summaryrefslogtreecommitdiffstats
path: root/admin/survey
diff options
context:
space:
mode:
Diffstat (limited to 'admin/survey')
-rw-r--r--admin/survey/Branching.php4631
-rw-r--r--admin/survey/BranchingAjax.php430
-rw-r--r--admin/survey/Glasovanje.php484
-rw-r--r--admin/survey/R/class.SurveyAnalysisR.php76
-rw-r--r--admin/survey/SurveyAdmin.php4331
-rw-r--r--admin/survey/SurveyAdminAjax.php2464
-rw-r--r--admin/survey/SurveyAdminSettings.php9103
-rw-r--r--admin/survey/ajax.php301
-rw-r--r--admin/survey/api/apidoc/index.html1338
-rw-r--r--admin/survey/api/class.ApiController.php3
-rw-r--r--admin/survey/api/class.ApiSurvey.php122
-rw-r--r--admin/survey/classes/class.AppSettings.php195
-rw-r--r--admin/survey/classes/class.ArchiveSurveys.php345
-rw-r--r--admin/survey/classes/class.Cache.php85
-rw-r--r--admin/survey/classes/class.Common.php220
-rw-r--r--admin/survey/classes/class.Dostop.php450
-rw-r--r--admin/survey/classes/class.Forum.php190
-rw-r--r--admin/survey/classes/class.GDPR.php1208
-rw-r--r--admin/survey/classes/class.GlobalMisc.php8
-rw-r--r--admin/survey/classes/class.HashUrl.php9
-rw-r--r--admin/survey/classes/class.Help.php195
-rw-r--r--admin/survey/classes/class.Library.php722
-rw-r--r--admin/survey/classes/class.LibraryBranching.php1193
-rw-r--r--admin/survey/classes/class.NewSurvey.php508
-rw-r--r--admin/survey/classes/class.Notifications.php310
-rw-r--r--admin/survey/classes/class.Prevajanje.php374
-rw-r--r--admin/survey/classes/class.RecodeValues.php96
-rw-r--r--admin/survey/classes/class.Setting.php2
-rw-r--r--admin/survey/classes/class.SurveyAapor.php2
-rw-r--r--admin/survey/classes/class.SurveyAktivnost.php518
-rw-r--r--admin/survey/classes/class.SurveyAppendMerge.php937
-rw-r--r--admin/survey/classes/class.SurveyCheck.php346
-rw-r--r--admin/survey/classes/class.SurveyComments.php1866
-rw-r--r--admin/survey/classes/class.SurveyCondition.php51
-rw-r--r--admin/survey/classes/class.SurveyConditionProfiles.php218
-rw-r--r--admin/survey/classes/class.SurveyConnect.php27
-rw-r--r--admin/survey/classes/class.SurveyCopy.php411
-rw-r--r--admin/survey/classes/class.SurveyCustomReport.php671
-rw-r--r--admin/survey/classes/class.SurveyDataSettingProfiles.php900
-rw-r--r--admin/survey/classes/class.SurveyDiagnostics.php646
-rw-r--r--admin/survey/classes/class.SurveyExport.php387
-rw-r--r--admin/survey/classes/class.SurveyExportProfiles.php2
-rw-r--r--admin/survey/classes/class.SurveyInfo.php216
-rw-r--r--admin/survey/classes/class.SurveyInpect.php175
-rw-r--r--admin/survey/classes/class.SurveyList.php1561
-rw-r--r--admin/survey/classes/class.SurveyListFolders.php1206
-rw-r--r--admin/survey/classes/class.SurveyMissingProfiles.php231
-rw-r--r--admin/survey/classes/class.SurveyMissingValues.php75
-rw-r--r--admin/survey/classes/class.SurveyParaAnalysis.php496
-rw-r--r--admin/survey/classes/class.SurveyParaGraph.php128
-rw-r--r--admin/survey/classes/class.SurveyPostProcess.php202
-rw-r--r--admin/survey/classes/class.SurveyQuotas.php231
-rw-r--r--admin/survey/classes/class.SurveyRecoding.php101
-rw-r--r--admin/survey/classes/class.SurveyReminderTracking.php5
-rw-r--r--admin/survey/classes/class.SurveyRespondents.php6
-rw-r--r--admin/survey/classes/class.SurveySetting.php10
-rw-r--r--admin/survey/classes/class.SurveySkupine.php143
-rw-r--r--admin/survey/classes/class.SurveyStaticHtml.php872
-rw-r--r--admin/survey/classes/class.SurveyStatistic.php1361
-rw-r--r--admin/survey/classes/class.SurveyStatisticProfiles.php2
-rw-r--r--admin/survey/classes/class.SurveyStatusCasi.php57
-rw-r--r--admin/survey/classes/class.SurveyStatusProfiles.php412
-rw-r--r--admin/survey/classes/class.SurveyTelephone.php685
-rw-r--r--admin/survey/classes/class.SurveyTextAnalysis.php4
-rw-r--r--admin/survey/classes/class.SurveyTheme.php519
-rw-r--r--admin/survey/classes/class.SurveyThemeEditor.php227
-rw-r--r--admin/survey/classes/class.SurveyTimeProfiles.php209
-rw-r--r--admin/survey/classes/class.SurveyUrlLinks.php68
-rw-r--r--admin/survey/classes/class.SurveyUsableResp.php27
-rw-r--r--admin/survey/classes/class.SurveyUserSession.php13
-rw-r--r--admin/survey/classes/class.SurveyUserSetting.php10
-rw-r--r--admin/survey/classes/class.SurveyVariableView.php28
-rw-r--r--admin/survey/classes/class.SurveyVariablesProfiles.php203
-rw-r--r--admin/survey/classes/class.SurveyZankaProfiles.php190
-rw-r--r--admin/survey/classes/class.SurveyZoom.php354
-rw-r--r--admin/survey/classes/class.User.php47
-rw-r--r--admin/survey/classes/class.UserSetting.php4
-rw-r--r--admin/survey/classes/class.Vprasanje.php6175
-rw-r--r--admin/survey/classes/class.VprasanjeDeleted.php185
-rw-r--r--admin/survey/classes/class.VprasanjeInline.php55
-rw-r--r--admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php2
-rw-r--r--admin/survey/classes/log/class.SurveyLog.php2
-rw-r--r--admin/survey/classes/mobile/class.MobileSurveyAdmin.php599
-rw-r--r--admin/survey/classes/objects/obj.MailAdapter.php160
-rw-r--r--admin/survey/classes/objects/obj.PopUp.php39
-rw-r--r--admin/survey/classes/objects/obj.PopUpButton.php21
-rw-r--r--admin/survey/classes/objects/obj.PopUpCancelButton.php1
-rw-r--r--admin/survey/classes/objects/obj.SpremenljivkaSkala.php4
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_10.datbin0 -> 204 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_11.datbin0 -> 210 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_12.datbin0 -> 222 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_13.datbin0 -> 223 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_14.datbin0 -> 227 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_15.datbin0 -> 242 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_16.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_17.datbin0 -> 237 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_18.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_19.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_20.datbin0 -> 250 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_21.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_22.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_23.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_24.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_25.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_26.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_27.datbin0 -> 284 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_28.datbin0 -> 318 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_29.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_30.datbin0 -> 324 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_31.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_32.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_33.dat14
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_34.datbin0 -> 331 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_35.datbin0 -> 342 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_36.datbin0 -> 370 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_37.datbin0 -> 376 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_38.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_39.datbin0 -> 404 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_4.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_40.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_6.datbin0 -> 132 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_7.datbin0 -> 196 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_8.datbin0 -> 201 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/frame_9.datbin0 -> 206 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_101_0.datbin0 -> 157 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_105_0.datbin0 -> 162 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_109_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_113_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_117_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_121_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_125_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_129_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_133_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_137_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_141_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_145_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_149_0.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_153_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_157_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_161_0.datbin0 -> 241 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_165_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_169_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_173_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_177_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_21_0.datbin0 -> 48 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_25_0.datbin0 -> 57 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_29_0.datbin0 -> 59 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_33_0.datbin0 -> 62 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_37_0.datbin0 -> 65 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_41_0.datbin0 -> 68 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_45_0.datbin0 -> 106 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_49_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_53_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_57_0.dat4
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_61_0.datbin0 -> 119 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_65_0.datbin0 -> 123 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_69_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_73_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_77_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_81_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_85_0.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_89_0.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_93_0.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_0/mask_97_0.datbin0 -> 150 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_101_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_105_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_109_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_113_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_117_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_121_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_125_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_129_1.datbin0 -> 164 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_133_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_137_1.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_141_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_145_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_149_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_153_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_157_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_161_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_165_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_169_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_173_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_177_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_21_1.datbin0 -> 42 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_25_1.datbin0 -> 48 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_29_1.datbin0 -> 50 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_33_1.datbin0 -> 53 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_37_1.datbin0 -> 56 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_41_1.datbin0 -> 58 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_45_1.datbin0 -> 82 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_49_1.datbin0 -> 84 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_53_1.datbin0 -> 87 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_57_1.datbin0 -> 92 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_61_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_65_1.datbin0 -> 99 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_69_1.datbin0 -> 102 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_73_1.datbin0 -> 104 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_77_1.datbin0 -> 110 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_81_1.datbin0 -> 114 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_85_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_89_1.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_93_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_1/mask_97_1.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_101_2.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_105_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_109_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_113_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_117_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_121_2.datbin0 -> 127 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_125_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_129_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_133_2.dat10
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_137_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_141_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_145_2.dat4
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_149_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_153_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_157_2.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_161_2.datbin0 -> 190 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_165_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_169_2.datbin0 -> 196 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_173_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_177_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_21_2.datbin0 -> 35 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_25_2.datbin0 -> 41 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_29_2.datbin0 -> 45 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_33_2.datbin0 -> 47 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_37_2.datbin0 -> 47 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_41_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_45_2.datbin0 -> 68 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_49_2.datbin0 -> 70 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_53_2.datbin0 -> 73 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_57_2.datbin0 -> 76 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_61_2.datbin0 -> 78 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_65_2.datbin0 -> 89 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_69_2.datbin0 -> 88 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_73_2.datbin0 -> 94 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_77_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_81_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_85_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_89_2.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_93_2.datbin0 -> 103 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_2/mask_97_2.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_101_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_105_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_109_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_113_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_117_3.dat4
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_121_3.datbin0 -> 212 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_125_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_129_3.dat8
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_133_3.datbin0 -> 216 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_137_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_141_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_145_3.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_149_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_153_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_157_3.datbin0 -> 248 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_161_3.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_165_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_169_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_173_3.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_177_3.datbin0 -> 312 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_21_3.datbin0 -> 60 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_25_3.datbin0 -> 75 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_29_3.datbin0 -> 75 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_33_3.datbin0 -> 79 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_37_3.datbin0 -> 83 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_41_3.datbin0 -> 85 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_45_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_49_3.datbin0 -> 127 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_53_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_57_3.datbin0 -> 126 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_61_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_65_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_69_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_73_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_77_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_81_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_85_3.datbin0 -> 160 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_89_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_93_3.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_3/mask_97_3.datbin0 -> 175 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_101_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_105_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_109_4.datbin0 -> 182 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_113_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_117_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_121_4.datbin0 -> 208 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_125_4.datbin0 -> 213 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_129_4.datbin0 -> 220 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_133_4.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_137_4.datbin0 -> 248 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_141_4.datbin0 -> 254 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_145_4.datbin0 -> 255 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_149_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_153_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_157_4.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_161_4.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_165_4.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_169_4.datbin0 -> 297 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_173_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_177_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_21_4.datbin0 -> 57 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_25_4.datbin0 -> 76 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_29_4.datbin0 -> 78 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_33_4.datbin0 -> 89 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_37_4.datbin0 -> 86 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_41_4.datbin0 -> 89 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_45_4.datbin0 -> 120 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_49_4.datbin0 -> 124 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_53_4.datbin0 -> 128 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_57_4.datbin0 -> 130 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_61_4.datbin0 -> 132 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_65_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_69_4.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_73_4.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_77_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_81_4.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_85_4.datbin0 -> 154 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_89_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_93_4.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_4/mask_97_4.datbin0 -> 176 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_101_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_105_5.datbin0 -> 224 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_109_5.datbin0 -> 211 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_113_5.dat9
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_117_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_121_5.datbin0 -> 256 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_125_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_129_5.datbin0 -> 259 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_133_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_137_5.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_141_5.datbin0 -> 297 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_145_5.datbin0 -> 300 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_149_5.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_153_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_157_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_161_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_165_5.datbin0 -> 332 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_169_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_173_5.dat4
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_177_5.dat11
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_21_5.datbin0 -> 74 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_25_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_29_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_33_5.datbin0 -> 106 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_37_5.datbin0 -> 103 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_41_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_45_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_49_5.datbin0 -> 146 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_53_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_57_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_61_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_65_5.datbin0 -> 163 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_69_5.datbin0 -> 167 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_73_5.datbin0 -> 184 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_77_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_81_5.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_85_5.datbin0 -> 186 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_89_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_93_5.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_5/mask_97_5.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_101_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_105_6.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_109_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_113_6.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_117_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_121_6.datbin0 -> 309 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_125_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_129_6.datbin0 -> 310 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_133_6.datbin0 -> 296 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_137_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_141_6.dat10
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_145_6.datbin0 -> 357 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_149_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_153_6.datbin0 -> 367 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_157_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_161_6.datbin0 -> 399 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_165_6.datbin0 -> 400 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_169_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_173_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_177_6.dat14
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_21_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_25_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_29_6.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_33_6.datbin0 -> 124 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_37_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_41_6.datbin0 -> 132 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_45_6.datbin0 -> 189 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_49_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_53_6.datbin0 -> 195 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_57_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_61_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_65_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_69_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_73_6.datbin0 -> 230 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_77_6.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_81_6.dat3
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_85_6.datbin0 -> 229 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_89_6.datbin0 -> 263 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_93_6.datbin0 -> 276 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_6/mask_97_6.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_101_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_105_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_109_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_113_7.dat11
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_117_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_121_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_125_7.datbin0 -> 288 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_129_7.datbin0 -> 282 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_133_7.datbin0 -> 281 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_137_7.dat5
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_141_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_145_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_149_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_153_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_157_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_161_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_165_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_169_7.datbin0 -> 383 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_173_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_177_7.datbin0 -> 407 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_21_7.dat4
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_25_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_29_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_33_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_37_7.datbin0 -> 122 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_41_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_45_7.datbin0 -> 173 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_49_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_53_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_57_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_61_7.dat2
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_65_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_69_7.datbin0 -> 202 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_73_7.datbin0 -> 221 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_77_7.datbin0 -> 226 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_81_7.dat1
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_85_7.datbin0 -> 213 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_89_7.datbin0 -> 244 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_93_7.datbin0 -> 248 bytes
-rw-r--r--admin/survey/classes/phpqrcode/cache/mask_7/mask_97_7.dat2
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php6443
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyAnalysisArchive.php570
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php88
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyBreak.php783
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyChart.php1125
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php977
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php24
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyMeans.php368
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php363
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyTTest.php309
-rw-r--r--admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php229
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataCollect.php490
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataDisplay.php2106
-rw-r--r--admin/survey/classes/surveyData/class.SurveyDataFile.php7
-rw-r--r--admin/survey/classes/surveyData/class.SurveySNDataFile.php20
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyAlert.php43
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php4561
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyInvitationsOld.php10670
-rw-r--r--admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php4
-rw-r--r--admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php9
-rw-r--r--admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php15
-rw-r--r--admin/survey/classes/tracking/CrossRoad.php432
-rw-r--r--admin/survey/classes/tracking/TrackingClass.php242
-rw-r--r--admin/survey/classes/tracking/UserTrackingClass.php20
-rw-r--r--admin/survey/css/print.css99
-rw-r--r--admin/survey/definition.php56
-rw-r--r--admin/survey/export/class.ExportController.php8
-rw-r--r--admin/survey/export/export_definitions.php37
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaBreak.php219
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaCReport.php62
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaCharts.php22
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php293
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaDesc.php46
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaFreq.php85
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaMean.php76
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php362
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaSums.php748
-rw-r--r--admin/survey/export/latexclasses/Analize/AnalizaTTest.php141
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php55
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/DatumLatex.php27
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php180
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php59
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php2
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php4
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php4
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php895
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php13
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php231
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php132
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/SNImena.php4
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php127
-rw-r--r--admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php41
-rw-r--r--admin/survey/export/latexclasses/class.LatexAnalysis.php26
-rw-r--r--admin/survey/export/latexclasses/class.LatexAnalysisElement.php598
-rw-r--r--admin/survey/export/latexclasses/class.LatexDocument.php686
-rw-r--r--admin/survey/export/latexclasses/class.LatexEditsAnalysis.php263
-rw-r--r--admin/survey/export/latexclasses/class.LatexStatus.php494
-rw-r--r--admin/survey/export/latexclasses/class.LatexSurvey.php682
-rw-r--r--admin/survey/export/latexclasses/class.LatexSurveyElement.php1416
-rw-r--r--admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisAndOtherLandscape.cls26
-rw-r--r--admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisPortrait.cls22
-rw-r--r--admin/survey/export/latexclasses/textemp/latexTemplatePdfSurvey.cls155
-rw-r--r--admin/survey/export/xmlClasses/class.XmlSurvey.php4
-rw-r--r--admin/survey/export/xmlClasses/class.XmlSurveyElement.php3
-rw-r--r--admin/survey/img_new/jazvem.pngbin0 -> 23099 bytes
-rw-r--r--admin/survey/index.php71
-rw-r--r--admin/survey/izvoz.php80
-rw-r--r--admin/survey/minify/.htaccess26
-rw-r--r--admin/survey/minify/.php_cs44
-rw-r--r--admin/survey/minify/.semver6
-rw-r--r--admin/survey/minify/.travis.yml19
-rw-r--r--admin/survey/minify/CHANGELOG.md142
-rw-r--r--admin/survey/minify/bootstrap.php2
-rw-r--r--admin/survey/minify/builder/.htaccess4
-rw-r--r--admin/survey/minify/builder/index.php2
-rw-r--r--admin/survey/minify/builder/ocCheck.php3
-rw-r--r--admin/survey/minify/builder/test.php4
-rw-r--r--admin/survey/minify/composer.json19
-rw-r--r--admin/survey/minify/config-test.php3
-rw-r--r--admin/survey/minify/groupsConfig.php13
-rw-r--r--admin/survey/minify/index.php4
-rw-r--r--admin/survey/minify/lib/HTTP/ConditionalGet.php4
-rw-r--r--admin/survey/minify/lib/HTTP/Encoder.php18
-rw-r--r--admin/survey/minify/lib/Minify.php7
-rw-r--r--admin/survey/minify/lib/Minify/App.php6
-rw-r--r--admin/survey/minify/lib/Minify/CSSmin.php12
-rw-r--r--admin/survey/minify/lib/Minify/Cache/Null.php2
-rw-r--r--admin/survey/minify/lib/Minify/Cache/WinCache.php2
-rw-r--r--admin/survey/minify/lib/Minify/Controller/Files.php1
-rw-r--r--admin/survey/minify/lib/Minify/Controller/Groups.php1
-rw-r--r--admin/survey/minify/lib/Minify/Controller/Page.php1
-rw-r--r--admin/survey/minify/lib/Minify/ControllerInterface.php2
-rw-r--r--admin/survey/minify/lib/Minify/HTML.php59
-rw-r--r--admin/survey/minify/lib/Minify/ImportProcessor.php4
-rw-r--r--admin/survey/minify/lib/Minify/JS/ClosureCompiler.php4
-rw-r--r--admin/survey/minify/lib/Minify/NailgunClosureCompiler.php2
-rw-r--r--admin/survey/minify/lib/Minify/Source/Factory.php2
-rw-r--r--admin/survey/minify/lib/Minify/YUICompressor.php1
-rw-r--r--admin/survey/minify/lib/MrClay/Cli.php1
-rw-r--r--admin/survey/minify/phpunit.xml4
-rw-r--r--admin/survey/minify/server-info.php3
-rw-r--r--admin/survey/minify/static/.htaccess80
-rw-r--r--admin/survey/minify/static/gen.php4
-rw-r--r--admin/survey/minify/static/lib.php12
-rw-r--r--admin/survey/minify/utils.php2
-rw-r--r--admin/survey/modules/mod_360_1KA/class.Survey3601ka.php4
-rw-r--r--admin/survey/modules/mod_MAZA/class.MAZA.php13
-rw-r--r--admin/survey/modules/mod_MAZA/js/MAZA.js2
-rw-r--r--admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php4
-rw-r--r--admin/survey/modules/mod_WPN/class.WPN.php1
-rw-r--r--admin/survey/modules/mod_WPN/frontend/index.html392
-rw-r--r--admin/survey/modules/mod_WPN/frontend/index1.html720
-rw-r--r--admin/survey/modules/mod_WPN/frontend/ui.html208
-rw-r--r--admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php24
-rw-r--r--admin/survey/modules/mod_advanced_timestamps/class.SurveyAdvancedTimestamps.php238
-rw-r--r--admin/survey/modules/mod_chat/class.SurveyChat.php49
-rw-r--r--admin/survey/modules/mod_email_access/class.SurveyEmailAccess.php280
-rw-r--r--admin/survey/modules/mod_email_access/disposable_email_blocklist.txt3474
-rw-r--r--admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php36
-rw-r--r--admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php33
-rw-r--r--admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php2
-rw-r--r--admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php13
-rw-r--r--admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php9
-rw-r--r--admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php3
-rw-r--r--admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php12
-rw-r--r--admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php3
-rw-r--r--admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css2
-rw-r--r--admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js10
-rw-r--r--admin/survey/modules/mod_kakovost/R/kakovost.R376
-rw-r--r--admin/survey/modules/mod_kakovost/class.SurveyKakovost.php12
-rw-r--r--admin/survey/modules/mod_panel/class.SurveyPanel.php108
-rw-r--r--admin/survey/modules/mod_quiz/class.SurveyQuiz.php67
-rw-r--r--admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php4
-rw-r--r--admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php9
-rw-r--r--admin/survey/modules/mod_voting/class.SurveyVoting.php14
-rw-r--r--admin/survey/pChart/classes/class.MyHorBar.php883
-rw-r--r--admin/survey/pChart/classes/class.pChart.php33
-rw-r--r--admin/survey/pChart/classes/class.pData.php4
-rw-r--r--admin/survey/parapodatki.php28
-rw-r--r--admin/survey/public.php112
-rw-r--r--admin/survey/redesign_test.php311
-rw-r--r--admin/survey/redesign_test_narrow.php113
-rw-r--r--admin/survey/script/Chartjs.js28
-rw-r--r--admin/survey/script/Chartjs/chart.js13
-rw-r--r--admin/survey/script/DragDrop/dragdropInAdmin.js16
-rw-r--r--admin/survey/script/GDPR.js102
-rw-r--r--admin/survey/script/Maps/VnaprejMarkers.js2
-rw-r--r--admin/survey/script/appendMerge.js34
-rw-r--r--admin/survey/script/branching.js461
-rw-r--r--admin/survey/script/break.js36
-rw-r--r--admin/survey/script/cReport.js87
-rw-r--r--admin/survey/script/calendar/calendar.js2
-rw-r--r--admin/survey/script/charts.js8
-rw-r--r--admin/survey/script/collectData.js2
-rw-r--r--admin/survey/script/comments.js198
-rw-r--r--admin/survey/script/conditionProfiles.js4
-rw-r--r--admin/survey/script/crosstab.js46
-rw-r--r--admin/survey/script/customizeImageView.js20
-rw-r--r--admin/survey/script/dataSettingProfiles.js6
-rw-r--r--admin/survey/script/datatables/jquery.dataTables.min.css2
-rw-r--r--admin/survey/script/datepicker.js6
-rw-r--r--admin/survey/script/domainChange.js28
-rw-r--r--admin/survey/script/dostop.js2
-rw-r--r--admin/survey/script/folders.js4
-rw-r--r--admin/survey/script/inspect.js2
-rw-r--r--admin/survey/script/invitations.js316
-rw-r--r--admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js7
-rw-r--r--admin/survey/script/js-lang.php35
-rw-r--r--admin/survey/script/library.js490
-rw-r--r--admin/survey/script/means.js21
-rw-r--r--admin/survey/script/missingProfiles.js4
-rw-r--r--admin/survey/script/missingValues.js6
-rw-r--r--admin/survey/script/mobile.js104
-rw-r--r--admin/survey/script/multiCrosstabs.js6
-rw-r--r--admin/survey/script/notifications.js63
-rw-r--r--admin/survey/script/postProcess.js165
-rw-r--r--admin/survey/script/progressBar.js10
-rw-r--r--admin/survey/script/quota.js38
-rw-r--r--admin/survey/script/script.js1597
-rw-r--r--admin/survey/script/script_analiza.js627
-rw-r--r--admin/survey/script/skupine.js12
-rw-r--r--admin/survey/script/slideshow.js4
-rw-r--r--admin/survey/script/statistika.js4
-rw-r--r--admin/survey/script/statusProfiles.js46
-rw-r--r--admin/survey/script/surveyCondition.js6
-rw-r--r--admin/survey/script/surveyList.js317
-rw-r--r--admin/survey/script/telephone.js64
-rw-r--r--admin/survey/script/themes.js68
-rw-r--r--admin/survey/script/timeProfiles.js4
-rw-r--r--admin/survey/script/ttest.js20
-rw-r--r--admin/survey/script/uporabniki_custom.js12
-rw-r--r--admin/survey/script/vprasanje.js377
-rw-r--r--admin/survey/script/vprasanjeDeleted.js86
-rw-r--r--admin/survey/script/vprasanjeInline.js470
-rw-r--r--admin/survey/script/zankaProfiles.js47
-rw-r--r--admin/survey/script/zoom.js31
-rw-r--r--admin/survey/unsubscribe.php5
645 files changed, 68925 insertions, 37983 deletions
diff --git a/admin/survey/Branching.php b/admin/survey/Branching.php
index 08ff025..6c48009 100644
--- a/admin/survey/Branching.php
+++ b/admin/survey/Branching.php
@@ -5,22 +5,8 @@ class Branching {
var $anketa; // trenutna anketa
var $grupa; // trenutna grupa
var $spremenljivka; // trenutna spremenljivka
- //var $SurveyAdmin = null; // globalna spremenljivka za SurveyAdmin // SurveyAdmin se nikjer vec ne klice iz Branchinga
-
- //var $sidebar; // ali prikazemo sidebar: 0-ne, 1-vprasanja, 2-library // sidebara nimamo vec
- //var $collapsed_content; // ali prikazujemo vseibno IFa (ce ne se poklice z ajaxom) // to se bo pa mogoce se uporabil, pri skrivanju ifov, zaenkrat se pa ne
var $skin = 0;
-
- // teh nastavitev se ne uporablja vec
- // tele nastavitve so tudi v BranchingAjax in jih je treba tudi tam popravit!
-
- //var $maxIfCount = 0; // koliko ifov je meja za prikaz. Če je 0 prikeže vse
- //var $autoRecount = 0; // ce je vec kot 50 spremenljivk nimamo avtomatskega prestevilcevanja
-
- //var $new = true; // spremenljivka za nov nacin prikaza ifov (s checkboxi), ker bo zihr treba se nazaj dajat... (v Branching.php in branching.js)
- //var $full_screen_edit = false; // Ali editiramo v full screen nacinu
-
var $expanded = false; // ali prikazujemo anketo razsirjeno (prikazan predogled vprasanja) ali skrceno (samo 1 vrstica za vprasanje)
var $db_table = '';
@@ -34,7 +20,7 @@ class Branching {
var $prevajanje = false;
var $imageadded = array();
- //$imageadded[$spremenljivka] = false;
+
/**
* @desc konstruktor
@@ -84,8 +70,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 +87,7 @@ class Branching {
}
/**
- * @desc inicializacija branchinga (samo prvi�, na za�etku), prepi�e vrstni red iz normalenga urejanja
+ * @desc inicializacija branchinga (samo prvic, na zacetku), prepise vrstni red iz normalenga urejanja
*/
function init_branching () {
@@ -147,44 +132,39 @@ class Branching {
$gl = new Glasovanje($this->anketa);
- //div z nastavitvami za glasovanje
- echo ' <div id="glas_settings">';
- //$this->display_glasovanje_settings();
+ // div z nastavitvami za glasovanje
+ echo ' <div class="glas_settings_holder">';
+ echo ' <div id="glas_settings">';
$gl->display_glasovanje_settings();
- echo ' </div> <!-- /glas_settings -->';
+ echo ' </div>';
+ echo ' </div>';
echo '<div id="placeholder">';
- echo '<div id="branching" class="branching_new expanded branching_glasovanje">';
-
- //$this->branching_struktura();
+ echo ' <div id="branching" class="branching_new expanded branching_glasovanje">';
$gl = new Glasovanje($this->anketa);
$gl->vprasanja();
+ echo ' </div>'; // #branching
- echo '</div>'; // #branching
-
- //$this->vprasanje_float_editing();
- echo '<div id="vprasanje_float_editing" class="float_glasovanje"></div>';
+ echo ' <div id="vprasanje_float_editing" class="float_glasovanje"></div>';
echo '</div>'; // #placeholder
-
- $this->toolbox();
}
// Navadna anketa ali forma
else{
+
+ Common::Init($this->anketa);
+
echo '<div id="placeholder">';
- echo '<div id="branching" class="branching_new'.($this->expanded?' expanded':' collapsed').($this->survey_type==1?' branching_forma':'').'">';
-
- Common::Init($this->anketa);
+ echo ' <div id="branching" class="branching_new'.($this->expanded?' expanded':' collapsed').($this->survey_type==1?' branching_forma':'').'">';
echo Common::checkStruktura();
$this->branching_struktura();
+ echo ' </div>';
- echo '</div>'; // #branching
-
- $this->vprasanje_float_editing();
+ echo ' <div id="vprasanje_float_editing"></div>';
echo '</div>'; // #placeholder
@@ -192,11 +172,11 @@ class Branching {
}
// forma in glasovanje - hitre nastavitve na desni - ce imamo odprto knjiznico ne prikazemo zaradi prekrivanja
- if ( ($this->survey_type == 1 || $this->survey_type == 0) && ($row['toolbox'] < 3) ) {
+ if ( $this->survey_type == 1 || $this->survey_type == 0 ) {
echo '<div id="quick_settings_holder" '.($this->survey_type==0 ? ' class="glas_quick_settings"':'').'>';
- echo '<div id="quick_settings" '.($this->survey_type==0 ? ' class="glas_quick_settings"':'').'>';
+ echo ' <div id="quick_settings" '.($this->survey_type==0 ? ' class="glas_quick_settings"':'').'>';
$this->toolbox_settings();
- echo '</div>';
+ echo ' </div>';
echo '</div>';
}
@@ -208,33 +188,9 @@ class Branching {
}
?><script> var vprasanje_tracking = <?=$row['vprasanje_tracking']?>; </script><?php
-
- /*echo '<script>';
- echo 'alert(document.getElementsByTagName("*").length);';
- echo '</script>';*/
-
}
- function vprasanje_float_editing () {
-
- echo '<div id="vprasanje_float_editing"></div>';
-
- }
-
- /**
- * prikaze zgornji toolbox z nastavitvami
- *
- */
- /*function toolbox_nastavitve () {
-
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<div id="toolbox_nastavitve"'.($row['toolbox']>=3?' class="library"':'').'>';
- $this->display_toolbox_nastavitve();
- echo '</div>';
- }*/
-
/**
* prikaze zgornji toolbox z nastavitvami
*
@@ -259,49 +215,6 @@ class Branching {
$full_view = (int)$row_query_fv['full_view'] == 1 ? true : false;
$full_view = true;
- echo '<div class="floatLeft">';
- # skrčen / razširjen
- if ($this->expanded) {
- echo '<span title="'.$lang['srv_expanded_1'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=expanded&value=0"><span class="faicon expanded"></span>'.$lang['srv_expanded_0_short'].'</a></span> ';
- $sqle = sisplet_query("SELECT count(*) AS c FROM srv_branching WHERE ank_id='$this->anketa'");
- $rowe = mysqli_fetch_array($sqle);
- if ($rowe['c'] > 15 && !isset($_COOKIE['expanded']))
- echo '<span class="expanded-tooltip top">'.$lang['srv_expaned_text'].' <a href="#" onclick="$(this).closest(\'.expanded-tooltip\').hide(); var d = new Date(); d.setDate(d.getDate()+30); document.cookie=\'expanded=1;expires=\'+d.toUTCString(); return false;" class="close">'.$lang['srv_zapri'].'</a><span class="arrow"></span></span>';
- } else {
- echo '<span title="'.$lang['srv_expanded_0'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=expanded&value=1"><span class="faicon compress"></span>'.$lang['srv_expanded_0_short'].'</a></span> ';
- }
- echo Help::display('srv_branching_expanded');
-
- echo '</div>';
-
-
- echo '<div class="floatRight">';
-
- # find & replace
- if ($row['locked'] == 0) {
- echo '<a href="#" onclick="find_replace(); return false;" title="'.$lang['srv_find_replace'].'" ><span class="faicon replace"></span></a>';
- }
-
- if ($row['locked'] == 0 && $full_view == true) {
- echo '<a href="#" onclick="javascript:pagebreak_all(); return false;" title="'.$lang['srv_pagebreak_all'].'"><span class="faicon paragraph"></span></a> '."\n";
- }
-
- # Hrošč je viden samo če imamo ife in razširjen pogled
- if ($row['locked'] == 0 && $full_view == true) { // if ($row['flat'] == 0)
- echo '<a href="#" onclick="check_pogoji(); return false;" title="'.$lang['srv_check_pogoji'].'"><span class="faicon bug"></span></a> '."\n";
- }
-
- if ($row['locked'] == 0 && $full_view == true) {
- echo '<a href="#" onclick="prestevilci(); return false;"><span class="faicon hashtag" title="'.$lang['srv_grupe_recount_branching'].'"></span></a>' . Help :: display('srv_grupe_recount_branching') ."\n";
- }
-
- if ($has_if == true && $full_view == true || ($has_if == true && $this->expanded == false)) {
- echo '<a href="#" onClick="expandCollapseAllPlusMinus(\'expand\'); return false;"><span class="faicon plus_square" title="'.$lang['srv_expand'].'"></span></a>'."\n";
- echo '<a href="#" onClick="expandCollapseAllPlusMinus(\'collapse\'); return false;"><span class="faicon minus_square" title="'.$lang['srv_collapse'].'"></span></a>'."\n";
- }
-
- echo '</div>';
-
// prikaz blokov kot zavihke
echo '<div class="blockSwitch">';
$sql = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red");
@@ -336,20 +249,20 @@ class Branching {
*
*/
function toolbox () {
-
+
$row = SurveyInfo::getInstance()->getSurveyRow();
- if($this->survey_type != 0)
- $this->toolbox_basic2();
+ echo '<div class="toolbox_holder open">';
+
+ $this->toolbox_basic2();
+
+ echo '<script> $(function(){ init_toolbox(); }) </script>';
- if ($row['toolbox'] >= 3)
- $this->toolbox_library();
+ // Predpregled tipa vprašanj
+ $this->getTipPreviewHtml();
+
+ echo '</div>';
- ?><script>
- $(function () {
- init_toolbox();
- });
- </script><?php
// Mobile add question
MobileSurveyAdmin::displayAddQuestion($this->anketa);
@@ -367,96 +280,134 @@ class Branching {
$this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type");
$hierarhija = SurveyInfo::getInstance()->checkSurveyModule('hierarhija');
- // Toolbox napredne nastavitve (prestevilci, dodaj prelome, debug...)
- if($this->survey_type > 1 && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija') ){
-
- echo '<div id="toolbox_advanced_settings">';
-
- echo '<span class="faicon icon-blue wheel_32"></span>';
-
- $this->toolbox_add_advanced_settings();
-
- echo '</div>';
- }
-
- echo '<div id="toolbox_basic"'.($this->survey_type==1?' class="forma"':'').($hierarhija ? ' class="toolbox-hierarhija"' : '').'>';
+ echo '<div id="toolbox_basic" class="toolbox '.($this->survey_type==1?' forma':'').($hierarhija ? ' toolbox-hierarhija' : '').'">';
if ($row['locked'] == 1) {
- // Ce ima uporabnik prepreceno moznost odklepanja ankete
$d = new Dostop();
- if(($hierarhija && SurveyInfo::getSurveyModules('hierarhija') == 2) || $d->checkDostopSub('lock') && ($admin_type != 0 && $admin_type != 1)){
+
+ // Ce ima uporabnik prepreceno moznost odklepanja ankete
+ $prevent_unlock = 0;
+ if(SurveyInfo::getSurveyModules('hierarhija') == 2 || (!$d->checkDostopSub('lock') && $row['locked'] == 1 && $admin_type != 0 && $admin_type != 1))
+ $prevent_unlock = 1;
+
+ if($prevent_unlock == 1){
echo '<div id="locked_toolbar">';
- echo '<span class="sprites lock_big"></span>';
+ echo ' <span class="sprites lock_big"></span>';
echo '</div>';
}
else{
- //echo '<a href="#" title="'.$lang['srv_anketa_locked_1'].'" onclick="javascript:anketa_lock(\''.$this->anketa.'\', \'0\');"><p style="text-align:center" ><span class="sprites lock_close_white"></span></p></a>';
echo '<div id="locked_toolbar">';
- echo '<span class="sprites lock_big pointer" onclick="javascript:anketa_lock(\''.$this->anketa.'\', \'0\', \''.$row['mobile_created'].'\');"></span>';
+ echo ' <span class="sprites lock_big pointer" onclick="javascript:anketa_lock(\''.$this->anketa.'\', \'0\', \''.$row['mobile_created'].'\');"></span>';
echo '</div>';
}
if(!$hierarhija) {
- echo '<p class="new_spr" tip="1"><span class="faicon icon-white radio_32"></span></p>';
- echo '<p class="new_spr" tip="2"><span class="faicon icon-white check_32"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="1"><span class="item_icon faicon icon-white radio_32"></span> <span class="item_text">'.$lang['srv_vprasanje_radio'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
+
+ echo '<div class="toolbox_item new_spr" tip="2"><span class="item_icon faicon icon-white check_32"></span> <span class="item_text">'.$lang['srv_vprasanje_checkbox'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
}
- echo '<p class="new_spr" tip="6"><span class="faicon icon-white matrix_32"></span></p>';
- echo '<p class="new_spr" tip="21"><span class="faicon icon-white abc_32"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="6"><span class="item_icon faicon icon-white matrix_32"></span> <span class="item_text">'.$lang['srv_vprasanje_multigrid'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
- if(!$hierarhija)
- echo '<p class="new_spr" tip="7"><span class="faicon icon-white number_32"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="21"><span class="item_icon faicon icon-white abc_32"></span> <span class="item_text">'.$lang['srv_vprasanje_text'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
- echo '<p class="new_spr" tip="5"><span class="faicon icon-white nagovor"></span></p>';
+ if(!$hierarhija){
+ echo '<div class="toolbox_item new_spr" tip="7"><span class="item_icon faicon icon-white number_32"></span> <span class="item_text">'.$lang['srv_vprasanje_number'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
+ }
+
+ echo '<div class="toolbox_item new_spr" tip="5"><span class="item_icon faicon icon-white nagovor"></span> <span class="item_text">'.$lang['srv_vprasanje_label'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
if(!$hierarhija) {
- echo '<div class="new_adv"><span class="faicon icon-white plus_32"></span>';
+ echo '<div class="toolbox_item new_adv"><span class="item_icon faicon icon-white plus_32"></span> <span class="item_text">'.$lang['srv_mobile_add_question'].'</span>';
$this->toolbox_add_advanced();
echo '</div>';
+
+ echo '<div class="toolbox_border"></div>';
}
+ // Knjiznica
+ echo '<div class="toolbox_item open_lib"><span class="item_icon faicon library"></span><span class="item_text">'.$lang['srv_library'].'</span></div>';
+ echo '<div class="toolbox_border open_lib"></div>';
+
// normalna anketa
if ($this->survey_type != 1){
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
- echo '<p class="new_if '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" tip="9999"><span class="faicon icon-white if_32"></span></p>';
- echo '<p class="new_block '.(!$userAccess->checkUserAccess($what='block') ? 'user_access_locked' : '').'" tip="9998"><span class="faicon icon-white block_32"></span></p>';
- }
+ echo '<div class="toolbox_item new_if '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" tip="9999"><span class="item_icon faicon icon-white if_32"></span> <span class="item_text">'.$lang['srv_condition'].'</span></div>';
+ echo '<div class="toolbox_border new_if"></div>';
+
+ echo '<div class="toolbox_item new_block '.(!$userAccess->checkUserAccess($what='block') ? 'user_access_locked' : '').'" tip="9998"><span class="item_icon faicon icon-white block_32"></span> <span class="item_text">'.$lang['srv_block_random_blocks'].'</span></div>';
+ }
+
+ // Pobrisana vprasanja
+ $vd = new VprasanjeDeleted($this->anketa);
+ $deleted_vrasanja_count = $vd->countDeletedVprasanja();
+ echo '<div id="vprasanje_deleted_border" class="toolbox_border '.($deleted_vrasanja_count == 0 ? 'displayNone' : '').'"></div>';
+ echo '<div id="vprasanje_deleted_toolbox" class="toolbox_item open_deleted '.($deleted_vrasanja_count == 0 ? 'displayNone' : '').'"><span class="item_icon faicon delete"></span><span class="item_text">'.$lang['srv_deleted_vprasanja'].' (<span id="vprasanje_deleted_count">'.$deleted_vrasanja_count.'</span>)</span></div>';
}
else {
if(!$hierarhija) {
- echo '<p class="new_spr" tip="1"><span class="faicon icon-white radio_32"></span></p>';
- echo '<p class="new_spr" tip="2"><span class="faicon icon-white check_32"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="1"><span class="item_icon faicon icon-white radio_32"></span> <span class="item_text">'.$lang['srv_vprasanje_radio'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
+
+ echo '<div class="toolbox_item new_spr" tip="2"><span class="item_icon faicon icon-white check_32"></span> <span class="item_text">'.$lang['srv_vprasanje_checkbox'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
}
- echo '<p class="new_spr" tip="6"><span class="faicon icon-white matrix_32"></span></p>';
- echo '<p class="new_spr" tip="21"><span class="faicon icon-white abc_32"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="6"><span class="item_icon faicon icon-white matrix_32"></span> <span class="item_text">'.$lang['srv_vprasanje_multigrid'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
+
+ echo '<div class="toolbox_item new_spr" tip="21"><span class="item_icon faicon icon-white abc_32"></span> <span class="item_text">'.$lang['srv_vprasanje_text'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
- if(!$hierarhija)
- echo '<p class="new_spr" tip="7"><span class="faicon icon-white number_32"></span></p>';
+ if(!$hierarhija){
+ echo '<div class="toolbox_item new_spr" tip="7"><span class="item_icon faicon icon-white number_32"></span> <span class="item_text">'.$lang['srv_vprasanje_number'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
+ }
- echo '<p class="new_spr" tip="5"><span class="faicon icon-white nagovor"></span></p>';
+ echo '<div class="toolbox_item new_spr" tip="5"><span class="item_icon faicon icon-white nagovor"></span> <span class="item_text">'.$lang['srv_vprasanje_label'].'</span></div>';
+ echo '<div class="toolbox_border"></div>';
if(!$hierarhija) {
- echo '<div class="new_adv"><span class="faicon icon-white plus_32"></span>';
+ echo '<div class="toolbox_item new_adv"><span class="item_icon faicon icon-white plus_32"></span> <span class="item_text">'.$lang['srv_mobile_add_question'].'</span>';
$this->toolbox_add_advanced();
echo '</div>';
+
+ echo '<div class="toolbox_border"></div>';
}
+ // Knjiznica
+ echo '<div class="toolbox_item open_lib" onClick="displayLibraryPopup();"><span class="item_icon faicon library"></span><span class="item_text">'.$lang['srv_library'].'</span></div>';
+ echo '<div class="toolbox_border open_lib"></div>';
+
// normalna anketa
if ($this->survey_type != 1){
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
- echo '<p class="new_if '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" tip="9999"><span class="faicon icon-white if_32"></span></p>';
- echo '<p class="new_block '.(!$userAccess->checkUserAccess($what='block') ? 'user_access_locked' : '').'" tip="9998"><span class="faicon icon-white block_32"></span></p>';
+ echo '<div class="toolbox_item new_if '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" tip="9999"><span class="item_icon faicon icon-white if_32"></span> <span class="item_text">'.$lang['srv_condition'].'</span></div>';
+ echo '<div class="toolbox_border new_if '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'"></div>';
+
+ echo '<div class="toolbox_item new_block '.(!$userAccess->checkUserAccess($what='block') ? 'user_access_locked' : '').'" tip="9998"><span class="item_icon faicon icon-white block_32"></span> <span class="item_text">'.$lang['srv_block_random_blocks'].'</span></div>';
}
+
+ // Pobrisana vprasanja
+ $vd = new VprasanjeDeleted($this->anketa);
+ $deleted_vrasanja_count = $vd->countDeletedVprasanja();
+ echo '<div id="vprasanje_deleted_border" class="toolbox_border '.($deleted_vrasanja_count == 0 ? 'displayNone' : '').'"></div>';
+ echo '<div id="vprasanje_deleted_toolbox" class="toolbox_item open_deleted '.($deleted_vrasanja_count == 0 ? 'displayNone' : '').'" onClick="displayVprasanjeDeletedPopup();"><span class="item_icon faicon delete"></span><span class="item_text">'.$lang['srv_deleted_vprasanja'].' (<span id="vprasanje_deleted_count">'.$deleted_vrasanja_count.'</span>)</span></div>';
}
echo '</div>';
@@ -466,324 +417,1058 @@ class Branching {
* prikaze popup z vsemi tipi vprasanj
*
*/
- function toolbox_add_advanced() {
+ function toolbox_add_advanced($popup=false) {
global $lang;
global $site_url;
global $admin_type;
global $global_user_id;
- $spr = $_POST['spr'];
- $if = $_POST['if'];
- $endif = $_POST['endif'];
-
+
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
- echo '<div id="toolbox_add_advanced">';
- echo '<p class="toolbox_add_title">'.$lang['srv_add_question_type'].' '.Help::display('srv_toolbox_add_advanced').'</p>';
- echo '<p class="new_question">'.$lang['srv_new_question_text'].'</p>';
+ echo '<div id="toolbox_add_advanced'.($popup ? '_popup' : '').'" class="toolbox_expand">';
- echo '<a style="position:absolute; right:10px; top:10px" href="#" title="'.$lang['srv_zapri'].'" onclick="$(\'#toolbox_add_advanced\').hide(); return false;">';
- echo '<span class="faicon close"></span>';
- echo '</a>';
+ // Naslov v oknu
+ echo '<div class="toolbox_expand_title">';
+ echo $lang['srv_add_question_type'].' '.Help::display('srv_toolbox_add_advanced');
+ echo '<span class="subtitle">'.$lang['srv_new_question_text'].'</span>';
+ echo '</div>';
- echo '<div class="holder">';
- echo '<p class="naslov">'.$lang['srv_sklop_osnovna2'].'</p>';
- echo '<div class="clr"></div>';
+ // Vsebina okna
+ echo '<div class="toolbox_expand_segments_holder">';
- echo '<p class="new_spr adv" tip="1"><span class="sprites radio3"></span> '.$lang['srv_vprasanje_tip_1'].'</p>';
- echo '<p class="new_spr adv" tip="3"><span class="sprites osnovna_vprasanja"></span> '.$lang['srv_vprasanje_tip_1'].' - '.$lang['srv_dropdown'].'</p>';
- echo '<p class="new_spr adv" tip="2"><span class="sprites checkbox3"></span> '.$lang['srv_vprasanje_tip_2'].'</p>';
- echo '<div class="clr"></div>';
- echo '<p class="naslov">'.$lang['srv_vprasanje_tables'].'</p>';
- echo '<div class="clr"></div>';
+ // Segment kategorije
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_sklop_osnovna2'].'</p>';
- echo '<p class="new_spr podtip adv" tip="6" podtip="0"><span class="sprites table"></span> '.$lang['srv_classic'].'</p>';
- echo '<p class="new_spr podtip adv" tip="6" podtip="1"><span class="sprites table"></span> '.$lang['srv_diferencial2'].'</p>';
- echo '<p class="new_spr podtip adv" tip="6" podtip="2"><span class="sprites table"></span> '.$lang['srv_table_dropdown'].'</p>';
- echo '<p class="new_spr podtip adv" tip="6" podtip="3"><span class="sprites table"></span> '.$lang['srv_double_grid'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="1">'.$lang['srv_vprasanje_tip_1'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="3">'.$lang['srv_vprasanje_tip_1'].' - '.$lang['srv_dropdown'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="2">'.$lang['srv_vprasanje_tip_2'].'</p>';
- echo '<div class="clr"></div>';
- echo '<p class="naslov">'.$lang['srv_sklop_posebna'].'</p>';
- echo '<div class="clr"></div>';
+ echo '</div>';
- echo '<p class="new_spr adv" tip="5"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_5'].'</p>';
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_location') ? 'user_access_locked' : '').'" tip="26"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_26'].'</p>';
-
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_heatmap') ? 'user_access_locked' : '').'" tip="27"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_heatmap'].'</p>';
-
- echo '<p class="new_spr adv" tip="8"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_8'].'</p>';
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_ranking') ? 'user_access_locked' : '').'" tip="17"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_17'].'</p>';
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_sum') ? 'user_access_locked' : '').'" tip="18"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_18'].'</p>';
+ // Segment vnos
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_sklop_osnovna_vnos2'].'</p>';
- echo '</div>';
- echo '<div class="holder">';
+ echo '<p class="new_spr adv segment_option" tip="7">'.$lang['srv_vprasanje_tip_7'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="21">'.$lang['srv_vprasanje_tip_21'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="7" podtip="2">'.$lang['srv_number_insert_1'].'</p>';
- echo '<p class="naslov">'.$lang['srv_sklop_osnovna_vnos2'].'</p>';
- echo '<div class="clr"></div>';
+ echo '</div>';
- echo '<p class="new_spr adv" tip="7"><span class="sprites number"></span> '.$lang['srv_vprasanje_tip_7'].'</p>';
- echo '<p class="new_spr adv" tip="21"><span class="sprites text"></span> '.$lang['srv_vprasanje_tip_21'].'</p>';
- echo '<p class="new_spr podtip adv" tip="7" podtip="2"><span class="sprites number"></span> '.$lang['srv_number_insert_1'].'</p>';
- echo '<div class="clr"></div>';
- echo '<p class="naslov">'.$lang['srv_sklop_tabele_ostale'].'</p>';
- echo '<div class="clr"></div>';
+ // Segment tabele
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_vprasanje_tables'].'</p>';
- echo '<p class="new_spr adv" tip="16"><span class="sprites table"></span> '.$lang['srv_vprasanje_tip_16'].'</p>';
- echo '<p class="new_spr adv" tip="20"><span class="sprites table"></span> '.$lang['srv_vprasanje_tip_20'].'</p>';
- echo '<p class="new_spr adv" tip="19"><span class="sprites table"></span> '.$lang['srv_vprasanje_tip_19'].'</p>';
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_multitable') ? 'user_access_locked' : '').'" tip="24"><span class="sprites table"></span> '.$lang['srv_survey_table_multiple'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="6" podtip="0">'.$lang['srv_classic'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="6" podtip="1">'.$lang['srv_diferencial2'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="6" podtip="2">'.$lang['srv_table_dropdown'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="6" podtip="3">'.$lang['srv_double_grid'].'</p>';
- echo '<div class="clr"></div>';
- echo '<p class="naslov">'.$lang['srv_standardni_vnosi'].'</p>';
- echo '<div class="clr"></div>';
+ echo '</div>';
- echo '<p class="new_spr podtip adv" tip="21" podtip="2"><span class="faicon preview icon-blue"></span> '.$lang['email'].'</p>';
- echo '<p class="new_spr podtip adv" tip="21" podtip="3"><span class="faicon preview icon-blue"></span> '.$lang['url'].'</p>';
- echo '<p class="new_spr podtip adv" tip="21" podtip="4"><span class="faicon preview icon-blue"></span> '.$lang['srv_tip_standard_993'].'</p>';
- echo '<p class="new_spr podtip adv" tip="21" podtip="7"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_long_21_7'].'</p>';
- echo '<p class="new_spr podtip adv" tip="21" podtip="1"><span class="faicon preview icon-blue"></span> '.$lang['srv_captcha_edit'].'</p>';
- echo '<p class="new_spr podtip adv" tip="1" podtip="10"><span class="faicon preview icon-blue"></span> '.$lang['srv_gdpr'].'</p>';
- echo '</div>';
+ // Segment ostale tabele
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_sklop_tabele_ostale'].'</p>';
- echo '<div class="holder">';
+ echo '<p class="new_spr adv segment_option" tip="16">'.$lang['srv_vprasanje_tip_16'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="20">'.$lang['srv_vprasanje_tip_20'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="19">'.$lang['srv_vprasanje_tip_19'].'</p>';
+
+ if(!$userAccess->checkUserAccess($what='question_type_multitable')){
+ echo '<div class="user_access_locked locked">';
+ }
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_multitable') ? 'user_access_locked' : '').'" tip="24">'.$lang['srv_survey_table_multiple'].'</p>';
+ if(!$userAccess->checkUserAccess($what='question_type_multitable')){
+ echo '</div>';
+ }
- if (($lang['id'] == '1' || $lang['id'] == '2') && ($site_url == 'https://www.1ka.si/' || strpos($site_url, 'localhost') !== false ) ) {
+ echo '</div>';
- echo '<p class="naslov">'.$lang['srv_demografija'].'</p>';
- echo '<div class="clr"></div>';
- if ($lang['id'] == '1') {
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XSPOL').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_spol'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XSTAR2a4').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_starost'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XZST1surs4').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_zakonski_stan'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XDS2a4').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_status'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XIZ1a2').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_izobrazba'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XLOKACREGk').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_lokacija'].'</p>';
- }
+ // Segment posebna vprasanja
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_sklop_posebna'].'</p>';
- if ($lang['id'] == '2') {
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XSEX').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_spol'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XAGE').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_starost'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XMRSTS').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_zakonski_stan'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XSTS').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_status'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XEDU').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_izobrazba'].'</p>';
- echo '<p class="new_spr podtip adv" tip="23" podtip="'.Demografija::getInstance()->getSpremenljivkaID('XLOC').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_demografija_lokacija'].'</p>';
- }
+ echo '<p class="new_spr adv segment_option" tip="5">'.$lang['srv_vprasanje_tip_5'].'</p>';
+ if(!$userAccess->checkUserAccess($what='question_type_location')){
+ echo '<div class="user_access_locked locked">';
+ }
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_location') ? 'user_access_locked' : '').'" tip="26">'.$lang['srv_vprasanje_tip_26'].'</p>';
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_heatmap') ? 'user_access_locked' : '').'" tip="27">'.$lang['srv_vprasanje_heatmap'].'</p>';
+ if(!$userAccess->checkUserAccess($what='question_type_multitable')){
+ echo '</div>';
+ }
+ echo '<p class="new_spr adv segment_option" tip="8">'.$lang['srv_vprasanje_tip_8'].'</p>';
+
+ if(!$userAccess->checkUserAccess($what='question_type_ranking')){
+ echo '<div class="user_access_locked locked">';
}
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_ranking') ? 'user_access_locked' : '').'" tip="17">'.$lang['srv_vprasanje_tip_17'].'</p>';
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_sum') ? 'user_access_locked' : '').'" tip="18">'.$lang['srv_vprasanje_tip_18'].'</p>';
+ if(!$userAccess->checkUserAccess($what='question_type_multitable')){
+ echo '</div>';
+ }
+
+ echo '</div>';
- echo '<p class="new_spr_spacer"></p>';
- echo '<p class="new_spr_spacer" style="height: 22px;"></p>';
- echo '<div class="clr"></div>';
- echo '<p class="naslov">'.$lang['srv_advanced_features'].'</p>';
- echo '<div class="clr"></div>';
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_standardni_vnosi'].'</p>';
+
+ echo '<p class="new_spr podtip adv segment_option" tip="21" podtip="2">'.$lang['email'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="21" podtip="3">'.$lang['url'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="21" podtip="4">'.$lang['srv_tip_standard_993'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="21" podtip="7">'.$lang['srv_vprasanje_tip_long_21_7'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="21" podtip="1">'.$lang['srv_captcha_edit'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="1" podtip="10">'.$lang['srv_gdpr'].'</p>';
+
+ echo '</div>';
+
+
+ echo '<div class="toolbox_expand_segment">';
+ echo '<p class="segment_title">'.$lang['srv_advanced_features'].'</p>';
+
+ if(!$userAccess->checkUserAccess($what='question_type_calculation')){
+ echo '<div class="user_access_locked locked">';
+ }
// Kalkulacija
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_calculation') ? 'user_access_locked' : '').'" tip="22"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_22'].'</p>';
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_calculation') ? 'user_access_locked' : '').'" tip="22">'.$lang['srv_vprasanje_tip_22'].'</p>';
// Kvota
- echo '<p class="new_spr adv '.(!$userAccess->checkUserAccess($what='question_type_quota') ? 'user_access_locked' : '').'" tip="25"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_25'].'</p>';
+ echo '<p class="new_spr adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_quota') ? 'user_access_locked' : '').'" tip="25">'.$lang['srv_vprasanje_tip_25'].'</p>';
// Loop
- echo '<p class="new_loop '.(!$userAccess->checkUserAccess($what='loop') ? 'user_access_locked' : '').'" tip="9997"><span class="faicon preview icon-blue"></span> '.$lang['srv_zanka'].'</p>';
+ echo '<p class="new_loop segment_option '.(!$userAccess->checkUserAccess($what='loop') ? 'user_access_locked' : '').'" tip="9997">'.$lang['srv_zanka'].'</p>';
// Signature
- echo '<p class="new_spr podtip adv '.(!$userAccess->checkUserAccess($what='question_type_signature') ? 'user_access_locked' : '').'" tip="21" podtip="6"><span class="faicon preview icon-blue"></span> '.$lang['srv_signature_edit'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option '.(!$userAccess->checkUserAccess($what='question_type_signature') ? 'user_access_locked' : '').'" tip="21" podtip="6">'.$lang['srv_signature_edit'].'</p>';
+
+
// Chat (nagovor z gumbom za vklop chata) - ce je vklopljen modul chat
if (SurveyInfo::getInstance()->checkSurveyModule('chat')){
- echo '<p class="new_spr podtip adv" tip="5" podtip="2"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_5_2'].'</p>';
+ echo '<p class="new_spr podtip adv segment_option" tip="5" podtip="2">'.$lang['srv_vprasanje_tip_5_2'].'</p>';
}
// Socialna omrezja
if (SurveyInfo::getInstance()->checkSurveyModule('social_network')){
- echo '<p class="new_spr adv" tip="9"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_9'].'</p>';
+ echo '<p class="new_spr adv segment_option" tip="9">'.$lang['srv_vprasanje_tip_9'].'</p>';
}
elseif(!$userAccess->checkUserAccess($what='question_type_signature')){
- echo '<p class="new_sn adv" tip="9" style="float:left; width:150px; margin:1px 0 1px 1px; padding:4px 7px;"><a href="index.php?anketa='.$this->anketa.'&a=social_network" class="user_access_locked"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_9'].'</A></p>';
+ echo '<p class="new_sn adv segment_option" tip="9" style="float:left; width:150px; margin:1px 0 1px 1px; padding:4px 7px;"><a href="index.php?anketa='.$this->anketa.'&a=social_network" class="user_access_locked">'.$lang['srv_vprasanje_tip_9'].'</A></p>';
}
else{
- echo '<p style="float:left; width:150px; margin:1px 0 1px 1px; padding:4px 7px;"><a href="index.php?anketa='.$this->anketa.'&a=social_network" '.(!$userAccess->checkUserAccess($what='question_type_signature') ? 'class="user_access_locked"' : '').'"><span class="faicon preview icon-blue"></span> '.$lang['srv_vprasanje_tip_9'].'</A></p>';
+ echo '<p class="segment_option"><a href="index.php?anketa='.$this->anketa.'&a=social_network" '.(!$userAccess->checkUserAccess($what='question_type_signature') ? 'class="user_access_locked"' : '').'">'.$lang['srv_vprasanje_tip_9'].'</a></p>';
}
+ if(!$userAccess->checkUserAccess($what='question_type_calculation')){
+ echo '</div>';
+ }
+
echo '</div>';
- //echo '<a style="position:absolute; right:10px; bottom:10px" href="#" onclick=" $(\'#toolbox_add_advanced\').addClass(\'dragging\'); setTimeout(function() { $(\'#toolbox_add_advanced\').removeClass(\'dragging\'); }, 500); return false;">'.$lang['srv_zapri'].'</a>';
+ echo '</div>';
+
+
+ if($popup){
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="$(\'#fullscreen\').hide().html(\'\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ // Klik izven okna - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#toolbox_add_advanced_popup, .toolbox_expand_title, .toolbox_expand_segments_holder, .button_holder");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0 && $("#toolbox_add_advanced_popup").length){
+ $(\'#fullscreen\').hide().html(\'\'); $(\'#fade\').fadeOut(\'slow\');
+ }
+ });
+ </script>';
+ }
+
echo '</div>';
}
- /**
- * prikaze popup z vsemi tipi vprasanj
- *
- */
- function toolbox_add_advanced_settings() {
- global $lang;
- global $admin_type;
- global $site_url;
- global $global_user_id;
+ /**
+ * preview
+ *
+ */
+ private function getTipPreviewHtml(){
+ global $lang;
+ global $global_user_id;
- echo '<div id="toolbox_advanced_settings_holder">';
- echo '<span class="advanced_settings_title">'.$lang['srv_advanced_settings_title'].'</span>';
+ // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete
+ if (!$this->anketa > 0)
+ return;
- $row = SurveyInfo::getInstance()->getSurveyRow();
+ if ( ($_GET['a'] != '' || !isset($_GET['anketa'])) && $_GET['a'] != 'branching' )
+ return;
- # preverimo ali imamo ife. Če so, izpisujemo vse ikonce
- $sql_select = "SELECT count(*) AS if_count FROM srv_branching WHERE element_if > 0 AND ank_id = '".$this->anketa."'";
- $sql_query = sisplet_query($sql_select);
- $row_query = mysqli_fetch_array($sql_query);
- $has_if = (int)$row_query['if_count'] > 0 ? true : false;
- # ali prikazujemo vse ikonice ali samo "simpl" ikonice
- $sql_select_fv = "SELECT count(*) AS full_view FROM srv_user_setting_for_survey WHERE sid='".$this->anketa."' AND uid='".$global_user_id."' AND what='display_full_toolbox' AND value='1'";
- $sql_query_fv = sisplet_query($sql_select_fv);
- $row_query_fv = mysqli_fetch_array($sql_query_fv);
- $full_view = (int)$row_query_fv['full_view'] == 1 ? true : false;
- $full_view = true;
+ echo '<div id="tip_preview" class="toolbox_preview">';
- // Razsiri / skrci
- if($this->survey_type > 1){
- if($this->expanded) {
- echo '<p>';
- echo '<a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=expanded&value=0" title="'.$lang['srv_expanded_0'].'">';
- echo '<span class="advanced_setting"><span class="faicon compress"></span></span>';
- echo $lang['srv_expand_0'];
- echo '</a>';
- echo '</p>';
- }
- else {
- echo '<p>';
- echo '<a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=expanded&value=1" title="'.$lang['srv_expanded_1'].'">';
- echo '<span class="advanced_setting"><span class="faicon expand"></span></span>';
- echo $lang['srv_expand_1'];
- echo '</a>';
- echo '</p>';
- }
- }
- if ($has_if == true/* && $full_view == true || ($has_if == true && $this->expanded == false)*/) {
- echo '<p>';
- echo '<a href="#" onClick="expandCollapseAllPlusMinus(\'expand\'); return false;"><span class="advanced_setting"><span class="faicon plus_square" title="'.$lang['srv_expand'].'"></span></span>'.$lang['srv_expand'].'</a>'."\n";
- echo '<a href="#" onClick="expandCollapseAllPlusMinus(\'collapse\'); return false;"><span class="advanced_setting" style="margin-left: 15px;"><span class="faicon minus_square" title="'.$lang['srv_collapse'].'"></span></span>'.$lang['srv_collapse'].'</a>'."\n";
- echo '</p>';
- }
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
- # find & replace
- if ($row['locked'] == 0) {
- echo '<p>';
- echo '<a href="#" onclick="find_replace(); return false;" title="'.$lang['srv_find_replace_words'].'" ><span class="advanced_setting"><span class="faicon replace"></span></span>'.$lang['srv_find_replace_words'].'</a>';
- echo '</p>';
- }
+ // tip 9999 - IF
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9999" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_toolbox_if'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='if')){
+ $userAccess->displayNoAccessText($what='if');
+ }
+ echo '</div>';
- if ($row['locked'] == 0 && $full_view == true) {
- echo '<p>';
- echo '<a href="#" onclick="javascript:pagebreak_all(); return false;" title="'.$lang['srv_pagebreak_all'].'"><span class="advanced_setting"><span class="faicon paragraph"></span></span>'.$lang['srv_pagebreak_all'].'</a> '."\n";
- echo '</p>';
- }
+ // tip 9998 - Block
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9998" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_toolbox_block'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='block')){
+ $userAccess->displayNoAccessText($what='block');
+ }
+ echo '</div>';
- # Hrošč je viden samo če imamo ife in razširjen pogled
- if ($row['locked'] == 0 && $full_view == true) { // if ($row['flat'] == 0)
- echo '<p>';
- echo '<a href="#" onclick="javascript:check_pogoji(); return false;" title="'.$lang['srv_check_pogoji'].'"><span class="advanced_setting"><span class="faicon bug"></span></span>'.$lang['srv_check_pogoji'].'</a> '."\n";
- echo '</p>';
- }
+ // tip 9997 - Loop
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9997" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_toolbox_loop'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='loop')){
+ $userAccess->displayNoAccessText($what='loop');
+ }
+ echo '</div>';
- if ($row['locked'] == 0 && $full_view == true) {
- echo '<p>';
- echo '<a href="#" onclick="prestevilci(); return false;"><span class="advanced_setting"><span class="faicon hashtag" title="'.$lang['srv_grupe_recount_branching'].'"></span></span>'.$lang['srv_grupe_recount_branching'].'</a>' . Help :: display('srv_grupe_recount_branching') ."\n";
- echo '</p>';
- }
- // Knjiznica na desni
- if ($row['locked'] == 0) {
- if($row['toolbox'] >= 3){
- echo '<p>';
- echo '<a href="#" onclick="change_mode(\'toolboxback\', \'1\'); return false;" title="'.$lang['srv_library_hide'].'" ><span class="advanced_setting"><span class="faicon library smaller"></span></span>'.$lang['srv_library_hide'].'</a>';
- echo '</p>';
- }
- else{
- echo '<p>';
- echo '<a href="#" onclick="change_mode(\'toolbox\', \'3\'); return false;" title="'.$lang['srv_library_show'].'" ><span class="advanced_setting"><span class="faicon library smaller"></span></span>'.$lang['srv_library_show'].'</a>';
- echo '</p>';
- }
- }
+ // tip 1_1 - radio
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="radio" checked />' . $lang['srv_tip_sample_t1_o1'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o2'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o3'] . '</div>';
+ echo '</div>';
+ echo '</div>';
- echo '</div>';
+ // tip 1_10 - gdpr
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_10" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_gdpr_intro_title'] . '</div><br />';
+ echo '<div class="tip_sample_text">' . $lang['srv_gdpr_intro'] . '.<br />'.$lang['srv_gdpr_intro4'].'</div>';
+ echo '<div class="tip_sample_option"><input type="radio" checked />' . $lang['srv_gdpr_intro_no'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_gdpr_intro_yes'] . '</div>';
+ echo '</div>';
+ echo '</div>';
- // prikaz blokov kot zavihke
- /*echo '<div class="blockSwitch">';
- $sql = sisplet_query("SELECT i.* FROM srv_if i, srv_branching b WHERE i.tab='1' AND i.tip='1' AND i.id=b.element_if AND b.ank_id='$this->anketa' ORDER BY b.parent, b.vrstni_red");
- if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
- $i = 0;
- while ($row = mysqli_fetch_array($sql)) {
- if ($i++ != 0) echo ' | ';
- $label = ($row['label'] == ''?$lang['srv_blok'].' ('.$row['number'].')':$row['label']);
- echo '<p>';
- echo '<a href="index.php?anketa='.$this->anketa.'&parent_if='.$row['id'].'">'.$label.'</a> ';
- echo '</p>';
- }
- echo '</div>';*/
- }
+ // tip 1 - radio (horizontalno)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '&nbsp;<span style="font-weight: normal;"><input type="radio" checked />' . $lang['srv_tip_sample_t1_o1'] . '&nbsp;<input type="radio" />' . $lang['srv_tip_sample_t1_o2'] . '</span></div>';
+ echo '</div>';
+ echo '</div>';
- /**
- * prikaz knjiznice v toolboxu na levi strani
- *
- */
- function toolbox_library () {
- global $lang;
+ // tip 1_2 - radio (horizontalno - nova vrstica)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o1'] . '&nbsp;<input type="radio" checked />' . $lang['srv_tip_sample_t1_o2'] . '&nbsp;<input type="radio" />' . $lang['srv_tip_sample_t1_o3'] . '</div>';
+ echo '</div>';
+ echo '</div>';
- $row = SurveyInfo::getInstance()->getSurveyRow();
+ // tip 1_5 - radio potrditev
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_5" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1_5'] . '</div>';
+ echo '<div class="tip_sample_option gray"><input type="button" disabled value="' . $lang['srv_potrdi'] . '"></div>';
+ echo '</div>';
+ echo '</div>';
- //glede na to kje smo se nahajali se vrnemo (na osnovne oz napredne moznosti)
- //$row['toolbox'] == 3 ? $preklop = 1 : $preklop = 2;
+ // tip 1_6 - select box
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_6" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t3'] . '</div>';
+ echo '<div class="tip_sample_option"><select size="3"><option>' . $lang['srv_tip_sample_t3_oc'] . '</option><option>' . $lang['srv_tip_sample_t3_oc'] . '</option><option>' . $lang['srv_tip_sample_t3_oc'] . '</option></select></div>';
+ echo '</div>';
+ echo '</div>';
- echo '<div id="toolbox_library" class="library">';
+ // tip 1_8 - Drag-drop
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_8" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
- //echo '<p style="position:absolute; top:-30px"><a href="#" onclick="change_mode(\'toolboxback\', \''.$preklop.'\'); return false;">'.$lang['srv_nazajnavprasanja'].'</a></p>';
+ echo '<div style="float: left; width: 150px; height: 110px; border-right: 1px black solid;">';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o1'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o2'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o3'] . '</div></div>';
+ echo '</div>';
+ echo '<div style="float: left; width: 150px; height: 110px; margin-left: 30px;">';
+ echo '<div class="tip_sample_option"><div class="dragdrop_preview_frame"></div></div>';
+ echo '</div>';
+ echo '<div class="clr"></div>';
- //zgornja navigacija toolboxa
- /*echo '<table id="toolbox_menu" cellspacing="0" cellpadding="0"><tr>';
- echo '<td class="noactive" style="border-right: 1px #888888 solid; border-bottom: 1px #888888 solid;"><a href="#" onclick="change_mode(\'toolboxback\', \''.$preklop.'\'); return false;">'.$lang['srv_novaspremenljivka'].'</a></td>';
- //echo '<td class="noactive"><a href="#" onclick="change_mode(\'toolbox\', \'2\'); return false;">'.$lang['srv_advanced'].'</a></td>';
- echo '<td class="handle">'.$lang['srv_library'].'</td>';
- echo '</tr></table>';*/
+ echo '</div>';
+ echo '</div>';
- if ($row['locked'] == 1) {
+ // tip 1_9 - custom radio picture
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_9" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
- //echo '<p><img src="img_0/lock.png" /> '.$lang['srv_anketa_locked_1'].'</p>';
- echo '<p>';
- echo '<span class="sprites lock_close"></span> '.$lang['srv_anketa_locked_1'];
- echo '</p>';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
+ // star
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio star"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
- } else {
+ // thumb
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio thumb"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
- echo '<div id="library_holder">';
- $l = new Library();
- $l->display();
- echo '</div>';
- }
+ //smiley
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio smiley"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
- echo '</div>';
- }
+ // heart
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio heart"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
+
+ // flag
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio flag"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
+
+ // user
+ echo '<div style="clear: both;">';
+ for ($i = 1; $i < 4; $i++) {
+ echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio user"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
+ }
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 1_10 - Image HotSpot
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_10" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_radio'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 1_11 - Vizualna anlaogna skala
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_1_11" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
+
+ echo '<div style="clear: both;padding-bottom:10px;">';
+ for ($i = 1; $i < 7; $i++) {
+ echo '<div class="variabla custom_radio visual-radio-scale" style="padding: 0 5px;">
+ <label>
+ <input type="radio">
+ <span class="enka-vizualna-skala siv-7'.$i.'"></span>
+ <div class="custom_radio_answer">('.$i.')</div>
+ </label>
+ </div>';
+ }
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+
+
+ // tip 2 - checkbox
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o1'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="checkbox" />' . $lang['srv_tip_sample_t2_o2'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 2_1 - check(horizontalno)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_2_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '&nbsp;<span style="font-weight: normal;"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o2'] . '&nbsp;<input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</span></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 2_2 - check (horizontalno - nova vrstica)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_2_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o1'] . '&nbsp;<input type="checkbox" />' . $lang['srv_tip_sample_t2_o2'] . '&nbsp;<input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 2_8 - Drag-drop
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_2_8" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
+
+ echo '<div style="float: left; width: 150px; height: 110px; border-right: 1px black solid;">';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o1'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o2'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o3'] . '</div></div>';
+ echo '</div>';
+
+ echo '<div style="float: left; width: 150px; height: 110px; margin-left: 30px;">';
+ echo '<div class="tip_sample_option"><div class="dragdrop_preview_frame"></div></div>';
+ echo '</div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 2_10 - Image HotSpot
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_2_10" class="tip_preview_sub">';
+ // echo '<div>Primer tipa vprašanj: label.</div>';
+ //echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_checkbox'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 3 - select
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_3" class="tip_preview_sub">';
+ // echo '<div>Primer tipa vprašanj: select.</div>';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t3'] . '</div>';
+ echo '<div class="tip_sample_option"><select><option>' . $lang['srv_tip_sample_t3_oc'] . '</option></select></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21 - besedilo*
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21'] . '</div>';
+ echo '<div class="tip_sample_option"><textarea style="width:150px; height:25px; padding:0 4px;">abc</textarea></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_1 - cpatcha
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_1_o1'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/captcha.jpg" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" value="VZHVP" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_2 - email
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">'.$lang['srv_tip_sample_t21_2_o1'].' ('.$lang['srv_email_example'].')</div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option bottom">' . $lang['srv_email_example_txt'] . '</div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_3 - url
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_3" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_3_o1'] . '</div>';
+ echo '<div class="tip_sample_option">(' . $lang['srv_url_example'] . ')</div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_4 - upload
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_4" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_4_o1'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="file" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_5 - textbox box
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_5" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21'] . '</div>';
+ echo '<div class="tip_sample_option"><textarea style="width:250px; height:36px">abc</textarea></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 21_6 - elektronski podpis
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_6" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo ' <div class="tip_sample_text">' . $lang['srv_tip_sample_t21_6'] . '</div>';
+ echo ' <div class="tip_sample_option">';
+ echo ' <div class="textarea"></div>';
+ echo ' <div class="button">'.$lang['srv_signature_clear'].'</div>';
+ echo ' </div>';
+ echo ' <span>'.$lang['srv_signature_name'].'</span>';
+ echo ' <input type="text" />';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_signature')){
+ $userAccess->displayNoAccessText($what='question_type_signature');
+ }
+ echo '</div>';
+
+ // tip 21_7 - fotografija
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_21_7" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_7'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/webcam_record.png" height="64"/></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 5 - label
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_5" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t5'] . '</div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 5_2 - nagovor za aktivacijo chata
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_5_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_chat_question_text'] . '</div>';
+ echo '<div class="tip_sample_option"><div class="tawk-chat-activation button" style="padding:6px 0px;">'.$lang['srv_chat_turn_on'].'</div></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 26 - lokacija
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_26" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_1'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/mojalokacija.png" /></div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_location')){
+ $userAccess->displayNoAccessText($what='question_type_location');
+ }
+ echo '</div>';
+
+ // tip 26_2 - multi lokacija
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_26_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_2'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/lokacija.png" /></div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_location')){
+ $userAccess->displayNoAccessText($what='question_type_location');
+ }
+ echo '</div>';
+
+ // tip 26_1 - moja lokacija
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_26_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_1'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/mojalokacija.png" /></div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_location')){
+ $userAccess->displayNoAccessText($what='question_type_location');
+ }
+ echo '</div>';
+
+ // tip 6 - multigrid
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
+ echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span> <span>' . $lang['srv_tip_sample_t6_o3'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><input type="radio" name="a" /></span><span><input type="radio" checked name="a" /></span><span><input type="radio" name="a" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><input type="radio" name="b" /></span><span><input type="radio" /></span><span><input type="radio" name="b" checked /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><input type="radio" name="c" /></span><span><input type="radio" /></span><span><input type="radio" name="c" checked /></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_1 - multigrid (semanticni diferencial)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t61'] . ':</div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>1</span><span>2</span><span>3</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v1x'] . '</div><span><input type="radio" name="d" /></span><span><input type="radio" name="d" /></span><span><input type="radio"name="d" /></span>' . $lang['srv_tip_sample_t61_v1y'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v2x'] . '</div><span><input type="radio" name="e" /></span><span><input type="radio" name="e" /></span><span><input type="radio" name="e" /></span>' . $lang['srv_tip_sample_t61_v2y'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v3x'] . '</div><span><input type="radio" name="f" /></span><span><input type="radio" name="f" checked /></span><span><input type="radio" /></span>' . $lang['srv_tip_sample_t61_v3y'] . '</div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_2 - multigrid (dropdown)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_3 - multigrid (double grid)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_3" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span></span><span>' . $lang['srv_tip_sample_t6_v1'] . '</span><span style="border-right: 1px #e5e5e5 solid;"></span><span></span><span>' . $lang['srv_tip_sample_t6_v3'] . '</span><span></span></div>';
+ echo '<div style="clear:left"></div>';
+
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span><span style="border-right: 1px #e5e5e5 solid;">' . $lang['srv_tip_sample_t6_o3'] . '</span><span>&nbsp;' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span><span>' . $lang['srv_tip_sample_t6_o3'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>www.xxx.si</div><span><input type="radio" /></span><span><input type="radio" /></span><span style="border-right: 1px #e5e5e5 solid;"><input type="radio" name="g" checked /></span><span><input type="radio" name="l" checked /></span><span><input type="radio" /></span><span><input type="radio" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>www.yyy.si</div><span><input type="radio" /></span><span><input type="radio" name="j" checked /></span><span style="border-right: 1px #e5e5e5 solid;"><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" name="h" checked /></span><span><input type="radio" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>www.zzz.si</div><span><input type="radio" /></span><span><input type="radio" name="i" checked /></span><span style="border-right: 1px #e5e5e5 solid;"><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" name="k" checked /></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+
+ // tip 6_4 - multigrid (one against another)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_4" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_4'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v1'] . '</div><span><input type="radio" name="l" checked/></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio"name="l" /></span>' . $lang['srv_tip_sample_t6_4_v2'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v1'] . '</div><span><input type="radio" name="m" /></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio" name="m" checked/></span>' . $lang['srv_tip_sample_t6_4_v3'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v3'] . '</div><span><input type="radio" name="n" checked/></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio" name="n" /></span>' . $lang['srv_tip_sample_t6_4_v2'] . '</div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_5 - multigrid (max diff)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_5" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_5'] . '</div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_5_c1'] . '</span><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_5_c2'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" checked/></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v1'] . '</div><span><input type="radio" name="p" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v2'] . '</div><span><input type="radio" name="p" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v3'] . '</div><span><input type="radio" name="p" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v4'] . '</div><span><input type="radio" name="p" checked/></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_6 - multigrid (select box)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_6" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_6'] . '</div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v1'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4a'] . '</option></select></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v2'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4b'] . '</option></select></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v3'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4c'] . '</option></select></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v4'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4d'] . '</option></select></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_8 - multigrid (Tabela Da/Ne)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_8" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
+ echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_8_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_8_o2'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><input type="radio" checked name="a" /></span><span><input type="radio" name="a" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><input type="radio" /></span><span><input type="radio" name="b" checked /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><input type="radio" /></span><span><input type="radio" name="c" checked /></span></div>';
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_9 - Drag-drop
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_9" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+
+ echo '<div class="tip_sample">';
+
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
+
+ echo '<div style="float: left; width: 200px; height: 150px; border-right: 1px black solid;">';
+ echo '<div class="tip_sample_option"></div><br /><br />';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v1'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v2'] . '</div></div>';
+ echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v3'] . '</div></div>';
+ echo '</div>';
+
+ echo '<div style="float: left; width: 200px; height: 180px; margin-left: 20px;">';
+ echo '<div class="tip_sample_option">';
+ echo '<ul style="list-style-type: none;">';
+
+ echo '<li >
+ <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o1'] . '</div>
+ </li>'; //izpis "naslova" okvirja
+ echo '<li>
+ <div class="dragdrop_preview_frame_grid"></div>
+ </li>' . "\n"; //izpis okvirja
+ echo '<li >
+ <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o2'] . '</div>
+ </li>'; //izpis "naslova" okvirja
+ echo '<li>
+ <div class="dragdrop_preview_frame_grid"></div>
+ </li>' . "\n"; //izpis okvirja
+ echo '<li >
+ <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o3'] . '</div>
+ </li>'; //izpis "naslova" okvirja
+ echo '<li>
+ <div class="dragdrop_preview_frame_grid"></div>
+ </li>' . "\n"; //izpis okvirja
+ echo '</ul>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="clr"></div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ // tip 6_10 - Image HotSpot
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_6_10" class="tip_preview_sub">';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_radio_grid'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 16 - multicheckbox
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_16" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t16'] . '</div>';
+ echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t16_o1'] . '</span><span>' . $lang['srv_tip_sample_t16_o2'] . '</span> <span>' . $lang['srv_tip_sample_t16_o3'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v1'] . '</div><span><input type="checkbox" checked /></span><span><input type="checkbox" /></span><span><input type="checkbox" checked /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v2'] . '</div><span><input type="checkbox" checked /></span><span><input type="checkbox" /></span><span><input type="checkbox" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v3'] . '</div><span><input type="checkbox" /></span><span><input type="checkbox" checked /></span><span><input type="checkbox" checked /></span></div>';
+ echo '<div class="clr"></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 19 - multitext
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_19" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t19'] . '</div>';
+ echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t19_o1'] . '</span><span>' . $lang['srv_tip_sample_t19_o2'] . '</span><span>' . $lang['srv_tip_sample_t19_o3'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t19_v1'] . '</div><span><input type="text" value="abc" /></span><span><input type="text" value="abc" /></span><span><input type="text" value="abc" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t19_v2'] . '</div><span><input type="text" value="abc" /></span><span><input type="text" value="abc" /></span><span><input type="text" value="abc" /></span></div>';
+ echo '<div class="clr"></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 20 - multinumber
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_20" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t20'] . '</div>';
+ echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t20_o1'] . '</span><span>' . $lang['srv_tip_sample_t20_o2'] . '</span><span>' . $lang['srv_tip_sample_t20_o3'] . '</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v1'] . '</div><span><input type="text" value="4" /></span><span><input type="text" value="0" /></span><span><input type="text" value="2" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v2'] . '</div><span><input type="text" value="8" /></span><span><input type="text" value="22" /></span><span><input type="text" value="7" /></span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v3'] . '</div><span><input type="text" value="6" /></span><span><input type="text" value="12" /></span><span><input type="text" value="6" /></span></div>';
+ echo '<div class="clr"></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 7 - number
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_7" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t7'] . '</div>';
+ echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t7_o1'] . '<input type="text" value="123" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 7_2 - slider
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_7_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t7_2'] . '</div>';
+ echo '<div class="tip_sample_option"><img src="img_new/slider.png" height="40"/></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 8 - datum
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_8" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t8'] . '</div>';
+ echo '<div class="tip_sample_option"><input type="text" size="20"/><span id="starts_img" class="sprites calendar" style="float:none; margin-bottom:0"></span></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 17 - Razvrščanje prestavljanje (default)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_17" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t17'] . '</div>';
+
+ echo '<div class="ranking_preview_holder">';
+ echo ' <div class="ranking_preview_left">';
+ echo ' <div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o1'] . '</div>';
+ echo ' <div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o2'] . '</div>';
+ echo ' <div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o3'] . '</div>';
+ echo ' </div>';
+
+ echo ' <div class="ranking_preview_right">';
+ echo ' <div class="razvrscanje_preview_frame">1.</div>';
+ echo ' <div class="razvrscanje_preview_frame">2.</div>';
+ echo ' <div class="razvrscanje_preview_frame">3.</div>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_ranking')){
+ $userAccess->displayNoAccessText($what='question_type_ranking');
+ }
+ echo '</div>';
+
+ // tip 171 - Razvrščanje ostevilcevanje (design = 1)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_17_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t171'] . '</div>';
+
+ echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o1'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o2'] . '</div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o3'] . '</div>';
+ echo '<div style="clear:left"></div>';
+
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_ranking')){
+ $userAccess->displayNoAccessText($what='question_type_ranking');
+ }
+ echo '</div>';
+
+ // tip 172 - Razvrščanje premikanje (design = 2)
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_17_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t172'] . '</div>';
+ echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o1'] . '</div><span>&nbsp;</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o2'] . '</div><span>&nbsp;</span></div>';
+ echo '<div style="clear:left"></div>';
+ echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o3'] . '</div><span>&nbsp;</span></div>';
+ echo '<div class="clr"></div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_ranking')){
+ $userAccess->displayNoAccessText($what='question_type_ranking');
+ }
+ echo '</div>';
+
+ // tip 18 - vsota
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_18" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t18'] . '</div>';
+ echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o1'] . '<input type="text" value="9" /></div>';
+ echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o2'] . '<input type="text" value="10" /></div>';
+ echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o3'] . '<input type="text" value="5" /></div>';
+ echo '<div class="tip_sample_option sum">' . $lang['srv_tip_sample_t18_o4'] . '<input type="text" value="24" /></div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_sum')){
+ $userAccess->displayNoAccessText($what='question_type_sum');
+ }
+ echo '</div>';
+
+ // tip 24 - Kombinirana tabela
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_24" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_survey_table_multiple'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_multitable')){
+ $userAccess->displayNoAccessText($what='question_type_multitable');
+ }
+ echo '</div>';
+
+ // tip 27 - Heatmap
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_27" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_vprasanje_heatmap'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_heatmap')){
+ $userAccess->displayNoAccessText($what='question_type_heatmap');
+ }
+ echo '</div>';
+
+ // tip 22 - Kalkulacija
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_22" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_vprasanje_tip_long_22'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_calculation')){
+ $userAccess->displayNoAccessText($what='question_type_calculation');
+ }
+ echo '</div>';
+
+ // tip 25 - Kvota
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_25" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo $lang['srv_vprasanje_tip_long_25'];
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='question_type_quota')){
+ $userAccess->displayNoAccessText($what='question_type_quota');
+ }
+ echo '</div>';
+
+ // tip 9 - SN-imena
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div><span class="faicon add"></span>' . $lang['srv_add_field'] . '</div>';
+ echo '</div>';
+ if(!$userAccess->checkUserAccess($what='social_network')){
+ $userAccess->displayNoAccessText($what='social_network');
+ }
+ echo '</div>';
+
+ // tip 9_1 - SN-imena - fiksno st. polj
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9_1" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 9_2 - SN-imena - 1 textbox
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9_2" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
+ echo '<div class="tip_sample_option"><textarea rows="10"></textarea></div>';
+ echo '</div>';
+ echo '</div>';
+
+ // tip 9_3 - SN-imena - vnos stevila polj
+ echo '<div name="tip_preview_sub" id="tip_preview_sub_9_3" class="tip_preview_sub">';
+ echo '<span>' . $lang['srv_new_question'] . '</span>';
+ echo '<div class="tip_sample">';
+ echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
+ echo '<div class="tip_sample_option">' . $lang['srv_design_count'] . ': <input type="text" size="4" style="margin-bottom: 3px;" value="3" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '<div class="tip_sample_option"><input type="text" /></div>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>'; // tip_preview
+ }
/**
* hitre nastavitve - na dnu pri formi
*
*/
- function toolbox_settings ($status1='none', $status2='none') {
+ function toolbox_settings ($status1='none') {
global $lang;
global $admin_type;
- $row = Cache::srv_spremenljivka($row2['spr_id']);
$rowA = SurveyInfo::getInstance()->getSurveyRow();
SurveySetting::getInstance()->Init($this->anketa);
@@ -791,7 +1476,7 @@ class Branching {
$emailDiv = SurveySetting::getInstance()->getSurveyMiscSetting('srvtoolbox_form_email');
- //OBVESCANJE
+ // OBVESCANJE
$sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '$this->anketa'");
if (!$sqlAlert)
echo mysqli_error($GLOBALS['connect_db']);
@@ -799,52 +1484,50 @@ class Branching {
$rowAlert['finish_other'] == 1 || ($rowAlert['finish_other_emails'] && $rowAlert['finish_other'] != 0) ? $checked = true : $checked = false;
- echo '<p style="margin: 6px 0;">';
- $alertDiv == 1 ? $obvescanje = 0 : $obvescanje = 1;
- echo '<a href="#" onClick="change_form_quicksettings(\'form_settings_obvescanje\');">';
+ $alertDiv == 1 ? $obvescanje = 0 : $obvescanje = 1;
+
- $img = ($status1 == 'none') ? ' class="faicon icon-blue plus"' : ' class="faicon icon-blue minus"';
- echo '<span '.$img.' id="obvescanje_switch" style="cursor:pointer;"></span> ';
+ echo '<div class="header" onClick="change_form_quicksettings();">';
+ echo '<span>'.$lang['srv_alert_link_form'].'</span><span id="obvescanje_switch" class="faicon '.($status1 == 'none' ? 'arrow2_d' : 'arrow2_u').'"></span>';
+ echo '</div>';
- echo '<b>' . $lang['srv_alert_link_form'] . '</b></a>';
- echo '</p>';
- //echo '<span class="nastavitveSpan4" style="width: 100%;"><label>' . $lang['srv_alert_prejemnik'] . '</label></span><br />';
$sas = new SurveyAdminSettings();
echo '<div id="form_settings_obvescanje" class="form_bottom_settings" style="display: '.$status1.';">';
// avtor ankete oz osebe z dostopom
- echo '<p class="whole"><input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="quick_settings(\'' . $row2['spr_id'] . '\', this, \'finish_author\'); return false;"' . ($rowAlert['finish_author'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_finish_author">';
+ echo '<div class="setting_row">';
+ echo '<input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="quick_settings(this, \'finish_author\'); return false;"' . ($rowAlert['finish_author'] == 1 ? ' checked' : '') . '>';
+ echo ' <span id="label_alert_finish_author">';
$sas->display_alert_label('finish_author',($rowAlert['finish_author'] == 1), true);
- echo '</span></p>';
+ echo ' </span>';
+ echo '</div>';
// posebej navedeni maili
- echo '<p class="whole"><input type="checkbox" name="alert_finish_other" id="alert_finish_other" value="1"' . ($checked ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'finish_other\'); quick_settings(\'' . $row2['spr_id'] . '\', this, \'finish_other\'); return false;"><label for="alert_finish_other">' . $lang['email_prejemniki'] . ($checked ? $lang['email_one_per_line'] : '' ) . '</label></p>';
-
- echo '<p id="alert_holder_finish_other_emails" '.($rowAlert['finish_other'] == 0 ? 'class="hidden"' : '' ).'>';
- echo '<label for="alert_finish_other_emails">' . $lang['email'] . ':</label>';
- echo '<textarea name="alert_finish_other_emails" id="alert_finish_other_emails" style="height:100px; width:60%; margin-left: 10px;" onBlur="quick_settings(\'' . $row2['spr_id'] . '\', this.value, \'finish_other_emails\');">' . $rowAlert['finish_other_emails'] . '</textarea>';
- echo '</p>';
-
- //respondent iz cms
- /*echo '<p><input type="checkbox" name="alert_finish_respondent_cms" id="alert_finish_respondent_cms" value="1" onChange="quick_settings(\'' . $row2['spr_id'] . '\', this, \'finish_respondent_cms\'); return false;" ' . ($rowAlert['finish_respondent_cms'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_finish_respondent_cms">';
- $sas->display_alert_label('finish_respondent_cms',($rowAlert['finish_respondent_cms'] == 1), true);
- echo '</span></p>';*/
-
- //respondent
- echo '<p class="whole"><input type="checkbox" class="enka-admin-custom" name="alert_finish_respondent" id="alert_finish_respondent" value="1" onChange="quick_settings(\'' . $row2['spr_id'] . '\', this, \'finish_respondent\'); return false;" ' . ($rowAlert['finish_respondent'] == 1 ? ' checked' : '') . '>';
- echo '<span class="enka-checkbox-radio "></span>';
- echo '<span id="label_alert_finish_respondent">';
+ echo '<div class="setting_row">';
+ echo ' <input type="checkbox" name="alert_finish_other" id="alert_finish_other" value="1"' . ($checked ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'finish_other\'); quick_settings(this, \'finish_other\'); return false;"><label for="alert_finish_other">' . $lang['email_prejemniki'] . ($checked ? $lang['email_one_per_line'] : '' ) . '</label>';
+
+ echo ' <div id="alert_holder_finish_other_emails" '.($rowAlert['finish_other'] == 0 ? 'class="displayNone"' : '' ).'>';
+ echo ' <label for="alert_finish_other_emails">' . $lang['email'] . ':</label>';
+ echo ' <textarea name="alert_finish_other_emails" id="alert_finish_other_emails" style="height:100px; width:60%; margin-left: 10px;" onBlur="quick_settings(this.value, \'finish_other_emails\');">' . $rowAlert['finish_other_emails'] . '</textarea>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ // respondent
+ echo '<div class="setting_row">';
+ echo ' <input type="checkbox" class="enka-admin-custom" name="alert_finish_respondent" id="alert_finish_respondent" value="1" onChange="quick_settings(this, \'finish_respondent\'); return false;" ' . ($rowAlert['finish_respondent'] == 1 ? ' checked' : '') . '>';
+ echo ' <span id="label_alert_finish_respondent">';
$sas->display_alert_label('finish_respondent',($rowAlert['finish_respondent'] == 1), true);
- echo '</span></p>';
+ echo ' </span>';
+ echo '</div>';
- echo '<a style=" margin: 5px 0 5px 10px;" href="index.php?anketa=' . $this->anketa . '&a=alert" ><span class="strong">'.$lang['srv_detail_settings'].'</span></a>';
+ echo '<div class="setting_row bottom">';
+ echo ' <a href="index.php?anketa=' . $this->anketa . '&a=alert" class="noline">'.$lang['srv_detail_settings'].'<span class="faicon arrow2_r"></span></a>';
echo '</div>';
- echo '<div id="clr" class="clr" ></div>';
+ echo '</div>';
}
/**
@@ -862,28 +1545,28 @@ class Branching {
echo '<div class="left">';
if ($lang['id'] == '1') {
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSPOL\');" '.($this->check_demografija_exists('XSPOL')?'checked':'').' value="XSPOL" id="XSPOL"><span class="enka-checkbox-radio"></span><label for="XSPOL">'.$lang['srv_demografija_spol'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSTAR2a4\');" '.($this->check_demografija_exists('XSTAR2a4')?'checked':'').' value="XSTAR2a4" id="XSTAR2a4"><span class="enka-checkbox-radio"></span><label for="XSTAR2a4">'.$lang['srv_demografija_starost'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XZST1surs4\');" '.($this->check_demografija_exists('XZST1surs4')?'checked':'').' value="XZST1surs4" id="XZST1surs4"><span class="enka-checkbox-radio"></span><label for="XZST1surs4">'.$lang['srv_demografija_zakonski_stan'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSPOL\');" '.($this->check_demografija_exists('XSPOL')?'checked':'').' value="XSPOL" id="XSPOL"><label for="XSPOL"<span class="enka-checkbox-radio"></span>>'.$lang['srv_demografija_spol'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSTAR2a4\');" '.($this->check_demografija_exists('XSTAR2a4')?'checked':'').' value="XSTAR2a4" id="XSTAR2a4"><label for="XSTAR2a4"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_starost'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XZST1surs4\');" '.($this->check_demografija_exists('XZST1surs4')?'checked':'').' value="XZST1surs4" id="XZST1surs4"><label for="XZST1surs4"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_zakonski_stan'].'</label></p>';
echo '</div><div class="left">';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XDS2a4\');" '.($this->check_demografija_exists('XDS2a4')?'checked':'').' value="XDS2a4" id="XDS2a4"><span class="enka-checkbox-radio"></span><label for="XDS2a4">'.$lang['srv_demografija_status'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XIZ1a2\');" '.($this->check_demografija_exists('XIZ1a2')?'checked':'').' value="XIZ1a2" id="XIZ1a2"><span class="enka-checkbox-radio"></span><label for="XIZ1a2">'.$lang['srv_demografija_izobrazba'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XLOKACREGk\');" '.($this->check_demografija_exists('XLOKACREGk')?'checked':'').' value="XLOKACREGk" id="XLOKACREGk"><span class="enka-checkbox-radio"></span><label for="XLOKACREGk">'.$lang['srv_demografija_lokacija'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XDS2a4\');" '.($this->check_demografija_exists('XDS2a4')?'checked':'').' value="XDS2a4" id="XDS2a4"><label for="XDS2a4"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_status'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XIZ1a2\');" '.($this->check_demografija_exists('XIZ1a2')?'checked':'').' value="XIZ1a2" id="XIZ1a2"><label for="XIZ1a2"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_izobrazba'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XLOKACREGk\');" '.($this->check_demografija_exists('XLOKACREGk')?'checked':'').' value="XLOKACREGk" id="XLOKACREGk"><label for="XLOKACREGk"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_lokacija'].'</label></p>';
//echo '<p><input type="checkbox" name="demografija[]" value="'.Demografija::getInstance()->getSpremenljivkaID('XPODJPRIH').'" id="XPODJPRIH"> <label for="XPODJPRIH">'.$lang['srv_demografija_podjetja'].'</label></p>';
}
if ($lang['id'] == '2') {
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSEX\');" '.($this->check_demografija_exists('XSEX')?'checked':'').' value="XSEX" id="XSEX"><span class="enka-checkbox-radio"></span><label for="XSEX">'.$lang['srv_demografija_spol'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XAGE\');" '.($this->check_demografija_exists('XAGE')?'checked':'').' value="XAGE" id="XAGE"><span class="enka-checkbox-radio"></span><label for="XAGE">'.$lang['srv_demografija_starost'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XMRSTS\');" '.($this->check_demografija_exists('XMRSTS')?'checked':'').' value="XMRSTS" id="XMRSTS"><span class="enka-checkbox-radio"></span><label for="XMRSTS">'.$lang['srv_demografija_zakonski_stan'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSEX\');" '.($this->check_demografija_exists('XSEX')?'checked':'').' value="XSEX" id="XSEX"><label for="XSEX"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_spol'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XAGE\');" '.($this->check_demografija_exists('XAGE')?'checked':'').' value="XAGE" id="XAGE"><label for="XAGE"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_starost'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XMRSTS\');" '.($this->check_demografija_exists('XMRSTS')?'checked':'').' value="XMRSTS" id="XMRSTS"><label for="XMRSTS"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_zakonski_stan'].'</label></p>';
echo '</div><div class="left">';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSTS\');" '.($this->check_demografija_exists('XSTS')?'checked':'').' value="XSTS" id="XSTS"><span class="enka-checkbox-radio"></span><label for="XSTS">'.$lang['srv_demografija_status'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XEDU\');" '.($this->check_demografija_exists('XEDU')?'checked':'').' value="XEDU" id="XEDU"><span class="enka-checkbox-radio"></span><label for="XEDU">'.$lang['srv_demografija_izobrazba'].'</label></p>';
- echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XLOC\');" '.($this->check_demografija_exists('XLOC')?'checked':'').' value="XLOC" id="XLOC"><span class="enka-checkbox-radio"></span><label for="XLOC">'.$lang['srv_demografija_lokacija'].'</label></p>'; //echo '<p><input type="checkbox" name="demografija[]" value="'.Demografija::getInstance()->getSpremenljivkaID('XPODJPRIH').'" id="XPODJPRIH"> <label for="XPODJPRIH">'.$lang['srv_demografija_podjetja'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XSTS\');" '.($this->check_demografija_exists('XSTS')?'checked':'').' value="XSTS" id="XSTS"><label for="XSTS"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_status'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XEDU\');" '.($this->check_demografija_exists('XEDU')?'checked':'').' value="XEDU" id="XEDU"><label for="XEDU"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_izobrazba'].'</label></p>';
+ echo '<p><input type="checkbox" class="enka-admin-custom" name="demografija[]" onchange="demografija_new(\'XLOC\');" '.($this->check_demografija_exists('XLOC')?'checked':'').' value="XLOC" id="XLOC"><label for="XLOC"><span class="enka-checkbox-radio"></span>'.$lang['srv_demografija_lokacija'].'</label></p>'; //echo '<p><input type="checkbox" name="demografija[]" value="'.Demografija::getInstance()->getSpremenljivkaID('XPODJPRIH').'" id="XPODJPRIH"> <label for="XPODJPRIH">'.$lang['srv_demografija_podjetja'].'</label></p>';
}
echo '</div>';
@@ -964,6 +1647,7 @@ class Branching {
*/
function branching_struktura () {
global $lang;
+ global $global_user_id;
// naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
Cache::cache_all_srv_spremenljivka($this->anketa, true);
@@ -1003,7 +1687,128 @@ class Branching {
}
echo '</div>';
- }
+ }
+
+ // Napredne nastavitve v sredini zgoraj
+ echo '<div class="top_center_settings">';
+
+ echo '<div class="left_settings">';
+
+ $url0 = "'" . "index.php?anketa=".$this->anketa."&a=branching&change_mode=1&what=expanded&value=0" . "'";
+ $url1 = "'" . "index.php?anketa=".$this->anketa."&a=branching&change_mode=1&what=expanded&value=1" . "'";
+
+ echo '<div class="settings_group">';
+ // Razširi
+ echo '<div title="'.$lang['srv_expanded_1'].'" class="square rectangle left '.($this->expanded ? 'active':'').'" onClick="window.location='.$url1.';return false;">';
+ //echo '<span class="faicon expand-new"></span>';
+ echo '<span class="expand-new-icon faicon"></span>';
+ echo '<span class="text hide_mobile">'.$lang['srv_expand'].'</span>';
+ echo '</div>';
+
+ //echo '<div class="line"></div>';
+
+ //Skrči
+ echo '<div title="'.$lang['srv_expanded_0'].'" class="square rectangle right '.($this->expanded ? '':'active').'" onClick="window.location='.$url0.';return false;">';
+ echo '<span class="faicon collapse-new-icon"></span><span class="text hide_mobile">'.$lang['srv_collapse'].'</span>';
+ echo '</div>';
+
+ echo '</div>';// settings group
+
+ // Napredne nastavitve dropdown
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+ # preverimo ali imamo ife. Če so, izpisujemo vse ikonce
+ $sql_select = "SELECT count(*) AS if_count FROM srv_branching WHERE element_if > 0 AND ank_id = '".$this->anketa."'";
+ $sql_query = sisplet_query($sql_select);
+ $row_query = mysqli_fetch_array($sql_query);
+ $has_if = (int)$row_query['if_count'] > 0 ? true : false;
+
+ # ali prikazujemo vse ikonice ali samo "simpl" ikonice
+ $sql_select_fv = "SELECT count(*) AS full_view FROM srv_user_setting_for_survey WHERE sid='".$this->anketa."' AND uid='".$global_user_id."' AND what='display_full_toolbox' AND value='1'";
+ $sql_query_fv = sisplet_query($sql_select_fv);
+ $row_query_fv = mysqli_fetch_array($sql_query_fv);
+ $full_view = (int)$row_query_fv['full_view'] == 1 ? true : false;
+ $full_view = true;
+
+ #odpri vse - zapri vse bloki
+ if ($has_if == true && $full_view == true || ($has_if == true && $this->expanded == false)) {
+ echo '<div class="settings_group">';
+ //echo '<span class="setting_text hide_mobile">'.$lang['srv_expand_colapse'].': </span>';
+
+ echo '<div class="button" onClick="expandCollapseAllPlusMinus(\'expand\'); return false;" title="'.$lang['srv_expand_open_title'].'">';
+ echo '<span class="faicon plus_square blue right" title="'.$lang['srv_expand_open_title'].'"></span>';
+ echo '<span class="hide_mobile">'.$lang['srv_expand_open'].'</span>';
+ echo '</div>';
+
+ echo '<div class="button" onClick="expandCollapseAllPlusMinus(\'collapse\'); return false;" title="'.$lang['srv_collapse_close_title'].'">';
+ echo '<span class="faicon minus_square blue right" title="'.$lang['srv_collapse_close_title'].'"></span>';
+ echo '<span class="hide_mobile">'.$lang['srv_collapse_close'].'</span>';
+ echo '</div>';
+ echo '</div>';// settings group
+ }
+ echo '</div>';
+
+ echo '<div class="right_settings">';
+
+ echo '<div class="settings_group no_margin">';
+ // Arhiviraj - ENKLIK ARHIV
+ echo '<div class="button '.($row['locked'] == 0 ? '' : 'no_margin').'" onclick="oneClickArchive();" title="'.$lang['srv_analiza_arhiviraj_ttl2'].'">';
+ echo '<span class="faicon arhiv blue right"></span>';
+ echo '<span class="hide_mobile">'.$lang['srv_analiza_arhiviraj'].'</span>';
+ echo '</div>';
+
+ if ($row['locked'] == 0) {
+ echo '<div id="top_napredne_holder">';
+
+ echo '<div title="'.$lang['srv_quick_settings_napredno'].'" id="top_napredne_gumb" class="button no_margin" onclick="toggleSurveyTopSettings(); return false;">';
+ echo '<span id="top_napredne_icon" class="faicon ellipsis-h blue"></span>';
+ echo '</div>';
+
+ echo '<div id="top_napredne_dropdown" class="displayNone">';
+
+ # find & replace
+ echo '<p class="segment_option">';
+ echo '<a href="#" onclick="find_replace(); toggleSurveyTopSettings(); return false;" title="'.$lang['srv_find_replace_words'].'" ><span class="faicon replace"></span>'.$lang['srv_find_replace_words'].'</a>';
+ echo '</p>';
+
+ if ($full_view == true) {
+ #prelom strani
+ echo '<p class="segment_option">';
+ echo '<a href="#" onclick="javascript:pagebreak_all(); toggleSurveyTopSettings(); return false;" title="'.$lang['srv_pagebreak_all'].'"><span class="faicon paragraph"></span>'.$lang['srv_pagebreak_all'].'</a> '."\n";
+ echo '</p>';
+
+ # Hrošč je viden samo če imamo ife in razširjen pogled
+ //if ($row['flat'] == 0)
+ echo '<p class="segment_option">';
+ echo '<a href="#" onclick="javascript:check_pogoji(); toggleSurveyTopSettings(); return false;" title="'.$lang['srv_check_pogoji'].'"><span class="faicon bug"></span>'.$lang['srv_check_pogoji'].'</a> '."\n";
+ echo '</p>';
+
+ #prestevilci
+ echo '<p class="segment_option">';
+ echo '<a href="#" onclick="prestevilci(); toggleSurveyTopSettings(); return false;"><span class="faicon hashtag" title="'.$lang['srv_grupe_recount_branching'].'"></span>'.$lang['srv_grupe_recount_branching'].'</a>' . Help :: display('srv_grupe_recount_branching') ."\n";
+ echo '</p>';
+ }
+
+ echo '</div>';
+ echo '</div>';
+ }
+
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#top_napredne_dropdown");
+ var gumb = $("#top_napredne_gumb");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0 && !gumb.is(e.target) && gumb.has(e.target).length === 0){
+ $("#top_napredne_dropdown").addClass("displayNone");
+ $("#top_napredne_gumb").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+ echo '</div>'; // settings group
+ echo '</div>'; // left settings
+ echo '</div>'; //top_center_settings
echo '<ul class="first '.($this->locked?'locked':'').'">';
@@ -1019,11 +1824,14 @@ class Branching {
// napis uvod na začetku
echo '<li id="droppable_0-0" class="nodrop">';
- echo '<span class="pb_on permanent"><span>'.$lang['srv_intro_page'].'</span></span>';
+ echo ' <div class="pb_on permanent">';
+ echo ' <div class="pb_page">'.$lang['srv_intro_page'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
echo '<li id="droppable_0-0" class="nodrop">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
// Ce imamo slucajno GDPR preduvod
@@ -1040,7 +1848,7 @@ class Branching {
echo '</li>';
echo '<li id="droppable_0-0" class="nodrop">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
}
}
@@ -1063,13 +1871,14 @@ class Branching {
echo '<li id="droppable_0-0" class="drop empty_vrivanje" spr="0" if="0" endif="0">';
- echo ' <div class="empty_vrivanje_title">'.$lang['srv_new_survey_success2'].'</div>';
+ echo ' <div class="empty_vrivanje_title">'.$lang['srv_new_survey_success'].'</div>';
- echo ' <div class="empty_vrivanje_subtitle">';
- printf ($lang['srv_new_survey_success3'], 'index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=toolbox&value=3');
- echo ' </div>';
+ echo ' <div class="empty_vrivanje_buttons">';
+ echo ' <button class="medium blue" onClick="toolbox_add_advanced_popup();">'.$lang['srv_new_survey_success_button_create'].'</button>';
+ echo ' <button class="medium white-blue" onClick="displayLibraryPopup();">'.$lang['srv_new_survey_success_button_template'].'</button>';
+ echo ' </div>';
- MobileSurveyAdmin::displayNoQuestions($this->anketa);
+ MobileSurveyAdmin::displayNoQuestions($this->anketa);
echo '</li>';
}
@@ -1077,9 +1886,10 @@ class Branching {
if ($first > 0) {
+ // Uvodni element (pri formi ga ni)
if ($this->survey_type != 1) {
echo '<li id="droppable_0-0-2" class="nodrop" spr="0" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
$first = $this->find_first_spr();
@@ -1087,37 +1897,53 @@ class Branching {
// Zaenkrat imamo vedno isti text za strani
if ($first > 0){
- /*$gr = $this->getGrupa4Spremenljivka($first);*/
$gr = $this->getGrupa4Spremenljivka($first);
$naslov = $lang['srv_stran'].' '.$gr['vrstni_red'];
}
else
$naslov = $lang['srv_stran'].' 1';
- echo '<span class="pb_on permanent"><span>'.$naslov.'</span></span>';
+ echo ' <div class="pb_on permanent">';
+ echo ' <div class="pb_page">'.$naslov.'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
+
echo '</li>';
}
echo '<li id="droppable_0-0-0" class="drop" spr="0" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
}
+ // Dodani elementi v anketi (vprasanja, pogoji...)
foreach (Cache::srv_branching_parent($this->anketa, $parent) AS $k => $rowQ) {
$this->display_element($rowQ['element_spr'], $rowQ['element_if']);
}
- // zakljucek - pri formi ga ni
+ // Gumb za dodajanje vprasanja
+ if ($first > 0 && !$this->locked) {
+ echo '<li id="droppable_0-0" class="nodrop bottom_vrivanje">';
+ echo ' <div class="bottom_vrivanje_buttons">';
+ echo ' <button class="medium blue" onClick="toolbox_add_advanced_popup();">'.$lang['srv_new_survey_success_button_create'].'</button>';
+ echo ' </div>';
+ echo '</li>';
+ }
+
+ // Zakljucek - pri formi ga ni
if ($this->survey_type != 1) {
// napis zakljucek prikazemo tukaj in ne za zadnjo spremenljivko da je lepse
echo '<li id="droppable_'.'0'.'-'.'0'.'-1" class="nodrop" spr="'.'0'.'" if="0" endif="0">';
- echo '<span class="pb_on permanent"><span>'.$lang['srv_end_page'].'</span></span>';
+ echo ' <div class="pb_on permanent">';
+ echo ' <div class="pb_page">'.$lang['srv_end_page'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
echo '<li id="droppable_'.'0'.'-'.'0'.'-0" class="nodrop" spr="'.'0'.'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
echo '<li id="-2" class="spr">';
@@ -1180,18 +2006,17 @@ class Branching {
global $lang;
$row = SurveyInfo::getInstance()->getSurveyRow();
- #$this->survey_type = SurveyAdmin::getSurvey_type($this->anketa);
$this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type");
if ($row['flat'] == 0)
- $zamik = ( $this->level($spremenljivka,0) > 0 ? ' style="padding-left:'.(10+$this->level($spremenljivka,0)*20).'px"' : '' );
+ $zamik = ( $this->level($spremenljivka,0) > 0 ? ' style="padding-left:'.($this->level($spremenljivka,0)*32).'px"' : '' );
else
$zamik = '';
$row = Cache::srv_spremenljivka($spremenljivka);
$row1 = Cache::srv_branching($spremenljivka, 0);
- echo '<li id="branching_'.$spremenljivka.'" class="spr'.' '.($row['tip']==22?' calculation':'').' '.($row['tip']==25?' quota':'').'" '.$zamik.' tip="'.$row['tip'].'" signature="'.$row['signature'].'">';
+ echo '<li id="branching_'.$spremenljivka.'" class="spr spr_tip_'.$row['tip'].' '.($row['tip']==22?' calculation':'').' '.($row['tip']==25?' quota':'').'" '.$zamik.' tip="'.$row['tip'].'" signature="'.$row['signature'].'">';
if ($this->expanded) {
$this->vprasanje($spremenljivka);
} else {
@@ -1199,76 +2024,75 @@ class Branching {
}
echo '</li>';
- //echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="'.$row['id'].'" if="0" endif="0">';
if ($this->pagebreak($spremenljivka)) {
+
$gr = $this->getGrupa4Spremenljivka($this->find_next_spr($spremenljivka));
+
if ($gr['id'] > 0) {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-2" class="drop" spr="'.$row['id'].'" if="0" endif="0" drop="2">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
// ++ zadnji pagebreak prikazan izven ifa //
// ce je spremenljivka zadnja v IFu, ne prikazemo PB, ker ga bomo za ENDIFom
$rows = Cache::srv_branching($spremenljivka, 0);
if ( $this->find_last_in_if($rows['parent']) != $spremenljivka ) {
- echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-1" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
- //echo '<span class="pb_on" title="'.$lang['srv_rem_pagebreak'].'"><span>'.$gr['naslov'].'</span></span>';
- echo '<span class="pb_on" title="'.$lang['srv_rem_pagebreak'].'"><span>'.$lang['srv_stran'].' '.$gr['vrstni_red'].'</span></span>';
+
+ echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-1" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
+ echo ' <div class="pb_on not-permanent" title="'.$lang['srv_rem_pagebreak'].'">';
+ echo ' <div class="pb_page">'.$lang['srv_stran'].' '.$gr['vrstni_red'].'</div>';
+ echo ' <div class="pb_page_hover"><span class="faicon delete_circle"></span>'.$lang['srv_rem_pagebreak'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
+
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-0" class="drop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
}
- // -- zadnji pagebreak prikazan izven ifa //
- } elseif($this->survey_type != 1) {
+
+ }
+ // -- zadnji pagebreak prikazan izven ifa //
+ elseif($this->survey_type != 1) {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-2" class="drop" spr="'.$row['id'].'" if="0" endif="0" drop="2">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
-
- /*echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-1" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_on">'.$lang['srv_end_label'].'</span>';
- echo '</li>';
-
- echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-0" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
- echo '</li>';*/
}
- } elseif ($spremenljivka == $this->find_last_spr() && $this->survey_type != 1) { // zadnja spremenljivka - zakljucek
+ }
+ elseif ($spremenljivka == $this->find_last_spr() && $this->survey_type != 1) { // zadnja spremenljivka - zakljucek
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-2" class="drop" spr="'.$row['id'].'" if="0" endif="0" drop="2">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
- /*echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-1" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_on">'.$lang['srv_end_label'].'</span>';
- echo '</li>';
-
- echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-0" class="nodrop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
- echo '</li>';*/
-
- } elseif ($this->survey_type != 1) { //pri formi ne dovolimo dodajanja page-breakov
+ }
+ // pri formi ne dovolimo dodajanja page-breakov
+ elseif ($this->survey_type != 1) {
// tuki pustimo, da se PB lahko dodaja za spremenljivko in za ifom (pol se prikaze za ifom)
// -- v zadnji spremenljivki za ifom ne prikazemo dodajanja
$rows = Cache::srv_branching($spremenljivka, 0);
if ( $this->find_last_in_if($rows['parent']) != $spremenljivka ) {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_new" title="'.$lang['srv_add_pagebreak'].'"></span>';
+ echo ' <div class="pb_new" title="'.$lang['srv_add_pagebreak'].'">';
+ echo ' <div class="pb_page_hover"><span class="faicon paragraph"></span>'.$lang['srv_add_pagebreak'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
- } else { // zadnji spremenljivki v ifu izpisemo PB izven ifa (da je bolj pregledno in lepse)
+ }
+ // zadnji spremenljivki v ifu izpisemo PB izven ifa (da je bolj pregledno in lepse)
+ else {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="'.$row['id'].'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
}
- } elseif ($this->survey_type == 1) { // forma
+ }
+ // forma
+ elseif ($this->survey_type == 1) {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="'.$row['id'].'" if="0" endif="0">';
echo '</li>';
}
-
- //echo '</li>';
-
}
function display_if_label($if) {
@@ -1282,7 +2106,7 @@ class Branching {
if ($rowb['tip'] == 0) {
$this->conditions_display($if);
} elseif ($rowb['tip'] == 1) {
- echo '<strong class="clr_bl">BLOCK</strong> <span class="colorblock">('.$rowb['number'].')</span>'.($rowb['enabled']==2?' FALSE ':'').($rowb['label']!=''?' <span class="if_comment">( '.$rowb['label'].' )</span>':'').'';
+ echo '<span class="clr_bl">BLOCK</span> <span class="colorblock">('.$rowb['number'].')</span>'.($rowb['enabled']==2?' FALSE ':'').($rowb['label']!=''?' <span class="if_comment">( '.$rowb['label'].' )</span>':'').'';
} elseif ($rowb['tip'] == 2) {
$this->loop_display($if);
}
@@ -1299,7 +2123,7 @@ class Branching {
$rowb = Cache::srv_if($if);
if ($row['flat'] == 0)
- $zamik = ( $this->level(0,$if) > 0 ? ' style="padding-left:'.(10+$this->level(0,$if)*20).'px"' : '' );
+ $zamik = ( $this->level(0,$if) > 0 ? ' style="padding-left:'.($this->level(0,$if)*32).'px"' : '' );
else
$zamik = '';
@@ -1308,7 +2132,7 @@ class Branching {
// plusminus
if ($row['flat'] == 0)
- echo '<a class="pm '.($rowb['collapsed']==1 && $row['flat']==0?'plus':'minus').'"></a>';
+ echo '<span class="pm faicon '.($rowb['collapsed']==1 && $row['flat']==0 ? 'plus' : 'minus').'"></span>';
$this->display_if_label($if);
@@ -1333,28 +2157,41 @@ class Branching {
$sqle = sisplet_query("SELECT ank_id, parent, element_spr, element_if FROM srv_branching WHERE parent='{$rowi['parent']}' AND vrstni_red>'{$rowi['vrstni_red']}' AND ank_id='$this->anketa'");
- if ($rows['pagebreak'] == 1 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) {
+ if (isset($rows['pagebreak']) && $rows['pagebreak'] == 1 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) {
$gr = $this->getGrupa4Spremenljivka($this->find_next_spr($spr));
if ($gr['id'] > 0) {
- echo '<li './*id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-2"*/' class="nodrop" spr="'.$spr.'" if="0" endif="0">';
- echo '<span class="pb_off"></span>';
+ echo '<li class="nodrop" spr="'.$spr.'" if="0" endif="0">';
+ echo ' <div class="pb_off"></div>';
echo '</li>';
- echo '<li './*id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'-1"*/' class="nodrop" spr="'.$spr.'" if="0" endif="0">';
- echo '<span class="pb_on" title="'.$lang['srv_rem_pagebreak'].'">'.$lang['srv_stran'].' '.$gr['vrstni_red'].'</span>';
+
+ echo '<li class="nodrop" spr="'.$spr.'" if="0" endif="0">';
+ echo ' <div class="pb_on not-permanent" title="'.$lang['srv_rem_pagebreak'].'">';
+ echo ' <div class="pb_page">'.$lang['srv_stran'].' '.$gr['vrstni_red'].'</div>';
+ echo ' <div class="pb_page_hover"><span class="faicon delete_circle"></span>'.$lang['srv_rem_pagebreak'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
}
-
}
// zadnji spremenljivki v ifu, tudi dodamo PB izven pagebreaka (da se doda, tam kjer se potem prikaže)
- if ($rows['pagebreak'] == 0 AND (mysqli_num_rows($sqle)>0 || $rowi['parent']==0) ) {
+ // ce gre za zadnji if v anketi ne pustimo dodajanja page breaka
+ if (isset($rows['pagebreak']) && $rows['pagebreak'] == 0
+ && (mysqli_num_rows($sqle) > 0 || $rowi['parent'] == 0)
+ && ($if != $this->find_last_if_branching())
+ ){
+
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="0" if="'.$if.'" endif="1" spr_pb="'.$spr.'">';
- echo '<span class="pb_new" title="'.$lang['srv_add_pagebreak'].'"></span>';
+ echo ' <div class="pb_new" title="'.$lang['srv_add_pagebreak'].'">';
+ echo ' <div class="pb_page_hover"><span class="faicon paragraph"></span>'.$lang['srv_add_pagebreak'].'</div>';
+ echo ' <div class="pb_line"></div>';
+ echo ' </div>';
echo '</li>';
- } else {
+ }
+ else {
echo '<li id="droppable_'.$row1['parent'].'-'.$row1['vrstni_red'].'" class="drop" spr="0" if="'.$if.'" endif="1">';
echo '</li>';
}
@@ -1370,8 +2207,8 @@ class Branching {
$rowb = Cache::srv_if($if);
if ($row['flat'] == 0) {
- $zamik = ($this->level(0, $if) > 0 ? ' style="padding-left:' . (10 + $this->level(0, $if) * 20) . 'px"' : '');
- $zaklepaj = ($this->level(0, $if) > 0 ? 'margin-left:-' . (10 + $this->level(0, $if) * 20) . 'px;width:' . (15 + $this->level(0, $if) * 20) . 'px;' : '');
+ $zamik = ($this->level(0, $if) > 0 ? ' style="padding-left:' . ($this->level(0, $if) * 32) . 'px"' : '');
+ $zaklepaj = ($this->level(0, $if) > 0 ? 'margin-left:-' . ($this->level(0, $if) * 32) . 'px;width:' . ($this->level(0, $if) * 32) . 'px;' : '');
}
else {
$zamik = '';
@@ -1386,11 +2223,12 @@ class Branching {
}
echo '<li id="branching_endif'.$if.'" class="'.($rowb['tip']==0?'endif':($rowb['tip']==1?'endblock':'endloop')).'"'.$zamik.'>';
- echo '<span class="'.($rowb['tip']==0?' clr_if':($rowb['tip']==1?' clr_bl':' clr_lp')).'"><strong>'.($rowb['tip']==0?'ENDIF':($rowb['tip']==1?'ENDBLOCK':'ENDLOOP')).'</strong></span> <span class="'.($rowb['tip']==0?'colorif':($rowb['tip']==1?'colorblock':'colorloop')).'">('.$rowb['number'].')</span>'."\n\r";
+ echo '<span class="'.($rowb['tip']==0?' clr_if':($rowb['tip']==1?' clr_bl':' clr_lp')).'">'.($rowb['tip']==0?'ENDIF':($rowb['tip']==1?'ENDBLOCK':'ENDLOOP')).'</span> <span class="'.($rowb['tip']==0?'colorif':($rowb['tip']==1?'colorblock':'colorloop')).'">('.$rowb['number'].')</span>'."\n\r";
// Dodajanje komentarjev na if/blok
if ($this->displayKomentarji !== false) {
- $this->if_komentarji($if, $rowb['tip']);
+ $sc = new SurveyComments($this->anketa);
+ $sc->display_if_komentarji($if, $rowb['tip']);
}
echo '</li>';
@@ -1423,15 +2261,15 @@ class Branching {
// Kvota
if($tip == 25){
$SQ = new SurveyQuotas($this->anketa);
- echo '<span class="quotavariable">('.$variable.')</span> '.$SQ->quota_display(-$spremenljivka).' <span class="spr_comment">( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )</span>';
+ echo '<span class="quotavariable">('.$variable.')</span> '.$SQ->quota_display(-$spremenljivka).' <span class="spr_comment">('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')</span>';
}
// Kalkulacija
else if($tip == 22){
- echo '<span class="calculationvariable">('.$variable.')</span> '.$this->calculations_display(-$spremenljivka).' <span class="spr_comment">( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )</span>';
+ echo '<span class="calculationvariable">('.$variable.')</span> '.$this->calculations_display(-$spremenljivka).' <span class="spr_comment">('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')</span>';
}
// Navadne spremenljivke
else{
- echo '<span class="colorvariable">('.$variable.')</span> '.$spanred.skrajsaj(strip_tags($naslov), 80).($spanred!=''?'</span>':'').' <span class="spr_comment">( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )</span>';
+ echo '<span class="colorvariable">('.$variable.')</span> '.$spanred.skrajsaj(strip_tags($naslov), 80).($spanred!=''?'</span>':'').' <span class="spr_comment">('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')</span>';
}
}
@@ -1450,6 +2288,13 @@ class Branching {
global $site_url;
$row = Cache::srv_spremenljivka($spremenljivka);
+
+ // novi missingi - vse tabele razen kombinirane
+ //dodatne missing vrednosti (ne vem, zavrnil...)
+ # preberemo iz class.SurveyMissingValues
+ $smv = new SurveyMissingValues($this->anketa);
+ # katere missinge imamo na voljo
+ $missing_values = $smv->GetUnsetValuesForSurvey();
$this->prevajanje = $prevajanje;
@@ -1461,9 +2306,10 @@ class Branching {
save('lang_id', $this->lang_id);
$rowl = \App\Controllers\LanguageController::srv_language_spremenljivka($spremenljivka);
- if (strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['info']) != '') $row['info'] = $rowl['info'];
- if ($rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
+
+ if (isset($rowl['naslov']) && strip_tags($rowl['naslov']) != '') $row['naslov'] = $rowl['naslov'];
+ if (isset($rowl['info']) && strip_tags($rowl['info']) != '') $row['info'] = $rowl['info'];
+ if (isset($rowl['vsota']) && $rowl['vsota'] != '') $row['vsota'] = $rowl['vsota'];
}
$this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type");
@@ -1497,13 +2343,15 @@ class Branching {
$string = '';
// statusi: reminder, timer, in še kaj
if ($row['sistem'] == 1)
- $string = $string . $lang['srv_system_text'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_system_text'].'</span>';
if ($row['visible'] == 0)
- $string .= $lang['srv_hidden_text'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_hidden_text'].'</span>';
if ($row['dostop'] != 4) {
- $string = $string . $lang['srv_visible_dostop'].' ';
+
+ $string .= '<span class="item">'.$lang['srv_visible_dostop'].' ';
+
switch ($row['dostop']) {
case 3: $string .= strtolower($lang['see_registered']);
break;
@@ -1514,65 +2362,62 @@ class Branching {
case 0; $string .= strtolower($lang['see_admin']);
break;
}
- $string .= '&nbsp;|&nbsp;';
+ $string .= '</span>';
}
if ($row['reminder'] > 0) {
if ($row['reminder'] == 1) {
- // echo '<img src="img_'.$this->skin.'/reminder_soft.png" alt="'.$lang['srv_reminder_soft'].'" />';
- $string = $string . $lang['srv_reminder_soft'];
- } else {
- // echo '<img src="img_'.$this->skin.'/reminder_hard.png" alt="'.$lang['srv_reminder_hard'].'" />';
- $string = $string . $lang['srv_reminder_hard'];
+ $string .= '<span class="item">'.$lang['srv_reminder_soft'].'</span>';
+ }
+ else {
+ $string .= '<span class="item">'.$lang['srv_reminder_hard'].'</span>';
}
- $string = $string . '&nbsp;|&nbsp;';
}
$sqlv = sisplet_query("SELECT spr_id, if_id FROM srv_validation WHERE spr_id = '$spremenljivka'");
if (mysqli_num_rows($sqlv) > 0) {
- $string = $string . $lang['srv_validation'];
- $string = $string . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_validation'].'</span>';
}
if ($row['timer'] > 0) {
- $string = $string . $lang['srv_timer_on_time'];
- $string = $string . (substr(bcdiv($row['timer'], 60), 0, 4)) . '' . $lang['srv_minutes'] . ' ';
- $string = $string . (bcmod($row['timer'], 60)) . '' . $lang['srv_seconds'] . '';
- $string = $string . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_timer_on_time'];
+ $string .= (substr(bcdiv($row['timer'], 60), 0, 4)) . '' . $lang['srv_minutes'] . ' ';
+ $string .= (bcmod($row['timer'], 60)) . '' . $lang['srv_seconds'] . '';
+ $string .= '</span>';
}
//izrišemo še ostale statuse: statistika, orientacija, sortiranje
if ($row['tip'] <= 3 && $row['stat'] && $this->survey_type != 0) {
- $string = $string . $lang['srv_stat_on'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_stat_on'].'</span>';
}
// Status orentacije - navadna vprasanja
if((in_array($row['tip'], array('1', '2', '21', '7', '8')) && $row['orientation'] != '1') || ($row['tip'] == '3' && $row['orientation'] == '1')){
- $string .= $this->getVprasanjeOrientationString($row['tip'], $row['orientation']) . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$this->getVprasanjeOrientationString($row['tip'], $row['orientation']) . '</span>';
}
// Status orentacije - tabele
elseif(in_array($row['tip'], array('6', '16')) && $row['enota'] != '0'){
- $string .= $this->getVprasanjeOrientationString($row['tip'], $row['enota']) . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$this->getVprasanjeOrientationString($row['tip'], $row['enota']) . '</span>';
}
if ($row['tip'] == 1 && $row['hidden_default'] == 1) {
- $string = $string . $lang['srv_potrditev'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_potrditev'].'</span>';
}
if ($row['random']) {
$arrayRandomText = array (
- 0 => $lang['srv_random_off'],
- 1 => $lang['srv_random_on'],
- 2 => $lang['srv_sort_asc'],
- 3 => $lang['srv_sort_desc']
+ 0 => $lang['srv_random_off'],
+ 1 => $lang['srv_random_on'],
+ 2 => $lang['srv_sort_asc'],
+ 3 => $lang['srv_sort_desc']
);
- $string = $string . $arrayRandomText[$row['random']] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$arrayRandomText[$row['random']].'</span>';
}
//skriti checkboxi
if ($row['checkboxhide'] != 0)
- $string = $string . $lang['srv_checkboxhide_disabled'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_checkboxhide_disabled'].'</span>';
// Kljucavnica ce je vprasanje zaklenjeno
if($question_locked){
@@ -1580,22 +2425,20 @@ class Branching {
}
// Ce je zaklenjeno ampak ga lahko ureja ker je admin ali avtor
elseif($row['locked']){
- $string = $string . $lang['srv_locked_text'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_locked_text'].'</span>';
}
// Ce je onemogoceno vprasanje
$disabled_vprasanje = $spremenljivkaParams->get('disabled_vprasanje') ? $spremenljivkaParams->get('disabled_vprasanje') : 0;
if($disabled_vprasanje){
- $string = $string . $lang['srv_disabled_text'] . '&nbsp;|&nbsp;';
+ $string .= '<span class="item">'.$lang['srv_disabled_text'].'</span>';
}
- //zbrisemo zadnji "|" iz niza
- $string = substr($string, 0, -7);
- $string = '<span class="red">' . $string . '</span>';
echo $string;
echo '</div>';
+
echo '</div>'; // - spremenljivka_settings
// --- Zgornja vrstica pri editiranju vprasanj -->
@@ -1614,12 +2457,12 @@ class Branching {
// kalkulacija
if ($row['tip'] == 22) {
- $row['naslov'] = ''.$this->calculations_display(-$spremenljivka).' <span class="spr_comment">( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )</span>';
+ $row['naslov'] = ''.$this->calculations_display(-$spremenljivka).' <span class="spr_comment">('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')</span>';
}
// Kvota
else if($row['tip'] == 25){
$SQ = new SurveyQuotas($this->anketa);
- $row['naslov'] = ''.$SQ->quota_display(-$spremenljivka).' <span class="spr_comment">( '.$lang['srv_vprasanje_tip_long_'.$row['tip']].' )</span>';
+ $row['naslov'] = ''.$SQ->quota_display(-$spremenljivka).' <span class="spr_comment">('.$lang['srv_vprasanje_tip_long_'.$row['tip']].')</span>';
}
// Inline ifi so disablani ce nimamo ustreznega paketa
@@ -1627,14 +2470,6 @@ class Branching {
echo '<div id="spremenljivka_contentdiv' . $spremenljivka . '" class="content_div_normalmode">';
- if ( in_array($row['tip'], array(1,2,6,16,19,20)) ) {
- if ($row['enota'] != 10 && $row['orientation'] != 10){
- echo '<div class="add-variable tip_'.$row['tip'].'"><a href="#" onclick="vprasanje_fullscreen(\''.$spremenljivka.'\'); return false;" title="'.$lang['srv_novavrednost'].'"><span class="faicon add small"></span> '.$lang['srv_novavrednost'].'</a></div>';
-
- MobileSurveyAdmin::displayAddQuestionCategory($this->anketa, $spremenljivka, $row['tip']);
- }
- }
-
// kalkulacija
if ($row['tip'] == 22) {
echo '<div class="naslov '.($row['orientation']==0?'floatLeft':'').' calculation">';
@@ -1666,13 +2501,13 @@ class Branching {
@include($file);
}
else{
- echo '<div class="naslov '.($row['orientation']==0?'':'').' naslov_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row['id'].'" '.(strpos($row['naslov'], $lang['srv_new_vprasanje'])!==false || strpos($row['naslov'], $lang1['srv_new_vprasanje'])!==false || $this->lang_id!=null ? ' default="1"':'').'>';
+ echo '<div class="naslov '.($row['orientation']==0?'':'').' naslov_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row['id'].'" '.(strpos($row['naslov'], $lang['srv_new_vprasanje'])!==false || (isset($lang1['srv_new_vprasanje']) && strpos($row['naslov'], $lang1['srv_new_vprasanje'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>';
echo $row['naslov'];
echo '</div>';
}
if ($row['info'] != '')
- echo '<div class="spremenljivka_info info_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row['id'].'" '.($row['info']==$lang['note'] || $row['info']==$lang1['note'] || $this->lang_id!=null ? ' default="1"':'').'>' . $row['info'] . '</div>';
+ echo '<div class="spremenljivka_info info_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row['id'].'" '.($row['info']==$lang['note'] || (isset($lang1['note']) && $row['info']==$lang1['note']) || $this->lang_id!=null ? ' default="1"':'').'>' . $row['info'] . '</div>';
echo '<span class="faicon edit-vprasanje icon-as_link display_editor" onclick="inline_load_editor(this); return false;"></span>';
@@ -1696,7 +2531,7 @@ class Branching {
else{
echo'
<script>
- $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html("'.$r['info'].'");
+ $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html('.json_encode($r['info']).');
</script>
';
}
@@ -1716,7 +2551,7 @@ class Branching {
else{
echo'
<script>
- $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html("'.$r['info'].'");
+ $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html('.json_encode($r['info']).');
</script>
';
}
@@ -1737,7 +2572,7 @@ class Branching {
else{
echo'
<script>
- $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html("'.$r['info'].'");
+ $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html('.json_encode($r['info']).'));
</script>
';
}
@@ -1757,7 +2592,7 @@ class Branching {
else{
echo'
<script>
- $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html("'.$r['info'].'");
+ $("#spremenljivka_content_'.$spremenljivka.' div.spremenljivka_info.info_inline").html('.json_encode($r['info']).');
</script>
';
}
@@ -1766,11 +2601,14 @@ class Branching {
}
- echo '<div id="variable_holder" class="variable_holder '.($this->lang_id==null?'allow_new':'').'"><!-- variable holder -->';
+ $leftmargin = (($row['tip'] <= 2 && $row['orientation'] == 10) || ($row['tip'] == 1 && ($row['orientation'] == 9 || $row['orientation'] == 11)))
+ ? ' left11' : '';
+
+ echo '<div id="variable_holder" class="variable_holder '.($this->lang_id==null?'allow_new':'').$leftmargin.'"><!-- variable holder -->';
// radio, checkbox, select
if ($row['tip'] <= 3) {
-
+
if ($row['tip'] == 3 || $row['orientation'] == 6)
echo '<div class="edit_mode '.($this->lang_id==null?'allow_new':'').'">';
@@ -1829,6 +2667,8 @@ class Branching {
$num = mysqli_num_rows($sql1);
$size = $num * 50;
+ echo '<div class="ranking_holder">';
+
//zaslon razdelimo na dva dela - izris leve strani
echo '<div id="half" class="dropzone '.($this->lang_id==null?'allow_new':'').'" style="width: 50%; min-height:' . $size . 'px; float: left; border-right: 1px solid black;">';
@@ -1865,47 +2705,57 @@ class Branching {
//echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
echo '<div class="variabla" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
// Ikona za upload slike
- echo ' <span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
+ echo ' <span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
+
echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
//koda za notranji IF
if ($row1['if_id'] > 0) {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
}
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
}
else{
if ($length > 30) $class = 'ranking_long'; $class = 'ranking';
- //echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
+
echo '<div class="variabla" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
+
echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
- //koda za notranji IF
+
+ // koda za notranji IF
if ($row1['if_id'] > 0) {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
- }
+ }
+
+ echo ' <div class="icons_holder no_grow">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
}
@@ -1924,8 +2774,7 @@ class Branching {
echo '</div>';
- echo '<div class="clr"></div>';
-
+ echo '</div>';
}
//Image hot spot @ radio ********************************************************************************************************
@@ -1968,20 +2817,24 @@ class Branching {
// Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec
$missing_warning = '';
- if(($row1['other'] == '-97' && $row['alert_show_97'] > 0)
+ if(($row1['other'] == '-96' && $row['alert_show_96'] > 0)
+ || ($row1['other'] == '-97' && $row['alert_show_97'] > 0)
|| ($row1['other'] == '-98' && $row['alert_show_98'] > 0)
|| ($row1['other'] == '-99' && $row['alert_show_99'] > 0)){
$missing_warning = ' red';
}
if ($row['tip'] == 1 && $row['orientation'] != 8 && $row['orientation'] != 10) {
- //echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'"><span class="sprites move_updown_orange inline inline_move" title="'.$lang['srv_move'].'"></span> <input type="radio" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" /> <label for="foo_' . $row1['id'] . '">' . $row1['naslov'] . '</label>';
+
if($row['orientation'] == 6){
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">
+ <span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>
+ <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div>
+ <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
elseif($row['orientation'] == 7){
- //echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span><div class="variable_inline variable_inline_'.$row['id'].'" contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false?' default="1"':'').'>' . $row1['naslov'] . '</div> <input type="radio" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" onclick="return false" />';
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span><div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span><div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
if ($row1['other'] == 1){
$otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1);
@@ -1997,44 +2850,62 @@ class Branching {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
}
+
+ if($row1['other'] != 0 && $row1['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$row1['other']].'</span>
+ </div>
+ <div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($row1['other']).'_'.$row['id'].'" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="1"
+ '.($row['alert_show_'.abs($row1['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$row['id'].');">
+ <label for="alert_show_'.abs($row1['other']).'_'.$row['id'].'" class="title"><span id="alert_show_'.abs($row1['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>
+ </div>';
+ }
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
if($row['tip'] == 1)
- echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_no '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
-
+ echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo '</div>';
echo '<input type="radio" class="enka-admin-custom" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" onclick="return false" />';
echo '<span class="enka-checkbox-radio"></span>';
- echo'</div>';
+ echo '</div>';
}
elseif($row['orientation'] == 9){
echo '<div class="variabla custom_radio ' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">
- <label>
<input type="radio" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" onclick="return false" />
- <span class="enka-custom-radio '.($spremenljivkaParams->get('customRadio') ? $spremenljivkaParams->get('customRadio') : '').'"></span>
+ <label><span class="enka-custom-radio '.($spremenljivkaParams->get('customRadio') ? $spremenljivkaParams->get('customRadio') : '').'"></span>
<div class="custom_radio_answer">('.$row1['naslov'].')</div>
</label>
</div>';
}
elseif( $row['orientation'] == 11){
-
+ //ali so smeskoti pobarvani ali samo sivi
+ $colored = ($spremenljivkaParams->get('visual_type') == 1 ? 'colored' : '');
$stVsehEnot = mysqli_num_rows($sql1);
//
echo '<div class="variabla custom_radio visual-radio-scale ' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">
<label>
<input type="radio" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" onclick="return false" />
- <span class="enka-vizualna-skala siv-'.$stVsehEnot.$row1['naslov'].'"></span>
+ <span class="enka-vizualna-skala siv-'.$stVsehEnot.$row1['naslov'].' '.$colored.'"></span>
<div class="custom_radio_answer">('.$row1['naslov'].')</div>
</label>
</div>';
@@ -2048,27 +2919,27 @@ class Branching {
echo ' <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div>';
// Ikona za upload slike
- echo ' <span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
+ echo ' <span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
// Slika oz. text (brez moznosti editiranja) - samo če je vnesen kaksen text ali slika
- echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
else{
echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
echo ' <span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <input type="radio" class="enka-admin-custom enka-inline" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" onclick="return false" /><span class="enka-checkbox-radio"></span>';
echo ' <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div>';
- echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
}
}
elseif ($row['tip'] == 2 && $row['orientation'] != 10) {
if($row['orientation'] == 6){
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
elseif($row['orientation'] == 7){
//echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id="'.$row1['id'].'" contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false?' default="1"':'').'>' . $row1['naslov'] . '</div><input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" ' . (($row['checkboxhide'] == 1) ? 'class="hidden" ' : '') . ' onclick="return false" />';
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id="'.$row1['id'].'" contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id="'.$row1['id'].'" contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
if ($row1['other'] == 1){
$otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1);
@@ -2084,7 +2955,7 @@ class Branching {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
@@ -2092,13 +2963,32 @@ class Branching {
echo ' <span class="faicon warning icon-orange"></span>';
}
+ if($row1['other'] != 0 && $row1['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$row1['other']].'</span>
+ </div>
+ <div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($row1['other']).'_'.$row['id'].'" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="1"
+ '.($row['alert_show_'.abs($row1['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$row['id'].');">
+ <label for="alert_show_'.abs($row1['other']).'_'.$row['id'].'" class="title"><span id="alert_show_'.abs($row1['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>
+ </div>';
+ }
+
+ echo ' <div class="icons_holder">';
+
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
if($row['tip'] == 1)
- echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
+ echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
-
+ echo ' </div>';
echo'<input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="enka-admin-custom ' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onclick="return false" />';
echo '<span class="enka-checkbox-radio"></span>';
@@ -2113,19 +3003,19 @@ class Branching {
echo ' <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div>';
// Ikona za upload slike
- echo ' <span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
+ echo ' <span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''.$row1['id'].'\', false); return false;" title="'.$lang['upload_img2'].'"></span>';
// Slika oz. text (brez moznosti editiranja) - samo če je vnesen kaksen text ali slika
- echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
else{
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="enka-admin-custom enka-inline' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onclick="return false" /><span class="enka-checkbox-radio"></span><div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id="'.$row1['id'].'" contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="enka-admin-custom enka-inline' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onclick="return false" /><span class="enka-checkbox-radio"></span><div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id="'.$row1['id'].'" contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline '.$missing_warning.'" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
}
}
elseif ($row['tip'] == 3) {
//echo ' <option value="">' . $row1['naslov'] . '</option>';
- echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
+ echo ' <div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'"><span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span> <div class="variable_inline variable_inline_'.$row['id'].'" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" vre_id='.$row1['id'].' tabindex="1">'.$row1['variable'].'</div><div id="vre_id_' . $row1['id'] . '" vre_id='.$row1['id'].' contenteditable="'.(!$locked?'true':'false').'" class="vrednost_inline" tabindex="1" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'] . '</div>';
}
@@ -2144,28 +3034,53 @@ class Branching {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
}
+
+ if($row1['other'] != 0 && $row1['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$row1['other']].'</span>
+ </div>';
+
+ //if($row['tip'] != 3) {
+ echo '<div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($row1['other']).'_'.$row['id'].'" name="alert_show_'.abs($row1['other']).'_'.$row['id'].'" value="1"
+ '.($row['alert_show_'.abs($row1['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$row['id'].');">
+ <label for="alert_show_'.abs($row1['other']).'_'.$row['id'].'" class="title"><span id="alert_show_'.abs($row1['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>';
+ //}
+
+ echo '</div>';
+ }
+
+
+ echo ' <div class="icons_holder">';
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
// Kljukica za kviz
if(SurveyInfo::getInstance()->checkSurveyModule('quiz')){
- $sqlQ = sisplet_query("SELECT * FROM srv_quiz_vrednost WHERE spr_id='".$row['id']."' AND vre_id='".$row1['id']."'");
+ $sqlQ = sisplet_query("SELECT * FROM srv_quiz_vrednost WHERE spr_id='".$row['id']."' AND vre_id='".$row1['id']."'");
echo ' <span class="faicon correct inline '.(mysqli_num_rows($sqlQ) > 0 ? ' show-correct' : '').'" spr_id="'.$row['id'].'" vre_id="'.$row1['id'].'" title="'.$lang['srv_vrednost_correct'].'"></span>';
}
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
-
- if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 3)
- echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
+
+ if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 3)
+ echo ' <span class="faicon odg_if_follow inline inline_if_follow '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="follow_up_condition(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_follow_up'].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
echo '</div>';
@@ -2214,7 +3129,8 @@ class Branching {
echo '</div>';
}
}
- // multigrid, multicheckbox, multitext, multinumber prikaz
+
+ // multigrid, multicheckbox, multitext, multinumber prikaz
elseif ($row['tip'] == 6 || $row['tip'] == 16 || $row['tip'] == 19 || $row['tip'] == 20 || $row['tip'] == 24) {
$spremenljivkaParams = new enkaParameters($row['params']);
@@ -2259,7 +3175,44 @@ class Branching {
$sizebox = '$("#grids_count option:selected").val()';
$display = ($row['tip'] == 6 && $row['enota'] == 8) ? ' style="display:none;"' : '';
- $grid_plus_minus = '<div class="grid-plus-minus"><a href="#" onclick="change_selectbox_size_1(\'' . $row['id'] . '\', \'' . $lang['srv_select_box_vse'] . '\'); grid_plus_minus(\'1\'); return false;" title="'.$lang['srv_grid_add'].'"><span class="faicon add small '.$spremenljivka.'" '.$display.'></span></a> <a href="#" onclick="grid_plus_minus(\'0\'); return false;" title="'.$lang['srv_grid_remove'].'"><span class="faicon delete_circle"></span></a></div>';
+
+ #kateri missingi so nastavljeni
+ //ignoriraj pri testiranje->komentarji
+ if($_GET['a'] !== 'komentarji' && $_GET['a'] !== 'komentarji_anketa'){
+ $already_set_mv = array();
+ $sql_grid_mv = sisplet_query("SELECT naslov, other FROM srv_grid WHERE spr_id='".$spremenljivka."' AND other != 0");
+
+ while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
+ $already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov'];
+ }
+
+ $missing_menu_items = '';
+
+ if (count($missing_values) > 0) {
+ foreach ($missing_values AS $mv_key => $mv_text) {
+ $missing_menu_items =
+ '<li><input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').'
+ name="missing_value_checkbox_'.$row['id'].'[]" id="missing_value_'.$row['id'].'_'.$mv_key.'" value="'.$mv_key.'" title="'.$mv_text.'"
+ onChange="grid_add_remove_missing(this, '.$row['id'].');">
+ <label for="missing_value_'.$row['id'].'_'.$mv_key.'" class="pointer">'.$mv_text.'</label></li>'
+ .$missing_menu_items;
+ }
+ }
+
+ $grid_plus_minus = '<div class="grid-plus-minus">
+ <a href="#" onclick="change_selectbox_size_1(\'' . $row['id'] . '\', \'' . $lang['srv_select_box_vse'] . '\'); grid_plus_minus(\'1\'); return false;" title="'.$lang['srv_grid_add'].'"><span class="faicon add '.$spremenljivka.'" '.$display.'></span></a>
+ <a href="#" onclick="grid_plus_minus(\'0\'); return false;" title="'.$lang['srv_grid_remove'].'"><span class="faicon delete_circle"></span></a>
+ <a href="#" onclick="toggle_missing_dropdown_table('.$spremenljivka.'); return false;" title="'.$lang['srv_manjkajoce_vrednosti'].'"><span class="faicon fa-ellipsis-h"></span></a>
+ </div>
+ <div id="table_missings_menu_'.$spremenljivka.'" class="table_missings_menu">
+ <form name="vprasanje_edit">
+ <ul>
+ <li><strong>'.$lang['srv_manjkajoce_vrednosti'].' '.Help::display('srv_missing_values').'</strong></li>
+ '.$missing_menu_items.'
+ </ul></form></div>
+ ';
+ }
+ //konec missingov
//izrisemo multigride z dropdowni in select box
if($row['tip'] == 6 && ($row['enota'] == 2 || $row['enota'] == 6)) {
@@ -2310,7 +3263,7 @@ class Branching {
if ($naslov != '') $row2['naslov'] = $naslov;
}
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
}
@@ -2354,12 +3307,15 @@ class Branching {
echo '<tr class="variabla" id="variabla_'.$row1['id'].'">';
echo '<td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="f_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
if ($row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
@@ -2382,7 +3338,7 @@ class Branching {
$sql2 = sisplet_query("SELECT id, naslov, vrstni_red FROM srv_grid WHERE spr_id='$row[id]' AND other=0 ORDER BY vrstni_red");
$row2 = mysqli_fetch_array($sql2);
- echo '<td class="preview_mode">';
+ echo '<td class="preview_mode" style="width: 320px;">';
if ($row['enota'] == 6){
echo '<select style="width: 100px;" multiple="">';
@@ -2502,7 +3458,7 @@ class Branching {
if ($naslov != '') $row2['naslov'] = $naslov;
}
if ($row2['vrstni_red'] == $i) {
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
} else {
echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
@@ -2544,12 +3500,15 @@ class Branching {
echo '<tr class="variabla" id="variabla_'.$row1['id'].'">';
echo '<td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="f_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost_grid'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
if ($row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
@@ -2637,7 +3596,7 @@ class Branching {
echo ' <thead>';
- echo ' <tr>';
+ echo ' <tr class="row_subtitle">';
echo ' <td></td>';
echo ' <td style="width:' . $spacesize . '%"></td>';
@@ -2656,26 +3615,25 @@ class Branching {
}
// Urejanje podnaslova 1. grida
- echo ' <td class="grid_header" colspan="'.$colspan.'">';
- echo '<div class="grid_subtitle_inline" grid_id=1 contenteditable="'.(!$locked?'true':'false').'" grid_subtitle="grid_subtitle1">' . $row['grid_subtitle1'] . '</div>';
- echo '</td>';
+ echo ' <td class="grid_header" colspan="'.$colspan.'">';
+ echo ' <div class="grid_subtitle_inline" grid_id=1 contenteditable="'.(!$locked?'true':'false').'" grid_subtitle="grid_subtitle1">' . $row['grid_subtitle1'] . '</div>';
+ echo ' </td>';
- echo ' <td style="width:0px;"></td>';
+ echo ' <td class="spacer double no-border"></td>';
// Urejanje podnaslova 2. grida
- echo ' <td class="grid_header" colspan="'.$colspan.'">';
- echo '<div class="grid_subtitle_inline" grid_id=2 contenteditable="'.(!$locked?'true':'false').'" grid_subtitle="grid_subtitle2">' . $row['grid_subtitle2'] . '</div>';
- echo '</td>';
+ echo ' <td class="grid_header" colspan="'.$colspan.'">';
+ echo ' <div class="grid_subtitle_inline" grid_id=2 contenteditable="'.(!$locked?'true':'false').'" grid_subtitle="grid_subtitle2">' . $row['grid_subtitle2'] . '</div>';
+ echo ' </td>';
- echo '<td style="width:' . $spacesize*3 . '%"></td>';
+ echo ' <td style="width:' . $spacesize*3 . '%"></td>';
echo ' </tr>';
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'" class="row_variable_inline" '.$show_variable_row.'>';
echo ' <td></td>';
- //echo ' <td style="width:' . $spacesize . '%"></td>';
echo ' <td></td>';
$bg = 1;
@@ -2696,7 +3654,7 @@ class Branching {
}
}
- echo '<td style="width:' . $spacesize*3 . '%"></td>';
+ echo '<td class="spacer double no-border"></td>';
echo '</tr>';
@@ -2715,7 +3673,7 @@ class Branching {
if ($naslov != '') $row2['naslov'] = $naslov;
}
if ($row2['vrstni_red'] == $i) {
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
} else {
echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
@@ -2736,7 +3694,7 @@ class Branching {
}
}
- echo '<td style="width:0px; border-left: 1px black solid;"></td>';
+ echo '<td class="spacer double"></td>';
//DRUGI DEL GRIDA
//$sql2 = sisplet_query("SELECT naslov, vrstni_red FROM srv_grid WHERE spr_id='$row[id]' AND other=0 AND part='2' ORDER BY vrstni_red");
@@ -2802,12 +3760,15 @@ class Branching {
echo ' <tr class="variabla" id="variabla_'.$row1['id'].'">';
echo ' <td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="f_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
+
+ echo ' <div class="icons_holder">';
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost_grid'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
if ($row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
@@ -2856,7 +3817,7 @@ class Branching {
}
}
- echo '<td style="width:1%; border-left: 1px black solid;"></td>';
+ echo '<td class="spacer double"></td>';
//DRUGI DEL GRIDA
//razlicni vnosi glede na tip multigrida
@@ -2908,7 +3869,7 @@ class Branching {
echo ' <table class="grid_header_table '.($this->lang_id==null?'allow_new':'').'">';
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'" class="row_variable_inline" '.$show_variable_row.'>';
echo ' <td></td>';
$bg = 1;
@@ -2945,10 +3906,10 @@ class Branching {
echo ' <td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon delete small inline inline_delete right8" title="'.$lang['srv_brisivrednost'].'"></span>';
//levi stolpec možnosti
- echo '<div style="text-align:right;" id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div style="text-align:right;" id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost_grid'])!==false || (isset($lang1['srv_new_vrednost_grid']) && strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
if ($row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
@@ -2996,7 +3957,7 @@ class Branching {
// desni stolpec možnosti, predelani bivši diferencial
- echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
+ echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost_grid'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
// Zadnja bela celica kjer se nahajajo ikone za mouseover
echo '<td class="white" style="min-width:20px;"></td>';
@@ -3017,7 +3978,7 @@ class Branching {
echo ' <thead>'; //začetek glave oz. naslovne vrstice tabele
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'" class="row_variable_inline" '.$show_variable_row.'>';
$bg = 1;
@@ -3046,11 +4007,11 @@ class Branching {
}
if ($row2['vrstni_red'] == $i) {
- //echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ //echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$label_text = ($row2['id'] % 2 == 0 ? $lang['srv_maxdiff_label1'] : $lang['srv_maxdiff_label2']);
//ce je default besedilo "Vpišite besedilo" spremeni labelo v "Najmanj pomemben" in "Najbolj pomemben", drugace pokazi v labelah, kar je v bazi
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'"'.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . ($row2['naslov'] == $lang['srv_new_grid'] ? $label_text : $row2['naslov']) . '</div></td>';
+ echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'"'.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . ($row2['naslov'] == $lang['srv_new_grid'] ? $label_text : $row2['naslov']) . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
echo '<td></td>';
@@ -3072,6 +4033,7 @@ class Branching {
echo '<td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row_grid_mv['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row_grid_mv['id'].'" '.(strpos($row_grid_mv['naslov'], $lang['srv_new_grid'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row_grid_mv['naslov'] . '</div></td>';
}
}
+
echo ' </tr>';
echo '</thead>'; //konec glave oz. naslovne vrstice tabele
@@ -3099,15 +4061,20 @@ class Branching {
//sredinski del z besedilom
echo ' <td style="text-align:center;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
+
+ echo ' <div class="icons_holder">';
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+ //ce je other, ga izrisi drugace
+ $style = ($row1['other'] == 1) ? 'style="flex-grow: 0;margin-left: auto;"' : '';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" '.$style.' contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost_grid'])!==false || (isset($lang1['srv_new_vrednost_grid']) && strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
- if ($row1['if_id'] > 0) {
+ if (isset($row1['if_id']) && $row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
@@ -3118,9 +4085,9 @@ class Branching {
$otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
if ($otherHeight > 1)
- echo '<textarea name="" rows="'.$otherHeight.'" style="max-width:50%; '.($otherWidth != -1 ? ' width:'.$otherWidth.'%;' : '').'" disabled="disabled"></textarea>';
+ echo '<textarea name="" rows="'.$otherHeight.'" style="margin-right:auto; max-width:50%; '.($otherWidth != -1 ? ' width:'.$otherWidth.'%;' : '').'" disabled="disabled"></textarea>';
else
- echo '<input type="text" name="" value="" style="max-width:50%; '.($otherWidth != -1 ? ' width:'.$otherWidth.'%;' : '').'" disabled="disabled" />';
+ echo '<input type="text" name="" value="" style="margin-right:auto; max-width:50%; '.($otherWidth != -1 ? ' width:'.$otherWidth.'%;' : '').'" disabled="disabled" />';
}
echo '</td>';
@@ -3129,6 +4096,9 @@ class Branching {
// desni del radio button
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="radio" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value="" data-col="2"/><span class="enka-checkbox-radio"></span></td>';
+ //zadnji stolpec za ikone
+ echo '<td style="width:80px;"></td>';
+
//urejanje navpicnega dela grupiranja radio button - vodoravni je urejen po defaultu s pomočjo atributa name
echo'
<script>
@@ -3186,8 +4156,11 @@ class Branching {
$num = mysqli_num_rows($sql1);
$size = $num * 50;
+
+ echo '<div class="ranking_holder">';
+
//zaslon razdelimo na dva dela - izris leve strani
- echo '<div id="half" class="dropzone '.($this->lang_id==null?'allow_new':'').'" style="width: 50%; min-height:' . $size . 'px; float: left; border-right: 1px solid black;">';
+ echo '<div id="half" class="dropzone '.($this->lang_id==null?'allow_new':'').'">';
while ($row1 = mysqli_fetch_array($sql1)) {
@@ -3214,38 +4187,48 @@ class Branching {
if ($length > 30) $class = 'ranking_long'; $class = 'ranking';
- //echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
+
echo '<div class="variabla" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
+
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+
+
+
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
+
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
-
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
- //koda za notranji IF
+ echo ' </div>';
+
+ // koda za notranji IF
if ($row1['if_id'] > 0) {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
if ($this->condition_check($row1['if_id']) != 0)
echo ' <span class="faicon warning icon-orange"></span>';
}
- echo '</div>';
+ echo '</div>';
}
+
echo '</div>';
+
//izris desne strani**************************************************************************************
//***********za skatlasto obliko
$display_drag_and_drop_new_look = ($spremenljivkaParams->get('display_drag_and_drop_new_look') ? $spremenljivkaParams->get('display_drag_and_drop_new_look') : 0); //za checkbox
//***********za skatlasto obliko - konec
- echo '<div id="half2" class="dropzone" style="width: 49%; min-height:' . $size . 'px; float: right;">';
+ echo '<div id="half2" class="dropzone">';
$sql2 = sisplet_query("SELECT id, naslov, variable, vrstni_red FROM srv_grid WHERE spr_id='$spremenljivka' AND other=0 ORDER BY vrstni_red");
$row2 = mysqli_fetch_array($sql2);
@@ -3265,7 +4248,7 @@ class Branching {
</li>'."\n"; //izpis "oznake" okvirja
if($display_drag_and_drop_new_look == 0){
echo '<li>
- <div class="grid_inline_droppable_title grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div>
+ <div class="grid_inline_droppable_title grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div>
</li>'."\n"; //izpis "naslova" okvirja
echo '<li>
<div class="dragdrop_frame_grid"></div>
@@ -3275,7 +4258,7 @@ class Branching {
<div class="dragdrop_frame_grid_box"></div>
</li>'."\n"; //izpis okvirja
echo '<li>
- <div class="grid_inline_droppable_title_box grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div>
+ <div class="grid_inline_droppable_title_box grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div>
</li>'."\n"; //izpis "naslova" okvirja
}
@@ -3314,12 +4297,11 @@ class Branching {
echo '</ul>';
- echo '</div>'; //half2_$spremenljivka
+ echo '</div>'; // half2_$spremenljivka
- echo '<div class="clr"></div>';
+ echo '</div>'; // end ranking_holder;
//***********************Drag and drop grid konec*************************************************************
-
}
//Image hot spot********************************************************************************************************
elseif( ($row['tip'] == 6) && $row['enota'] == 10){ //image hot spot
@@ -3339,10 +4321,10 @@ class Branching {
elseif($row['num_useMax'] == 1)
$limit = '(max '.$row['vsota_limit'].')';
else
- $limit = '';
+ $limit = $lang['srv_number_text'];
if ($row['vsota_show'] == 1 && $limit != '') {
- echo '<span style="color: red;">'.$limit.'</span>';
+ echo '<span class="left16" style="color: red;">'.$limit.'</span>';
}
}
@@ -3377,6 +4359,9 @@ class Branching {
//********************** za izris traku - konec
+ $sliderTableStyle = "";
+ $sliderTableColspan = "";
+
if ($row['tip'] == 20) { //ce je tabela s stevili
if ($row['ranking_k'] == 1){ //ce so stevila v obliki drsnikov
$slider_handle = ($spremenljivkaParams->get('slider_handle') ? $spremenljivkaParams->get('slider_handle') : 0);
@@ -3439,31 +4424,20 @@ class Branching {
}
}
- }else{
- $sliderTableStyle = "";
- $sliderTableColspan = "";
}
- echo ' <table '.$sliderTableStyle.' class="grid_header_table '.($this->lang_id==null?'allow_new':'').'">';
- echo ' <thead>';
-
-
- //vrstica z nadnaslovi ###################################################################################
- echo ' <thead>';
-
-
- //vrstica z nadnaslovi
- echo '<tr '.$display_trak_num_of_titles.' class="display_trak_num_of_titles_'.$row['id'].'">';
+ echo ' <table '.$sliderTableStyle.' class="grid_header_table '.($this->lang_id==null?'allow_new':'').'">';
+ echo ' <thead>';
+ // vrstica z nadnaslovi
+ echo '<tr '.$display_trak_num_of_titles.' class="row_subtitle display_trak_num_of_titles_'.$row['id'].'">';
echo ' <td></td>';
echo ' <td></td>';
-
for ($j = 1; $j <= $row['grids']; $j++) {
- //echo '<td>'.$j.'</td>';
if($j == 1){
$nadnaslov_floating = 'left';
}
@@ -3474,14 +4448,15 @@ class Branching {
$nadnaslov_floating = 'none';
}
- echo '<td class="trak_inline_nadnaslov" grd="g_'.$j.'" ><div grid="'.$j.'" id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" contenteditable="'.(!$locked?'true':'false').'" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
+ if(isset($trak_nadnaslov[$j]))
+ echo '<td class="trak_inline_nadnaslov" grd="g_'.$j.'" ><div grid="'.$j.'" id="trak_nadnaslov_'.$j.'_'.$spremenljivka.'" name="trak_nadnaslov_'.$j.'" class="trak_inline_nadnaslov" style="float:'.$nadnaslov_floating.'; display:inline" contenteditable="'.(!$locked?'true':'false').'" '.(strpos($trak_nadnaslov[$j], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $trak_nadnaslov[$j] . '</div></td>';
}
echo '</tr>';
-
//vrstica z nadnaslovi - konec ###################################################################################
+
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'" class="row_variable_inline" '.$show_variable_row.'>';
echo ' <td></td>';
echo ' <td></td>';
@@ -3520,7 +4495,7 @@ class Branching {
if ($naslov != '') $row2['naslov'] = $naslov;
}
if ($row2['vrstni_red'] == $i) {
- echo ' <td '.$sliderTableColspan.' class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline '.$trak_class_input.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ echo ' <td '.$sliderTableColspan.' class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline '.$trak_class_input.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
} else {
echo ' <td '.$sliderTableColspan.' class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
@@ -3632,14 +4607,9 @@ class Branching {
echo ' <tr class="variabla" '.$style.' id="variabla_'.$row1['id'].'">';
echo ' <td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
if($row['enota'] != 9){
-
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.((isset($lang1['srv_new_vrednost_grid']) && strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
}
if ($row1['if_id'] > 0) {
@@ -3691,15 +4661,14 @@ class Branching {
echo '</td>';
}
- } elseif($row['tip'] == 16) {
+ }
+ elseif($row['tip'] == 16) {
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="checkbox" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value="" /><span class="enka-checkbox-radio"></span></td>';
-
- } elseif ($row['tip'] == 19) {
- echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><textarea style="width:'.$taWidth.'em; height:'.($taHeight*12).'px" name="foo_' . $row1['id'] . '"></textarea></td>';
-
- } elseif ($row['tip'] == 20) {
-
- //echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" style="width:'.$taWidth.'em;" name="foo_' . $row1['id'] . '" value="" />';
+ }
+ elseif ($row['tip'] == 19) {
+ echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><textarea style="width:'.$taWidth.'em;" rows="'.$taHeight.'" name="foo_' . $row1['id'] . '"></textarea></td>';
+ }
+ elseif ($row['tip'] == 20) {
if ($row['ranking_k'] == 1) { //ce je slider
@@ -3720,6 +4689,7 @@ class Branching {
//za custom opisne labele
//moznosti urejanja opisnih label drsnika
+ $slider_CustomDescriptiveLabels = '';
if($slider_VmesneDescrLabel){
for($i=1; $i<=$slider_NumofDescrLabels; $i++){
if($prevajanje == false){
@@ -3731,7 +4701,8 @@ class Branching {
$slider_CustomDescriptiveLabelsTmp = preg_replace("/\s|&nbsp;/",' ',$slider_CustomDescriptiveLabelsTmp); //za odstranitev morebitnih presledkov, ki lahko delajo tezave pri polju za drsnik
if($i == 1){
$slider_CustomDescriptiveLabels = $slider_CustomDescriptiveLabelsTmp;
- }else{
+ }
+ else{
$slider_CustomDescriptiveLabels .= "; ".$slider_CustomDescriptiveLabelsTmp;
}
}
@@ -3756,17 +4727,18 @@ class Branching {
</script>
<?
}
+
//Zadnja bela celica kjer se nahajajo ikone za mouseover, ko je slider
if($slider_VmesneDescrLabel){
$mouseOverStyle = '';
- }else{
+ }
+ else{
$mouseOverStyle = 'style="min-width:80px;"';
}
- echo '<td class="white" '.$mouseOverStyle.'></td>';
- //echo ' </tr>';
- //Zadnja bela celica kjer se nahajajo ikone za mouseover, ko je slider - konec
-
- }else{
+
+ echo '<td class="white" '.$mouseOverStyle.'></td>';
+ }
+ else{
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" style="width:'.$taWidth.'em;" name="foo_' . $row1['id'] . '" value="" />';
}
@@ -3796,12 +4768,21 @@ class Branching {
// diferencial
if ($row['enota'] == 1 && $row['tip'] == 6) {
echo ' <td></td>';
- echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
+ echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost_grid'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
}
if ($row['ranking_k'] != 1) { //ce ni slider
// Zadnja bela celica kjer se nahajajo ikone za mouseover
- echo '<td class="white" style="min-width:80px;"></td>';
+ echo '<td class="white" style="min-width:84px; padding-left:0;">';
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit" style="margin-left:0;"></span>';
+ echo ' </div>';
+
+ echo ' </td>';
echo ' </tr>';
}
@@ -3896,8 +4877,11 @@ class Branching {
//ce je drsnik in moramo urediti opisne labele - konec ##################################################
}
- // textbox -- not any more
- } elseif ($row['tip'] == 4) {
+
+ // textbox -- not any more
+ }
+
+ elseif ($row['tip'] == 4) {
$taSize = ($spremenljivkaParams->get('taSize') ? $spremenljivkaParams->get('taSize') : 1);
$taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1);
@@ -3924,7 +4908,7 @@ class Branching {
// textbox*
elseif ($row['tip'] == 21) {
- if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit'])
+ if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit'])
$limit = '('.$lang['srv_text_length_char_num'].$row['vsota_min'].')';
elseif($row['num_useMin'] == 1 && $row['num_useMax'] == 1)
$limit = '('.$lang['srv_text_length_char_num'].'min '.$row['vsota_min'].', max '.$row['vsota_limit'].')';
@@ -3941,9 +4925,7 @@ class Branching {
if($taWidth == -1)
$taWidth = 30;
- echo '<table class="text_vrednost" style="width: 100%; text-align: left">';
- if($row['orientation'] != 3)
- echo '<tr>';
+ echo '<div class="text_vrednost orientation_'.$row['orientation'].'">';
$_others = array();
$sql1 = sisplet_query("SELECT id, naslov, variable, size, other, hidden, naslov2 FROM srv_vrednost WHERE spr_id='$row[id]' AND vrstni_red > 0 ORDER BY vrstni_red");
@@ -3951,77 +4933,102 @@ class Branching {
if ((int)$row1['other'] == 0) {
- // sirina celice td
- $cell = $row['text_kosov'] == 1 ? 100 : $row1['size'] ;
+ // sirina celice
+ $cell_width = $row['text_kosov'] > 0 ? 100 / $row['text_kosov'] : 100;
+
+ echo '<div id="f_'.$row1['id'].'" class="grid_question position_'.$row['text_orientation'].' '.($row['text_kosov'] > 1 ? 'multiple' : '').'" style="width:'.$cell_width.'%">';
+
// sirina vnosnega polja
$input = $taWidth;
- if($row['orientation'] == 3)
- echo '<tr>';
- echo '<td class="grid_question" style="width: '.$cell.'%; text-align:left" id="f_'.$row1['id'].'">';
+ if ($this->lang_id != null) {
+ save('lang_id', $this->lang_id);
+ $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($row1['id']);
+ if ($naslov != '') $row1['naslov'] = $naslov;
+ }
+
+ // Polje za enoto
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
- if($row['text_orientation'] == 1 || $row['text_orientation'] == 3){
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
- if ($row['text_orientation'] == 3)
- echo '<br />';
- }
if ($taSize > 1)
- echo '<textarea id="txt_f_' .$row1['id'] .'" vre_id="'.$row1['id'].'_2" name="foo_' . $row['id'] . '" rows="' . $taSize . '" style="width: ' . $input . '%; margin-left:15px" ' .($locked?'disabled="disabled" ':' class="textfield_editable" contenteditable="true" ETF="true"') .'>' .$row1['naslov2'] .'</textarea>';
+ echo '<textarea id="txt_f_' .$row1['id'] .'" vre_id="'.$row1['id'].'_2" name="foo_' . $row['id'] . '" rows="' . $taSize . '" style="width: ' . $input . '%;" ' .($locked?'disabled="disabled" ':' class="textfield_editable" contenteditable="true" ETF="true"') .'>' .$row1['naslov2'] .'</textarea>';
else
- echo '<input id="txt_f_' .$row1['id'] .'" vre_id="'.$row1['id'].'_2" type="text" style="width: ' . $input . '%; margin-left:15px" ' .($locked?'disabled="disabled" ':' class="textfield_editable" contenteditable="true" ETF="true"') .' value="' .$row1['naslov2'] .'" />';
-
- if($row['text_orientation'] == 2){
- echo '<br /><div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
- }
- echo '</td>';
- if($row['orientation'] == 3)
- echo '</tr>';
+ echo '<input id="txt_f_' .$row1['id'] .'" vre_id="'.$row1['id'].'_2" type="text" style="width: ' . $input . '%;" ' .($locked?'disabled="disabled" ':' class="textfield_editable" contenteditable="true" ETF="true"') .' value="' .$row1['naslov2'] .'" />';
+
+ echo '</div>';
}
else {
# imamo opcijo drugo prikažemo kot checkbox
$_others[] = $row1;
}
}
- if($row['orientation'] != 3)
- echo '</tr>';
- echo '</table>';
+
+ echo '</div>';
+
- if ($row['vsota_show'] == 1 && $limit != '')
- echo '<span id="variabla_limit_'.$spremenljivka.'" class="variabla_limit '.$cssFloat.'" style="padding: 0 15px 0 10px;">'.$limit.'</span>';
+ if ($row['vsota_show'] == 1 && $limit != '')
+ echo '<div id="variabla_limit_'.$spremenljivka.'" class="variabla_limit">'.$limit.'</div>';
if (count($_others)> 0 ) {
+
+ echo '<div class="text_vrednost_missing">';
+
foreach ($_others AS $oKey => $_other) {
- if ($this->lang_id != null) {
- save('lang_id', $this->lang_id);
- $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($_other['id']);
- if ($naslov != '') $_other['naslov'] = $naslov;
- }
-
- // Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec
- $missing_warning = '';
- if(($_other['variable'] == '-97' && $row['alert_show_97'] > 0)
- || ($_other['variable'] == '-98' && $row['alert_show_98'] > 0)
- || ($_other['variable'] == '-99' && $row['alert_show_99'] > 0)){
- $missing_warning = ' red';
- }
+ if ($this->lang_id != null) {
+ save('lang_id', $this->lang_id);
+ $naslov = \App\Controllers\LanguageController::getInstance()->srv_language_vrednost($_other['id']);
+ if ($naslov != '') $_other['naslov'] = $naslov;
+ }
+
+ // Ce je variabla ne vem in imamo vklopljen prikaz ob opozorilu -> rdec
+ $missing_warning = '';
+ if(($_other['variable'] == '-97' && $row['alert_show_97'] > 0)
+ || ($_other['variable'] == '-98' && $row['alert_show_98'] > 0)
+ || ($_other['variable'] == '-99' && $row['alert_show_99'] > 0)){
+ $missing_warning = ' red';
+ }
- echo '<div class="variabla' . $cssFloat . '" id="variabla_'.$_other['id'].'" other="'.$_other['other'].'">';
- echo ' <input type="checkbox" name="foo_' . $_other['id'] . '" id="foo_' . $_other['id'] . '" value="" class="' . (($_other['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
- echo '<div id="vre_id_'.$_other['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$_other['id'].'">' . $_other['naslov'] . '</div>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo '<div class="variabla' . $cssFloat . '" id="variabla_'.$_other['id'].'" other="'.$_other['other'].'">';
+ echo ' <input type="checkbox" name="foo_' . $_other['id'] . '" id="foo_' . $_other['id'] . '" value="" class="enka-admin-custom ' . ((isset($_other['checkboxhide']) && $_other['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
+ echo '<span class="enka-checkbox-radio "></span>';
+ echo '<div id="vre_id_'.$_other['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$_other['id'].'">' . $_other['naslov'] . '</div>';
+
+ if($_other['other'] != 0 && $_other['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$_other['other']].'</span>
+ </div>
+ <div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($_other['other']).'_'.$spremenljivka.'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($_other['other']).'_'.$spremenljivka.'" name="alert_show_'.abs($_other['other']).'_'.$spremenljivka.'" value="1"
+ '.($row['alert_show_'.abs($_other['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$spremenljivka.');">
+ <label for="alert_show_'.abs($_other['other']).'_'.$spremenljivka.'" class="title"><span id="alert_show_'.abs($_other['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>
+ </div>';
+ }
- echo '</div>';
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($_other['hidden'] == 1) ? 'show-hidden' : '').(($_other['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$_other['hidden'].'" odg_id="'.$_other['id'].'" title="'.$lang['srv_hide-disable_answer-'.$_other['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$_other['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+ echo '</div>';
}
+
+ echo '</div>';
}
+
+ $this->missings_menu($spremenljivka);
}
// number
- elseif ($row['tip'] == 7) {
+ elseif ($row['tip'] == 7) {
if($row['num_useMin'] == 1 && $row['num_useMax'] == 1 && $row['vsota_min'] == $row['vsota_limit'])
$limit = '('.$row['vsota_min'].')';
@@ -4052,20 +5059,19 @@ class Branching {
if($taWidth == -1)
$taWidth = 10;
- $cssFloat = ' floatLeft';
-
$sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' AND other = 0 ");
$row1 = mysqli_fetch_array($sql1);
$sqlOther = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND vrstni_red>0 AND other != 0");
$num_other = mysqli_num_rows($sqlOther);
- $num_all = $num_other+$row['size'];
- $cell_width = 'width:'.(80/$num_all).'% ';
if ( $row['ranking_k'] == '0' ) {
- echo '<div class="variabla' . $cssFloat . '" style="'.$cell_width.'clear:none" id="variabla_'.$row1['id'].'">';
+ echo '<div class="number_vrednost enota_'.$row['enota'].'">';
+
+
+ echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
if ($this->lang_id != null) {
save('lang_id', $this->lang_id);
@@ -4074,28 +5080,24 @@ class Branching {
}
if($row['enota'] == 1)
- echo ' <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '</div>
- <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'">';
+ echo ' <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '</div>
+ <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'">';
elseif($row['enota'] == 2)
- echo ' <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'" > <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null?' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo ' <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'" > <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null?' default="1"':'').'>' . $row1['naslov'].'</div>';
else
- echo ' <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'" >';
- echo '</div>';
+ echo ' <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'" >';
+
+ echo '</div>';
+
// Omejitev vnosa
- if ($row['orientacija'] == 1) {
- echo '<div class="clr">ccc</div>';
- $cssFloat = '';
- }else {
- $cssFloat = ' floatLeft';
- }
if ($row['vsota_show'] == 1 && $limit != '') {
- echo '<span id="variabla_limit_'.$spremenljivka.'" class="variabla_limit '.$cssFloat.'" style="padding: 0 15px 0 10px;">'.$limit.'</span>';
- } elseif($row['size'] != 2 && $limit == '') {
- echo '<span id="variabla_limit_'.$spremenljivka.'" class="variabla_limit '.$cssFloat.' editingOnly" style="padding-left: 10px;">'.$lang['srv_number_text'].'</span>';
+ echo '<div id="variabla_limit_'.$spremenljivka.'" class="variabla_limit">'.$limit.'</div>';
+ }
+ elseif($row['size'] != 2 && $limit == '') {
+ echo '<div id="variabla_limit_'.$spremenljivka.'" class="variabla_limit editingOnly">'.$lang['srv_number_text'].'</div>';
}
- $cssFloat = ' floatLeft';
if ($row['size'] == 2) {
@@ -4107,35 +5109,32 @@ class Branching {
if ($naslov != '') $row1['naslov'] = $naslov;
}
- echo '<div class="variabla' . $cssFloat . '" style="width:'.$cell_width.'% !important; clear:none" id="variabla_'.$row1['id'].'">';
+ echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
if($row['enota'] == 1){
if($taWidth > 40)
echo '<br />';
- echo ' <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '</div>
- <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'">';
+ echo ' <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'] . '</div>
+ <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'">';
}
elseif($row['enota'] == 2)
- echo ' <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'"> <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" style="float:none; display:inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo ' <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'"> <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov'].'</div>';
else
- echo ' <input type="text" name="foo_' . $row['id'] . '" style="width: '.$taWidth.'em; float:none" id="foo_'.$row1['id'].'">';
+ echo ' <input type="text" name="foo_' . $row['id'] . '" style="width:'.$taWidth.'em;" id="foo_'.$row1['id'].'">';
echo '</div>';
- //Omejitev vnosa
- if ($row['orientacija'] == 1) {
- echo '<div class="clr">ccc</div>';
- $cssFloat = '';
- }else {
- $cssFloat = ' floatLeft';
- }
+ // Omejitev vnosa
if ($row['vsota_show'] == 1 && $limit2 != '') {
- echo '<span id="variabla_limit_'.$spremenljivka.'" class="variabla_limit '.$cssFloat.'" style="padding-left: 10px;">'.$limit2.'</span>';
- } elseif($limit == '' && $limit2 == '') {
- echo '<span id="variabla_limit_'.$spremenljivka.'" class="variabla_limit '.$cssFloat.' editingOnly" style="padding-left: 10px;">'.$lang['srv_number_text'].'</span>';
+ echo '<div id="variabla_limit_'.$spremenljivka.'" class="variabla_limit">'.$limit2.'</div>';
+ }
+ elseif($limit == '' && $limit2 == '') {
+ echo '<div id="variabla_limit_'.$spremenljivka.'" class="variabla_limit editingOnly">'.$lang['srv_number_text'].'</div>';
}
}
- }//ranking_k == 0
-
+ echo '</div>';
+ }
+
+ //ranking_k == 0
if ( $row['ranking_k'] == '1' ) {
echo '<div id="variabla_'.$row1['id'].'">';
@@ -4222,18 +5221,21 @@ class Branching {
//za custom opisne labele
//moznosti urejanja opisnih label drsnika
+ $slider_CustomDescriptiveLabels = '';
if($slider_VmesneDescrLabel){
for($i=1; $i<=$slider_NumofDescrLabels; $i++){
if($prevajanje == false){
$slider_CustomDescriptiveLabelsTmp = ($spremenljivkaParams->get('slider_Labela_opisna_'.$i) ? $spremenljivkaParams->get('slider_Labela_opisna_'.$i) : '');
- }else if ($prevajanje == true){
+ }
+ else if ($prevajanje == true){
$slider_CustomDescriptiveLabelsTmp = $custom_ar[$i-1];
}
$slider_CustomDescriptiveLabelsTmp = preg_replace("/\s|&nbsp;/",' ',$slider_CustomDescriptiveLabelsTmp); //za odstranitev morebitnih presledkov, ki lahko delajo tezave pri polju za drsnik
if($i == 1){
$slider_CustomDescriptiveLabels = $slider_CustomDescriptiveLabelsTmp;
- }else{
+ }
+ else{
$slider_CustomDescriptiveLabels .= "; ".$slider_CustomDescriptiveLabelsTmp;
}
}
@@ -4259,10 +5261,8 @@ class Branching {
</script>
<?
}
- echo '<br />';
- echo '<br />';
- echo '<br />';
-
+
+
//tabela za labele podrocij in podrocja
echo '<table '.$display_labele_podrocij.' style="width:85%">';
@@ -4380,14 +5380,37 @@ class Branching {
$missing_warning = ' red';
}
- echo '<div class="variabla' . $cssFloat . '" style="'.$cell_width.'" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
- echo '<input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'">' . $row1['naslov'] . '</div>';
+ echo '<div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
+ echo '<input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="enka-admin-custom ' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
+ echo '<span class="enka-checkbox-radio "></span>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'">' . $row1['naslov'] . '</div>';
+
+ if($row1['other'] != 0 && $row1['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$row1['other']].'</span>
+ </div>
+ <div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" name="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" value="1"
+ '.($row['alert_show_'.abs($row1['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$spremenljivka.');">
+ <label for="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" class="title"><span id="alert_show_'.abs($row1['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>
+ </div>';
+ }
+ echo ' <div class="icons_holder">';
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
echo '</div>';
}
+
+ $this->missings_menu($spremenljivka);
}
// label
@@ -4423,15 +5446,38 @@ class Branching {
}
echo '<div class="variabla' . $cssFloat . '" id="variabla_'.$row1['id'].'" other="'.$row1['other'].'">';
- echo '<input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'">' . $row1['naslov'] . '</div>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo '<input type="checkbox" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" class="enka-admin-custom ' . (($row['checkboxhide'] == 1) ? 'hidden' : '') . '" onClick="return false;"/>';
+ echo '<span class="enka-checkbox-radio "></span>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$missing_warning.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'">' . $row1['naslov'] . '</div>';
+
+ if($row1['other'] != 0 && $row1['other'] != 1){
+ echo ' <div class="missing_settings">
+ <div class="stamp_holder inline">
+ <span class="missing_stamp">'.$lang['srv_other_system'].$missing_values[$row1['other']].'</span>
+ </div>
+ <div class="missing_alert_holder inline" '.(($row['reminder'] > 0)?'':' style="display:none;"').'>
+ <form name="vprasanje_edit">
+ <input type="hidden" name="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" value="0" />
+ <input type="checkbox" id="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" name="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" value="1"
+ '.($row['alert_show_'.abs($row1['other'])]=='1'?' checked':'').'
+ onChange="vprasanje_save(true, '.$spremenljivka.');">
+ <label for="alert_show_'.abs($row1['other']).'_'.$spremenljivka.'" class="title"><span id="alert_show_'.abs($row1['other']).'_text">'.$lang['srv_alert_show_missing_general'].'</span> '.Help::display('srv_alert_show_general').'</label>
+ </form>
+ </div>
+ </div>';
+ }
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
echo '</div>';
}
+ $this->missings_menu($spremenljivka);
}
// ranking
@@ -4443,9 +5489,12 @@ class Branching {
$num = mysqli_num_rows($sql1);
$size = $num * 50;
+ echo '<div class="ranking_holder design_'.$row['design'].' '.($this->lang_id==null ? 'allow_new' : '').'">';
+
// n=k
if ($row['design'] == 2) {
- echo '<div id="half_' . $row['podpora'] . '" class="dropzone '.($this->lang_id==null?'allow_new':'').'" style="min-height:' . $size . 'px;">';
+
+ echo '<div id="half_' . $row['podpora'] . '" class="dropzone '.($this->lang_id==null?'allow_new':'').'">';
while ($row1 = mysqli_fetch_array($sql1)) {
@@ -4469,10 +5518,6 @@ class Branching {
echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
@@ -4482,7 +5527,7 @@ class Branching {
echo '<div style="text-align: center;">';
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
@@ -4492,8 +5537,16 @@ class Branching {
echo '</div>';
}
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
echo '</div>';
}
+
echo '</div>';
}
@@ -4501,7 +5554,7 @@ class Branching {
elseif ($row['design'] == 0) {
//zaslon razdelimo na dva dela - izris leve strani
- echo '<div id="half" class="dropzone '.($this->lang_id==null?'allow_new':'').'" style="width: 50%; min-height:' . $size . 'px; float: left; border-right: 1px solid black;">';
+ echo '<div id="half" class="dropzone '.($this->lang_id==null ? 'allow_new' : '').'">';
while ($row1 = mysqli_fetch_array($sql1)) {
@@ -4525,10 +5578,6 @@ class Branching {
echo '<div class="variabla" id="variabla_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" style="float:none" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
@@ -4537,7 +5586,7 @@ class Branching {
echo '<div style="text-align: center;">';
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
@@ -4548,12 +5597,21 @@ class Branching {
echo '</div>';
}
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
echo '</div>';
}
+
echo '</div>';
+
// izris desne strani
- echo '<div id="half2" class="dropzone" style="width: 49%; min-height:' . $size . 'px; float: right;">';
+ echo '<div id="half2" class="dropzone">';
if($row['ranking_k'] == 0)
$max = mysqli_num_rows($sql1);
@@ -4565,8 +5623,6 @@ class Branching {
}
echo '</div>';
-
- echo '<div class="clr"></div>';
}
// cifre - dropdown
@@ -4584,10 +5640,6 @@ class Branching {
echo '<div class="variabla '.$cssFloat.'" id="variabla_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
- echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
- echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
- echo ' <span class="faicon edit2 inline inline_edit"></span>';
//echo '<input type="textfield" size="2"> ';
echo '<select style="width:50px; margin-top:0; float:left;">';
@@ -4596,15 +5648,15 @@ class Branching {
echo ' <option>'.$i.'</option>';
}
echo '</select>';
-
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline '.$class.'" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
+
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
//koda za notranji IF
if ($row1['if_id'] > 0) {
echo ' <span class="red">*</span>';
- echo ' <span style="font-size:9px; cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
+ echo ' <span style="cursor:pointer" id="if_notranji_'.$row1['id'].'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">';
$this->conditions_display($row1['if_id']);
echo '</span>';
@@ -4612,6 +5664,13 @@ class Branching {
echo ' <span class="faicon warning icon-orange"></span>';
}
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+ echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
+ echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
+ echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
+
echo '</div>';
}
}
@@ -4622,6 +5681,8 @@ class Branching {
//izris hotspot nastavitev za dodajanje slike
$this->vprasanje_hotspot($row['id'], $row['tip'], $row['design']);
}
+
+ echo '</div>';
}
// vsota
@@ -4641,14 +5702,17 @@ class Branching {
if ($naslov != '') $row1['naslov'] = $naslov;
}
- echo '<div class="variabla variabla_vsota" id="variabla_'.$row1['id'].'" style="width:100%; ">';
+ echo '<div class="variabla variabla_vsota" id="variabla_'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
+
+ echo ' <div class="icons_holder">';
echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
+ echo ' </div>';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline vrednost_inline_vsota '.$class.'" style="width:'.($gridWidth*7).'px" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline vrednost_inline_vsota" style="width:'.$gridWidth.'%" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>'.$row1['naslov'].'</div>';
echo ' <input type="text" name="foo_' . $row['id'] . '" maxlength="8" size="5">';
if ($row1['if_id'] > 0) {
@@ -4664,6 +5728,7 @@ class Branching {
$row1 = Cache::srv_spremenljivka($row['id']);
+ $limit = '';
if($row['vsota_limit'] != 0 && $row['vsota_limit'] == $row['vsota_min'])
$limit = '('.$row['vsota_min'].')';
elseif($row['vsota_limit'] != 0 && $row['vsota_min'] != 0)
@@ -4676,21 +5741,17 @@ class Branching {
$vsota = ($row1['vsota'] != '') ? $row1['vsota'] : $lang['srv_vsota_text'];
- echo '<table class="variabla_vsota"><tr>';
+ echo '<div class="variabla_vsota sum">';
- echo ' <td class="text">';
- echo ' <div class="variabla_vsota_sum">';
- echo ' <div style="width:'.($gridWidth*7).'px;" id="vsota_'.$row['id'].'" name="vsota" class="variabla_vsota_inline vrednost_inline_vsota" style="display:inline" contenteditable="'.(!$locked?'true':'false').'" '.(strpos($vsota, $lang['srv_vsota_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $vsota . '</div>';
- echo ' </div>';
- echo ' </td>';
+ echo ' <div class="variabla_vsota_border"></div>';
+
+ echo ' <div style="width:'.$gridWidth.'%;" id="vsota_'.$row['id'].'" name="vsota" class="variabla_vsota_inline vrednost_inline_vsota" style="display:inline; width:'.$gridWidth.'%;" contenteditable="'.(!$locked?'true':'false').'" '.(strpos($vsota, $lang['srv_vsota_text'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $vsota . '</div>';
- echo ' <td class="input">';
- echo ' <input type="text" name="foo_' . $row['id'] . '" maxlength="8" size="5" >';
+ echo ' <input type="text" name="foo_' . $row['id'] . '" maxlength="8" size="5" >';
if ($row['vsota_show'] == 1)
- echo ' <label style="color: red; padding-left: 5px;">'.$limit.'</label>';
- echo ' </td>';
+ echo ' <label style="color: red; padding-left: 5px;">'.$limit.'</label>';
- echo '</tr></table>';
+ echo '</div>';
}
// SN - imena
@@ -4738,11 +5799,11 @@ class Branching {
$sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY $orderby");
while ($row1 = mysqli_fetch_array($sql1)) {
- echo ' <p' . '><input type="radio" class="enka-admin-custom" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" "/><span class="enka-checkbox-radio"></span> <label for="foo_' . $row1['id'] . '">' . $row1['naslov'] . '</label></p>';
+ echo ' <p' . '><input type="radio" class="enka-admin-custom" name="foo_' . $row['id'] . '" id="foo_' . $row1['id'] . '" value="" "/><label for="foo_' . $row1['id'] . '"><span class="enka-checkbox-radio"></span> ' . $row1['naslov'] . '</label></p>';
}
if ($row['textfield'] == 1) {
- echo ' <p' . '><input type="radio" class="enka-admin-custom" name="foo_' . $row['id'] . '" id="foo_-3" value="" "/><span class="enka-checkbox-radio"></span> <label for="foo_-3">' . $row['textfield_label'] . '</label> <input type="text" name="" value="" /></p>';
+ echo ' <p' . '><input type="radio" class="enka-admin-custom" name="foo_' . $row['id'] . '" id="foo_-3" value="" "/><label for="foo_-3"><span class="enka-checkbox-radio"></span> ' . $row['textfield_label'] . '</label> <input type="text" name="" value="" /></p>';
}
}
@@ -4788,7 +5849,9 @@ class Branching {
else
$map_data[] = $sql1;
- echo '<span id="variabla_no_value_'.$spremenljivka.'" '. (($cssFloat != '') ? 'class="'.$cssFloat.'"' : '') .' style="width:auto !important; color: red; padding-left: 10px; display:'. ((count($map_data) > 0) ? 'none' : 'inline-block') .';">'.$lang['srv_branching_no_value_map'].'</span>';
+ echo '<span id="variabla_no_value_'.$spremenljivka.'" '. (($cssFloat != '') ? 'class="'.$cssFloat.'"' : '') .'
+ style="width:auto !important; color: red; margin-bottom: 12px; display:'. ((count($map_data) > 0) ? 'none' : 'inline-block') .';">'.
+ $lang['srv_branching_no_value_map'].'</span>';
//get info shapes
$sql2 = sisplet_query("SELECT lat, lng, address, overlay_id FROM srv_vrednost_map
@@ -4821,7 +5884,7 @@ class Branching {
?>
<script type="text/javascript">
//naredi padding variable_holder na desni in levi strani (default je samo na levi)
- document.getElementById('br_map_<?php echo $spremenljivka; ?>').parentElement.style.padding = "0px 30px";
+ document.getElementById('br_map_<?php echo $spremenljivka; ?>').parentElement.style.padding = "0px 16px";
//preveri, ce je google API ze includan (ce se je vedno icludal, je prislo do errorjev)
if((typeof google === 'object' && typeof google.maps === 'object')){
@@ -4981,26 +6044,38 @@ class Branching {
elseif( ($row['tip'] == 27)){ //Heatmap
$this->vprasanje_heatmap($row['id'], $row['tip']);
}
-
-
-
- //echo '<div id="clr" class="clr"></div>';
+
echo '</div>';
- if ($row['orientation']==0 || $row['orientation']==2 || $row['tip'] == 17) echo '<div class="clr"></div>'; // kjer so vsi divi floatani, da se raztegne okvir vprasanja
+
+ // Add variable - hover
+ if ( in_array($row['tip'], array(1,2,6,16,19,20)) ) {
+ if ($row['enota'] != 10 && $row['orientation'] != 10){
+ echo '<div class="add-variable tip_'.$row['tip'].'"><a href="#" class="noline" onclick="add_question_category(\''.$spremenljivka.'\'); return false;" title="'.$lang['srv_novavrednost'].'"><span class="faicon add"></span>'.$lang['srv_novavrednost'].'</a></div>';
+
+ MobileSurveyAdmin::displayAddQuestionCategory($this->anketa, $spremenljivka, $row['tip']);
+ }
+ }
+
+
+ // kjer so vsi divi floatani, da se raztegne okvir vprasanja
+ if ($row['orientation']==0 || $row['orientation']==2 || $row['tip'] == 17)
+ echo '<div class="clr"></div>';
echo '</div><!-- end:variable_holder -->';
- //echo ' </div>';
if ($this->displayKomentarji !== false) {
- $this->vprasanje_komentarji($spremenljivka);
+ $sc = new SurveyComments($this->anketa);
+ $sc->display_vprasanje_komentarji($spremenljivka);
}
- echo ' </div> <!-- spremenljivka_content_' . $spremenljivka . ' -->';
+ echo ' </div> <!-- spremenljivka_content_' . $spremenljivka . ' -->';
}
function vprasanje_grid_multiple ($spremenljivka) {
global $lang;
+ global $lang1;
+ global $global_user_id;
$row = Cache::srv_spremenljivka($spremenljivka);
@@ -5015,65 +6090,48 @@ class Branching {
echo ' <table class="grid_header_table '.($this->lang_id==null?'allow_new':'').'">';
echo ' <thead>';
+
// podnaslovi gridov
- if ($row['grid_subtitle1'] == '1') {
- echo ' <tr>';
+ $sql2 = sisplet_query("SELECT s.id, s.naslov, s.grids FROM srv_spremenljivka s, srv_grid_multiple m WHERE s.id = m.spr_id AND parent = '".$row['id']."' ORDER BY m.vrstni_red");
+ if ($row['grid_subtitle1'] == '1' && mysqli_num_rows($sql2) > 0) {
+
+ echo ' <tr class="row_subtitle">';
echo ' <td></td>';
- //echo ' <td style="width:' . $spacesize . '%"></td>';
echo ' <td></td>';
- $sql2 = sisplet_query("SELECT s.id, s.naslov, s.grids FROM srv_spremenljivka s, srv_grid_multiple m WHERE s.id = m.spr_id AND parent = '".$row['id']."' ORDER BY m.vrstni_red");
+ $col = 1;
+ $tip_prev = 0;
+ $id_prev = 0;
+
while ($row2 = mysqli_fetch_array($sql2)) {
-
-
+
+ if ($id_prev == 0) $id_prev = $row2['id'];
+
+ if ($tip_prev != $row2['tip']) $col++;
+ $tip_prev = $row2['tip'];
+
if ($this->lang_id != null) {
save('lang_id', $this->lang_id);
$rowl = \App\Controllers\LanguageController::srv_language_spremenljivka($row2['id']);
if (strip_tags($rowl['naslov']) != '') $row2['naslov'] = $rowl['naslov'];
- }
-
-
- echo ' <td colspan="'.$row2['grids'].'" class="grid_header" grd="g_'.$row2['id'].'"><div class="naslov_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_vprasanje'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ }
+ echo ' <td colspan="'.$row2['grids'].'" class="grid_header '.($id_prev!=$row2['id']?'col_border ':'').'" grd="g_'.$row2['id'].'"><div class="naslov_inline grid_subtitle_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" spr_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_vprasanje'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
}
echo ' </tr>';
}
- // urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
- echo ' <td></td>';
- //echo ' <td style="width:' . $spacesize . '%"></td>';
- echo ' <td></td>';
-
- $bg = 1;
-
- $sql2 = sisplet_query("SELECT id, variable, vrstni_red FROM srv_grid WHERE spr_id='$row[id]' AND other=0 ORDER BY vrstni_red");
- $row2 = mysqli_fetch_array($sql2);
-
- for ($i = 1; $i <= $row['grids']; $i++) {
- if ($row2['vrstni_red'] == $i) {
- echo ' <td class=" ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_variable_inline" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'">' . $row2['variable'] . '</div></td>';
- $row2 = mysqli_fetch_array($sql2);
- } else {
- echo ' <td class=" ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
- }
- }
- echo '</tr>';
-
- $grid_plus_minus = '<div class="grid-plus-minus"><a href="#" onclick="grid_multiple_add(\''.$row['id'].'\'); return false;" title="'.$lang['srv_gridmultiple_add'].'">'.$lang['add'].' <span class="faicon add icon-blue"></span></a></div>';
-
- echo ' <tr>';
- echo ' <td></td>';
- //echo ' <td style="width:' . $spacesize . '%"></td>';
- echo ' <td></td>';
$bg = 1;
- //$sql2 = sisplet_query("SELECT g.* FROM srv_grid g, srv_grid_multiple m WHERE g.spr_id = m.spr_id AND parent = '".$row['id']."' ORDER BY m.vrstni_red, g.vrstni_red");
-
$sqlM = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka' ORDER BY vrstni_red");
if(mysqli_num_rows($sqlM) > 0){
+
+ echo ' <tr>';
+ echo ' <td></td>';
+ echo ' <td></td>';
+
$multiple = array();
while ($rowM = mysqli_fetch_array($sqlM)) {
$multiple[] = $rowM['spr_id'];
@@ -5081,37 +6139,36 @@ class Branching {
$sql2 = sisplet_query("SELECT g.*, s.tip, s.enota, s.dostop FROM srv_grid g, srv_grid_multiple m, srv_spremenljivka s WHERE s.id=g.spr_id AND g.spr_id=m.spr_id AND m.spr_id IN (".implode(',', $multiple).") ORDER BY m.vrstni_red, g.vrstni_red");
$row2 = mysqli_fetch_array($sql2);
+ $col = 1;
+ $tip_prev = 0;
+ $id_prev = 0;
+
for ($i = 1; $i <= mysqli_num_rows($sql2); $i++) {
+
+ if ($id_prev == 0) $id_prev = $row2['id'];
+
+ if ($tip_prev != $row2['tip']) $col++;
+ $tip_prev = $row2['tip'];
+
if ($this->lang_id != null) {
$naslov = \App\Controllers\LanguageController::srv_language_grid($row2['spr_id'], $row2['id']);
if ($naslov != '') $row2['naslov'] = $naslov;
}
- if (true) {
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" spr_id="'.$row2['spr_id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
- $row2 = mysqli_fetch_array($sql2);
- } else {
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
- }
+ echo ' <td class="grid_header '.($bg % 2 == 0 ? 'grid_light' : 'grid_dark').' '.($id_prev==$row2['id'] && $col!=2?'col_border ':'').'" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" spr_id="'.$row2['spr_id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+
+ $row2 = mysqli_fetch_array($sql2);
}
- }
-
- #kateri missingi so nastavljeni
- $sql_grid_mv = sisplet_query("SELECT * FROM srv_grid WHERE spr_id='".$spremenljivka."' AND other != 0");
- if (mysqli_num_rows($sql_grid_mv) > 0 ) {
- echo '<td class=""></td>';
- while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
- echo '<td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row_grid_mv['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row_grid_mv['id'].'" '.(strpos($row_grid_mv['naslov'], $lang['srv_new_grid'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row_grid_mv['naslov'] . '</div></td>';
- }
+ echo ' </tr>';
}
- echo ' </tr>';
// linki za urejanje pod-spremenljivk tabele
+ $grid_plus_minus = '<div class="grid-plus-minus"><a href="#" class="noline" onclick="grid_multiple_add(\''.$row['id'].'\'); return false;" title="'.$lang['srv_gridmultiple_add'].'"><span class="faicon add icon-blue"></span><span>'.$lang['add'].'</span></a></div>';
+
echo ' <tr class="sub-table">';
echo ' <td>'.$grid_plus_minus.'</td>';
- //echo ' <td style="width:' . $spacesize . '%"></td>';
echo ' <td></td>';
$bg = 1;
@@ -5127,7 +6184,9 @@ class Branching {
if ($tip_prev != $row2['tip']) $col++;
$tip_prev = $row2['tip'];
- echo ' <td class="grid_header ' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" colspan="'.$row2['grids'].'"><a href="#" onclick="grid_multiple_edit(\''.$row['id'].'\', \''.$row2['id'].'\'); return false;">'.$lang['edit3'].'</a></td>';
+ echo ' <td class="grid_header ' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" colspan="'.$row2['grids'].'">';
+ echo ' <div class="grid-subtable-edit"><a href="#" class="noline" onclick="grid_multiple_edit(\''.$row['id'].'\', \''.$row2['id'].'\'); return false;">'.$lang['edit3'].'</a></div>';
+ echo ' </td>';
$id_prev = $row2['id'];
}
@@ -5148,14 +6207,17 @@ class Branching {
}
echo ' <tr class="variabla" id="variabla_'.$row1['id'].'">';
- echo ' <td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" '.($gridWidth == -1 ? '' : $css ).' id="'.$row1['id'].'">';
+ echo ' <td class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="'.$row1['id'].'">';
echo '<span class="faicon move_updown inline inline_move" title="'.$lang['srv_move'].'"></span>';
- echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
+
+ echo ' <div class="icons_holder">';
+ echo ' <span class="faicon delete small inline inline_delete" title="'.$lang['srv_brisivrednost'].'"></span>';
echo ' <span class="faicon odg_hidden inline inline_hidden '. (($row1['hidden'] == 1) ? 'show-hidden' : '').(($row1['hidden'] == 2) ? 'show-disable' : '') .'" odg_vre="'.$row1['hidden'].'" odg_id="'.$row1['id'].'" title="'.$lang['srv_hide-disable_answer-'.$row1['hidden']].'"></span>';
echo ' <span class="faicon odg_if_not inline inline_if_not '.(!$userAccess->checkUserAccess($what='if') ? 'user_access_locked' : '').'" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
echo ' <span class="faicon edit2 inline inline_edit"></span>';
-
- echo '<div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo ' </div>';
+
+ echo '<div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost_grid'])!==false || (isset($lang1['srv_new_vrednost_grid']) && strpos($row1['naslov'], $lang1['srv_new_vrednost_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
if ($row1['if_id'] > 0) {
echo ' <span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_podif_edit'].'">*</span>';
@@ -5198,20 +6260,22 @@ class Branching {
if ($tip_prev != $row2['tip']) $col++;
$tip_prev = $row2['tip'];
+ // Radio podtabela
if($row2['tip'] == 6) {
- //echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '">'.($row2['enota']!=2?'<input type="radio" name="foo_' . $row1['id'] . '" value="">':'').'</td>';
echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '">'.(($row2['enota']!=2 && $row2['enota']!=6)?'<input type="radio" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value=""><span class="enka-checkbox-radio"></span>':'').'</td>';
-
- } elseif($row2['tip'] == 16) {
- //echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="checkbox" name="foo_' . $row1['id'] . '" value=""></td>';
+ }
+ // Checkbox podtabela
+ elseif($row2['tip'] == 16) {
echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '">'.(($row2['enota']!=2 && $row2['enota']!=6)?'<input type="checkbox" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value=""><span class="enka-checkbox-radio"></span>':'').'</td>';
+ }
+ // Text podtabela
+ elseif ($row2['tip'] == 19) {
+ echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" class="small" name="foo_' . $row1['id'] . '" value=""></td>';
+ }
+ // Number podtabela
+ elseif ($row2['tip'] == 20) {
- } elseif ($row2['tip'] == 19) {
- echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><textarea style="width:3em; height:12px" name="foo_' . $row1['id'] . '"></textarea></td>';
-
- } elseif ($row2['tip'] == 20) {
-
- echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" style="width:'.$taWidth.'em;" name="foo_' . $row1['id'] . '" value="">';
+ echo ' <td style="width:' . $cellsize . '%" class="' .($id_prev!=$row2['id']?'col_border ':'').($col%2==0?'col_dark ':'') . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" class="small" name="foo_' . $row1['id'] . '" value="">';
if ($row['ranking_k'] == 1) {
echo '<div style="width:100%">';
@@ -5225,7 +6289,6 @@ class Branching {
echo '</div>';
- //<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css" type="text/css" media="all" />
?>
<script>
$(function() {
@@ -5244,18 +6307,20 @@ class Branching {
#kateri missingi so nastavljeni
$sql_grid_mv = sisplet_query("SELECT id FROM srv_grid WHERE spr_id='".$spremenljivka."' AND other != 0");
if (mysqli_num_rows($sql_grid_mv) > 0 ) {
- //echo '<td style="width:' . $spacesize . '%"></td>';
- echo '<td></td>';
+
+ echo '<td></td>';
+
while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
- if($row['tip'] == 6) {
+
+ if($row['tip'] == 6) {
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="radio" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value="" /><span class="enka-checkbox-radio"></span></td>';
- } elseif($row['tip'] == 16) {
+ }
+ elseif($row['tip'] == 16) {
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="checkbox" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value="" /><span class="enka-checkbox-radio"></span></td>';
- } else {
+ }
+ else {
echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="radio" class="enka-admin-custom" name="foo_' . $row1['id'] . '" value="" /><span class="enka-checkbox-radio"></span></td>';
-// echo ' <td style="width:' . $cellsize . '%" class="' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"><input type="text" style="width: 90%;" name="foo_' . $row1['id'] . '" value="" /></td>';
}
-
}
}
@@ -5263,8 +6328,12 @@ class Branching {
if ($row['enota'] == 1 && $row['tip'] == 6) {
//echo ' <td style="width:' . $spacesize . '%"></td>';
echo ' <td></td>';
- echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
+ echo ' <td style="text-align:left;" class="grid_question ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" id="f_'.$row1['id'].'_2"><div class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'_2" '.(strpos($row1['naslov2'], $lang['srv_new_vrednost_grid'])!==false || $this->lang_id!=null ?' default="1"':'').'>' . $row1['naslov2'] . '</div></td>';
}
+
+ // Zadnja bela celica kjer se nahajajo ikone za mouseover
+ echo '<td class="white" style="min-width:80px;"></td>';
+
echo ' </tr>';
$bg++;
@@ -5272,144 +6341,56 @@ class Branching {
echo ' </tbody>';
echo ' </table>';
-
}
-
- /**
- * komentarji na vprasanje - vrstica se izpise na dnu prikaza vprasanja
- *
- * @param mixed $spremenljivka
- */
- function vprasanje_komentarji ($spremenljivka) {
+ //generira dropdown in menu za missinge
+ public function missings_menu($spremenljivka){
global $lang;
- global $admin_type;
- global $global_user_id;
- SurveySetting::getInstance()->Init($this->anketa);
- $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
- $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment');
- $question_resp_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment_viewadminonly');
-
- $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
- $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
-
- if (!($admin_type <= $question_comment && $question_comment!='') && !($question_resp_comment==1)) return;
- if ($_GET['a'] == 'komentarji') return; // v komentarjih tut ne izpisujemo te vrstice
-
- echo '<div id="surveycommentcontainer_'.$spremenljivka.'" class="printHide comment_container_inline">';
-
- // komentarji na vprasanje
- if ($admin_type <= $question_comment && $question_comment != '') {
-
- // Dodaj komentar
- echo ' <span class="floatRight spaceLeft"><a href="#" id="surveycomment_'.$spremenljivka.'_0" class="surveycomment" type="1" subtype="q_admin_add" spremenljivka="'.$spremenljivka.'" view="0" onclick="return false;" title="'.$lang['srv_question_comment'].'"> ';
- //echo '<img src="img_' . $this->skin . '/comment.png" alt="'.$lang['srv_question_comment'].'" title="'.$lang['srv_question_comment'].'" > ';
- echo '<span class="faicon inline_comment"></span> ';
- echo $lang['srv_add_comment'];
- echo '</a></span>';
- echo ' <script> $(function() { load_comment(\'#surveycomment_'.$spremenljivka.'_0\'); }); </script>';
+ if($_GET['a'] !== 'komentarji' && $_GET['a'] !== 'komentarji_anketa'){
$row = Cache::srv_spremenljivka($spremenljivka);
- if ($row['thread'] == 0) {
- $row['count'] = 0;
- } else {
- if ($admin_type <= $question_comment_viewadminonly) {
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'");
- } elseif ($question_comment_viewauthor==1) {
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]' AND uid='$global_user_id'");
- } else {
- $sql = sisplet_query("SELECT * FROM post WHERE 1 = 0");
- }
- $row = mysqli_fetch_array($sql);
- $row['count']--;//1. je default comment
- }
-
- // Poglej komentarje
- if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) {
- echo '&nbsp;&nbsp;&nbsp;<span class="floatRight spaceRight" id="comment_add_'.$spremenljivka.'"'.($row['count']==0?' style="visibility:hidden"':'').'><a href="#" id="surveycomment_'.$spremenljivka.'_1" class="surveycomment" type="1" subtype="q_admin_all" spremenljivka="'.$spremenljivka.'" view="1" onclick="return false;" title="'.$lang['srv_question_comments'].'"> ';
- //echo '<img src="img_' . $this->skin . '/comments.png" alt="'.$lang['srv_question_comments'].'" title="'.$lang['srv_question_comments'].'" > ';
- echo '<span class="faicon inline_double_comment"></span> ';
- echo $lang['srv_view_comment'].''.($row['count']>0?' ('.$row['count'].')':'');
- echo '</a></span>';
- echo ' <script> $(function() { load_comment(\'#surveycomment_'.$spremenljivka.'_1\'); }); </script>';
+ $spremenljivkaParams = new enkaParameters($row['params']);
+
+ # preberemo missing vrednosti iz class.SurveyMissingValues - kateri so na voljo v anketi
+ $smv = new SurveyMissingValues($this->anketa);
+ $missing_values = $smv->GetUnsetValuesForSurvey();
+
+ # kateri missingi so nastavljeni
+ $already_set_mv = array();
+ $sql_grid_mv = sisplet_query("SELECT naslov, other FROM srv_vrednost WHERE spr_id='".$spremenljivka."' AND other != 0");
+ while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
+ $already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov'];
}
- }
- // komentarji respondentov
- if (($question_resp_comment==1) AND ($admin_type <= $question_resp_comment_viewadminonly)) {
+ $missing_menu_items = '';
- echo '&nbsp;<span class="spaceRight floatRight" style="padding-right:10px">';
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spremenljivka'");
- $row = mysqli_fetch_array($sql);
+ if (count($missing_values) > 0) {
+ foreach ($missing_values AS $mv_key => $mv_text) {
+ $missing_menu_items = '
+ <li>
+ <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').'
+ onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked); close_missing_menu(\'' . $row['id'] . '\');"
+ id="missing_value_'.$row['id'].'_'.$mv_key.'">
+ <label for="missing_value_'.$row['id'].'_'.$mv_key.'" class="pointer">'.$mv_text.'</label></li>'
+ .$missing_menu_items;
+ }
- if ($row['count'] > 0) {
- echo '<a href="#" id="surveycomment_'.$spremenljivka.'_2" class="surveycomment" type="2" subtype="q_resp_all" spremenljivka="'.$spremenljivka.'" onclick="return false;">';
- echo '<span class="faicon inline_comment icon-orange"></span> ';
- echo $lang['srv_repondent_comment'].' ('.$row['count'].')';
- echo '</a>';
- echo ' <script> $(function() { load_comment(\'#surveycomment_'.$spremenljivka.'_2\'); }); </script>';
}
- echo '</span>';
- }
- echo '</div>';
- }
-
- /**
- * komentarji na if oz. blok - vrstica se izpise na dnu prikaza ifa oz. bloka
- *
- * @param mixed $if_id (id ifa ali bloka)
- * @param mixed $block (ali gre za if ali blok)
- */
- function if_komentarji ($if_id, $block=0) {
- global $lang;
- global $admin_type;
- global $global_user_id;
-
- SurveySetting::getInstance()->Init($this->anketa);
- $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
-
- $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
- $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
-
- if (!($admin_type <= $question_comment && $question_comment!='')) return;
- if ($_GET['a'] == 'komentarji') return; // v komentarjih tut ne izpisujemo te vrstice
+ if (count($missing_values) > 0) {
- // komentarji na if ali blok
- if ($admin_type <= $question_comment && $question_comment != '') {
-
- // Dodaj komentar
- echo ' <span class="floatRight spaceLeft"><a href="#" id="surveycomment_'.$if_id.'_0" class="surveycomment" type="'.($block==1 ? '6' : '5').'" subtype="'.($block==1 ? 'blok_admin_add' : 'if_admin_add').'" spremenljivka="'.$if_id.'" view="0" onclick="return false;" title="'.$lang['srv_question_comment'].'"> ';
- //echo '<img src="img_' . $this->skin . '/comment.png" alt="'.$lang['srv_question_comment'].'" title="'.$lang['srv_question_comment'].'" > ';
- echo '<span class="faicon inline_comment"></span> ';
- echo $lang['srv_add_comment'];
- echo '</a></span>';
- echo ' <script> $(function() { load_comment(\'#surveycomment_'.$if_id.'_0\'); }); </script>';
-
- $row = Cache::srv_if($if_id);
- if ($row['thread'] == 0) {
- $row['count'] = 0;
- } else {
- if ($admin_type <= $question_comment_viewadminonly) {
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'");
- } elseif ($question_comment_viewauthor==1) {
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]' AND uid='$global_user_id'");
- } else {
- $sql = sisplet_query("SELECT * FROM post WHERE 1 = 0");
- }
- $row = mysqli_fetch_array($sql);
- $row['count']--;//1. je default comment
- }
-
- // Poglej komentarje
- if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) {
- echo '&nbsp;&nbsp;&nbsp;<span class="floatRight spaceRight" id="comment_add_'.$if_id.'"'.($row['count']==0?' style="visibility:hidden"':'').'><a href="#" id="surveycomment_'.$if_id.'_1" class="surveycomment" type="'.($block==1 ? '6' : '5').'" subtype="'.($block==1 ? 'blok_admin_all' : 'if_admin_all').'" spremenljivka="'.$if_id.'" view="1" onclick="return false;" title="'.$lang['srv_question_comments'].'"> ';
- //echo '<img src="img_' . $this->skin . '/comments.png" alt="'.$lang['srv_question_comments'].'" title="'.$lang['srv_question_comments'].'" > ';
- echo '<span class="faicon inline_double_comment"></span> ';
- echo $lang['srv_view_comment'].''.($row['count']>0?' ('.$row['count'].')':'');
- echo '</a></span>';
- echo ' <script> $(function() { load_comment(\'#surveycomment_'.$if_id.'_1\'); }); </script>';
+ echo '<div class="missing_dropdown_link">
+ <a href="#" onclick="toggle_missing_dropdown_table('.$spremenljivka.'); return false;" title="'.$lang['srv_manjkajoce_vrednosti'].'">'.
+ $lang['srv_manjkajoce_vrednosti'].'&nbsp;&nbsp;<span class="faicon arrow2_d small"></span></a>
+ </div>
+ <div>
+ <div id="table_missings_menu_'.$row['id'].'" class="table_missings_menu mm_extra">
+ <form name="vprasanje_edit"><ul>
+ <li><strong>'.$lang['srv_manjkajoce_vrednosti'].' '.Help::display('srv_missing_values').'</strong></li>
+ '.$missing_menu_items.'
+ </ul></form></div></div>
+ ';
}
}
}
@@ -5432,11 +6413,15 @@ class Branching {
$this->Survey = new \App\Controllers\SurveyController(true);
$lang = $l;
+
save('lang_id', $this->lang_id);
+
$rowl = \App\Controllers\LanguageController::srv_language_spremenljivka($id);
- if ($id == -1) {
+
+ if ($id == -1 && isset($rowl['naslov'])) {
if (strip_tags($rowl['naslov']) != '') $row['introduction'] = $rowl['naslov'];
- } else {
+ }
+ elseif(isset($rowl['naslov'])) {
if (strip_tags($rowl['naslov']) != '') $row['conclusion'] = $rowl['naslov'];
}
}
@@ -5524,7 +6509,7 @@ class Branching {
// prikažemo nastavitve vprasanja
$fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false;
- echo '<div id="spr_settings_intro_concl" >'."\n\r";
+ echo '<div id="spr_settings_intro_concl" class="spr_settings">'."\n\r";
if ($id == -1) {
$show = $row['show_intro'];
@@ -5545,25 +6530,21 @@ class Branching {
// <-- Editor teksta vprasanja ---
echo '<div class="spremenljivka_tekst_form">';
echo '<div class="naslov naslov_inline" contenteditable="'.(!$this->locked?'true':'false').'" spr_id="'.$id.'" tabindex="1" '.(strpos($text, $selectall)!==false?' default="1"':'').'>'.$text.'</div>';
- echo '<div class="clr"></div>';
echo '<span class="faicon edit-vprasanje icon-as_link display_editor" onclick="inline_load_editor(this); return false;"></span>';
// opomba
if ($opomba != '' && $this->lang_id == null) {
- echo '<table style="margin-top:5px; width:100%"><tr>';
- echo '<td style="width:120px;">'.$lang['note'].' ('.$lang['srv_internal'].'):</td>';
- echo '<td >';
- echo '<span>'.$opomba.'</span>';
- echo '</td>';
- echo '</tr></table>';
+
+ echo '<div class="opomba_holder">';
+ echo '*'.$lang['note'].' ('.$lang['srv_internal'].'): '.$opomba;
+ echo '</div>';
}
+
echo '</div>';
// --- Editor teksta vprasanja -->
-
- echo '<div class="clr"></div>';
-
- } else { // urejanje uvoda,zakljucka
+ }
+ else { // urejanje uvoda,zakljucka
// <-- Zgornja vrstica pri editiranju vprasanj ---
echo '<div class="spremenljivka_settings spremenljivka_settings_active">';
@@ -5576,9 +6557,8 @@ class Branching {
// prikažemo nastavitve vprasanja
$fullscreen = ( isset($_POST['fullscreen']) && $_POST['fullscreen'] != 'undefined') ? (int)$_POST['fullscreen'] : false;
- echo '<div id="spr_settings_intro_concl" >'."\n\r";
+ echo '<div id="spr_settings_intro_concl" class="spr_settings">'."\n\r";
echo ' <span id="visible_introconcl_'.$id.'" class="extra_opt">';
- //$this->introconcl_visible($id);
echo ' </span>'."\n\r";
echo '</div>';
@@ -5601,7 +6581,6 @@ class Branching {
echo '<div id="editor_display_' . $id. '" class="editor_display" >';
echo '<div class="faicon edit-vprasanje icon-as_link pointer lightRed" onmouseover="editor_display(\'' . $id . '\'); $(this).parent().hide();" style="width:auto;" title="'.$lang['srv_editor'].'">';
- //echo '<img src="img_' . $this->skin . '/settings.png" />';
echo '<span class="faicon edit-vprasanje icon-as_link"></span>';
echo'</div>';
echo '</div>';
@@ -5713,16 +6692,14 @@ class Branching {
// <-- Editor teksta vprasanja ---
echo '<div class="spremenljivka_tekst_form">';
echo '<div class="naslov naslov_inline">'.$text.'</div>';
- echo '<div class="clr"></div>';
-
echo '</div>';
// --- Editor teksta vprasanja -->
-
echo '<div class="clr"></div>';
// Da/ne variable
+ echo '<div class="content_div_normalmode">';
echo '<div id="variable_holder" class="variable_holder">';
echo '<div class="variabla">';
@@ -5740,6 +6717,7 @@ class Branching {
echo '</div>';
echo '</div>';
+ echo '</div>';
echo '<br />';
@@ -5793,7 +6771,7 @@ class Branching {
/**
* @desc prikaze pogoje v IFu
*/
- function conditions_display($if, $long_alert=0, $notranji_pogoj=0) {
+ function conditions_display($if, $long_alert=0, $notranji_pogoj=0, $vrednost=0) {
global $lang;
$row_if = Cache::srv_if($if);
@@ -5890,6 +6868,7 @@ class Branching {
else
echo $row2['variable'];
}
+
// multigrid
} elseif ($row['vre_id'] > 0) {
@@ -5897,7 +6876,7 @@ class Branching {
// Preverimo pogoj -1
$sqlX = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id='$row[id]' AND grd_id='-1'");
- if (!$sql2) echo mysqli_error($GLOBALS['connect_db']);
+ if (!$sqlX) echo mysqli_error($GLOBALS['connect_db']);
if(mysqli_num_rows($sqlX) > 0){
echo '-1';
$j++;
@@ -6031,48 +7010,55 @@ class Branching {
echo ' ) ';
}
- //echo '</span>';
if ($row_if['label'] != '') {
echo ' <span class="if_comment">(';
echo ' '.$row_if['label'].' ';
echo ')</span> ';
-
}
$condition_check = $this->condition_check($if);
if ($long_alert) {
- if ($c == 1 && $spr_id == 0)
- if ($this->count_spr_in_if($if) > 1) {
+
+ if ($c == 1 && $spr_id == 0){
+
+ if ($this->count_spr_in_if($if) > 1) {
echo '<em>'.$lang['srv_edit_condition_question'].'</em>';
- } else {
+ }
+ else {
$spr = $this->find_first_in_if($if);
$r = Cache::srv_spremenljivka($spr);
- if (!$spr > 0) $r['variable'] = '';
- echo '<em>'.sprintf($lang['srv_edit_condition_question1'], '<span class="variable">'.$r['variable'].'</span>').'</em>';
+
+ if (!$spr > 0)
+ $r['variable'] = '';
+
+ if(($vrednost == -4))
+ echo '<em>'.sprintf($lang['srv_edit_validation_question1'], '<span class="variable">'.$r['variable'].'</span>').'</em>';
+ else
+ echo '<em>'.sprintf($lang['srv_edit_condition_question1'], '<span class="variable">'.$r['variable'].'</span>').'</em>';
}
- //if ($condition_check >= 1 && $condition_check <= 5 ) {
- echo '<span class="error_display">';
- if ($condition_check == 1)
- echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_oklepaji'].'</span>';
- if ($condition_check == 2) {
- if (mysqli_num_rows($sql) > 1) // ko nardimo nov if, ne prikazemo takoj errorja
- echo '<span class="faicon warning icon-orange"></span> <span style="color:red">'.$lang['srv_error_spremenljivka'].'</span>';
- } elseif ($condition_check == 3)
- echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_vrednost'].'</span>';
- if ($condition_check == 4)
- echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_numericno'].'</span>';
- if ($condition_check == 5)
- echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_calculation'].'</span>';
- if ($condition_check == 6)
- echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_date'].'</span>';
- echo '</span>';
- //}
- } else {
+ echo '<span class="error_display">';
+ if ($condition_check == 1)
+ echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_oklepaji'].'</span>';
+ if ($condition_check == 2) {
+ if (mysqli_num_rows($sql) > 1) // ko nardimo nov if, ne prikazemo takoj errorja
+ echo '<span class="faicon warning icon-orange"></span> <span style="color:red">'.$lang['srv_error_spremenljivka'].'</span>';
+ } elseif ($condition_check == 3)
+ echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_vrednost'].'</span>';
+ if ($condition_check == 4)
+ echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_numericno'].'</span>';
+ if ($condition_check == 5)
+ echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_calculation'].'</span>';
+ if ($condition_check == 6)
+ echo '<span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_date'].'</span>';
+ echo '</span>';
+ }
+ }
+ else {
if ($condition_check != 0)
- echo ' <span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_if_error'].'</span>';
+ echo ' <span class="if_warning"><span class="faicon warning"></span>'.$lang['srv_if_error'].'</span>';
}
@@ -6094,7 +7080,7 @@ class Branching {
$rowb = Cache::srv_if($if);
//začetek oklepaja za ZANKO
- echo '<strong class="clr_lp">LOOP</strong> <span class="colorloop">('.$rowb['number'].')</span>';
+ echo '<span class="clr_lp">LOOP</span> <span class="colorloop">('.$rowb['number'].')</span>';
$sql = sisplet_query("SELECT l.spr_id, s.variable FROM srv_loop l, srv_spremenljivka s WHERE l.if_id='$if' AND l.spr_id=s.id");
$row = mysqli_fetch_array($sql);
@@ -6182,6 +7168,85 @@ class Branching {
return true;
}
+ function check_pogoji_output () {
+ global $lang;
+
+ $output = '';
+
+ $code = $this->check_pogoji();
+
+ // ce je vse ok, preverimo se loope
+ if ($code === true)
+ $code = $this->check_loops();
+
+ // ce je vse ok, preverimo se validacije
+ if ($code === true)
+ $code = $this->check_validation();
+
+ // ce je vse ok, preverimo se imena variabel (vprasanj in variabel znotraj vprasanj)
+ if ($code === true)
+ $code = $this->check_variable();
+
+ // ce je vse ok, preverimo se vrednosti stolpcev v gridu (ce je slucajno kaksna prazna)
+ if ($code === true)
+ $code = $this->check_grid_value();
+
+ if ($code === true) return '1';
+
+ $output .= '<div class="bottom8">';
+ if ($code['type'] == 'if' || $code['type'] == 'podif')
+ $output .= $lang['srv_check_pogoji_not_ok'];
+ elseif ($code['type'] == 'loop')
+ $output .= $lang['srv_loop_no_nesting'];
+ elseif ($code['type'] == 'question_variable')
+ $output .= $lang['srv_duplicate_question_variable'];
+ elseif ($code['type'] == 'variable')
+ $output .= $lang['srv_duplicate_variables'];
+ elseif ($code['type'] == 'grid_value')
+ $output .= $lang['srv_empty_grid_values'];
+
+ $output .= '</div>';
+
+ // napaka v ifih
+ if ($code['type'] == 'if') {
+ $sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'");
+ $row = mysqli_fetch_array($sql);
+ $output .= '<p class="">'.$lang['srv_check_pogoji_if'].' <a class="noline" href="javascript:condition_editing(\''.$row['id'].'\');$(\'#fullscreen\').fadeOut(\'slow\'); popupClose();"><b>'.$row['number'].'</b></a>.</p>';
+ }
+ // napaka v podifih, ki so nastavljeni na vrednosti spremenljivk
+ elseif ($code['type'] == 'podif') {
+ $sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'");
+ $row = mysqli_fetch_array($sql);
+ $output .= '<p>'.$lang['srv_check_pogoji_spremenljivka'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');$(\'#fullscreen\').fadeOut(\'slow\'); popupClose();">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
+ }
+ // napaka z gnezdenjem loopov
+ elseif ($code['type'] == 'loop') {
+ $sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'");
+ $row = mysqli_fetch_array($sql);
+ $output .= '<p>'.$lang['srv_check_pogoji_loop'].' <a href="javascript:condition_editing(\''.$row['id'].'\');$(\'#fullscreen\').fadeOut(\'slow\'); popupClose();"><b>'.$row['number'].'</b></a></p>';
+ }
+ elseif ($code['type'] == 'validation') {
+ $sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'");
+ $row = mysqli_fetch_array($sql);
+ $output .= '<p>'.$lang['srv_check_validacija'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');$(\'#fullscreen\').fadeOut(\'slow\'); popupClose();">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
+ }
+ // napaka z imeni variabel
+ elseif ($code['type'] == 'variable') {
+ foreach ($code['vars'] AS $var) {
+ $output .= '<strong>'.$var.'</strong><br />';
+ };
+ }
+ // napaka z vrednostmi v gridu
+ elseif ($code['type'] == 'grid_value') {
+ foreach ($code['vars'] AS $var) {
+ $output .= '<strong>'.$var.'</strong><br />';
+ };
+ }
+
+
+ return $output;
+ }
+
/**
* preveri celo anketo, ce so loopi pravilno postavljeni
* gleda pa to, da loopi niso vgnezdeni en znotraj drugega
@@ -6284,15 +7349,44 @@ class Branching {
}
}
}
-
- /*if(count($spr_errors))
- return $spr_errors;*/
if(count($var_errors))
return $var_errors;
return true;
}
+
+ /**
+ * preveri, da vrednosti gridov (multigrid vprasanja) v anketi niso prazne
+ *
+ */
+ public function check_grid_value () {
+
+ $spr_errors = array();
+ $vars = array();
+
+ // Poiscemo gride, ki imajo prazno vrednost
+ $sql = sisplet_query("SELECT grid.vrstni_red, s.id AS spr_id, s.variable AS spr_variable
+ FROM srv_grid grid, srv_spremenljivka s, srv_grupa g
+ WHERE grid.spr_id=s.id AND s.gru_id=g.id AND g.ank_id='".$this->anketa."'
+ AND (grid.variable='' OR grid.variable='<br>')
+ ");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ while ($row = mysqli_fetch_array($sql)) {
+ $vars[] = $row['spr_variable'] . ' - ' . $row['vrstni_red'];
+ }
+
+ if(count($vars)){
+ $spr_errors['type'] = 'grid_value';
+ $spr_errors['code'] = '7';
+ $spr_errors['vars'] = $vars;
+
+ return $spr_errors;
+ }
+
+ return true;
+ }
/**
@@ -6563,9 +7657,7 @@ class Branching {
echo '<h2>'.$lang['urejanje_pogoj_popup_vrednost'].'</h2>';
echo '<div class="popup_close"><a href="#" onClick="vrednost_condition_editing_close(\''.$vrednost.'\', \''.$if.'\'); return false;"">✕</a></div>';
- echo '<span class="bold">'.$lang['urejanje_podif_alert'].'</span>';
-
- echo '<br /><br />';
+ echo '<span class="semi-bold">'.$lang['urejanje_podif_alert'].'</span>';
$sql = sisplet_query("SELECT naslov FROM srv_vrednost WHERE id='$vrednost'");
$row = mysqli_fetch_assoc($sql);
@@ -6573,7 +7665,7 @@ class Branching {
}
// Pogoj pri npr. obvescanju
elseif($vrednost == -3){
- echo '<h2>'.$lang['urejanje_pogoj_popup'].'</h2>';
+ echo '<h2>IF - '.$lang['urejanje_pogoj_popup'].'</h2>';
echo '<div class="popup_close"><a href="#" onClick="alert_if_close(\''.$vrednost.'\', \''.$if.'\'); return false;">✕</a></div>';
}
// Validacija
@@ -6601,26 +7693,56 @@ class Branching {
// gumbi na desni v novem oknu
if ($vrednost==0) {
- // floating box
+ // floating box
echo '<div id="div_condition_editing_float">';
+
+ echo '<div class="condition_header">';
+
+ echo '<span class="faicon edit"></span>';
+
if ($row['tip'] == 0)
- echo '<h2>'.$lang['oblikovanje_if'].'</h2>';
+ echo $lang['oblikovanje_if'];
elseif ($row['tip'] == 1)
- echo '<h2>'.$lang['oblikovanje_blok'].'</h2>';
+ echo $lang['oblikovanje_blok'];
elseif ($row['tip'] == 2)
- echo '<h2>'.$lang['srv_loop_urejanje'].'</h2>';
+ echo $lang['srv_loop_urejanje'];
- if ($row['tip'] == 0)
- echo '<p class="heading">'.$lang['srv_edit_condition_question'].'</p>';
- elseif ($row['tip'] == 1)
- echo '<p class="heading">'.$lang['srv_block_desc'].'</p>';
+ echo '</div>';
+
+
+ echo '<div class="condition_edit">';
+
+
+ echo '<fieldset><legend>'.$lang['srv_common_settings'].'</legend>';
+ if ($row['tip'] == 0){
+ echo '<div class="condition_setting_holder">';
+ echo ' <div class="condition_setting_line">';
+ echo '<p>'.$lang['srv_edit_condition_question'].'</p>';
+ echo ' </div>';
+ echo '</div>';
+ }
+ elseif ($row['tip'] == 1){
+ echo '<div class="condition_setting_holder">';
+ echo ' <div class="condition_setting_line">';
+ echo '<p>'.$lang['srv_block_desc'].'</p>';
+ echo ' </div>';
+ echo '</div>';
+ }
+
if ($vrednost != -1 && $vrednost != -2) {
- echo '<p><span class="title">';
- echo ($row['tip']==0?$lang['srv_if_label']:($row['tip']==1?$lang['srv_block_label']:$lang['srv_loop_label'])).':</span>';
- echo '<span class="content"><input type="text" name="label_'.$if.'" id="label_'.$if.'" value="'.$row['label'].'" ></span>';
- echo '</p>';
+
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line half-half">';
+ echo ' <label>'.($row['tip'] == 0 ? $lang['srv_if_label'] : ($row['tip'] == 1 ? $lang['srv_block_label'] :$lang['srv_loop_label'])).':</label>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="label_'.$if.'" id="label_'.$if.'" value="'.$row['label'].'">';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -6629,23 +7751,41 @@ class Branching {
' });' .
'});';
echo '</script>';
-
}
+ // Dodaj blok/if v knjiznico
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line with-icon">';
+ echo ' <span onClick="displayAddIntoLibraryPopup(\''.$if.'\', \'2_'.$row['tip'].'\');"><span class="faicon library"></span>'.$lang['srv_library_add_to_lib'].'</span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+
+
if ($row['tip'] == 0 || $row['tip'] == 1) {
- echo '<fieldset>';
+ echo '<fieldset><legend>'.($row['tip'] == 1 ? $lang['srv_block_enabled'] : $lang['srv_if_enabled']).'</legend>';
- echo '<p><span class="title">'.($row['tip'] == 1 ? $lang['srv_block_enabled'] : $lang['srv_if_enabled']).':</span>';
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" class="enka-admin-custom" value="0" name="if_edit" id="if_edit_0" '.($row['enabled']==0?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><label for="if_edit_0">'.$lang['srv_if_enabled_'.$row['tip']].'</label>';
+ echo ' </div>';
- echo'<span class="displayBlock" style="padding:5px 0 0 5px;">';
- echo '<label for="if_edit_0"><input type="radio" class="enka-admin-custom" value="0" name="if_edit" id="if_edit_0" '.($row['enabled']==0?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><span class="enka-checkbox-radio"></span>'.$lang['srv_if_enabled_'.$row['tip']].'</label>';
- if ($row['tip'] == 0)
- echo '<span class="spaceLeft"><label for="if_edit_1"><input type="radio" value="1" name="if_edit" id="if_edit_1" class="enka-admin-custom" '.($row['enabled']==1?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><span class="enka-checkbox-radio"></span>'.$lang['srv_if_enabled_1'].'</label></span>';
- echo '<span class="spaceLeft"><label for="if_edit_2"><input type="radio" value="2" name="if_edit" id="if_edit_2" class="enka-admin-custom" '.($row['enabled']==2?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><span class="enka-checkbox-radio"></span>'.$lang['srv_if_enabled_2'].'</label></span>';
- echo '</span>';
+ if ($row['tip'] == 0){
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" value="1" name="if_edit" id="if_edit_1" class="enka-admin-custom" '.($row['enabled']==1?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><label for="if_edit_1">'.$lang['srv_if_enabled_1'].'<label for="if_edit_1"></label>';
+ echo ' </div>';
+ }
- echo '</p>';
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" value="2" name="if_edit" id="if_edit_2" class="enka-admin-custom" '.($row['enabled']==2?' checked="checked"':'').' onClick="if_edit_enabled(\''.$row['id'].'\', $(this).val())" /><label for="if_edit_2">'.$lang['srv_if_enabled_2'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
echo '</fieldset>';
}
@@ -6653,15 +7793,18 @@ class Branching {
// Posebna nastavitev vrednosti statusa panelista ce je vklopljen modul "panel"
if ($row['tip'] == 0 && SurveyInfo::getInstance()->checkSurveyModule('panel')) {
- echo '<fieldset>';
- echo '<p><span class="title">'.$lang['srv_panel_if'].':</span>';
+ echo '<fieldset><legend>'.$lang['srv_panel_if'].'</legend>';
- $sp = new SurveyPanel($this->anketa);
+ $sp = new SurveyPanel($this->anketa);
$panel_if = $sp->getPanelIf($if);
-
- echo'<span class="displayBlock" style="padding:5px 0 0 5px;">';
- echo '<input type="text" name="panel_status_'.$if.'" id="panel_status_'.$if.'" value="'.$panel_if.'" ></span>';
- echo '</span>';
+
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="text" class="text medium" name="panel_status_'.$if.'" id="panel_status_'.$if.'" value="'.$panel_if.'" ></span>';
+ echo ' </div>';
+
+ echo '</div>';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -6671,28 +7814,40 @@ class Branching {
'});';
echo '</script>';
- echo '</p>';
echo '</fieldset>';
}
if ($row['tip'] == 1) {
- echo '<fieldset>';
+ echo '<fieldset><legend>'.$lang['srv_block_random'].' '.Help::display('srv_block_random').'</legend>';
// Blok ki prikaze nakljucno razvrscena vprasanja (in samo doloceno stevilo)
- echo '<p>';
- echo ' <span class="title">'.$lang['srv_block_random'].': </span>'.Help::display('srv_block_random');
- echo ' <span class="displayBlock" style="padding:5px 0 0 5px;">';
- echo ' <label for="if_random_-1"><input type="radio" value="-1" class="enka-admin-custom small-padding" name="if_random" id="if_random_-1" '.($row['random']==-1?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val());" /><span class="enka-checkbox-radio"></span>'.$lang['no1'].'</label>';
- echo ' <span class="spaceLeft"><label for="if_random_-2"><input type="radio" value="-2" class="enka-admin-custom small-padding" name="if_random" id="if_random_-2" '.($row['random']==-2?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val())" /><span class="enka-checkbox-radio"></span>'.$lang['srv_block_random_blocks'].'</label></span>';
- echo ' <span class="spaceLeft"><label for="if_random_0"><input type="radio" value="0" class="enka-admin-custom small-padding" name="if_random" id="if_random_0" '.($row['random']>=0?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val())" /><span class="enka-checkbox-radio"></span>'.$lang['srv_block_random_questions'].'</label></span>';
- echo ' </span>';
- echo '</p>';
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" value="-1" class="enka-admin-custom small-padding" name="if_random" id="if_random_-1" '.($row['random']==-1?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val());" /><label for="if_random_-1">'.$lang['no1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" value="-2" class="enka-admin-custom small-padding" name="if_random" id="if_random_-2" '.($row['random']==-2?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val())" /><label for="if_random_-2">'.$lang['srv_block_random_blocks'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="condition_setting_line">';
+ echo ' <input type="radio" value="0" class="enka-admin-custom small-padding" name="if_random" id="if_random_0" '.($row['random']>=0?' checked="checked"':'').' onClick="if_blok_random(\''.$row['id'].'\', $(this).val())" /><label for="if_random_0">'.$lang['srv_block_random_questions'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Stevilo vprasanj ki jih nakljucno izberemo (ce je zgornja "da")
- echo '<p id="if_blok_random_cnt" '.(($row['random'] >= 0) ? '' : ' style="display:none;"').'><span class="title">'.$lang['srv_block_random_cnt'].':</span><span class="content">';
- echo '<select onchange="if_blok_random_cnt(\''.$row['id'].'\', $(this).val());">';
- echo ' <option value="0" '.($row['random']==0 ? 'selected' : '').'>'.$lang['srv_block_random_all'].'</option>';
+ echo '<div id="if_blok_random_cnt" class="condition_setting_holder" '.(($row['random'] >= 0) ? '' : ' style="display:none;"').'>';
+
+ echo ' <div class="condition_setting_line half-half">';
+ echo ' <label>'.$lang['srv_block_random_cnt'].':</label>';
+
+ echo ' <span class="content">';
+ echo ' <select class="dropdown medium" onchange="if_blok_random_cnt(\''.$row['id'].'\', $(this).val());">';
+ echo ' <option value="0" '.($row['random']==0 ? 'selected' : '').'>'.$lang['srv_block_random_all'].'</option>';
$sqlB = sisplet_query("SELECT count(*) AS cnt_spr FROM srv_branching
WHERE ank_id='".$this->anketa."' AND parent='".$row['id']."' AND element_spr>'0'
ORDER BY vrstni_red");
@@ -6702,102 +7857,119 @@ class Branching {
echo ' <option value="'.$i.'" '.($row['random']==$i ? 'selected' : '').'>'.$i.'</option>';
}
}
- echo '</select>';
-
+ echo ' </select>';
+ echo ' </span>';
+
+ echo ' </div>';
+
+ echo '</div>';
+
+
// Blok ki vsebuje horizontalno urejena vprasanja
- echo '<p><span class="title">'.$lang['srv_orientacija_vprasanja'].':</span><span class="content">';
- echo '<select name="if_blok_horizontal" onchange="if_blok_horizontal(\''.$row['id'].'\', $(this).val());">';
- echo ' <option value="0" '.($row['horizontal']==0?'selected':'').'>'.$lang['srv_orientacija_classic'].'</option>';
- echo ' <option value="2" '.($row['horizontal']==2?'selected':'').'>'.$lang['srv_orientacija_expand'].'</option>';
- echo ' <option value="1" '.($row['horizontal']==1?'selected':'').'>'.$lang['srv_orientacija_horizontalna_3'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line half-half">';
+ echo ' <label>'.$lang['srv_orientacija_vprasanja'].':</label>';
+ echo ' <span class="content">';
+ echo ' <select class=dropdown medium" name="if_blok_horizontal" onchange="if_blok_horizontal(\''.$row['id'].'\', $(this).val());">';
+ echo ' <option value="0" '.($row['horizontal']==0?'selected':'').'>'.$lang['srv_orientacija_classic'].'</option>';
+ echo ' <option value="2" '.($row['horizontal']==2?'selected':'').'>'.$lang['srv_orientacija_expand'].'</option>';
+ echo ' <option value="1" '.($row['horizontal']==1?'selected':'').'>'.$lang['srv_orientacija_horizontalna_3'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// Blok kot zavihek
- echo '<p><span class="title">'.$lang['srv_block_tab'].':</span><span class="content">';
- echo '<select name="if_blok_tab" onchange="if_blok_tab(\''.$row['id'].'\', $(this).val());">';
- echo ' <option value="0" '.($row['tab']==0?'selected':'').'>'.$lang['no'].'</option>';
- echo ' <option value="1" '.($row['tab']==1?'selected':'').'>'.$lang['yes'].'</option>';
- echo '</select>';
- echo '</span></p>';
-
+ echo '<div class="condition_setting_holder">';
+
+ echo ' <div class="condition_setting_line half-half">';
+ echo ' <label>'.$lang['srv_block_tab'].':</label>';
+ echo' <span class="content">';
+ echo ' <select class="dropdown medium" name="if_blok_tab" onchange="if_blok_tab(\''.$row['id'].'\', $(this).val());">';
+ echo ' <option value="0" '.($row['tab']==0?'selected':'').'>'.$lang['no'].'</option>';
+ echo ' <option value="1" '.($row['tab']==1?'selected':'').'>'.$lang['yes'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// Opozorilo, da mora biti blok na svoji strani (ce je vklopljena katera od zgornjih nastavitev)
- echo '<p id="blok_pb_warning" '.($row['tab']==1 || $row['horizontal']==1 || $row['random']>=0 ? '' : ' style="display:none;"').'><span class="red bold">'.$lang['srv_block_pbWarning'].'</span></p>';
-
+ echo '<div id="blok_pb_warning" class="condition_setting_holder" '.($row['tab']==1 || $row['horizontal']==1 || $row['random']>=0 ? '' : ' style="display:none;"').'>';
+ echo ' <div class="condition_setting_line half-half">';
+ echo ' <span class="red bold">'.$lang['srv_block_pbWarning'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
echo '</fieldset>';
}
+
+ echo '</div>';
- echo '<span id="condition_editing_bottom_placeholder"></span>';
-
- echo '<span class="buttonwrapper spaceRight floatLeft" id="if_remove_all" style="margin-bottom:10px">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="if_remove(\''.$if.'\', \'1\', \'0\'); return false;" title="'.($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) ).'"><span>'.($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) ).'</span></a>'."\n\r";
- echo '</span>';
+ echo '<div class="remove_condition_holder">';
- echo '<div class="clr"></div>';
+ echo ' <div id="if_remove_all" onclick="if_remove(\''.$if.'\', \'1\', \'0\'); return false;" title="'.($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) ).'">';
+ echo ($row['tip'] == 0 ? $lang['srv_if_rem_all'] : ($row['tip']==1?$lang['srv_block_rem_all']:$lang['srv_loop_rem_all']) );
+ echo ' </div>';
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="condition_editing_close(\''.$if.'\'); return false;">'.$lang['srv_zapri'].'</a>';
- echo '</span>';
+ echo ' <div onclick="if_remove(\''.$if.'\'); return false;" title="'.($row['tip'] == 0 ? $lang['srv_if_rem_only'] : ($row['tip']==1?$lang['srv_block_rem_only']:$lang['srv_loop_rem_only']) ).'">';
+ echo ' <span class="faicon delete"></span>';
+ echo ($row['tip'] == 0 ? $lang['srv_if_rem_only'] : ($row['tip']==1?$lang['srv_block_rem_only']:$lang['srv_loop_rem_only']) );
+ echo ' </div>';
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="if_remove(\''.$if.'\'); return false;" title="'.($row['tip'] == 0 ? $lang['srv_if_rem'] : ($row['tip']==1?$lang['srv_block_rem']:$lang['srv_loop_rem']) ).'"><span>'.($row['tip'] == 0 ? $lang['srv_if_rem'] : ($row['tip']==1?$lang['srv_block_rem']:$lang['srv_loop_rem']) ).'</span></a>'."\n\r";
- echo '</span>';
+ echo '</div>';
- echo '</div>'; // -- div_condition_editing_float
+
+ echo '<div class="button_holder">';
- }
- // filter v DisplayData
- elseif ($vrednost == -1) {
- // tega niti ni vec...
- }
- // profili filtrov
- elseif ($vrednost == -2) {
+ echo ' <button class="small blue" onclick="condition_editing_close(\''.$if.'\'); return false;">';
+ echo $lang['srv_zapri'];
+ echo ' </button>';
+
+ echo '</div>';
+
+ echo '</div>'; // -- div_condition_editing_float
}
// klasicen popup v #div_condition_editing, uporablja se npr pri ifih za obvescanje
- elseif ($vrednost == -3) {
- echo '<span class="buttonwrapper floatRight">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="alert_if_close(\''.$vrednost.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="alert_if_close(\''.$vrednost.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="alert_if_remove(\''.$if.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span>'.$lang['srv_if_rem'].'</span></a>'."\n\r";
- echo '</span>';
-
+ elseif ($vrednost == -3) {
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="alert_if_remove(\''.$if.'\'); return false;" title="'.$lang['srv_if_rem'].'">'.$lang['srv_if_rem'].'</button>';
+ echo '<button class="medium blue" onclick="alert_if_close(\''.$vrednost.'\', \''.$if.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
}
// validacija
- elseif ($vrednost == -4) {
- echo '<span class="buttonwrapper floatRight">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="validation_if_close(\''.$this->spremenljivka.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="validation_if_close(\''.$this->spremenljivka.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="validation_if_remove(\''.$this->spremenljivka.'\', \''.$if.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span>'.$lang['srv_if_rem'].'</span></a>'."\n\r";
- echo '</span>';
-
+ elseif ($vrednost == -4) {
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_if_rem'].'" onClick="validation_if_remove(\''.$this->spremenljivka.'\', \''.$if.'\'); return false;">'.$lang['srv_if_rem'].'</button>';
+ echo '<button class="medium blue" onClick="validation_if_close(\''.$this->spremenljivka.'\', \''.$if.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ }
+ // analize, podatki, vabila ipd
+ elseif ($vrednost == -2) {
}
// filter na vrednosti
- else {
- echo '<span class="buttonwrapper floatRight">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="vrednost_condition_editing_close_save(\''.$vrednost.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_condition_editing_close(\''.$vrednost.'\', \''.$if.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_if_remove(\''.$if.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span>'.$lang['srv_if_rem'].'</span></a>'."\n\r";
- echo '</span>';
+ else {
+
+ echo '<div class="button_holder" id="if_popup_butons">';
+ echo '<button class="medium white-black" onClick="vrednost_condition_editing_close(\''.$vrednost.'\', \''.$if.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onClick="vrednost_if_remove(\''.$if.'\', \''.$vrednost.'\'); return false;">'.$lang['srv_if_rem'].'</button>';
+ echo '<button class="medium blue" onclick="vrednost_condition_editing_close_save(\''.$vrednost.'\', \''.$if.'\'); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
- echo '<div class="clr"></div>';
+ echo '</div>';
?><script>
- $('#div_condition_editing_inner').sortable({items: 'form', handle: 'img.move', stop: function () {
+ $('#div_condition_editing_inner').sortable({items: 'form', handle: 'span.move', stop: function () {
condition_sort(<?=$if?>);
} });
@@ -6814,13 +7986,9 @@ class Branching {
echo '<div class="condition_editing_preview">';
- //echo '<div class="condition_editing_naslov">'.$lang['sintaksa_if'].'</div>';
-
echo '<div class="condition_editing_naslov_holder">';
echo '<div id="div_condition_editing_conditions">';
- //zacetni oklepaj za if
-// echo '<span class="zacetni-oklepaj" id="zacetni_oklepaj_'.$if.'" style="display:none;"></span>';
- $this->conditions_display($if, 1, 1);
+ $this->conditions_display($if, 1, 1, $vrednost);
echo '</div>';
echo '</div>';
echo '</div><!-- condition_editing_preview -->';
@@ -6836,25 +8004,28 @@ class Branching {
$spr_id = $row1['spr_id'];
}
- if ( ! ( mysqli_num_rows($sql1)==1 && $spr_id==0 ) ) {
- echo '<div id="div_condition_editing_operators" style="padding-left:1%">'.$lang['srv_add_cond'].' '.Help::display('srv_if_operator').':
-
- <a href="#" onclick="condition_add(\''.$if.'\', \'0\', \'0\', \''.$vrednost.'\'); return false;"><strong>&nbsp;AND&nbsp;</strong></a>,
- <a href="#" onclick="condition_add(\''.$if.'\', \'0\', \'1\', \''.$vrednost.'\'); return false;"><strong>&nbsp;AND NOT&nbsp;</strong></a>,
- <a href="#" onclick="condition_add(\''.$if.'\', \'1\', \'0\', \''.$vrednost.'\'); return false;"><strong>&nbsp;OR&nbsp;</strong></a>,
- <a href="#" onclick="condition_add(\''.$if.'\', \'1\', \'1\', \''.$vrednost.'\'); return false;"><strong>&nbsp;OR NOT&nbsp;</strong></a></div>';
- }
+ echo '</div><!-- class="condition_editing_body"-->';
- echo '</div><!-- class="condition_editing_body"-->';
+
+ if ( ! ( mysqli_num_rows($sql1)==1 && $spr_id==0 ) ) {
+ echo '<div id="div_condition_editing_operators" class="div_condition_bottom">'.$lang['srv_add_cond'].' '.Help::display('srv_if_operator').':
- // blok
- } elseif ($row['tip'] == 1) {
+ <a href="#" class="noline" onclick="condition_add(\''.$if.'\', \'0\', \'0\', \''.$vrednost.'\'); return false;">AND</a>,
+ <a href="#" class="noline" onclick="condition_add(\''.$if.'\', \'0\', \'1\', \''.$vrednost.'\'); return false;">AND NOT</a>,
+ <a href="#" class="noline" onclick="condition_add(\''.$if.'\', \'1\', \'0\', \''.$vrednost.'\'); return false;">OR</a>,
+ <a href="#" class="noline" onclick="condition_add(\''.$if.'\', \'1\', \'1\', \''.$vrednost.'\'); return false;">OR NOT</a></div>';
+ }
+ }
+ // blok
+ elseif ($row['tip'] == 1) {
//ko imamo BLOCK prikažemo začetek oklepaja
- echo '<strong class="clr_bl">BLOCK</strong> <span class="colorblock">('.$row['number'].')</span>'.($row['enabled']==2?' FALSE ':'').($row['label']!=''?' <span class="if_comment">( '.$row['label'].' )</span>':'').'';
+ echo '<span class="clr_bl">BLOCK</span> <span class="colorblock">('.$row['number'].')</span>'.($row['enabled']==2?' FALSE ':'').($row['label']!=''?' <span class="if_comment">( '.$row['label'].' )</span>':'').'';
+
+ }
// zanka
- } elseif ($row['tip'] == 2) {
+ elseif ($row['tip'] == 2) {
//začetni oklepaj za zanko
$this->loop_display($if);
@@ -6906,16 +8077,19 @@ class Branching {
if ($vrednost == 0) { // ce imamo obicn if v branchingu ali v DisplayData
$vrstni_red = $this->vrstni_red($this->find_before_if($row['if_id']));
- } elseif ($vrednost == -1 or $vrednost == -2 or $vrednost == -3) { // filter v DisplayData.php (prikazemo vse spremenljivke)
+ }
+ elseif ($vrednost == -1 or $vrednost == -2 or $vrednost == -3) { // filter v DisplayData.php (prikazemo vse spremenljivke)
$vrstni_red = PHP_INT_MAX;
- } elseif ($vrednost == -4) { // validacija
+ }
+ elseif ($vrednost == -4) { // validacija
if (!$this->spremenljivka > 0) {
$sqlv = sisplet_query("SELECT spr_id FROM srv_validation WHERE if_id = '$row[if_id]'");
$rowv = mysqli_fetch_array($sqlv);
$this->spremenljivka = $rowv['spr_id'];
}
$vrstni_red = $this->vrstni_red($this->spremenljivka);
- } else { // ce imamo podif na vrednosti
+ }
+ else { // ce imamo podif na vrednosti
$sqlv = sisplet_query("SELECT spr_id FROM srv_vrednost WHERE if_id='$row[if_id]'");
$rowv = mysqli_fetch_array($sqlv);
$vrstni_red = $this->vrstni_red($rowv['spr_id']);
@@ -6925,81 +8099,93 @@ class Branching {
if (!$sql_count) die();
$row_count = mysqli_fetch_array($sql_count);
- if ($row['vrstni_red'] == 1 && $row_count['count'] > 1) {
- echo '<table class="tbl_condition_editing">';
- echo '<tr>';
- echo '<th style="text-align:center; width:50px">'.$lang['srv_oklepaji'].'</th>'; // gumbi oklepaji
- echo '<th style="width:70px">&nbsp;</th>'; // logicni operatorji
- echo '<th style="width:50px">&nbsp;</th>'; // oklepaji
- echo '<th >&nbsp;</th>';
- echo '<th style="text-align:center; width:50px;">'.$lang['srv_zaklepaji'].'</th>'; // gumbi zaklepaji
- echo '<th style="text-align:center; width:60px">'.$lang['edit2'].'</th>'; // move
- echo '</tr>';
- echo '</table>';
- } elseif ($row['vrstni_red'] == 1) {
- echo '<table class="tbl_condition_editing"><tr><th>&nbsp;</th></tr></table>';
+ // form
+ echo '<form name="condition_'.$condition.'" action="" method="post" onsubmit="condition_edit(\''.$condition.'\'); return false;" id="condition_'.$condition.'">';
+
+
+ // Operator pred pogojem
+ echo '<div class="condition_editing_row conjunction">';
+
+ $operator = $row['conjunction'].'_'.$row['negation'];
+
+ echo '<input type="hidden" name="conjunction_'.$condition.'" id="conjunction_'.$condition.'" value="'.$row['conjunction'].'_'.$row['negation'].'" />';
+
+ // Prikazujemo samo pri prvem in ce je ze izbran not
+ if ($row['vrstni_red'] == 1) {
+
+ if($row['negation'] == 1)
+ echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'0\', \'0\'); return false;">&nbsp;&nbsp;not&nbsp;&nbsp;</a></span>';
+ }
+ else {
+
+ echo '<select name="conjunction_dropdown_'.$condition.'" id="conjunction_dropdown_'.$condition.'" class="dropdown medium" onChange="conjunction_dropdown_edit(\''.$condition.'\'); return false;">';
+ echo ' <option value="0_0" '.($operator == '0_0' ? 'selected="selected"' : '').'>AND</option>';
+ echo ' <option value="1_0" '.($operator == '1_0' ? 'selected="selected"' : '').'>OR</option>';
+ echo ' <option value="0_1" '.($operator == '0_1' ? 'selected="selected"' : '').'>AND NOT</option>';
+ echo ' <option value="1_1" '.($operator == '1_1' ? 'selected="selected"' : '').'>OR NOT</option>';
+ echo '</select>';
}
+ echo '</div>';
+
+
+ // Urejanje 1 vrstice pogoja
+ echo '<div class="condition_editing_row">';
- // form
- echo '<form name="condition_'.$condition.'" action="" method="post" onsubmit="condition_edit(\''.$condition.'\'); return false;" id="condition_'.$condition.'">'."\n\r";
- echo '<table class="tbl_condition_editing" style="margin-bottom:10px; background-color:white" >';
- echo '<tr>';
+ // Move handle
+ echo '<div class="move_holder">';
+ if ($row_count['count'] != 1 )
+ echo '<span class="faicon move_updown move" title="'.$lang['srv_move'].'"></span>';
+ echo '</div>';
+
+
+ // Glavni del urejanja
+ echo '<div class="white_holder">';
+
// left_bracket
+ echo '<div class="column bracket left">';
+
if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add small"></span></a>';
- if ($row['left_bracket'] > 0)
+
+ echo '<div class="bracket_icons">';
+
+ echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ if ($row['left_bracket'] > 0)
echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
else
echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- } else {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- }
- echo '</td>';
+ echo '</div>';
- // conjunction
- echo '<td class="tbl_ce_tb white" style="width:70px; text-align:center">';
- if ($row['vrstni_red'] == 1) {
- echo '<input type="hidden" name="conjunction_'.$condition.'" id="conjunction_'.$condition.'" value="'.$row['conjunction'].'_'.$row['negation'].'" />';
+ echo '<div class="bracket_text">'.$lang['srv_oklepaji'].'</div>';
+ }
- // prikazujemo samo ce je ze izbran not
- if ($row['negation']==1)
- echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'0\', \'0\'); return false;">&nbsp;&nbsp;not&nbsp;&nbsp;</a></span>';
+ echo '</div>';
- } else {
- echo '<input type="hidden" name="conjunction_'.$condition.'" id="conjunction_'.$condition.'" value="'.$row['conjunction'].'_'.$row['negation'].'" />';
+ // display bracket
+ echo '<div class="column display_bracket left">';
- if ($row['conjunction']==0 && $row['negation']==0)
- echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'1\', \'0\'); return false;" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;&nbsp;AND&nbsp;&nbsp;</a></span>';
- if ($row['conjunction']==1 && $row['negation']==0)
- echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'0\', \'1\'); return false;" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;&nbsp;OR&nbsp;&nbsp;</a></span>';
- if ($row['conjunction']==0 && $row['negation']==1)
- echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'1\', \'1\'); return false;" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;AND NOT&nbsp;</a></span>';
- if ($row['conjunction']==1 && $row['negation']==1)
- echo '<span style="font-weight:bold"><a href="#" onclick="conjunction_edit(\''.$condition.'\', \'0\', \'0\'); return false;" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;OR NOT&nbsp;</a></span>';
+ for ($i=1; $i<=$row['left_bracket']; $i++) echo ' ( ';
- }
- echo '</td>';
+ echo '</div>';
- // display bracket
- echo '<td class="tbl_ce_tb white" style="width:50px; text-align:center" nowrap>';
- for ($i=1; $i<=$row['left_bracket']; $i++) echo ' ( ';
- echo '</td>';
// spremenljivka
- echo '<td class="tbl_ce_tb white" style="width:150px">'.($row['spr_id']=='0'?'<span class="red">'.$lang['srv_select_spr'].'!</span>':'').'<br />';
- echo '<select class="spremenljivka_select spaceRight" name="spremenljivka_'.$condition.'" id="spremenljivka_'.$condition.'" size="1" style="width:150px" onchange="javascript:fill_value(\''.$condition.'\', \''.$vrednost.'\');">'."\n\r";
+ echo '<div class="column variable">';
+
+ if($row['spr_id']=='0')
+ echo '<span class="red">'.$lang['srv_select_spr'].'!</span><br />';
+
+ echo '<select class="spremenljivka_select dropdown medium" name="spremenljivka_'.$condition.'" id="spremenljivka_'.$condition.'" size="1" style="width:150px" onchange="javascript:fill_value(\''.$condition.'\', \''.$vrednost.'\');">';
echo '<option value="0"></option>';
echo '<option value="-1"'.($row['spr_id']==-1?' selected="selected"':'').' style="color:blue">&nbsp;&nbsp;&nbsp; '.$lang['srv_random_groups'].'</option>';
echo '<option value="-2"'.($row['spr_id']==-2?' selected="selected"':'').' style="color:blue">&nbsp;&nbsp;&nbsp; '.$lang['srv_calc'].'</option>';
// Kvota
- //if($admin_type == 0)
echo '<option value="-3"'.($row['spr_id']==-3?' selected="selected"':'').' style="color:blue">&nbsp;&nbsp;&nbsp; '.$lang['srv_quota'].'</option>';
echo '<option value="-4"'.($row['spr_id']==-4?' selected="selected"':'').' style="color:blue">&nbsp;&nbsp;&nbsp; '.$lang['srv_device'].'</option>';
@@ -7197,14 +8383,15 @@ class Branching {
}
}
- echo '</select><br />&nbsp;'."\n\r";
- echo '</td>';
+ echo '</select>';
+
+ echo '</div>';
// span, ki se updata ob spremembi spremenljivke
- echo '<td class="tbl_ce_tb white">';
+ echo '<div class="column operator">';
- echo '<span id="fill_vrednost_'.$condition.'">'."\n\r";
+ echo '<span id="fill_vrednost_'.$condition.'" class="fill_vrednost">';
if ($edit_fill_value == $condition)
$edit_value = true;
@@ -7217,50 +8404,56 @@ class Branching {
$this->fill_value($condition, $row['spr_id'], $row['vre_id'], $row['grd_id'], $edit_value);
- echo '</span>'."\n\r";
- echo '</td>';
+ echo '</span>';
+
+ echo '</div>';
+
// display right bracket
- echo '<td class="tbl_ce_tb white" style="width:50px; text-align:center" nowrap>';
+ echo '<div class="column display_bracket right">';
+
if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) {
for ($i=1; $i<=$row['right_bracket']; $i++) echo ' ) ';
}
- echo '</td>';
+
+ echo '</div>';
+
// right_bracket buttons
+ echo '<div class="column bracket right">';
+
if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) {
- echo '<td class="tbl_ce_tb white" style="width:50px; text-align:center" nowrap>';
+ echo '<div class="bracket_icons">';
+
if ($row['right_bracket'] > 0)
echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'right\', \'minus\'); return false;" title="'.$lang['srv_zaklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
else
echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add small"></span></a>';
- }
- else {
- echo '<td class="tbl_ce_tb white" style="width:50px; text-align:center" nowrap>';
+ echo '<a href="#" onclick="javascript:bracket_edit_new(\''.$condition.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ echo '</div>';
+
+ echo '<div class="bracket_text">'.$lang['srv_zaklepaji'].'</div>';
}
- echo '</td>';
+ echo '</div>';
- // move
- echo '<td class="tbl_ce_tb white" style="text-align:right; width:30px">';
- if ($row_count['count'] != 1 )
- echo '<img src="img_0/move_updown.png" class="move" title="'.$lang['srv_move'].'" />';
- echo '</td>';
- // remove
- echo '<td class="tbl_ce_lor white" style="text-align:left; width:30px">';
+ echo '</div>';
+
+
+ // Delete icon
+ echo '<div class="delete_holder">';
if ($row_count['count'] != 1 )
- echo '<a href="#" onclick="condition_remove(\''.$row['if_id'].'\', \''.$condition.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete icon-grey_dark_link"></span></a>'."\n";
- echo '</td>';
+ echo '<a href="#" onclick="condition_remove(\''.$row['if_id'].'\', \''.$condition.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete"></span></a>';
+ echo '</div>';
- echo '</tr>';
- echo '</table>';
+ echo '</div>';
- echo '</form>'."\n\r";
+ echo '</form>';
}
/**
@@ -7277,17 +8470,17 @@ class Branching {
// navadne spremenljivke (vkljucno z multigrid)
if ($spremenljivka > 0) {
+ $preview = '';
+
// zato, da z JS vemo kaj poslat po AJAXu, ID vrednosti ali text
echo '<input type="hidden" name="tip_'.$condition.'" id="tip_'.$condition.'" value="'.$row1['tip'].'" >';
// operator
- echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" onchange="javascript:condition_edit(\''.$condition.'\');" style="width:45px">'."\n\r";
+ echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" class="dropdown medium operator" onchange="javascript:condition_edit(\''.$condition.'\');">'."\n\r";
echo ' <option value="0"'.($row['operator']==0?' selected="selected"':'').'>=</option>'."\n\r";
echo ' <option value="1"'.($row['operator']==1?' selected="selected"':'').'>&ne;</option>'."\n\r";
- // echo ' <option value="1"'.($row['operator']==1?' selected':'').'>≠</option>'."\n\r";
if ($row1['tip'] == 7 || $row1['tip'] == 8 || $row1['tip'] == 22 || $row1['tip'] == 25 || $row1['tip'] == 20 || $row1['tip'] == 18) {
- // number in compute in tabela number ma dodatne operatorje
echo ' <option value="2"'.($row['operator']==2?' selected="selected"':'').'><</option>'."\n\r";
echo ' <option value="3"'.($row['operator']==3?' selected="selected"':'').'><=</option>'."\n\r";
echo ' <option value="4"'.($row['operator']==4?' selected="selected"':'').'>></option>'."\n\r";
@@ -7307,7 +8500,7 @@ class Branching {
// number in textbox, vsota imajo textovni input (ter compute in kvota)
if ($row1['tip'] == 4 || $row1['tip'] == 21 || $row1['tip'] == 7 || $row1['tip'] == 22 || $row1['tip'] == 25 || $row1['tip'] == 18)
{
- echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" value="'.$row['text'].'" style="width:140px" >';
+ echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" class="medium" value="'.$row['text'].'">';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -7351,13 +8544,12 @@ class Branching {
// obicajna spremenljivka
if ($vrednost <= 0) {
- echo '<span id="edit_fill_value_'.$condition.'"'.($edit_value?'':' style="display: none"').'>';
+ echo '<span id="edit_fill_value_'.$condition.'" class="edit_fill_value" '.($edit_value?'':' style="display: none"').'>';
$sql1 = sisplet_query("SELECT COUNT(*) AS count FROM srv_condition_vre WHERE cond_id='$condition'");
$row1 = mysqli_fetch_array($sql1);
- if ($row1['count'] == 0) echo '<span class="red">';
- echo $lang['srv_note_vrednost'].':<br />';
- if ($row1['count'] == 0) echo '</span>';
+
+ echo '<span '.($row1['count'] == 0 ? 'class="red"' : '').'>'.$lang['srv_note_vrednost'].':</span>';
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$spremenljivka' ORDER BY vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
@@ -7368,9 +8560,9 @@ class Branching {
else
$selected = '';
- echo '<label for="vrednost_'.$condition.'_'.$row['id'].'" style="height:1em; overflow:hidden;" nowrap><input type="checkbox" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$row['id'].'" value="'.$row['id'].'" class="enka-admin-custom" '.$selected.' onclick="condition_edit(\''.$condition.'\');" /><span class="enka-checkbox-radio"></span> ('.$row['variable'].') '.strip_tags($row['naslov']).'</label><br />'."\n\r";
+ echo '<input type="checkbox" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$row['id'].'" value="'.$row['id'].'" class="enka-admin-custom" '.$selected.' onclick="condition_edit(\''.$condition.'\');" /><label for="vrednost_'.$condition.'_'.$row['id'].'"><span class="enka-checkbox-radio"></span> ('.$row['variable'].') '.strip_tags($row['naslov']).'</label>';
if ($selected != '')
- $preview .= /*($preview!=''?', ':'').*/'('.$row['variable'].') '.strip_tags($row['naslov']).'<br>';
+ $preview .= '<span>('.$row['variable'].') '.strip_tags($row['naslov']).'</span>';
}
@@ -7379,21 +8571,22 @@ class Branching {
$rowC = mysqli_fetch_array($sqlC);
$current_grupa = $this->getGrupa4If($rowC['if_id']);
$selected_grupa = $this->getGrupa4Spremenljivka($spremenljivka);
- if($selected_grupa['vrstni_red'] != $current_grupa['vrstni_red']){
+ if(isset($selected_grupa['vrstni_red']) && isset($current_grupa['vrstni_red']) && $selected_grupa['vrstni_red'] != $current_grupa['vrstni_red']){
$sql1 = sisplet_query("SELECT * FROM srv_condition_vre WHERE cond_id='$condition' AND vre_id='-1'");
if (mysqli_num_rows($sql1) > 0)
$selected = ' checked="checked"';
else
$selected = '';
- echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_-1" value="-1"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><span class="enka-checkbox-radio"></span><label for="vrednost_'.$condition.'_-1" style="height:1em; overflow:hidden;" nowrap> (-1) '.$lang['srv_mv_Ni odgovoril'].'</label><br />'."\n\r";
+ echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_-1" value="-1"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><label for="vrednost_'.$condition.'_-1"><span class="enka-checkbox-radio"></span>(-1) '.$lang['srv_mv_Ni odgovoril'].'</label>';
if ($selected != '')
- $preview .= '(-1) '.$lang['srv_mv_Ni odgovoril'].'<br>';
+ $preview .= '<span>(-1) '.$lang['srv_mv_Ni odgovoril'].'</span>';
}
echo '</span>';
- echo '<a href="#" onclick="edit_fill_value(\''.$condition.'\'); return false;" id="preview_fill_value_'.$condition.'"'.($edit_value?' style="display: none"':'').' title="'.$lang['srv_note_vrednost'].'!">'.($preview!=''?$preview:$lang['srv_error_vrednost']).'</a>';
+ echo '<div id="preview_fill_value_'.$condition.'" class="preview_fill_value" '.($edit_value ? 'style="display:none"' : '').'>'.($preview != '' ? $preview : $lang['srv_error_vrednost']).'</div>';
+ echo '<a href="#" id="preview_fill_link_'.$condition.'" '.($edit_value ? 'style="display:none"' : '').' onclick="edit_fill_value(\''.$condition.'\'); return false;" title="'.$lang['srv_note_vrednost'].'!"><span class="faicon edit"></span></a>';
// multigrid (tuki mamo poleg spremenljivke vrednost, ki oznacuje element)
} elseif ($vrednost > 0) {
@@ -7401,13 +8594,12 @@ class Branching {
// tabela radio, tabela checkbox
if ($grid == 0) {
- echo '<span id="edit_fill_value_'.$condition.'"'.($edit_value?'':' style="display: none"').'>';
+ echo '<span id="edit_fill_value_'.$condition.'" class="edit_fill_value" '.($edit_value?'':' style="display: none"').'>';
$sql1c = sisplet_query("SELECT COUNT(*) AS count FROM srv_condition_grid WHERE cond_id='$condition'");
$row1c = mysqli_fetch_array($sql1c);
- if ($row1c['count'] == 0) echo '<span class="red">';
- echo $lang['srv_note_vrednost'].':<br />';
- if ($row1c['count'] == 0) echo '</span>';
+
+ echo '<span '.($row1c['count'] == 0 ? 'class="red"' : '').'>'.$lang['srv_note_vrednost'].':</span>';
if ($row1['tip'] == 6 || $row1['tip'] == 16) {
@@ -7427,9 +8619,9 @@ class Branching {
$sql2 = sisplet_query("SELECT naslov, variable FROM srv_grid WHERE id='$i' AND spr_id='$row[id]'");
$row2 = mysqli_fetch_array($sql2);
- echo '<label for="vrednost_'.$condition.'_'.$i.'" style="height:1em; overflow:hidden;" nowrap><input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$i.'" value="'.$i.'"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><span class="enka-checkbox-radio"></span> ('.$row2['variable'].') '.strip_tags($row2['naslov']).'</label><br />'."\n\r";
+ echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$i.'" value="'.$i.'"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><label for="vrednost_'.$condition.'_'.$i.'"><span class="enka-checkbox-radio"></span> ('.$row2['variable'].') '.strip_tags($row2['naslov']).'</label>';
if ($selected != '')
- $preview .= /*($preview!=''?', ':'').*/'('.$row2['variable'].') '.strip_tags($row2['naslov']).'<br>';
+ $preview .= '<span>('.$row2['variable'].') '.strip_tags($row2['naslov']).'</span>';
}
// Ce je bilo vprasanje na prejsnji strani imamo tudi pogoj -1 (neodgovor)
@@ -7437,15 +8629,16 @@ class Branching {
$rowC = mysqli_fetch_array($sqlC);
$current_grupa = $this->getGrupa4If($rowC['if_id']);
$selected_grupa = $this->getGrupa4Spremenljivka($spremenljivka);
+
if($selected_grupa['vrstni_red'] != $current_grupa['vrstni_red']){
$sql1 = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id='$condition' AND grd_id='-1'");
if (mysqli_num_rows($sql1) > 0)
$selected = ' checked="checked"';
else
$selected = '';
- echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_-1" value="-1"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><span class="enka-checkbox-radio"></span><label for="vrednost_'.$condition.'_-1" style="height:1em; overflow:hidden;" nowrap> (-1) '.$lang['srv_mv_Ni odgovoril'].'</label><br />'."\n\r";
+ echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_-1" value="-1"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><label for="vrednost_'.$condition.'_-1"><span class="enka-checkbox-radio"></span>(-1) '.$lang['srv_mv_Ni odgovoril'].'</label>';
if ($selected != '')
- $preview .= '(-1) '.$lang['srv_mv_Ni odgovoril'].'<br>';
+ $preview .= '<span>(-1) '.$lang['srv_mv_Ni odgovoril'].'</span>';
}
// ranking
@@ -7464,22 +8657,23 @@ class Branching {
else
$selected = '';
- echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$i.'" value="'.$i.'"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><span class="enka-checkbox-radio"></span><label for="vrednost_'.$condition.'_'.$i.'" style="height:1em; overflow:hidden;" nowrap> ('.$i.') '.$i.'. '.$lang['srv_position'].'</label><br />'."\n\r";
+ echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$condition.'" id="vrednost_'.$condition.'_'.$i.'" value="'.$i.'"'.$selected.' onclick="condition_edit(\''.$condition.'\');" /><label for="vrednost_'.$condition.'_'.$i.'"><span class="enka-checkbox-radio"></span>('.$i.') '.$i.'. '.$lang['srv_position'].'</label>';
if ($selected != '')
- $preview .= /*($preview!=''?', ':'').*/'('.$i.') '.$i.'. '.$lang['srv_position'].'<br>';
+ $preview .= '<span>('.$i.') '.$i.'. '.$lang['srv_position'].'</span>';
}
}
echo '</span>';
- echo '<a href="#" onclick="edit_fill_value(\''.$condition.'\'); return false;" id="preview_fill_value_'.$condition.'"'.($edit_value?' style="display: none"':'').' title="'.$lang['srv_note_vrednost'].'!">'.($preview!=''?$preview:$lang['srv_error_vrednost']).'</a>';
-
+ echo '<div id="preview_fill_value_'.$condition.'" class="preview_fill_value" '.($edit_value ? 'style="display:none"' : '').'>'.($preview != '' ? $preview : $lang['srv_error_vrednost']).'</div>';
+ echo '<a href="#" id="preview_fill_link_'.$condition.'" '.($edit_value ? 'style="display:none"' : '').' onclick="edit_fill_value(\''.$condition.'\'); return false;" title="'.$lang['srv_note_vrednost'].'!"><span class="faicon edit"></span></a>';
+
// tabela text, tabela stevilo
} else {
- echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" value="'.$row['text'].'" style="width:140px" >';
+ echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" class="medium" value="'.$row['text'].'">';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -7499,14 +8693,14 @@ class Branching {
// zato, da z JS vemo kaj poslat po AJAXu, ID vrednosti ali text
echo '<input type="hidden" name="tip_'.$condition.'" id="tip_'.$condition.'" value="-1" />'."\n\r";
- echo $lang['srv_groups'].': <select name="modul_'.$condition.'" id="modul_'.$condition.'" style="width:40px" onchange="javascript:fill_ostanek(\''.$condition.'\');">'."\n\r";
+ echo '<label>'.$lang['srv_groups'].':</label><select name="modul_'.$condition.'" id="modul_'.$condition.'" class="dropdown medium" onchange="javascript:fill_ostanek(\''.$condition.'\');">'."\n\r";
for ($i=2; $i<=64; $i++)
echo '<option value="'.$i.'"'.($row['modul']==$i?' selected="selected"':'').'>'.$i.'</option>';
echo '</select>'."\n\r";
- echo '<span id="'.$condition.'_ostanek">';
+ echo '<span id="'.$condition.'_ostanek" class="ostanek">';
$this->fill_ostanek($condition);
echo '</span>'."\n\r";
@@ -7517,22 +8711,22 @@ class Branching {
echo '<input type="hidden" name="tip_'.$condition.'" id="tip_'.$condition.'" value="-2" />'."\n\r";
$text = $this->calculations_display($condition);
- if ($text == '<span class="calculations_display"></span>') $text = $lang['srv_editcalculation'];
+ if ($text == '<span class="calculations_display"></span>')
+ $text = '';
- echo ' <a href="#" onclick="calculation_editing(\''.$condition.'\', \'0\', \''.$vrednost.'\'); $(\'#calculation\').css({\'position\': \'absolute\'}); return false;">'.$text.'</a> ';
+ echo $text.'<a href="#" onclick="calculation_editing(\''.$condition.'\', \'0\', \''.$vrednost.'\'); $(\'#calculation\').css({\'position\': \'absolute\'}); return false;"><span class="faicon edit"></span></a> ';
// operator
- echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" onchange="javascript:condition_edit(\''.$condition.'\');" style="width:45px">'."\n\r";
+ echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" onchange="javascript:condition_edit(\''.$condition.'\');" class="dropdown medium">'."\n\r";
echo ' <option value="0"'.($row['operator']==0?' selected':'').'>=</option>'."\n\r";
echo ' <option value="1"'.($row['operator']==1?' selected':'').'>&ne;</option>'."\n\r";
-// echo ' <option value="1"'.($row['operator']==1?' selected':'').'>≠</option>'."\n\r";
echo ' <option value="2"'.($row['operator']==2?' selected':'').'><</option>'."\n\r";
echo ' <option value="3"'.($row['operator']==3?' selected':'').'><=</option>'."\n\r";
echo ' <option value="4"'.($row['operator']==4?' selected':'').'>></option>'."\n\r";
echo ' <option value="5"'.($row['operator']==5?' selected':'').'>>=</option>'."\n\r";
echo '</select> '."\n\r";
- echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" value="'.$row['text'].'" style="width:40px;" />';
+ echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" class="medium" value="'.$row['text'].'" />';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -7550,22 +8744,22 @@ class Branching {
$SQ = new SurveyQuotas($this->anketa);
$text = $SQ->quota_display($condition);
- if ($text == '<span class="quota_display"></span>') $text = $lang['srv_edit_quota'];
+ if ($text == '<span class="quota_display"></span>')
+ $text = '';
- echo ' <a href="#" onclick="quota_editing(\''.$condition.'\', \'0\', \''.$vrednost.'\'); $(\'#quota\').css({\'position\': \'absolute\'}); return false;">'.$text.'</a> ';
+ echo $text.'<a href="#" onclick="quota_editing(\''.$condition.'\', \'0\', \''.$vrednost.'\'); $(\'#quota\').css({\'position\': \'absolute\'}); return false;"><span class="faicon edit"></span></a> ';
// operator
- echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" onchange="javascript:condition_edit(\''.$condition.'\');" style="width:45px">'."\n\r";
+ echo '<select name="operator_'.$condition.'" id="operator_'.$condition.'" onchange="javascript:condition_edit(\''.$condition.'\');" class="dropdown medium">'."\n\r";
echo ' <option value="0"'.($row['operator']==0?' selected':'').'>=</option>'."\n\r";
echo ' <option value="1"'.($row['operator']==1?' selected':'').'>&ne;</option>'."\n\r";
-// echo ' <option value="1"'.($row['operator']==1?' selected':'').'>≠</option>'."\n\r";
echo ' <option value="2"'.($row['operator']==2?' selected':'').'><</option>'."\n\r";
echo ' <option value="3"'.($row['operator']==3?' selected':'').'><=</option>'."\n\r";
echo ' <option value="4"'.($row['operator']==4?' selected':'').'>></option>'."\n\r";
echo ' <option value="5"'.($row['operator']==5?' selected':'').'>>=</option>'."\n\r";
echo '</select> '."\n\r";
- echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" value="'.$row['text'].'" style="width:40px;" />';
+ echo '<input type="text" name="text_'.$condition.'" id="text_'.$condition.'" class="medium" value="'.$row['text'].'" />';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -7581,7 +8775,7 @@ class Branching {
// zato, da z JS vemo kaj poslat po AJAXu, ID vrednosti ali text
echo '<input type="hidden" name="tip_'.$condition.'" id="tip_'.$condition.'" value="-4" />'."\n\r";
- echo $lang['srv_device_type'].': <select name="text_'.$condition.'" id="text_'.$condition.'" style="width:100px" onchange="javascript:condition_edit(\''.$condition.'\');">'."\n\r";
+ echo '<label>'.$lang['srv_device_type'].':</label><select name="text_'.$condition.'" id="text_'.$condition.'" class="dropdown medium" onchange="javascript:condition_edit(\''.$condition.'\');">'."\n\r";
echo '<option value="-1"'.($row['text']=='' || $row['text']=='-1'?' selected="selected"':'').'>'.$lang['srv_device_type_select'].'</option>';
echo '<option value="0"'.($row['text']=='0'?' selected="selected"':'').'>'.$lang['srv_para_graph_device0'].'</option>';
echo '<option value="1"'.($row['text']=='1'?' selected="selected"':'').'>'.$lang['srv_para_graph_device1'].'</option>';
@@ -7600,12 +8794,12 @@ class Branching {
$sql = sisplet_query("SELECT * FROM srv_condition WHERE id='$condition'");
$row = mysqli_fetch_array($sql);
- echo $lang['srv_group'].': <select name="ostanek_'.$condition.'" id="ostanek_'.$condition.'" style="width:40px" onchange="javascript:condition_edit(\''.$condition.'\');">'."\n\r";
+ echo '<label>'.$lang['srv_group'].':</label><select name="ostanek_'.$condition.'" id="ostanek_'.$condition.'" class="dropdown medium" onchange="javascript:condition_edit(\''.$condition.'\');">';
for ($i=0; $i<$row['modul']; $i++)
echo '<option value="'.$i.'"'.($row['ostanek']==$i?' selected="selected"':'').'>'.($i+1).'</option>';
- echo '</select>'."\n\r";
+ echo '</select>';
}
@@ -7638,11 +8832,12 @@ class Branching {
$prev_grupa = 0;
- echo '<table style="width:100%"><tr>';
+ echo '<div class="condition_editing_row loop_row">';
+ echo '<div class="white_holder">';
- echo '<td style="width:40%; text-align:center">';
+ echo '<div class="column">';
- echo $lang['srv_loop_for'].' <select name="spremenljivka_'.$if.'" id="spremenljivka_'.$if.'" size="1" style="width:150px" onchange="javascript:fill_value_loop(\''.$if.'\');">';
+ echo $lang['srv_loop_for'].' <select name="spremenljivka_'.$if.'" id="spremenljivka_'.$if.'" class="dropdown medium" size="1" style="width:150px; margin: 0 8px;" onchange="javascript:fill_value_loop(\''.$if.'\');">';
echo '<option value="0"></option>';
$sql1 = sisplet_query("SELECT s.id, s.naslov, s.variable, s.gru_id, g.naslov AS grupa_naslov
@@ -7671,7 +8866,10 @@ class Branching {
if ($spremenljivka > 0 && ($tip==2 || $tip==3))
echo $lang['srv_loop_for_when'].(!$advanced?' '.$lang['srv_loop_when_checked']:'');
- echo '</td><td>';
+ echo '</div>';
+
+
+ echo '<div class="column options">';
if ($spremenljivka > 0 && ($tip==2 ||$tip==3)) { // spremenljivka je izbrana in ne gre za sn-imena
@@ -7701,8 +8899,8 @@ class Branching {
if (mysqli_num_rows($sql3) > 0) $selected = ' checked'; else $selected = '';
echo '<input type="checkbox" class="enka-admin-custom" name="vrednost_'.$if.'" id="vrednost_'.$if.'_'.$row2['id'].'" value="'.$row2['id'].'" '.$selected.' onclick="loop_edit(\''.$if.'\');" />';
- echo '<span class="enka-checkbox-radio"></span>';
- echo'<label for="vrednost_'.$if.'_'.$row2['id'].'"> ('.$row2['variable'].') '.strip_tags($row2['naslov']).'</label><br />';
+ echo '<label for="vrednost_'.$if.'_'.$row2['id'].'"><span class="enka-checkbox-radio"></span>';
+ echo ' ('.$row2['variable'].') '.strip_tags($row2['naslov']).'</label>';
}
}
@@ -7714,18 +8912,24 @@ class Branching {
} elseif ($tip == 9) { //SN-imena - uporabimo vedno vseh 20 vrednosti
}
- echo '</td>';
+ echo '</div>';
+
if (!$advanced && $spremenljivka>0 && ($tip==2 || $tip==3)) {
- echo '<td><a href="#" onclick="$(\'#branching_if'.$if.'\').load(
+ echo '<div class="column">';
+
+ echo '<a href="#" onclick="$(\'#branching_if'.$if.'\').load(
\'ajax.php?t=branching&a=condition_editing\', {
\'if\' : '.$if.',
anketa : '.$this->anketa.',
advanced: 1
- }); return false;">'.$lang['srv_advanced_options'].'</a></td>';
+ }); return false;">'.$lang['srv_advanced_options'].'</a>';
+
+ echo '</div>';
}
- echo '</tr></table>';
+ echo '</div>';
+ echo '</div>';
if ($spremenljivka > 0) {
$sql2 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$spremenljivka'");
@@ -7736,12 +8940,12 @@ class Branching {
if ($max == 0) $max = 20;
}
- echo '<p style="margin-left:10px; margin-top:40px">'.$lang['srv_loop_max'].': <select name="max" onchange="loop_edit_max('.$if.', this.value);">';
+ echo '<div class="div_condition_bottom loop_bottom">'.$lang['srv_loop_max'].': <select name="max" class="dropdown medium" onchange="loop_edit_max('.$if.', this.value);">';
if ($tip != 7)
echo '<option value="0"'.(0==$max?' selected':'').'>'.$lang['srv_all'].'</option>';
for ($i=1; $i<=$count; $i++)
echo '<option value="'.$i.'"'.($i==$max?' selected':'').'>'.$i.'</option>';
- echo '</select></p>';
+ echo '</select></div>';
}
}
@@ -7812,9 +9016,7 @@ class Branching {
$variable = $row1['variable'].'['.$row1g['variable'].']';
}
- if ($long_alert) $echo .= '<strong>';
$echo .= $variable;
- if ($long_alert) $echo .= '</strong>';
// konstante
} elseif ($row['spr_id'] == -1) {
@@ -7843,11 +9045,11 @@ class Branching {
if ( $calculation_check != 0) {
- if ($calculation_check == 1)
- $echo .= '<br /><span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_spremenljivka'].'</span>';
- elseif ($calculation_check == 2)
- $echo .= '<br /><span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_spremenljivka'].'</span>';
- elseif ($calculation_check == 3)
+ //if ($calculation_check == 1)
+ //$echo .= '<br /><span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_spremenljivka'].'</span>';
+ //elseif ($calculation_check == 2)
+ //$echo .= '<br /><span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_spremenljivka'].'</span>';
+ if ($calculation_check == 3)
$echo .= '<br /><span class="faicon warning icon-orange"></span> <span class="red">'.$lang['srv_error_oklepaji'].'</span>';
}
@@ -7862,74 +9064,68 @@ class Branching {
function calculation_editing ($condition, $vrednost=0) {
global $lang;
- echo '<div class="popup_close"><a href="#" onClick="calculation_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
- echo '<div id="calculation_editing_inner">';
+ echo '<div id="calculation_editing_inner" class="podatki">';
$this->calculation_editing_inner($condition, $vrednost);
- echo '</div>';
+ echo '</div>';
+
+ echo '<div id="bottom_options">';
- echo '<div id="bottom_space">';
+ echo '<div class="setting_horizontal_wrapper">';
$row = Cache::srv_spremenljivka(-$condition);
- if ($condition < 0) {
- echo '<p style="float:left; padding:0; margin:0; margin-left:20px">'.$lang['srv_variable'].': <input type="text" id="variable_'.(-$condition).'" value="'.$row['variable'].'" onkeyup="calculation_edit_variable(\''.-$condition.'\');" style="width:60px" /></p>';
+ if ($condition < 0) {
+ echo '<div class="setting_holder">';
+ echo '<label for="variable_'.(-$condition).'">'.$lang['srv_editcalculation_new'].':</label>';
+ echo '<input type="text" class="large" id="variable_'.(-$condition).'" value="'.$row['variable'].'" onkeyup="calculation_edit_variable(\''.-$condition.'\');" />';
+ echo '</div>';
}
// Nastavitev števila decimalk
- echo '<p style="clear:both;float:left; padding:0; margin:10px 0 0 20px;">'.$lang['srv_results_num_digits'].':';
- echo ' <select id="decimalna_'.(-$condition).'" onChange="calculation_edit_decimalna(\''.-$condition.'\');">';
+ echo '<div class="setting_holder">';
+ echo '<label for="decimalna_'.(-$condition).'">'.$lang['srv_results_num_digits'].':</label>';
+ echo ' <select class="dropdown large w130" id="decimalna_'.(-$condition).'" onChange="calculation_edit_decimalna(\''.-$condition.'\');">';
for($i=0; $i<=10; $i++){
echo ' <option value="'.$i.'" '.($row['decimalna'] == $i ? ' selected="selected"' : '').'>'.$i.'</option>';
}
echo '</select>';
- echo '</p>';
+ echo '</div>';
+
+ echo '</div>';
+
- // Nastavitev kako se obravnava missing v kalkulaciji (kot 0 ali za celo kalkulacijo kot -88)
+ // Nastavitev, kako se obravnava missing v kalkulaciji (kot 0 ali za celo kalkulacijo kot -88)
$newParams = new enkaParameters($row['params']);
$calcMissing = $newParams->get('calcMissing', '0');
- echo '<p style="float:left; padding:0; margin:10px 0 0 20px;">';
- echo '<input type="checkbox" class="enka-admin-custom" value="1" '.($calcMissing == 1 ? ' checked="checked"' : '').' id="calcMissing_'.(-$condition).'" onChange="calculation_edit_missing(\''.-$condition.'\');"> ';
- echo '<span class="enka-checkbox-radio"></span>';
- echo '<label for="calcMissing_'.(-$condition).'">'.$lang['srv_editcalculation_missing'].'</label> '.Help::display('srv_calculation_missing');
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" value="1" '.($calcMissing == 1 ? ' checked="checked"' : '').' id="calcMissing_'.(-$condition).'" onChange="calculation_edit_missing(\''.-$condition.'\');"> ';
+ echo '<label for="calcMissing_'.(-$condition).'">'.$lang['srv_editcalculation_missing'];
+ //echo ' '.Help::display('srv_calculation_missing').'</label>';
+ echo '</div>';
- echo '<div id="condition_editing_close">';
+ echo '</div>';
- // kalkulacija kot spremenljivka (lahko jo zbrisemo)
- if ($condition < 0) {
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;"><span>'.$lang['srv_anketadelete_txt'].'</span></a>';
- echo '</span>';
- }
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="calculation_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
+ echo '<div id="condition_editing_close" class="podatki">';
- echo '<span class="buttonwrapper floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="calculation_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
+ echo ' <div class="button_holder">';
- echo '</div>';
+ // kalkulacija kot spremenljivka (lahko jo zbrisemo)
+ if ($condition < 0)
+ echo ' <button class="medium white-blue" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;">'.$lang['srv_anketadelete_txt'].'</button>';
+
+ echo ' <button class="medium white-blue" onclick="window.location.reload(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onclick="window.location.reload(); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo ' </div>';
+
echo '</div>';
- echo '<div id="arrows_more_calculation" onclick=" $(\'#calculation_editing_inner\').animate({ scrollTop: $(\'#calculation_editing_inner\').attr(\'scrollHeight\') }, 2000); "><img src="img_0/bullet_arrow_down.png" /> '.$lang['srv_more'].'</div>';
?><script>
- $('#calculation_editing_inner').sortable({items: 'form', handle: 'img.move', stop: function () {
+ $('#calculation_editing_inner').sortable({items: 'form', handle: '.move', stop: function () {
calculation_sort(<?=$condition?>);
} });
-
- $('#calculation_editing_inner').scroll(function() {
- if ( isScrolledIntoView('#calculation_editing_operators', '#calculation_editing_inner') )
- $('#arrows_more_calculation').fadeOut(1000);
- else
- $('#arrows_more_calculation').fadeIn(1000);
- });
- $('#calculation_editing_inner').resize(function() {
- $('#calculation_editing_inner').scroll();
- });
- $('#calculation_editing_inner').scroll();
</script><?
}
@@ -7938,33 +9134,32 @@ class Branching {
echo '<div class="calculation_editing_preview">';
- echo '<h2>'.$lang['srv_calc'].'</h2>';
+ echo '<h2><span class="blue faicon edit"></span>'.$lang['srv_calc'].'</h2>';
echo '<div id="calculation_editing_calculations">';
echo $this->calculations_display($condition, 1);
echo '</div>';
echo '</div>';
- echo '<div class="condition_editing_body">';
- echo '<h2>'.$lang['srv_editcalculation'].'</h2>';
- echo '</div>';
+ echo '<div class="calculation_editing_body">';
$sql = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id = '$condition' ORDER BY vrstni_red");
if (mysqli_num_rows($sql) == 0) {
sisplet_query("INSERT INTO srv_calculation (id, cnd_id, vrstni_red) VALUES ('', '$condition', '1')");
$sql = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id = '$condition' ORDER BY vrstni_red");
}
- while ($row = mysqli_fetch_array($sql)) {
+ while ($row = mysqli_fetch_array($sql)) {
$this->calculation_edit($row['id'], $vrednost);
}
- echo '<p id="calculation_editing_operators" style="margin-left:62px; height:50px;">'.$lang['srv_add_cond'].':
- <a href="#" onclick="calculation_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
- <a href="#" onclick="calculation_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
- <a href="#" onclick="calculation_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
- <a href="#" onclick="calculation_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
- </p><br><br>';
+ echo '<p class="div_calculation_bottom" id="calculation_editing_operators">'.$lang['srv_add_cond'].':
+ <a href="#" onclick="calculation_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
+ <a href="#" onclick="calculation_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
+ <a href="#" onclick="calculation_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
+ <a href="#" onclick="calculation_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
+ </p>';
+ echo '</div>';
}
/**
@@ -7990,51 +9185,14 @@ class Branching {
if (!$sql_count) die();
$row_count = mysqli_fetch_array($sql_count);
- if ($row['vrstni_red'] == 1 && $row_count['count'] > 1) {
- echo '<table class="tbl_condition_editing">';
- echo '<tr>';
- echo '<th style="text-align:center; width:50px">'.$lang['srv_oklepaji'].'</th>'; // gumbi oklepaji
- echo '<th style="width:70px">&nbsp;</th>'; // logicni operatorji
- echo '<th style="width:50px">&nbsp;</th>'; // oklepaji
- echo '<th >&nbsp;</th>';
- echo '<th style="text-align:center; width:50px;">'.$lang['srv_zaklepaji'].'</th>'; // gumbi zaklepaji
- echo '<th style="text-align:center; width:60px">'.$lang['edit2'].'</th>'; // move
- echo '</tr>';
- echo '</table>';
-
- } elseif ($row['vrstni_red'] == 1) {
- echo '<table class="tbl_condition_editing"><tr><th>&nbsp;</th></tr></table>';
- }
// form
- echo '<form name="calculation_'.$calculation.'" id="calculation_'.$calculation.'" action="" method="post" onsubmit="calculation_edit(\''.$calculation.'\'); return false;">'."\n\r";
-
- echo '<table class="tbl_condition_editing" style="margin-bottom:10px; padding-bottom:10px; background-color:white">';
- echo '<tr>';
-
+ echo '<form name="calculation_'.$calculation.'" id="calculation_'.$calculation.'" action="" method="post" onsubmit="calculation_edit(\''.$calculation.'\'); return false;">'."\n\r";
- // left_bracket
- if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) {
-
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add small"></span></a>';
-
- if ($row['left_bracket'] > 0)
- echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
- else
- echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- }
- else {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- }
- echo '</td>';
// operator
- echo '<td class="tbl_ce_tb white" style="width:77px; text-align:center">';
-
- if ($row['vrstni_red'] == 1) {
- // nimamo nic..
- } else {
+ if ($row['vrstni_red'] > 1) {
+ echo '<div class="condition_editing_row operator">';
if ($row['operator']==0)
echo '<a href="#" onclick="calculation_operator_edit(\''.$calculation.'\', \'1\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;+&nbsp;</a>';
@@ -8044,22 +9202,60 @@ class Branching {
echo '<a href="#" onclick="calculation_operator_edit(\''.$calculation.'\', \'3\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;*&nbsp;</a>';
if ($row['operator']==3)
echo '<a href="#" onclick="calculation_operator_edit(\''.$calculation.'\', \'0\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;/&nbsp;</a>';
+
+ echo '</div>';
}
- echo '</td>';
+ echo '<div class="condition_editing_row">';
+
+ // move
+ echo '<div class="move_holder">';
+ if ($row_count['count'] != 1 )
+ echo '<span class="faicon move_updown move" title="'.$lang['srv_move'].'" />';
+ echo '</div>';
+
+
+ // Srednji bel del
+ echo '<div class="white_holder">';
+
+ // left_bracket
+ echo '<div class="column bracket left">';
+
+ if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) {
+
+ echo '<div class="bracket_icons">';
+
+ echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ if ($row['left_bracket'] > 0)
+ echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
+ else
+ echo '<span class="faicon delete_circle icon-grey_normal"></span>';
+
+ echo '</div>';
+
+ echo '<div class="bracket_text">'.$lang['srv_oklepaji'].'</div>';
+ }
+
+ echo '</div>';
// left_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket left">';
+
for ($i=$row['left_bracket']; $i>0; $i--) {
- echo ' ( '; }
- echo '</td>';
+ echo ' ( ';
+ }
+
+ echo '</div>';
// spremenljivka
- echo '<td class="tbl_ce_tb white" style="width:auto">';
- if ($row['spr_id']==0) echo '<span class="red">'.$lang['srv_select_spr'].'!</span>';
- echo '<br />';
- echo '<select name="calculation_spremenljivka_'.$calculation.'" id="calculation_spremenljivka_'.$calculation.'" size="1" style="width:'.($row['spr_id']==-1?'100':'150').'px" onchange="javascript:calculation_edit(\''.$calculation.'\', \''.$vrednost.'\');">'."\n\r";
+ echo '<div class="column variable">';
+
+ if ($row['spr_id']==0)
+ echo '<span class="red">'.$lang['srv_select_spr'].'!</span>';
+
+ echo '<select name="calculation_spremenljivka_'.$calculation.'" id="calculation_spremenljivka_'.$calculation.'" size="1" class="dropdown medium" style="width:'.($row['spr_id']==-1?'100':'150').'px" onchange="javascript:calculation_edit(\''.$calculation.'\', \''.$vrednost.'\');">'."\n\r";
echo '<option value="0"></option>';
echo '<option value="-1"'. ($row['spr_id']==-1 ?' selected="selected"':'').' style="color: blue">&nbsp;&nbsp;&nbsp; '.$lang['srv_number'].'</option>';
@@ -8173,8 +9369,7 @@ class Branching {
// number vnos
if ($row['spr_id'] == -1) {
- //if ($row['number'] == 0) $row['number'] = '';
- echo ' <input type="text" name="number" id="calculation_number_'.$calculation.'" value="'.$row['number'].'" style="width:40px" >';
+ echo ' <input type="text" name="number" id="calculation_number_'.$calculation.'" value="'.$row['number'].'" class="medium" style="width: 40px;">';
echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
echo '$(document).ready(function() {' .
@@ -8183,56 +9378,56 @@ class Branching {
' });' .
'});';
echo '</script>';
-
}
- echo '<br />&nbsp;'."\n\r";
- echo '</td>';
-
+ echo '</div>';
// right_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket right">';
+
for ($i=$row['right_bracket']; $i>0; $i--) {
echo ' ) ';
}
- echo '</td>';
+ echo '</div>';
// right_bracket buttons
+ echo '<div class="column bracket right">';
+
if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) {
- echo '<td class="tbl_ce_lor" style="width:50px; text-align:center" nowrap>';
+
+ echo '<div class="bracket_icons">';
+
if ($row['right_bracket'] > 0)
echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'right\', \'minus\'); return false;" title="'.$lang['srv_zaklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
else
echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add small"></span></a>';
- } else {
- echo '<td class="tbl_ce_lor white" style="width:50px; text-align:center" nowrap>';
-// echo '<span class="sprites delete_blue_light"></span>';
-// echo '<span class="sprites add_blue_light"></span>';
- }
- echo '</td>';
+ echo '<a href="#" onclick="javascript:calculation_bracket_edit_new(\''.$calculation.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add"></span></a>';
- // move
- echo '<td class="tbl_ce_bck_blue white" style="text-align:right; width:30px">';
- if ($row_count['count'] != 1 )
- echo '<img src="img_0/move_updown.png" class="move" title="'.$lang['srv_move'].'" />';
- echo '</td>';
+ echo '</div>';
+
+ echo '<div class="bracket_text">'.$lang['srv_zaklepaji'].'</div>';
+ }
+
+ echo '</div>';
+
+ echo '</div>';
+
// remove
- echo '<td class="tbl_ce_bck_blue white" style="text-align:left; width:30px">';
+ echo '<div class="delete_holder">';
+
$sql3 = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id='$row[cnd_id]'");
if (mysqli_num_rows($sql3) != 1 )
- echo ' <a href="#" onclick="calculation_remove(\''.$row['cnd_id'].'\', \''.$calculation.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete icon-grey_dark_link delte-if-block"></span></a>'."\n\r";
- echo '</td>';
-
+ echo ' <a href="#" onclick="calculation_remove(\''.$row['cnd_id'].'\', \''.$calculation.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete"></span></a>'."\n\r";
+
+ echo '</div>';
- echo '</tr>';
- echo '</table>';
- echo '</form>'."\n\r";
+ echo '</div>';
+ echo '</form>';
}
/**
@@ -8268,7 +9463,7 @@ class Branching {
$variable_ok = true;
foreach ($variable_array AS $spr => $var) {
- if ($spr != $row['id'] && $var == $variable) {
+ if ($var == $variable) {
$variable_ok = false;
}
}
@@ -8313,7 +9508,7 @@ class Branching {
function nova_spremenljivka($grupa, $grupa_vrstni_red, $vrstni_red, $kuki = 0) {
global $lang;
- if ($kuki == 0)
+ if ($kuki == 0 && isset($_COOKIE['srv_clipboard_' . $this->anketa]))
$kuki = $_COOKIE['srv_clipboard_' . $this->anketa];
$variable = $this->generate_variable();
@@ -8380,6 +9575,7 @@ class Branching {
'naslov' => "'".mysqli_real_escape_string($GLOBALS['connect_db'], $row['naslov'])."'",
'variable' => "'".mysqli_real_escape_string($GLOBALS['connect_db'], $variable)."'",
'variable_custom' => "'$variable_custom'",
+ 'vrstni_red' => "'$vrstni_red'",
'thread' => "'0'",
'edit_graf' => "'0'", // naknadno popravimo editiranje grafov - po kopiranju je onemogoceno
);
@@ -8460,7 +9656,7 @@ class Branching {
$condition = SurveyCopy::preformCopyTable('srv_condition', 'id', SurveyCopy::sql2array($qry_src_condition), $pre_set);
// condtition grid, tabela srv_condition_grid
- if (count($condition) > 0) {
+ if (is_countable($condition) && count($condition) > 0) {
foreach ($condition AS $orig => $bckp) {
// condtition grid, tabela srv_condition_grid
$qry_src_condition_grid = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id = '".$orig."'");
@@ -8472,7 +9668,7 @@ class Branching {
}
// condtition vrednost, tabela srv_condition_vre
- if (count($condition) > 0) {
+ if (is_countable($condition) && count($condition) > 0) {
foreach ($condition AS $orig => $bckp) {
$qry_src_condition_vre = sisplet_query("SELECT * FROM srv_condition_vre WHERE cond_id = '$orig'");
//$src_srv_condition_vre = SurveyCopy::arrayfilter($arr_src['srv_condition_vre'], 'cond_id', $orig);
@@ -8510,28 +9706,17 @@ class Branching {
}
+
+ }
// nova (prazna) spremenljivka
- } else {
-
+ else {
// pri glasovanju ustvarimo samo prvic novo spr. z default 2 variablami
if(isset($_POST['survey_type']) && $_POST['survey_type'] == 0)
$size = 2;
else
$size = 3;
- if($type < 990)
- $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '<p>$lang[srv_new_vprasanje]</p>', '$variable', '$size', '$type', '$vrstni_red')");
- //standardna vprasanja -> email, url, file upload, ime priimek
- else{
- if($type == 991) //email
- $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '<p>Vnesite vaš email naslov</p>', 'email', '1', '4', '$vrstni_red')");
- elseif($type == 992) //url
- $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '<p>Vnesite URL</p>', 'url', '1', '4', '$vrstni_red')");
- elseif($type == 993) //file upload
- $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red) VALUES ('', '$grupa', '<p>Naložite datoteko</p>', 'upload', '1', '4', '$vrstni_red')");
- elseif($type == 994) //ime priimek
- $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, tip, vrstni_red, text_kosov, text_orientation) VALUES ('', '$grupa', '<p>Vnesite ime in priimek</p>', 'name', '1', '21', '$vrstni_red', '2', '2')");
- }
+ $sql = sisplet_query("INSERT INTO srv_spremenljivka (id, gru_id, naslov, variable, size, vrstni_red) VALUES ('', '$grupa', '<p>$lang[srv_new_vprasanje]</p>', '$variable', '$size', '$vrstni_red')");
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
@@ -8539,6 +9724,7 @@ class Branching {
$spremenljivka = mysqli_insert_id($GLOBALS['connect_db']);
}
+
// vnesemo -4 tag v podatke, ki oznacuje novo spremenljivko
$sql = sisplet_query("SELECT id FROM srv_user WHERE ank_id = '$this->anketa'");
$query_values = "";
@@ -8549,6 +9735,12 @@ class Branching {
if (mysqli_num_rows($sql) > 0)
sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES $query_values");
+
+ // Preverimo ce smo presegli limit za stevilo vprasanj
+ $check = new SurveyCheck($this->anketa);
+ $check->checkLimitSpremenljivke();
+
+
return $spremenljivka;
}
@@ -8559,10 +9751,12 @@ class Branching {
*/
function if_new ($endif, $parent, $if_id, $vrstni_red, $spremenljivka, $if, $copy=0, $no_content=0, $include_element=true) {
- if ($copy > 0)
- $cookie = $copy;
- else
- $cookie = substr($_COOKIE['srv_clipboard_'.$this->anketa], 3);
+ $cookie = 0;
+
+ if ($copy > 0)
+ $cookie = $copy;
+ elseif(isset($_COOKIE['srv_clipboard_'.$this->anketa]))
+ $cookie = substr($_COOKIE['srv_clipboard_'.$this->anketa], 3);
// Dodaten pogoj da nikoli ne vstavimo v srv_branching elementa ki ima element_spr=0 in element_if=0 (potem lahko pride do neskoncnega loopa kjer se dodajajo grupe v anketo)
if ($if_id == 0) die('copy error2');
@@ -8578,9 +9772,9 @@ class Branching {
// ob pastanju zbrisemo clipboard
setcookie('srv_clipboard_'.$this->anketa, '', time()-3600);
-
- // navaden nov if (pri ENDIFu je nov if prazen, zato ne dodamo nicesar)
- } else {
+ }
+ // navaden nov if (pri ENDIFu je nov if prazen, zato ne dodamo nicesar)
+ else {
$s = sisplet_query("INSERT INTO srv_condition (id, if_id, vrstni_red) VALUES ('', '$if_id', '1')");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
@@ -8706,6 +9900,9 @@ class Branching {
SurveyCopy::preformCopyTable('srv_calculation', null, SurveyCopy::sql2array($sql2), $pre_set);
}
+
+ $vre_id = array();
+
// zanka
// srv_loop
$qry_src_loop = sisplet_query("SELECT * FROM srv_loop WHERE if_id = '$if_copied'");
@@ -8806,7 +10003,7 @@ class Branching {
if ($spr < 0)
return $spr;
- if ($this->if_copy_spremenljivke[$spr] > 0)
+ if (isset($this->if_copy_spremenljivke[$spr]) && $this->if_copy_spremenljivke[$spr] > 0)
return $this->if_copy_spremenljivke[$spr];
$sql = sisplet_query("SELECT g.ank_id FROM srv_spremenljivka s, srv_grupa g WHERE s.id = '$spr' AND s.gru_id=g.id");
@@ -8827,7 +10024,7 @@ class Branching {
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
$row = mysqli_fetch_array($sql);
- $spr_copy = $this->if_copy_spremenljivke[$row['spr_id']];
+ $spr_copy = (isset($this->if_copy_spremenljivke[$row['spr_id']])) ? $this->if_copy_spremenljivke[$row['spr_id']] : 0;
if ($spr_copy > 0) {
$vrstni_red = $row['vrstni_red'];
@@ -8838,7 +10035,8 @@ class Branching {
return $row['id'];
- } else {
+ }
+ else {
$sql = sisplet_query("SELECT g.ank_id FROM srv_vrednost v, srv_spremenljivka s, srv_grupa g WHERE v.id='$vre' AND v.spr_id=s.id AND s.gru_id=g.id");
$row = mysqli_fetch_array($sql);
@@ -8847,7 +10045,6 @@ class Branching {
return $vre;
else
return 0;
-
}
}
@@ -9070,7 +10267,7 @@ class Branching {
$gru_id = $this->find_grupa($gru_vr);
- if ($this->spremenljivka_grupa[$row['element_spr']]['vrstni_red'] != $spr_vr OR $this->spremenljivka_grupa[$row['element_spr']]['gru_id'] != $gru_id) {
+ if (!isset($this->spremenljivka_grupa[$row['element_spr']]) || $this->spremenljivka_grupa[$row['element_spr']]['vrstni_red'] != $spr_vr || $this->spremenljivka_grupa[$row['element_spr']]['gru_id'] != $gru_id) {
if ( $gru_id > 0 ) {
sisplet_query("UPDATE srv_spremenljivka SET vrstni_red = '$spr_vr', gru_id='$gru_id' WHERE id = '$row[element_spr]'");
@@ -9189,7 +10386,8 @@ class Branching {
// naslednij je na isti strani
$next = $vrstni_red + 1;
$sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE vrstni_red='$next' AND gru_id='$row[gru_id]'");
- if (mysqli_num_rows($sql) > 0) {
+
+ if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_array($sql);
return $row['id'];
}
@@ -9197,12 +10395,17 @@ class Branching {
// naslednik je na naslednji strani
$sql = sisplet_query("SELECT g.vrstni_red FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND s.id='$spremenljivka'");
$row = mysqli_fetch_array($sql);
+
$grupa_red = $row['vrstni_red'];
$next = $grupa_red + 1;
- $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$next' ORDER BY s.vrstni_red ASC LIMIT 1");
- $row = mysqli_fetch_array($sql);
- return $row['id'];
+ $sql2 = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$next' ORDER BY s.vrstni_red ASC LIMIT 1");
+ $row2 = mysqli_fetch_array($sql2);
+
+ if(isset($row2['id']))
+ return $row2['id'];
+
+ return 0;
}
/**
@@ -9234,12 +10437,16 @@ class Branching {
$row = mysqli_fetch_array($sql);
$grupa_red = $row['vrstni_red'];
$prev = $grupa_red - 1;
- $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$prev' ORDER BY s.vrstni_red DESC LIMIT 1");
- $row = mysqli_fetch_array($sql);
-
- $this->find_prev_spr[$spremenljivka] = $row['id'];
- return $row['id'];
-
+
+ $sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND g.vrstni_red = '$prev' ORDER BY s.vrstni_red DESC LIMIT 1");
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+ $this->find_prev_spr[$spremenljivka] = $row['id'];
+
+ return $row['id'];
+ }
+
+ return 0;
}
var $prev_srv_branching = 0; // zacasna spremenljivka
@@ -9276,11 +10483,15 @@ class Branching {
return $this->find_last_spr;
$sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red DESC, s.vrstni_red DESC LIMIT 1");
- $row = mysqli_fetch_array($sql);
+
+ if ( mysqli_num_rows($sql) > 0 ){
+ $row = mysqli_fetch_array($sql);
+ $this->find_last_spr = $row['id'];
- $this->find_last_spr = $row['id'];
- return $row['id'];
+ return $row['id'];
+ }
+ return 0;
}
/**
@@ -9290,14 +10501,34 @@ class Branching {
function find_last_spr_branching ($parent = 0) {
$sql = sisplet_query("SELECT element_spr, element_if FROM srv_branching WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red DESC LIMIT 1");
- $row = mysqli_fetch_array($sql);
+
+ if ( mysqli_num_rows($sql) > 0 ){
+ $row = mysqli_fetch_array($sql);
+
+ if ($row['element_spr'] > 0)
+ return $row['element_spr'];
+ else
+ return $this->find_last_spr_branching($row['element_if']);
+ }
- if ($row['element_spr'] > 0) return $row['element_spr'];
+ return 0;
+ }
- if ( mysqli_num_rows($sql) > 0 )
- return $this->find_last_spr_branching($row['element_if']);
+ /**
+ * poisce zadnji if v tabeli srv_branching
+ *
+ */
+ private function find_last_if_branching ($parent = 0) {
- return 0;
+ $sql = sisplet_query("SELECT element_if FROM srv_branching WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red DESC LIMIT 1");
+
+ if ( mysqli_num_rows($sql) > 0 ){
+ $row = mysqli_fetch_array($sql);
+
+ return $row['element_if'];
+ }
+
+ return 0;
}
/**
@@ -9309,9 +10540,14 @@ class Branching {
function getGrupa4Spremenljivka($spremenljivka) {
$sql = sisplet_query("SELECT g.* FROM srv_grupa AS g WHERE g.id = (SELECT s.gru_id FROM srv_spremenljivka as s WHERE s.id = '$spremenljivka')");
- $row = mysqli_fetch_assoc($sql);
- return $row;
+ if ( mysqli_num_rows($sql) > 0 ){
+ $row = mysqli_fetch_assoc($sql);
+
+ return $row;
+ }
+
+ return 0;
}
/**
@@ -9322,28 +10558,47 @@ class Branching {
*/
function getGrupa4If($if_id) {
- $sqlBr = sisplet_query("SELECT vrstni_red FROM srv_branching WHERE ank_id='$this->anketa' AND element_if='$if_id'");
- $rowBr = mysqli_fetch_assoc($sqlBr);
- $vrstni_red_if = $rowBr['vrstni_red'];
+ $row = array();
- if($vrstni_red_if == 1){
- $sql = sisplet_query("SELECT * FROM srv_grupa WHERE ank_id='$this->anketa' AND vrstni_red='1'");
- $row = mysqli_fetch_assoc($sql);
+ // Najprej preverimo, ce imamo v ifu kaksno vprasanje - potem je 1. vprasanje na isti strani
+ $spr_in_if = $this->get_subspr($if_id);
+ if(count($spr_in_if) > 0){
+ $row = $this->getGrupa4Spremenljivka($spr_in_if[0]);
+ return $row;
}
- else{
- $sqlB = sisplet_query("SELECT element_spr, pagebreak FROM srv_branching WHERE ank_id='$this->anketa' AND vrstni_red<'$vrstni_red_if' AND element_spr>'0' ORDER BY vrstni_red DESC");
- $rowB = mysqli_fetch_assoc($sqlB);
- if($rowB['pagebreak'] == 0){
- $row = $this->getGrupa4Spremenljivka($rowB['element_spr']);
+ // If nima znotraj se nobenega vprasanja - moramo poiskati prejsnje vprasanje in ugotoviti stran - NI SE CISTO OK - JE TREBA DODELATI
+ $sqlBr2 = sisplet_query("SELECT vrstni_red, parent FROM srv_branching WHERE ank_id='$this->anketa' AND element_if='$if_id'");
+ if(mysqli_num_rows($sqlBr2) > 0){
+
+ $rowBr2 = mysqli_fetch_assoc($sqlBr2);
+
+ $vrstni_red_if = isset($rowBr2['vrstni_red']) ? $rowBr2['vrstni_red'] : null;
+ $parent_if = isset($rowBr2['parent']) ? $rowBr2['parent'] : null;
+
+ if($vrstni_red_if == 1){
+ $sql = sisplet_query("SELECT * FROM srv_grupa WHERE ank_id='$this->anketa' AND vrstni_red='1'");
+ $row = mysqli_fetch_assoc($sql);
}
else{
- $prev_grupa = $this->getGrupa4Spremenljivka($rowB['element_spr']);
- $row['id'] = $this->find_grupa($prev_grupa['vrstni_red']+1);
- $row['vrstni_red'] = $prev_grupa['vrstni_red']+1;
+ $sqlB = sisplet_query("SELECT element_spr, pagebreak
+ FROM srv_branching
+ WHERE ank_id='".$this->anketa."' AND vrstni_red<'".$vrstni_red_if."' AND parent='".$parent_if."' AND element_spr>'0'
+ ORDER BY vrstni_red DESC
+ ");
+ $rowB = mysqli_fetch_assoc($sqlB);
+
+ if(isset($rowB['pagebreak']) && $rowB['pagebreak'] == 0 && $rowB['element_spr']){
+ $row = $this->getGrupa4Spremenljivka($rowB['element_spr']);
+ }
+ else{
+ $prev_grupa = $this->getGrupa4Spremenljivka($rowB['element_spr']);
+ $row['id'] = $this->find_grupa($prev_grupa['vrstni_red']+1);
+ $row['vrstni_red'] = $prev_grupa['vrstni_red']+1;
+ }
}
}
-
+
return $row;
}
@@ -9357,11 +10612,12 @@ class Branching {
return $this->find_first_spr;
$sql = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC LIMIT 1");
- $row = mysqli_fetch_array($sql);
-
- $this->find_first_spr = $row['id'];
- return $row['id'];
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+ $this->find_first_spr = $row['id'];
+ }
+ return $this->find_first_spr;
}
/**
@@ -9415,24 +10671,17 @@ class Branching {
* poisce naslednji element (spremenljivko, if, blok) in vrne njegov row (parent, vrstni_red, element_spr, element_if)
* v primeru ENDIFA, vrne prazno
*
- * @param mixed $spr
- * @param mixed $if
*/
- var $find_next_element = array();
function find_next_element($parent, $vrstni_red) {
- if (isset($this->find_next_element[$spr][$if]))
- return $this->find_next_element[$spr][$if];
-
$sql = sisplet_query("SELECT parent, vrstni_red, element_spr, element_if FROM srv_branching WHERE parent='$parent' AND vrstni_red>'$vrstni_red' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC LIMIT 1");
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_array($sql);
- $this->find_next_element[$spr][$if] = $row;
- } else {
- $this->find_next_element[$spr][$if] = null;
- }
- return $this->find_next_element[$spr][$if];
+ return $row;
+ }
+
+ return null;
}
/**
@@ -9604,8 +10853,11 @@ class Branching {
$vrstni_red = 1;
$this->vrstni_red_branching_fun(0, $vrstni_red);
}
-
- return $this->vrstni_red_branching[$if][$spremenljivka];
+
+ if(isset($this->vrstni_red_branching[$if][$spremenljivka]))
+ return $this->vrstni_red_branching[$if][$spremenljivka];
+ else
+ return null;
}
/**
@@ -9652,7 +10904,7 @@ class Branching {
$vrstni_red = 1;
- $sql = sisplet_query("SELECT element_spr, element_if FROM srv_branching WHERE parent='$parent' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC");
+ $sql = sisplet_query("SELECT element_spr, element_if, vrstni_red FROM srv_branching WHERE parent='$parent' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
while ($row = mysqli_fetch_array($sql)) {
@@ -9798,33 +11050,36 @@ class Branching {
// Vprasalnik se shranjuje avt.
echo '<div class="forma_bottom_inner changes">';
- echo '<table><tr><td><span class="faicon bottom_saving icon-blue" style="float:left; display:inline;"></span></td>';
- echo '<td>'.$lang['srv_vprasalnik_autosave'].'</td></tr></table>';
+ echo ' <span class="faicon bottom_saving"></span>';
+ echo ' <span>'.$lang['srv_vprasalnik_autosave'].'</span>';
echo '</div>';
echo '<div class="forma_bottom_inner links">';
// Preview
- echo '<a href="' . SurveyInfo::getSurveyLink() . '?preview=on" title="'.$lang['srv_poglejanketo'].'" target="_blank">';
- echo '<span class="faicon bottom_preview"></span> ';
- echo $lang['srv_poglejanketo2'];
+ echo '<a href="' . SurveyInfo::getSurveyLink() . '?preview=on" title="'.$lang['srv_poglejanketo'].'" target="_blank" class="noline">';
+ echo ' <button class="medium-rounded white-gray">';
+ echo ' <span class="faicon monitor"></span> '.$lang['srv_poglejanketo2'];
+ echo ' </button>';
echo '</a>';
// Testiranje
if($this->survey_type != 0 && $this->survey_type != 1){
if ($d->checkDostopSub('test')){
- echo '<a href="index.php?anketa='.$this->anketa.'&a=testiranje" title="'.$lang['srv_testiranje'].'">';
- echo '<span class="faicon bottom_test"></span> ';
- echo $lang['srv_testiranje'];
+ echo '<a href="index.php?anketa='.$this->anketa.'&a=testiranje" title="'.$lang['srv_testiranje'].'" class="noline">';
+ echo ' <button class="medium-rounded white-gray">';
+ echo ' <span class="faicon bottom_test"></span> '.$lang['srv_testiranje'];
+ echo ' </button>';
echo '</a>';
}
}
-
+
// Objava
if ($d->checkDostopSub('publish')){
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=vabila" '.$lang['srv_vabila'].' title="'.$lang['srv_vabila'].'">';
- echo '<span class="faicon bottom_publish"></span> ';
- echo $lang['srv_vabila'];
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=vabila" '.$lang['srv_vabila'].' title="'.$lang['srv_vabila'].'" class="noline">';
+ echo ' <button class="medium-rounded white-gray">';
+ echo ' <span class="faicon data_link"></span> '.$lang['srv_vabila'];
+ echo ' </button>';
echo '</a>';
}
@@ -9835,22 +11090,6 @@ class Branching {
}
}
- /**
- * @desc Če je anketa aktivna, preverimo da ni slučajno potekel čas aktivnosti,
- * če je, jo deaktiviramo
- */
- function checkSurveyActive($anketa = null) {
- // pretecena anketa, kontroliramo datum na: starts in expire
- sisplet_query("UPDATE srv_anketa SET active = '0' WHERE id='" . ($anketa ? $anketa : $this->anketa) . "' AND active = '1' AND expire < CURDATE()");
-
- SurveyInfo :: getInstance()->SurveyInit($this->anketa);
- // vsilimo refresh podatkov
- SurveyInfo :: getInstance()->resetSurveyData();
-
- $sqls = sisplet_query("SELECT active FROM srv_anketa WHERE id='" . ($anketa ? $anketa : $this->anketa) . "'");
- $rows = mysqli_fetch_assoc($sqls);
- return $rows['active'];
- }
/**
* vrne array vseh spremenljivk, ki se pojavljajo v loopu
@@ -10005,9 +11244,11 @@ class Branching {
$row = Cache::srv_spremenljivka($spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
$hotspot_image = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
+
+ // Ce je vprasanje ali anketa zaklenjena
+ $locked = ($this->locked) ? true : false;
//zaslon razdelimo na dva dela - izris leve strani***************************************
- //echo '<div id="half_hot_spot_1" style="width: 50%; class="grid_header_table '.($this->lang_id==null?'allow_new':'').'">';
echo '<div id="half_hot_spot_1" class="hotspot" style="width: 40%; float: left;">';
@@ -10045,8 +11286,8 @@ class Branching {
}else if(substr($hotspot_image, 0, 4) == '<img'){
$hotspot_image_button_text = $lang['srv_hot_spot_edit_image']; //drugace pokazi tekst za urejanje slike
}
- //echo '<p><span class="title" ><button id="hot_spot_regions_add_image_'.$row['id'].'" type="button" onclick=" hotspot_edit('.$row['id'].')">'.$hotspot_image_button_text.'</button></span></p>';
- echo '<p><span class="sprites image_upload pointer" onclick=" hotspot_edit('.$row['id'].')"></span></p>';
+
+ echo '<p style="margin-left:16px;"><span class="faicon image_upload pointer" onclick=" hotspot_edit('.$row['id'].')"></span></p>';
//Slika
echo '<div id="hotspot_image_'.$row['id'].'" class="vrednost_inline_hotspot" contenteditable="false" spr_id="'.$row['id'].'">'.$hotspot_image.'</div>';
@@ -10073,14 +11314,14 @@ class Branching {
else{
while ($row1 = mysqli_fetch_array($sql1)) {
- echo ' <div style="display:none;" other="'.$row1['other'].'" class="variabla" id="variabla_'.$row1['id'].'">';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '<div style="display:none;" other="'.$row1['other'].'" class="variabla" id="variabla_'.$row1['id'].'">';
+ echo ' <div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
echo '</div>';
}
while ($row1_missing = mysqli_fetch_array($sql1_missing)) {
echo '<div class="variabla" other="'.$row1_missing['other'].'" id="variabla_'.$row1_missing['id'].'"><input disabled type="'.$input.'">';
- echo '<div id="vre_id_'.$row1_missing['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1_missing['id'].'" '.(strpos($row1_missing['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1_missing['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1_missing['naslov'].'</div>';
+ echo ' <div id="vre_id_'.$row1_missing['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1_missing['id'].'" '.(strpos($row1_missing['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1_missing['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1_missing['naslov'].'</div>';
echo '</div>';
}
}
@@ -10125,7 +11366,7 @@ class Branching {
echo ' <thead>';
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'">';
echo ' <td></td>';
$bg = 1;
@@ -10135,7 +11376,7 @@ class Branching {
for ($i = 1; $i <= $row['grids']; $i++) {
if ($row2['vrstni_red'] == $i) {
- echo ' <td class=" ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_variable_inline" '.$show_variable_inline.' contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'">' . $row2['variable'] . '</div></td>';
+ echo ' <td class=" ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_variable_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'">' . $row2['variable'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
} else {
echo ' <td class=" ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
@@ -10144,7 +11385,7 @@ class Branching {
echo '</tr>';
echo ' <tr>';
- echo ' <td>'.$grid_plus_minus.'</td>';
+ echo ' <td></td>';
$bg = 1;
@@ -10157,7 +11398,7 @@ class Branching {
if ($naslov != '') $row2['naslov'] = $naslov;
}
if ($row2['vrstni_red'] == $i) {
- echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || strpos($row2['naslov'], $lang1['srv_new_grid'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
+ echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '" grd="g_'.$row2['id'].'"><div class="grid_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" grd_id="'.$row2['id'].'" '.(strpos($row2['naslov'], $lang['srv_new_grid'])!==false || (isset($lang1['srv_new_grid']) && strpos($row2['naslov'], $lang1['srv_new_grid'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row2['naslov'] . '</div></td>';
$row2 = mysqli_fetch_array($sql2);
} else {
echo ' <td class="grid_header ' . ($bg % 2 == 0 ? 'grid_light' : 'grid_dark') . '"></td>';
@@ -10179,7 +11420,7 @@ class Branching {
}
}
- echo '<td style="width:' . $spacesize*3 . '%"></td>';
+ echo '<td></td>';
echo ' </tr>';
echo '</thead>';
@@ -10217,7 +11458,7 @@ class Branching {
echo ' <thead>';
// urejanje vrednosti
- echo ' <tr id="grid_variable_'.$row['id'].'" '.$show_variable_row.'>';
+ echo ' <tr id="grid_variable_'.$row['id'].'">';
echo ' <td></td>';
$bg = 1;
@@ -10232,11 +11473,11 @@ class Branching {
echo '</tr>';
echo ' <tr>';
- echo ' <td>'.$grid_plus_minus.'</td>';
+ echo ' <td></td>';
$bg = 1;
- echo '<td style="width:' . $spacesize*3 . '%"></td>';
+ echo '<td></td>';
echo ' </tr>';
echo '</thead>';
@@ -10260,77 +11501,81 @@ class Branching {
$spremenljivkaParams = new enkaParameters($row['params']);
$hotspot_image = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
$spremenljivkaParams->set('multi_input_type', 'marker');
+
+ // Ce je vprasanje ali anketa zaklenjena
+ $locked = ($this->locked) ? true : false;
echo '<div id="half_hot_spot_1" class="hotspot" style="width: 40%; float: left;">';
- $sql1 = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND other = 0 ORDER BY vrstni_red");
- $sql1_missing = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND other != 0 ORDER BY vrstni_red");
+ $sql1 = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND other = 0 ORDER BY vrstni_red");
+ $sql1_missing = sisplet_query("SELECT id, naslov, other FROM srv_vrednost WHERE spr_id='$row[id]' AND other != 0 ORDER BY vrstni_red");
+
+ //GUMB za nalaganje in urejanje slike
+ if ( ($hotspot_image == '') || substr($hotspot_image, 0, 4) != '<img'){ //ce ni slike
+ $hotspot_image_button_text = $lang['srv_hot_spot_load_image']; //pokazi tekst za upload slike
+ }
+ else if(substr($hotspot_image, 0, 4) == '<img'){
+ $hotspot_image_button_text = $lang['srv_hot_spot_edit_image']; //drugace pokazi tekst za urejanje slike
+ }
+
+ echo '<p style="margin-left:16px;"><span class="faicon image_upload pointer" onclick=" hotspot_edit('.$row['id'].')"></span></p>';
- //GUMB za nalaganje in urejanje slike
- if ( ($hotspot_image == '') || substr($hotspot_image, 0, 4) != '<img'){ //ce ni slike
- $hotspot_image_button_text = $lang['srv_hot_spot_load_image']; //pokazi tekst za upload slike
- }
- else if(substr($hotspot_image, 0, 4) == '<img'){
- $hotspot_image_button_text = $lang['srv_hot_spot_edit_image']; //drugace pokazi tekst za urejanje slike
- }
+ echo '<div id="hotspot_image_'.$row['id'].'" class="vrednost_inline_hotspot" contenteditable="false" spr_id="'.$row['id'].'">'.$hotspot_image.'</div>';
+
+
+ //skrita varianta od koder poberem height in width za urejanje obmocij
+ //izbira ustreznega radio ali checkbox za prikazovanje ob missingu
+ $input = "checkbox";
+
+ echo '<div id="hotspot_image_'.$row['id'].'_hidden" style="display: none;" class="vrednost_inline_hotspot" contenteditable="false" spr_id="'.$row['id'].'">'.$hotspot_image.'</div>';
- echo '<p><span class="sprites image_upload pointer" onclick=" hotspot_edit('.$row['id'].')"></span></p>';
-
- echo '<div id="hotspot_image_'.$row['id'].'" class="vrednost_inline_hotspot" contenteditable="false" spr_id="'.$row['id'].'">'.$hotspot_image.'</div>';
-
-
- //skrita varianta od koder poberem height in width za urejanje obmocij
- //izbira ustreznega radio ali checkbox za prikazovanje ob missingu
- $input = "checkbox";
-
- echo '<div id="hotspot_image_'.$row['id'].'_hidden" style="display: none;" class="vrednost_inline_hotspot" contenteditable="false" spr_id="'.$row['id'].'">'.$hotspot_image.'</div>';
-
- echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'">';
-
- if (mysqli_num_rows($sql1) == 0){
- echo '<div class="variabla">';
- echo '</div>';
- }
- else{
- while ($row1 = mysqli_fetch_array($sql1)) {
-
- echo '<div style="display:none;" other="'.$row1['other'].'" class="variabla" id="variabla_'.$row1['id'].'">';
- echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
- echo '</div>';
- }
- while ($row1_missing = mysqli_fetch_array($sql1_missing)) {
- echo '<div class="variabla" other="'.$row1_missing['other'].'" id="variabla_'.$row1_missing['id'].'"><input disabled type="'.$input.'">';
- echo '<div id="vre_id_'.$row1_missing['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1_missing['id'].'" '.(strpos($row1_missing['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1_missing['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1_missing['naslov'].'</div>';
- echo '</div>';
- }
- }
+ echo '<div id="hotspot_regions_hidden_menu_'.$row['id'].'">';
+
+ if (mysqli_num_rows($sql1) == 0){
+ echo '<div class="variabla">';
echo '</div>';
-
- ?>
- <script>
- $(document).ready(function(){
- //resize slike ob razlicnih dogodkih
- hotspot_image_resize(<?=$row['id']?>);
- //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
- //hotspot_image_button_update(<?=$row['id']?>, '<?=$lang['srv_hot_spot_load_image']?>', '<?=$lang['srv_hot_spot_edit_image']?>');
-
- $("#hotspot_image_<?=$row['id']?>")
- .mouseup(function(){//ko prst dvignemo iz miskine tipke
- hotspot_image_resize(<?=$row['id']?>); //
- //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
- })
- .mouseover(function(){//ko z misko gremo mimo
- hotspot_image_resize(<?=$row['id']?>); //
- //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
- })
- .mouseout(function(){//ko z misko gremo ven
- hotspot_image_resize(<?=$row['id']?>); //
- //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
- })
-
- });
- </script>
- <?
+ }
+ else{
+ while ($row1 = mysqli_fetch_array($sql1)) {
+
+ echo '<div style="display:none;" other="'.$row1['other'].'" class="variabla" id="variabla_'.$row1['id'].'">';
+ echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_new_vrednost'])!==false || (isset($lang1['srv_new_vrednost']) && strpos($row1['naslov'], $lang1['srv_new_vrednost'])!==false) || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
+ echo '</div>';
+ }
+ while ($row1_missing = mysqli_fetch_array($sql1_missing)) {
+ echo '<div class="variabla" other="'.$row1_missing['other'].'" id="variabla_'.$row1_missing['id'].'"><input disabled type="'.$input.'">';
+ echo '<div id="vre_id_'.$row1_missing['id'].'" class="vrednost_inline" contenteditable="'.(!$locked?'true':'false').'" tabindex="1" vre_id="'.$row1_missing['id'].'" '.(strpos($row1_missing['naslov'], $lang['srv_new_vrednost'])!==false || strpos($row1_missing['naslov'], $lang1['srv_new_vrednost'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1_missing['naslov'].'</div>';
+ echo '</div>';
+ }
+ }
+ echo '</div>';
+
+ ?>
+ <script>
+ $(document).ready(function(){
+ //resize slike ob razlicnih dogodkih
+ hotspot_image_resize(<?=$row['id']?>);
+ //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
+ //hotspot_image_button_update(<?=$row['id']?>, '<?=$lang['srv_hot_spot_load_image']?>', '<?=$lang['srv_hot_spot_edit_image']?>');
+
+ $("#hotspot_image_<?=$row['id']?>")
+ .mouseup(function(){//ko prst dvignemo iz miskine tipke
+ hotspot_image_resize(<?=$row['id']?>); //
+ //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
+ })
+ .mouseover(function(){//ko z misko gremo mimo
+ hotspot_image_resize(<?=$row['id']?>); //
+ //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
+ })
+ .mouseout(function(){//ko z misko gremo ven
+ hotspot_image_resize(<?=$row['id']?>); //
+ //show_hot_spot_settings (<?=$row['id']?>, <?=$row['enota']?>, <?=$row['tip']?>);
+ })
+
+ });
+ </script>
+ <?
+
echo ' </div>';
//***********************Heatmap konec*************************************************************
}
diff --git a/admin/survey/BranchingAjax.php b/admin/survey/BranchingAjax.php
index 4ab75e6..81d035d 100644
--- a/admin/survey/BranchingAjax.php
+++ b/admin/survey/BranchingAjax.php
@@ -72,23 +72,34 @@ class BranchingAjax {
}
+ //generira blok (dropdown in menu) za missinge za kategorije
+ function ajax_get_missing_block () {
+ global $lang;
+
+ $b = new Branching($this->anketa);
+ $b->missings_menu($this->spremenljivka);
+ }
+
function ajax_if_new ($spremenljivka = null, $if = null, $endif = null, $tip = null) {
- Common::getInstance()->Init($this->anketa);
- Common::getInstance()->updateEditStamp();
global $lang;
+
+ Common::getInstance()->Init($this->anketa);
+ Common::getInstance()->updateEditStamp();
- if ($spremenljivka == null) $spremenljivka = $_POST['spremenljivka'];
- if ($if == null) $if = $_POST['if'];
- if ($endif == null) $endif = $_POST['endif'];
- if ($tip == null) $tip = $_POST['tip'];
- $copy = $_POST['copy'];
- $no_content = $_POST['no_content'];
+ $spremenljivka = (isset($_POST['spremenljivka']) && $spremenljivka == null) ? $_POST['spremenljivka'] : $spremenljivka;
+ $if = (isset($_POST['if']) && $if == null) ? $_POST['if'] : $if;
+ $endif = (isset($_POST['endif']) && $endif == null) ? $_POST['endif'] : $endif;
+ $tip = (isset($_POST['tip']) && $tip == null) ? $_POST['tip'] : $tip;
+
+ $copy = isset($_POST['copy']) ? $_POST['copy'] : 0;
+ $no_content = isset($_POST['no_content']) ? $_POST['no_content'] : 0;
$include_element = false;
$b = new Branching($this->anketa);
+
if ($spremenljivka >= 0 || $if >= 0) {
$sqln = sisplet_query("SELECT MAX(i.number) AS number FROM srv_if i, srv_branching b WHERE b.ank_id='$this->anketa' AND b.element_if=i.id");
@@ -118,9 +129,9 @@ class BranchingAjax {
// ce je blok Demografija na zadnjem mestu v anketi, potem pri "dodajanju na konec" dodamo pred demografijo --da je demografija vedno na koncu
$sqld = sisplet_query("SELECT b.element_if, b.vrstni_red FROM srv_if i, srv_branching b
- WHERE i.label = '$lang[srv_demografija]' AND i.tip='1' AND b.ank_id='$this->anketa' AND b.element_if=i.id AND parent='0' AND b.vrstni_red = (
- SELECT MAX(vrstni_red) FROM srv_branching WHERE ank_id='$this->anketa' AND parent = '0'
- )");
+ WHERE i.label = '$lang[srv_demografija]' AND i.tip='1' AND b.ank_id='$this->anketa' AND b.element_if=i.id AND parent='0'
+ AND b.vrstni_red = (SELECT MAX(vrstni_red) FROM srv_branching WHERE ank_id='$this->anketa' AND parent = '0')
+ ");
if (mysqli_num_rows($sqld) > 0) {
$rowd = mysqli_fetch_array($sqld);
@@ -196,13 +207,20 @@ class BranchingAjax {
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
- if ($spremenljivka == null) $spremenljivka = $_POST['spremenljivka'];
- if ($if == null) $if = $_POST['if'];
- if ($endif == null) $endif = $_POST['endif'];
- if ($copy == null) $copy = $_POST['copy'];
- if ($drop == null) $drop = $_POST['drop'];
- if ($tip == null) $tip = $_POST['tip'];
- if ($podtip == null) $podtip = $_POST['podtip'];
+ if ($spremenljivka == null && isset($_POST['spremenljivka']))
+ $spremenljivka = $_POST['spremenljivka'];
+ if ($if == null && isset($_POST['if']))
+ $if = $_POST['if'];
+ if ($endif == null && isset($_POST['endif']))
+ $endif = $_POST['endif'];
+ if ($copy == null && isset($_POST['copy']))
+ $copy = $_POST['copy'];
+ if ($drop == null && isset($_POST['drop']))
+ $drop = $_POST['drop'];
+ if ($tip == null && isset($_POST['tip']))
+ $tip = $_POST['tip'];
+ if ($podtip == null && isset($_POST['podtip']))
+ $podtip = $_POST['podtip'];
if ($tip == 23) {
$copy = $podtip;
@@ -459,21 +477,23 @@ class BranchingAjax {
Common::getInstance()->updateEditStamp();
if(!$API_call){
- $child = $_POST['child'];
$parent = $_POST['parent'];
-
$tmp_p = str_replace('droppable_', '', $parent);
$tmp_p = explode('-', $tmp_p);
- $parent = $tmp_p[0];
- $vrstni_red = (int)$tmp_p[1];
- $page_break = (int)$tmp_p[2];
+
+ $parent = isset($tmp_p[0]) ? $tmp_p[0] : $parent;
+ $vrstni_red = isset($tmp_p[1]) ? $tmp_p[1] : $vrstni_red;
+ $page_break = isset($tmp_p[2]) ? $tmp_p[2] : $page_break;
+
+ $child = $_POST['child'];
$child = str_replace('branching_', '', $child);
}
$b = new Branching($this->anketa);
-
+
// droppal smo spremenljivko
- if (is_numeric($parent) && $child > 0) {
+ if (is_numeric($parent) && is_numeric($child) && $child > 0) {
+
if ($b->check_dropped_spremenljivka($child, $parent, $vrstni_red)) {
$sql = sisplet_query("SELECT pagebreak FROM srv_branching WHERE element_spr = '$child'");
@@ -510,7 +530,8 @@ class BranchingAjax {
}
// ce je za spremenljivko page break, ga moramo ohraniti tam, kjer je
- } elseif ($row['pagebreak'] == 1) { /*echo '$row[pb] == 1';*/
+ }
+ elseif ($row['pagebreak'] == 1) { /*echo '$row[pb] == 1';*/
$s = sisplet_query("SELECT element_spr FROM srv_branching WHERE parent='$parent' AND vrstni_red>='$vrstni_red' AND ank_id='$this->anketa' ORDER BY vrstni_red ASC LIMIT 1");
$r = mysqli_fetch_array($s);
@@ -532,7 +553,6 @@ class BranchingAjax {
} /*else echo ' no';*/
Cache::clear_branching_cache(); // drugace se polje pagebreak zakesira pri prikazu
-
}
// na zadnjem mestu vedno popravimo, da ni pagebreaka (ker je nepotreben in lahko kasneje ko se premika kaj pokvari)
@@ -541,17 +561,15 @@ class BranchingAjax {
// -- nastavljanje pagebreakov //
-
- //$b->repare_branching($row['parent']);
- //$b->repare_branching($parent);
$b->repare_branching();
- } else $b->dropped_alert();
-
- // droppal smo if ali endif
- } else {
-
- $child = str_replace('if', '', $child);
+ }
+ else
+ $b->dropped_alert();
+ }
+ // droppal smo if ali endif
+ else {
+ $child = str_replace('if', '', $child);
// droppal smo if
if (is_numeric($child)) {
@@ -672,13 +690,14 @@ class BranchingAjax {
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
- if ($if == 0)
- $if = $_POST['if'];
+ $if = ($if == 0 && isset($_POST['if'])) ? $_POST['if'] : $if;
- if ($_POST['all'] == 1) $all = 1; else $all = 0; // ali brisemo tudi celotno vsebino pogoja/bloka
-
+ // ali brisemo tudi celotno vsebino pogoja/bloka
+ $all = (isset($_POST['all']) && $_POST['all'] == 1) ? 1 : 0;
+
$b = new Branching($this->anketa);
+
if ($if > 0) {
// preverimo, ce obstajajo ze podatki za spremenljivko - v tem primeru damo dodaten error
@@ -694,11 +713,12 @@ class BranchingAjax {
echo '<div class="popup_close"><a href="#" onClick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
echo '<p>'.$lang['if_delete_data'].'</p>';
- echo '<p>'.$lang['srv_brisiifconfirm_all'].'</p><br />';
+ echo '<p class="top16">'.$lang['srv_brisiifconfirm_all'].'</p>';
- echo '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="if_remove(\''.$if.'\', \'1\'); return false;"><span>'.$lang['srv_if_rem_all'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span>';
- //echo '<p><a href="#" onclick="if_remove(\''.$if.'\', \'1\'); return false;">'.$lang['srv_if_rem_all'].'</a> <a href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</a></p>';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ echo ' <button class="medium blue" onclick="if_remove(\''.$if.'\', \'1\'); return false;">'.$lang['srv_if_rem_all'].'</button>';
+ echo '</div>';
return;
}
@@ -865,14 +885,14 @@ class BranchingAjax {
Common::getInstance()->updateEditStamp();
}
- $text = $_POST['text'];
- $operator = $_POST['operator'];
- $negation = $_POST['negation'];
- $conjunction = $_POST['conjunction'];
- $vrednost = $_POST['vrednost'];
- $condition = $_POST['condition'];
- $spremenljivka = $_POST['spremenljivka'];
- $ostanek = $_POST['ostanek'];
+ $text = isset($_POST['text']) ? strip_tags($_POST['text']) : '';
+ $operator = isset($_POST['operator']) ? $_POST['operator'] : '';
+ $negation = isset($_POST['negation']) ? $_POST['negation'] : '';
+ $conjunction = isset($_POST['conjunction']) ? $_POST['conjunction'] : '';
+ $vrednost = isset($_POST['vrednost']) ? $_POST['vrednost'] : '';
+ $condition = isset($_POST['condition']) ? $_POST['condition'] : '';
+ $spremenljivka = isset($_POST['spremenljivka']) ? $_POST['spremenljivka'] : '';
+ $ostanek = isset($_POST['ostanek']) ? $_POST['ostanek'] : '';
//$vrednost = explode(',', $vrednost);
@@ -1080,7 +1100,7 @@ class BranchingAjax {
}
$if = $_POST['if'];
- $label = $_POST['label'];
+ $label = strip_tags($_POST['label']);
sisplet_query("UPDATE srv_if SET label='$label' WHERE id = '$if'");
}
@@ -1315,16 +1335,8 @@ class BranchingAjax {
function ajax_condition_editing_close () {
- $if_nova = $_POST['if_nova'];
$if = $_POST['if'];
- // tega ni vec
- /*if ($if_nova > 0) {
- echo '<script type="text/javascript">
- spremenljivka_new(\'0\', \''.$if_nova.'\', \'1\');
- </script>';
- }*/
-
$b = new Branching($this->anketa);
$b->display_if_label($if);
}
@@ -1418,12 +1430,6 @@ class BranchingAjax {
echo $row['id'];
}
- function ajax_get_new_if () {
- $sql = sisplet_query("SELECT * FROM misc WHERE what='new_if_$this->anketa'");
- $row = mysqli_fetch_array($sql);
- echo $row['value'];
- }
-
function ajax_if_collapsed () {
Common::updateEditStamp();
@@ -1459,7 +1465,7 @@ class BranchingAjax {
$id = $_POST['id'];
$text = $_POST['text'];
- $opomba = $_POST['opomba'];
+ $opomba = strip_tags($_POST['opomba']);
if ($id == -1) {
sisplet_query("UPDATE srv_anketa SET introduction='$text', intro_opomba='$opomba' WHERE id='$this->anketa'");
@@ -1610,20 +1616,24 @@ class BranchingAjax {
// ce je vse ok, preverimo se imena variabel (vprasanj in variabel znotraj vprasanj)
if ($code === true)
$code = $b->check_variable();
+
+ // ce je vse ok, preverimo se vrednosti stolpcev v gridu (ce je slucajno kaksna prazna)
+ if ($code === true)
+ $code = $b->check_grid_value();
// pogoji so ok
if ($code === true) {
if ($_GET['izpis'] == 'long') {
- echo '<p style="text-align: center"><b>'.$lang['srv_check_pogoji_ok'].'!</b></p>';
+
+ echo '<h2>'.$lang['srv_check_pogoji_ok2'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">✕</a></div>';
+
+ echo '<p>'.$lang['srv_check_pogoji_ok'].'!</p>';
- ?>
- <script>
- $(function () {
- $('#check_pogoji').animate({opacity: 1.0}, 3000).fadeOut('slow');
- $('#fade').fadeOut("slow");
- })
- </script>
- <?php
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
} else {
echo '1';
}
@@ -1640,39 +1650,49 @@ class BranchingAjax {
echo '<h2>'.$lang['srv_duplicate_question_variable'].'</h2>';
elseif ($code['type'] == 'variable')
echo '<h2>'.$lang['srv_duplicate_variables'].'</h2>';
+ elseif ($code['type'] == 'grid_value')
+ echo '<h2>'.$lang['srv_empty_grid_values'].'</h2>';
+
echo '<div class="popup_close"><a href="#" onClick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">✕</a></div>';
// napaka v ifih
if ($code['type'] == 'if') {
$sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'");
$row = mysqli_fetch_array($sql);
- echo '<p>'.$lang['srv_check_pogoji_if'].' <a href="javascript:condition_editing(\''.$row['id'].'\');"><b>'.$row['number'].'</b></a></p>';
-
+ echo '<p class="bottom16">'.$lang['srv_check_pogoji_if'].' <a class="noline" href="javascript:condition_editing(\''.$row['id'].'\');$(\'#check_pogoji\').fadeOut(\'slow\');popupClose();"><b>'.$row['number'].'</b></a>.</p>';
+ }
// napaka v podifih, ki so nastavljeni na vrednosti spremenljivk
- } elseif ($code['type'] == 'podif') {
+ elseif ($code['type'] == 'podif') {
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'");
$row = mysqli_fetch_array($sql);
- echo '<p>'.$lang['srv_check_pogoji_spremenljivka'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
-
+ echo '<p>'.$lang['srv_check_pogoji_spremenljivka'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');$(\'#check_pogoji\').fadeOut(\'slow\');popupClose();">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
+ }
// napaka z gnezdenjem loopov
- } elseif ($code['type'] == 'loop') {
+ elseif ($code['type'] == 'loop') {
$sql = sisplet_query("SELECT id, number FROM srv_if WHERE id = '$code[id]'");
$row = mysqli_fetch_array($sql);
- echo '<p>'.$lang['srv_check_pogoji_loop'].' <a href="javascript:condition_editing(\''.$row['id'].'\');"><b>'.$row['number'].'</b></a></p>';
-
- } elseif ($code['type'] == 'validation') {
+ echo '<p>'.$lang['srv_check_pogoji_loop'].' <a href="javascript:condition_editing(\''.$row['id'].'\');$(\'#check_pogoji\').fadeOut(\'slow\');popupClose();"><b>'.$row['number'].'</b></a></p>';
+ }
+ elseif ($code['type'] == 'validation') {
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_spremenljivka WHERE id = '$code[id]'");
$row = mysqli_fetch_array($sql);
- echo '<p>'.$lang['srv_check_validacija'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
-
+ echo '<p>'.$lang['srv_check_validacija'].': <b><a href="javascript:vprasanje_fullscreen(\''.$row['id'].'\');$(\'#check_pogoji\').fadeOut(\'slow\');popupClose();">'.$row['variable'].' - '.strip_tags($row['naslov']).'</a></b></p>';
+ }
// napaka z imeni variabel
- } elseif ($code['type'] == 'variable') {
+ elseif ($code['type'] == 'variable') {
+ foreach ($code['vars'] AS $var) {
+ echo '<strong>'.$var.'</strong><br />';
+ };
+ }
+ // napaka z vrednostmi v gridu
+ elseif ($code['type'] == 'grid_value') {
foreach ($code['vars'] AS $var) {
echo '<strong>'.$var.'</strong><br />';
};
}
+
// error code
echo '<p>';
if ($code['code'] == 1) {
@@ -1690,18 +1710,20 @@ class BranchingAjax {
}
echo '</p>';
-
- //echo '<p class="as_link" onclick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</p>';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</a></div></span>';
- }
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="$(\'#check_pogoji\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ }
else {
echo '<h2>'.$lang['srv_check_pogoji_not_ok'].'</h2>';
echo '<div class="popup_close"><a href="#" onClick="$(\'#surveyTrajanje\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">✕</a></div>';
echo '<p>'.$lang['srv_check_pogoji_not_ok_txt'].'</p>';
-
- //echo '<p class="as_link" onclick="$(\'#surveyTrajanje\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</p>';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#surveyTrajanje\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</a></div></span>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="$(\'#surveyTrajanje\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
}
}
}
@@ -1717,12 +1739,18 @@ class BranchingAjax {
$show_alert = SurveySetting::getInstance()->getSurveyMiscSetting('alert_close_block');
if($show_alert != '2'){
+
+ echo '<h2>'.$lang['alert_close_block_title'].'</h2>';
echo $lang['alert_close_block'];
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="alert_close_block(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
- echo '<span class="buttonwrapper floatRight">';
+ /* echo '<span class="buttonwrapper floatRight">';
echo '<a class="ovalbutton ovalbutton_grey" href="#" onclick="alert_close_block(); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
+ echo '</span>'; */
SurveySetting::getInstance()->setSurveyMiscSetting('alert_close_block', '2');
}
@@ -1795,7 +1823,6 @@ class BranchingAjax {
$results = $_POST['results'];
$status1 = $_POST['status1'];
- $status2 = $_POST['status2'];
if($what == 'finish_author' || $what == 'finish_respondent_cms' || $what == 'finish_respondent' || $what == 'finish_other' | $what == 'finish_other_emails') {
sisplet_query("INSERT INTO srv_alert (ank_id, $what) VALUES ('$this->anketa', '$results')
@@ -1806,7 +1833,7 @@ class BranchingAjax {
}
$b = new Branching($this->anketa);
- $b->toolbox_settings($status1, $status2);
+ $b->toolbox_settings($status1);
}
@@ -1934,89 +1961,22 @@ class BranchingAjax {
$sql = sisplet_query("SELECT * FROM post WHERE 1=0");
}
- if (mysqli_num_rows($sql) > 0) {
- if ($view == 1) {
- //echo '<b><a href="'.$site_url.'index.php?fl=4&fid='.$row['forum'].'&tid='.$tid.'&sortpostorder='.$sortpostorder.'" target="_blank">'.$lang['srv_forum_go'].'</a></b>';
- $rows = mysqli_num_rows($sql);
- if ($rows > 0) echo '<img src="'.$site_url.'/admin/survey/img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '<br /><br />';
- } elseif ($view == 3) {
- echo '<div style="width:45%; float:left">';
- echo '<h3 class="red"><b>'.$lang['comments'].'</b>';
- $rows = mysqli_num_rows($sql);
- if ($rows > 0) echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '</h3>';
- }
- }
-
- // textarea za oddat komentar - zgoraj
+ /*/ textarea za oddat komentar - zgoraj
if ($addfieldposition == 1) {
$this->add_comment_field($spremenljivka, $type, $view);
echo '<br /><br />';
- }
+ }*/
- if (mysqli_num_rows($sql) > 0) {
-
- $i = 0;
- $rows = mysqli_num_rows($sql);
- while ($row = mysqli_fetch_array($sql)) {
-
- // Prikazemo zgodovino glede na nastavitev
- if($comment_history == '2' || (($comment_history == '0' || $comment_history == '') && $row['uid'] == $global_user_id)){
- if ($row['ocena'] == 0) echo '<span style="color:black">';
- elseif ($row['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['ocena'] == 2) echo '<span style="color:#999999">';
- elseif ($row['ocena'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
-
- echo '<b>'.$f->user($row['uid']).'</b> ('.$f->datetime1($row['time']).'):';
-
- if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
-
- echo '<div style="float:right">';
-
- if ($commentmarks == 1) {
- echo ' <select name="ocena" onchange="$.post(siteurl+\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$row['id'].'\', anketa: \''.$rowi['id'].'\'}, function () { add_comment(\''.$spremenljivka.'\', \''.$type.'\', \''.$view.'\', \'\' ); });">
- <option value="0"'.($row['ocena']==0?' selected':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($row['ocena']==1?' selected':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($row['ocena']==2?' selected':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($row['ocena']==3?' selected':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- echo '<input type="checkbox" name="ocena_'.$row['id'].'" id="ocena_'.$row['id'].'" style="margin-right:3px;" onchange="$.post(siteurl+\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \''.$row['id'].'\', anketa: \''.$rowi['id'].'\'}, function () { add_comment(\''.$spremenljivka.'\', \''.$type.'\', \''.$view.'\', \'\' ); });" value="2" '.($row['ocena'] >= 2?' checked':'').' /><label for="ocena_'.$row['id'].'">'.$lang['srv_done'].'</label>';
- }
- //echo ' <br /><a href="javascript:comment_on_comment(\''.$rowt['id'].'\');">'.$lang['srv_comment_comment'].'</a>';
- echo '</div>';
- }
-
- echo '<br/>'.$row['vsebina'].'<hr>';
-
- echo '</span>';
- }
-
- //}
- $i++;
-
- // Nastavimo oglede foruma in teme
- if ($global_user_id > 0) {
- $sqla2 = sisplet_query("SELECT time FROM views WHERE pid='" .$row['id'] ."' AND uid='$global_user_id'");
- if (mysqli_num_rows($sqla2) > 0) {
- $sqla3 = sisplet_query("UPDATE views SET time=NOW() WHERE pid='" .$row['id'] ."' AND uid='$global_user_id'");
- } else {
- $sqla3 = sisplet_query("INSERT INTO views (pid, uid, time) VALUES ('" .$row['id'] ."', '$global_user_id', NOW())");
- }
- }
- }
- }
// textarea za oddat komentar - spodaj
if ($addfieldposition == 0 || $addfieldposition == '') {
- echo '<br />';
- $this->add_comment_field($spremenljivka, $type, $view);
+ echo '<div id="survey_comment_0_1">';
+ $this->add_comment_field($spremenljivka, $type, $view, true, false);
+ echo '</div>';
}
} else {
- $this->add_comment_field($spremenljivka, $type, $view);
+ //$this->add_comment_field($spremenljivka, $type, $view);
}
if ($_REQUEST['refresh'] != '1' || $view==3)
@@ -2172,7 +2132,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");
@@ -2322,29 +2282,42 @@ class BranchingAjax {
}
}
- function add_comment_field ($spremenljivka, $type, $view, $form=true) {
+ function add_comment_field ($spremenljivka, $type, $view, $form=true, $buttons=true) {
global $admin_type;
global $global_user_id;
global $lang;
global $site_url;
$rowanketa = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<textarea name="vsebina" id="vsebina_'.$spremenljivka.'_'.$view.'" style="width:100%; height:50px; margin-bottom:10px; border:1px red solid;"></textarea><br />';
- echo '<input type="submit" value="'.$lang['send'].'" onclick="add_comment(\''.$spremenljivka.'\', \''.$type.'\', \''.$view.'\', $(\'#vsebina_'.$spremenljivka.'_'.$view.'\').val()); return false;" />';
-
- if (($type == 0 || $view==3) && ($admin_type == 0 || $global_user_id==$rowanketa['insert_uid'])) {
-
- echo '<div style="float:right">';
-
- // Link na pregled splosnih komentarjev
- echo '<span style="margin-right: 20px;"><a href="'.$site_url.'/admin/survey/index.php?anketa='.$this->anketa.'&a=komentarji_anketa">'.$lang['srv_comment_overview'].'</a></span>';
-
- // Link na nastavitve komentarjev
- echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$this->anketa.'&a=urejanje">'.$lang['settings'].'</a>';
-
+
+
+ $tip_lang = '';
+ if ($type == 1 && $view == 4) //splošen komentar na strani testiranje
+ $tip_lang = 'S';
+ if ($type == 0 && $view == 1) //splošen komentar v dropdownu
+ $tip_lang = 'S';
+ if ($spremenljivka != 0) //komentar na vprašanja
+ $tip_lang = 'Q';
+
+ if ($type == 5) //komentar na pogoj
+ $tip_lang = 'IF';
+ elseif ($type == 6) //komentar na blok
+ $tip_lang = 'B';
+
+
+ echo '<textarea name="vsebina" placeholder="'.$lang['srv_comments_add_comment'.$tip_lang.''].'" id="vsebina_'.$spremenljivka.'_'.$view.'"></textarea>';
+
+ if ($buttons) {
+ echo '<div class="button_holder bottom0">';
+
+ if($_GET['a'] == 'comment_manage')
+ echo ' <button class="medium white-blue" onClick="closeCommentQtip(\''.$spremenljivka.'_'.$view.'\');">'.$lang['edit1338'].'</button>';
+ else
+ echo ' <button class="medium white-blue" onClick="toggleAddComment(\''.$spremenljivka.'_'.$view.'\');">'.$lang['edit1338'].'</button>';
+
+ echo ' <button class="medium blue" onclick="add_comment(\''.$spremenljivka.'\', \''.$type.'\', \''.$view.'\', $(\'#vsebina_'.$spremenljivka.'_'.$view.'\').val()); return false;">'.$lang['srv_comments_new'].'</button>';
echo '</div>';
- }
+ }
}
/**
@@ -2382,10 +2355,12 @@ class BranchingAjax {
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
- $spremenljivka = $_POST['spremenljivka'];
+ if(isset($_POST['spremenljivka'])){
+ $spremenljivka = $_POST['spremenljivka'];
- save('forceShowSpremenljivka', true);
- \App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($spremenljivka);
+ save('forceShowSpremenljivka', true);
+ \App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($spremenljivka);
+ }
}
function ajax_calculation_edit_variable () {
@@ -2675,6 +2650,30 @@ class BranchingAjax {
$b->repare_condition($if);
$b->calculation_editing_inner($condition);
}
+
+ function ajax_quota_sort() {
+ Common::getInstance()->Init($this->anketa);
+ Common::getInstance()->updateEditStamp();
+
+ $condition = $_POST['condition'];
+ $sortable = $_POST['sortable'];
+ $sortable = explode('&', $sortable);
+
+ $i=1;
+ foreach ($sortable AS $val) {
+ $quota = explode('=', $val);
+ $quota = $quota[1];
+
+ $s = sisplet_query("UPDATE srv_quota SET vrstni_red='{$i}' WHERE id='{$quota}'");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+
+ $i++;
+ }
+
+ $b = new Branching($this->anketa);
+ $b->repare_condition($if);
+ //$b->calculation_editing_inner($condition);
+ }
function ajax_spremenljivka_preview_print() {
global $lang;
@@ -2699,11 +2698,11 @@ class BranchingAjax {
</head>
<body>
<?
-
- echo '<div id="printIcon">';
- echo '<a href="#" onclick="window.print(); return false;"><span class="faicon print_small icon-grey_dark_link"></span> '.$lang['hour_print2'].'</a>';
- echo '</div>';
+ echo '<div class="button_holder print_button">';
+ echo '<button class="small blue" onclick="window.print(); return false;">'.$lang['hour_print2'].'</button>';
+ echo '</div>';
+
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
@@ -2721,7 +2720,7 @@ class BranchingAjax {
save('forceShowSpremenljivka', true);
\App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($_GET['spremenljivka']);
}
-
+
?>
</body>
</html>
@@ -2731,7 +2730,7 @@ class BranchingAjax {
function ajax_toolbox_add_advanced () {
$b = new Branching($this->anketa);
- $b->toolbox_add_advanced();
+ $b->toolbox_add_advanced($popup=true);
}
function ajax_toggle_toolbox () {
@@ -2765,15 +2764,27 @@ class BranchingAjax {
echo '<div class="popup_close"><a href="#" onClick="$(\'#vrednost_edit\').hide().html(\'\'); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
- echo '<h2>'.$lang['srv_find_replace'].'</h2>';
+ echo '<h2><span class="faicon blue replace"></span>'.$lang['srv_find_replace'].'</h2>';
- echo '<p class="gray">'.$lang['srv_find_text'].'</p>';
-
- echo '<p><label style="display:inline-block; width:100px">'.$lang['srv_find'].': </label><input type="text" name="find" style="width:200px"><span id="find_count" style="color:red; margin:0 20px"></span></p>';
- echo '<p><label style="display:inline-block; width:100px">'.$lang['srv_replace_with'].': </label><input type="text" name="replace" style="width:200px"></p>';
-
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="find_replace_do(); return false;" href="#"><span>'.$lang['srv_replace'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray btn_savesettings" onclick="$(\'#vrednost_edit\').hide().html(\'\'); $(\'#fade\').fadeOut(); return false;" href="#"><span>'.$lang['srv_cancel'].'</span></a></div></span>';
+ echo '<p class="bottom16">'.$lang['srv_find_text'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_find'].':</p>';
+ echo '<div class="find-holder">';
+ echo '<input type="text" class="text large" name="find">';
+ echo '<span class="red" id="find_count" style="margin-left: 16px;"></span>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_replace_with'].':</p>';
+ echo '<input type="text" class="text large" name="replace">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#vrednost_edit\').hide().html(\'\'); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="find_replace_do(); return false;">'.$lang['srv_replace'].'</button>';
+ echo '</div>';
}
function ajax_find_replace_count() {
@@ -2924,11 +2935,6 @@ class BranchingAjax {
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
$if_id = mysqli_insert_id($GLOBALS['connect_db']);
- $sqlm = sisplet_query("SELECT * FROM misc WHERE what='new_if_$this->anketa'");
- if (mysqli_num_rows($sqlm) > 0)
- sisplet_query("UPDATE misc SET value='$if_id' WHERE what='new_if_$this->anketa'");
- else
- sisplet_query("INSERT INTO misc (what, value) VALUES ('new_if_$this->anketa', '$if_id')");
if ($this->spremenljivka > 0 || ($if > 0 && $endif == 1)) {
$sql = sisplet_query("SELECT * FROM srv_branching WHERE element_spr = '$this->spremenljivka' AND element_if='$if'");
diff --git a/admin/survey/Glasovanje.php b/admin/survey/Glasovanje.php
index b880b21..a0539df 100644
--- a/admin/survey/Glasovanje.php
+++ b/admin/survey/Glasovanje.php
@@ -100,225 +100,238 @@ class Glasovanje {
global $site_path;
global $admin_type;
- echo '<div class="header_holder">'.NEW_LINE;
- echo '<div class="header_content">'.NEW_LINE;
- echo ' <div class="header_left">' . $lang['srv_glasovanja_settings'] . Help :: display('srv_type_glasovanje') . '</div>' . NEW_LINE;
- echo '<div class="clr"></div>';
- echo '</div>';
+ echo '<div class="header">';
+ echo $lang['srv_glasovanja_settings'].Help :: display('srv_type_glasovanje');
echo '</div>';
$sql2 = sisplet_query("SELECT * FROM srv_glasovanje WHERE ank_id='$this->anketa'");
$row2 = mysqli_fetch_array($sql2);
$row = Cache::srv_spremenljivka($row2['spr_id']);
-
$rowA = SurveyInfo::getInstance()->getSurveyRow();
- //Vkljucenost ankete (embeddana ali samostojna)
+
+ // Vkljucenost ankete (embeddana ali samostojna)
echo '<fieldset>';
- echo '<legend>' . $lang['glasovanja_embed'] . '</legend>';
- echo '<label for="glasovanja_embed_0" class="pointer"><input type="radio" name="glasovanja_embed" value="0" id="glasovanja_embed_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'embed\')" ' . ($row2['embed'] == 0 ? ' checked' : '') . '/>' . $lang['glasovanja_embed_off'] . '</label><br /> ';
- echo '<label for="glasovanja_embed_1" class="pointer"><input type="radio" name="glasovanja_embed" value="1" id="glasovanja_embed_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'embed\')" ' . ($row2['embed'] == 1 ? ' checked' : '') . '/>' . $lang['glasovanja_embed_on'];
- if($row2['embed'] != 0)
- echo ' (<a href="index.php?anketa=' . $this->anketa . '&a=vabila&m=url&js=open">' . $lang['srv_embed_link'] . '</a>)';
- echo '</label> ';
+
+ echo ' <div class="setting_title">' . $lang['glasovanja_embed'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_embed" value="0" id="glasovanja_embed_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'embed\')" ' . ($row2['embed'] == 0 ? ' checked' : '') . '/><label for="glasovanja_embed_0">'.$lang['glasovanja_embed_off'] .'</label>';
+ echo ' </div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_embed" value="1" id="glasovanja_embed_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'embed\')" ' . ($row2['embed'] == 1 ? ' checked' : '') . '/><label for="glasovanja_embed_1">'.$lang['glasovanja_embed_on'].'</label> ';
+ echo ' </div>';
+
echo '</fieldset>';
- //Izbira spola ob resevanju
+ // Izbira spola ob resevanju
echo '<fieldset>';
- echo '<legend>' . $lang['glasovanja_spol'] . '</legend>';
- //echo '<span class="nastavitveSpan4"><label>' . $lang['srv_alert_respondent'] . ':</label></span>';
- echo '<label for="glasovanja_spol_1" class="pointer"><input type="radio" name="glasovanja_spol" value="1" id="glasovanja_spol_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'spol\')" ' . ($row2['spol'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<label for="glasovanja_spol_0" class="pointer"><input type="radio" name="glasovanja_spol" value="0" id="glasovanja_spol_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'spol\')" ' . ($row2['spol'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label> ';
- echo '</fieldset>';
+ echo ' <div class="setting_title">' . $lang['glasovanja_spol'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_spol" value="1" id="glasovanja_spol_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'spol\')" ' . ($row2['spol'] == 1 ? ' checked' : '') . '/><label for="glasovanja_spol_1">' . $lang['yes'] . '</label> ';
+ echo ' <input type="radio" name="glasovanja_spol" value="0" id="glasovanja_spol_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'spol\')" ' . ($row2['spol'] == 0 ? ' checked' : '') . '/><label for="glasovanja_spol_0">' . $lang['no1'] . '</label> ';
+ echo ' </div>';
+
+ echo '</fieldset>';
- //Prikaz dodatnih strani
+
+ // Prikaz dodatnih strani
echo '<fieldset>';
- echo '<legend>' . $lang['glasovanja_strani'] . '</legend>';
-
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_strani_intro'] . ':</label></span>';
- echo '<label for="glasovanja_intro_1" class="pointer"><input type="radio" name="glasovanja_intro" value="1" id="glasovanja_intro_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_intro\')" ' . ($rowA['show_intro'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<label for="glasovanja_intro_0" class="pointer"><input type="radio" name="glasovanja_intro" value="0" id="glasovanja_intro_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_intro\')" ' . ($rowA['show_intro'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label><br /> ';
-
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_strani_outro'] . ':</label></span>';
- echo '<label for="glasovanja_concl_1" class="pointer"><input type="radio" name="glasovanja_concl" value="1" id="glasovanja_concl_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_concl\')" ' . ($rowA['show_concl'] == 1 ? ' checked' : '') . '/>' . $lang['glasovanja_strani_outro_show'] . '</label> ';
- echo '<label for="glasovanja_concl_0" class="pointer"><input type="radio" name="glasovanja_concl" value="0" id="glasovanja_concl_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_concl\')" ' . ($rowA['show_concl'] == 0 ? ' checked' : '') . '/>' . $lang['glasovanja_strani_outro_hide'] . '</label> ';
- //echo '<input type="radio" name="glasovanja_concl" value="-1" id="glasovanja_concl_-1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_concl\')" ' . ($rowA['show_concl'] == -1 ? ' checked' : '') . '/><label for="glasovanja_concl_-1" class="pointer">' . $lang['glasovanja_strani_outro_hide'] . '</label> ';
- // tega ni treba vec
- /*if($rowA['show_concl'] != 1)
- echo '<a href="#" onclick="vprasanje_fullscreen(\'-2\')">(' . $lang['edit3'] . ')</a>';*/
-
+
+ echo '<div class="setting_title">' . $lang['glasovanja_strani_intro'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_intro" value="1" id="glasovanja_intro_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_intro\')" ' . ($rowA['show_intro'] == 1 ? ' checked' : '') . '/><label for="glasovanja_intro_1">' . $lang['yes'] . '</label>';
+ echo ' <input type="radio" name="glasovanja_intro" value="0" id="glasovanja_intro_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_intro\')" ' . ($rowA['show_intro'] == 0 ? ' checked' : '') . '/><label for="glasovanja_intro_0">' . $lang['no1'] . '</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_title">' . $lang['glasovanja_strani_outro'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_concl" value="1" id="glasovanja_concl_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_concl\')" ' . ($rowA['show_concl'] == 1 ? ' checked' : '') . '/><label for="glasovanja_concl_1">' . $lang['yes'] . '</label> ';
+ echo ' <input type="radio" name="glasovanja_concl" value="0" id="glasovanja_concl_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_concl\')" ' . ($rowA['show_concl'] == 0 ? ' checked' : '') . '/><label for="glasovanja_concl_0">' . $lang['no1'] . '</label> ';
+ echo ' </div>';
+
echo '</fieldset>';
// Prikaz naslova...
echo '<fieldset>';
- echo '<legend>' . $lang['glasovanja_naslov'] . '</legend>';
-
+
// prikaz naslova ankete
SurveySetting::getInstance()->Init($this->anketa);
- $survey_hide_title = SurveySetting::getInstance()->getSurveyMiscSetting('survey_hide_title');
- echo '<span class="nastavitveSpan4" style="width: 140px;"><label>' . $lang['glasovanja_results_survey_title'] . ':</label></span>';
- echo '<label><input type="radio" name="survey_hide_title" value="0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'survey_hide_title\')" '.($survey_hide_title == 0 ? ' checked="checked"' : '').'>' . $lang['yes'] . '</label> ';
- echo '<label><input type="radio" name="survey_hide_title" value="1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'survey_hide_title\')" '.($survey_hide_title == 1 ? ' checked="checked"' : '').'>' . $lang['no1'] . '</label><br />';
- /*echo '<input type="radio" name="glasovanja_survey_title" value="0" id="glasovanja_survey_title_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'akronim\')" ' . ($rowA['akronim'] == ' ' ? ' checked' : '') . '/><label for="glasovanja_survey_title_0" class="pointer">' . $lang['no1'] . '</label> ';
- echo '<input type="radio" name="glasovanja_survey_title" value="1" id="glasovanja_survey_title_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'akronim\')" ' . ($rowA['akronim'] == '' ? ' checked' : '') . '/><label for="glasovanja_survey_title_1" class="pointer">' . $lang['yes'] . '</label> ';
- echo '<input type="radio" name="glasovanja_survey_title" value="2" id="glasovanja_survey_title_2" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'akronim\')" ' . ($rowA['akronim'] == $lang['poll'] ? ' checked' : '') . '/><label for="glasovanja_survey_title_2" class="pointer">"' . $lang['poll'] . '"</label><br /> ';*/
-
- //anketa v arhivu - prikaz arhiva
- echo '<span class="nastavitveSpan4" style="width: 140px;"><label>' . $lang['glasovanja_results_archive'] . ':</label></span>';
- echo '<label for="stat_archive_1" class="pointer"><input type="radio" name="stat_archive" value="1" id="stat_archive_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_archive\')" ' . ($row2['stat_archive'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<label for="stat_archive_0" class="pointer"><input type="radio" name="stat_archive" value="0" id="stat_archive_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_archive\')" ' . ($row2['stat_archive'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label><br /> ';
- //echo '<input type="checkbox" name="stat_archive" value="1" id="stat_archive" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'stat_archive\')" ' . ($row2['stat_archive'] == 1 ? ' checked' : '') . '/><label for="stat_archive" class="pointer"></label><br /> ';
+ $survey_hide_title = SurveySetting::getInstance()->getSurveyMiscSetting('survey_hide_title');
+ echo ' <div class="setting_title">' . $lang['glasovanja_results_survey_title'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="survey_hide_title" id="survey_hide_title_0" value="0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'survey_hide_title\')" '.($survey_hide_title == 0 ? ' checked="checked"' : '').'><label for="survey_hide_title_0">' . $lang['yes'] . '</label>';
+ echo ' <input type="radio" name="survey_hide_title" id="survey_hide_title_1" value="1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'survey_hide_title\')" '.($survey_hide_title == 1 ? ' checked="checked"' : '').'><label for="survey_hide_title_1">' . $lang['no1'] . '</label>';
+ echo ' </div>';
+
+ //anketa v arhivu - prikaz arhiva
+ echo ' <div class="setting_title">' . $lang['glasovanja_results_archive'].' '.Help :: display('srv_glasovanje_archive').':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="stat_archive" value="1" id="stat_archive_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_archive\')" ' . ($row2['stat_archive'] == 1 ? ' checked' : '') . '/><label for="stat_archive_1">' . $lang['yes'] . '</label>';
+ echo ' <input type="radio" name="stat_archive" value="0" id="stat_archive_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_archive\')" ' . ($row2['stat_archive'] == 0 ? ' checked' : '') . '/><label for="stat_archive_0">' . $lang['no1'] . '</label>';
+ echo ' </div>';
+
echo '</fieldset>';
- //Prikaz statistike - nastavitve
+ // Prikaz statistike - nastavitve
echo '<fieldset>';
- echo '<legend>' . $lang['glasovanja_results'] . '</legend>';
-
- //prikaz statistike
- echo '<span class="nastavitveSpan4" style="width: 100%;"><label>' . $lang['srv_stat_on'] . ':</label></span><br />';
- echo '<label for="show_stat_1" class="pointer"><input type="radio" name="show_stat" value="1" id="show_stat_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<label for="show_stat_0" class="pointer"><input type="radio" name="show_stat" value="0" id="show_stat_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label> ';
- echo '<label for="show_stat_2" class="pointer"><input type="radio" name="show_stat" value="2" id="show_stat_2" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 2 ? ' checked' : '') . '/>' . $lang['glasovanja_results_admin'] . '</label><br /> ';
-
+
+ echo '<div class="setting_title">' . $lang['glasovanja_results'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="show_stat" value="1" id="show_stat_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 1 ? ' checked' : '') . '/><label for="show_stat_1">' . $lang['yes'] . '</label>';
+ echo ' <input type="radio" name="show_stat" value="0" id="show_stat_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 0 ? ' checked' : '') . '/><label for="show_stat_0">' . $lang['no1'] . '</label>';
+ echo ' <input type="radio" name="show_stat" value="2" id="show_stat_2" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat\')" ' . ($row['stat'] == 2 ? ' checked' : '') . '/><label for="show_stat_2">' . $lang['glasovanja_results_admin'] . '</label>';
+ echo ' </div>';
+
if($row['stat'] > 0){
- //prikaz stevila glasov, v procentih in z grafom
- echo '<span class="nastavitveSpan5" style="width: 100%;"><label>' . $lang['glasovanja_results_type'] . ':</label></span><br />';
- echo '<label for="glasovanja_results" class="pointer"><input type="checkbox" name="glasovanja_results" value="1" id="glasovanja_results" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_results\')" ' . ($row2['show_results'] == 1 ? ' checked' : '') . '/>' . $lang['glasovanja_results_count'] . '</label> ';
- echo '<label for="glasovanja_percent" class="pointer"><input type="checkbox" name="glasovanja_percent" value="1" id="glasovanja_percent" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_percent\')" ' . ($row2['show_percent'] == 1 ? ' checked' : '') . '/>' . $lang['glasovanja_results_percent'] . '</label> ';
- echo '<label for="glasovanja_graph" class="pointer"><input type="checkbox" name="glasovanja_graph" value="1" id="glasovanja_graph" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_graph\')" ' . ($row2['show_graph'] == 1 ? ' checked' : '') . '/>' . $lang['glasovanja_results_graph'] . '</label><br /> ';
-
- //prikaz stevila glasov
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_results_allcount'] . ':</label></span>';
- echo '<label for="glasovanja_count_0" class="pointer"><input type="radio" name="glasovanja_count" value="0" id="glasovanja_count_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_count\')" ' . ($row2['stat_count'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label> ';
- echo '<label for="glasovanja_count_1" class="pointer"><input type="radio" name="glasovanja_count" value="1" id="glasovanja_count_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_count\')" ' . ($row2['stat_count'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label><br /> ';
-
- //prikaz casa glasovanja
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_results_time'] . ':</label></span>';
- echo '<label for="glasovanja_time_0" class="pointer"><input type="radio" name="glasovanja_time" value="0" id="glasovanja_time_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_time\')" ' . ($row2['stat_time'] == 0 ? ' checked' : '') . '/>' . $lang['no1'] . '</label> ';
- echo '<label for="glasovanja_time_1" class="pointer"><input type="radio" name="glasovanja_time" value="1" id="glasovanja_time_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_time\')" ' . ($row2['stat_time'] == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label><br /> ';
-
- //prikaz naslova vprasanja
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_results_title'] . ':</label></span>';
- echo '<label for="glasovanja_title_1" class="pointer"><input type="radio" name="glasovanja_title" value="1" id="glasovanja_title_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_title\')" ' . ($row2['show_title'] == 1 ? ' checked' : '') . '/>' . $lang['no1'] . '</label> ';
- echo '<label for="glasovanja_title_0" class="pointer"><input type="radio" name="glasovanja_title" value="0" id="glasovanja_title_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_title\')" ' . ($row2['show_title'] == 0 ? ' checked' : '') . '/>' . $lang['yes'] . '</label><br /> ';
+
+ // prikaz stevila glasov, v procentih in z grafom
+ echo ' <div class="setting_title">' . $lang['glasovanja_results_type'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="checkbox" name="glasovanja_results" value="1" id="glasovanja_results" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_results\')" ' . ($row2['show_results'] == 1 ? ' checked' : '') . '/><label for="glasovanja_results">' . $lang['glasovanja_results_count'] . '</label> ';
+ echo ' <input type="checkbox" name="glasovanja_percent" value="1" id="glasovanja_percent" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_percent\')" ' . ($row2['show_percent'] == 1 ? ' checked' : '') . '/><label for="glasovanja_percent">' . $lang['glasovanja_results_percent'] . '</label> ';
+ echo ' <input type="checkbox" name="glasovanja_graph" value="1" id="glasovanja_graph" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this, \'show_graph\')" ' . ($row2['show_graph'] == 1 ? ' checked' : '') . '/><label for="glasovanja_graph">' . $lang['glasovanja_results_graph'] . '</label><br /> ';
+ echo ' </div>';
+
+ // prikaz stevila glasov
+ echo ' <div class="setting_title">' . $lang['glasovanja_results_allcount'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_count" value="0" id="glasovanja_count_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_count\')" ' . ($row2['stat_count'] == 0 ? ' checked' : '') . '/><label for="glasovanja_count_0">' . $lang['no1'] . '</label>';
+ echo ' <input type="radio" name="glasovanja_count" value="1" id="glasovanja_count_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_count\')" ' . ($row2['stat_count'] == 1 ? ' checked' : '') . '/><label for="glasovanja_count_1">' . $lang['yes'] . '</label>';
+ echo ' </div>';
+
+ // prikaz casa glasovanja
+ echo '<div class="setting_title">' . $lang['glasovanja_results_time'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_time" value="0" id="glasovanja_time_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_time\')" ' . ($row2['stat_time'] == 0 ? ' checked' : '') . '/><label for="glasovanja_time_0">' . $lang['no1'] . '</label>';
+ echo ' <input type="radio" name="glasovanja_time" value="1" id="glasovanja_time_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'stat_time\')" ' . ($row2['stat_time'] == 1 ? ' checked' : '') . '/><label for="glasovanja_time_1">' . $lang['yes'] . '</label>';
+ echo ' </div>';
+
+ // prikaz naslova vprasanja
+ echo '<div class="setting_title">' . $lang['glasovanja_results_title'] . ':</div>';
+ echo ' <div class="setting_row">';
+ echo ' <input type="radio" name="glasovanja_title" value="1" id="glasovanja_title_1" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_title\')" ' . ($row2['show_title'] == 1 ? ' checked' : '') . '/><label for="glasovanja_title_1">' . $lang['no1'] . '</label>';
+ echo ' <input type="radio" name="glasovanja_title" value="0" id="glasovanja_title_0" onClick="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'show_title\')" ' . ($row2['show_title'] == 0 ? ' checked' : '') . '/><label for="glasovanja_title_0">' . $lang['yes'] . '</label>';
+ echo ' </div>';
}
+
echo '</fieldset>';
// SPODNJE EXTRA NASTAVITVE
- echo '<div id="glas_extra_settings" '.($displayExtra==0 ? ' style="display: none;"' : '').' >';
- //PISKOTEK
- echo ' <fieldset>'. NEW_LINE;
- echo ' <legend>' . $lang['cookie'] . '</legend>'. NEW_LINE;
-
- //piskotek shrani
- echo '<span class="nastavitveSpan4" style="width: 100%;"><label>' . $lang['srv_cookie'] . ':</label></span><br />';
- echo '<label for="cookie_-1" class="pointer"><input type="radio" name="cookie" value="-1" id="cookie_-1" onClick="edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'cookie\')" ' . ($rowA['cookie'] == -1 ? ' checked' : '') . '/>' . $lang['a_without'] . '</label> ';
- echo '<label for="cookie_1" class="pointer"><input type="radio" name="cookie" value="1" id="cookie_1" onClick="edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'cookie\')" ' . ($rowA['cookie'] == 1 ? ' checked' : '') . '/>' . $lang['srv_cookie_1'] . '</label><br /> ';
-
- echo ' </fieldset>';
-
- //TRAJANJE
- echo ' <fieldset>'. NEW_LINE;
- echo ' <legend>' . $lang['duration'] . '</legend>'. NEW_LINE;
-
- echo '<span class="nastavitveSpan4" style="width: 100%;"><label>' . $lang['srv_starts'] . ':</label></span><br/>';
- echo '<input id="starts" type="text" name="starts" value="' . $rowA['starts'] . '" onBlur="edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'starts\')" />
- <span class="faicon calendar_icon icon-as_link" id="starts_img"></span>
- <script type="text/javascript">
- Calendar.setup({
- inputField : "starts",
- ifFormat : "%Y-%m-%d",
- button : "starts_img",
- singleClick : true,
-
- onUpdate : function() {
- edit_glasovanje(\'' . $rowA['spr_id'] . '\', document.getElementById("starts").value, \'starts\');
- }
- });
- </script>
- ';
- echo '<br/>';
- echo '<span class="nastavitveSpan4" style="width: 100%;"><label>' . $lang['srv_expire'] . ':</label></span><br/>';
- echo '<input id="expire" type="text" name="expire" value="' . $rowA['expire'] . '" onBlur="edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'expire\')" />
- <span class="faicon calendar_icon icon-as_link" id="expire_img"></span>
- <script type="text/javascript">
- Calendar.setup({
- inputField : "expire",
- ifFormat : "%Y-%m-%d",
- button : "expire_img",
- singleClick : true,
- onUpdate : function() {
- edit_glasovanje(\'' . $rowA['spr_id'] . '\', document.getElementById("expire").value, \'expire\');
- }
- });
- </script>
- ';
- echo '<br/>';
-
- echo ' </fieldset>';
-
-
- //Izbira skina za glasovanje
-
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_themes'] . '</legend>';
-
- //izbira skina
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_theme'] . ':</label></span>';
-
- $dir = opendir($site_path . 'main/survey/skins/');
-
- echo '<select name="skin_anketa" id="skin_anketa" onChange="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'skin_anketa\')">' . NEW_LINE;
- while ($file = readdir($dir)) {
- if ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) == '.css')
- echo ' <option value="' . substr($file, 0, -4) . '"' . ($rowA['skin'] == substr($file, 0, -4) ? ' selected="selected"' : '') . '>' . substr($file, 0, -4) . '</option>' . NEW_LINE;
- elseif ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) != '.css') {
- if (is_file($site_path . 'main/survey/skins/' . $file . '/' . $file . '.css')) {
- echo ' <option value="' . $file . '"' . ($rowA['skin'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>' . NEW_LINE;
- }
- }
- }
- echo '</select><br>' . NEW_LINE;
-
-
- //izbira skina za statistiko
- echo '<span class="nastavitveSpan4"><label>' . $lang['glasovanja_stat_theme'] . ':</label></span>';
-
- $dir = opendir($site_path . 'main/survey/skins/glasovanje/');
-
- echo '<select name="skin" id="skin" onChange="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'skin\')">' . NEW_LINE;
- while ($file = readdir($dir)) {
- if ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) == '.css')
- echo ' <option value="' . substr($file, 0, -4) . '"' . ($row2['skin'] == substr($file, 0, -4) ? ' selected="selected"' : '') . '>' . substr($file, 0, -4) . '</option>' . NEW_LINE;
- elseif ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) != '.css') {
- if (is_file($site_path . 'main/survey/skins/' . $file . '/' . $file . '.css')) {
- echo ' <option value="' . $file . '"' . ($row2['skin'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>' . NEW_LINE;
- }
- }
- }
- echo '</select>' . NEW_LINE;
-
- echo '</fieldset>';
-
- echo '</div>';
-
- // gumb VEC
+ // gumb VEC
+ echo '<div class="expand_holder">';
if($displayExtra==1){
- echo '<span class="more" style="display:none;"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_more'].'</a></span>';
- echo '<span class="less"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_less'].'</a></span>';
+ echo '<span class="more" style="display:none;"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_publication_survey_settings_more'].'<span class="faicon arrow2_d"></span></a></span>';
+ echo '<span class="less"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_publication_survey_settings_less'].'<span class="faicon arrow2_u"></span></a></span>';
}
else{
- echo '<span class="more"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_more'].'</a></span>';
- echo '<span class="less" style="display:none;"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_less'].'</a></span>';
+ echo '<span class="more"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_publication_survey_settings_more'].'<span class="faicon arrow2_d"></span></a></span>';
+ echo '<span class="less" style="display:none;"><a href="#" onClick="glas_extra_settings();">'.$lang['srv_publication_survey_settings_less'].'<span class="faicon arrow2_u"></span></a></span>';
}
+ echo '</div>';
+
+
+ echo '<div id="glas_extra_settings" '.($displayExtra==0 ? ' style="display: none;"' : '').' >';
+
+ // TRAJANJE
+ echo '<fieldset>';
+
+ echo ' <div class="setting_row half-half">';
+ echo ' <div class="setting_title">' . $lang['srv_starts2'] . ':</div>';
+ echo ' <input id="starts" class="small" type="text" name="starts" value="' . date('d.m.Y', strtotime($rowA['starts'])) . '" disabled autocomplete="off">';
+ echo ' </div>';
+
+ echo ' <div class="setting_row half-half">';
+ echo ' <div class="setting_title">' . $lang['srv_expire2'] . ':</div>';
+ echo ' <input id="expire" class="small" type="text" name="expire" value="' . date('d.m.Y', strtotime($rowA['expire'])) . '" disabled autocomplete="off">';
+ echo ' </div>';
+
+ echo '<script type="text/javascript">
+
+ $(document).ready(function() {
+ $( "#starts" ).datepicker({
+ showOtherMonths: true,
+ selectOtherMonths: true,
+ changeMonth: true,
+ changeYear: true,
+ dateFormat: "dd.mm.yy",
+ showAnim: "slideDown",
+ showOn: "button",
+ buttonText: "",
+ onSelect: function(selected, evnt) {
+ edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'starts\')
+ }
+ });
+ $( "#expire" ).datepicker({
+ showOtherMonths: true,
+ selectOtherMonths: true,
+ changeMonth: true,
+ changeYear: true,
+ dateFormat: "dd.mm.yy",
+ showAnim: "slideDown",
+ showOn: "button",
+ buttonText: "",
+ onSelect: function(selected, evnt) {
+ edit_glasovanje(\'' . $rowA['spr_id'] . '\', this.value, \'expire\')
+ }
+ });
+ });
+ </script>';
+
+ echo ' </fieldset>';
+
+
+ // Izbira skina za glasovanje
+ echo '<fieldset>';
+
+ // Izbira skina za anketo
+ echo ' <div class="setting_row half-half">';
+ echo ' <div class="setting_title">' . $lang['glasovanja_theme2'] . '</div>';
+ echo ' <select name="skin_anketa" id="skin_anketa" class="dropdown small" onChange="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'skin_anketa\')">';
+
+ $st = new SurveyTheme();
+ $skins = $st->getGroups();
+ foreach ($skins['0']['skins'] as $key => $skin) {
+
+ $simple_name = preg_replace("/\.css$/", '', $skin);
+
+ // Default skin po novem izkljucimo
+ if ($simple_name != 'Default') {
+ echo ' <option value="'.$simple_name.'"' . ($rowA['skin'] == $simple_name ? ' selected="selected"' : '') . '>'.($simple_name == '1kaBlue' ? $simple_name.' (' . $lang['default'] . ')' : $simple_name).'</option>';
+ }
+ }
+
+ echo ' </select>';
+ echo ' </div>';
+
+
+ // Izbira skina za statistiko
+ echo ' <div class="setting_row half-half">';
+ echo ' <div class="setting_title">' . $lang['glasovanja_stat_theme2'] . ':</div>';
+ echo ' <select name="skin" id="skin" class="dropdown small" onChange="edit_glasovanje(\'' . $row2['spr_id'] . '\', this.value, \'skin\')">';
+ $dir = opendir($site_path . 'main/survey/skins/glasovanje/');
+ while ($file = readdir($dir)) {
+ if ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) == '.css')
+ echo ' <option value="' . substr($file, 0, -4) . '"' . ($row2['skin'] == substr($file, 0, -4) ? ' selected="selected"' : '') . '>' . substr($file, 0, -4) . '</option>';
+ elseif ($file != '.' && $file != '..' && $file != '.svn' && strtolower(substr($file, -4, 4)) != '.css') {
+ if (is_file($site_path . 'main/survey/skins/' . $file . '/' . $file . '.css')) {
+ echo ' <option value="' . $file . '"' . ($row2['skin'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>';
+ }
+ }
+ }
+ echo ' </select>';
+ echo ' </div>';
+
+ echo '</fieldset>';
+
+ echo '</div>';
}
/**
@@ -329,7 +342,7 @@ class Glasovanje {
$Branching = new Branching($this->anketa);
- echo '<li id="branching_'.$spremenljivka.'" class="spr">';
+ echo '<li id="branching_'.$spremenljivka.'" class="spr spr_tip_1">';
$Branching->vprasanje($spremenljivka);
@@ -389,15 +402,12 @@ class Glasovanje {
// <-- Editor teksta vprasanja ---
echo '<div class="spremenljivka_tekst_form">';
echo '<div class="naslov naslov_inline" contenteditable="'.(!$this->locked?'true':'false').'" spr_id="'.$id.'" tabindex="1" '.(strpos($text, $selectall)!==false?' default="1"':'').'>'.$text.'</div>';
- echo '<div class="clr"></div>';
+
// opomba
if ($opomba != '') {
- echo '<table style="margin-top:5px; width:100%"><tr>';
- echo '<td style="width:120px;">'.$lang['note'].' ('.$lang['srv_internal'].'):</td>';
- echo '<td >';
- echo '<span>'.$opomba.'</span>';
- echo '</td>';
- echo '</tr></table>';
+ echo '<div class="opomba_holder">';
+ echo '*'.$lang['note'].' ('.$lang['srv_internal'].'): '.$opomba;
+ echo '</div>';
}
echo '</div>';
@@ -441,12 +451,10 @@ class Glasovanje {
echo '<div id="editor_display_' . $id. '" class="editor_display" >';
echo '<div class="editor_display_small pointer lightRed" onclick="editor_display(\'' . $id . '\'); $(this).parent().hide();" style="width:auto;" title="'.$lang['srv_editor'].'">';
- //echo '<img src="img_' . $this->skin . '/settings.png" />';
echo $lang['srv_editor'] . '<span style="font-size: large;">&nbsp;&#187;</span>';
echo'</div>';
echo '</div>';
echo '<textarea name="naslov_' . $id . '" class="texteditor naslov" id="naslov_' . $id . '" >' . $text . '</textarea>';
- echo '<div class="clr"></div>';
// opomba
echo '<table style="margin-top:5px; width:100%"><tr>';
@@ -474,90 +482,12 @@ class Glasovanje {
echo '<div class="save_button">';
echo ' <span class="floatLeft spaceRight"><div class="buttonwrapper" id="save_button_'.$id.'" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="normalmode_introconcl(\''.$id.'\',\''.$editmode.'\',\''.$fullscreen.'\'); return false;"><span>';
- //echo '<img src="icons/icons/accept.png" alt="" vartical-align="middle" />';
- echo $lang['srv_potrdi'].'</span></a></div></span>';
- echo '</div>';
- echo '<div class="clr"></div>';
- }
- echo ' </div> <!-- /spremenljivka_content_'.$id.' -->'."\n\r";
-
-
-
-
-
-/*
- //if ($row['statistics'] == '') {
- // $text = $lang['results'];
- //} else {
- // $text = $row['statistics'];
- //}
- $text = $row['statistics'];
-
- echo ' <div id="spremenljivka_content_'.$id.'" class="spremenljivka_content'.($editmode==1?' active':'').'" spr_id="'.$id.'" '.($editmode==0?'onclick="editmode_introconcl(\''.$id.'\');"':'').'>'."\n\r";
-
- if ($editmode == 0) {
- // <-- Zgornja vrstica pri editiranju vprasanj ---
- echo '<div class="spremenljivka_settings spremenljivka_settings_active">';
- echo '<div style="float:left;width:auto;">';
- // variabla
- echo '<div class="variable_name" id="div_variable_'.$id.'">';
- echo $lang['srv_statistics_edit'];
- echo '</div>'."\n\r";
- echo '</div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- // --- Zgornja vrstica pri editiranju vprasanj -->
-
- // <-- Editor teksta vprasanja ---
- echo '<div class="spremenljivka_tekst_form">';
-
- echo '<span>'.$text.'</span>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
-
- // --- Editor teksta vprasanja -->
-
-
-
- echo '<div class="clr"></div>';
-
- }
- else {
-
- // <-- Zgornja vrstica pri editiranju vprasanj ---
- echo '<div class="spremenljivka_settings spremenljivka_settings_active">';
- echo '<div style="float:left;width:auto;">';
- // variabla
- echo '<div class="variable_name" id="div_variable_-3">';
- echo $lang['srv_statistics_edit'];
- echo '</div>'."\n\r";
- echo '</div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- // --- Zgornja vrstica pri editiranju vprasanj -->
-
- echo ' <form name="editintro_'.substr($id, 1, 1).'" action="" method="post">'."\n\r";
- // <-- Editor teksta vprasanja ---
- echo '<div class="spremenljivka_tekst_form">';
- echo '<div id="editor_display_'.$id.'" class="editor_display" onclick="editor_display(\''.$id.'\'); $(this).hide();"><small>Editor</small></div>';
- echo '<textarea name="naslov_'.$id.'" class="texteditor naslov" id="naslov_'.$id.'" >'.$text.'</textarea>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</form>';
-
- // --- Editor teksta vprasanja -->
-
- echo '<div class="save_button">';
- echo ' <span class="floatLeft spaceRight"><div class="buttonwrapper" id="save_button_'.$id.'" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="normalmode_introconcl(\''.$id.'\',\''.$editmode.'\',\''.$fullscreen.'\'); return false;"><span>';
echo $lang['srv_potrdi'].'</span></a></div></span>';
echo '</div>';
echo '<div class="clr"></div>';
}
echo ' </div> <!-- /spremenljivka_content_'.$id.' -->'."\n\r";
-*/
}
@@ -590,23 +520,20 @@ class Glasovanje {
else
sisplet_query("UPDATE srv_anketa SET show_concl='1' WHERE id = '$this->anketa'");
}
-
+ elseif($what == 'starts' || $what == 'expire') {
+ $results_date = date('Y-m-d', strtotime($results));
+ sisplet_query("UPDATE srv_anketa SET $what = '$results_date' WHERE id = '$this->anketa'");
+ }
elseif($what == 'show_intro' || $what == 'show_concl' || $what == 'cookie' || $what == 'user_from_cms' || $what == 'block_ip' || $what == 'starts' || $what == 'expire' || $what == 'vote_limit' || $what == 'vote_count' || $what == 'countType' || $what == 'progressbar') {
sisplet_query("UPDATE srv_anketa SET $what = '$results' WHERE id = '$this->anketa'");
}
-
elseif($what == 'survey_hide_title') {
SurveySetting::getInstance()->Init($this->anketa);
SurveySetting::getInstance()->setSurveyMiscSetting('survey_hide_title', $results);
}
-
elseif($what == 'finish_author' || $what == 'finish_respondent_cms' || $what == 'finish_other' | $what == 'finish_other_emails') {
- sisplet_query("INSERT INTO srv_alert (ank_id, $what) VALUES ('$this->anketa', '$results')
- ON DUPLICATE KEY UPDATE $what = '$results' ");
-
- //sisplet_query("UPDATE srv_alert SET $what = '$results' WHERE ank_id = '$this->anketa'");
- }
-
+ sisplet_query("INSERT INTO srv_alert (ank_id, $what) VALUES ('$this->anketa', '$results') ON DUPLICATE KEY UPDATE $what = '$results' ");
+ }
elseif($what == 'akronim') {
if($results == 0)
sisplet_query("UPDATE srv_anketa SET $what = ' ' WHERE id = '$this->anketa'");
@@ -615,11 +542,9 @@ class Glasovanje {
else
sisplet_query("UPDATE srv_anketa SET $what = '$lang[poll]' WHERE id = '$this->anketa'");
}
-
elseif($what == 'skin_anketa') {
sisplet_query("UPDATE srv_anketa SET skin = '$results' WHERE id = '$this->anketa'");
}
-
elseif($what == 'embed'){
sisplet_query("UPDATE srv_glasovanje SET $what = '$results' WHERE spr_id = '$spremenljivka'");
@@ -636,7 +561,6 @@ class Glasovanje {
sisplet_query("UPDATE srv_anketa SET skin='Default', concl_end_button='1', concl_back_button='1' WHERE id = '$this->anketa'");
}
}
-
else{
sisplet_query("UPDATE srv_glasovanje SET $what = '$results' WHERE spr_id = '$spremenljivka'");
}
diff --git a/admin/survey/R/class.SurveyAnalysisR.php b/admin/survey/R/class.SurveyAnalysisR.php
index 8a594af..53d5c09 100644
--- a/admin/survey/R/class.SurveyAnalysisR.php
+++ b/admin/survey/R/class.SurveyAnalysisR.php
@@ -52,7 +52,7 @@ class SurveyAnalysisR {
// variable pri katerih upostevamo delez
$delezVar = 0;
- if(count($delezVars) > 0){
+ if(isset($delezVars)&&count($delezVars) > 0){
// Gre za checkbox
if($delezVars == -1){
@@ -88,12 +88,12 @@ class SurveyAnalysisR {
}
// Napolnimo podatke iz vrnjenega rezultata
- function parseMultiCrosstabResults($out, $avgVar=0, $delezVar=0){
+ function parseMultiCrosstabResults($out='', $avgVar=0, $delezVar=0){
$results = array();
// Razbijemo na variable, podatke in vsote
- $strings = explode("--", $out);
+ $strings = explode("--", isset($out)?$out:'');
// VARIABLE shranimo v array
@@ -106,9 +106,10 @@ class SurveyAnalysisR {
// PODATKE shranimo v array
- $tempData = explode("_", $strings[1]);
- $tempAvgData = explode("_", $strings[6]);
- $tempDelezData = ($avgVar == 1) ? explode("_", $strings[7]) : explode("_", $strings[6]);
+ $tempData = isset($strings[1])?explode("_", $strings[1]):array("");
+ $tempAvgData = isset($strings[6])?explode("_", $strings[6]):array("");
+ $tempDelezData = ($avgVar == 1 && isset($strings[7])) ? explode("_", $strings[7]) : $tempAvgData;
+
$data = array();
$avgData = array();
$delezData = array();
@@ -261,7 +262,7 @@ class SurveyAnalysisR {
// X^2
- $x2 = $strings[5];
+ $x2 = isset($strings[5])?$strings[5]:'';
$results['hi2'] = (float)$x2;
@@ -304,38 +305,39 @@ class SurveyAnalysisR {
$results = array();
-
- // Razbijemo na variable, podatke in vsote
- $strings = explode("--", $out);
+ if($out!=null){
+ // Razbijemo na variable, podatke in vsote
+ $strings = explode("--", $out);
- // Vrednosti prve variable
- $vals1 = explode("_", $strings[0]);
- $results['1'] = array(
- 'n' => (int)$vals1[0],
- 'x' => (float)$vals1[1],
- 's2' => (float)$vals1[2],
- 'se' => (float)$vals1[3],
- 'se2' => (float)$vals1[4],
- 'margin' => (float)$vals1[5]
- );
-
- // Vrednosti druge variable
- $vals2 = explode("_", $strings[1]);
- $results['2'] = array(
- 'n' => (int)$vals2[0],
- 'x' => (float)$vals2[1],
- 's2' => (float)$vals2[2],
- 'se' => (float)$vals2[3],
- 'se2' => (float)$vals2[4],
- 'margin' => (float)$vals2[5]
- );
+ // Vrednosti prve variable
+ $vals1 = explode("_", $strings[0]);
+ $results['1'] = array(
+ 'n' => (int)$vals1[0],
+ 'x' => (float)$vals1[1],
+ 's2' => (float)$vals1[2],
+ 'se' => (float)$vals1[3],
+ 'se2' => (float)$vals1[4],
+ 'margin' => (float)$vals1[5]
+ );
+
+ // Vrednosti druge variable
+ $vals2 = explode("_", $strings[1]);
+ $results['2'] = array(
+ 'n' => (int)$vals2[0],
+ 'x' => (float)$vals2[1],
+ 's2' => (float)$vals2[2],
+ 'se' => (float)$vals2[3],
+ 'se2' => (float)$vals2[4],
+ 'margin' => (float)$vals2[5]
+ );
- // Skupne vrednosti
- $vals = explode("_", $strings[2]);
- $results['d'] = (float)$vals[0];
- $results['sed'] = (float)$vals[1];
- $results['t'] = (float)$vals[2];
- $results['sig'] = (float)$vals[3];
+ // Skupne vrednosti
+ $vals = explode("_", $strings[2]);
+ $results['d'] = (float)$vals[0];
+ $results['sed'] = (float)$vals[1];
+ $results['t'] = (float)$vals[2];
+ $results['sig'] = (float)$vals[3];
+ }
return $results;
diff --git a/admin/survey/SurveyAdmin.php b/admin/survey/SurveyAdmin.php
index 98555ce..c438167 100644
--- a/admin/survey/SurveyAdmin.php
+++ b/admin/survey/SurveyAdmin.php
@@ -40,6 +40,7 @@
* voting (volitve z anonimnimi vabili)
* uporabnost (evalvacija strani - split screen)
* panel (povezovanje ankete s panelom - npr. Valicon, GFK...)
+ * email_access (enkratni dostop do ankete z emailom - narejeno za mju po narocilu)
* 360_stopinj (adecco)
* 360_stopinj_1ka
* evoli
@@ -81,10 +82,10 @@ define("M_REPORT_TOTAL", "total");
define("SRV_DEVELOPMENT_VERSION", true);
// tipi uporabnikov, (za kontrolo prikaza posameznih elementov) za preverjanje kličemo funkcijo user_role_cehck
-define("U_ROLE_ADMIN", 0);
-define("U_ROLE_MANAGER", 1);
-define("U_ROLE_CLAN", 2);
-define("U_ROLE_NAROCNIK", 3);
+if (!defined('U_ROLE_ADMIN')) define("U_ROLE_ADMIN", 0);
+if (!defined('U_ROLE_MANAGER')) define("U_ROLE_MANAGER", 1);
+if (!defined('U_ROLE_CLAN')) define("U_ROLE_CLAN", 2);
+if (!defined('U_ROLE_NAROCNIK')) define("U_ROLE_NAROCNIK", 3);
global $site_path;
@@ -110,6 +111,14 @@ class SurveyAdmin
var $full_screen_edit = false; # ali ima uporabnik nastavljeno da ureja vprašanja v fullscreen načinu
var $isAnketar = false; # Ali je uporabnik anketar ankete privzeto je ne
+ var $first_action = ''; // Prvi nivo navigacije kjer se nahajamo
+ var $second_action = ''; // Drugi nivo navigacije kjer se nahajamo
+ var $third_action = ''; // Tretji nivo navigacije kjer se nahajamo
+
+ var $layout_width = ''; // Layout strani kjer se nahajamo - "fullwidth", "wide" ali "narrow"
+ var $layout_menu = ''; // Layout strani kjer se nahajamo - "menu_lef" (prisoten levi meni)
+
+
/**
* @desc konstruktor
*/
@@ -153,8 +162,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);
@@ -168,9 +176,10 @@ class SurveyAdmin
header('location: ' . $site_url . 'admin/survey/index.php');
}
else {
- // preverimo userjev dostop
- //if ($this->checkDostop() || $this->checkDostopAktiven() || $_GET['a'] == A_ANALYSIS || $_GET['a'] == 'analiza' || $_GET['a'] == 'analizaReloadData' || $_GET['t'] == A_ANALYSIS || $_GET['a'] == A_REPORTI) {
- if ($this->checkDostop() && ($this->isAnketar || $this->checkDostopAktiven() || $_GET['a']==A_ANALYSIS || $_GET['a']=='analiza' || $_GET['a']=='analizaReloadData' || $_GET['t']==A_ANALYSIS || $_GET['a']==A_REPORTI)) {
+ // preverimo userjev dostop - ZAKAJ SMO TUKAJ IMELI DODATNE POGOJE??? NEKDO BREZ DOSTOPA DO ANKETE NE MORE KAR VEDNO DOSTOPATI DO ANALIZ
+ //if ($this->checkDostop() || $_GET['a'] == A_ANALYSIS || $_GET['a'] == 'analiza' || $_GET['a'] == 'analizaReloadData' || $_GET['t'] == A_ANALYSIS || $_GET['a'] == A_REPORTI) {
+ //if ($this->checkDostop() && ($this->isAnketar || $this->checkDostopAktiven() || $_GET['a']=='redirectLink' || $_GET['a']==A_ANALYSIS || $_GET['a']=='analiza' || $_GET['a']=='analizaReloadData' || $_GET['t']==A_ANALYSIS || $_GET['a']==A_REPORTI)) {
+ if ($this->checkDostop()){
// pasivne uporabnike preusmerimo na status tudi pri neaktivni anketi
if ($this->checkDostop() && !$this->checkDostopAktiven() && !isset($_GET['a'])) {
@@ -212,6 +221,7 @@ class SurveyAdmin
echo '<form name="meta" action="" style="display:none">';
echo '<input type="hidden" name="anketa" id="srv_meta_anketa_id" value="' . $this->anketa . '" />';
+ echo '<input type="hidden" name="anketa_hash" id="srv_meta_anketa_hash" value="' . SurveyInfo::getInstance()->getSurveyHash() . '" />';
echo '<input type="hidden" name="srv_site_url" id="srv_site_url" value="' . $site_url . '" />';
echo '<input type="hidden" name="grupa" id="srv_meta_grupa" value="' . $this->grupa . '" />';
echo '<input type="hidden" name="branching" id="srv_meta_branching" value="' . $this->branching . '" />';
@@ -221,8 +231,7 @@ class SurveyAdmin
echo '<input type="hidden" name="editing_mode" id="editing_mode" value="1" />';
// Ce imamo vklopljene komercialne pakete
- global $app_settings;
- if($app_settings['commercial_packages']){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
$userAccess = UserAccess::getInstance($global_user_id);
// Ce gre za staro anketo nimamo omejitev
@@ -265,7 +274,18 @@ class SurveyAdmin
global $lang;
global $admin_type;
global $site_domain;
- global $aai_instalacija;
+
+
+ // prvi in drugi nivo (tretji samo za mobilno navigacijo)
+ $navigationArray = CrossRoad::MainNavigation($this->anketa, true);
+ $this->first_action = $navigationArray['first_action'];
+ $this->second_action = $navigationArray['second_action'];
+ $this->third_action = $navigationArray['third_action'];
+
+ // Layout strani
+ $this->layout_width = $navigationArray['layout_width'];
+ $this->layout_menu = $navigationArray['layout_menu'];
+ $this->hide_header = $navigationArray['hide_header'];
echo '<div id="main_holder">';
@@ -275,20 +295,11 @@ class SurveyAdmin
echo '<header>';
// DESKTOP HEADER
- echo '<div class="desktop_header">';
-
- // Nastavitve zgoraj desno v headerju (search, help, profil...)
- $this->displayHeaderRight();
-
- // logotip
- $this->displayHeaderLogo();
+ echo '<div class="desktop_header '.(($this->hide_header == "hide_header") ? 'displayNone' : '').'">';
// Znotraj posamezne ankete
if($this->anketa > 0){
- // Utripajoc napis "Demo anketa"
- $this->displayHeaderDemoSurvey();
-
// Prikaze podatke o anketi in navigacijo - na vrhu (top bar)
$this->displayHeaderAnketa();
}
@@ -312,7 +323,7 @@ class SurveyAdmin
/********************* MAIN *********************/
- echo '<div id="main">';
+ echo '<div id="main" class="'.$this->hide_header.'">';
// SEZNAM ANKET - Ce ni nastavljene ankete, potem prikazujemo seznam na prvi strani *****/
if (!($this->anketa > 0)) {
@@ -320,9 +331,29 @@ class SurveyAdmin
}
// ZNOTRAJ ANKETE
else{
- echo '<div id="anketa">';
+ echo '<div id="anketa">';
+
+ // breadcrumbs
+ echo '<div class="breadcrumbs">';
+
+ if ((isset($_GET['a']) && $this->first_action == 'NAVI_STATUS')? $breadcrumbs_a = '_' . $_GET['a'] : $breadcrumbs_a = '');
+ if ((isset($_GET['m']) && $this->first_action == 'NAVI_ANALYSIS' && $_GET['m'] == 'charts')? $breadcrumbs_m = '_' . $_GET['m'] : $breadcrumbs_m = '');
+
+ if(isset($lang['navigation_'.$this->first_action])){
+ echo $lang['navigation_'.$this->first_action];
+
+ if(isset($lang['navigation_'.$this->second_action.$breadcrumbs_a.$breadcrumbs_m]))
+ echo ' > ' . $lang['navigation_'.$this->second_action.$breadcrumbs_a.$breadcrumbs_m];
+
+ if (isset($this->third_action) && $this->third_action != '') {
+ echo ' > '.(isset($lang['navigation_'.$this->third_action]) ? $lang['navigation_'.$this->third_action] : '');
+ }
+ }
+
+ echo '</div>';
- echo '<div id="anketa_edit" class="page_'.$_GET['a'].' subpage_'.$_GET['m'].' '.($this->survey_type == '1' ? 'forma' : '').' '.($this->survey_type == '0' ? 'glasovanje' : '').'">';
+
+ echo '<div id="anketa_edit" class="page_'.$_GET['a'].' subpage_'.$_GET['m'].' '.($this->survey_type == '1' ? 'forma' : '').' '.($this->survey_type == '0' ? 'glasovanje' : '').' '.$this->layout_width.' '.$this->layout_menu.'">';
$this->displayAnketa();
echo '</div>';
@@ -342,6 +373,12 @@ class SurveyAdmin
echo '</div> <!-- /main_holder -->';
+
+
+ // Preklop domene - javimo popup
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->visibleSwitchPopup()){
+ echo '<script> popupSwitch(); </script>';
+ }
}
@@ -350,15 +387,27 @@ class SurveyAdmin
global $lang;
- // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete
- $this->getTipPreviewHtml();
-
-
// Loading ikona
echo ' <div id="loading">';
- echo ' <span class="faicon spinner fa-spin spaceRight"></span> '.$lang['srv_saving'];
+ echo ' <span class="faicon spinner fa-spin"></span>';
+ echo ' <span class="text">'.$lang['srv_saving'].'</span>';
echo ' </div> <!-- /loading -->';
+
+ // Okencki spodaj levo
+ echo '<div class="bottom_left_popup_holder">';
+
+ // Trenutno aktivni uredniki
+ echo ' <div id="active_editors_holder">';
+ $this->check_online_users();
+ echo ' </div>';
+
+ // Obvestilo o akciji (success...) spodaj levo
+ echo ' <div id="action_note_holder"></div>';
+
+ echo '</div>';
+
+
echo ' <div id="clipboard">';
$this->clipboard_display();
echo ' </div> <!-- /clipboard -->';
@@ -372,7 +421,7 @@ class SurveyAdmin
echo '<div class="popup_holder">';
// div za setiranje trajanja ankete ob aktiviranju
- echo '<div id="surveyTrajanje" class="divPopUp">';
+ echo '<div id="surveyTrajanje" class="divPopUp PopUpNarrow">';
echo ' <div id="surveyTrajanje_msg">&nbsp;</div>';
echo '</div> <!-- /surveyTrajanje -->';
@@ -395,7 +444,13 @@ class SurveyAdmin
// Generičen popup
- echo '<div id="popup_note" class="divPopUp"></div>';
+ echo '<div id="general_popup" class="divPopUp"></div>';
+
+ // Popup za analize
+ echo '<div id="analysis_popup" class="divPopUp"></div>';
+
+ // Knjiznica popup
+ echo '<div id="library_popup" class="divPopUp"></div>';
// urejanje calculation-ov
echo '<div id="calculation" class="divPopUp"></div>';
@@ -405,10 +460,10 @@ class SurveyAdmin
echo '<div id="alert_close_block" class="divPopUp"></div>';
- echo '<div id="div_status_values" class="divPopUp"></div>';
+ echo '<div id="div_status_values" class="divPopUp PopUpNarrow"></div>';
// div za prikaz neprebranih sporocil
- echo '<div id="unread_notifications" class="divPopUp"></div>';
+ echo '<div id="unread_notifications" class="divPopUp PopUpNarrow"></div>';
// div za uvoz vprasanj iz texta
echo '<div id="popup_import_from_text" class="divPopUp"></div>';
@@ -416,17 +471,12 @@ class SurveyAdmin
// div za opozorilo, da funkcionalnost ni na voljo v paketu
echo '<div id="popup_user_access" class="divPopUp"></div>';
- // alert za paste from Word
- echo '<div id="pasteFromWordAlert" class="divPopUp">';
- echo $lang['pasteFromWordAlert'];
- echo '</div>';
-
// Alert
echo '<div id="dropped_alert" class="divPopUp"></div>';
// Preverjanje pravilnosti pogojev
- echo '<div id="check_pogoji" class="divPopUp"></div>';
+ echo '<div id="check_pogoji" class="divPopUp PopUpNarrow"></div>';
// ANALIZE
@@ -437,7 +487,7 @@ class SurveyAdmin
echo '<div id="zoom_div" class="divPopUp"></div>';
# skrit div za izbor profilov nastavitev
- echo '<div id="inspect_div" class="divPopUp"></div>';
+ echo '<div id="inspect_div" class="divPopUp PopUpNarrow"></div>';
# skrit div za izbor profilov zank
echo '<div id="div_zanka_profiles" class="divPopUp"></div>';
@@ -458,24 +508,27 @@ class SurveyAdmin
echo '<div id="chart_float_editing" class="divPopUp"></div>';
//div za opozorilo pri vkljucevanju v report
- echo '<div id="custom_report_alert" class="divPopUp"></div>';
+ echo '<div id="custom_report_alert" class="divPopUp PopUpNarrow"></div>';
// Skriti divi za profile
- echo '<div id="div_creport_settings_profiles" class="divPopUp"></div>';
+ echo '<div id="div_creport_settings_profiles" class="divPopUp PopUpNarrow"></div>';
// Creport
- echo '<div id="div_mc_tables" class="divPopUp"></div>';
+ echo '<div id="div_mc_tables" class="divPopUp PopUpNarrow"></div>';
// REKODIRANJE
- echo '<div id="question_recode" class="divPopUp"></div>';
+ echo '<div id="question_recode" class="divPopUp PopUpNarrow"></div>';
echo '<div id="question_recode_run_note" class="divPopUp"></div>';
// NAROCILA in PLACILA
echo '<div id="user_narocila_popup" class="user_narocila_popup divPopUp"></div>';
echo '<div id="user_placila_popup" class="user_placila_popup divPopUp"></div>';
+
+ //Telefonska anketa
+ echo '<div id="telephone_popup" class="divPopUp PopUpNarrow"></div>';
echo '</div>';
@@ -483,141 +536,16 @@ class SurveyAdmin
}
- // Prikazemo podatke zgoraj desno v glavi (search, user, help)
- private function displayHeaderRight(){
- global $site_url;
- global $global_user_id;
- global $lang;
-
-
- // user navigacija
- echo '<div id="enka_nav">';
-
-
- // Gumb za nadgraditev paketa v mojih anketah (ce imamo vklopljene pakete in nimamo 3ka paketa)
- if($this->anketa == 0){
-
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
-
- // Preverimo trenuten paket uporabnika
- $userAccess = UserAccess::getInstance($global_user_id);
- $current_package = $userAccess->getPackage();
- if($current_package != '3' && !$userAccess->userNotAuthor()){
-
- $drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/';
- $upgrade_url = $drupal_url.'izvedi-nakup/3/podatki';
-
- $button_text = ($current_package == '2') ? $lang['srv_access_upgrade2'] : $lang['srv_access_upgrade'];
-
- echo '<div class="upgrade_package">';
- echo '<div class="buttonwrapper"><a class="ovalbutton ovalbutton_purple" href="'.$upgrade_url.'" target="_blank"><span>'.$button_text.'</span></a></div>';
- echo '</div>';
- }
- }
- }
-
-
- // Search po zunanji lupini - preusmeri na drupalov search
- echo '<div id="search_holder">';
-
- if($lang['id'] != "1")
- $drupal_search_url = 'https://www.1ka.si/d/en/iskanje/';
- else
- $drupal_search_url = 'https://www.1ka.si/d/sl/iskanje/';
-
- echo '<form method="GET" id="1kasf" action="'.$drupal_search_url.'">';
-
- echo '<input type="hidden" id="drupal_search_url" name="drupal_search_url" value="'.$drupal_search_url.'" />';
-
- echo '<a href="#" onclick="showSearch();"><span class="faicon search pointer"></span></a> ';
- echo '<input id="searchSurvey" type="text" value="" placeholder="' . $lang['s_search_frontend'] . '" name="search" />';
- echo '<input type="button" style="display: none;" value="' . $lang['s_search'] . '" />';
-
- echo '</form>';
-
- echo '</div>';
-
-
- // Hitra pomoč - povezave na linke s pomočjo na www.1ka.si
- $subdomain = ($lang['id'] == "1") ? 'www' : 'english';
- $help_url = Common::getHelpUrl($subdomain, $this->first_action);
- echo '<div id="help_holder">';
- echo ' <a href="' . $help_url . '" title="' . $lang['srv_settings_help'] . '" target="_blank">';
- echo '<span class="faicon help2"></span>';
- echo '</a> ';
- echo '</div>';
-
-
- // povezava na fieldwork sync
- if ($this->anketa > 0) {
-
- // poglej če je tale ID ankete v srv_fieldwork
- $sql = sisplet_query("SELECT id FROM srv_fieldwork where sid_server='" . $this->anketa . "'");
- if (mysqli_num_rows($sql) > 0) {
- // nariši link.
- echo '<div id="fieldwork_holder">';
-
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_FIELDWORK . '" title="' . $lang['srv_vrsta_survey_type_13'] . '">';
- echo '<span class="sprites fieldwork"></span>';
- echo '</a> ';
-
- echo '</div>';
- }
- }
-
-
- // User profil
- $sql = $this->db_select_user($global_user_id);
- $row = mysqli_fetch_array($sql);
-
- $text = $row['name'] . ' ' . $row['surname'];
- $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text;
-
- echo '<div id="xtradiv"><strong class="xtraname">'.$text.' <span class="faicon after sort_down_arrow"/></strong>';
- echo '<div id="xtradivSettings">';
-
- echo '<span class="xtraSetting"><a class="xtra" href="' . $site_url . 'admin/survey/index.php?a=nastavitve&m=global_user_myProfile"><span class="faicon user"></span>' . $lang['edit_data'] . '</a></span>';
-
- // Odjava na nov nacin preko frontend/api
- echo '<form name="odjava" id="form_odjava_desktop" method="post" action="'.$site_url.'frontend/api/api.php?action=logout">';
- echo '<span class="xtraSetting"><a class="xtra" href="#" onClick="$(\'#form_odjava_desktop\').submit();"><span class="faicon logout"></span>' . $lang['logout'] . '</a></span>';
- echo '</form>';
-
- echo '</div>';
- echo '</div>';
-
-
- echo '</div>';
- }
-
- // Prikazemo logo zgoraj levo
- public function displayHeaderLogo(){
- global $lang;
- global $site_url;
-
- echo '<div id="logo">';
-
- $logo_class = ($lang['id'] != "1") ? ' class="english"' : '';
- $su = ($site_url == "https://www.1ka.si/" && $lang['id'] != "1") ? "https://www.1ka.si/d/en/" : $site_url;
-
- echo '<a href="' . $su . '" title="' . $lang['srv_1cs'] . '" id="enka_logo" ' . $logo_class . '></a>';
-
- echo '</div>';
- }
-
// Utripajoc napis "Demo anketa"
private function displayHeaderDemoSurvey(){
global $lang;
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
- if ($row['invisible'] == 1 && !Dostop::isMetaAdmin()) {
-
+ // Demo anketa utripanje
+ if (!Dostop::isMetaAdmin()) {
echo '<div id="invisible-layer"></div>';
echo '<div id="invisible-close" onClick="window.close(); return false;"><span>' . $lang['srv_close_invisible'] . '</span></div>';
- ?> <script> $('#invisible-close span').effect("pulsate", {times: 3}, 2000); </script> <?
+ ?> <script> $('#invisible-close span').effect("pulsate", {times: 5}, 2000); </script> <?
}
}
@@ -626,19 +554,22 @@ class SurveyAdmin
global $lang;
global $site_url;
- // Aktivacija ankete, preview...
- echo '<div id="anketa_active" class="newCss '.substr($lang['language'], 0, 3).'">';
- $this->anketa_active();
- echo '</div> <!-- /anketa_active -->';
+ // Zgornja vrstica v headerju
+ $this->displayHeaderTopLine();
// Prvi nivo navigacije
$this->showMainNavigation();
- // Drugi nivo navigacije
- $this->secondNavigation();
+ // Preverimo, ce ima uporabnik dostop do te podstrani
+ $d = new Dostop();
+ if($d->checkDostopSubFromNavigation($this->first_action)){
+
+ // Drugi nivo navigacije
+ $this->secondNavigation();
- // Tretji nivo navigacije po potrebi glede na podstran
- $this->thirdNavigation();
+ // Tretji nivo navigacije po potrebi glede na podstran
+ $this->thirdNavigation();
+ }
}
/**
@@ -646,7 +577,8 @@ class SurveyAdmin
*
*/
private function displayHeaderSeznamAnket(){
- global $lang, $site_url, $global_user_id, $admin_type, $site_domain;
+ global $lang, $site_url, $global_user_id, $admin_type, $site_domain, $cookie_domain;
+
// Pobrisemo vse preview vnose
Common::deletePreviewData($this->anketa);
@@ -670,118 +602,204 @@ class SurveyAdmin
}
// GDPR popup za prejemanje obvestil - force ce ga se ni izpolnil - SAMO NA www.1ka.si, test.1ka.si in virtualkah
- if (($site_url == 'https://www.1ka.si/' || $site_url == 'http://test.1ka.si/' || $site_url == 'https://1ka.arnes.si/' || ($cookie_domain == '.1ka.si' && $virtual_domain == true))
- && User::getInstance()->getSetting($setting='gdpr_agree') == '-1') {
+ if ( ($site_url == 'http://test.1ka.si/'
+ || isWWW()
+ || isAAI()
+ || ($cookie_domain == '.1ka.si' && isVirtual()))
+ && User::getInstance()->getSetting($setting='gdpr_agree') == '-1'
+ ) {
// Avtomatsko prikazemo po loadu
echo '<script>$(document).ready(function(){showGDPRMessage();})</script>';
}
- echo '<div id="anketa_active" class="folders">';
-
- echo ' <div id="topLine2">&nbsp;</div>';
+ // Zgornja vrstica v headerju
+ $this->displayHeaderTopLine($class='folders');
+ // Navigacija
echo ' <div id="surveyNavigation">';
$SL->display_tabs();
echo ' </div>';
-
- echo '</div>';
-
# smo v knjižnici
$SL->display_sub_tabs();
}
+ public function displayHeaderTopLine($class=''){
+ global $lang, $site_url, $global_user_id, $admin_type, $site_domain;
+
+ echo '<div id="top_line" class="'.$class.'">';
- // Priakz footerja
- private function displayFooter(){
- global $lang;
- global $app_settings;
- global $site_frontend;
- global $aai_instalacija;
- global $mysql_database_name;
+ // logotip
+ $this->displayHeaderLogo();
+ // Nastavitve ankete
+ if($class != 'folders')
+ $this->displayHeaderAnketaSettings();
- echo '<footer id="srv_footer">';
-
+ // Nastavitve zgoraj desno v headerju (search, help, profil...)
+ $this->displayHeaderRight();
- // Leva stran footerja
- echo '<div class="footer_left">';
-
- // Custom footer
- if(isset($app_settings['footer_custom']) && $app_settings['footer_custom'] == 1){
- echo $app_settings['footer_text'];
+ // Utripajoc napis "Demo anketa"
+ if(isDemoSurvey($this->anketa)){
+ $this->displayHeaderDemoSurvey();
}
- // Default footer
- else{
- echo $lang['srv_footer_links'];
- if(isset($aai_instalacija) && $aai_instalacija == true){
- echo ' | <a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank">'.$lang['aa4'].'</a>';
- }
+ echo '</div>';
+ }
+
+ // Prikazemo podatke zgoraj desno v glavi (search, user, help)
+ private function displayHeaderRight(){
+ global $site_url;
+ global $global_user_id;
+ global $lang;
- echo '<br />';
- // Verzijo izpišemo samo za admine
- if ($admin_type == 0) {
+ // user navigacija
+ echo '<div id="enka_nav">';
- // Verzija 1ka
- $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what='version'", "obj");
- if (!empty($sqlVersion)) {
- echo $lang['srv_footer_1ka_version'].': ' . $sqlVersion->value . ' | ';
- }
- // Verzija Drupal
- if ($site_frontend == 'drupal') {
- $sqlDrupal = sisplet_query("SELECT value FROM misc WHERE what='drupal version'", "obj");
- if (!empty($sqlDrupal)) {
- echo 'Drupal: ' . $sqlDrupal->value . ' | ';
- }
+ // Gumb za nadgraditev paketa v mojih anketah (ce imamo vklopljene pakete in nimamo 3ka paketa)
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
+ // Preverimo trenuten paket uporabnika
+ $userAccess = UserAccess::getInstance($global_user_id);
+ $current_package = $userAccess->getPackage();
+ if($current_package != '3' && !$userAccess->userNotAuthor() && !isDemoSurvey($this->anketa)){
+
+ $drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/';
+ $upgrade_url = $drupal_url.'izvedi-nakup/3/podatki';
+
+ $button_text = ($current_package == '2') ? $lang['srv_access_upgrade2'] : $lang['srv_access_upgrade'];
+
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ /*echo '<div class="anketa_header_upgrade_package">';
+ echo ' <a href="'.$upgrade_url.'"><button class="small yellow">'.$button_text.'</button></a>';
+ echo '</div>';*/
+ }
+ else{
+ echo '<div class="anketa_header_upgrade_package">';
+ echo ' <a href="'.$upgrade_url.'"><button class="small yellow">'.$button_text.'</button></a>';
+ echo '</div>';
}
}
-
- echo 'Copyright (©) 2002-'.date('Y').' '.$lang['srv_footer_copyright'];
}
+
+ // Grid vseh linkov za pomoc, cenik,...
+ echo '<div id="link_grid_holder" class="setting_box tooltip">';
+ echo ' <a>';
+ echo ' <span class="faicon grid"></span>';
+ echo ' </a> ';
+ echo ' <div class="expanded-tooltip bottom big left" id="link_grid_content">';
+ $this->tooltip_link_grid();
+ echo ' </div>';
echo '</div>';
- // Desna stran footerja - report a bug
- echo '<div id="reportabug" class="footer_right">';
-
- // www.1ka.si ima se link na go instrukcije
- if($mysql_database_name == 'real1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'test21kasi'){
+ // Search po zunanji lupini - preusmeri na drupalov search
+ echo '<div id="search_holder" class="setting_box">';
- echo '<a href="#" onClick="consultingPopupOpen();"><span class="faicon external_link"></span> '.$lang['srv_svetovanje'].'</a>';
- echo '<br>';
- }
+ if($lang['id'] != "1")
+ $drupal_search_url = 'https://www.1ka.si/d/en/iskanje/';
+ else
+ $drupal_search_url = 'https://www.1ka.si/d/sl/iskanje/';
+
+ echo '<form method="GET" id="1kasf" action="'.$drupal_search_url.'">';
- // Posebej report buga za gorenje
- if (Common::checkModule('gorenje')){
- echo '<a href="https://helpdesk.gorenje.com/SubmitSR.jsp" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
- }
- elseif(isset($aai_instalacija) && $aai_instalacija == true){
- echo '<a href="https://www.1ka.si/help1KA" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
- }
- else{
- // Slovenski jezik
- if ($lang['id'] == 1)
- echo '<a href="https://www.1ka.si/a/72864?Q1=292032" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
- // Angleski jezik
- else
- echo '<a href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
- }
+ echo '<input type="hidden" id="drupal_search_url" name="drupal_search_url" value="'.$drupal_search_url.'" />';
+
+ echo '<a href="#" onclick="showSearch();" title="' . $lang['s_search_frontend'] . '"><span class="faicon search pointer"></span></a> ';
+ echo '<input id="searchSurvey" type="text" value="" placeholder="' . $lang['s_search_frontend'] . '" name="search" />';
+ echo '<input type="button" style="display: none;" value="' . $lang['s_search'] . '" />';
+
+ echo '</form>';
echo '</div>';
+
+
+ // Hitra pomoč - povezave na linke s pomočjo na www.1ka.si
+ $subdomain = ($lang['id'] == "1") ? 'www' : 'english';
+ $help_url = Common::getHelpUrl($subdomain, $this->first_action);
+ echo '<div id="help_holder" class="setting_box">';
+ echo ' <a href="' . $help_url . '" title="' . $lang['srv_settings_help'] . '" target="_blank">';
+ echo ' <span class="faicon help2"></span>';
+ echo ' </a> ';
+ echo '</div>';
+
+
+ // povezava na fieldwork sync
+ if ($this->anketa > 0) {
+
+ // poglej če je tale ID ankete v srv_fieldwork
+ $sql = sisplet_query("SELECT id FROM srv_fieldwork where sid_server='" . $this->anketa . "'");
+ if (mysqli_num_rows($sql) > 0) {
+ // nariši link.
+ echo '<div id="fieldwork_holder">';
+
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_FIELDWORK . '" title="' . $lang['srv_vrsta_survey_type_13'] . '">';
+ echo '<span class="sprites fieldwork"></span>';
+ echo '</a> ';
+
+ echo '</div>';
+ }
+ }
+
+
+ // User profil
+ $sql = $this->db_select_user($global_user_id);
+ $row = mysqli_fetch_array($sql);
+
+ $text = $row['name'] . ' ' . $row['surname'];
+ $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text;
+
+ echo '<div id="xtradiv"><strong class="xtraname">'.$text.' <span class="faicon arrow2_d small" /></strong>';
+
+ echo '<div id="xtradivSettings"><ul>';
+
+ echo '<li><a class="xtra" href="' . $site_url . 'admin/survey/index.php?a=nastavitve&m=global_user_myProfile"><span class="faicon user"></span>' . $lang['edit_data'] . '</a></li>';
+
+ // Odjava na nov nacin preko frontend/api
+ echo '<li>';
+ echo ' <form name="odjava" id="form_odjava_desktop" method="post" action="'.$site_url.'frontend/api/api.php?action=logout">';
+ echo ' <a class="xtra" href="#" onClick="$(\'#form_odjava_desktop\').submit();"><span class="faicon logout"></span>' . $lang['logout'] . '</a>';
+ echo ' </form>';
+ echo '</li>';
+
+ echo '</ul></div>';
+ echo '</div>';
+
- echo '</footer>';
+ echo '</div>';
}
+ // Prikazemo logo zgoraj levo
+ private function displayHeaderLogo(){
+ global $lang;
+ global $site_url;
+
+ // Logo glede na jezik in namestitev
+ $logo_class = '';
+
+ if(isLastnaInstalacija() || isVirtual())
+ $logo_class = 'namestitev';
+ elseif(isAAI())
+ $logo_class = 'arnes';
+
+ if($lang['id'] != "1")
+ $logo_class .= ' english';
+
+ $url = ($site_url == "https://www.1ka.si/" && $lang['id'] != "1") ? "https://www.1ka.si/d/en/" : $site_url;
+
+ echo '<div id="logo_holder" class="'.$logo_class.'">';
+ echo ' <a href="'.$url.'" title="'.$lang['srv_1cs'].'"></a>';
+ echo '</div>';
+ }
// Prikaze ime ankete, zvezdico in tiste linke spodi (ker se vse refresha z ajaxom)
- private function anketa_active() {
+ private function displayHeaderAnketaSettings() {
global $lang;
global $site_url;
global $admin_type;
@@ -803,34 +821,32 @@ class SurveyAdmin
if ($this->skin == 0) {
// Top navigacija
- echo '<div id="topLine2" class="noMargin">';
+ echo '<div id="anketa_header_settings">';
// aktivni ki lahko tudi urejajo
if ($this->checkDostopAktiven()) {
- echo '<span id="anketa_naslov" class="anketa_img_nav">';
+ echo '<div class="anketa_header_naslov">';
if($hierarhija_type == 10){
- echo '<a href="#" title="' . $lang['srv_anketarename'] . '" style="cursor:text !important;">' . $row['naslov'] . '</a>';
- }else{
- echo '<a href="#" onclick="anketa_title_edit(\'' . $this->anketa . '\',\'1\'); return false;" title="' . $lang['srv_anketarename'] . '">' . $row['naslov'] . '</a>';
+ echo '<a href="#" title="' . $lang['srv_anketarename'] . ' - ' . $row['naslov'] . '" style="cursor:text !important;">' . $row['naslov'] . '</a>';
+ }
+ else{
+ echo '<a href="#" onclick="anketa_title_edit(\'' . $this->anketa . '\',\'1\'); return false;" title="' . $lang['srv_anketarename'] . ' - ' . $row['naslov'] . '">' . $row['naslov'] . '</a>';
}
- $this->request_help();
-
- $this->check_online_users();
-
- echo '</span>';
+ echo '</div>';
}
// pasivni lahko samo gledajo
else {
+ echo ' <div class="anketa_header_naslov">'.$row['naslov'].'</div>';
+ }
- echo ' <span id="anketa_naslov" class="anketa_img_nav">';
- echo ' ' . $row['naslov'] . '';
- echo ' </span>';
- $link = SurveyInfo::getSurveyLink();
- }
+ // Pomoc
+ echo '<div class="anketa_header_help setting_box">';
+ $this->request_help();
+ echo '</div>';
echo '<script type="text/javascript">';
echo '$(document).ready(function() {';
@@ -840,48 +856,33 @@ class SurveyAdmin
echo '});';
echo '</script>';
-
- // aktivacija, deaktivacija
- echo '<span id="anketa_activation"' . ($this->isAnketar == true ? ' class="visibility_hidden"' : '') . '>';
+
+ // URL, aktivacija, deaktivacija
+ echo '<div class="anketa_header_activation"' . ($this->isAnketar == true ? ' class="visibility_hidden"' : '') . '>';
$this->displayAktivnost();
- echo '</span>'; # id="anketa_activation"
+ echo '</div>';
- // Nastavitve ankete
+ // Nastavitve ankete - ikona
$d = new Dostop();
if ($d->checkDostopSub('edit')) {
+ echo '<div class="anketa_header_quick_settings setting_box">';
+
if ($hierarhija_type == 10) {
- echo ' <a href="#" title="' . $lang['srv_survey_settings'] . '" style="padding: 0 5px;cursor:text !important;">';
+ echo '<a href="#" title="' . $lang['srv_survey_settings'] . '" style="cursor:text !important;">';
+ echo '<span class="faicon wheel_32"></span>';
+ echo '<span class="text">'.$lang['settings'].'</span>';
+ echo '</a>';
}
else {
- echo ' <a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=nastavitve" title="' . $lang['srv_survey_settings'] . '" style="padding: 0 5px;">';
+ echo '<a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=nastavitve" title="' . $lang['srv_survey_settings'] . '">';
+ echo '<span class="faicon wheel_32"></span>';
+ echo '<span class="text">'.$lang['settings'].'</span>';
+ echo '</a>';
}
- echo '<span class="faicon wheel_32 icon-orange_hover_red" style="margin-bottom:1px;"></span>';
- echo '</a> ';
- }
-
-
- // Gumb za nadgraditev paketa (ce imamo vklopljene pakete in nimamo 3ka paketa)
- global $app_settings;
- global $global_user_id;
- if($app_settings['commercial_packages'] == true){
-
- // Preverimo trenuten paket uporabnika
- $userAccess = UserAccess::getInstance($global_user_id);
- $current_package = $userAccess->getPackage();
- if($current_package != '3' && !$userAccess->userNotAuthor()){
-
- $drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/';
- $upgrade_url = $drupal_url.'izvedi-nakup/3/podatki';
-
- $button_text = ($current_package == '2') ? $lang['srv_access_upgrade2'] : $lang['srv_access_upgrade'];
-
- echo '<div class="upgrade_package">';
- echo '<div class="buttonwrapper"><a class="ovalbutton ovalbutton_purple" href="'.$upgrade_url.'" target="_blank"><span>'.$button_text.'</span></a></div>';
- echo '</div>';
- }
+ echo '</div> ';
}
@@ -889,8 +890,10 @@ class SurveyAdmin
$reloadSetting = ($_GET['a'] == "nastavitve") ? "'1'" : "'0'";
echo '<span id="survey_comment_holder" style="visibility: hidden" spremenljivka="0" view="0" type="0">&nbsp;</span>';
- echo ' </div>';
+
+ echo '</div>';
+
SurveySetting::getInstance()->Init($this->anketa);
// komentar na anketo, ki je vedno viden
@@ -913,12 +916,6 @@ class SurveyAdmin
$modules = SurveyInfo::getSurveyModules();
- # vse tri nivoje akcij pohendlamo tukaj, da bo lažje ob kakih spremnjanjih
-
- # prvi in drugi nivo
- $navigationArray = CrossRoad::MainNavigation($this->anketa, true);
- $this->first_action = $navigationArray['first_action'];
- $this->second_action = $navigationArray['second_action'];
$css_status = 'off';
$css_urejanje = 'off';
@@ -926,7 +923,6 @@ class SurveyAdmin
$css_objava = 'off';
$css_data = 'off';
$css_analysis = 'off';
- $separatorli = '<li class="separator">&nbsp;</li>';
if ($this->first_action == NAVI_STATUS) {
$css_status = 'on';
@@ -954,254 +950,179 @@ class SurveyAdmin
echo '<div id="firstNavigation" >';
- echo '<div id="mojeAnketeLink">';
- echo '<a class="left-1ka" href="index.php?a=pregledovanje" title="' . $lang['srv_pregledovanje'] . ' (' . strtolower($lang['srv_create_survey']) . ', ' . strtolower($lang['srv_library']) . ')">'/*<span class="sprites moje_ankete_off"></span>*/.'<span class="library_link">' . $lang['srv_pregledovanje'] . '</span></a>';
- echo '</div>';
-
-
- echo '<ol class="left-side right-space' . ($this->isAnketar == true ? ' visibility_hidden' : '') . '">';
- if ($this->skin == 0 /*&& $this->checkDostopAktiven()*/ && $this->isAnketar == false) {
- echo $separatorli;
- echo '<li>';
+ echo '<ol class="navigation_buttons_list">';
- if ($d->checkDostopSub('dashboard'))
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI . '" title="' . $lang['srv_navigation_status'] . '">';
+ // Samo anketar pri telefonski anketi - vidi moje ankete in poseben zavihek
+ if($this->isAnketar == true){
+ // Tab Moje ankete
+ echo '<li class="active_off">';
+ echo ' <a href="index.php?a=pregledovanje" title="' . $lang['srv_pregledovanje'] . ' (' . strtolower($lang['srv_create_survey']) . ', ' . strtolower($lang['srv_library']) . ')">';
+ echo ' <div id="mojeAnketeLink"><span class="faicon clipboard_notes"></span><span class="mojeAnketeLink_text">'.$lang['srv_pregledovanje'].'</span></div>';
+ echo ' </a>';
+ echo '</li>';
- echo '<div id="status_link_' . $css_status . '">';
+ // Tab telefonske ankete
+ echo '<li class="active_off">';
+ echo '<a href="index.php?a=phoneSurveys" title="' . $lang['srv_telephone_surveys'] . '">';
+ echo '<div class="smaller-singlebutton-off">' . $lang['srv_telephone_surveys'] . '</div>';
+ echo '</a>';
+ echo '</li>';
+
+ echo '<li class="active_on">';
+ echo ' <a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TELEPHONE . '&m=start_call" title="' . $lang['srv_telephone_surveying'] . '">';
+ echo ' <div class="step-on">' . $lang['srv_telephone_surveying'] . '</div>';
+ echo ' </a>';
+ echo '</li>';
+ }
+ else{
+ // Tab Moje ankete
+ echo '<li class="active_off">';
+ echo ' <a href="index.php?a=pregledovanje" title="' . $lang['srv_pregledovanje'] . ' (' . strtolower($lang['srv_create_survey']) . ', ' . strtolower($lang['srv_library']) . ')">';
+ echo ' <div id="mojeAnketeLink"><span class="faicon clipboard_notes"></span><span class="mojeAnketeLink_text">'.$lang['srv_pregledovanje'].'</span></div>';
+ echo ' </a>';
+ echo '</li>';
- if ($d->checkDostopSub('dashboard')) {
- echo '<span id="baseSurveyInfoImg" class="tooltip anketa_img_nav">';
- echo '<span class="faicon info icon-inline '.($css_status == 'on' ? 'icon-orange' : 'icon-white').'"></span>';
- echo '<span class="expanded-tooltip bottom light">';
- echo '<span id="surveyInfo_msg"></span>';
- echo '<span class="arrow"></span>';
- echo '</span>'; // expanded-tooltip bottom
- echo '</span>';
- }
- echo '<span class="status_link">' . $lang['srv_navigation_status'] . '</span>';
+ // Tab Status
+ if ($this->skin == 0 && $this->isAnketar == false) {
- echo '</div>';
+ // Separator
+ if($css_status == 'off')
+ echo '<li class="separator"></li>';
- if ($d->checkDostopSub('dashboard'))
- echo '</a>';
+ echo '<li class="active_'.$css_status.'">';
- echo '</li>';
- }
+ if ($d->checkDostopSub('dashboard')){
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI . '" title="' . $lang['srv_navigation_status'] . '">';
- echo $separatorli;
- echo '<li>';
- if ($d->checkDostopSub('edit') && $hierarhija_type < 5) {
- echo '<a href="index.php?anketa=' . $this->anketa . ($this->survey_type > 1 ? '&a=' . A_BRANCHING : '') . '" title="' . $lang['srv_vprasalnik'] . '">';
- }
- echo '<div class="left-' . $css_urejanje . '">&nbsp;</div>';
- echo '<div class="step-' . $css_urejanje . '">' . $lang['srv_vprasalnik'] . '</div>';
- //echo $css_urejanjeRight;
- if ($d->checkDostopSub('edit') && $hierarhija_type < 5) {
- echo '</a>';
- }
- echo '</li>';
+ echo '<div id="status_link_' . $css_status . '">';
+ echo ' <span class="status_link">' . $lang['srv_navigation_status'] . '</span>';
+
+ echo '</a>';
+ }
+ else{
+ echo '<div id="status_link_' . $css_status . '" title="'.$lang['srv_dostop_sub_locked_text'].'">';
+ echo ' <span class="status_link">' . $lang['srv_navigation_status'] . '</span>';
+ echo '</div>';
+ }
- # testiranje - ne prikazemo v glasovanju
- if ($this->survey_type != 0 && $this->survey_type != 1) {
- echo $separatorli;
- echo '<li>';
- if ($d->checkDostopSub('test')) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '" title="' . $lang['srv_testiranje'] . '">';
+ echo '</li>';
}
- echo '<div class="step-' . $css_testiranje . '">' . $lang['srv_testiranje'] . '</div>';
- //echo $css_testiranjeRight;
- if ($d->checkDostopSub('test')) {
- echo '</a>';
+ else{
+ // Separator
+ if($css_urejanje == 'off')
+ echo '<li class="separator"></li>';
}
- echo '</li>';
- }
- # če ni manager mora iti na vabila
- if (SurveyInfo::getInstance()->checkSurveyModule('email') && $this->user_role_cehck(U_ROLE_MANAGER) == true) {
- $link = 'invitations';
- }
- else {
- $link = A_VABILA;
- }
-
- echo $separatorli;
- echo '<li>';
- if ($d->checkDostopSub('publish')) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . $link . '" title="' . $lang['srv_vabila'] . '">';
- }
- echo '<div class="step-' . $css_objava . '">' . $lang['srv_vabila'] . '</div>';
- //echo $css_objavaRight;
- if ($d->checkDostopSub('publish')) {
- echo '</a>';
- }
- echo '</li>';
-
-
- // Podatki - ne prikazemo v glasovanju
- if ($this->survey_type != 0) {
- echo $separatorli;
- echo '<li>';
- if ($d->checkDostopSub('data')) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '" title="' . $lang['srv_results'] . '">';
- }
- echo '<div class="step-' . $css_data . '">' . $lang['srv_results'] . '</div>';
- //echo $css_dataRight;
- if ($d->checkDostopSub('data')) {
+ // Tab Urejanje
+ echo '<li class="active_'.$css_urejanje.'">';
+ if ($d->checkDostopSub('edit') && $hierarhija_type < 5) {
+ echo '<a href="index.php?anketa=' . $this->anketa . ($this->survey_type > 1 ? '&a=' . A_BRANCHING : '') . '" title="' . $lang['srv_vprasalnik'] . '">';
+ echo '<div class="step-' . $css_urejanje . '">' . $lang['srv_vprasalnik'] . '</div>';
echo '</a>';
}
+ else{
+ echo '<div class="step-' . $css_urejanje . '" title="'.$lang['srv_dostop_sub_locked_text'].'">' . $lang['srv_vprasalnik'] . '</div>';
+ }
echo '</li>';
- }
- # če je manj kot 20 variabel naj gre default na graf
- $sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa'");
- [$varcount] = mysqli_fetch_array($sql);
-
-
- if ($varcount < 20) {
- SurveyDataSettingProfiles:: Init($this->anketa);
- $goto = SurveyDataSettingProfiles::getSetting('analysisGoTo');
- $_goto_m = '&m=' . $goto;
- } else {
- $_goto_m = '&m=' . M_ANALYSIS_SUMMARY;
- }
- echo $separatorli;
- echo '<li>';
- if ($d->checkDostopSub('analyse') && !isset($modules['hierarhija'])) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . $_goto_m . '" title="' . $lang['srv_analiza'] . '">';
- }
- elseif ($d->checkDostopSub('analyse') && isset($modules['hierarhija'])) {
- echo '<a href="#" title="' . $lang['srv_analiza_hierarchy'] . '">';
- }
- echo '<div class="step-' . $css_analysis . '">' . $lang['srv_analiza'] . '</div>';
+ // Tab Testiranje - ne prikazemo v glasovanju
+ if ($this->survey_type != 0 && $this->survey_type != 1) {
- if ($d->checkDostopSub('analyse')) {
- echo '</a>';
- }
- echo '</li>';
-
- echo '</ol>';
-
-
- $d = new Dostop();
- if ($d->checkDostopAktiven()) {
- echo '<ol class="quick_settings' . ($this->isAnketar == true ? ' visibility_hidden' : '') . '">';
-
- # Komentarji
- SurveySetting::getInstance()->Init($this->anketa);
- $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment');
- $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
- $question_note_view = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_view');
- $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment');
-
- $sas = new SurveyAdminSettings();
-
- // V kolikor je vklopljena hierarhija in imamo gor splošne uporabnike, potem nastavitev ne prikazujemo
- $hierarhija_prikaz = true;
- if(SurveyInfo::getInstance()->checkSurveyModule('hierarhija') && $hierarhija_type == 10)
- $hierarhija_prikaz = false;
-
- #ikonco za komentarje prikazujemo po potrebi
- if ($this->survey_type > 1 && $hierarhija_prikaz) {
+ echo '<li class="active_'.$css_testiranje.'">';
+ if ($d->checkDostopSub('test')) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '" title="' . $lang['srv_testiranje'] . '">';
+ echo '<div class="step-' . $css_testiranje . '">' . $lang['srv_testiranje'] . '</div>';
+ echo '</a>';
+ }
+ else{
+ echo '<div class="step-' . $css_testiranje . '" title="'.$lang['srv_dostop_sub_locked_text'].'">' . $lang['srv_testiranje'] . '</div>';
+ }
+ echo '</li>';
+ }
- global $global_user_id;
- $userAccess = UserAccess::getInstance($global_user_id);
- if ($survey_comment != '' || $question_comment != '' || /*$question_note_view != '' ||*/
- $question_resp_comment == 1 || $sas->testiranje_komentarji_komentarji_na_vprasanje(false) > 0
- ) {
- echo '<li>';
- echo '<div id="quick_comments_link" class="newCss">';
-
- if($userAccess->checkUserAccess('komentarji')){
- if ($sas->testiranje_komentarji_komentarji_na_vprasanje() > 0)
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='.$row['id'].'&a=komentarji" title="' . $lang['srv_view_comment'] . '" ><div class="fa-stack"><span class="faicon comments_num icon-orange fa-stack-1x" title="' . $lang['srv_view_comment'] . '"><strong class="fa-stack-1x">' . $sas->testiranje_komentarji_komentarji_na_vprasanje() . '</strong></span></div></a>';
- else
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='.$row['id'].'&a=komentarji" title="' . $lang['srv_view_comment'] . '" ><div class="fa-stack"><span class="faicon comments fa-stack-1x icon-orange" title="' . $lang['srv_view_comment'] . '"></span></div></a>';
- }
- else{
- if ($sas->testiranje_komentarji_komentarji_na_vprasanje() > 0)
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='. $row['id'].'&a=urejanje" title="' . $lang['srv_view_comment'] . '" ><div class="fa-stack"><span class="faicon comments_num icon-orange fa-stack-1x user_access_locked" title="' . $lang['srv_view_comment'] . '"><strong class="fa-stack-1x">' . $sas->testiranje_komentarji_komentarji_na_vprasanje() . '</strong></span></div></a>';
- else
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='.$row['id'].'&a=urejanje" title="' . $lang['srv_view_comment'] . '" ><div class="fa-stack"><span class="faicon comments fa-stack-1x icon-orange user_access_locked" title="' . $lang['srv_view_comment'] . '"></span></div></a>';
- }
+ // Tab Objava
+ # če ni manager mora iti na vabila
+ if (SurveyInfo::getInstance()->checkSurveyModule('email') && $this->user_role_cehck(U_ROLE_MANAGER) == true)
+ $link = 'invitations';
+ else
+ $link = A_VABILA;
- echo '</div>';
- echo '</li>';
- }
- // ce ni komentarjev, potem prikazemo link do nastavitev komentarjev
- else {
- echo '<li>';
- echo '<div id="quick_comments_link" class="newCss">';
+ echo '<li class="active_'.$css_objava.'">';
+ if ($d->checkDostopSub('publish')) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . $link . '" title="' . $lang['srv_vabila'] . '">';
+ echo '<div class="step-' . $css_objava . '">' . $lang['srv_vabila'] . '</div>';
+ echo '</a>';
+ }
+ else{
+ echo '<div class="step-' . $css_objava . '" title="'.$lang['srv_dostop_sub_locked_text'].'">' . $lang['srv_vabila'] . '</div>';
+ }
+ echo '</li>';
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
-
- if($userAccess->checkUserAccess('komentarji'))
- echo '<a href="' . $site_url . 'admin/survey/ajax.php?anketa='.$row['id'].'&a=comments_onoff&do=on" title="' . $lang['srv_preview_comments'] . '"><div class="fa-stack"><span class="faicon comments fa-stack-1x icon-blue" title="' . $lang['srv_preview_comments'] . '">';
- else
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='.$row['id'].'&a=urejanje" title="' . $lang['srv_preview_comments'] . '"><div class="fa-stack"><span class="faicon comments fa-stack-1x icon-blue user_access_locked" title="' . $lang['srv_preview_comments'] . '">';
- echo '</span></div></a>';
+ // Podatki - ne prikazemo v glasovanju
+ if ($this->survey_type != 0) {
- echo '</div>';
- echo '</li>';
+ echo '<li class="active_'.$css_data.'">';
+ if ($d->checkDostopSub('data')) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '" title="' . $lang['srv_results'] . '">';
+ echo '<div class="step-' . $css_data . '">' . $lang['srv_results'] . '</div>';
+ echo '</a>';
}
-
- if (($admin_type <= $survey_comment && $survey_comment != '') || $sas->testiranje_komentarji_komentarji_na_anketo(false) > 0) {
- echo '<li>';
- echo '<div id="quick_comments_link" class="newCss">';
- $this->survey_icon_add_comment();
- echo '</div>';
- echo '</li>';
+ else{
+ echo '<div class="step-' . $css_data . '" title="'.$lang['srv_dostop_sub_locked_text'].'">' . $lang['srv_results'] . '</div>';
}
+ echo '</li>';
}
- // ikonco za jezik prikazujemo po potrebi
- if ($row['multilang'] == 1) {
- $p = new Prevajanje($this->anketa);
- global $lang1;
- echo '<li style="margin: 10px 0 0 0;">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=prevajanje" class="srv_ico" title="' . $lang['lang'] . ': ' . $lang['lang_short'] . ' | ' . $lang1['lang_short'] . $lang_more . '">';
- echo '<span class="faicon language icon-as_link"></span>';
- echo '</a>';
- echo '</li>';
+ // Tab Analize
+ # če je manj kot 20 variabel naj gre default na graf
+ $sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa'");
+ [$varcount] = mysqli_fetch_array($sql);
+
+ if ($varcount < 20) {
+ SurveyDataSettingProfiles:: Init($this->anketa);
+ $goto = SurveyDataSettingProfiles::getSetting('analysisGoTo');
+ $_goto_m = '&m=' . $goto;
+ } else {
+ $_goto_m = '&m=' . M_ANALYSIS_SUMMARY;
}
- elseif (UserSetting::getInstance()->getUserSetting('showLanguageShortcut')) {
- // Ikona za vklop jezika, če je v globalnih nastavitvah vklopljena opcija
- echo '<li style="margin: 10px 0 0 0;">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=prevajanje" class="srv_ico" title="' . $lang['lang'] . '">';
- echo '<span class="faicon language icon-grey_normal pointer"></span>';
+
+ echo '<li class="active_'.$css_analysis.'">';
+ if ($d->checkDostopSub('analyse') && isset($modules['hierarhija'])) {
+ echo '<a href="#" title="' . $lang['srv_analiza_hierarchy'] . '">';
+ echo '<div class="step-' . $css_analysis . '">' . $lang['srv_analiza'] . '</div>';
echo '</a>';
- echo '</li>';
}
-
- // Ikonca ce je izklopljeno prilagajanje za mobitel (mobile friendly)
- $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly');
- if ($mobile_friendly == 0) {
- echo '<li style="margin: 10px 0 0 0;">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=mobile_settings" class="srv_ico" title="' . $lang['srv_settings_mobile_friendly_off'] . '">';
- echo '<span class="faicon mobile_off icon-as_link"></span>';
+ elseif ($d->checkDostopSub('analyse')) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . $_goto_m . '" title="' . $lang['srv_analiza'] . '">';
+ echo '<div class="step-' . $css_analysis . '">' . $lang['srv_analiza'] . '</div>';
echo '</a>';
- echo '</li>';
+ }
+ else{
+ echo '<div class="step-' . $css_analysis . '" title="'.$lang['srv_dostop_sub_locked_text'].'">' . $lang['srv_analiza'] . '</div>';
}
-
- echo '</ol>';
+ echo '</li>';
}
+ echo '</ol>';
+
+
+ // Ikone na desni
+ echo '<div class="right_icons '.($this->isAnketar == true ? ' displayNone' : '').'">';
# zavhiki dodatnih nastavitev
- echo '<ol class="smaller right-side">';
+ echo '<ol class="navigation_modules">';
# MAZA - mobilna aplikacija za anketirance
if (isset($modules['maza'])) {
$css = ($this->first_action == A_MAZA) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MAZA . '" title="' . $lang['srv_maza'] . '">';
echo '<span class="module_icon maza"></span>';
@@ -1212,8 +1133,6 @@ class SurveyAdmin
if (isset($modules['wpn'])) {
$css = ($this->first_action == A_WPN) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_WPN . '" title="' . $lang['srv_wpn'] . '">';
echo '<span class="module_icon wpn"></span>';
@@ -1224,8 +1143,6 @@ class SurveyAdmin
if (isset($modules['phone'])) {
$css = ($this->first_action == NAVI_PHONE) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
# če je navadni user in anketar
if ($this->isAnketar) {
@@ -1241,8 +1158,6 @@ class SurveyAdmin
if (isset($modules['slideshow'])) {
$css = ($this->first_action == NAVI_SLIDESHOW) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SLIDESHOW . '" title="' . $lang['srv_vrsta_survey_type_9'] . '">';
echo '<span class="module_icon slideshow"></span>';
@@ -1253,8 +1168,6 @@ class SurveyAdmin
if (isset($modules['uporabnost'])) {
$css = ($this->first_action == NAVI_UPORABNOST) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_UPORABNOST . '" title="' . $lang['srv_uporabnost'] . '">';
echo '<span class="module_icon evalvation"></span>';
@@ -1265,8 +1178,6 @@ class SurveyAdmin
if ($row['user_from_cms'] >= 1) {
$css = ($this->first_action == NAVI_VNOS) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COOKIE . '" title="' . $lang['srv_vnos'] . '">';
echo '<span class="module_icon vnos"></span>';
@@ -1277,8 +1188,6 @@ class SurveyAdmin
if (isset($modules['social_network'])) {
$css = ($this->first_action == NAVI_VNOS) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SOCIAL_NETWORK . '" title="' . $lang['srv_vrsta_survey_type_8'] . '">';
echo '<span class="module_icon social"></span>';
@@ -1289,8 +1198,6 @@ class SurveyAdmin
if (isset($modules['quiz'])) {
$css = ($this->first_action == A_KVIZ) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_KVIZ . '" title="' . $lang['srv_vrsta_survey_type_6'] . '">';
echo '<span class="module_icon quiz"></span>';
@@ -1301,8 +1208,6 @@ class SurveyAdmin
if (isset($modules['voting'])) {
$css = ($this->first_action == A_VOTING) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VOTING . '" title="' . $lang['srv_vrsta_survey_type_18'] . '">';
echo '<span class="module_icon voting"></span>';
@@ -1313,20 +1218,26 @@ class SurveyAdmin
if (isset($modules['advanced_paradata'])) {
$css = ($this->first_action == A_ADVANCED_PARADATA) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_PARADATA . '" title="' . $lang['srv_vrsta_survey_type_16'] . '">';
echo '<span class="module_icon advanced_paradata"></span>';
echo '</a>';
echo '</li>';
}
+ # napredni casi po straneh
+ if (isset($modules['advanced_timestamps'])) {
+ $css = ($this->first_action == A_ADVANCED_TIMESTAMPS) ? 'on' : 'off';
+
+ echo '<li>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_TIMESTAMPS . '" title="' . $lang['srv_vrsta_survey_type_20'] . '">';
+ echo '<span class="module_icon advanced_timestamps"></span>';
+ echo '</a>';
+ echo '</li>';
+ }
# excelleration matrix
if (isset($modules['excell_matrix'])) {
$css = ($this->first_action == 'excell_matrix') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=excell_matrix" title="Excelleration matrix">';
echo '<span class="module_icon excell_matrix"></span>';
@@ -1337,8 +1248,6 @@ class SurveyAdmin
if (isset($modules['chat'])) {
$css = ($this->first_action == A_CHAT) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_CHAT . '" title="' . $lang['srv_vrsta_survey_type_14'] . '">';
echo '<span class="module_icon chat"></span>';
@@ -1349,20 +1258,26 @@ class SurveyAdmin
if (isset($modules['panel'])) {
$css = ($this->first_action == A_PANEL) ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PANEL . '" title="' . $lang['srv_vrsta_survey_type_15'] . '">';
echo '<span class="module_icon panel"></span>';
echo '</a>';
echo '</li>';
}
+ # dostop z emailom
+ if (isset($modules['email_access'])) {
+ $css = ($this->first_action == A_EMAIL_ACCESS) ? 'on' : 'off';
+
+ echo '<li>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EMAIL_ACCESS . '" title="' . $lang['srv_vrsta_survey_type_19'] . '">';
+ echo '<span class="module_icon email_access"></span>';
+ echo '</a>';
+ echo '</li>';
+ }
# evoli
if (isset($modules['evoli'])) {
$css = ($this->first_action == 'evoli') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli" title="Evoli">';
echo '<span class="module_icon evoli"></span>';
@@ -1373,8 +1288,6 @@ class SurveyAdmin
if (isset($modules['evoli_teammeter'])) {
$css = ($this->first_action == 'evoli_teammeter') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teammeter" title="Evoli team meter">';
echo '<span class="module_icon evoli_teammeter"></span>';
@@ -1385,8 +1298,6 @@ class SurveyAdmin
if (isset($modules['evoli_quality_climate'])) {
$css = ($this->first_action == 'evoli_quality_climate') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_quality_climate" title="Evoli quality climate">';
echo '<span class="module_icon evoli_quality_climate"></span>';
@@ -1397,8 +1308,6 @@ class SurveyAdmin
if (isset($modules['evoli_teamship_meter'])) {
$css = ($this->first_action == 'evoli_teamship_meter') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teamship_meter" title="Evoli teamship meter">';
echo '<span class="module_icon evoli_teamship_meter"></span>';
@@ -1409,8 +1318,6 @@ class SurveyAdmin
if (isset($modules['evoli_organizational_employeeship_meter'])) {
$css = ($this->first_action == 'evoli_organizational_employeeship_meter') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_organizational_employeeship_meter" title="Evoli organizational employeeship meter">';
echo '<span class="module_icon evoli_organizational_employeeship_meter"></span>';
@@ -1421,8 +1328,6 @@ class SurveyAdmin
if (isset($modules['evoli_employmeter'])) {
$css = ($this->first_action == 'evoli_employmeter') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_employmeter" title="Evoli employeeship meter">';
echo '<span class="module_icon evoli_employmeter"></span>';
@@ -1433,8 +1338,6 @@ class SurveyAdmin
if (isset($modules['mfdps'])) {
$css = ($this->first_action == 'mfdps') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mfdps" title="MFDPŠ">';
echo '<span class="module_icon mfdps"></span>';
@@ -1445,8 +1348,6 @@ class SurveyAdmin
if (isset($modules['borza'])) {
$css = ($this->first_action == 'borza') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=borza" title="BORZA">';
echo '<span class="module_icon borza"></span>';
@@ -1457,8 +1358,6 @@ class SurveyAdmin
if (isset($modules['mju'])) {
$css = ($this->first_action == 'mju') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mju" title="MJU">';
echo '<span class="module_icon mju"></span>';
@@ -1469,8 +1368,6 @@ class SurveyAdmin
if (isset($modules['360_stopinj'])) {
$css = ($this->first_action == '360_stopinj') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=360_stopinj" title="' . $lang['srv_360_reports'] . '">';
echo '<span class="module_icon degrees"></span>';
@@ -1481,8 +1378,6 @@ class SurveyAdmin
if (isset($modules['360_stopinj_1ka'])) {
$css = ($this->first_action == '360_stopinj_1ka') ? 'on' : 'off';
- echo '<li class="space">&nbsp;</li>';
-
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=360_stopinj_1ka" title="' . $lang['srv_360_reports'] . '">';
echo '<span class="module_icon degrees_1ka"></span>';
@@ -1492,8 +1387,6 @@ class SurveyAdmin
# GDPR
$gdpr = new GDPR();
if (true /*$gdpr->isGDPRSurvey($this->anketa)*/) {
-
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=gdpr_settings" title="' . $lang['srv_gdpr'] . '">';
@@ -1503,7 +1396,6 @@ class SurveyAdmin
}
# SA - hierarhija
if (isset($modules['hierarhija'])) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
if($modules['hierarhija'] == 1) {
@@ -1528,7 +1420,6 @@ class SurveyAdmin
echo '</li>';
}
elseif(UserSetting::getInstance()->getUserSetting('showSAicon') && $admin_type < 3){
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m='.M_HIERARHIJA_STATUS.'" title="' . $lang['srv_hierarchy'] . '">';
@@ -1537,9 +1428,63 @@ class SurveyAdmin
echo '</li>';
}
-
echo '</ol>';
+ // Ikone komentarjev, jezika...
+ $d = new Dostop();
+ if ($d->checkDostopAktiven()) {
+ echo '<ol class="quick_settings' . ($this->isAnketar == true ? ' displayNone' : '') . '">';
+
+ // V kolikor je vklopljena hierarhija in imamo gor splošne uporabnike, potem nastavitev ne prikazujemo
+ $hierarhija_prikaz = true;
+ if(SurveyInfo::getInstance()->checkSurveyModule('hierarhija') && $hierarhija_type == 10)
+ $hierarhija_prikaz = false;
+
+
+ // ikonco za jezik prikazujemo po potrebi
+ if ($row['multilang'] == 1) {
+ $p = new Prevajanje($this->anketa);
+ global $lang1;
+
+ echo '<li>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=prevajanje" class="srv_ico" title="' . $lang['lang'] . ': ' . $lang['lang_short'] . ' | ' . $lang1['lang_short'] . '">';
+ echo '<span class="faicon language"></span>';
+ echo '</a>';
+ echo '</li>';
+ }
+ // Ikona za vklop jezika, če je v globalnih nastavitvah vklopljena opcija
+ //elseif (UserSetting::getInstance()->getUserSetting('showLanguageShortcut')) {
+ else{
+ echo '<li>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=prevajanje" class="srv_ico" title="' . $lang['lang'] . '">';
+ echo '<span class="faicon language gray"></span>';
+ echo '</a>';
+ echo '</li>';
+ }
+
+
+ // Ikonca ce je izklopljeno prilagajanje za mobitel (mobile friendly)
+ $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly');
+ if ($mobile_friendly == 0) {
+ echo '<li>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=mobile_settings" class="srv_ico" title="' . $lang['srv_settings_mobile_friendly_off'] . '">';
+ echo '<span class="faicon mobile_off"></span>';
+ echo '</a>';
+ echo '</li>';
+ }
+
+
+ #ikonco za komentarje prikazujemo po potrebi
+ if ($this->survey_type > 1 && $hierarhija_prikaz) {
+ $sc = new SurveyComments($this->anketa);
+ $sc->display_comments_icon();
+ }
+
+ echo '</ol>';
+ }
+
+ echo '</div>'; # class="right_items"
+
echo '</div>'; # id="firstNavigation"
@@ -1554,89 +1499,80 @@ class SurveyAdmin
# ajaxa se poslje skupaj z ajaxom, da ob updatu vemo kaksen 'a' je bil na originalni strani
# (drugace se ob updatu z ajaxom informacija o 'a'ju zgubi)
- $get = $_GET['a'];
+ $get = isset($_GET['a']) ? $_GET['a'] : '';
if (isset ($_GET['ajaxa']))
$get = $_GET['ajaxa'];
- if (trim($get) == '') {
+ if (trim($get) == '')
$get = A_BRANCHING;
- }
+
//*** druga vrstica navigacije ***//
echo '<div id="secondNavigation" class="clr subpage_' . $get . '">';
# podzavihek: urejanje ankete
if ($this->first_action == NAVI_UREJANJE) {
- echo '<ul class="secondNavigation ' . ($this->isAnketar == true ? ' visibility_hidden' : '') . '">';
+ echo '<ul class="secondNavigation ' . ($this->isAnketar == true ? ' displayNone' : '') . '">';
#zavihek vprasalnik *
- echo '<li>';
- echo '<a class="no-img side-left' . ($this->second_action == NAVI_UREJANJE_BRANCHING ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . ($this->survey_type > 1 ? '&a=' . A_BRANCHING : '') . '" title="' . $lang['srv_editirajanketo2'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_UREJANJE_BRANCHING ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . ($this->survey_type > 1 ? '&a=' . A_BRANCHING : '') . '" title="' . $lang['srv_editirajanketo2'] . '">';
echo $lang['srv_editirajanketo2'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
#zavihek urejanje akete
- echo '<li>';
- echo '<a class="no-img' . ($this->second_action == NAVI_UREJANJE_ANKETA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&a=' . A_SETTINGS . '" title="' . $lang['srv_nastavitve_ankete'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_UREJANJE_ANKETA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_SETTINGS . '" title="' . $lang['srv_nastavitve_ankete'] . '">';
echo $lang['srv_nastavitve_ankete'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
# zavihek oblika
- echo '<li>';
- echo '<a class="no-img side-right' . ($this->second_action == NAVI_UREJANJE_TEMA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEMA . '" title="' . $lang['srv_themes'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_UREJANJE_TEMA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEMA . '" title="' . $lang['srv_themes'] . '">';
echo $lang['srv_themes'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
echo '</ul>';
+
+ # link arhivi
if (!$this->isAnketar) {
+ echo '<div class="separator"></div>';
+
echo '<ul class="secondNavigationArchive">';
- # link arhivi
- echo '<li class="' . ($get == A_ARHIVI || $get == A_TRACKING ? ' aactive' : '') . '">';
- echo '<a class="' . ($get == A_ARHIVI || $get == A_TRACKING ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '" title="' . $lang['srv_arhivi'] . '">';
- //echo $lang['srv_arhivi'];
- echo /*'<span class="sprites archive"></span>' .*/ $lang['srv_analiza_arhiv'];
+
+ echo '<li class="'.($get == A_ARHIVI || $get == A_TRACKING ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '" title="' . $lang['srv_arhivi'] . '">';
+ echo $lang['srv_analiza_arhiv'];
echo '</a>';
echo '</li>';
+
echo '</ul>';
}
}
# podzavihek: testiranje
if ($this->first_action == NAVI_TESTIRANJE) {
- //$tab = $_GET['m'];
+
echo '<ul class="secondNavigation">';
- echo '<li>';
- echo '<a class="no-img side-left' . ($this->second_action == M_TESTIRANJE_DIAGNOSTIKA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_DIAGNOSTIKA . '" title="' . $lang['srv_testiranje_diagnostika'] . '">';
+ echo '<li class="'.($this->second_action == M_TESTIRANJE_DIAGNOSTIKA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_DIAGNOSTIKA . '" title="' . $lang['srv_testiranje_diagnostika'] . '">';
echo $lang['srv_testiranje_diagnostika'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
# zavihek trajanje
- echo '<li>';
- echo '<a class="no-img' . ($this->second_action == NAVI_TESTIRANJE_PREDVIDENI || $this->second_action == NAVI_TESTIRANJE_CAS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . A_TRAJANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_trajanje'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_TESTIRANJE_PREDVIDENI || $this->second_action == NAVI_TESTIRANJE_CAS ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . A_TRAJANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_trajanje'] . '">';
echo $lang['srv_testiranje_trajanje'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
# zavihek komentarji
- echo '<li>';
- echo '<a class="no-img' . ($this->second_action == NAVI_TESTIRANJE_KOMENTARJI || $this->second_action == NAVI_TESTIRANJE_KOMENTARJI_ANKETA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_KOMENTARJI . '" title="' . $lang['srv_testiranje_komentarji'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_TESTIRANJE_KOMENTARJI || $this->second_action == NAVI_TESTIRANJE_KOMENTARJI_ANKETA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_KOMENTARJI . '" title="' . $lang['srv_testiranje_komentarji'] . '">';
echo $lang['srv_testiranje_komentarji'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
- echo '<li>';
- echo '<a class="no-img side-right' . ($this->second_action == NAVI_TESTIRANJE_VNOSI ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_VNOSI . '" title="' . $lang['srv_testiranje_vnosi'] . '">';
+
+ echo '<li class="'.($this->second_action == NAVI_TESTIRANJE_VNOSI ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_VNOSI . '" title="' . $lang['srv_testiranje_vnosi'] . '">';
echo $lang['srv_testiranje_vnosi'] . '</a>';
echo '</li>';
@@ -1648,15 +1584,18 @@ class SurveyAdmin
$query_testdata = sisplet_query($str_testdata);
[$testdata] = mysqli_fetch_row($query_testdata);
+ # link arhivi
if ((int)$testdata > 0) {
+ echo '<div class="separator"></div>';
+
echo '<ul class="secondNavigationArchive">';
- # link arhivi
- echo '<li>';
- echo '<a class="' . ($get == A_ARHIVI || $get == A_TRACKING ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '&m=testdata" title="' . $lang['srv_arhivi'] . '">';
- echo /*'<span class="sprites archive"></span>' .*/ $lang['srv_analiza_arhiv'];
+
+ echo '<li class="'.($get == A_ARHIVI || $get == A_TRACKING ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '&m=testdata" title="' . $lang['srv_arhivi'] . '">';
+ echo $lang['srv_analiza_arhiv'];
echo '</a>';
echo '</li>';
+
echo '</ul>';
}
}
@@ -1670,38 +1609,36 @@ class SurveyAdmin
echo '<ul class="secondNavigation">';
- #((($tab == 'url' || ($row['email'] != 1 && !$tab && $get!='email')) && ($get != 'invitations'))
- echo '<li>';
- echo '<a class="no-img side-left' . ($_GET['a'] == A_VABILA && ($_GET['m'] == '' || $_GET['m'] == 'settings') ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '&m=settings" title="' . $lang['srv_publication_base'] . '">';
+ echo '<li class="'.($_GET['a'] == A_VABILA && ($_GET['m'] == '' || $_GET['m'] == 'settings') ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '&m=settings" title="' . $lang['srv_publication_base'] . '">';
echo $lang['srv_publication_base'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
- echo '<li>';
- echo '<a class="no-img side' . ($_GET['a'] == A_VABILA && $_GET['m'] == 'url' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '&m=url" title="' . $lang['srv_publication_url'] . '">';
- echo $lang['srv_publication_url'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- echo '<li>';
- echo '<a class="no-img side-right' . ($_GET['a'] == A_INVITATIONS && $_GET['m'] != 'view_archive' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_INVITATIONS . '" title="' . $lang['srv_inv_nav_invitations'] . '">';
+
+ echo '<li class="'.($_GET['a'] == A_INVITATIONS && $_GET['m'] != 'view_archive' ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_INVITATIONS . '" title="' . $lang['srv_inv_nav_invitations'] . '">';
echo $lang['srv_inv_nav_invitations'] . '</a>';
echo '</li>';
+ echo '<li class="'.($_GET['a'] == A_OTHER_INV && $_GET['m'] != 'view_archive' ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_OTHER_INV . '" title="' . $lang['srv_inv_nav_other_inv'] . '">';
+ echo $lang['srv_inv_nav_other_inv'] . '</a>';
+ echo '</li>';
+
echo '</ul>';
- echo '<ul class="secondNavigationArchive">';
+
# link arhivi
- echo '<li>';
- echo '<a class="' . ($get == A_ARHIVI || $get == A_TRACKING || $_GET['m'] == 'view_archive' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=invitations&m=view_archive" title="' . $lang['srv_arhivi'] . '">';
- //echo $lang['srv_arhivi'];
- echo /*'<span class="sprites archive"></span>' .*/ $lang['srv_analiza_arhiv'];
+ echo '<div class="separator"></div>';
+
+ echo '<ul class="secondNavigationArchive">';
+
+ echo '<li class="'.($get == A_ARHIVI || $get == A_TRACKING || $_GET['m'] == 'view_archive' ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=invitations&m=view_archive" title="' . $lang['srv_arhivi'] . '">';
+ echo $lang['srv_analiza_arhiv'];
echo '</a>';
echo '</li>';
- echo '</ul>';
+ echo '</ul>';
}
# podzavihek: analize
if ($this->first_action == NAVI_ANALYSIS) {
@@ -1709,104 +1646,91 @@ class SurveyAdmin
# ZDRUŽIMO STATISTIKE
# osnovne
- echo '<li>';
- echo '<a class="no-img side-left' . ($_GET['m'] == M_ANALYSIS_SUMMARY
- || $_GET['m'] == M_ANALYSIS_FREQUENCY
- || $_GET['m'] == M_ANALYSIS_DESCRIPTOR
- || $_GET['m'] == M_ANALYSIS_CROSSTAB
- || $_GET['m'] == M_ANALYSIS_MEANS
- || $_GET['m'] == M_ANALYSIS_TTEST
- || $_GET['m'] == M_ANALYSIS_BREAK
- || $_GET['m'] == M_ANALYSIS_PARA
- || $_GET['m'] == M_ANALYSIS_MULTICROSSTABS
- || $_GET['m'] == M_ANALYSIS_MEANS_HIERARHY
- || $_GET['m'] == M_ANALYSIS_HEATMAP
- ? ' active' : '') . '"';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_SUMMARY
+ || $_GET['m'] == M_ANALYSIS_FREQUENCY
+ || $_GET['m'] == M_ANALYSIS_DESCRIPTOR
+ || $_GET['m'] == M_ANALYSIS_CROSSTAB
+ || $_GET['m'] == M_ANALYSIS_MEANS
+ || $_GET['m'] == M_ANALYSIS_TTEST
+ || $_GET['m'] == M_ANALYSIS_BREAK
+ || $_GET['m'] == M_ANALYSIS_PARA
+ || $_GET['m'] == M_ANALYSIS_MULTICROSSTABS
+ || $_GET['m'] == M_ANALYSIS_MEANS_HIERARHY
+ || $_GET['m'] == M_ANALYSIS_HEATMAP
+ ? ' active' : '').'">';
if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_stat_analiza'] . '">';
- } else {
- echo ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_SUMMARY . '" title="' . $lang['srv_stat_analiza'] . '">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_stat_analiza'] . '">';
+ }
+ else {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_SUMMARY . '" title="' . $lang['srv_stat_analiza'] . '">';
}
echo $lang['srv_stat_analiza'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
-
if (!SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
# zavihek GRAFI
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['m'] == M_ANALYSIS_CHARTS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_CHARTS . '" title="' . $lang['srv_analiza_charts'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_CHARTS ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_CHARTS . '" title="' . $lang['srv_analiza_charts'] . '">';
echo $lang['srv_analiza_charts'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
// zavihek POROCILA
// Link na navadna porocila
if (SurveyCustomReport::checkEmpty($this->anketa)) {
- echo '<li>';
- echo '<a class="no-img side-right ' . ($_GET['m'] == M_ANALYSIS_CREPORT || $this->second_action == NAVI_ANALYSIS_LINKS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_LINKS . '" title="' . $lang['srv_reporti'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_CREPORT || $this->second_action == NAVI_ANALYSIS_LINKS ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_LINKS . '" title="' . $lang['srv_reporti'] . '">';
echo $lang['srv_reporti'] . '</a>';
echo '</li>';
- } // Link na porocilo po meri (ce ni prazno)
+ }
+ // Link na porocilo po meri (ce ni prazno)
else {
- echo '<li>';
- echo '<a class="no-img side-right' . ($_GET['m'] == M_ANALYSIS_CREPORT || $this->second_action == NAVI_ANALYSIS_LINKS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_CREPORT . '" title="' . $lang['srv_reporti'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_CREPORT || $this->second_action == NAVI_ANALYSIS_LINKS ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_CREPORT . '" title="' . $lang['srv_reporti'] . '">';
echo $lang['srv_reporti'] . '</a>';
echo '</li>';
}
- // zavihek vizualizacija - zaenkrat samo admini
- if ($admin_type === '0') {
- echo '<li class="space"></li>';
+ // zavihek vizualizacija - zaenkrat kar odstranimo, ker itak ne dela
+ /*if ($admin_type === '0') {
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['m'] == M_ANALYSIS_VIZUALIZACIJA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_VIZUALIZACIJA . '" title="' . $lang['srv_vizualizacija'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_VIZUALIZACIJA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_VIZUALIZACIJA . '" title="' . $lang['srv_vizualizacija'] . '">';
echo $lang['srv_vizualizacija'] . '</a>';
echo '</li>';
- }
+ }*/
// zavihek 360 STOPINJSKA POROCILA
if (SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')) {
- echo '<li class="space"></li>';
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['m'] == M_ANALYSIS_360 ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_360 . '" title="' . $lang['srv_360_stopinj'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_360 ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_360 . '" title="' . $lang['srv_360_stopinj'] . '">';
echo $lang['srv_360_report'] . '</a>';
echo '</li>';
}
// zavihek 360 STOPINJSKA POROCILA 1KA
if (SurveyInfo::getInstance()->checkSurveyModule('360_stopinj_1ka')) {
- echo '<li class="space"></li>';
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['m'] == M_ANALYSIS_360_1KA ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_360_1KA . '" title="' . $lang['srv_360_stopinj'] . '">';
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_360_1KA ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_360_1KA . '" title="' . $lang['srv_360_stopinj'] . '">';
echo $lang['srv_360_report'] . '</a>';
echo '</li>';
}
-
- //$row = Cache::srv_spremenljivka($spremenljivka);
-
}
echo '</ul>';
- echo '<ul class="secondNavigationArchive">';
+
# link arhivi
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['m'] == M_ANALYSIS_ARCHIVE ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_ARCHIVE . '" title="' . $lang['srv_analiza_arhiv'] . '">';
- echo /*'<span class="sprites archive"></span>' .*/ $lang['srv_analiza_arhiv'];
+ echo '<div class="separator"></div>';
+
+ echo '<ul class="secondNavigationArchive">';
+
+ echo '<li class="'.($_GET['m'] == M_ANALYSIS_ARCHIVE ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&amp;m=' . M_ANALYSIS_ARCHIVE . '" title="' . $lang['srv_analiza_arhiv'] . '">';
+ echo $lang['srv_analiza_arhiv'];
echo '</a>';
echo '</li>';
@@ -1820,50 +1744,45 @@ class SurveyAdmin
echo '<ul class="secondNavigation">';
// podatki
- echo '<li>';
- echo '<a class="no-img side-left' . ((($_GET['m'] == 'view' || $_GET['m'] == '' || $_GET['m'] == M_COLLECT_DATA_QUICKEDIT || $_GET['m'] == M_COLLECT_DATA_VARIABLE_VIEW || $_GET['m'] == M_COLLECT_DATA_QUICKEDIT) && $_GET['a'] != A_COLLECT_DATA_EXPORT) ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '" title="' . $lang['srv_link_data_browse'] . '">';
+ echo '<li class="'.((($_GET['m'] == 'view' || $_GET['m'] == '' || $_GET['m'] == M_COLLECT_DATA_QUICKEDIT || $_GET['m'] == M_COLLECT_DATA_VARIABLE_VIEW || $_GET['m'] == M_COLLECT_DATA_QUICKEDIT) && $_GET['a'] != A_COLLECT_DATA_EXPORT) ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '" title="' . $lang['srv_link_data_browse'] . '">';
echo $lang['srv_link_data_browse'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
// izracuni
- echo '<li>';
- echo '<a class="no-img' . ($_GET['m'] == M_COLLECT_DATA_CALCULATION || $_GET['m'] == M_COLLECT_DATA_CODING || $_GET['m'] == 'coding_auto' || $_GET['m'] == M_COLLECT_DATA_RECODING || $_GET['m'] == M_COLLECT_DATA_RECODING_DASHBOARD ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '&amp;m=calculation" title="' . $lang['srv_data_navigation_calculate'] . '">';
+ echo '<li class="'.($_GET['m'] == M_COLLECT_DATA_CALCULATION || $_GET['m'] == M_COLLECT_DATA_CODING || $_GET['m'] == 'coding_auto' || $_GET['m'] == M_COLLECT_DATA_RECODING || $_GET['m'] == M_COLLECT_DATA_RECODING_DASHBOARD ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '&amp;m=calculation" title="' . $lang['srv_data_navigation_calculate'] . '">';
echo $lang['srv_data_navigation_calculate'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
// uvoz
- echo '<li>';
- echo '<a class="no-img' . ($_GET['m'] == 'append' || $_GET['m'] == 'merge' || $_GET['m'] == 'upload_xls' || $_GET['m'] == 'append_xls' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '&amp;m=append" title="' . $lang['srv_data_navigation_import'] . '">';
+ echo '<li class="'.($_GET['m'] == 'append' || $_GET['m'] == 'merge' || $_GET['m'] == 'upload_xls' || $_GET['m'] == 'append_xls' ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA . '&amp;m=append" title="' . $lang['srv_data_navigation_import'] . '">';
echo $lang['srv_data_navigation_import'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
$d = new Dostop();
# izvozi
if ($d->checkDostopSub('export')) {
- echo '<li>';
- echo '<a class="no-img side-right' . ($this->second_action == NAVI_DATA_EXPORT ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA_EXPORT . '" title="' . $lang['srv_export_tab'] . '">';
+ echo '<li class="'.($this->second_action == NAVI_DATA_EXPORT ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COLLECT_DATA_EXPORT . '" title="' . $lang['srv_export_tab'] . '">';
echo $lang['srv_export_tab'] . '</a>';
echo '</li>';
}
echo '</ul>';
+
+ # link arhivi
if ($d->checkDostopSub('edit')) {
+ echo '<div class="separator"></div>';
+
echo '<ul class="secondNavigationArchive">';
- # link arhivi
- echo '<li>';
- echo '<a class="no-img ' . ($_GET['a'] == A_ARHIVI && $_GET['m'] == 'data' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '&amp;m=data" title="' . $lang['srv_arhiv_data'] . '">';
- //echo $lang['srv_analiza_arhiv'];
- echo /*'<span class="sprites archive"></span>' .*/ $lang['srv_analiza_arhiv'];
+
+ echo '<li class="'.($_GET['a'] == A_ARHIVI && $_GET['m'] == 'data' ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '&amp;m=data" title="' . $lang['srv_arhiv_data'] . '">';
+ echo $lang['srv_analiza_arhiv'];
echo '</a>';
echo '</li>';
@@ -1897,8 +1816,8 @@ class SurveyAdmin
|| isset($modules['quiz'])
|| isset($modules['social_network'])
|| isset($modules['slideshow'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_UPORABNOST . '" title="' . $lang['srv_uporabnost'] . '">' . $lang['srv_uporabnost'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_UPORABNOST . '" title="' . $lang['srv_uporabnost'] . '">' . $lang['srv_uporabnost'] . '</a></li>';
}
# vnos
if ($row['user_from_cms'] == 2 && $row['cookie'] == -1) {
@@ -1906,45 +1825,53 @@ class SurveyAdmin
$_right = (isset($modules['quiz'])
|| isset($modules['social_network'])
|| isset($modules['slideshow'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_VNOS . '" title="' . $lang['srv_vnos'] . '">' . $lang['srv_vnos'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_VNOS . '" title="' . $lang['srv_vnos'] . '">' . $lang['srv_vnos'] . '</a></li>';
}
#kviz
if (isset($modules['quiz'])) {
$_active = ($_GET['a'] == A_KVIZ) ? ' active' : '';
$_right = (isset($modules['social_network'])
|| isset($modules['slideshow'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_KVIZ . '" title="' . $lang['srv_kviz'] . '">' . $lang['srv_kviz'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_KVIZ . '" title="' . $lang['srv_kviz'] . '">' . $lang['srv_kviz'] . '</a></li>';
}
#volitve
if (isset($modules['voting'])) {
$_active = ($_GET['a'] == A_VOTING) ? ' active' : '';
$_right = (isset($modules['social_network'])
|| isset($modules['slideshow'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_VOTING . '" title="' . $lang['srv_voting'] . '">' . $lang['srv_voting'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_VOTING . '" title="' . $lang['srv_voting'] . '">' . $lang['srv_voting'] . '</a></li>';
}
#napredni parapodatki
if (isset($modules['advanced_paradata'])) {
$_active = ($_GET['a'] == A_ADVANCED_PARADATA) ? ' active' : '';
$_right = (isset($modules['advanced_paradata'])
|| isset($modules['advanced_paradata'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_PARADATA . '" title="' . $lang['srv_advanced_paradata'] . '">' . $lang['srv_advanced_paradata'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_PARADATA . '" title="' . $lang['srv_advanced_paradata'] . '">' . $lang['srv_advanced_paradata'] . '</a></li>';
+ }
+ #napredni casi po straneh
+ if (isset($modules['advanced_timestamps'])) {
+ $_active = ($_GET['a'] == A_ADVANCED_TIMESTAMPS) ? ' active' : '';
+ $_right = (isset($modules['advanced_timestamps'])
+ || isset($modules['advanced_timestamps'])) ? '' : ' side-right';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_TIMESTAMPS . '" title="' . $lang['srv_advanced_timestamps'] . '">' . $lang['srv_advanced_timestamps'] . '</a></li>';
}
# SN
if (isset($modules['social_network'])) {
$_active = ($_GET['a'] == A_SOCIAL_NETWORK) ? ' active' : '';
$_right = (isset($modules['slideshow'])) ? '' : ' side-right';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img' . $_right . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_SOCIAL_NETWORK . '" title="' . $lang['srv_vrsta_survey_type_8'] . '">' . $lang['srv_vrsta_survey_type_8'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_SOCIAL_NETWORK . '" title="' . $lang['srv_vrsta_survey_type_8'] . '">' . $lang['srv_vrsta_survey_type_8'] . '</a></li>';
}
#slideshow
if (isset($modules['slideshow'])) {
$_active = ($_GET['a'] == A_SLIDESHOW) ? ' active' : '';
- echo '<li class="space"></li>';
- echo '<li><a class="no-img side-right' . $_active . '" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_SLIDESHOW . '" title="' . $lang['srv_vrsta_survey_type_9'] . '">' . $lang['srv_vrsta_survey_type_9'] . '</a></li>';
+
+ echo '<li class="'.$_active.'"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=' . A_SLIDESHOW . '" title="' . $lang['srv_vrsta_survey_type_9'] . '">' . $lang['srv_vrsta_survey_type_9'] . '</a></li>';
}
echo '</ul>';
@@ -1958,147 +1885,37 @@ class SurveyAdmin
|| $this->first_action == 'langStatistic'
|| $this->first_action == 'usable_resp'
|| $this->first_action == 'speeder_index'
- || $this->first_action == 'reminder_tracking') {
+ || $this->first_action == 'reminder_tracking'
+ || $this->first_action == 'status_advanced') {
echo '<ul class="secondNavigation">';
# dashboard
- echo '<li>';
- echo '<a class="no-img single' . ($_GET['a'] == A_REPORTI ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI . '" title="' . $lang['srv_status_osnovni'] . '">';
+ echo '<li class="'.($_GET['a'] == A_REPORTI ? ' active' : '').'">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_REPORTI . '" title="' . $lang['srv_status_osnovni'] . '">';
echo $lang['srv_status_summary'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
# parapodatki (browser, os, js...) - volitve imajo to ugasnjeno
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')) {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_PARA_GRAPH ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PARA_GRAPH . '" title="' . $lang['srv_metapodatki'] . '">';
+ echo '<li class="' . ($_GET['a'] == A_PARA_GRAPH ? ' active' : '') . '">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PARA_GRAPH . '" title="' . $lang['srv_metapodatki'] . '">';
echo $lang['srv_metapodatki'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
}
# neodgovori in uporabnost enot
- //if ($admin_type === '0') {
# non-responses
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_NONRESPONSE_GRAPH ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_NONRESPONSE_GRAPH . '" title="' . $lang['srv_para_neodgovori'] . '">';
+ echo '<li class="' . ($_GET['a'] == A_NONRESPONSE_GRAPH ? ' active' : '') . '">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_NONRESPONSE_GRAPH . '" title="' . $lang['srv_para_neodgovori'] . '">';
echo $lang['srv_para_neodgovori'] . '</a>';
echo '</li>';
- echo '<li class="space"></li>';
- //}
- # usable respondents
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_USABLE_RESP ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_USABLE_RESP . '" title="' . $lang['srv_usable_respondents'] . '">';
- echo $lang['srv_usable_respondents'] . '</a>';
+ # Gumb za novo stran napredni statusi
+ echo '<li class="' . ($_GET['a'] == A_STATUS_ADVANCED ? ' active' : '') . '">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_STATUS_ADVANCED . '" title="' . $lang['srv_status_advanced'] . '">';
+ echo $lang['srv_status_advanced'] . '<span class="faicon arrow2_r"></span></a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- # kakovost resp - V DELU - ZAENKRAT SAMO ADMINI
- if ($admin_type === '0') {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_KAKOVOST_RESP ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_KAKOVOST_RESP . '" title="' . $lang['srv_kakovost'] . '">';
- echo $lang['srv_kakovost'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # speeder index - V DELU - ZAENKRAT SAMO ADMINI
- if ($admin_type === '0') {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_SPEEDER_INDEX ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SPEEDER_INDEX . '" title="' . $lang['srv_speeder_index'] . '">';
- echo $lang['srv_speeder_index'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # text analysis
- if ($admin_type === '0' || $admin_type === '1') {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_TEXT_ANALYSIS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEXT_ANALYSIS . '" title="' . $lang['srv_text_analysis'] . '">';
- echo $lang['srv_text_analysis'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # IP analiza lokacij - gorenje ima to ugasnjeno, volitve imajo tudi ugasnjeno
- if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_GEOIP_LOCATION ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_GEOIP_LOCATION . '" title="' . $lang['srv_geoip_location'] . '">';
- echo $lang['srv_geoip_location'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # Analize urejanja - V DELU - ZAENKRAT SAMO ADMINI
- if ($admin_type === '0') {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_EDITS_ANALYSIS ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EDITS_ANALYSIS . '" title="' . $lang['srv_edits_analysis'] . '">';
- echo $lang['srv_edits_analysis'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # reminder tracking - pokazi, ce je admin in so vklopljeni napredni parapodatki
- $survey_track_reminders = SurveySetting::getInstance()->getSurveyMiscSetting('survey_track_reminders');
- if ($survey_track_reminders == '') $survey_track_reminders = 0;
- if (($admin_type === '0' || $admin_type === '1') && SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_REMINDER_TRACKING ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_REMINDER_TRACKING . '&m='. A_REMINDER_TRACKING_RECNUM .'" title="' . $lang['srv_reminder_tracking'] . '">';
- echo $lang['srv_reminder_tracking'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # ul evalvacija
- if (Common::checkModule('evalvacija') == '1') {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == A_UL_EVALVATION ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_UL_EVALVATION . '" title="UL evalvacije">';
- echo 'UL evalvacije</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # AAPOR
- #aapor naj bo viden samo če so vabila
- if (SurveyInfo::getSurveyColumn('user_base') == 1 || SurveyInfo::getInstance()->checkSurveyModule('email')) {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == 'AAPOR' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=AAPOR&m=aapor1" title="' . $lang['srv_aapor'] . '">';
- echo $lang['srv_aapor'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
-
- # langStatistic
- #langStatistic naj bo viden samo če imamo različne jezike in nimamo volitev
- if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) {
-
- $qry_string = "SELECT language FROM srv_user WHERE ank_id = '" . $this->anketa . "' AND preview = '0' AND deleted='0' group by language";
- $qry = (sisplet_query($qry_string));
- $cntLang = mysqli_num_rows($qry);
-
- if ($cntLang > 1) {
- echo '<li>';
- echo '<a class="no-img' . ($_GET['a'] == 'langStatistic' ? ' active' : '') . '"'
- . ' href="index.php?anketa=' . $this->anketa . '&amp;a=langStatistic" title="' . $lang['srv_languages_statistics'] . '">';
- echo $lang['srv_languages_statistics'] . '</a>';
- echo '</li>';
- echo '<li class="space"></li>';
- }
- }
echo '</ul>';
}
@@ -2107,14 +1924,14 @@ class SurveyAdmin
#quicksettings
if ($_GET['a'] == 'quicksettings') {
echo '<ul class="secondNavigation">';
- echo '<li><a class="no-img single active" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=' . A_QUICK_SETTINGS . '" title="' . $lang['srv_settings_quick'] . '">' . $lang['srv_settings_quick'] . '</a></li>';
+ echo '<li class="active"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&a=' . A_QUICK_SETTINGS . '" title="' . $lang['srv_settings_quick'] . '">' . $lang['srv_settings_quick'] . '</a></li>';
echo '</ul>';
}
if ($_GET['a'] == 'data' && $_GET['m'] == 'monitoring') {
echo '<ul class="secondNavigation">';
- echo '<li><a class="no-img single active" href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=data&m=monitoring" title="' . $lang['srv_monitoring'] . '">' . $lang['srv_monitoring'] . '</a></li>';
+ echo '<li class="active"><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->anketa . '&amp;a=data&m=monitoring" title="' . $lang['srv_monitoring'] . '">' . $lang['srv_monitoring'] . '</a></li>';
echo '</ul>';
}
@@ -2123,6 +1940,7 @@ class SurveyAdmin
if($hierarhija_type < 5) {
echo '<div id="secondNavigation_links">';
+
# Ikonce za delete, copy ....
$d = new Dostop();
if ($d->checkDostopAktiven()) {
@@ -2192,10 +2010,6 @@ class SurveyAdmin
$podstran = M_ANALYSIS_SUMMARY;
}
}
- // Zavihki STATUS
- elseif($_GET['a'] == 'reporti'){
- $podstran = 'status';
- }
elseif($_GET['a'] == 'usable_resp'){
$podstran = 'usable_resp';
}
@@ -2221,29 +2035,159 @@ class SurveyAdmin
}
}
+
+ // Priakz footerja
+ private function displayFooter(){
+ global $lang;
+ global $site_frontend;
+ global $mysql_database_name;
+ global $admin_type;
+
+
+ echo '<footer id="srv_footer"'.(($this->hide_header == "hide_header") ? 'class="displayNone"' : '').'>';
+
+ // Leva stran footerja
+ echo '<div class="footer_left">';
+
+ // Custom footer
+ if(AppSettings::getInstance()->getSetting('app_settings-footer_custom') !== false){
+ echo '<div class="footer_line">';
+ echo AppSettings::getInstance()->getSetting('app_settings-footer_text');
+ echo '</div>';
+ }
+ // Default footer
+ else{
+
+ // First left line - links
+ echo '<div class="footer_line">';
+
+ echo $lang['srv_footer_links'];
+
+ if(isAAI())
+ echo '<span class="footer_item"><a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank">'.$lang['aa4'].'</a></span>';
+
+ echo '</div>';
+
+
+ // Second left line - version...
+ echo '<div class="footer_line">';
+
+ // Verzijo izpišemo samo za admine
+ if ($admin_type == 0) {
+
+ // Verzija 1ka
+ $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what='version' LIMIT 1", "obj");
+ if (!empty($sqlVersion)) {
+ echo '<span class="footer_item">'.$lang['srv_footer_1ka_version'].': ' . $sqlVersion->value . '</span>';
+ }
+
+ // Verzija Drupal
+ if ($site_frontend == 'drupal') {
+ $sqlDrupal = sisplet_query("SELECT value FROM misc WHERE what='drupal version'", "obj");
+ if (!empty($sqlDrupal)) {
+ echo '<span class="footer_item">Drupal: ' . $sqlDrupal->value . '</span>';
+ }
+ }
+ }
+
+ echo '<span class="footer_item">Copyright (©) 2002-'.date('Y').' '.$lang['srv_footer_copyright'].'</span>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ // Desna stran footerja - report a bug
+ echo '<div id="reportabug" class="footer_right">';
+
+ // www.1ka.si ima se link na go instrukcije
+ if($mysql_database_name == 'real1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'test21kasi'){
+
+ echo '<a href="#" onClick="consultingPopupOpen();"><span class="faicon external_link"></span> '.$lang['srv_svetovanje'].'</a>';
+ echo '<br>';
+ }
+
+ // Posebej report buga za gorenje
+ if (Common::checkModule('gorenje')){
+ echo '<a href="https://helpdesk.gorenje.com/SubmitSR.jsp" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+ }
+ /*elseif(isAAI()){
+ echo '<a href="https://www.1ka.si/help1KA" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+ }*/
+ else{
+ // Slovenski jezik
+ if ($lang['id'] == 1){
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+
+ // Zacasen gumb na desni
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032" target="_blank"><div class="right_help_button">'.$lang['srv_footer_reportabug2'].'</div></a>';
+ }
+ // Angleski jezik
+ else{
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+
+ // Zacasen gumb na desni
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"><div class="right_help_button">'.$lang['srv_footer_reportabug2'].'</div></a>';
+ }
+ }
+
+ echo '</div>';
+
+
+ echo '</footer>';
+ }
+
+
// Pohendla prikazovanje vsebine ankete
private function displayAnketa(){
global $global_user_id;
- // Prikazemo meni na levi po potrebi glede na podstran
- $this->displayLeftMenu();
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
- if(!$userAccess->checkUserAccess()){
-
- $userAccess->displayNoAccess();
+ // Preverimo, ce ima uporabnik dostop do te podstrani
+ $d = new Dostop();
+ if(!$d->checkDostopSubFromNavigation($this->first_action)){
+ $d->displayDostopNoAccess();
return;
}
- // Prikazemo glavni del urejanja ankete
- $this->displayAnketaMain();
+ // Imamo levi meni
+ if($this->layout_menu == 'menu_left'){
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ // Prikazemo meni na levi po potrebi glede na podstran
+ echo '<div class="layout_left_item '.(!$userAccess->checkUserAccess('komentarji') ? 'user_access_locked' : '').'">';
+ $this->displayLeftMenu();
+ echo '</div>';
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess()){
+ $userAccess->displayNoAccess();
+ return;
+ }
+
+ // Prikazemo glavni del urejanja ankete
+ echo '<div class="layout_right_item">';
+ $this->displayAnketaMain();
+ echo '</div>';
+ }
+ // Ni levega menija
+ else{
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess()){
+ $userAccess->displayNoAccess();
+ return;
+ }
+
+ // Prikazemo glavni del urejanja ankete
+ $this->displayAnketaMain();
+ }
}
// Prikazemo glavni del urejanja ankete
private function displayAnketaMain(){
-
- echo '<div class="anketa_edit_main">';
// Ustrezno redirectamo anketo na ustrezno stran
if ($_GET['a'] == 'redirectLink') {
@@ -2319,12 +2263,12 @@ class SurveyAdmin
}
}
- echo '</div>';
}
// Prikazemo levi meni po potrebi
private function displayLeftMenu(){
-
+ global $lang, $global_user_id;
+ $userAccess = UserAccess::getInstance($global_user_id);
$hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null);
// Levi meni v nastavitvah ankete
@@ -2339,6 +2283,7 @@ class SurveyAdmin
|| $_GET['a'] == 'forma'
|| $_GET['a'] == 'metadata'
|| $_GET['a'] == 'mobile_settings'
+ || $_GET['a'] == 'table_settings'
|| $_GET['a'] == A_PRIKAZ
|| $_GET['a'] == A_MISSING
|| $_GET['a'] == A_SKUPINE
@@ -2353,6 +2298,7 @@ class SurveyAdmin
|| $_GET['a'] == A_TELEPHONE
|| $_GET['a'] == A_CHAT
|| $_GET['a'] == A_PANEL
+ || $_GET['a'] == A_EMAIL_ACCESS
|| $_GET['a'] == A_FIELDWORK
|| $_GET['a'] == A_MAZA
|| $_GET['a'] == A_WPN
@@ -2370,29 +2316,25 @@ class SurveyAdmin
|| $_GET['a'] == 'mju'
|| $_GET['a'] == 'excell_matrix'
|| $_GET['a'] == 'advanced_paradata'
+ || $_GET['a'] == 'advanced_timestamps'
|| $_GET['a'] == 'json_survey_export'
){
- echo '<div class="anketa_edit_left" '.($this->isAnketar ? ' style="display:none;"' : '').'>';
+ if ($this->isAnketar) {
+ return;
+ }
- echo '<div id="globalSetingsLinks" class="globalSetingsLinks baseSettings">';
$this->showGlobalSettingsLinks();
- echo '</div>';
if ($this->survey_type > 1) {
- echo '<div id="globalSetingsLinks" class="globalSetingsLinks advancedModules" '.($this->isAnketar ? ' style="display:none;"' : '').'>';
$this->showAdvancedModulesLinks();
- echo '</div>';
}
- echo '<div id="globalSetingsLinks" class="globalSetingsLinks aditionalSettings" '.($this->isAnketar ? ' style="display:none;"' : '').'>';
$this->showAdditionalSettingsLinks();
- echo '</div>';
- echo '</div>';
}
// Uvoz podatkov levi meni
- elseif ($_GET['a'] == A_COLLECT_DATA && in_array($_GET['m'], ['append', 'merge', 'upload_xls', 'append_xls'])) {
+ elseif ($_GET['a'] == A_COLLECT_DATA && in_array($_GET['m'], ['append', 'merge', 'upload_xls', 'append_xls', 'merge_xls'])) {
echo '<div class="anketa_edit_left">';
@@ -2426,18 +2368,20 @@ class SurveyAdmin
// Arhiv levi meni
elseif(in_array($_GET['a'], ['arhivi', 'tracking', 'tracking-hierarhija']) || in_array($_GET['m'], ['anal_arch', 'view_archive'])){
- echo '<div class="anketa_edit_left">';
+ //echo '<span class="menu_left-title title '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').'">'.$lang['srv_arhivi'].'</span>';
echo '<div id="globalSetingsLinks" class="globalSetingsLinks archive">';
$SSH = new SurveyStaticHtml($this->anketa);
$SSH->displayArchiveNavigation();
echo '</div>';
- echo '</div>';
}
+
}
private function displayAnketaTabStatus(){
+ global $lang;
+ global $admin_type;
// Osnovni statusi
if ($_GET['a'] == A_REPORTI) {
@@ -2534,13 +2478,122 @@ class SurveyAdmin
echo ' <div id="surveyStatistic">';
$ss->DisplayLangStatistic();
echo ' </div>';
- }
+ }
+ //prikaze napredne statuse
+ elseif ($_GET['a'] == A_STATUS_ADVANCED) {
+ echo '<div class="status_advanced">';
+
+ // Uporabni respondenti
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_USABLE_RESP ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_USABLE_RESP . '" title="' . $lang['srv_usable_respondents'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box1" id="status_advanced_box1" >';
+ echo $lang['srv_usable_respondents'];
+ echo '</div> </a>';
+
+ // Kakovost respondentov - v delu, zaenkrat samo admini
+ if ($admin_type === '0') {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_KAKOVOST_RESP ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_KAKOVOST_RESP . '" title="' . $lang['srv_kakovost'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box2" id="status_advanced_box2" >';
+ echo $lang['srv_kakovost'];
+ echo '</div> </a>';
+
+ }
+
+ // Index hitrosti - v delu, zaenkrat samo admini
+ if ($admin_type === '0') {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_SPEEDER_INDEX ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SPEEDER_INDEX . '" title="' . $lang['srv_speeder_index'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box3" id="status_advanced_box3" >';
+ echo $lang['srv_speeder_index'];
+ echo '</div> </a>';
+
+ }
+
+ // Analiza besedil
+ if ($admin_type === '0' || $admin_type === '1') {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_TEXT_ANALYSIS ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEXT_ANALYSIS . '" title="' . $lang['srv_text_analysis'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box4" id="status_advanced_box4" >';
+ echo $lang['srv_text_analysis'];
+ echo '</div> </a>';
+ }
+
+ // IP lokacija - gorenje ima to ugasnjeno, volitve imajo tudi ugasnjeno
+ if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_GEOIP_LOCATION ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_GEOIP_LOCATION . '" title="' . $lang['srv_geoip_location'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box5" id="status_advanced_box5" >';
+ echo $lang['srv_geoip_location'];
+ echo '</div> </a>';
+ }
+
+ // Analize urejanja - v delu, zaenkrat samo admini
+ if ($admin_type === '0') {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_EDITS_ANALYSIS ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EDITS_ANALYSIS . '" title="' . $lang['srv_edits_analysis'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box6" id="status_advanced_box6" >';
+ echo $lang['srv_edits_analysis'];
+ echo '</div> </a>';
+ }
+
+ // reminder tracking - pokazi, ce je admin in so vklopljeni napredni parapodatki
+ $survey_track_reminders = SurveySetting::getInstance()->getSurveyMiscSetting('survey_track_reminders');
+ if ($survey_track_reminders == '') $survey_track_reminders = 0;
+ if (($admin_type === '0' || $admin_type === '1') && SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_REMINDER_TRACKING ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_REMINDER_TRACKING . '&m='. A_REMINDER_TRACKING_RECNUM .'" title="' . $lang['srv_reminder_tracking'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box7" id="status_advanced_box7" >';
+ echo $lang['srv_reminder_tracking'];
+ echo '</div> </a>';
+ }
+
+ // ul evalvacija
+ if (Common::checkModule('evalvacija') == '1') {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == A_UL_EVALVATION ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_UL_EVALVATION . '" title="UL evalvacije">';
+ echo '<div class="status_advanced_box" name="status_advanced_box8" id="status_advanced_box8" >';
+ echo 'UL evalvacije';
+ echo '</div> </a>';
+ }
+
+ // AAPOR
+ // aapor naj bo viden samo če so vabila
+ if (SurveyInfo::getSurveyColumn('user_base') == 1 || SurveyInfo::getInstance()->checkSurveyModule('email')) {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == 'AAPOR' ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=AAPOR&m=aapor1" title="' . $lang['srv_aapor'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box9" id="status_advanced_box9" >';
+ echo $lang['srv_aapor'];
+ echo '</div> </a>';
+ }
+
+ // langStatistic
+ // langStatistic naj bo viden samo če imamo različne jezike in nimamo volitev
+ if (!Common::checkModule('gorenje') && !SurveyInfo::getInstance()->checkSurveyModule('voting')) {
+
+ $qry_string = "SELECT language FROM srv_user WHERE ank_id = '" . $this->anketa . "' AND preview = '0' AND deleted='0' group by language";
+ $qry = (sisplet_query($qry_string));
+ $cntLang = mysqli_num_rows($qry);
+
+ if ($cntLang > 1) {
+ echo '<a class="status_advanced_link' . ($_GET['a'] == 'langStatistic' ? ' active' : '') . '"'
+ . ' href="index.php?anketa=' . $this->anketa . '&amp;a=langStatistic" title="' . $lang['srv_languages_statistics'] . '">';
+ echo '<div class="status_advanced_box" name="status_advanced_box10" id="status_advanced_box10" >';
+ echo $lang['srv_languages_statistics'];
+ echo '</div> </a>';
+ }
+ }
+
+ echo '</div>';
+ }
}
private function displayAnketaTabUrejanje(){
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+
// Prikaze branching
- if ($_GET['a'] == 'branching' || !isset($_GET['a']) || $_GET['a'] == '') {
+ if ($a == 'branching' || $a == '') {
$bn = new Branching($this->anketa);
$bn->display_new();
@@ -2549,86 +2602,89 @@ class SurveyAdmin
$hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null);
- echo '<div id="globalSetingsList" '.(($_GET['a'] != 'prevajanje' && $_GET['a'] != 'prevajanje2' && $_GET['a'] != A_TEMA && $_GET['a'] != 'theme-editor') ? '' : ' class="full_width"').'>';
+ echo '<div id="globalSetingsList" '.(($a != 'prevajanje' && $a != 'prevajanje2' && $a != A_TEMA && $a != 'theme-editor') ? '' : ' class="full_width"').'>';
// Prikaze nastavitve
- if ($_GET['a'] == 'nastavitve'
- || $_GET['a'] == 'urejanje'
- || $_GET['a'] == 'dostop'
- || $_GET['a'] == 'jezik'
- || $_GET['a'] == 'osn_pod'
- || $_GET['a'] == 'piskot'
- || $_GET['a'] == 'trajanje'
- || $_GET['a'] == 'forma'
- || $_GET['a'] == 'metadata'
- || $_GET['a'] == 'mobile_settings'
- || $_GET['a'] == A_PRIKAZ
- || $_GET['a'] == A_EXPORTSETTINGS
- || $_GET['a'] == A_GDPR
+ if ($a == 'nastavitve'
+ || $a == 'urejanje'
+ || $a == 'dostop'
+ || $a == 'jezik'
+ || $a == 'osn_pod'
+ || $a == 'piskot'
+ || $a == 'trajanje'
+ || $a == 'forma'
+ || $a == 'metadata'
+ || $a == 'mobile_settings'
+ || $a == 'table_settings'
+ || $a == A_PRIKAZ
+ || $a == A_EXPORTSETTINGS
+ || $a == A_GDPR
) {
$sas = new SurveyAdminSettings();
$sas->anketa_nastavitve_global();
}
- elseif ($_GET['a'] == 'prevajanje' || $_GET['a'] == 'prevajanje2') {
+ elseif ($a == 'prevajanje' || $a == 'prevajanje2') {
$p = new Prevajanje($this->anketa);
$p->prevajaj();
}
- elseif ($_GET['a'] == 'tema') {
+ elseif ($a == 'tema') {
$st = new SurveyTheme($this->anketa);
$st->displayGroup();
}
- elseif ($_GET['a'] == 'theme-editor') {
+ elseif ($a == 'theme-editor') {
$ste = new SurveyTheme($this->anketa);
$ste->displayEditing();
}
// nastavitve manjkajočih vrednosti za anketos
- elseif ($_GET['a'] == A_MISSING) {
+ elseif ($a == A_MISSING) {
$smv = new SurveyMissingValues($this->anketa);
$smv->displayMissingForSurvey();
}
// skupine respondentov
- elseif ($_GET['a'] == A_SKUPINE) {
+ elseif ($a == A_SKUPINE) {
$ss = new SurveySkupine($this->anketa);
$ss->displayEdit();
}
// prikaze nastavitve za obvescanje
- elseif ($_GET['a'] == 'alert') {
+ elseif ($a == 'alert') {
$sas = new SurveyAdminSettings();
$sas->alert_nastavitve();
}
// Prikaze urejanje teme
- elseif ($_GET['a'] == 'edit_css') {
+ elseif ($a == 'edit_css') {
$sas = new SurveyAdminSettings();
$sas->anketa_editcss();
}
// Napredni moduli
- elseif ($_GET['a'] == 'uporabnost'
- || ($_GET['a'] == 'hierarhija_superadmin' && $hierarhija_type < 5)
- || $_GET['a'] == 'kviz'
- || $_GET['a'] == 'voting'
- || $_GET['a'] == 'slideshow'
- || $_GET['a'] == 'vnos'
- || $_GET['a'] == A_TELEPHONE
- || $_GET['a'] == A_CHAT
- || $_GET['a'] == A_PANEL
- || $_GET['a'] == A_FIELDWORK
- || $_GET['a'] == A_MAZA
- || $_GET['a'] == A_WPN
- || $_GET['a'] == 'social_network'
- || $_GET['a'] == A_360
- || $_GET['a'] == A_360_1KA
- || $_GET['a'] == 'evoli'
- || $_GET['a'] == 'evoli_teammeter'
- || $_GET['a'] == 'evoli_quality_climate'
- || $_GET['a'] == 'evoli_teamship_meter'
- || $_GET['a'] == 'evoli_organizational_employeeship_meter'
- || $_GET['a'] == 'evoli_employmeter'
- || $_GET['a'] == 'mfdps'
- || $_GET['a'] == 'borza'
- || $_GET['a'] == 'mju'
- || $_GET['a'] == 'excell_matrix'
- || $_GET['a'] == 'advanced_paradata'
- || $_GET['a'] == 'json_survey_export'
+ elseif ($a == 'uporabnost'
+ || ($a == 'hierarhija_superadmin' && $hierarhija_type < 5)
+ || $a == 'kviz'
+ || $a == 'voting'
+ || $a == 'slideshow'
+ || $a == 'vnos'
+ || $a == A_TELEPHONE
+ || $a == A_CHAT
+ || $a == A_PANEL
+ || $a == A_EMAIL_ACCESS
+ || $a == A_FIELDWORK
+ || $a == A_MAZA
+ || $a == A_WPN
+ || $a == 'social_network'
+ || $a == A_360
+ || $a == A_360_1KA
+ || $a == 'evoli'
+ || $a == 'evoli_teammeter'
+ || $a == 'evoli_quality_climate'
+ || $a == 'evoli_teamship_meter'
+ || $a == 'evoli_organizational_employeeship_meter'
+ || $a == 'evoli_employmeter'
+ || $a == 'mfdps'
+ || $a == 'borza'
+ || $a == 'mju'
+ || $a == 'excell_matrix'
+ || $a == 'advanced_paradata'
+ || $a == 'advanced_timestamps'
+ || $a == 'json_survey_export'
) {
$sas = new SurveyAdminSettings();
$sas->showAdvancedModules();
@@ -2640,37 +2696,42 @@ class SurveyAdmin
}
private function displayAnketaTabTestiranje(){
- if ($_GET['a'] == 'komentarji') {
- $sas = new SurveyAdminSettings();
- $sas->testiranje_komentarji();
- }
- elseif ($_GET['a'] == 'komentarji_anketa') {
- $sas = new SurveyAdminSettings();
- $sas->testiranje_komentarji_anketa();
+
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+
+ if($a == 'komentarji' || $a == 'komentarji_anketa'){
+ $sc = new SurveyComments($this->anketa);
+ $sc->display_komentarji();
}
- elseif (trim($_GET['m']) == '' || $_GET['m'] == 'diagnostika') {
+ elseif (trim($m) == '' || $m == 'diagnostika') {
$sd = new SurveyDiagnostics($this->anketa);
$sd->doDiagnostics();
$sd->displayDiagnostic();
}
- elseif ($_GET['m'] == 'predvidenicas' || $_GET['m'] == 'cas') {
+ elseif ($m == 'predvidenicas' || $m == 'cas') {
$sas = new SurveyAdminSettings();
$sas->tabTestiranje();
}
- elseif($_GET['a'] == A_TESTIRANJE) {
+ elseif($a == A_TESTIRANJE) {
$sas = new SurveyAdminSettings();
$sas->tabTestiranje();
}
}
private function displayAnketaTabObjava(){
-
if ($_GET['a'] == A_VABILA) {
echo '<div id="vabila">';
$sas = new SurveyAdminSettings();
$sas->anketa_vabila();
echo '</div>';
}
+ elseif ($_GET['a'] == A_OTHER_INV) {
+ echo '<div id="vabila">';
+ $sas = new SurveyAdminSettings();
+ $sas->anketa_vabila_drugo();
+ echo '</div>';
+ }
elseif ($_GET['a'] == A_INVITATIONS) {
$SI = new SurveyInvitationsNew($this->anketa);
$SI->action($_GET['m']);
@@ -2763,6 +2824,11 @@ class SurveyAdmin
$spp = new SurveyAppendMerge($this->anketa);
$spp->append_xls();
}
+ elseif ($_GET['m'] == 'merge_xls') {
+
+ $spp = new SurveyAppendMerge($this->anketa);
+ $spp->merge_xls();
+ }
elseif ($_GET['m'] == 'evoli') {
// Posebno PDF porocilo za Evoli
@@ -2910,9 +2976,7 @@ class SurveyAdmin
SurveyAnalysis::Init($this->anketa);
SurveyAnalysis::DisplayFilters();
- if ($_GET['m'] == M_ANALYSIS_CROSSTAB) {
- echo '<br class="clr"/>';
- }
+
echo '<div id="div_analiza_data" class="' . $podstran . '">';
SurveyAnalysis::Display();
echo '</div>'; // div_analiza_data
@@ -2924,38 +2988,39 @@ class SurveyAdmin
private function displayAnketaTabArhiv(){
- echo '<div id="div_archive_content" ' . (in_array($_GET['a'], ['tracking', 'tracking-hierarhija']) ? ' class="tracking"' : '') . '>';
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+ $d = isset($_GET['d']) ? $_GET['d'] : '';
+
+
+ echo '<div id="div_archive_content" ' . (in_array($a, ['tracking', 'tracking-hierarhija']) ? ' class="tracking"' : '') . '>';
$sas = new SurveyAdminSettings();
- if ($_GET['m'] == 'data') {
+ if ($m == 'data') {
$sas->arhivi_data();
-
}
- else if ($_GET['m'] == 'testdata') {
+ else if ($m == 'testdata') {
$sas->arhivi_testdata();
-
}
- else if ($_GET['m'] == 'survey' || $_GET['m'] == 'survey_data') {
+ else if ($m == 'survey' || $m == 'survey_data') {
$sas->arhivi_survey();
-
}
- else if ($_GET['a'] == 'tracking') {
- if($_GET['d'] == 'download')
+ else if ($a == 'tracking') {
+ if($d == 'download')
return TrackingClass::init()->filter([20,21,22])->csvExport();
TrackingClass::init()->filter([20,21,22])->trackingDisplay();
-
}
- else if ($_GET['a'] == 'tracking-hierarhija') {
- if($_GET['m'] == 'udelezenci') {
- if ($_GET['d'] == 'download')
+ else if ($a == 'tracking-hierarhija') {
+ if($m == 'udelezenci') {
+ if ($d == 'download')
return TrackingClass::init()->filter(22, true)->csvExport();
return TrackingClass::init()->filter(22, true)->trackingDisplay();
}
- if ($_GET['d'] == 'download')
+ if ($d == 'download')
return TrackingClass::init()->filter([20,21], true)->csvExport();
return TrackingClass::init()->filter([20,21], true)->trackingDisplay();
@@ -3032,33 +3097,47 @@ class SurveyAdmin
global $admin_type;
global $global_user_id;
- if (trim($_GET['m']) == '') {
- $_GET['m'] = M_EXPORT_SPSS;
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ if(!$userAccess->checkUserAccess('data_export')){
+ echo '<div class="data user_access_locked locked">';
+ }
+
+
+ if (!isset($_GET['m']) || trim($_GET['m']) == '') {
+ $_GET['m'] = M_EXPORT_EXCEL_XLS;
}
- echo '<ul>';
+ echo '<span class="menu_left-title">'.$lang['srv_survey_archives'].'</span>';
+
+ echo '<ul class="menu_left-list">';
+
+ # EXCEL - XLS
+ echo '<li ' . ($_GET['m'] == M_EXPORT_EXCEL_XLS ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_EXCEL_XLS . '" title="' . $lang['srv_lnk_excel_xls'] . '">' . $lang['srv_lnk_excel_xls'] . '</a></li> ';
+
# SPSS
- echo '<li ' . ($_GET['m'] == M_EXPORT_SPSS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_SPSS . '" title="' . $lang['srv_lnk_spss'] . '"><span>' . $lang['srv_lnk_spss'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == M_EXPORT_SPSS ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_SPSS . '" title="' . $lang['srv_lnk_spss'] . '">' . $lang['srv_lnk_spss'] . '</a></li> ';
# SPSS SAV
- echo '<li ' . ($_GET['m'] == M_EXPORT_SAV ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_SAV . '" title="' . $lang['srv_lnk_sav'] . '"><span>' . $lang['srv_lnk_sav'] . '</span></a></li> ';
-
- # EXCEL - XLS
- echo '<li ' . ($_GET['m'] == M_EXPORT_EXCEL_XLS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_EXCEL_XLS . '" title="' . $lang['srv_lnk_excel_xls'] . '"><span>' . $lang['srv_lnk_excel_xls'] . '</span></a></li> ';
+ //echo '<li ' . ($_GET['m'] == M_EXPORT_SAV ? ' class="active"' : '') . '>';
+ //echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_SAV . '" title="' . $lang['srv_lnk_sav'] . '">' . $lang['srv_lnk_sav'] . '</a></li> ';
# EXCEL - CSV
- echo '<li ' . ($_GET['m'] == M_EXPORT_EXCEL ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_EXCEL . '" title="' . $lang['srv_lnk_excel'] . '"><span>' . $lang['srv_lnk_excel'] . '</span></a></li> ';
+ //echo '<li ' . ($_GET['m'] == M_EXPORT_EXCEL ? ' class="active"' : '') . '>';
+ //echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_EXCEL . '" title="' . $lang['srv_lnk_excel'] . '">' . $lang['srv_lnk_excel'] . '</a></li> ';
# TXT
- echo '<li ' . ($_GET['m'] == M_EXPORT_TXT ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_TXT . '" title="' . $lang['srv_lnk_txt'] . '"><span>' . $lang['srv_lnk_txt'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == M_EXPORT_TXT ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA_EXPORT . '&m=' . M_EXPORT_TXT . '" title="' . $lang['srv_lnk_txt'] . '">' . $lang['srv_lnk_txt'] . '</a></li> ';
echo '</ul>';
+
+ if(!$userAccess->checkUserAccess('data_export')){
+ echo '</div>';
+ }
}
function showcalculationsLinks(){
@@ -3067,25 +3146,37 @@ class SurveyAdmin
global $site_path;
global $admin_type;
global $global_user_id;
+
+ $userAccess = UserAccess::getInstance($global_user_id);
- echo '<ul>';
+ if(!$userAccess->checkUserAccess('data_calculation')){
+ echo '<div class="data user_access_locked locked">';
+ }
+
+ echo '<span class="menu_left-title">'.$lang['srv_data_navigation_calculate'].'</span>';
+
+ echo '<ul class="menu_left-list">';
# kalkulacija - nove spremenljivke
- echo '<li ' . ($_GET['m'] == M_COLLECT_DATA_CALCULATION ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_CALCULATION . '" title="' . $lang['srv_data_subnavigation_calculaion'] . '"><span>' . $lang['srv_data_subnavigation_calculaion'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == M_COLLECT_DATA_CALCULATION ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_CALCULATION . '" title="' . $lang['srv_data_subnavigation_calculaion'] . '">' . $lang['srv_data_subnavigation_calculaion'] . '</a></li> ';
# kodiranje - coding
- echo '<li ' . ($_GET['m'] == 'coding_auto' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=coding_auto" title="' . $lang['srv_auto_coding'] . '"><span>' . $lang['srv_auto_coding'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == 'coding_auto' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=coding_auto" title="' . $lang['srv_auto_coding'] . '">' . $lang['srv_auto_coding'] . '</a></li> ';
# kodiranje - coding
- echo '<li ' . ($_GET['m'] == 'coding' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=coding" title="' . $lang['srv_hand_coding'] . '"><span>' . $lang['srv_hand_coding'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == 'coding' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=coding" title="' . $lang['srv_hand_coding'] . '">' . $lang['srv_hand_coding'] . '</a></li> ';
# rekodiranje - recoding
- echo '<li ' . ($_GET['m'] == M_COLLECT_DATA_RECODING || $_GET['m'] == M_COLLECT_DATA_RECODING_DASHBOARD ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_RECODING . '" title="' . $lang['srv_data_subnavigation_recode'] . '"><span>' . $lang['srv_data_subnavigation_recode'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == M_COLLECT_DATA_RECODING || $_GET['m'] == M_COLLECT_DATA_RECODING_DASHBOARD ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_RECODING . '" title="' . $lang['srv_data_subnavigation_recode'] . '">' . $lang['srv_data_subnavigation_recode'] . '</a></li> ';
echo '</ul>';
+
+ if(!$userAccess->checkUserAccess('data_calculation')){
+ echo '</div>';
+ }
}
function showImportLinks(){
@@ -3095,17 +3186,29 @@ class SurveyAdmin
global $admin_type;
global $global_user_id;
- echo '<ul>';
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ if(!$userAccess->checkUserAccess('data_append')){
+ echo '<div class="data user_access_locked locked">';
+ }
+
+ echo '<span class="menu_left-title">'.$lang['srv_data_navigation_import'].'</span>';
+
+ echo '<ul class="menu_left-list">';
# append
- echo '<li ' . ($_GET['m'] == 'append' || $_GET['m'] == 'upload_xls' || $_GET['m'] == 'append_xls' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=append" title="' . $lang['srv_data_subnavigation_append'] . '"><span>' . $lang['srv_data_subnavigation_append'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == 'append' || $_GET['m'] == 'append_xls' || ((!isset($_POST['do_merge']) || $_POST['do_merge'] == 0) && $_GET['m'] == 'upload_xls') ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=append" title="' . $lang['srv_data_subnavigation_append'] . '">' . $lang['srv_data_subnavigation_append'] . '</a></li> ';
# merge
- echo '<li ' . ($_GET['m'] == 'merge' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=merge" title="' . $lang['srv_data_subnavigation_merge'] . '"><span>' . $lang['srv_data_subnavigation_merge'] . '</span></a></li> ';
+ echo '<li ' . ($_GET['m'] == 'merge' || $_GET['m'] == 'merge_xls' || ($_GET['m'] == 'upload_xls' && (isset($_POST['do_merge']) && $_POST['do_merge'] == 1)) ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=' . A_COLLECT_DATA . '&m=merge" title="' . $lang['srv_data_subnavigation_merge'] . '">' . $lang['srv_data_subnavigation_merge'] . '</a></li> ';
echo '</ul>';
+
+ if(!$userAccess->checkUserAccess('data_append')){
+ echo '</div>';
+ }
}
function showGlobalSettingsLinks(){
@@ -3114,96 +3217,103 @@ class SurveyAdmin
global $site_path;
global $admin_type;
global $global_user_id;
+
+ $userAccess = UserAccess::getInstance($global_user_id);
$get = $_GET['a'];
$d = new Dostop();
- echo '<h2>' . $lang['srv_survey_settings'] . '</h2>';
+ //echo '<span class="menu_left-title">'.$lang['srv_survey_settings'].'</span>';
+ echo '<span class="menu_left-title ">'.$lang['srv_survey_settings'].'</span>';
- echo '<ul>';
+ echo '<ul class="menu_left-list">';
# zavihek osnovni podatki
- echo '<li ' . ($get == A_SETTINGS || $get == A_OSNOVNI_PODATKI ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_OSNOVNI_PODATKI . '" title="' . $lang['srv_osnovniPodatki2'] . '"><span>' . $lang['srv_osnovniPodatki2'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_SETTINGS || $get == A_OSNOVNI_PODATKI ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_OSNOVNI_PODATKI . '" title="' . $lang['srv_osnovniPodatki2'] . '">' . $lang['srv_osnovniPodatki2'] . '</a></li> ';
- # prikaz pri mobilnikih
- echo '<li ' . ($get == A_MOBILESETTINGS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MOBILESETTINGS . '" title="' . $lang['srv_mobile_settings'] . '"><span>' . $lang['srv_mobile_settings'] . '</span></a></li> ';
+ # prikaz pri mobilnikih - tega zaenkrat nimamo vec, mogoce s bo v prihodnosti se rabilo za kaksne dodatne nastavitve. zaenkrat so tabele v locenem razdelku, slike pa itak vedno prikazujemo
+ /*echo '<li ' . ($get == A_MOBILESETTINGS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MOBILESETTINGS . '" title="' . $lang['srv_mobile_settings'] . '">' . $lang['srv_mobile_settings'] . '</a></li> ';*/
- # tema
- # echo '<li ' . ($get == A_TEMA || $get == 'edit_css' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- # echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_TEMA.'" title="' . $lang['srv_themes'] . '"><span>' . $lang['srv_themes'] . '</span></a></li> ';
+ # prikaz tabel
+ echo '<li ' . ($get == A_TABLESETTINGS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TABLESETTINGS . '" title="' . $lang['srv_table_settings'] . '">' . $lang['srv_table_settings'] . '</a></li> ';
+
# prevajanje - jezik (standardne besede)
- echo '<li ' . ($get == A_JEZIK ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_JEZIK . '" title="' . $lang['srv_standardne_besede'] . '"><span>' . $lang['srv_standardne_besede'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_JEZIK ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_JEZIK . '" title="' . $lang['srv_standardne_besede'] . '">' . $lang['srv_standardne_besede'] . '</a></li> ';
# zavihek dostop -> uredniki
- echo '<li ' . ($get == A_DOSTOP ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_DOSTOP . '" title="' . $lang['srv_global_settnig_access_admin'] . '"><span>' . $lang['srv_global_settnig_access_admin'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_DOSTOP ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_DOSTOP . '" title="' . $lang['srv_global_settnig_access_admin'] . '">' . $lang['srv_global_settnig_access_admin'] . '</a></li> ';
# zavihek piškotek -> dostop respondenti
- echo '<li ' . ($get == A_COOKIE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COOKIE . '" title="' . $lang['srv_global_settnig_access_respondents'] . '"><span>' . $lang['srv_global_settnig_access_respondents'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_COOKIE ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_COOKIE . '" title="' . $lang['srv_global_settnig_access_respondents'] . '">' . $lang['srv_global_settnig_access_respondents'] . '</a></li> ';
# zavihek obveščanje
- echo '<li class="nonhighlight">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ALERT . '" title="' . $lang['srv_alert_link'] . '"><span ' . ($get == A_ALERT ? ' class="extended"' : '') . '>' . $lang['srv_alert_link'] . '</span></a>';
+ #echo '<li id="alert" '.(!$userAccess->checkUserAccess('alert') ? 'class="locked"' : '').' ' . ($get == A_ALERT ? 'class="active first"' : '') .'>';
+ echo '<li id="alert" '.(!$userAccess->checkUserAccess('alert') ? 'class="locked"' : '').' ' . ($get == A_ALERT ? 'class="first active"' : 'class="first"') .'>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ALERT . '" title="' . $lang['srv_alert_link'] . '">' . $lang['srv_alert_link'] . '</a>';
$tab = (!$_GET['m']) ? 'complete' : $_GET['m'];
- #echo '<h2>'.$lang['srv_notification_settings'].'</h2>';
echo '</li> ';
- echo '<ul id="sub_navi_alert"' . ($get == A_ALERT ? '' : ' class="displayNone"') . '>';
- echo '<li ' . ($get == A_ALERT && (!$tab || $tab == 'complete') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=complete" title="' . $lang['srv_alert_completed'] . '"><span>' . $lang['srv_alert_completed'] . '</span></a></li> ';
- echo '<li ' . (($tab == 'expired') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=expired" title="' . $lang['srv_alert_expired'] . '"><span>' . $lang['srv_alert_expired'] . '</span></a></li> ';
- echo '<li ' . (($tab == 'active') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=active" title="' . $lang['srv_alert_active'] . '"><span>' . $lang['srv_alert_active'] . '</span></a></li> ';
- echo '<li ' . (($tab == 'delete') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=delete" title="' . $lang['srv_alert_delete'] . '"><span>' . $lang['srv_alert_delete'] . '</span></a></li> ';
+
+ echo '<ul ' . ($get == A_ALERT ? 'class="menu_left-list second"' : ' class="displayNone"') . '>';
+ echo '<li ' . ($get == A_ALERT && (!$tab || $tab == 'complete') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=complete" title="' . $lang['srv_alert_completed'] . '">' . $lang['srv_alert_completed'] . '</a></li> ';
+ echo '<li ' . (($tab == 'expired') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=expired" title="' . $lang['srv_alert_expired'] . '">' . $lang['srv_alert_expired'] . '</a></li> ';
+ echo '<li ' . (($tab == 'active') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=active" title="' . $lang['srv_alert_active'] . '">' . $lang['srv_alert_active'] . '</a></li> ';
+ echo '<li ' . (($tab == 'delete') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=delete" title="' . $lang['srv_alert_delete'] . '">' . $lang['srv_alert_delete'] . '</a></li> ';
// Gorenje tega nima, po novem to vidijo samo admini, ostali posiljajo preko default
if (!Common::checkModule('gorenje') && $admin_type == '0'){
- echo '<li ' . (($tab == 'email_server') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=email_server" title="' . $lang['srv_user_base_email_server_settings'] . '"><span>' . $lang['srv_user_base_email_server_settings'] . '</span></a></li> ';
+ echo '<li ' . (($tab == 'email_server') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=alert&amp;m=email_server" title="' . $lang['srv_user_base_email_server_settings'] . '">' . $lang['srv_user_base_email_server_settings'] . '</a></li> ';
}
echo '</ul>';
# zavihek trajanje
- echo '<li ' . ($get == A_TRAJANJE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TRAJANJE . '" title="' . $lang['srv_settings_activity'] . '"><span>' . $lang['srv_settings_activity'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_TRAJANJE ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TRAJANJE . '" title="' . $lang['srv_settings_activity'] . '">' . $lang['srv_settings_activity'] . '</a></li> ';
# skupine
- echo '<li ' . ($get == A_SKUPINE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SKUPINE . '" title="' . $lang['srv_skupine'] . '"><span>' . $lang['srv_skupine'] . '</span></a></li> ';
+ echo '<li id="skupine" '.(!$userAccess->checkUserAccess('skupine') ? 'class="locked"' : '').' ' . ($get == A_SKUPINE ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SKUPINE . '" title="' . $lang['srv_skupine'] . '">' . $lang['srv_skupine'] . '</a></li> ';
// Zavihek nastavitve komentarjev
if ($this->survey_type > 1) {
- echo '<li ' . (($_GET['a'] == 'urejanje') ? ' class="highlightLineTab "' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=urejanje" title="' . $lang['srv_settings_komentarji'] . '"><span>' . $lang['srv_settings_komentarji'] . '</span></a></li> ';
+ //echo '<li ' . (($_GET['a'] == 'urejanje') ? 'class="active"' : '') . '>';
+ echo '<li id="komentarji" '.(!$userAccess->checkUserAccess('komentarji') ? 'class="locked"' : '').' ' . (($_GET['a'] == 'urejanje') ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=urejanje" title="' . $lang['srv_settings_komentarji'] . '">' . $lang['srv_settings_komentarji'] . '</a></li> ';
}
if ($this->survey_type > 0) {
// zavihek prikaz podatkov
- echo '<li ' . ($get == A_PRIKAZ ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PRIKAZ . '" title="' . $lang['srv_prikaz_nastavitve'] . '"><span>' . $lang['srv_prikaz_nastavitve'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_PRIKAZ ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PRIKAZ . '" title="' . $lang['srv_prikaz_nastavitve'] . '">' . $lang['srv_prikaz_nastavitve'] . '</a></li> ';
# zavihek metapodatki
- echo '<li ' . ($get == A_METADATA ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_METADATA . '" title="' . $lang['srv_metadata'] . '"><span>' . $lang['srv_metadata'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_METADATA ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_METADATA . '" title="' . $lang['srv_metadata'] . '">' . $lang['srv_metadata'] . '</a></li> ';
- # zavihek manjkajoče vrednosti
- echo '<li ' . ($get == A_MISSING || $_GET['t'] == 'missingValues' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MISSING . '" title="' . $lang['srv_missing_values'] . '"><span>' . $lang['srv_missing_values'] . '</span></a></li> ';
+ /**# zavihek manjkajoče vrednosti
+ echo '<li ' . ($get == A_MISSING || $_GET['t'] == 'missingValues' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MISSING . '" title="' . $lang['srv_missing_values'] . '">' . $lang['srv_missing_values'] . '</a></li> ';**/
+ //Zakomentirano, ker funkcionalnost potrebuje prenovo
}
# PDF/RTF izvozi
- echo '<li ' . ($get == A_EXPORTSETTINGS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EXPORTSETTINGS . '" title="' . $lang['srv_export_settings'] . '"><span>' . $lang['srv_export_settings'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_EXPORTSETTINGS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EXPORTSETTINGS . '" title="' . $lang['srv_export_settings'] . '">' . $lang['srv_export_settings'] . '</a></li> ';
# GDPR
- echo '<li ' . ($get == A_GDPR ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_GDPR . '" title="' . $lang['srv_gdpr'] . '"><span>' . $lang['srv_gdpr'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_GDPR ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_GDPR . '" title="' . $lang['srv_gdpr'] . '">' . $lang['srv_gdpr'] . '</a></li> ';
echo '</ul>';
}
@@ -3216,51 +3326,53 @@ class SurveyAdmin
global $admin_type;
global $global_user_id;
+ $userAccess = UserAccess::getInstance($global_user_id);
+
$get = $_GET['a'];
$d = new Dostop();
- echo '<h2>' . $lang['set_links'] . '</h2>';
+ echo '<span class="menu_left-title">' . $lang['set_links'] . '</span>';
- echo '<ul>';
+ echo '<ul class="menu_left-list">';
# tema
- echo '<li ' . ($get == A_TEMA || $get == 'edit_css' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEMA . '" title="' . $lang['srv_themes'] . '"><span>' . $lang['srv_themes'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_TEMA || $get == 'edit_css' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TEMA . '" title="' . $lang['srv_themes'] . '">' . $lang['srv_themes'] . '</a></li> ';
# jezik
- echo '<li ' . ($get == A_PREVAJANJE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PREVAJANJE . '" title="' . $lang['lang'] . '"><span>' . $lang['lang'] . '</span></a></li> ';
+ echo '<li id="jezik" '.(!$userAccess->checkUserAccess('prevajanje') ? 'class="locked"' : '').' ' . ($get == A_PREVAJANJE ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PREVAJANJE . '" title="' . $lang['lang'] . '">' . $lang['lang'] . '</a></li> ';
# arhivi
- echo '<li ' . ($get == A_ARHIVI || $get == A_TRACKING ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '" title="' . $lang['srv_arhivi'] . '"><span>' . $lang['srv_arhivi'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_ARHIVI || $get == A_TRACKING ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ARHIVI . '" title="' . $lang['srv_arhivi'] . '">' . $lang['srv_arhivi'] . '</a></li> ';
# Objava
if ($d->checkDostopSub('publish')) {
- echo '<li ' . ($get == A_VABILA ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '" title="' . $lang['srv_vabila'] . '"><span>' . $lang['srv_vabila'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_VABILA ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '" title="' . $lang['srv_vabila'] . '">' . $lang['srv_vabila'] . '</a></li> ';
}
# HIERARHIJA
if ($d->checkDostopSub('analyse') && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo '<li ' . ($get == A_ANALYSIS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&m=sumarnik" title="' . $lang['srv_analiza'] . '"><span>' . $lang['srv_analiza'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_ANALYSIS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&m=sumarnik" title="' . $lang['srv_analiza'] . '">' . $lang['srv_analiza'] . '</a></li> ';
}
if ($d->checkDostopSub('analyse') && SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo '<li ' . ($get == A_ANALYSIS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_analiza'] . '"><span>' . $lang['srv_analiza'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_ANALYSIS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_analiza'] . '">' . $lang['srv_analiza'] . '</a></li> ';
}
if ($this->user_role_cehck(U_ROLE_ADMIN)) {
# Sistemske nastavitve
- echo '<li class="nonhighlight">';
- echo '<a href="index.php?a=nastavitve&m=system" title="' . $lang['srv_settingsSystem'] . '"><span>' . $lang['srv_settingsSystem'] . '</span></a></li> ';
+ echo '<li>';
+ echo '<a href="index.php?a=nastavitve&m=system" title="' . $lang['srv_settingsSystem'] . '">' . $lang['srv_settingsSystem'] . '</a></li> ';
# Nastavitve uporabnika
- echo '<li class="nonhighlight">';
- echo '<a href="index.php?a=nastavitve&m=global_user_settings" title="' . $lang['srv_user_settings'] . '"><span>' . $lang['srv_user_settings'] . '</span></a></li> ';
+ echo '<li>';
+ echo '<a href="index.php?a=nastavitve&m=global_user_settings" title="' . $lang['srv_user_settings'] . '">' . $lang['srv_user_settings'] . '</a></li> ';
}
echo '</ul>';
@@ -3285,79 +3397,100 @@ class SurveyAdmin
if ($d->checkDostopAktiven()) {
$userAccess = UserAccess::getInstance($global_user_id);
+ $user_package = $userAccess->getPackage(); // paket, ki ga ima uporabnik (1, 2 , 3)
- echo '<h2>' . $lang['srv_moduli'] . '</h2>';
+ $dostop_styling = "";
+ if ($user_package != "-1" && $user_package != "" && !$userAccess->isAnketaOld())
+ $dostop_styling = "dostop_".$user_package."ka";
- echo '<ul>';
+ if(/*!$userAccess->checkUserAccess('kviz') &&*/ $user_package==1 && $dostop_styling != ""){
+ echo '<div id="advanced_modules" >'; #zacetek napredni moduli
+ }
+ if($user_package != 3 && $dostop_styling != ""){
+ echo '<div class="'.$dostop_styling.'_locked" >'; #zacetek lock
+ }
+
+ echo '<span class="menu_left-title '.$dostop_styling.'">' . $lang['srv_moduli'] . '</span>';
+ if ($dostop_styling != "") {
+ //echo '<span class="faicon lock_close yellow"></span>';
+ }
+
+ echo '<ul class="menu_left-list '.$dostop_styling.'">';
+
+ # Kviz
+ echo '<li ' . ($get == A_KVIZ ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_KVIZ.'" title="' . $lang['srv_vrsta_survey_type_6'] . '" '.(!$userAccess->checkUserAccess($what='kviz') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_6'] . '</a></li> ';
+
+ if($user_package==2){
+ echo '<div id="advanced_modules" class="locked" >'; #zacetek zaklepa naprednih modulov 2KA
+ }
# Evalvacija
- echo '<li ' . ($get == A_UPORABNOST ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_UPORABNOST . '" title="' . $lang['srv_vrsta_survey_type_4'] . '" '.(!$userAccess->checkUserAccess($what='uporabnost') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_4'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_UPORABNOST ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_UPORABNOST . '" title="' . $lang['srv_vrsta_survey_type_4'] . '" '.(!$userAccess->checkUserAccess($what='uporabnost') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_4'] . '</a></li> ';
# Samoevalvacija hirarhija - hierarhija_superadmin
//$row_user se zacasno uporabi tudi za modul MAZA
$row_user = SurveyUserSetting::getInstance()->getUserRow();
if (\Hierarhija\HierarhijaHelper::preveriDostop($this->anketa)) {
- echo '<li ' . ($get == A_HIERARHIJA_SUPERADMIN ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
+ echo '<li ' . ($get == A_HIERARHIJA_SUPERADMIN ? 'class="active"' : '') . '>';
if(SurveyInfo::getSurveyModules('hierarhija') > 1) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&m='.M_HIERARHIJA_STATUS.'" title="' . $lang['srv_vrsta_survey_type_10'] . '"><span>' . $lang['srv_vrsta_survey_type_10'] . '</span></a></li> ';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&m='.M_HIERARHIJA_STATUS.'" title="' . $lang['srv_vrsta_survey_type_10'] . '">' . $lang['srv_vrsta_survey_type_10'] . '</a></li> ';
}else{
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&m='.M_ADMIN_UREDI_SIFRANTE.'" title="' . $lang['srv_vrsta_survey_type_10'] . '"><span>' . $lang['srv_vrsta_survey_type_10'] . '</span></a></li> ';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&m='.M_ADMIN_UREDI_SIFRANTE.'" title="' . $lang['srv_vrsta_survey_type_10'] . '">' . $lang['srv_vrsta_survey_type_10'] . '</a></li> ';
}
}
- # Vnos vprasalnikov - premaknjeno kar v nastavitve -> dostop uredniki
- /*echo '<li ' . ($get == A_VNOS ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VNOS . '" title="' . $lang['srv_vrsta_survey_type_5'] . '" '.(!$userAccess->checkUserAccess($what='vnos') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_5'] . '</span></a></li> ';*/
- # Kviz
- echo '<li ' . ($get == A_KVIZ ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_KVIZ.'" title="' . $lang['srv_vrsta_survey_type_6'] . '" '.(!$userAccess->checkUserAccess($what='kviz') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_6'] . '</span></a></li> ';
-
- # Volitve
- if ($admin_type == 0) {
- echo '<li ' . ($get == A_VOTING ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_VOTING.'" title="' . $lang['srv_vrsta_survey_type_18'] . '" '.(!$userAccess->checkUserAccess($what='voting') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_18'] . '</span></a></li> ';
- }
+ echo '<li ' . ($get == A_VOTING ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_VOTING.'" title="' . $lang['srv_vrsta_survey_type_18'] . '" '.(!$userAccess->checkUserAccess($what='voting') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_18'] . '</a></li> ';
# Socialna omrezja
- echo '<li ' . ($get == A_SOCIAL_NETWORK ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SOCIAL_NETWORK . '" title="' . $lang['srv_vrsta_survey_type_8'] . '" '.(!$userAccess->checkUserAccess($what='social_network') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_8'] . '</span></a></li> ';
-
- # Prezentacija
- echo '<li ' . ($get == A_SLIDESHOW ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SLIDESHOW . '" title="' . $lang['srv_vrsta_survey_type_9'] . '" '.(!$userAccess->checkUserAccess($what='slideshow') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_9'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_SOCIAL_NETWORK ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_SOCIAL_NETWORK . '" title="' . $lang['srv_vrsta_survey_type_8'] . '" '.(!$userAccess->checkUserAccess($what='social_network') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_8'] . '</a></li> ';
# Telefonska anketa
- echo '<li ' . ($get == A_TELEPHONE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TELEPHONE . '" title="' . $lang['srv_vrsta_survey_type_7'] . '" '.(!$userAccess->checkUserAccess($what='telephone') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_7'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_TELEPHONE ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_TELEPHONE . '" title="' . $lang['srv_vrsta_survey_type_7'] . '" '.(!$userAccess->checkUserAccess($what='telephone') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_7'] . '</a></li> ';
- # Chat
- echo '<li ' . ($get == A_CHAT ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_CHAT . '" title="' . $lang['srv_vrsta_survey_type_14'] . '" '.(!$userAccess->checkUserAccess($what='chat') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_14'] . '</span></a></li> ';
+ # Chat - se ne uporablja vec, viden je samo v anketah, kjer je vklopljen
+ /*echo '<li ' . ($get == A_CHAT ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_CHAT . '" title="' . $lang['srv_vrsta_survey_type_14'] . '" '.(!$userAccess->checkUserAccess($what='chat') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_14'] . '</a></li> ';*/
# Panel
- echo '<li ' . ($get == A_PANEL ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PANEL . '" title="' . $lang['srv_vrsta_survey_type_15'] . '" '.(!$userAccess->checkUserAccess($what='panel') ? 'class="user_access_locked"' : '').'><span>' . $lang['srv_vrsta_survey_type_15'] . '</span></a></li> ';
-
+ echo '<li ' . ($get == A_PANEL ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_PANEL . '" title="' . $lang['srv_vrsta_survey_type_15'] . '" '.(!$userAccess->checkUserAccess($what='panel') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_15'] . '</a></li> ';
+
+ # Dostop z emailom - zaenkrat samo admini
+ if ($admin_type == 0 || SurveyInfo::getInstance()->checkSurveyModule('email_access')) {
+ echo '<li ' . ($get == A_EMAIL_ACCESS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_EMAIL_ACCESS . '" title="' . $lang['srv_vrsta_survey_type_19'] . '" '.(!$userAccess->checkUserAccess($what='email_access') ? 'class="'.$dostop_styling.'"' : '').'>' . $lang['srv_vrsta_survey_type_19'] . '</a></li> ';
+ }
+
# Napredni parapodatki - samo admini oz. ce je vklopljen
if ($admin_type == 0 || SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) {
- echo '<li ' . ($get == A_ADVANCED_PARADATA ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_PARADATA . '" title="' . $lang['srv_vrsta_survey_type_16'] . '"><span>' . $lang['srv_vrsta_survey_type_16'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_ADVANCED_PARADATA ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_PARADATA . '" title="' . $lang['srv_vrsta_survey_type_16'] . '">' . $lang['srv_vrsta_survey_type_16'] . '</a></li> ';
+ }
+
+ # Napredni parapodatki - samo admini oz. ce je vklopljen
+ if ($admin_type == 0 || SurveyInfo::getInstance()->checkSurveyModule('advanced_timestamps')) {
+ echo '<li ' . ($get == A_ADVANCED_TIMESTAMPS ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_ADVANCED_TIMESTAMPS . '" title="' . $lang['srv_vrsta_survey_type_20'] . '">' . $lang['srv_vrsta_survey_type_20'] . '</a></li> ';
}
# JSON izvoz ankete - samo admini oz. ce je vklopljen
if ($admin_type == 0 || SurveyInfo::getInstance()->checkSurveyModule('json_survey_export')) {
- echo '<li ' . ($get == A_JSON_SURVEY_EXPORT ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_JSON_SURVEY_EXPORT . '" title="' . $lang['srv_vrsta_survey_type_17'] . '"><span>' . $lang['srv_vrsta_survey_type_17'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_JSON_SURVEY_EXPORT ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_JSON_SURVEY_EXPORT . '" title="' . $lang['srv_vrsta_survey_type_17'] . '">' . $lang['srv_vrsta_survey_type_17'] . '</a></li> ';
}
# Tablice, laptopi
if ($admin_type == 0 || $admin_type == 1) {
- echo '<li ' . ($get == A_FIELDWORK ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_FIELDWORK . '" title="' . $lang['srv_vrsta_survey_type_13'] . '"><span>' . $lang['srv_vrsta_survey_type_13'] .' (beta)' . '</span></a></li> ';
+ echo '<li ' . ($get == A_FIELDWORK ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_FIELDWORK . '" title="' . $lang['srv_vrsta_survey_type_13'] . '">' . $lang['srv_vrsta_survey_type_13'] .' (beta)' . '</a></li> ';
}
# Aplikacija za anketirance
@@ -3368,94 +3501,106 @@ class SurveyAdmin
($global_user_id == 1073 && $row_user['email'] == 'nejc.berzelak@fdv.uni-lj.si') ||
($global_user_id == 836 && $row_user['email'] == 'nejc.berzelak@fdv.uni-lj.si'));
if (Common::checkModule('maza') && $user_dostop) {
- echo '<li ' . ($get == A_MAZA ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MAZA . '" title="' . $lang['srv_maza'] . '"><span>' . $lang['srv_maza'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_MAZA ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_MAZA . '" title="' . $lang['srv_maza'] . '">' . $lang['srv_maza'] . '</a></li> ';
}
# 360 web push notifications - zaenkrat samo admini
if (Common::checkModule('wpn') && $admin_type == 0) {
- echo '<li ' . ($get == A_WPN ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_WPN . '" title="' . $lang['srv_wpn'] . '"><span>' . $lang['srv_wpn'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_WPN ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_WPN . '" title="' . $lang['srv_wpn'] . '">' . $lang['srv_wpn'] . '</a></li> ';
}
# 360 stopinj
if (Common::checkModule('360')) {
- echo '<li ' . ($get == A_360 ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_360 . '" title="' . $lang['srv_vrsta_survey_type_11'] . '"><span>' . $lang['srv_vrsta_survey_type_11'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_360 ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_360 . '" title="' . $lang['srv_vrsta_survey_type_11'] . '">' . $lang['srv_vrsta_survey_type_11'] . '</a></li> ';
}
# 360 stopinj 1ka - zaenkrat samo admini
if (Common::checkModule('360_1ka') && $admin_type == 0) {
- echo '<li ' . ($get == A_360_1KA ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_360_1KA . '" title="' . $lang['srv_vrsta_survey_type_12'] . '"><span>' . $lang['srv_vrsta_survey_type_12'] . '</span></a></li> ';
+ echo '<li ' . ($get == A_360_1KA ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_360_1KA . '" title="' . $lang['srv_vrsta_survey_type_12'] . '">' . $lang['srv_vrsta_survey_type_12'] . '</a></li> ';
}
# evoli
if (Common::checkModule('evoli')) {
- echo '<li ' . ($get == 'evoli' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli" title="Evoli"><span>Evoli</span></a></li> ';
+ echo '<li ' . ($get == 'evoli' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli" title="Evoli">Evoli</a></li> ';
}
# evoli - teammeter
if (Common::checkModule('evoli_teammeter')) {
- echo '<li ' . ($get == 'evoli_teammeter' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teammeter" title="Evoli team meter"><span>Evoli team meter</span></a></li> ';
+ echo '<li ' . ($get == 'evoli_teammeter' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teammeter" title="Evoli team meter">Evoli team meter</a></li> ';
}
# evoli - evoli_quality_climate
if (Common::checkModule('evoli_quality_climate')) {
- echo '<li ' . ($get == 'evoli_quality_climate' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_quality_climate" title="Evoli quality climate"><span>Evoli quality climate</span></a></li> ';
+ echo '<li ' . ($get == 'evoli_quality_climate' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_quality_climate" title="Evoli quality climate">Evoli quality climate</a></li> ';
}
# evoli - evoli_teamship_meter
if (Common::checkModule('evoli_teamship_meter')) {
- echo '<li ' . ($get == 'evoli_teamship_meter' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teamship_meter" title="Evoli teamship meter"><span>Evoli teamship meter</span></a></li> ';
+ echo '<li ' . ($get == 'evoli_teamship_meter' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_teamship_meter" title="Evoli teamship meter">Evoli teamship meter</a></li> ';
}
# evoli - evoli_organizational_employeeship_meter
if (Common::checkModule('evoli_organizational_employeeship_meter')) {
- echo '<li ' . ($get == 'evoli_organizational_employeeship_meter' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_organizational_employeeship_meter" title="Evoli organizational employeeship meter"><span>Evoli organizational employeeship meter</span></a></li> ';
+ echo '<li ' . ($get == 'evoli_organizational_employeeship_meter' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_organizational_employeeship_meter" title="Evoli organizational employeeship meter">Evoli organizational employeeship meter</a></li> ';
}
# evoli - employmeter
if (Common::checkModule('evoli_employmeter')) {
- echo '<li ' . ($get == 'evoli_employmeter' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_employmeter" title="Evoli employeeship meter"><span>Evoli employeeship meter</span></a></li> ';
+ echo '<li ' . ($get == 'evoli_employmeter' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=evoli_employmeter" title="Evoli employeeship meter">Evoli employeeship meter</a></li> ';
}
# mfdps
if (Common::checkModule('mfdps')) {
- echo '<li ' . ($get == 'mfdps' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mfdps" title="MFDPS"><span>MFDPŠ</span></a></li> ';
+ echo '<li ' . ($get == 'mfdps' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mfdps" title="MFDPS">MFDPŠ</a></li> ';
}
# borza
if (Common::checkModule('borza') && $admin_type == 0) {
- echo '<li ' . ($get == 'borza' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=borza" title="BORZA"><span>Borza</span></a></li> ';
+ echo '<li ' . ($get == 'borza' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=borza" title="BORZA"Borza</a></li> ';
}
# mju - vsi, ker je to samo na njihovi instalaciji
if (Common::checkModule('mju')) {
- echo '<li ' . ($get == 'mju' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mju" title="MJU"><span>MJU</span></a></li> ';
+ echo '<li ' . ($get == 'mju' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=mju" title="MJU">MJU</a></li> ';
}
# excelleration matrix - zaenkrat samo admini
if (Common::checkModule('excell_matrix') && $admin_type == 0) {
- echo '<li ' . ($get == 'excell_matrix' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=excell_matrix" title="Excelleration matrix"><span>Excelleration matrix</span></a></li> ';
+ echo '<li ' . ($get == 'excell_matrix' ? 'class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=excell_matrix" title="Excelleration matrix">Excelleration matrix</a></li> ';
+ }
+
+ if($user_package==2 && $dostop_styling != ""){
+ echo '</div>'; #konec zaklepa napredni moduli 2KA
}
echo '</ul>';
+
+ if($user_package != 3 && $dostop_styling != ""){
+ echo '</div>'; #konec lock
+ }
+
+ if($user_package==1 && $dostop_styling != ""){
+ echo '</div>'; #konec napredni moduli
+ }
}
}
/**
- * prikaze seznam anket in polje za dodajanje na prvi strani
+ * prikaze admin vmesnik izven specificne ankete (seznam anket in polje za dodajanje na prvi strani, nastavitve uporabnika, uporabnike...)
*
*/
private function displaySeznamAnket(){
@@ -3463,13 +3608,15 @@ class SurveyAdmin
# naložimo razred z seznamom anket
- $SL = new SurveyList();
+ $SL = ($has_folders = SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
+
$SLCount = $SL->countSurveys();
$SLCountPhone = $SL->countPhoneSurveys();
// VSEBINA POSAMEZNEGA TABA PRI MOJIH ANKETAH
- echo '<div id="moje_ankete_edit" class="page_'.$_GET['a'].' subpage_'.$_GET['t'].' '.(isset($_GET['b']) ? 'subpage_b_'.$_GET['b'] : '').' '.($SLCount == 0 ? 'page_ustvari_anketo' : '').'">';
+ echo '<div id="moje_ankete_edit" class="page_'.$_GET['a'].' subpage_'.$_GET['t'].' '.(isset($_GET['b']) ? 'subpage_b_'.$_GET['b'] : '').' '.($SLCount == 0 ? 'page_ustvari_anketo' : '').' '.$this->layout_width.' '.$this->layout_menu.'">';
// izpis pregledovanja
if ((!isset($_GET['a']) && !isset($_GET['anketa'])) || ($_GET['a'] == 'pregledovanje')) {
@@ -3483,7 +3630,7 @@ class SurveyAdmin
$newSurvey = new NewSurvey();
if (isset($_GET['b']) && $_GET['b'] == 'new_survey'){
- echo '<div id="new_anketa_div">';
+ echo '<div id="new_anketa_div" class="fullwidth menu_left">';
$newSurvey->displayNewSurveyPage();
echo '</div>';
}
@@ -3497,7 +3644,7 @@ class SurveyAdmin
// Izpis okna za ustvarjanje ankete (enako kot ce nimamo nobene ankete)
if ($_GET['a'] == 'ustvari_anketo') {
- echo '<div id="new_anketa_div">';
+ echo '<div id="new_anketa_div" class="fullwidth menu_left">';
$newSurvey = new NewSurvey();
$newSurvey->displayNewSurveyPage();
echo '</div>';
@@ -3511,7 +3658,7 @@ class SurveyAdmin
echo '</div>';
}
else {
- echo '<div id="new_anketa_div">';
+ echo '<div id="new_anketa_div" class="fullwidth menu_left">';
$newSurvey = new NewSurvey();
$newSurvey->displayNewSurveyPage();
echo '</div>';
@@ -3548,6 +3695,9 @@ class SurveyAdmin
elseif($_GET['m'] == 'all'){
$sas->allUsersList();
}
+ elseif($_GET['m'] == 'add'){
+ $sas->dodeljeniUporabniki();
+ }
else {
$sas->assignedUsersList();
}
@@ -3623,6 +3773,9 @@ class SurveyAdmin
$sas = new SurveyAdminSettings();
$sas->data_deleted();
}
+ if ($_GET['m'] == 'help_settings' && $this->user_role_cehck(U_ROLE_ADMIN)) {
+ Help::displaySettings();
+ }
if ($_GET['m'] == 'global_user_settings') {
$sas = new SurveyAdminSettings();
$sas->globalUserSettings();
@@ -3631,6 +3784,10 @@ class SurveyAdmin
$sas = new SurveyAdminSettings();
$sas->globalUserMyProfile();
}
+ if ($_GET['m'] == 'global_user_ChangeArchive') {
+ $sas = new SurveyAdminSettings();
+ $sas->globalUserChangeArchive();
+ }
echo '</div>';
}
@@ -3752,6 +3909,14 @@ class SurveyAdmin
}
}
+ // kolektor modul
+ if ($_GET['a'] == 'kolektor') {
+ echo ' <div id="kolektor">';
+ $kolektor = new Kolektor();
+ $kolektor->display();
+ echo ' </div>';
+ }
+
// Konec moje_ankete_edit
echo '</div>';
}
@@ -3762,11 +3927,10 @@ class SurveyAdmin
* vrne kodo ankete, ki se jo uporabi za embed
*
*/
- function getEmbed($js = true)
+ static function getEmbed($js = true)
{
global $site_url;
- //return '&lt;iframe id="1ka" src="'.$site_url.'main/survey/index.php?anketa='.$this->anketa.'" scrolling="auto" frameborder="0" width="100%"&gt;&lt;/iframe&gt;&lt;script type="text/javascript"&gt;function r(){var a=window.location.hash.replace("#","");if(a.length==0)return;document.getElementById("1ka").style.height=a+"px";window.location.hash=""};window.setInterval(\\\'r()\\\',100);&lt;/script&gt;';
$iframe = '<iframe id="1ka" src="' . SurveyInfo::getSurveyLink() . '" height="400px" width="100%" scrolling="auto" frameborder="0"></iframe>';
$javascript = '<script type="text/javascript">function r(){var a=window.location.hash.replace("#","");if(a.length==0)return;document.getElementById("1ka").style.height=a+"px";window.location.hash=""};window.setInterval("r()",100);</script>';
@@ -3790,32 +3954,22 @@ class SurveyAdmin
if (!$sql) return;
if (mysqli_num_rows($sql) > 0 && $hierarhija_type < 5) {
- echo '<div class="active-alert">';
-
- echo '<span class="tooltip active-editors">';
-
- echo '<a href="#" onclick="return false;">';
- echo '<span class="square green"></span>';
- echo ' <span class="active-editors">' . $lang['srv_users_viewing'] . ': <b>' . (mysqli_num_rows($sql) + 1) . '</b></span>';
- echo '</a>';
+ echo '<div class="action_note_box active-users">';
+ echo ' <span class="faicon users"></span>';
+ echo ' <span class="text">'.$lang['srv_users_viewing3'].': ' . (mysqli_num_rows($sql) + 1) . '</span>';
+ /*
if(is_null($hierarhija_type) || $hierarhija_type == 1){
- echo '<span class="expanded-tooltip bottom" id="request_help_content">';
-
- echo '<b>' . $lang['srv_users_viewing2'] . '</b><p>';
- while ($row = mysqli_fetch_array($sql)) {
- $sql1 = sisplet_query("SELECT name, surname, email FROM users WHERE id = '$row[user]'");
- if ($row1 = mysqli_fetch_array($sql1)) {
- echo '<a href="mailto:' . $row1['email'] . '" target="_blank">' . $row1['email'] . '</a> (' . $row1['name'] . ' ' . $row1['surname'] . ')<br>';
+
+ while ($row = mysqli_fetch_array($sql)) {
+ $sql1 = sisplet_query("SELECT name, surname, email FROM users WHERE id = '$row[user]'");
+ if ($row1 = mysqli_fetch_array($sql1)) {
+ echo ' <a href="mailto:' . $row1['email'] . '" target="_blank">' . $row1['email'] . '</a> (' . $row1['name'] . ' ' . $row1['surname'] . ')';
+ }
}
- }
- echo '</p>';
-
- echo '<span class="arrow"></span>';
- echo '</span>'; // expanded-tooltip bottom
}
- echo '</span>'; // request-help
+ */
echo '</div>';
}
@@ -3833,65 +3987,271 @@ class SurveyAdmin
echo '<span class="tooltip request-help">';
- echo '<a href="#" onclick="return false;" title="' . $lang['srv_request_help'] . '">';
- echo '<span class="faicon users icon-as_link"></span>';
+ echo '<a href="#" onclick="return false;">';
+ echo ' <span class="faicon users icon-as_link"></span>';
echo '</a>';
- echo '<span class="expanded-tooltip bottom light" id="request_help_content">';
+ echo '<div class="expanded-tooltip bottom" id="request_help_content">';
+ $this->tooltip_request_help();
+ echo '</div>'; // expanded-tooltip bottom
- $this->request_help_content();
-
- echo '</span>'; // expanded-tooltip bottom
echo '</span>'; // request-help
}
- function request_help_content(){
+ // Tooltip "prosi za pomoc"
+ public function tooltip_request_help(){
global $lang;
$row = SurveyInfo::getInstance()->getSurveyRow();
- echo '<b>' . $lang['srv_dostopmail_1'] . '</b>';
+ echo '<div class="expanded-tooltip-box">';
- $d = new Dostop();
+ echo ' <h1><span class="faicon users"></span>'.$lang['srv_multilang_users'].'</h1>';
+
+ $d = new Dostop();
$users = $d->getDostop();
+
if (is_countable($users[2]) && count($users[2]) > 0) {
- echo '<p><b>' . $lang['srv_users'] . ':</b> ';
- if ($d->checkDostopAktiven()) echo ' (<a href="index.php?anketa=' . $this->anketa . '&a=dostop">' . $lang['srv_add_edit'] . '</a>)';
- echo '<br>';
+
+ echo ' <div class="tooltip_line semi-bold">';
+ if ($d->checkDostopAktiven())
+ echo $lang['srv_users'].' (<a href="index.php?anketa=' . $this->anketa . '&a=dostop">'.$lang['srv_add_edit'].'</a>):';
+ else
+ echo $lang['srv_users'].':';
+ echo ' </div>';
foreach ($users[2] AS $user) {
- echo ' - ' . $user['email'] . '<br>';
+ echo ' <div class="tooltip_line">';
+ echo $user['email'];
+ echo ' </div>';
}
- echo '</p>';
}
+
if (is_countable($users[1]) && count($users[1]) > 0) {
- echo '<p><b>' . $lang['managers'] . ':</b>';
- if ($d->checkDostopAktiven()) echo ' (<a href="index.php?anketa=' . $this->anketa . '&a=dostop">' . $lang['srv_add_edit'] . '</a>)';
- echo '<br>';
+
+ echo ' <div class="tooltip_line semi-bold">';
+ echo $lang['managers'].':';
+ if ($d->checkDostopAktiven())
+ echo $lang['managers'].' (<a href="index.php?anketa=' . $this->anketa . '&a=dostop">' . $lang['srv_add_edit'] . '</a>):';
+ else
+ echo $lang['managers'].':';
+ echo ' </div>';
foreach ($users[1] AS $user) {
- echo ' - ' . $user['email'] . '<br>';
+ echo ' <div class="tooltip_line">';
+ echo $user['email'];
+ echo ' </div>';
}
- echo '</p>';
}
- echo '<p><b>' . $lang['srv_request_help_txt3'] . '</b> ' . Help::display('help-centre') . '<br>';
+
+ echo ' <div class="tooltip_line semi-bold">';
+ echo $lang['srv_request_help_txt3'].' '.Help::display('help-centre');
+ echo ' </div>';
+
+ echo ' <div class="tooltip_line">';
if ($users[0] !== false) {
- echo $lang['srv_request_help_txt4'] . ' ' . date('j.n.Y', strtotime($users[0])) . ' (<a href="#" onclick="dostop_admin(1); return false;">' . $lang['hour_remove'] . '</a>)';
- } else {
- echo '<a href="#" onclick="dostop_admin(); return false;">' . $lang['srv_dostop_admin'] . '</a>';
+ echo ' <input type="checkbox" id="add_dostop_admin" checked="checked" onclick="dostop_admin(1); return false;">';
+ echo ' <label for="add_dostop_admin">'.$lang['srv_dostop_admin'].'</label>';
+ //echo $lang['srv_request_help_txt4'] . ' ' . date('j.n.Y', strtotime($users[0])) . ' (<a href="#" onclick="dostop_admin(1); return false;">' . $lang['hour_remove'] . '</a>)';
+ }
+ else {
+ echo ' <input type="checkbox" id="add_dostop_admin" onclick="dostop_admin(); return false;">';
+ echo ' <label for="add_dostop_admin">'.$lang['srv_dostop_admin'].'</label>';
+ //echo '<a href="#" onclick="dostop_admin(); return false;">' . $lang['srv_dostop_admin'] . '</a>';
}
- echo '</p>';
+ echo ' </div>';
+
- echo '<span class="arrow"></span>';
+ echo '</div>';
}
- function displaySecondNavigationLinks($navigation = 0)
- {
+ // Tooltip "aktivnost ankete"
+ public function tooltip_survey_activity(){
+ global $lang;
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ echo '<div class="expanded-tooltip-box">';
+
+ // Aktivna
+ if($row['active'] == 1){
+ echo ' <h1><span class="faicon info"></span>'.$lang['srv_anketa_active2'].'</h1>';
+ echo ' <div class="tooltip_line">'.$lang['srv_anketa_active2_text'].'</div>';
+ }
+ // Ni aktivna
+ else{
+ echo ' <h1><span class="faicon info"></span>'.$lang['srv_anketa_noactive2'].'</h1>';
+ echo ' <div class="tooltip_line">'.$lang['srv_anketa_noactive2_text'].'</div>';
+ }
+
+ echo '</div>';
+ }
+
+ // Tooltip "zaklenjena/odklenjena anketa"
+ public function tooltip_survey_locked(){
+ global $lang;
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ echo '<div class="expanded-tooltip-box">';
+
+ // Zaklenjena
+ if($row['locked'] == 1){
+ echo ' <h1><span class="faicon info"></span>'.$lang['srv_anketa_locked'].'</h1>';
+ echo ' <div class="tooltip_line">'.$lang['srv_anketa_locked_text'].'</div>';
+ }
+ // Ni zaklenjena
+ else{
+ echo ' <h1><span class="faicon info"></span>'.$lang['srv_anketa_unlocked'].'</h1>';
+ echo ' <div class="tooltip_line">'.$lang['srv_anketa_unlocked_text'].'</div>';
+ }
+
+ echo '</div>';
+ }
+
+ // Tooltip "testni vnos"
+ public function tooltip_test_data(){
+ global $lang;
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ echo '<div class="expanded-tooltip-box">';
+
+ echo ' <h1><span class="faicon info"></span>'.$lang['srv_survey_testdata'].'</h1>';
+ echo ' <div class="tooltip_line">'.$lang['srv_testdata_text'].'</div>';
+
+ echo '</div>';
+ }
+
+ // Tooltip "predogled anekte"
+ public function tooltip_preview_data(){
+ global $lang;
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+ $link = SurveyInfo::getSurveyLink();
+
+ echo '<div class="expanded-tooltip-box">';
+
+ echo ' <h1><span class="faicon monitor"></span>'.$lang['srv_poglejanketo2'].'</h1>';
+
+ echo ' <div class="tooltip_line">'.$lang['srv_monitor_toolbox_preview'].'</div>';
+
+
+ echo ' <div class="tooltip_device">';
+
+ // Ce imamo izklopljene mobilne prilagoditve ne pustimo preview-ja na mobile, ker itak ne prikaze scalano
+ $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly');
+ if($mobile_friendly != '0'){
+
+ echo '<div class="item">';
+ echo ' <a href="' . $link . '&preview=on" title="'.$lang['srv_preview_computer'].'" target="_blank"><span class="faicon monitor"></span>'.$lang['srv_preview_computer'].'</a>';
+ echo '</div>';
+
+ echo '<div class="item separator"></div>';
+
+ echo '<div class="item expand">';
+ echo ' <a href="' . $link . '&preview=on&mobile=1" title="'.$lang['srv_preview_mobile'].'" target="_blank"><span class="faicon mobile"></span>'.$lang['srv_preview_mobile'].'</a>';
+ echo '</div>';
+
+ echo '<div class="item separator"></div>';
+
+ echo '<div class="item">';
+ echo ' <a href="' . $link . '&preview=on&mobile=2" title="'.$lang['srv_preview_tablet'].'" target="_blank"><span class="faicon tablet"></span>'.$lang['srv_preview_tablet'].'</a>';
+ echo '</div>';
+ }
+ else{
+ echo '<div class="item">';
+ echo ' <a href="' . $link . '&preview=on" title="'.$lang['srv_preview_computer'].'" target="_blank"><span class="faicon monitor"></span>'.$lang['srv_preview_computer'].'</a>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ echo '</div>';
+ }
+
+ // Tooltip gridi pomembnih zunanjih linkov
+ public function tooltip_link_grid(){
+ global $lang;
+
+ $subdomain = ($lang['id'] == "1") ? 'www' : 'english';
+ $links = array('www' => array('https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja', 'https://www.1ka.si/d/sl/pomoc/prirocniki', 'https://www.1ka.si/d/sl/cenik/zasebni-paketi',
+ 'https://www.1ka.si/d/sl/cenik/poslovni-paketi', 'https://www.1ka.si/d/sl/novice', 'https://www.1ka.si/d/sl/o-1ka/splosen-opis/nove-funkcionalnosti'),
+ 'english' => array('https://www.1ka.si/d/en/help/frequently-asked-questions', 'https://www.1ka.si/d/en/help/manuals', 'https://www.1ka.si/d/en/cenik/zasebni-paketi',
+ 'https://www.1ka.si/d/sl/cenik/poslovni-paketi', 'https://www.1ka.si/d/en/news', 'https://www.1ka.si/d/en/about/general-description/new-functionalities'));
+
+ echo '<div class="expanded-tooltip-box big_grid left">';
+ echo '<div class="tooltip_grid">';
+
+ echo '<div class="tooltip_grid_item">';
+ echo ' <div class="title">'.$lang['tooltip_link_grid_help'].'</div>';
+ echo ' <div class="tooltip_row">';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][0].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon help2 blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_faq_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_faq_text'] . '</div>';
+ echo ' </a>';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][1].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon book blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_manu_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_manu_text'] . '</div>';
+ echo ' </a>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="separator"></div>';
+
+ echo '<div class="tooltip_grid_item">';
+ echo ' <div class="title">'.$lang['tooltip_link_grid_pricelist'].'</div>';
+ echo ' <div class="tooltip_row">';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][2].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon user blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_ind_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_ind_text'] . '</div>';
+ echo ' </a>';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][3].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon briefcase blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_group_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_group_text'] . '</div>';
+ echo ' </a>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="separator"></div>';
+
+ echo '<div class="tooltip_grid_item">';
+ echo ' <div class="title">'.$lang['tooltip_link_grid_novel'].'</div>';
+ echo ' <div class="tooltip_row">';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][4].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon newspaper blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_news_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_news_text'] . '</div>';
+ echo ' </a>';
+ echo ' <a class="tooltip_row_item" href="'.$links[$subdomain][5].'" target="_blank">';
+ echo ' <div class="item_title">';
+ echo ' <span class="faicon puzzle-piece blue"></span><span class="link_title_text">'.$lang['tooltip_link_grid_update_title'].'</span>';
+ echo ' </div>';
+ echo ' <div class="description">' . $lang['tooltip_link_grid_update_text'] . '</div>';
+ echo ' </a>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+ }
+
+ function displaySecondNavigationLinks($navigation = 0){
global $lang, $site_url;
global $global_user_id;
@@ -3901,23 +4261,9 @@ class SurveyAdmin
$userAccess = UserAccess::getInstance($global_user_id);
if ($navigation == 0) {
+
# stran status (reporti) ali urejanje
if ($this->first_action == NAVI_UREJANJE || $_GET['a'] == '' || $_GET['a'] == A_REPORTI) {
-
- if ($_GET['a'] == '' || $_GET['a'] == 'branching') {
-
- if ($row['toolbox'] <= 2) {
- $row['toolbox'] == 1 ? $preklop = 3 : $preklop = 4;
- echo '<a href="#" title="' . $lang['srv_library'] . '" class="srv_ico" onclick="change_mode(\'toolbox\', \'' . $preklop . '\'); return false;">';
- echo '<span class="faicon library"></span>';
- echo '</a>';
- } else {
- $row['toolbox'] == 3 ? $preklop = 1 : $preklop = 2;
- echo '<a href="#" title="' . $lang['srv_library'] . '" class="srv_ico" onclick="if ( $(\'#toolbox_library\').css(\'display\') == \'none\' ) { close_all_editing(); $(\'#toolbox_library\').show(); } else { change_mode(\'toolboxback\', \'' . $preklop . '\'); } return false;">';
- echo '<span class="faicon library"></span>';
- echo '</a>';
- }
- }
$p = new Prevajanje($this->anketa);
global $lang1;
@@ -3964,7 +4310,12 @@ class SurveyAdmin
}
# kopiranje
- echo '<a href="#" onclick="anketa_copy_top(\'' . $this->anketa . '\'); return false;" title="' . $lang['srv_anketacopy'] . '" class="srv_ico"><span class="faicon anketa_copy"></span></a>';
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ //echo '<a href="#" onclick="anketa_copy_top(\'' . $this->anketa . '\'); return false;" title="' . $lang['srv_anketacopy'] . '" class="srv_ico"><span class="faicon anketa_copy"></span></a>';
+ }
+ else{
+ echo '<a href="#" onclick="anketa_copy_top(\'' . $this->anketa . '\'); return false;" title="' . $lang['srv_anketacopy'] . '" class="srv_ico"><span class="faicon anketa_copy"></span></a>';
+ }
# brisanje
echo '<a href="#" onclick="anketa_delete(\'' . $this->anketa . '\', \'' . $lang['srv_anketadeleteconfirm'] . '\'); return false;" title="' . $lang['srv_anketadelete'] . '" class="srv_ico"><span class="faicon anketa_delete" title="' . $lang['srv_anketadelete'] . '"></span></a>';
@@ -3985,14 +4336,19 @@ class SurveyAdmin
global $lang, $site_url, $global_user_id, $admin_type;
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
+ $userAccess = UserAccess::getInstance($global_user_id);
+ $current_package = $userAccess->getPackage();
+ $dostop_styling = "";
+ if ($current_package != "-1" && $current_package != "")
+ $dostop_styling = "dostop_".$current_package."ka";
$hidden_icon = (in_array($_GET['m'], array(M_ANALYSIS_CROSSTAB, M_ANALYSIS_MULTICROSSTABS, M_ANALYSIS_MEANS, M_ANALYSIS_TTEST, M_ANALYSIS_BREAK))) ? 'hidden' : '';
echo '<a href="#" class="srv_ico '.$hidden_icon.'" id="hover_export_icon" title="' . $lang['srv_export'] . '">';
echo '<span class="faicon export"></span>';
echo '</a>';
- echo '<div id="hover_export">';
+
+ echo '<div id="hover_export" '.(!$userAccess->checkUserAccess('public_link') ? 'class= "user_access_locked"' : '').'>';
if ($navigation == 0) {
@@ -4005,92 +4361,331 @@ class SurveyAdmin
$lan_ppt = ' title="' . $lang['PPT_Izpis'] . '"';
if ($_GET['m'] == M_ANALYSIS_DESCRIPTOR) {
+ if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_DESCRIPTOR . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){
+ echo '</div>';
+ }
echo '<a href="#" onclick="doArchiveAnaliza();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Opisne statistike\'); return false;"' . $lan_print . ' class="srv_ico"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics&anketa=' . $this->anketa) . '" target="_blank"' . $lan_pdf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_rtf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_rtf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_xls&anketa=' . $this->anketa) . '" target="_blank"' . $lan_xls . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_FREQUENCY) {
+ if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_FREQUENCY . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){
+ echo '</div>';
+ }
echo '<a href="#" onclick="doArchiveAnaliza();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Frekvence\'); return false;"' . $lan_print . ' class="srv_ico"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency&anketa=' . $this->anketa) . '" target="_blank"' . $lan_pdf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_rtf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_rtf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_xls&anketa=' . $this->anketa) . '" target="_blank"' . $lan_xls . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_SUMMARY) {
- echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_SUMMARY . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package != 3 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
+ echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_SUMMARY . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span><div class="hover_export_text">' . $lang['srv_export_hover_public'] . '</div></a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 2 && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($current_package == 2 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
+
echo '<a href="#" onclick="doArchiveAnaliza();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
+
echo '<a href="#" onclick="createArchiveBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('publik_link') && $current_package == 1 && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Sumarnik\'); return false;"' . $lan_print . ' class="srv_ico"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums&anketa=' . $this->anketa) . '" target="_blank"' . $lan_pdf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_rtf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_rtf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_xls&anketa=' . $this->anketa) . '" target="_blank"' . $lan_xls . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $current_package == 1 && $dostop_styling != ""){
+ echo '</div>';
+ }
+ if($current_package == 2 && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_CROSSTAB) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="doArchiveCrosstab();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveCrosstabBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Crosstab\'); return false;"' . $lan_print . ' class="srv_ico hidden"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" id="crosstabDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_crosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_crosstabs"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="#" id="crosstabDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_crosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_crosstabs"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="#" id="crosstabDoXls" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_crosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_crosstabs"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_MULTICROSSTABS) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'MultiCrosstab\'); return false;"' . $lan_print . ' class="srv_ico hidden"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" id="multicrosstabDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_multicrosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_multicrosstabs"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="#" id="multicrosstabDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_multicrosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_multicrosstabs"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="#" id="multicrosstabDoXls" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_multicrosstabs') ? 'user_access_locked' : '').' hidden" user-access="analysis_multicrosstabs"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_CHARTS) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_CHARTS . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
echo '<a href="#" onclick="doArchiveChart();" title="' . $lang['srv_analiza_arhiviraj_ttl'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveChartBeforeEmail();" title="' . $lang['srv_analiza_arhiviraj_email_ttl'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Grafi\'); return false;"' . $lan_print . ' class="srv_ico"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=charts&anketa=' . $this->anketa) . '" target="_blank"' . $lan_pdf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_charts') ? 'user_access_locked' : '').'" user-access="analysis_charts"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=charts_rtf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_rtf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_charts') ? 'user_access_locked' : '').'" user-access="analysis_charts"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
- echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=charts_ppt&anketa=' . $this->anketa) . '" target="_blank"' . $lan_ppt . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_charts') ? 'user_access_locked' : '').'" user-access="analysis_charts"><span class="hover_export_icon"><span class="sprites ppt_large"></span></span>' . $lang['srv_export_hover_ppt'] . '</a>';
+ echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=charts_ppt&anketa=' . $this->anketa) . '" target="_blank"' . $lan_ppt . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_charts') ? 'user_access_locked' : '').'" user-access="analysis_charts"><span class="hover_export_icon"><span class="faicon ppt black"></span></span>' . $lang['srv_export_hover_ppt'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_MEANS) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="doArchiveMeans();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveMeansBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Means\'); return false;"' . $lan_print . ' class="srv_ico hidden"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" id="meansDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_means') ? 'user_access_locked' : '').' hidden" user-access="analysis_means"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="#" id="meansDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_means') ? 'user_access_locked' : '').' hidden" user-access="analysis_means"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="#" id="meansDoXls" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_means') ? 'user_access_locked' : '').' hidden" user-access="analysis_means"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_TTEST) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="doArchiveTTest();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveTTestBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'TTest\'); return false;"' . $lan_print . ' class="srv_ico hidden"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" id="ttestDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_ttest') ? 'user_access_locked' : '').' hidden" user-access="analysis_ttest"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="#" id="ttestDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_ttest') ? 'user_access_locked' : '').' hidden" user-access="analysis_ttest"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="#" id="ttestDoXls" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_ttest') ? 'user_access_locked' : '').' hidden" user-access="analysis_ttest"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_BREAK) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="doArchiveBreak();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveBreakBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').' hidden" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'Break\'); return false;"' . $lan_print . ' class="srv_ico hidden"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
- echo '<a href="#" id="breakDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_break') ? 'user_access_locked' : '').' hidden" user-access="analysis_break"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
- echo '<a href="#" id="breakDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_break') ? 'user_access_locked' : '').' hidden" user-access="analysis_break"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
+ //echo '<a href="#" id="breakDoPdf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_break') ? 'user_access_locked' : '').' hidden" user-access="analysis_break"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
+ //echo '<a href="#" id="breakDoRtf" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_break') ? 'user_access_locked' : '').' hidden" user-access="analysis_break"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
echo '<a href="#" id="breakDoXls" target="_blank" class="srv_ico '.(!$userAccess->checkUserAccess('analysis_break') ? 'user_access_locked' : '').' hidden" user-access="analysis_break"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['m'] == M_ANALYSIS_CREPORT) {
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_ANALYSIS . '\',\'' . M_ANALYSIS_CREPORT . '\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
echo '<a href="#" onclick="doArchiveCReport();"' . $lan_archive . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv black very_large"></span></span>' . $lang['srv_export_hover_archive'] . '</a>';
echo '<a href="#" onclick="createArchiveCReportBeforeEmail();"' . $lan_archive_send . ' class="srv_ico '.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="hover_export_icon"><span class="faicon arhiv_mail black very_large"></span></span>' . $lang['srv_export_hover_archive_mail'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle_no_lock">';
+ }
echo '<a href="#" onClick="printAnaliza(\'CReport\'); return false;"' . $lan_print . ' class="srv_ico"><span class="hover_export_icon"><span class="faicon print"></span></span>' . $lang['srv_export_hover_print'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
+
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '<div id="hover_export_rectangle">';
+ }
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=creport_pdf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_pdf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?b=export&m=creport_rtf&anketa=' . $this->anketa) . '" target="_blank"' . $lan_rtf . ' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
+ if($userAccess->checkUserAccess('export') && $dostop_styling != ""){
+ echo '</div>';
+ }
}
else if ($_GET['a'] == A_COLLECT_DATA) {
- echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_COLLECT_DATA . '\',\'\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_spss'] . '"><span class="hover_export_icon"><span class="basic-icon spss very_large"></span></span>' . $lang['srv_export_hover_spss'] . '</a>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=excel_xls" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_excel'] . '"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=txt" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_txt'] . '"><span class="hover_export_icon"><span class="faicon text_file"></span></span>' . $lang['srv_export_hover_txt'] . '</a>';
+ if($dostop_styling != ""){
+
+ if($current_package == 2){
+ echo '<div id="hover_export_rectangle">';
+ echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_COLLECT_DATA . '\',\'\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ echo '</div>';
+
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : 'no_lock').'" user-access="data_export" title="' . $lang['srv_export_spss'] . '"><span class="hover_export_icon"><span class="basic-icon spss very_large"></span></span>' . $lang['srv_export_hover_spss'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=excel_xls" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : 'no_lock').'" user-access="data_export" title="' . $lang['srv_export_excel'] . '"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=txt" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : 'no_lock').'" user-access="data_export" title="' . $lang['srv_export_txt'] . '"><span class="hover_export_icon"><span class="faicon text_file"></span></span>' . $lang['srv_export_hover_txt'] . '</a>';
+
+ }elseif($current_package == 3){
+ echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_COLLECT_DATA . '\',\'\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_spss'] . '"><span class="hover_export_icon"><span class="basic-icon spss very_large"></span></span>' . $lang['srv_export_hover_spss'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=excel_xls" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_excel'] . '"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=txt" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_txt'] . '"><span class="hover_export_icon"><span class="faicon text_file"></span></span>' . $lang['srv_export_hover_txt'] . '</a>';
+ }else{
+ echo '<div id="hover_export_rectangle">';
+ echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_COLLECT_DATA . '\',\'\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_spss'] . '"><span class="hover_export_icon"><span class="basic-icon spss very_large"></span></span>' . $lang['srv_export_hover_spss'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=excel_xls" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_excel'] . '"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=txt" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_txt'] . '"><span class="hover_export_icon"><span class="faicon text_file"></span></span>' . $lang['srv_export_hover_txt'] . '</a>';
+ echo '</div>';
+ }
+ }else{
+ echo '<a href="#" onclick="showSurveyUrlLinks(\'' . A_COLLECT_DATA . '\',\'\');" class="srv_ico '.(!$userAccess->checkUserAccess('public_link') ? 'user_access_locked' : '').'" user-access="public_link" title="' . $lang['srv_export_hover_public2'] . '"><span class="hover_export_icon"><span class="faicon data_link very_large"></span></span>' . $lang['srv_export_hover_public'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_spss'] . '"><span class="hover_export_icon"><span class="basic-icon spss very_large"></span></span>' . $lang['srv_export_hover_spss'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=excel_xls" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_excel'] . '"><span class="hover_export_icon"><span class="faicon xls black very_large"></span></span>' . $lang['srv_export_hover_xls'] . '</a>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=export&m=txt" class="srv_ico '.(!$userAccess->checkUserAccess('data_export') ? 'user_access_locked' : '').'" user-access="data_export" title="' . $lang['srv_export_txt'] . '"><span class="hover_export_icon"><span class="faicon text_file"></span></span>' . $lang['srv_export_hover_txt'] . '</a>';
+ }
// poseben excel izvoz za mfdps
if(SurveyInfo::getInstance()->checkSurveyModule('mfdps')){
@@ -4125,6 +4720,11 @@ class SurveyAdmin
else {
if ($this->first_action == NAVI_UREJANJE || $_GET['a'] == '' || $_GET['a'] == 'reporti') {
if ($_GET['a'] == '' || $_GET['a'] == 'branching') {
+
+ if($userAccess->checkUserAccess('export')){
+ echo '<div id="hover_export_rectangle">';
+ }
+
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_pdf&anketa=' . $this->anketa . '&type=1') . '" target="_blank" title="' . $lang['PDF_Izpis'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('export') ? 'user_access_locked' : '').'"><span class="hover_export_icon"><span class="faicon pdf black very_large"></span></span>' . $lang['srv_export_hover_pdf'] . '</a>';
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_rtf&anketa=' . $this->anketa . '&type=1') . '" target="_blank" title="' . $lang['RTF_Izpis'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('export') ? 'user_access_locked' : '').'"><span class="hover_export_icon"><span class="faicon rtf black very_large"></span></span>' . $lang['srv_export_hover_rtf'] . '</a>';
@@ -4132,9 +4732,9 @@ class SurveyAdmin
if($admin_type == 0){
echo '<a href="' . makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_xml&anketa=' . $this->anketa . '&type=1') . '" target="_blank" title="' . $lang['XML_Izpis'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('export') ? 'user_access_locked' : '').'"><span class="hover_export_icon"><span class="faicon xml black very_large"></span></span>' . $lang['srv_export_hover_xml'] . '</a>';
}
-
- if ($row['multilang'] == 1 && $full_view) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&a=prevajanje" title="' . $lang['srv_prevajanje'] . '" class="srv_ico '.(!$userAccess->checkUserAccess('export') ? 'user_access_locked' : '').'"><span class="hover_export_icon"><span class="sprites book"></span></span></a>';
+
+ if($userAccess->checkUserAccess('export')){
+ echo '</div>';
}
}
@@ -4162,91 +4762,11 @@ class SurveyAdmin
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<script> userAccessExport(); </script>';
}
}
- function survey_icon_add_comment(){
- global $lang, $site_url, $admin_type, $global_user_id;
-
- SurveyInfo::getInstance()->SurveyInit($this->anketa);
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
- SurveySetting::getInstance()->Init($this->anketa);
-
- $survey_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_viewadminonly');
- $survey_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_viewauthor');
- $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
- $view = 1;
-
- $sas = new SurveyAdminSettings();
- $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment');
-
- $userAccess = UserAccess::getInstance($global_user_id);
-
- if (($admin_type <= $survey_comment && $survey_comment != '') or $sas->testiranje_komentarji_komentarji_na_anketo(false) > 0) {
- $show_survey_comment = $_GET['show_survey_comment'];
-
- $comment_count = $sas->testiranje_komentarji_count();
- $comment_count_text = ($comment_count['survey_admin']['unresolved'] + $comment_count['survey_resp']['unresolved']);
-
- if (($row['forum'] == 0 || $row['thread'] == 0) && $comment_count_text == '0') {
-
- if($userAccess->checkUserAccess('komentarji')){
- echo '<a href="#" onclick="return false;" class="surveycomment srv_ico" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
- echo ' <div class="fa-stack"><span class="faicon comments fa-stack-1x icon-blue" title="' . $lang['srv_survey_general_comment'] . '"></div></span>';
- echo '</a>';
- }
- else{
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='. $row['id'].'&a=urejanje" class="surveycomment srv_ico" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
- echo ' <div class="fa-stack"><span class="faicon comments fa-stack-1x icon-blue user_access_locked" title="' . $lang['srv_survey_general_comment'] . '"></div></span>';
- echo '</a>';
- }
- }
- else {
-
- $sqlf = sisplet_query("SELECT COUNT(*) AS count FROM post WHERE tid='$row[thread]'");
- $rowf = mysqli_fetch_array($sqlf);
- $rowf['count']--; //zaradi 1. avtomatskega posta
-
- // Shranimo naslov za js qtip box
- $comment_qip_title = $lang['srv_comments_anketa_ured'] .
- ' (' . $comment_count['survey_admin']['unresolved'] . '/' . $comment_count['survey_admin']['all'] . ')'
- . '<div class=\'comment_qtip_title_secondLine\'>' . $lang['srv_comments_anketa_resp']
- . ' (' . $comment_count['survey_resp']['unresolved'] . '/' . $comment_count['survey_resp']['all'] . ')</div>';
- echo '<input type="hidden" id="comment_qtip_title" value="' . $comment_qip_title . '" />';
-
-
- if($userAccess->checkUserAccess('komentarji')){
- echo '<a href="#" onclick="return false;" class="surveycomment srv_ico" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
-
- echo '<div class="fa-stack"><span class="faicon comments_num icon-blue fa-stack-1x" title="' . $lang['srv_survey_general_comment'] . '"><strong class="fa-stack-1x">' . $comment_count_text . '</strong></span></div>';
-
- // ali prikazemo okno odprto - je dodan tak admin komentar
- $sqlf1 = sisplet_query("SELECT id FROM post p WHERE p.tid='$row[thread]' AND p.ocena='5'");
- while ($rowf1 = mysqli_fetch_array($sqlf1)) {
- $s = sisplet_query("SELECT * FROM views WHERE pid='$rowf1[id]' AND uid='$global_user_id'");
-
- if (mysqli_num_rows($s) == 0)
- $show_survey_comment = 1;
- }
-
- echo '</a>';
- }
- else{
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa='. $row['id'].'&a=urejanje" class="surveycomment srv_ico" id="surveycomment_0_' . $view . '" type="0" view="' . $view . '" spremenljivka="0">';
- echo ' <div class="fa-stack"><span class="faicon comments_num icon-blue fa-stack-1x user_access_locked" title="' . $lang['srv_survey_general_comment'] . '"><strong class="fa-stack-1x">' . $comment_count_text . '</strong></span></div>';
- echo '</a>';
- }
- }
-
- if($userAccess->checkUserAccess('komentarji'))
- echo '<script> $(function() { load_comment(\'#surveycomment_0_' . $view . '\'' . ($show_survey_comment == '1' ? ', \'2\'' : '') . '); });</script>';
- }
- }
-
/**
* @desc uploada skin
@@ -4383,7 +4903,7 @@ class SurveyAdmin
} else {
echo '
<script language="javascript">
- alert(\'' . $lang['srv_filealert'] . '\');
+ genericAlertPopup(\'srv_filealert\');
</script>
';
@@ -4429,11 +4949,9 @@ class SurveyAdmin
* @return unknown_type
*
*/
- function anketa_delete_from_db($anketa)
- {
- global $site_path, $global_user_id;
+ public static function anketa_delete_from_db($anketa){
- if (!$anketa) return;
+ if (!$anketa || $anketa < 1) return;
// zbrisemo zakesiran query v seji
if (session_id() == '') {
@@ -4442,35 +4960,46 @@ class SurveyAdmin
unset($_SESSION['query']);
unset($_SESSION['result']);
- // pošiljanje obvestil ob izbrisu ankete
- //SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- //SurveyAlert::getInstance()->sendMailDelete();
$sql = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id = '$anketa'");
while ($row = mysqli_fetch_array($sql)) {
+
$sql1 = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id='$row[id]'");
while ($row1 = mysqli_fetch_array($sql1)) {
$sql2 = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id = '$row1[id]'");
}
+
$sql2 = sisplet_query("DELETE FROM srv_spremenljivka WHERE gru_id = '$row[id]'");
- # tabela srv_user_grupa
- $sql2 = sisplet_query("DELETE FROM srv_user_grupa WHERE gru_id = '$row[id]'");
+ # tabela srv_user_grupa_archive1
+ $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive1 WHERE gru_id = '$row[id]'");
+
+ # tabela srv_user_grupa_archive2
+ $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive2 WHERE gru_id = '$row[id]'");
+
+ # tabela srv_user_grupa_archive3
+ $sql2 = sisplet_query("DELETE FROM srv_user_grupa_archive3 WHERE gru_id = '$row[id]'");
+
# tabela srv_user_grupa_active
- $sql2 = sisplet_query("DELETE FROM srv_user_grupa" . $this->db_table . " WHERE gru_id = '$row[id]'");
+ $sql2 = sisplet_query("DELETE FROM srv_user_grupa_active WHERE gru_id = '$row[id]'");
}
+
$sql2 = sisplet_query("DELETE FROM srv_grupa WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_alert WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_dostop WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_user WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_anketa WHERE backup = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_anketa WHERE id = '$anketa'");
- $sql2 = sisplet_query("DELETE FROM srv_tracking".$this->db_table." WHERE id = '$anketa'");
+ $sql2 = sisplet_query("DELETE FROM srv_tracking_active WHERE ank_id = '$anketa'");
+ $sql2 = sisplet_query("DELETE FROM srv_tracking_archive1 WHERE ank_id = '$anketa'");
+ $sql2 = sisplet_query("DELETE FROM srv_tracking_archive2 WHERE ank_id = '$anketa'");
+ $sql2 = sisplet_query("DELETE FROM srv_tracking_archive3 WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_library_anketa WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_survey_misc WHERE sid = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_variable_profiles WHERE sid = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_glasovanje WHERE ank_id = '$anketa'");
$sql2 = sisplet_query("DELETE FROM srv_survey_misc WHERE sid = '$anketa'");
+
# Pobrisemo srv_condition_vre
$sql2 = sisplet_query("DELETE FROM srv_condition_vre WHERE cond_id IN (SELECT id FROM srv_condition WHERE if_id IN (SELECT element_if FROM srv_branching WHERE ank_id = '$anketa' AND element_if > 0))");
#Pobrisemo srv_condition_grid
@@ -4485,26 +5014,14 @@ class SurveyAdmin
$sql2 = sisplet_query("DELETE FROM srv_branching WHERE ank_id = '$anketa'");
Common::RemoveNiceUrl($anketa);
-
-
- // kaj pa tabele:
- //srv_grid
- // srv_call_....
- // srv_data_.... // vsi podatki
- // srv_userbase_setting
- // srv_user_setting_for_survey
-
}
/**
* @desc popravimo cas in userja popravka
* ta funkcija je skopirana v common. tole pustimo, da ne bojo kaksne napake...
*/
- function updateEditStamp()
- {
-
+ function updateEditStamp() {
Common::updateEditStamp();
-
}
/**
@@ -4543,8 +5060,11 @@ class SurveyAdmin
$akronim = $naslov;
}
- $starts = $_POST['starts'] ? "'" . $_POST['starts'] . "'" : "NOW()";
- $expire = $_POST['expire'] ? "'" . $_POST['expire'] . "'" : "NOW() + INTERVAL 3 MONTH ";
+ $naslov = strip_tags($naslov);
+ $akronim = strip_tags($akronim);
+
+ $starts = isset($_POST['starts']) ? "'" . $_POST['starts'] . "'" : "NOW()";
+ $expire = isset($_POST['expire']) ? "'" . $_POST['expire'] . "'" : "NOW() + INTERVAL 3 MONTH ";
// Nastavimo jezik - admin in response jezik je vedno enak nastavitvi, ki jo ima uporabnik a default
$lang_admin = ((int)$lang_admin > 0) ? $lang_admin : 1;
@@ -4572,11 +5092,15 @@ class SurveyAdmin
$mobile_skin = 'Mobile'.$skin;
}
- $sql = sisplet_query("INSERT INTO srv_anketa (id, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, show_intro, show_concl, survey_type, lang_admin, lang_resp, active, skin, mobile_skin) " .
- "VALUES ('', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '$text', '$url', '$intro_opomba', '$showIntro', '$showConcl', '$survey_type', '$lang_admin', '$lang_resp', '$autoActiveSurvey', '$skin', '$mobile_skin')");
+ // Nastavimo se hash
+ $hash = Common::generateSurveyHash();
+
+ $sql = sisplet_query("INSERT INTO srv_anketa (id, hash, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, show_intro, show_concl, survey_type, lang_admin, lang_resp, active, skin, mobile_skin) " .
+ "VALUES ('', '".$hash."', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '$text', '$url', '$intro_opomba', '$showIntro', '$showConcl', '$survey_type', '$lang_admin', '$lang_resp', '$autoActiveSurvey', '$skin', '$mobile_skin')");
if (!$sql) {
$error = mysqli_error($GLOBALS['connect_db']);
}
+
$anketa = mysqli_insert_id($GLOBALS['connect_db']);
@@ -4585,21 +5109,18 @@ class SurveyAdmin
// Updatamo srv_activity, ce je anketa aktivna - drugace se ne zabelezi ok ko se deaktivira
if ($autoActiveSurvey == 1) {
- $activity_insert_string = "INSERT INTO srv_activity (sid, starts, expire, uid) VALUES('" . $anketa . "', $starts, $expire, '" . $global_user_id . "' );";
- $sql_insert = sisplet_query($activity_insert_string);
+ $sql_insert = sisplet_query("INSERT INTO srv_activity (sid, starts, expire) VALUES ('".$anketa."', $starts, $expire)");
}
// vnesemo tudi 1. grupo aka page
- $sql = sisplet_query("INSERT INTO srv_grupa (id, ank_id, naslov, vrstni_red) VALUES ('', '$anketa', '$lang[srv_stran] 1', '1')");
+ $sql = sisplet_query("INSERT INTO srv_grupa (ank_id, naslov, vrstni_red) VALUES ('$anketa', '$lang[srv_stran] 1', '1')");
+
+ $grupa = mysqli_insert_id($GLOBALS['connect_db']);
//ce se nimamo vprasanja v glasovanju ga ustvarimo
if ($survey_type == 0) {
- $sqlGrupe = sisplet_query("SELECT id, naslov FROM srv_grupa g WHERE g.ank_id='$anketa' ORDER BY g.vrstni_red");
- $rowGrupe = mysqli_fetch_assoc($sqlGrupe);
- $grupa = $rowGrupe['id'];
-
- $b = new Branching($this->anketa);
+ $b = new Branching($anketa);
$spr_id = $b->nova_spremenljivka($grupa, 1, 1);
//napolnimo bazo srv_glasovanje
@@ -4617,10 +5138,11 @@ class SurveyAdmin
$sql1 = sisplet_query("INSERT INTO srv_vrednost (spr_id, variable, vrstni_red) VALUES $values");
//popravljanje default nastavitev - stat=0, show_intro=0
- $sqlSpr = sisplet_query("UPDATE srv_spremenljivka SET stat = '0' WHERE id = '$spr_id'");
- $sqlAnk = sisplet_query("UPDATE srv_anketa SET show_intro = '0', show_concl = '0', progressbar = '0', countType = '0', akronim = ' ' WHERE id = '$anketa'");
- // vsilimo refresh podatkov
- SurveyInfo:: getInstance()->resetSurveyData();
+ $sqlSpr = sisplet_query("UPDATE srv_spremenljivka SET stat = '0', skala='0' WHERE id = '$spr_id'");
+ $sqlAnk = sisplet_query("UPDATE srv_anketa SET show_intro = '0', show_concl = '0', progressbar = '0', countType = '0' WHERE id = '$anketa'");
+
+ // vsilimo refresh podatkov
+ SurveyInfo::getInstance()->resetSurveyData();
}
//popravljanje default nastavitev pri formi - show_intro=0, show_concl=0, trajanje->neomejeno
@@ -4664,12 +5186,6 @@ class SurveyAdmin
// Nastavimo obvescanje pri poteku ankete (default ob kreiranju ankete)
SurveyAlert::setDefaultAlertBeforeExpire();
-
- // uporabniku dodamo anketo se v knjiznico "moje ankete"
- // torej uporabniku ne bomo avtomatsko dodali ankete v knjiznico "moje ankete"
- //$sqlk = sisplet_query("SELECT * FROM srv_library_folder WHERE uid='$uid' AND tip='1' AND parent='0'");
- //$rowk = mysqli_fetch_array($sqlk);
- //sisplet_query("INSERT INTO srv_library_anketa (ank_id, uid, folder) VALUES ('$anketa', '$uid', '$rowk[id]')");
return $anketa;
}
@@ -4718,6 +5234,10 @@ class SurveyAdmin
$rowg = Cache::srv_spremenljivka($spremenljivka);
+ // Preden vprasanje zbrisemo po novem ustvarimo kopijo vprasanja med zbrisanimi (knjiznica zbrisanih vprasanj)
+ $vd = new VprasanjeDeleted($this->anketa);
+ $vd->createDeletedVprasanje($spremenljivka);
+
// pri brisanju multiple grid vprasanja, moramo pobrisate tudi vse child spremenljivke (ker kljuci niso nastavljeni)
if ($rowg['tip'] == 24) {
$sqld = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka'");
@@ -4756,7 +5276,8 @@ class SurveyAdmin
$b = new Branching($this->anketa);
- $b->repare_branching($row['parent']);
+ if(isset($row['parent']))
+ $b->repare_branching($row['parent']);
$b->repare_vrstni_red();
@@ -5053,957 +5574,6 @@ class SurveyAdmin
return $offset + $rowCountPast['cnt'];
}
- /**
- * @desc Če je anketa aktivna, preverimo da ni slučajno potekel čas aktivnosti,
- * če je, jo deaktiviramo
- */
- function checkSurveyActive($anketa = null)
- {
- // pretecena anketa, kontroliramo datum na: starts in expire
- sisplet_query("UPDATE srv_anketa SET active = '0' WHERE id='" . ($anketa ? $anketa : $this->anketa) . "' AND active = '1' AND expire < CURDATE()");
-
- SurveyInfo:: getInstance()->SurveyInit($this->anketa);
- // vsilimo refresh podatkov
- SurveyInfo:: getInstance()->resetSurveyData();
-
- $sqls = sisplet_query("SELECT active FROM srv_anketa WHERE id='" . ($anketa ? $anketa : $this->anketa) . "'");
- $rows = mysqli_fetch_assoc($sqls);
- return $rows['active'];
- }
-
- /**
- * preview
- *
- */
- private function getTipPreviewHtml(){
- global $lang;
- global $global_user_id;
-
-
- // Predpregled tipa vprašanj - prikazujemo samo kadar smo v urejanju ankete
- if (!$this->anketa > 0)
- return;
-
- if ( ($_GET['a'] != '' || !isset($_GET['anketa'])) && $_GET['a'] != 'branching' )
- return;
-
-
- echo '<div id="tip_preview">';
-
- echo '<div class="top-left"></div><div class="top-right"></div><div class="inside">';
-
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
-
- // tip 9999 - IF
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9999" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_toolbox_if'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='if')){
- $userAccess->displayNoAccessText($what='if');
- }
- echo '</div>';
-
- // tip 9998 - Block
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9998" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_toolbox_block'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='block')){
- $userAccess->displayNoAccessText($what='block');
- }
- echo '</div>';
-
- // tip 9997 - Loop
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9997" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_toolbox_loop'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='loop')){
- $userAccess->displayNoAccessText($what='loop');
- }
- echo '</div>';
-
-
- // tip 1_1 - radio
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
- echo '<div class="tip_sample_option"><input type="radio" checked />' . $lang['srv_tip_sample_t1_o1'] . '</div>';
- echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o2'] . '</div>';
- echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o3'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_10 - gdpr
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_10" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_gdpr_intro_title'] . '</div><br />';
- echo '<div class="tip_sample_text">' . $lang['srv_gdpr_intro'] . '.<br />'.$lang['srv_gdpr_intro4'].'</div>';
- echo '<div class="tip_sample_option"><input type="radio" checked />' . $lang['srv_gdpr_intro_no'] . '</div>';
- echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_gdpr_intro_yes'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1 - radio (horizontalno)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '&nbsp;<span style="font-weight: normal;"><input type="radio" checked />' . $lang['srv_tip_sample_t1_o1'] . '&nbsp;<input type="radio" />' . $lang['srv_tip_sample_t1_o2'] . '</span></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_2 - radio (horizontalno - nova vrstica)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
- echo '<div class="tip_sample_option"><input type="radio" />' . $lang['srv_tip_sample_t1_o1'] . '&nbsp;<input type="radio" checked />' . $lang['srv_tip_sample_t1_o2'] . '&nbsp;<input type="radio" />' . $lang['srv_tip_sample_t1_o3'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_5 - radio potrditev
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_5" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1_5'] . '</div>';
- echo '<div class="tip_sample_option gray"><input type="button" disabled value="' . $lang['srv_potrdi'] . '"></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_6 - select box
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_6" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: radio.</div>';
- //echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t3'] . '</div>';
- echo '<div class="tip_sample_option"><select size="3"><option>' . $lang['srv_tip_sample_t3_oc'] . '</option><option>' . $lang['srv_tip_sample_t3_oc'] . '</option><option>' . $lang['srv_tip_sample_t3_oc'] . '</option></select></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_8 - Drag-drop
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_8" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- //echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; border-right: 1px black solid;">';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o1'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o2'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o3'] . '</div></div>';
- echo '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; margin-left: 30px;">';
- echo '<div class="tip_sample_option"><div class="dragdrop_preview_frame"></div></div>';
- echo '</div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 1_9 - custom radio picture
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_9" class="tip_preview_sub">';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
- // star
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio star"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- // thumb
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio thumb"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- //smiley
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio smiley"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- // heart
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio heart"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- // flag
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio flag"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- // user
- echo '<div style="clear: both;">';
- for ($i = 1; $i < 4; $i++) {
- echo '<div class="variabla custom_radio"><label><input type="radio"><span class="enka-custom-radio user"></span><div class="custom_radio_answer">(' . $i . ')</div></label> </div>';
- }
- echo '</div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 1_10 - Image HotSpot
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_10" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- //echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_radio'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 1_11 - Vizualna anlaogna skala
- echo '<div name="tip_preview_sub" id="tip_preview_sub_1_11" class="tip_preview_sub">';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
-
- echo '<div style="clear: both;padding-bottom:10px;">';
- for ($i = 1; $i < 7; $i++) {
- echo '<div class="variabla custom_radio visual-radio-scale" style="padding: 0 5px;">
- <label>
- <input type="radio">
- <span class="enka-vizualna-skala siv-7'.$i.'"></span>
- <div class="custom_radio_answer">('.$i.')</div>
- </label>
- </div>';
- }
- echo '</div>';
-
- echo '</div>';
- echo '</div>';
-
-
- // tip 2 - checkbox
- echo '<div name="tip_preview_sub" id="tip_preview_sub_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: checkbox.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '</div>';
- echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o1'] . '</div>';
- echo '<div class="tip_sample_option"><input type="checkbox" />' . $lang['srv_tip_sample_t2_o2'] . '</div>';
- echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 2_1 - check(horizontalno)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_2_1" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '&nbsp;<span style="font-weight: normal;"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o2'] . '&nbsp;<input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</span></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 2_2 - check (horizontalno - nova vrstica)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_2_2" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t2'] . '</div>';
- echo '<div class="tip_sample_option"><input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o1'] . '&nbsp;<input type="checkbox" />' . $lang['srv_tip_sample_t2_o2'] . '&nbsp;<input type="checkbox" checked="checked"/>' . $lang['srv_tip_sample_t2_o3'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 2_8 - Drag-drop
- echo '<div name="tip_preview_sub" id="tip_preview_sub_2_8" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t1'] . '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; border-right: 1px black solid;">';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o1'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o2'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t1_o3'] . '</div></div>';
- echo '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; margin-left: 30px;">';
- echo '<div class="tip_sample_option"><div class="dragdrop_preview_frame"></div></div>';
- echo '</div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 2_10 - Image HotSpot
- echo '<div name="tip_preview_sub" id="tip_preview_sub_2_10" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- //echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_checkbox'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 3 - select
- echo '<div name="tip_preview_sub" id="tip_preview_sub_3" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: select.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t3'] . '</div>';
- echo '<div class="tip_sample_option"><select><option>' . $lang['srv_tip_sample_t3_oc'] . '</option></select></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21 - besedilo*
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21'] . '</div>';
- echo '<div class="tip_sample_option"><textarea style="width:150px; height:12px">abc</textarea></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_1 - cpatcha
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_1_o1'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/captcha.jpg" /></div>';
- echo '<div class="tip_sample_option"><input type="text" value="VZHVP" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_2 - email
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_2_o1'] . '</div>';
- echo '<div class="tip_sample_option">(' . $lang['srv_email_example'] . ')</div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<p style="font-size:smaller; color:gray;">' . $lang['srv_email_example_txt'] . '</p>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_3 - url
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_3" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_3_o1'] . '</div>';
- echo '<div class="tip_sample_option">(' . $lang['srv_url_example'] . ')</div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_4 - upload
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_4" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_4_o1'] . '</div>';
- echo '<div class="tip_sample_option"><input type="file" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_5 - textbox box
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_5" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21'] . '</div>';
- echo '<div class="tip_sample_option"><textarea style="width:250px; height:36px">abc</textarea></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 21_6 - elektronski podpis
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_6" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_6'] . '</div>';
- echo '<div class="tip_sample_option"><div style="width:250px; height:50px; border: 1px grey solid; background-color: white;"></div></div>';
- echo '<div class="clr"></div>';
- echo '<input type="button" value="'.$lang['srv_signature_clear'].'" style="margin: 5px;" />';
- echo '<br />'.$lang['srv_signature_name'].' <input type="text" />';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_signature')){
- $userAccess->displayNoAccessText($what='question_type_signature');
- }
- echo '</div>';
-
- // tip 21_7 - fotografija
- echo '<div name="tip_preview_sub" id="tip_preview_sub_21_7" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t21_7'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/webcam_record.png" height="64"/></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 5 - label
- echo '<div name="tip_preview_sub" id="tip_preview_sub_5" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t5'] . '</div>';
- echo '</div>';
- echo '</div>';
-
- // tip 5_2 - nagovor za aktivacijo chata
- echo '<div name="tip_preview_sub" id="tip_preview_sub_5_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: text.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_chat_question_text'] . '</div>';
- echo '<div class="tip_sample_option"><div class="tawk-chat-activation button" style="padding:6px 0px;">'.$lang['srv_chat_turn_on'].'</div></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 26 - lokacija
- echo '<div name="tip_preview_sub" id="tip_preview_sub_26" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_1'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/mojalokacija.png" /></div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_location')){
- $userAccess->displayNoAccessText($what='question_type_location');
- }
- echo '</div>';
-
- // tip 26_2 - multi lokacija
- echo '<div name="tip_preview_sub" id="tip_preview_sub_26_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_2'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/lokacija.png" /></div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_location')){
- $userAccess->displayNoAccessText($what='question_type_location');
- }
- echo '</div>';
-
- // tip 26_1 - moja lokacija
- echo '<div name="tip_preview_sub" id="tip_preview_sub_26_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t26_1'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/mojalokacija.png" /></div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_location')){
- $userAccess->displayNoAccessText($what='question_type_location');
- }
- echo '</div>';
-
- // tip 6 - multigrid
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
- echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span> <span>' . $lang['srv_tip_sample_t6_o3'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><input type="radio" name="a" /></span><span><input type="radio" checked name="a" /></span><span><input type="radio" name="a" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><input type="radio" name="b" /></span><span><input type="radio" /></span><span><input type="radio" name="b" checked /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><input type="radio" name="c" /></span><span><input type="radio" /></span><span><input type="radio" name="c" checked /></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_1 - multigrid (semanticni diferencial)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t61'] . ':</div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>1</span><span>2</span><span>3</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v1x'] . '</div><span><input type="radio" name="d" /></span><span><input type="radio" name="d" /></span><span><input type="radio"name="d" /></span>' . $lang['srv_tip_sample_t61_v1y'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v2x'] . '</div><span><input type="radio" name="e" /></span><span><input type="radio" name="e" /></span><span><input type="radio" name="e" /></span>' . $lang['srv_tip_sample_t61_v2y'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t61_v3x'] . '</div><span><input type="radio" name="f" /></span><span><input type="radio" name="f" checked /></span><span><input type="radio" /></span>' . $lang['srv_tip_sample_t61_v3y'] . '</div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_2 - multigrid (dropdown)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><select><option>' . $lang['srv_tip_sample_t6_o1'] . '</option></select></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_3 - multigrid (double grid)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_3" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span></span><span>' . $lang['srv_tip_sample_t6_v1'] . '</span><span style="border-right: 1px black solid;"></span><span></span><span>' . $lang['srv_tip_sample_t6_v3'] . '</span><span></span></div>';
- echo '<div style="clear:left"></div>';
-
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span><span style="border-right: 1px black solid;">' . $lang['srv_tip_sample_t6_o3'] . '</span><span>&nbsp;' . $lang['srv_tip_sample_t6_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_o2'] . '</span><span>' . $lang['srv_tip_sample_t6_o3'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>www.xxx.si</div><span><input type="radio" /></span><span><input type="radio" /></span><span style="border-right: 1px black solid;"><input type="radio" name="g" checked /></span><span><input type="radio" name="l" checked /></span><span><input type="radio" /></span><span><input type="radio" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>www.yyy.si</div><span><input type="radio" /></span><span><input type="radio" name="j" checked /></span><span style="border-right: 1px black solid;"><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" name="h" checked /></span><span><input type="radio" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>www.zzz.si</div><span><input type="radio" /></span><span><input type="radio" name="i" checked /></span><span style="border-right: 1px black solid;"><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" /></span><span><input type="radio" name="k" checked /></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
-
- // tip 6_4 - multigrid (one against another)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_4" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: one against another.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_4'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v1'] . '</div><span><input type="radio" name="l" checked/></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio"name="l" /></span>' . $lang['srv_tip_sample_t6_4_v2'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v1'] . '</div><span><input type="radio" name="m" /></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio" name="m" checked/></span>' . $lang['srv_tip_sample_t6_4_v3'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div style="text-align: right;">' . $lang['srv_tip_sample_t6_4_v3'] . '</div><span><input type="radio" name="n" checked/></span><span>' . $lang['srv_tip_sample_t6_4_vmes'] . '</span><span><input type="radio" name="n" /></span>' . $lang['srv_tip_sample_t6_4_v2'] . '</div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_5 - multigrid (max diff)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_5" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: max diff.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_5'] . '</div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_5_c1'] . '</span><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_5_c2'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" checked/></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v1'] . '</div><span><input type="radio" name="p" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v2'] . '</div><span><input type="radio" name="p" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v3'] . '</div><span><input type="radio" name="p" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option2"><div>&nbsp;</div><span><input type="radio" name="o" /></span><div style="text-align: center;">' . $lang['srv_tip_sample_t6_5_v4'] . '</div><span><input type="radio" name="p" checked/></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_6 - multigrid (select box)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_6" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6_6'] . '</div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v1'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3a'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4a'] . '</option></select></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v2'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3b'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4b'] . '</option></select></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v3'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3c'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4c'] . '</option></select></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_6_v4'] . '</div><span><select multiple=""><option>' . $lang['srv_tip_sample_t6_6_o1d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o2d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o3d'] . '</option><option>' . $lang['srv_tip_sample_t6_6_o4d'] . '</option></select></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_8 - multigrid (Tabela Da/Ne)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_8" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
- echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t6_8_o1'] . '</span><span>' . $lang['srv_tip_sample_t6_8_o2'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v1'] . '</div><span><input type="radio" checked name="a" /></span><span><input type="radio" name="a" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v2'] . '</div><span><input type="radio" /></span><span><input type="radio" name="b" checked /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t6_v3'] . '</div><span><input type="radio" /></span><span><input type="radio" name="c" checked /></span></div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_9 - Drag-drop
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_9" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>'; //$lang['srv_new_question_icon']
- echo '<span>' . $lang['srv_new_question'] . '</span>';
-
- echo '<div class="tip_sample">';
-
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t6'] . '</div>';
-
- echo '<div style="float: left; width: 200px; height: 150px; border-right: 1px black solid;">';
- echo '<div class="tip_sample_option"></div><br /><br />';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v1'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v2'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t6_v3'] . '</div></div>';
- echo '</div>';
-
- echo '<div style="float: left; width: 200px; height: 180px; margin-left: 20px;">';
- echo '<div class="tip_sample_option">';
- echo '<ul style="list-style-type: none;">';
- //echo '<div>'.$lang['srv_tip_sample_t6_o1'].'</div><div>tralrarla</div><div>'.$lang['srv_tip_sample_t6_o2'].'</div><div>'.$lang['srv_tip_sample_t6_o3'].'</div><br />';
- echo '<li >
- <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o1'] . '</div>
- </li>'; //izpis "naslova" okvirja
- echo '<li>
- <div class="dragdrop_preview_frame_grid"></div>
- </li>' . "\n"; //izpis okvirja
- echo '<li >
- <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o2'] . '</div>
- </li>'; //izpis "naslova" okvirja
- echo '<li>
- <div class="dragdrop_preview_frame_grid"></div>
- </li>' . "\n"; //izpis okvirja
- echo '<li >
- <div class="dragdrop_preview_frame_grid_title">' . $lang['srv_tip_sample_t6_o3'] . '</div>
- </li>'; //izpis "naslova" okvirja
- echo '<li>
- <div class="dragdrop_preview_frame_grid"></div>
- </li>' . "\n"; //izpis okvirja
- echo '</ul>';
- echo '</div>';
- echo '</div>';
-
- echo '<div class="clr"></div>';
-
- echo '</div>';
- echo '</div>';
-
- // tip 6_10 - Image HotSpot
- echo '<div name="tip_preview_sub" id="tip_preview_sub_6_10" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: label.</div>';
- //echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_hotspot_preview_text_radio_grid'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_0/hotspot.png" /></div>';
- echo '</div>';
- echo '</div>';
-
-
- // tip 16 - multicheckbox
- echo '<div name="tip_preview_sub" id="tip_preview_sub_16" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multicheckbox.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t16'] . '</div>';
- echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t16_o1'] . '</span><span>' . $lang['srv_tip_sample_t16_o2'] . '</span> <span>' . $lang['srv_tip_sample_t16_o3'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v1'] . '</div><span><input type="checkbox" checked /></span><span><input type="checkbox" /></span><span><input type="checkbox" checked /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v2'] . '</div><span><input type="checkbox" checked /></span><span><input type="checkbox" /></span><span><input type="checkbox" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t16_v3'] . '</div><span><input type="checkbox" /></span><span><input type="checkbox" checked /></span><span><input type="checkbox" checked /></span></div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 19 - multitext
- echo '<div name="tip_preview_sub" id="tip_preview_sub_19" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multitext.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t19'] . '</div>';
- echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t19_o1'] . '</span><span>' . $lang['srv_tip_sample_t19_o2'] . '</span><span>' . $lang['srv_tip_sample_t19_o3'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t19_v1'] . '</div><span><input type="text" size="10" value="abc" /></span><span><input type="text" size="10" value="abc" /></span><span><input type="text" size="10" value="abc" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t19_v2'] . '</div><span><input type="text" size="10" value="abc" /></span><span><input type="text" size="10" value="abc" /></span><span><input type="text" size="10" value="abc" /></span></div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 20 - multinumber
- echo '<div name="tip_preview_sub" id="tip_preview_sub_20" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multinumber.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t20'] . '</div>';
- echo '<div class="tip_sample_option"><div>&nbsp;</div><span>' . $lang['srv_tip_sample_t20_o1'] . '</span><span>' . $lang['srv_tip_sample_t20_o2'] . '</span><span>' . $lang['srv_tip_sample_t20_o3'] . '</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v1'] . '</div><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v2'] . '</div><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><div>' . $lang['srv_tip_sample_t20_v3'] . '</div><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span><span><input type="text" size="10" value="123" /></span></div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 7 - number
- echo '<div name="tip_preview_sub" id="tip_preview_sub_7" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: number.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t7'] . '</div>';
- echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t7_o1'] . '<input type="text" value="123" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 7_2 - slider
- echo '<div name="tip_preview_sub" id="tip_preview_sub_7_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: number.</div>';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t7_2'] . '</div>';
- echo '<div class="tip_sample_option"><img src="img_new/slider.png" height="40"/></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 8 - datum
- echo '<div name="tip_preview_sub" id="tip_preview_sub_8" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: datum.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t8'] . '</div>';
- echo '<div class="tip_sample_option"><input type="text" size="20"/><span id="starts_img" class="sprites calendar" style="float:none; margin-bottom:0"></span></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 17 - Razvrščanje prestavljanje (default)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_17" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t17'] . '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; border-right: 1px black solid;">';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o1'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o2'] . '</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t17_o3'] . '</div></div>';
- echo '</div>';
-
- echo '<div style="float: left; width: 150px; height: 110px; margin-left: 30px;">';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview_frame">1</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview_frame">2</div></div>';
- echo '<div class="tip_sample_option"><div class="razvrscanje_preview_frame">3</div></div>';
- echo '</div>';
- echo '<div class="clr"></div>';
-
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_ranking')){
- $userAccess->displayNoAccessText($what='question_type_ranking');
- }
- echo '</div>';
-
- // tip 171 - Razvrščanje ostevilcevanje (design = 1)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_17_1" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t171'] . '</div>';
-
- echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o1'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o2'] . '</div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option" style="margin-top: 5px;"><input type="text" size="1"/>' . $lang['srv_tip_sample_t171_o3'] . '</div>';
- echo '<div style="clear:left"></div>';
-
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_ranking')){
- $userAccess->displayNoAccessText($what='question_type_ranking');
- }
- echo '</div>';
-
- // tip 172 - Razvrščanje premikanje (design = 2)
- echo '<div name="tip_preview_sub" id="tip_preview_sub_17_2" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: multigrid.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t172'] . '</div>';
- echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o1'] . '</div><span>&nbsp;</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o2'] . '</div><span>&nbsp;</span></div>';
- echo '<div style="clear:left"></div>';
- echo '<div class="tip_sample_option"><span>&nbsp;</span><div class="razvrscanje_preview">' . $lang['srv_tip_sample_t172_o3'] . '</div><span>&nbsp;</span></div>';
- echo '<div class="clr"></div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_ranking')){
- $userAccess->displayNoAccessText($what='question_type_ranking');
- }
- echo '</div>';
-
- // tip 18 - vsota
- echo '<div name="tip_preview_sub" id="tip_preview_sub_18" class="tip_preview_sub">';
- // echo '<div>Primer tipa vprašanj: vsota.</div>';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample" style="text-align: right;">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t18'] . '</div>';
- echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o1'] . '<input type="text" size="8" style="margin-bottom: 3px;" value="9" /></div>';
- echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o2'] . '<input type="text" size="8" style="margin-bottom: 3px;" value="10" /></div>';
- echo '<div class="tip_sample_option">' . $lang['srv_tip_sample_t18_o3'] . '<input type="text" size="8" style="margin-bottom: 3px;" value="5" /></div>';
- echo '<div class="tip_sample_option" style="border-top: 1px black solid;">' . $lang['srv_tip_sample_t18_o4'] . '<input type="text" size="8" style="margin-top: 3px;" value="24" /></div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_sum')){
- $userAccess->displayNoAccessText($what='question_type_sum');
- }
- echo '</div>';
-
- // tip 24 - Kombinirana tabela
- echo '<div name="tip_preview_sub" id="tip_preview_sub_24" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_survey_table_multiple'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_multitable')){
- $userAccess->displayNoAccessText($what='question_type_multitable');
- }
- echo '</div>';
-
- // tip 27 - Heatmap
- echo '<div name="tip_preview_sub" id="tip_preview_sub_27" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_vprasanje_heatmap'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_heatmap')){
- $userAccess->displayNoAccessText($what='question_type_heatmap');
- }
- echo '</div>';
-
- // tip 22 - Kalkulacija
- echo '<div name="tip_preview_sub" id="tip_preview_sub_22" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_vprasanje_tip_long_22'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_calculation')){
- $userAccess->displayNoAccessText($what='question_type_calculation');
- }
- echo '</div>';
-
- // tip 25 - Kvota
- echo '<div name="tip_preview_sub" id="tip_preview_sub_25" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question_icon'] . '</span>';
- echo '<div class="tip_sample">';
- echo $lang['srv_vprasanje_tip_long_25'];
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='question_type_quota')){
- $userAccess->displayNoAccessText($what='question_type_quota');
- }
- echo '</div>';
-
- // tip 9 - SN-imena
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div><span class="faicon add small icon-blue"></span>' . $lang['srv_add_field'] . '</div>';
- echo '</div>';
- if(!$userAccess->checkUserAccess($what='social_network')){
- $userAccess->displayNoAccessText($what='social_network');
- }
- echo '</div>';
-
- // tip 9_1 - SN-imena - fiksno st. polj
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9_1" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 9_2 - SN-imena - 1 textbox
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9_2" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
- echo '<div class="tip_sample_option"><textarea rows="10"></textarea></div>';
- echo '</div>';
- echo '</div>';
-
- // tip 9_3 - SN-imena - vnos stevila polj
- echo '<div name="tip_preview_sub" id="tip_preview_sub_9_3" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
- echo '<div class="tip_sample_text">' . $lang['srv_tip_sample_t9'] . ':</div>';
- echo '<div class="tip_sample_option">' . $lang['srv_design_count'] . ': <input type="text" size="4" style="margin-bottom: 3px;" value="3" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '<div class="tip_sample_option"><input type="text" /></div>';
- echo '</div>';
- echo '</div>';
-
- // demografska vprasanja
- include_once('../../main/survey/app/global_function.php');
- $Survey = new \App\Controllers\SurveyController(true);
- save('forceShowSpremenljivka', true);
-
- $dem = Array('XSPOL', 'XSTAR2a4', 'XZST1surs4', 'XDS2a4', 'XIZ1a2', 'XLOKACREGk', 'XPODJPRIH');
-
- foreach ($dem AS $key) {
-
- $id = Demografija::getInstance()->getSpremenljivkaID($key);
-
- if ($id > 0) {
- echo '<div name="tip_preview_sub" id="tip_preview_sub_' . $id . '" class="tip_preview_sub">';
- echo '<span>' . $lang['srv_new_question'] . '</span>';
- echo '<div class="tip_sample">';
-
- \App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($id);
-
- echo '</div>';
- echo '</div>';
- }
- }
-
-
- echo '</div><div class="bottom-left"></div><div class="bottom-right"></div>';
-
- echo '</div>'; // tip_preview
- }
/**
* porihtana funkcija, da poklice SurveyRespondents::checkSystemVariables(), ki je zadolzena za dodajanje sistemskih spremenljivk
@@ -6633,17 +6203,6 @@ class SurveyAdmin
}
}
-
- /** prikaze div da so nastavitve shranjene in ga nato skrije
- *
- */
- function displaySuccessSave()
- {
- global $lang;
- echo $lang['srv_success_save'];
- }
-
-
/** pravilno redirekta admin url ankete
* če je anketa aktivna gre na dashboard
* če anketa ni aktivna gre na:
@@ -6703,7 +6262,7 @@ class SurveyAdmin
die();
}
}
-
+
# ugotovimo status ankete
SurveyInfo::getInstance()->SurveyInit($this->anketa);
if (SurveyInfo::getSurveyColumn('active') == 1) {
@@ -6729,9 +6288,8 @@ class SurveyAdmin
die();
}
- function displayAktivnost()
- {
- global $lang, $site_url, $admin_type;
+ function displayAktivnost(){
+ global $lang, $site_url, $admin_type, $global_user_id;
$hierarhija_type = (!empty($_SESSION['hierarhija'][$this->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null);
@@ -6739,8 +6297,8 @@ class SurveyAdmin
$row = SurveyInfo::getInstance()->getSurveyRow();
SurveySetting::getInstance()->Init($this->anketa);
- if ($row['active'] == 1) // preverimo če je čas aktivacije potekel potem anketo deaktiviramo
- $row['active'] = $this->checkSurveyActive();
+ // preverimo če je čas aktivacije potekel potem anketo deaktiviramo oz, ce bi se morala sama aktivirati
+ $row['active'] = SurveyInfo::getInstance()->checkSurveyActive();
$link = SurveyInfo::getSurveyLink();
@@ -6753,157 +6311,146 @@ class SurveyAdmin
$preview_displayvariables = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayvariables');
$preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment');
$preview_options = '' . ($preview_disableif == 1 ? '&disableif=1' : '') . ($preview_disablealert == 1 ? '&disablealert=1' : '') . ($preview_displayifs == 1 ? '&displayifs=1' : '') . ($preview_displayvariables == 1 ? '&displayvariables=1' : '') . ($preview_hidecomment == 1 ? '&hidecomment=1' : '') . '';
+
+ // URL ankete
+ echo '<div class="anketa_header_url setting_box tooltip">';
- // Predogled in testiranje (ikona monitor)
- echo '<span class="tooltip borderLeft monitor" style="padding-left:7px;">';
- echo ' <a href="' . $link . '&preview=on' . $preview_options . '" target="_blank"><span class="faicon monitor" style="margin-right:7px;"></span></a> ';
- echo '<span id="tooltip_preview_content" class="expanded-tooltip bottom light">';
-
- echo '<b>' . $lang['srv_monitor_toolbox_title'] . '</b>';
-
- echo '<p>';
-
- // Ce imamo izklopljene mobilne prilagoditve ne pustimo preview-ja na mobile, ker itak ne prikaze scalano
- $mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly');
- if($mobile_friendly != '0'){
- echo '<b><a href="' . $link . '&preview=on' . $preview_options . '" target="_blank">' . $lang['srv_preview'] . ' PC</a>';
- echo ' &nbsp;(<a href="' . $link . '&preview=on&mobile=1' . $preview_options . '" target="_blank">' . $lang['srv_preview_mobile'] . '</a>, ';
- echo '<a href="' . $link . '&preview=on&mobile=2' . $preview_options . '" target="_blank">' . $lang['srv_preview_tablet'] . '</a>)</b>';
- }
- else{
- echo '<b><a href="' . $link . '&preview=on' . $preview_options . '" target="_blank">' . $lang['srv_preview'] . ' PC</a></b>';
- }
-
- echo '<br />(' . $lang['srv_monitor_toolbox_preview'] . ')';
-
- echo '</p>';
-
- // V formi in glasovanju nimamo testnih vnosov
- if ($this->survey_type != 0 && $this->survey_type != 1) {
- echo '<a href="' . $link . '&preview=on&testdata=on' . $preview_options . '" title="" target="_blank">';
- echo '<b>' . $lang['srv_survey_testdata'] . '</b>';
- echo '</a>';
-
- echo '<br />(' . $lang['srv_monitor_toolbox_test'] . ')';
+ if ($row['active'] == 1 && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
+ echo '<a href="' . $link . '" target="_blank">'.$link.'</a>';
+ }
+ elseif (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
+ echo '<a href="'.$site_url.'sa" target="_blank">'.$site_url.'sa</a>';
+ }
+ else {
+ echo '<span>'.$link.'</span>';
}
- echo '<br /><br />';
-
- echo '<span class="arrow"></span>';
- echo '</span>'; // expanded-tooltip bottom
- echo '</span>'; // request-help
+ echo '<div class="expanded-tooltip bottom" id="survey_activity_content">';
+ $this->tooltip_survey_activity();
+ echo '</div>';
- # url ankete
- echo '<span id="anketa_url" class="anketa_url borderLeft">';
- if ($row['active'] == 1 && !SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo '<a href="' . $link . '" title="' . $lang['srv_urlankete'] . '" target="_blank">';
- //echo '<span class="sprites anketa_link"></span>&nbsp;
- echo $link;
- echo '</a>';
+ echo '</div>';
- } elseif (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo '<a href="'.$site_url.'sa" target="_blank">'.$site_url.'sa</a>';
- } else {
- echo $link;
- }
- echo '</span>&nbsp;&nbsp;';
+ // Aktivacija ankete
$d = new Dostop();
if ($d->checkDostopAktiven()) {
- echo '<span class="borderLeft">';
+ echo '<div class="anketa_header_activate setting_box tooltip">';
if (SurveyInfo::getSurveyColumn('active') == 1) {
+
# anketa je aktivna
# V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije
if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
if ($hierarhija_type == 1) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
- } else{
- echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_active'] . '" style="cursor:text !important;">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico">';
+ }
+ else{
+ echo '<a href="#" class="srv_ico" style="cursor:text !important;">';
}
- }else {
- echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this->anketa . '\',\'' . $row['active'] . '\'); return false;" title="' . $lang['srv_anketa_active'] . '">';
+ }
+ else {
+ echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this->anketa . '\',\'' . $row['active'] . '\'); return false;">';
}
- echo '<div id="srv_active" class="switch_anketa anketa_on"><span class="switch_anketa_content">ON</span></div>';
+ echo '<div id="srv_active" class="switch_anketa anketa_on"></div>';
echo '</a>';
- } else {
+ }
+ // Preklop domene na oneclicksurvey.com - ne pustimo aktivacije
+ elseif(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ echo '<a href="#" class="srv_ico">';
+ echo ' <div id="srv_inactive" class="switch_anketa anketa_off"></div>';
+ echo '</a>';
+ }
+ else {
$anketa_active = "anketa_active('" . $this->anketa . "','" . $row['active'] . "'); ";
//Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana
if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
if ($hierarhija_type == 1) {
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico">';
} else{
- echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ echo '<a href="#" class="srv_ico">';
}
- }else {
- echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;" title="' . $lang['srv_anketa_noactive'] . '">';
}
-
- if ((int)$_last_active > 0) {
- # anketa je zaključena
- echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>';
- } else {
- # anketa je neaktivna
- echo '<div id="srv_inactive" class="switch_anketa anketa_off"><span class="switch_anketa_content">OFF</span></div>';
+ else {
+ echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;">';
}
+ echo '<div id="srv_inactive" class="switch_anketa anketa_off"></div>';
+
echo '</a>';
}
+ echo '<div class="expanded-tooltip bottom" id="survey_activity2_content">';
+ $this->tooltip_survey_activity();
+ echo '</div>';
+
+ echo '</div>';
+
+
+ // Ikona kljucavnice
+ echo '<div class="anketa_header_lock setting_box tooltip">';
+
// Ce ima uporabnik prepreceno moznost odklepanja ankete, anketo ima vedno zaklenjeno če je vklopljena hierarhija
- $prevent_unlock = (SurveyInfo::getSurveyModules('hierarhija') == 2 || $d->checkDostopSub('lock') && $row['locked'] == 1 && ($admin_type != 0 && $admin_type != 1)) ? 1 : 0;
+ $prevent_unlock = 0;
+ if(SurveyInfo::getSurveyModules('hierarhija') == 2 || (!$d->checkDostopSub('lock') && $row['locked'] == 1 && $admin_type != 0 && $admin_type != 1))
+ $prevent_unlock = 1;
+
if ($prevent_unlock == 1) {
echo '<input type="hidden" name="prevent_unlock" id="prevent_unlock" value="1">';
- echo '<a class="anketa_img_nav" title="' . $lang['srv_anketa_locked_close'] . '">';
+ echo '<a class="anketa_img_nav">';
echo '<span class="faicon lock_close"></span>';
echo '</a>';
- } else {
+ }
+ else {
# zaklepanje
- //echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\''.$this->anketa.'\', \''.($row['locked']==0?'1':'0').'\');" title="'.$lang['srv_anketa_locked_'.$row['locked']].'"><img style="margin-left: 5px;" src="img_0/lock'.($row['locked']==0?'_open':'').'.png" /></a>';
if ($hierarhija_type == 10) {
- echo '<a href="#" class="anketa_img_nav" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '" style="cursor:text !important;">';
- } else {
- echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\'' . $this->anketa . '\', \'' . ($row['locked'] == 0 ? '1' : '0') . '\', \''.$row['mobile_created'].'\');" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '">';
+ echo '<a href="#" class="anketa_img_nav" style="cursor:text !important;">';
+ }
+ else {
+ echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\'' . $this->anketa . '\', \'' . ($row['locked'] == 0 ? '1' : '0') . '\', \''.$row['mobile_created'].'\');" >';
}
echo '<span class="faicon lock' . ($row['locked'] == 0 ? '_open' : '_close') . '"></span>';
echo '</a>';
}
- echo '</span>';
- }
-
-
- # Objava na FB, twitter, .... share pac
- if ($row['active'] == 1 && false) {
- # NE PRIKAZUJEMO IKONIC
- $sqlu = sisplet_query("SELECT email FROM users WHERE id='" . $this->uid() . "'");
- $rowu = mysqli_fetch_array($sqlu);
- if ($rowu['email'] == '') {
- $sqlm = sisplet_query("SELECT value FROM misc WHERE what = 'AlertFrom'");
- $rowm = mysqli_fetch_array($sqlm);
- $rowu['email'] = $rowm['value'];
- }
- ?><span style="display: inline-block; margin-left:25px;">
- <span class="anketa_img_icons" style="margin-top: 3px;">
- <a href="mailto:<?= $rowu['email'] ?>?body=<?= urlencode(SurveyInfo::getSurveyLink()) ?>?subject=<?= $row['naslov'] ?>"
- target="_blank" title="<?= $lang['srv_add_to_mail'] ?>"><span class="sprites email"></span></a>
- </span>
- <span class="anketa_img_icons">
- <a href="http://www.facebook.com/share.php?u=<?= urlencode(SurveyInfo::getSurveyLink()) ?>" target="_blank"
- title="<?= $lang['srv_add_to_fb'] ?>"><span class="sprites facebook"></span></a>
- </span>
- <span class="anketa_img_icons">
- <a href="http://twitter.com/share?url=<?= urlencode(SurveyInfo::getSurveyLink()) ?>?text=<?= $row['naslov'] ?>"
- target="_blank" title="<?= $lang['srv_add_to_tw'] ?>"><span class="sprites twitter"></span></a>
- </span>
- </span>
- <?php
+ echo '<div class="expanded-tooltip bottom" id="survey_locked_content">';
+ $this->tooltip_survey_locked();
+ echo '</div>';
+
+ echo '</div>';
}
+
+
+ // Testiranje (ikona monitor s "T") - v formi in glasovanju nimamo testnih vnosov
+ if ($this->survey_type != 0 && $this->survey_type != 1) {
+
+ echo '<div class="anketa_header_test setting_box tooltip">';
+
+ echo ' <a href="' . $link . '&preview=on&testdata=on' . $preview_options . '" target="_blank"><span class="faicon monitor"></span></a> ';
+
+ echo ' <div class="expanded-tooltip bottom" id="test_data_content">';
+ $this->tooltip_test_data();
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+
+ // Predogled in testiranje (ikona monitor)
+ echo '<div class="anketa_header_preview setting_box tooltip">';
+
+ echo ' <a href="' . $link . '&preview=on' . $preview_options . '" target="_blank"><span class="faicon monitor"></span><span class="text">'.$lang['srv_poglejanketo2'].'</span></a> ';
+
+ echo ' <div class="expanded-tooltip bottom" id="preview_data_content">';
+ $this->tooltip_preview_data();
+ echo ' </div>';
+
+ echo '</div>';
}
function surveyAutoActivate()
@@ -6922,7 +6469,7 @@ class SurveyAdmin
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
#updejtamo še stv_activity
- $uString = "INSERT INTO srv_activity (sid, starts, expire, uid) VALUES ('" . $this->anketa . "', NOW(), date_add(NOW(), INTERVAL 3 MONTH), '" . $global_user_id . "')";
+ $uString = "INSERT INTO srv_activity (sid, starts, expire) VALUES ('" . $this->anketa . "', NOW(), date_add(NOW(), INTERVAL 3 MONTH))";
$s = sisplet_query($uString);
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
diff --git a/admin/survey/SurveyAdminAjax.php b/admin/survey/SurveyAdminAjax.php
index c52315a..7aa8fc9 100644
--- a/admin/survey/SurveyAdminAjax.php
+++ b/admin/survey/SurveyAdminAjax.php
@@ -6,15 +6,15 @@
*/
// STARO
-define("A_REPORTI", "reporti");
+if (!defined('A_REPORTI')) define("A_REPORTI", "reporti");
// tipi uporabnikov, (za kontrolo prikaza posameznih elementov) za preverjanje kličemo funkcijo user_role_cehck
-define("U_ROLE_ADMIN", 0);
-define("U_ROLE_MANAGER", 1);
-define("U_ROLE_CLAN", 2);
-define("U_ROLE_NAROCNIK", 3);
+if (!defined('U_ROLE_ADMIN')) define("U_ROLE_ADMIN", 0);
+if (!defined('U_ROLE_MANAGER')) define("U_ROLE_MANAGER", 1);
+if (!defined('U_ROLE_CLAN')) define("U_ROLE_CLAN", 2);
+if (!defined('U_ROLE_NAROCNIK')) define("U_ROLE_NAROCNIK", 3);
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if (!defined('EXPORT_FOLDER')) define("EXPORT_FOLDER", "admin/survey/SurveyData");
global $site_path;
@@ -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);
@@ -112,17 +111,6 @@ class SurveyAdminAjax {
header('Location: index.php?anketa=' . $this->anketa . '&grupa=' . $this->grupa . '');
}
- /*
- // meta podatki, ki jih beremo z JS
- echo '<form name="meta" action="" style="display:none">';
- echo '<input type="hidden" name="anketa" id="srv_meta_anketa_id" value="' . $this->anketa . '" />';
- echo '<input type="hidden" name="grupa" id="srv_meta_grupa" value="' . $this->grupa . '" />';
- echo '<input type="hidden" name="branching" id="srv_meta_branching" value="' . $this->branching . '" />';
- echo '<input type="hidden" name="podstran" id="srv_meta_podstran" value="' . $_GET['m'] . '" />';
- echo '<input type="hidden" name="akcija" id="srv_meta_akcija" value="' . $_GET['a'] . '" />';
- echo '<input type="hidden" name="full_screen_edit" id="srv_meta_full_screen_edit" value="' . ($this->full_screen_edit == 1 ? 1 : 0) . '" />';
- echo '</form>';
- */
}
// tole je, ce se inicializira v branhingu z $action=-1 (pa mogoce/najbrz se kje), da se ne prikazujejo 2x te meta podatki in redirecta...
@@ -202,7 +190,7 @@ class SurveyAdminAjax {
if (isset ($_POST['branching']))
$this->branching = $_POST['branching'];
if (isset ($_POST['label']))
- $label = $_POST['label'];
+ $label = strip_tags($_POST['label']);
if (isset ($_POST['cela']))
$cela = $_POST['cela'];
if (isset ($_POST['decimalna']))
@@ -288,7 +276,7 @@ class SurveyAdminAjax {
if (isset ($_POST['timer']))
$timer = $_POST['timer'];
if (isset ($_POST['intro_opomba']))
- $intro_opomba = $_POST['intro_opomba'];
+ $intro_opomba = strip_tags($_POST['intro_opomba']);
if (isset ($_POST['akronim']))
$akronim = $_POST['akronim'];
if (isset ($_POST['paramName']))
@@ -346,7 +334,7 @@ class SurveyAdminAjax {
$_GET['parent_if'] = substr( $_SERVER['HTTP_REFERER'], strpos($_SERVER['HTTP_REFERER'], 'parent_if')+10 );
}
- SurveyInfo :: getInstance()->SurveyInit($anketa);
+ SurveyInfo :: getInstance()->SurveyInit($this->anketa);
// vsilimo refresh podatkov
SurveyInfo :: getInstance()->resetSurveyData();
@@ -404,7 +392,7 @@ class SurveyAdminAjax {
elseif ($_GET['a'] == 'edit_anketa_note') {
if ($anketa && isset ($_POST['note']) && $_POST['note'] != '' && $_POST['note'] != 'undefined') {
Common::updateEditStamp();
- $sql = sisplet_query("UPDATE srv_anketa SET intro_opomba='" . $_POST['note'] . "' WHERE id='$anketa'");
+ $sql = sisplet_query("UPDATE srv_anketa SET intro_opomba='" . strip_tags($_POST['note']) . "' WHERE id='$anketa'");
// vsilimo refresh podatkov
SurveyInfo :: getInstance()->resetSurveyData();
@@ -429,29 +417,45 @@ class SurveyAdminAjax {
echo '<h2>'.$lang['srv_ime'].'</h2>';
- echo '<div class="quick_title_edit_label taLeft floatLeft">'.$lang['srv_novaanketa_polnoime'].':</div>';
- echo '<div class="floatLeft" >';
- echo '<input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" value="'.$naslov.'" class="full" maxlength="'.ANKETA_NASLOV_MAXLENGTH.'" onfocus="if(this.value==\''.$lang['srv_naslov'].'\') {this.value=\'\';}" />';
- echo '<span id="novaanketa_naslov_1_chars" class="spaceLeft">'.mb_strlen($naslov, 'UTF-8').'/'.ANKETA_NASLOV_MAXLENGTH.'</span>';
- echo '<br class="clr"/><i class="gray small">'.$lang['srv_interno_ime'].'</i>';
- echo '</div>';
-
- echo '<br class="clr"/><br class="clr"/>';
+
+ echo '<div class="quick_title_setting">';
+
+ echo ' <div class="title_line">'.$lang['srv_novaanketa_polnoime'].':</div>';
+ echo ' <div class="setting_line">';
+ echo ' <input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" value="'.$naslov.'" class="medium" maxlength="'.ANKETA_NASLOV_MAXLENGTH.'" onfocus="if(this.value==\''.$lang['srv_naslov'].'\') {this.value=\'\';}" />';
+ echo ' <span id="novaanketa_naslov_1_chars" class="counter">'.mb_strlen($naslov, 'UTF-8').'/'.ANKETA_NASLOV_MAXLENGTH.'</span>';
+ echo ' </div>';
+ echo ' <div class="opomba_line">';
+ echo $lang['srv_interno_ime'];
+ echo ' </div>';
+
+ echo '</div>';
- echo '<div class="quick_title_edit_label taLeft floatLeft">'.$lang['srv_novaanketa_kratkoime'].':</div>';
- echo '<div class="floatLeft">';
+
+ echo '<div class="quick_title_setting">';
+
+ echo ' <div class="title_line">'.$lang['srv_novaanketa_kratkoime'].':</div>';
+ echo ' <div class="setting_line">';
$name_changed = ($naslov != $akronim) ? '1' : '0';
- echo '<input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="'.$akronim.'" class="full" maxlength="'.ANKETA_AKRONIM_MAXLENGTH.'" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\''.$lang['srv_naslov'].'\') {this.value=\'\';}" changed="'.$name_changed.'" />';
- echo '<span id="novaanketa_akronim_1_chars" class="spaceLeft">'.mb_strlen($akronim, 'UTF-8').'/'.ANKETA_AKRONIM_MAXLENGTH.'</span>';
- echo '<br class="clr"/><i class="gray small">'.$lang['srv_objavljeno_ime'].'</i>';
- echo '</div>';
-
- echo '<br class="clr"/><br class="clr"/>';
-
- echo '<div class="quick_title_edit_label taLeft floatLeft">'.$lang['srv_list_no_data_create_note'].':</div>';
- echo '<div class="floatLeft">';
- echo '<textarea id="novaanketa_opis_1" name="novaanketa_opis_1" class="full" rows="3">'.$row['intro_opomba'].'</textarea>';
- echo '</div>';
+ echo ' <input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="'.$akronim.'" class="medium" maxlength="'.ANKETA_AKRONIM_MAXLENGTH.'" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\''.$lang['srv_naslov'].'\') {this.value=\'\';}" changed="'.$name_changed.'" />';
+ echo ' <span id="novaanketa_akronim_1_chars" class="counter">'.mb_strlen($akronim, 'UTF-8').'/'.ANKETA_AKRONIM_MAXLENGTH.'</span>';
+ echo ' </div>';
+ echo ' <div class="opomba_line">';
+ echo $lang['srv_objavljeno_ime'];
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="quick_title_setting">';
+
+ echo ' <div class="title_line">'.$lang['srv_list_no_data_create_note'].':</div>';
+ echo ' <div class="setting_line">';
+ echo ' <textarea id="novaanketa_opis_1" name="novaanketa_opis_1" class="full" rows="3">'.$row['intro_opomba'].'</textarea>';
+ echo ' </div>';
+
+ echo '</div>';
+
echo '<script>';
echo "$('#novaanketa_naslov_1').keyup(function(){
@@ -485,12 +489,10 @@ class SurveyAdminAjax {
";
echo '</script>';
-
- //echo '<span class="floatleft spaceLeft" title="'.$lang['srv_settings_quick'].'"><a class="" href="#" onclick="quick_title_edit_save(\'true\'); return false;"><span>'.$lang['srv_settings_quick'].'</span></a></span>';
-
- echo '<div class="buttons_holder">';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_save_profile_yes'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="quick_title_edit_save(); return false;"><span>'.$lang['srv_save_profile_yes'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="quick_title_edit_cancel(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" title="'.$lang['srv_cancel'].'" onclick="quick_title_edit_cancel(); return false;">'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" title="'.$lang['srv_save_profile_yes'].'" onclick="quick_title_edit_save(); return false;">'.$lang['srv_save_profile_yes'].'</button>';
echo '</div>';
echo '</div>';
@@ -500,13 +502,13 @@ class SurveyAdminAjax {
$update=array();
if (isset($_POST['naslov']) && trim($_POST['naslov']) != '') {
- $update[] = " naslov='".trim($_POST['naslov'])."'";
+ $update[] = " naslov='".strip_tags(trim($_POST['naslov']))."'";
}
if (isset($_POST['akronim']) && trim($_POST['akronim']) != '') {
- $update[] = " akronim='".trim($_POST['akronim'])."'";
+ $update[] = " akronim='".strip_tags(trim($_POST['akronim']))."'";
}
if (isset($_POST['intro_opomba']) /*&& trim($_POST['intro_opomba']) != ''*/) {
- $update[] = " intro_opomba='".trim($_POST['intro_opomba'])."'";
+ $update[] = " intro_opomba='".strip_tags(trim($_POST['intro_opomba']))."'";
}
if (count($update) > 0 ) {
sisplet_query("UPDATE srv_anketa SET ".implode(',',$update)." WHERE id='".$this->anketa."'");
@@ -540,8 +542,8 @@ class SurveyAdminAjax {
$show_intro = $_POST['show_intro'];
$show_concl = $_POST['show_concl'];
$concl_link = $_POST['concl_link'];
- $intro_opomba = $_POST['intro_opomba'];
- $concl_opomba = $_POST['concl_opomba'];
+ $intro_opomba = strip_tags($_POST['intro_opomba']);
+ $concl_opomba = strip_tags($_POST['concl_opomba']);
if ($_POST['concl_link'] == 1)
$concl_link = 0;
else
@@ -585,18 +587,19 @@ class SurveyAdminAjax {
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
}
- if (isset ($_POST['SurveyExport'])) {
- $val = $_POST['SurveyExport'];
- $sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyExport'");
- if (!$sql)
- echo mysqli_error($GLOBALS['connect_db']);
- }
if (isset ($_POST['SurveyForum'])) {
$val = $_POST['SurveyForum'];
$sql = sisplet_query("UPDATE misc SET value='$val' WHERE what = 'SurveyForum'");
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
}
+
+ // Save app settings
+ foreach($_POST as $what => $value){
+ if(substr($what, 0, 3) == 'as_'){
+ AppSettings::getInstance()->saveSetting(substr($what, 3), $value);
+ }
+ }
}
elseif ($_GET['m'] == 'global_user_settings') {
if (isset ($_POST['language'])) {
@@ -690,7 +693,8 @@ class SurveyAdminAjax {
}
if(empty($_POST['google-2fa']) && !empty($_POST['google_2fa_akcija']) && $_POST['google_2fa_akcija'] == 'deactivate' && !empty($_POST['google_2fa_deaktiviraj'])){
- $user_2fa = User::option($global_user_id, 'google-2fa-secret');
+
+ $user_2fa = User::option($global_user_id, 'google-2fa-secret');
$user_2fa_validate = User::option($global_user_id, 'google_2fa_koda_validate');
$google2fa = new \Sonata\GoogleAuthenticator\GoogleAuthenticator();
@@ -700,7 +704,8 @@ class SurveyAdminAjax {
echo 'success';
return true;
- }else{
+ }
+ else{
echo 'error';
return true;
}
@@ -731,7 +736,7 @@ class SurveyAdminAjax {
&& $_POST['geslo'] == $_POST['geslo2']){
- $result = sisplet_query ("UPDATE users SET pass='".base64_encode((hash(SHA256, $geslo.$pass_salt)))."' WHERE id='".$global_user_id."'");
+ $result = sisplet_query ("UPDATE users SET pass='".base64_encode((hash('SHA256', $geslo.$pass_salt)))."' WHERE id='".$global_user_id."'");
setcookie('uid', '', time() - 3600, '/', $cookie_domain);
setcookie('secret', '', time() - 3600, '/', $cookie_domain);
setcookie('unam', '', time() - 3600, '/', $cookie_domain);
@@ -753,6 +758,14 @@ class SurveyAdminAjax {
// naredi link za aktivacijo
$code = base64_encode((hash('SHA256', time() .$pass_salt . $email. $rowU['name'])));
+ //Preverimo, koliko alternativnih emailov ima (dovolimo samo 10)
+ $sql_user_to_be = sisplet_query ("SELECT count(id) AS skupaj FROM users_to_be WHERE user_id='" . $global_user_id . "'");
+ $row_user_to_be = mysqli_fetch_array($sql_user_to_be);
+ if($row_user_to_be['skupaj'] > 10){
+ echo 'error';
+ return true;
+ }
+
// Vstavimo novega userja v users_to_be kjer caka na aktivacijo
$insert_id = sisplet_query ("INSERT INTO users_to_be
(type, email, name, user_id, timecode, code, lang)
@@ -761,8 +774,7 @@ class SurveyAdminAjax {
$poslji_email = [];
- global $app_settings;
- $PageName = $app_settings['app_name'];
+ $PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
// Pošljemo email na alternativni email in nato še na primarni email samo obvestilo o dodanem emailu
$poslji_email['novi'] = [
@@ -923,6 +935,10 @@ class SurveyAdminAjax {
if (isset($_POST['mobile_tables'])) {
SurveySetting::getInstance()->setSurveyMiscSetting('mobile_tables', $_POST['mobile_tables']);
}
+
+ if (isset($_POST['pc_tables'])) {
+ SurveySetting::getInstance()->setSurveyMiscSetting('pc_tables', $_POST['pc_tables']);
+ }
if (isset($_POST['export_font_size'])) {
SurveySetting::getInstance()->setSurveyMiscSetting('export_font_size', $_POST['export_font_size']);
@@ -1048,7 +1064,7 @@ class SurveyAdminAjax {
if(isset($_POST['lang_resp'])){
// Popravljamo samo ce imamo vec jezikov
- $sqlL = sisplet_query("SELECT id FROM srv_language WHERE ank_id='$this->anketa'");
+ $sqlL = sisplet_query("SELECT lang_id FROM srv_language WHERE ank_id='$this->anketa'");
if (mysqli_num_rows($sqlL) > 0){
$new_resp_lang_id = $_POST['lang_resp'];
$old_resp_lang_id = SurveyInfo::getInstance()->getSurveyColumn('lang_resp');
@@ -1093,6 +1109,9 @@ class SurveyAdminAjax {
// Zaradi zavihkov sproti preverjamo katere variable lahko shranimo če so bile podane preko $_POST
$allVariableToSave = array (
+ 'naslov',
+ 'akronim',
+ 'intro_opomba',
'cookie',
'cookie_return',
'return_finished',
@@ -1132,8 +1151,6 @@ class SurveyAdminAjax {
'continue_later',
'js_tracking',
'defValidProfile',
- 'showItime',
- 'showLineNumber',
'parapodatki'
);
@@ -1173,7 +1190,7 @@ class SurveyAdminAjax {
$sql = sisplet_query("UPDATE srv_anketa SET progressbar='$_POST[progressbar]' WHERE id='$anketa'");
}
- if ($_POST['quiz'] == 1) { // za kviz je anketa vedno v pogoji in bloki načinu
+ if (isset($_POST['quiz']) && $_POST['quiz'] == 1) { // za kviz je anketa vedno v pogoji in bloki načinu
sisplet_query("UPDATE srv_anketa SET survey_type='3' WHERE id = '$anketa'");
ob_start();
$ba = new BranchingAjax($this->anketa);
@@ -1207,7 +1224,7 @@ class SurveyAdminAjax {
}
}
- if ($_POST['multilang'] == 1) {
+ if (isset($_POST['multilang']) && $_POST['multilang'] == 1) {
$this->SurveyAdmin->createUserbaseSystemVariable(0, 0, 1);
}
@@ -1271,7 +1288,7 @@ class SurveyAdminAjax {
}
}
- if ($dostop_edit == 1 && isset ($global_user_id) && $global_user_id > 0) {
+ if (isset($dostop_edit) && $dostop_edit == 1 && isset($global_user_id) && $global_user_id > 0) {
global $admin_type;
$uid = $_POST['uid'];
@@ -1317,7 +1334,7 @@ class SurveyAdminAjax {
}
}
- if ($_POST['comment_send'] != '') {
+ if (isset($_POST['comment_send']) && $_POST['comment_send'] != '') {
// nastavitev, da se okno s komentarji prvic prikaze odprto
if ($_POST['srv_c_alert'] == '1')
@@ -1357,100 +1374,6 @@ class SurveyAdminAjax {
}
}
}
-
- // Dodajanje novih uproabnikov (emailov)
- if (isset($_POST['addusers']) && $_POST['addusers'] != '') {
- global $pass_salt, $global_user_id, $site_path, $admin_type;
-
- $_POST['addusers'] = mysql_real_unescape_string($_POST['addusers']);
- $users = explode(NEW_LINE, $_POST['addusers']);
- $sqlu = sisplet_query("SELECT email, name FROM users WHERE id = '".$global_user_id."'");
- $rowu = mysqli_fetch_array($sqlu);
-
- $MailReply = $rowu['email'];
- $nameAuthor = $rowu['name'];
-
- $aktiven = $_POST['aktiven'];
-
- // Loop cez vse vnesesne userje, ki jim dajemo dostop
- foreach ($users AS $user) {
-
- $user = explode(',', $user);
- $email = trim($user[0]);
- $name = trim($user[1])!='' ? trim($user[1]) : $email;
- $surnname = trim($user[2])!='' ? trim($user[2]) : $email;
-
- // Ce gre za veljaven email dodamo userja
- if ($email != '' && validEmail($email)) {
-
- $id = 0;
- $sqlu = sisplet_query("SELECT id FROM users WHERE email='$email'");
-
- // Ce user, ki ga dodajamo, se ne obstaja, ga ustvarimo - PO NOVEM SAMO CE SMO ADMIN ALI MANAGER
- if (mysqli_num_rows($sqlu) == 0 && ($admin_type == 0 || $admin_type == 1)) {
- $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" .base64_encode((hash(SHA256, '' .$pass_salt))) ."', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
- $id = mysqli_insert_id($GLOBALS['connect_db']);
- }
- // Drugace pridobimo podatke o userju iz baze
- else {
- $rowu = mysqli_fetch_array($sqlu);
- $id = $rowu['id'];
- }
-
- // Ce je bil ustvarjen oz ga imamo ze v bazi, mu damo dostop in posljemo mail
- if($id > 0){
- $s = sisplet_query("INSERT INTO srv_dostop (ank_id, uid, aktiven) VALUES ('$anketa', '$id', '$aktiven')");
- if ( !$s ) echo mysqli_error($GLOBALS['connect_db']);
-
- // V kolikor gre za hierarhijo, potem še enkrat preverimo v bazi in dodelimo dostop tudi do hierarhije status 2 - naknadno dodan administrator
- if(SurveyInfo::checkSurveyModule('hierarhija', $anketa))
- sisplet_query("INSERT INTO srv_hierarhija_users (user_id, anketa_id, type) VALUES ('".$id."', '".$anketa."', 2)");
-
- $naslov = SurveyInfo::getInstance()->getSurveyColumn('naslov');
-
- $subject = $lang['srv_dostopmail_1'].' '.$naslov.'.';
-
- $content = $lang['srv_dostopmail_2'].' <span style="color:red;">'.$nameAuthor.'</span> (<a style="color:#1e88e5 !important; text-decoration:none !important;" href="mailto:'.$MailReply.'">'.$MailReply.'</a>) '.$lang['srv_dostopmail_3'].' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'admin/survey/index.php?anketa='.$anketa.'"><span style="font-weight:bold;">'.$naslov.'.</span></a><br /><br />
- '.$lang['srv_dostopmail_4'].' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'">'.$site_url.'</a> '.$lang['srv_dostopmail_5'].' (<a style="color:#1e88e5 !important; text-decoration:none !important;" href="mailto:'.$email.'">'.$email.'</a>).';
-
- // Ce email se ni registriran, dodamo dodatno obvestilo
- if(mysqli_num_rows($sqlu) == 0 && ($admin_type == 0 || $admin_type == 1)){
- $content .= '<br /><br />'.$lang['srv_dostopmail_7'];
- $content .= ' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'/admin/survey/index.php?a=nastavitve&m=global_user_myProfile">'.$lang['edit_data'].'</a> ';
- $content .= $lang['srv_dostopmail_72'];
- }
-
- // Sporočilo urednika (opcijsko)
- if(isset($_POST['addusers_note']) && $_POST['addusers_note'] != ''){
-
- $_POST['addusers_note'] = mysql_real_unescape_string($_POST['addusers_note']);
-
- $content .= '<br /><br /><span style="font-weight:bold;">'.$lang['srv_dostopmail_note'].'</span><br /><br />';
- $content .= '<span style="color:red;">'.$_POST['addusers_note'].'</span>';
- }
-
- // Podpis
- $signature = Common::getEmailSignature();
- $content .= $signature;
-
- try{
- $MA = new MailAdapter($this->anketa, $type='account');
- $MA->addRecipients($email);
- $resultX = $MA->sendMail(stripslashes($content), $subject);
- }
- catch (Exception $e)
- {
- }
-
- if ($resultX) {
- $status = 1; // poslalo ok
- } else {
- $status = 2; // ni poslalo
- }
- }
- }
- }
- }
}
# nastavimo še stvari za slideshow
@@ -1463,58 +1386,71 @@ class SurveyAdminAjax {
}
$urlprefix = "?";
+ $anketaurl = '';
if (isset ($anketa) && $anketa != null && $anketa != "") {
$anketaurl = $urlprefix . 'anketa=' . $anketa;
$urlprefix = "&";
}
- if ($_REQUEST['location'] == 'jezik' && $_REQUEST['multilang'] == '1') {
+
+ $location = isset($_REQUEST['location']) ? $_REQUEST['location'] : '';
+ $multilang = isset($_REQUEST['multilang']) ? $_REQUEST['multilang'] : '';
+ $uporabnost = isset($_REQUEST['uporabnost']) ? $_REQUEST['uporabnost'] : '';
+ $user_from_cms = isset($_REQUEST['user_from_cms']) ? $_REQUEST['user_from_cms'] : '';
+ $quiz = isset($_REQUEST['quiz']) ? $_REQUEST['quiz'] : '';
+ $phone = isset($_REQUEST['phone']) ? $_REQUEST['phone'] : '';
+ $email = isset($_REQUEST['email']) ? $_REQUEST['email'] : '';
+ $social_network = isset($_REQUEST['social_network']) ? $_REQUEST['social_network'] : '';
+ $slideshow = isset($_REQUEST['slideshow']) ? $_REQUEST['slideshow'] : '';
+ $m = isset($_REQUEST['m']) ? $_REQUEST['m'] : '';
+
+ if ($location == 'jezik' && $multilang == '1') {
$locationurl = $urlprefix . 'a=prevajanje';
$urlprefix = "&";
- } else if ($_REQUEST['uporabnost'] == 1) {
+ } else if ($uporabnost == 1) {
$locationurl = $urlprefix . 'a=uporabnost';
$urlprefix = "&";
- } else if ($_REQUEST['user_from_cms'] == 2 && $_REQUEST['location'] != 'piskot') {
+ } else if ($user_from_cms == 2 && $location != 'piskot') {
$locationurl = $urlprefix . 'a=vnos';
$urlprefix = "&";
- } else if ($_REQUEST['quiz'] == 1) {
+ } else if ($quiz == 1) {
$locationurl = $urlprefix . 'a=kviz';
$urlprefix = "&";
- } else if ($_REQUEST['phone'] == 1) {
+ } else if ($phone == 1) {
$locationurl = $urlprefix . 'a='.A_TELEPHONE;
$urlprefix = "&";
- } else if ($_REQUEST['email'] == 1) {
+ } else if ($email == 1) {
#$locationurl = $urlprefix . 'a=invitations';
$locationurl = $urlprefix . 'a='.A_VABILA;
$urlprefix = "&";
- } else if ($_REQUEST['social_network'] == 1) {
+ } else if ($social_network == 1) {
$locationurl = $urlprefix . 'a=social_network';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'vabila ') {
+ } else if ($m == 'vabila ') {
// izpisemo vsebino nastavitev za vabila
$locationurl = $urlprefix . 'a='.A_VABILA;
$urlprefix = "&";
- } else if ($_REQUEST['slideshow'] == 1) {
+ } else if ($slideshow == 1) {
$locationurl = $urlprefix.'a=slideshow';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'system') {
+ } else if ($m == 'system') {
$locationurl = $urlprefix.'a=nastavitve&m=system';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'global_user_settings') {
+ } else if ($m == 'global_user_settings') {
$locationurl = $urlprefix.'a=nastavitve&m=global_user_settings';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'global_user_myProfile') {
+ } else if ($m == 'global_user_myProfile') {
$locationurl = $urlprefix.'a=nastavitve&m=global_user_myProfile';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'predvidenicasi') {
+ } else if ($m == 'predvidenicasi') {
$locationurl = $urlprefix.'a=nastavitve&m=predvidenicasi';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'vabila_settings') {
+ } else if ($m == 'vabila_settings') {
$locationurl = $urlprefix.'a='.A_VABILA;
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'inv_server') {
+ } else if ($m == 'inv_server') {
$locationurl = $urlprefix.'a=invitations&m=inv_settings';
$urlprefix = "&";
- } else if ($_REQUEST['m'] == 'email_server') {
+ } else if ($m == 'email_server') {
$locationurl = $urlprefix.'a=alert&m=email_server';
$urlprefix = "&";
} else if ($_POST['location'] == 'handleUserCodeSetting') {
@@ -1526,7 +1462,7 @@ class SurveyAdminAjax {
$urlprefix = "&";
}
if (isset($_REQUEST['submited']) && $_REQUEST['submited'] == 1) {
- $locationurl .= $urlprefix.'s=1'.($_GET['show_back'] ? '&show_back=true' : '');
+ $locationurl .= $urlprefix.'s=1'.(isset($_GET['show_back']) ? '&show_back=true' : '');
}
if ( isset($_REQUEST['lang_id']) ) {
$locationurl .= $urlprefix.'lang_id='.$_REQUEST['lang_id'];
@@ -1632,8 +1568,9 @@ class SurveyAdminAjax {
}
}
- SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- SurveyAlert::getInstance()->prepareSendExpireAlerts();
+ // Ostanek, kjer se uporablja baza surveycrontab za posiljanje obvestil o poteku
+ /*SurveyAlert::getInstance()->Init($anketa, $global_user_id);
+ SurveyAlert::getInstance()->prepareSendExpireAlerts();*/
} elseif ($_POST['m'] == 'active') {
@@ -1762,7 +1699,7 @@ class SurveyAdminAjax {
} elseif ($_GET['a'] == 'anketa' || $_GET['a'] == 'nova-anketa-in-hierarhija' || $_GET['a'] == 'anketa_from_text') {
Common::updateEditStamp();
- if (trim($_POST['survey_type']) == '') {
+ if (!isset($_POST['survey_type']) || trim($_POST['survey_type']) == '') {
$_POST['survey_type'] = 2;
}
$anketa = $this->SurveyAdmin->nova_anketa($naslov, $intro_opomba, $akronim, $_POST['survey_type'], $skin);
@@ -1838,6 +1775,10 @@ class SurveyAdminAjax {
$row = SurveyInfo::getInstance()->getSurveyRow();
+ $starts = '';
+ $expire = '';
+
+ // Anketa ni aktivna - jo aktiviramo
if ($row['active'] == 0) {
$active = 1;
$backup = 0;
@@ -1855,10 +1796,12 @@ class SurveyAdminAjax {
if ($_POST['starts']) {
$starts = ", starts='" . $_POST['starts'] . "' ";
$activity_starts = "'".$_POST['starts']."'";
- } else {
+ }
+ else {
$starts = ", starts=NOW() ";
$activity_starts = 'NOW()';
}
+
if ($_POST['expire']) {
# če je datum expire od trajne ankete '2099-01-01' in anketo deaktiviramo moramo spremeniti datum expire da ni več videti kot trajna
if ($_POST['expire'] == PERMANENT_DATE) {
@@ -1867,28 +1810,45 @@ class SurveyAdminAjax {
}
$expire = ", expire='" . $_POST['expire'] . "' ";
$activity_expire = "'".$_POST['expire']."'";
- } else {
+ }
+ else {
$expire = ", expire=NOW() + INTERVAL 30 DAY ";
$activity_expire = 'NOW() + INTERVAL 30 DAY';
}
- } else {
+ }
+ // Anketa je aktivna - jo deaktiviramo
+ else {
$active = 0;
$backup = $row['backup'];
$locked = "locked";
-
- if(Common::checkModule('maza') && SurveyInfo::getSurveyModules('maza')){
+
+ $activity_expire = 'NOW()';
+
+ if(Common::checkModule('maza') && SurveyInfo::checkSurveyModule('maza')){
$maza = new MAZA($this->anketa);
$maza ->maza_off();
}
}
- $sql = sisplet_query("UPDATE srv_anketa SET active='$active', backup='$backup', locked=$locked $starts $expire WHERE id = '$anketa'");
+ $sql = sisplet_query("UPDATE srv_anketa SET active='$active', backup='$backup', locked=$locked $starts $expire WHERE id='$anketa'");
- # dodamo zapis v srv_activity
+ # Pri aktivaciji dodamo zapis v srv_activity samo ce
if ($active == 1) {
- $activity_insert_string = "INSERT INTO srv_activity (sid, starts, expire, uid) VALUES('".$anketa."', $activity_starts, $activity_expire, '".$global_user_id."' );";
- $sql_insert = sisplet_query($activity_insert_string);
+ $sql_insert = sisplet_query("INSERT INTO srv_activity
+ (sid, starts, expire)
+ VALUES
+ ('".$anketa."', ".$activity_starts.", ".$activity_expire.")
+ ON DUPLICATE KEY UPDATE
+ expire=".$activity_expire."
+ ");
}
+ else{
+ $sql_insert = sisplet_query("UPDATE srv_activity
+ SET expire=".$activity_expire."
+ WHERE sid='".$anketa."'
+ ");
+ }
+
# vsilimo refresh podatkov
SurveyInfo :: getInstance()->resetSurveyData();
@@ -1902,7 +1862,7 @@ class SurveyAdminAjax {
$this->anketa = $anketa;
- if ($_POST['folders'] && $_POST['folders'] == 'true') { // če smo na folderjih zlistamo folderje
+ if (isset($_POST['folders']) && $_POST['folders'] == 'true') { // če smo na folderjih zlistamo folderje
# osvezimo samo ikonico in ne celotnih map
$row = SurveyInfo::getInstance()->getSurveyRow();
echo '<a href="#" onclick="anketa_active(\''.$this->anketa.'\',\''.(int)$row['active'].'\',\'true\'); return false;">' .
@@ -1924,31 +1884,34 @@ class SurveyAdminAjax {
$rowa = SurveyInfo::getInstance()->getSurveyRow();
- //notify all maza app users who participate in this survey that this survey has ended
- if(SurveyInfo::getSurveyModules('maza') && $rowa['active'] = 1){
- $maza = new MAZA($this->anketa);
- $maza ->maza_off();
- }
+ //notify all maza app users who participate in this survey that this survey has ended
+ if(SurveyInfo::checkSurveyModule('maza') && $rowa['active'] = 1){
+ $maza = new MAZA($this->anketa);
+ $maza ->maza_off();
+ }
$this->SurveyAdmin->anketa_delete($anketa);
# če postamo iz survey_lista (prva stran) preverimo koliko anket je ostalo, če je bila zadnja osvežimo celotno stran
if (isset($_POST['inList'] ) && $_POST['inList'] == 'true' ) {
+ global $admin_type, $global_user_id;
+
# preštejemo število anket.
- global $admin_type, $global_user_id;
//SELECT count(sa.id) AS cnt FROM srv_anketa sa WHERE sa.backup='0' AND sa.id > 0 AND (sa.dostop >= '2' OR sa.id IN (SELECT ank_id FROM srv_dostop WHERE uid='90'))
$stringSurveyList = "SELECT count(sa.id) AS cnt FROM srv_anketa sa WHERE sa.backup='0' AND sa.id > 0 AND (sa.dostop >= '".$admin_type."' OR sa.id IN (SELECT ank_id FROM srv_dostop WHERE uid='".$global_user_id."'))";
$sqlSurveyList = sisplet_query($stringSurveyList);
$rowSurveyList = mysqli_fetch_assoc($sqlSurveyList);
+
# v ajax post vrnemo število anket
echo $rowSurveyList['cnt'];
+
return;
}
+
if ($rowa['backup'] > 0)
echo 'index.php?anketa=' . $rowa['backup'] . '&a=arhivi';
else
echo 'index.php';
-
}
elseif ($_GET['a'] == 'nova_grupa') {
Common::updateEditStamp();
@@ -3236,9 +3199,6 @@ class SurveyAdminAjax {
if ($value != '') {
sisplet_query("INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, usr_id, text) VALUES ('$spr_id', '$vre_id', '$usr_id', '$value')");
-
- /*if ($textfield == 1)
- sisplet_query("DELETE FROM srv_data_vrednost WHERE spr_id='$spr_id' AND usr_id='$usr_id'");*/
}
}
@@ -3246,40 +3206,11 @@ class SurveyAdminAjax {
Common::updateEditStamp();
sisplet_query("DELETE FROM srv_user WHERE id = '$usr_id'");
- /* Ker imamo FK bi moralo avtomatsko pobrisati vse ostale vnose ( upam da res :) )
- sisplet_query("DELETE FROM srv_data_grid".$this->db_table." WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_text".$this->db_table." WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_checkgrid".$this->db_table." WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_imena WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_number WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_rating WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_data_textgrid".$this->db_table." WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_user_grupa_active WHERE usr_id = '$usr_id'");
- sisplet_query("DELETE FROM srv_user_grupa WHERE usr_id = '$usr_id'");
- */
}
elseif ($_GET['a'] == 'delete_all') {
Common::updateEditStamp();
$sql = sisplet_query("DELETE FROM srv_user WHERE ank_id = '$this->anketa'");
- //$sql = sisplet_query("SELECT * FROM srv_user WHERE ank_id = '$this->anketa'");
- //while ($row = mysqli_fetch_array($sql)) {
-
- //sisplet_query("DELETE FROM srv_user WHERE id = '$row[id]'");
- /* Ker imamo FK bi moralo avtomatsko pobrisati vse ostale vnose ( upam da res :) )
- sisplet_query("DELETE FROM srv_data_grid".$this->db_table." WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_text".$this->db_table." WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_checkgrid".$this->db_table." WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_imena WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_number WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_rating WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_data_textgrid".$this->db_table." WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_user_grupa_active WHERE usr_id = '$row[id]'");
- sisplet_query("DELETE FROM srv_user_grupa WHERE usr_id = '$row[id]'");
- */
- //}
# pobrišemo še DATA datoteke in HTML -dashboard če obstajajo
global $site_path;
@@ -3325,8 +3256,9 @@ class SurveyAdminAjax {
$row = SurveyInfo::getInstance()->getSurveyRow();
# updejtjmo pošiljanje alertov
- SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- SurveyAlert::getInstance()->prepareSendExpireAlerts();
+ // Ostanek, kjer se uporablja baza surveycrontab za posiljanje obvestil o poteku
+ /*SurveyAlert::getInstance()->Init($anketa, $global_user_id);
+ SurveyAlert::getInstance()->prepareSendExpireAlerts();*/
if ($_POST['folders'] && $_POST['folders'] == 'true') { // če smo na folderjih zlistamo folderje
// osvezimo samo ikonico in ne celotnih map
@@ -3342,111 +3274,111 @@ class SurveyAdminAjax {
global $global_user_id;
$folders = $_POST['folders'];
-
+
# za koliko časa aktiviramo
$mth = 3;
$starts = date("d.m.Y"); // danes
- $startsDB = date("Y-m-d"); // danes
$cd = strtotime($starts);
$expire = date('d.m.Y', mktime(0, 0, 0, date('m', $cd) + $mth, date('d', $cd), date('Y', $cd)));
- $expireDB = date('Y-m-d', mktime(0, 0, 0, date('m', $cd) + $mth, date('d', $cd), date('Y', $cd)));
- # preverimo ali ima uporabnik izklopljeno zaklepanje
- # polovimo nastavitve uporabnika
-
- UserSetting::getInstance()->Init($global_user_id);
- # ali zaklepamo anketo ob aktivaciji
- $lockSurvey = UserSetting::getInstance()->getUserSetting('lockSurvey');
-
- # aktiviramo anketo
- #avtomatsko aktiviramo anketo za 1 mesec in o tem obvestimo uporabnika.
- $updateString = "UPDATE srv_anketa SET active='1', locked='".(int)$lockSurvey."', backup='0', starts='".$startsDB."', expire='".$expireDB."' WHERE id='$anketa'";
- $sql = sisplet_query($updateString) or die(mysqli_error($GLOBALS['connect_db']));
-
- // Zapišemo vsako aktivacijo ankete po dnevih
- $activity_insert_string = "INSERT INTO srv_activity (sid, starts, expire, uid) VALUES('" . $anketa . "', '" . $startsDB . "', '" . $expireDB . "', '" . $global_user_id . "' )";
- $sql_insert = sisplet_query($activity_insert_string);
-
- # popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
- Common::getInstance()->updateEditStamp();
-
- # vsilimo refresh podatkov
- SurveyInfo :: getInstance()->resetSurveyData();
$row = SurveyInfo::getInstance()->getSurveyRow();
-
- # posljemo mail ob spremembi aktivnosti ankete
- SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- SurveyAlert::getInstance()->sendMailActive();
-
- $gdpr = new GDPR();
+
+ $b = new Branching($this->anketa);
+ $napake = $b->check_pogoji_output();
# Aktivacijski pop up za hierarhijo
if(SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
// Anketo zaklenemo
- sisplet_query("UPDATE srv_anketa SET locked='1' WHERE id = '$anketa'");
+ //sisplet_query("UPDATE srv_anketa SET locked='1' WHERE id = '$anketa'");
// Popup
- echo '<div id="anketa_activate_note" class="divPopUp">';
+ echo '<div id="anketa_activate_note" class="divPopUp PopUpNarrow">';
- echo '<div class="popup_close"><a href="#" onClick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;">✕</a></div>';
+ //echo '<div class="popup_close"><a href="#" onClick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;">✕</a></div>';
- echo '<h2>' . $lang['srv_hierarchy_activation_header'] . '.</h2>';
-
- echo '<div>' . $lang['srv_activation_expire'] . $expire . '</div>';
- echo '<div id="div_anketa_activate_more"><br/>';
- printf($lang['srv_activation_setting'], $anketa);
- echo '</div>';
-
- // Seznam uporabnikov na katere je bil poslan email
- // Dobimo samo uporabnike na zadnjem nivoju in to obvestilo prikažemo samo prvič ko se aktivira anketa
- if(SurveyInfo::getSurveyModules('hierarhija') == 1) {
- $users_upravicen_do_evalvacije = (new \Hierarhija\Model\HierarhijaOnlyQuery())->queryStrukturaUsers($anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $anketa . ') GROUP BY users.id');
- echo '<div class="hierarhija-aktivacija-seznam-uporabnikov">';
- echo '<div class="oranzna">';
-
- echo '<h3>' . Hierarhija\HierarhijaHelper::textGledeNaOpcije($anketa, 'srv_hierarchy_email_code') . '</h3>';
-
- if(\Hierarhija\Model\HierarhijaQuery::getOptions($anketa, 'onemogoci_dostop_uciteljem') == 1)
- echo '<h3>' . $lang['srv_hierarchy_teacher_can_not_access']. '</h3>';
-
- echo '</div>';
- echo '<ul>';
- while ($uporabnik = $users_upravicen_do_evalvacije->fetch_object()) {
- echo '<li>' . $uporabnik->email . '</li>';
- }
- echo '</ul>';
- echo '</div>';
- }
+ echo '<h2>' . $lang['srv_hierarchy_activation_header'] . '</h2>';
+
+ //ce hocemo izpisati samo warninge, izpustimo prvo vrstico
+ if((!isset($_POST['izpis']) || $_POST['izpis'] !== 'only_warnings')){
+ echo '<div class="popup_row">';
+ echo '<div><span class="faicon info blue"></span></div>';
+
+ echo '<div>';
+ echo '<div class="'.(($napake == '1') ? '':' gray-text').' bottom8">' . $lang['srv_activation_expire'] . $expire . '</div>';
+ echo '<div class="'.(($napake == '1') ? '':' gray-text').'" id="div_anketa_activate_more">';
+ printf($lang['srv_activation_setting'], $anketa);
+ echo '</div>';
+
+ // Seznam uporabnikov na katere je bil poslan email
+ // Dobimo samo uporabnike na zadnjem nivoju in to obvestilo prikažemo samo prvič ko se aktivira anketa
+ if(SurveyInfo::getSurveyModules('hierarhija') == 1) {
+ $users_upravicen_do_evalvacije = (new \Hierarhija\Model\HierarhijaOnlyQuery())->queryStrukturaUsers($anketa, ' AND hs.level=(SELECT MAX(level) FROM srv_hierarhija_struktura WHERE anketa_id=' . $anketa . ') GROUP BY users.id');
+ echo '<div class="hierarhija-aktivacija-seznam-uporabnikov top16">';
+ echo '<div class="oranzna">';
+
+ echo Hierarhija\HierarhijaHelper::textGledeNaOpcije($anketa, 'srv_hierarchy_email_code');
+
+ if(\Hierarhija\Model\HierarhijaQuery::getOptions($anketa, 'onemogoci_dostop_uciteljem') == 1)
+ echo '<br>'.$lang['srv_hierarchy_teacher_can_not_access'];
+
+ echo '</div>';
+ echo '<ul>';
+ while ($uporabnik = $users_upravicen_do_evalvacije->fetch_object()) {
+ echo '<li>' . $uporabnik->email . '</li>';
+ }
+ echo '</ul>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+ echo '</div>';
+ }
}
else {
// Brez timerja
//echo '<script>stopActivationTimer();</script>';
# Aktivacijski pop up za vse ostale ankete
- echo '<div id="anketa_activate_note" class="divPopUp">';
+ echo '<div id="anketa_activate_note" class="divPopUp PopUpNarrow">';
- echo '<div class="popup_close"><a href="#" onClick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;">✕</a></div>';
+ //echo '<div class="popup_close"><a href="#" onClick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;">✕</a></div>';
- echo '<h2>' . $lang['srv_activation_header'] . '.</h2>';
+ echo '<h2>' . $lang['srv_activation_header'] . '</h2>';
// GDPR opozorilo ce ni potencialno GDPR
- echo '<p class="bold">';
+ /* echo '<p class="semi-bold bottom16">';
printf($lang['srv_activation_text_nongdpr'], $anketa);
echo '</p>';
- echo '<p class="bold">';
+ echo '<p class="semi-bold">';
echo $lang['srv_activation_text_nongdpr2'];
- echo '</p>';
-
- echo '<div>' . $lang['srv_activation_expire'] .'<b>'.$expire.'</b></div>';
- echo '<div id="div_anketa_activate_more"><br/>';
- printf($lang['srv_activation_setting'], $anketa);
- echo '</div>';
+ echo '</p>'; */
+
+ //ce hocemo izpisati samo warninge, izpustimo prvo vrstico
+ if((!isset($_POST['izpis']) || $_POST['izpis'] !== 'only_warnings')){
+ echo '<div class="popup_row">';
+ echo '<div><span class="faicon info blue"></span></div>';
+ echo '<div>';
+ echo '<div class="bottom8 '.(($napake == '1') ? '':' gray-text').'">' . $lang['srv_activation_expire'] .'<b> '.$expire.'</b></div>';
+ echo '<div class="'.(($napake == '1') ? '':' gray-text').'" id="div_anketa_activate_more">';
+ printf($lang['srv_activation_setting'], $anketa);
+ echo '</div>';
+ echo '</div>';
+ echo '</div>';
+ }
- echo '<div id="div_lock_survey">';
+ /* echo '<div id="div_lock_survey">';
$sas = new SurveyAdminSettings();
$sas->showLockSurvey();
+ echo '</div>'; */
+ }
+
+ if($napake !== '1'){
+ echo '<div class="popup_row top16">';
+ echo '<div><span class="faicon warning yellow"></span></div>';
+ echo '<div>';
+ echo $napake;
+ echo '</div>';
echo '</div>';
}
@@ -3462,9 +3394,7 @@ class SurveyAdminAjax {
echo $lang['srv_activate_duration_manual_to'];
echo '<input id="expireManual" type="text" name="expireManual" value="' . $expire . '" /> <span id="expire_img_manual" class="sprites calendar_ico"></span><br/>';
echo '</label></p>';
- echo '</fieldset>';
- echo '<fieldset><legend>'.$lang['srv_vote_limit'].'</legend>';
echo '<p><label>' . $lang['srv_vote_limit'] . ':</label>';
echo '<input type="radio" name="vote_count_limit" value="0" id="vote_count_limit_0"' . ($row['vote_limit'] == 0 ? ' checked="checked"' : '') . ' onClick="voteCountToggle(0)" /><label for="vote_count_limit_0">' . $lang['no1'] . '</label>';
echo '<input type="radio" name="vote_count_limit" value="1" id="vote_count_limit_1"' . ($row['vote_limit'] == 1 ? ' checked="checked"' : '') . ' onClick="voteCountToggle(1)" /><label for="vote_count_limit_1">' . $lang['yes'] . '</label>';
@@ -3473,7 +3403,6 @@ class SurveyAdminAjax {
echo '<label for="anketa' . $row['id'] . '" >'.$lang['srv_vote_count'].':</label>';
echo '<input type="text" id="vote_count_val" name="vote_count_val" value="' . $row['vote_count'] . '" style="width:50px; margin-left: 5px;" maxlength="7" />';
echo '</p>';
- echo '</fieldset>';
echo '
<script type="text/javascript">
@@ -3496,14 +3425,71 @@ class SurveyAdminAjax {
echo '</div>';
// Timer counter
- echo '<div id="divAvtoClose" active="1" >'.$lang['srv_activate_duration_autostart'].': <span>10</span> s.</div>';
+ //echo '<div class="top16 bottom16" id="divAvtoClose" active="1" >'.$lang['srv_activate_duration_autostart'].': <span>10</span> s.</div>';
// Gumb zapri
- echo '<div class="buttonwrapper buttons_holder"><a class="ovalbutton ovalbutton_orange" href="#" onclick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;"><span>' . $lang['srv_zapri'] . '</span></a></div>';
-
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fullscreen\').fadeOut(\'slow\'); popupClose(); return false;">'.$lang['srv_activation_button_cancel'].'</button>';
+ if($napake == '1')
+ echo '<button class="medium blue" onClick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;">'.$lang['srv_activation_button_activate'].'</button>';
+ echo '</div>';
+
echo '</div>';
- } elseif ($_GET['a'] == 'anketa_save_activation') {
+ }
+ elseif ($_GET['a'] == 'anketa_activate') {
+ global $global_user_id;
+
+ $folders = $_POST['folders'];
+
+ # za koliko časa aktiviramo
+ $mth = 3;
+
+ $starts = date("d.m.Y"); // danes
+ $startsDB = date("Y-m-d"); // danes
+ $cd = strtotime($starts);
+ $expire = date('d.m.Y', mktime(0, 0, 0, date('m', $cd) + $mth, date('d', $cd), date('Y', $cd)));
+ $expireDB = date('Y-m-d', mktime(0, 0, 0, date('m', $cd) + $mth, date('d', $cd), date('Y', $cd)));
+
+ # preverimo ali ima uporabnik izklopljeno zaklepanje
+ # polovimo nastavitve uporabnika
+
+ UserSetting::getInstance()->Init($global_user_id);
+ # ali zaklepamo anketo ob aktivaciji
+ $lockSurvey = UserSetting::getInstance()->getUserSetting('lockSurvey');
+
+ # aktiviramo anketo
+ #avtomatsko aktiviramo anketo za 1 mesec in o tem obvestimo uporabnika.
+ $updateString = "UPDATE srv_anketa SET active='1', locked='".(int)$lockSurvey."', backup='0', starts='".$startsDB."', expire='".$expireDB."' WHERE id='$anketa'";
+
+ $sql = sisplet_query($updateString) or die(mysqli_error($GLOBALS['connect_db']));
+
+ // Zapišemo vsako aktivacijo ankete po dnevih
+ $sql_insert = sisplet_query("INSERT INTO srv_activity
+ (sid, starts, expire)
+ VALUES
+ ('".$anketa."', '".$startsDB."', '".$expireDB."')
+ ON DUPLICATE KEY UPDATE
+ expire='".$expireDB."'
+ ");
+
+ # popravimo timestamp za regeneracijo dashboarda
+ Common::getInstance()->Init($anketa);
+ Common::getInstance()->updateEditStamp();
+
+ # vsilimo refresh podatkov
+ SurveyInfo :: getInstance()->resetSurveyData();
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ # posljemo mail ob spremembi aktivnosti ankete
+ SurveyAlert::getInstance()->Init($anketa, $global_user_id);
+ SurveyAlert::getInstance()->sendMailActive();
+
+ # Preverimo, ce gre za phishing
+ $check = new SurveyCheck($anketa);
+ $check->checkPhishing();
+ }
+ elseif ($_GET['a'] == 'anketa_save_activation') {
Common::updateEditStamp();
# po potrebi shranimo dodatne nastavitve
@@ -3522,24 +3508,29 @@ class SurveyAdminAjax {
if ((int)$_POST['voteCountLimitType'] == 1) {
$updateString .= $prefix." vote_limit = '1', vote_count='".(int)$_POST['voteCountValue']."'";
$prefix = ',';
- } elseif ((int)$_POST['voteCountLimitType'] == 2) {
+ }
+ elseif ((int)$_POST['voteCountLimitType'] == 2) {
$updateString .= $prefix." vote_limit = '2', vote_count='".(int)$_POST['voteCountValue']."'";
$prefix = ',';
- } else {
+ }
+ else {
$updateString .= $prefix." vote_limit = '0'";
$prefix = ',';
}
$updateString .= " WHERE id='$anketa'";
$sql = sisplet_query($updateString);
+
#updejtamo srv_alert
- global $global_user_id;
+ // Ostanek, kjer se uporablja baza surveycrontab za posiljanje obvestil o poteku
+ /*global $global_user_id;
SurveyAlert::getInstance()->Init($this->anketa, $global_user_id);
- SurveyAlert::getInstance()->prepareSendExpireAlerts();
+ SurveyAlert::getInstance()->prepareSendExpireAlerts();*/
+
# vsilimo refresh podatkov
- SurveyInfo :: getInstance()->resetSurveyData();
-
- } elseif ($_GET['a'] == 'anketa_getDates') {
+ SurveyInfo :: getInstance()->resetSurveyData();
+ }
+ elseif ($_GET['a'] == 'anketa_getDates') {
// prikažemo vmesnik za izbiro datuma
// preberemo datume aktivnosti
//$sqlDates = sisplet_query("SELECT starts, expire FROM srv_anketa WHERE id='" . $this->anketa . "'");
@@ -4193,13 +4184,17 @@ class SurveyAdminAjax {
// shranimo nastavitve
UserSetting::getInstance()->saveUserSetting();
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL->getSurveys();
}
elseif ($_GET['a'] == 'surveyListFilter') {
- // setiramo nastavitve v UserSetting
- $SL = new SurveyList();
- $SL -> setFilter();
+
+ // setiramo nastavitve v UserSetting
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
+ $SL->setFilter();
+
$SL->getSurveys();
}
elseif ($_GET['a'] == 'default_surveyListSettings') {
@@ -4226,8 +4221,10 @@ class SurveyAdminAjax {
if ($_POST['sortby'] != "" )
UserSetting::getInstance()->setUserSetting('survey_list_order_by', $_POST['sortby']. ",".$_POST['sorttype']);
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL->saveCssSettings($_POST['data']);
+
$SL->getSurveys();
}
elseif ($_GET['a'] == 'surveyList_goTo') {
@@ -4236,7 +4233,7 @@ class SurveyAdminAjax {
UserSetting::getInstance()->setUserSetting('survey_list_order_by', $_POST['sortby']. ",".$_POST['sorttype']);
UserSetting::getInstance()->saveUserSetting();
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
$SL->getSurveys();
}
@@ -4247,37 +4244,37 @@ class SurveyAdminAjax {
UserSetting::getInstance()->setUserSetting('survey_list_folders', $val);
UserSetting::getInstance()->saveUserSetting();
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
$SL->getSurveys();
}
elseif ($_GET['a'] == 'surveyList_user') {
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL -> setUserId();
$SL->getSurveys();
-
}
elseif ($_GET['a'] == 'surveyList_language') {
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL -> setUserLanguage();
$SL->getSurveys();
-
}
elseif ($_GET['a'] == 'surveyList_gdpr') {
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL -> setUserGDPR();
$SL->getSurveys();
-
}
elseif ($_GET['a'] == 'surveyList_library') {
- $SL = new SurveyList();
+ $SL = (SurveyList::hasFolders()) ? new SurveyListFolders() : new SurveyList();
+
$SL -> setUserLibrary();
$SL->getSurveys();
-
}
elseif ($_GET['a'] == 'survey_chaneg_type') {
global $site_url;
@@ -4403,7 +4400,7 @@ class SurveyAdminAjax {
echo '<div id="preview_spremenljivka">';
- echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancle(); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancel(); return false;">✕</a></div>';
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
@@ -4413,10 +4410,10 @@ class SurveyAdminAjax {
}
echo ' <div id="spremenljivka_preview">';
if ( $_POST['spremenljivka'] == -1 ) {
- \App\Controllers\BodyController::getInstance()->displayIntroduction();
+ \App\Controllers\BodyController::getInstance()->displayIntroductionContent();
}
elseif ( $_POST['spremenljivka'] == -2 ) {
- \App\Controllers\BodyController::getInstance()->displayKonec();
+ \App\Controllers\BodyController::getInstance()->displayKonecContent();
}
elseif ( $_POST['spremenljivka'] == -3 ) {
\App\Controllers\StatisticController::displayStatistika();
@@ -4427,14 +4424,84 @@ class SurveyAdminAjax {
\App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($_POST['spremenljivka'], $offset, $zaporedna);
}
echo ' </div>';
-
- echo '<div class="buttons_holder">';
- echo '<span class="floatRight">';
- echo ' <div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="preview_spremenljivka_cancle(); return false;"><span>' . $lang['srv_zapri'] . '</span></a></div> ';
- echo ' <div class="buttonwrapper spaceRight floatRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.open(\''.$site_url.'admin/survey/ajax.php?t=branching&a=spremenljivka_preview_print&anketa='.$this->anketa.'&spremenljivka='.$_POST['spremenljivka'].'\', \'print\', \'scrollbars=1\'); return false;"><span><img src="img_0/printer.png" /> ' . $lang['hour_print2'] . '</span></a></div> ';
- echo '</span>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="window.open(\''.$site_url.'admin/survey/ajax.php?t=branching&a=spremenljivka_preview_print&anketa='.$this->anketa.'&spremenljivka='.$_POST['spremenljivka'].'\', \'print\', \'scrollbars=1\'); return false;">'.$lang['hour_print2'].'</button>';
+ echo '<button class="medium blue" onClick="preview_spremenljivka_cancel(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
+
+ echo '</div>';
+ }
+ elseif ($_GET['a'] == 'preview_spremenljivka_lib') {
+ global $site_path;
+
+ SurveyInfo :: getInstance()->SurveyInit($anketa);
+
+ $offset = 0;
+ $zaporedna = 0;
+ $count_type = SurveyInfo :: getInstance()->getSurveyCountType();
+
+ if ($count_type) {
+
+ // Preštejemo koliko vprašanj je bilo do sedaj
+ $sqlg = sisplet_query("SELECT vrstni_red FROM srv_grupa WHERE id = (SELECT gru_id FROM srv_spremenljivka WHERE id = '" . $_POST['spremenljivka'] . "')");
+ $rowg = mysqli_fetch_assoc($sqlg);
+ $vrstni_red = $rowg['vrstni_red'];
+
+ $sqlCountPast = sisplet_query("SELECT count(*) as cnt FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='" . $_POST['anketa'] . "' AND s.gru_id=g.id AND g.vrstni_red < '$vrstni_red' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
+ $rowCount = mysqli_fetch_assoc($sqlCountPast);
+ $offset = $rowCount['cnt'];
+
+ // poiscemo vprasanja / spremenljivke
+ $sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id=(SELECT gru_id FROM srv_spremenljivka WHERE id = '" . $_POST['spremenljivka'] . "') AND visible='1' ORDER BY vrstni_red ASC");
+ while ($row = mysqli_fetch_array($sql)) {
+ if ($row['id'] == $_POST['spremenljivka']) {
+ $zaporedna++;
+ break;
+ }
+ }
+ }
+
+
+ echo '<h2><span class="as_link" onClick="closePreviewVprasanje();"><span class="faicon arrow_back"></span>'.$lang['srv_deleted_vprasanja_back'].'</span></h2>';
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<div id="preview_spremenljivka">';
+
+ $lang_old = $lang;
+
+ include_once('../../main/survey/app/global_function.php');
+ new \App\Controllers\SurveyController(true);
+
+ if (isset($_POST['lang_id'])) {
+ save('lang_id', (int)$_POST['lang_id']);
+ }
+ echo ' <div id="spremenljivka_preview">';
+ if ( $_POST['spremenljivka'] == -1 ) {
+ \App\Controllers\BodyController::getInstance()->displayIntroductionContent();
+ }
+ elseif ( $_POST['spremenljivka'] == -2 ) {
+ \App\Controllers\BodyController::getInstance()->displayKonecContent();
+ }
+ elseif ( $_POST['spremenljivka'] == -3 ) {
+ \App\Controllers\StatisticController::displayStatistika();
+ }
+ else {
+ save('forceShowSpremenljivka', true);
+ save('question_preview', true);
+ \App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($_POST['spremenljivka'], $offset, $zaporedna);
+ }
+ echo ' </div>';
+
+ echo '</div>';
+
+ $lang = $lang_old;
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onClick="closePreviewVprasanje(); return false;">'.$lang['srv_deleted_vprasanja_back'].'</button>';
echo '</div>';
}
else if ($_GET['a'] == 'preview_page') {
@@ -4448,23 +4515,7 @@ class SurveyAdminAjax {
echo ' <div class="clr"></div>';
echo ' </div>';
echo '</div>';
- }
- /*else if ($_GET['a'] == 'rename_variable') {
- if ($_POST['show'] == 'true') {
- echo '<input type="text" name="variable" id="variable_' . $spremenljivka . '" value="' . $_POST['value'] . '" class="variableinput variableinput_noborder" onkeyup="edit_spremenljivka_variable(\'' . $spremenljivka . '\');" ' . ' />';
- echo '<script type="text/javascript">';
- echo '$(document).ready(function() {';
- echo ' $("#variable_' . $spremenljivka . '").keypress(function(e){if(e.which==13) rename_variable(\'' . $spremenljivka . '\', $(this).val()' . ', \'' . $_POST['variable_custom'] . '\', \'false\'); });';
- echo '});';
- echo '</script>';
-
- } else {
- echo $_POST['value'];
- echo '<a href="#" onclick="rename_variable(\'' . $spremenljivka . '\', \'' . $_POST['value'] . '\', \'' . $_POST['variable_custom'] . '\', \'true\'); return false;" title="' . $lang['edit3'] . '"><img id="edit_variable_' . $spremenljivka . '" src="img_' . $this->skin . '/pencil.png" /></a>';
-
- }
- }*/
-
+ }
else if ($_GET['a'] == 'form_settings') {
Common::updateEditStamp();
@@ -4679,8 +4730,6 @@ class SurveyAdminAjax {
UserSetting::getInstance()->setUserSetting('full_screen_edit', $_POST['full_screen_edit']);
}
UserSetting::getInstance()->saveUserSetting();
- } elseif ($_GET['a'] == 'display_success_save') {
- $this->SurveyAdmin->displaySuccessSave();
} elseif ($_GET['a'] == 'vnosi_show_status_casi') {
SurveyStatusCasi :: Init($anketa);
if (isset($pid) && $pid > 0) {
@@ -4807,7 +4856,19 @@ class SurveyAdminAjax {
Timer::GetTimer($lang['srv_collectData']);
- } elseif ($_GET['a'] == 'dataDeleteRow') {
+ }
+ // Pobrisemo neustrezne odgovore
+ elseif ($_GET['a'] == 'dataCountNeustrezne') {
+ $sql = sisplet_query("SELECT count(id) FROM srv_user WHERE ank_id='".$this->anketa."' AND (last_status='-1' OR last_status='3' OR last_status='4' OR (last_status='5' AND lurker='1') OR (last_status='6' AND lurker='1')) AND deleted='0' AND preview='0'");
+ $row = mysqli_fetch_array($sql);
+
+ echo $row['count(id)'];
+ }
+ // Pobrisemo neustrezne odgovore
+ elseif ($_GET['a'] == 'dataDeleteNeustrezne') {
+ sisplet_query("DELETE FROM srv_user WHERE ank_id='".$this->anketa."' AND (last_status='-1' OR last_status='3' OR last_status='4' OR (last_status='5' AND lurker='1') OR (last_status='6' AND lurker='1')) AND deleted='0' AND preview='0'");
+ }
+ elseif ($_GET['a'] == 'dataDeleteRow') {
if ((int)$usr_id > 0) {
@@ -4818,13 +4879,18 @@ class SurveyAdminAjax {
sisplet_query("UPDATE srv_user SET deleted = '1', time_edit = NOW() WHERE id = '$usr_id'");
sisplet_query('COMMIT');
+ // Pobrišemo vse datoteke
+ $SDF = SurveyDataFile::get_instance();
+ $SDF->init($this->anketa);
+ $SDF->clearFiles();
+
echo '0';
}
else {
echo 'Error: Invalid user ID!';
}
- } elseif ($_GET['a'] == 'dataDeleteMultipleRow') { // V DELU...
+ } elseif ($_GET['a'] == 'dataDeleteMultipleRow') {
// ulovimo json objekt z userji za brisanje
if ( is_array($_POST['users']) && count($_POST['users']) > 0 ) {
@@ -4837,6 +4903,11 @@ class SurveyAdminAjax {
sisplet_query("UPDATE srv_user SET deleted = '1', time_edit = NOW() WHERE id IN (".$users.")");
sisplet_query('COMMIT');
+
+ // Pobrišemo vse datoteke
+ $SDF = SurveyDataFile::get_instance();
+ $SDF->init($this->anketa);
+ $SDF->clearFiles();
}
} elseif ($_GET['a'] == 'dataCopyRow') {
@@ -4931,6 +5002,9 @@ class SurveyAdminAjax {
} elseif ($_GET['a'] == 'nice_url') {
$this->ajax_nice_url();
+ } elseif ($_GET['a'] == 'nice_url_check') {
+ $this->ajax_nice_url_check();
+
} elseif ($_GET['a'] == 'nice_url_remove') {
$this->ajax_nice_url_remove();
@@ -4970,10 +5044,70 @@ class SurveyAdminAjax {
$row = mysqli_fetch_array($sql);
$f = new Forum();
- $vsebina = $row['vsebina'].'<blockquote style="margin-left:20px"><b>'.$f->user($global_user_id).'</b> ('.$f->datetime1(date('Y-m-d h:i:s')).'):<br />'.$vsebina.'</blockquote>';
+ $vsebina = $row['vsebina'].'<blockquote><span class="semi-bold">'.$f->user($global_user_id).'</span> <span class="gray">('.$f->datetime1(date('Y-m-d h:i:s')).')</span><div class="answer">'.$vsebina.'</div></blockquote>';
sisplet_query("UPDATE post SET vsebina='$vsebina' WHERE id='$id'");
+ }
+ elseif ($_GET['a'] == 'comment_on_comment_resp') {
+ $id = $_POST['id'];
+ $vsebina = $_POST['vsebina'];
+
+ if ($vsebina == '') return;
+
+ $sql = sisplet_query("SELECT text FROM srv_data_text".$this->db_table." WHERE id='$id'");
+ $row = mysqli_fetch_array($sql);
+
+ $f = new Forum();
+ $vsebina = $row['text'].'<blockquote><span class="semi-bold">'.$f->user($global_user_id).'</span> <span class="gray">('.$f->datetime1(date('Y-m-d h:i:s')).')</span><div class="answer">'.$vsebina.'</div></blockquote>';
+
+ sisplet_query("UPDATE srv_data_text".$this->db_table." SET text='$vsebina' WHERE id='$id'");
+
+ }
+ elseif ($_GET['a'] == 'comment_on_comment_splosni_resp') {
+ $id = $_POST['id'];
+ $vsebina = $_POST['vsebina'];
+
+ if ($vsebina == '') return;
+
+ $sql = sisplet_query("SELECT comment FROM srv_comment_resp WHERE id='$id'");
+ $row = mysqli_fetch_array($sql);
+
+ $f = new Forum();
+ $vsebina = $row['comment'].'<blockquote><span class="semi-bold">'.$f->user($global_user_id).'</span> <span class="gray">('.$f->datetime1(date('Y-m-d h:i:s')).')</span><div class="answer">'.$vsebina.'</div></blockquote>';
+
+ sisplet_query("UPDATE srv_comment_resp SET comment='$vsebina' WHERE id='$id'");
+
+ }
+ elseif ($_GET['a'] == 'comment_delete') {
+ $id = $_POST['id'];
+
+ if (isset($_POST['id']) && $_POST['id'] != "" && $_POST['id'] > 0) {
+ $id = $_POST['id'];
+ $sql = sisplet_query("DELETE FROM post WHERE id='$id'");
+ }
+ } elseif ($_GET['a'] == 'respondent_comment_delete') {
+ $id = $_POST['id'];
+
+ if (isset($_POST['id']) && $_POST['id'] != "" && $_POST['id'] > 0) {
+ $id = $_POST['id'];
+ $sql = sisplet_query("DELETE FROM srv_data_text_active WHERE id='$id'");
+ }
+ } elseif ($_GET['a'] == 'survey_respondent_comment_delete') {
+ $id = $_POST['id'];
+
+ if (isset($_POST['id']) && $_POST['id'] != "" && $_POST['id'] > 0) {
+ $id = $_POST['id'];
+ $sql = sisplet_query("DELETE FROM srv_comment_resp WHERE id='$id'");
+ }
+ } elseif ($_GET['a'] == 'survey_comment_delete') {
+ $id = $_POST['id'];
+
+ if (isset($_POST['id']) && $_POST['id'] != "" && $_POST['id'] > 0) {
+ $id = $_POST['id'];
+ $sql = sisplet_query("DELETE FROM post WHERE id='$id'");
+ }
+
} elseif ($_GET['a'] == 'archivePopup') {
echo '<div class="survey_archive_popup">';
$sas = new SurveyAdminSettings();
@@ -5122,9 +5256,9 @@ class SurveyAdminAjax {
} elseif ($_GET['a'] == 'new_anketa') {
global $global_user_id, $site_url;
- $naslov = trim($_POST['naslov']);
+ $naslov = strip_tags(trim($_POST['naslov']));
- echo '<div id="new_anketa_div">';
+ echo '<div id="new_anketa_div" class="fullwidth menu_left">';
$newSurvey = new NewSurvey();
$newSurvey->displayNewSurveyPage();
echo '</div>';
@@ -5184,17 +5318,12 @@ class SurveyAdminAjax {
} elseif ($_GET['a'] == 'exportChangeCheckbox') {
- if(isset($_POST['name']) && $_POST['name'] != '') {
-
- session_start();
-
- // Resetiramo vse nastavitve
- $_SESSION['exportHiddenSystem'] = false;
- $_SESSION['exportFullMeta'] = false;
- $_SESSION['exportOnlyData'] = false;
-
- // Nastavimo ustrezno nastavitev
- $_SESSION[$_POST['name']] = true;
+ if(isset($_POST['value']) && is_numeric($_POST['value'])) {
+ //nastavi nastavitve za export ankete
+ //kateri podatki so v export se sedaj veze na naketo (0-onlydata, 1-data in paradata, 2-identifikatorji)
+ sisplet_query("INSERT INTO srv_user_setting_for_survey (sid, what, uid, value)
+ VALUES ('" . $this->anketa . "', 'default_export_data_mode', '$global_user_id', '".$_POST['value']."')
+ ON DUPLICATE KEY UPDATE value = '".$_POST['value']."';");
}
} elseif ($_GET['a'] == 'exportChangeRadio') {
if(isset($_POST['name']) && $_POST['name'] != '') {
@@ -5234,7 +5363,7 @@ class SurveyAdminAjax {
}
# dodamo zapis v srv_activity
- $activity_insert_string = "INSERT IGNORE INTO srv_activity (sid, starts, expire, uid) VALUES('".$anketa."', '".$rowDates['starts']."', '".$rowDates['expire']."', '".$global_user_id."')";
+ $activity_insert_string = "INSERT INTO srv_activity (sid, starts, expire) VALUES('".$anketa."', '".$rowDates['starts']."', '".$rowDates['expire']."') ON DUPLICATE KEY UPDATE expire='".$rowDates['expire']."'";
$msg.=$activity_insert_string;
$sql_insert = sisplet_query($activity_insert_string);
if (!$sql_insert) {
@@ -5290,113 +5419,8 @@ class SurveyAdminAjax {
} elseif ($_GET['a'] == 'comments_onoff') {
$this->ajax_comments_onoff();
- } elseif ($_GET['a'] == 'runLanguageTechnology') {
- header('Content-Type: application/json; charset=UTF-8');
- $parsedData= array();
- try {
- $settings = array();
- foreach(array('lt_language', 'lt_min_FWD', 'lt_min_nNoM', 'lt_min_vNoM', 'lt_special_setting') AS $_key) {
- if (isset ($_POST['settings'][$_key]))
- $settings[$_key] = $_POST['settings'][$_key];
- }
-
- $slt = new SurveyLanguageTechnology($this->anketa);
- $settings = $slt->setup($settings);
- $parsedData = $slt->parseSpremenljivka($spremenljivka);
- $settings['lt_spremenljivka'] = $spremenljivka;
-
- $parsedData['setting'] = $settings;
- $parsedData['error'] = array('hasError'=> false, 'msg' => '');
-
- } catch (Exception $e) {
- $parsedData['error'] = array('hasError'=> true, 'msg' => 'Prišlo je do napake');
- }
- if (isset($parsedData['language'])) {
- //unset($parsedData['language']);
- }
- echo json_encode($parsedData);
- exit();
- } elseif ($_GET['a'] == 'runLanguageTechnologyWord') {
- header('Content-Type: application/json; charset=UTF-8');
- $parsedData= array();
- try {
- $settings = array();
- if (isset ($_POST['lt_language']))
- $settings['lt_language'] = $_POST['lt_language'];
- if (isset ($_POST['lt_min_FWD']))
- $settings['lt_min_FWD'] = $_POST['lt_min_FWD'];
- if (isset ($_POST['lt_min_nNoM']))
- $settings['lt_min_nNoM'] = $_POST['lt_min_nNoM'];
- if (isset ($_POST['lt_min_vNoM']))
- $settings['lt_min_vNoM'] = $_POST['lt_min_vNoM'];
-
- $word = $_REQUEST['lt_word'];
- $wordType = $_REQUEST['lt_tag'];
- $slt = new SurveyLanguageTechnology($this->anketa);
- $settings = $slt->setup($settings);
- $parsedData = $slt->parseWord($word, $wordType);
- $settings['lt_spremenljivka'] = $spremenljivka;
-
- $parsedData['setting'] = $settings;
- $parsedData['error'] = array('hasError'=> false, 'msg' => '');
-
- } catch (Exception $e) {
- $parsedData['error'] = array('hasError'=> true, 'msg' => 'Prišlo je do napake');
-
- }
- if (isset($parsedData['language'])) {
- //unset($parsedData['language']);
- }
- echo json_encode($parsedData);
- exit();
- } elseif ($_GET['a'] == 'runLanguageTechnologyHypoHypernym') {
- header('Content-Type: application/json; charset=UTF-8');
- $parsedData= array();
- try {
- $synsets = $_REQUEST['synsets'];
-
- $slt = new SurveyLanguageTechnology($this->anketa);
- $settings = array();
-
- if (isset ($_POST['settings']['lt_language']))
- $settings['lt_language'] = $_POST['settings']['lt_language'];
- $settings = $slt->setup($settings);
-
- $parsedData = $slt->getHypoHypernym($synsets);
-
- $parsedData['setting']['lt_spremenljivka'] = $spremenljivka;
- $parsedData['setting']['synsets'] = $synsets;
-
- $parsedData['error'] = array('hasError'=> false, 'msg' => '');
-
- } catch (Exception $e) {
- $parsedData['error'] = array('hasError'=> true, 'msg' => 'Prišlo je do napake');
-
- }
- if (isset($parsedData['language'])) {
- //unset($parsedData['language']);
- }
- echo json_encode($parsedData);
- exit();
- } elseif ($_GET['a'] == 'exportLanguageTechnology') {
- header('Content-Type: application/json; charset=UTF-8');
-
- $result = array();
- try {
- $slt = new SurveyLanguageTechnology($this->anketa);
- $url = $slt->exportLanguageTechnology($_REQUEST['lt_data'], $_REQUEST['language']);
- $result['error'] = false;
- $result['filename'] = $url;
- $result['url'] = makeEncodedIzvozUrlString('izvoz.php?a=lt_excel&file=' . $url);;
- } catch (Exception $e) {
- $result['error'] = true;
- $result['filename'] = '';
- $result['url'] = '';
- $result['msg'] = $e->getMessage();
- }
- echo json_encode($result);
- exit();
- } else { // genericna resitev za vse nadaljne
+ }
+ else { // genericna resitev za vse nadaljne
$ajax = 'ajax_' . $_GET['a'];
@@ -5433,7 +5457,7 @@ class SurveyAdminAjax {
$return['output'] .= '<p>'.$lang['spremenljivka_delete_in_if'].'</p>';
- $return['output'] .= '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span>';
+ $return['output'] .= '<div class="button_holder"><button class="medium blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button></div>';
echo json_encode($return);
@@ -5454,11 +5478,10 @@ class SurveyAdminAjax {
$return['output'] .= '<h2>'.$lang['srv_warning'].'</h2>';
$return['output'] .= '<p>'.$lang['spremenljivka_delete_data'].'</p>';
- $return['output'] .= '<p>'.$lang['srv_brisispremenljivkoconfirm_data'].'</p><br />';
+ $return['output'] .= '<p class="top16">'.$lang['srv_brisispremenljivkoconfirm_data'].'</p>';
- $return['output'] .= '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="brisi_spremenljivko(\''.$spremenljivka.'\', \'\', \'1\'); return false;"><span>'.$lang['srv_brisispremenljivko'].'</span></a></span>';
- $return['output'] .= '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span>';
- //$return['output'] .= '<p><a href="#" onclick="brisi_spremenljivko(\''.$spremenljivka.'\', \'\', \'1\'); return false;">'.$lang['srv_brisispremenljivko'].'</a> <a href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</a></p>';
+ $return['output'] .= '<div class="button_holder"><button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ $return['output'] .= '<button class="medium blue" onclick="brisi_spremenljivko(\''.$spremenljivka.'\', \'\', \'1\'); return false;">'.$lang['srv_brisispremenljivko'].'</button></div>';
echo json_encode($return);
@@ -5480,13 +5503,13 @@ class SurveyAdminAjax {
// ce je za spremenljivko PB, ga prestavimo na prejsnjo spremenljivko
$rowg = Cache::srv_branching($spremenljivka, 0);
- if ($rowg['pagebreak'] == 1) {
+ if (isset($rowg['pagebreak']) && $rowg['pagebreak'] == 1) {
$s = sisplet_query("UPDATE srv_branching SET pagebreak='1' WHERE element_spr='{$b->find_prev_spr($spremenljivka)}' AND ank_id='$this->anketa'");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
}
$this->SurveyAdmin->brisi_spremenljivko($spremenljivka);
- if ($_COOKIE['srv_clipboard_' . $this->anketa] == $spremenljivka)
+ if (isset($_COOKIE['srv_clipboard_' . $this->anketa]) && $_COOKIE['srv_clipboard_' . $this->anketa] == $spremenljivka)
$this->SurveyAdmin->clipboard_display(-1);
$this->SurveyAdmin->prestevilci(0);
@@ -5496,13 +5519,50 @@ class SurveyAdminAjax {
$b->branching_struktura();
$return['error'] = 0;
- $return['output'] = ob_get_clean().$echo;
+ $return['output'] = ob_get_clean();
echo json_encode($return);
}
+
+ function ajax_nice_url_check () {
+ global $site_path, $lang;
+
+ $nice_url = $_POST['nice_url'];
+ //$nice_url = preg_replace("#[^A-Za-z0-9-]#", "", $nice_url);
+
+ if (preg_match("/[^A-Za-z0-9\-]/", $nice_url)) {
+ echo '<br><p class="red"><span class="faicon warning red"></span>&nbsp;&nbsp;'.$lang['srv_nice_url_invalid'].'</p>';return;
+ }
+
+
+ $f = @fopen($site_path.'.htaccess', 'rb');
+ if ($f !== false) {
+ while (!feof($f)) {
+ $r = fgets($f);
+ if (strpos($r, "^".$nice_url.'\b') !== false) { // preverimo, da ni tak redirect ze dodan
+ echo '<br><p class="red"><span class="faicon warning red"></span>&nbsp;&nbsp;'.$lang['srv_nice_url_taken'].'</p>';return;
+ }
+ }
+ fclose($f);
+ }
+
+ // Ne pustimo manj kot 3 znake
+ if (strlen($nice_url) < 3) echo '<br><p class="red"><span class="faicon warning red"></span>&nbsp;&nbsp;'.$lang['srv_nice_url_short'].'</p>';return;
+
+ // Ne pustimo vec kot 20 znakov
+ if (strlen($nice_url) > 20) echo '<br><p class="red"><span class="faicon warning red"></span>&nbsp;&nbsp;'.$lang['srv_nice_url_long'].'</p>';return;
+
+ sisplet_query("BEGIN"); // damo v transakcijo, da se ne more kdo med tedva querija ustulit
+
+ $sql = sisplet_query("SELECT id FROM srv_nice_links WHERE link = '$nice_url'");
+ if (mysqli_num_rows($sql) > 0) echo '<br><p class="red"><span class="faicon warning red"></span>&nbsp;&nbsp;'.$lang['srv_nice_url_taken'].'</p>';return;
+
+ echo "";return;
+ }
function ajax_nice_url () {
global $site_path;
+ global $lang;
Common::updateEditStamp();
@@ -5537,9 +5597,9 @@ class SurveyAdminAjax {
if (mysqli_num_rows($sql) > 0) $add = false;
if (SurveyInfo::getInstance()->checkSurveyModule('uporabnost'))
- $link = 'main/survey/uporabnost.php?anketa=' . $anketa ;
+ $link = 'main/survey/uporabnost.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash() ;
else
- $link = 'main/survey/index.php?anketa=' . $anketa ;
+ $link = 'main/survey/index.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash();
// Dodamo nice url
@@ -5548,7 +5608,7 @@ class SurveyAdminAjax {
// Dodamo nice url za anketo
$f = @fopen($site_path.'.htaccess', 'a');
if ($f !== false) {
- fwrite($f, "\nRewriteRule ^".$nice_url.'\b(.*) '.$link."&foo=\$1&%{QUERY_STRING}");
+ fwrite($f, "\nRewriteRule ^".$nice_url.'\b(?!-)(.*) '.$link."&foo=\$1&%{QUERY_STRING}");
// Dodamo nice url v bazo
$s = sisplet_query("INSERT INTO srv_nice_links (id,ank_id,link) VALUES ('','$this->anketa','$nice_url')");
@@ -5570,10 +5630,11 @@ class SurveyAdminAjax {
while($rowS = mysqli_fetch_array($sqlS)){
$nice_url_skupina = $nice_url.'_'.$rowS['vrstni_red'];
- $link_skupina = $link.'&skupina='.$rowS['id'];
+ $skupina_string = strtolower($lang['srv_skupina']);
+ $link_skupina = $link.'&'.$skupina_string.'='.$rowS['id'];
// Skupini dodamo nice url zapis v htaccess
- fwrite($f, "\nRewriteRule ^".$nice_url_skupina.'\b(.*) '.$link_skupina."&foo=\$1&%{QUERY_STRING}");
+ fwrite($f, "\nRewriteRule ^".$nice_url_skupina.'\b(?!-)(.*) '.$link_skupina."&foo=\$1&%{QUERY_STRING}");
// Skupini zapisemo nice url se v bazo
$sqlSI = sisplet_query("INSERT INTO srv_nice_links_skupine
@@ -5596,25 +5657,33 @@ class SurveyAdminAjax {
function ajax_nice_url_remove () {
global $site_path;
+ global $lang;
Common::updateEditStamp();
$anketa = $_GET['anketa'];
+
+ SurveyInfo::getInstance()->SurveyInit($this->anketa);
+ $anketa_hash = SurveyInfo::getInstance()->getSurveyHash();
+
$nice_url_id = $_GET['nice_url'];
-
- $sql = sisplet_query("SELECT id, link FROM srv_nice_links WHERE id = '$nice_url_id'");
+
+ $sql = sisplet_query("SELECT id, link FROM srv_nice_links WHERE id = '$nice_url_id'");
$row = mysqli_fetch_array($sql);
$nice_url = $row['link'];
+ // Preberemo celoten .htaccess in ga zakesiramo
$f = fopen($site_path.'.htaccess', 'rb');
if ($f !== false) {
$output = array();
while (!feof($f)) {
$r = fgets($f);
- if (strpos($r, "^".$nice_url.'\b(.*) ') !== false && strpos($r, "?anketa=".$anketa."") !== false) {
- // kao pobrisemo vrstico
- } else {
+
+ // Vrstice, ki jih pobrisemo - ne zakesiramo
+ if (strpos($r, "^".$nice_url.'\b') !== false && strpos($r, "?anketa=".$anketa_hash."") !== false) {
+ }
+ else {
$output[] = $r;
}
}
@@ -5625,17 +5694,23 @@ class SurveyAdminAjax {
$f = fopen($site_path.'.htaccess', 'w');
if ($f !== false) {
+
+ // Na novo zapisemo htaccess
foreach ($output AS $line) {
fwrite($f, $line);
}
fclose($f);
+ // Pobrisemo lep url se iz baze
$sql = sisplet_query("DELETE FROM srv_nice_links WHERE id = '$nice_url_id'");
- // Preverimo ce imamo skupine s tem urljem in jih pobrisemo
+
+ // Preverimo ce imamo SKUPINE s tem urljem in jih pobrisemo
$sqlS = sisplet_query("SELECT * FROM srv_nice_links_skupine WHERE ank_id='$anketa' AND nice_link_id='$nice_url_id'");
if(mysqli_num_rows($sqlS) > 0){
+ $skupina_string = strtolower($lang['srv_skupina']);
+
$f = fopen($site_path.'.htaccess', 'rb');
if ($f !== false) {
$outputS = array();
@@ -5648,7 +5723,7 @@ class SurveyAdminAjax {
$sqlS = sisplet_query("SELECT * FROM srv_nice_links_skupine WHERE ank_id='$anketa' AND nice_link_id='$nice_url_id'");
while($rowS = mysqli_fetch_array($sqlS)){
- if (strpos($r, "^".$rowS['link'].'\b(.*) ') !== false && strpos($r, "?anketa=".$anketa."&skupina=".$rowS['vre_id']."") !== false) {
+ if (strpos($r, "^".$rowS['link'].'\b') !== false && strpos($r, "?anketa=".$anketa_hash."&".$skupina_string."=".$rowS['vre_id']."") !== false) {
// pobrisemo vrstico in vnos v bazi
$sqlD = sisplet_query("DELETE FROM srv_nice_links_skupine WHERE ank_id='$anketa' AND nice_link_id='$row[id]' AND vre_id='$rowS[vre_id]'");
$delete = true;
@@ -5675,14 +5750,12 @@ class SurveyAdminAjax {
}
}
-
header('Location: index.php?anketa='.$anketa.'&a=vabila&m=settings');
}
function ajax_alert_custom() {
global $lang;
global $global_user_id;
- global $app_settings;
$anketa = $this->anketa;
$type = $_POST['type'];
@@ -5717,22 +5790,31 @@ class SurveyAdminAjax {
$text = $row['text'];
}
+ echo '<h2><span class="faicon blue text_file empty"></span>'.$lang['srv_alert_custom'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="remove_editor(\'text\'); $(\'#fade\').fadeOut(\'slow\'); $(\'#vrednost_edit\').hide().html(\'\'); return false;">✕</a></div>';
+
echo '<form action="ajax.php?a=alert_custom_save" name="alert_custom" method="post">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
echo '<input type="hidden" name="type" value="'.$type.'">';
echo '<input type="hidden" name="uid" value="'.$uid.'">';
-
- echo '<p><label for="subject">' . $lang['subject'] . ': </label><input type="text" id="subject" name="subject" value="' . $subject . '" size="90"/></p>';
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="subject" name="subject" value="' . $subject . '"/>';
+ echo '</div>';
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
- echo ' <p><label for="text">' . $lang['text'] . ':</label>';
- echo ' <textarea name="text" id="text" rows="3" >' . $text . '</textarea>';
- echo ' </p>';
+ echo '<div class="setting_holder">';
+
+ echo '<label class="bottom4" for="text">' . $lang['message'] . ':</label>';
+ echo '<textarea name="text" id="text">' . $text . '</textarea>';
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="remove_editor(\'text\'); $(\'#fade\').fadeOut(\'slow\'); $(\'#vrednost_edit\').hide().html(\'\'); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="$(\'form[name=alert_custom]\').submit(); return false;">'.$lang['edit1337'].'</button>';
echo '</div>';
-
- echo '<div class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_orange" onclick="$(\'form[name=alert_custom]\').submit(); return false;" href="#"><span>'.$lang['save'].'</span></a></div>';
- echo '<div class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" onclick="remove_editor(\'text\'); $(\'#fade\').fadeOut(\'slow\'); $(\'#vrednost_edit\').hide().html(\'\'); return false;" href="#"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></div>';
echo '</form>';
@@ -5838,10 +5920,13 @@ class SurveyAdminAjax {
}
function ajax_get_variable_labels () {
+ $spr = isset($_POST['spr']) ? array_unique( $_POST['spr'] ) : array();
+ echo json_encode(self::get_variable_labels($spr));
+ }
+
+ private function get_variable_labels($spr = array()){
global $lang;
-
- $spr = array_unique( $_POST['spr'] );
-
+
$response = array();
foreach ($spr AS $spr_id) {
@@ -5849,55 +5934,98 @@ class SurveyAdminAjax {
$s = sisplet_query("SELECT tip FROM srv_spremenljivka WHERE id = '$spr_id'");
$r = mysqli_fetch_array($s);
- if ( in_array($r['tip'], array(1, 3)) ) {
-
- $output = array();
+ //radio and select, ranking
+ if ( in_array($r['tip'], array(1, 3/* , 17 */)) ) {
+ $output = $this->add_missing_values(array());
$output['spr'] = $spr_id;
$output['tip'] = $r['tip'];
- $output['values'] = array();
-
- $sql = sisplet_query("SELECT naslov, variable FROM srv_vrednost WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
- while ($row = mysqli_fetch_array($sql)) {
- $output['values'][$row['variable']] = strip_tags( $row['naslov'] );
+ $sql = sisplet_query("SELECT naslov, variable, vrstni_red FROM srv_vrednost WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
+ while ($row = mysqli_fetch_array($sql)) {
+ /* if ( $r['tip'] == 17 )
+ $output['values'][$row['vrstni_red']] = strip_tags( $row['naslov'] );
+ else */
+ $output['values'][$row['variable']] = strip_tags( $row['naslov'] );
}
- $output['values']['-1'] = $lang['srv_bottom_data_legend_note_li1a'];
- $output['values']['-2'] = $lang['srv_bottom_data_legend_note_li2a'];
- $output['values']['-3'] = $lang['srv_bottom_data_legend_note_li3a'];
- $output['values']['-4'] = $lang['srv_bottom_data_legend_note_li4a'];
- $output['values']['-5'] = $lang['srv_bottom_data_legend_note_li5a'];
-
$response[] = $output;
-
- } elseif ( in_array($r['tip'], array(6, 16)) ) {
-
- $output = array();
+ }
+ //radio grid
+ elseif ( in_array($r['tip'], array(6)) ) {
+ $output = $this->add_missing_values(array());
$output['spr'] = $spr_id;
$output['tip'] = $r['tip'];
- $output['values'] = array();
-
- $sql = sisplet_query("SELECT naslov, variable FROM srv_grid WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
+ $sql = sisplet_query("SELECT naslov, variable, other FROM srv_grid WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
- $output['values'][$row['variable']] = strip_tags( $row['naslov'] );
+ if($row['other'] === 1 || $row['other'] === 0)
+ $output['values'][$row['variable']] = strip_tags( $row['naslov'] );
+ else
+ $output['values'][$row['other']] = strip_tags( $row['naslov'] );
}
- $output['values']['-1'] = $lang['srv_bottom_data_legend_note_li1a'];
- $output['values']['-2'] = $lang['srv_bottom_data_legend_note_li2a'];
- $output['values']['-3'] = $lang['srv_bottom_data_legend_note_li3a'];
- $output['values']['-4'] = $lang['srv_bottom_data_legend_note_li4a'];
- $output['values']['-5'] = $lang['srv_bottom_data_legend_note_li5a'];
-
$response[] = $output;
+ }
+ //check and checkk grid
+ elseif ( in_array($r['tip'], array(2, 16)) ) {
+ $output = $this->add_missing_values(array());
+
+ $output['spr'] = $spr_id;
+ $output['tip'] = $r['tip'];
+
+ $output['values']['0'] = $lang['srv_checked_value_0'];
+ $output['values']['1'] = $lang['srv_checked_value_1'];
+
+ //misingi za labele
+ if($r['tip'] == 2){
+ $sql = sisplet_query("SELECT naslov, variable, vrstni_red, other FROM srv_vrednost WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
+ while ($row = mysqli_fetch_array($sql)) {
+ if($row['other'] != 1 && $row['other'] != 0)
+ $output['values'][$row['variable']] = strip_tags( $row['naslov'] );
+ }
+ }
+ if($r['tip'] == 16){
+ $sql = sisplet_query("SELECT naslov, variable, other FROM srv_grid WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
+ while ($row = mysqli_fetch_array($sql)) {
+ if($row['other'] != 1 && $row['other'] != 0){
+ $output['values'][$row['other']] = strip_tags( $row['naslov'] );
+ }
+ }
+ }
+
+ $response[] = $output;
}
+ /* else{
+ $output = array();
+
+ $output['spr'] = $spr_id;
+ $output['tip'] = $r['tip'];
+
+ $output['values'] = array();
+
+ $response[] = $this->add_missing_values($output);
+ } */
}
-
- echo json_encode($response);
-
+
+ return $response;
+ }
+
+ private function add_missing_values($output){
+ global $lang;
+
+ $output['values']['-1'] = $lang['srv_bottom_data_legend_note_li1a'];
+ $output['values']['-2'] = $lang['srv_bottom_data_legend_note_li2a'];
+ $output['values']['-3'] = $lang['srv_bottom_data_legend_note_li3a'];
+ $output['values']['-4'] = $lang['srv_bottom_data_legend_note_li4a'];
+ $output['values']['-5'] = $lang['srv_bottom_data_legend_note_li5a'];
+ $output['values']['-97'] = $lang['srv_other_97'];
+ $output['values']['-98'] = $lang['srv_other_98'];
+ $output['values']['-99'] = $lang['srv_other_99'];
+
+ return $output;
}
function ajax_remove_logo () {
@@ -5942,7 +6070,7 @@ class SurveyAdminAjax {
SurveyInfo::getInstance()->resetSurveyData();
- $this->SurveyAdmin->request_help_content();
+ $this->SurveyAdmin->tooltip_request_help();
}
@@ -5973,71 +6101,107 @@ class SurveyAdminAjax {
echo '<form name="testiranje_preview_settings" action="#" method="get">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
-
- // Nastavitve komentarjev - preverimo ce so na voljo v paketu
+
+ echo '<div id="testiranje_preview_settings">';
+ echo '<div class="testiranje_preview_settings_left">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_preview_defaults'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="checkbox" value="1" '.($preview_disableif==1?' checked':'').' name="disableif" id="disableif"/>';
+ echo ' <label for="disableif">'.$lang['srv_disableif'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="checkbox" value="1" '.($preview_displayifs==1?' checked':'').' name="displayifs" id="displayifs"/>';
+ echo ' <label for="displayifs">'.$lang['srv_displayifs'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="checkbox" value="1" '.($preview_displayvariables==1?' checked':'').' name="displayvariables" id="displayvariables"/>';
+ echo ' <label for="displayvariables">'.$lang['srv_displayvariables'].'</label>';
+ echo '</div>';
+
+ // Nastavitve komentarjev - preverimo ce so na voljo v paketu
if($userAccess->checkUserAccess($what='question_type_location')){
- echo '<div style="float: right; width: 260px">';
-
- echo '<p style="margin-top:0">'.$lang['srv_testiranje_komentarji'].': ';
- echo '<input type="radio" name="question_resp_comment" value="0" id="question_resp_comment_0" ' . ($question_resp_comment == 0 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_0">' . $lang['no'] . '</label> ';
+ echo '<div class="setting_item">';
+ echo ' <input type="checkbox" value="1" '.($preview_hidecomment==1?' checked':'').' name="hidecomment" id="hidecomment"/>';
+ echo ' <label for="hidecomment">'.$lang['srv_preview_comments2'].'</label>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+
+ echo '</div>'; #testiranje_preview_settings_left
+ echo '<div class="testiranje_preview_settings_right">';
+
+ // Nastavitve komentarjev - preverimo ce so na voljo v paketu
+ if($userAccess->checkUserAccess($what='question_type_location')){
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_testiranje_komentarji'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment" value="0" id="question_resp_comment_0" ' . ($question_resp_comment == 0 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_0">' . $lang['no'] . '</label> ';
echo '<input type="radio" name="question_resp_comment" value="1" id="question_resp_comment_1" ' . ($question_resp_comment == 1 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_1">' . $lang['yes'] . '</label> ';
- echo '</p>';
- echo '<p class="question_resp_comment">'.$lang['srv_comments_show_open'].': <br />';
- echo '<input type="radio" name="question_resp_comment_show_open" value="" id="question_resp_comment_show_open_0" ' . ($question_resp_comment_show_open == 0 ? ' checked' : '') . '/><label for="question_resp_comment_show_open_0">' . $lang['forma_settings_open'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder question_resp_comment">';
+ echo '<span class="setting_title">'.$lang['srv_comments_show_open'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_show_open" value="" id="question_resp_comment_show_open_0" ' . ($question_resp_comment_show_open == 0 ? ' checked' : '') . '/><label for="question_resp_comment_show_open_0">' . $lang['forma_settings_open'] . '</label> ';
echo '<input type="radio" name="question_resp_comment_show_open" value="1" id="question_resp_comment_show_open_1" ' . ($question_resp_comment_show_open == 1 ? ' checked' : '') . '/><label for="question_resp_comment_show_open_1">' . $lang['forma_settings_closed'] . '</label> ';
- echo '</p><p class="question_resp_comment">';
- echo '' . $lang['srv_q_inicialke'] . ': <br />';
- echo '<input type="radio" name="question_resp_comment_inicialke" value="0" id="question_resp_comment_inicialke_0" ' . ($question_resp_comment_inicialke == 0 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_inicialke_0">' . $lang['no'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder question_resp_comment">';
+ echo '<span class="setting_title">'.$lang['srv_q_inicialke'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke" value="0" id="question_resp_comment_inicialke_0" ' . ($question_resp_comment_inicialke == 0 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_inicialke_0">' . $lang['no'] . '</label> ';
echo '<input type="radio" name="question_resp_comment_inicialke" value="1" id="question_resp_comment_inicialke_1" ' . ($question_resp_comment_inicialke == 1 ? ' checked' : '') . ' onclick="testiranje_settings();"><label for="question_resp_comment_inicialke_1">' . $lang['yes'] . '</label> ';
- echo '</p>';
- echo '<p class="question_resp_comment question_resp_comment_inicialke">' . $lang['srv_q_inicialke_alert'] . ': <br />';
- echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="0" id="question_resp_comment_inicialke_alert_0" ' . ($question_resp_comment_inicialke_alert == 0 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_0">' . $lang['srv_reminder_off2'] . '</label><br> ';
- echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="1" id="question_resp_comment_inicialke_alert_1" ' . ($question_resp_comment_inicialke_alert == 1 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_1">' . $lang['srv_reminder_soft2'] . '</label><br> ';
- echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="2" id="question_resp_comment_inicialke_alert_2" ' . ($question_resp_comment_inicialke_alert == 2 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_2">' . $lang['srv_reminder_hard2'] . '</label> ';
- echo '</p>';
- echo '<p><a href="index.php?anketa='.$this->anketa.'&a=urejanje&advanced_expanded=1">('.$lang['srv_details_settings'].')</a></p>';
-
- echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder question_resp_comment question_resp_comment_inicialke">';
+ echo '<span class="setting_title">'.$lang['srv_q_inicialke_alert'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="0" id="question_resp_comment_inicialke_alert_0" ' . ($question_resp_comment_inicialke_alert == 0 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_0">' . $lang['srv_reminder_off2'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="1" id="question_resp_comment_inicialke_alert_1" ' . ($question_resp_comment_inicialke_alert == 1 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_1">' . $lang['srv_reminder_soft2'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="2" id="question_resp_comment_inicialke_alert_2" ' . ($question_resp_comment_inicialke_alert == 2 ? ' checked' : '') . '/><label for="question_resp_comment_inicialke_alert_2">' . $lang['srv_reminder_hard2'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<p class="top16"><a href="index.php?anketa='.$this->anketa.'&a=urejanje&advanced_expanded=1">'.$lang['srv_details_settings'].'</a></p>';
?><script>
testiranje_settings();
</script><?
}
-
- echo '<h3>'.$lang['srv_preview_defaults'].'</h3>';
-
- echo '<p><label for="disableif"><input type="checkbox" value="1" '.($preview_disableif==1?' checked':'').' name="disableif" id="disableif">';
- echo ' '.$lang['srv_disableif'].'</label></p>';
-
- echo '<p><label for="disablealert"><input type="checkbox" value="1" '.($preview_disablealert==1?' checked':'').' name="disablealert" id="disablealert">';
- echo ' '.$lang['srv_disablealert'].'</label></p>';
-
- echo '<p><label for="displayifs"><input type="checkbox" value="1" '.($preview_displayifs==1?' checked':'').' name="displayifs" id="displayifs">';
- echo ' '.$lang['srv_displayifs'].'</label></p>';
-
- echo '<p><label for="displayvariables"><input type="checkbox" value="1" '.($preview_displayvariables==1?' checked':'').' name="displayvariables" id="displayvariables">';
- echo ' '.$lang['srv_displayvariables'].'</label></p>';
-
- // Nastavitve komentarjev - preverimo ce so na voljo v paketu
- if($userAccess->checkUserAccess($what='question_type_location')){
- echo '<p><label for="hidecomment"><input type="checkbox" value="1" '.($preview_hidecomment==1?' checked':'').' name="hidecomment" id="hidecomment">';
- echo ' '.$lang['srv_preview_comments2'].'</label></p>';
- }
-
- echo '<div style="clear:both;"></div>';
- echo '<div class="buttonwrapper floatRight">
- <a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="testiranje_preview_settings_save(); return false;" href="#">
- <span>'.$lang['edit1337'].'</span>
- </a>
- </div>
-
- <div class="buttonwrapper spaceRight floatRight">
- <a class="ovalbutton ovalbutton_gray btn_savesettings" onclick="$(\'#vrednost_edit\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;" href="#" style="margin-left:10px">
- <span>'.$lang['srv_cancel'].'</span>
- </a>
- </div>';
-
+ echo '</div>'; #testiranje_preview_settings_right
+ echo '</div>'; #testiranje_preview_settings
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#vrednost_edit\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="testiranje_preview_settings_save(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
echo '</form>';
}
@@ -6152,10 +6316,15 @@ class SurveyAdminAjax {
$sv->displaySettings();
}
elseif ($what == 'advanced_paradata' && $value == '1'){
- // kviz
+ // napredni parapodatki
$sap = new SurveyAdvancedParadata($this->anketa);
$sap->displaySettings();
}
+ elseif ($what == 'advanced_timestamps' && $value == '1'){
+ // napredni casi po straneh
+ $sat = new SurveyAdvancedTimestamps($this->anketa);
+ $sat->displaySettings();
+ }
elseif ($what == 'slideshow' && $value == '1'){
$ss = new SurveySlideshow($this->anketa);
$ss->ShowSlideshowSetings();
@@ -6214,6 +6383,12 @@ class SurveyAdminAjax {
$sp->activatePanel();
$sp->displaySettings();
}
+ elseif ($what == 'email_access' && $value == '1'){
+ // dostop z emailom
+ $sea = new SurveyEmailAccess($this->anketa);
+ $sea->activateEmailAccess();
+ $sea->displaySettings();
+ }
}
// Zgenerira key za api
@@ -6236,28 +6411,19 @@ class SurveyAdminAjax {
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
- echo '<div class="title">'.$lang['srv_api_auth_title'].'</div>';
-
- echo '<br />';
-
- echo 'ID: ';
- echo '<br /><span class="bold">'.$identifier.'</span>';
-
- echo '<br /><br />';
+ echo '<h2><span class="faicon fa-key"></span>'.$lang['srv_api_auth_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="close_API_window(); return false;">✕</a></div>';
- echo 'PRIVATNI KLJUČ: ';
- echo '<br /><span class="bold">'.$private_key.'</span>';
+ echo '<p class="semi-bold bottom8">ID:</p>';
+ echo '<p class="bottom16">'.$identifier.'<span class="faicon copy empty pointer blue link-left" onClick="CopyToClipboard(\''.$identifier.'\'); actionNotePopup(\'text_copied\', \'success\');"></span></p>';
- echo '<br /><br />';
+ echo '<p class="semi-bold bottom8 caps">'.$lang['srv_api_auth_private'].':</p>';
+ echo '<p class="bottom32">'.$private_key.'<span class="faicon copy empty pointer blue link-left" onClick="CopyToClipboard(\''.$private_key.'\'); actionNotePopup(\'text_copied\', \'success\');"></p>';
// Gumb za zapiranje
- echo '<div class="floatRight spaceRight">';
- echo '<div class="buttonwrapper" title="'.$lang['srv_zapri'].'">';
- echo '<a class="ovalbutton ovalbutton" onclick="close_API_window(); return false;" href="#">';
- echo '<span>'.$lang['srv_zapri'].'</span>';
- echo '</a>';
- echo '</div>';
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="close_API_window(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
}
// Prikaze uvoz iz besedila znotraj ankete (popup)
@@ -6265,39 +6431,50 @@ class SurveyAdminAjax {
global $lang, $site_url, $global_user_id;
// uvoz iz besedila
- echo '<div class="fieldset anketa_from_text">';
+ echo '<div class="fieldset anketa_from_text from_text_popup">';
+
echo '<div class="popup_close"><a href="#" onClick="popupImportAnketaFromText_close();">✕</a></div>';
// Naslov
echo '<h2>' . $lang['srv_newSurvey_survey_from_text_title'] . ' '.Help::display('srv_create_survey_from_text').'</h2>';
- echo '<span>' . $lang['srv_newSurvey_survey_from_text_text'] . '</span>';
+ echo '<div class="instructions">';
+ echo ' <p>'.$lang['srv_newSurvey_survey_from_text_text1'].'</p>';
+ echo ' <p>'.$lang['srv_newSurvey_survey_from_text_text2'].'</p>';
+ echo ' <p>'.$lang['srv_newSurvey_survey_from_text_text3'].'</p>';
+ echo '</div>';
+
+
+ echo '<div class="import_holder">';
+
// Input okno za text
echo '<div id="input_field_holder"><div id="input_field">';
- //echo '<textarea placeholder="'.$lang['srv_newSurvey_survey_from_text_example'].'" onKeyUp="$(\'#preview_field\').html($(\'textarea\').val());"></textarea>';
- echo '<textarea id="anketa_from_text_textarea" placeholder="'.$lang['srv_newSurvey_survey_from_text_example'].'" onKeyUp="anketaFromText_preview();"></textarea>';
+ echo ' <textarea id="anketa_from_text_textarea" placeholder="'.$lang['srv_newSurvey_survey_from_text_example'].'" onKeyUp="anketaFromText_preview();"></textarea>';
echo '</div></div>';
// Preview okno
echo '<div id="preview_field_holder"><div id="preview_field">';
- echo '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
+ echo ' <span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
echo '</div></div>';
+
+ echo '</div>';
+
echo '</div>';
// Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
+ echo '<div class="button_holder">';
- echo ' <span class="floatRight spaceRight buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="importAnketaFromText();" title="'.$lang['srv_newSurvey_survey_from_text'].'">';
- echo ' <span>'.$lang['next1'].'</span>';
- echo ' </a></span>';
-
- echo ' <span class="floatRight spaceRight buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="popupImportAnketaFromText_close();" title="'.$lang['srv_cancel'].'">';
- echo ' <span>'.$lang['srv_cancel'].'</span>';
- echo ' </a></span>';
-
+ echo ' <button class="medium white-blue" onclick="popupImportAnketaFromText_close();" title="'.$lang['srv_cancel'].'">';
+ echo $lang['srv_cancel'];
+ echo ' </button>';
+
+ echo ' <button class="medium blue" href="#" onclick="importAnketaFromText();" title="'.$lang['srv_newSurvey_survey_from_text'].'">';
+ echo $lang['next1'];
+ echo ' </button>';
+
echo '</div>';
}
@@ -6356,6 +6533,150 @@ class SurveyAdminAjax {
}
+ // Dodeljevanje uredniskega dostopa do ankete
+ private function ajax_add_survey_dostop_popup(){
+ global $lang, $pass_salt, $global_user_id, $site_path, $site_url, $admin_type;
+
+ $_POST['addusers'] = mysql_real_unescape_string($_POST['addusers']);
+ $users = explode(NEW_LINE, $_POST['addusers']);
+ $sqlu = sisplet_query("SELECT email, name FROM users WHERE id = '".$global_user_id."'");
+ $rowu = mysqli_fetch_array($sqlu);
+
+ $MailReply = $rowu['email'];
+ $nameAuthor = $rowu['name'];
+
+
+ // Vsebina popupa
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_dostop_addusers'].'</h2>';
+
+
+ echo '<div class="popup_content">';
+
+ // Loop cez vse vnesesne userje, ki jim dajemo dostop
+ foreach ($users AS $user) {
+
+ $user = explode(',', $user);
+ $email = trim($user[0]);
+ $name = (isset($user[1]) && trim($user[1])!='') ? trim($user[1]) : $email;
+ $surnname = (isset($user[2]) && trim($user[2])!='') ? trim($user[2]) : $email;
+
+ if($email != ''){
+
+ echo '<div class="row">';
+
+ // Ce gre za veljaven email dodamo userja
+ if (validEmail($email)) {
+
+ $id = 0;
+ $sqlu = sisplet_query("SELECT id FROM users WHERE email='$email'");
+
+ $create_new_account = false;
+
+ // Ce user, ki ga dodajamo, se ne obstaja, ga ustvarimo - PO NOVEM SAMO CE SMO ADMIN
+ if (mysqli_num_rows($sqlu) == 0 && $admin_type == 0) {
+ $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" .base64_encode((hash('SHA256', '' .$pass_salt))) ."', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
+ $id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ $create_new_account = true;
+ }
+ // Drugace pridobimo podatke o userju iz baze
+ else {
+ $rowu = mysqli_fetch_array($sqlu);
+ $id = $rowu['id'];
+ }
+
+ // Ce je bil ustvarjen oz ga imamo ze v bazi, mu damo dostop in posljemo mail
+ if($id > 0){
+
+ $sqlDostopExist = sisplet_query("SELECT * FROM srv_dostop WHERE ank_id='".$this->anketa."' AND uid='".$id."' AND aktiven='1'");
+ if(mysqli_num_rows($sqlDostopExist) == 0){
+
+ $s = sisplet_query("INSERT INTO srv_dostop (ank_id, uid, aktiven) VALUES ('$this->anketa', '$id', '1')");
+
+ // V kolikor gre za hierarhijo, potem še enkrat preverimo v bazi in dodelimo dostop tudi do hierarhije status 2 - naknadno dodan administrator
+ if(SurveyInfo::checkSurveyModule('hierarhija', $this->anketa))
+ sisplet_query("INSERT INTO srv_hierarhija_users (user_id, anketa_id, type) VALUES ('".$id."', '".$this->anketa."', 2)");
+
+ $naslov = SurveyInfo::getInstance()->getSurveyColumn('naslov');
+
+ $subject = $lang['srv_dostopmail_1'].' '.$naslov.'.';
+
+ $content = $lang['srv_dostopmail_2'].' <span style="color:red;">'.$nameAuthor.'</span> (<a style="color:#1e88e5 !important; text-decoration:none !important;" href="mailto:'.$MailReply.'">'.$MailReply.'</a>) '.$lang['srv_dostopmail_3'].' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'"><span style="font-weight:bold;">'.$naslov.'.</span></a><br /><br />
+ '.$lang['srv_dostopmail_4'].' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'">'.$site_url.'</a> '.$lang['srv_dostopmail_5'].' (<a style="color:#1e88e5 !important; text-decoration:none !important;" href="mailto:'.$email.'">'.$email.'</a>).';
+
+ // Ce email se ni registriran, dodamo dodatno obvestilo
+ if(mysqli_num_rows($sqlu) == 0 && $admin_type == 0){
+ $content .= '<br /><br />'.$lang['srv_dostopmail_7'];
+ $content .= ' <a style="color:#1e88e5 !important; text-decoration:none !important;" href="'.$site_url.'/admin/survey/index.php?a=nastavitve&m=global_user_myProfile">'.$lang['edit_data'].'</a> ';
+ $content .= $lang['srv_dostopmail_72'];
+ }
+
+ // Sporočilo urednika (opcijsko)
+ if(isset($_POST['addusers_note']) && $_POST['addusers_note'] != ''){
+
+ $_POST['addusers_note'] = mysql_real_unescape_string($_POST['addusers_note']);
+
+ $content .= '<br /><br /><span style="font-weight:bold;">'.$lang['srv_dostopmail_note'].'</span><br /><br />';
+ $content .= '<span style="color:red;">'.$_POST['addusers_note'].'</span>';
+ }
+
+ // Podpis
+ $signature = Common::getEmailSignature();
+ $content .= $signature;
+
+ try{
+ $MA = new MailAdapter($this->anketa, $type='account');
+ $MA->addRecipients($email);
+ $resultX = $MA->sendMail(stripslashes($content), $subject);
+
+ if($resultX){
+ echo '<span><span class="email bold">'.$email.' - </span>'.($create_new_account ? $lang['srv_dostop_addusers_success_create'] : $lang['srv_dostop_addusers_success']).'</span>';
+ }
+ else{
+ echo '<span class="red"><span class="email bold">'.$email.' - </span>'.$lang['srv_dostop_addusers_error3'].'</span>';
+ }
+ }
+ catch (Exception $e){
+ echo '<span class="red"><span class="email bold">'.$email.' - </span>'.$lang['srv_dostop_addusers_error3'].'</span>';
+ }
+ }
+ // Uporabnik ze ima dostop
+ else{
+ echo '<span><span class="email bold">'.$email.' - </span>'.$lang['srv_dostop_addusers_error4'].'</span>';
+ }
+ }
+ // Uporabnika ni v bazi
+ else{
+ echo '<span class="red"><span class="email bold">'.$email.' - </span>'.$lang['srv_dostop_addusers_error2'].'</span>';
+ }
+ }
+ // Mail ni veljaven
+ else{
+ echo '<span class="red"><span class="email bold">'.$email.' - </span>'.$lang['srv_dostop_addusers_error1'].'</span>';
+ }
+
+ echo '</div>';
+ }
+ }
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" title="'.$lang['srv_zapri'].'" onClick="popupClose(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ }
+
+ private function ajax_refresh_dostop_settings(){
+
+ $_GET['a'] = 'dostop';
+
+ $sas = new SurveyAdminSettings();
+ $sas->anketa_nastavitve_global();
+ }
+
+
// Display consulting popup
function ajax_consulting_popup_open () {
global $lang;
@@ -6392,6 +6713,859 @@ class SurveyAdminAjax {
echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_zapri'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="smtpAAIPopupClose(); return false;"><span>'.$lang['srv_zapri'].'</span></a></span>';
echo '</div>';
}
+
+ // Alert na vsa vprašanja - popup
+ private function ajax_alert_all_popup(){
+ global $lang;
+
+ $alert_type = $_POST['alert_type'];
+
+
+ // Vsebina popupa
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_'.$alert_type.'_reminder_all'].'</h2>';
+
+ echo '<div class="popup_content">';
+ echo $lang['srv_reminder_popup_warning'];
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="popupClose();">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?a=reminder_all&what='.$alert_type.'&anketa='.$this->anketa.'\';return false;">'.$lang['edit1339'].'</button>';
+ echo '</div>';
+ }
+
+ // Generičen alert popup
+ private function ajax_genericAlertPopup(){
+ global $lang;
+
+ $name = $_POST['name'];
+ $optional_parameter = $_POST['optional_parameter'];
+
+
+ // Generičen alert popup - vsebina
+ echo '<h2>'.$lang['srv_warning'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+ echo '<div class="popup_content">';
+
+
+ switch ($name) {
+
+ //branching.js
+ case 'srv_unlock_popup2':
+ echo $lang['srv_unlock_popup2'];
+ break;
+ case 'srv_unlock_popup3':
+ echo $lang['srv_unlock_popup3'];
+ echo $optional_parameter;
+ break;
+
+ //_index.js
+ case 'alert_extensions_match':
+ echo $lang['alert_extensions_match'];
+ break;
+
+ //bm.js
+ case 'alert_no_jscss_found':
+ echo $lang['alert_no_jscss_found_1'];
+ echo $optional_parameter;
+ echo $lang['alert_no_jscss_found_2'];
+ break;
+
+ //hierarhija_analize.js, break.js, cReport.js, crosstab.js, means.js, script_analiza.js, ttest.js
+ case 'alert_no_archive_tables':
+ echo $lang['alert_no_archive'];
+ echo ' ';
+ echo $lang['alert_create_tables'];
+ break;
+
+ case 'alert_no_archive_response':
+ echo $lang['alert_no_archive'];
+ echo $optional_parameter;
+ break;
+
+ case 'alert_archive_error_response':
+ echo $lang['alert_archive_error'];
+ echo $optional_parameter;
+ break;
+
+ //MAZA.js, VnaprejMarkers.js
+ case 'srv_resevanje_alert_location_not_found_map':
+ echo $lang['srv_resevanje_alert_location_not_found_map'];
+ break;
+
+ //appendMerge.js, invitations.js, telephone.js
+ case 'srv_invitation_note1':
+ echo $lang['srv_invitation_note1'];
+ break;
+
+ case 'srv_invitation_note2':
+ echo $lang['srv_invitation_note2'];
+ break;
+
+ //charts.js
+ case 'srv_chart_num_limit_warning':
+ echo $lang['srv_chart_num_limit_warning'];
+ break;
+
+ //collectData.js
+ case 'srv_collectdata_failed':
+ echo $lang['srv_collectdata_failed'];
+ break;
+
+ //conditionProfiles.js, script_analiza.js, statistika.js, zankaProfiles.js
+ case 'error':
+ echo $lang['error'];
+ echo "!";
+ break;
+
+ case 'alert_missing_action':
+ echo $lang['alert_missing_action'];
+ echo $optional_parameter;
+ break;
+
+ //dataSettingsProfiles.js, missingProfiles.js, timeProfiles.js, zoom.js
+ case 'alert_parameter_action':
+ echo $optional_parameter;
+ break;
+
+ //invitations.js
+ case 'alert_deprecated':
+ echo $lang['alert_deprecated'];
+ break;
+
+ case 'alert_parameter_dataerror':
+ echo $optional_parameter;
+ break;
+
+ case 'alert_parameter_profilename':
+ echo $optional_parameter;
+ break;
+
+ case 'alert_incorrect_filetype':
+ echo $lang['alert_incorrect_filetype'];
+ break;
+
+ case 'alert_choose_file':
+ echo $lang['alert_choose_file'];
+ break;
+
+ case 'alert_parameter_response':
+ echo $optional_parameter;
+ break;
+
+ case 'alert_timeout':
+ echo $lang['alert_timeout'];
+ break;
+
+ case 'alert_unknown_error':
+ echo $lang['alert_unknown_error'];
+ break;
+
+ //missingvalues.js
+ case 'srv_missing_value_not_empty':
+ echo $lang['srv_missing_value_not_empty'];
+ break;
+
+ //script_analiza.js
+ case 'alert_delete_error':
+ echo $lang['alert_delete_error'];
+ break;
+
+ case 'srv_data_delete_not_selected':
+ echo $lang['srv_data_delete_not_selected'];
+ break;
+
+ case 'alert_copy_error':
+ echo $lang['alert_copy_error'];
+ break;
+
+ case 'alert_too_many_arguments':
+ echo $lang['alert_too_many_arguments'];
+ break;
+
+ case 'alert_missing_arguments':
+ echo $lang['alert_missing_arguments'];
+ break;
+
+
+ //script.js, telephone.js, invitations.js
+ case 'srv_newSurvey_survey_template_error':
+ echo $lang['srv_newSurvey_survey_template_error'];
+ break;
+
+ case 'alert_parameter_datamsg':
+ echo $optional_parameter;
+ break;
+
+ case 'alert_save_error':
+ echo $lang['alert_save_error'];
+ break;
+
+ case 'alert_userGlobalSettingChange':
+ echo $lang['alert_userGlobalSettingChange'];
+ echo ' (';
+ echo $optional_parameter;
+ echo ')';
+ break;
+
+ case 'cms_error_password_incorrect':
+ echo $lang['cms_error_password_incorrect'];
+ break;
+
+ case 'password_err_complex':
+ echo $lang['password_err_complex'];
+ break;
+
+ //slideshow.js
+ case 'alert_checkbox_error':
+ echo $lang['alert_checkbox_error'];
+ break;
+
+ //surveyCondition.js, ds_extras.js
+ case 'alert_error_code':
+ echo $lang['alert_error_code'];
+ echo $optional_parameter;
+ break;
+
+ case 'alert_parameter_dataerrormsg':
+ echo $optional_parameter;
+ break;
+
+ //surveyList.js
+ case 'alert_parameter_msg':
+ echo $optional_parameter;
+ break;
+
+ //telephone.js
+ case 'alert_invalidPID':
+ echo $lang['alert_invalidPID'];
+ break;
+
+ //timeProfiles.js
+ case 'srv_time_profile_error_interval':
+ echo $lang['srv_time_profile_error_interval'];
+ break;
+
+ //vprasanje.js
+ case 'srv_checkbox_min_limit_error_msg':
+ echo $lang['srv_checkbox_min_limit_error_msg'];
+ break;
+
+ //zankaProfiles
+ case 'srv_loop_multiplication_error':
+ echo $lang['srv_loop_multiplication_error'];
+ break;
+
+ //zoom.js
+ case 'alert_choose_variables':
+ echo $lang['alert_choose_variables'];
+ break;
+
+ //calendar.js
+ case 'alert_parameter_text':
+ echo $optional_parameter;
+ break;
+
+ //SurveyAdmin.php
+ case 'srv_filealert':
+ echo $lang['srv_filealert'];
+ break;
+
+ //SurveyAdminSettings.php
+ case 'srv_anketa_noactive2':
+ echo $lang['srv_anketa_noactive2'];
+ break;
+
+ //class.SurveyCondition.php
+ case 'alert_no_action_set':
+ echo $lang['alert_no_action_set'];
+ break;
+
+
+ }
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="popupClose(); return false;">OK</button>';
+ echo '</div>';
+ }
+
+ // Generičen popup spodaj levo
+ private function ajax_actionNotePopup(){
+ global $lang;
+
+ $name = $_POST['name'];
+ $type = $_POST['type'];
+
+ if($type == 'error'){
+ $icon = 'close';
+ }
+ elseif($type == 'success'){
+ $icon = 'success';
+ }
+
+ echo '<div class="action_note_box '.$type.'">';
+
+ echo ' <span class="faicon '.$type.'"></span>';
+ echo ' <span class="text">'.$lang['action_note_'.$name].'</span>';
+ echo ' <span class="close" onClick="actionNotePopupClose();">✕</span>';
+
+ echo '</div>';
+ }
+
+ function ajax_publish_popup_open() {
+ global $lang, $site_url;
+
+ $name = $_POST['name'];
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ switch ($name) {
+
+ case 'html':
+
+ $code = '<a href="'.SurveyInfo::getSurveyLink().'">'.$lang['srv_complete_survey'].'</a>';
+
+ echo '<h2><span class="fa-brands html5"></span>'.$lang['srv_anketa_href'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ echo '<textarea onclick="this.select();" readonly>';
+ echo $code;
+ echo '</textarea>';
+
+ echo '</div>';
+ break;
+
+ case 'htmlcount':
+
+ $code = '<a href="'.SurveyInfo::getSurveyLink().'">'.$lang['srv_complete_survey'].'</a><img src="'.$site_url.'main/survey/view_count.php?a='.$this->anketa.'" style="display:none"/>';
+
+ echo '<h2><span class="fa-brands html5"></span>'.$lang['srv_anketa_href_count'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ echo '<textarea onclick="this.select();" readonly>';
+ echo $code;
+ echo '</textarea>';
+
+ echo '</div>';
+ break;
+
+ case 'QR':
+ $img = 'classes/phpqrcode/imgs/code'.$this->anketa.'.png';
+ QRcode::png(SurveyInfo::getSurveyLink(), $img, 'L', 4, 2);
+
+ echo '<h2><span class="faicon fa-qrcode"></span>'.$lang['srv_anketa_href_friends'].'</h2>';
+
+ echo '<div class="popup_content publish qr">';
+ echo '<img src="'.$site_url.'admin/survey/'.$img.'">';
+ echo '</div>';
+
+ break;
+
+ case 'jazvem':
+ $img = 'img_new/jazvem.png';
+
+ echo '<h2 class="jazvem_popup_title"><span><img src="'.$site_url.'admin/survey/'.$img.'"></span>'.$lang['srv_anketa_href_jazvem'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ echo '<h4>'.$lang['srv_anketa_href_jazvem_text1'].'</h4>';
+ echo '<p>'.$lang['srv_anketa_href_jazvem_text2'].'</p>';
+ echo '</div>';
+
+ break;
+
+ case 'iframejs':
+
+ $code = SurveyAdmin::getEmbed();
+
+ echo '<h2><span class="faicon fa-window-maximize empty"></span>'.$lang['srv_anketa_href_ijs'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ //echo '<p class="bottom16">'.$lang['srv_anketa_href_ijs_text2'].'</p>';
+ echo '<textarea class="iframe" onclick="this.select();" readonly>';
+ echo $code;
+ echo '</textarea>';
+
+ echo '</div>';
+ break;
+
+ case 'iframenojs':
+
+ $code = SurveyAdmin::getEmbed(false);
+
+ echo '<h2><span class="faicon fa-window-maximize empty"></span>'.$lang['srv_anketa_href_inojs'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ //echo '<p class="bottom16">'.$lang['srv_anketa_href_inojs_text2'].'</p>';
+ echo '<textarea onclick="this.select();" readonly>';
+ echo $code;
+ echo '</textarea>';
+
+ echo '</div>';
+ break;
+
+ case 'add_url':
+
+ $code = SurveyAdmin::getEmbed(false);
+
+ echo '<h2>'.$lang['srv_nice_url_add'].'</h2>';
+
+ echo '<div class="popup_content publish">';
+ echo ' <div id="nice_url_holder">';
+ echo ' <div class="url">';
+ echo ' <span class="faicon link-chain link-right"></span>'.$site_url;
+ echo ' <input type="text" class="text large" name="nice_url" id="nice_url" value=""/>';
+ echo ' </div>';
+ echo ' </div>';
+ echo '<span id="add_url_error"></span>';
+ echo '</div>';
+ break;
+
+ case 'settings': // še v delu
+ $d = new Dostop();
+
+ echo '<h2><span class="faicon wheel_32 blue"></span>'.$lang['srv_publication_survey_settings'].'</h2>';
+
+ echo '<div class="popup_content publish settings">';
+
+ //privzete nastavitve
+ echo '<input type="hidden" value="' . $this->anketa . '" name="anketa" >';
+
+ $base_url = $site_url.'admin/survey/index.php?anketa='.$this->anketa;
+ # preberomo osnovne nastavitve
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ // Ce imamo dostop do zavihka urejanje
+ if($d->checkDostopSub('edit')){
+
+ # Trajanje
+ $starts = explode('-',$row['starts']);
+ $starts = $starts[2].'.'.$starts[1].'.'.$starts[0];
+ $expire = explode('-',$row['expire']);
+ $expire = $expire[2].'.'.$expire[1].'.'.$expire[0];
+ echo '<p><span>'.$lang['srv_starts'].':</span> <a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_info_duration'].'"><span class="qs_data as_link">'.$starts.'</span></a></p>';
+ if ( $row['expire'] == PERMANENT_DATE ) {
+ #trajna
+ echo '<p><span>'.$lang['srv_trajna_anketa'].':</span> <a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_trajna_anketa'].'"><span class="qs_data as_link">'.($row['expire'] == PERMANENT_DATE ? $lang['yes'] : $lang['no']).'</span></a></p>';
+ } else {
+ echo '<p><span>'.$lang['srv_expire'].':</span> <a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_info_duration'].'"><span class="qs_data as_link">'.$expire.'</span></a></p>';
+ }
+
+ // Skin ankete
+ if ($row['skin_profile'] == 0) {
+ $skin_name = $row['skin'];
+ }
+ else {
+ $sqla = sisplet_query("SELECT name FROM srv_theme_profiles WHERE id = '".$row['skin_profile']."'");
+ $rowa = mysqli_fetch_array($sqla);
+ $skin_name = $rowa['name'];
+ }
+ //echo '<p>'.$lang['srv_themes'].':<a href="'.$base_url.'&a='.A_TEMA.'&f=vabila_settings" title="'.$lang['srv_themes'].'"><span class="qs_data as_link">'.$row['skin'].'</span></a></p>';
+ echo '<p><span>'.$lang['srv_themes'].':</span> <a href="'.$base_url.'&a='.A_TEMA.'" title="'.$lang['srv_themes'].'"><span class="qs_data as_link">'.$skin_name.'</span></a></p>';
+
+ # Jezik
+ $lang_old = $lang;
+ $lang_admin = (int)$row['lang_admin'];
+ $lang_resp = (int)$row['lang_resp'];
+ $lang_array = array();
+ $lang_array[0] = $lang['srv_language_not_set'];
+ // Preberemo razpoložljive jezikovne datoteke
+ if ($dir = opendir('../../lang')) {
+ while (($file = readdir($dir)) !== false) {
+ if ($file != '.' AND $file != '..') {
+ if (is_numeric(substr($file, 0, strpos($file, '.')))) {
+ $i = substr($file, 0, strpos($file, '.'));
+ $file = '../../lang/'.$i.'.php';
+ if (file_exists($file)) {
+ include($file);
+ $lang_array[$i] = $lang['language'];
+ }
+ }
+ }
+ }
+ }
+
+ $lang = $lang_old;
+ $resp_change_lang = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang');
+ //echo '<p>'.$lang['srv_language_admin_1'].':</p>';
+ echo '<p><span>'.$lang['srv_language_admin_0'].':</span> <a href="'.$base_url.'&a='.A_JEZIK.'&f=vabila_settings" title="'.$lang['srv_language_admin_1'].'"><span class="qs_data as_link">'.$lang_array[$lang_admin].'</span></a> / <a href="'.$base_url.'&a='.A_JEZIK.'&f=vabila_settings" title="'.$lang['srv_language_respons_1'].'"><span class="qs_data as_link">'.$lang_array[$lang_resp].'</span></a></p>';
+
+ #obveščanje
+
+ // jezikovni linki
+ $p = new Prevajanje($this->anketa);
+ $p->dostop();
+ $jeziki = $p->get_all_translation_langs();
+ if (count($jeziki) > 0) {
+ echo '<p>' . $lang['srv_trans_lang'] . ': ';
+ $i = 0;
+ foreach ($jeziki AS $key => $val) {
+ if ($i++ != 0) echo ', ';
+ echo '<a href="'.$link.'?anketa='.$this->anketa.'&a=prevajanje&lang_id='.$key.'" target="_blank">'.$val.'</a>';
+ }
+ echo '</p>';
+ }
+
+ #piškotki
+ echo '<p><span>'.$lang['srv_cookie'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_cookie'].'"><span class="qs_data as_link">'.$lang['srv_cookie_'.$row['cookie']].'</span></a></p>';
+ echo '<p><span>'.$lang['srv_cookie_return'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_cookie_return'].'"><span class="qs_data as_link">'.($row['cookie_return'] == 0 ? $lang['srv_cookie_return_start'] : $lang['srv_cookie_return_middle']).'</span></a></p>';
+
+ #more - več
+ echo '<div id="srv_objava_info_more1" class="as_link" onclick="togglePublishSettings();"><span class="faicon fa-angle-down"></span>'.$lang['srv_publication_survey_settings_more'].'</div>';
+ echo '<div id="srv_objava_info_more2" class="as_link displayNone" onclick="togglePublishSettings();"><span class="faicon fa-angle-up"></span>'.$lang['srv_publication_survey_settings_less'].'</div>';
+
+ echo '<div id="publish_settings_more">';
+
+ if ($row['cookie'] > -1) {
+ # če je piškotek dlje kot do konca nakete lahko izbere tudi druge možnosti
+ echo '<p><span>'.$lang['srv_return_finished'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_return_finished'].'"><span class="qs_data as_link">'.($row['return_finished'] == 1 ? $lang['srv_return_finished_yes'] : $lang['srv_return_finished_no']).'</span></a></p>';
+ } else {
+ # ker je piškotek samo do konca ankete se ne more vrnit ali urejat
+ echo '<p><span>'.$lang['srv_return_finished'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_return_finished'].'"><span class="qs_data as_link">'. $lang['srv_return_finished_no'] .'</span></a></p>';
+ }
+
+ echo '<p><span>'.$lang['srv_multilang'].':</span> <a href="'.$base_url.'&a='.A_PREVAJANJE.'&f=vabila_settings" title="'.$lang['srv_multilang'].'"><span class="qs_data as_link">'.($row['multilang'] == 1 ? $lang['yes'] : $lang['no'] ).'</span></a></p>';
+
+ echo '<p><span>'.$lang['srv_user'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_user'].'"><span class="qs_data as_link">';
+ if ($row['user_from_cms'] == 1) {
+ echo $lang['srv_respondent'];
+ } elseif ($row['user_from_cms'] == 2) {
+ echo $lang['srv_vnasalec'];
+ } elseif ($row['user_from_cms'] == 0) {
+ echo $lang['no1'];
+ }
+ echo '</span></a></p>';
+
+ echo '<p><span>'.$lang['srv_block_ip'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_block_ip'].'"><span class="qs_data as_link">';
+ if ($row['block_ip'] == 0) {
+ echo $lang['no1'];
+ } elseif ($row['block_ip'] == 10) {
+ echo '10 min';
+ } elseif ($row['block_ip'] == 20) {
+ echo '20 min';
+ } elseif ($row['block_ip'] == 60) {
+ echo '60 min';
+ } elseif ($row['block_ip'] == 720) {
+ echo '12 '.$lang['hour_hours2'];
+ } elseif ($row['block_ip'] == 1440) {
+ echo '24 '.$lang['hour_hours2'];
+ }
+ echo '</a>';
+ echo '</p>';
+
+
+ # user from cms
+ if ($row['user_from_cms']>0) {
+ echo '<p><span>'.$lang['srv_user_cms_show'].':</span> <a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_user_cms_show'].'"><span class="qs_data as_link">'.($lang['srv_user_cms_email']).'</span></a></p>';
+ }
+ echo '<p><span>'.$lang['srv_vote_limit'].':</span> <a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_vote_limit'].'"><span class="qs_data as_link">'.($row['vote_limit'] == 0 ? $lang['no'] : $lang['yes']).'</span></a></p>';
+
+ echo '<p><span>'.$lang['srv_vote_count'].':</span> <a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_vote_count'].'"><span class="qs_data as_link">'.($row['vote_limit'] == 0 ? '/' : $row['vote_count']).'</span></a></p>';
+ # Obveščanje
+ // preberemo nastavitve alertov
+ $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".$this->anketa."'");
+ if (mysqli_num_rows($sqlAlert) > 0) {
+ $rowAlert = mysqli_fetch_assoc($sqlAlert);
+ } else {
+ SurveyAlert::getInstance()->Init($anketa, $global_user_id);
+ $rowAlert = SurveyAlert::setDefaultAlertBeforeExpire();
+ }
+
+ $alert_finish = array();
+ $alert_expire = array();
+ $alert_delete = array();
+ $alert_active = array();
+ if ($rowAlert['finish_respondent'] == 1) {
+ $alert_finish[] = $lang['srv_alert_respondent'];
+ }
+ if ($rowAlert['finish_respondent_cms'] == 1) {
+ $alert_finish[] = $lang['srv_alert_respondent_cms'];
+ }
+ if ($rowAlert['finish_author'] == 1) {
+ $alert_finish[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['finish_other'] == 1) {
+ $alert_finish[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['expire_author'] == 1) {
+ $alert_expire[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['expire_other'] == 1) {
+ $alert_expire[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['delete_author'] == 1) {
+ $alert_delete[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['delete_other'] == 1) {
+ $alert_delete[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['active_author'] == 1) {
+ $alert_active[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['active_other'] == 1) {
+ $alert_active[] = $lang['email_prejemniki'];
+ }
+ echo '<p><span>'.$lang['srv_alert_completed_2'].':</span> <a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_completed_2'].'"><span class="qs_data as_link">'.(count($alert_finish) ? implode(',',$alert_finish) : $lang['no']).'</span></a></p>';
+ echo '<p><span>'.$lang['srv_alert_expired_2'].':</span> <a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_expired_2'].'"><span class="qs_data as_link">'.(count($alert_expire) ? implode(',',$alert_expire) : $lang['no']).'</span></a></p>';
+ echo '<p><span>'.$lang['srv_alert_active_2'].':</span> <a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_active_2'].'"><span class="qs_data as_link">'.(count($alert_active) ? implode(',',$alert_active) : $lang['no']).'</span></a></p>';
+ echo '<p><span>'.$lang['srv_alert_delete_2'].':</span> <a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_delete_2'].'"><span class="qs_data as_link">'.(count($alert_delete) ? implode(',',$alert_delete) : $lang['no']).'</span></a></p>';
+
+ echo '<p>';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a='.A_SETTINGS . '&f=vabila_settings" title="' . $lang['srv_nastavitve_ankete'] . '">';
+ echo $lang['srv_nastavitve_ankete_all'].'</a>';
+ echo '</p>';
+
+ echo '</div>'; // div#publish_settings_more
+ }
+ // Nimamo dostopa do zavihka urejanje - ni nobenih linkov
+ else{
+ # Trajanje
+ $starts = explode('-',$row['starts']);
+ $starts = $starts[2].'.'.$starts[1].'.'.$starts[0];
+ $expire = explode('-',$row['expire']);
+ $expire = $expire[2].'.'.$expire[1].'.'.$expire[0];
+ echo '<p><span>'.$lang['srv_starts'].':</span> '.$starts.'</p>';
+ if ( $row['expire'] == PERMANENT_DATE ) {
+ #trajna
+ echo '<p><span>'.$lang['srv_trajna_anketa'].':</span> '.($row['expire'] == PERMANENT_DATE ? $lang['yes'] : $lang['no']).'</p>';
+ } else {
+ echo '<p><span>'.$lang['srv_expire'].':</span> '.$expire.'</p>';
+ }
+
+ echo '<p><span>'.$lang['srv_themes'].':</span> '.$row['skin'].'</p>';
+
+ # Jezik
+ $lang_old = $lang;
+ $lang_admin = (int)$row['lang_admin'];
+ $lang_resp = (int)$row['lang_resp'];
+ $lang_array = array();
+ $lang_array[0] = $lang['srv_language_not_set'];
+ // Preberemo razpoložljive jezikovne datoteke
+ if ($dir = opendir('../../lang')) {
+ while (($file = readdir($dir)) !== false) {
+ if ($file != '.' AND $file != '..') {
+ if (is_numeric(substr($file, 0, strpos($file, '.')))) {
+ $i = substr($file, 0, strpos($file, '.'));
+ $file = '../../lang/'.$i.'.php';
+ if (file_exists($file)) {
+ include($file);
+ $lang_array[$i] = $lang['language'];
+ }
+ }
+ }
+ }
+ }
+
+ $lang = $lang_old;
+ $resp_change_lang = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang');
+ echo '<p><span>'.$lang['srv_language_admin_0'].':</span> '.$lang_array[$lang_admin].' / '.$lang_array[$lang_resp].'</p>';
+
+ #obveščanje
+
+ // jezikovni linki
+ $p = new Prevajanje($this->anketa);
+ $jeziki = $p->get_all_translation_langs();
+ if (count($jeziki) > 0) {
+ echo '<p>' . $lang['srv_trans_lang'] . ': ';
+ $i = 0;
+ foreach ($jeziki AS $key => $val) {
+ if ($i++ != 0) echo ', ';
+ echo '<a href="'.$link.'?language='.$key.'&f=vabila_settings" target="_blank">'.$val.'</a>';
+ }
+ echo '</p>';
+ }
+ #piškotki
+ echo '<p><span>'.$lang['srv_cookie'].':</span> '.$lang['srv_cookie_'.$row['cookie']].'</p>';
+ echo '<p><span>'.$lang['srv_cookie_return'].':</span> '.($row['cookie_return'] == 0 ? $lang['srv_cookie_return_start'] : $lang['srv_cookie_return_middle']).'</p>';
+
+ #more - več
+ echo '<div id="srv_objava_info_more1" class="as_link" onclick="togglePublishSettings();"><span class="faicon fa-angle-down"></span>'.$lang['srv_publication_survey_settings_more'].'</div>';
+ echo '<div id="srv_objava_info_more2" class="as_link displayNone" onclick="togglePublishSettings();"><span class="faicon fa-angle-up"></span>'.$lang['srv_publication_survey_settings_less'].'</div>';
+
+ echo '<div id="publish_settings_more">';
+
+ if ($row['cookie'] > -1) {
+ # če je piškotek dlje kot do konca nakete lahko izbere tudi druge možnosti
+ echo '<p><span>'.$lang['srv_return_finished'].':</span> '.($row['return_finished'] == 1 ? $lang['srv_return_finished_yes'] : $lang['srv_return_finished_no']).'</p>';
+ } else {
+ # ker je piškotek samo do konca ankete se ne more vrnit ali urejat
+ echo '<p><span>'.$lang['srv_return_finished'].':</span> '. $lang['srv_return_finished_no'] .'</p>';
+ }
+
+ echo '<p><span>'.$lang['srv_multilang'].':</span> '.($row['multilang'] == 1 ? $lang['yes'] : $lang['no'] ).'</p>';
+
+ echo '<p><span>'.$lang['srv_user'].':</span> ';
+ if ($row['user_from_cms'] == 1) {
+ echo $lang['srv_respondent'];
+ } elseif ($row['user_from_cms'] == 2) {
+ echo $lang['srv_vnasalec'];
+ } elseif ($row['user_from_cms'] == 0) {
+ echo $lang['no1'];
+ }
+ echo '</p>';
+
+ echo '<p><span>'.$lang['srv_block_ip'].':</span> ';
+ if ($row['block_ip'] == 0) {
+ echo $lang['no1'];
+ } elseif ($row['block_ip'] == 10) {
+ echo '10 min';
+ } elseif ($row['block_ip'] == 20) {
+ echo '20 min';
+ } elseif ($row['block_ip'] == 60) {
+ echo '60 min';
+ } elseif ($row['block_ip'] == 720) {
+ echo '12 '.$lang['hour_hours2'];
+ } elseif ($row['block_ip'] == 1440) {
+ echo '24 '.$lang['hour_hours2'];
+ }
+ echo '</p>';
+
+
+ # user from cms
+ if ($row['user_from_cms']>0) {
+ echo '<p><span>'.$lang['srv_user_cms_show'].':</span> '.($lang['srv_user_cms_email']).'</p>';
+ }
+ echo '<p><span>'.$lang['srv_vote_limit'].':</span> '.($row['vote_limit'] == 0 ? $lang['no'] : $lang['yes']).'</p>';
+
+ echo '<p><span>'.$lang['srv_vote_count'].':</span> '.($row['vote_limit'] == 0 ? '/' : $row['vote_count']).'</p>';
+ # Obveščanje
+ // preberemo nastavitve alertov
+ $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".$this->anketa."'");
+ if (mysqli_num_rows($sqlAlert) > 0) {
+ $rowAlert = mysqli_fetch_assoc($sqlAlert);
+ } else {
+ SurveyAlert::getInstance()->Init($anketa, $global_user_id);
+ $rowAlert = SurveyAlert::setDefaultAlertBeforeExpire();
+ }
+
+ $alert_finish = array();
+ $alert_expire = array();
+ $alert_delete = array();
+ $alert_active = array();
+ if ($rowAlert['finish_respondent'] == 1) {
+ $alert_finish[] = $lang['srv_alert_respondent'];
+ }
+ if ($rowAlert['finish_respondent_cms'] == 1) {
+ $alert_finish[] = $lang['srv_alert_respondent_cms'];
+ }
+ if ($rowAlert['finish_author'] == 1) {
+ $alert_finish[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['finish_other'] == 1) {
+ $alert_finish[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['expire_author'] == 1) {
+ $alert_expire[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['expire_other'] == 1) {
+ $alert_expire[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['delete_author'] == 1) {
+ $alert_delete[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['delete_other'] == 1) {
+ $alert_delete[] = $lang['email_prejemniki'];
+ }
+ if ($rowAlert['active_author'] == 1) {
+ $alert_active[] = $lang['srv_info_author'];
+ }
+ if ($rowAlert['active_other'] == 1) {
+ $alert_active[] = $lang['email_prejemniki'];
+ }
+ echo '<p><span>'.$lang['srv_alert_completed_2'].':</span> '.(count($alert_finish) ? implode(',',$alert_finish) : $lang['no']).'</p>';
+ echo '<p><span>'.$lang['srv_alert_expired_2'].':</span> '.(count($alert_expire) ? implode(',',$alert_expire) : $lang['no']).'</p>';
+ echo '<p><span>'.$lang['srv_alert_active_2'].':</span> '.(count($alert_active) ? implode(',',$alert_active) : $lang['no']).'</p>';
+ echo '<p><span>'.$lang['srv_alert_delete_2'].':</span> '.(count($alert_delete) ? implode(',',$alert_delete) : $lang['no']).'</p>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+ break;
+ }
+
+ // Gumbi spodaj
+
+ echo '<div class="button_holder">';
+ // privzete nastavitve in QR koda imajo samo gumb zapri
+ if ($name == 'settings' || $name == 'QR') {
+ $img = $site_url.'admin/survey/classes/phpqrcode/imgs/code'.$this->anketa.'.png';
+ echo '<button class="medium blue" id="'.$name.'" onclick="download_file(\''.$img.'\'); popupClose(); return false;">'.$lang['srv_anketa_href_friends_button'].'</button>';
+ }
+ // html in iframe kode imajo gumba zapri in kopiraj ($code)
+ elseif ($name == 'html' || $name == 'htmlcount') {
+ //echo '<button class="medium white-blue" onclick="popupClose(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="CopyToClipboard(\''.htmlspecialchars($code).'\'); actionNotePopup(\'link_copied\', \'success\'); popupClose(); return false;">'.$lang['srv_diagnostika_testiranje_copy'].'</button>';
+ }
+ elseif ($name == 'jazvem') {
+ echo '<button class="medium blue" onclick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=panel\'; popupClose(); return false;">'.$lang['srv_anketa_href_jazvem_button'].'</button>';
+ }
+ elseif ($name == 'add_url') {
+ echo '<button type="button" class="medium white-blue" onclick="popupClose(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button type="button" class="medium blue" onclick="addPrettyURL();">'.$lang['srv_nice_url_add_button'].'</button>';
+ }
+ else {
+ //echo '<button class="medium white-blue" onclick="popupClose(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="CopyToClipboard(\''.$code.'\'); actionNotePopup(\'link_copied\', \'success\'); popupClose(); return false;">'.$lang['srv_diagnostika_testiranje_copy'].'</button>';
+ }
+ echo '</div>';
+ }
+
+ // Enklikarhiv popup
+ private function ajax_oneClickArchive(){
+ global $lang;
+
+ $anketa = $_POST['anketa'];
+
+ echo '<h2>'.$lang['srv_analiza_arhiviraj'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+
+ echo '<div class="popup_content">';
+ echo '<p class="bottom16">'.$lang['srv_questionnaire_archives_text_popup'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo $lang['srv_questionnaire_archives_note'].':';
+ echo '<input class="large w400" name="intro_opomba" id="intro_opomba" type="text"/>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="popupClose(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="create_archive_survey(\'' . $this->anketa .'\'); return false;">'.$lang['srv_backup_button'].'</button>';
+ echo '</div>';
+ }
+
+
+ private function ajax_show_gdpr_messeage(){
+ global $lang;
+
+ $id_sporocila = $_POST['id_sporocila'];
+
+ $sql = sisplet_query("SELECT text FROM srv_gdpr_requests WHERE id = '".$id_sporocila."'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<h2><span class="faicon envelope"></span>'.$lang['srv_gdpr_requests_text'].'</h2>';
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+
+ echo '<div class="popup_content">';
+ echo '<p class="bottom16"> '.$row['text'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="popupClose(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
+
+
+ }
}
?> \ No newline at end of file
diff --git a/admin/survey/SurveyAdminSettings.php b/admin/survey/SurveyAdminSettings.php
index 259ffb5..4a1918b 100644
--- a/admin/survey/SurveyAdminSettings.php
+++ b/admin/survey/SurveyAdminSettings.php
@@ -49,8 +49,9 @@ class SurveyAdminSettings {
$this->skin = 0;
if ((isset ($_REQUEST['anketa']) && $_REQUEST['anketa'] > 0) || (isset ($anketa) && $anketa > 0)) {
- $this->anketa = (isset ($_REQUEST['anketa']) && $_REQUEST['anketa'] > 0) ? $_REQUEST['anketa'] : $anketa;
- } else {
+ $this->anketa = (isset ($anketa) && $anketa > 0) ? $anketa : $_REQUEST['anketa'];
+ }
+ else {
// nekje se uporablja tudi brez IDja ankete!!!
//die("SAS: SID missing!");
}
@@ -58,12 +59,11 @@ 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);
- $this->stran = $_GET['a'];
+ $this->stran = isset($_GET['a']) ? $_GET['a'] : null;
}
@@ -88,6 +88,9 @@ class SurveyAdminSettings {
/* Globalne nastavitve ankete: veljajo za celoto anketo ne glede na uporabnika*/
$row = SurveyInfo::getInstance()->getSurveyRow();
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
+
echo '<form name="settingsanketa_' . $row['id'] . '" action="ajax.php?a=editanketasettings" method="post" autocomplete="off">' . "\n\r";
echo ' <input type="hidden" name="anketa" value="' . $this->anketa . '" />' . "\n\r";
echo ' <input type="hidden" name="grupa" value="' . $this->grupa . '" />' . "\n\r";
@@ -101,14 +104,30 @@ class SurveyAdminSettings {
echo '<fieldset>';
echo '<legend>' . $lang['srv_osnovniPodatki'] . '</legend>';
- echo '<span class="nastavitveSpan2" >' . $lang['srv_novaanketa_polnoime'] . ':&nbsp;</span>';
- echo '<input type="text" id="anketa_polnoIme" name="anketa_polnoIme" value="' . $row['naslov'] . '" style="width:300px" onblur="edit_anketa_naslov(\'' . $row['id'] . '\');" maxlength="'.ANKETA_NASLOV_MAXLENGTH.'" />&nbsp;<span id="anketa_polnoIme_chars">' . strlen($row['naslov']) . '/'.ANKETA_NASLOV_MAXLENGTH.'</span><br/>' . "\n\r";
- echo '<span class="nastavitveSpan2" >' . $lang['srv_novaanketa_kratkoime'] . ':&nbsp;</span>';
- echo '<input type="text" id="anketa_akronim" name="anketa_akronim" value="' . $row['akronim'] . '" style="width:300px" onblur="edit_anketa_akronim(\'' . $row['id'] . '\');" maxlength="'.ANKETA_AKRONIM_MAXLENGTH.'" />&nbsp;<span id="anketa_akronim_chars">' . strlen($row['akronim']) . '/'.ANKETA_AKRONIM_MAXLENGTH.'</span><br/>' . "\n\r";
- echo '<span class="nastavitveSpan2" style="vertical-align:top;">' . $lang['srv_note'] . ':&nbsp;</span>';
- echo '<span><textarea rows="5" cols="20" id="anketa_note" name="anketa_note" onblur="edit_anketa_note(\'' . $row['id'] . '\');" maxlength="'.ANKETA_NOTE_MAXLENGTH.'">' . $row['intro_opomba'] . '</textarea></span>&nbsp;<span id="anketa_note_chars">' . strlen($row['intro_opomba']) . '/'.ANKETA_NOTE_MAXLENGTH.'</span><br/>' . "\n\r";
- echo '<span id="blank_note_edit"></span><br />';
-
+ echo '<div class="setting_holder">';
+ echo '<label for="anketa_polnoIme">'.$lang['srv_novaanketa_polnoime'].':</label>';
+ echo ' <input type="text" class="large" id="anketa_polnoIme" name="naslov" value="' . $row['naslov'] . '" />';
+ echo ' <span class="charalimit" id="anketa_polnoIme_chars">' . strlen($row['naslov']) . '/'.ANKETA_NASLOV_MAXLENGTH.'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label for="anketa_akronim">'.$lang['srv_novaanketa_kratkoime'].':</label>';
+ echo ' <input type="text" class="large" id="anketa_akronim" name="akronim" value="' . $row['akronim'] . '" />';
+ echo ' <span class="charalimit" id="anketa_akronim_chars">' . strlen($row['akronim']) . '/'.ANKETA_AKRONIM_MAXLENGTH.'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="opomba" value="0">';
+ echo '<input type="checkbox" id="opomba" name="opomba" value="1" '.(isset($row['intro_opomba']) && $row['intro_opomba'] != "" ? ' checked="checked"' : '').' onChange="toggleAnketaOpomba(); return false;">';
+ echo '<label for="opomba">'.$lang['srv_dodaj_opombo'].'</label> ';
+ echo '</div>';
+
+ echo '<div id="dodaj-opombo" class="setting_holder '.(isset($row['intro_opomba']) && $row['intro_opomba'] != "" ? '' : 'displayNone').'">';
+ echo ' <label for="anketa_note">'.$lang['srv_note'].':</label>';
+ echo ' <textarea id="anketa_note" name="intro_opomba" maxlength="'.ANKETA_NOTE_MAXLENGTH.'">' . $row['intro_opomba'] . '</textarea>';
+ echo ' <span class="charalimit" id="anketa_note_chars";">' . strlen($row['intro_opomba']) . '/'.ANKETA_NOTE_MAXLENGTH.'</span>';
+ echo '</div>';
+
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
UserSetting::getInstance()->Init($global_user_id);
$show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
@@ -122,24 +141,30 @@ class SurveyAdminSettings {
$sqlF = sisplet_query("SELECT id, naslov FROM srv_mysurvey_folder WHERE usr_id='".$global_user_id."' ORDER BY naslov ASC");
if($show_folders == 1 && mysqli_num_rows($sqlF) > 0){
- echo '<span class="nastavitveSpan2">' . $lang['srv_newSurvey_survey_new_folder'] . ':</span>';
-
- echo '<select name="anketa_folder" id="anketa_folder">';
+
+ echo '<div id="anketa-toggle" class="setting_holder '.($selected_folder != 0 ? '' : 'bottom0').'">';
+ echo '<input type="hidden" name="mapa" value="0">';
+ echo '<input type="checkbox" id="mapa" name="mapa" value="1" '.($selected_folder != 0 ? ' checked="checked"' : '').' onChange="toggleAnketaMapa(); return false;">';
+ echo '<label for="mapa">'.$lang['srv_newSurvey_survey_new_folder'].'</label> ';
+ echo '</div>';
+
+ echo '<div id="dodaj-v-mapo" class="setting_holder '.($selected_folder != 0 ? '' : 'displayNone').'">';
+ echo '<label for="anketa_folder">'. $lang['srv_newSurvey_survey_new_folder'] .Help::display('srv_nova_shrani').':</label>';
+ echo '<select class="dropdown large w400" name="anketa_folder" id="anketa_folder">';
echo '<option value="0" '.($selected_folder == 0 ? ' selected="selected"' : '').'>'.$lang['srv_newSurvey_survey_new_folder_def'].'</option>';
while($rowF = mysqli_fetch_array($sqlF)){
echo '<option value="'.$rowF['id'].'" '.($rowF['id'] == $selected_folder ? ' selected="selected"' : '').'>'.$rowF['naslov'].'</option>';
}
echo '</select>';
- echo '<br />';
+
+ echo '</div>';
}
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</fieldset>';
/* JEZIK */
echo '<fieldset>';
- echo '<legend>' . $lang['lang'] . '</legend>';
+ echo '<legend>' . $lang['lang'] . Help::display('srv_nastavitve_jezik').'</legend>';
$lang_admin = $row['lang_admin'];
$lang_resp = $row['lang_resp'];
@@ -165,53 +190,62 @@ class SurveyAdminSettings {
$file = '../../lang/'.$lang_admin.'.php';
@include($file);
}
-
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_language_admin_survey'].':</span>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_language_admin_survey'].':</span>';
+
ksort($lang_array);
foreach ($lang_array AS $key => $val) {
- if ($key == 1 || $key == 2) {
- echo '<input type="radio" value="'.$key.'" id="lll_'.$key.'" '.($key==$lang_admin?' checked':'').' name="lang_admin" style="margin-bottom:5px;">';
- echo '<label for="lll_'.$key.'">'.$val.'</label>&nbsp;';
+ if ($key == 1 || $key == 2) {
+ echo '<div class="setting_item">';
+ echo '<input type="radio" value="'.$key.'" id="lll_'.$key.'" '.($key==$lang_admin?' checked':'').' name="lang_admin">';
+ echo '<label for="lll_'.$key.'">'.$val.'</label>';
+ echo '</div>';
}
}
- echo '<br />';
+ echo '</div>';
+
+ echo '<div class="setting_horizontal_wrapper">';
+ echo '<div class="setting_holder">';
+ echo '<label for="lang_resp">'.$lang['srv_language_respons_1'].':</label>';
+
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_language_respons_1'].':</span>';
asort($lang_array);
- echo '&nbsp;<select name="lang_resp">';
+ echo '<select class="dropdown large" id="lang_resp" name="lang_resp">';
foreach ($lang_array AS $key => $val) {
echo '<option value="'.$key.'" '.($key==$lang_resp?' selected':'').'>'.$val.'</option>';
}
- echo '</select>';
-
- echo '<br /><br />';
-
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_language_link2'].':</span>';
+ echo '</select>';
+ echo '</div>';
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
if($userAccess->checkUserAccess($what='prevajanje')){
- echo '&nbsp;<a href="index.php?anketa='.$this->anketa.'&a=prevajanje" title="'.$lang['srv_language_link'].'"><span class="bold">'.$lang['srv_language_link'].'</span></a>';
- }
- else{
- echo '&nbsp;<a href="#" onClick=popupUserAccess(\'prevajanje\'); return false;" title="'.$lang['srv_language_link'].'" class="user_access_locked"><span class="bold">'.$lang['srv_language_link'].'</span></a>';
+
+ $lang_link = 'window.location.href=\'index.php?anketa='.$this->anketa.'&a=prevajanje\'; return false;';
+ $color = 'white-black';
}
+ else{
+ $lang_link = 'popupUserAccess(\'prevajanje\'); return false;';
+ $color = 'yellow user_access_locked';
+ }
-
-
- echo '<div style="float:right;">'.$lang['srv_language_mySurveys'].'</div>';
-
+ echo '<div class="button_holder top0 bottom0">';
+ echo '<button class="medium '.$color.'" onClick="'.$lang_link.'">'.$lang['srv_multi_lang'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
+
echo '</fieldset>';
-
- echo '<br />';
// Gumb shrani - vmes
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
-
- echo '<br class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
/* INTERAKTIVNI ELEMENTI */
@@ -231,210 +265,254 @@ class SurveyAdminSettings {
$multiple_pages = true;
- // Indikator napredka
- //echo '<br />';
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_te_progressbar'].' '.Help::display('srv_show_progressbar').':</span>';
- echo '<label><input type="radio" name="progressbar" value="1" '.($row['progressbar'] == 1 && $multiple_pages ? ' checked="checked"' : '').' '.(!$multiple_pages ? ' disabled="disabled"' : '').'>' . $lang['yes'] . '</label> ';
- echo '<label><input type="radio" name="progressbar" value="0" '.($row['progressbar'] == 0 || !$multiple_pages ? ' checked="checked"' : '').' '.(!$multiple_pages ? ' disabled="disabled"' : '').'>' . $lang['no1'] . '</label> ';
+ // Indikator napredka
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="progressbar" value="0">';
+ echo '<input type="checkbox" id="progressbar" name="progressbar" value="1" '.($row['progressbar'] == 1 && $multiple_pages ? ' checked="checked"' : '').' '.(!$multiple_pages ? 'disabled' : '').'>';
+ echo '<label for="progressbar">'.$lang['srv_te_progressbar'].' '.Help::display('srv_show_progressbar').'</label> ';
+ echo '</div>';
// Naslov ankete za uporabnike
- echo '<br />';
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_show_title'].':</span>';
- echo '<label><input type="radio" name="survey_hide_title" value="0" '.($survey_hide_title == 0 ? ' checked="checked"' : '').'>' . $lang['yes'] . '</label> ';
- echo '<label><input type="radio" name="survey_hide_title" value="1" '.($survey_hide_title == 1 ? ' checked="checked"' : '').'>' . $lang['no1'] . '</label> ';
-
- // Politika zasebnosti
- echo '<br />';
- echo '<span class="nastavitveSpan3 bold"><label for="anketa_countType" >' . $lang['srv_privacy'] . ' '.Help::display('srv_privacy_setting').':</label></span>';
- echo '<label><input type="radio" name="privacy" value="0"' . ($survey_privacy == 0 ? ' checked="checked"' : '') . '>' . $lang['srv_privacy_0'] . '</label>' . "\n\r";
- echo '<label><input type="radio" name="privacy" value="1"' . ($survey_privacy == 1 ? ' checked="checked"' : '') . '>' . $lang['srv_privacy_1'] . '</label>' . "\n\r";
- echo '<label><input type="radio" name="privacy" value="2"' . ($survey_privacy == 2 ? ' checked="checked"' : '') . '>' . $lang['srv_privacy_2'] . '</label>' . "\n\r";
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_hide_title" value="1">';
+ echo '<input type="checkbox" id="survey_hide_title" name="survey_hide_title" value="0" '.($survey_hide_title == 0 ? ' checked="checked"' : '').'>';
+ echo '<label for="survey_hide_title">'.$lang['srv_show_title'].'</label> ';
+ echo '</div>';
+
// Nadaljuj kasneje
- if($this->survey_type > 1){
- echo '<br />';
- echo '<span class="nastavitveSpan3 bold"><label>' . $lang['srv_show_continue_later'] . ' '.Help::display('srv_continue_later_setting').':</label></span>';
- echo '<label for="continue_later_1"><input type="radio" name="continue_later" value="1" id="continue_later_1"' . ($row['continue_later'] == 1 ? ' checked="checked"' : '') . '>' . $lang['yes'] . '</label>' . "\n\r";
- echo '<label for="continue_later_0"><input type="radio" name="continue_later" value="0" id="continue_later_0"' . ($row['continue_later'] == 0 ? ' checked="checked"' : '') . '>' . $lang['no1'] . '</label>' . "\n\r";
+ if($this->survey_type > 1 && !SurveyInfo::getInstance()->checkSurveyModule('panel')){
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="continue_later" value="0">';
+ echo '<input type="checkbox" id="continue_later" name="continue_later" value="1" '.($row['continue_later'] == 1 ? ' checked="checked"' : '').'>';
+ echo '<label for="continue_later">'.$lang['srv_show_continue_later'].' '.Help::display('srv_continue_later_setting').'</label> ';
+ echo '</div>';
}
-
+
// Gumb nazaj
- echo '<br />';
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_slideshow_sett_back_button_lbl'].':</span>';
- echo '<label for="display_backlink_1"><input type="radio" name="display_backlink" id="display_backlink_1" '.($display_backlink!=='0'?' checked':'').' value="">'.$lang['yes'].'</label> ';
- echo '<label for="display_backlink_0"><input type="radio" name="display_backlink" id="display_backlink_0" '.($display_backlink==='0'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br /><br />';
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="display_backlink" value="0">';
+ echo '<input type="checkbox" id="display_backlink" name="display_backlink" value="1" '.($display_backlink!=='0'?' checked':'').'>';
+ echo '<label for="display_backlink">'.$lang['srv_slideshow_sett_back_button_lbl'].'</label> ';
+ echo '</div>';
+
// Namig
- echo '<span class="nastavitveSpan3 bold"><label>' . $lang['srv_hint'] . ' '.Help::display('srv_namig_setting').':</label></span>';
- echo '<label><input type="radio" name="survey_hint" value="1"' . ($survey_hint == 1 ? ' checked="checked"' : '') . '>' . $lang['yes'] . '</label>' . "\n\r";
- echo '<label><input type="radio" name="survey_hint" value="0"' . ($survey_hint == 0 ? ' checked="checked"' : '') . '>' . $lang['no1'] . '</label>' . "\n\r";
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_hint" value="0">';
+ echo '<input type="checkbox" id="survey_hint" name="survey_hint" value="1" '.($survey_hint == 1 ? ' checked="checked"' : '').'>';
+ echo '<label for="survey_hint">'.$lang['srv_hint'].' '.Help::display('srv_namig_setting').'</label> ';
+ echo '</div>';
+
+ /* KNJIZNICA */
+ $sqlk = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='$this->anketa' AND uid='$global_user_id'");
+ $moje = mysqli_num_rows($sqlk);
+ $sqlk = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='$this->anketa' AND uid='0'");
+ $javne = mysqli_num_rows($sqlk);
- //belezenje reminderjev
- /*echo '<br /><span class="nastavitveSpan3 bold"><label>' . $lang['srv_reminder_tracking'] . ':</label></span>';
- echo '<label><input type="radio" name="survey_track_reminders" value="1"' . ($survey_track_reminders == 1 ? ' checked="checked"' : '') . '>' . $lang['yes'] . '</label>' . "\n\r";
- echo '<label><input type="radio" name="survey_track_reminders" value="0"' . ($survey_track_reminders == 0 ? ' checked="checked"' : '') . '>' . $lang['no1'] . '</label>' . "\n\r";*/
+ if ($admin_type == 0 || $admin_type == 1) {
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="javne_ankete" value="0">';
+ echo '<input type="checkbox" id="javne_ankete" name="javne_ankete" value="1" '.($javne==1?' checked':'').' onchange="javascript:check_library();">';
+ echo '<label for="javne_ankete">'.$lang['srv_javne_ankete'].'</label> ';
+ echo '</div>';
+ }
- echo '<br />';
+ echo '<div class="setting_holder" id="moje_ankete">';
+ echo '<input type="hidden" name="moje_ankete" value="0">';
+ echo '<input type="checkbox" id="moje_ankete" name="moje_ankete" value="1" '.($moje==1?' checked':'').'>';
+ echo '<label for="moje_ankete">'.$lang['srv_moje_ankete'].' '.Help::display('srv_moje_ankete_setting').'</label> ';
+ echo '</div>';
+
+ ?>
+ <script>
+ check_library();
+ </script>
+ <?
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_opozorilo_vprasanja'].':</span>&nbsp;
- <a href="ajax.php?a=reminder_all&what=soft&anketa='.$this->anketa.'">'.$lang['srv_soft_reminder_all'].'</a>,
- <a href="ajax.php?a=reminder_all&what=hard&anketa='.$this->anketa.'">'.$lang['srv_hard_reminder_all'].'</a>,
- <a href="ajax.php?a=reminder_all&what=no&anketa='.$this->anketa.'">'.$lang['srv_no_reminder_all'].'</a>';
-
- echo '<br /><br />';
-
- // Napredni parapodatki
- if (($admin_type == 0 || $admin_type == 1) && $this->survey_type > 0) {
- echo '<span class="nastavitveSpan3 bold"><label>' . $lang['srv_parapodatki'] . ':</label></span>';
- echo '<label><input type="radio" name="parapodatki" value="1"' . ($row['parapodatki'] == 1 ? ' checked="checked"' : '') . '>' . $lang['yes'] . '</label>' . "\n\r";
- echo '<label><input type="radio" name="parapodatki" value="0"' . ($row['parapodatki'] == 0 ? ' checked="checked"' : '') . '>' . $lang['no1'] . '</label>' . "\n\r";
-
- echo '(Download: ';
- // Download tracking podatke
- echo '<a href="parapodatki.php?anketa='.$this->anketa.'&a=tracking" target="_blank">Editor data</a>, ';
- // Download parapodatke
- echo '<a href="parapodatki.php?anketa='.$this->anketa.'&a=parapodatki" target="_blank">Respondent data</a>, ';
- // Download vprasanja v anketi (srv_spremenljivka)
- echo '<a href="parapodatki.php?anketa='.$this->anketa.'&a=vprasanja" target="_blank">Survey questions</a>, ';
- // Download variable v vprasanjih (srv_vrednost)
- echo '<a href="parapodatki.php?anketa='.$this->anketa.'&a=items" target="_blank">Question items</a>';
- echo ') '.Help::display('srv_parapodatki');
- }
+ // Politika zasebnosti
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' .$lang['srv_privacy'] .' '.Help::display('srv_privacy_setting').':</span>';
- echo '<br />';
-
- // Arhiviranje vprasanj - samo admini in managerji
- if ($admin_type == 0 || $admin_type == 1) {
- echo '<span class="nastavitveSpan3 bold">'.$lang['srv_vprasanje_tracking'].' '.Help::display('srv_vprasanje_tracking_setting').':</span>';
- echo '<label for="vprasanje_tracking_1"><input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_1" '.($row['vprasanje_tracking']==1?' checked':'').' value="1">'.$lang['srv_avtomatsko'].'</label>';
- //echo '<input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_1" '.($row['vprasanje_tracking']==1?' checked':'').' value="1"><label for="vprasanje_tracking_1">'.$lang['srv_avtomatsko'].' ('.$lang['srv_loop_always'].')</label>';
- //echo '<input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_3" '.($row['vprasanje_tracking']==3?' checked':'').' value="3"><label for="vprasanje_tracking_3">'.$lang['srv_avtomatsko'].' ('.$lang['srv_potrditev'].')</label>';
- echo '<label for="vprasanje_tracking_2"><input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_2" '.($row['vprasanje_tracking']==2?' checked':'').' value="2">'.$lang['srv_rocno'].'</label>';
- echo '<label for="vprasanje_tracking_0"><input type="radio" name="vprasanje_tracking" id="vprasanje_tracking_0" '.($row['vprasanje_tracking']==0?' checked':'').' value="0">'.$lang['no'].'</label>';
- }
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="privacy0" name="privacy" value="0"' . ($survey_privacy == 0 ? ' checked="checked"' : '') . '>';
+ echo '<label for="privacy0">'.$lang['srv_privacy_0'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="privacy1" name="privacy" value="1"' . ($survey_privacy == 1 ? ' checked="checked"' : '') . '>';
+ echo '<label for="privacy1">'.$lang['srv_privacy_1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="privacy2" name="privacy" value="2"' . ($survey_privacy == 2 ? ' checked="checked"' : '') . '>';
+ echo '<label for="privacy2">'.$lang['srv_privacy_2'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ // Oozorilo na vprašanja
+ echo '<div class="setting_holder">';
+ echo '<span class="seting_title">'.$lang['srv_opozorilo_vprasanja'].Help::display('srv_splosnenas_opozorilo').':</span>';
+ echo '<div class="setting_item">';
+ echo '<span class="blue pointer" onClick="popupAlertAll(\'no\')"><span class="faicon minus_circle link-right"></span>'.$lang['srv_no_reminder_all'].'</span>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<span class="blue pointer" onClick="popupAlertAll(\'soft\')"><span class="faicon link-right fa-stack"><span class="faicon circle empty fa-stack-1x"></span> <span class="faicon plus small fa-stack-1x"></span></span>'.$lang['srv_soft_reminder_all'].'</span>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<span class="blue pointer" onClick="popupAlertAll(\'hard\')"><span class="faicon plus_circle link-right"></span>'.$lang['srv_hard_reminder_all'].'</span>';
+ echo '</div>';
+
+ echo '</div>';
echo '</fieldset>';
+
/* ZAKLJUCEK (samo pri formi) */
if($row['survey_type'] == 1){
- echo '<br />';
+
echo '<fieldset>';
+
echo '<legend>'.$lang['srv_end_label'].'</legend>';
if ($row['url'] != '')
$url = $row['url'];
else
$url = $site_url;
-
- echo '<span class="nastavitveSpan2" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_link'] . ':&nbsp;</label></span>';
- echo '<input type="radio" name="concl_link" value="0" '.($row['concl_link'] == 0 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()">'.$lang['srv_concl_link_close'].' <input type="radio" name="concl_link" value="1" '.($row['concl_link'] == 1 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').show()">'.$lang['srv_concl_link_go'];
- echo '<div id="srv_concl_link_go" '.($row['concl_link'] == 0?' style="display:none"':'').'><span class="nastavitveSpan2" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_url'] . ':&nbsp;</label></span>';
- echo '<input type="text" name="url" id="url_concl_sett" value="'.$url.'" style="width:200px"></div>';
+
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title"><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_link'] . ':</label></span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="concl_link0" name="concl_link" value="0" '.($row['concl_link'] == 0 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()">';
+ echo ' <label for="concl_link0">'.$lang['srv_concl_link_close'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="concl_link1" name="concl_link" value="1" '.($row['concl_link'] == 1 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').show()">';
+ echo ' <label for="concl_link1">'.$lang['srv_concl_link_go'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item" id="srv_concl_link_go" '.($row['concl_link'] == 0?' style="display:none"':'').'>';
+ echo ' <span class="setting_title"></span>';
+ echo ' <label for="anketa' . $row['id'] . '" >' . $lang['srv_url'] . ':</label>';
+ echo ' <form>';
+ echo ' <input type="text" class="large" name="url" id="url_concl_sett" value="'.$url.'">';
+ echo ' </form>';
+ echo '</div>';
+
+ echo '</div>';
+
// Prikaz zakljucka
- echo '<br />';
- echo '<span class="nastavitveSpan2" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_show_concl']. ':&nbsp;</label></span>';
- echo '<input type="radio" name="show_concl" value="0" '.(($row['show_concl'] == 0) ? ' checked="checked" ' : '').' onclick="$(\'#srv_concl_settings\').hide()" />'.$lang['no1'];
- echo '<input type="radio" name="show_concl" value="1" '.(($row['show_concl'] == 1) ? ' checked="checked" ' : '').' onclick="$(\'#srv_concl_settings\').show()" />'.$lang['yes'];
-
- echo '<div id="srv_concl_settings" '.($row['show_concl'] == 0?' style="display:none"':'').'>';
-
+ echo '<div class="setting_holder">';
+
+ echo '<span class="seting_title" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_show_concl']. ':</label></span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="show_concl0" name="show_concl" value="0" '.(($row['show_concl'] == 0) ? ' checked="checked" ' : '').' onclick="$(\'#srv_concl_settings\').hide()" />';
+ echo ' <label for="show_concl0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="show_concl1" name="show_concl" value="1" '.(($row['show_concl'] == 1) ? ' checked="checked" ' : '').' onclick="$(\'#srv_concl_settings\').show()" />';
+ echo ' <label for="show_concl1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+
// Besedilo zakljucka
+ echo '<div class="setting_holder" id="srv_concl_settings" '.($row['show_concl'] == 0?' style="display:none"':'').'>';
+
$text = ($row['conclusion'] == '') ? $lang['srv_end'] : $row['conclusion'];
- echo '<span class="nastavitveSpan2" ><label for="anketa' . $row['id'] . '" >' . $lang['text'] . ':&nbsp;</label></span>';
- echo '<span><textarea rows="5" cols="20" id="conclusion" name="conclusion">' . $text . '</textarea></span><br/>' . "\n\r";
-
+ echo '<label for="anketa' . $row['id'] . '" >' . $lang['text'] . ':</label>';
+ echo '<textarea id="conclusion" name="conclusion">' . $text . '</textarea>';
+
+ echo '</div>';
+
+
// Gumb konec
- echo '<br />';
- echo '<span class="nastavitveSpan1" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_end_button_show'] . ':&nbsp;</label></span>';
- echo '<input type="radio" name="concl_end_button" value="0" '.(($row['concl_end_button'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'];
- echo '<input type="radio" name="concl_end_button" value="1" '.(($row['concl_end_button'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'];
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_end_button_show'] . ':</label></span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="concl_end_button0" name="concl_end_button" value="0" '.(($row['concl_end_button'] == 0) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="concl_end_button0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="concl_end_button1" name="concl_end_button" value="1" '.(($row['concl_end_button'] == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="concl_end_button1">'.$lang['yes'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+
// Gumb nazaj
- echo '<br />';
- echo '<span class="nastavitveSpan1" ><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_back_button_show'] . ':&nbsp;</label></span>';
- echo '<input type="radio" name="concl_back_button" value="0" '.(($row['concl_back_button'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'];
- echo '<input type="radio" name="concl_back_button" value="1" '.(($row['concl_back_button'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'];
-
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title"><label for="anketa' . $row['id'] . '" >' . $lang['srv_concl_back_button_show'] . ':</label></span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="concl_back_button0" name="concl_back_button" value="0" '.(($row['concl_back_button'] == 0) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="concl_back_button0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input id="concl_back_button1" type="radio" name="concl_back_button" value="1" '.(($row['concl_back_button'] == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="concl_back_button1">'.$lang['yes'].'</label>';
echo '</div>';
+ echo '</div>';
+
+
echo '</fieldset>';
}
- echo '<br />';
-
- /* KNJIZNICA */
- $sqlk = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='$this->anketa' AND uid='$global_user_id'");
- $moje = mysqli_num_rows($sqlk);
- $sqlk = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='$this->anketa' AND uid='0'");
- $javne = mysqli_num_rows($sqlk);
-
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_library'].'</legend>';
- if ($admin_type == 0 || $admin_type == 1) {
- echo '<span class="nastavitveSpan2" ><label>'.$lang['srv_javne_ankete'].':</label></span> <label><input type="radio" name="javne_ankete" value="0"'.($javne==0?' checked':'').' onchange="javascript:check_library();">'.$lang['no'].'</label> <label><input type="radio" name="javne_ankete" value="1"'.($javne==1?' checked':'').' onchange="javascript:check_library();">'.$lang['yes'].'</label>';
- echo '<br/>';
- }
-
- echo '<div id="moje_ankete">';
- echo '<span class="nastavitveSpan2"><label>'.$lang['srv_moje_ankete'].' '.Help::display('srv_moje_ankete_setting').':</label></span> <label><input type="radio" name="moje_ankete" value="0"'.($moje==0?' checked':'').'>'.$lang['no'].'</label> <label><input type="radio" name="moje_ankete" value="1"'.($moje==1?' checked':'').'>'.$lang['yes'].'</label>';
- echo '</div>';
-
- // zamakni
- echo '<br />';
- echo '<span class="nastavitveSpan2"><label>'.$lang['a_show'].'</label></span>';
- if ($row['flat'] == 0)
- echo '<span title="'.$lang['srv_flat_0'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=flat&value=1"><span class="faicon flat_0"></span> '.$lang['srv_flat_0_short'].'</a></span> ';
- else
- echo '<span title="'.$lang['srv_flat_1'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=flat&value=0"><span class="faicon flat_1"></span> '.$lang['srv_flat_0_short'].'</a></span> ';
- echo Help::display('srv_branching_flat');
-
- // odpri
- if ($row['popup'] == 1)
- echo '<span class="spaceLeft" title="'.$lang['srv_popup_1'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=popup&value=0"><span class="faicon popup_1"></span> '.$lang['srv_popup_1_short'].'</a></span> ';
- else
- echo '<span class="spaceLeft" title="'.$lang['srv_popup_0'].'"><a href="index.php?anketa='.$this->anketa.'&a=branching&change_mode=1&what=popup&value=1"><span class="faicon popup_0"></span> '.$lang['srv_popup_1_short'].'</a></span> ';
- echo Help::display('srv_branching_popup');
-
- echo '</fieldset>';
-
- ?>
- <script>
- check_library();
- </script>
- <?
-
/* STEVILCENJE */
- echo '<br/>';
echo '<fieldset>';
echo '<legend>' . $lang['srv_nastavitveStevilcenje'] . '</legend>';
- echo '<span class="nastavitveSpan2"><label for="anketa_countType">' . $lang['srv_nastavitveStevilcenjeType'] . ':</label></span>';
- echo '<label for="countType_0"><input type="radio" name="countType" value="0" id="countType_0" checked="checked" onclick="saveGlobalSetting(\'countType\')"/>' . $lang['srv_nastavitveStevilcenjeType0'] . '</label>' . "\n\r";
- echo '<label for="countType_1"><input type="radio" name="countType" value="1" id="countType_1" ' . ($row['countType'] == 1 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>' . $lang['srv_nastavitveStevilcenjeType1'] . '</label>' . "\n\r";
- echo '<label for="countType_2"><input type="radio" name="countType" value="2" id="countType_2" ' . ($row['countType'] == 2 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>' . $lang['srv_nastavitveStevilcenjeType2'] . '</label>' . "\n\r";
- echo '<label for="countType_3"><input type="radio" name="countType" value="3" id="countType_3" ' . ($row['countType'] == 3 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>' . $lang['srv_nastavitveStevilcenjeType3'] . '</label>' . "\n\r";
-
- echo '<br />';
-
// Izklop prestevilcevanja
$enumerate = SurveySetting::getInstance()->getSurveyMiscSetting('enumerate'); if ($enumerate == '') $enumerate = 1;
- echo '<span class="nastavitveSpan2"><label for="anketa_enumerate">'.$lang['srv_nastavitvePrestevilcevanje'].':</label></span>';
- echo '<label for="enumerate_1"><input type="radio" name="enumerate" id="enumerate_1" '.($enumerate == 1 ? ' checked' : '').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="enumerate_0"><input type="radio" name="enumerate" id="enumerate_0" '.($enumerate == 0 ? ' checked' : '').' value="0">'.$lang['no'].'</label> ';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="enumerate" value="0">';
+ echo '<input type="checkbox" id="enumerate" name="enumerate" value="1" '.($enumerate == 1 ? ' checked' : '').'>';
+ echo '<label for="enumerate">'.$lang['srv_nastavitvePrestevilcevanje'].'</label> ';
+ echo '</div>';
+
+ //način številčenja
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title"><label for="anketa_countType">' . $lang['srv_nastavitveStevilcenjeType'] . ':</label></span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="countType" value="0" id="countType_0" checked="checked" onclick="saveGlobalSetting(\'countType\')"/>';
+ echo '<label for="countType_0">' . $lang['srv_nastavitveStevilcenjeType0'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="countType" value="1" id="countType_1" ' . ($row['countType'] == 1 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>';
+ echo '<label for="countType_1">' . $lang['srv_nastavitveStevilcenjeType1'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="countType" value="2" id="countType_2" ' . ($row['countType'] == 2 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>';
+ echo '<label for="countType_2">' . $lang['srv_nastavitveStevilcenjeType2'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="countType" value="3" id="countType_3" ' . ($row['countType'] == 3 ? ' checked="checked"' : '') . ' onclick="saveGlobalSetting(\'countType\')"/>';
+ echo '<label for="countType_3">' . $lang['srv_nastavitveStevilcenjeType3'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
echo '</fieldset>';
- echo '<br />';
-
/* JS TRACKING */
if ($admin_type == 0 || $admin_type == 1) {
echo '<fieldset><legend>'.$lang['srv_js_tracking'].'</legend>';
- //echo '<legend>' . $lang['srv_nastavitveStevilcenje'] . '</legend>';
- echo '<p><textarea name="js_tracking" cols="20" rows="5">'.$row['js_tracking'].'</textarea></p>';
- echo '<p style="color: gray">'.$lang['js_tracking_note'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['js_tracking_note'].'</span>';
+ echo '<textarea class="textarea w800" name="js_tracking">'.$row['js_tracking'].'</textarea>';
+ echo '</div>';
+
echo '</fieldset>';
}
}
@@ -445,28 +523,56 @@ class SurveyAdminSettings {
echo '<fieldset>';
echo '<legend>' . $lang['srv_data_valid_units_settings'] . '</legend>';
- echo '<p>';
- echo '<span class="strong" >'.$lang['srv_prikaz_default_valid'].'</span>';
- echo '<label><input type="radio" name="defValidProfile" '.($row['defValidProfile']==2?' checked':'').' value="2">'.'(5,6) '.$lang['srv_data_valid_units'].'</label>';
- echo '<label><input type="radio" name="defValidProfile" '.($row['defValidProfile']==3?' checked':'').' value="3">'.'(6) '.$lang['srv_data_finished_units'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title" >'.$lang['srv_prikaz_default_valid'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="defValidProfile2" name="defValidProfile" '.($row['defValidProfile']==2?' checked':'').' value="2">';
+ echo '<label for="defValidProfile2">'.'(5,6) '.$lang['srv_data_valid_units'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="defValidProfile3" name="defValidProfile" '.($row['defValidProfile']==3?' checked':'').' value="3">';
+ echo '<label for="defValidProfile3">'.'(6) '.$lang['srv_data_finished_units'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
// Pri volitvah ne moremo prikazati datuma respondenta
- if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<p>';
- echo '<span class="strong" >'.$lang['srv_prikaz_showItime'].'</span>';
- echo '<label><input type="radio" name="showItime" '.((int)$row['showItime']==0?' checked':'').' value="0">'.$lang['no1'].'</label>';
- echo '<label><input type="radio" name="showItime" '.((int)$row['showItime']==1?' checked':'').' value="1">'.$lang['yes'].'</label>';
- echo '</p>';
+ /*if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title" >'.$lang['srv_prikaz_showItime'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="showItime0" name="showItime" '.((int)$row['showItime']==0?' checked':'').' value="0">';
+ echo '<label for="showItime0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="showItime1" name="showItime" '.((int)$row['showItime']==1?' checked':'').' value="1">';
+ echo '<label for="showItime1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
}
- echo '<p>';
- echo '<span class="strong" >'.$lang['srv_prikaz_showLineNumber'].'</span>';
- echo '<label><input type="radio" name="showLineNumber" '.((int)$row['showLineNumber']==0?' checked':'').' value="0">'.$lang['no1'].'</label>';
- echo '<label><input type="radio" name="showLineNumber" '.((int)$row['showLineNumber']==1?' checked':'').' value="1">'.$lang['yes'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title" >'.$lang['srv_prikaz_showLineNumber'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="showLineNumber0" name="showLineNumber" '.((int)$row['showLineNumber']==0?' checked':'').' value="0">';
+ echo '<label for="showLineNumber0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="showLineNumber1" name="showLineNumber" '.((int)$row['showLineNumber']==1?' checked':'').' value="1">';
+ echo '<label for="showLineNumber1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';*/
echo '</fieldset>';
+
+ echo '<form>';
+
}
/*Piskotek*/
@@ -475,9 +581,9 @@ class SurveyAdminSettings {
// Pri volitvah ne moremo popravljati nastavitev piskotka
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<fieldset style="position:relative">';
+ echo '<fieldset>';
echo '<legend>' . $lang['srv_cookie'] . '</legend>';
- echo '<span class="red bold">'.$lang['srv_voting_no_cookie'].'</span>';
+ echo '<span class="red">'.$lang['srv_voting_no_cookie'].'</span>';
echo '</fieldset>';
echo '</form>';
@@ -485,75 +591,146 @@ class SurveyAdminSettings {
return;
}
- echo '<fieldset style="position:relative">';
+ echo '<fieldset>';
+
+ echo '<legend>' . $lang['settings'] . '</legend>';
+
+ // Piskotkov nimamo, ce imamo vklopljen modul panel
+ if(!SurveyInfo::getInstance()->checkSurveyModule('panel')){
+
+ echo '<div class="divPopUp_info warning_popup" id="cookie_alert">';
+ echo '<h2>'.$lang['srv_cookie_alert_title'].'</h2>';
+ echo '<p>'.$lang['srv_cookie_alert_1'].'</p>';
+ echo '<p>'.$lang['srv_cookie_alert_2'].'</p>';
+ echo '</div>';
+
+
+ // Shrani piskotek za X casa
+ echo '<div id="cookie_osnovno" class="setting_holder bottom8">';
+ echo '<span class="setting_title">' . $lang['srv_cookie'] . Help :: display('srv_cookie') .':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="cookie" value="-1" id="cookie_-1"' . ($row['cookie'] == -1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_-1">' . $lang['srv_cookie_-1'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="cookie" value="0" id="cookie_0"' . ($row['cookie'] == 0 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_0">' . $lang['srv_cookie_0'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="cookie" value="1" id="cookie_1"' . ($row['cookie'] == 1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_1">' . $lang['srv_cookie_1'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="cookie" value="2" id="cookie_2"' . ($row['cookie'] == 2 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_2">' . $lang['srv_cookie_2'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '<div id="cookie_settings_wrap">';
+
+ // Ko se uporabnik vrne (zacne od zacetka/nadaljuje kjer je ostal)
+
+ echo '<div class="setting_holder indent">';
+ echo '<span class="setting_title">' . $lang['srv_cookie_return'] . Help :: display('srv_cookie_return') . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="cookie_return" value="0" id="cookie_return_0"' . ($row['cookie_return'] == 0 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_return_0">' . $lang['srv_cookie_return_start'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item no-cookie">';
+ echo '<input type="radio" name="cookie_return" value="1" id="cookie_return_1"' . ($row['cookie_return'] == 1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />';
+ echo '<label for="cookie_return_1">' . $lang['srv_cookie_return_middle'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ // Ce je zakljucil lahko naknadno ureja svoje odgovore
+ echo '<div class="setting_holder bottom16 indent no-cookie no-cookie-return">';
+ echo '<span class="setting_title" >' . $lang['srv_return_finished'] . Help :: display('srv_return_finished') . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="return_finished" value="1" id="return_finished_1"' . ($row['return_finished'] == 1 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="return_finished_1">' . $lang['srv_return_finished_yes'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="return_finished" value="0" id="return_finished_0"' . ($row['return_finished'] == 0 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="return_finished_0">' . $lang['srv_return_finished_no'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+
+ // Nikoli ne more popravljati svojih odgovorov (tudi ce se npr. vrne na prejsnjo stran)
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title" >' . $lang['srv_subsequent_answers'] . Help :: display('srv_subsequent_answers') . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="subsequent_answers" value="1" id="subsequent_answers_1"' . ($row['subsequent_answers'] == 1 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="subsequent_answers_1">' . $lang['srv_subsequent_answers_yes'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="subsequent_answers" value="0" id="subsequent_answers_0"' . ($row['subsequent_answers'] == 0 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="subsequent_answers_0">' . $lang['srv_subsequent_answers_no'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<div id="cookie_alert" class="google_yellow">';
- echo '<span class="">'.$lang['srv_cookie_alert_title'].'</span>';
- echo '<span class="">'.$lang['srv_cookie_alert_1'].'</span>';
- echo '<span class="">'.$lang['srv_cookie_alert_2'].'</span>';
- echo '<span class="">'.$lang['srv_cookie_alert'].'</span>';
- echo '</div>';
-
- echo '<legend>' . $lang['srv_cookie'] . '</legend>';
-
- // Shrani piskotek za X casa
- echo '<span class="nastavitveSpan3 bold" ><label>' . $lang['srv_cookie'] . Help :: display('srv_cookie') .':</label></span>';
- echo ' <label for="cookie_-1"><input type="radio" name="cookie" value="-1" id="cookie_-1"' . ($row['cookie'] == -1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_-1'] . '</label>' . "\n\r";
- echo ' <label for="cookie_0"><input type="radio" name="cookie" value="0" id="cookie_0"' . ($row['cookie'] == 0 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_0'] . '</label>' . "\n\r";
- echo ' <label for="cookie_1"><input type="radio" name="cookie" value="1" id="cookie_1"' . ($row['cookie'] == 1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_1'] . '</label>' . "\n\r";
- echo ' <label for="cookie_2"><input type="radio" name="cookie" value="2" id="cookie_2"' . ($row['cookie'] == 2 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_2'] . '</label>' . "\n\r";
- echo '<br/>';
-
- // Ko se uporabnik vrne (zacne od zacetka/nadaljuje kjer je ostal)
- echo '<span class="nastavitveSpan3 bold" ><label>' . $lang['srv_cookie_return'] . Help :: display('srv_cookie_return') . ':</label></span>';
- echo ' <label for="cookie_return_0"><input type="radio" name="cookie_return" value="0" id="cookie_return_0"' . ($row['cookie_return'] == 0 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_return_start'] . '</label>' . "\n\r";
- echo ' <div class="no-cookie"><label for="cookie_return_1"><input type="radio" name="cookie_return" value="1" id="cookie_return_1"' . ($row['cookie_return'] == 1 ? ' checked="checked"' : '') . ' onclick="checkcookie();" />' . $lang['srv_cookie_return_middle'] . '</label></div>' . "\n\r";
- echo '<br>';
-
- // Ce je zakljucil lahko naknadno ureja svoje odgovore
- echo '<div class="no-cookie no-cookie-return"><span class="nastavitveSpan3 bold" ><label>' . $lang['srv_return_finished'] . Help :: display('srv_return_finished') . ':</label></span>';
- echo ' <label for="return_finished_1"><input type="radio" name="return_finished" value="1" id="return_finished_1"' . ($row['return_finished'] == 1 ? ' checked="checked"' : '') . ' />' . $lang['srv_return_finished_yes'] . '</label>' . "\n\r";
- echo ' <label for="return_finished_0"><input type="radio" name="return_finished" value="0" id="return_finished_0"' . ($row['return_finished'] == 0 ? ' checked="checked"' : '') . ' />' . $lang['srv_return_finished_no'] . '</label></div>' . "\n\r";
- echo '<br/>';
-
- // Nikoli ne more popravljati svojih odgovorov (tudi ce se npr. vrne na prejsnjo stran)
- echo '<div class="no-subsequent-answers"><span class="nastavitveSpan3 bold" ><label>' . $lang['srv_subsequent_answers'] . Help :: display('srv_subsequent_answers') . ':</label></span>';
- echo ' <label for="subsequent_answers_1"><input type="radio" name="subsequent_answers" value="1" id="subsequent_answers_1"' . ($row['subsequent_answers'] == 1 ? ' checked="checked"' : '') . ' />' . $lang['srv_subsequent_answers_yes'] . '</label>' . "\n\r";
- echo ' <label for="subsequent_answers_0"><input type="radio" name="subsequent_answers" value="0" id="subsequent_answers_0"' . ($row['subsequent_answers'] == 0 ? ' checked="checked"' : '') . ' />' . $lang['srv_subsequent_answers_no'] . '</label></div>' . "\n\r";
- echo '<br/>';
-
- // Ce ni sprejel piskotka lahko/ne more nadaljevati
- echo '<div class="no-cookie"><span class="nastavitveSpan3 bold" ><label>' . $lang['srv_cookie_continue'] . Help :: display('srv_cookie_continue') . ':</label></span>';
- echo ' <label for="cookie_continue_1"><input type="radio" name="cookie_continue" value="1" id="cookie_continue_1"' . ($row['cookie_continue'] == 1 ? ' checked="checked"' : '') . ' />' . $lang['srv_cookie_continue_yes'] . '</label>' . "\n\r";
- echo ' <label for="cookie_continue_0"><input type="radio" name="cookie_continue" value="0" id="cookie_continue_0"' . ($row['cookie_continue'] == 0 ? ' checked="checked"' : '') . ' />' . $lang['srv_cookie_continue_no'] . '</label></div>' . "\n\r";
- echo '<br/>';
-
- echo '<br/>';
// Prepoznaj respondenta
- echo '<span class="nastavitveSpan3 bold" ><label>' . $lang['srv_user'] . Help :: display('srv_user_from_cms') . ':</label></span>';
- echo ' <label for="user_1"><input type="radio" name="user_from_cms" value="1" id="user_1"' . ($row['user_from_cms'] == 1 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />' . $lang['srv_respondent'] . '</label>' . "\n\r";
- echo ' <label for="user_2"><input type="radio" name="user_from_cms" value="2" id="user_2"' . ($row['user_from_cms'] == 2 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />' . $lang['srv_vnasalec'] . '</label>' . "\n\r";
- echo ' <label for="user_0"><input type="radio" name="user_from_cms" value="0" id="user_0"' . ($row['user_from_cms'] == 0 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').attr(\'disabled\', true); _user_from_cms(); " />' . $lang['no1'] . '</label>' . "\n\r";
- echo '<br/>';
+ echo '<div class="setting_holder" id="prepoznaj_respondenta">';
+ echo '<span class="setting_title">' . $lang['srv_user'] . Help :: display('srv_user_from_cms') . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="user_from_cms" value="1" id="user_1"' . ($row['user_from_cms'] == 1 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />';
+ echo '<label for="user_1">' . $lang['srv_respondent'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="user_from_cms" value="2" id="user_2"' . ($row['user_from_cms'] == 2 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').removeAttr(\'disabled\')" />';
+ echo '<label for="user_2">' . $lang['srv_vnasalec'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="user_from_cms" value="0" id="user_0"' . ($row['user_from_cms'] == 0 ? ' checked="checked"' : '') . ' onclick="javascript:checkcookie(); $(\'#user_1_email\').attr(\'disabled\', true); _user_from_cms(); " />';
+ echo '<label for="user_0">' . $lang['no1'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
// Ob izpolnjevanju prikazi email
- echo '<div id="cms_email">';
- echo ' <span class="nastavitveSpan3 bold" >&nbsp;</span><label>' . $lang['srv_user_cms_show'] . Help :: display('srv_user_from_cms_email') . ':</label>';
- echo ' <label for="user_1_email"><input type="checkbox" name="user_from_cms_email" value="1" id="user_1_email"' . ($row['user_from_cms_email'] == 1 ? ' checked="checked"' : '') . ' '.($row['user_from_cms']>0?'':' disabled="true" ').'/>' . $lang['srv_user_cms_email'] . '</label>' . "\n\r";
- echo '</div>';
-
+ echo '<div class="setting_holder" id="cms_email">';
+ echo '<span class="setting title">' . $lang['srv_user_cms_show'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="user_from_cms_email" value="1" id="user_1_email"' . ($row['user_from_cms_email'] == 1 ? ' checked="checked"' : '') . ' '.($row['user_from_cms']>0?'':' disabled="true" ').'/>';
+ echo '<label for="user_1_email">' . $lang['srv_user_cms_email'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
// Masovno vnasanje - modul Vnos
- echo '<fieldset id="vnos_modul" style="margin-top: 15px !important;"><legend>'.$lang['srv_vrsta_survey_type_5'].'</legend>';
-
- echo ' <p>'.$lang['srv_vnos_navodila'].'</p>';
+ echo '<fieldset id="vnos_modul"><legend>'.$lang['srv_vrsta_survey_type_5'].'</legend>';
- echo ' <span class="nastavitveSpan3 bold"><label>' . $lang['srv_mass_input']. Help :: display('srv_mass_insert') . ':</label></span>';
- echo ' <input type="radio" name="mass_insert" value="1" id="mass_insert_1"' . ($row['mass_insert'] == 1 ? ' checked="checked"' : '') . ' /><label for="mass_insert_1">' . $lang['srv_mass_input_1'] . '</label>' . "\n\r";
- echo ' <input type="radio" name="mass_insert" value="0" id="mass_insert_0"' . ($row['mass_insert'] == 0 ? ' checked="checked"' : '') . ' /><label for="mass_insert_0">' . $lang['srv_mass_input_0'] . '</label>' . "\n\r";
+ echo '<p class="bottom16">'.$lang['srv_vnos_navodila'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['srv_mass_input'] . ':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mass_insert" value="1" id="mass_insert_1"' . ($row['mass_insert'] == 1 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="mass_insert_1">' . $lang['srv_mass_input_1'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mass_insert" value="0" id="mass_insert_0"' . ($row['mass_insert'] == 0 ? ' checked="checked"' : '') . ' />';
+ echo '<label for="mass_insert_0">' . $lang['srv_mass_input_0'] . '</label>';
+ echo '</div>';
+
echo '</fieldset>';
// For modul maza, show all cookie settings
@@ -563,36 +740,37 @@ class SurveyAdminSettings {
function checkcookie () {
- if ($('input[name=cookie]:checked').val() == '-1' && $('input[name=user_from_cms]:checked').val() == '0' && <?echo $row['user_base'];?> != 1 && <?echo $isMaza;?> != 1) {
- $('input[name=cookie_return]').attr('disabled', true);
- $('input[name=return_finished]').attr('disabled', true);
- $('.no-cookie').css('visibility', 'hidden');
+ if ($('input[name=cookie]:checked').val() == '-1' && $('input[name=user_from_cms]:checked').val() == '0' && <?echo $row['user_base'];?> != 1 && <?echo $isMaza;?> != 1) {
+ $('#cookie_settings_wrap').addClass('displayNone');
+ $('#cookie_osnovno').removeClass('bottom8');
}
else {
- $('input[name=cookie_return]').attr('disabled', false);
- $('input[name=return_finished]').attr('disabled', false);
- $('.no-cookie').css('visibility', 'visible');
+ $('#cookie_settings_wrap').removeClass('displayNone');
+ $('#cookie_osnovno').addClass('bottom8');
}
if ( $('input[name=cookie_return]:checked').val() == 1 ) {
- $('.no-cookie-return').css('visibility', 'hidden');
+ $('.no-cookie-return').addClass('displayNone');
}
else {
- $('.no-cookie-return').css('visibility', 'visible');
+ $('.no-cookie-return').removeClass('displayNone');
}
if ( $('input[name=user_from_cms]:checked').val() == 0 ) {
- $('#cms_email').css('visibility', 'hidden');
+ $('#cms_email').addClass('displayNone');
+ $('#prepoznaj_respondenta').addClass('bottom0');
}
else {
- $('#cms_email').css('visibility', 'visible');
+ $('#cms_email').removeClass('displayNone');
+ $('#prepoznaj_respondenta').removeClass('bottom0');
+
}
if ( $('input[name=user_from_cms]:checked').val() == 2 ) {
- $('#vnos_modul').show();
+ $('#vnos_modul').removeClass('displayNone');
}
else {
- $('#vnos_modul').hide();
+ $('#vnos_modul').addClass('displayNone');
}
}
@@ -605,22 +783,22 @@ class SurveyAdminSettings {
$sqlDostopAvtor = sisplet_query($stringDostopAvtor);
$rowDostopAvtor = mysqli_fetch_assoc($sqlDostopAvtor);
$avtorRow = SurveyInfo::getInstance()->getSurveyRow();
-
-
- echo '<br/>';
echo '<fieldset>';
echo '<legend>' . $lang['access'] . '</legend>';
- echo '<span class="nastavitveSpan3" ><label for="odgovarja">' . $lang['srv_izpolnjujejo'] . Help :: display('srv_izpolnjujejo') .': </label></span>';
- echo ' <select name="odgovarja" id="odgovarja" onchange="javascript:_odgovarja();" class="spaceLeft">';
- echo ' <option value="4"' . ($row['odgovarja'] == 4 ? ' selected="selected"' : '') . '>' . $lang['forum_hour_all'] . '</option>';
- echo ' <option value="3"' . ($row['odgovarja'] == 3 ? ' selected="selected"' : '') . '>' . $lang['forum_registered'] . '</option>';
- echo ' <option value="2"' . ($row['odgovarja'] == 2 ? ' selected="selected"' : '') . '>' . $lang['forum_clan'] . '</option>';
- echo ' <option value="1"' . ($row['odgovarja'] == 1 ? ' selected="selected"' : '') . '>' . $lang['forum_manager'] . '</option>';
- echo ' <option value="0"' . ($row['odgovarja'] == 0 ? ' selected="selected"' : '') . '>' . $lang['forum_admin'] . '</option>';
- echo ' </select>';
- echo '<br />';
+
+ /*echo '<div class="setting_holder">';
+ echo '<span class="setting_title" ><label for="odgovarja">' . $lang['srv_izpolnjujejo'] . Help :: display('srv_izpolnjujejo') .': </label></span>';
+ echo '<select name="odgovarja" id="odgovarja" onchange="javascript:_odgovarja();" class="dropdown large">';
+ echo '<option value="4"' . ($row['odgovarja'] == 4 ? ' selected="selected"' : '') . '>' . $lang['forum_hour_all'] . '</option>';
+ echo '<option value="3"' . ($row['odgovarja'] == 3 ? ' selected="selected"' : '') . '>' . $lang['forum_registered'] . '</option>';
+ echo '<option value="2"' . ($row['odgovarja'] == 2 ? ' selected="selected"' : '') . '>' . $lang['forum_clan'] . '</option>';
+ echo '<option value="1"' . ($row['odgovarja'] == 1 ? ' selected="selected"' : '') . '>' . $lang['forum_manager'] . '</option>';
+ echo '<option value="0"' . ($row['odgovarja'] == 0 ? ' selected="selected"' : '') . '>' . $lang['forum_admin'] . '</option>';
+ echo '</select>';
+ echo '</div>';*/
+
echo '<script language="javascript">'."\n";
echo ' function _user_from_cms() {'."\n";
echo ' document.settingsanketa_' . $row['id'] . '.odgovarja.value = \'4\''."\n";
@@ -631,23 +809,40 @@ class SurveyAdminSettings {
echo ' }'."\n";
echo '}'."\n";
echo '</script>'."\n";
-
- echo '<br/>';
-
- echo '<span class="nastavitveSpan3 bold" ><label>' . $lang['srv_block_ip'] . Help :: display('srv_block_ip') . ':</label></span>';
- echo ' <label for="block_ip_0"><input type="radio" name="block_ip" value="0" id="block_ip_0"' . ($row['block_ip'] == 0 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').hide();" />' . $lang['no1'] . '</label>' . "\n\r";
- echo ' <label for="block_ip_10"><input type="radio" name="block_ip" value="10" id="block_ip_10"' . ($row['block_ip'] == 10 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').show();" />10 min</label>' . "\n\r";
- echo ' <label for="block_ip_20"><input type="radio" name="block_ip" value="20" id="block_ip_20"' . ($row['block_ip'] == 20 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').show();" />20 min</label>' . "\n\r";
- echo ' <label for="block_ip_60"><input type="radio" name="block_ip" value="60" id="block_ip_60"' . ($row['block_ip'] == 60 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').show();" />60 min</label>' . "\n\r";
- echo ' <label for="block_ip_720"><input type="radio" name="block_ip" value="720" id="block_ip_720"' . ($row['block_ip'] == 720 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').show();" />12 '.$lang['hour_hours2'].'</label>' . "\n\r";
- echo ' <label for="block_ip_1440"><input type="radio" name="block_ip" value="1440" id="block_ip_1440"' . ($row['block_ip'] == 1440 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').show();" />24 '.$lang['hour_hours2'].'</label>' . "\n\r";
- echo '<br /><br /><span id="block_ip_warning" class="bold" style="margin-left:117px; '.($row['block_ip'] == 0 ? ' display:none;' : '').'">'.$lang['srv_block_ip_warning'].'</span>';
- echo '</fieldset>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['srv_block_ip'] . Help :: display('srv_block_ip') . ':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="0" id="block_ip_0"' . ($row['block_ip'] == 0 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').addClass(\'displayNone\');" />';
+ echo '<label for="block_ip_0">' . $lang['no1'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="10" id="block_ip_10"' . ($row['block_ip'] == 10 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />';
+ echo '<label for="block_ip_10">10 min</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="20" id="block_ip_20"' . ($row['block_ip'] == 20 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />';
+ echo '<label for="block_ip_20">20 min</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="60" id="block_ip_60"' . ($row['block_ip'] == 60 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />';
+ echo '<label for="block_ip_60">60 min</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="720" id="block_ip_720"' . ($row['block_ip'] == 720 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />';
+ echo '<label for="block_ip_720">12 '.$lang['hour_hours2'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="block_ip" value="1440" id="block_ip_1440"' . ($row['block_ip'] == 1440 ? ' checked="checked"' : '') . ' onChange="$(\'#block_ip_warning\').removeClass(\'displayNone\');" />';
+ echo '<label for="block_ip_1440">24 '.$lang['hour_hours2'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<br/>';
-
+ echo '<p id="block_ip_warning" class="top16 red '.($row['block_ip'] == 0 ? ' displayNone' : '').'">'.$lang['srv_block_ip_warning'].'</p>';
+
+ echo '</fieldset>';
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
global $global_user_id;
@@ -661,7 +856,7 @@ class SurveyAdminSettings {
}
else{
- echo '<div id="password">';
+ echo '<div class="setting_holder" id="password">';
$ss = new SurveySkupine($this->anketa);
$spr_id = $ss->hasSkupine(2);
@@ -682,19 +877,42 @@ class SurveyAdminSettings {
echo '</script>';
// dodajanje gesel za anketo
- if($spr_id > 0){
- $vrednosti = $ss->getVrednosti($spr_id);
- if($vrednosti != 0){
- foreach($vrednosti as $vrednost){
- echo '<p>';
- echo '<strong>'.$vrednost['naslov'].'</strong><span class="faicon delete_circle icon-orange_link spaceLeft" style="margin-bottom:1px;" onclick="delete_skupina(\'2\', \''.$vrednost['id'].'\', \''.$vrednost['naslov'].'\');"></span>';
- echo '</p>';
- }
- }
- }
- echo '<p class="add_skupina_button"><input type="text" name="skupina" autocomplete="off" onKeyUp="add_skupina_enter(\'2\', event);" /> <input type="button" value="'.$lang['add'].'" onclick="add_skupina(\'2\');" /></p>';
-
- echo '<span class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" href="#" onClick="display_add_passwords_mass();">'.$lang['srv_password_add_mass'].'</a></span>';
+
+ echo '<div class="setting_holder bottom0">';
+ echo '<div class="button_holder inline bottom16">';
+ echo '<input type="text" class="large" name="skupina" autocomplete="off" onKeyUp="add_skupina_enter(\'2\', event);" />';
+ echo '<button type="button" class="medium blue" onclick="add_skupina(\'2\');">'.$lang['add'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div>';
+
+ echo '<table id="passwords_table" '.(($spr_id == 0) ? 'class="displayNone"' : '').'>';
+
+ echo '<tr>';
+ echo '<th>'.$lang['password'].'</th>';
+ echo '<th></th>';
+ echo '</tr>';
+
+ if($spr_id > 0){
+ $vrednosti = $ss->getVrednosti($spr_id);
+ if($vrednosti != 0){
+ foreach($vrednosti as $vrednost){
+ echo '<tr>';
+ echo '<td>'.$vrednost['naslov'].'</td>';
+ echo '<td class="right"><button class="table-inline blue caps" type="button" onclick="delete_skupina(\'2\', \''.$vrednost['id'].'\');">'.$lang['srv_password_remove'].'</button></td>';
+ echo '</tr>';
+ }
+ }
+ }
+
+ echo '</table>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder">';
+ echo '<a class="noline" href="#" onClick="display_add_passwords_mass();"><span class="faicon file-import flipX link-right"></span>'.$lang['srv_password_add_mass'].'</a>';
+ echo '</div>';
echo '</div>';
}
@@ -721,18 +939,10 @@ class SurveyAdminSettings {
echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_gray" href="'.$url.'"><span>'.$lang['back'] . '</span></a></span>';
}
}
- echo '<span class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="submitSurveyDuration();return false;" href="#"><span>';
- echo $lang['edit1337'] . '</span></a></span>';
-
- /*
- $http_referer = parse_url($_SERVER['HTTP_REFERER']); //If yes, parse referrer
- $referer_url = $http_referer['query'];
- if (preg_match('/anketa='.$this->anketa.'&a'.A_VABILA.'/', $referer_url)) {
- echo '<div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="'.$_SERVER['HTTP_REFERER'].'"><span>';
- echo $lang['srv_back_to_email'] . '</span></a></div>';
- echo '</div>';
- }
- */
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="submitSurveyDuration();return false;" href="#">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
/*Respondenti*/
@@ -744,11 +954,13 @@ class SurveyAdminSettings {
/*Komentarji*/
if ($_GET['a'] == 'urejanje') {
+
// tukaj bom dodal še kontrolo na Avtorja ankete, tako da avtor lahko vedno spreminja urejanje (gorazd,1.9.2009)
$stringDostopAvtor = "SELECT count(*) as isAvtor FROM srv_dostop WHERE ank_id = '" . $this->anketa . "' AND uid='" . $global_user_id . "'";
$sqlDostopAvtor = sisplet_query($stringDostopAvtor);
$rowDostopAvtor = mysqli_fetch_assoc($sqlDostopAvtor);
- if ($admin_type == 0 || $rowDostopAvtor['isAvtor']) {
+
+ if ($admin_type == 0 || $rowDostopAvtor['isAvtor'] || isDemoSurvey($this->anketa)) {
SurveySetting::getInstance()->Init($this->anketa);
@@ -796,7 +1008,17 @@ class SurveyAdminSettings {
$preview_disable_test_insert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disable_test_insert');
if ( isset($_GET['show']) && $_GET['show']=='on_alert' ) {
- echo '<div class="comments_on_alert google_yellow">'.$lang['srv_comments_on_alert'].' <a href="ajax.php?anketa='.$this->anketa.'&a=comments_onoff&do=off">'.$lang['srv_off'].'.</a> '.$lang['srv_comments_on_alert2'].' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/testiranje/komentarji/?from1ka=1" target="_blank">'.$lang['srv_anl_more'].'</a></div>';
+ echo '<div class="comments_on_alert google_yellow">';
+
+ echo ' <div class="title"><span class="faicon success"></span>'.$lang['srv_comments_on_alert'].'</div>';
+
+ echo ' <div class="text">';
+ echo $lang['srv_comments_on_alert1'].' <a href="ajax.php?anketa='.$this->anketa.'&a=comments_onoff&do=off">'.$lang['srv_here'].'</a>. ';
+ echo $lang['srv_comments_on_alert2'];
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/testiranje/komentarji/?from1ka=1" target="_blank">'.$lang['srv_more_info'].'</a>.';
+ echo ' </div>';
+
+ echo '</div>';
}
$css_width = '';
@@ -805,41 +1027,48 @@ class SurveyAdminSettings {
$css_width2 = 'width:45% !important;';
}
- echo '<fieldset style="float: left;'.$css_width.'"><legend>'.$lang['comments'].'</legend>';
+ $advanced_expanded = isset($_GET['advanced_expanded']) ? $_GET['advanced_expanded'] : '';
- echo '<p><input type="checkbox" name="comments_default" id="comments_admin1" onclick="comments_admin_toggle(\'1\')" admin_on="false" /><label for="comments_admin1" style="font-weight:500; vertical-align:inherit"> '.$lang['srv_comments_admin_on1'].'</label><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$lang['srv_comments_admin_note1'].')</p>';
- echo '<p><input type="checkbox" name="comments_resp2" id="comments_resp2" onclick="comments_resp_toggle(\'2\')" resp_on="false" /><label for="comments_resp2" style="font-weight:500; vertical-align:inherit"> '.$lang['srv_comments_resp_on2'].'</label><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$lang['srv_comments_resp_note2'].')</p>';
- echo '<p><input type="checkbox" name="comments_default" id="comments_admin2" onclick="comments_admin_toggle(\'2\')" admin_on="false" /><label for="comments_admin2" style="font-weight:500; vertical-align:inherit"> '.$lang['srv_comments_admin_on2'].'</label><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$lang['srv_comments_admin_note2'].')</p>';
- echo '<p><input type="checkbox" name="comments_default" id="comments_resp" onclick="comments_resp_toggle(\'1\')" resp_on="false" /><label for="comments_resp" style="font-weight:500; vertical-align:inherit"> '.$lang['srv_comments_resp_on'].'</label><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('.$lang['srv_comments_resp_note'].')</p>';
- //echo '<input type="radio" name="comments_defalut" id="comments_default_on" disabled /> <a href="#" onclick="comments_default_on(); return false;">'.$lang['srv_comments_default_on'].'</a><br />';
- //echo '<input type="radio" name="comments_defalut" id="comments_on" disabled /> '.$lang['srv_comments_on'].'<br />';
- //echo '<input type="radio" name="comments_defalut" id="comments_default_off" disabled /> <a href="#" onclick="comments_default_off(); return false;">'.$lang['srv_comments_default_off'].'</a>';
-
+ echo '<fieldset class="comments"><legend>'.$lang['comments'].'</legend>';
+
+ echo '<p class="semi-bold caps bottom16">'.$lang['srv_admin_s_comments_editor'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" name="comments_default" id="comments_admin1" onclick="comments_admin_toggle(\'1\')" admin_on="false" /><label class="semi-bold" for="comments_admin1"> '.$lang['srv_comments_admin_on1'].'</label>';
+ echo '<p class="indent">('.$lang['srv_comments_admin_note1'].')</p>';
+ echo '</div>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" name="comments_default" id="comments_admin2" onclick="comments_admin_toggle(\'2\')" admin_on="false" /><label class="semi-bold" for="comments_admin2"> '.$lang['srv_comments_admin_on2'].'</label>';
+ echo '<p class="indent">('.$lang['srv_comments_admin_note2'].')</p>';
+ echo '</div>';
+
+ echo '<p class="semi-bold caps bottom16">'.$lang['srv_admin_s_comments_resp'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" name="comments_resp2" id="comments_resp2" onclick="comments_resp_toggle(\'2\')" resp_on="false" /><label class="semi-bold" for="comments_resp2"> '.$lang['srv_comments_resp_on2'].'</label>';
+ echo '<p class="indent">('.$lang['srv_comments_resp_note2'].')</p>';
+ echo '</div>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" name="comments_default" id="comments_resp" onclick="comments_resp_toggle(\'1\')" resp_on="false" /><label class="semi-bold" for="comments_resp"> '.$lang['srv_comments_resp_on'].'</label>';
+ echo '<p class="indent">('.$lang['srv_comments_resp_note'].')</p>';
+ echo '</div>';
+
+ echo '<p class="semi-bold caps top16 bottom16">'.$lang['srv_admin_s_comments_links'].'</p>';
+
+ echo '<div class="links">';
+
$d = new Dostop();
-
- $sqlc = sisplet_query("SELECT COUNT(s.id) AS count FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='$this->anketa' AND s.gru_id=g.id AND s.thread > '0'");
- if (!$sqlc) echo mysqli_error($GLOBALS['connect_db']);
- $rowc = mysqli_fetch_array($sqlc);
- if ($rowc['count'] > 0 && $d->checkDostopSub('test')) {
-
- echo '<p>';
- echo '<a href="'.$site_url . 'admin/survey/index.php?anketa=' . $row['id'] .'&a=komentarji" title="' . $lang['srv_view_comment'] . '" >';
- echo '<div class="fa-stack"><span class="faicon comments fa-stack-1x" icon-blue" title="'.$lang['srv_view_comment'].'"></span></div>';
- echo '&nbsp;'.$lang['srv_view_comment'];
- echo '</a>';
- }
-
- echo '</p>';
+ echo '<div class="button" title="'.$lang['srv_view_comment'].'" onClick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=komentarji\';">';
+ echo '<span class="faicon comments blue"></span>';
+ echo $lang['srv_admin_s_comments_view'];
+ echo '</div>';
+
+ echo '<div class="button" id="more_comments" onclick="$(\'#komentarji_napredno\').fadeToggle(); $(\'#komentarji_napredno_arrow\').toggleClass(\'plus minus\'); $(this).toggleClass(\'border_blue\'); return false;">';
+ echo '<span id="komentarji_napredno_arrow" class="faicon blue '.($advanced_expanded==1 ? 'minus' : 'plus').'"></span>';
+ echo $lang['srv_admin_s_comments_set'];
+ echo '</div>';
- echo '<p><a href="index.php?anketa='.$this->anketa.'&a=komentarji"><span class="bold">'.$lang['comments'].'</span></a></p>';
- echo '<p><a href="index.php?anketa='.$this->anketa.'&a=vabila"><span class="bold">'.$lang['srv_vabila'].'</span></a></p>';
-
- echo '<p><a href="#" onclick="$(\'#komentarji_napredno\').fadeToggle(); $(\'#komentarji_napredno_arrow\').toggleClass(\'arrow2_d\'); $(\'#komentarji_napredno_arrow\').toggleClass(\'arrow2_u\'); return false;">';
- echo ' <span class="bold">'.$lang['srv_detail_settings'].'&nbsp;</span>';
- echo ' <span id="komentarji_napredno_arrow" class="faicon arrow2_d"></span>';
- echo '</a></p>';
+ echo '</div>';
echo '</fieldset>';
@@ -879,6 +1108,9 @@ class SurveyAdminSettings {
if ( ( !check_comments_admin() && !check_comments_admin_off() ) || ( !check_comments_resp() && !check_comments_resp_off() ) ) {
$('#komentarji_napredno').show();
+ $('#komentarji_napredno_arrow').addClass('minus');
+ $('#komentarji_napredno_arrow').removeClass('plus');
+ $('#more_comments').removeClass('border_blue');
}
});
@@ -887,71 +1119,107 @@ class SurveyAdminSettings {
if ($survey_comment != "") {
- echo '<fieldset style="float:right;margin-left:13px !important;margin-right:0px !important;'.$css_width2.'"><legend>'.$lang['srv_admin_s_comments'].'</legend>';
- //echo '<form name="comment_send" action="ajax.php?a=comment_send&anketa='.$this->anketa.'">';
- echo '<textarea name="comment_send" style="width:50%; height:60px"></textarea>';
-
- echo '<p><input type="checkbox" id="srv_c_alert" name="srv_c_alert" checked value="1" /><label for="srv_c_alert"> '.$lang['srv_c_alert'].'</label></p>';
- echo '<p><input type="checkbox" id="srv_c_to_mail" name="srv_c_to_mail" value="1" onchange="$(\'#prejemniki\').toggle();" /><label for="srv_c_to_mail"> '.$lang['srv_c_to_mail'].'</label></p>';
-
- echo '<p id="prejemniki" style="display:none">';
+ echo '<fieldset class="comments" ><legend>'.$lang['srv_admin_s_comments'].'</legend>';
+ echo '<textarea name="comment_send"></textarea>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="srv_c_alert" name="srv_c_alert" checked value="1" />';
+ echo '<label for="srv_c_alert"> '.$lang['srv_c_alert'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="srv_c_to_mail" name="srv_c_to_mail" value="1" onchange="$(\'#prejemniki\').toggle();" />';
+ echo '<label for="srv_c_to_mail"> '.$lang['srv_c_to_mail'].'</label>';
+
+ echo '<div id="prejemniki" style="display:none">';
$sqlp = sisplet_query("SELECT u.name, u.surname, u.email FROM srv_dostop d, users u WHERE d.uid=u.id AND ank_id='$this->anketa'");
while ($rowp = mysqli_fetch_array($sqlp)) {
- echo '&nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="mails[]" value="'.$rowp['email'].'" checked="checked" id="'.$rowp['email'].'" /><label for="'.$rowp['email'].'"> '.$rowp['name'].' '.$rowp['surname'].' ('.$rowp['email'].')</label><br />';
+
+ echo '<div class="setting_item indent">';
+ echo '<input type="checkbox" name="mails[]" value="'.$rowp['email'].'" checked="checked" id="'.$rowp['email'].'" />';
+ echo '<label for="'.$rowp['email'].'"> '.$rowp['name'].' '.$rowp['surname'].' ('.$rowp['email'].')</label>';
+ echo '</div>';
}
- echo '</p>';
+ echo '</div>';
+ echo '</div>';
- echo '
- <div class="buttonwrapper" style="float:left;">
- <a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="document.settingsanketa_'.$this->anketa.'.submit(); return false;" href="#">
- '.$lang['add'].'
- </a>
- </div>';
- //echo '</form>';
echo '</fieldset>';
- echo '<br />';
-
}
- echo '<div id="komentarji_napredno" '.($_GET['advanced_expanded']==1 ? '' : ' style="display:none;"').'>';
-
- echo '<br class="clr" />';
- echo '<br />';
+ //Komentarji - napredne nastavitve
+ echo '<div id="komentarji_napredno" '.($advanced_expanded==1 ? '' : 'style="display:none"').'>';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
- echo '<br class="clr" />';
-
- echo '<fieldset class="wide"><legend>'.$lang['srv_preview_defaults'].'</legend>';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
- echo '<span class="nastavitveSpan1"><label for="disableif">'.$lang['srv_disableif'].': </span><input type="hidden" name="preview_disableif" value=""><input type="checkbox" value="1" '.($preview_disableif==1?' checked':'').' name="preview_disableif" id="disableif">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label for="disablealert">'.$lang['srv_disablealert'].': </span><input type="hidden" name="preview_disablealert" value=""><input type="checkbox" value="1" '.($preview_disablealert==1?' checked':'').' name="preview_disablealert" id="disablealert">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label for="displayifs">'.$lang['srv_displayifs'].': </span><input type="hidden" name="preview_displayifs" value=""><input type="checkbox" value="1" '.($preview_displayifs==1?' checked':'').' name="preview_displayifs" id="displayifs">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label for="displayvariables">'.$lang['srv_displayvariables'].': </span><input type="hidden" name="preview_displayvariables" value=""><input type="checkbox" value="1" '.($preview_displayvariables==1?' checked':'').' name="preview_displayvariables" id="displayvariables">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label for="hidecomment">'.$lang['srv_preview_comments2'].': </span><input type="hidden" name="preview_hidecomment" value=""><input type="checkbox" value="1" '.($preview_hidecomment==1?' checked':'').' name="preview_hidecomment" id="hidecomment">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label for="hidesurveycomment">'.$lang['srv_preview_hide_survey_comment'].': </span><input type="hidden" name="preview_hide_survey_comment" value=""><input type="checkbox" value="1" '.($preview_hide_survey_comment==1?' checked':'').' name="preview_hide_survey_comment" id="hidesurveycomment">';
- echo ' </label><br>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_preview_survey_comment_showalways'] . ':</label></span>';
- echo '<label for="preview_survey_comment_showalways_0"><input type="radio" name="preview_survey_comment_showalways" value="0" id="preview_survey_comment_showalways_0" ' . ($preview_survey_comment_showalways == 0 ? ' checked' : '') . '/>' . $lang['no'] . '</label> ';
- echo '<label for="preview_survey_comment_showalways_1"><input type="radio" name="preview_survey_comment_showalways" value="1" id="preview_survey_comment_showalways_1" ' . ($preview_survey_comment_showalways == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<br>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_preview_disable_test_insert'] . ':</label></span>';
- echo '<label for="preview_disable_test_insert_1"><input type="radio" name="preview_disable_test_insert" value="1" id="preview_disable_test_insert_1" ' . ($preview_disable_test_insert == 1 ? ' checked' : '') . '/>' . $lang['no'] . '</label> ';
- echo '<label for="preview_disable_test_insert_0"><input type="radio" name="preview_disable_test_insert" value="0" id="preview_disable_test_insert_0" ' . ($preview_disable_test_insert == 0 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<br>';
+ echo '<fieldset class="comments"><legend>'.$lang['srv_preview_defaults'].'</legend>';
+
+
+ echo '<div class="setting_holder">';
+ echo ' <input type="hidden" name="preview_disableif" value=""><input type="checkbox" value="1" '.($preview_disableif==1?' checked':'').' name="preview_disableif" id="disableif">';
+ echo ' <label for="disableif">'.$lang['srv_disableif'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <input type="hidden" name="preview_displayifs" value=""><input type="checkbox" value="1" '.($preview_displayifs==1?' checked':'').' name="preview_displayifs" id="displayifs">';
+ echo ' <label for="displayifs">'.$lang['srv_displayifs'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <input type="hidden" name="preview_displayvariables" value=""><input type="checkbox" value="1" '.($preview_displayvariables==1?' checked':'').' name="preview_displayvariables" id="displayvariables">';
+ echo ' <label for="displayvariables">'.$lang['srv_displayvariables'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <input type="hidden" name="preview_hidecomment" value=""><input type="checkbox" value="1" '.($preview_hidecomment==1?' checked':'').' name="preview_hidecomment" id="hidecomment">';
+ echo ' <label for="hidecomment">'.$lang['srv_preview_comments2'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <input type="hidden" name="preview_hide_survey_comment" value=""><input type="checkbox" value="1" '.($preview_hide_survey_comment==1?' checked':'').' name="preview_hide_survey_comment" id="hidesurveycomment">';
+ echo ' <label for="hidesurveycomment">'.$lang['srv_preview_hide_survey_comment'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_preview_survey_comment_showalways'] .':</span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="preview_survey_comment_showalways" value="0" id="preview_survey_comment_showalways_0" ' . ($preview_survey_comment_showalways == 0 ? ' checked' : '') . '/>';
+ echo ' <label for="preview_survey_comment_showalways_0">' . $lang['no'] . '</label> ';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="preview_survey_comment_showalways" value="1" id="preview_survey_comment_showalways_1" ' . ($preview_survey_comment_showalways == 1 ? ' checked' : '') . '/>';
+ echo ' <label for="preview_survey_comment_showalways_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_preview_disable_test_insert'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="preview_disable_test_insert" value="1" id="preview_disable_test_insert_1" ' . ($preview_disable_test_insert == 1 ? ' checked' : '') . '/>';
+ echo ' <label for="preview_disable_test_insert_1">' . $lang['no'] . '</label> ';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="preview_disable_test_insert" value="0" id="preview_disable_test_insert_0" ' . ($preview_disable_test_insert == 0 ? ' checked' : '') . '/>';
+ echo ' <label for="preview_disable_test_insert_0">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
- echo '</fieldset><br>';
+ echo '</fieldset>';
- echo '<fieldset class="wide"><legend>'.$lang['srv_admin_s_comments'].'<span>'.$lang['srv_admin_s_comments_txt'].'</span></legend>';
+ echo '<fieldset class="comments"><legend>'.$lang['srv_admin_s_comments'].'<span>'.$lang['srv_admin_s_comments_txt'].'</span></legend>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_write'] . ':</span>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_write'] . ':</label></span>';
- echo '<select name="survey_comment">';
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="survey_comment">';
echo '<option value=""'.($survey_comment==''?' selected':'').'>'.$lang['srv_nihce'].'</option>';
//echo '<option value="4"'.($survey_comment==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($survey_comment==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
@@ -959,51 +1227,90 @@ class SurveyAdminSettings {
echo '<option value="1" '.($survey_comment==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($survey_comment=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select>';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_view'] . ':</label></span>';
- echo '<select name="survey_comment_viewadminonly">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_view'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="survey_comment_viewadminonly">';
//echo '<option value="4"'.($survey_comment_viewadminonly==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($survey_comment_viewadminonly==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
echo '<option value="2" '.($survey_comment_viewadminonly==2 ?' selected':'').'>'.$lang['forum_clan'].'</option>';
echo '<option value="1" '.($survey_comment_viewadminonly==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($survey_comment_viewadminonly=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select> ';
- echo $lang['srv_comments_viewauthor'];
- echo '<input type="hidden" name="survey_comment_viewauthor" value=""><input type="checkbox" name="survey_comment_viewauthor" value="1" '.($survey_comment_viewauthor==1?' checked':'').' />';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_survey_comment_show'] . ':</label></span>';
- echo '<label for="survey_comment_showalways_0"><input type="radio" name="survey_comment_showalways" value="0" id="survey_comment_showalways_0" ' . ($survey_comment_showalways == 0 ? ' checked' : '') . '/>' . $lang['no'] . '</label> ';
- echo '<label for="survey_comment_showalways_1"><input type="radio" name="survey_comment_showalways" value="1" id="survey_comment_showalways_1" ' . ($survey_comment_showalways == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="hidden" name="survey_comment_viewauthor" value=""><input type="checkbox" id="survey_comment_viewauthor" name="survey_comment_viewauthor" value="1" '.($survey_comment_viewauthor==1?' checked':'').' />';
+ echo '<label for="survey_comment_viewauthor">'.$lang['srv_comments_viewauthor'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_survey_comment_show'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="survey_comment_showalways" value="0" id="survey_comment_showalways_0" ' . ($survey_comment_showalways == 0 ? ' checked' : '') . '/>';
+ echo '<label for="survey_comment_showalways_0">' . $lang['no'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="survey_comment_showalways" value="1" id="survey_comment_showalways_1" ' . ($survey_comment_showalways == 1 ? ' checked' : '') . '/>';
+ echo '<label for="survey_comment_showalways_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br>';
- echo '<fieldset class="wide">';
+ echo '<fieldset class="comments">';
echo '<legend>' . $lang['srv_admin_q_notes'] . '<span>'.$lang['srv_admin_q_notes_txt'].'</span></legend>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_q_note_view'] . ':</label></span>';
- echo '<select name="question_note_view">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_q_note_view'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="question_note_view">';
echo '<option value=""'.($question_note_view==''?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($question_note_view==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
echo '<option value="2" '.($question_note_view==2 ?' selected':'').'>'.$lang['forum_clan'].'</option>';
echo '<option value="1" '.($question_note_view==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($question_note_view=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select>';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_q_note_write'] . ':</label></span>';
- echo '<select name="question_note_write">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_q_note_write'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="question_note_write">';
echo '<option value=""'.($question_note_write==''?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($question_note_write==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
echo '<option value="2" '.($question_note_write==2 ?' selected':'').'>'.$lang['forum_clan'].'</option>';
echo '<option value="1" '.($question_note_write==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($question_note_write=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
- echo '</select> ';
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br>';
- echo '<fieldset class="wide">';
+ echo '<fieldset class="comments">';
echo '<legend>' . $lang['srv_admin_q_comments'] . '<span>'.$lang['srv_admin_q_comments_txt'].'</span></legend>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_write'] . ':</label></span>';
- echo '<select name="question_comment">';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_write'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="question_comment">';
echo '<option value=""'.($question_comment==''?' selected':'').'>'.$lang['srv_nihce'].'</option>';
echo '<option value="4"'.($question_comment==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($question_comment==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
@@ -1011,30 +1318,55 @@ class SurveyAdminSettings {
echo '<option value="1" '.($question_comment==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($question_comment=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select>';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_view'] . ':</label></span>';
- echo '<select name="question_comment_viewadminonly">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_view'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="question_comment_viewadminonly">';
echo '<option value="4"'.($question_comment_viewadminonly==4 || $question_comment_viewadminonly==''?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($question_comment_viewadminonly==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
echo '<option value="2" '.($question_comment_viewadminonly==2 ?' selected':'').'>'.$lang['forum_clan'].'</option>';
echo '<option value="1" '.($question_comment_viewadminonly==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($question_comment_viewadminonly=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
- echo '</select> ';
- echo $lang['srv_comments_viewauthor'];
- echo '<input type="hidden" name="question_comment_viewauthor" value=""><input type="checkbox" name="question_comment_viewauthor" value="1" '.($question_comment_viewauthor==1?' checked':'').' />';
+ echo '</select>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="hidden" name="question_comment_viewauthor" value=""><input type="checkbox" id="question_comment_viewauthor" name="question_comment_viewauthor" value="1" '.($question_comment_viewauthor==1?' checked':'').' />';
+ echo '<label for="question_comment_viewauthor">'.$lang['srv_comments_viewauthor'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br>';
-
- echo '<fieldset class="wide">';
- echo '<legend>' . $lang['srv_comments_respondents'] . '<span>'.$lang['srv_comments_respondents_txt'].'</span></legend>';
-
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_q_comment'] . ':</label></span>';
- echo '<label for="question_resp_comment_0"><input type="radio" name="question_resp_comment" value="0" id="question_resp_comment_0" ' . ($question_resp_comment == 0 ? ' checked' : '') . '/>' . $lang['no'] . '</label> ';
- echo '<label for="question_resp_comment_1"><input type="radio" name="question_resp_comment" value="1" id="question_resp_comment_1" ' . ($question_resp_comment == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_view'] . ':</label></span>';
- echo '<select name="question_resp_comment_viewadminonly">';
+ echo '<fieldset class="comments">';
+ echo '<legend>' . $lang['srv_comments_respondents'] . '</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_comments_respondents_txt'].'</p>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_q_comment'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment" value="0" id="question_resp_comment_0" ' . ($question_resp_comment == 0 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_0">' . $lang['no'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment" value="1" id="question_resp_comment_1" ' . ($question_resp_comment == 1 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_view'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="question_resp_comment_viewadminonly">';
//echo '<option value=""'.($question_resp_comment_viewadminonly==''?' selected':'').'>'.$lang['srv_nihce'].'</option>';
echo '<option value="4"'.($question_resp_comment_viewadminonly==4 || $question_resp_comment_viewadminonly==''?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($question_resp_comment_viewadminonly==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
@@ -1042,38 +1374,41 @@ class SurveyAdminSettings {
echo '<option value="1" '.($question_resp_comment_viewadminonly==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($question_resp_comment_viewadminonly=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select>';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_show_open'] . ':</label></span>';
- echo '<label for="question_resp_comment_show_open_0"><input type="radio" name="question_resp_comment_show_open" value="" id="question_resp_comment_show_open_0" ' . ($question_resp_comment_show_open == '' ? ' checked' : '') . '/>' . $lang['forma_settings_open'] . '</label> ';
- echo '<label for="question_resp_comment_show_open_1"><input type="radio" name="question_resp_comment_show_open" value="1" id="question_resp_comment_show_open_1" ' . ($question_resp_comment_show_open == '1' ? ' checked' : '') . '/>' . $lang['forma_settings_closed'] . '</label> ';
- echo '<br>';
- echo '<span class="nastavitveSpan1"><label>' .$lang['text'].' "'. $lang['srv_question_respondent_comment'] . '":</label></span>';
- echo '<input type="text" name="srvlang_srv_question_respondent_comment" value="'.$srvlang_srv_question_respondent_comment.'" style="width:300px">';
- echo '<input type="hidden" name="extra_translations" value="1">';
- echo '</fieldset>';
- echo '<br>';
-
- echo '<fieldset class="wide">';
- echo '<legend>' . $lang['srv_comments_respondents'] . '<span> - '.$lang['srv_extra_settings'].'</span></legend>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_q_inicialke'] . ':</label></span>';
- echo '<label for="question_resp_comment_inicialke_0"><input type="radio" name="question_resp_comment_inicialke" value="0" id="question_resp_comment_inicialke_0" ' . ($question_resp_comment_inicialke == 0 ? ' checked' : '') . '/>' . $lang['no'] . '</label> ';
- echo '<label for="question_resp_comment_inicialke_1"><input type="radio" name="question_resp_comment_inicialke" value="1" id="question_resp_comment_inicialke_1" ' . ($question_resp_comment_inicialke == 1 ? ' checked' : '') . '/>' . $lang['yes'] . '</label> ';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_q_inicialke_alert'] . ':</label></span>';
- echo '<label for="question_resp_comment_inicialke_alert_0"><input type="radio" name="question_resp_comment_inicialke_alert" value="0" id="question_resp_comment_inicialke_alert_0" ' . ($question_resp_comment_inicialke_alert == 0 ? ' checked' : '') . '/>' . $lang['srv_reminder_off2'] . '</label> ';
- echo '<label for="question_resp_comment_inicialke_alert_1"><input type="radio" name="question_resp_comment_inicialke_alert" value="1" id="question_resp_comment_inicialke_alert_1" ' . ($question_resp_comment_inicialke_alert == 1 ? ' checked' : '') . '/>' . $lang['srv_reminder_soft2'] . '</label> ';
- echo '<label for="question_resp_comment_inicialke_alert_2"><input type="radio" name="question_resp_comment_inicialke_alert" value="2" id="question_resp_comment_inicialke_alert_2" ' . ($question_resp_comment_inicialke_alert == 2 ? ' checked' : '') . '/>' . $lang['srv_reminder_hard2'] . '</label> ';
- /*echo '<br/>';
- echo '<div class="nastavitveSpan1" style="height:auto; float:left;"><label>' . $lang['text'] . ':</label></div>';
- echo '<textarea id="sys_survey_misc_question_comment_text" name="question_comment_text" type="text" srv_survey_misc="true" maxlength="255">'.$srv_qct.'</textarea>';
- echo '&nbsp;<span id="sys_survey_misc_question_comment_text_chars">' . strlen($srv_qct) . '/250</span>' . "\n\r";*/
- echo '</fieldset>';
- echo '<br>';
-
- echo '<fieldset class="wide"><legend>'.$lang['srv_comments_respondents'].'<span>'.$lang['srv_resp_s_comments_txt'].'</span></legend>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_show_open'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_show_open" value="" id="question_resp_comment_show_open_0" ' . ($question_resp_comment_show_open == '' ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_show_open_0">' . $lang['forma_settings_open'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_show_open" value="1" id="question_resp_comment_show_open_1" ' . ($question_resp_comment_show_open == '1' ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_show_open_1">' . $lang['forma_settings_closed'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_write'] . ':</label></span>';
- echo '<select name="survey_comment_resp">';
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' .$lang['text'].' "'. $lang['srv_question_respondent_comment'] . '":</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="text" class="text small" name="srvlang_srv_question_respondent_comment" value="'.$srvlang_srv_question_respondent_comment.'" style="width:300px">';
+ echo '<input type="hidden" name="extra_translations" value="1">';echo '</div>';
+
+ echo '</div>';
+
+ echo '<p class="bottom16">'.$lang['srv_resp_s_comments_txt'].'</p>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_write'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="survey_comment_resp">';
echo '<option value=""'.($survey_comment_resp==''?' selected':'').'>'.$lang['srv_nihce'].'</option>';
echo '<option value="4"'.($survey_comment_resp==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($survey_comment_resp==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
@@ -1081,66 +1416,149 @@ class SurveyAdminSettings {
echo '<option value="1" '.($survey_comment_resp==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($survey_comment_resp=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select>';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_view'] . ':</label></span>';
- echo '<select name="survey_comment_viewadminonly_resp">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_view'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" nname="survey_comment_viewadminonly_resp">';
echo '<option value="4"'.($survey_comment_viewadminonly_resp==4?' selected':'').'>'.$lang['move_all'].'</option>';
echo '<option value="3" '.($survey_comment_viewadminonly_resp==3 ?' selected':'').'>'.$lang['forum_registered'].'</option>';
echo '<option value="2" '.($survey_comment_viewadminonly_resp==2 ?' selected':'').'>'.$lang['forum_clan'].'</option>';
echo '<option value="1" '.($survey_comment_viewadminonly_resp==1 ?' selected':'').'>'.$lang['forum_manager'].'</option>';
echo '<option value="0" '.($survey_comment_viewadminonly_resp=='0' ?' selected':'').'>'.$lang['forum_admin'].'</option>';
echo '</select> ';
- echo $lang['srv_comments_viewauthor'];
- echo '<input type="hidden" name="survey_comment_viewauthor_resp" value=""><input type="checkbox" name="survey_comment_viewauthor_resp" value="1" '.($survey_comment_viewauthor_resp==1?' checked':'').' />';
- /*echo '<br />';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_survey_comment_show'] . ':</label></span>';
- echo '<input type="radio" name="survey_comment_showalways_resp" value="0" id="survey_comment_showalways_resp_0" ' . ($survey_comment_showalways_resp == 0 ? ' checked' : '') . '/><label for="survey_comment_showalways_resp_0">' . $lang['no'] . '</label> ';
- echo '<input type="radio" name="survey_comment_showalways_resp" value="1" id="survey_comment_showalways_resp_1" ' . ($survey_comment_showalways_resp == 1 ? ' checked' : '') . '/><label for="survey_comment_showalways_resp_1">' . $lang['yes'] . '</label> ';
- */
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="hidden" name="survey_comment_viewauthor_resp" value=""><input type="checkbox" id="survey_comment_viewauthor_resp" name="survey_comment_viewauthor_resp" value="1" '.($survey_comment_viewauthor_resp==1?' checked':'').' />';
+ echo '<label for="survey_comment_viewauthor_resp">'.$lang['srv_comments_viewauthor'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<p class="semi-bold bottom16">'.$lang['srv_extra_settings'].'</p>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_q_inicialke'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke" value="0" id="question_resp_comment_inicialke_0" ' . ($question_resp_comment_inicialke == 0 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_inicialke_0">' . $lang['no'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke" value="1" id="question_resp_comment_inicialke_1" ' . ($question_resp_comment_inicialke == 1 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_inicialke_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_q_inicialke_alert'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="0" id="question_resp_comment_inicialke_alert_0" ' . ($question_resp_comment_inicialke_alert == 0 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_inicialke_alert_0">' . $lang['srv_reminder_off2'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="1" id="question_resp_comment_inicialke_alert_1" ' . ($question_resp_comment_inicialke_alert == 1 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_inicialke_alert_1">' . $lang['srv_reminder_soft2'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="question_resp_comment_inicialke_alert" value="2" id="question_resp_comment_inicialke_alert_2" ' . ($question_resp_comment_inicialke_alert == 2 ? ' checked' : '') . '/>';
+ echo '<label for="question_resp_comment_inicialke_alert_2">' . $lang['srv_reminder_hard2'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
- echo '<fieldset class="wide">';
+ echo '<fieldset class="comments">';
echo '<legend>' . $lang['srv_settings_komentarji'] . '</legend>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['orderby'] . ':</label></span>';
- echo '<label for="sortpostorder_0"><input type="radio" name="sortpostorder" value="0" id="sortpostorder_0" ' . ($sortpostorder == 0 ? ' checked' : '') . '/>' . $lang['forum_asc'] . '</label> ';
- echo '<label for="sortpostorder_1"><input type="radio" name="sortpostorder" value="1" id="sortpostorder_1" ' . ($sortpostorder == 1 ? ' checked' : '') . '/>' . $lang['forum_desc'] . '</label> ';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_add_comment'] . ':</label></span>';
- echo '<label for="addfieldposition_0"><input type="radio" name="addfieldposition" value="0" id="addfieldposition_0" ' . ($addfieldposition == 0 ? ' checked' : '') . '/>' . $lang['srv_polozaj_bottom'] . '</label> ';
- echo '<label for="addfieldposition_1"><input type="radio" name="addfieldposition" value="1" id="addfieldposition_1" ' . ($addfieldposition == 1 ? ' checked' : '') . '/>' . $lang['srv_polozaj_top'] . '</label> ';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_marks'] . ':</label></span>';
- echo '<label for="commentmarks_0"><input type="radio" name="commentmarks" value="0" id="commentmarks_0" ' . ($commentmarks == 0 ? ' checked' : '') . '/>' . $lang['srv_comments_marks_0'] . '</label> ';
- echo '<label for="commentmarks_1"><input type="radio" name="commentmarks" value="1" id="commentmarks_1" ' . ($commentmarks == 1 ? ' checked' : '') . '/>' . $lang['srv_comments_marks_1'] . '</label> ';
- echo '<br/>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comments_marks_who'] . ':</label></span>';
- echo '<label for="commentmarks_who_0"><input type="radio" name="commentmarks_who" value="0" id="commentmarks_who_0" ' . ($commentmarks_who == 0 ? ' checked' : '') . '/>' . $lang['srv_comments_marks_who_1'] . '</label> ';
- echo '<label for="commentmarks_who_1"><input type="radio" name="commentmarks_who" value="1" id="commentmarks_who_1" ' . ($commentmarks_who == 1 ? ' checked' : '') . '/>' . $lang['srv_comments_marks_who_0'] . '</label> ';
- echo '<br>';
- echo '<span class="nastavitveSpan1"><label>' . $lang['srv_comment_history'] . ':</label></span>';
- echo '<select name="comment_history">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['orderby'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="sortpostorder" value="0" id="sortpostorder_0" ' . ($sortpostorder == 0 ? ' checked' : '') . '/>';
+ echo '<label for="sortpostorder_0">' . $lang['forum_asc'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="sortpostorder" value="1" id="sortpostorder_1" ' . ($sortpostorder == 1 ? ' checked' : '') . '/>';
+ echo '<label for="sortpostorder_1">' . $lang['forum_desc'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_add_comment'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="addfieldposition" value="0" id="addfieldposition_0" ' . ($addfieldposition == 0 ? ' checked' : '') . '/>';
+ echo '<label for="addfieldposition_0">' . $lang['srv_polozaj_bottom'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="addfieldposition" value="1" id="addfieldposition_1" ' . ($addfieldposition == 1 ? ' checked' : '') . '/>';
+ echo '<label for="addfieldposition_1">' . $lang['srv_polozaj_top'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_marks'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="commentmarks" value="0" id="commentmarks_0" ' . ($commentmarks == 0 ? ' checked' : '') . '/>';
+ echo '<label for="commentmarks_0">' . $lang['srv_comments_marks_0'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="commentmarks" value="1" id="commentmarks_1" ' . ($commentmarks == 1 ? ' checked' : '') . '/>';
+ echo '<label for="commentmarks_1">' . $lang['srv_comments_marks_1'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comments_marks_who'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="commentmarks_who" value="0" id="commentmarks_who_0" ' . ($commentmarks_who == 0 ? ' checked' : '') . '/>';
+ echo '<label for="commentmarks_who_0">' . $lang['srv_comments_marks_who_1'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="commentmarks_who" value="1" id="commentmarks_who_1" ' . ($commentmarks_who == 1 ? ' checked' : '') . '/>';
+ echo '<label for="commentmarks_who_1">' . $lang['srv_comments_marks_who_0'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['srv_comment_history'] . ':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<select class="dropdown small" name="comment_history">';
echo '<option value="0" '.($comment_history=='0' || $comment_history=='' ? ' selected':'').'>'.$lang['srv_comment_history_1'].'</option>';
echo '<option value="1" '.($comment_history==1 ?' selected':'').'>'.$lang['srv_comment_history_0'].'</option>';
echo '<option value="2" '.($comment_history==2 ?' selected':'').'>'.$lang['srv_comment_history_2'].'</option>';
echo '</select>';
- echo '<br/>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
- echo '<fieldset><legend>' . $lang['srv_delete_comments'] . '</legend>';
- echo '<p><a href="#" onClick="delete_test_data();">'.$lang['srv_delete_comments3'].'</a> ('.$lang['srv_delete_comments_txt2'].')</p>';
- echo '</fieldset>';
+ echo '<p class="delete_comments"><a class="noline" href="#" onClick="delete_test_data();"><span class="faicon trash empty link-right"></span>'.$lang['srv_delete_comments3'].'</a> ('.$lang['srv_delete_comments_txt2'].')</p>';
echo '</div>';
- echo '<br class="clr" />';
}
}
/*Dostop*/
if ($_GET['a'] == 'dostop') {
-
+
// tukaj bom dodal še kontrolo na Avtorja ankete, tako da avtor lahko vedno spreminja dostop (gorazd,1.9.2009)
$stringDostopAvtor = "SELECT count(*) as isAvtor FROM srv_dostop WHERE ank_id = '" . $this->anketa . "' AND (uid='" . $global_user_id . "' OR uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$global_user_id' ))";
$sqlDostopAvtor = sisplet_query($stringDostopAvtor);
@@ -1148,60 +1566,32 @@ class SurveyAdminSettings {
if ($admin_type <= $row['dostop'] || $rowDostopAvtor['isAvtor'] > 0) {
- echo '<fieldset><legend>' . $lang['srv_dostop_users'] . '' . Help :: display('srv_dostop_users'). '</legend>'."\n";
+ echo '<fieldset><legend>' . $lang['srv_dostop_users'] . '' . Help :: display('srv_dostop_users'). '</legend>';
+
+ //Dodajanje dostopa - prikaži vse za admine - potrebuje prenovo
+ /**if($admin_type == 0 || $admin_type == 1){
+ echo '<div class="setting_holder">';
+ echo '<span id="dostop_active_show_1"><a href="#" onClick="dostopActiveShowAll(\'true\'); return false;">'.$lang['srv_dostop_show_all'].'</a></span>';
+ echo '<span id="dostop_active_show_2" class="displayNone"><a href="#" onClick="dostopActiveShowAll(\'false\'); return false;">'.$lang['srv_dostop_hide_all'].'</a></span>';
+ echo '</div>';
+ }**/
- echo '<span id="dostop_active_show_1"><a href="#" onClick="dostopActiveShowAll(\'true\'); return false;">'.$lang['srv_dostop_show_all'].'</a></span>';
- echo '<span id="dostop_active_show_2" class="displayNone"><a href="#" onClick="dostopActiveShowAll(\'false\'); return false;">'.$lang['srv_dostop_hide_all'].'</a></span>';
-
echo '<div id="dostop_users_list">';
$this->display_dostop_users(0);
echo '</div>';
+
+ echo '<div class="button_holder below">';
+ echo '<button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
echo '</fieldset>';
- echo '<br />';
// Dodajanje uproabnikov preko e-maila
echo '<fieldset><legend>'.$lang['srv_dostop_addusers'].'</legend>';
echo '<div id="addmail">';
-
-
- // Dodajanje dostopa
- global $app_settings;
- global $aai_instalacija;
-
- echo '<p class="bold">';
-
- // Admini in managerji lahko dodajo dostop komurkoli
- if($admin_type == 0 || $admin_type == 1){
- echo $lang['srv_dostop_adduserstxt_admin'].' '.$app_settings['app_name'].'. ';
- }
- // Ostali uporabniki lahko dodajo dostop samo ze registriranim uporabnikom
- else{
- echo $lang['srv_dostop_adduserstxt'].' '.$app_settings['app_name'].'! ';
- }
-
- // AAI ima poseben link na help
- if(isset($aai_instalacija) && $aai_instalacija == true){
- echo $lang['srv_dostop_adduserstxt_aai_more'];
- }
-
- echo '</p>';
-
-
- echo '<input type="hidden" name="aktiven" value="1" >';
-
- echo '<p>';
- echo $lang['srv_dostop_adduserstxt_email'].'<br />';
- echo '<textarea name="addusers"></textarea>';
- echo '</p>';
-
- echo '<p>';
- echo $lang['srv_dostop_adduserstxt_note'].'<br />';
- echo '<textarea name="addusers_note"></textarea>';
- echo '</p>';
-
- echo '<p>'.$lang['srv_dostop_adduserstxt_end'].'</p>';
+
+ $this->display_add_survey_dostop();
echo '</div>';
echo '</fieldset>';
@@ -1229,10 +1619,11 @@ class SurveyAdminSettings {
include($file);
- echo '<fieldset class="wide"><legend>'.$lang['srv_extra_translations'].' ';
+ echo '<fieldset><legend>'.$lang['srv_extra_translations'].' ';
+ $lang_id = '';
if ($row['multilang'] == 1) {
- echo ' <select name="lang_id" onchange="window.location.href=\'index.php?anketa='.$this->anketa.'&a=jezik&lang_id=\'+this.value;">';
+ echo ' <select class="dropdown medium w130 inline" name="lang_id" onchange="window.location.href=\'index.php?anketa='.$this->anketa.'&a=jezik&lang_id=\'+this.value;">';
$lang_id = (int)$_GET['lang_id'];
if ($lang_id > 0)
@@ -1253,36 +1644,27 @@ class SurveyAdminSettings {
echo '</legend>';
- if ($row['multilang'] == 1 && $lang_id > 0) {
- //echo '<p><span style="font-size:10px"> <a href="'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].'"><img src="img_0/preview_red.png" /></a> <a href="'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'" target="_blank">'.SurveyInfo::getSurveyLink().'?language='.$lang_id.'</a></p>';
- }
- echo '<p><a href="index.php?anketa='.$this->anketa.'&a=prevajanje">'.$lang['srv_info_language'].'</a></p>';
echo '<div class="standardne_besede">';
echo '<input type="hidden" name="extra_translations" value="1" />'; // da vemo, da nastavljamo ta besedila
+
+ // Tabela standardnih besed
+ echo '<table id="standard_words_table">';
+ echo '<tr>';
- echo '<p><span class="nastavitveSpan1 textleft">&nbsp;</span><span class="nastavitveSpan1 textleft" style="min-width:500px">'.($lang_id>0?$lang['srv_multilang']:$lang['srv_language_respons_1']).':';
-
+ echo '<th>'.($lang_id > 0 ? $lang['srv_language_respons_1'].': '.$resp_lang['language']:$lang['srv_language_admin'].': '.$lang['language']).'</th>';
+ echo '<th>'.$lang['srv_std_second'].': ';
$file = '../../lang/'.$lang_resp.'.php';
include($file);
- echo ' '.$lang['language'].'</span><br></p>';
-
- // nazaj na administrativnega
+ echo $lang['language'].'</th>';
+
+ // nazaj na administrativni jezik
$file = '../../lang/'.$lang_admin.'.php';
include($file);
-
- echo '<p>';
-
- echo '<span class="nastavitveSpan1 textleft">'.($lang_id>0?$lang['srv_language_respons_1'].': '.$resp_lang['language']:$lang['srv_language_admin'].': '.$lang['language']).'</span>';
- echo '<span class="nastavitveSpan1 textleft">'.$lang['srv_std_second'].'';
- echo '</span>';
- echo '<span class="bold">'.$lang['srv_std_translation'].' <a href="'.SurveyInfo::getSurveyLink().'&preview=on&language='.$lang_resp.'" target="_blank"><span class="faicon preview icon-as_link"></span></a></span>';
-
- echo '</p><hr>';
-
- echo '<p>';
+ echo '<th><div class="standardna-beseda-th">'.$lang['srv_std_translation'].'<div class="icon_holder"><a href="'.SurveyInfo::getSurveyLink().'&preview=on&language='.$lang_resp.'" target="_blank"><span class="faicon preview"></span></a></div></div></th>';
+ echo '</tr>';
// jezik nastavimo na nastavitev za respondente, ker ta text dejansko nastavljamo
$file = '../../lang/'.$lang_resp.'.php';
@@ -1334,33 +1716,43 @@ class SurveyAdminSettings {
$this->extra_translation('srv_survey_non_active_notStarted', 1);
$this->extra_translation('srv_survey_non_active_expired', 1);
$this->extra_translation('srv_survey_non_active_voteLimit', 1);
-
-
- echo '</p>';
-
+
// nastavimo jezik nazaj
$file = '../../lang/'.$lang_admin.'.php';
include($file);
-
+
+ echo '</table>';
+
echo '<div>';
-
- echo '</fieldset>';
-
- echo '<br />';
-
+ // Gumb za ponastavitev prevoda v bazi pobriše že nastavljene prevode za izbran jezik
+ echo '<div class="button_holder top16 bottom16">';
+ echo ' <button class="medium white-black" type="button" onclick="ponastavi_prevod(\''.$lang_id.'\')">'.$lang['reset_translation'].'</button>';
+ echo '</div>';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'];
- echo '</span></a></div></span>';
+ // Ta del se v 2. fazi zamenja z gumbom "Večjezične ankete"
+ echo '<div class="setting_holder">';
- // Gumb za ponastavitev prevoda v bazi pobriše že nastavljene prevode za izbran jezik
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray btn_resetsettings" href="#" onclick="ponastavi_prevod(\''.$lang_id.'\')"><span>';
- echo $lang['reset_translation'];
- echo '</span></a></div></span>';
+ echo '<p class="bottom8">'.$lang['srv_language_link2'].':';
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if($userAccess->checkUserAccess($what='prevajanje')){
+ echo '&nbsp;<a href="index.php?anketa='.$this->anketa.'&a=prevajanje" title="'.$lang['srv_language_link'].'"><span class="bold">'.$lang['srv_language_link'].'</span></a></p>';
+ }
+ else{
+ echo '&nbsp;<a href="#" onClick=popupUserAccess(\'prevajanje\'); return false;" title="'.$lang['srv_language_link'].'" class="user_access_locked"><span class="bold">'.$lang['srv_language_link'].'</span></a></p>';
+ }
+ echo '<p>'.$lang['srv_language_mySurveys'].'.</p>';
+
+ echo '</div>';
+ echo '</fieldset>';
- echo '<a href="index.php?anketa='.$this->anketa.'&a=prevajanje" title="'.$lang['lang'].'"><span class="faicon language" style="display:inline-block; margin:2px 8px 0 25px;"></span>'.$lang['lang'].'</a>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
}
/*Forma*/
if ($_GET['a'] == 'forma') {
@@ -1369,40 +1761,125 @@ class SurveyAdminSettings {
/*Nastavitve prikaza za mobilnike*/
if ($_GET['a'] == 'mobile_settings') {
- SurveySetting::getInstance()->Init($this->anketa);
-
- echo '<fieldset class="wide">';
+ SurveySetting::getInstance()->Init($this->anketa);
+ echo '<fieldset>';
- echo '<legend>'.$lang['srv_mobile_settings_title'].'</legend>';
+ echo '<legend>'.$lang['srv_mobile_settings_title'].Help::display('srv_mobilne_tabele').'</legend>';
// Prikaz slik pri mobilnikih (default da)
$mobile_friendly = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_friendly');
- echo '<span class="nastavitveSpan2" >'.$lang['srv_settings_mobile_friendly'].':</span>';
- echo '<label for="mobile_friendly_1"><input type="radio" name="mobile_friendly" id="mobile_friendly_1" '.($mobile_friendly==='1'?' checked':'').' value="1" onClick="$(\'#mobile_settings_other\').show();">'.$lang['yes'].'</label> ';
- echo '<label for="mobile_friendly_0"><input type="radio" name="mobile_friendly" id="mobile_friendly_0" '.($mobile_friendly!=='1'?' checked':'').' value="0" onClick="$(\'#mobile_settings_other\').hide();">'.$lang['no'].'</label> ';
+ echo '<div class="setting_holder '.($mobile_friendly!=='1' ? 'bottom0':'').'" id="mobile_osnovno">';
+
+ echo '<input type="hidden" name="mobile_friendly" value="0">';
+ echo '<input type="checkbox" id="mobile_friendly" name="mobile_friendly" value="1" '.($mobile_friendly == 1 ? ' checked="checked"' : '').' onChange="$(\'#mobile_settings_other\').toggleClass(\'displayNone\');$(\'#mobile_osnovno\').toggleClass(\'bottom0\');">';
+ echo '<label for="mobile_friendly">'. $lang['srv_settings_mobile_friendly'] .'</label> ';
+
+ echo '</div>';
- $display = ($mobile_friendly == 1) ? '' : ' display: none;';
- echo '<div id="mobile_settings_other" style="margin-top: 10px; '.$display.'">';
+ $display = ($mobile_friendly == 1) ? '' : 'displayNone';
+
+ echo '<div class="'.$display.'" id="mobile_settings_other">';
// Prikaz slik pri mobilnikih (default da)
$hide_mobile_img = SurveySetting::getInstance()->getSurveyMiscSetting('hide_mobile_img');
- echo '<span class="nastavitveSpan2" >'.$lang['srv_settings_mobile_img'].':</span>';
- echo '<label for="hide_mobile_img_0"><input type="radio" name="hide_mobile_img" id="hide_mobile_img_0" '.($hide_mobile_img!=='1'?' checked':'').' value="0">'.$lang['yes'].'</label> ';
- echo '<label for="hide_mobile_img_1"><input type="radio" name="hide_mobile_img" id="hide_mobile_img_1" '.($hide_mobile_img==='1'?' checked':'').' value="1">'.$lang['no'].'</label> ';
+ echo '<div class="setting_holder">';
+
+ echo '<input type="hidden" name="hide_mobile_img" value="1">';
+ echo '<input type="checkbox" id="hide_mobile_img" name="hide_mobile_img" value="0" '.($hide_mobile_img!= 1 ? ' checked="checked"' : '').'>';
+ echo '<label for="hide_mobile_img">'. $lang['srv_settings_mobile_img'] .'</label> ';
+
+ echo '</div>';
+
+ // Prilagoditev tabel pri mobilnikih
+ /*$mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title" >'.$lang['srv_settings_mobile_tables'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_1" '.($mobile_tables==='1'?' checked':'').' value="1">';
+ echo '<label for="mobile_tables_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_2" '.($mobile_tables==='2'?' checked':'').' value="2">';
+ echo '<label for="mobile_tables_2">'.$lang['srv_settings_mobile_tables_slide'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_0" '.($mobile_tables==='0'?' checked':'').' value="0">';
+ echo '<label for="mobile_tables_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+
+ echo '</div>';*/
+
+ echo '</div>';
+
+ echo '</fieldset>';
+ }
+
+ /*Nastavitve prikaza za tabele*/
+ if ($_GET['a'] == 'table_settings') {
+
+ SurveySetting::getInstance()->Init($this->anketa);
+
+ echo '<fieldset>';
- echo '<span class="clr"></span>';
+ echo '<legend>'.$lang['srv_table_settings_title'].'</legend>';
+
+
+ // Prilagoditev tabel na pc-ju
+ $pc_tables = SurveySetting::getInstance()->getSurveyMiscSetting('pc_tables');
+
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title" >'.$lang['srv_table_settings_pc_tables'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="pc_tables" id="pc_tables_0" '.($pc_tables==='0'?' checked':'').' value="0">';
+ echo '<label for="pc_tables_0">'.$lang['srv_settings_mobile_tables_0'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="pc_tables" id="pc_tables_1" '.($pc_tables==='1'?' checked':'').' value="1">';
+ echo '<label for="pc_tables_1">'.$lang['srv_settings_mobile_tables_1'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="pc_tables" id="pc_tables_2" '.($pc_tables==='2'?' checked':'').' value="2">';
+ echo '<label for="pc_tables_2">'.$lang['srv_settings_mobile_tables_2'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="pc_tables" id="pc_tables_3" '.($pc_tables==='3'?' checked':'').' value="3">';
+ echo '<label for="pc_tables_3">'.$lang['srv_settings_mobile_tables_3'].'</label> ';
+ echo '</div>';
+ echo '</div>';
+
+
// Prilagoditev tabel pri mobilnikih
$mobile_tables = SurveySetting::getInstance()->getSurveyMiscSetting('mobile_tables');
- echo '<span class="nastavitveSpan2" >'.$lang['srv_settings_mobile_tables'].':</span>';
- echo '<label for="mobile_tables_1"><input type="radio" name="mobile_tables" id="mobile_tables_1" '.($mobile_tables==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="mobile_tables_2"><input type="radio" name="mobile_tables" id="mobile_tables_2" '.($mobile_tables==='2'?' checked':'').' value="2">'.$lang['srv_settings_mobile_tables_slide'].'</label> ';
- echo '<label for="mobile_tables_0"><input type="radio" name="mobile_tables" id="mobile_tables_0" '.($mobile_tables==='0'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
+
+ echo '<div class="setting_holder">';
+
+ echo '<span class="setting_title" >'.$lang['srv_table_settings_mobile_tables'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_0" '.($mobile_tables==='0'?' checked':'').' value="0">';
+ echo '<label for="mobile_tables_0">'.$lang['srv_settings_mobile_tables_0'].'</label> ';
echo '</div>';
-
-
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_1" '.($mobile_tables==='1'?' checked':'').' value="1">';
+ echo '<label for="mobile_tables_1">'.$lang['srv_settings_mobile_tables_1'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_2" '.($mobile_tables==='2'?' checked':'').' value="2">';
+ echo '<label for="mobile_tables_2">'.$lang['srv_settings_mobile_tables_2'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="mobile_tables" id="mobile_tables_3" '.($mobile_tables==='3'?' checked':'').' value="3">';
+ echo '<label for="mobile_tables_3">'.$lang['srv_settings_mobile_tables_3'].'</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
+
echo '</fieldset>';
}
@@ -1416,60 +1893,78 @@ class SurveyAdminSettings {
$referal = SurveySetting::getInstance()->getSurveyMiscSetting('survey_referal');
$date = SurveySetting::getInstance()->getSurveyMiscSetting('survey_date');
+ $ip = $ip == '' ? 0 : $ip;
+ $ip_show = $ip_show == '' ? 0 : $ip_show;
+ $browser = $browser == '' ? 0 : $browser;
+ $referal = $referal == '' ? 0 : $referal;
+ $date = $date == '' ? 0 : $date;
- echo '<fieldset class="wide">';
+
+ echo '<fieldset>';
echo '<legend>'.$lang['srv_sledenje'].'</legend>';
// Preverimo ce je vklopljen modul za volitve - potem ne pustimo nobenih preklopov
$voting_disabled = '';
- $voting_disabled_class = '';
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
$voting_disabled = ' disabled';
- $voting_disabled_class = ' class="gray"';
- echo '<p class="red">'.$lang['srv_voting_warning_paradata'].'</p>';
+ echo '<p class="red">'.$lang['srv_voting_warning_paradata'].'</p><br>';
}
- echo '<p>'.$lang['srv_metadata_desc'].'</p>';
-
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_browser'].':</label></span>';
- echo ' <label for="survey_browser_1" '.$voting_disabled_class.'><input type="radio" name="survey_browser" id="survey_browser_1" value="1"'.($browser==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="survey_browser_0" '.$voting_disabled_class.'><input type="radio" name="survey_browser" id="survey_browser_0" value="0"'.($browser==0?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label><br class="clr"/>';
-
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_referal'].':</label></span>';
- echo ' <label for="survey_referal_1" '.$voting_disabled_class.'><input type="radio" name="survey_referal" id="survey_referal_1" value="1"'.($referal==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="survey_referal_0" '.$voting_disabled_class.'><input type="radio" name="survey_referal" id="survey_referal_0" value="0"'.($referal==0?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label><br class="clr"/>';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_metadata_desc'].'</p>';
+ echo '</div>';
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_date'].':</label></span>';
- echo ' <label for="survey_date_1" '.$voting_disabled_class.'><input type="radio" name="survey_date" id="survey_date_1" value="1"'.($date==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="survey_date_0" '.$voting_disabled_class.'><input type="radio" name="survey_date" id="survey_date_0" value="0"'.($date==0?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label><br class="clr"/>';
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_browser" value="1">';
+ echo '<input type="checkbox" id="survey_browser" name="survey_browser" value="0" '.($browser==0? ' checked':'').' '.$voting_disabled.'>';
+ echo '<label for="survey_browser">'. $lang['srv_sledenje_browser'] .'</label> ';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_referal" value="1">';
+ echo '<input type="checkbox" id="survey_referal" name="survey_referal" value="0" '.($referal==0? ' checked':'').' '.$voting_disabled.'>';
+ echo '<label for="survey_referal">'. $lang['srv_sledenje_referal'] .'</label> ';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_date" value="1">';
+ echo '<input type="checkbox" id="survey_date" name="survey_date" value="0" '.($date==0? ' checked':'').' '.$voting_disabled.'>';
+ echo '<label for="survey_date">'. $lang['srv_sledenje_date'] .'</label> ';
+ echo '</div>';
+
echo '</fieldset>';
-
- echo '<br />';
-
-
echo '<fieldset>';
echo '<legend>'.$lang['srv_sledenje_ip_title'].'</legend>';
-
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_ip'].':</label></span>';
- echo ' <label for="survey_ip_1" '.$voting_disabled_class.'><input type="radio" name="survey_ip" id="survey_ip_1" value="1"'.($ip==1?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="survey_ip_0" '.$voting_disabled_class.'><input type="radio" name="survey_ip" id="survey_ip_0" value="0"'.($ip==0?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label>';
-
- if($ip == 0 && $ip_show != 1)
- echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_sledenje_ip_alert'].'</div>';
-
- echo '<br class="clr"/>';
-
- if($ip == 0 && ($admin_type == 0 || $admin_type == 1)){
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_show_ip'].':</label></span>';
- echo ' <label for="survey_show_ip_0" '.$voting_disabled_class.'><input type="radio" name="survey_show_ip" id="survey_show_ip_0" value="0"'.($ip_show==0?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="survey_show_ip_1" '.$voting_disabled_class.'><input type="radio" name="survey_show_ip" id="survey_show_ip_1" value="1"'.($ip_show==1?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label>';
-
- if($ip_show == 1)
- echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_show_ip_alert'].'</div>';
+
+ //Shranjuj IP naslov respondenta
+ echo '<div class="setting_holder '.(($ip == 0) ? '' : ' bottom0').'" id="save_IP">';
+ echo '<input type="hidden" name="survey_ip" value="1">';
+ echo '<input type="checkbox" id="survey_ip" name="survey_ip" value="0" '.($ip==0? ' checked':'').' '.$voting_disabled.' onChange="toggleParapodatki();">';
+ echo '<label for="survey_ip">'. $lang['srv_sledenje_ip'] .'</label> ';
+ echo '</div>';
+
+ echo '<div class=" '.(($ip == 1 && $ip_show == 0) ? 'displayNone' : '').'" id="save_IP_warning">';
+ echo '<p class="red">'.$lang['srv_sledenje_ip_alert'].'</p><br>';
+ echo '</div>';
+
+ //Poveži IP v bazi s podatki
+ if ($admin_type == 0 || $admin_type == 1){
+ echo '<div class="'.(($ip == 0) ? '' : ' displayNone').'" id="connect_IP">';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="survey_show_ip" value="0">';
+ echo '<input type="checkbox" id="survey_show_ip" name="survey_show_ip" value="1" '.($ip_show==1? ' checked':'').' '.$voting_disabled.' onChange="toggleParapodatki();">';
+ echo '<label for="survey_show_ip">'. $lang['srv_show_ip'] .'</label> ';
+ echo '</div>';
+
+ echo '<div class=" '.(($ip_show == 1) ? '' : ' displayNone').'" id="connect_IP_warning">';
+ echo '<p class="red">'.$lang['srv_show_ip_alert'].'</p>';
+ echo '</div>';
+
+ echo '</div>';
}
echo '</fieldset>';
@@ -1477,16 +1972,26 @@ class SurveyAdminSettings {
// Povezovanje identifikatorjev s podatki - samo za admine in ce so vklopljena email vabila
if ($admin_type == 0 && SurveyInfo::getInstance()->checkSurveyModule('email')) {
- echo '<br />';
- echo '<fieldset class="wide">';
+ echo '<fieldset>';
echo '<legend>'.$lang['srv_sledenje_identifikatorji_title'].' '.Help::display('srv_email_with_data').'</legend>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_sledenje_identifikatorji'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="show_email" id="show_email_0" value="0"'.($row['show_email']==0?' checked':'').' '.$voting_disabled.' onClick="toggleParapodatki();">';
+ echo '<label for="show_email_0">'.$lang['no'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="show_email" id="show_email_1" value="1"'.($row['show_email']==1?' checked':'').' '.$voting_disabled.' onClick="toggleParapodatki();">';
+ echo '<label for="show_email_1">'.$lang['yes'].'</label>';
+ echo '</div>';
- echo '<span class="nastavitveSpan1 wide"><label>'.$lang['srv_sledenje_identifikatorji'].':</label></span>';
- echo ' <label for="show_email_0" '.$voting_disabled_class.'><input type="radio" name="show_email" id="show_email_0" value="0"'.($row['show_email']==0?' checked':'').' '.$voting_disabled.'>'.$lang['no'].'</label>';
- echo ' <label for="show_email_1" '.$voting_disabled_class.'><input type="radio" name="show_email" id="show_email_1" value="1"'.($row['show_email']==1?' checked':'').' '.$voting_disabled.'>'.$lang['yes'].'</label>';
+ echo '</div>';
- if($row['show_email'] == 1)
- echo '<div class="spaceLeft floatRight red" style="display:inline; width:520px;">'.$lang['srv_show_mail_with_data3'].'</div>';
+ echo '<div class="setting_holder '.(($row['show_email'] == 1) ? '' : ' displayNone').'" id="connect_identifier_warning">';
+ echo '<p class="red">'.$lang['srv_show_mail_with_data3'].'.</p>';
+ echo '</div>';
echo '</fieldset>';
}
@@ -1498,117 +2003,112 @@ class SurveyAdminSettings {
SurveySetting::getInstance()->Init($this->anketa);
// Nastavitve za izpis vprasalnika
- echo '<fieldset class="wide">';
+ echo '<fieldset>';
echo '<legend>'.$lang['srv_export_survey_settings'].'</legend>';
// Številčenje vprašanj (default da)
$export_numbering = SurveySetting::getInstance()->getSurveyMiscSetting('export_numbering');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_nastavitveStevilcenje'].':</span>';
- echo '<label for="export_numbering_1"><input type="radio" name="export_numbering" id="export_numbering_1" '.($export_numbering==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_numbering_0"><input type="radio" name="export_numbering" id="export_numbering_0" '.($export_numbering!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_numbering" value="0">';
+ echo '<input type="checkbox" id="export_numbering" name="export_numbering" value="1" '.($export_numbering==='1'?' checked':'').'>';
+ echo '<label for="export_numbering">'. $lang['srv_nastavitveStevilcenje'] .'</label> ';
+ echo '</div>';
+
// Prikaz pogojev (default da)
$export_show_if = SurveySetting::getInstance()->getSurveyMiscSetting('export_show_if');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_if'].':</span>';
- echo '<label for="export_show_if_1"><input type="radio" name="export_show_if" id="export_show_if_1" '.($export_show_if==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_show_if_0"><input type="radio" name="export_show_if" id="export_show_if_0" '.($export_show_if!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_show_if" value="0">';
+ echo '<input type="checkbox" id="export_show_if" name="export_show_if" value="1" '.($export_show_if==='1'?' checked':'').'>';
+ echo '<label for="export_show_if">'. $lang['srv_export_if'] .'</label> ';
+ echo '</div>';
// Prikazi uvoda (default ne)
$export_show_intro = SurveySetting::getInstance()->getSurveyMiscSetting('export_show_intro');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_intro'].':</span>';
- echo '<label for="export_show_intro_1"><input type="radio" name="export_show_intro" id="export_show_intro_1" '.($export_show_intro==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_show_intro_0"><input type="radio" name="export_show_intro" id="export_show_intro_0" '.($export_show_intro!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="exporexport_show_introt_show_if" value="0">';
+ echo '<input type="checkbox" id="export_show_intro" name="export_show_intro" value="1" '.($export_show_intro==='1'?' checked':'').'>';
+ echo '<label for="export_show_intro">'. $lang['srv_export_intro'] .'</label> ';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
-
// Nastavitve za izpis odgovorov respondentov
- echo '<fieldset class="wide">';
+ echo '<fieldset>';
echo '<legend>'.$lang['srv_export_results_settings'].'</legend>';
-
-/* // Tip izvoza (0->navaden-default, 1->dolg, 2->kratek)
- $export_data_type = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_type');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_displaydata_type'].':</span>';
- echo '<select name="export_data_type" id="export_data_type" >';
- echo ' <option value="0"'.((int)$export_data_type == 0 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type0'] . '</option>';
- echo ' <option value="1"'.((int)$export_data_type == 1 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type1'] . '</option>';
- echo ' <option value="2"'.((int)$export_data_type == 2 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type2'] . '</option>';
- echo '</select>';
- echo Help :: display('displaydata_pdftype'); */
- // Tip izvoza (1->dolg oz. razsirjen, 2->kratek oz. skrcen)
- $export_data_type = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_type');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_displaydata_type'].':</span>';
- echo '<select name="export_data_type" id="export_data_type" >';
- echo ' <option value="2"'.((int)$export_data_type == 2 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type2'] . '</option>';
- echo ' <option value="1"'.((int)$export_data_type == 1 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type1'] . '</option>';
- //echo ' <option value="2"'.((int)$export_data_type == 2 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type2'] . '</option>';
- echo '</select>';
- echo Help :: display('displaydata_pdftype');
-
- echo '<br />';
-
+
// Številčenje vprašanj (default da)
$export_data_numbering = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_numbering');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_nastavitveStevilcenje'].':</span>';
- echo '<label for="export_data_numbering_1"><input type="radio" name="export_data_numbering" id="export_data_numbering_1" '.($export_data_numbering==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_numbering_0"><input type="radio" name="export_data_numbering" id="export_data_numbering_0" '.($export_data_numbering!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_numbering" value="0">';
+ echo '<input type="checkbox" id="export_data_numbering" name="export_data_numbering" value="1" '.($export_data_numbering==='1'?' checked':'').'>';
+ echo '<label for="export_data_numbering">'. $lang['srv_nastavitveStevilcenje'] .'</label> ';
+ echo '</div>';
+
// Prikaz recnuma (default da)
$export_data_show_recnum = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_show_recnum');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_show_recnum'].':</span>';
- echo '<label for="export_data_show_recnum_1"><input type="radio" name="export_data_show_recnum" id="export_data_show_recnum_1" '.($export_data_show_recnum==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_show_recnum_0"><input type="radio" name="export_data_show_recnum" id="export_data_show_recnum_0" '.($export_data_show_recnum!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_show_recnum" value="0">';
+ echo '<input type="checkbox" id="export_data_show_recnum" name="export_data_show_recnum" value="1" '.($export_data_show_recnum==='1'?' checked':'').'>';
+ echo '<label for="export_data_show_recnum">'. $lang['srv_export_show_recnum'] .'</label> ';
+ echo '</div>';
+
// Prikaz pogojev (default da)
$export_data_show_if = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_show_if');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_if'].':</span>';
- echo '<label for="export_data_show_if_1"><input type="radio" name="export_data_show_if" id="export_data_show_if_1" '.($export_data_show_if==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_show_if_0"><input type="radio" name="export_data_show_if" id="export_data_show_if_0" '.($export_data_show_if!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_show_if" value="0">';
+ echo '<input type="checkbox" id="export_data_show_if" name="export_data_show_if" value="1" '.($export_data_show_if==='1'?' checked':'').'>';
+ echo '<label for="export_data_show_if">'. $lang['srv_export_if'] .'</label> ';
+ echo '</div>';
+
// Page break med posameznimi respondenti (default ne)
$export_data_PB = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_PB');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_pagebreak'].':</span>';
- echo '<label for="export_data_PB_1"><input type="radio" name="export_data_PB" id="export_data_PB_1" '.($export_data_PB==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_PB_0"><input type="radio" name="export_data_PB" id="export_data_PB_0" '.($export_data_PB!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_PB" value="0">';
+ echo '<input type="checkbox" id="export_data_PB" name="export_data_PB" value="1" '.($export_data_PB==='1'?' checked':'').'>';
+ echo '<label for="export_data_PB">'. $lang['srv_export_pagebreak'] .'</label> ';
+ echo '</div>';
+
// Izpusti vprasanja brez odgovora (default ne)
$export_data_skip_empty = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_skip_empty'].':</span>';
- echo '<label for="export_data_skip_empty_1"><input type="radio" name="export_data_skip_empty" id="export_data_skip_empty_1" '.($export_data_skip_empty==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_skip_empty_0"><input type="radio" name="export_data_skip_empty" id="export_data_skip_empty_0" '.($export_data_skip_empty!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_skip_empty" value="0">';
+ echo '<input type="checkbox" id="export_data_skip_empty" name="export_data_skip_empty" value="1" '.($export_data_skip_empty==='1'?' checked':'').'>';
+ echo '<label for="export_data_skip_empty">'. $lang['srv_export_skip_empty'] .'</label> ';
+ echo '</div>';
+
// Izpusti podvprasanja brez odgovora (default ne)
$export_data_skip_empty_sub = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty_sub');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_skip_empty_sub'].':</span>';
- echo '<label for="export_data_skip_empty_sub_1"><input type="radio" name="export_data_skip_empty_sub" id="export_data_skip_empty_sub_1" '.($export_data_skip_empty_sub==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_skip_empty_sub_0"><input type="radio" name="export_data_skip_empty_sub" id="export_data_skip_empty_sub_0" '.($export_data_skip_empty_sub!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> ';
-
- echo '<br />';
-
- // Landscape postavitev izvoza (default ne)
-/* $export_data_landscape = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_landscape');
- echo '<span class="nastavitveSpan1" >'.$lang['srv_export_landscape'].':</span>';
- echo '<label for="export_data_landscape_1"><input type="radio" name="export_data_landscape" id="export_data_landscape_1" '.($export_data_landscape==='1'?' checked':'').' value="1">'.$lang['yes'].'</label> ';
- echo '<label for="export_data_landscape_0"><input type="radio" name="export_data_landscape" id="export_data_landscape_0" '.($export_data_landscape!=='1'?' checked':'').' value="0">'.$lang['no'].'</label> '; */
-
+ echo '<div class="setting_holder">';
+ echo '<input type="hidden" name="export_data_skip_empty_sub" value="0">';
+ echo '<input type="checkbox" id="export_data_skip_empty_sub" name="export_data_skip_empty_sub" value="1" '.($export_data_skip_empty_sub==='1'?' checked':'').'>';
+ echo '<label for="export_data_skip_empty_sub">'. $lang['srv_export_skip_empty_sub'] .'</label> ';
+ echo '</div>';
+
+ // Tip izvoza (1->dolg oz. razsirjen, 2->kratek oz. skrcen)
+ echo '<div class="setting_holder">';
+ $export_data_type = SurveySetting::getInstance()->getSurveyMiscSetting('export_data_type');
+ echo '<label for="export_data_type">'.$lang['srv_displaydata_type'];
+ echo Help :: display('displaydata_pdftype');
+ echo ':</label>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_data_type" id="export_data_type2" '.((int)$export_data_type == 2 ? ' checked':'').' value="2">';
+ echo '<label for="export_data_type2">'.$lang['srv_displaydata_type2'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_data_type" id="export_data_type1" '.((int)$export_data_type == 1 ?' checked':'').' value="1">';
+ echo '<label for="export_data_type1">'.$lang['srv_displaydata_type1'].'</label> ';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
}
@@ -1620,18 +2120,17 @@ class SurveyAdminSettings {
}
- if ($_GET['a'] != 'jezik' && $_GET['a'] != 'trajanje' && $_GET['a'] != A_GDPR) {
- //echo ' <p><a href="index.php?anketa='.$this->anketa.'&a=prestevilci">'.$lang['srv_prestevilci'].'</a></p>';
- echo '<br class="clr" />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
- //echo '<img src="icons/icons/disk.png" alt="" vartical-align="middle" />';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ if ($_GET['a'] != 'jezik' && $_GET['a'] != 'trajanje' && $_GET['a'] != A_GDPR && $_GET['a'] != 'dostop') {
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo '</form>';
@@ -1683,7 +2182,7 @@ class SurveyAdminSettings {
echo '<p><label>'.$lang['srv_email_setting_from'].'<span>'.$enkaSettings['SMTPFrom'].'</span><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'"></label>';
echo '</p>';
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
+ echo '<p><label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
echo '</p>';
echo '</div>';
@@ -1694,7 +2193,7 @@ class SurveyAdminSettings {
echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom1" value="'.$enkaSettings['SMTPFrom'].'"></label>';
echo '</p>';
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
+ echo '<p><label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
echo '</p>';
#Password
echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
@@ -1711,7 +2210,7 @@ class SurveyAdminSettings {
echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'"></label>';
echo '</p>';
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
+ echo '<p><label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'<input type="text" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
echo '</p>';
#Username
echo '<p><label>'.$lang['srv_email_setting_username'].'<input type="text" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'" ></label>';
@@ -1749,7 +2248,6 @@ class SurveyAdminSettings {
echo '</form>';
echo '</fieldset>';
- echo '<br class="clr" />';
echo '<span id="send_mail_mode_test" class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;"><span>';
echo $lang['srv_email_setting_btn_test'].'</span></a></div></span>';
echo '<span class="floatLeft spaceRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
@@ -1763,14 +2261,10 @@ class SurveyAdminSettings {
echo '</div>';
}
- echo '<br class="clr" />';
-
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
-
-
}
/**
@@ -1782,7 +2276,7 @@ class SurveyAdminSettings {
global $admin_lang;
global $resp_lang;
- $lang_id = (int)$_GET['lang_id'];
+ $lang_id = isset($_GET['lang_id']) ? (int)$_GET['lang_id'] : '';
if ($lang_id > 0)
$lang_id = '_'.$lang_id;
else
@@ -1799,28 +2293,57 @@ class SurveyAdminSettings {
if($text == 'srv_nextpage_uvod')
$next_uvod = $lang_id == '' ? $admin_lang['srv_nextpage_uvod_desc'] : $resp_lang['srv_nextpage_uvod_desc'];
- echo '<div class="standardna-beseda"><span class="nastavitveSpan1 gray textleft">'.($lang_id==''?$admin_lang[$text]:$resp_lang[$text]).' '.($text == 'srv_nextpage_uvod' ? '<span class="gray italic">('.$next_uvod.')</span>' : '').'</span> ';
- echo '<span class="nastavitveSpan1 textleft textItalic">'.$lang[$text].' </span>';
- echo '<div contentEditable="true" class="standardna-beseda-urejanje" name="srvlang_'.$text.$lang_id.'" id="srvlang_'.$text.$lang_id.'">'.$value.'</div>';
-
+ echo '<tr>';
+ echo '<td>'.($lang_id==''?$admin_lang[$text]:$resp_lang[$text]).' '.($text == 'srv_nextpage_uvod' ? ' ('.$next_uvod.')' : '').'</td> ';
+ echo '<td>'.$lang[$text].'</td>';
+ echo '<td><div class="standardna-beseda"><div contentEditable="true" class="standardna-beseda-urejanje" name="srvlang_'.$text.$lang_id.'" id="srvlang_'.$text.$lang_id.'">'.$value.'</div>';
+
if($editor == 1)
- echo '<span class="faicon edit2 sb-edit"'.$onclick.' style="float:right; margin-top:1px; display:none;"></span>';
-
+ echo '<span class="faicon edit-vprasanje sb-edit blue"'.$onclick.' style="display:none;"></span>';
+
echo '<textarea name="srvlang_'.$text.$lang_id.'" id="polje_srvlang_'.$text.$lang_id.'" style="display:none;">'.$value.'</textarea>';
+ echo '</div></td>';
- echo '</div>';
+ echo '</tr>';
}
function anketa_nice_links () {
+ global $lang;
echo '<div id="anketa_edit">';
+
+ echo '<fieldset><legend>'.$lang['srv_nice_url'].'</legend>';
$sql = sisplet_query("SELECT l.link, a.id, a.naslov FROM srv_nice_links l, srv_anketa a WHERE a.id=l.ank_id ORDER BY l.link ASC");
- while ($row = mysqli_fetch_array($sql)) {
- echo '<p><strong style="display:inline-block; width:300px;">'.$row['link'].'</strong> <a href="index.php?anketa='.$row['id'].'&a=vabila&m=url">'.$row['naslov'].'</a></p>';
+ $table_exists = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ if ($table_exists == 0) {
+ echo '<p class="bottom16">'.$lang['srv_nice_url_note'].'</p>';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+ echo '<table>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_nice_url_extension'].'</th>';
+ echo '<th>'.$lang['srv_nice_url_surveyname'].'</th>';
+ echo '</tr>';
+
+ $table_exists = 1;
+ }
+
+ echo '<tr>';
+ echo '<td>'.$row['link'].'</td>';
+ echo '<td><a href="index.php?anketa='.$row['id'].'&a=vabila">'.$row['naslov'].'</a></td>';
+ echo '</tr>';
+ }
+
+ if ($table_exists == 1){
+ echo '</table>';
+ echo '</div>';
+ echo '</div>';
}
-
+
+ echo '</fieldset>';
echo '</div>';
}
@@ -1851,14 +2374,44 @@ class SurveyAdminSettings {
global $lang;
echo '<div id="anketa_edit">';
+
+ echo '<fieldset><legend>'.$lang['srv_anketa_deleted'].'</legend>';
$sql = sisplet_query("SELECT srv_anketa.id, srv_anketa.naslov, users.email FROM srv_anketa, users WHERE users.id=srv_anketa.insert_uid AND active='-1' ORDER BY edit_time DESC");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
-
- while ($row = mysqli_fetch_array($sql)) {
- echo '<p><strong style="display:inline-block; width:300px;"><a href="index.php?anketa='.$row['id'].'">'.$row['naslov'].'</a></strong> <span style="display:inline-block; width:300px;">('.$row['email'].')</span> <a href="#" onclick="anketa_restore(\''.$row['id'].'\'); return false;">'.$lang['srv_restore'].'</a></p>';
+
+
+ $table_exists = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ if ($table_exists == 0) {
+ echo '<p class="bottom16">'.$lang['srv_anketa_deleted_note'].'</p>';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+ echo '<table>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_data_deleted_surveyname'].'</th>';
+ echo '<th class="nowrap">'.$lang['srv_data_deleted_user'].'</th>';
+ echo '<th></th>';
+ echo '</tr>';
+
+ $table_exists = 1;
+ }
+
+ echo '<tr>';
+ echo '<td><a href="index.php?anketa='.$row['id'].'">'.$row['naslov'].'</a></td>';
+ echo '<td>'.$row['email'].'</td>';
+ echo '<td><button class="table white-black caps" type="button" onclick="anketa_restore(\''.$row['id'].'\'); return false;">'.$lang['srv_anketa_deleted_restore'].'</button></td>';
+ echo '</tr>';
}
+
+ if ($table_exists == 1){
+ echo '</table>';
+ echo '</div>';
+ echo '</div>';
+ }
+
+ echo '</fieldset>';
echo '</div>';
}
@@ -1870,14 +2423,39 @@ class SurveyAdminSettings {
global $lang;
echo '<div id="anketa_edit">';
-
+
+ echo '<fieldset><legend>'.$lang['srv_data_deleted'].'</legend>';
+
$sql = sisplet_query("SELECT a.id, a.naslov, users.email, COUNT(u.id) AS deleted FROM srv_anketa a, srv_user u, users WHERE u.deleted='1' AND u.ank_id=a.id AND users.id=a.insert_uid GROUP BY a.id ORDER BY edit_time DESC");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
- while ($row = mysqli_fetch_array($sql)) {
- echo '<p><strong style="display:inline-block; width:300px;"><a href="index.php?anketa='.$row['id'].'">'.$row['naslov'].'</a></strong> <span style="display:inline-block; width:300px;">('.$row['email'].')</span> <a href="#" onclick="data_restore(\''.$row['id'].'\'); return false;">'.$lang['srv_restore'].'</a> ('.$row['deleted'].')</p>';
+ $table_exists = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ if ($table_exists == 0) {
+ echo '<p class="bottom16">'.$lang['srv_data_deleted_note'].'</p>';
+ echo '<table>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_data_deleted_surveyname'].'</th>';
+ echo '<th class="nowrap">'.$lang['srv_data_deleted_user'].'</th>';
+ echo '<th class="nowrap">'.$lang['srv_data_deleted'].'</th>';
+ echo '<th></th>';
+ echo '</tr>';
+
+ $table_exists = 1;
+ }
+
+ echo '<tr>';
+ echo '<td><a href="index.php?anketa='.$row['id'].'">'.$row['naslov'].'</a></td>';
+ echo '<td>'.$row['email'].'</td>';
+ echo '<td class="right">'.$row['deleted'].'</td>';
+ echo '<td><button class="table white-black caps" type="button" onclick="data_restore(\''.$row['id'].'\'); return false;">'.$lang['srv_data_deleted_restore'].'</button></td>';
+ echo '</tr>';
}
+
+ if ($table_exists == 1)
+ echo '</table>';
+ echo '</fieldset>';
echo '</div>';
}
@@ -1889,455 +2467,303 @@ class SurveyAdminSettings {
function anketa_vabila() {
global $lang;
- if ($_GET['m'] == '' || $_GET['m'] == 'settings') {
+ if ($_GET['a'] == A_VABILA) {
$this->anketa_vabila_nastavitve();
- } elseif ($_GET['m'] == 'url') {
- $this->anketa_vabila_url();
+ }
+ elseif ($_GET['a'] == A_OTHER_INV) {
+ $this->anketa_vabila_drugo();
}
}
function anketa_vabila_nastavitve() {
global $lang, $site_url, $global_user_id;
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
$d = new Dostop();
-
- echo '<table id="tbl_inv_setting" style="width:100%">';
- echo '<colgroup>';
- echo '<col style="width:30%;" valign="top"/>';
- echo '<col style="width:70%;" valign="top"/>';
- echo '</colgroup>';
-
- echo '<tr>';
-
- # če ni aktivna damo opozorilo
- echo '<td style="height: 50px;">';
-
+
# Opozorilo o napakah
- $sd = new SurveyDiagnostics($this->anketa);
- $sd->doDiagnostics();
- $diagnostic = $sd->getDiagnostic();
- if (is_array($diagnostic) && count($diagnostic) > 0)
- echo '<div id="anketa_diagnostika_note2">'.$lang['srv_publication_survey_warnings'].' <a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_TESTIRANJE.'" class="bold">>></a></div>';
+ $this->survey_errors();
+
+ # Opozorilo - anketa ni aktivna
+ $this->activation_error();
+
+ // Delite povezavo do ankete
+ echo '<div class="title">'.$lang['srv_publication_survey_links'].'</div>';
+
+ //echo '<p class="bottom16">'.$lang['srv_publication_survey_links_note'].'</p>';
- // Aktivacija ankete
- echo '<span id="anketa_aktivacija_note" '.($row['active']==0?' class="google_yellow"':'').'>';
- $this->anketa_aktivacija_note();
- echo'</span>';
-
- echo '</td>';
-
- # Povezave, lepi linki...
- echo '<td style="padding-left:15px;" rowspan="2">';
- # Linki, lepi linki
- $this->niceUrlSettings();
+ //Lep URL - dodajanje
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess($what='nice_url')){
- echo '<br />';
+ echo '<div class="button_holder">';
+
+ echo ' <div class="copy_survey_url_holder">';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span><span class="italic"></span>';
+ echo ' <a href="'.SurveyInfo::getRawSurveyLink().'">'.SurveyInfo::getRawSurveyLink().'</a>';
+ echo ' </div>';
+ echo ' <button type="button" class="medium blue" onclick="CopyToClipboard(\''.SurveyInfo::getRawSurveyLink().'\'); actionNotePopup(\'link_copied\', \'success\');">
+ <span class="faicon copy link-right"></span>'.$lang['srv_diagnostika_testiranje_copy_url'].'</button>';
+ echo ' </div>';
+
+ /* echo ' <button type="button" class="medium yellow">'.$lang['srv_nice_url_add'].'</button>'; */
+ echo ' <button type="button" class="medium yellow niceurl">'.$lang['srv_nice_url_add'].'<span class="faicon lock_close"></span></button>';
+
+ echo '</div>';
+ }
+ else{
+
+ echo '<div class="button_holder">';
+
+ echo ' <div class="copy_survey_url_holder">';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span><span class="italic"></span>';
+ echo ' <a href="'.SurveyInfo::getRawSurveyLink().'">'.SurveyInfo::getRawSurveyLink().'</a>';
+ echo ' </div>';
+ echo ' <button type="button" class="medium blue" onclick="CopyToClipboard(\''.SurveyInfo::getRawSurveyLink().'\'); actionNotePopup(\'link_copied\', \'success\');">
+ <span class="faicon copy"></span>'.$lang['srv_diagnostika_testiranje_copy_url'].'</button>';
+ echo ' </div>';
+
+ // Gumb za dodajanje lepega linka
+ echo ' <button id="nice_url_button" type="button" class="medium white-blue niceurl" onclick="publishPopupOpen(\'add_url\');">'.$lang['srv_nice_url_add'].'</button>';
+
+ echo '</div>';
+
+
+ if (isset($_GET['error'])) {
+
+ $error = $_GET['error'];
+
+ /* ?><script type="text/javascript">
+ toggleNiceURL('show');
+ </script><?php */
+
+ echo '<div id="nice_url_error">';
+
+ // Prekratek lep url
+ if(strlen($error) <= 2)
+ echo '<p class="red"><span class="bold">'.$error.'</span> '.$lang['srv_nice_url_short'].'</p>';
+ // Predolg lep url
+ elseif(strlen($error) > 20)
+ echo '<p class="red"><span class="bold">'.$error.'</span> '.$lang['srv_nice_url_long'].'</p>';
+ // Ze obstaja
+ else
+ echo '<p class="red"><span class="bold">'.$error.'</span> '.$lang['srv_nice_url_taken'].'</p>';
+
+ echo '</div>';
+ }
+
+ }
+
+ // Zlistamo nice URL, povezave za skupine in jezike
+ $this->niceUrlSettings();
- // Napredne URL povezave
- echo '<div style="background-color:#EFF2F7; padding:5px 10px;">';
- //echo '<span class="strong">'.$lang['srv_publication_advanced_url'].'</span>';
- echo '<div class="buttonwrapper" style="margin:10px 0; height:25px;"><a class="ovalbutton floatLeft" title="'.$lang['srv_publication_advanced_url'].'" href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_VABILA . '&m=url">'.$lang['srv_publication_advanced_url'].'</a></div>';
- echo '<p>'.$lang['srv_publication_advanced_url_text'].'</p>';
+ // Spodnji kvadratki
+ // Več načinov deljenja ankete
+ echo '<div class="divider_line"></div>';
+
+ echo '<div class="more">';
+
+ // Vabila
+ echo '<div class="more_block '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').'" onclick="window.location.href=\'index.php?anketa=' . $this->anketa . '&a=invitations\'">';
+ echo '<div class="more_title">';
+ echo '<div class="more_title_icon"><span class="faicon inv_sent_1 empty"></span></div>';
+ echo $lang['srv_publication_invitations'];
+ if(!$userAccess->checkUserAccess('arhivi')) echo '<span class="faicon lock_close"></span>';
+ echo '</div>';
echo '</div>';
-
- echo '<br />';
-
- // Individualizirana vabila
- echo '<div style="background-color:#EFF2F7; padding:5px 10px;">';
- //echo '<span class="strong">'.$lang['srv_publication_invitations'].'</span>';
- echo '<div class="buttonwrapper" style="margin:10px 0; height:25px;"><a class="ovalbutton floatLeft" title="'.$lang['srv_publication_invitations'].'" href="index.php?anketa=' . $this->anketa . '&amp;a=invitations">'.$lang['srv_publication_invitations'].'</a></div>';
- echo '<p>'.$lang['srv_publication_invitations_text'].'</p>';
+
+ // Drugi nacini
+ echo '<div class="more_block" onclick="window.location.href=\'index.php?anketa=' . $this->anketa . '&a=other_inv\'">';
+ echo '<div class="more_title">';
+ echo '<div class="more_title_icon"><span class="faicon qrcode"></span></div>';
+ echo $lang['srv_publication_survey_more'];
+ echo '</div>';
echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+
- echo '</td>';
- /* # Opozorilo o napakah
- echo '<td style="padding-left:15px;">';
- $sd = new SurveyDiagnostics($this->anketa);
- $sd->doDiagnostics();
- $diagnostic = $sd->getDiagnostic();
- if (is_array($diagnostic) && count($diagnostic) > 0) {
- echo '<span id="anketa_diagnostika_note">';
- $this->anketa_diagnostika_note($sd, $d->checkDostopSub('test'));
- echo'</span>';
- }
- echo '</td>';*/
-
- echo '</tr>';
-
- echo '<tr>';
-
- echo '<td>';
- echo '<input type="hidden" value="' . $this->anketa . '" name="anketa" >';
-
- $base_url = $site_url.'admin/survey/index.php?anketa='.$this->anketa;
- # preberomo osnovne nastavitve
+ echo '</div>';
+ }
+
+ # Opozorilo - anketa ni aktivna
+ private function activation_error(){
+ global $lang;
+
$row = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<fieldset><legend>'.($row['active']==0 ? $lang['srv_default_setting_unactive'] : $lang['srv_default_setting']).'</legend>';
-
- // Ce imamo dostop do zavihka urejanje
- if($d->checkDostopSub('edit')){
-
- # Trajanje
- $starts = explode('-',$row['starts']);
- $starts = $starts[2].'.'.$starts[1].'.'.$starts[0];
- $expire = explode('-',$row['expire']);
- $expire = $expire[2].'.'.$expire[1].'.'.$expire[0];
- echo '<p>'.$lang['srv_starts'].':<a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_info_duration'].'"><span class="qs_data as_link">'.$starts.'</span></a></p>';
- if ( $row['expire'] == PERMANENT_DATE ) {
- #trajna
- echo '<p>'.$lang['srv_trajna_anketa'].':<a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_trajna_anketa'].'"><span class="qs_data as_link">'.($row['expire'] == PERMANENT_DATE ? $lang['yes'] : $lang['no']).'</span></a></p>';
- } else {
- echo '<p>'.$lang['srv_expire'].':<a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_info_duration'].'"><span class="qs_data as_link">'.$expire.'</span></a></p>';
- }
-
- // Skin ankete
- if ($row['skin_profile'] == 0) {
- $skin_name = $row['skin'];
- }
- else {
- $sqla = sisplet_query("SELECT name FROM srv_theme_profiles WHERE id = '".$row['skin_profile']."'");
- $rowa = mysqli_fetch_array($sqla);
- $skin_name = $rowa['name'];
- }
- //echo '<p>'.$lang['srv_themes'].':<a href="'.$base_url.'&a='.A_TEMA.'&f=vabila_settings" title="'.$lang['srv_themes'].'"><span class="qs_data as_link">'.$row['skin'].'</span></a></p>';
- echo '<p>'.$lang['srv_themes'].':<a href="'.$base_url.'&a='.A_TEMA.'" title="'.$lang['srv_themes'].'"><span class="qs_data as_link">'.$skin_name.'</span></a></p>';
+
+ if ($row['active']==0) {
+ echo '<div class="top_note one_liner">';
+ //echo ' <div class="title">';
+ //echo ' <span class="faicon warning"></span> '.$lang['srv_publication_survey_noactive'];
+ //echo ' </div>';
+ //echo '<p class="bottom16">'.$lang['srv_publication_survey_noactive_note'].'</p>';
+
+
+ echo '<div class="top_note_activate">';
- # Jezik
- $lang_old = $lang;
- $lang_admin = (int)$row['lang_admin'];
- $lang_resp = (int)$row['lang_resp'];
- $lang_array = array();
- $lang_array[0] = $lang['srv_language_not_set'];
- // Preberemo razpoložljive jezikovne datoteke
- if ($dir = opendir('../../lang')) {
- while (($file = readdir($dir)) !== false) {
- if ($file != '.' AND $file != '..') {
- if (is_numeric(substr($file, 0, strpos($file, '.')))) {
- $i = substr($file, 0, strpos($file, '.'));
- $file = '../../lang/'.$i.'.php';
- if (file_exists($file)) {
- include($file);
- $lang_array[$i] = $lang['language'];
- }
- }
+ //echo '<p class="semi-bold">'.$lang['srv_anketa_noactive2'].'</p>';
+ echo '<span class="faicon warning"></span><p>'.$lang['srv_publication_survey_noactive_note3'].'</p>';
+
+ //Toggle kopiran iz headerja
+ if (SurveyInfo::getSurveyColumn('active') == 1) {
+
+ # anketa je aktivna
+ # V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije
+ if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
+ if ($hierarhija_type == 1) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ }
+ else{
+ echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_active'] . '" style="cursor:text !important;">';
}
}
- }
-
- // nastavimo jezik nazaj
- /*$file = '../../lang/'.$lang_admin.'.php';
- if (file_exists($file)) {
- include($file);
- }*/
- $lang = $lang_old;
- $resp_change_lang = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang');
- //echo '<p>'.$lang['srv_language_admin_1'].':</p>';
- echo '<p>'.$lang['srv_language_admin_0'].':<a href="'.$base_url.'&a='.A_JEZIK.'&f=vabila_settings" title="'.$lang['srv_language_admin_1'].'"><span class="qs_data as_link">'.$lang_array[$lang_admin].'</span></a> / <a href="'.$base_url.'&a='.A_JEZIK.'&f=vabila_settings" title="'.$lang['srv_language_respons_1'].'"><span class="qs_data as_link">'.$lang_array[$lang_resp].'</span></a></p>';
-
- #obveščanje
-
- // jezikovni linki
- $p = new Prevajanje($this->anketa);
- $p->dostop();
- $jeziki = $p->get_all_translation_langs();
- if (count($jeziki) > 0) {
- echo '<p>' . $lang['srv_trans_lang'] . ': ';
- $i = 0;
- foreach ($jeziki AS $key => $val) {
- if ($i++ != 0) echo ', ';
- echo '<a href="'.$link.'?anketa='.$this->anketa.'&a=prevajanje&lang_id='.$key.'" target="_blank">'.$val.'</a>';
+ else {
+ echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this->anketa . '\',\'' . $row['active'] . '\'); return false;" title="' . $lang['srv_anketa_active'] . '">';
}
- echo '</p>';
- }
- #piškotki
- echo '<p>'.$lang['srv_cookie'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_cookie'].'"><span class="qs_data as_link">'.$lang['srv_cookie_'.$row['cookie']].'</span></a></p>';
- echo '<p>'.$lang['srv_cookie_return'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_cookie_return'].'"><span class="qs_data as_link">'.($row['cookie_return'] == 0 ? $lang['srv_cookie_return_start'] : $lang['srv_cookie_return_middle']).'</span></a></p>';
-
- #more - več
- echo '<div id="srv_objava_info_more1" class="as_link" onclick="$(\'#srv_objava_info_more, #srv_objava_info_more1, #srv_objava_info_more2\').toggle();">'.$lang['srv_more'].'</div>';
- echo '<div id="srv_objava_info_more2" class="as_link displayNone" onclick="$(\'#srv_objava_info_more, #srv_objava_info_more1, #srv_objava_info_more2\').toggle();">'.$lang['srv_less'].'</div>';
- echo '<div id="srv_objava_info_more" class="displayNone">';
-
- if ($row['cookie'] > -1) {
- # če je piškotek dlje kot do konca nakete lahko izbere tudi druge možnosti
- echo '<p>'.$lang['srv_return_finished'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_return_finished'].'"><span class="qs_data as_link">'.($row['return_finished'] == 1 ? $lang['srv_return_finished_yes'] : $lang['srv_return_finished_no']).'</span></a></p>';
- } else {
- # ker je piškotek samo do konca ankete se ne more vrnit ali urejat
- echo '<p>'.$lang['srv_return_finished'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_return_finished'].'"><span class="qs_data as_link">'. $lang['srv_return_finished_no'] .'</span></a></p>';
- }
-
- echo '<p>'.$lang['srv_multilang'].':<a href="'.$base_url.'&a='.A_PREVAJANJE.'&f=vabila_settings" title="'.$lang['srv_multilang'].'"><span class="qs_data as_link">'.($row['multilang'] == 1 ? $lang['yes'] : $lang['no'] ).'</span></a></p>';
-
- echo '<p>'.$lang['srv_user'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_user'].'"><span class="qs_data as_link">';
- if ($row['user_from_cms'] == 1) {
- echo $lang['srv_respondent'];
- } elseif ($row['user_from_cms'] == 2) {
- echo $lang['srv_vnasalec'];
- } elseif ($row['user_from_cms'] == 0) {
- echo $lang['no1'];
- }
- echo '</span></a></p>';
-
- echo '<p>'.$lang['srv_block_ip'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_block_ip'].'"><span class="qs_data as_link">';
- if ($row['block_ip'] == 0) {
- echo $lang['no1'];
- } elseif ($row['block_ip'] == 10) {
- echo '10 min';
- } elseif ($row['block_ip'] == 20) {
- echo '20 min';
- } elseif ($row['block_ip'] == 60) {
- echo '60 min';
- } elseif ($row['block_ip'] == 720) {
- echo '12 '.$lang['hour_hours2'];
- } elseif ($row['block_ip'] == 1440) {
- echo '24 '.$lang['hour_hours2'];
- }
- echo '</a>';
- echo '</p>';
-
-
- # user from cms
- if ($row['user_from_cms']>0) {
- echo '<p>'.$lang['srv_user_cms_show'].':<a href="'.$base_url.'&a='.A_COOKIE.'&f=vabila_settings" title="'.$lang['srv_user_cms_show'].'"><span class="qs_data as_link">'.($lang['srv_user_cms_email']).'</span></a></p>';
+
+ echo '<div id="srv_active" class="switch_anketa anketa_on"></div>';
+
+ echo '</a>';
}
- echo '<p>'.$lang['srv_vote_limit'].':<a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_vote_limit'].'"><span class="qs_data as_link">'.($row['vote_limit'] == 0 ? $lang['no'] : $lang['yes']).'</span></a></p>';
-
- echo '<p>'.$lang['srv_vote_count'].':<a href="'.$base_url.'&a='.A_TRAJANJE.'&f=vabila_settings" title="'.$lang['srv_vote_count'].'"><span class="qs_data as_link">'.($row['vote_limit'] == 0 ? '/' : $row['vote_count']).'</span></a></p>';
- # Obveščanje
- // preberemo nastavitve alertov
- $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".$this->anketa."'");
- if (mysqli_num_rows($sqlAlert) > 0) {
- $rowAlert = mysqli_fetch_assoc($sqlAlert);
- } else {
- SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- $rowAlert = SurveyAlert::setDefaultAlertBeforeExpire();
- }
-
- $alert_finish = array();
- $alert_expire = array();
- $alert_delete = array();
- $alert_active = array();
- if ($rowAlert['finish_respondent'] == 1) {
- $alert_finish[] = $lang['srv_alert_respondent'];
- }
- if ($rowAlert['finish_respondent_cms'] == 1) {
- $alert_finish[] = $lang['srv_alert_respondent_cms'];
- }
- if ($rowAlert['finish_author'] == 1) {
- $alert_finish[] = $lang['srv_info_author'];
- }
- if ($rowAlert['finish_other'] == 1) {
- $alert_finish[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['expire_author'] == 1) {
- $alert_expire[] = $lang['srv_info_author'];
- }
- if ($rowAlert['expire_other'] == 1) {
- $alert_expire[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['delete_author'] == 1) {
- $alert_delete[] = $lang['srv_info_author'];
- }
- if ($rowAlert['delete_other'] == 1) {
- $alert_delete[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['active_author'] == 1) {
- $alert_active[] = $lang['srv_info_author'];
- }
- if ($rowAlert['active_other'] == 1) {
- $alert_active[] = $lang['email_prejemniki'];
- }
- echo '<p>'.$lang['srv_alert_completed_2'].':<a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_completed_2'].'"><span class="qs_data as_link">'.(count($alert_finish) ? implode(',',$alert_finish) : $lang['no']).'</span></a></p>';
- echo '<p>'.$lang['srv_alert_expired_2'].':<a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_expired_2'].'"><span class="qs_data as_link">'.(count($alert_expire) ? implode(',',$alert_expire) : $lang['no']).'</span></a></p>';
- echo '<p>'.$lang['srv_alert_active_2'].':<a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_active_2'].'"><span class="qs_data as_link">'.(count($alert_active) ? implode(',',$alert_active) : $lang['no']).'</span></a></p>';
- echo '<p>'.$lang['srv_alert_delete_2'].':<a href="'.$base_url.'&a='.A_ALERT.'&f=vabila_settings" title="'.$lang['srv_alert_delete_2'].'"><span class="qs_data as_link">'.(count($alert_delete) ? implode(',',$alert_delete) : $lang['no']).'</span></a></p>';
-
- echo '<p>';
- echo '<a href="index.php?anketa=' . $this->anketa . '&a='.A_SETTINGS . '&f=vabila_settings" title="' . $lang['srv_nastavitve_ankete'] . '">';
- echo $lang['srv_nastavitve_ankete_all'].'</a>';
- echo '</p>';
- echo '</div>';
- }
- // Nimamo dostopa do zavihka urejanje - ni nobenih linkov
- else{
- # Trajanje
- $starts = explode('-',$row['starts']);
- $starts = $starts[2].'.'.$starts[1].'.'.$starts[0];
- $expire = explode('-',$row['expire']);
- $expire = $expire[2].'.'.$expire[1].'.'.$expire[0];
- echo '<p>'.$lang['srv_starts'].': '.$starts.'</p>';
- if ( $row['expire'] == PERMANENT_DATE ) {
- #trajna
- echo '<p>'.$lang['srv_trajna_anketa'].': '.($row['expire'] == PERMANENT_DATE ? $lang['yes'] : $lang['no']).'</p>';
- } else {
- echo '<p>'.$lang['srv_expire'].': '.$expire.'</p>';
- }
-
- echo '<p>'.$lang['srv_themes'].': '.$row['skin'].'</p>';
-
- # Jezik
- $lang_old = $lang;
- $lang_admin = (int)$row['lang_admin'];
- $lang_resp = (int)$row['lang_resp'];
- $lang_array = array();
- $lang_array[0] = $lang['srv_language_not_set'];
- // Preberemo razpoložljive jezikovne datoteke
- if ($dir = opendir('../../lang')) {
- while (($file = readdir($dir)) !== false) {
- if ($file != '.' AND $file != '..') {
- if (is_numeric(substr($file, 0, strpos($file, '.')))) {
- $i = substr($file, 0, strpos($file, '.'));
- $file = '../../lang/'.$i.'.php';
- if (file_exists($file)) {
- include($file);
- $lang_array[$i] = $lang['language'];
- }
- }
+ else {
+ $anketa_active = "anketa_active('" . $this->anketa . "','" . $row['active'] . "'); ";
+
+ //Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana
+ if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
+ if ($hierarhija_type == 1) {
+ echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ } else{
+ echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
}
}
- }
-
- // nastavimo jezik nazaj
- /*$file = '../../lang/'.$lang_admin.'.php';
- if (file_exists($file)) {
- include($file);
- }*/
- $lang = $lang_old;
- $resp_change_lang = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang');
- echo '<p>'.$lang['srv_language_admin_0'].': '.$lang_array[$lang_admin].' / '.$lang_array[$lang_resp].'</p>';
-
- #obveščanje
-
- // jezikovni linki
- $p = new Prevajanje($this->anketa);
- $jeziki = $p->get_all_translation_langs();
- if (count($jeziki) > 0) {
- echo '<p>' . $lang['srv_trans_lang'] . ': ';
- $i = 0;
- foreach ($jeziki AS $key => $val) {
- if ($i++ != 0) echo ', ';
- echo '<a href="'.$link.'?language='.$key.'&f=vabila_settings" target="_blank">'.$val.'</a>';
+ else {
+ echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;" title="' . $lang['srv_anketa_noactive'] . '">';
}
- echo '</p>';
- }
- #piškotki
- echo '<p>'.$lang['srv_cookie'].': '.$lang['srv_cookie_'.$row['cookie']].'</p>';
- echo '<p>'.$lang['srv_cookie_return'].': '.($row['cookie_return'] == 0 ? $lang['srv_cookie_return_start'] : $lang['srv_cookie_return_middle']).'</p>';
-
- #more - več
- echo '<div id="srv_objava_info_more1" class="as_link" onclick="$(\'#srv_objava_info_more, #srv_objava_info_more1, #srv_objava_info_more2\').toggle();">'.$lang['srv_more'].'</div>';
- echo '<div id="srv_objava_info_more2" class="as_link displayNone" onclick="$(\'#srv_objava_info_more, #srv_objava_info_more1, #srv_objava_info_more2\').toggle();">'.$lang['srv_less'].'</div>';
- echo '<div id="srv_objava_info_more" class="displayNone">';
-
- if ($row['cookie'] > -1) {
- # če je piškotek dlje kot do konca nakete lahko izbere tudi druge možnosti
- echo '<p>'.$lang['srv_return_finished'].': '.($row['return_finished'] == 1 ? $lang['srv_return_finished_yes'] : $lang['srv_return_finished_no']).'</p>';
- } else {
- # ker je piškotek samo do konca ankete se ne more vrnit ali urejat
- echo '<p>'.$lang['srv_return_finished'].': '. $lang['srv_return_finished_no'] .'</p>';
- }
-
- echo '<p>'.$lang['srv_multilang'].': '.($row['multilang'] == 1 ? $lang['yes'] : $lang['no'] ).'</p>';
-
- echo '<p>'.$lang['srv_user'].': ';
- if ($row['user_from_cms'] == 1) {
- echo $lang['srv_respondent'];
- } elseif ($row['user_from_cms'] == 2) {
- echo $lang['srv_vnasalec'];
- } elseif ($row['user_from_cms'] == 0) {
- echo $lang['no1'];
- }
- echo '</p>';
-
- echo '<p>'.$lang['srv_block_ip'].': ';
- if ($row['block_ip'] == 0) {
- echo $lang['no1'];
- } elseif ($row['block_ip'] == 10) {
- echo '10 min';
- } elseif ($row['block_ip'] == 20) {
- echo '20 min';
- } elseif ($row['block_ip'] == 60) {
- echo '60 min';
- } elseif ($row['block_ip'] == 720) {
- echo '12 '.$lang['hour_hours2'];
- } elseif ($row['block_ip'] == 1440) {
- echo '24 '.$lang['hour_hours2'];
- }
- echo '</p>';
-
-
- # user from cms
- if ($row['user_from_cms']>0) {
- echo '<p>'.$lang['srv_user_cms_show'].': '.($lang['srv_user_cms_email']).'</p>';
- }
- echo '<p>'.$lang['srv_vote_limit'].': '.($row['vote_limit'] == 0 ? $lang['no'] : $lang['yes']).'</p>';
-
- echo '<p>'.$lang['srv_vote_count'].': '.($row['vote_limit'] == 0 ? '/' : $row['vote_count']).'</p>';
- # Obveščanje
- // preberemo nastavitve alertov
- $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".$this->anketa."'");
- if (mysqli_num_rows($sqlAlert) > 0) {
- $rowAlert = mysqli_fetch_assoc($sqlAlert);
- } else {
- SurveyAlert::getInstance()->Init($anketa, $global_user_id);
- $rowAlert = SurveyAlert::setDefaultAlertBeforeExpire();
- }
-
- $alert_finish = array();
- $alert_expire = array();
- $alert_delete = array();
- $alert_active = array();
- if ($rowAlert['finish_respondent'] == 1) {
- $alert_finish[] = $lang['srv_alert_respondent'];
- }
- if ($rowAlert['finish_respondent_cms'] == 1) {
- $alert_finish[] = $lang['srv_alert_respondent_cms'];
- }
- if ($rowAlert['finish_author'] == 1) {
- $alert_finish[] = $lang['srv_info_author'];
- }
- if ($rowAlert['finish_other'] == 1) {
- $alert_finish[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['expire_author'] == 1) {
- $alert_expire[] = $lang['srv_info_author'];
- }
- if ($rowAlert['expire_other'] == 1) {
- $alert_expire[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['delete_author'] == 1) {
- $alert_delete[] = $lang['srv_info_author'];
- }
- if ($rowAlert['delete_other'] == 1) {
- $alert_delete[] = $lang['email_prejemniki'];
- }
- if ($rowAlert['active_author'] == 1) {
- $alert_active[] = $lang['srv_info_author'];
- }
- if ($rowAlert['active_other'] == 1) {
- $alert_active[] = $lang['email_prejemniki'];
+
+ echo '<div id="srv_inactive" class="switch_anketa anketa_off"></div>';
+
+ echo '</a>';
}
- echo '<p>'.$lang['srv_alert_completed_2'].': '.(count($alert_finish) ? implode(',',$alert_finish) : $lang['no']).'</p>';
- echo '<p>'.$lang['srv_alert_expired_2'].': '.(count($alert_expire) ? implode(',',$alert_expire) : $lang['no']).'</p>';
- echo '<p>'.$lang['srv_alert_active_2'].': '.(count($alert_active) ? implode(',',$alert_active) : $lang['no']).'</p>';
- echo '<p>'.$lang['srv_alert_delete_2'].': '.(count($alert_delete) ? implode(',',$alert_delete) : $lang['no']).'</p>';
-
+
+ echo '</div>';
+
+ //echo '<p class="top16">'.$lang['srv_publication_survey_noactive_note2'].'</p>';
+
echo '</div>';
}
+ }
+
+ # Opozorilo o napakah
+ private function survey_errors(){
+ global $lang;
+
+ $sd = new SurveyDiagnostics($this->anketa);
+ $sd->doDiagnostics();
+ $diagnostic = $sd->getDiagnostic();
+ if (is_array($diagnostic) && count($diagnostic) > 0) {
+
+ echo '<div class="top_note" id="publication_warnings">';
+ echo ' <div class="title small">';
+ echo ' <span class="faicon warning"></span> '.$lang['srv_warning'];
+ echo '<div class="note_hide"><a href="#" onClick="top_note_hide(\'publication_warnings\'); return false;"">✕</a></div>';
+ echo ' </div>';
+ echo $lang['srv_publication_survey_warnings'].'\'<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_TESTIRANJE.'">'.$lang['srv_testiranje'].'</a>\'.';
+ echo '</div>';
+ }
+ }
+
+ function anketa_vabila_drugo() {
+ global $lang, $site_url, $global_user_id;
- echo '</fieldset>';
- echo '</td>';
+ $d = new Dostop();
+
+ # Opozorilo o napakah
+ $this->survey_errors();
+
+ # Opozorilo - anketa ni aktivna
+ $this->activation_error();
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
- echo '<td>';
- echo '</td>';
+ // Več načinov deljenja ankete
+ echo '<div class="title">'.$lang['srv_publication_survey_more'].'</div>';
+
+ echo '<div class="more squares">';
+
+ //QR koda
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'QR\');">';
+ echo '<div class="more_title_icon"><span class="faicon fa-qrcode"></span></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href_friends'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_friends_text'];
+ echo '</div>';
+
+ //jazvem
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'jazvem\');">';
+ echo '<div class="more_title_icon jazvem"></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href_jazvem'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_friends_text'];
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="divider_line"></div>';
+
+ // Več načinov deljenja ankete
+ echo '<div class="title">'.$lang['srv_publication_survey_integration'].'</div>';
+
+ echo '<div class="more squares">';
+
+ //HTML koda
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'html\');">';
+ echo '<div class="more_title_icon"><span class="fa-brands html5"></span></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_text'];
+ echo '</div>';
- echo '</tr>';
+ //HTML koda + števec
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'htmlcount\');">';
+ echo '<div class="more_title_icon"><span class="fa-brands html5"></span><span class="circle-icon icon-123"></span></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href_count'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_count_text'];
+ echo '</div>';
+
+ // iFrame - brez js
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'iframenojs\');">';
+ echo '<div class="more_title_icon"><span class="faicon fa-window-maximize empty"></span></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href_inojs'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_inojs_text'];
+ echo '</div>';
+
+ // iFrame - js
+ echo '<div class="more_block square" onclick="publishPopupOpen(\'iframejs\');">';
+ echo '<div class="more_title_icon"><span class="faicon fa-window-maximize empty"></span><span class="circle-icon icon-JS"></span></div>';
+ echo '<div class="more_title">';
+ echo $lang['srv_anketa_href_ijs'];
+ echo '</div>';
+ //echo $lang['srv_anketa_href_ijs_text'];
+ echo '</div>';
- echo '</table>';
+
+
+ echo '</div>';
+ echo '</div>';
+
}
function niceUrlSettings() {
@@ -2346,6 +2772,12 @@ class SurveyAdminSettings {
$p = new Prevajanje($this->anketa);
$p->dostop();
$lang_array = $p->get_all_translation_langs();
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ $p->include_lang($p->lang_resp);
+ $base_lang_resp = $lang['language'];
+ $p->include_base_lang();
$link = SurveyInfo::getSurveyLink();
$preview_disableif = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disableif');
@@ -2354,195 +2786,138 @@ class SurveyAdminSettings {
$preview_displayvariables = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayvariables');
$preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment');
$preview_options = ''.($preview_disableif==1?'&disableif=1':'').($preview_disablealert==1?'&disablealert=1':'').($preview_displayifs==1?'&displayifs=1':'').($preview_displayvariables==1?'&displayvariables=1':'').($preview_hidecomment==1?'&hidecomment=1':'').'';
-
-
- echo '<fieldset><legend>'.$lang['srv_publication_base_title'].'</legend>';
-
- // Predogled url
- echo '<div class="publish_url_holder">';
-
- echo '<p style="margin: 2px 0;"><a href="' . $link . '&preview=on'.$preview_options.'" target="_blank" class="srv_icox spaceRight"><span class="faicon preview"></span> ' . $lang['srv_poglejanketo2'] . '</b></a>';
- echo '<span class="spaceLeft italic">('.$lang['srv_preview_text'].')</span></p>';
- echo '<p style="margin: 2px 0;">' . $lang['url'] . ': ' . $link . '&preview=on'.$preview_options.'</p>';
-
- echo '</div>';
-
- // Test url
- if($this->survey_type > 1){
- echo '<div class="publish_url_holder">';
-
- echo '<p style="margin: 2px 0;"><a href="' . $link . '&preview=on&testdata=on'.$preview_options.'" title="" target="_blank" class="srv_ico spaceRight"><span class="faicon test large"></span> ' . $lang['srv_survey_testdata2'] . '</b></a>';
- echo '<span class="spaceLeft italic">('.$lang['srv_testdata_text'].')</span></p>';
- echo '<p style="margin: 2px 0;">'.$lang['url'] . ': ' . $link . '&preview=on&testdata=on'.$preview_options;
- echo ' (<a href="#" id="popup-open" onclick="javascript:testiranje_preview_settings(); return false;">'.$lang['srv_testrianje_how'].'</a>)</p>';
-
- echo '</div>';
- }
-
- // Navaden url
+
echo '<div class="publish_url_holder">';
- $row = SurveyInfo::getInstance()->getSurveyRow();
+ //Zlistamo vse lepe url-je
+ $title = 0;
+ $sqll = sisplet_query("SELECT id, link FROM srv_nice_links WHERE ank_id = '$this->anketa' ORDER BY id desc");
+ while ($rowl = mysqli_fetch_assoc($sqll)) {
- echo '<p style="margin: 2px 0;"><a href="' . $link . '" target="_blank" class="srv_icox spaceRight"><span class="faicon edit_square large"></span> ' . $lang['srv_survey_real'] . '</b></a>';
- echo '<span class="spaceLeft italic">('.$lang['srv_survey_real_savedata'].')</span></p>';
+ if ($title == 0) {
+ echo '<div class="divider_line"></div>';
- echo '<span class="'.($row['active']==1?'url_box_active':'').'" style="display:block;">' . $lang['url'] . ': &nbsp;';
-
- $p->include_lang($p->lang_resp);
- $base_lang_resp = $lang['language'];
- $p->include_base_lang();
-
- $link1 = $site_url.'a/'.Common::encryptAnketaID($this->anketa);
- echo '<b><a href="'.$link1.'" target="_blank">'.$link1.'</a>'.(count($lang_array) > 0 ? ' - '.$base_lang_resp : '').'</b>';
-
- // Zlistamo vse lepe url-je
- $sqll = sisplet_query("SELECT id, link FROM srv_nice_links WHERE ank_id = '$this->anketa' ORDER BY id ASC");
- while ($rowl = mysqli_fetch_assoc($sqll)) {
+ echo '<div class="title">'.$lang['srv_publication_survey_niceurl'].'</div>';
+ $title = 1;
+ }
$link_nice = $site_url . $rowl['link'];
- echo '<br/><span style="margin-left:35px; margin-top:5px; display:inline-block;" ><b>';
- echo '<a href="'.$link_nice.'" target="_blank">'.$link_nice.'</a>'.(count($lang_array) > 0 ? ' - '.$base_lang_resp : '').'</b></span>';
+ echo ' <div class="niceurl">';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span>';
+ echo ' <a href="'.$link_nice.'">'.$site_url.'<span class="semi-bold">'.$rowl['link'].'</span></a>';
+ echo ' </div>';
+ echo ' <a class="input_box as_button onlyicon" href="ajax.php?a=nice_url_remove&anketa='.$this->anketa.'&nice_url='.$rowl['id'].'" title="'.$lang['srv_copy_remove'].'"><span class="faicon trash empty blue"></span></a>';
- //echo '<b><a href="'.$site_url.$rowl['link'].'" target="_blank">'.$site_url.$rowl['link'].'</a></b>';
- //echo '<a href="ajax.php?a=nice_url_remove&anketa='.$this->anketa.'&nice_url='.$rowl['id'].'" title="'.$lang['srv_copy_remove'].'"><img src="img_0/if_remove.png" /></a></b></span>';
+ echo ' <div class="input_box as_button" onclick="CopyToClipboard(\''.$link_nice.'\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="'.$lang['srv_diagnostika_testiranje_copy_url'].'">';
+ echo ' <span class="faicon copy blue no_margin"></span>'.$lang['srv_diagnostika_testiranje_copy_url'];
+ echo ' </div>';
+
+ echo ' </div>';
}
+
- // Imamo vec linkov za skupine
+ // Povezave za skupine in jezike
+ // Navaden url
+
$ss = new SurveySkupine($this->anketa);
- $spr_id = $ss->hasSkupine();
+ $spr_id = $ss->hasSkupine();
+
+ $vrednosti = $ss->getVrednosti($spr_id);
+
+ if (count($lang_array) > 0 || $spr_id > 0){
+ echo '<div class="divider_line"></div>';
+
+ echo '<div class="title">'.$lang['srv_publication_survey_grouplang'].'</div>';
+
+ if (count($lang_array) > 0){
+ echo '<div class="lang_wrapper">';
+ echo ' <div class="lang_title"><span class="semi-bold">'.$base_lang_resp.'</span>'.$lang['srv_nice_url_default_lang'].'</div>';
+ echo ' <hr class="lang_line">';
+ echo '</div>';
+
+ echo ' <div class="niceurl">';
+ echo ' <div class="group_name" title="'.$lang['srv_nice_url_no_group'].'">'.$lang['srv_nice_url_no_group'].'</div>';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span>';
+ echo ' <a href="'.$link.'">'.$link.'</a>';
+ echo ' </div>';
+
+ echo ' <div class="input_box as_button" onclick="CopyToClipboard(\''.$link.'\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="'.$lang['srv_diagnostika_testiranje_copy_url'].'">';
+ echo ' <span class="faicon copy blue no_margin"></span>'.$lang['srv_diagnostika_testiranje_copy_url'];
+ echo ' </div>';
+ echo ' </div>';
+
+ }
+ }
+
+ // Imamo vec linkov za skupine
if($spr_id > 0){
- $vrednosti = $ss->getVrednosti($spr_id);
+
foreach($vrednosti as $vrednost){
+
$link_skupine = isset($vrednost['nice_url']) ? $vrednost['nice_url'] : $vrednost['url'];
- echo '<br/><span style="margin-left:35px; margin-top:5px; display:inline-block;" ><b>';
- echo '<a href="'.$link_skupine.'" target="_blank">'.$link_skupine.'</a>'.(count($lang_array) > 0 ? ' - '.$base_lang_resp : '').' - '.$vrednost['naslov'].'</b></span>';
+
+ echo ' <div class="niceurl">';
+ echo ' <div class="group_name" title="'.$vrednost['naslov'].'">'.$vrednost['naslov'].'</div>';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span>';
+ echo ' <a href="'.$link_skupine.'">'.$link_skupine.'</a>';
+ echo ' </div>';
+
+ echo ' <div class="input_box as_button" onclick="CopyToClipboard(\''.$link_skupine.'\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="'.$lang['srv_diagnostika_testiranje_copy_url'].'">';
+ echo ' <span class="faicon copy blue no_margin"></span>'.$lang['srv_diagnostika_testiranje_copy_url'];
+ echo ' </div>';
+ echo ' </div>';
}
}
// Imamo vec linkov za jezike
if (count($lang_array) > 0) {
+
foreach ($lang_array AS $lang_id => $lang_name) {
- echo '<br/><span style="margin-left:35px; margin-top:5px; display:inline-block;" ><b>';
- echo '<a href="'.$link.'?language='.$lang_id.'" target="_blank">'.$link.'?language='.$lang_id.'</a> - '.$lang_name.'</b></span>';
+
+ echo '<div class="lang_wrapper">';
+ echo ' <div class="lang_title"><span class="semi-bold">'.$lang_name.'</span></div>';
+ echo ' <hr class="lang_line">';
+ echo '</div>';
+
+ echo ' <div class="niceurl">';
+ echo ' <div class="group_name" title="'.$lang['srv_nice_url_no_group'].'">'.$lang['srv_nice_url_no_group'].'</div>';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span>';
+ echo ' <a href="'.$link.'?language='.$lang_id.'">'.$link.'?language='.$lang_id.'</a>';
+ echo ' </div>';
+
+ echo ' <div class="input_box as_button" onclick="CopyToClipboard(\''.$link.'?language='.$lang_id.'\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="'.$lang['srv_diagnostika_testiranje_copy_url'].'">';
+ echo ' <span class="faicon copy blue no_margin"></span>'.$lang['srv_diagnostika_testiranje_copy_url'];
+ echo ' </div>';
+ echo ' </div>';
if($spr_id > 0){
foreach($vrednosti as $vrednost){
+
$link_skupine = isset($vrednost['nice_url']) ? $vrednost['nice_url'] : $vrednost['url'];
- echo '<br/><span style="margin-left:35px; margin-top:5px; display:inline-block;" ><b>';
- echo '<a href="'.$link_skupine.'&language='.$lang_id.'" target="_blank">'.$link_skupine.'&language='.$lang_id.'</a> - '.$lang_name.' - '.$vrednost['naslov'].'</b></span>';
+
+ echo ' <div class="niceurl">';
+ echo ' <div class="group_name" title="'.$vrednost['naslov'].'">'.$vrednost['naslov'].'</div>';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right"></span>';
+ echo ' <a href="'.$link_skupine.'&language='.$lang_id.'">'.$link_skupine.'&language='.$lang_id.'</a>';
+ echo ' </div>';
+
+ echo ' <div class="input_box as_button" onclick="CopyToClipboard(\''.$link_skupine.'&language='.$lang_id.'\'); actionNotePopup(\'link_copied\', \'success\'); return false;" title="'.$lang['srv_diagnostika_testiranje_copy_url'].'">';
+ echo ' <span class="faicon copy blue no_margin"></span>'.$lang['srv_diagnostika_testiranje_copy_url'];
+ echo ' </div>';
+ echo ' </div>';
}
}
}
}
-
- echo '</span>';
-
- echo '</fieldset>';
-
-
- echo '<br />';
-
-
- // Okno za dodajanje lepega url-ja
- echo '<fieldset><legend>'.$lang['srv_nice_url'].'</legend>';
-
- // Zlistamo vse lepe url-je
- $sqll = sisplet_query("SELECT id, link FROM srv_nice_links WHERE ank_id = '$this->anketa' ORDER BY id ASC");
- while ($rowl = mysqli_fetch_assoc($sqll)) {
-
- echo '<span style="margin-top: 10px; display:inline-block;">';
- echo '<b><a href="'.$site_url.$rowl['link'].'" target="_blank">'.$site_url.$rowl['link'].'</a></b>';
-
- // Remove nice url
- echo '<a href="ajax.php?a=nice_url_remove&anketa='.$this->anketa.'&nice_url='.$rowl['id'].'" title="'.$lang['srv_copy_remove'].'"><span class="faicon delete_circle icon-orange_link spaceLeft"></span></a>';
-
- echo '<br />';
- }
-
- echo '<br />';
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
- if(!$userAccess->checkUserAccess($what='nice_url')){
- $userAccess->displayNoAccess($what='nice_url');
- }
- else{
- // Gumb za dodajanje lepega linka
- //echo '<div class="" style="margin-top:5px;"><a href="#" onclick="$(\'#spn_nice_url\').toggle(); return false;">' . $lang['srv_nice_url'] . '</a>&nbsp;'.Help::display('srv_nice_url');
- echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft" title="' . $lang['srv_nice_url_add'] . '" href="#" onclick="$(\'#spn_nice_url\').fadeToggle(); return false;">' . $lang['srv_nice_url_add'] . '</a></div>&nbsp;'.Help::display('srv_nice_url');
-
-
- echo '<br /><span id="spn_nice_url" '.(isset($_GET['error']) ? '' : 'style="display:none;"').'><br /><br />';
-
- echo $site_url.' <input type="text" name="nice_url" id="nice_url" value="" /> <input type="submit" value="'.$lang['add'].'" onclick="$.redirect(\'ajax.php?a=nice_url\', {anketa: '.$this->anketa.', nice_url: $(\'#nice_url\').val()}); return false;" />';
-
- echo '</span>';
- echo '</div>';
-
- if (isset($_GET['error'])) {
-
- // Prekratek lep url
- if(strlen($_GET['error']) <= 2)
- echo '<br /><br /><span class="red"><b>'.$_GET['error'].'</b> '.$lang['srv_nice_url_short'].'</span>';
- // Predolg lep url
- elseif(strlen($_GET['error']) > 20)
- echo '<br /><br /><span class="red"><b>'.$_GET['error'].'</b> '.$lang['srv_nice_url_long'].'</span>';
- // Ze obstaja
- else
- echo '<br /><br /><span class="red"><b>'.$_GET['error'].'</b> '.$lang['srv_nice_url_taken'].'</span>';
- }
-
- echo '</div>';
- }
-
- echo '<br /><br />';
-
- echo '</fieldset>';
- }
-
- function anketa_vabila_url() {
- echo '<table width="100%">';
- echo '<tr style="">';
-
- echo '<td style="vertical-align:top;">';
- $this->displayInvSurveyEmbed();
-
- // Embed v popup je zaenkrat disablan zaradi cross domain omejitev browserjev
- //$this->displayInvSurveyPopup();
- echo '</td>';
-
- echo '<td style="width:45%; vertical-align:top;">';
- $this->displayInvSurveyLink();
- echo '</td>';
-
- echo '</tr>';
- echo '</table>';
}
- function displayInvSurveyEmbed() {
- global $lang;
-
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_embed_title'].':</legend>';
-
- echo '<p><span onclick="$(\'#embed_js\').toggle(); $(\'#embed_js textarea\').click();" class="as_link">'.$lang['srv_embed_js'].Help :: display('srv_embed_js').'</span></p>';
- echo '<p id="embed_js" '.($_GET['js']!='open'?'style="display:none"':'').'><textarea id="ta" style="width: 99%; height:80px" onclick="this.select();" readonly>'.$this->getEmbed().'</textarea></p>';
-
- echo '<p><span onclick="$(\'#embed_js_fixed\').toggle(); $(\'#embed_js_fixed textarea\').click();" class="as_link">'.$lang['srv_embed_fixed'].Help :: display('srv_embed_fixed').'</span></p>';
- echo '<p id="embed_js_fixed" '.($_GET['js']!='open'?'style="display:none"':'').'><textarea style="width: 99%; height:80px" onclick="this.select();" readonly>'.$this->getEmbed(false).'</textarea></p>';
-
-
- echo '</fieldset>';
-
- if ($_GET['js'] == 'open') {
- ?><script>
- $('#ta').click();
- </script><?
- }
- }
function displayInvSurveyPopup() {
global $lang;
@@ -2555,71 +2930,6 @@ class SurveyAdminSettings {
echo '</fieldset>';
}
- function displayInvSurveyLink() {
- global $lang, $site_url, $admin_type;
-
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_user_base_url'] . '</legend>';
-
- echo '<p><div class="as_link"><label onclick="$(\'#anketa_href\').toggle(); $(\'#anketa_href textarea\').click(); $(\'#space1\').toggle();" class="pointer">' . $lang['srv_anketa_href'] . ' </label></div>';
- echo '<div id="anketa_href" class="displayNone"><br>'.$lang['srv_anketa_href_text'].' <textarea style="width:99%; height:24px;" onclick="this.select();" readonly id="href">';
- echo '&lt;a href="'.SurveyInfo::getSurveyLink().'"&gt;'.$lang['srv_complete_survey'].'&lt;/a&gt;';
- echo '</textarea></div></p>';
- echo '<p><div class="as_link" ><label onclick="$(\'#anketa_href_count\').toggle(); $(\'#space2\').toggle(); $(\'#anketa_href_count textarea\').click();" class="pointer">' . $lang['srv_anketa_href_count'] . ' </label></div>';
- echo '<div id="anketa_href_count" class="displayNone"><br>'.$lang['srv_anketa_href_count_text'].' <textarea style="width:99%; height:48px" onclick="this.select();" readonly>';
- echo '&lt;a href="'.SurveyInfo::getSurveyLink().'"&gt;'.$lang['srv_complete_survey'].'&lt;/a&gt;&lt;img src="'.$site_url.'main/survey/view_count.php?a='.$this->anketa.'" style="display:none"/&gt;';
- echo '</textarea></div></p>';
-
- echo '</fieldset><fieldset>';
-
- // Prikaz QR kode
- $img = 'classes/phpqrcode/imgs/code'.$this->anketa.'.png';
- QRcode::png(SurveyInfo::getSurveyLink(), $img, 'L', 4, 2);
-
- echo '<div class="as_link"><label onclick="$(\'#anketa_qr_code\').toggle();" class="pointer" title="'.$lang['srv_qr_code'].'">' . $lang['srv_qr_code'] . ' </label></div>';
-# echo '<p>'.$lang['srv_qr_code'].':<br>';
- echo '<div id="anketa_qr_code" class="displayNone">';
- echo '<img src="'.$site_url.'admin/survey/'.$img.'">';
- echo '</div>';
-
- // Prikaz ikon za deljenje (FB, twitter...)
- echo '<p class="clr" style="margin-top:15px;"><span class="labelSpanWide"><label>'.$lang['srv_share'].': </label></span> ';
-
- ?>
- <div class="addthis_toolbox addthis_default_style">
-
- <a class="addthis_button_facebook" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- <a class="addthis_button_gmail" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
-
- <!-- <a class="addthis_button_preferred_1" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- <a class="addthis_button_preferred_2" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>-->
-
- <!--
- <a class="addthis_button_preferred_3" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- <a class="addthis_button_preferred_4" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- <a class="addthis_button_preferred_5" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- <a class="addthis_button_preferred_6" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- -->
-
- <span class="addthis_separator">|</span>
- <a href="https://www.addthis.com/bookmark.php?v=250" class="addthis_button_compact" addthis:url="<?=SurveyInfo::getSurveyLink()?>" addthis:title="<?=$row['akronim']?>"></a>
- </div>
- <script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js"></script>
-
- <script type="text/javascript">
- var addthis_config = {
- data_track_clickback: false,
- services_exclude: 'print'
- }
- </script>
-
- <?php
-
- echo '</p>';
- echo '</fieldset>';
- }
/**
* nastavitve za obveščanje na email
*
@@ -2664,10 +2974,9 @@ class SurveyAdminSettings {
echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;"><span>';
// echo '<img src="icons/icons/disk.png" alt="" vartical-align="middle" />';
echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
#echo '</div>';
@@ -2686,7 +2995,6 @@ class SurveyAdminSettings {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
$row = SurveyInfo::getInstance()->getSurveyRow();
- //return '&lt;iframe id="1ka" src="'.$site_url.'main/survey/index.php?anketa='.$this->anketa.'" scrolling="auto" frameborder="0" width="100%"&gt;&lt;/iframe&gt;&lt;script type="text/javascript"&gt;function r(){var a=window.location.hash.replace("#","");if(a.length==0)return;document.getElementById("1ka").style.height=a+"px";window.location.hash=""};window.setInterval(\\\'r()\\\',100);&lt;/script&gt;';
$iframe = '<iframe id="1ka" src="'.$link.'?e=1" height="500px" width="100%" scrolling="auto" frameborder="0"></iframe>';
$javascript = '<script type="text/javascript">function r(){var a=window.location.hash.replace("#","");if(a.length==0)return;document.getElementById("1ka").style.height=a+"px";window.location.hash=""};window.setInterval("r()",100);'
.'</script>';
@@ -2722,9 +3030,11 @@ class SurveyAdminSettings {
global $lang;
global $site_url;
global $admin_type;
- global $app_settings;
$anketa = $this->anketa;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
/* moznosti:
* 'complete' -> obvsetilo o izpolnjeni anketi (respondent, respondent iz cms, avtor + dostop, dodatn-emaili)
@@ -2772,7 +3082,7 @@ class SurveyAdminSettings {
if ($tab == 'complete') {
- //echo '<h4>' . $lang['srv_alert_title'] . '</h4>'."\n";
+ //Obveščanje o izpolnjeni anketi
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m='.$tab.'" method="post" autocomplete="off">' . "\n";
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . "\n";
echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n";
@@ -2780,60 +3090,75 @@ class SurveyAdminSettings {
echo ' <input type="hidden" name="submited" value="1" />' . "\n";
- echo ' <fieldset>'. "\n";
- echo ' <legend>' . $lang['srv_alert_prejemnik'] . '</legend>'. "\n";
-
- // respondent - ne prikazemo ce gre za glasovanje oz. volitve
+ echo ' <fieldset>';
+ echo ' <legend>' . $lang['srv_alert_completed_2'] . '</legend>';
+
+ echo '<div class="setting_holder alert_prejemniki">';
+ echo '<span class="setting_title">'.$lang['srv_alert_completed_prejemniki'].'</span>';
+
+ // respondent - ne prikazemo ce gre za glasovanje oz. volitve
if($rowS['survey_type'] != 0 && !SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<p>';
- echo '<input type="checkbox" name="alert_finish_respondent" id="alert_finish_respondent" value="1" onChange="change_alert_respondent(\'finish_respondent\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ($rowAlert['finish_respondent'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_finish_respondent">';
+ echo '<div class="setting_item" id="label_alert_finish_respondent">';
+
+ //echo '<input type="checkbox" name="alert_finish_respondent" id="alert_finish_respondent" value="1" onChange="change_alert_respondent(\'finish_respondent\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ($rowAlert['finish_respondent'] == 1 ? ' checked' : '') . '>';
$this->display_alert_label('finish_respondent',($rowAlert['finish_respondent'] == 1));
- echo '</span>'. "\n";
+ echo '</div>';
+
// Ce imamo vec prevodov omogocimo za vsak prevod svoj email
$this->display_alert_label('finish_respondent_language',($rowAlert['finish_respondent'] == 1));
- echo '</p>';
+
}
- // respondent iz cms ne prikazemo ce gre za volitve
+ // respondent iz cms ne prikazemo ce gre za volitve
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<p><input type="checkbox" name="alert_finish_respondent_cms" id="alert_finish_respondent_cms" value="1" onChange="change_alert_respondent(\'finish_respondent_cms\', $(this)); chnage_alert_instruction($(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ($rowAlert['finish_respondent_cms'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_finish_respondent_cms">';
+ echo '<div class="setting_item" id="label_alert_finish_respondent_cms">';
+
+ //echo '<input type="checkbox" name="alert_finish_respondent_cms" id="alert_finish_respondent_cms" value="1" onChange="change_alert_respondent(\'finish_respondent_cms\', $(this)); change_alert_instruction($(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;" ' . ($rowAlert['finish_respondent_cms'] == 1 ? ' checked' : '') . '>';
$this->display_alert_label('finish_respondent_cms',($rowAlert['finish_respondent_cms'] == 1));
- echo '</span></p>'. "\n";
+
+ echo '</div>';
}
- // avtor ankete oz osebe z dostopom
- //echo '<p><input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="change_alert_respondent(\'finish_author\', $(this)); $(\'form[name=alertanketa_' . $anketa . ']\').submit(); return false;"' . ($rowAlert['finish_author'] == 1 ? ' checked' : '') . '>';
- echo '<p><input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="change_alert_respondent(\'finish_author\', $(this));"' . ($rowAlert['finish_author'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_finish_author">';
+ //Avtor ankete oz. souredniki
+ echo '<div class="setting_item" id="label_alert_finish_author">';
+ echo '<input type="checkbox" name="alert_finish_author" id="alert_finish_author" value="1" onChange="change_alert_respondent(\'finish_author\', $(this));return false;"' . ($rowAlert['finish_author'] == 1 ? ' checked' : '') . '>';
$this->display_alert_label('finish_author',($rowAlert['finish_author'] == 1));
- echo '</span></p>';
+ echo '</div>';
- // posebej navedeni maili
- echo '<p><input type="checkbox" name="alert_finish_other" id="alert_finish_other" value="1"' . (($rowAlert['finish_other'] == 1 || ($rowAlert['finish_other_emails'] && $rowAlert['finish_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'finish_other\'); if ( ! $(this).attr(\'checked\') ) { $(\'form[name=alertanketa_' . $anketa . ']\').submit(); }"><label for="alert_finish_other">' . $lang['email_prejemniki'] . $lang['email_one_per_line'] . '</label>';
- echo ' <a href="#" onclick="alert_custom(\'other\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ //Posebej navedeni maili
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_finish_other" id="alert_finish_other" value="1"' . (($rowAlert['finish_other'] == 1 || ($rowAlert['finish_other_emails'] && $rowAlert['finish_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'finish_other\'); if ( ! $(this).attr(\'checked\') ) { $(\'form[name=alertanketa_' . $anketa . ']\').submit(); }"><label for="alert_finish_other">' . $lang['email_prejemniki'] .'</label>';
+ echo ' <a href="#" onclick="alert_custom(\'other\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
echo ' <a href="#" onclick="alert_edit_if(\'4\'); return false;"><span class="faicon if_add" '.($rowAlert['finish_other_if']==0?'style=""':'').'></span></a> ';
- if ($rowAlert['finish_other_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($rowAlert['finish_other_if']); }
- echo '</p>';
-
- echo '<p id="alert_holder_finish_other_emails" '.($rowAlert['finish_other'] == 0 ? 'class="displayNone"' : '' ).'>';
- echo '<label for="alert_finish_other_emails">' . $lang['email'] . ':</label>' .
- '<textarea name="alert_finish_other_emails" id="alert_finish_other_emails" style="height:100px" onblur="$(\'form[name=alertanketa_' . $anketa . ']\').submit();">' . $rowAlert['finish_other_emails'] . '</textarea>' .
- '</p>';
-
- echo '</fieldset>';
-
-
- echo '<br />';
+ if ($rowAlert['finish_other_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($rowAlert['finish_other_if']); }
+ echo '</div>';
+
+ echo '<div class="setting_item">';
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_alert_oblika'] . '</legend>';
- echo '<div style="float:left; width:auto;">';
- echo '<p><label for="alert_finish_subject">' . $lang['subject'] . ': <input type="text" id="alert_finish_subject" name="alert_finish_subject" value="' . ($rowAlert['finish_subject'] ? $rowAlert['finish_subject'] : $lang['srv_alert_finish_subject']) . '" size="90"/></label></p>';
- echo '<p><label for="reply_to">'.$lang['srv_replay_to'].': <input type="text" id="reply_to" name="reply_to" value="' . ($rowAlert['reply_to'] ? $rowAlert['reply_to'] : $MailReply) . '" size="40"/></label></p>';
+ echo '<div class="setting_holder alert_other_emails '.($rowAlert['finish_other'] == 0 ? 'displayNone' : '' ).'" id="alert_holder_finish_other_emails">';
+ echo '<label for="alert_finish_other_emails">' . $lang['email_prejemniki_one_per_line'] . ':</label>';
+ echo '<textarea class="alert_other_emails" name="alert_finish_other_emails" id="alert_finish_other_emails">' . $rowAlert['finish_other_emails'] . '</textarea>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '<div id="obvescanje_sidebyside_holder">';
+ echo '<div id="obvescanje_sidebyside_left">';
+
+ echo '<p class="bold caps bottom16">'.$lang['message_content'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="alert_finish_subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="alert_finish_subject" name="alert_finish_subject" value="' . ($rowAlert['finish_subject'] ? $rowAlert['finish_subject'] : $lang['srv_alert_finish_subject']) . '"/>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="reply_to">' . $lang['srv_replay_to'] . Help::display('srv_obvescanje_odgovorZa').': </label>';
+ echo '<input type="text" class="large wauto" id="reply_to" name="reply_to" value="' . ($rowAlert['reply_to'] ? $rowAlert['reply_to'] : $MailReply) . '"/>';
+ echo '</div>';
+
if ($rowAlert['finish_text'] != '') {
$text = $rowAlert['finish_text'];
}
@@ -2845,95 +3170,134 @@ class SurveyAdminSettings {
}
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
- echo ' <p><label for="alert_finish_text">' . $lang['text'] . ':</label>';
- echo ' <textarea name="alert_finish_text" id="alert_finish_text" rows="3" >' . $text . '</textarea>';
- echo ' </p>';
- echo '</div>';
- echo '<div style="float:left; width:auto; max-width:330px; margin-left:10px;">';
- echo '<div id="div_error">';
- echo $lang['srv_alert_instruction1'];
+ echo '<div class="setting_holder">';
+
+ echo '<label class="bottom4" for="alert_finish_text">' . $lang['message'] . ':</label>';
+ echo '<textarea name="alert_finish_text" id="alert_finish_text">' . $text . '</textarea>';
+
+ echo '</div>';
+ echo '</div>';
+
+ //Navodila na desni
+ echo '<div id="obvescanje_sidebyside_right">';
+ echo '<div class="message_instructions">';
+ echo '<p class="bold caps bottom16">'.$lang['srv_alert_instruction1'].'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction1a'].':</p>';
+
+ echo '<div class="izpolnjena_spremenljivke">';
+
// ta se skriva, potreben respondent iz CMS, da dobi NAME
echo '<span id="alert_respondent_cms_instruction" class="'.( $rowAlert['finish_respondent_cms'] == 1 ? '' : 'displayNone').'">'.$lang['srv_alert_instruction2'].'</span>';
- echo $lang['srv_alert_instruction_survey'].'<br/>';
- echo $lang['srv_alert_instruction_date'].'<br/>';
- echo $lang['srv_alert_instruction_site'].'<br/>';
- echo $lang['srv_alert_instruction_url'].'<br/>';
- echo $lang['srv_alert_instruction_pdf'].'<br/>';
- echo $lang['srv_alert_instruction_rtf'].'<br/>';
-
+ 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 '<p>'.$lang['srv_alert_instruction_url'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_pdf'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_rtf'].'</p>';
+
$row = SurveyInfo::getInstance()->getSurveyRow();
# če imamo prepoznavanje uporabnik iz CMS, potem ponudimo tudi META_REFERAL_URL
- echo $lang['srv_alert_instruction_meta_referer_url'].'<br/>';
- echo $lang['srv_alert_instruction_system'];
- echo $lang['srv_alert_instruction_sample'];
- echo $lang['srv_alert_instruction_available'];
-
-# echo $lang['srv_alert_instruction3'];
+ if ($rowAlert['finish_respondent_cms'] == 1)
+ echo '<p>'.$lang['srv_alert_instruction_meta_referer_url'].'</p>';
+
+ echo '</div>';
+
+ echo '<div class="izpolnjena_spremenljivke">';
+
$sqlSistemske = sisplet_query("SELECT s.id, s.naslov, s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='$anketa' ORDER BY g.vrstni_red, s.vrstni_red");
$prefix = "";
+
while ($rowSistemske = mysqli_fetch_assoc($sqlSistemske)) {
- echo $prefix . '#' . $rowSistemske['variable'] . '#';
- $prefix = ", ";
+ $prefix = $prefix . $rowSistemske['variable'] . ', ';
}
- if ($prefix == "") { // ni sistemskih spremenljivk
- echo '<p class="red">'.$lang['srv_alert_no_sys_var'].'</p>';
+ if($prefix != "") {
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction_available'].'</p>';
+ echo '<p class="bottom16">'.rtrim($prefix, ", ").'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction_system'].'</p>';
+ echo '<p>'.$lang['srv_alert_instruction_sample'].'</p>';
}
- echo '</span>';
- echo '</div>';
+ else{ // ni sistemskih spremenljivk
+ echo '<p class="bold">'.$lang['srv_alert_no_sys_var'].'</p>';
+ }
+
+ echo '</div>';
+
+
echo '</div>';
- echo ' </fieldset>';
-
- echo '<br />';
-
- echo ' <span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
- echo '<div class="clr"></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo ' </form>';
} else if ($tab == 'expired') {
global $site_path, $global_user_id;
- //echo '<h4>' . $lang['srv_alert_expired_title'] . '</h4>'."\n";
+ //Obveščanje o izteku ankete
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m='.$tab.'" method="post" autocomplete="off">' . "\n";
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . "\n";
echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n";
echo ' <input type="hidden" name="m" value="' . $_GET['m'] . '" />' . "\n";
- echo ' <fieldset>'. "\n";
- echo ' <legend>' . $lang['srv_alert_expired_time_title'] . '</legend>'. "\n";
+
+ echo ' <fieldset>';
+ echo ' <legend>' . $lang['srv_alert_expired_2'] . '</legend>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="alert_expire_days">'.$lang['srv_alert_expire_days'].':</label>';
+ echo '<input type="text" class="large w200" id="alert_expire_days" name="alert_expire_days" value="'.$rowAlert['expire_days'].'" size="3" >';
+ echo '</div>';
- echo $lang['srv_alert_expire_days1'];
- echo '<input type="text" id="alert_expire_days" name="alert_expire_days" value="'.$rowAlert['expire_days'].'" size="3" >';
- echo $lang['srv_alert_expire_days2'];
- echo $lang['srv_alert_expire_expire_at'] . $rowS['expire'].'<span>'.$lang['at'].'00:00</span><br/>';
- echo $lang['srv_alert_expire_note_at'] . '<span id="calc_alert_expire">'.$rowAlert['newdate'].'</span><span>'.$lang['at'].'01:00</span><br/>';
- echo ' </fieldset>';
+ echo '<div class="setting_holder">';
+ echo '<p class="bold">'. $lang['srv_alert_expire_expire_at'] .'</p>';
+ echo $rowS['expire'].$lang['at'].'00:00';
+ echo '</div>';
- echo '<br />';
- echo ' <fieldset>'. "\n";
- echo ' <legend>' . $lang['srv_alert_prejemnik'] . '</legend>'. "\n";
- echo '<p><input type="checkbox" name="alert_expire_author" id="alert_expire_author" value="1" onChange="change_alert_respondent(\'expire_author\', $(this));return false;"' . ($rowAlert['expire_author'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_expire_author">';
+ echo '<div class="setting_holder">';
+ echo '<p class="bold">'. $lang['srv_alert_expire_note_at'] .'</p>';
+ echo '<p><span id="calc_alert_expire">'.$rowAlert['newdate'].'</span><span>'.$lang['at'].'01:00</span></p>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_alert_expire_prejemniki'].'</span>';
+
+ echo '<div class="setting_item" id="label_alert_expire_author">';
+ echo '<input type="checkbox" name="alert_expire_author" id="alert_expire_author" value="1" onChange="change_alert_respondent(\'expire_author\', $(this));return false;"' . ($rowAlert['expire_author'] == 1 ? ' checked' : '') . '>';
$this->display_alert_label('expire_author',($rowAlert['expire_author'] == 1));
- echo '</span></p>';
- echo '<p><input type="checkbox" name="alert_expire_other" id="alert_expire_other" value="1"' . (($rowAlert['expire_other'] == 1 || ($rowAlert['expire_other_emails'] && $rowAlert['expire_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'expire_other\');"><label for="alert_expire_other">' . $lang['email_prejemniki'] . $lang['email_one_per_line'] . '</label></p>';
- echo '<p id="alert_holder_expire_other_emails" '.($rowAlert['expire_other'] == 0 ? 'class="displayNone"' : '' ).'>';
- echo '<label for="alert_expire_other_emails">' . $lang['email'] . ':</label>' .
- ' <textarea name="alert_expire_other_emails" id="alert_expire_other_emails" style="height:100px" >' . $rowAlert['expire_other_emails'] . '</textarea>' .
- ' </p>';
- echo ' </fieldset>';
+ echo '</div>';
- echo '</fieldset>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_expire_other" id="alert_expire_other" value="1"' . (($rowAlert['expire_other'] == 1 || ($rowAlert['expire_other_emails'] && $rowAlert['expire_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'expire_other\');"><label for="alert_expire_other">' . $lang['email_prejemniki'] .'</label>';
+ echo '</div>';
- echo '<br />';
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_alert_oblika'] . '</legend>';
- echo '<div style="float:left; width:auto;">';
- echo '<p><label for="subject">' . $lang['subject'] . ': <input type="text" id="alert_expire_subject" name="alert_expire_subject" value="' . ($rowAlert['expire_subject'] ? $rowAlert['expire_subject'] : $lang['srv_alert_expire_subject']) . '" size="90"/></label></p>';
+ echo '<div class="setting_item">';
+
+ echo '<div class="setting_holder alert_other_emails '.($rowAlert['expire_other'] == 0 ? 'displayNone' : '' ).'" id="alert_holder_expire_other_emails">';
+ echo '<label for="alert_expire_other_emails">' . $lang['email_prejemniki_one_per_line'] . ':</label>';
+ echo '<textarea class="alert_other_emails" name="alert_expire_other_emails" id="alert_expire_other_emails" >' . $rowAlert['expire_other_emails'] . '</textarea>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="obvescanje_sidebyside_holder">';
+ echo '<div id="obvescanje_sidebyside_left">';
+
+ echo '<p class="bold caps bottom16">'.$lang['message_content'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="alert_delete_subject" id="alert_expire_subject" name="alert_expire_subject" value="' . ($rowAlert['expire_subject'] ? $rowAlert['expire_subject'] : $lang['srv_alert_expire_subject']) . '"/>';
+ echo '</div>';
if ($rowAlert['expire_text'] != ''){
$text = $rowAlert['expire_text'];
@@ -2946,56 +3310,81 @@ class SurveyAdminSettings {
}
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
- echo ' <p><label for="alert_expire_text">' . $lang['text'] . ':</label>';
- echo ' <textarea name="alert_expire_text" id="alert_expire_text" rows="3" >' . $text . '</textarea>';
- echo ' </p>';
- echo '</div>';
- echo '<div style="float:left; width:auto; max-width:550px; margin-left:10px;">';
- echo '<div id="div_error">';
- echo $lang['srv_alert_instruction1'];
- echo $lang['srv_alert_instruction4'];
+ echo '<div class="setting_holder">';
- echo '</div>';
- echo '</div>';
- echo '</fieldset>';
- echo '<br />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
- if ($_GET['s'] == '1') {
+ echo '<label class="bottom4" for="alert_expire_text">' . $lang['message'] . ':</label>';
+ echo '<textarea name="alert_expire_text" id="alert_expire_text">' . $text . '</textarea>';
+
+ echo '</div>';
+ echo '</div>';
+
+ //Navodila na desni
+ echo '<div id="obvescanje_sidebyside_right">';
+ echo '<div class="message_instructions">';
+ echo '<p class="bold caps bottom16">'.$lang['srv_alert_instruction1'].'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction1a'].':</p>';
+ echo '<p class="bottom16">'.$lang['srv_alert_instruction4'].'</p>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo '</form>';
- } else if ($tab == 'active') {
- //echo '<h4>' . $lang['srv_alert_active_title'] . '</h4>'."\n";
+ }
+
+ // Obveščanje o spremembi aktivnosti ankete
+ else if ($tab == 'active') {
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m='.$tab.'" method="post" autocomplete="off">' . "\n";
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . "\n";
echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n";
echo ' <input type="hidden" name="m" value="' . $_GET['m'] . '" />' . "\n";
- echo '<fieldset>'. "\n";
- echo '<legend>' . $lang['srv_alert_prejemnik'] . '</legend>'. "\n";
- echo '<p><input type="checkbox" name="alert_active_author" id="alert_active_author" value="1" onChange="change_alert_respondent(\'active_author\', $(this));return false;"' . ($rowAlert['active_author'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_active_author">';
- $this->display_alert_label('active_author',($rowAlert['active_author'] == 1));
- echo '</span></p>';
- echo '<p><input type="checkbox" name="alert_active_other" id="alert_active_other" value="1"' . (($rowAlert['active_other'] == 1 || ($rowAlert['active_other_emails'] && $rowAlert['active_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'active_other\');"><label for="alert_active_other">' . $lang['email_prejemniki'] . $lang['email_one_per_line'] . '</label></p>';
- echo '<p id="alert_holder_active_other_emails" '.($rowAlert['active_other'] == 0 ? 'class="displayNone"' : '' ).'>';
- echo '<label for="alert_active_other_emails">' . $lang['email'] . ':</label>';
- echo '<textarea name="alert_active_other_emails" id="alert_active_other_emails" style="height:100px" >' . $rowAlert['active_other_emails'] . '</textarea>' .
- '</p>';
- echo '</fieldset>';
-
- echo '</fieldset>';
-
- echo '<br />';
echo '<fieldset>';
- echo '<legend>' . $lang['srv_alert_oblika'] . '</legend>';
- echo '<div style="float:left; width:auto;">';
- echo '<p>' . $lang['srv_alert_oblika_deactivate_note'] . '</p>';
- echo '<p><label for="subject">' . $lang['subject'] . ': ';
- echo '<input type="text" name="alert_active_subject0" id="alert_active_subject0" value="' . ($rowAlert['active_subject0'] ? $rowAlert['active_subject0'] : $lang['srv_alert_active_subject0']) . '" size="90"/></label></p>';
+ echo '<legend>' . $lang['srv_alert_active_2'] . '</legend>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_alert_active_prejemniki'].'</span>';
+
+ echo '<div class="setting_item" id="label_alert_active_author">';
+ echo '<input type="checkbox" name="alert_active_author" id="alert_active_author" value="1" onChange="change_alert_respondent(\'active_author\', $(this));return false;"' . ($rowAlert['active_author'] == 1 ? ' checked' : '') . '>';
+ $this->display_alert_label('active_author',($rowAlert['active_author'] == 1));
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_active_other" id="alert_active_other" value="1"' . (($rowAlert['active_other'] == 1 || ($rowAlert['active_other_emails'] && $rowAlert['active_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'active_other\');"><label for="alert_active_other">' . $lang['email_prejemniki'] .'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+
+ echo '<div class="setting_holder alert_other_emails '.($rowAlert['active_other'] == 0 ? 'displayNone' : '' ).'" id="alert_holder_active_other_emails">';
+ echo '<label for="alert_active_other_emails">' . $lang['email_prejemniki_one_per_line'] . ':</label>';
+ echo '<textarea class="alert_other_emails" name="alert_active_other_emails" id="alert_active_other_emails">' . $rowAlert['active_other_emails'] . '</textarea>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="obvescanje_sidebyside_holder">';
+ echo '<div id="obvescanje_sidebyside_left">';
+
+ echo '<p class="bold caps bottom16">'.$lang['message_content'].'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_oblika_deactivate_note'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="alert_active_subject0" name="alert_active_subject0" value="' . ($rowAlert['active_subject0'] ? $rowAlert['active_subject0'] : $lang['srv_alert_active_subject0']) . '"/>';
+ echo '</div>';
if ($rowAlert['active_text0'] != '') {
$text0 = $rowAlert['active_text0'];
@@ -3006,15 +3395,21 @@ class SurveyAdminSettings {
$text0 = nl2br($lang['srv_alert_active_text0'].$signature);
}
+
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
- echo ' <p><label for="alert_active_text0">' . $lang['text'] . ':</label>';
- echo ' <textarea name="alert_active_text0" id="alert_active_text0" rows="3" >' . $text0 . '</textarea>';
- echo ' </p>';
+ echo '<div class="setting_holder">';
- echo '<br/>';
- echo '<p>' . $lang['srv_alert_oblika_activate_note'] . '</p>';
- echo '<p><label for="subject">' . $lang['subject'] . ': ';
- echo '<input type="text" name="alert_active_subject1" id="alert_active_subject1" value="' . ($rowAlert['active_subject1'] ? $rowAlert['active_subject1'] : $lang['srv_alert_active_subject1']) . '" size="90"/></label></p>';
+ echo '<label class="bottom4" for="alert_active_text0">' . $lang['message'] . ':</label>';
+ echo '<textarea name="alert_active_text0" id="alert_active_text0">' . $text0 . '</textarea>';
+
+ echo '</div>';
+
+ echo '<p class="bold top32 bottom16">'.$lang['srv_alert_oblika_activate_note'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="alert_active_subject1" name="alert_active_subject1" value="' . ($rowAlert['active_subject1'] ? $rowAlert['active_subject1'] : $lang['srv_alert_active_subject1']) . '"/>';
+ echo '</div>';
if ($rowAlert['active_text1'] != '') {
$text1 = $rowAlert['active_text1'];
@@ -3025,55 +3420,81 @@ class SurveyAdminSettings {
$text1 = nl2br($lang['srv_alert_active_text1'].$signature);
}
+
+ echo '<div class="setting_holder">';
+
+ echo '<label class="bottom4" for="alert_active_text1">' . $lang['message'] . ':</label>';
+ echo '<textarea name="alert_active_text1" id="alert_active_text1">' . $text1 . '</textarea>';
+
+ echo '</div>';
+ echo '</div>';
- echo ' <p><label for="alert_active_text1">' . $lang['text'] . ':</label>';
- echo ' <textarea name="alert_active_text1" id="alert_active_text1" rows="3" >' . $text1 . '</textarea>';
- echo ' </p>';
+ //Navodila na desni
+ echo '<div id="obvescanje_sidebyside_right">';
+ echo '<div class="message_instructions">';
+ echo '<p class="bold caps bottom16">'.$lang['srv_alert_instruction1'].'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction1a'].':</p>';
+ echo '<p class="bottom16">'.$lang['srv_alert_instruction5'].'</p>';
+ echo '</div>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
echo '</div>';
- echo '<div style="float:left; width:auto; max-width:550px; margin-left:10px;">';
- echo '<div id="div_error">';
- echo $lang['srv_alert_instruction1'];
- echo $lang['srv_alert_instruction5'];
- echo '</div>';
- echo '</div>';
- echo '</fieldset>';
- echo '<br />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
- if ($_GET['s'] == '1') {
+
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo '</form>';
- } else if ($tab == 'delete') {
- //echo '<h4>' . $lang['srv_alert_delete_title'] . '</h4>'."\n";
+ }
+
+ else if ($tab == 'delete') {
echo ' <form name="alertanketa_' . $anketa . '" action="ajax.php?a=editanketaalert&m='.$tab.'" method="post" autocomplete="off">' . "\n";
echo ' <input type="hidden" name="anketa" value="' . $anketa . '" />' . "\n";
echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n";
echo ' <input type="hidden" name="m" value="' . $_GET['m'] . '" />' . "\n";
- echo '<fieldset>'. "\n";
- echo '<legend>' . $lang['srv_alert_prejemnik'] . '</legend>'. "\n";
- echo '<p><input type="checkbox" name="alert_delete_author" id="alert_delete_author" value="1" onChange="change_alert_respondent(\'delete_author\', $(this));return false;"' . ($rowAlert['delete_author'] == 1 ? ' checked' : '') . '>';
- echo '<span id="label_alert_delete_author">';
+ //Obveščanje o izbrisu ankete
+ echo '<fieldset>';
+ echo '<legend>' . $lang['srv_alert_surveydelete'] . '</legend>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_alert_surveydelete_text'].'</span>';
+
+ echo '<div class="setting_item" id="label_alert_delete_author">';
+ echo '<input type="checkbox" name="alert_delete_author" id="alert_delete_author" value="1" onChange="change_alert_respondent(\'delete_author\', $(this));return false;"' . ($rowAlert['delete_author'] == 1 ? ' checked' : '') . '>';
$this->display_alert_label('delete_author',($rowAlert['delete_author'] == 1));
- echo '</span></p>';
- echo '<p><input type="checkbox" name="alert_delete_other" id="alert_delete_other" value="1"' . (($rowAlert['delete_other'] == 1 || ($rowAlert['delete_other_emails'] && $rowAlert['delete_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'delete_other\');"><label for="alert_delete_other">' . $lang['email_prejemniki'] . $lang['email_one_per_line'] . '</label></p>';
- echo '<p id="alert_holder_delete_other_emails" '.($rowAlert['delete_other'] == 0 ? 'class="displayNone"' : '' ).'>';
- echo '<label for="alert_delete_other_emails">' . $lang['email'] . ':</label>';
- echo '<textarea name="alert_delete_other_emails" id="alert_delete_other_emails" style="height:100px" >' . $rowAlert['delete_other_emails'] . '</textarea>';
- echo '</p>';
- echo '</fieldset>';
+ echo '</div>';
- echo '</fieldset>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_delete_other" id="alert_delete_other" value="1"' . (($rowAlert['delete_other'] == 1 || ($rowAlert['delete_other_emails'] && $rowAlert['delete_other'] != 0)) ? ' checked' : '') . ' onchange="toggleStatusAlertOtherCheckbox(\'delete_other\');"><label for="alert_delete_other">' . $lang['email_prejemniki'] .'</label>';
+ echo '</div>';
- echo '<br />';
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_alert_oblika'] . '</legend>';
- echo '<div style="float:left; width:auto;">';
- echo '<p><label for="subject">' . $lang['subject'] . ': <input type="text" id="alert_delete_subject" name="alert_delete_subject" value="' . ($rowAlert['delete_subject'] ? $rowAlert['delete_subject'] : $lang['srv_alert_delete_subject']) . '" size="90"/></label></p>';
+ echo '<div class="setting_item">';
+
+ echo '<div class="setting_holder alert_other_emails '.($rowAlert['delete_other'] == 0 ? 'displayNone' : '' ).'" id="alert_holder_delete_other_emails">';
+ echo '<label for="alert_delete_other_emails">' . $lang['email_prejemniki_one_per_line'] . ':</label>';
+ echo '<textarea class="alert_other_emails" name="alert_delete_other_emails" id="alert_delete_other_emails">' . $rowAlert['delete_other_emails'] . '</textarea>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="obvescanje_sidebyside_holder">';
+ echo '<div id="obvescanje_sidebyside_left">';
+
+ echo '<p class="bold caps bottom16">'.$lang['message_content'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="subject">' . $lang['subject'] . ': </label>';
+ echo '<input type="text" class="large wauto" id="alert_delete_subject" name="alert_delete_subject" value="' . ($rowAlert['delete_subject'] ? $rowAlert['delete_subject'] : $lang['srv_alert_delete_subject']) . '"/>';
+ echo '</div>';
if ($rowAlert['delete_text'] != '') {
$text = $rowAlert['delete_text'];
@@ -3084,25 +3505,37 @@ class SurveyAdminSettings {
$text = nl2br($lang['srv_alert_delete_text'].$signature);
}
+
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
- echo ' <p><label for="alert_delete_text">' . $lang['text'] . ':</label>';
- echo ' <textarea name="alert_delete_text" id="alert_delete_text" rows="3" >' . $text . '</textarea>';
- echo ' </p>';
+ echo '<div class="setting_holder">';
+
+ echo '<label class="bottom4" for="alert_delete_text">' . $lang['message'] . ':</label>';
+ echo '<textarea name="alert_delete_text" id="alert_delete_text">' . $text . '</textarea>';
+
echo '</div>';
- echo '<div style="float:left; width:auto; max-width:550px; margin-left:10px;">';
- echo '<div id="div_error">';
- echo $lang['srv_alert_instruction1'];
- echo $lang['srv_alert_instruction5'];
echo '</div>';
+
+ //Navodila na desni
+ echo '<div id="obvescanje_sidebyside_right">';
+ echo '<div class="message_instructions">';
+ echo '<p class="bold caps bottom16">'.$lang['srv_alert_instruction1'].'</p>';
+ echo '<p class="bold bottom16">'.$lang['srv_alert_instruction1a'].':</p>';
+ echo '<p class="bottom16">'.$lang['srv_alert_instruction5a'].'</p>';
echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
- if ($_GET['s'] == '1') {
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.alertanketa_' . $rowS['id'] . '.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo '</form>';
@@ -3153,7 +3586,7 @@ class SurveyAdminSettings {
global $global_user_id;
global $mysql_database_name;
- echo '<fieldset>';
+ echo '<fieldset id="email_streznik_anketa">';
echo '<legend>'.$lang['srv_user_base_email_server_settings'].'</legend>';
$row = SurveyInfo::getInstance()->getSurveyRow();
@@ -3161,7 +3594,7 @@ class SurveyAdminSettings {
// Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
if($isEmail)
- echo '<p class="red bold">'.$lang['srv_email_server_settings_warning'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_email_server_settings_warning'].'</p>';
echo '<form name="settingsanketa_' . $row['id'] . '" action="ajax.php?a=editanketasettings&m=email_server" method="post" autocomplete="off">' . "\n\r";
@@ -3176,20 +3609,31 @@ class SurveyAdminSettings {
// Dostop za posiljanje mailov preko 1ka serverja
$enabled1ka = ( $MA->is1KA() || (($admin_type == 0) && ($mysql_database_name == 'www1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'real1kasi' || $mysql_database_name == '1kaarnessi')) ) ? true : false;
- echo '<p>';
- echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span>&nbsp;';
- echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">';
- echo $lang['srv_email_setting_adapter0']. ' </label>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_select_server'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="SMTPMailMode0" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">';
+ echo '<label for="SMTPMailMode0">'.$lang['srv_email_setting_adapter0']. ' </label>';
+ echo '</div>';
+
// Google smtp je viden samo starim, kjer je ze vklopljen
- if($MA->isGoogle()){
- echo '<label><input type="radio" name="SMTPMailMode" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">';
- echo $lang['srv_email_setting_adapter1'].' </label>';
- }
- echo '<label><input type="radio" name="SMTPMailMode" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">';
- echo $lang['srv_email_setting_adapter2'].' </label>';
+ if($MA->isGoogle()){
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="SMTPMailMode" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">';
+ echo '<label>'.$lang['srv_email_setting_adapter1'].' </label>';
+ echo '</div>';
+ }
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="SMTPMailMode" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">';
+ echo '<label>'.$lang['srv_email_setting_adapter2'].' </label>';
echo Help :: display('srv_mail_mode');
- echo '</p>';
-
+ echo '</div>';
+
+ echo '</div>';
+
#1KA
$enkaSettings = $MA->get1KASettings($raziskave=true);
@@ -3200,7 +3644,7 @@ class SurveyAdminSettings {
echo '<p><label>'.$lang['srv_email_setting_from'].'<span>'.$enkaSettings['SMTPFrom'].'</span><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'"></label>';
echo '</p>';
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
+ echo '<p><label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
echo '</p>';
echo '</div>';
@@ -3213,7 +3657,7 @@ class SurveyAdminSettings {
echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom1" value="'.$enkaSettings['SMTPFrom'].'"></label>';
echo '</p>';
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
+ echo '<p><label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
echo '</p>';
#Password
echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
@@ -3223,89 +3667,155 @@ class SurveyAdminSettings {
#SMTP
$enkaSettings = $MA->getSMTPSettings();
echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() ? ' class="displayNone"' : '').'>';
- echo '<span class="italic">'.$lang['srv_email_setting_adapter2_note'].'</span><br />';
- echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span><br />';
+ //echo '<span class="italic">'.$lang['srv_email_setting_adapter2_note'].'</span><br />';
+ echo '<p class="semi-bold bottom16">'.$lang['srv_email_setting_settings'].'</p>';
+
+ echo '<div class="setting_holder horizontal">';
+
# from - NICE
- echo '<p><label>'.$lang['srv_email_setting_from_nice'].'<input type="text" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'"></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_from_nice'].'</span>';
+ echo '<input type="text" class="text large" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'">';
+ echo '</div>';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_from'].'</span>';
+ echo '<input type="text" class="text large" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</span>';
+ echo '<input type="text" class="text large" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" >';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+
#Username
- echo '<p><label>'.$lang['srv_email_setting_username'].'<input type="text" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'" ></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_username'].'</span>';
+ echo '<input type="text" class="text large" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'" >';
+ echo '</div>';
+
#Password
- echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_password'].'</span>';
+ echo '<input type="password" class="text large" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+
#autentikacija
- echo '<p>';
- echo $lang['srv_email_setting_autentication'];
- echo '<label><input type="radio" name="SMTPAuth2" value="0" '.((int)$enkaSettings['SMTPAuth'] != 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_no'].'</label>';
- echo '<label><input type="radio" name="SMTPAuth2" value="1" '.((int)$enkaSettings['SMTPAuth'] == 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_yes'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_autentication'].'</span>';
+
+ echo '<div class="fold">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="SMTPAuth20" name="SMTPAuth2" value="0" '.((int)$enkaSettings['SMTPAuth'] != 1 ? 'checked ="checked" ' : '').'>';
+ echo '<label for="SMTPAuth20">'. $lang['srv_email_setting_no'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="SMTPAuth21" name="SMTPAuth2" value="1" '.((int)$enkaSettings['SMTPAuth'] == 1 ? 'checked ="checked" ' : '').'>';
+ echo '<label for="SMTPAuth21">'. $lang['srv_email_setting_yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+
#Varnost SMTPSecure
- echo '<p>';
- echo $lang['srv_email_setting_encryption'];
- echo '<label><input type="radio" name="SMTPSecure2" value="0" '.((int)$enkaSettings['SMTPSecure'] == 0 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_none'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="ssl" '.($enkaSettings['SMTPSecure'] == 'ssl' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_ssl'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="tls" '.($enkaSettings['SMTPSecure'] == 'tls' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_tls'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_encryption'].'</span>';
+ echo '<div class="fold">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="SMTPSecure20" value="0" '.((int)$enkaSettings['SMTPSecure'] == 0 ? 'checked ="checked" ' : '').'>';
+ echo '<label for="SMTPSecure20">'. $lang['srv_email_setting_encryption_none'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="SMTPSecure21" value="ssl" '.($enkaSettings['SMTPSecure'] == 'ssl' ? 'checked ="checked" ' : '').'>';
+ echo '<label for="SMTPSecure21">'. $lang['srv_email_setting_encryption_ssl'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="SMTPSecure22" value="tls" '.($enkaSettings['SMTPSecure'] == 'tls' ? 'checked ="checked" ' : '').'>';
+ echo '<label for="SMTPSecure22">'. $lang['srv_email_setting_encryption_tls'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+
#port
- echo '<p><label>'.$lang['srv_email_setting_port'].'<input type="number" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'" style="width:80px;"></label>';
- echo ' '.$lang['srv_email_setting_port_note'];
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_port'].$lang['srv_email_setting_port_note'].'</span>';
+ echo '<input type="number" class="text large min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'">';
+ echo '</div>';
+
#host
- echo '<p><label>'.$lang['srv_email_setting_host'].'<input type="text" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'" ></label>';
- echo '</p>';
- #delay
- echo '<p><label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').': <select name="SMTPDelay2">'
- /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
- . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
- . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
- . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
- . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
- . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
- . '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
- . '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
- . '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
- . '<option value="4000000" '.($enkaSettings['SMTPDelay']=="4000000"?'selected="selected"':'') .'>4 sec (max 15 / min)</option>'
- . '<option value="5000000" '.($enkaSettings['SMTPDelay']=="5000000"?'selected="selected"':'') .'>5 sec (max 12 / min)</option>'
- . '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
- . '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
- . '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
- . '</select></label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_host'].'</span>';
+ echo '<input type="text" class="text large" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'" >';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+
+ #delay
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</span>';
+ echo '<select class="dropdown large" name="SMTPDelay2">'
+ /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
+ . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
+ . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
+ . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
+ . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
+ . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
+ . '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
+ . '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
+ . '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
+ . '<option value="4000000" '.($enkaSettings['SMTPDelay']=="4000000"?'selected="selected"':'') .'>4 sec (max 15 / min)</option>'
+ . '<option value="5000000" '.($enkaSettings['SMTPDelay']=="5000000"?'selected="selected"':'') .'>5 sec (max 12 / min)</option>'
+ . '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
+ . '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
+ . '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
+ . '</select>';
+ echo '</div>';
+
+
+ echo '</div>';
- echo '</div>';
echo '</form>';
echo '</fieldset>';
-
-
- echo '<br class="clr" />';
-
- // Gumb shrani
- echo '<span class="floatLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">';
- echo $lang['srv_email_setting_btn_save'] . '</a></div></span>';
-
+
+ echo '<div class="button_holder">';
// Gumb preveri nastavitve
- echo '<span id="send_mail_mode_test" class="floatLeft spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;">';
- echo $lang['srv_email_setting_btn_test'].'</a></div></span>';
+ echo '<button class="medium white-black" onClick="showTestSurveySMTP(); return false;">'.$lang['srv_email_setting_btn_test'].'</button>';
+ // Gumb shrani
+ echo '<button class="medium blue" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">'.$lang['srv_email_setting_btn_save'].'</button>';
+ echo '</div>';
- if ($_GET['s'] == '1') {
- echo '<div id="success_save" style="float:left; display:inline; margin: -2px 0 0 0;"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
}
@@ -3365,7 +3875,6 @@ class SurveyAdminSettings {
$sa = new SurveyAdmin(1, $this->anketa);
$sa->show_mailto_users('all', null);
echo '</div>';
- echo '<div class="clr"></div>';
} else { // pošljemo emaile
@@ -3551,71 +4060,96 @@ class SurveyAdminSettings {
global $site_url;
global $site_path;
- echo '<fieldset>';
- echo '<legend >' . $lang['srv_splosna_navodila'] . '</legend>';
-
- echo '<p>'.$lang['srv_social_settings_text1'].'</p>';
- echo '<p>'.$lang['srv_social_settings_text2'].'</p>';
- echo '<p>'.$lang['srv_social_settings_text3'].'</p>';
- echo '<p>'.$lang['srv_social_settings_text4'].'</p>';
- echo '<p>'.$lang['srv_social_settings_text5'].' <a href="http://www.1ka.si/a/3510">http://www.1ka.si/a/3510</a>, </p>';
- echo '<p>'.$lang['srv_social_settings_text6'].' <a href="http://www.1ka.si/admin/survey/index.php?a=knjiznica">'.$lang['srv_library'].'</a> '.$lang['srv_social_settings_text7'].'</p>';
- echo '<p><a href="index.php?anketa='.$this->anketa.'">'.$lang['edit2'].'</a>'.$lang['srv_social_settings_text8'].'</p>';
+ echo '<p class="top16 bottom16">'.$lang['srv_social_settings_text1'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_social_settings_text2'].$lang['srv_social_settings_text3'].$lang['srv_social_settings_text4'].'</p>';
+ echo '<p>'.$lang['srv_social_settings_text5'].'<a href="index.php?anketa='.$this->anketa.'">'.$lang['srv_social_settings_text6'].'</a>.</p>';
- echo '</fieldset>';
// Omrežja so sestavljane vprašanja. Začnejo se iz generatorja imen (name generator). S tem respondent (ego) navede objekte, prijatelje - alterje. , s katerim pridobimo imena pzanke in vprašanj. Druga kompnenta je zanka, ki za vse alterje določenega ega sproži enaka vprašanja. Dretja komponenta so vprašanja. Primer omrežja je tukaj, http://www.1ka.si/a/3510, vprašalnik pa najdemo v knjižnjic med Primerov 1KA anket http://www.1ka.si/admin/survey/index.php?a=knjiznica
}
/**
* @desc prikaze tab arhivi
*/
- function arhivi() {//OSTANE
+ function arhivi() {
global $lang;
- echo '<fieldset style="width:100%">';
+ echo '<fieldset>';
echo '<legend >' . $lang['srv_questionnaire_archives'] . '</legend>';
-
- echo '<p style="margin-bottom:5px;"><span class="bold spaceRight" style="margin-top:5px;">' . $lang['srv_backup_label'] . '</span></p>';
- echo '<p style="margin-top:5px;margin-bottom:10px;">'.$lang['srv_note'].': <input class="" name="intro_opomba" id="intro_opomba" type="text" style="width:400px"></p>';
-
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="index.php?anketa=' . $this->anketa . '&a=backup_create" onclick="create_archive_survey(\'' . $this->anketa .'\',\'' . $lang['srv_wait_a_moment'] .'\'); return false;">';
- echo $lang['srv_backup_button'];
- echo '</a></div></span>';
-
- echo '<br /><br />';
+
+ echo '<p class="bottom16">'.$lang['srv_questionnaire_archives_text'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo $lang['srv_questionnaire_archives_note'].':';
+ echo '<input class="large w400" name="intro_opomba" id="intro_opomba" type="text"/>';
+ echo '</div>';
+
+ echo '<div class="button_holder bottom16">';
+ echo '<button class="medium blue" type="button" href="index.php?anketa=' . $this->anketa . '&a=backup_create" onclick="create_archive_survey(\'' . $this->anketa .'\'); return false;">'.$lang['srv_backup_button'].'</button>';
+ echo '</div>';
// Seznam ustvarjenih arhivov
$sql = sisplet_query("SELECT a.id, a.naslov, a.intro_opomba, a.insert_time, a.edit_time, CONCAT(i.name, ' ', i.surname) AS insert_name, CONCAT(e.name, ' ', e.surname) AS edit_name FROM srv_anketa a, users i, users e WHERE a.insert_uid=i.id AND a.edit_uid=e.id AND a.backup = '$this->anketa' AND a.active>='0' ORDER BY a.insert_time DESC");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
- if (mysqli_num_rows($sql) > 0)
- echo '<br /><strong>' . $lang['srv_backup_list'] . ':</strong>';
-
- while ($row = mysqli_fetch_array($sql)) {
- echo '<div style="margin: 5px 0 10px 10px;">';
- echo '<span class="bold"><a href="index.php?anketa=' . $row['id'] . '">' . $row['naslov'] . '</a></span> '.($row['intro_opomba']!='' ? ' - <i>'.$row['intro_opomba'].'</i>' : '');
- echo '<br />(' . $lang['sent_by'] . ': <b>' . $row['insert_name'].'</b> ' . datetime($row['insert_time']) . ', ' . $lang['edit_by'] . ': <b>' . $row['edit_name'].'</b> ' . datetime($row['edit_time']) . ')';
- echo '<br /><a href="#" onclick="javascript:anketa_delete(\'' . $row['id'] . '\', \'' . $lang['srv_anketadeleteconfirm'] . '\'); return false;">' . $lang['srv_survey_archives_delete_survey'] . '</a>, <a href="index.php?anketa=' . $row['id'] . '&a=backup_restore">' . $lang['srv_anketarestore'] . '</a>';
- echo '</div>';
+ if (mysqli_num_rows($sql) > 0) {
+ echo '<p class="bold">' . $lang['srv_backup_list'] . ':</p>';
+
+ echo '<table id="survey_archives_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_questionnaire_archives_date'].'</th>';
+ echo '<th>'.$lang['srv_questionnaire_archives_by'].'</th>';
+ echo '<th>'.$lang['srv_questionnaire_archives_note2'].'</th>';
+ echo '<th></th>';
+ echo '</tr>';
+
+ while ($row = mysqli_fetch_array($sql)) {
+ echo '<tr>';
+ echo '<td>'.datetime($row['insert_time']).'</td>';
+ echo '<td>'.$row['insert_name'].'</td>';
+
+ if ($row['intro_opomba']=='')
+ $opomba = "/";
+ else if (strlen($row['intro_opomba']) > 40)
+ $opomba = substr($row['intro_opomba'], 0, 37).'...';
+ else
+ $opomba = $row['intro_opomba'];
+
+ echo '<td>'.$opomba.'</td>';
+
+ //Ikone
+ echo '<td class="right">';
+ echo '<div class="icon_holder multiple">';
+ echo '<a class="faicon" href="#" onclick="javascript:anketa_delete(\'' . $row['id'] . '\', \'' . $lang['srv_anketadeleteconfirm'] . '\'); return false;"><span class="faicon trash empty"></span></a>';
+ echo '<button class="table-inline white-black caps" type="button" onclick="window.location.href=\'index.php?anketa=' . $row['id'] . '&a=backup_restore\'">'.$lang['srv_questionnaire_archives_activate'].'</button>';
+ echo '</div>';
+ echo '</td>';
+
+ echo '</tr>';
+ }
+
+ echo '</table>';
+
}
+
+
echo '</fieldset>';
}
function arhivi_data() {
global $lang;
- echo '<fieldset style="width:100%">';
+ echo '<fieldset>';
echo '<legend>' . $lang['srv_arhiv_data'] . '</legend>';
-
- echo '<p style="margin-bottom:5px;"><span class="bold spaceRight" style="margin-top:5px;">' . $lang['srv_backup_data_label'] . '</span></p>';
-
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="ajax.php?anketa=' . $this->anketa . '&a=backup_data" onclick="create_archive_survey_data(\'' . $this->anketa .'\',\'' . $lang['srv_wait_a_moment'] .'\'); return false;">';
- echo $lang['srv_backup_data_button'];
- echo '</a></div></span>';
- echo '<br /><br />';
+ echo '<p class="bottom16">'.$lang['srv_backup_data_text'].'</p>';
+
+ echo '<div class="button_holder bottom16">';
+ echo '<button class="medium blue" type="button" href="ajax.php?anketa=' . $this->anketa . '&a=backup_data" onclick="create_archive_survey_data(\'' . $this->anketa .'\'); return false;">'.$lang['srv_backup_data_label'].'</button>';
+ echo '</div>';
+ // Seznam ustvarjenih arhivov - 2. faza: kdo je arhiviral, opomba, možnost izbrisa
$backups = array();
if ($handle = opendir( dirname(__FILE__) . '/SurveyBackup/' )) {
while (false !== ($entry = readdir($handle))) {
@@ -3629,13 +4163,37 @@ class SurveyAdminSettings {
closedir($handle);
}
if (count($backups) > 0) {
- echo '<br /><span class="bold">' . $lang['srv_backup_data_list'] . ':</span>';
+ echo '<p class="bold">' . $lang['srv_backup_data_list'] . ':</p>';
+
+ echo '<table id="survey_data_archives_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_questionnaire_archives_date'].'</th>';
+ echo '<th></th>';
+ echo '</tr>';
+
foreach ($backups AS $file) {
$e = explode('-', $file);
$e[2] = str_replace('.1ka', '', $e[2]);
- echo '<br /><span style="padding-left:10px;">'.$e[1].' '.$e[2].' - <a href="ajax.php?anketa='.$this->anketa.'&a=backup_restore&filename='.$file.'">'.$lang['srv_anketarestoredata'].'</a></span>';
+ $e[2] = str_replace('.', ':', $e[2]);
+ $e[2] = substr($e[2], 0, -3);
+
+ echo '<tr>';
+ echo '<td>'.$e[1].' '.$e[2].'</td>';
+
+
+ //Ikone
+ echo '<td class="right">';
+ echo '<div class="icon_holder multiple">';
+ //echo '<a class="faicon" href="#" onclick="delete_funkcija_todo"><span class="faicon trash empty"></span></a>';
+ echo '<button class="table-inline white-black caps" type="button" onclick="window.location.href=\'ajax.php?anketa='.$this->anketa.'&a=backup_restore&filename='.$file.'\'">'.$lang['srv_questionnaire_archives_activate'].'</button>';
+ echo '</div>';
+ echo '</td>';
+
+ echo '</tr>';
+
}
- echo '<br /><br />';
+ echo '</table>';
}
echo '</fieldset>';
@@ -3644,94 +4202,115 @@ class SurveyAdminSettings {
function arhivi_testdata() {
global $lang;
- $str_testdata = "SELECT count(*) FROM srv_user WHERE ank_id='".$this->anketa."' AND (testdata='1' OR testdata='2')";
- $query_testdata = sisplet_query($str_testdata);
- list($testdata) = mysqli_fetch_row($query_testdata);
-
- $str_testdata_auto = "SELECT count(*), add_date, add_uid FROM srv_testdata_archive WHERE ank_id='".$this->anketa."' GROUP BY add_date";
- $query_testdata_auto = sisplet_query($str_testdata_auto);
- $auto_testdata = array();
- while (list($_cnt, $_date, $_uid) = mysqli_fetch_row($query_testdata_auto) ) {
- $testdata_auto+=$_cnt;
- $auto_testdata[] = $cnt;
- }
-
echo '<fieldset>';
echo '<legend>'.$lang['srv_arhiv_testdata'].'</legend>';
-
- echo $lang['srv_archive_test_data_count'].(int)$testdata;
- if ($testdata_auto > 0) {
- echo $lang['srv_archive_test_data_auto'].(int)$testdata_auto;
+
+ $link = SurveyInfo::getSurveyLink();
+ $surveyName = SurveyInfo::getInstance()->getSurveyTitle();
+
+ $preview_disableif = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disableif');
+ $preview_disablealert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disablealert');
+ $preview_displayifs = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayifs');
+ $preview_displayvariables = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayvariables');
+ $preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment');
+ $preview_options = '' . ($preview_disableif == 1 ? '&disableif=1' : '') . ($preview_disablealert == 1 ? '&disablealert=1' : '') . ($preview_displayifs == 1 ? '&displayifs=1' : '') . ($preview_displayvariables == 1 ? '&displayvariables=1' : '') . ($preview_hidecomment == 1 ? '&hidecomment=1' : '') . '';
+
+ echo '<p class="bottom16">'.$lang['srv_archive_test_data_text1'].'<a href="index.php?anketa=' . $this->anketa . '&a=testiranje&m=testnipodatki">'.$lang['srv_archive_test_data_text1a'].'</a>'.$lang['srv_archive_test_data_text2'].'<a href="' . $link . '&preview=on&testdata=on' . $preview_options . '" title="" target="_blank">'.$lang['srv_archive_test_data_text2a'].'</a>'.$lang['srv_archive_test_data_text3'].'</p>';
+
+ //Nimamo nobenih vnosov
+ $str_testdata_any = "SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id='".$this->anketa."' AND (testdata='1' OR testdata='2') GROUP BY day(time_insert)";
+ $query_testdata_any = sisplet_query($str_testdata_any);
+ list($testdata_any) = mysqli_fetch_row($query_testdata_any);
+ if ((int)$testdata_any == 0) {
+ echo '<p class="top16">'.$lang['srv_archive_test_data_none1']. $surveyName . $lang['srv_archive_test_data_none2'] . $lang['srv_archive_test_data_none3'].'.</p>';
+ }
+ else { // Imamo vnose, izpišemo eno ali obe tabeli
+
+ // Avtomatski vnosi
+ $str_testdata = "SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id='".$this->anketa."' AND (testdata='2') GROUP BY day(time_insert)";
+ $query_testdata = sisplet_query($str_testdata);
+ $table_exists1 = 0;
+ while ($testdata = mysqli_fetch_array($query_testdata)) {
+ // Izpišemo naslov in začetek tabele
+ if($table_exists1==0 && $testdata['cnt']!=0) {
+ echo '<p class="bold">'.$lang['srv_archive_test_data_timeline_auto'].$surveyName.':</p>';
+ echo '<table id="testni_vnosi">';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_archive_test_data_date'].'</th>';
+ echo '<th class="right">'.$lang['srv_archive_test_data_count'].'</th>';
+ echo '</tr>';
+
+ $table_exists1=1;
+ }
+
+ echo '<tr>';
+ echo '<td>'.date("d.m.Y",strtotime($testdata['time'])).'</td>';
+ echo '<td class="right">'.$testdata['cnt'].'</td>';
+ echo '</tr>';
+ }
+
+ if($table_exists1==1) {
+ echo '</table>';
+ }
+
+ // Ročni vnosi
+ $str_testdata = "SELECT count(*) as cnt, time_insert as time FROM srv_user WHERE ank_id='".$this->anketa."' AND (testdata='1') GROUP BY day(time_insert)";
+ $query_testdata = sisplet_query($str_testdata);
+ $table_exists2 = 0;
+ while ($testdata = mysqli_fetch_array($query_testdata)) {
+ // Izpišemo naslov in začetek tabele
+ if($table_exists2==0 && $testdata['cnt']!=0) {
+ echo '<p class="bold top16">'.$lang['srv_archive_test_data_timeline_manual'].$surveyName.':</p>';
+ echo '<table id="testni_vnosi">';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_archive_test_data_date'].'</th>';
+ echo '<th class="right">'.$lang['srv_archive_test_data_count'].'</th>';
+ echo '</tr>';
+
+ $table_exists2=1;
+ }
+
+ echo '<tr>';
+ echo '<td>'.date("d.m.Y",strtotime($testdata['time'])).'</td>';
+ echo '<td class="right">'.$testdata['cnt'].'</td>';
+ echo '</tr>';
+ }
+
+ if($table_exists2==1) {
+ echo '</table>';
+ }
}
-
echo '</fieldset>';
}
function arhivi_survey() {
global $lang;
- // Uvoz/izvoz samo ankete - po novem je uvoz pri kreiranju ankete
+ // Izvoz samo ankete
if($_GET['m'] == 'survey'){
echo '<fieldset>';
- echo '<legend>'.$lang['srv_survey_archives_ie_title'].'</legend>';
+ echo '<legend>'.$lang['srv_survey_archives_ie_title'].Help::display('srv_arhiv_vprasalnik').'</legend>';
- echo '<p class="italic">'.$lang['srv_survey_archives_note_survey'].'</p>';
-
- // Izvoz
- echo '<p>';
- echo '<span class="bold">'.$lang['srv_survey_archives_export'].'</span>';
- echo '<br />'.$lang['srv_survey_archives_export_text'];
- echo '<span class="buttonwrapper floatLeft" style="margin-top:3px;" title="'.$lang['srv_survey_archives_export_save'].'"><a class="ovalbutton ovalbutton_orange" href="ajax.php?a=archive_download&anketa='.$this->anketa.'">'.$lang['srv_survey_archives_export_save'].'</a></span>';
- echo '</p>';
-
- echo '<br /><br />';
-
- // Uvoz
- /*echo '<p style="margin-bottom:20px;">';
- echo '<span class="bold">'.$lang['srv_survey_archives_import'].'</span>';
- echo '<br />'.$lang['srv_survey_archives_import_text'];
- echo '<br /><span class="buttonwrapper floatLeft" style="margin-top:3px;" title="'.$lang['srv_survey_archives_import_import'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#restore\').toggle(); return false;">'.$lang['srv_survey_archives_import_import'].'</a></span>';
- echo '<br />';
- echo '<form style="display:none" id="restore" action="ajax.php?a=archive_restore" method="post" name="restorefrm" enctype="multipart/form-data" >
- <span style="line-height:18px;">'.$lang['srv_arhiv_datoteka_save_txt2'].':
- <input type="hidden" name="has_data" value="0" />
- <input type="file" name="restore" onchange="document.restorefrm.submit();" /></span>
- <br /><span class="italic">'.$lang['srv_arhiv_datoteka_restore_help'].'</span>
- </form>';
- echo '</p>';*/
-
+ echo '<p>'.$lang['srv_survey_archives_note_survey'].'</p>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?a=archive_download&anketa='.$this->anketa.'\';" >'.$lang['srv_survey_archives_export'].'</button>';
+ echo '</div>';
+
echo '</fieldset>';
}
- // Uvoz/izvoz ankete s podatki - po novem je uvoz pri kreiranju ankete
+
+ // Izvoz ankete s podatki
else{
echo '<fieldset>';
- echo '<legend>'.$lang['srv_survey_archives_ie_data_title'].'</legend>';
-
- echo '<p class="italic">'.$lang['srv_survey_archives_note_survey_data'].'</p>';
-
- // Izvoz
- echo '<p>';
- echo '<span class="bold">'.$lang['srv_survey_archives_export'].'</span>';
- echo '<br />'.$lang['srv_survey_archives_export_text'];
- echo '<span class="buttonwrapper floatLeft" style="margin-top:3px;" title="'.$lang['srv_survey_archives_export_save'].'"><a class="ovalbutton ovalbutton_orange" href="ajax.php?a=archive_download&anketa='.$this->anketa.'&data=true">'.$lang['srv_survey_archives_export_save'].'</a></span>';
- echo '</p>';
-
- echo '<br /><br />';
-
- // Uvoz
- /*echo '<p style="margin-bottom:20px;">';
- echo '<span class="bold">'.$lang['srv_survey_archives_import'].'</span>';
- echo '<br />'.$lang['srv_survey_archives_import_text'];
- echo '<br /><span class="buttonwrapper floatLeft" style="margin-top:3px;" title="'.$lang['srv_survey_archives_import_import'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#restore_data\').toggle(); return false;">'.$lang['srv_survey_archives_import_import'].'</a></span>';
- echo '<br />';
- echo '<form style="display:none" id="restore_data" action="ajax.php?a=archive_restore" method="post" name="restoredatafrm" enctype="multipart/form-data" >
- <span style="line-height:18px;">'.$lang['srv_arhiv_datoteka_save_txt2'].':
- <input type="hidden" name="has_data" value="1" />
- <input type="file" name="restore_data" onchange="document.restoredatafrm.submit();" /></span>
- <br /><span class="italic">'.$lang['srv_arhiv_datoteka_restore_help'].'</span>
- </form>';
- echo '</p>';*/
-
+ echo '<legend>'.$lang['srv_survey_archives_ie_data_title'].Help::display('srv_arhiv_podatki').'</legend>';
+
+ echo '<p>'.$lang['srv_survey_archives_note_survey_data'].'</p>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?a=archive_download&anketa='.$this->anketa.'&data=true\';" >'.$lang['srv_survey_archives_export'].'</button>';
+ echo '</div>';
+
echo '</fieldset>';
}
}
@@ -3770,7 +4349,7 @@ class SurveyAdminSettings {
if ($anketa > 0)
$this->anketa = $anketa;
- $site = $_GET['site'];
+ $site = isset($_GET['site']) ? $_GET['site'] : 0;
SurveyCopy :: setSrcSurvey($this->anketa);
SurveyCopy :: setSrcConectDb($connect_db);
@@ -3780,7 +4359,7 @@ class SurveyAdminSettings {
$napake = SurveyCopy :: getErrors();
- if (count($napake) > 0)
+ if (is_countable($napake) && count($napake) > 0)
print_r($napake);
if (!$new_anketa_id)
@@ -3892,11 +4471,9 @@ class SurveyAdminSettings {
echo '</div>';
echo '</span>';
- echo '<br class="clr" />';
-
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
}
@@ -3907,6 +4484,10 @@ class SurveyAdminSettings {
global $site_url;
global $lang;
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
+
+
SurveySetting::getInstance()->Init($this->anketa);
if (count($_POST) > 0 && (isset($_POST['uporabnost_link']) || isset($_POST['uporabnost_razdeli']))) {
@@ -3938,52 +4519,59 @@ class SurveyAdminSettings {
if ($row['uporabnost_link'] == '')
$row['uporabnost_link'] = 'http://';
- echo '<p class="bold">'.$lang['srv_uporabnost_link'].'</p>';
- echo '<p class="red">'.$lang['srv_uporabnost_warning'].'</p>';
- echo '<p>Link: <input type="text" name="uporabnost_link" value="' . $row['uporabnost_link'] . '" style="width:300px"></p>';
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_4_3b'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_uporabnost_link'].'</p>';
+ echo '<input type="text" class="large w400" name="uporabnost_link" value="' . $row['uporabnost_link'] . '">';
+ echo '</div>';
$uporabnost_razdeli = SurveySetting::getInstance()->getSurveyMiscSetting('uporabnost_razdeli');
- echo '<p>'.$lang['srv_uporabnost_razdeli'].': <input type="radio" name="uporabnost_razdeli" value="0" '.($uporabnost_razdeli!=1?' checked':'').'>'.$lang['srv_vodoravno'].' <input type="radio" name="uporabnost_razdeli" value="1" '.($uporabnost_razdeli==1?' checked':'').'>'.$lang['srv_navpicno'].' ('.$lang['srv_razdeli_dodatno'].')</p>';
- echo '</fieldset>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_uporabnost_razdeli'].':</span>';
- echo '<br />';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="uporabnost_razdeli_0" name="uporabnost_razdeli" value="0" '.($uporabnost_razdeli!=1?' checked':'').'>';
+ echo '<label for="uporabnost_razdeli_0">'.$lang['srv_vodoravno'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="uporabnost_razdeli_1" name="uporabnost_razdeli" value="1" '.($uporabnost_razdeli==1?' checked':'').'>';
+ echo '<label for="uporabnost_razdeli_1">'.$lang['srv_navpicno'].' ('.$lang['srv_razdeli_dodatno'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<p class="top16">'.$lang['srv_uporabnost_warning'].'</p>';
+
+
+ echo '</fieldset>';
echo '<fieldset><legend>'.$lang['srv_uporabnost_nadaljne'].'</legend>';
- echo '<p class="bold">'.$lang['srv_uporabnost_link_stran'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_uporabnost_link_stran'].'</p>';
$sqlg = sisplet_query("SELECT id, naslov FROM srv_grupa WHERE ank_id = '$this->anketa' ORDER BY vrstni_red ASC");
while ($rowg = mysqli_fetch_array($sqlg)) {
$link = SurveySetting::getInstance()->getSurveyMiscSetting('uporabnost_link_'.$rowg['id']);
if ($link == '')
$link = 'http://';
- echo '<p>'.$rowg['naslov'].': <input type="text" name="uporabnost_link_'.$rowg['id'].'" value="'.$link.'" style="width:300px"></p>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$rowg['naslov'].':</p>';
+ echo '<input type="text" class="large w400" name="uporabnost_link_'.$rowg['id'].'" value="'.$link.'">';
+ echo '</div>';
}
echo '</fieldset>';
- echo '<br class="clr">';
-
- //echo '<p><input type="submit" value="' . $lang['edit'] . '"></p>';
- echo '<span class="floatLeft spaceRight">';
- echo '<div class="buttonwrapper">';
- echo '<a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="document.settingsanketa_'.$this->anketa.'.submit(); return false;" href="#">';
- echo '<span>'.$lang['edit1337'].'</span>';
- echo '</a>';
- echo '</div>';
- echo '</span>';
-
- echo '<br class="clr">';
- echo '<br />';
+ // Gumb shrani
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa_'.$this->anketa.'.submit(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
echo '</form>';
-
- /*echo '<fieldset><legend>'.$lang['srv_upora_dodatno'].'</legend>';
- echo '<p style="width:50%">' . $lang['srv_upora_text'] . '</p>';
- echo '<p><a href="#" onclick="javascript:$(\'#demo\').show(\'slow\'); return false;">'.$lang['srv_primer'].'</a></p>';
- echo '<p id="demo" style="display:none"><img src="img_0/uporabnost.png" /></p>';
- echo '</fieldset>';*/
}
/**
@@ -3994,6 +4582,8 @@ class SurveyAdminSettings {
$sdf = SurveyDataFile::get_instance();
$sdf->init($this->anketa);
+ $sdf->prepareFiles();
+
$headFileName = $sdf->getHeaderFileName();
$dataFileName = $sdf->getDataFileName();
$dataFileStatus = $sdf->getStatus();
@@ -4001,15 +4591,17 @@ class SurveyAdminSettings {
if ($dataFileStatus== FILE_STATUS_NO_DATA
|| $dataFileStatus == FILE_STATUS_NO_FILE
|| $dataFileStatus == FILE_STATUS_SRV_DELETED){
+ echo '<fieldset><legend>'.$lang['srv_no_data'].'</legend>';
Common::noDataAlert();
+ echo '</fieldset>';
return false;
}
- if ($_GET['m'] == 'excel') {
+ /* if ($_GET['m'] == 'excel') {
echo '<form id="export_excel_form" target="_blank" action="ajax.php?t=export&anketa='.$this->anketa.'&a=doexport&m=excel" method="POST">';
- } else if($_GET['m'] == 'excel_xls') {
+ } */ if($_GET['m'] == 'excel_xls') {
echo '<form id="export_excel_xls_form" target="_blank" action="ajax.php?t=export&anketa='.$this->anketa.'&a=doexport&m=excel_xls" method="POST">';
} else if($_GET['m'] == 'txt') {
- echo '<form id="export_txt_form" target="_blank" action="ajax.php?t=export&anketa='.$this->anketa.'&a=doexport&m=txt" method="POST">';
+ echo '<form id="export_excel_form" target="_blank" action="ajax.php?t=export&anketa='.$this->anketa.'&a=doexport&m=excel" method="POST">';
} else if($_GET['m'] == 'spss') {
echo '<form id="export_spss_form" target="_blank" action="ajax.php?t=export&anketa='.$this->anketa.'&a=doexport&m=spss" method="POST">';
} else if($_GET['m'] == 'sav') {
@@ -4018,134 +4610,212 @@ class SurveyAdminSettings {
$row = SurveyInfo::getInstance()->getSurveyRow();
- echo '<div id="div_analiza_filtri_right" class="floatRight export">';
- echo '<ul>';
-
- if($_GET['m'] != 'export_PDF'){
- echo '<li>';
- echo '<span class="as_link gray" id="link_export_setting" onClick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#div_export_setting_show\').fadeIn(\'slow\'); return false;" title="' . $lang['srv_dsp_link'] . '">' . $lang['srv_dsp_link'] . '</span>';
- echo '</li>';
- }
-
- // profili statusov
- SurveyStatusProfiles :: Init($this->anketa);
- SurveyStatusProfiles :: DisplayLink(false);
-
- # div za profile variabel
- SurveyVariablesProfiles :: Init($this->anketa, $global_user_id);
- SurveyVariablesProfiles :: DisplayLink(false,false);
- SurveyConditionProfiles :: Init($this->anketa, $global_user_id);
- SurveyConditionProfiles::DisplayLink(false);
-
- # div za profile časov
- SurveyTimeProfiles :: Init($this->anketa, $global_user_id);
- SurveyTimeProfiles::DisplayLink(false,true);
-
- echo '</ul>';
- echo '</div>';
-
-
- if($_GET['m'] != 'export_PDF'){
+ //sedaj se prikaze staticno ob vsakem izvozu
+ /* if($_GET['m'] != 'export_PDF'){
if(session_id() == '')
session_start();
- echo '<div id="div_export_setting_show">';
+ echo '<div id="div_export_setting_show" class="divPopUp PopUpNarrow">';
+
+ echo '<h2>'.$lang['settings'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#div_export_setting_show\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');return false;">✕</a></div>';
+
+
+ echo '<div class="setting_holder">';
// Izvozi identifikatorje
- echo '<label><input type="radio" name="exportSetting" id="hiddenSystem" value="2"'.
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="hiddenSystem" value="2"'.
((isset($_SESSION['exportHiddenSystem']) && $_SESSION['exportHiddenSystem'] == true) ? ' checked="checked"' : '') .
- ' onchange="exportChangeCheckbox(\'exportHiddenSystem\');"/>'.$lang['srv_export_hidden_system']
- .'</label>';
- echo Help::display('exportSettings');
-
- echo '<br />';
-
+ ' onchange="exportChangeCheckbox(\'exportHiddenSystem\');"/><label for="hiddenSystem">'.$lang['srv_export_hidden_system'];
+ echo Help::display('exportSettings').'</label>';
+ echo '</div>';
+
// Izvozi podatke
- echo '<label><input type="radio" name="exportSetting" id="onlyData" value="0"'.
- ((isset($_SESSION['exportOnlyData']) && $_SESSION['exportOnlyData'] == true) ? ' checked="checked"' : '') .
- ' onchange="exportChangeCheckbox(\'exportOnlyData\');"/>'.$lang['srv_export_only_data']
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="onlyData" value="0"'.
+ ( (isset($_SESSION['exportOnlyData']) && $_SESSION['exportOnlyData'] == true) || (!isset($_SESSION['exportHiddenSystem']) && !isset($_SESSION['exportOnlyData']) && !isset($_SESSION['exportFullMeta'])) ? ' checked="checked"' : '') .
+ ' onchange="exportChangeCheckbox(\'exportOnlyData\');"/><label for="onlyData">'.$lang['srv_export_only_data']
.'</label>';
-
- echo '<br />';
+ echo '</div>';
// Izvozi podatke in parapodatke
- echo '<label><input type="radio" name="exportSetting" id="fullMeta" value="1"'.
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="fullMeta" value="1"'.
((isset($_SESSION['exportFullMeta']) && $_SESSION['exportFullMeta'] == true) ? ' checked="checked"' : '') .
- ' onchange="exportChangeCheckbox(\'exportFullMeta\');"/>'.$lang['srv_export_full_meta']
- .'</label>';
- echo Help::display('srv_export_full_meta');
-
- echo '<br class="clr"/>';
-
- echo '<br />';
-
- echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="$(\'#div_export_setting_show\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');return false;"><span>'.$lang['srv_zapri'] . '</span></a></div>';
+ ' onchange="exportChangeCheckbox(\'exportFullMeta\');"/><label for="fullMeta">'.$lang['srv_export_full_meta'];
+ echo Help::display('srv_export_full_meta').'</label>';
echo '</div>';
- }
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="$(\'#div_export_setting_show\').fadeOut(\'slow\'); $(\'#fade\').fadeOut(\'slow\');return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+
+ } */
# v odvisnosti od $_GET['m'] prikazemo podstran
- if (!$_GET['m'] || $_GET['m'] == M_EXPORT_EXCEL) {
+ if ($_GET['m'] == M_EXPORT_EXCEL_XLS) {
- echo '<fieldset><legend>'.$lang['srv_lnk_excel'].'</legend>';
+ echo '<fieldset><legend>'.$lang['srv_lnk_excel_xls'].'</legend>';
+
+ $this->exportSettingsData();
+ echo '<br>';
+
+ /* echo $lang['srv_izvoz_Excel_xls_labels'];
+ echo '<div class="setting_holder">';
+
+ // Izvozi podatke kot stevilske vrednosti
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportLabelsSetting" id="exportCodes" value="0" checked="checked"/>
+ <label for="fullMeta">'.$lang['srv_izvoz_Excel_xls_labels_codes'].'</label>';
+ echo '</div>';
+
+ // Izvozi podatke kot labele
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportLabelsSetting" id="exportLabels" value="1"/>
+ <label for="onlyData">'.$lang['srv_izvoz_Excel_xls_labels_labels'].'</label>';
+ echo '</div>';
- echo $lang['srv_izvoz_Excel_note'];
- echo $lang['srv_izvoz_Excel_note_2'];
-
- echo '<p class="strong">'.$lang['srv_izvoz_Excel_settings'].'</p>';
- echo '<p>';
- echo '<label>'.$lang['srv_expor_excel_cell_delimiter'].'</label>';
- echo '<label><input type="radio" name="export_delimit" id="export_delimit_semicolon" value="0" onchange="excelExportChangeDelimit(); return false;" checked="checked"/>'.$lang['srv_expor_excel_cell_delimiter1'].'</label>';
- echo '<label><input type="radio" name="export_delimit" id="export_delimit_coma" value="1" onchange="excelExportChangeDelimit(); return false;"/>'.$lang['srv_expor_excel_cell_delimiter2'].'</label>';
- echo '</p>';
-
- echo '<p>';
- echo '<div id="replace_export_delimit_semicolon">';
- echo '<span>';
- echo $lang['srv_export_replace1'].' <input type="text" value=";" name="replace_what0[]" id="replace_what_0" size="1">';
- echo $lang['srv_export_replace2'].' <input type="text" value="," name="replace_with0[]" id="replace_with_0" size="1">';
- echo '</span>';
- echo '</div>';
- echo '<div id="replace_export_delimit_comma" class="displayNone">';
- echo '<span>';
- echo $lang['srv_export_replace1'].' <input type="text" value="," name="replace_what1[]" id="replace_what_0" size="1">';
- echo $lang['srv_export_replace2'].' <input type="text" value=";" name="replace_with1[]" id="replace_with_0" size="1">';
- echo '</span>';
echo '</div>';
- echo '</p>';
- echo '<p>';
- echo '<label><input type="checkbox" name="export_labels" id="export_labels" checked="checked" value="1"/>'.$lang['srv_export_texts'].'</label>';
- echo '<p>';
-
+ echo '<br>'; */
+
+ echo $lang['srv_izvoz_Excel_xls_note1'];
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" onclick="doExcelXlsExport(); return false;">'.$lang['srv_izvoz_Excel_xls_file'].'</button>';
+ echo '</div>';
+
+ $this->filterNote();
+
+ echo '<p>'.$lang['srv_izvoz_Excel_xls_prirocnik'].'</p>';
echo '</fieldset>';
-
- } elseif ($_GET['m'] == M_EXPORT_EXCEL_XLS) {
+ }
+ elseif ($_GET['m'] == M_EXPORT_TXT) {
+
+ echo '<fieldset><legend>'.$lang['srv_lnk_excel'].'</legend>';
+
+ $this->exportSettingsData();
+ echo '<br>';
- echo '<fieldset><legend>'.$lang['srv_lnk_excel_xls'].'</legend>';
- echo $lang['srv_izvoz_Excel_xls_note'];
- echo $lang['srv_izvoz_Excel_xls_note_2'];
- echo '</fieldset>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_expor_excel_cell_delimiter'].Help::display('srv_izvozCSV_locitveni').':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_delimit" id="export_delimit_semicolon" value="0" onchange="excelExportChangeDelimit(1); return false;" checked="checked"/>';
+ echo '<label for="export_delimit_semicolon">'.$lang['srv_expor_excel_cell_delimiter1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_delimit" id="export_delimit_coma" value="1" onchange="excelExportChangeDelimit(2); return false;"/>';
+ echo '<label for="export_delimit_coma">'.$lang['srv_expor_excel_cell_delimiter2'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<br>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_export_texts'].Help::display('srv_izvozCSV_tekst').':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_headers" id="export_header_yes" value="1" checked="checked"/>';
+ echo '<label for="export_header_yes">'.$lang['yes'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_headers" id="export_header_no" value="0" />';
+ echo '<label for="export_header_no">'.$lang['no'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<br>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_izvoz_txt_format'].'</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_format" id="export_format_csv" value="1" checked="checked"/>';
+ echo '<label for="export_format_csv">'.$lang['srv_izvoz_txt_format_csv'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export_format" id="export_format_txt" value="0" />';
+ echo '<label for="export_format_txt">'.$lang['srv_izvoz_txt_format_txt'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<br>';
+
+ echo $lang['srv_izvoz_Excel_note_a'];
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" onclick="doExcelExport(); return false;">'.$lang['srv_izvoz_Excel_file'].'</button>';
+ echo '</div>';
+
+ $this->filterNote();
+
+ echo '<p>'.$lang['srv_izvoz_Excel_note_2'].'</p>';
+
}
elseif ($_GET['m'] == M_EXPORT_SPSS) {
- echo '<fieldset><legend>'.$lang['srv_lnk_spss'].'</legend>';
- echo $lang['srv_izvoz_SPSS_faq'];
- echo $lang['srv_izvoz_SPSS_note'];
+ echo '<fieldset><legend>'.$lang['srv_lnk_spss'].'</legend>';
+
+ $this->exportSettingsData();
+ echo '<br>';
+
+ echo '<p class="bottom16">'.$lang['srv_izvoz_SPSS_faq'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_izvoz_SPSS_note'].'</p>';
+
+
+ echo '<p class="bold">'.$lang['srv_izvoz_step1'].'</p>';
+ echo '<div class="export_indent">';
+ echo '<p>'.$lang['srv_izvoz_step1_SPSS'].'</p>';
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" onclick="doSpssExport(\'yes\'); return false;">'.$lang['srv_izvoz_step1_SPSS_file'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<p class="bold">'.$lang['srv_izvoz_step2'].'</p>';
+ echo '<div class="export_indent">';
+ echo '<p>'.$lang['srv_izvoz_step2a_SPSS'].'</p>';
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" onclick="doSpssExport(\'no\'); return false;">'.$lang['srv_izvoz_step2_SPSS_file'].'</button>';
+ echo '</div>';
+ echo '<p class="top16">'.$lang['srv_izvoz_step2b_SPSS'].'</p>';
+ echo '</div>';
+
+ echo '<p class="bold">'.$lang['srv_izvoz_step3'].'</p>';
+ echo '<div class="export_indent">';
+ echo '<ul>';
+ echo '<li>'.$lang['srv_izvoz_step3a_SPSS'].'</li>';
+ echo '<li>'.$lang['srv_izvoz_step3b_SPSS'].'</li>';
+ echo '<li class="no_bullet top16">'.$lang['srv_izvoz_step3c_SPSS'].'</li>';
+ echo '</ul>';
+ echo '</div>';
+
+ echo '<p class="bold">'.$lang['srv_izvoz_step4'].'</p>';
+ echo '<div class="export_indent">';
+ echo '<p>'.$lang['srv_izvoz_step4_SPSS'].'</p>';
+ echo '</div>';
+
+ echo '<p class="bold">'.$lang['srv_izvoz_step5'].'</p>';
+ echo '<div class="export_indent">';
+ echo '<p>'.$lang['srv_izvoz_step5_SPSS'].'</p>';
+ echo '</div>';
+
+ $this->filterNote();
+
echo '</fieldset>';
}
- elseif ($_GET['m'] == M_EXPORT_SAV) {
+ /* elseif ($_GET['m'] == M_EXPORT_SAV) {
echo '<fieldset><legend>'.$lang['srv_lnk_sav'].'</legend>';
- echo $lang['srv_izvoz_SAV_note'];
+ echo $lang['srv_izvoz_SAV_note1'];
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" onclick="doSAVExport(); return false;">'.$lang['srv_izvoz_SAV_file'].'</button>';
+ echo '</div>';
+ echo '<p class="top16">'.$lang['srv_izvoz_SAV_note2a'].'<a href="index.php?anketa=' . $this->anketa . '&a=export&m=spss">'.$lang['srv_izvoz_SAV_note2b'].'</a>'.$lang['srv_izvoz_SAV_note2c'].'</p>';
+
echo '</fieldset>';
- }
- elseif ($_GET['m'] == M_EXPORT_TXT) {
-
- echo '<fieldset><legend>'.$lang['srv_lnk_txt'].'</legend>';
- echo $lang['srv_izvoz_txt_note'];
- echo '</fieldset>';
- }
+ } */
elseif ($_GET['m'] == 'export_PDF') {
$pageBreak = isset($_GET['pageBreak']) ? $_GET['pageBreak'] : 0;
@@ -4208,8 +4878,8 @@ class SurveyAdminSettings {
}
/**
* @desc prikaze vnose v anketo
- * /
- function displayVnosi() {//OSTANE
+ */
+ /*function displayVnosi() {//OSTANE
global $lang;
$row = SurveyInfo::getInstance()->getSurveyRow();
if ($_GET['m'] == 'SN_izvozi') {
@@ -4264,6 +4934,66 @@ class SurveyAdminSettings {
}
}
*/
+
+ // nastavitve glede katere podatke se naj izvozi
+ private function exportSettingsData(){
+ global $lang;
+ global $global_user_id;
+
+ //pridobi nastavitve za export ankete
+ //kateri podatki so v export se sedaj veze na naketo (0-onlydata, 1-data in paradata, 2-identifikatorji)
+ $sql_export_mode = sisplet_query("SELECT value FROM srv_user_setting_for_survey ".
+ "WHERE sid = '" . $this->anketa . "' AND what='default_export_data_mode' AND uid='$global_user_id'");
+ $export_mode = 0;
+ if($sql_export_mode){
+ $export_mode = mysqli_fetch_assoc($sql_export_mode);
+ $export_mode = isset($export_mode['value']) ? $export_mode['value'] : 0;
+ }
+
+ echo $lang['srv_izvoz_settings_data'];
+
+ echo '<div class="setting_holder">';
+
+ // Izvozi podatke
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="onlyData" value="0"'.
+ ( $export_mode == 0 ? ' checked="checked"' : '') .
+ ' onchange="exportChangeCheckbox();"/><label for="onlyData">'.$lang['srv_export_only_data']
+ .'</label>';
+ echo '</div>';
+
+ // Izvozi podatke in parapodatke
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="fullMeta" value="1"'.
+ ( $export_mode == 1 ? ' checked="checked"' : '') .
+ ' onchange="exportChangeCheckbox();"/><label for="fullMeta">'.$lang['srv_export_full_meta'];
+ echo Help::display('srv_export_full_meta').'</label>';
+ echo '</div>';
+
+ //pridobi header, da vidimo, ce imamo identifikatorje
+ $SDF = SurveyDataFile::get_instance();
+ $SDF->init($this->anketa);
+ $headFileName = $SDF->getHeaderFileName();
+ $HEADERS = unserialize(file_get_contents($headFileName));
+
+ // Izvozi identifikatorje, ce obstajajo
+ if((isset($HEADERS['_settings']['count_system_data_variables']) && (int)$HEADERS['_settings']['count_system_data_variables'] > 0)){
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="exportSetting" id="hiddenSystem" value="2"'.
+ ( $export_mode == 2 ? ' checked="checked"' : '') .
+ ' onchange="exportChangeCheckbox();"/><label for="hiddenSystem">'.$lang['srv_export_hidden_system'];
+ echo Help::display('exportSettings').'</label>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+ }
+
+ private function filterNote(){
+ global $lang;
+ echo '<br><p>'.$lang['srv_izvoz_filter_note'].'</p><br>';
+ }
+
/**
* @desc prikaze podatke v tabeli
*/
@@ -4332,28 +5062,52 @@ class SurveyAdminSettings {
global $global_user_id, $admin_type, $lang;
$avtorRow = SurveyInfo::getInstance()->getSurveyRow();
+
+ echo '<p class="bold">'.$lang['srv_dostop_users_list'].'</p>';
// Prikazemo samo userje ki lahko urejajo anketo
if($show_all == 0){
echo ' <input type="hidden" name="dostop_edit" value="1" />' . "\n";
+
+ echo '<table>';
+ echo '<tr>';
+ echo '<th>';
+ //echo '<input type="checkbox" id="user_access_check_all" name="user_access_check_all"></input><label class="empty" for="user_access_check_all"></label>';
+ echo '</th>';
+ echo '<th>' . $lang['srv_dostop_users_username'] . '</th>';
+ echo '<th>' . $lang['srv_dostop_users_email'] . '</th>';
+ echo '<th></th>';
+ echo '</tr>';
$sql1 = sisplet_query("SELECT u.name, u.surname, u.id, u.email FROM users u, srv_dostop d WHERE d.ank_id='$this->anketa' AND d.uid=u.id");
while ($row1 = mysqli_fetch_array($sql1)) {
-
- // Da ga ne pocistimo ce je disablan (sam sebe ne more odstranit in avtorja se ne sme odstranit)
+
+ // Da ga ne pocistimo, ce je disablan (sam sebe ne more odstranit in avtorja se ne sme odstranit)
if($avtorRow['insert_uid'] == $row1['id'] || $global_user_id == $row1['id'])
echo ' <input type="hidden" name="uid[]" value="' . $row1['id'] . '" />' . "\n";
-
- echo '<div id="div_for_uid_' . $row1['id'] . '" name="dostop_active_uid" class="floatLeft dostop_for_uid">' . "\n";
- echo '<label nowrap for="uid_' . $row1['id'] . '" title="' . $row1['email'] . '">';
- echo '<input type="checkbox" name="uid[]" value="' . $row1['id'] . '" id="uid_' . $row1['id'] . '" checked="checked" '.($avtorRow['insert_uid'] == $row1['id'] || $global_user_id == $row1['id'] ? ' disabled="disabled"' : '').' autocomplete="off"/>';
- echo $row1['name'] . ($avtorRow['insert_uid'] == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>' . "\n";
- echo ' <span class="faicon edit small icon-as_link" onclick="javascript:anketa_user_dostop(\''.$row1['id'].'\');"></span>';
- echo '</div>' . "\n";
+
+ echo '<tr id="div_for_uid_' . $row1['id'] . '" name="dostop_active_uid">';
+
+ echo ' <td><input type="checkbox" name="uid[]" value="' . $row1['id'] . '" id="uid_' . $row1['id'] . '" checked="checked" '.($avtorRow['insert_uid'] == $row1['id'] || $global_user_id == $row1['id'] ? ' disabled="disabled"' : '').' autocomplete="off"/><label class="empty" for="uid_' . $row1['id'] . '" title="' . $row1['email'] . '"></label></td>';
+ echo ' <td>'.$row1['name'] . ($avtorRow['insert_uid'] == $row1['id'] ? ' (' . $lang['author'] . ')' : '') .'</td>';
+ echo ' <td>'.$row1['email'].'</td>';
+
+ // Avtor ne rabi ikone za urejanje
+ echo ' <td>';
+ if($avtorRow['insert_uid'] != $row1['id'])
+ echo ' <div class="icon_holder multiple"><a><span class="faicon edit" onclick="javascript:anketa_user_dostop(\''.$row1['id'].'\');"></span></a>';
+ echo ' </td>';
+
+ echo '</tr>';
}
+
+ echo '</table>';
+
+ //echo '<a class="noline undertable" href="#" onClick="________IZBRIS DOSTOPA ZA VSE OZNAČENE____________"><span class="faicon trash empty link-right"></span>'.$lang['srv_dostop_users_removeselected'].'</a>';
+
}
- // Prikazemo vse userje, ki jih lahko uporabnig dodaja
+ // Prikazemo vse userje, ki jih lahko uporabnik dodaja
else{
$sql1 = $this->db_select_users_forLevel($this->anketa);
if ( mysqli_num_rows($sql1) > 0 ) {
@@ -4384,6 +5138,55 @@ class SurveyAdminSettings {
}
}
+ // Dodajanje uredniskega dostopa do ankete
+ public function display_add_survey_dostop(){
+ global $lang;
+ global $admin_type;
+
+ echo '<p class="red bottom16">';
+
+ // Admini in managerji lahko dodajo dostop komurkoli
+ if($admin_type == 0 || $admin_type == 1){
+ echo $lang['srv_dostop_adduserstxt_admin'].' '.AppSettings::getInstance()->getSetting('app_settings-app_name').'. ';
+ }
+ // Ostali uporabniki lahko dodajo dostop samo ze registriranim uporabnikom
+ else{
+ echo $lang['srv_dostop_adduserstxt'].' '.AppSettings::getInstance()->getSetting('app_settings-app_name').'! ';
+ }
+
+ // AAI ima poseben link na help
+ if(isAAI()){
+ echo $lang['srv_dostop_adduserstxt_aai_more'];
+ }
+
+ echo '</p>';
+
+ echo '<input type="hidden" name="aktiven" value="1" >';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="addusers">'.$lang['srv_dostop_adduserstxt_email'].'</label>';
+ echo '<textarea name="addusers" id="addusers"></textarea>';
+ echo '</div>';
+
+ echo '<p class="bottom16">'.$lang['srv_dostop_adduserstxt_end'].'</p>';
+
+ //Opcijsko sporočilo
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="addusers_note_checkbox" onClick="dostopNoteToggle();">';
+ echo '<label for="addusers_note_checkbox">'.$lang['srv_dostop_adduserstxt_note'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<textarea class="displayNone" name="addusers_note" id="addusers_note">'.$lang['srv_dostop_adduserstxt_note_text'].'</textarea>';
+ echo '</div>';
+ echo '</div>';
+
+ // Gumb za dodajanje in posiljanje
+ echo '<div class="button_holder below">';
+ echo '<button class="medium blue" href="#" onclick="dostopAddAccess(); return false;">'.$lang['srv_dostop_addusers_button'].'</button>';
+ echo '</div>';
+ }
+
/**
* @desc Vrne podatke o uporabniku
@@ -4419,7 +5222,7 @@ class SurveyAdminSettings {
// polovimo tip ankete
$str_survey_type = sisplet_query("SELECT survey_type FROM srv_anketa WHERE id = '" . $sid . "'");
$row_survey_type = mysqli_fetch_assoc($str_survey_type);
- $this->getSurvey_type = $row_survey_type['survey_type'];
+ $this->getSurvey_type = isset($row_survey_type['survey_type']) ? $row_survey_type['survey_type'] : null;
return $this->getSurvey_type;
}
@@ -4443,18 +5246,18 @@ class SurveyAdminSettings {
case 'finish_respondent_language': // respondent ki je zakljucil anketo v drugem jeziku (mu omogocimo nastavljanje custom maila za obvescanje)
if ($isChecked) {
- $p = new Prevajanje($anketa);
+ $p = new Prevajanje($this->anketa);
$p->dostop();
$jeziki = $p->get_all_translation_langs();
if(!empty($jeziki)){
$row = SurveyInfo::getInstance()->getSurveyRow();
- echo '<br />';
foreach($jeziki as $key => $jezik){
- echo '<span class="clr" style="padding-left:20px; line-height:22px;">'.$lang['srv_alert_respondent'].' - '.$jezik;
- echo ' <a href="#" onclick="alert_custom(\'respondent_lang_'.$key.'\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
- echo '</span>';
+ echo '<div class="setting_item respondent_jeziki">';
+ echo '<label>'.$lang['srv_alert_respondent'].' - '.$jezik.'</label>';
+ echo '<a href="#" onclick="alert_custom(\'respondent_lang_'.$key.'\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
+ echo '</div>';
}
}
}
@@ -4463,14 +5266,15 @@ class SurveyAdminSettings {
case 'finish_respondent': // respondent ki je zakljucil anketo
if ($isChecked) {
- // preverimo ali obszaja sistemska spremenljivka email če ne jo dodamo
+ // preverimo, ali obstaja sistemska spremenljivka email, če ne jo dodamo
$sqlEmail = sisplet_query("SELECT s.sistem, s.variable, s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='email' AND s.gru_id=g.id AND g.ank_id='$this->anketa'");
$sqlIme = sisplet_query("SELECT s.sistem, s.variable, s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='ime' AND s.gru_id=g.id AND g.ank_id='$this->anketa'");
- // ce sta dodani obe sistemski spremenljivki je fse ok
+ // ce sta dodani obe sistemski spremenljivki, je vse ok
$email_ok = $ime_ok = false;
if ( mysqli_num_rows($sqlEmail) > 0 && mysqli_num_rows($sqlIme) > 0) {
$email_ok = $ime_ok = true;
- } else {
+ }
+ else {
// manjka ena ali obe potrebni sistemski spremenljivki
// email je nujen, zato ga dodamo avtomatsko
@@ -4480,7 +5284,7 @@ class SurveyAdminSettings {
if (in_array('email',$sa->alert_add_necessary_sysvar( array('email') , false))) {
$email_ok = true;
}
- // email v tem primeru spremenimo da je viden, ker gre za alert
+ // email v tem primeru spremenimo, da je viden, ker gre za alert
$sqlEmail = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.variable='email' AND s.gru_id=g.id AND g.ank_id='$this->anketa'");
$rowEmail = mysqli_fetch_array($sqlEmail);
sisplet_query("UPDATE srv_spremenljivka SET visible='1' WHERE id = '$rowEmail[id]'");
@@ -4489,51 +5293,48 @@ class SurveyAdminSettings {
$v->spremenljivka = $rowEmail['id'];
$v->set_email($reminder=1);
- } else {
- // email je ze dodan damo tekst za ok
+ }
+ else {
+ // email je ze dodan, damo tekst za ok
$email_ok = true;
}
// preverimo še za ime
if ( mysqli_num_rows($sqlIme) == 0 ) {
-
- } else{
+ }
+ else{
$ime_ok = true;
}
}
-
- if($forma)
- echo '<label for="alert_finish_respondent">'.$lang['srv_alert_anketiranec'].'</label>';
- else
- echo '<label for="alert_finish_respondent">'.$lang['srv_alert_respondent'].'</label>';
+ echo '<input type="checkbox" name="alert_'.$what.'" id="alert_'.$what.'" value="1" onChange="change_alert_respondent(\''.$what.'\', $(this)); $(\'form[name=alertanketa_' . $this->anketa . ']\').submit(); return false;"' . (($isChecked) ? ' checked' : '') . '>';
+ echo '<label for="alert_'.$what.'">'.$lang['srv_alert_respondent'].'</label>';
if ($email_ok && $ime_ok) {
- echo $lang['srv_alert_respondent_note_ok_email_ime'];
- echo ' <img src="icons/icons/accept.png" alt="" vartical-align="middle" />' . "\n\r";
-
- echo ' <a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ echo ' <a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
$sql1 = sisplet_query("SELECT finish_respondent_if FROM srv_alert WHERE ank_id='$this->anketa'");
$row1 = mysqli_fetch_array($sql1);
echo ' <a href="#" onclick="alert_edit_if(\'2\'); return false;"><span class="faicon if_add" '.($row1['finish_respondent_if']==0?'style=""':'').'></span></a> ';
if ($row1['finish_respondent_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['finish_respondent_if']); }
+
+ echo '<span class="gray">'.$lang['srv_alert_respondent_note_ok_email_ime'].'&nbsp<span class="faicon fa-check-circle"></span></span>';
} else {
if ($ime_ok) {
// pomeni da email ni ok! napaka
- echo $lang['srv_alert_respondent_note_notok_email'];
+ echo '<span class="red">'.$lang['srv_alert_respondent_note_notok_email'].'</span>';
} else {
- // email je ok, ime ni, uporabnika fprasamo ali hoce se ime
- echo $lang['srv_alert_respondent_note_ok_email'];
-
- echo ' <a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ // email je ok, ime ni, uporabnika vprasamo, ali hoce se ime
+ echo '<a href="#" onclick="alert_custom(\'respondent\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
$sql1 = sisplet_query("SELECT finish_respondent_if FROM srv_alert WHERE ank_id='$this->anketa'");
$row1 = mysqli_fetch_array($sql1);
- echo ' <a href="#" onclick="alert_edit_if(\'2\'); return false;"><span class="faicon if_add" '.($row1['finish_respondent_if']==0?'style=""':'').'></span></a> ';
+ echo ' <a href="#" onclick="alert_edit_if(\'2\'); return false;"><span class="faicon if_add" '.($row1['finish_respondent_if']==0?'style=""':'').'></span></a>';
if ($row1['finish_respondent_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['finish_respondent_if']); }
+ echo '<p class="gray top8">'.$lang['srv_alert_respondent_note_ok_email'].'</p>';
+
if(!$forma){
- echo $lang['srv_alert_respondent_note_ime'];
- echo ' &nbsp;<a href="#" onClick="alert_add_necessary_sysvar(\'finish_respondent\', $(this)); return false;"><span class="faicon add icon-blue"></span> '.$lang['srv_alert_respondent_note_link'].'</a>' . "\n\r";
+ echo '<p class="top8"><span class="gray">'.$lang['srv_alert_respondent_note_ime'].'</span>';
+ echo '<a class="noline" href="#" onClick="alert_add_necessary_sysvar(\'finish_respondent\', $(this)); return false;"><span class="faicon add respondent_iconwithlink"></span> '.$lang['srv_alert_respondent_note_link'].'</a></p>';
}
}
}
@@ -4541,20 +5342,16 @@ class SurveyAdminSettings {
// preverimo sistemske nastavitve in spremenljivke ime
} else {
- if($forma)
- echo '<label for="alert_finish_respondent">'.$lang['srv_alert_anketiranec'].'</label>';
- else
- echo '<label for="alert_finish_respondent">'.$lang['srv_alert_respondent'].'</label>';
+ echo '<input type="checkbox" name="alert_'.$what.'" id="alert_'.$what.'" value="1" onChange="change_alert_respondent(\''.$what.'\', $(this)); $(\'form[name=alertanketa_' . $this->anketa . ']\').submit(); return false;"' . (($isChecked) ? ' checked' : '') . '>';
+ echo '<label for="alert_'.$what.'">'.$lang['srv_alert_respondent'].'</label>';
}
break;
case 'finish_respondent_cms': // respondent prepoznan iz CMS ko je izpolnil anketo
- //respondent iz cms
- //pri hitrih nastavitvah forme prikazemo drug text
- if($forma)
- echo '<label for="alert_finish_respondent_cms">'.$lang['srv_alert_anketiranec_cms'].'</label>';
- else
- echo '<label for="alert_finish_respondent_cms">'.$lang['srv_alert_respondent_cms'].'</label>';
+
+ //respondent iz cms
+ echo '<input type="checkbox" name="alert_'.$what.'" id="alert_'.$what.'" value="1" onChange="change_alert_respondent(\''.$what.'\', $(this)); change_alert_instruction($(this)); $(\'form[name=alertanketa_' . $this->anketa . ']\').submit(); return false;" ' . (($isChecked) ? ' checked' : '') . '>';
+ echo '<label for="alert_finish_respondent_cms">'.$lang['srv_alert_respondent_cms'].'</label>';
if ($isChecked) {
// preverimo sistemske nastavitve in spremenljivke
@@ -4562,34 +5359,49 @@ class SurveyAdminSettings {
//$rowCMS = mysqli_fetch_assoc($sqlCMS);
$rowCMS = SurveyInfo::getInstance()->getSurveyRow();
if ($rowCMS['user_from_cms'] > 0) {
- echo $lang['srv_alert_respondent_cms_note_ok'];
- echo ' <img src="icons/icons/accept.png" alt="" vartical-align="middle" />' . "\n\r";
-
- echo ' <a href="#" onclick="alert_custom(\'respondent_cms\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ echo ' <a href="#" onclick="alert_custom(\'respondent_cms\', \'0\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
$sql1 = sisplet_query("SELECT finish_respondent_cms_if FROM srv_alert WHERE ank_id='$this->anketa'");
$row1 = mysqli_fetch_array($sql1);
echo ' <a href="#" onclick="alert_edit_if(\'3\'); return false;"><span class="faicon if_add" '.($row1['finish_respondent_cms_if']==0?'style=""':'').'></span></a> ';
if ($row1['finish_respondent_cms_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['finish_respondent_cms_if']); }
+ echo '<span class="gray">'.$lang['srv_alert_respondent_cms_note_ok'].'&nbsp<span class="faicon fa-check-circle"></span></span>';
+
} else {
- echo $lang['srv_alert_respondent_cms_note'];
- echo ' &nbsp;<a href="#" onClick="alert_change_user_from_cms(\'finish_respondent_cms\', $(this)); return false;"><span class="faicon add icon-blue"></span> '.$lang['srv_alert_respondent_cms_note_link'].'</a>' . "\n\r";
+ echo '<p class="top8"><span class="red">'.$lang['srv_alert_respondent_cms_note'].'</spam>';
+ echo '<a class="noline" href="#" onClick="alert_change_user_from_cms(\'finish_respondent_cms\', $(this)); return false;"><span class="faicon add respondent_iconwithlink"></span> '.$lang['srv_alert_respondent_cms_note_link'].'</a></p>';
}
}
break;
- case 'finish_author': // obveščanje ob izpolnjeni anketi
- case 'expire_author': // obveščanje ob poteku ankete
- case 'active_author': // obveščanje ob aktivaciji/deaktivaciej ankete
- case 'delete_author': // obveščanje ob izbrisu ankete
+ case 'finish_author': // obveščanje o izpolnjeni anketi
+ case 'expire_author': // obveščanje o poteku ankete
+ case 'active_author': // obveščanje o aktivaciji/deaktivaciej ankete
+ case 'delete_author': // obveščanje o izbrisu ankete
+
+ // preberemo nastavitve alertov
+ $sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '$this->anketa'");
+ if (!$sqlAlert)
+ echo mysqli_error($GLOBALS['connect_db']);
+
+ if (mysqli_num_rows($sqlAlert) > 0) {
+ $rowAlert = mysqli_fetch_array($sqlAlert);
+ }
+ else {
+ SurveyAlert::getInstance()->Init($this->anketa, $global_user_id);
+ $rowAlert = SurveyAlert::setDefaultAlertBeforeExpire();
+ }
// avtor ankete
- if($forma)
- echo '<label for="alert_'.$what.'">'.$lang['srv_alert_author2'].'</label>';
- else
+ if($forma) {
+ echo '<input type="checkbox" name="alert_'.$what.'" id="alert_'.$what.'" value="1" onChange="change_alert_respondent(\''.$what.'\', $(this));return false;"' . (($isChecked) ? ' checked' : '') . '>';
+ echo '<label for="alert_'.$what.'">'.$lang['srv_alert_author2'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" name="alert_'.$what.'" id="alert_'.$what.'" value="1" onChange="change_alert_respondent(\''.$what.'\', $(this));return false;"' . (($isChecked) ? ' checked' : '') . '>';
echo '<label for="alert_'.$what.'">'.$lang['srv_alert_author'].'</label>';
-
+ }
if ($isChecked) {
//$sql = sisplet_query("SELECT insert_uid, edit_uid FROM srv_anketa WHERE id='$this->anketa'");
//$row = mysqli_fetch_assoc($sql);
@@ -4597,8 +5409,6 @@ class SurveyAdminSettings {
$row = SurveyInfo::getInstance()->getSurveyRow();
- echo '<br/>';
-
if ($what == 'finish_author')
$db_field = 'alert_complete';
else if ($what == 'expire_author')
@@ -4623,14 +5433,21 @@ class SurveyAdminSettings {
$checked = ($row1[$db_field] == '1') ? ' checked="checked" ' : '';
}
- echo '<span class="alert_authors"><input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row['insert_uid'] . '" id="alert_'.$what.'_uid_' . $row['insert_uid'] . '"' . $checked . ' autocomplete="off"/>' . "\n\r";
- echo '<label for="alert_'.$what.'_uid_' . $row['insert_uid'] . '" title="' . $rowAuthor['email'] . '">' . $rowAuthor['name'] . ' (' . $lang['author'] . ': '.$rowAuthor['email']. ')' . '</label>' . "\n\r";
+ echo '<div class="alert_authors">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row['insert_uid'] . '" id="alert_'.$what.'_uid_' . $row['insert_uid'] . '"' . $checked . ' autocomplete="off"/>';
+ echo '<label for="alert_'.$what.'_uid_' . $row['insert_uid'] . '" title="' . $rowAuthor['email'] . '">' . $rowAuthor['name'] . ' (' . $lang['author'] . ': '.$rowAuthor['email']. ')' . '</label>';
+
if ($what == 'finish_author') {
- echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row['insert_uid'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ echo '<span>';
+ echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row['insert_uid'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
echo ' <a href="#" onclick="alert_edit_if(\'1\', \''.$row1['id'].'\'); return false;"><span class="faicon if_add" '.($row1['alert_complete_if']==0?'style=""':'').'></span></a> ';
if ($row1['alert_complete_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['alert_complete_if']); }
+ echo '</span>';
}
- echo '</span>' . "\n\r";
+ echo '</div>';
+
+ echo '</div>';
}
// polovimo avtorja pri ostalih obvestilih
else{
@@ -4639,14 +5456,21 @@ class SurveyAdminSettings {
$sql1 = sisplet_query("SELECT *, uid AS id FROM srv_dostop WHERE ank_id='$this->anketa' AND uid='".$row['insert_uid']."'");
$row1 = mysqli_fetch_array($sql1);
- echo '<span class="alert_authors"><input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row['insert_uid'] . '" id="alert_'.$what.'_uid_' . $row['insert_uid'] . '" checked="checked" disabled="disabled" autocomplete="off"/>' . "\n\r";
- echo '<label for="alert_'.$what.'_uid_' . $row['insert_uid'] . '" title="' . $rowAuthor['email'] . '">' . $rowAuthor['name'] . ' (' . $lang['author'] . ': '.$rowAuthor['email']. ')' . '</label>' . "\n\r";
+ echo '<div class="alert_authors">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row['insert_uid'] . '" id="alert_'.$what.'_uid_' . $row['insert_uid'] . '" checked="checked" disabled="disabled" autocomplete="off"/>';
+ echo '<label for="alert_'.$what.'_uid_' . $row['insert_uid'] . '" title="' . $rowAuthor['email'] . '">' . $rowAuthor['name'] . ' (' . $lang['author'] . ': '.$rowAuthor['email']. ')' . '</label>';
+
if ($what == 'finish_author') {
- echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row['insert_uid'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ echo '<span>';
+ echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row['insert_uid'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
echo ' <a href="#" onclick="alert_edit_if(\'1\', \''.$row1['id'].'\'); return false;"><span class="faicon if_add" '.($row1['alert_complete_if']==0?'style=""':'').'></span></a> ';
if ($row1['alert_complete_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['alert_complete_if']); }
+ echo '</span>';
}
- echo '</span>' . "\n\r";
+ echo '</div>';
+
+ echo '</div>';
}
@@ -4657,14 +5481,21 @@ class SurveyAdminSettings {
if ($row1['id']) { // se zgodi da je prazno za metauserje
// avtor je vedno chekiran
$checked = ( $row1[$db_field] == '1') ? ' checked="checked"' : '';
- echo '<span class="alert_authors"><input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row1['id'] . '" id="alert_'.$what.'_uid_' . $row1['id'] . '"' . $checked . ' autocomplete="off"/>' . "\n\r";
- echo '<label for="alert_'.$what.'_uid_' . $row1['id'] . '" title="' . $row1['email'] . '">' . $row1['name'] . ' ('.$row1['email'].')</label>' . "\n\r";
+ echo '<div class="alert_authors">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="alert_'.$what.'_uid[]" value="' . $row1['id'] . '" id="alert_'.$what.'_uid_' . $row1['id'] . '"' . $checked . ' autocomplete="off"/>';
+ echo '<label for="alert_'.$what.'_uid_' . $row1['id'] . '" title="' . $row1['email'] . '">' . $row1['name'] . ' ('.$row1['email'].')</label>';
+
if ($what == 'finish_author') {
- echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row1['id'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file_small"></span></a>';
+ echo '<span>';
+ echo ' <a href="#" onclick="alert_custom(\'author\', \''.$row1['id'].'\'); return false;" title="'.$lang['srv_alert_custom'].'"><span class="faicon text_file empty"></span></a>';
echo ' <a href="#" onclick="alert_edit_if(\'1\', \''.$row1['id'].'\'); return false;"><span class="faicon if_add" '.($row1['alert_complete_if']==0?'style=""':'').'></span></a> ';
if ($row1['alert_complete_if']>0) { if ($b==null) $b = new Branching($this->anketa); $b->conditions_display($row1['alert_complete_if']); }
+ echo '</span>';
}
- echo '</span>' . "\n\r";
+ echo '</div>';
+
+ echo '</div>';
}
}
}
@@ -4801,13 +5632,14 @@ class SurveyAdminSettings {
}
function anketa_diagnostika_note($diagnostics,$show_link = false) {
global $lang;
+
$diagnostics->printNote($show_link);
-
}
/**
* @desc prikaze dropdown z nastavitvami ankete (globalne, za celo 1ko) -- Prva stran -> Nastavitve -> Sistemske nastavitve
+ * Sistemske nastavitve: mora biti admin da ima dostop
*/
function anketa_nastavitve_system() {
global $lang;
@@ -4816,110 +5648,125 @@ class SurveyAdminSettings {
global $admin_type;
global $global_user_id;
- /* ** Sistemske nastavitve: mora biti admin da ima dostop *** */
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
- echo '<div id="anketa_edit">' . "\n\r";
- if ($admin_type == 0) {
+ // Ni admin - nima pravic
+ if ($admin_type != 0) {
- echo '<form name="settingsanketa" action="ajax.php?a=editanketasettings&m=system" method="post" autocomplete="off">' . "\n\r";
- echo ' <input type="hidden" name="anketa" value="' . $this->anketa . '" />' . "\n\r";
- echo ' <input type="hidden" name="grupa" value="' . $this->grupa . '" />' . "\n\r";
- echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n\r";
- echo ' <input type="hidden" name="submited" value="1" />' . "\n\r";
+ echo '<div id="anketa_edit">';
+ echo $lang['srv_settingsSystemNoRights'];
+ echo '</div>';
- echo '<fieldset>';
- echo '<legend>' . $lang['settings'] . '</legend>';
-
- $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyDostop'");
- list ($SurveyDostop) = mysqli_fetch_row($result);
- $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyCookie'");
- list ($SurveyCookie) = mysqli_fetch_row($result);
- $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyExport'");
- list ($SurveyExport) = mysqli_fetch_row($result);
- $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyForum'");
- list ($SurveyForum) = mysqli_fetch_row($result);
-
- echo '<span class="nastavitveSpan1" ><label>' . $lang['SurveyDostop'] . ':</label></span>';
- ?>
- <select name="SurveyDostop">
- <option value="0" <?=($SurveyDostop=='0'?"SELECTED":"") ?>><?=$lang['forum_admin']?></option>
- <option value="1" <?=($SurveyDostop=='1'?"SELECTED":"") ?>><?=$lang['forum_manager']?></option>
- <option value="2" <?=($SurveyDostop=='2'?"SELECTED":"") ?>><?=$lang['forum_clan']?></option>
- <option value="3" <?=($SurveyDostop=='3'?"SELECTED":"") ?>><?=$lang['forum_registered']?></option>
- </select>
- <br />
- <?php
-
-
- echo '<span class="nastavitveSpan1" ><label>' . $lang['SurveyCookie'] . ':</label></span>';
- ?>
- <select name="SurveyCookie">
- <option value="-1" <?=($SurveyCookie=='-1'?"SELECTED":"") ?>><?=$lang['without']?></option>
- <option value="0" <?=($SurveyCookie=='0'?"SELECTED":"") ?>><?=$lang['srv_cookie_0']?></option>
- <option value="1" <?=($SurveyCookie=='1'?"SELECTED":"") ?>><?=$lang['srv_cookie_1']?></option>
- <option value="2" <?=($SurveyCookie=='2'?"SELECTED":"") ?>><?=$lang['srv_cookie_2']?></option>
- </select>
- <br />
- <?php
-
-
- echo '<span class="nastavitveSpan1" ><label>' . $lang['SurveyExport'] . ':</label></span>';
- ?>
- <select name="SurveyExport">
- <option value="0" <?=($SurveyExport=='0'?"SELECTED":"") ?>><?=$lang['forum_admin']?></option>
- <option value="1" <?=($SurveyExport=='1'?"SELECTED":"") ?>><?=$lang['forum_manager']?></option>
- <option value="2" <?=($SurveyExport=='2'?"SELECTED":"") ?>><?=$lang['forum_clan']?></option>
- <option value="3" <?=($SurveyExport=='3'?"SELECTED":"") ?>><?=$lang['forum_registered']?></option>
- </select>
- <br />
- <?php
-
- echo '<span class="nastavitveSpan1" ><label>' . $lang['SurveyForum'] . ':</label></span>';
- ?>
- <select name="SurveyForum">
- <?
- echo '<option value="0">'.$lang['without'].'</option>';
- $sqlf = sisplet_query("SELECT id, naslov FROM forum WHERE parent = '0'");
- while ($rowf = mysqli_fetch_array($sqlf)) {
- echo '<option value="'.$rowf['id'].'"'.($SurveyForum==$rowf['id']?' selected':'').'>'.$rowf['naslov'].'</option>';
- }
- ?>
- </select>
- </fieldset>
+ return;
+ }
- <?php
- echo '<fieldset>';
- echo '<legend>' . $lang['srv_edithelp'] . '</legend>';
-
- echo '<span class="nastavitveSpan1" ><label>' . $lang['srv_edithelp'] . ' '.Help::display('srv_window_help').': </label></span>';
- Help :: edit_toggle();
-
- echo '</fieldset>';
- //echo ' <p><input type="submit" value="' . $lang['edit4'] . '" onclick="document.settingsanketa.submit();" /></p>' . "\n\r";
- echo ' </form>';
-
-
- $smv = new SurveyMissingValues();
- $smv->SystemFilters();
-
-
- // save gumb
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa.submit();"><span>'.$lang['edit1337'] . '</span></a></div>';
-
- echo '<span class="clr"></span>';
-
- // div za prikaz uspešnosti shranjevanja
- if ($_GET['s'] == '1') {
- echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
- }
+ echo '<div id="anketa_edit">';
- } else {
- echo $lang['srv_settingsSystemNoRights'];
- }
- echo '</div>' . "\n\r";
-
+ echo '<form name="settingsanketa" action="ajax.php?a=editanketasettings&m=system" method="post" autocomplete="off">';
+
+ echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />';
+ echo ' <input type="hidden" name="submited" value="1" />';
+
+
+ // SISTEMSKE NASTAVITVE (prej v settings_optional.php)
+ echo '<fieldset><legend>'.$lang['as_basic'].'</legend>';
+
+ echo '<div class="osnovne_nastavitve">';
+
+ AppSettings::getInstance()->displaySettingsGroup('basic');
+
+ // Kdo lahko ureja ankete
+ echo '<div class="osnovne_nastavitve_single">';
+
+ echo '<label>' . $lang['SurveyDostop'] . ':</label>';
+
+ $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyDostop'");
+ list ($SurveyDostop) = mysqli_fetch_row($result);
+
+ echo '<select class="dropdown" name="SurveyDostop">';
+ echo ' <option value="0" '.($SurveyDostop=='0'?"SELECTED":"").'>'.$lang['forum_admin'].'</option>';
+ echo ' <option value="1" '.($SurveyDostop=='1'?"SELECTED":"").'>'.$lang['forum_manager'].'</option>';
+ echo ' <option value="2" '.($SurveyDostop=='2'?"SELECTED":"").'>'.$lang['forum_clan'].'</option>';
+ echo ' <option value="3" '.($SurveyDostop=='3'?"SELECTED":"").'>'.$lang['forum_registered'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ // Default trajanje piskotka
+ echo '<div class="osnovne_nastavitve_single">';
+ echo '<label>' . $lang['SurveyCookie'] . ':</label>';
+
+ $result = sisplet_query("SELECT value FROM misc WHERE what='SurveyCookie'");
+ list ($SurveyCookie) = mysqli_fetch_row($result);
+
+ echo '<select class="dropdown" name="SurveyCookie">';
+ echo ' <option value="-1" '.($SurveyCookie=='-1'?"SELECTED":"").'>'.$lang['without'].'</option>';
+ echo ' <option value="0" '.($SurveyCookie=='0'?"SELECTED":"").'>'.$lang['srv_cookie_0'].'</option>';
+ echo ' <option value="1" '.($SurveyCookie=='1'?"SELECTED":"").'>'.$lang['srv_cookie_1'].'</option>';
+ echo ' <option value="2" '.($SurveyCookie=='2'?"SELECTED":"").'>'.$lang['srv_cookie_2'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+
+
+ // INFO
+ echo '<fieldset><legend>'.$lang['as_info'].'</legend>';
+ echo '<div class="osnovne_nastavitve">';
+ AppSettings::getInstance()->displaySettingsGroup('info');
+ echo '</div>';
+ echo '</fieldset>';
+
+
+ // OMEJITVE
+ echo '<fieldset><legend>'.$lang['as_limits'].'</legend>';
+ echo '<div class="osnovne_nastavitve">';
+ AppSettings::getInstance()->displaySettingsGroup('limits');
+ echo '</div>';
+ echo '</fieldset>';
+
+
+ // SMTP NASTAVITVE
+ echo '<fieldset><legend>'.$lang['as_smtp'].'</legend>';
+ echo '<div class="osnovne_nastavitve">';
+ AppSettings::getInstance()->displaySettingsGroup('smtp');
+ echo '</div>';
+ echo '</fieldset>';
+
+
+ // MODULI
+ echo '<fieldset><legend>'.$lang['as_modules'].'</legend>';
+ echo '<div class="osnovne_nastavitve">';
+ AppSettings::getInstance()->displaySettingsGroup('modules');
+ echo '</div>';
+ echo '</fieldset>';
+
+
+ /* Missingi - zakomentirano, prenova po redizajnu
+ $smv = new SurveyMissingValues();
+ $smv->SystemFilters();
+ */
+
+
+ // save gumb
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa.submit();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+ // div za prikaz uspešnosti shranjevanja
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<div id="success_save"></div>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
+ }
+
+
+ echo '</div>';
}
/**
@@ -4928,71 +5775,78 @@ class SurveyAdminSettings {
*/
function anketa_nastavitve_predvidenicasi () {
global $lang;
-
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
+
echo '<div id="anketa_edit">';
- echo $lang['srv_predvidenicasi_help'];
-
echo '<form name="timinganketa" method="post" action="ajax.php?a=editanketasettings&m=predvidenicasi">';
- echo '<fieldset><legend>'.$lang['srv_stran'].'</legend>';
- echo '<p>'.$lang['srv_timing_page'].': <input type="text" name="timing_stran" value="'.GlobalMisc::getMisc('timing_stran').'" /> s</p>';
- echo '</fieldset>';
-
- echo '<fieldset><legend>'.$lang['srv_vprasanja'].'</legend>';
- echo '<table style="width:100%">';
- echo '<tr><td></td><td>'.$lang['srv_timing_vprasanje'].'</td><td>'.$lang['srv_timing_kategorija'].'</td><td>'.$lang['srv_timing_kategorija_max'].'</td></tr>';
- for ($tip=1; $tip<= 21; $tip++) { if ($tip <= 8 || $tip >= 16) {
+ echo '<fieldset><legend>'.$lang['srv_testiranje_predvidenicas'].'</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_predvidenicasi_help'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_timing_page'].'</label>';
+ echo '<span><input type="text" class="text large w200" name="timing_stran" value="'.GlobalMisc::getMisc('timing_stran').'" />&nbsp&nbsps</span>';
+ echo '</div>';
+
+ echo '<p class="top16 bottom16">'.$lang['srv_predvidenicasi_note'].'</p>';
+
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+
+ echo '<table id="timinganketa_table">';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_question_type'].'</th>';
+ echo '<th>'.$lang['srv_timing_vprasanje'].'</th>';
+ echo '<th>'.$lang['srv_timing_kategorija'].'</th>';
+ echo '<th>'.$lang['srv_timing_kategorija_max'].'</th>';
+ echo '</tr>';
- echo '<tr><th align="left">'.$lang['srv_vprasanje_tip_'.$tip].'</th>';
- echo '<td><input type="text" name="timing_vprasanje_'.$tip.'" value="'.GlobalMisc::getMisc('timing_vprasanje_'.$tip).'" /> s</td>';
+ for ($tip=1; $tip<= 21; $tip++) {
- if ($tip<=3 || $tip==6 || $tip==16 || $tip==17 || $tip==18 || $tip==19 || $tip==20)
- echo '<td><input type="text" name="timing_kategorija_'.$tip.'" value="'.GlobalMisc::getMisc('timing_kategorija_'.$tip).'" /> s</td>';
-
- if ($tip==3){
- $kategorija_max = GlobalMisc::getMisc('timing_kategorija_max_'.$tip);
- echo '<td><input type="text" name="timing_kategorija_max_'.$tip.'" value="'.GlobalMisc::getMisc('timing_kategorija_max_'.$tip).'" /> s'
- /*. '<select name="timing_kategorija_max_'.$tip.'" value="'.GlobalMisc::getMisc('timing_kategorija_max_'.$tip).'" >'
- . '<option value="1" '. ($kategorija_max == 1 ? 'selected' : '') .'>1</option>'
- . '<option value="2" '. ($kategorija_max == 2 ? 'selected' : '') .'>2</option>'
- . '<option value="3" '. ($kategorija_max == 3 ? 'selected' : '') .'>3</option>'
- . '<option value="5" '. ($kategorija_max == 5 ? 'selected' : '') .'>5</option>'
- . '<option value="7" '. ($kategorija_max == 7 ? 'selected' : '') .'>7</option>'
- . '<option value="10" '. ($kategorija_max == 10 ? 'selected' : '') .'>10</option>'
- . '<option value="15" '. ($kategorija_max == 15 ? 'selected' : '') .'>15</option>'
- . '<option value="20" '. ($kategorija_max == 20 ? 'selected' : '') .'>20</option>'
- . '<option value="0" '. ($kategorija_max == 0 ? 'selected' : '') .'>'. $lang['all2'] .'</option>'
- . '</select>'*/
- . '</td>';
- }
- echo '</tr>';
-
- } }
+ if ($tip <= 8 || $tip >= 16) {
+ echo '<tr>';
+ echo '<td class="left">'.$lang['srv_vprasanje_tip_'.$tip].'</td>';
+ echo '<td class="nowrap"><input type="text" name="timing_vprasanje_'.$tip.'" value="'.GlobalMisc::getMisc('timing_vprasanje_'.$tip).'" />&nbsp&nbsps</td>';
+
+ if ($tip<=3 || $tip==6 || $tip==16 || $tip==17 || $tip==18 || $tip==19 || $tip==20)
+ echo '<td class="nowrap"><input type="text" name="timing_kategorija_'.$tip.'" value="'.GlobalMisc::getMisc('timing_kategorija_'.$tip).'" />&nbsp&nbsps</td>';
+ else
+ echo '<td></td>';
+
+ if ($tip==3){
+ $kategorija_max = GlobalMisc::getMisc('timing_kategorija_max_'.$tip);
+ echo '<td class="nowrap"><input type="text" name="timing_kategorija_max_'.$tip.'" value="'.GlobalMisc::getMisc('timing_kategorija_max_'.$tip).'" />&nbsp&nbsps</td>';
+ }
+ else
+ echo '<td></td>';
+
+ echo '</tr>';
+
+ }
+ }
echo '</table>';
- echo '</fieldset>';
-
- echo '<div class="buttonwrapper floatLeft spaceLeft">';
- echo '<a class="ovalbutton ovalbutton_orange btn_savesetting" onclick="document.timinganketa.submit();"><span>'.$lang['edit1337'].'</span></a>';
+
echo '</div>';
-
- echo '<br />';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.timinganketa.submit();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
echo '</form>';
echo '</div>';
}
-
- /** prikaze div da so nastavitve shranjene in ga nato skrije
- *
- */
- function displaySuccessSave() {
- global $lang;
- echo $lang['srv_success_save'];
- }
-
function tabTestiranje () {
global $lang;
@@ -5022,20 +5876,20 @@ class SurveyAdminSettings {
global $lang;
$expected_time = array();
- $expected_time_block = array();
- $block_labels_by_number = array();
+ $expected_time_block = array();
+ $block_labels_by_number = array();
$expected_vprasanja = array();
$verjetnost = array();
- $verjetnost_block = array();
+ $verjetnost_block = array();
- //from php 7.2 this helps to round numbers calculated in bcmod() - without it, it always rounds down to int
- bcscale(1);
+ //from php 7.2 this helps to round numbers calculated in bcmod() - without it, it always rounds down to int
+ bcscale(1);
$sql = sisplet_query("SELECT introduction FROM srv_anketa WHERE id = '$this->anketa'");
$row = mysqli_fetch_array($sql);
+ $introduction = isset($row['introduction']) ? $row['introduction'] : $lang['srv_intro'];
+ $expected_vprasanja[0][0] = strlen(strip_tags($introduction)) * GlobalMisc::getMisc('timing_vprasanje_5') / 100;
- // nagovor racunamo kot da gre za labelo
- $expected_vprasanja[0][0] = strlen(strip_tags($row['introduction'])) * GlobalMisc::getMisc('timing_vprasanje_5') / 100;
$expected_vprasanja[0][1] = 1;
$expected_vprasanja[0][2] = $lang['srv_vprasanje_tip_5'];
$expected_vprasanja[0][3] = $lang['srv_intro_label'];
@@ -5043,7 +5897,7 @@ class SurveyAdminSettings {
$expected_time[0][0] = $expected_vprasanja[0][0] + GlobalMisc::getMisc('timing_stran');
$expected_time[0][1] = $expected_time[0][0];
- $block_spr_data = $this->get_block_data_by_spr_id();
+ $block_spr_data = $this->get_block_data_by_spr_id();
$sql = sisplet_query("SELECT id, naslov, vrstni_red FROM srv_grupa g WHERE g.ank_id='$this->anketa' ORDER BY g.vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
@@ -5058,62 +5912,77 @@ class SurveyAdminSettings {
$expected_vprasanja[$row1['id']][1] = $this->vprasanje_verjetnost($row1['id']);
$expected_vprasanja[$row1['id']][2] = strip_tags($row1['naslov']);
$expected_vprasanja[$row1['id']][3] = strip_tags($row['naslov']);
- $expected_vprasanja[$row1['id']][4] = strip_tags($block_spr_data[$row1['id']]['label']);
+
+ if(isset($block_spr_data[$row1['id']]['label']))
+ $expected_vprasanja[$row1['id']][4] = strip_tags($block_spr_data[$row1['id']]['label']);
+ else
+ $expected_vprasanja[$row1['id']][4] = '';
$expected_time[$row['vrstni_red']][0] += $expected_vprasanja[$row1['id']][0] * $expected_vprasanja[$row1['id']][1]; // dejanski
$expected_time[$row['vrstni_red']][1] += $expected_vprasanja[$row1['id']][0]; // bruto - z vsemi vprasanji
- if ( $expected_vprasanja[$row1['id']][1] > $verjetnost[$row['vrstni_red']])
+ if (isset($verjetnost[$row['vrstni_red']]) && $expected_vprasanja[$row1['id']][1] > $verjetnost[$row['vrstni_red']])
$verjetnost[$row['vrstni_red']] = $expected_vprasanja[$row1['id']][1];
}
- $expected_time[$row['vrstni_red']][0] += GlobalMisc::getMisc('timing_stran') * $verjetnost[$row['vrstni_red']]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
- $expected_time[$row['vrstni_red']][1] += GlobalMisc::getMisc('timing_stran');
+ if(isset($verjetnost[$row['vrstni_red']]))
+ $expected_time[$row['vrstni_red']][0] += GlobalMisc::getMisc('timing_stran') * $verjetnost[$row['vrstni_red']]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
+
+ $expected_time[$row['vrstni_red']][1] += GlobalMisc::getMisc('timing_stran');
}
- $sql = sisplet_query("SELECT * FROM srv_if as bl LEFT JOIN srv_branching as br ON br.parent = bl.id WHERE bl.enabled='0' AND bl.tip='1' AND br.ank_id = '$this->anketa' ORDER BY bl.number ASC, br.vrstni_red ASC");
- $last_block_st = -1;
+ $sql = sisplet_query("SELECT * FROM srv_if as bl LEFT JOIN srv_branching as br ON br.parent = bl.id WHERE bl.enabled='0' AND bl.tip='1' AND br.ank_id = '$this->anketa' ORDER BY bl.number ASC, br.vrstni_red ASC");
+ $last_block_st = -1;
while ($row = mysqli_fetch_array($sql)) {
- $new_block = $last_block_st != $row['number'];
- if($new_block){
- $last_block_st = $row['number'];
- $label = $row['label'] ? $row['label']: $lang['srv_blok'].' '.$last_block_st;
- $block_labels_by_number[$last_block_st] = $label;
- $expected_time_block[$last_block_st-1][0] = 0;
- $expected_time_block[$last_block_st-1][1] = 0;
- }
-
- if(!$row['element_if']){
- $expected_time_block[$last_block_st-1][0] += $expected_vprasanja[$row['element_spr']][0] * $expected_vprasanja[$row['element_spr']][1]; // dejanski
- $expected_time_block[$last_block_st-1][1] += $expected_vprasanja[$row['element_spr']][0]; // bruto - z vsemi vprasanji
-
- if ( $expected_vprasanja[$row['element_spr']][1] > $verjetnost_block[$last_block_st-1])
- $verjetnost_block[$last_block_st-1] = $expected_vprasanja[$row['element_spr']][1];
- }
- else{
- $sql1 = sisplet_query("SELECT * FROM srv_branching WHERE parent='".$row['element_if']."' ORDER BY vrstni_red ASC");
- while ($row1 = mysqli_fetch_array($sql1)) {
- $expected_time_block[$last_block_st-1][0] += $expected_vprasanja[$row1['element_spr']][0] * $expected_vprasanja[$row1['element_spr']][1]; // dejanski
- $expected_time_block[$last_block_st-1][1] += $expected_vprasanja[$row1['element_spr']][0]; // bruto - z vsemi vprasanji
- $expected_vprasanja[$row1['element_spr']][4] = $label;
-
- if ( $expected_vprasanja[$row1['element_spr']][1] > $verjetnost_block[$last_block_st-1])
- $verjetnost_block[$last_block_st-1] = $expected_vprasanja[$row1['element_spr']][1];
- }
- }
-
- if($new_block){
- $expected_time_block[$last_block_st-1][0] += GlobalMisc::getMisc('timing_stran') * $verjetnost_block[$last_block_st-1]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
- $expected_time_block[$last_block_st-1][1] += GlobalMisc::getMisc('timing_stran');
- }
+
+ $new_block = $last_block_st != $row['number'];
+
+ if($new_block){
+ $last_block_st = $row['number'];
+ $label = $row['label'] ? $row['label']: $lang['srv_blok'].' '.$last_block_st;
+ $block_labels_by_number[$last_block_st] = $label;
+ $expected_time_block[$last_block_st-1][0] = 0;
+ $expected_time_block[$last_block_st-1][1] = 0;
+ }
+
+ if(!$row['element_if']){
+ $expected_time_block[$last_block_st-1][0] += $expected_vprasanja[$row['element_spr']][0] * $expected_vprasanja[$row['element_spr']][1]; // dejanski
+ $expected_time_block[$last_block_st-1][1] += $expected_vprasanja[$row['element_spr']][0]; // bruto - z vsemi vprasanji
+
+ if ( !isset($verjetnost_block[$last_block_st-1]) || $expected_vprasanja[$row['element_spr']][1] > $verjetnost_block[$last_block_st-1])
+ $verjetnost_block[$last_block_st-1] = $expected_vprasanja[$row['element_spr']][1];
+ }
+ else{
+ $sql1 = sisplet_query("SELECT * FROM srv_branching WHERE parent='".$row['element_if']."' ORDER BY vrstni_red ASC");
+ while ($row1 = mysqli_fetch_array($sql1)) {
+ if(array_key_exists($last_block_st, $expected_time_block)){
+ $expected_time_block[$last_block_st-1][0] += $expected_vprasanja[$row1['element_spr']][0] * $expected_vprasanja[$row1['element_spr']][1]; // dejanski
+ $expected_time_block[$last_block_st-1][1] += $expected_vprasanja[$row1['element_spr']][0]; // bruto - z vsemi vprasanji
+ $expected_vprasanja[$row1['element_spr']][4] = $label;
+
+ if ( !isset($verjetnost_block[$last_block_st-1]) || $expected_vprasanja[$row1['element_spr']][1] > $verjetnost_block[$last_block_st-1])
+ $verjetnost_block[$last_block_st-1] = $expected_vprasanja[$row1['element_spr']][1];
+ }
+ }
+ }
+
+ if($new_block){
+ $expected_time_block[$last_block_st-1][0] += GlobalMisc::getMisc('timing_stran') * $verjetnost_block[$last_block_st-1]; // pri dejanskem trajanju strani upostevamo verjetnost najverjetnejsega vprasanja na strani (stran se pojavi z najvisjo verjetnostjo vseh vprasanj na strani)
+ $expected_time_block[$last_block_st-1][1] += GlobalMisc::getMisc('timing_stran');
+ }
}
// izpis za strani
$max = 0;
$total = 0;
+ $total_brez_pogojev = 0;
foreach ($expected_time AS $key => $val) {
- if ($val[1] > $max) $max = $val[1];
+
+ if ($val[1] > $max)
+ $max = $val[1];
+
$total += $val[0];
+ $total_brez_pogojev += $val[1];
}
if ($max == 0) return;
@@ -5121,46 +5990,58 @@ class SurveyAdminSettings {
return $total;
}
- $skupni_cas = (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s';
+ $skupni_cas = (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total, 60), 0).'<span class="time_text">s</span>';
+ $skupni_cas_brez_pogojev = (bcdiv($total_brez_pogojev, 60, 0)>0?bcdiv($total_brez_pogojev, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_brez_pogojev, 60), 0).'<span class="time_text">s</span>';
if ($samo_izracunaj_skupini_cas == 1)
return $skupni_cas;
- echo '<div class="clr"></div>';
-
echo '<fieldset><legend>'.$lang['srv_total_trajanje'].'</legend>';
- echo '<p>'.$lang['srv_dejansko_trajanje'].': <b>'.$skupni_cas.'</b></p>';
+ echo '<p class="semi-bold">'.$lang['srv_dejansko_trajanje'].':</p>';
+ echo '<p>'.$skupni_cas.'</p>';
echo '</fieldset>';
- echo '<br />';
-
echo '<fieldset><legend>'.$lang['srv_casi_po_straneh'].'</legend>';
- echo '<table style="width:100%">';
+ echo '<table>';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_casi_po_straneh_stran'].'</th>';
+ echo '<th colspan="2">'.$lang['srv_neto_t_cas'].' / '.$lang['srv_bruto_t_cas'].'</th>';
+ echo '</tr>';
+
foreach ($expected_time AS $vrstni_red => $time) {
$sql = sisplet_query("SELECT naslov FROM srv_grupa WHERE vrstni_red='$vrstni_red' AND ank_id = '$this->anketa'");
$row = mysqli_fetch_array($sql);
+ $naslov = isset($row['naslov']) && $row['naslov'] != '' ? $row['naslov'] : $lang['srv_intro_label'];
echo '<tr>';
- echo '<th style="text-align:left; padding: 0 20px 0 0" nowrap>'.($row['naslov']!=''?$row['naslov']:$lang['srv_intro_label']).'</th>';
-
- echo '<td style="width:100%">';
- echo ' <div class="graph_db" style="text-align: right; float: left; width: '.($time[0]/$max*85).'%">&nbsp;</div>';
+ echo '<td>'.$naslov.'</td>';
+
+ echo '<td class="right time">';
+ echo ($time[0]<60?round($time[0],1).'<span class="time_text">s</span> ':round($time[0]/60,1).'<span class="time_text">min</span> ').'/ <span class="gray">'.($time[1]<60?round($time[1],1).'<span class="time_text">s</span> ':round($time[1]/60,1).'<span class="time_text">min</span> ').'</span>';
+ echo '</td>';
+
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+
+ echo '<div class="graph_full" style="width: '.($time[0]/$max*85).'%"></div>';
if ((($time[1]-$time[0])/$max*85) > 0)
- echo ' <div class="graph_lb" style="border-left: 0; text-align: right; float: left; width: '.(($time[1]-$time[0])/$max*85).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.($time[0]<60?round($time[0],1).'s ':round($time[0]/60,1).'min ').'<span style="color:gray">/ '.($time[1]<60?round($time[1],1).'s ':round($time[1]/60,1).'min ').'</span></span>';
+ echo ' <div class="graph_empty" style="width: '.(($time[1]-$time[0])/$max*85).'%"></div>';
+
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
- echo '<tr><td colspan="3" style="border-bottom:1px solid #E4E4F9"></td></tr>';
- echo '<tr><td></td><th style="text-align:left; padding-right: 20px" nowrap>'.$lang['srv_anl_suma1'].': '.(bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s</th></tr>';
-
+ echo '<tr class="semi-bold"><td>'.$lang['srv_casi_po_vprasanjih_skupaj'].'</td><td class="right time">'.$skupni_cas.' / <span class="gray">'.$skupni_cas_brez_pogojev.'</span></td><td></td></tr>';
echo '</table>';
- echo '<p><div class="graph_db" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_neto_t_cas'].'</span>';
- echo '<div class="graph_lb" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_bruto_t_cas'].'</span></p>';
+ echo '<div class="tabela_trajanje_legenda">';
+ echo '<div class="graph_full legend"></div><span class="legend"> '.$lang['srv_neto_t_cas'].'</span>';
+ echo '<div class="graph_empty legend"></div><span class="legend"> '.$lang['srv_bruto_t_cas'].'</span>';
+ echo '</div>';
echo '</fieldset>';
@@ -5176,15 +6057,21 @@ class SurveyAdminSettings {
$prevstran = false;
- echo '<br />';
-
echo '<fieldset><legend>'.$lang['srv_casi_po_vprasanjih_strani'].'</legend>';
- echo '<table style="width:100%">';
- echo '<tr><td></td><th>'.$lang['srv_bruto_v_cas'].'</th><th>'.$lang['srv_verjetnost_pojavitve'].'</th><th>'.$lang['srv_neto_v_cas'].'</th></tr>';
+
+ echo '<table>';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_casi_po_straneh_stran'].'/'.$lang['srv_casi_po_vprasanjih_vprasanje'].'</th>';
+ echo '<th>'.$lang['srv_bruto_v_cas'].'</th>';
+ echo '<th>'.$lang['srv_verjetnost_pojavitve'].'</th>';
+ echo '<th colspan="2">'.$lang['srv_neto_v_cas'].'/'.$lang['srv_bruto_v_cas_long'].'</th>';
+ echo '</tr>';
+
foreach ($expected_vprasanja AS $vprasanje) {
if (!$prevstran || $prevstran != $vprasanje[3]) {
- echo '<tr><th style="text-align:left; border-bottom:1px solid #E4E4F9; padding-top:10px" colspan="5">'.$vprasanje[3].'</th></tr>';
+ echo '<tr><td class="semi-bold" colspan="5">'.$vprasanje[3].'</td></tr>';
$prevstran = $vprasanje[3];
}
@@ -5192,102 +6079,156 @@ class SurveyAdminSettings {
$verjetnost = $vprasanje[1];
$neto = $bruto * $verjetnost;
- echo '<tr><td align="left"><span title="'.$vprasanje[2].'">'.skrajsaj($vprasanje[2], 30).'</span></td><td align="center">'.round($bruto, 1).'s</td><td align="center">'.round($verjetnost*100, 2).'%</td><td align="center">'.round($neto, 1).'s</td>';
- echo '<td style="width:50%">';
- echo ' <div class="graph_db" style="text-align: right; float: left; width: '.($neto/$max*85).'%">&nbsp;</div>';
+ echo '<tr>';
+ echo '<td><span title="'.$vprasanje[2].'">'.skrajsaj($vprasanje[2], 30).'</span></td>';
+ echo '<td class="right">'.round($bruto, 1).'s</td>';
+ echo '<td class="center">'.round($verjetnost*100, 2).'%</td>';
+
+ echo '<td class="right time">';
+ echo round($neto, 1).'s / <span class="gray">'.round($bruto, 1).'s</span>';
+ echo '</td>';
+
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+
+ echo '<div class="graph_full" style="width: '.($neto/$max*85).'%"></div>';
if (($bruto-$neto)/$max*85 > 0)
- echo ' <div class="graph_lb" style="border-left:0; text-align: right; float: left; width: '.(($bruto-$neto)/$max*85).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left; color: gray">'.round($neto, 1).'s / '.round($bruto, 1).'s</span>';
+ echo ' <div class="graph_empty" style="width: '.(($bruto-$neto)/$max*85).'%"></div>';
+
+ echo '</div>';
echo '</td>';
+
echo '</tr>';
}
- echo '<tr><th></th><th>'.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'min ':'').''.round(bcmod($bruto_total, 60), 0).'s</th><th></th><th>'.(bcdiv($neto_total, 60, 0)>0?bcdiv($neto_total, 60, 0).'min ':'').''.round(bcmod($neto_total, 60), 0).'s</th><tr>';
+ echo '<tr class="semi-bold"><td>'.$lang['srv_casi_po_vprasanjih_skupaj'].'</td><td class="right">'.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($bruto_total, 60), 0).'<span class="time_text">s</span></td><td></td><td class="right time">'.(bcdiv($neto_total, 60, 0)>0?bcdiv($neto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($neto_total, 60), 0).'<span class="time_text">s</span> / '.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($bruto_total, 60), 0).'<span class="time_text">s</span></td><td></td></tr>';
echo '</table>';
+
+ echo '<div class="tabela_trajanje_legenda">';
+ echo '<div class="graph_full legend"></div><span class="legend"> '.$lang['srv_neto_v_cas'].'</span>';
+ echo '<div class="graph_empty legend"></div><span class="legend"> '.$lang['srv_bruto_v_cas_long'].'</span>';
+ echo '</div>';
+
echo '</fieldset>';
- //CASI PO BLOKIH
- if($block_spr_data){
- // izpis za bloke
- $maxb = 0;
- $totalb = 0;
- foreach ($expected_time_block AS $key => $val) {
- if ($val[1] > $maxb) $maxb = $val[1];
- $totalb += $val[0];
- }
-
- echo '<br />';
- echo '<fieldset><legend>'.$lang['srv_casi_po_blokih'].'</legend>';
- echo '<table style="width:100%">';
-
- foreach ($expected_time_block AS $vrstni_red => $time) {
- echo '<tr>';
- echo '<th style="text-align:left; padding: 0 20px 0 0" nowrap>'.$block_labels_by_number[$vrstni_red+1].'</th>';
-
- echo '<td style="width:100%">';
- echo ' <div class="graph_db" style="text-align: right; float: left; width: '.($time[0]/$maxb*85).'%">&nbsp;</div>';
- if ((($time[1]-$time[0])/$maxb*85) > 0)
- echo ' <div class="graph_lb" style="border-left: 0; text-align: right; float: left; width: '.(($time[1]-$time[0])/$maxb*85).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.($time[0]<60?round($time[0],1).'s ':round($time[0]/60,1).'min ').'<span style="color:gray">/ '.($time[1]<60?round($time[1],1).'s ':round($time[1]/60,1).'min ').'</span></span>';
- echo '</td>';
-
- echo '</tr>';
- }
- echo '<tr><td colspan="3" style="border-bottom:1px solid #E4E4F9"></td></tr>';
- echo '<tr><td></td><th style="text-align:left; padding-right: 20px" nowrap>'.$lang['srv_anl_suma1'].': '.(bcdiv($totalb, 60, 0)>0?bcdiv($totalb, 60, 0).'min ':'').''.round(bcmod($totalb, 60), 0).'s</th></tr>';
+ //CASI PO BLOKIH
+ if($block_spr_data){
+ // izpis za bloke
+ $maxb = 0;
+ $totalb = 0;
+ foreach ($expected_time_block AS $key => $val) {
+ if ($val[1] > $maxb) $maxb = $val[1];
+ $totalb += $val[0];
+ }
+
+ echo '<fieldset><legend>'.$lang['srv_casi_po_blokih'].'</legend>';
+ echo '<table>';
- echo '</table>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_casi_po_blokih_blok'].'</th>';
+ echo '<th colspan="2">'.$lang['srv_neto_t_cas'].' / '.$lang['srv_bruto_t_cas'].'</th>';
+ echo '</tr>';
- echo '<p><div class="graph_db" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_neto_t_cas'].'</span>';
- echo '<div class="graph_lb" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_bruto_t_cas'].'</span></p>';
+ foreach ($expected_time_block AS $vrstni_red => $time) {
+ echo '<tr>';
+ echo '<td class="nowrap">'.$block_labels_by_number[$vrstni_red+1].'</td>';
- echo '</fieldset>';
-
-
- // izpis za vprasanja po blokih
- $max = 0;
- $bruto_total = 0;
- $neto_total = 0;
- foreach ($expected_vprasanja AS $vpr) {
- if($vpr[4]){
- if ($vpr[0] > $max) $max = $vpr[0];
- $bruto_total += $vpr[0];
- $neto_total += $vpr[0] * $vpr[1];
- }
- }
+ echo '<td class="right time">';
+ echo ($time[0]<60?round($time[0],1).'<span class="time_text">s</span> ':round($time[0]/60,1).'<span class="time_text">min</span> ').'<span class="gray">/ '.($time[1]<60?round($time[1],1).'<span class="time_text">s</span> ':round($time[1]/60,1).'<span class="time_text">min</span> ').'</span>';
+ echo '</td>';
- $prevstran = false;
-
- echo '<br />';
-
- echo '<fieldset><legend>'.$lang['srv_casi_po_vprasanjih_bloki'].'</legend>';
- echo '<table style="width:100%">';
- echo '<tr><td></td><th>'.$lang['srv_bruto_v_cas'].'</th><th>'.$lang['srv_verjetnost_pojavitve'].'</th><th>'.$lang['srv_neto_v_cas'].'</th></tr>';
- foreach ($expected_vprasanja AS $vprasanje) {
- if($vprasanje[4]){
- if (!$prevstran || $prevstran != $vprasanje[4]) {
- echo '<tr><th style="text-align:left; border-bottom:1px solid #E4E4F9; padding-top:10px" colspan="5">'.$vprasanje[4].'</th></tr>';
- $prevstran = $vprasanje[4];
- }
-
- $bruto = $vprasanje[0];
- $verjetnost = $vprasanje[1];
- $neto = $bruto * $verjetnost;
-
- echo '<tr><td align="left"><span title="'.$vprasanje[2].'">'.skrajsaj($vprasanje[2], 30).'</span></td><td align="center">'.round($bruto, 1).'s</td><td align="center">'.round($verjetnost*100, 2).'%</td><td align="center">'.round($neto, 1).'s</td>';
- echo '<td style="width:50%">';
- echo ' <div class="graph_db" style="text-align: right; float: left; width: '.($neto/$max*85).'%">&nbsp;</div>';
- if (($bruto-$neto)/$max*85 > 0)
- echo ' <div class="graph_lb" style="border-left:0; text-align: right; float: left; width: '.(($bruto-$neto)/$max*85).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left; color: gray">'.round($neto, 1).'s / '.round($bruto, 1).'s</span>';
- echo '</td>';
- echo '</tr>';
- }
- }
- echo '<tr><th></th><th>'.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'min ':'').''.round(bcmod($bruto_total, 60), 0).'s</th><th></th><th>'.(bcdiv($neto_total, 60, 0)>0?bcdiv($neto_total, 60, 0).'min ':'').''.round(bcmod($neto_total, 60), 0).'s</th><tr>';
- echo '</table>';
- echo '</fieldset>';
- }
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($time[0]/$maxb*85).'%"></div>';
+ if ((($time[1]-$time[0])/$maxb*85) > 0)
+ echo ' <div class="graph_empty" style="width: '.(($time[1]-$time[0])/$maxb*85).'%"></div>';
+ echo '</div>';
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ echo '<tr class="semi-bold"><td>'.$lang['srv_casi_po_vprasanjih_skupaj'].'</td><td class="right time">'.(bcdiv($totalb, 60, 0)>0?bcdiv($totalb, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($totalb, 60), 0).'<span class="time_text">s</span></td><td></td><td></td><td></td></tr>';
+
+ echo '</table>';
+
+ echo '<div class="tabela_trajanje_legenda">';
+ echo '<div class="graph_full legend"></div><span class="legend"> '.$lang['srv_neto_t_cas'].'</span>';
+ echo '<div class="graph_empty legend"></div><span class="legend"> '.$lang['srv_bruto_t_cas'].'</span>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+
+ // izpis za vprasanja po blokih
+ $max = 0;
+ $bruto_total = 0;
+ $neto_total = 0;
+ foreach ($expected_vprasanja AS $vpr) {
+ if($vpr[4]){
+ if ($vpr[0] > $max) $max = $vpr[0];
+ $bruto_total += $vpr[0];
+ $neto_total += $vpr[0] * $vpr[1];
+ }
+ }
+
+ $prevstran = false;
+
+ echo '<fieldset><legend>'.$lang['srv_casi_po_vprasanjih_bloki'].'</legend>';
+
+ echo '<table>';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_casi_po_straneh_stran'].'/'.$lang['srv_casi_po_vprasanjih_vprasanje'].'</th>';
+ echo '<th>'.$lang['srv_bruto_v_cas'].'</th>';
+ echo '<th>'.$lang['srv_verjetnost_pojavitve'].'</th>';
+ echo '<th colspan="2">'.$lang['srv_neto_v_cas'].'/'.$lang['srv_bruto_v_cas_long'].'</th>';
+ echo '</tr>';
+
+ foreach ($expected_vprasanja AS $vprasanje) {
+
+ if($vprasanje[4]){
+ if (!$prevstran || $prevstran != $vprasanje[4]) {
+ echo '<tr><td class="semi-bold" colspan="5">'.$vprasanje[4].'</td></tr>';
+ $prevstran = $vprasanje[4];
+ }
+
+ $bruto = $vprasanje[0];
+ $verjetnost = $vprasanje[1];
+ $neto = $bruto * $verjetnost;
+
+ echo '<tr>';
+ echo '<td><span title="'.$vprasanje[2].'">'.skrajsaj($vprasanje[2], 30).'</span></td>';
+ echo '<td class="right">'.round($bruto, 1).'s</td>';
+ echo '<td class="center">'.round($verjetnost*100, 2).'%</td>';
+
+ echo '<td class="right time">';
+ echo round($neto, 1).'s / <span class="gray">'.round($bruto, 1).'s</span>';
+ echo '</td>';
+
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+
+ echo '<div class="graph_full" style="width: '.($neto/$max*85).'%"></div>';
+ if (($bruto-$neto)/$max*85 > 0)
+ echo ' <div class="graph_empty" style="width: '.(($bruto-$neto)/$max*85).'%"></div>';
+
+ echo '</div>';
+ echo '</td>';
+
+ echo '</tr>';
+ }
+
+ }
+ echo '<tr class="semi-bold"><td>'.$lang['srv_casi_po_vprasanjih_skupaj'].'</td><td class="right">'.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($bruto_total, 60), 0).'<span class="time_text">s</span></td><td></td><td class="right time">'.(bcdiv($neto_total, 60, 0)>0?bcdiv($neto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($neto_total, 60), 0).'<span class="time_text">s</span> / '.(bcdiv($bruto_total, 60, 0)>0?bcdiv($bruto_total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($bruto_total, 60), 0).'<span class="time_text">s</span></td><td></td></tr>';
+ echo '</table>';
+
+ echo '<div class="tabela_trajanje_legenda">';
+ echo '<div class="graph_full legend"></div><span class="legend"> '.$lang['srv_neto_v_cas'].'</span>';
+ echo '<div class="graph_empty legend"></div><span class="legend"> '.$lang['srv_bruto_v_cas_long'].'</span>';
+ echo '</div>';
+
+ echo '</fieldset>';
+ }
}
/**
@@ -5323,21 +6264,24 @@ class SurveyAdminSettings {
if ($row1['tip'] <= 3 || $row1['tip'] == 6 || $row1['tip'] == 16 || $row1['tip'] == 17 || $row1['tip'] == 18 || $row1['tip'] == 19 || $row1['tip'] == 20) {
$sql2 = sisplet_query("SELECT naslov FROM srv_vrednost WHERE spr_id='$row1[id]'");
- //for those types we have max time option
- if($row1['tip'] == 3){
- while ($row2 = mysqli_fetch_array($sql2)) {
- $expected_time_temp += strlen(strip_tags($row2['naslov'])) * GlobalMisc::getMisc('timing_kategorija_'.$row1['tip']) / 100;
- }
- //if time is greater than max time, use max time
- $max_time = GlobalMisc::getMisc('timing_kategorija_max_'.$row1['tip']);
- $expected_time += ($max_time > $expected_time_temp) ? $expected_time_temp : $max_time;
- }
- //types that doesnt have max time option
- else{
- while ($row2 = mysqli_fetch_array($sql2)) {
- $expected_time += strlen(strip_tags($row2['naslov'])) * GlobalMisc::getMisc('timing_kategorija_'.$row1['tip']) / 100;
- }
- }
+
+ //for those types we have max time option
+ if($row1['tip'] == 3){
+ $expected_time_temp = 0;
+
+ while ($row2 = mysqli_fetch_array($sql2)) {
+ $expected_time_temp += strlen(strip_tags($row2['naslov'])) * GlobalMisc::getMisc('timing_kategorija_'.$row1['tip']) / 100;
+ }
+ //if time is greater than max time, use max time
+ $max_time = GlobalMisc::getMisc('timing_kategorija_max_'.$row1['tip']);
+ $expected_time += (isset($expected_time_temp) && $max_time > $expected_time_temp) ? $expected_time_temp : $max_time;
+ }
+ //types that doesnt have max time option
+ else{
+ while ($row2 = mysqli_fetch_array($sql2)) {
+ $expected_time += strlen(strip_tags($row2['naslov'])) * GlobalMisc::getMisc('timing_kategorija_'.$row1['tip']) / 100;
+ }
+ }
}
return $expected_time;
@@ -5516,15 +6460,20 @@ class SurveyAdminSettings {
SurveyUserSetting :: getInstance()->Init($this->anketa, $global_user_id);
// nastavitve iz popupa
- $rezanje = SurveyUserSetting::getInstance()->getSettings('rezanje'); if ($rezanje == '') $rezanje = 1;
+ $rezanje = SurveyUserSetting::getInstance()->getSettings('rezanje'); if ($rezanje == '') $rezanje = 0;
$rezanje_meja_sp = SurveyUserSetting::getInstance()->getSettings('rezanje_meja_sp'); if ($rezanje_meja_sp == '') $rezanje_meja_sp = 5;
$rezanje_meja_zg = SurveyUserSetting::getInstance()->getSettings('rezanje_meja_zg'); if ($rezanje_meja_zg == '') $rezanje_meja_zg = 5;
$rezanje_predvidena_sp = SurveyUserSetting::getInstance()->getSettings('rezanje_predvidena_sp'); if ($rezanje_predvidena_sp == '') $rezanje_predvidena_sp = 10;
$rezanje_predvidena_zg = SurveyUserSetting::getInstance()->getSettings('rezanje_predvidena_zg'); if ($rezanje_predvidena_zg == '') $rezanje_predvidena_zg = 200;
$rezanje_preskocene = SurveyUserSetting::getInstance()->getSettings('rezanje_preskocene'); if ($rezanje_preskocene == '') $rezanje_preskocene = 1;
+ $get_predvideni = isset($_GET['predvideni']) ? $_GET['predvideni'] : '';
+ $get_prikazi01 = isset($_GET['prikazi01']) ? $_GET['prikazi01'] : '';
+ $get_pages = isset($_GET['pages']) ? $_GET['pages'] : '';
+
+
/* ++ Predvideni casi */
- if ($_GET['predvideni'] == 1 || $rezanje == 1) {
+ if ($get_predvideni == 1 || $rezanje == 1) {
$expected_time = array();
$expected_vprasanja = array();
$verjetnost = array();
@@ -5559,7 +6508,7 @@ class SurveyAdminSettings {
$expected_time[$row['vrstni_red']][0] += $expected_vprasanja[$row1['id']][0] * $expected_vprasanja[$row1['id']][1]; // dejanski
$expected_time[$row['vrstni_red']][1] += $expected_vprasanja[$row1['id']][0]; // bruto - z vsemi vprasanji
- if ( $expected_vprasanja[$row1['id']][1] > $verjetnost[$row['vrstni_red']])
+ if (!isset($verjetnost[$row['vrstni_red']]) || $expected_vprasanja[$row1['id']][1] > $verjetnost[$row['vrstni_red']])
$verjetnost[$row['vrstni_red']] = $expected_vprasanja[$row1['id']][1];
}
@@ -5594,9 +6543,14 @@ class SurveyAdminSettings {
$sql = sisplet_query("SELECT ug.usr_id, UNIX_TIMESTAMP(ug.time_edit) AS time_edit_u, g.vrstni_red FROM srv_user_grupa".$this->db_table." ug, srv_grupa g, srv_user u WHERE ug.usr_id=u.id AND u.last_status IN ($status) $lurker AND ug.gru_id=g.id AND g.ank_id='$this->anketa' ORDER BY usr_id, gru_id");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
if (mysqli_num_rows($sql) == 0) {
+
if ($samo_izracunaj_skupini_cas == 1) {
return null;
- } else {
+ }
+ elseif ($samo_izracunaj_skupini_cas == 2) {
+ return array(null, null);
+ }
+ else {
echo '<div style="padding: 5px;" class="clr">'.$lang['srv_analiza_no_entry'].'</div>';
}
}
@@ -5636,35 +6590,25 @@ class SurveyAdminSettings {
$casi = array();
foreach ($user_grupa AS $usr_id => $val) {
- //$sql = sisplet_query("SELECT recnum, time_insert, UNIX_TIMESTAMP(time_insert) AS time_insert_u FROM srv_user WHERE id = '$usr_id'");
- //$row = mysqli_fetch_array($sql);
- $row = $cache_row[$usr_id];
-
- //$sql1 = sisplet_query("SELECT time_edit, UNIX_TIMESTAMP(time_edit) AS time_edit_u FROM srv_user_grupa".$this->db_table." WHERE usr_id = '$usr_id' AND gru_id = '0'");
- //$row1 = mysqli_fetch_array($sql1);
- $row1 = $cache_row1[$usr_id];
+ $row = isset($cache_row[$usr_id]) ? $cache_row[$usr_id] : array();
+ $row1 = isset($cache_row1[$usr_id]) ? $cache_row1[$usr_id] : array();
- //echo $row1['time_edit'].' ('.($row1['time_edit_u'] - strtotime($row1['time_edit'])).') - '.$row['time_insert'].' ('.($row['time_insert_u'] - strtotime($row['time_insert'])).')<br>';
- $prev = ($row1['time_edit'] != '' ? $row1['time_edit_u'] : $row['time_insert_u']);
+ $prev = (isset($row1['time_edit']) && $row1['time_edit'] != '' ? $row1['time_edit_u'] : $row['time_insert_u']);
// nagovor
- //if ($row1['time_edit'] != '') $casi[0][$usr_id] = $this->diff($row1['time_edit'], $row['time_insert']);
- if ($row1['time_edit'] != '') $casi[0][$usr_id] = abs($row1['time_edit_u'] - $row['time_insert_u']);
+ if (isset($row1['time_edit']) && $row1['time_edit'] != '') $casi[0][$usr_id] = abs($row1['time_edit_u'] - $row['time_insert_u']);
- if ($row['recnum'] > 0) { // zapisi brez recnuma ne pridejo v poštev, ker nimajo pravih časov
+ if (isset($row['recnum']) && $row['recnum'] > 0) { // zapisi brez recnuma ne pridejo v poštev, ker nimajo pravih časov
foreach ($val AS $vrstni_red => $time_edit) {
-
- //$casi[$vrstni_red][$usr_id] = $this->diff($time_edit, $prev);
- $casi[$vrstni_red][$usr_id] = abs($time_edit - $prev);
-
- $prev = $time_edit;
-
+
+ $casi[$vrstni_red][$usr_id] = abs($time_edit - $prev);
+
+ $prev = $time_edit;
}
}
}
// porezemo zgornjih in spodnjih 5% casov vsake strani
- //if (isset($_GET['truncate'])) $truncate = ((int)$_GET['truncate'])/100; else $truncate = 0.05;
$spodnja = $rezanje_meja_sp / 100;
$zgornja = $rezanje_meja_zg / 100;
@@ -5695,23 +6639,27 @@ class SurveyAdminSettings {
}
}
-
- //foreach ($casi AS $key => $val) { echo $key.': '; foreach ($val AS $k => $v) { echo $v.', '; } echo '<br>'; }
-
+
// izracunamo povprecne case
$sql = sisplet_query("SELECT MAX(vrstni_red) AS max FROM srv_grupa WHERE ank_id = '$this->anketa'");
$row = mysqli_fetch_array($sql);
$count = array();
- $count_bruto = array();
$povprecni_casi = array();
- $povprecni_casi_bruto = array();
- $max_time = 0;
- for ($i=0; $i<=$row['max']; $i++) $povprecni_casi[$i] = 0;
- foreach ($casi AS $vrstni_red => $val) {
+ $user_casi = array();
+
+ $max_time_on_page = 0;
+
+ // Na zacetku nastavimo vse povprecne case po straneh na 0
+ for ($i=0; $i<=$row['max']; $i++){
+ $povprecni_casi[$i] = 0;
+ }
+
+ // Loop po vseh straneh
+ foreach ($casi AS $vrstni_red => $uporabniki_na_strani) {
- // pogledamo za preskocene strani
+ // pogledamo za preskocene strani - samo ce nimamo nastavljeno, da se uposteva preskocene kot 0s
$preskocene = array();
if ($rezanje_preskocene == 0) {
$sqlp = sisplet_query("SELECT ug.usr_id FROM srv_user_grupa".$this->db_table." ug, srv_grupa g WHERE g.id=ug.gru_id AND g.vrstni_red='$vrstni_red' AND ug.preskocena='1'");
@@ -5720,229 +6668,478 @@ class SurveyAdminSettings {
}
}
- foreach ($casi[$vrstni_red] AS $usr_id => $time) {
- if (!in_array($usr_id, $preskocene)) {
- $povprecni_casi_bruto[$vrstni_red] += $time; // bruto so kao brez upoštevanja strani ki so se preskocile (0s, 1s)
- $count_bruto[$vrstni_red] ++; // to je dejansko trajanje strani, ce uporabnik pride nanjo
- }
- if (!in_array($usr_id, $preskocene) || $rezanje_preskocene==1) {
- $povprecni_casi[$vrstni_red] += $time; // neto je kao povprecno trajanje strani in uposteva tudi 0s, 1s ce se je preskocilo
- $count[$vrstni_red] ++; // ta cas pride potem dejansko krajsi od bruto casa
- }
- if ($time > $max_time) $max_time = $time;
+ // Loop po vseh uporabnikih na strani (cas, ki ga je prezivel na trenutni strani)
+ foreach ($uporabniki_na_strani AS $usr_id => $time) {
+
+ // Racunanje casov - eliminiramo preskocene samo ce imamo to nastavitev vklopljeno
+ //if (!in_array($usr_id, $preskocene) || $rezanje_preskocene==1) {
+
+ // neto je kao povprecno trajanje strani in uposteva tudi 0s, 1s ce se je preskocilo
+ if(isset($povprecni_casi[$vrstni_red]))
+ $povprecni_casi[$vrstni_red] += $time;
+ else
+ $povprecni_casi[$vrstni_red] = $time;
+
+ // Pristejemo cas userja
+ if(isset($user_casi[$usr_id]))
+ $user_casi[$usr_id] += $time;
+ else
+ $user_casi[$usr_id] = $time;
+ //}
+
+ // Zabelezimo najdaljsi obisk strani
+ if ($time > $max_time_on_page)
+ $max_time_on_page = $time;
}
+
+ // Izracunamo povprecje na strani
+ if (count($uporabniki_na_strani) > 0){
+ $povprecni_casi[$vrstni_red] = $povprecni_casi[$vrstni_red] / count($uporabniki_na_strani);
+ }
+
+ $count[$vrstni_red] = count($casi[$vrstni_red]);
}
- foreach ($povprecni_casi AS $vrstni_red => $time) {
- if ($count[$vrstni_red] > 0)
- $povprecni_casi[$vrstni_red] = $time / $count[$vrstni_red];
- }
-
- foreach ($povprecni_casi_bruto AS $vrstni_red => $time) {
- if ($count_bruto[$vrstni_red] > 0)
- $povprecni_casi_bruto[$vrstni_red] = $time / $count_bruto[$vrstni_red];
- }
-
+ // Loop po povprecnih casih in dobimo najvecji povprecni cas in celoten cas
$max = 0;
- $total = 0;
- $total_predvideni = 0;
+ $total_povprecni_cas = 0;
+ $total_predvideni_cas = 0;
foreach ($povprecni_casi AS $key => $val) {
- if ($val > $max) $max = $val;
- $total += $val;
- }
- /*foreach ($povprecni_casi AS $key => $val) {
- if ($val > $max) $max = $val;
- //$total += $val;
- }*/
- if ($_GET['predvideni'] == 1) {
+
+ // Shranimo vecji povprecni cas
+ if ($val > $max)
+ $max = $val;
+
+ // Pristejemo povprecni cas strani celotnemu povprecnemu casu
+ $total_povprecni_cas += $val;
+ }
+
+ if ($get_predvideni == 1) {
if ($rezanje_preskocene == 1) {
foreach ($expected_time AS $key => $val) {
if ($val[0] > $max) $max = $val[0];
- $total_predvideni += $val[0];
+ $total_predvideni_cas += $val[0];
}
} else {
foreach ($expected_time AS $key => $val) {
if ($val[1] > $max) $max = $val[1];
- $total_predvideni += $val[1];
+ $total_predvideni_cas += $val[1];
}
}
}
+
- if ($max == 0) return;
-
- if ($samo_izracunaj_skupini_cas == 1)
- return (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s';
-
+ // Izracunamo mediano, min in max cas na anketi
+ $total_median_cas = 0;
+ $total_min_cas = 0;
+ $total_max_cas = 0;
+
+ // Sortiramo case uporabnikov po velikosti
+ sort($user_casi, SORT_NUMERIC);
+ $user_count = count($user_casi);
+
+ // Dobimo index srednjega elementa
+ $user_median_index = floor($user_count / 2);
+
+ // Liho stevilo userjev - dobimo mediano - vrednost srednjega
+ if ($user_count % 2 === 1) {
+ $total_median_cas = $user_casi[$user_median_index];
+ }
+ // Sodo stevilo - izracunamo mediano iz srednjih dveh
+ else {
+ if(isset($user_casi[$user_median_index-1]))
+ $total_median_cas = ($user_casi[$user_median_index-1] + $user_casi[$user_median_index]) / 2;
+ else
+ $total_median_cas = $user_casi[$user_median_index];
+ }
+
+ // Zabelezimo min in max cas uporabnika na anketi
+ $total_min_cas = $user_casi[0];
+ $total_max_cas = $user_casi[$user_count-1];
+
+
+ if ($max == 0)
+ return;
+
// izpis
- echo '<div class="clr"></div>';
+ $skupni_cas = (bcdiv($total_povprecni_cas, 60, 0) > 0 ? bcdiv($total_povprecni_cas, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_povprecni_cas, 60), 0).'<span class="time_text">s</span>';
+ $predviden_cas = (bcdiv($total_predvideni_cas, 60, 0)>0?bcdiv($total_predvideni_cas, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_predvideni_cas, 60), 0);
+
+ $mediana = (bcdiv($total_median_cas, 60, 0) > 0 ? bcdiv($total_median_cas, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_median_cas, 60), 0).'<span class="time_text">s</span>';
+ $minimum = (bcdiv($total_min_cas, 60, 0) > 0 ? bcdiv($total_min_cas, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_min_cas, 60), 0).'<span class="time_text">s</span>';
+ $maximum = (bcdiv($total_max_cas, 60, 0) > 0 ? bcdiv($total_max_cas, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total_max_cas, 60), 0).'<span class="time_text">s</span>';
+ $numerus = $user_count;
+
+
+ // Ce izipsujemo samo dejanski cas na nekem drugem mestu
+ if ($samo_izracunaj_skupini_cas > 0){
+
+ // Vracamo array tudi z mediano
+ if($samo_izracunaj_skupini_cas == 2)
+ return array($skupni_cas, $mediana);
+ else
+ return $skupni_cas;
+ }
+
+
+ // Prvi segment - dejansko trajanje, mediana...
+ echo '<fieldset><legend>'.$lang['srv_total_trajanje'].'</legend>';
+ echo ' <p class="semi-bold">'.$lang['srv_dejansko_trajanje_real'].':</p>';
+ echo ' <p>'.$skupni_cas.'</p>';
+
+ echo ' <p class="semi-bold top16">'.$lang['median'].':</p>';
+ echo ' <p>'.$mediana.'</p>';
+
+ echo ' <p class="semi-bold top8">Min:</p>';
+ echo ' <p>'.$minimum.'</p>';
+
+ echo ' <p class="semi-bold top8">Max:</p>';
+ echo ' <p>'.$maximum.'</p>';
+
+ echo ' <p class="semi-bold top8">'.$lang['numerus'].':</p>';
+ echo ' <p>'.$numerus.'</p>';
+
+ echo '</fieldset>';
+
+
echo '<fieldset><legend>'.$lang['srv_dejanski_casi'].'</legend>';
- echo '<table style="width:100%" >';
- echo '<tr><td></td><td>';
- echo '<input type="checkbox" name="predvideni" id="predvideni" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.($_GET['predvideni']==1?'0':'1').'&pages='.$_GET['pages'].'&prikazi01='.$_GET['prikazi01'].'\');" '.($_GET['predvideni']==1?'checked':'').' /><label for="predvideni">'.$lang['srv_vkljuci_predvidene'].'</label>';
- echo '</td><td nowrap>'.$lang['srv_stevilo_enot'].'</td></tr>';
+
+ echo '<p class="bottom16"><input type="checkbox" name="predvideni" id="predvideni" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.($get_predvideni == 1 ? '0' : '1').'&pages='.$get_pages.'&prikazi01='.$get_prikazi01.'\');" '.($get_predvideni == 1 ? 'checked' : '').' /><label for="predvideni">'.$lang['srv_vkljuci_predvidene'].'</label></p>';
+
+ echo '<table>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_casi_po_straneh_stran'].'</th>';
+ echo '<th colspan="2">'.$lang['srv_neto_v_cas'];
+
+ if ($get_predvideni == 1) {
+ echo ' / '.$lang['srv_testiranje_predvidenicas_1'];
+ }
+ echo '</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
foreach ($povprecni_casi AS $vrstni_red => $time) {
+ $naslov = $lang['srv_intro_label'];
+
$sql = sisplet_query("SELECT naslov FROM srv_grupa WHERE vrstni_red='$vrstni_red' AND ank_id = '$this->anketa'");
- $row = mysqli_fetch_array($sql);
-
- $bruto = $povprecni_casi_bruto[$vrstni_red];
-
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+
+ if($row['naslov'] != '')
+ $naslov = $row['naslov'];
+ }
+
echo '<tr>';
- echo '<th style="text-align:left; padding-right:20px" nowrap>'.($row['naslov']!=''?$row['naslov']:$lang['srv_intro_label']).'</th>';
-
- echo '<td style="width:100%">';
- echo ' <div class="graph_db" style="text-align: right; float: left; width: '.($time/$max*85).'%">&nbsp;</div>';
- //if ($bruto-$time > 0)
- //echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.(($bruto-$time)/$max*85).'%; border-left:0px">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.($time<60?round($time,1).'s ':round($time/60,1).'min ')./*'<span style="color:gray">/ '.($bruto<60?round($bruto,1).'s ':round($bruto/60,1).'min ').'</span>'.*/'</span>';
+ echo '<td>'.$naslov.'</td>';
+ echo '<td class="right time">'.($time<60 ? round($time,1).'<span class="time_text">s</span> ' : round($time/60,1).'<span class="time_text">min</span> ');
+ if ($get_predvideni == 1) {
+ if ($rezanje_preskocene == 1)
+ $time = $expected_time[$vrstni_red][0];
+ else
+ $time = $expected_time[$vrstni_red][1];
+
+ echo '<span class="gray"> / '.($time<60 ? round($time,1).'<span class="time_text">s</span> ' : round($time/60,1).'<span class="time_text">min</span> ').'</span>';
+ }
echo '</td>';
- echo '<td style="text-align:center" nowrap>'.$count[$vrstni_red]./*' <span style="color:gray">/ '.$count_bruto[$vrstni_red].'</span>'.*/'</td>';
-
- echo '</tr>';
-
- if ($_GET['predvideni'] == 1) {
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo '<div class="graph_full" style="width: '.($time/$max*85).'%"></div>';
+
+ if ($get_predvideni == 1) {
if ($rezanje_preskocene == 1)
$time = $expected_time[$vrstni_red][0];
else
$time = $expected_time[$vrstni_red][1];
- echo '<tr>';
- echo '<th style="text-align:left; padding-right: 20px; color:gray" nowrap>'.($row['naslov']!=''?$row['naslov']:$lang['srv_intro_label']).'</th>';
-
- echo '<td style="width:100%">';
- echo ' <div class="graph_'.($rezanje_preskocene==1?'lb':'lr').'" style="text-align: right; float: left; width: '.($time/$max*85).'%">&nbsp;</div>';
- //if ((($time[1]-$time[0])/$max*85) > 0)
- // echo ' <div class="graph_lb" style="border-left: 0; text-align: right; float: left; width: '.(($time[1]-$time[0])/$max*85).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.($time<60?round($time,1).'s ':round($time/60,1).'min ')./*'<span style="color:gray">/ '.($time[1]<60?round($time[1],1).'s ':round($time[1]/60,1).'min ').'</span>'.*/'</span>';
- echo '</td>';
- echo '</tr>';
- echo '<tr><td colspan="3" style="border-bottom:1px solid #E4E4F9"></td></tr>';
+
+ echo '<div class="graph_'.($rezanje_preskocene==1?'empty':'red').'" style="width: '.($time/$max*85).'%"></div>';
}
+
+ echo '</div>';
+ echo '</td>';
+
+ echo '<td class="right">'.(isset($count[$vrstni_red]) ? $count[$vrstni_red] : 0).'</td>';
+
+ echo '</tr>';
}
- if ($_GET['predvideni'] != 1)
- echo '<tr><td colspan="3" style="border-bottom:1px solid #E4E4F9"></td></tr>';
- echo '<tr><td></td><th style="text-align:left">'.$lang['srv_anl_suma1'].': '.(bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s';
- if ($_GET['predvideni'] == 1) echo ' / '.$lang['srv_skupaj_predvideni'].': '.(bcdiv($total_predvideni, 60, 0)>0?bcdiv($total_predvideni, 60, 0).'min ':'').''.round(bcmod($total_predvideni, 60), 0).'s';
- echo '</th></tr>';
-
- echo '</table>';
- if ($_GET['predvideni'] == 1) {
- echo '<p><div class="graph_db" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_neto_t_cas'].'</span>';
- echo '<div class="graph_'.($rezanje_preskocene==1?'lb':'lr').'" style="float: left; width: 11px">&nbsp;</div><span style="float:left; margin:0 10px 0 5px"> - '.$lang['srv_testiranje_predvidenicas'].'</span></p>';
+ echo '<tr class="semi-bold"><td>'.$lang['srv_anl_suma1'].'<td class="right time">'.$skupni_cas;
+ if ($get_predvideni == 1) {
+ if ($rezanje_preskocene == 1)
+ $time = $expected_time[$vrstni_red][0];
+ else
+ $time = $expected_time[$vrstni_red][1];
+
+ echo '<span class="gray"> / '.$predviden_cas.'s</span>';
}
+ echo '</td><td></td><td></td>';
- echo '</fieldset>';
+ echo '</td></tr>';
- if ($max_time > 1000 && $admin_type > 0) return; // pridejo prevelike tabele
+ echo '</table>';
+
+ echo '<div class="tabela_trajanje_legenda">';
+ echo '<div class="graph_full legend"></div><span class="legend"> '.$lang['srv_neto_t_cas'].'</span>';
+ if ($get_predvideni == 1)
+ echo '<div class="graph_empty legend"></div><span class="legend"> '.$lang['srv_testiranje_predvidenicas_1'].'</span>';
+ echo '</div>';
- if ($_GET['prikazi01'] == 1)
- $t_min = 0;
- else
- $t_min = 2;
+ echo '</fieldset>';
+
- // izpis histograma casov za vsako stran
+ // pridejo prevelike tabele
+ if ($max_time_on_page > 1000 && $admin_type > 0)
+ return;
- echo '<br /><fieldset><legend>'.$lang['srv_frekvencna_porazdelitev'].'</legend>';
+
+ // izpis histograma casov za vsako stran
- echo '<p>';
- echo ' <input type="checkbox" name="pages" id="pages" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.$_GET['predvideni'].'&prikazi01='.$_GET['prikazi01'].'&pages='.($_GET['pages']==1?'0':'1').'\');" '.($_GET['pages']==1?'checked':'').' /><label for="pages">'.$lang['srv_show_pages'].'</label>';
- echo '</p>';
+ echo '<fieldset style="position:relative;"><legend>'.$lang['srv_frekvencna_porazdelitev'].'</legend>';
+
+ echo '<div class="setting_holder bottom16">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="pages" id="pages" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.$get_predvideni.'&prikazi01='.$get_prikazi01.'&pages='.($get_pages == 1 ? '0' : '1').'\');" '.($get_pages == 1 ? 'checked' : '').' /><label for="pages">'.$lang['srv_show_pages'].'</label>';
+ echo '</div>';
if ($rezanje_preskocene == 1) {
- echo '<p>';
- echo ' <input type="checkbox" name="prikazi01" id="prikazi01" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.$_GET['predvideni'].'&pages='.$_GET['pages'].'&prikazi01='.($_GET['prikazi01']==1?'0':'1').'\');" '.($_GET['prikazi01']==1?'checked':'').' /><label for="prikazi01">'.$lang['srv_prikazi01'].'</label>';
- echo '</p>';
+ echo '<div class="setting_item">';
+ echo ' <input type="checkbox" name="prikazi01" id="prikazi01" value="1" onclick="vnos_redirect(\'index.php?anketa='.$this->anketa.'&a=testiranje&m=cas&predvideni='.$get_predvideni.'&pages='.$get_pages.'&prikazi01='.($get_prikazi01 == 1 ? '0' : '1').'\');" '.($get_prikazi01 == 1 ? 'checked' : '').' /><label for="prikazi01">'.$lang['srv_prikazi01'].'</label>';
+ echo '</div>';
}
+
+ echo '</div>';
- // zdruzimo vse case po straneh na en graf
- if ($_GET['pages'] != '1') {
- $casi2 = array();
- $casi2[0] = array();
- foreach ($casi AS $key => $val) {
- foreach ($val AS $k => $v) {
- if (isset($casi2[0][$k]))
- $casi2[0][$k] += $v;
+
+ // Zdruzimo vse case po straneh na en histogram
+ if ($get_pages != '1') {
+
+ // Dobimo case resevanja celotne ankete - po respondentih
+ $skupni_casi = array();
+
+ // Loop po posameznih straneh - sestejemo case po straneh na skupni cas na anketi
+ foreach ($casi AS $stran => $casi_na_strani) {
+
+ // Loop po vseh casih na strani
+ foreach ($casi_na_strani AS $usr_id => $cas_na_strani) {
+
+ if (isset($skupni_casi[$usr_id]))
+ $skupni_casi[$usr_id] += $cas_na_strani;
else
- $casi2[0][$k] = $v;
- //array_push($casi2[0], $v);
+ $skupni_casi[$usr_id] = $cas_na_strani;
}
}
- $casi = $casi2;
- $max_time = 0;
- foreach ($casi[0] AS $k => $v)
- if ($v > $max_time) $max_time = $v;
- }
-
- $minute = true;
- if ($minute) { // minute
- foreach ($casi AS $k => $page) {
- foreach ($page AS $key => $val) {
- $casi[$k][$key] = (int) round($val / 60, 0);
- }
+
+ // Nastavimo se min cas in max cas na anketi
+ $max_cas_na_anketi = 0;
+ $min_cas_na_anketi = 0;
+ foreach ($skupni_casi AS $usr_id => $cas_na_anketi){
+
+ if ($cas_na_anketi > $max_cas_na_anketi)
+ $max_cas_na_anketi = $cas_na_anketi;
+
+ if ($cas_na_anketi < $min_cas_na_anketi || $min_cas_na_anketi == 0)
+ $min_cas_na_anketi = $cas_na_anketi;
}
- $max_time = (int) round($max_time / 60, 0);
- }
-
- foreach ($casi AS $key => $val) {
-
- if ($_GET['pages'] == '1') {
- $sql = sisplet_query("SELECT naslov FROM srv_grupa WHERE vrstni_red='$key' AND ank_id='$this->anketa'");
- $row = mysqli_fetch_array($sql);
- echo '<h2>'.($row['naslov']!=''?$row['naslov']:$lang['srv_intro_label']).'</h2>';
+
+ // Pretvorimo v minute
+ foreach ($skupni_casi AS $usr_id => $cas_na_anketi) {
+ $skupni_casi[$usr_id] = (int) round($cas_na_anketi / 60, 0);
}
+ $max_cas_na_anketi = (int) round($max_cas_na_anketi / 60, 0);
+ $min_cas_na_anketi = (int) round($min_cas_na_anketi / 60, 0);
+
+ if($get_prikazi01 == 1)
+ $min_cas_na_anketi = 0;
+ else
+ $min_cas_na_anketi = 2;
+
+ // Pripravimo podatke za histogram
+ $histogram_data = array();
- echo '<table style="width:100%; padding:0; margin: 0"><tr>';
-
- $histogram = array();
- for ($t=0; $t<=$max_time; $t++) $histogram[$t] = 0;
- foreach ($val AS $k => $v) {
- if ($v >= $t_min) $histogram[$v]++;
- }
- $max_stran = 0;
- $max_stran_time = 0;
- foreach ($histogram AS $k => $v) {
- if ($v > $max_stran) $max_stran = $v;
- if ($v > 0) $max_stran_time = $k;
+ // Napolnimo vrednosti 0 na vsakem koraku (minuti)
+ for ($t=0; $t<=$max_cas_na_anketi; $t++)
+ $histogram_data[$t] = 0;
+
+ // Napolnimo vrednosti v histogram in dobimo najvecjo vrednost
+ $histogram_max_data = 0;
+ foreach ($skupni_casi AS $usr_id => $cas_na_anketi) {
+ $histogram_data[$cas_na_anketi]++;
+
+ if($histogram_data[$cas_na_anketi] > $histogram_max_data)
+ $histogram_max_data = $histogram_data[$cas_na_anketi];
}
-
-
- if ($max_stran != 0) {
-
- for ($t=$t_min; $t<=$max_time; $t++) {
-
- echo '<td style="vertical-align:bottom; margin:0; padding:0; border:0">';
-
- echo ' <div style="background-color:#D8DFEA; border:1px solid transparent; text-align: right; height: '.($histogram[$t]/$max_stran*150).'px; width: 100%; margin:0; padding:0; min-height:1px" title="'.$t.($minute?'min':'s').': '.$histogram[$t].'"></div>';
- //echo '<span style="display:block; width: 100%; text-align:center">'.$t.'</span>';
- echo '</td>';
+
+
+ // Izrisemo histogram - ce imamo kaksno vrednost nad 0
+ if ($histogram_max_data != 0) {
+
+ echo '<table class="casi_histogram">';
+
+ // Sivi stolpci
+ echo '<tr>';
+
+ for ($t=$min_cas_na_anketi; $t<=$max_cas_na_anketi; $t++) {
+
+ if(isset($histogram_data[$t])){
+ echo '<td class="histogram">';
+ echo ' <div class="histogram" style="height: '.($histogram_data[$t]/$histogram_max_data*150).'px;" title="'.$histogram_data[$t].' ('.$t.'min)"></div>';
+ echo '</td>';
+ }
}
+
+ echo '</tr>';
+
+
+ // Spodnja os
+ echo '<tr>';
+
+ // Korak 1 min
+ if ($max_cas_na_anketi <= 20) {
+ for ($t=$min_cas_na_anketi; $t<=$max_cas_na_anketi; $t++) {
+ echo '<td class="histogram_time">'.$t.'min'.'</td>';
+ }
+ }
+ // Korak 10 min
+ else {
+ $colspan = 10 - $min_cas_na_anketi;
+ echo '<td class="histogram_time" colspan="'.$colspan.'">'.$min_cas_na_anketi.'min</td>';
+
+ for ($t=10; $t<=$max_cas_na_anketi; $t+=10) {
+
+ // Pri zadnji labeli odstejemo span
+ if(($t + 10) > count($histogram_data))
+ $colspan = count($histogram_data) - $t;
+ else
+ $colspan = 10;
+
+ echo '<td class="histogram_time" colspan="'.$colspan.'">'.$t.'</td>';
+ }
+ }
+
+ echo '</tr>';
+
+ echo '</table>';
}
+ }
+ // Casi po straneh - 1 histogram na stran
+ else{
+
+ foreach ($casi AS $stran => $casi_na_strani) {
+
+ // Izpisemo naslov posamezne strani
+ $naslov = $lang['srv_intro_label'];
+
+ $sql = sisplet_query("SELECT naslov FROM srv_grupa WHERE vrstni_red='$stran' AND ank_id='$this->anketa'");
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+
+ if($row['naslov'] != '')
+ $naslov = $row['naslov'];
+ }
+
+ echo '<p class="bold blue bottom16">'.$naslov.'</p>';
+
+
+ // Dobimo podatke za histogram
+ // Nastavimo min cas in max cas na anketi
+ $max_cas_na_strani = 0;
+ $min_cas_na_strani = 0;
+ foreach ($casi_na_strani AS $usr_id => $cas_na_strani) {
- echo '</tr><tr>';
-
-
- if ($max_time <= 20) {
- for ($t=$t_min; $t<=$max_time; $t++) {
- echo '<td>'.$t.($minute?'min':'s').'</td>';
+ if ($cas_na_strani > $max_cas_na_strani)
+ $max_cas_na_strani = $cas_na_strani;
+
+ if ($cas_na_strani < $min_cas_na_strani || $min_cas_na_strani == 0)
+ $min_cas_na_strani = $cas_na_strani;
}
- } else {
- if ($t_min == 0)
- echo '<td colspan="10">0'.($minute?'min':'s').'</td>';
- else
- echo '<td colspan="8">2'.($minute?'min':'s').'</td>';
+
+ // Pretvorimo v minute
+ $max_cas_na_strani = (int) round($max_cas_na_strani / 60, 0);
+ $min_cas_na_strani = (int) round($min_cas_na_strani / 60, 0);
+
+ if($get_prikazi01 == 1)
+ $min_cas_na_strani = 0;
+
+ // Pripravimo podatke za histogram
+ $histogram_data = array();
- for ($t=10; $t<=$max_time; $t+=10) {
- echo '<td colspan="10">'.$t.'</td>';
+ // Napolnimo vrednosti 0 na vsakem koraku (minuti)
+ for ($t=0; $t<=$max_cas_na_strani; $t++)
+ $histogram_data[$t] = 0;
+
+ // Napolnimo vrednosti v histogram in dobimo najvecjo vrednost
+ $histogram_max_data = 0;
+ foreach ($casi_na_strani AS $usr_id => $cas_na_strani) {
+
+ // Pretvorimo v minute
+ $cas_na_strani = (int) round($cas_na_strani / 60, 0);
+
+ $histogram_data[$cas_na_strani]++;
+
+ if($histogram_data[$cas_na_strani] > $histogram_max_data)
+ $histogram_max_data = $histogram_data[$cas_na_strani];
+ }
+
+
+ // Izrisemo histogram za stran - ce imamo kaksno vrednost nad 0
+ if ($histogram_max_data != 0) {
+
+ echo '<table class="casi_histogram">';
+
+ // Sivi stolpci
+ echo '<tr>';
+
+ for ($t=$min_cas_na_strani; $t<=$max_cas_na_strani; $t++) {
+
+ if(isset($histogram_data[$t])){
+ echo '<td class="histogram">';
+ echo ' <div class="histogram" style="height: '.($histogram_data[$t]/$histogram_max_data*150).'px;" title="'.$histogram_data[$t].' ('.$t.'min)"></div>';
+ echo '</td>';
+ }
+ }
+
+ echo '</tr>';
+
+
+ // Spodnja os
+ echo '<tr>';
+
+ // Korak 1 min
+ if ($max_cas_na_strani <= 20) {
+ for ($t=$min_cas_na_strani; $t<=$max_cas_na_strani; $t++) {
+ echo '<td class="histogram_time">'.$t.'min'.'</td>';
+ }
+ }
+ // Korak 10 min
+ else {
+ if ($min_cas_na_strani == 0)
+ echo '<td class="histogram_time" colspan="10">0'.'min'.'</td>';
+ else
+ echo '<td class="histogram_time" colspan="8">2'.'min'.'</td>';
+
+ for ($t=10; $t<=$max_cas_na_strani; $t+=10) {
+
+ $colspan = 10;
+ if(($t + 10) > count($histogram_data))
+ $colspan = $t + 10 - count($histogram_data);
+ if($min_cas_na_strani != 0)
+ $colspan -= 2;
+
+ echo '<td class="histogram_time" colspan="'.$colspan.'">'.$t.'</td>';
+ }
+ }
+
+ echo '</tr>';
+
+ echo '</table>';
}
}
-
- echo '</tr></table>';
-
+
}
- echo '</fieldset>';
+ echo '</fieldset>';
}
/**
@@ -5962,51 +7159,86 @@ class SurveyAdminSettings {
$rezanje_preskocene = SurveyUserSetting::getInstance()->getSettings('rezanje_preskocene'); if ($rezanje_preskocene == '') $rezanje_preskocene = 1;
- echo '<p><input type="radio" name="rezanje" value="0"'.($rezanje==0?' checked':'').'> '.$lang['srv_rezanje_0'].'</p>';
- echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$lang['srv_rezanje_meja_sp'].': <select name="rezanje_meja_sp">';
- echo '<option value="0"'.($rezanje_meja_sp==0?' selected':'').'>0%</option>';
- echo '<option value="1"'.($rezanje_meja_sp==1?' selected':'').'>1%</option>';
- echo '<option value="3"'.($rezanje_meja_sp==3?' selected':'').'>3%</option>';
- echo '<option value="5"'.($rezanje_meja_sp==5?' selected':'').'>5%</option>';
- echo '<option value="10"'.($rezanje_meja_sp==10?' selected':'').'>10%</option>';
- echo '<option value="20"'.($rezanje_meja_sp==20?' selected':'').'>20%</option>';
- echo '</select></p>';
-
- echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$lang['srv_rezanje_meja_zg'].': <select name="rezanje_meja_zg">';
- echo '<option value="0"'.($rezanje_meja_zg==0?' selected':'').'>0%</option>';
- echo '<option value="1"'.($rezanje_meja_zg==1?' selected':'').'>1%</option>';
- echo '<option value="3"'.($rezanje_meja_zg==3?' selected':'').'>3%</option>';
- echo '<option value="5"'.($rezanje_meja_zg==5?' selected':'').'>5%</option>';
- echo '<option value="10"'.($rezanje_meja_zg==10?' selected':'').'>10%</option>';
- echo '<option value="20"'.($rezanje_meja_zg==20?' selected':'').'>20%</option>';
- echo '</select></p>';
-
- echo '<p><input type="radio" name="rezanje" value="1"'.($rezanje==1?' checked':'').'> '.$lang['srv_rezanje_1'].'</p>';
- echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$lang['srv_rezanje_meja_sp'].': <select name="rezanje_predvidena_sp">';
- echo '<option value="0"'.($rezanje_predvidena_sp==0?' selected':'').'>0%</option>';
- echo '<option value="1"'.($rezanje_predvidena_sp==1?' selected':'').'>1%</option>';
- echo '<option value="3"'.($rezanje_predvidena_sp==3?' selected':'').'>3%</option>';
- echo '<option value="5"'.($rezanje_predvidena_sp==5?' selected':'').'>5%</option>';
- echo '<option value="10"'.($rezanje_predvidena_sp==10?' selected':'').'>10%</option>';
- echo '<option value="20"'.($rezanje_predvidena_sp==20?' selected':'').'>20%</option>';
- echo '</select> '.$lang['srv_rezanje_predvidenega'].'</p>';
-
- echo '<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$lang['srv_rezanje_meja_zg'].': <select name="rezanje_predvidena_zg">';
- echo '<option value="100"'.($rezanje_predvidena_zg==100?' selected':'').'>100%</option>';
- echo '<option value="150"'.($rezanje_predvidena_zg==150?' selected':'').'>150%</option>';
- echo '<option value="200"'.($rezanje_predvidena_zg==200?' selected':'').'>200%</option>';
- echo '<option value="300"'.($rezanje_predvidena_zg==300?' selected':'').'>300%</option>';
- echo '<option value="500"'.($rezanje_predvidena_zg==500?' selected':'').'>500%</option>';
- echo '<option value="1000"'.($rezanje_predvidena_zg==1000?' selected':'').'>1000%</option>';
- echo '</select> '.$lang['srv_rezanje_predvidenega'].'</p>';
-
- echo '<p>&nbsp;</p>';
- echo '<p><input type="checkbox" name="rezanje_preskocene" value="1"'.($rezanje_preskocene==1?' checked':'').' onchange="javascript: if (this.checked == 1) { $(\'#preskocene_txt\').hide(); } else { $(\'#preskocene_txt\').show(); }"> '.$lang['srv_rezanje_preskocene'].'</p>';
- echo '<p id="preskocene_txt" '.($rezanje_preskocene==1?'style="display:none"':'').'>'.$lang['srv_rezanje_preskocene_txt'].'</p>';
-
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="statusCasiAction(\'run_rezanje\'); return false;"><span>'.$lang['srv_save_run_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="statusCasiAction(\'cancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
-
+ echo '<h2>'.$lang['srv_rezanje'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+
+ echo '<div class="popup_main">';
+
+ echo ' <div class="setting_line">';
+ echo ' <input type="radio" name="rezanje" id="rezanje_0" value="0"'.($rezanje==0?' checked':'').'>';
+ echo ' <label for="rezanje_0">'.$lang['srv_rezanje_0'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <label for="rezanje_meja_sp">'.$lang['srv_rezanje_meja_sp'].':</label>';
+ echo ' <select name="rezanje_meja_sp" id="rezanje_meja_sp">';
+ echo ' <option value="0"'.($rezanje_meja_sp==0?' selected':'').'>0%</option>';
+ echo ' <option value="1"'.($rezanje_meja_sp==1?' selected':'').'>1%</option>';
+ echo ' <option value="3"'.($rezanje_meja_sp==3?' selected':'').'>3%</option>';
+ echo ' <option value="5"'.($rezanje_meja_sp==5?' selected':'').'>5%</option>';
+ echo ' <option value="10"'.($rezanje_meja_sp==10?' selected':'').'>10%</option>';
+ echo ' <option value="20"'.($rezanje_meja_sp==20?' selected':'').'>20%</option>';
+ echo ' </select>';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <label for="rezanje_meja_sp">'.$lang['srv_rezanje_meja_zg'].':</label>';
+ echo ' <select name="rezanje_meja_zg" id="rezanje_meja_zg">';
+ echo ' <option value="0"'.($rezanje_meja_zg==0?' selected':'').'>0%</option>';
+ echo ' <option value="1"'.($rezanje_meja_zg==1?' selected':'').'>1%</option>';
+ echo ' <option value="3"'.($rezanje_meja_zg==3?' selected':'').'>3%</option>';
+ echo ' <option value="5"'.($rezanje_meja_zg==5?' selected':'').'>5%</option>';
+ echo ' <option value="10"'.($rezanje_meja_zg==10?' selected':'').'>10%</option>';
+ echo ' <option value="20"'.($rezanje_meja_zg==20?' selected':'').'>20%</option>';
+ echo ' </select>';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <input type="radio" name="rezanje" id="rezanje_1" value="1"'.($rezanje==1?' checked':'').'>';
+ echo ' <label for="rezanje_1">'.$lang['srv_rezanje_1'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <label for="rezanje_predvidena_sp">'.$lang['srv_rezanje_meja_sp'].':</label>';
+ echo ' <select name="rezanje_predvidena_sp" id="rezanje_predvidena_sp">';
+ echo ' <option value="0"'.($rezanje_predvidena_sp==0?' selected':'').'>0%</option>';
+ echo ' <option value="1"'.($rezanje_predvidena_sp==1?' selected':'').'>1%</option>';
+ echo ' <option value="3"'.($rezanje_predvidena_sp==3?' selected':'').'>3%</option>';
+ echo ' <option value="5"'.($rezanje_predvidena_sp==5?' selected':'').'>5%</option>';
+ echo ' <option value="10"'.($rezanje_predvidena_sp==10?' selected':'').'>10%</option>';
+ echo ' <option value="20"'.($rezanje_predvidena_sp==20?' selected':'').'>20%</option>';
+ echo ' </select> '.$lang['srv_rezanje_predvidenega'];
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <label for="rezanje_meja_sp">'.$lang['srv_rezanje_meja_zg'].':</label>';
+ echo ' <select name="rezanje_predvidena_zg" id="rezanje_predvidena_zg">';
+ echo ' <option value="100"'.($rezanje_predvidena_zg==100?' selected':'').'>100%</option>';
+ echo ' <option value="150"'.($rezanje_predvidena_zg==150?' selected':'').'>150%</option>';
+ echo ' <option value="200"'.($rezanje_predvidena_zg==200?' selected':'').'>200%</option>';
+ echo ' <option value="300"'.($rezanje_predvidena_zg==300?' selected':'').'>300%</option>';
+ echo ' <option value="500"'.($rezanje_predvidena_zg==500?' selected':'').'>500%</option>';
+ echo ' <option value="1000"'.($rezanje_predvidena_zg==1000?' selected':'').'>1000%</option>';
+ echo ' </select> '.$lang['srv_rezanje_predvidenega'];
+ echo ' </div>';
+
+ echo ' <div class="setting_line top8">';
+ echo ' <input type="checkbox" name="rezanje_preskocene" id="rezanje_preskocene" value="1"'.($rezanje_preskocene==1?' checked':'').' onchange="javascript: if (this.checked == 1) { $(\'#preskocene_txt\').hide(); } else { $(\'#preskocene_txt\').show(); }">';
+ echo ' <label for="rezanje_preskocene">'.$lang['srv_rezanje_preskocene'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="bottom16">';
+ echo ' <span id="preskocene_txt" '.($rezanje_preskocene==1? 'style="display:none"' : '').'>'.$lang['srv_rezanje_preskocene_txt'].'</span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="statusCasiAction(\'cancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo ' <button class="medium blue" onclick="statusCasiAction(\'run_rezanje\'); return false;">'.$lang['srv_save_run_profile'].'</button>';
+ echo '</div>';
}
/**
@@ -6027,61 +7259,6 @@ class SurveyAdminSettings {
}
- function testiranje_komentarji_links($comment_count){
- global $lang;
- global $site_url;
- global $site_path;
- global $admin_type;
- global $global_user_id;
-
-
- if($_GET['a'] == 'komentarji_anketa'){
-
- // Gumb nazaj
- echo '<div class="switch_button '.($_GET['a'] == A_KOMENTARJI ? ' active' : '').'">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_KOMENTARJI.'" title="' . $lang['srv_testiranje_komentarji_title'] . '">' . $lang['srv_q_comments_back'] . '</a>';
- echo '</div>';
-
- echo '<span class="bold"> (';
- if($comment_count['question']['unresolved'] > 0)
- echo '<span class="orange">';
- echo $comment_count['question']['unresolved'];
- if($comment_count['question']['unresolved'] > 0)
- echo '</span>';
- echo '/'.$comment_count['question']['all'];
- echo ')</span>';
- }
- else{
-
- echo '<span id="comment_question_note">';
-
- echo $lang['srv_komentarji_imate'].' ';
- if($comment_count['question']['unresolved'] > 0) echo '<span class="red">';
- echo $this->string_format((int)$comment_count['question']['unresolved'], 'srv_cnt_komentarji');
- if($comment_count['question']['unresolved'] > 0) echo '</span>';
-
- echo ' '.$lang['srv_komentarji_odskupno'].' ';
- echo $this->string_format((int)$comment_count['question']['all'], 'srv_cnt_komentar_na_vprs');
-
- echo '</span>';
-
-
- // Gumb splosni komentarji
- echo '<div class="switch_button '.($_GET['a'] == A_KOMENTARJI_ANKETA ? ' active' : '').'">';
- echo '<a href="index.php?anketa=' . $this->anketa . '&amp;a='.A_KOMENTARJI_ANKETA.'" title="' . $lang['srv_testiranje_komentarji_anketa_title'] . '">' . $lang['srv_testiranje_komentarji_anketa_title'] . '</a>';
- echo '</div>';
-
- echo '<span class="bold"> (';
- if($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved'] > 0)
- echo '<span class="orange">';
- echo ($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved']);
- if($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved'] > 0)
- echo '</span>';
- echo '/'.($comment_count['survey_resp']['all']+$comment_count['survey_admin']['all']);
- echo ')</span>';
- }
- }
-
function string_format($cnt,$lang_root) {
global $lang;
@@ -6100,1023 +7277,6 @@ class SurveyAdminSettings {
}
/**
- * izpise komentarje na anketo - stara ki se ne uporablja
- *
- */
- function testiranje_komentarji_anketa_old () {
- global $lang;
- global $site_url;
- global $admin_type;
- global $global_user_id;
-
- $rowa = SurveyInfo::getInstance()->getSurveyRow();
-
- SurveySetting::getInstance()->Init($this->anketa);
- $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
-
- $f = new Forum;
-
- $sql = sisplet_query("SELECT * FROM post WHERE tid='$rowa[thread]'");
-
- echo '<div style="padding:0 20px">';
- echo '<p><b>'.$lang['srv_admin_s_comments'].'</b></p>';
-
- if (mysqli_num_rows($sql) > 0) {
- $rows = mysqli_num_rows($sql);
- if ($rows > 0) echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- }
-
- $i=0;
- while ($row = mysqli_fetch_array($sql)) {
-
- if (($i != 0 && $sortpostorder==0) || ($i < $rows-1 && $sortpostorder==1)) {
- if ($row['ocena'] == 0) echo '<span style="color:black">';
- elseif ($row['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['ocena'] == 2) echo '<span style="color:lightgray">';
- elseif ($row['ocena'] == 3) echo '<span style="color:lightgray">';
- else echo '<span>';
-
- echo '<b>'.$f->user($row['uid']).'</b> ('.$f->datetime1($row['time']).'):';
- echo '<br/>'.$row['vsebina'].'<hr>';
-
- echo '</span>';
- }
- $i++;
- }
-
- echo '</div>';
-
- }
-
- /**
- * izpise komentarje na anketo
- *
- */
- function testiranje_komentarji_anketa () {
- global $lang;
- global $site_url;
- global $admin_type;
- global $global_user_id;
-
- $b = new Branching($this->anketa);
- $f = new Forum;
- $d = new Dostop();
-
- SurveySetting::getInstance()->Init($this->anketa);
- $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
- $commentmarks = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks');
- $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment');
- $survey_comment_resp = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_resp');
- $comment_count = $this->testiranje_komentarji_count();
-
- $rowa = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<div id="placeholder" class="komentarji">';
-
-
- echo '<div id="branching" class="branching_new expanded komentarji">';
-
-
- echo '<span id="comment_question_note">';
-
- echo $lang['srv_komentarji_imate'].' ';
- if(($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved']) > 0) echo '<span class="red">';
- echo $this->string_format((int)($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved']), 'srv_cnt_komentarji');
- if(($comment_count['survey_resp']['unresolved']+$comment_count['survey_admin']['unresolved']) > 0) echo '</span>';
-
- echo ' '.$lang['srv_komentarji_odskupno'].' ';
- echo $this->string_format((int)($comment_count['survey_resp']['all']+$comment_count['survey_admin']['all']), 'srv_cnt_komentarji_survey');
-
- echo '</span>';
-
-
- echo '&nbsp;<span class="tooltip clr spaceLeft">';
- echo '<a href="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" target="_blank" style="font-size:15px"><span class="faicon edit_square"></span> '.$lang['srv_survey_testdata'].'</a>';
- echo ' ('.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.') ';
- echo '<span class="expanded-tooltip bottom light" style="left: -20px;">';
- echo '<b>' . $lang['srv_survey_testdata2'] . ':</b> '.$lang['srv_testdata_text'].'';
- echo '<p>'.$lang['srv_preview_testdata_longtext'].'</p>';
- echo '<span class="arrow"></span>';
- echo '</span>'; // expanded-tooltip bottom
- echo '</span>'; // tooltip
-
-
- # VV: privzeto naj bodo samo nerešeni komentarji
- if (!isset($_GET['only_unresolved'])) {
- $_GET['only_unresolved'] = 1;
- }
-
-
- echo '<span style="float:left; width:auto; margin-top:20px; display:inline-block;">';
-
- # samo nerešeni komentarji
- if ($commentmarks == 0) {
- echo '<label for="only_unresolved"><input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji_anketa&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" '.($_GET['only_unresolved']==1?'checked':'').' />';
- echo $lang['srv_comments_unresolved'];
- echo '</label>';
- } else {
- echo $lang['move_show'].': <select id="only_unresolved" name="" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji_anketa&only_unresolved=\'+$(\'#only_unresolved\').val(); " >
- <option value="0"'.($_GET['only_unresolved']==0?' selected="selected"':'').'>'.$lang['all2'].'</option>
- <option value="1"'.($_GET['only_unresolved']==1?' selected="selected"':'').'>'.$lang['srv_comments_unresolved'].'</option>
- <option value="2"'.($_GET['only_unresolved']==2?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="3"'.($_GET['only_unresolved']==3?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="4"'.($_GET['only_unresolved']==4?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="5"'.($_GET['only_unresolved']==5?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- }
- echo ' '.Help::display('srv_comments_only_unresolved').'</span>';
-
- $only_unresolved = " ";
- switch($_GET['only_unresolved']){
- case 1:
- $only_unresolved = " AND ocena <= '1' ";
- break;
- case 2:
- $only_unresolved = " AND ocena = '0' ";
- break;
- case 3:
- $only_unresolved = " AND ocena = '1' ";
- break;
- case 4:
- $only_unresolved = " AND ocena = '2' ";
- break;
- case 5:
- $only_unresolved = " AND ocena = '3' ";
- break;
- default:
- break;
- }
-
-
- echo '<span class="clr"></span>';
-
- // Splosni komentarji urednikov - levo
- echo '<div class="komentarji_anketa komentarji_ured">';
- echo '<span class="komentarji_title">'.$lang['srv_comments_anketa_ured'].' ('.$comment_count['survey_admin']['unresolved'].'/'.$comment_count['survey_admin']['all'].')</span>';
-
- echo '<div style="padding: 20px 20px">';
-
- $sql = sisplet_query("SELECT * FROM post WHERE tid='$rowa[thread]' ".$only_unresolved." ");
- $rows = (mysqli_num_rows($sql) == 0) ? 0 : mysqli_num_rows($sql) - 1;
- if ($rows > 0){
- echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '<br />';
-
- $i=0;
- while ($row = mysqli_fetch_array($sql)) {
-
- if (($i != 0 && $sortpostorder==0) || ($i < $rows && $sortpostorder==1)) {
- if ($row['ocena'] == 0) echo '<span style="color:black">';
- elseif ($row['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['ocena'] == 2) echo '<span style="color:#999999">';
- elseif ($row['ocena'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
-
- echo '<b>'.$f->user($row['uid']).'</b> ('.$f->datetime1($row['time']).'):';
-
- echo '<div style="float:right">';
- if ($commentmarks == 1) {
- echo ' <select name="ocena'.$row['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});">
- <option value="0"'.($row['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($row['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($row['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($row['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- // Checkbox za "Koncano"
- echo '<input type="checkbox" name="ocena_'.$row['id'].'" id="ocena_'.$row['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});" value="2" '.($row['ocena'] >= 2?' checked':'').' />';
- echo '<label for="ocena_'.$row['id'].'">'.$lang['srv_done'].'</label>';
- }
- echo '</div>';
-
- echo '<br/>'.$row['vsebina'].'<hr>';
-
- echo '</span>';
- }
- $i++;
- }
- }
- // Nimamo komentarja
- else{
- // Ce so komentarji aktivirani
- if($survey_comment != ''){
- echo $lang['srv_no_comments_solved'];
- }
- else{
- echo $lang['srv_no_comments'];
- }
- }
-
- echo '</div>';
-
- // Dodajanje novega komentarja
- echo '<div id="survey_comment_0_4" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_admin\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_admin" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field(0, '1', '4', false);
- echo '</p>';
-
- echo '</div>';
-
-
- // Splosni komentarji respondentov - desno
- echo '<div class="komentarji_anketa komentarji_resp">';
- echo '<span class="komentarji_title">'.$lang['srv_comments_anketa_resp'].' ('.$comment_count['survey_resp']['unresolved'].'/'.$comment_count['survey_resp']['all'].')</span>';
-
- echo '<div style="padding: 20px 20px">';
-
- $sql = sisplet_query("SELECT * FROM srv_comment_resp WHERE ank_id='$this->anketa' ".$only_unresolved." ORDER BY comment_time $orderby, id $orderby");
- if (mysqli_num_rows($sql) > 0) {
-
- echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '<br />';
-
- while ($row = mysqli_fetch_array($sql)) {
-
- if ($row['ocena'] == 0) echo '<span style="color:black">';
- elseif ($row['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['ocena'] == 2) echo '<span style="color:#999999">';
- elseif ($row['ocena'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
-
- $datetime = strtotime($row['comment_time']);
- $datetime = date("d.m G:i", $datetime);
-
- if($row['usr_id'] == 0){
- $user = $lang['guest'];
- }
- else{
- $sqlU = sisplet_query("SELECT name FROM users WHERE id='$row[usr_id]'");
- $rowU = mysqli_fetch_array($sqlU);
-
- $user = $rowU['name'];
- }
-
- echo '<b>'.$user.'</b> ('.$datetime.'):';
-
- echo '<div style="float:right">';
- if ($commentmarks == 1) {
- echo ' <select name="ocena'.$row['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: this.value, id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});">
- <option value="0"'.($row['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($row['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($row['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($row['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- // Checkbox za "Koncano"
- echo '<input type="checkbox" name="ocena_'.$row['id'].'" id="ocena_'.$row['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (this.checked?\'2\':\'0\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});" value="2" '.($row['ocena'] >= 2?' checked':'').' />';
- echo '<label for="ocena_'.$row['id'].'">'.$lang['srv_done'].'</label>';
- }
- echo '</div>';
-
- echo '<br/>'.$row['comment'].'<hr>';
-
- echo '</span>';
- }
- }
- // Nimamo komentarja
- else{
- // Ce so komentarji aktivirani
- if($survey_comment_resp != ''){
- echo $lang['srv_no_comments_solved'];
- }
- else{
- echo $lang['srv_no_comments'];
- }
- }
-
- echo '</div>';
-
- // Dodajanje novega komentarja
- echo '<div id="survey_comment_0_5" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_resp\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_resp" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field(0, '4', '5', false);
- echo '</p>';
-
- echo '</div>';
-
-
- echo '</div>';
- echo '</div>';
- }
-
- function testiranje_komentarji_komentarji_na_anketo ($return = true) {
-
- $rowi = SurveyInfo::getInstance()->getSurveyRow();
-
- #komentarji na anketo
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0";
- $sqlta = sisplet_query($strta);
- list($rowta) = mysqli_fetch_row($sqlta);
-
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0 AND ocena <= 1 ";
- $sqltu = sisplet_query($strtu);
- list($rowtu) = mysqli_fetch_row($sqltu);
-
- if ($return)
- return '(<span class="lightRed">'.(int)$rowtu.'</span>/'.(int)$rowta.')';
- else
- return (int)$rowtu;
- }
-
- public function testiranje_komentarji_count () {
-
- $comment_count = array();
-
- $rowi = SurveyInfo::getInstance()->getSurveyRow();
-
-
- // KOMENTARJI NA ANKETO - UREDNIK
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0";
- $sqlta = sisplet_query($strta);
- list($rowta) = mysqli_fetch_row($sqlta);
-
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0 AND ocena <= 1 ";
- $sqltu = sisplet_query($strtu);
- list($rowtu) = mysqli_fetch_row($sqltu);
- //(int)$rowtu.'/'.(int)$rowta;
- $comment_count['survey_admin']['all'] = (int)$rowta;
- $comment_count['survey_admin']['unresolved'] = (int)$rowtu;
-
-
- // KOMENTARJI NA ANKETO - RESPONDENT
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->anketa."'";
- $sqlta = sisplet_query($strta);
- list($rowta) = mysqli_fetch_row($sqlta);
-
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->anketa."' AND ocena <= 1 ";
- $sqltu = sisplet_query($strtu);
- list($rowtu) = mysqli_fetch_row($sqltu);
- //(int)$rowtu.'/'.(int)$rowta;
- $comment_count['survey_resp']['all'] = (int)$rowta;
- $comment_count['survey_resp']['unresolved'] = (int)$rowtu;
-
-
- // KOMENTARJI NA VPRASANJE
- # naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
- $spremenljivke = Cache::cache_all_srv_spremenljivka($this->anketa, true);
- $spr_id=array();
- $threads=array();
- if ( is_array($spremenljivke) && count($spremenljivke) > 0 ) {
-
- foreach ($spremenljivke as $id=>$value) {
- $spr_id[] = $id;
-
- if ((int)$value['thread'] > 0) {
- $threads[] = $value['thread'];
- }
- }
- }
- if (count($spr_id) > 0) {
- #preštejemo komentarje uporabnikov na vprašanja
- # srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
- $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).")";
- $sqlqr = sisplet_query($strqr);
- list($rowqr) = mysqli_fetch_row($sqlqr);
-
- #končani komentarji respondentov
- #text2 = 2 => končan
- #text2 = 3 => nerelevantno
- $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
- $sqlqrf = sisplet_query($strqrf);
- list($rowqrf) = mysqli_fetch_row($sqlqrf);
-
- # preštejemo
- if (count($threads) > 0) {
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0";
- $sqlta = sisplet_query($strta);
- list($rowtqa) = mysqli_fetch_row($sqlta);
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena IN (2,3) ";
- $sqltu = sisplet_query($strtu);
- list($rowtqu) = mysqli_fetch_row($sqltu);
- }
- }
-
- #vsi
- //$all = (int)((int)$rowqr + (int)$rowtqa);
- #nerešeni
- //$unresolved = $all - (int)((int)$rowqrf + (int)$rowtqu);
- $comment_count['question']['all'] = (int)((int)$rowqr + (int)$rowtqa);
- $comment_count['question']['unresolved'] = $comment_count['question']['all'] - (int)((int)$rowqrf + (int)$rowtqu);
-
- // KOMENTARJI NA IF ALI BLOK
- # naenkrat preberemo vse ife in bloke, da ne delamo queryja vsakic posebej
- $ifi = Cache::cache_all_srv_if($this->anketa, true);
- $if_id = array();
- $threads_if = array();
- if ( is_array($ifi) && count($ifi) > 0 ) {
-
- foreach ($ifi as $id=>$value) {
- $if_id[] = $id;
-
- if ((int)$value['thread'] > 0) {
- $threads_if[] = $value['thread'];
- }
- }
- }
- if (count($if_id) > 0) {
-
- #preštejemo komentarje uporabnikov na vprašanja
- # srv_data_text where if_id = 0 AND vre_id IN (id-ji spremenljivk)
- $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$if_id).")";
- $sqlqr = sisplet_query($strqr);
- list($rowqr_if) = mysqli_fetch_row($sqlqr);
-
- #končani komentarji respondentov
- #text2 = 2 => končan
- #text2 = 3 => nerelevantno
- $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$if_id).") AND text2 IN (2,3)";
- $sqlqrf = sisplet_query($strqrf);
- list($rowqrf_if) = mysqli_fetch_row($sqlqrf);
-
- # preštejemo
- if (count($threads_if) > 0) {
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads_if).") AND parent > 0";
- $sqlta = sisplet_query($strta);
- list($rowtqa_if) = mysqli_fetch_row($sqlta);
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads_if).") AND parent > 0 AND ocena IN (2,3) ";
- $sqltu = sisplet_query($strtu);
- list($rowtqu_if) = mysqli_fetch_row($sqltu);
- }
- }
-
- $comment_count['question']['all'] += (int)((int)$rowqr_if + (int)$rowtqa_if);
- $comment_count['question']['unresolved'] += ((int)((int)$rowqr_if + (int)$rowtqa_if)) - ((int)((int)$rowqrf_if + (int)$rowtqu_if));
-
-
- return $comment_count;
- }
-
- /**
- * $return pove a vrne text (true) ali samo številko (false)
- */
- function testiranje_komentarji_komentarji_na_vprasanje ($return = true) {
-
- # naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
- $spremenljivke = Cache::cache_all_srv_spremenljivka($this->anketa, true);
-
- $spr_id=array();
- $threads=array();
- if ( is_array($spremenljivke) && count($spremenljivke) > 0 ) {
- foreach ($spremenljivke as $id=>$value) {
- $spr_id[] = $id;
- if ((int)$value['thread'] > 0) {
- $threads[] = $value['thread'];
- }
- }
- }
- if (count($spr_id) > 0) {
- #preštejemo komentarje uporabnikov na vprašanja
- # srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
- $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).")";
- $sqlqr = sisplet_query($strqr);
- list($rowqr) = mysqli_fetch_row($sqlqr);
-
- #končani komentarji respondentov
- #text2 = 2 => končan
- #text2 = 3 => nerelevantno
- $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
- $sqlqrf = sisplet_query($strqrf);
- list($rowqrf) = mysqli_fetch_row($sqlqrf);
-
- # preštejemo
- if (count($threads) > 0) {
- # vsi komentarji na anketo
- $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0";
- $sqlta = sisplet_query($strta);
- list($rowtqa) = mysqli_fetch_row($sqlta);
- # nerešeni komentarji: only_unresolved => ocena <= 1
- $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena IN (2,3) ";
- $sqltu = sisplet_query($strtu);
- list($rowtqu) = mysqli_fetch_row($sqltu);
- }
- }
-
- #vsi
- $all = (int)((int)$rowqr + (int)$rowtqa);
- # nerešeni
- $unresolved = $all - (int)((int)$rowqrf + (int)$rowtqu);
-
- if ($return)
- // '(<span class="lightRed">'.$unresolved.'</span>/'.$all.')';
- return $unresolved;
- else
- return $unresolved;
-
- }
-
- /**
- * izpise vprasanja, ki imajo komentarje in poleg tudi razprte komentarje
- *
- */
- function testiranje_komentarji () {
- global $lang;
- global $site_url;
- global $admin_type;
- global $global_user_id;
-
- $lang_admin = $lang;
-
- //$sa = new SurveyAdmin(1, $this->anketa);
- include_once('../../main/survey/app/global_function.php');
- new \App\Controllers\SurveyController(true);
- save('forceShowSpremenljivka', true);
-
- $f = new Forum;
- $c = 0;
-
- $lang = $lang_admin;
-
- $b = new Branching($this->anketa);
-
- $d = new Dostop();
-
- $rowi = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<div id="placeholder" class="komentarji">';
-
-
- echo '<div id="branching" class="branching_new expanded komentarji">';
-
- SurveySetting::getInstance()->Init($this->anketa);
- $question_resp_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment_viewadminonly');
- $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
- $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
- $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
- $question_note_view = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_view');
- $addfieldposition = SurveySetting::getInstance()->getSurveyMiscSetting('addfieldposition');
- $commentmarks = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks');
- $commentmarks_who = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks_who');
-
- $question_comment_viewadminonly = ($question_comment_viewadminonly == '') ? 4 : $question_comment_viewadminonly;
- $question_resp_comment_viewadminonly = ($question_resp_comment_viewadminonly == '') ? 4 : $question_resp_comment_viewadminonly;;
-
- $comment_count = $this->testiranje_komentarji_count();
-
-
- echo '<span id="comment_question_note">';
-
- echo $lang['srv_komentarji_imate'].' ';
- if($comment_count['question']['unresolved'] > 0) echo '<span class="red">';
- echo $this->string_format((int)$comment_count['question']['unresolved'], 'srv_cnt_komentarji');
- if($comment_count['question']['unresolved'] > 0) echo '</span>';
-
- echo ' '.$lang['srv_komentarji_odskupno'].' ';
- echo $this->string_format((int)$comment_count['question']['all'], 'srv_cnt_komentar_na_vprs');
-
- echo '</span>';
-
-
- echo '&nbsp;<span class="tooltip clr spaceLeft">';
- echo '<a href="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" target="_blank" style="font-size:15px"><span class="faicon edit_square"></span> '.$lang['srv_survey_testdata'].'</a>';
- echo ' ('.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.') ';
- echo '<span class="expanded-tooltip bottom light" style="left: -20px;">';
- echo '<b>' . $lang['srv_survey_testdata2'] . ':</b> '.$lang['srv_testdata_text'].'';
- echo '<p>'.$lang['srv_preview_testdata_longtext'].'</p>';
- echo '<span class="arrow"></span>';
- echo '</span>'; // expanded-tooltip bottom
- echo '</span>'; // tooltip
-
-
- # VV: privzeto naj bodo samo nerešeni komentarji
- if (!isset($_GET['only_unresolved'])) {
- $_GET['only_unresolved'] = 1;
- }
-
-
- $sqlf1 = sisplet_query("SELECT p.id FROM post p WHERE p.tid='$rowi[thread]' AND p.ocena='5'");
- while ($rowf1 = mysqli_fetch_array($sqlf1)) {
- $s = sisplet_query("SELECT * FROM views WHERE pid='$rowf1[id]' AND uid='$global_user_id'");
- if (mysqli_num_rows($s) == 0)
- $show_survey_comment = 1;
- }
-
- echo '<span style="float:left; width:auto; margin-top:20px; display:inline-block;">';
-
- // vsa vprasanja
- echo '<label for="all_questions" style="margin-right:40px"><input type="checkbox" id="all_questions" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji'.(isset($_GET['only_unresolved'])?'&only_unresolved='.$_GET['only_unresolved']:'').'&all_questions=\'+$(\'#all_questions:checked\').val()" value="1" '.($_GET['all_questions']==1?'checked':'').' />';
- echo $lang['srv_all_questions'];
- echo '</label>';
-
- # samo nerešeni komentarji
- if ($commentmarks == 0) {
- echo '<label for="only_unresolved"><input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji'.(isset($_GET['all_questions'])?'&all_questions='.$_GET['all_questions']:'').'&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" '.($_GET['only_unresolved']==1?'checked':'').' />';
- //echo $lang['srv_comments_unresolved'].' '.$this->testiranje_komentarji_komentarji_na_vprasanje();
- echo $lang['srv_comments_unresolved'];
- echo '</label>';
- } else {
- echo $lang['move_show'].': <select id="only_unresolved" name="" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji&only_unresolved=\'+$(\'#only_unresolved\').val(); " >
- <option value="0"'.($_GET['only_unresolved']==0?' selected="selected"':'').'>'.$lang['all2'].'</option>
- <option value="1"'.($_GET['only_unresolved']==1?' selected="selected"':'').'>'.$lang['srv_comments_unresolved'].'</option>
- <option value="2"'.($_GET['only_unresolved']==2?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="3"'.($_GET['only_unresolved']==3?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="4"'.($_GET['only_unresolved']==4?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="5"'.($_GET['only_unresolved']==5?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- }
- echo ' '.Help::display('srv_comments_only_unresolved').'</span>';
-
-
-
-
-
- // Nov nacin kjer se sprehodimo cez branching, ker imamo lahko tudi komentarje na ife in bloke
- Common::getInstance()->Init($this->anketa);
- $branching_array = Common::getBranchingOrder();
- if (count($branching_array) > 0) {
-
- $view = 1;
-
- echo '<span class="floatLeft" style="width:100% !important;">';
-
- $b = new Branching($this->anketa);
-
- foreach($branching_array AS $element){
-
- // Gre za if ali blok
- if($element['if_id'] > 0){
- $if_id = $element['if_id'];
-
- $sql1 = sisplet_query("SELECT * FROM srv_if WHERE id = '$if_id'");
- $row1 = mysqli_fetch_array($sql1);
-
- $orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
- $tid = $row1['thread'];
-
- $only_unresolved = " ";
- $only_unresolved2 = " ";
- if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND ocena <= 1 ";
- if ($_GET['only_unresolved'] == 1) $only_unresolved2 = " AND text2 <= 1 ";
-
- if ($_GET['only_unresolved'] == 2) $only_unresolved = " AND ocena = 0 ";
- if ($_GET['only_unresolved'] == 2) $only_unresolved2 = " AND text2 = 0 ";
-
- if ($_GET['only_unresolved'] == 3) $only_unresolved = " AND ocena = 1 ";
- if ($_GET['only_unresolved'] == 3) $only_unresolved2 = " AND text2 = 1 ";
-
- if ($_GET['only_unresolved'] == 4) $only_unresolved = " AND ocena = 2 ";
- if ($_GET['only_unresolved'] == 4) $only_unresolved2 = " AND text2 = 2 ";
-
- if ($_GET['only_unresolved'] == 5) $only_unresolved = " AND ocena = 3 ";
- if ($_GET['only_unresolved'] == 5) $only_unresolved2 = " AND text2 = 3 ";
-
-
- $tema_vsebuje = substr($lang['srv_forum_intro'],0,10); // da ne prikazujemo 1. default sporocila
-
- if ($admin_type <= $question_comment_viewadminonly) { // vidi vse komentarje
- $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved ORDER BY time $orderby, id $orderby");
- } elseif ($question_comment_viewauthor==1) { // vidi samo svoje komentarje
- $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved AND uid='$global_user_id' ORDER BY time $orderby, id $orderby");
- } else { // ne vidi nobenih komentarjev
- $sqlt = sisplet_query("SELECT * FROM post WHERE 1=0");
- }
-
- if (($_GET['all_questions']=='1') OR (mysqli_num_rows($sqlt) > 0)) {
- $c++;
-
- echo '<div style="margin: 20px 0">';
-
- echo '<li id="branching_'.$if_id.'" class="spr">';
- echo '<div class="spremenljivka_content">';
-
- // Blok
- if($row1['tip'] == 1){
- echo '<div class="spremenljivka_settings" style="font-size:14px; padding:0 0 0 10px;">';
- echo '<span class="conditions_display"><strong class="clr_bl">BLOCK</strong> <span class="colorblock">('.$row1['number'].')</span>';
- echo '</div>';
- }
- // If
- else{
- echo '<div class="spremenljivka_settings" style="font-size:14px; padding:4px 0 0 10px;">';
- $b->conditions_display($if_id);
- echo '</div>';
- }
-
- echo '</div>';
- echo '</li>';
-
- echo '<div style="width:40%; margin: 0 5% 2% 1%; float: left">';
-
- if ($addfieldposition == 1) {
- echo '<div id="survey_comment_'.$if_id.'_'.'4'.'" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_'.$if_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_'.$if_id.'" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field($if_id, '1', '4', false);
- echo '</p>';
- }
-
- // komentarji na vprasanje
- if ($row1['thread'] > 0) {
-
- if (mysqli_num_rows($sqlt) > 0) {
-
- echo '<p class="red"><b>'.$lang['srv_admin_comment'].'</b>';
- //$rowss = mysqli_num_rows($sql);
- //if ($rowss > 0)
- echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '</p>';
-
- $i = 0;
- while ($rowt = mysqli_fetch_array($sqlt)) {
- if ($_GET['only_unresolved'] == 1) {
- if ($rowt['ocena'] == 0) echo '<span style="color:black">';
- elseif ($rowt['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($rowt['ocena'] == 2) echo '<span style="color:#999999">';
- elseif ($rowt['ocena'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
- } else {
- if ($rowt['ocena'] == 0) echo '<span style="color:#990000">';
- elseif ($rowt['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($rowt['ocena'] == 2) echo '<span style="color:black">';
- elseif ($rowt['ocena'] == 3) echo '<span style="color:black">';
- else echo '<span>';
- }
-
- echo '<b>'.$f->user($rowt['uid']).'</b> ('.$f->datetime1($rowt['time']).'):';
-
- if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
-
- echo '<div style="float:right; text-align:right">';
-
- if ($commentmarks == 1) {
- echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
- <option value="0"'.($rowt['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($rowt['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($rowt['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($rowt['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- echo '<input type="checkbox" name="ocena_'.$rowt['id'].'" id="ocena_'.$rowt['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});" value="2" '.($rowt['ocena'] >= 2?' checked':'').' /><label for="ocena_'.$rowt['id'].'">'.$lang['srv_done'].'</label>';
- }
- echo ' <br /><a href="javascript:comment_on_comment(\''.$rowt['id'].'\');">'.$lang['srv_comment_comment'].'</a>';
- echo '</div>';
- }
-
- echo '<br/>'.$rowt['vsebina'].'<span id="comment_on_comment_'.$rowt['id'].'"></span><hr>';
- echo '</span>';
- }
- }
- }
-
- if ($addfieldposition == '' || $addfieldposition == 0) {
- echo '<div id="survey_comment_'.$spr_id.'_'.'4'.'" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_'.$spr_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_'.$spr_id.'" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field($spr_id, '1', '4', false);
- echo '</p>';
- }
-
- echo '</div>';
-
- echo '<div class="clr"></div>';
- echo '</div>';
- }
- }
- // Gre za navadno vprasanje
- else{
- $spr_id = $element['spr_id'];
-
- $sql1 = sisplet_query("SELECT thread, note FROM srv_spremenljivka WHERE id = '$spr_id'");
- $row1 = mysqli_fetch_array($sql1);
-
- $orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
- $tid = $row1['thread'];
-
- $only_unresolved = " ";
- $only_unresolved2 = " ";
- if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND ocena <= 1 ";
- if ($_GET['only_unresolved'] == 1) $only_unresolved2 = " AND text2 <= 1 ";
-
- if ($_GET['only_unresolved'] == 2) $only_unresolved = " AND ocena = 0 ";
- if ($_GET['only_unresolved'] == 2) $only_unresolved2 = " AND text2 = 0 ";
-
- if ($_GET['only_unresolved'] == 3) $only_unresolved = " AND ocena = 1 ";
- if ($_GET['only_unresolved'] == 3) $only_unresolved2 = " AND text2 = 1 ";
-
- if ($_GET['only_unresolved'] == 4) $only_unresolved = " AND ocena = 2 ";
- if ($_GET['only_unresolved'] == 4) $only_unresolved2 = " AND text2 = 2 ";
-
- if ($_GET['only_unresolved'] == 5) $only_unresolved = " AND ocena = 3 ";
- if ($_GET['only_unresolved'] == 5) $only_unresolved2 = " AND text2 = 3 ";
-
-
- $tema_vsebuje = substr($lang['srv_forum_intro'],0,10); // da ne prikazujemo 1. default sporocila
-
- if ($admin_type <= $question_comment_viewadminonly) { // vidi vse komentarje
- $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved ORDER BY time $orderby, id $orderby");
- } elseif ($question_comment_viewauthor==1) { // vidi samo svoje komentarje
- $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved AND uid='$global_user_id' ORDER BY time $orderby, id $orderby");
- } else { // ne vidi nobenih komentarjev
- $sqlt = sisplet_query("SELECT * FROM post WHERE 1=0");
- }
-
- $sql2 = sisplet_query("SELECT COUNT(*) AS count FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spr_id' $only_unresolved2");
- $row2 = mysqli_fetch_array($sql2);
-
-
- if ( ($_GET['all_questions']=='1') OR ( mysqli_num_rows($sqlt) > 0 || $row2['count'] > 0 || $row1['note'] != '' ) ) {
- $c++;
-
- echo '<div style="margin: 20px 0">';
-
- echo '<li id="branching_'.$spr_id.'" class="spr">';
- $b->vprasanje($spr_id);
- echo '</li>';
-
- if ($admin_type <= $question_note_view || $question_note_view == '') {
-
- if ($row1['note'] != '') {
- echo '<div style="float:left; width:100%; margin-left: 1%">';
- echo '<p class="red"><b><a href="#" class="gray" onclick="$(\'.note-'.$spr_id.', .pl, .mn\').toggle(); return false;"><span class="pl">+</span><span class="mn" style="display:none">-</span> '.$lang['srv_note'].'</a></b></p>';
- echo '<p class="note-'.$spr_id.' displayNone">'.nl2br($row1['note']).'</p>';
- echo '</div>';
- }
- }
-
- echo '<div style="width:40%; margin: 0 5% 2% 1%; float: left">';
-
- if ($addfieldposition == 1) {
- echo '<div id="survey_comment_'.$spr_id.'_'.'4'.'" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_'.$spr_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_'.$spr_id.'" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field($spr_id, '1', '4', false);
- echo '</p>';
- }
-
- // komentarji na vprasanje
- if ($row1['thread'] > 0) {
-
- if (mysqli_num_rows($sqlt) > 0) {
-
- echo '<p class="red"><b>'.$lang['srv_admin_comment'].'</b>';
- //$rowss = mysqli_num_rows($sql);
- //if ($rowss > 0)
- echo '<img src="img_0/'.($sortpostorder==1?'up':'down').'.gif" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'" />';
- echo '</p>';
-
- $i = 0;
- while ($rowt = mysqli_fetch_array($sqlt)) {
- if ($_GET['only_unresolved'] == 1) {
- if ($rowt['ocena'] == 0) echo '<span style="color:black">';
- elseif ($rowt['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($rowt['ocena'] == 2) echo '<span style="color:#999999">';
- elseif ($rowt['ocena'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
- } else {
- if ($rowt['ocena'] == 0) echo '<span style="color:#990000">';
- elseif ($rowt['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($rowt['ocena'] == 2) echo '<span style="color:black">';
- elseif ($rowt['ocena'] == 3) echo '<span style="color:black">';
- else echo '<span>';
- }
-
- echo '<b>'.$f->user($rowt['uid']).'</b> ('.$f->datetime1($rowt['time']).'):';
-
- if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
-
- echo '<div style="float:right; text-align:right">';
-
- if ($commentmarks == 1) {
- echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
- <option value="0"'.($rowt['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($rowt['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($rowt['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($rowt['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- echo '<input type="checkbox" name="ocena_'.$rowt['id'].'" id="ocena_'.$rowt['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (this.checked?\'2\':\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});" value="2" '.($rowt['ocena'] >= 2?' checked':'').' /><label for="ocena_'.$rowt['id'].'">'.$lang['srv_done'].'</label>';
- }
- echo ' <br /><a href="javascript:comment_on_comment(\''.$rowt['id'].'\');">'.$lang['srv_comment_comment'].'</a>';
- echo '</div>';
- }
-
- echo '<br/>'.$rowt['vsebina'].'<span id="comment_on_comment_'.$rowt['id'].'"></span><hr>';
- echo '</span>';
- }
- }
- }
-
- if ($addfieldposition == '' || $addfieldposition == 0) {
- echo '<div id="survey_comment_'.$spr_id.'_'.'4'.'" style="display:none"></div>';
- echo '<p><a href="#" onclick="$(\'#comment_field_'.$spr_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
- echo '<p id="comment_field_'.$spr_id.'" style="display:none">';
- $ba = new BranchingAjax($this->anketa);
- $ba->add_comment_field($spr_id, '1', '4', false);
- echo '</p>';
- }
-
- echo '</div>';
-
- // komentarji respondentov
- if ($row2['count'] > 0) {
-
- if ($admin_type <= $question_resp_comment_viewadminonly) {
- echo '<div style="width:40%; margin: 0 5% 0 1%; float: left">';
- echo '<p class="red"><b>'.$lang['srv_repondent_comment'].'</b></p>';
-
- if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND d.text2 <= 1 "; else $only_unresolved = " ";
-
- $sqlt = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spr_id' $only_unresolved2 ORDER BY id ASC");
- if (!$sqlt) echo mysqli_error($GLOBALS['connect_db']);
- while ($rowt = mysqli_fetch_array($sqlt)) {
-
- if ($rowt['text2'] == 0) echo '<span style="color:black">';
- elseif ($rowt['text2'] == 1) echo '<span style="color:darkgreen">';
- elseif ($rowt['text2'] == 2) echo '<span style="color:#999999">';
- elseif ($rowt['text2'] == 3) echo '<span style="color:#999999">';
- else echo '<span>';
-
-
- if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
- echo '<div style="float:right">';
- if ($commentmarks == 1) {
- echo ' <select name="ocena'.$rowt['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
- <option value="0"'.($rowt['text2']==0?' selected':'').'>'.$lang['srv_undecided'].'</option>
- <option value="1"'.($rowt['text2']==1?' selected':'').'>'.$lang['srv_todo'].'</option>
- <option value="2"'.($rowt['text2']==2?' selected':'').'>'.$lang['srv_done'].'</option>
- <option value="3"'.($rowt['text2']==3?' selected':'').'>'.$lang['srv_not_relevant'].'</option>
- </select>';
- } else {
- echo '<input type="checkbox" name="ocena_'.$rowt['id'].'" id="ocena_'.$rowt['id'].'" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (this.checked?\'2\':\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});" value="2" '.($rowt['text2'] >= 2?' checked':'').' /><label for="ocena_'.$rowt['id'].'">'.$lang['srv_done'].'</label>';
- }
- echo ' </div>';
- }
-
- // Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja
- $sqlTime = sisplet_query("SELECT time_edit FROM srv_user WHERE id='".$rowt['usr_id']."'");
- if(mysqli_num_rows($sqlTime) > 0){
-
- $rowTime = mysqli_fetch_array($sqlTime);
-
- if ( strpos($rowt['text'], '__DATE__') !== false ) {
- $rowt['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowt['text']);
- echo ''.nl2br($rowt['text']).'<hr>';
- }
- else {
- echo ''.$f->datetime1($rowTime['time_edit']).':<br>';
- echo ''.nl2br($rowt['text']).'<hr>';
- }
- }
- else{
- if ( strpos($rowt['text'], '__DATE__') !== false ) {
- $rowt['text'] = str_replace('__DATE__', '', $rowt['text']);
- echo ''.nl2br($rowt['text']).'<hr>';
- }
- else {
- echo ''.nl2br($rowt['text']).'<hr>';
- }
- }
-
- echo '</span>';
-
- }
- echo '</div>';
- }
- }
-
- echo '<div class="clr"></div>';
- echo '</div>';
- }
- }
- }
-
- echo '</span>';
-
- if ($c == 0) {
- echo '<div style="margin-top: 60px;">';
- echo $lang['srv_no_comments_solved'].'<br/>';
- #echo '<a href="index.php?anketa='.$this->anketa.'&a=urejanje">'.$lang['srv_settings_komentarji'].'</a>';
- echo '</div>';
- }
- }
- else {
- echo '<div style="margin-top: 60px;">';
- echo $lang['srv_no_comments'].'<br/>';
- echo '</div>';
- }
-
- echo '</div>'; // branching
- echo '<div id="vprasanje_float_editing"></div>';
- echo '</div>'; // placeholder
- }
-
- /**
* odsteje dva datuma, $d1 - D2
*
*/
@@ -7138,7 +7298,7 @@ class SurveyAdminSettings {
function testiranje_testnipodatki () {
global $lang;
- if ($_POST['stevilo_vnosov'] > 0) {
+ if (isset($_POST['stevilo_vnosov']) && $_POST['stevilo_vnosov'] > 0) {
// Nastavitev da vstavljamo samo veljavne vnose
$only_valid = isset($_POST['only_valid']) ? $_POST['only_valid'] : 0;
@@ -7220,7 +7380,7 @@ class SurveyAdminSettings {
}
if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
- if ($vrednost > 0) {
+ if (isset($vrednost) && $vrednost > 0) {
$srv_data_vrednost .= "('$row[id]', '$vrednost', '$this->usr_id'),";
if ($row1['other'] == 1)
$srv_data_text .= "('$row[id]', '$vrednost', '".$this->randomString()."', '', '$this->usr_id'),";
@@ -7258,11 +7418,11 @@ class SurveyAdminSettings {
$j++;
}
- if ($vrednost) {
+ if (isset($vrednost)) {
foreach ($vrednost AS $key => $val) {
if ($val > 0) {
$srv_data_vrednost .= "('$row[id]', '$val', '$this->usr_id'),";
- if ($row1['other'] == 1)
+ if (isset($row1['other']) && $row1['other'] == 1)
$srv_data_text .= "('$row[id]', '$val', '".$this->randomString()."', '', '$this->usr_id'),";
}
}
@@ -7388,56 +7548,8 @@ class SurveyAdminSettings {
}
}
- //Lokacija
- elseif($row['tip'] == 26){
- //choose location
- $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$row[id]'", 'array');
-
- //so vrednosti, se pravi je choose
- if($sql1){
- foreach($sql1 as $row1){
- if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
- // Ce imamo samo veljavne imamo vedno vrednost
- if($only_valid == 1)
- $vrednost = $this->randomString();
- else
- $vrednost = rand(0,1)==0 ? $this->randomString() : '';
-
- $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '".
- ($vrednost != '' ? $vrednost : '-1')."', ''),";
- }
- else {
- $srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
- }
- }
- }
- //niso vrednosti, se pravi je moja ali multi lokacija
- else{
- if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
-
- $make_input = ($only_valid == 1 ? true : rand(0,1)==0);
- if($make_input){
-
- $lat = floatval(mt_rand(454000, 466500)/10000);
- $lng = floatval(mt_rand(136000, 163900)/10000);
-
- // Ce imamo samo veljavne imamo vedno vrednost
- if($only_valid == 1)
- $vrednost = $this->randomString();
- else
- $vrednost = rand(0,1)==0 ? $this->randomString() : '';
-
- $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '".
- ($vrednost != '' ? $vrednost : '-1')."', ''),";
- }
- }
- else {
- $srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
- }
- }
- }
- //Heatmap
- elseif($row['tip'] == 27){
+ //Lokacija
+ elseif($row['tip'] == 26){
//choose location
$sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$row[id]'", 'array');
@@ -7451,7 +7563,7 @@ class SurveyAdminSettings {
else
$vrednost = rand(0,1)==0 ? $this->randomString() : '';
- $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '".
+ $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '".
($vrednost != '' ? $vrednost : '-1')."', ''),";
}
else {
@@ -7475,7 +7587,7 @@ class SurveyAdminSettings {
else
$vrednost = rand(0,1)==0 ? $this->randomString() : '';
- $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '".
+ $srv_data_map .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '".
($vrednost != '' ? $vrednost : '-1')."', ''),";
}
}
@@ -7484,6 +7596,54 @@ class SurveyAdminSettings {
}
}
}
+ //Heatmap
+ elseif($row['tip'] == 27){
+ //choose location
+ $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$row[id]'", 'array');
+
+ //so vrednosti, se pravi je choose
+ if($sql1){
+ foreach($sql1 as $row1){
+ if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
+ // Ce imamo samo veljavne imamo vedno vrednost
+ if($only_valid == 1)
+ $vrednost = $this->randomString();
+ else
+ $vrednost = rand(0,1)==0 ? $this->randomString() : '';
+
+ $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '', '', '', '".
+ ($vrednost != '' ? $vrednost : '-1')."', ''),";
+ }
+ else {
+ $srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
+ }
+ }
+ }
+ //niso vrednosti, se pravi je moja ali multi lokacija
+ else{
+ if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
+
+ $make_input = ($only_valid == 1 ? true : rand(0,1)==0);
+ if($make_input){
+
+ $lat = floatval(mt_rand(454000, 466500)/10000);
+ $lng = floatval(mt_rand(136000, 163900)/10000);
+
+ // Ce imamo samo veljavne imamo vedno vrednost
+ if($only_valid == 1)
+ $vrednost = $this->randomString();
+ else
+ $vrednost = rand(0,1)==0 ? $this->randomString() : '';
+
+ $srv_data_heatmap .= "(" . $this->usr_id . ", '$row[id]', '$row1[id]', ". $this->anketa . ", '$lat', '$lng', '[N/A]', '".
+ ($vrednost != '' ? $vrednost : '-1')."', ''),";
+ }
+ }
+ else {
+ $srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
+ }
+ }
+ }
// multinumber
elseif ($row['tip'] == 20) {
@@ -7525,7 +7685,7 @@ class SurveyAdminSettings {
if ($s->checkSpremenljivka($row['id'], $isTestData=true)) {
$vrednost = rand(0,1)==0 ? $this->randomString() : '';
- if ($vrednost != '')
+ if (isset($vrednost) && $vrednost != '')
$srv_data_text .= "('$row[id]', '', '$vrednost', '', '$this->usr_id'),";
} else {
$srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
@@ -7546,7 +7706,7 @@ class SurveyAdminSettings {
else
$vrednost = rand(0,1)==0 ? $this->randomString() : '';
- if ($vrednost != '')
+ if (isset($vrednost) && $vrednost != '')
$srv_data_text .= "('$row[id]', '$row1[id]', '$vrednost', '', '$this->usr_id'),";
}
@@ -7639,7 +7799,7 @@ class SurveyAdminSettings {
else
$vrednost = rand(0,1)==0 ? $this->randomDate() : '';
- if ($vrednost != '')
+ if (isset($vrednost) && $vrednost != '')
$srv_data_text .= "('$row[id]', '', '$vrednost', '', '$this->usr_id'),";
} else {
@@ -7674,10 +7834,10 @@ class SurveyAdminSettings {
while($row1 = mysqli_fetch_array($sql1)){
- if (count($array) > 0) {
+ if (isset($array) && count($array) > 0) {
$vrednost = array_pop($array);
- if ($vrednost != '')
+ if (isset($vrednost) && $vrednost != '')
$srv_data_rating .= "('$row[id]', '$row1[id]', '$this->usr_id', '$vrednost'),";
}
}
@@ -7711,11 +7871,8 @@ class SurveyAdminSettings {
elseif(rand(0,1) == 0)
$vrednost = $this->randomNumber();
- if (isset( $vrednost )) {
-
- if ($vrednost != '')
- $srv_data_text .= "('$row[id]', '$row1[id]', '$vrednost', '', '$this->usr_id'),";
- }
+ if (isset($vrednost) && $vrednost != '')
+ $srv_data_text .= "('$row[id]', '$row1[id]', '$vrednost', '', '$this->usr_id'),";
}
else
$srv_data_vrednost .= "('$row[id]', '-2', '$this->usr_id'),";
@@ -7931,9 +8088,9 @@ class SurveyAdminSettings {
header("Location: index.php?anketa=$this->anketa&a=testiranje&m=testnipodatki");
- } elseif ($_GET['delete_testdata'] == 1 || $_GET['delete_autogen_testdata'] == 1) {
+ } elseif ((isset($_GET['delete_testdata']) && $_GET['delete_testdata'] == 1) || (isset($_GET['delete_autogen_testdata']) && $_GET['delete_autogen_testdata'] == 1)) {
- if($_GET['delete_autogen_testdata'] == 1)
+ if(isset($_GET['delete_autogen_testdata']) && $_GET['delete_autogen_testdata'] == 1)
sisplet_query("DELETE FROM srv_user WHERE ank_id='$this->anketa' AND testdata='2'");
else
sisplet_query("DELETE FROM srv_user WHERE ank_id='$this->anketa' AND (testdata='1' OR testdata='2')");
@@ -7950,25 +8107,52 @@ class SurveyAdminSettings {
$sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_user WHERE ank_id='$this->anketa' AND (testdata='1' OR testdata='2')");
$row = mysqli_fetch_array($sql);
$total_rows = $row['count'];
-
+
echo '<form name="" action="ajax.php?anketa='.$this->anketa.'&a=testiranje&m=testnipodatki" method="post" onsubmit="init_progressBar(true);">';
- echo '<p>';
- echo '<span class="spaceRight">'.$lang['srv_stevilo_vnosov'].': <input type="text" name="stevilo_vnosov" value="1" onkeyup="max_stevilo_vnosov();"> (max 1000) </span>';
+
+ echo '<fieldset><legend>'.$lang['srv_testiranje_vnosi'].'</legend>';
+ echo '<p class="bottom16">'.$lang['srv_testni_nagovor'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo $lang['srv_stevilo_vnosov'].':';
+ echo '<div class="max_wrap">';
+ echo '<input class="text large" type="text" name="stevilo_vnosov" value="1" onkeyup="max_stevilo_vnosov();">';
+ echo '<span class="gray">(max. 1000)</span>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
echo '<input type="hidden" name="only_valid" id="only_valid_0" value="0" />';
- echo '<span style="margin: 0 25px;"><label for="only_valid_1">'.$lang['srv_testni_samo_veljavni'].': <input type="checkbox" name="only_valid" id="only_valid_1" value="1"></label></span>';
- echo '<span class="spaceLeft"><input type="submit" name="" value="'.$lang['srv_dodaj_vnose'].'" /></span>';
- echo '</p>';
+ echo '<input type="checkbox" name="only_valid" id="only_valid_1" value="1">';
+ echo '<label for="only_valid_1">'.$lang['srv_testni_samo_veljavni'].'</label>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" type="submit">'.$lang['srv_dodaj_vnose'].'</button>';
+ echo '</div>';
+
echo '</form>';
- echo '<p>'.$lang['srv_testni_nagovor'].'</p>';
-
- echo '<a href="#" onClick="delete_test_data();">'.$lang['srv_delete_testdata'].'</a> ('.$total_rows.')';
+ echo '<p class="bottom16">'.$lang['srv_testni_nakonec'].'</p>';
+
+ echo '<a class="noline" href="#" onClick="delete_test_data();"><span class="faicon trash empty link-right"></span>'.$lang['srv_delete_testdata'].'</a> ('.$total_rows.')';
+
if ($total_rows > 0) {
+
+ echo '<table class="table_header">';
+ echo '<tbody>';
+ echo '<tr>';
+ echo '<td> Labela </td>';
+ echo '<td> Veljavni odgovori (Grafični prikaz) </td>';
+ echo '</tr>';
+ echo '</tbody>';
+ echo '</table>';
-
+
$prevpage = 0;
-
+
+
$sql = sisplet_query("SELECT s.id, s.gru_id, s.tip, s.naslov, g.naslov AS pagename FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND s.visible='1' AND g.ank_id='$this->anketa' ORDER BY g.vrstni_red, s.vrstni_red");
while ($row = mysqli_fetch_array($sql)) {
@@ -7981,14 +8165,16 @@ class SurveyAdminSettings {
echo '</table>';
echo '</fieldset>';
}
-
- echo '<fieldset><legend>'.$row['pagename'].'</legend>';
- echo '<table style="width:100%">';
+
+ echo '<fieldset class="page_num_fieldset">';
+ echo '<legend class="page_num">'.$row['pagename'].'</legend>';
+ // echo '<span class="dotted_line"> - </span>';
+ echo '<table class="avt_vnosi_table">';
$prevpage = $row['gru_id'];
}
- echo '<tr><td style="width:20%; text-align:left" title="'.strip_tags($row['naslov']).'">'.skrajsaj(strip_tags($row['naslov']),20).'</td>';
+ echo '<tr><td title="'.strip_tags($row['naslov']).'">'.skrajsaj(strip_tags($row['naslov']),50).'</td>';
// radio ali select, checkbox, textbox, textbox*, number, datum
if ( ($row['tip']==1 || $row['tip']==3 || $row['tip']==2 || $row['tip']==4 || $row['tip']==21 || $row['tip']==7 || $row['tip']==8) ) {
@@ -8056,9 +8242,11 @@ class SurveyAdminSettings {
}
}
- echo '<td>';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($p*0.7).'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$p.'% ('.($total_rows-$rowc['count']).')</span>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($p*0.9).'%"></div>';
+ echo ' <span>'.$p.'% ('.($total_rows-$rowc['count']).')</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
@@ -8068,8 +8256,8 @@ class SurveyAdminSettings {
echo '</table>';
echo '</fieldset>';
-
- echo '<p>'.$lang['srv_testni_nakonec'].'</p>';
+
+ echo '</fieldset>';
}
}
}
@@ -8113,7 +8301,7 @@ class SurveyAdminSettings {
function displayBtnMailtoPreview($row) {
global $lang;
echo '<div class="floatLeft"><div class="buttonwrapper">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="'.( ($row['active'] != 1) ? 'alert(\''.$lang['srv_anketa_noactive2'].'\'); ' : 'preview_mailto_email(); ').'return false;">';
+ echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="'.( ($row['active'] != 1) ? 'genericAlertPopup(\'srv_anketa_noactive2\'); ' : 'preview_mailto_email(); ').'return false;">';
echo '<span>';
//'<img src="icons/icons/accept.png" alt="" vartical-align="middle" />'
echo $lang['srv_mailto_preview'] . '</span></a></div></div>';
@@ -8132,33 +8320,46 @@ class SurveyAdminSettings {
$_expire = explode('-',$row['expire']);
$expire = $_expire[2].'.'.$_expire[1].'.'.$_expire[0];
- echo '<fieldset><legend>'.$lang['srv_activate_duration_2'].' '.Help::display('srv_activity_quotas').'</legend>';
- echo '<p>';
- echo '<span class="duration_span">' . $lang['srv_activate_duration_manual_from'].'</span>';
- echo '<input id="startsManual1" type="text" name="durationStarts" value="' . $starts . '" disabled autocomplete="off"/>';
- echo '</p>';
+
+ // Preklop domene na oneclicksurvey.com - ne pustimo spremembe aktivnosti
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ return;
+ }
+
+ echo '<fieldset>';
+ echo '<legend>'.$lang['srv_activate_duration_2'].'</legend>';
+ echo '<div class="setting_holder" id="start">';
+ echo '<span class="setting_title">' . $lang['srv_activate_duration_manual_from'].'</span>';
+ echo '<div class="icon_holder">';
+ echo '<input id="startsManual1" type="text" class="large" readonly="true" name="durationStarts" value="' . $starts . '" autocomplete="off"/>';
+ echo '</div>';
+ echo '</div>';
- echo '<p>';
- echo '<span class="duration_span">' . $lang['srv_activate_duration_manual_to'].'</span>';
- echo '<input id="expireManual1" type="text" name="durationExpire" value="' . $expire . '" disabled autocomplete="off"/>';
- echo '</p>';
+ echo '<div class="setting_holder" id="expire">';
+ echo '<span class="setting_title">' . $lang['srv_activate_duration_manual_to'].'</span>';
+ echo '<div class="icon_holder">';
+ echo '<input id="expireManual1" type="text" class="large '.($row['expire'] == PERMANENT_DATE ? ' disabled' : '').'" readonly="true" name="durationExpire" value="' . $expire . '" autocomplete="off"/>';
+ echo '</div>';
+ echo '</div>';
- echo '<p>';
- echo '<span class="duration_span">' . $lang['srv_trajna_anketa'].'</span>';
+ echo '<div class="setting_holder">';
echo '<input id="expirePermanent" type="checkbox" name="expirePermanent" value="1"'.($row['expire'] == PERMANENT_DATE ? ' checked="checked"' : '').' autocomplete="off" onchange="setExpirePermanent();"/>';
- echo '</p>';
- echo '</fieldset>';
+ echo '<label for="expirePermanent">' . $lang['srv_trajna_anketa'].'</label>';
echo '</div>';
- #echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="anketa_activate_save(\''.$this->anketa.'\',\''.$folders.'\'); return false;"><span>' . $lang['srv_zapri'] . '</span></a></div></span>';
+ echo '</fieldset>';
echo '
- <script type="text/javascript">
+ <script type="text/javascript">
$(document).ready(function () {
datepicker("#startsManual1");
- datepicker("#expireManual1");
- });
- </script>';
+ datepicker("#expireManual1");';
+
+ if($row['expire'] == PERMANENT_DATE)
+ echo '$("#expire").find(".ui-datepicker-trigger").addClass("disabled");';
+
+ echo ' });
+ </script>';
}
function DisplayNastavitveMaxGlasov() {
@@ -8171,73 +8372,54 @@ class SurveyAdminSettings {
$row = SurveyInfo::getInstance()->getSurveyRow();
//Nastavitev max stevila glasov
- echo '<br />';
echo '<fieldset>';
echo '<legend>'.$lang['srv_vote_quotas'].' '.Help::display('srv_activity_quotas').'</legend>';
- echo '<p>';
- echo '<span class="duration_span" ><label>' . $lang['srv_vote_quotas_2'] . ':</label></span>';
- echo '<label for="vote_limit_0"><input type="radio" name="vote_limit" value="0" id="vote_limit_0"' . ($row['vote_limit'] == 0 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(0)" />' . $lang['no1'] . '</label>';
- echo '<label for="vote_limit_1"><input type="radio" name="vote_limit" value="1" id="vote_limit_1"' . ($row['vote_limit'] == 1 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(1)" />' . $lang['yes'] . '</label>';
- echo '<label for="vote_limit_2"><input type="radio" name="vote_limit" value="2" id="vote_limit_2"' . ($row['vote_limit'] == 2 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(2)" />' . $lang['srv_data_only_valid'] . ' (status 5, 6) '.Help::display('srv_activity_quotas_valid').'</label>';
-
- echo '&nbsp;&nbsp;&nbsp;&nbsp;<span class="duration_span"><label for="anketa' . $row['id'] . '" >'.$lang['srv_vote_count'].': </span>';
- echo '<input type="text" id="vote_count" name="vote_count" ' . ($row['vote_limit'] == 0 ? ' disabled="disabled"' : '') . ' value="' . $row['vote_count'] . '" style="width:50px; margin-left: 5px;" maxlength="40" /></label>';
- echo '</p>';
+ echo '<div class="setting_holder '.($row['vote_limit'] == 0 ? 'bottom0' : '').'" id="vote_limit">';
- // Opozorilo, da je limit odgovorov presezen
- echo '<p class="vote_limit_warning" style="padding-left:10px; line-height:20px; '.($row['vote_limit'] == 0 ? ' display:none;' : '').'">';
- echo $lang['srv_survey_voteLimit_warning'].':<br />';
-
- $srv_survey_non_active_voteLimit = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_survey_non_active_voteLimit');
- if ($srv_survey_non_active_voteLimit == '') $srv_survey_non_active_voteLimit = $lang['srv_survey_non_active_voteLimit'];
- echo '<span class="italic spaceLeft">'.$srv_survey_non_active_voteLimit.'</span>';
-
- echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=jezik">'.$lang['edit3'].'</a>';
- echo '</p>';
+ echo '<span class="setting_title">' . $lang['srv_vote_quotas_2'] . ':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="vote_limit" value="0" id="vote_limit_0"' . ($row['vote_limit'] == 0 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(0)" />';
+ echo '<label for="vote_limit_0">' . $lang['srv_vote_quotas_val0'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="vote_limit" value="2" id="vote_limit_2"' . ($row['vote_limit'] == 2 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(2)" />';
+ echo '<label for="vote_limit_2">' . $lang['srv_vote_quotas_val2'] . ' '.Help::display('srv_activity_quotas_valid').'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="vote_limit" value="1" id="vote_limit_1"' . ($row['vote_limit'] == 1 ? ' checked="checked"' : '') . ' onClick="voteCountStatus(1)" />';
+ echo '<label for="vote_limit_1">' . $lang['srv_vote_quotas_val1'] . '</label>';
+ echo '</div>';
- echo '</fieldset>';
- }
-
- /**
- * Uporabnik (administrator, manager) lahko dodajata nove uporabnike in jim dodelita dostop
- */
- public function dodajNovegaUporabnika(){
- global $admin_type;
- global $lang;
- global $virtual_domain;
+ echo '</div>';
- // admini lahko dodajajo uporabnike, ki jih nato managirajo
- if($admin_type != 0)
- return '';
- echo '<div id="dodajanjeNovega">';
+ // Opozorilo, da je limit odgovorov presezen
+ echo '<div id="vote_limit_all_warning" class="bottom16 '.($row['vote_limit'] == 0 || $row['vote_limit'] == 2 ? 'displayNone' : '').'">';
+ echo ' <div class="setting_holder red">'.$lang['srv_vote_quotas_all_warning'].'</div>';
+ echo '</div>';
- echo '<form class="manager_add_user" name="admin_add_user" action="ajax.php?t=dostop&a=add_new_user" method="post">';
- echo '<h3><b>'.$lang['srv_users_add_new_title'].'</b></h3>';
+ // Opozorilo, da je limit odgovorov presezen
+ echo '<div id="vote_limit_warning" class="'.($row['vote_limit'] == 0 ? 'displayNone' : '').'">';
- echo '<p><label for="email">'.$lang['email'].':</label><input type="email" id="email" name="email"> '.(!empty($_GET['add']) && $_GET['error']=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'').'</p>';
- echo '<p><label for="name">'.$lang['name'].':</label><input type="text" id="name" name="name"></p>';
- echo '<p><label for="surname">'.$lang['surname'].':</label><input type="text" id="surname" name="surname"></p>';
- echo '<p><label for="password">'.$lang['password'].':</label><input type="password" id="password" name="password"> '.(!empty($_GET['add']) && $_GET['error']=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'').'</p>';
- echo '<p><label for="password2">'.$lang['again'].':</label><input type="password" id="password2" name="password2"></p>';
- echo '<p><label for="jezik">'.$lang['lang'].':</label>
- <select id="jezik" name="jezik">
- <option value="1" selected>'.$lang['srv_diagnostics_filter_lang_slo'].'</option>
- <option value="2">'.$lang['srv_diagnostics_filter_lang_ang'].'</option>
- </select>
- </p>';
-
- //echo '<p><button type="submit">'.$lang['add'].'</button></p>';
- echo '<p><div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.admin_add_user.submit();">'.$lang['create'].'</a>';
- echo '</div></p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_vote_count'].':</span>';
+ echo '<input type="text" class="large" id="vote_count" name="vote_count" value="' . $row['vote_count'] . '"/></label>';
+ echo '</div>';
- echo '</form>';
+ echo '<p class="top16">'.$lang['srv_survey_voteLimit_warning'].':</p>';
+
+ $srv_survey_non_active_voteLimit = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_survey_non_active_voteLimit');
+ if ($srv_survey_non_active_voteLimit == '') $srv_survey_non_active_voteLimit = $lang['srv_survey_non_active_voteLimit'];
+ echo '<p><span class="italic">'.$srv_survey_non_active_voteLimit.' </span><a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=jezik"><span class="faicon edit"></span></a><p>';
+
+ echo '</div>';
- echo '</div>';
- }
+
+ echo '</fieldset>';
+ }
+
/**
* Uporabnik (administrator, manager) lahko dodajata nove uporabnike in jim dodelita dostop
@@ -8246,96 +8428,246 @@ class SurveyAdminSettings {
global $admin_type;
global $lang;
global $global_user_id;
- global $virtual_domain;
- // managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
+ // managerji in admini lahko dodajajo uporabnike, ki jih nato managirajo
if( !($admin_type == 1 || $admin_type == 0) )
return '';
- // Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
- if(false && $virtual_domain && $admin_type == 1){
+ $error = isset($_GET['error']) ? $_GET['error'] : '';
- // Limit st. dodeljenih uporabnikov
- $managed_accounts_limit = 5;
- // Prestejemo dodeljene uporabnike
- $sql = sisplet_query("SELECT u.email
- FROM srv_dostop_manage m, users u
- WHERE m.manager='".$global_user_id."' AND u.id=m.user AND u.email NOT LIKE ('D3LMD-%') AND u.email NOT LIKE ('UNSU8MD-%')
- ");
+ // MANAGER lahko samo doda novega uporabnika pod sebe
+ if($admin_type == 1){
- $managed_accounts_count = mysqli_num_rows($sql);
+ echo '<fieldset><legend>'.$lang['n_users_list_add'].'</legend>';
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_users_add_new_type2'].'</span>';
+ echo '</div>';
- echo '<p class="bold" style="padding-left:0px;">';
- echo $lang['srv_users_add_assigned_max_1'].' <span class="red bold">'.$managed_accounts_limit.'</span> '.$lang['srv_users_add_assigned_max_2'];
- // Manager na virtualkah ima omejitev koliko uporabnikov lahko pregleduje
- if($managed_accounts_count >= $managed_accounts_limit){
- echo '<br /><br />';
- echo $lang['srv_users_add_assigned_max_reached'];
- echo '</p>';
-
- return;
- }
- elseif($managed_accounts_count > 0){
- echo '<br /><br />';
- echo $lang['srv_users_add_assigned_current'].' <span class="red bold">'.$managed_accounts_count.' '.$lang['of'].' '.$managed_accounts_limit.'</span>';
- }
+ // Na virtualkah imajo managerji omejitev st. dodeljenih uporabnikov - ZAENKRAT JE TO ONEMOGOCENO, KASNEJE SE LAHKO OMEJI NA PAKET
+ /*if(false && isVirtual() && $admin_type == 1){
+
+ // Limit st. dodeljenih uporabnikov
+ $managed_accounts_limit = 5;
+
+ // Prestejemo dodeljene uporabnike
+ $sql = sisplet_query("SELECT u.email
+ FROM srv_dostop_manage m, users u
+ WHERE m.manager='".$global_user_id."' AND u.id=m.user AND u.email NOT LIKE ('D3LMD-%') AND u.email NOT LIKE ('UNSU8MD-%')
+ ");
+
+ $managed_accounts_count = mysqli_num_rows($sql);
+
+
+ echo '<p class="bold bottom16">';
+ echo $lang['srv_users_add_assigned_max_1'].' <span class="red bold">'.$managed_accounts_limit.'</span> '.$lang['srv_users_add_assigned_max_2'].'</p>';
+
+ // Manager na virtualkah ima omejitev koliko uporabnikov lahko pregleduje
+ if($managed_accounts_count >= $managed_accounts_limit){
+ echo '<p>';
+ echo $lang['srv_users_add_assigned_max_reached'];
+ echo '</p>';
+
+ return;
+ }
+ elseif($managed_accounts_count > 0){
+ echo '<p>';
+ echo $lang['srv_users_add_assigned_current'].' <span class="red bold">'.$managed_accounts_count.' '.$lang['of'].' '.$managed_accounts_limit.'</span></p>';
+ }
+ }*/
+
+
+ // Dodajanje novih uporabnikov pod pregled - ustvari racun, doda uporabnika pod pregled in mu poslje mail
+ echo '<div id="add_user_option_2" class="add_user_option">';
+ echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo ' <label>'.$lang['name'].':</label>';
+ echo ' <input type="text" class="text large" id="name" name="name">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['surname'].':</label>';
+ echo ' <input type="text" class="text large" id="surname" name="surname">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['email'].':</label>';
+ echo ' <input type="email" class="text large" id="email" name="email"> '.(empty($_GET['add']) && $error=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo ' <label>'.$lang['password'].':</label>';
+ echo ' <input type="password" class="text large" id="password" name="password"> '.(empty($_GET['add']) && $error=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['password_confirm'].':</label>';
+ echo ' <input type="password" class="text large" id="password2" name="password2">';
+ echo '</div>';
- echo '</p>';
+ echo '<div class="button_holder top16 bottom0">';
+ echo ' <button class="medium blue" onClick="document.manager_add_user.submit();">'.$lang['create_add'].'</button>';
+ echo '</div>';
+
+ echo '</form>';
+ echo '</div>'; //new_user_option
+
+
+ // Managerji lahko dodajajo samo uporabnike z dolocenimi emaili (če jim domeno posebej nastavi admin)
+ // TODO: trenutno onemogočimo dodaja ostalih uporabnikov za managerje. Ko bo stvar vezana na domeno se jim bo omogočilo dodajanje samo domenskih
+ /*elseif(false && $admin_type == 1){
+
+ UserSetting :: getInstance()->Init($global_user_id);
+ $emails = UserSetting :: getInstance()->getUserSetting('manage_domain');
+
+ echo '<br><form class="manager_add_user" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
+ echo '<h3><b>'.sprintf($lang['srv_manager_add_user3'], $emails).'<br />'.$lang['srv_manager_add_user4'].'</b></h3>';
+ echo '<p><input name="uemail" value="" style="width: 500px;" id="manager-email"><span id="manager-email-obvestilo"></span></p>';
+ echo '<p><button type="submit" id="manager-email-submit" style="display:none;">'.$lang['add'].'</button></p>';
+
+ echo '</form>';
+ }*/
+
+ echo '</fieldset>';
}
+ // ADMIN lahko tudi doda uporabnika brez pregleda in doda obstojecega pod pregled
+ else{
- echo '<div id="dodajanje">';
+ echo '<fieldset><legend>'.$lang['n_users_list_add'].'</legend>';
- // Dodajanje novih uporabnikov - ustvari racun, doda uporabnika pod pregled in mu poslje mail
- echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">';
- echo '<h3><b>'.$lang['srv_users_add_assigned_title'].'</b></h3>';
- echo '<p><label for="email">'.$lang['email'].':</label><input type="email" id="email" name="email"> '.(empty($_GET['add']) && $_GET['error']=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'').'</p>';
- echo '<p><label for="name">'.$lang['name'].':</label><input type="text" id="name" name="name"></p>';
- echo '<p><label for="surname">'.$lang['surname'].':</label><input type="text" id="surname" name="surname"></p>';
- echo '<p><label for="password">'.$lang['password'].':</label><input type="password" id="password" name="password"> '.(empty($_GET['add']) && $_GET['error']=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'').'</p>';
- echo '<p><label for="password2">'.$lang['again'].':</label><input type="password" id="password2" name="password2"></p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_users_add_new_type'].'</span>';
- echo '<p><div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.manager_add_user.submit();">'.$lang['create_add'].'</a>';
- echo '</div></p>';
+ // Dodajanje novega uporabnika v sistem
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="user_add_type_1" name="user_add_type" value="1" checked="checked" onClick="toggleAddUser(this.value);">';
+ echo ' <label for="user_add_type_1">'. $lang['srv_users_add_new_type1'] .'</label> ';
+ echo '</div>';
- echo '</form>';
+ // Dodajanje novega uporabnika v sistem in pod svoj pregled
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="user_add_type_2" name="user_add_type" value="2" onClick="toggleAddUser(this.value);">';
+ echo ' <label for="user_add_type_2">'. $lang['srv_users_add_new_type2'] .'</label> ';
+ echo '</div>';
- // admini si lahko dodajajo ze obstojece uporabnike
- if ($admin_type == 0) {
+ // Dodajanje obstoječega uporabnika pod pregled
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" id="user_add_type_3" name="user_add_type" value="3" onClick="toggleAddUser(this.value);">';
+ echo ' <label for="user_add_type_3">'. $lang['srv_users_add_new_type3'] .'</label> ';
+ echo '</div>';
+
+ echo '</div>';
- echo '<br /><br /><br />';
- echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
+ // Dodajanje novih uporabnikov - ustvari racun in mu poslje mail
+ echo '<div id="add_user_option_1" class="add_user_option">';
+ echo '<form class="add_new_user" name="add_new_user" action="ajax.php?t=dostop&a=add_new_user" method="post">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo ' <label>'.$lang['name'].':</label>';
+ echo ' <input type="text" class="text large" id="name" name="name">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['surname'].':</label>';
+ echo ' <input type="text" class="text large" id="surname" name="surname">';
+ echo '</div>';
- echo '<h3><b>'.$lang['srv_manager_add_user2'].'</b></h3>';
- echo '<p><select name="uid" class="js-obstojeci-uporabniki-admin-ajax" style="width: 500px;"></select></p>';
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['email'].':</label>';
+ echo ' <input type="email" class="text large" id="email" name="email"> '.(empty($_GET['add']) && $error=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo ' <label>'.$lang['password'].':</label>';
+ echo ' <input type="password" class="text large" id="password" name="password"> '.(empty($_GET['add']) && $error=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['password_confirm'].':</label>';
+ echo ' <input type="password" class="text large" id="password2" name="password2">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['lang'].':</label>';
+ echo ' <input type="radio" id="jezik_1" name="jezik" value="1" '.($lang['id'] == '1' ? 'checked="checked"' : '').'><label for="jezik_1">'.$lang['srv_diagnostics_filter_lang_slo'].'</label>';
+ echo ' <input type="radio" id="jezik_2" name="jezik" value="2" '.($lang['id'] == '2' ? 'checked="checked"' : '').'><label for="jezik_2">'.$lang['srv_diagnostics_filter_lang_ang'].'</label>';
+ echo '</div>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo ' <button class="medium blue" onClick="document.add_new_user.submit();">'.$lang['create'].'</button>';
+ echo '</div>';
+
+ echo '</form>';
+ echo '</div>';
+
+
+ // Dodajanje novih uporabnikov pod pregled - ustvari racun, doda uporabnika pod pregled in mu poslje mail
+ echo '<div id="add_user_option_2" class="add_user_option displayNone">';
+ echo '<form class="manager_add_user" name="manager_add_user" action="ajax.php?t=dostop&a=manager_add_user" method="post">';
- //echo '<p><button type="submit">'.$lang['add'].'</button></p>';
- echo '<p><div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="document.admin_add_dostop.submit();">'.$lang['add'].'</a>';
- echo '</div></p>';
+ echo '<div class="setting_holder horizontal">';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['name'].':</span>';
+ echo '<input type="text" class="text large" id="name" name="name">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['surname'].':</span>';
+ echo '<input type="text" class="text large" id="surname" name="surname">';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['email'].':</p>';
+ echo '<input type="email" class="text large" id="email" name="email"> '.(empty($_GET['add']) && $error=='email'?'<span class="red">'.$lang['srv_added_false'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['password'].':</p>';
+ echo '<input type="password" class="text large" id="password" name="password"> '.(empty($_GET['add']) && $error=='pass'?'<span class="red">'.$lang['pass_doesnt_match'].'</span>':'');
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['password_confirm'].':</p>';
+ echo '<input type="password" class="text large" id="password2" name="password2">';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo ' <button class="medium blue" onClick="document.manager_add_user.submit();">'.$lang['create_add'].'</button>';
+ echo '</div>';
echo '</form>';
- }
- // Managerji lahko dodajajo samo uporabnike z dolocenimi emaili (če jim domeno posebej nastavi admin)
- // TODO: trenutno onemogočimo dodaja ostalih uporabnikov za managerje. Ko bo stvar vezana na domeno se jim bo omogočilo dodajanje samo domenskih
- /*elseif(false && $admin_type == 1){
+
+ echo '</div>';
+
- UserSetting :: getInstance()->Init($global_user_id);
- $emails = UserSetting :: getInstance()->getUserSetting('manage_domain');
+ // Dodajanje obstojecih uporabnikov pod pregled
+ echo '<div id="add_user_option_3" class="add_user_option displayNone">';
+
+ echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
- echo '<br><form class="manager_add_user" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
- echo '<h3><b>'.sprintf($lang['srv_manager_add_user3'], $emails).'<br />'.$lang['srv_manager_add_user4'].'</b></h3>';
- echo '<p><input name="uemail" value="" style="width: 500px;" id="manager-email"><span id="manager-email-obvestilo"></span></p>';
- echo '<p><button type="submit" id="manager-email-submit" style="display:none;">'.$lang['add'].'</button></p>';
+ echo '<div class="setting_holder">';
+ echo ' <p class="bottom4">'.$lang['srv_manager_add_user_label'].':</p>';
+ echo ' <select name="uid" class="js-obstojeci-uporabniki-admin-ajax drowpdown large" style="width: 460px;"></select>';
+ echo '</div>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo ' <button class="medium blue" onCclick="document.admin_add_dostop.submit();">'.$lang['add'].'</button>';
+ echo '</div>';
echo '</form>';
- }*/
- echo '</div>';
+ echo '</div>';
+
+
+ echo '</fieldset>';
+ }
}
/**
@@ -8345,9 +8677,10 @@ class SurveyAdminSettings {
global $lang;
global $admin_type;
- echo '<table id="all_users_list" class="dataTable">';
+ echo '<table id="all_users_list" class="usersTable">';
echo '<thead><tr>';
+ echo '<th>'.$lang['edit2'].'</th>';
echo '<th>' . $lang['srv_survey_list_users_name'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_email'] . '</th>';
echo '<th>' . $lang['admin_type'] . '</th>';
@@ -8360,22 +8693,9 @@ class SurveyAdminSettings {
echo '<th>' . $lang['users_gdpr_title'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_registred'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_last_login'] . '</th>';
- echo '<th style="max-width: 70px;">'.$lang['edit2'].'</th>';
echo '</tr></thead>';
echo '</table>';
-
- // Dodajanje uporabnikov
- echo '<div class="add_user">';
-
- // Admin lahko doda novega uporabnika v sistem (brez pregleda)
- if($admin_type == '0'){
- echo '<fieldset class="new_user"><legend>'.$lang['srv_users_add_new'].'</legend>';
- $this->dodajNovegaUporabnika();
- echo '</fieldset>';
- }
-
- echo '</div>';
}
/**
@@ -8389,9 +8709,13 @@ class SurveyAdminSettings {
$sqlU = sisplet_query("SELECT name, surname, email FROM users WHERE id='".$global_user_id."'");
$rowU = mysqli_fetch_array($sqlU);
+ //echo "Ime: ".$rowU['name'];
+
+ // PREGLED NAD UPORABNIKI - TABELA
+ echo '<div class="my_users_list_holder">';
- // Naslov
- echo '<h2 style="margin-bottom:30px;">';
+ // Naslov
+ /*echo '<h2 style="margin-bottom:30px;">';
if($admin_type == 0)
echo $lang['administrator'];
@@ -8404,15 +8728,15 @@ class SurveyAdminSettings {
echo ' <a href="#" onclick="edit_user(\''.$global_user_id.'\'); return false;" title="Uredi"><i class="fa fa-pencil-alt link-moder"></i></a>';
- echo '</h2>';
+ echo '</h2>'; */
+ echo '<p class="bottom16 caps semi-bold">'.$lang['srv_users_assigned_title'].'</p>';
// Tabela
- echo '<fieldset style="max-width: 100% !important;"><legend>'.$lang['srv_users_assigned_title'].'</legend>';
- //echo '<h4 style="margin-bottom: 10px;">'.$lang['srv_users_assigned_title'].'</h4>';
- echo '<table id="my_users_list" class="dataTable">';
+ echo '<table id="my_users_list" class="usersTable">';
echo '<thead><tr>';
+ echo '<th>'.$lang['edit2'].'</th>';
echo '<th>' . $lang['srv_survey_list_users_name'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_email'] . '</th>';
echo '<th>' . $lang['admin_type'] . '</th>';
@@ -8423,20 +8747,9 @@ class SurveyAdminSettings {
echo '<th>' . $lang['users_gdpr_title'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_registred'] . '</th>';
echo '<th>' . $lang['srv_survey_list_users_last_login'] . '</th>';
- echo '<th style="max-width: 70px;">'.$lang['edit2'].'</th>';
echo '</tr></thead>';
echo '</table>';
- echo '</fieldset>';
-
-
- // Dodajanje uporabnikov
- echo '<div class="add_user">';
-
- // Manager ali admin lahko doda novega uporabnika pod pregled
- echo '<fieldset class="assign_user"><legend>'.$lang['srv_users_add_assigned'].'</legend>';
- $this->dodeljeniUporabniki();
- echo '</fieldset>';
echo '</div>';
}
@@ -8447,7 +8760,7 @@ class SurveyAdminSettings {
public function deletedUsersList(){
global $lang;
- echo '<table id="deleted_users_list" class="dataTable">';
+ echo '<table id="deleted_users_list" class="usersTable">';
echo '<thead><tr>';
echo '<th>'.$lang['srv_survey_list_users_name'].'</th>';
echo '<th>'.$lang['srv_survey_list_users_email'].'</th>';
@@ -8466,7 +8779,7 @@ class SurveyAdminSettings {
public function unsignedUsersList(){
global $lang;
- echo '<table id="unsigned_users_list" class="dataTable">';
+ echo '<table id="unsigned_users_list" class="usersTable">';
echo '<thead><tr>';
echo '<th>'.$lang['srv_survey_list_users_name'].'</th>';
echo '<th>'.$lang['srv_survey_list_users_email'].'</th>';
@@ -8485,12 +8798,12 @@ class SurveyAdminSettings {
echo '<table id="unconfirmed_mail_user_list" class="dataTable">';
echo '<thead><tr>';
+ echo '<th>'.$lang['edit2'].'</th>';
echo '<th>'.$lang['srv_survey_list_users_name'].'</th>';
echo '<th>'.$lang['srv_survey_list_users_email'].'</th>';
echo '<th>'.$lang['admin_type'].'</th>';
echo '<th>'.$lang['lang'].'</th>';
echo '<th>'.$lang['registered'].'</th>';
- echo '<th style="width: 90px;">'.$lang['edit2'].'</th>';
echo '</tr></thead>';
echo '</table>';
}
@@ -8568,14 +8881,17 @@ class SurveyAdminSettings {
if ($_GET['a'] == 'uporabnost'){
- echo '<fieldset><legend>'.$lang['srv_uporabnost'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_uporabnost" name="uporabnost" value="1"'. (isset($modules['uporabnost']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'uporabnost\');" />';
- echo $lang['srv_vrsta_survey_type_4'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_4_3'].'</i>';
+ echo '<fieldset><legend>'.$lang['srv_uporabnost'].Help::display('srv_evalvacija_strani').'</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_4_3'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_uporabnost" name="uporabnost" value="1"'. (isset($modules['uporabnost']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'uporabnost\');" />';
+ echo '<label for="advanced_module_uporabnost">'.$lang['srv_vrsta_survey_note_4_3a'] . '</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
if(isset($modules['uporabnost'])){
$this->uporabnost();
@@ -8685,13 +9001,15 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'kviz'){
echo '<fieldset><legend>'.$lang['srv_kviz'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_quiz" name="quiz" value="1" '. (isset($modules['quiz']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'quiz\');" />';
- echo $lang['srv_vrsta_survey_type_6'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_6_4'].'</i>';
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_6_4'].'</p>';
+ echo '<div class="setting_holder">';
+ echo ' <input type="checkbox" id="advanced_module_quiz" name="quiz" value="1" '. (isset($modules['quiz']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'quiz\');" />';
+ echo ' <label for="advanced_module_quiz">'.$lang['srv_vrsta_survey_note_6_4a'].'</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
if(isset($modules['quiz'])){
$sq = new SurveyQuiz($this->anketa);
@@ -8709,19 +9027,22 @@ class SurveyAdminSettings {
echo '<fieldset><legend>'.$lang['srv_voting'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_voting" name="voting" value="1" '. (isset($modules['voting']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'voting\');" />';
- echo $lang['srv_vrsta_survey_type_18'] . '</label>';
- echo '<br><i>'.$lang['srv_voting_info'].'</i>';
+ echo '<p class="bottom16">'.$lang['srv_voting_info'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_voting_info_link'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_voting_info_warning'].'</p>';
// Opozorilo, da so vabila ze vklopljena in zato modula ni mogoce vklopiti
if(!isset($modules['voting']) && SurveyInfo::getInstance()->checkSurveyModule('email')){
- echo '<br><br><i class="red bold">'.$lang['srv_voting_info_error'].'</i><br>';
+ echo '<p class="bottom16"><i class="red bold">'.$lang['srv_voting_info_error'].'</i></p>';
}
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo ' <input type="checkbox" id="advanced_module_voting" name="voting" value="1" '. (isset($modules['voting']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'voting\');" />';
+ echo ' <label for="advanced_module_voting">'.$lang['srv_voting_on'].'</label>';
+ echo '</div>';
echo '</fieldset>';
-
- echo '<br />';
-
+
echo '<div id="globalSettingsInner">';
if(isset($modules['voting'])){
$sv = new SurveyVoting($this->anketa);
@@ -8732,13 +9053,14 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'advanced_paradata'){
echo '<fieldset><legend>'.$lang['srv_advanced_paradata'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_advanced_paradata" name="advanced_paradata" value="1" '. (isset($modules['advanced_paradata']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'advanced_paradata\');" />';
- echo $lang['srv_vrsta_survey_type_16'] . '</label>';
- //echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_6_4'].'</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo ' <input type="checkbox" id="advanced_module_advanced_paradata" name="advanced_paradata" value="1" '. (isset($modules['advanced_paradata']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'advanced_paradata\');" />';
+ echo ' <label for="advanced_module_advanced_paradata">'.$lang['srv_vrsta_survey_type_16_on'].'</label>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
echo '<div id="globalSettingsInner">';
if(isset($modules['advanced_paradata'])){
$sap = new SurveyAdvancedParadata($this->anketa);
@@ -8746,6 +9068,24 @@ class SurveyAdminSettings {
}
echo '</div>';
}
+ elseif ($_GET['a'] == 'advanced_timestamps'){
+
+ echo '<fieldset><legend>'.$lang['srv_advanced_timestamps'].'</legend>';
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo ' <input type="checkbox" id="advanced_module_advanced_timestamps" name="advanced_timestamps" value="1" '. (isset($modules['advanced_timestamps']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'advanced_timestamps\');" />';
+ echo ' <label for="advanced_module_advanced_timestamps">'.$lang['srv_vrsta_survey_type_20_on'].'</label>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner">';
+ if(isset($modules['advanced_timestamps'])){
+ $sat = new SurveyAdvancedTimestamps($this->anketa);
+ $sat->displaySettings();
+ }
+ echo '</div>';
+ }
elseif ($_GET['a'] == 'json_survey_export'){
echo '<fieldset><legend>'.$lang['srv_json_survey_export'].'</legend>';
@@ -8798,6 +9138,18 @@ class SurveyAdminSettings {
echo '</div>';
}
elseif ($_GET['a'] == A_TELEPHONE){
+
+ echo '<div class="phone_settings_top" id="globalSettingsInner">';
+ if(isset($modules['phone'])){
+ $ST = new SurveyTelephone($this->anketa);
+ $ST->action($_GET['m']);
+ }
+ echo '</div>';
+
+ $hide_tel_fieldset = '';
+ if ($_GET['m'] == 'recipients_lists') {
+ $hide_tel_fieldset = 'displayNone';
+ }
// Ce je anketar ne vidi teh nastavitev
$isAnketar = Common::isUserAnketar($this->anketa, $global_user_id);
@@ -8809,46 +9161,46 @@ class SurveyAdminSettings {
// Ce se nimamo nobene stevilke v bazi, pustimo da se lahko ugasne
if($rowT['cnt'] == 0){
- echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_7'].' '.Help::display('srv_telephone_help').'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_phone" name="phone" value="1" '. (isset($modules['phone']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'phone\');" />';
- echo $lang['srv_vrsta_survey_type_7'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_7_3'].'</i>';
+ echo '<fieldset class="'.$hide_tel_fieldset.'"><legend>'.$lang['srv_vrsta_survey_type_7'].' '.Help::display('srv_telephone_help').'</legend>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_phone" name="phone" value="1" '. (isset($modules['phone']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'phone\');" />';
+ echo '<label for="advanced_module_phone" class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_type_7'] . '</label>';
+ echo '</div>';
+
+ echo '<p class="top16 '.$css_disabled.'">'.$lang['srv_vrsta_survey_note_7_3'].'</p>';
echo '</fieldset>';
}
- else{
+ /*else{
echo '<span class="blue" style="font-size:14px; font-weight:600;">'.$lang['srv_vrsta_survey_type_7'].'</span> '.Help::display('srv_telephone_help');
echo '<br />';
- }
+ }*/
}
else{
- echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_7'].' '.Help::display('srv_telephone_help').'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_phone" name="phone" value="1" '. (isset($modules['phone']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'phone\');" />';
- echo $lang['srv_vrsta_survey_type_7'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_7_3'].'</i>';
+ echo '<fieldset class="'.$hide_tel_fieldset.'"><legend>'.$lang['srv_vrsta_survey_type_7'].' '.Help::display('srv_telephone_help').'</legend>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_phone" name="phone" value="1" '. (isset($modules['phone']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'phone\');" />';
+ echo '<label for="advanced_module_phone" class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_type_7'] . '</label>';
+ echo '</div>';
+
+ echo '<p class="top16 '.$css_disabled.'">'.$lang['srv_vrsta_survey_note_7_3'].'</p>';
echo '</fieldset>';
}
-
- echo '<br />';
- }
-
- echo '<div id="globalSettingsInner">';
- if(isset($modules['phone'])){
- $ST = new SurveyTelephone($this->anketa);
- $ST->action($_GET['m']);
}
- echo '</div>';
}
elseif ($_GET['a'] == A_CHAT){
global $site_path;
echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_14'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_chat" name="chat" value="1" '. (isset($modules['chat']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'chat\');" />';
- echo $lang['srv_vrsta_survey_type_14'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_14_1'].'</i>';
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_14_1'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_chat" name="chat" value="1" '. (isset($modules['chat']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'chat\');" />';
+ echo '<label for="advanced_module_chat">'.$lang['srv_vrsta_survey_note_14_1b'].'</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
if(isset($modules['chat'])){
$sc = new SurveyChat($this->anketa);
@@ -8860,13 +9212,15 @@ class SurveyAdminSettings {
global $site_path;
echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_15'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_panel" name="panel" value="1" '. (isset($modules['panel']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'panel\');" />';
- echo $lang['srv_vrsta_survey_type_15'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_15_1'].'</i>';
+ echo '<p>'.$lang['srv_vrsta_survey_note_15_1'].'</p>';
+ echo '<p class="top16 bottom16">'.$lang['srv_vrsta_survey_note_15_1a'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_panel" name="panel" value="1" '. (isset($modules['panel']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'panel\');" />';
+ echo '<label for="advanced_module_panel">'.$lang['srv_vrsta_survey_note_15_1b'].'</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
if(isset($modules['panel'])){
$sp = new SurveyPanel($this->anketa);
@@ -8874,6 +9228,26 @@ class SurveyAdminSettings {
}
echo '</div>';
}
+ elseif ($_GET['a'] == A_EMAIL_ACCESS){
+ global $site_path;
+
+ echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_19'].'</legend>';
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_19_1'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="advanced_module_email_access" name="email_access" value="1" '. (isset($modules['email_access']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'email_access\');" />';
+ echo '<label for="advanced_module_email_access">'.$lang['srv_vrsta_survey_note_19_2'].'</label>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner">';
+ if(isset($modules['email_access'])){
+ $sea = new SurveyEmailAccess($this->anketa);
+ $sea->displaySettings();
+ }
+ echo '</div>';
+ }
elseif ($_GET['a'] == A_FIELDWORK){
global $site_path;
@@ -8892,7 +9266,7 @@ class SurveyAdminSettings {
echo '</div>';
}
- elseif ($_GET['a'] == A_MAZA){
+ elseif ($_GET['a'] == A_MAZA){
global $site_path;
echo '<fieldset><legend>'.$lang['srv_maza'].'</legend>';
@@ -8905,14 +9279,14 @@ class SurveyAdminSettings {
echo '<div id="globalSettingsInner">';
- if(isset($modules['maza'])){
- $MS = new MAZA($this->anketa);
- $MS ->display();
- }
+ if(isset($modules['maza'])){
+ $MS = new MAZA($this->anketa);
+ $MS ->display();
+ }
echo '</div>';
}
- elseif ($_GET['a'] == A_WPN){
+ elseif ($_GET['a'] == A_WPN){
global $site_path;
echo '<fieldset><legend>'.$lang['srv_wpn'].'</legend>';
@@ -8925,10 +9299,10 @@ class SurveyAdminSettings {
echo '<div id="globalSettingsInner">';
- if(isset($modules['wpn'])){
- $MS = new WPN($this->anketa);
- $MS ->display();
- }
+ if(isset($modules['wpn'])){
+ $MS = new WPN($this->anketa);
+ $MS ->display();
+ }
echo '</div>';
}
@@ -8936,19 +9310,20 @@ class SurveyAdminSettings {
if ($_GET['m'] == 'respondenti' || $_GET['m'] == "") {
echo '<fieldset><legend>'.$lang['srv_vrsta_survey_type_8'].'</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_social_network" name="social_network" value="1" '. (isset($modules['social_network']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'social_network\');" />';
- echo $lang['srv_vrsta_survey_type_8'] . '</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_8_3'].'</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_8_3'].'</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_social_network" name="social_network" value="1" '. (isset($modules['social_network']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'social_network\');" />';
+ echo '<label for="advanced_module_social_network">'.$lang['srv_vrsta_survey_note_8_3a'].'</label>';
+ echo '</div>';
+
echo '<div id="globalSettingsInner">';
- // urejanje respondentov
if(isset($modules['social_network'])){
$this->SN_Settings();
}
echo '</div>';
+
+ echo '</fieldset>';
}
}
elseif ($_GET['a'] == A_360){
@@ -8990,26 +9365,29 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'evoli'){
echo '<fieldset><legend>Evoli</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli" name="evoli" value="1" '. (isset($modules['evoli']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli\');" />';
- echo 'Evoli</label>';
- echo '<br/><i class="'.$css_disabled.'">Napredna poročila Evoli</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<div id="globalSettingsInner">';
+
+ echo '<p class="bottom16">Napredna poročila Evoli</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli" name="evoli" value="1" '. (isset($modules['evoli']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli\');" />';
+ echo '<label for="advanced_module_evoli">Evoli</label>';
echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner"></div>';
}
elseif ($_GET['a'] == 'evoli_teammeter'){
echo '<fieldset><legend>Evoli team meter</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli_teammeter" name="evoli_teammeter" value="1" '. (isset($modules['evoli_teammeter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_teammeter\');" />';
- echo 'Evoli team meter</label>';
- echo '<br /><i class="'.$css_disabled.'">Napredna poročila Evoli team meter</i>';
+
+ echo '<p class="bottom16">Napredna poročila Evoli team meter</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli_teammeter" name="evoli_teammeter" value="1" '. (isset($modules['evoli_teammeter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_teammeter\');" />';
+ echo '<label for="advanced_module_evoli_teammeter">Evoli team meter</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
// urejanje respondentov
if(isset($modules['evoli_teammeter'])){
@@ -9021,13 +9399,15 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'evoli_quality_climate'){
echo '<fieldset><legend>Evoli quality climate</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli_quality_climate" name="evoli_quality_climate" value="1" '. (isset($modules['evoli_quality_climate']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_quality_climate\');" />';
- echo 'Evoli quality climate</label>';
- echo '<br /><i class="'.$css_disabled.'">Napredna poročila Evoli quality climate</i>';
+
+ echo '<p class="bottom16">Napredna poročila Evoli quality climate</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli_quality_climate" name="evoli_quality_climate" value="1" '. (isset($modules['evoli_quality_climate']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_quality_climate\');" />';
+ echo '<label for="advanced_module_evoli_quality_climate">Evoli quality climate</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
// urejanje respondentov
if(isset($modules['evoli_quality_climate'])){
@@ -9039,13 +9419,15 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'evoli_teamship_meter'){
echo '<fieldset><legend>Evoli teamship meter</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli_teamship_meter" name="evoli_teamship_meter" value="1" '. (isset($modules['evoli_teamship_meter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_teamship_meter\');" />';
- echo 'Evoli teamship meter</label>';
- echo '<br /><i class="'.$css_disabled.'">Napredna poročila Evoli teamship meter</i>';
+
+ echo '<p class="bottom16">Napredna poročila Evoli teamship meter</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli_teamship_meter" name="evoli_evoli_teamship_meter" value="1" '. (isset($modules['evoli_teamship_meter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_teamship_meter\');" />';
+ echo '<label for="advanced_module_evoli_teamship_meter">Evoli teamship meter</label>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
// urejanje respondentov
if(isset($modules['evoli_teamship_meter'])){
@@ -9057,13 +9439,15 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'evoli_organizational_employeeship_meter'){
echo '<fieldset><legend>Evoli organizational employeeship meter</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli_organizational_employeeship_meter" name="evoli_organizational_employeeship_meter" value="1" '. (isset($modules['evoli_organizational_employeeship_meter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_organizational_employeeship_meter\');" />';
- echo 'Evoli organizational employeeship meter</label>';
- echo '<br /><i class="'.$css_disabled.'">Napredna poročila Evoli organizational employeeship meter</i>';
+
+ echo '<p class="bottom16">Napredna poročila Evoli organizational employeeship meter</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli_organizational_employeeship_meter" name="evoli_evoli_organizational_employeeship_meter" value="1" '. (isset($modules['evoli_organizational_employeeship_meter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_organizational_employeeship_meter\');" />';
+ echo '<label for="advanced_module_evoli_organizational_employeeship_meter">Evoli organizational employeeship meter</label>';
+ echo '</div>';
+
echo '</fieldset>';
-
- echo '<br />';
-
+
echo '<div id="globalSettingsInner">';
// urejanje respondentov
if(isset($modules['evoli_organizational_employeeship_meter'])){
@@ -9075,53 +9459,58 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'evoli_employmeter'){
echo '<fieldset><legend>Evoli employ meter</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_evoli_employmeter" name="evoli_employmeter" value="1" '. (isset($modules['evoli_employmeter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_employmeter\');" />';
- echo 'Evoli employeeship meter</label>';
- echo '<br /><i class="'.$css_disabled.'">Napredna poročila Evoli employeeship meter</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<div id="globalSettingsInner">';
+
+ echo '<p class="bottom16">Napredna poročila Evoli employeeship meter</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_evoli_employmeter" name="evoli_evoli_employmeter" value="1" '. (isset($modules['evoli_employmeter']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'evoli_employmeter\');" />';
+ echo '<label for="advanced_module_evoli_employmeter">Evoli employeeship meter</label>';
echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner"></div>';
}
elseif ($_GET['a'] == 'mfdps'){
echo '<fieldset><legend>MFDPŠ</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_mfdps" name="mfdps" value="1" '. (isset($modules['mfdps']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'mfdps\');" />';
- echo 'MFDPŠ</label>';
- echo '<br/><i class="'.$css_disabled.'">Napredni izvozi MFDPŠ</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<div id="globalSettingsInner">';
+
+ echo '<p class="bottom16">Napredni izvozi MFDPŠ</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_mfdps" name="mfdps" value="1" '. (isset($modules['mfdps']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'mfdps\');" />';
+ echo '<label for="advanced_module_mfdps">MFDPŠ</label>';
echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner"></div>';
}
elseif ($_GET['a'] == 'borza'){
echo '<fieldset><legend>Borza</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_borza" name="borza" value="1" '. (isset($modules['borza']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'borza\');" />';
- echo 'Borza</label>';
- echo '<br/><i class="'.$css_disabled.'">Napredni izvozi Borza</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<div id="globalSettingsInner">';
+
+ echo '<p class="bottom16">Napredni izvozi Borza</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_borza" name="borza" value="1" '. (isset($modules['borza']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'borza\');" />';
+ echo '<label for="advanced_module_borza">Borza</label>';
echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner"></div>';
}
elseif ($_GET['a'] == 'mju'){
echo '<fieldset><legend>MJU</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_mju" name="mju" value="1" '. (isset($modules['mju']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'mju\');" />';
- echo 'MJU</label>';
- echo '<br/><i class="'.$css_disabled.'">Napredni izvozi MJU</i>';
-
+
+ echo '<p class="bottom16">Napredni izvozi MJU</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_mju" name="mju" value="1" '. (isset($modules['mju']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'mju\');" />';
+ echo '<label for="advanced_module_mju">MJU</label>';
+ echo '</div>';
+
echo '</fieldset>';
+
- echo '<br />';
-
echo '<div id="globalSettingsInner">';
if(isset($modules['mju'])){
$sme = new SurveyMJUEnote($this->anketa);
@@ -9132,15 +9521,16 @@ class SurveyAdminSettings {
elseif ($_GET['a'] == 'excell_matrix'){
echo '<fieldset><legend>Excelleration matrix</legend>';
- echo '<label class="strong'.$css_disabled.'"><input type="checkbox" id="advanced_module_excell_matrix" name="excell_matrix" value="1" '. (isset($modules['excell_matrix']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'excell_matrix\');" />';
- echo 'Excelleration matrix</label>';
- echo '<br/><i class="'.$css_disabled.'">'.$lang['srv_vrsta_survey_note_16_1'].'</i>';
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<div id="globalSettingsInner">';
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_16_1'].'</p>';
+ echo '<div class="setting_holder bottom0">';
+ echo '<input type="checkbox" id="advanced_module_excell_matrix" name="excell_matrix" value="1" '. (isset($modules['excell_matrix']) ? ' checked="checked"' : '').$disabled.' onChange="toggleAdvancedModule(\'excell_matrix\');" />';
+ echo '<label for="advanced_module_excell_matrix">Excelleration matrix</label>';
echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '<div id="globalSettingsInner"></div>';
}
}
@@ -9168,7 +9558,10 @@ class SurveyAdminSettings {
}
function globalUserSettings () {
- global $lang, $global_user_id, $admin_type;
+ global $lang, $global_user_id, $admin_type, $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
# polovimo nastavitve uporabnika
UserSetting::getInstance()->Init($global_user_id);
@@ -9210,117 +9603,157 @@ class SurveyAdminSettings {
$sql = sisplet_query("SELECT lang FROM users WHERE id = '$global_user_id'");
$row = mysqli_fetch_array($sql);
$lang_admin = $row['lang'];
- echo '<span class="nastavitveSpan6">'.$lang['lang'] . ':</span><select name="language">';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="language">'.$lang['lang'] . ':</label><select class="dropdown large" name="language" id="language">';
echo '<option value="1"'.($lang_admin == 1?' selected':'').'>Slovenščina</option>';
echo '<option value="2"'.($lang_admin == 2?' selected':'').'>English</option>';
echo '</select>';
-
- echo '<br />';
-
- // Napredni vmesnik (star design za moje ankete)
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_language_shortcut'].':</span>';
- echo '<input name="showLanguageShortcut" type="hidden" value="0">';
- echo '<input name="showLanguageShortcut" type="checkbox" value="1" '.($showLanguageShortcut == 1?' checked="checked"':'').'></label>';
+ echo '</div>';
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_settings_interfaceshow'] . ':</span>';
- // Prikaži ikono za jezik v navigacijski vrstici ankete, desno zgoraj
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_lock_survey_when_activate'].' </span>';
- echo '<input name="lockSurvey" type="hidden" value="0">';
- echo '<input name="lockSurvey" type="checkbox" value="1" '.($lockSurvey == 1?' checked="checked"':'').'></label>';
+ // Prikaži ikono za jezik v navigacijski vrstici ankete, desno zgoraj - TE NASTAVITVE NE UPOSTEVAMO VEC
+ /*echo '<div class="setting_item">';
+ echo '<input name="showLanguageShortcut" type="hidden" value="0">';
+ echo '<input id="showLanguageShortcut" name="showLanguageShortcut" type="checkbox" value="1" '.($showLanguageShortcut == 1?' checked="checked"':'').'>';
+ echo '<label for="showLanguageShortcut">'.$lang['srv_settings_language_shortcut'].'</label>';
+ echo '</div>';*/
- echo '<br />';
-
// Opcija enklik ustvarjanja ankete (v mojih anketah)
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_oneClickCreate'].':</span>';
+ echo '<div class="setting_item">';
echo '<input name="oneclickCreateMySurveys" type="hidden" value="0">';
- echo '<input name="oneclickCreateMySurveys" type="checkbox" value="1" '.($oneclickCreateMySurveys == 1?' checked="checked"':'').'></label>';
-
- echo '<br />';
+ echo '<input id="oneclickCreateMySurveys" name="oneclickCreateMySurveys" type="checkbox" value="1" '.($oneclickCreateMySurveys == 1?' checked="checked"':'').'>';
+ echo '<label for="oneclickCreateMySurveys">'.$lang['srv_settings_oneClickCreate'].Help::display('srv_nastavitve_enklik').'</label>';
+ echo '</div>';
- // Možnost prikaza SA ikone pri vseh anketah
+ // Možnost prikaza SA ikone pri vseh anketah
if($admin_type < 3) {
$showSAicon = UserSetting::getInstance()->getUserSetting('showSAicon');
- echo '<label><span class="nastavitveSpan6">' . $lang['srv_settings_showSAicon'] . ':</span>';
- echo '<input name="showSAicon" type="hidden" value="0">';
- echo '<input name="showSAicon" type="checkbox" value="1" ' . ($showSAicon == 1 ? ' checked="checked"' : '') . '></label>';
+ echo '<div class="setting_item">';
+ echo '<input name="showSAicon" type="hidden" value="0">';
+ echo '<input id="showSAicon" name="showSAicon" type="checkbox" value="1" ' . ($showSAicon == 1 ? ' checked="checked"' : '') . '>';
+ echo '<label for="showSAicon">' . $lang['srv_settings_showSAicon'] .'</label>';
+ echo '</div>';
}
+
+ echo '</div>';
echo '</fieldset>';
echo '<fieldset><legend>'.$lang['srv_survey_settings'].'</legend>';
-
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_settings_oncreation'] . ':</span>';
+
// Aktivna anketa ob aktivaciji - TO PUSTIMO SAMO ADMINOM ZARADI GDPR OPOZORILA OB AKTIVACIJI
if($admin_type == '0'){
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_autoActiveSurvey'].': </span>';
+ echo '<div class="setting_item">';
echo '<input name="autoActiveSurvey" type="hidden" value="0">';
- echo '<input name="autoActiveSurvey" type="checkbox" value="1" '.($autoActiveSurvey == 1?' checked="checked"':'').'></label>';
-
- echo '<br />';
+ echo '<input id="autoActiveSurvey" name="autoActiveSurvey" type="checkbox" value="1" '.($autoActiveSurvey == 1?' checked="checked"':'').'>';
+ echo '<label for="autoActiveSurvey">'.$lang['srv_settings_autoActiveSurvey'].'</label>';
+ echo '</div>';
}
// Komentarji aktivirani ob kreaciji ankete
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_settings_activeComments'].': </span>';
+ echo '<div class="setting_item">';
echo '<input name="activeComments" type="hidden" value="0">';
- echo '<input name="activeComments" type="checkbox" value="1" '.($activeComments == 1?' checked="checked"':'').'></label>';
+ echo '<input id="activeComments" name="activeComments" type="checkbox" value="1" '.($activeComments == 1?' checked="checked"':'').'>';
+ echo '<label for="activeComments">'.$lang['srv_settings_activeComments'].'</label>';
+ echo '</div>';
- echo '<br /><br />';
-
// Uvod ob aktivaciji prikazan
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_create_show_intro'].': </span>';
+ echo '<div class="setting_item">';
echo '<input name="showIntro" type="hidden" value="0">';
- echo '<input name="showIntro" type="checkbox" value="1" '.($showIntro == 1?' checked="checked"':'').'></label>';
+ echo '<input id="showIntro" name="showIntro" type="checkbox" value="1" '.($showIntro == 1?' checked="checked"':'').'>';
+ echo '<label for="showIntro">'.$lang['srv_create_show_intro'].'</label>';
+ echo '</div>';
- echo '<br />';
-
// Zakljucek ob aktivaciji prikazan
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_create_show_concl'].': </span>';
+ echo '<div class="setting_item">';
echo '<input name="showConcl" type="hidden" value="0">';
- echo '<input name="showConcl" type="checkbox" value="1" '.($showConcl == 1?' checked="checked"':'').'></label>';
-
- echo '<br />';
-
+ echo '<input id="showConcl" name="showConcl" type="checkbox" value="1" '.($showConcl == 1?' checked="checked"':'').'>';
+ echo '<label for="showConcl">'.$lang['srv_create_show_concl'].'</label>';
+ echo '</div>';
+
// Ime ob aktivaciji prikazano za respondente
- echo '<label><span class="nastavitveSpan6">'.$lang['srv_create_show_title'].': </span>';
+ echo '<div class="setting_item">';
echo '<input name="showSurveyTitle" type="hidden" value="0">';
- echo '<input name="showSurveyTitle" type="checkbox" value="1" '.($showSurveyTitle == 1?' checked="checked"':'').'></label>';
+ echo '<input id="showSurveyTitle" name="showSurveyTitle" type="checkbox" value="1" '.($showSurveyTitle == 1?' checked="checked"':'').'>';
+ echo '<label for="showSurveyTitle">'.$lang['srv_create_show_title'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_settings_onactivation'] . ':</span>';
+
+ // Zaklep urejanja ob aktivaciji
+ echo '<div class="setting_item">';
+ echo '<input name="lockSurvey" type="hidden" value="0">';
+ echo '<input name="lockSurvey" id="lockSurvey" type="checkbox" value="1" '.($lockSurvey == 1?' checked="checked"':'').'>';
+ echo '<label for="lockSurvey">'.$lang['srv_lock_survey_when_activate'].Help::display('srv_nastavitve_zakleni').'</label>';
+ echo '</div>';
+
+ echo '</div>';
echo '</fieldset>';
echo '</form>';
+ // save gumb
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="document.settingsanketa.submit();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+ // div za prikaz uspešnosti shranjevanja
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<div id="success_save"></div>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
+ }
+
// API avtentikacija
- echo '<fieldset><legend>'.$lang['srv_api'].'</legend>';
-
- echo '<span class="nastavitveSpan6">'.$lang['srv_api_auth'].': </span>';
- echo '<a href="#" onClick="generate_API_key(); return false;">'.$lang['srv_api_auth2'].'</a>';
- echo '<br /><br />';
+ echo '<fieldset><legend>'.$lang['srv_api'].Help::display('srv_nastavitve_API').'</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_api_auth'].':</p>';
+
+ echo '<div class="button_holder bottom16">';
+ echo '<button type="button" class="medium white-black" onClick="generate_API_key(); return false;">'.$lang['srv_api_auth2'].'</button>';
+ echo '</div>';
echo $lang['additional_info_api'];
echo '</fieldset>';
+
+
+ // Izvoz vseh anket v paket
+ echo '<fieldset class="top32"><legend>'.$lang['srv_archive_surveys'].Help::display('archive_surveys').'</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_archive_surveys_text1'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_archive_surveys_text2'].'</p>';
+ echo '<p class="bottom32 italic">'.$lang['srv_archive_surveys_text3'].'</p>';
+
+ echo '<div class="button_holder bottom0">';
+ echo ' <button type="button" class="medium white-black" onClick="archive_surveys_display_export(); return false;">'.$lang['srv_archive_surveys_export'].'</button>';
+ echo ' <button type="button" class="medium white-black" onClick="archive_surveys_display_import(); return false;">'.$lang['srv_archive_surveys_import'].'</button>';
+ echo '</div>';
+ echo '</fieldset>';
- // save gumb
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa.submit();"><span>'.$lang['edit1337'] . '</span></a></div>';
-
- echo '<span class="clr"></span>';
-
- // div za prikaz uspešnosti shranjevanja
- if ($_GET['s'] == '1') {
- echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
- }
-
+
echo '</div>';
}
function globalUserMyProfile () {
- global $lang, $global_user_id, $admin_type, $site_domain, $site_url, $app_settings, $aai_instalacija;
+ global $lang, $global_user_id, $admin_type, $site_domain, $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
// podatki prijavljenega uporabnika
$sql = sisplet_query("SELECT id, name, surname, email, type, gdpr_agree, last_login FROM users WHERE id = '$global_user_id'");
@@ -9332,26 +9765,34 @@ class SurveyAdminSettings {
echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n\r";
echo ' <input type="hidden" name="submited" value="1" />' . "\n\r";
- echo ' <fieldset><legend>'.$lang['edit_data'].'</legend>';
-
- echo '<div class="data"><span class="setting_title">'.$lang['logged_in_as'].': </span><span class="bold">'.$row['name'].' '.$row['surname'].'</span></div>';
+ echo '<fieldset><legend>'.$lang['edit_data'].'</legend>';
+
+ //Prijavljeni kot, status, zadnja prijava, aktivni paket
+ echo '<div id="user_info_segment" class="bottom0">';
+
if($row['type'] == '0')
$type = $lang['admin_admin'];
elseif($row['type'] == '1')
$type = $lang['admin_manager'];
else
$type = $lang['admin_narocnik'];
- echo '<div class="data"><span class="setting_title">'.$lang['your_status'].': </span><span class="bold">'.$type.'</span></div>';
-
- // Zadnja prijava
- echo '<div class="data"><span class="setting_title">'.$lang['srv_last_login'].': </span><span class="bold">'.date('j.n.Y', strtotime($row['last_login'])).' '.$lang['ob'].' '.date('H:i', strtotime($row['last_login'])).'</span></div>';
-
-
- // Trenutni paket funkcionalnosti
- if($app_settings['commercial_packages']){
- echo '<br>';
-
+ echo '<div class="user_info text">';
+ echo '<div class="setting_holder">'.$lang['logged_in_as']. ':</div>';
+ echo '<div class="setting_holder">'.$lang['your_status']. ':</div>';
+ echo '<div class="setting_holder">'.$lang['srv_last_login'].':</div>';
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true)
+ echo '<div class="setting_holder">'.$lang['srv_access_package'].':</div>';
+ echo '</div>';
+
+ echo '<div class="user_info data bold">';
+ echo '<div class="setting_holder">'.$row['name'].' '.$row['surname'].'</div>';
+ echo '<div class="setting_holder">'.$type.'</div>';
+ echo '<div class="setting_holder">'.date('j.n.Y', strtotime($row['last_login'])).' '.$lang['ob'].' '.date('H:i', strtotime($row['last_login'])).'</div>';
+
+ // Trenutni paket funkcionalnosti
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
$sqlA = sisplet_query("SELECT ua.time_activate, ua.time_expire, uap.id AS package_id, uap.name AS package_name
FROM user_access ua, user_access_paket uap
WHERE ua.usr_id='$global_user_id' AND uap.id=ua.package_id
@@ -9359,88 +9800,116 @@ class SurveyAdminSettings {
$drupal_url = ($lang['id'] == '2') ? $site_url.'d/en/' : $site_url.'d/';
+
+
// Ni nobenega paketa
- if(mysqli_num_rows($sqlA) == 0){
- $package_string = '1ka ('.$lang['srv_access_package_free'].') - <a href="'.$drupal_url.'cenik/zasebni-paketi">'.$lang['srv_narocila_buy'].'</a>';
+ if(mysqli_num_rows($sqlA) == 0){
+ $package_string = $lang['paket_opis_1ka'].' ('.$lang['srv_access_package_free'].')</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.''.$lang['srv_narocila_buyurl'].'\';">'.$lang['srv_narocila_buy'].'</button>';
}
else{
$rowA = mysqli_fetch_array($sqlA);
+ $userAccess = UserAccess::getInstance($global_user_id);
+ $package_name = $userAccess->getPackageName($rowA['package_id']);
// Ce ima paket 2 ali 3
- if($rowA['package_id'] == '2' || $rowA['package_id'] == '3'){
+ if($rowA['package_id'] == '2' || $rowA['package_id'] == '3'){
// Ce je paket ze potekel
- if(strtotime($rowA['time_expire']) < time()){
+ if(strtotime($rowA['time_expire']) < time()){
- $package_string = '<span class="red bold">';
- $package_string .= $rowA['package_name'];
+ $package_string = '<span>';
+ $package_string .= $package_name;
$package_string .= ' ('.$lang['srv_access_package_expire'].' '.date("d.m.Y", strtotime($rowA['time_expire'])).')';
$package_string .= '</span>';
-
- $package_string .= ' - <a href="'.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/">'.$lang['srv_narocila_extend'].'</a>';
+
+ $package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/\';">'.$lang['srv_narocila_extend'].'</button>';
}
else{
- $package_string = $rowA['package_name'];
+ $package_string = $package_name;
$package_string .= ' ('.$lang['srv_access_package_valid'].' '.date("d.m.Y", strtotime($rowA['time_expire'])).')';
- $package_string .= ' - <a href="'.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/">'.$lang['srv_narocila_extend'].'</a>';
-
- $package_string .= '<br /><a href="'.$site_url.'admin/survey/index.php?a=narocila" style="line-height:24px;">'.$lang['srv_access_package_all'].'</a>';
+ $package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.'izvedi-nakup/'.$rowA['package_id'].'/podatki/\';">'.$lang['srv_narocila_extend'].'</button>';
}
}
else{
- $package_string = $rowA['package_name'];
+ $package_string = $package_name;
$package_string .= ' ('.$lang['srv_access_package_free'].')';
- $package_string .= ' - <a href="'.$drupal_url.'cenik/zasebni-paketi">'.$lang['srv_narocila_buy'].'</a>';
+ $package_string .= '</div><div class="setting_holder"><button class="medium yellow" type="button" onClick="window.location.href=\''.$drupal_url.''.$lang['srv_narocila_buyurl'].'\';">'.$lang['srv_narocila_buy'].'</button>';
}
}
-
- echo '<div class="data"><span class="setting_title">'.$lang['srv_access_package'].': </span><span class="bold">'.$package_string.'</span></div>';
+ echo '<div class="setting_holder">'.$package_string.'</div>';
}
-
- echo '<br />';
+ echo '</div>';
+
+ echo '</div>';
// AAI nima moznosti spreminjanja imena, priimka, emaila, gesla...
- if($aai_instalacija){
+ if(isAAI()){
echo '<span class="italic">'.$lang['srv_profil_aai_warning'].'</span>';
}
else{
- echo ' <div class="setting"><span class="setting_title">'.$lang['name'].':</span>';
- echo ' <input class="text " name="ime" placeholder="Ime" value="'.$row['name'].'" type="text"></div>';
-
- echo ' <div class="setting"><span class="setting_title">'.$lang['surname'].' :</span>';
- echo ' <input class="text " name="priimek" placeholder="Priimek" value="'.$row['surname'].'" type="text"></div>';
- echo ' <div class="setting"><span class="setting_title">'.$lang['email'].' : <span class="faicon add icon-blue pointer" id="klik-dodaj-email" deluminate_imagetype="png"></span></span>';
- echo ' <input class="text" disabled="disabled" value="'.$row['email'].'" type="text">';
- echo ' <input name="email2" value="'.$row['email'].'" type="hidden">';
- echo ' <span style="margin:0 6.5px">&nbsp;</span>';
-
- $alternativni_emaili = User::getInstance()->allEmails('brez primarnega');
-
- echo '<label for="active-master" '.(empty($alternativni_emaili) ? 'class="hidden"' : '').'><input class="text" name="active_email" value="master" id="active-master" type="radio" '.(User::getInstance()->primaryEmail() == $row['email'] ? 'checked="checked"' : '').'> '.$lang['login_email_subscription'].'</label>';
- if(!empty($alternativni_emaili)){
- foreach($alternativni_emaili as $email) {
- echo '<br/><span style="width:130px; float:left;">&nbsp;</span>';
- echo '<input class="text" disabled="disabled" value="'.$email->email.'" type="text">';
- echo '<span style="margin: 0 5px 10px;" onclick="izbrisiAlternativniEmail(\''.$email->id.'\')"><i class="fa fa-times link-sv-moder"></i></span>';
- echo '<input class="text" value="'.($email->id).'" name="active_email" type="radio" '.($email->active == 1 ? 'checked="checked"' : '').'> <label for="active-master">'.$lang['login_email_subscription'].'</label>';
- }
+ echo '<p class="bottom16">'.$lang['srv_profil_settings_text'].'</p>';
+
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="ime">'.$lang['name'].':</label>';
+ echo '<input class="large" id="ime" name="ime" placeholder="Ime" value="'.$row['name'].'" type="text">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="priimek">'.$lang['surname'].':</label>';
+ echo '<input class="large" id="priimek" name="priimek" placeholder="Priimek" value="'.$row['surname'].'" type="text">';
+ echo '</div>';
+
+ echo '</div>';
+
+ $alternativni_emaili = User::getInstance()->allEmails('brez primarnega');
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['email'].':</label>';
+ echo '<div class="icon_holder">';
+ echo '<input class="large disabled" value="'.$row['email'].'" type="text" name="email_main">';
+ if(!empty($alternativni_emaili))
+ echo '<input name="active_email" value="master" id="active-master" type="radio" '.(User::getInstance()->primaryEmail() == $row['email'] ? 'checked="checked"' : '').'><label for="active-master">'.$lang['login_email_subscription'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ //Alternativni maili
+ if(!empty($alternativni_emaili)){
+ foreach($alternativni_emaili as $email) {
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['altemail'].':</label>';
+ echo '<div class="icon_holder">';
+ echo '<input class="large disabled" value="'.$email->email.'" name="email_alter'.($email->id).'" type="text">';
+ echo '<div class="blue pointer altmail" onclick="izbrisiAlternativniEmail(\''.$email->id.'\', \''.$email->email.'\')"><span class="faicon trash empty"></span></div>';
+ echo '<input value="'.($email->id).'" id="altemail'.($email->id).'" name="active_email" type="radio" '.($email->active == 1 ? 'checked="checked"' : '').'> <label for="altemail'.($email->id).'">'.$lang['login_email_subscription'].'</label>';
+ echo '</div>';
+ echo '</div>';
}
- echo '</div><br />';
-
- echo '<div class="dodaj-alternativni-email" style="display: none;">';
- echo '<div class="vnos">';
- echo '<span class="setting_title">'.$lang['login_alternative_emails'].' :</span>';
- echo '<input class="text" id="alternativni-email" value="" type="text">';
- echo '<span style="margin:0 8px">&nbsp;</span>';
- echo '<a href="#" onclick="dodajAlternativniEmail()">'.$lang['srv_inv_btn_add_recipients_add'].'</a>';
- echo '</div>';
- echo '<br><div id="alternativno-obvestilo" style="font-style: italic;"></div>';
- echo '<br />';
- echo '</div>';
+ }
+
+ echo '<div class="setting_holder">';
+ echo '<div class="blue pointer" id="klik-dodaj-email"><span class="faicon add"></span>'.$lang['srv_profil_settings_addemail'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder dodaj-alternativni-email" style="display: none;">';
+ echo '<div class="setting_item">';
+ echo '<label for="alternativni-email">'.$lang['login_alternative_emails'].':</label>';
+ echo '<div class="vnos button_holder inline bottom0">';
+ echo '<input class="large" id="alternativni-email" value="" type="text">';
+ echo '<button type="button" class="medium blue" onclick="dodajAlternativniEmail()">'.$lang['srv_inv_btn_add_recipients_add'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<div id="alternativno-obvestilo" class="italic"></div>';
+ echo '</div>';
+
+ echo '</div>';
// Ce je vklopljen modul gorenje, preverimo ce ima se default geslo in izpisemo opozorilo
if (Common::checkModule('gorenje')){
@@ -9448,25 +9917,44 @@ class SurveyAdminSettings {
echo '<p class="red bold">'.$lang['gorenje_password_warning'].'</p>';
}
- // Obveščanje
- echo ' <div class="setting"><span class="setting_title">'.$lang['password'].':</span>';
- echo ' <input class="text" name="geslo" placeholder="'.$lang['password'].'" id="p1" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p1\').value=\'\';" type="password"></div>';
-
- echo ' <div class="setting"><span class="setting_title">'.$lang['again'].':</span>';
- echo ' <input class="text" name="geslo2" placeholder="'.$lang['password'].'" id="p2" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p2\').value=\'\';" type="password"></div>';
+ // Geslo
+
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="p1">'.$lang['password'].':</label>';
+ echo '<input class="large" name="geslo" placeholder="'.$lang['password'].'" id="p1" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p1\').value=\'\';" type="password">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="p2">'.$lang['password_confirm'].':</label>';
+ echo '<input class="large" name="geslo2" placeholder="'.$lang['password'].'" id="p2" value="PRIMERZELODOLGEGAGESLA" onclick="document.getElementById(\'p2\').value=\'\';" type="password">';
+ echo '</div>';
+
+ echo '</div>';
// Prejemanje obvestil
- $red_border = (isset($_GET['unsubscribe']) && $_GET['unsubscribe'] == '1') ? ' border:2px red solid; padding: 5px 10px;' : '';
- echo ' <div class="setting" style="height:auto; float:left; clear:both; margin: 15px 0; '.$red_border.'"><span class="setting_title">'.$lang['srv_gdpr_user_options'].': '.Help::display('srv_gdpr_user_options').'</span>';
- echo ' <label for="gdpr-agree-yes"><input type="radio" name="gdpr_agree" id="gdpr-agree-yes" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : null).'/>'.$lang['yes'].'</label>';
- echo ' <label for="gdpr-agree-no"><input type="radio" name="gdpr_agree" id="gdpr-agree-no" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : null).'/>'.$lang['no1'].'</label></div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_user_options'].' '.Help::display('srv_gdpr_user_options').'</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="gdpr_agree" id="gdpr-agree-yes" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : null).'/>';
+ echo '<label for="gdpr-agree-yes">'.$lang['yes'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="gdpr_agree" id="gdpr-agree-no" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : null).'/>';
+ echo '<label for="gdpr-agree-no">'.$lang['no1'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
// Google 2 FA
$user_option = User::option($global_user_id, 'google-2fa-secret');
$user_option_validate = User::option($global_user_id, 'google-2fa-validation');
- echo ' <div class="setting" style="clear: both;"><span class="setting_title">'.$lang['google_2fa'].': '.Help::display('srv_google_2fa_options').'</span>';
- echo ' <label for="google-2fa"><input type="checkbox" name="google-2fa" id="google-2fa" value="1" '.(! empty($user_option) ? 'checked="checked"' : '').' onclick="prikaziGoogle2faKodo()"/>'.$lang['yes'].'</label>';
- echo ' </div>';
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" name="google-2fa" id="google-2fa" value="1" '.(! empty($user_option) ? 'checked="checked"' : '').' onclick="prikaziGoogle2faKodo()"/>';
+ echo '<label for="google-2fa">'.$lang['google_2fa'].' '.Help::display('srv_google_2fa_options').'</label>';
+ echo '</div>';
if (empty($user_option)) {
$google2fa = new \Sonata\GoogleAuthenticator\GoogleAuthenticator();
@@ -9479,56 +9967,89 @@ class SurveyAdminSettings {
echo '<div>'.$lang['google_2fa_admin_enabled'].'<b>'.$googleSecret.'</b></div>';
echo '<div style="padding-top: 10px;">'.$lang['google_2fa_admin_enabled_2'].'</div>';
echo '<input type="hidden" name="google-2fa-secret" value="'.$googleSecret.'">';
- echo '<div><img style="border: 0; padding:10px" src="'.$googleLink.'"/></div>';
- echo '<div>Ko boste shranili nastavitve, bo nastavitev obveljala.</div>';
+ echo '<div><img class="twoFAQRcode" src="'.$googleLink.'"/></div>';
+ echo '<div>'.$lang['google_2fa_admin_save_note'].'</div>';
echo '</div>';
- } elseif (! empty($user_option) && $user_option_validate == 'NOT') {
- echo '<div class="google-2fa-validate">';
- echo '<div style="padding:5px;">'.$lang['google_2fa_admin_validate'].'</div>';
- echo '<div style="display: block; clear: both;padding: 10px;"><input type="text" name="google-2fa-validate"></div>';
- echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="ponastaviGoogle2fa()">'.$lang['google_2fa_admin_test_code_reset'].'</a></div>';
- echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="aktivirajGoogle2fa()">'.$lang['google_2fa_admin_test_code'].'</a></div>';
-
- echo '<div id="google-2fa-bvestilo" style="font-style: italic;">'.$lang['google_2fa_user_error_code'].'</div>';
+ }
+ elseif (! empty($user_option) && $user_option_validate == 'NOT') {
+ echo '<div class="google-2fa-validate setting_holder">';
+
+ echo '<div>'.$lang['google_2fa_admin_validate'].'</div>';
+ echo '<div><input type="text" class="medium bottom8" name="google-2fa-validate"></div>';
+
+ echo '<div class="bottom8">';
+ echo ' <button type="button" class="small white-blue right8" onclick="ponastaviGoogle2fa()">'.$lang['google_2fa_admin_test_code_reset'].'</a></button>';
+ echo ' <button type="button" class="small blue" onclick="aktivirajGoogle2fa()">'.$lang['google_2fa_admin_test_code'].'</a></button>';
+ echo '</div>';
+
+ echo '<div id="google-2fa-bvestilo" style="font-style: italic; display: none;">'.$lang['google_2fa_user_error_code'].'</div>';
+
echo '</div>';
- } else {
- echo '<div class="google-2fa-deactivate" id="2fa-display" style="display: none;">';
- echo '<div style="padding:5px;">'.$lang['google_2fa_admin_deactivate'].'</div>';
- echo '<div style="display: block; clear: both;padding: 10px;"><input type="text" name="google-2fa-deactivate"></div>';
- echo '<div class="buttonwrapper floatLeft spaceLeft"><a href="#" class="ovalbutton btn_savesettings" onclick="deaktivirajGoogle2fa()">'.$lang['google_2fa_admin_deactivat_code'].'</a></div>';
- echo '<div id="google-2fa-bvestilo" style="font-style: italic;">'.$lang['google_2fa_user_error_code'].'</div>';
+ }
+ else {
+ echo '<div class="google-2fa-deactivate setting_holder" id="2fa-display" style="display: none;">';
+
+ echo '<div>'.$lang['google_2fa_admin_deactivate'].'</div>';
+ echo '<div><input type="text" class="medium bottom8" name="google-2fa-deactivate"></div>';
+
+ echo '<div class="bottom8">';
+ echo ' <button type="button" class="small blue" onclick="deaktivirajGoogle2fa()">'.$lang['google_2fa_admin_deactivat_code'].'</a></button>';
echo '</div>';
+
+ echo '<div id="google-2fa-bvestilo" style="font-style: italic; display: none;">'.$lang['google_2fa_user_error_code'].'</div>';
+
+ echo '</div>';
}
+
+ echo '<div class="button_holder below">';
+ echo ' <button type="button" class="medium red" onClick="izbrisi1kaRacun();">'.$lang['delete_account'].'</button>';
+ echo '</div>';
}
- echo ' </fieldset>';
-
- echo ' </form>';
-
+ echo '</fieldset>';
// Save gumb - ce ni AAI
- if(!$aai_instalacija){
-
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="izbrisi1kaRacun();"><span>'.$lang['delete_account'] . '</span></a></div>';
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="save1kaRacunSettings();"><span>'.$lang['edit1337'] . '</span></a></div>';
+ if(!isAAI()){
- echo '<span class="clr"></span>';
+ echo '<div class="button_holder">';
+ echo ' <button type="button" class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onclick="save1kaRacunSettings();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
// div za prikaz uspešnosti shranjevanja
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
-
- echo '<br /><br />';
}
+
+ echo '</form>';
+
+ echo '</div>';
+ }
+
+ function globalUserChangeArchive () {
+ global $lang, $global_user_id, $admin_type, $site_domain, $site_url;
+
+ // podatki prijavljenega uporabnika
+ $sql = sisplet_query("SELECT id, name, surname, email, type, gdpr_agree, last_login FROM users WHERE id = '$global_user_id'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<div id="anketa_edit">';
+
+ echo ' <form name="settingsanketa" id="form_profile_user_settings" action="ajax.php?a=editanketasettings&m=global_user_ChangeArchive" method="post" autocomplete="off">' . "\n\r";
+ echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n\r";
+ echo ' <input type="hidden" name="submited" value="1" />' . "\n\r";
// Tabela aktivnosti (prijav)
echo '<fieldset><legend>'.$lang['srv_login_tracking_title'].'</legend>';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+
echo '<table class="login_tracking">';
- echo '<tr><th>IP</th><th>'.$lang['srv_login_tracking_date'].'</th><th>'.$lang['srv_login_tracking_time'].'</th></tr>';
+ echo '<tr><th>IP</th><th>'.$lang['srv_login_tracking_date'].'</th></tr>';
$result = sisplet_query ("SELECT IP, kdaj FROM user_login_tracker WHERE uid='".$global_user_id."' ORDER BY kdaj desc");
if (mysqli_num_rows($result) == 0) {
@@ -9537,21 +10058,23 @@ class SurveyAdminSettings {
else {
$count = 0;
while ($row = mysqli_fetch_array ($result)) {
- echo '<tr '.($count >= 5 ? ' class="hide"' : '').'>';
+ echo '<tr '.($count >= 5 ? ' class="displayNone"' : '').($count == 4 ? ' class="show_as_last_row"' : '').'>';
echo '<td>'.$row['IP'].'</td>';
- echo '<td>'.date('j.n.Y', strtotime($row['kdaj'])).'</td>';
- echo '<td>'.date('H:i', strtotime($row['kdaj'])).'</td>';
+ echo '<td>'.date('j.n.Y', strtotime($row['kdaj'])).' '.date('H:i:s', strtotime($row['kdaj'])).'</td>';
echo '</tr>';
$count++;
}
}
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
- if(mysqli_num_rows($result) > 25){
- echo '<span class="login_tracking_more bold" onClick="$(\'table.login_tracking tr\').removeClass(\'hide\'); $(\'.login_tracking_more\').hide();">'.$lang['srv_invitation_nonActivated_more'].'</span>';
- echo '<br /><br />';
- }
+ //Gumb za izpis vseh prijav v tabeli - update v 2. fazi @TG
+ /**if(mysqli_num_rows($result) > 25){
+ echo '<span class="login_tracking_more bold" onClick="$(\'table.login_tracking tr\').removeClass(\'displayNone\'); $(\'.login_tracking_more\').addClass(\'displayNone\');">'.$lang['srv_invitation_nonActivated_more'].'</span>';
+ }**/
echo '</fieldset>';
@@ -9586,15 +10109,16 @@ class SurveyAdminSettings {
$lockSurvey = (int)UserSetting::getInstance()->getUserSetting('lockSurvey');
if ($admin_type == '0' || $admin_type == '1') {
- echo '<p>';
- echo '<label><input type="checkbox" onclick="changeSurveyLock(this)" '.($lockSurvey == 1 ? ' checked="checekd"' : '').'>';
- echo $lang['srv_survey_lock_note'];
- echo '</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo ' <input type="checkbox" id="change_survey_lock" onclick="changeSurveyLock(this)" '.($lockSurvey == 1 ? ' checked="checekd"' : '').'>';
+ echo ' <label for="change_survey_lock">';
+ echo $lang['srv_survey_lock_note'];
+ echo ' </label>';
+ echo '</div>';
}
if ((int)$lockSurvey > 0) {
- echo '<p class="small">'.$lang['srv_unlock_popup'].'</p>';
+ echo '<p class="top16">'.$lang['srv_unlock_popup'].'</p>';
}
}
@@ -9608,23 +10132,29 @@ class SurveyAdminSettings {
$msg = null;
$email_msg = $lang['srv_mail_test_smtp_test_success'];
$email_subject = $lang['srv_mail_test_smtp_test'];
+
+ $mailMode = $_REQUEST['SMTPMailMode'];
$MA = new MailAdapter($this->anketa);
-
$settings = $MA->getSettingsFromRequest($_REQUEST);
- $mailMode = $_REQUEST['SMTPMailMode'];
+ $SmailMode = $mailMode === 1 ? 'google' : 'smtp';
+ $settings_saved = $MA->getSettings($SmailMode);
-
- if (isset ($_COOKIE['uid'])) {
+ if ($mailMode == 1 || $mailMode == 2){
+ $email = $settings['SMTPFrom'];
+ }
+ else if (isset ($_COOKIE['uid'])) {
$email = base64_decode ($_COOKIE['uid']);
}
else {
$error = true;
$msg = $lang['srv_mail_test_smtp_mail_detect_error'];
}
-
- if (validEmail($email)){
+ $settings['SMTPPassword'] = empty($_REQUEST['SMTPPassword']) ? $settings_saved['SMTPPassword'] : $_REQUEST['SMTPPassword'];
+
+ if (validEmail($email)){
+
// preverimo password - ne sme bit prazen
if (($mailMode == 1 || $mailMode == 2) && empty($settings['SMTPPassword'])){ # password
$error = true;
@@ -9647,8 +10177,13 @@ class SurveyAdminSettings {
$error = true;
$msg = $lang['srv_mail_test_smtp_not_possible'];
}
- }
+ }
+
+ echo '<div id="divSurveySmtp">';
+ echo '<h2>'.$lang['srv_mail_test_smtp'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
// če imamo napake jo izpišemo
if ($error == true){
echo $lang['srv_mail_test_smtp_error'].': '. $msg;
@@ -9656,23 +10191,17 @@ class SurveyAdminSettings {
else{
echo $lang['srv_mail_test_smtp_sent'].': '.$email;
}
-
+
#vsebino shranimo v buffer
$content = ob_get_clean();
+
+ echo $content;
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="popupClose(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
- $popUp = new PopUp();
- #$popUp->setId('divSurveySmtp');
- $popUp->setHeaderText($lang['srv_mail_test_smtp']);
-
- #dodamo vsebino
- $popUp->setContent($content);
-
- # dodamo gumb Prekliči
- $button = new PopUpCancelButton();
- $button->setCaption($lang['srv_zapri'])->setTitle($lang['srv_zapri']);
- $popUp->addButton($button);
-
- echo $popUp;
+ echo '</div>';
}
}
?> \ No newline at end of file
diff --git a/admin/survey/ajax.php b/admin/survey/ajax.php
index 80cae5c..162d02e 100644
--- a/admin/survey/ajax.php
+++ b/admin/survey/ajax.php
@@ -14,6 +14,10 @@ if (isDebug()){
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', '1');
}
+else{
+ error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
+ ini_set('display_errors', '0');
+}
Common::start();
@@ -25,7 +29,7 @@ $surveySkin = 0;
// Naložimo jezikovno datoteko
-$anketa = $_REQUEST['anketa'];
+$anketa = $_REQUEST['anketa'] ?? null;
$lang_admin = 0;
if ($anketa > 0) {
$sql = sisplet_query("SELECT lang_admin FROM srv_anketa WHERE id = '$anketa'");
@@ -49,11 +53,17 @@ include($file);
$_SESSION['langX'] = $site_url .'lang/'.$lang_admin.'.php';
+$t = (isset($_GET['t'])) ? $_GET['t'] : '';
+$a = (isset($_GET['a'])) ? $_GET['a'] : '';
+$m = (isset($_GET['m'])) ? $_GET['m'] : '';
+$d = (isset($_GET['d'])) ? $_GET['d'] : '';
+
+
// preverimo dostop
$result = sisplet_query ("SELECT value FROM misc WHERE what='SurveyDostop'");
list ($SurveyDostop) = mysqli_fetch_row ($result);
-if ( (( ($admin_type <= $SurveyDostop && $SurveyDostop<3) || ($SurveyDostop==3) ) && ($admin_type>=0)) || $_GET['a']=='comment_manage' ) {
+if ( (( ($admin_type <= $SurveyDostop && $SurveyDostop<3) || ($SurveyDostop==3) ) && ($admin_type>=0)) || $a == 'comment_manage' ) {
// ok, bo slo naprej...
}
else {
@@ -67,94 +77,100 @@ $tracking_status = -1;
/**************** UREJANJE ****************/
-if ($_GET['t'] == 'branching') {
+if ($t == 'branching') {
$tracking_status = 0;
$b = new BranchingAjax($anketa);
$b->ajax();
}
-elseif ($_GET['t'] == 'quota') {
+elseif ($t == 'quota') {
$tracking_status = 0;
$SQ = new SurveyQuotas($anketa);
$SQ->ajax();
}
-elseif ($_GET['t'] == 'vprasanje') {
+elseif ($t == 'vprasanje') {
$tracking_status = 0;
$v = new Vprasanje();
$v->ajax();
}
-elseif ($_GET['t'] == 'vprasanjeinline') {
+elseif ($t == 'vprasanjeinline') {
$tracking_status = 0;
$v = new VprasanjeInline();
$v->ajax();
}
-elseif ($_GET['t'] == 'prevajanje') {
+elseif ($t == 'vprasanjeDeleted') {
+ $tracking_status = 0;
+
+ $vd = new VprasanjeDeleted($anketa);
+ $vd->ajax();
+}
+elseif ($t == 'prevajanje') {
$tracking_status = 0;
$p = new Prevajanje();
$p->ajax();
}
-elseif ($_GET['t'] == 'glasovanje') {
+elseif ($t == 'glasovanje') {
$tracking_status = 0;
$gl = new Glasovanje($anketa);
$gl->ajax();
}
-elseif ($_GET['t'] == 'missingValues') {
+elseif ($t == 'missingValues') {
$tracking_status = 0;
$smv = new SurveyMissingValues($anketa);
$smv->ajax();
}
-elseif ($_GET['t'] == 'quiz') {
+elseif ($t == 'quiz') {
$tracking_status = 0;
$sq = new SurveyQuiz($anketa);
$sq -> ajax();
}
-elseif ($_GET['t'] == 'theme') {
+elseif ($t == 'theme') {
$tracking_status = 0;
$diplayIframe = ($_POST['a'] == 'previewThemeIframe' ? false : true);
$st = new SurveyTheme($anketa,$diplayIframe);
$st->Ajax();
}
-elseif ($_GET['t'] == 'heatmapRadij') {
+elseif ($t == 'heatmapRadij') {
$tracking_status = 0;
$hmr = new SurveyHeatMapRadij();
$hmr->ajax() ;
}
-elseif ($_GET['t'] == 'getheatmapradij') {
+elseif ($t == 'getheatmapradij') {
$tracking_status = 0;
$hmgr = new SurveyGetHeatMapRadij();
$hmgr->ajax() ;
}
-elseif ($_GET['t'] == 'getheatmapexporticons') {
+elseif ($t == 'getheatmapexporticons') {
$tracking_status = 0;
$hmei = new SurveyHeatMapExportIcons();
$hmei->ajax() ;
}
-elseif ($_GET['t'] == 'saveHeatmapImage') {
+elseif ($t == 'saveHeatmapImage') {
$tracking_status = 0;
$hmis = new SurveyHeatMapImageSave();
$hmis->ajax() ;
}
-elseif ($_GET['t'] == 'themeEditor') {
+elseif ($t == 'themeEditor') {
$tracking_status = 0;
$te = new SurveyThemeEditor($anketa, true);
$te->ajax();
}
-elseif ($_GET['t'] == 'changeSurveyLock') {
+elseif ($t == 'changeSurveyLock') {
$tracking_status = 0;
if (isset($_POST['name']) && $_POST['name'] == 'lockSurvey') {
@@ -168,31 +184,31 @@ elseif ($_GET['t'] == 'changeSurveyLock') {
$sas = new SurveyAdminSettings();
$sas->showLockSurvey();
}
-elseif ($_GET['t'] == 'SurveyConnect') {
+elseif ($t == 'SurveyConnect') {
$tracking_status = 0;
$sc = new SurveyConnect();
$sc->ajax();
}
-elseif ($_GET['t'] == 'surveyCondition') {
+elseif ($t == 'surveyCondition') {
$tracking_status = 0;
$scp = new SurveyCondition($anketa);
$scp->ajax();
}
-elseif($_GET['t'] == 'checboxChangeTheme'){
+elseif($t == 'checboxChangeTheme'){
$tracking_status = 0;
$checkbox = new SurveyTheme($anketa);
$checkbox->Ajax();
}
-elseif($_GET['t'] == 'gdpr'){
+elseif($t == 'gdpr'){
$tracking_status = 0;
$gdpr = new GDPR();
$gdpr->ajax();
}
-elseif ($_GET['t'] == 'skupine') {
+elseif ($t == 'skupine') {
$tracking_status = 0;
$ss = new SurveySkupine($anketa);
@@ -202,76 +218,76 @@ elseif ($_GET['t'] == 'skupine') {
/**************** ANALIZE ****************/
-elseif ($_GET['t'] == A_ANALYSIS) {
+elseif ($t == A_ANALYSIS) {
$tracking_status = 2;
$a = new SurveyAnalysis();
$a->Init($anketa);
$a->ajax();
}
-elseif ($_GET['t'] == 'crosstab') {
+elseif ($t == 'crosstab') {
$tracking_status = 2;
$sc = new SurveyCrosstabs();
$sc -> Init($anketa);
$sc -> ajax();
}
-elseif ($_GET['t'] == 'multicrosstabs') {
+elseif ($t == 'multicrosstabs') {
$tracking_status = 2;
$smc = new SurveyMultiCrosstabs($anketa);
$smc -> ajax();
}
-elseif ($_GET['t'] == 'means') {
+elseif ($t == 'means') {
$tracking_status = 2;
$sm = new SurveyMeans($anketa);
$sm -> ajax();
}
-elseif ($_GET['t'] == 'ttest') {
+elseif ($t == 'ttest') {
$tracking_status = 2;
$stt = new SurveyTTest($anketa);
$stt -> ajax();
}
-elseif ($_GET['t'] == 'table_chart') {
+elseif ($t == 'table_chart') {
$tracking_status = 2;
$stc = new SurveyTableChart($anketa);
$stc -> ajax();
}
-elseif ($_GET['t'] == 'charts') {
+elseif ($t == 'charts') {
$tracking_status = 2;
$sc = new SurveyChart();
$sc -> Init($anketa);
$sc -> ajax();
}
-elseif ($_GET['t'] == 'zoom') {
+elseif ($t == 'zoom') {
$tracking_status = 2;
$sz = new SurveyZoom($anketa);
$sz -> ajax();
}
-elseif ($_GET['t'] == 'break') {
+elseif ($t == 'break') {
$tracking_status = 2;
$sb = new SurveyBreak($anketa);
$sb->ajax() ;
}
-elseif($_GET['t'] == 'analysisGorenje'){
+elseif($t == 'analysisGorenje'){
$tracking_status = 2;
$SAG = new SurveyAnalysisGorenje($anketa);
$SAG->ajax();
}
-elseif ($_GET['t'] == 'ParaAnalysis') {
+elseif ($t == 'ParaAnalysis') {
$tracking_status = 2;
$spa = new SurveyParaAnalysis($anketa);
$spa->ajax();
}
-elseif ($_GET['t'] == 'custom_report') {
+elseif ($t == 'custom_report') {
$tracking_status = 2;
$SCR = new SurveyCustomReport($anketa);
@@ -281,7 +297,7 @@ elseif ($_GET['t'] == 'custom_report') {
/**************** STATUS ****************/
-elseif ($_GET['t'] == 'dashboard') {
+elseif ($t == 'dashboard') {
$tracking_status = 3;
$ss = new SurveyStatistic();
@@ -292,62 +308,62 @@ elseif ($_GET['t'] == 'dashboard') {
/**************** PODATKI ****************/
-elseif ($_GET['t'] == 'postprocess') {
+elseif ($t == 'postprocess') {
$tracking_status = 4;
$spp = new SurveyPostProcess($anketa);
$spp->ajax();
}
-elseif ($_GET['t'] == 'advanced_paradata') {
+elseif ($t == 'advanced_paradata') {
$tracking_status = 4;
$sq = new SurveyAdvancedParadata($anketa);
$sq -> ajax();
}
-elseif ($_GET['t'] == 'recode') {
+elseif ($t == 'recode') {
$tracking_status = 4;
$SR = new SurveyRecoding($anketa);
$SR -> Ajax();
}
-elseif ($_GET['t'] == 'displayData') {
+elseif ($t == 'displayData') {
$tracking_status = 4;
$dd = new SurveyDataDisplay($anketa);
$dd->ajax() ;
}
-elseif ($_GET['t'] == 'dataFile') {
+elseif ($t == 'dataFile') {
$tracking_status = 4;
$SDF = SurveyDataFile::get_instance();
$SDF->init($anketa);
$SDF->ajax();
}
-elseif ($_GET['t'] == 'mapData') {
+elseif ($t == 'mapData') {
$tracking_status = 4;
$md = new SurveyMapData();
$md->mapData() ;
}
-elseif ($_GET['t'] == 'mapDataAll') {
+elseif ($t == 'mapDataAll') {
$tracking_status = 4;
$md = new SurveyMapData();
$md->mapDataAll() ;
}
-elseif ($_GET['t'] == 'heatmapData') {
+elseif ($t == 'heatmapData') {
$tracking_status = 4;
$hmd = new SurveyHeatMap();
$hmd->ajax() ;
}
-elseif ($_GET['t'] == 'heatmapBackgroundData') {
+elseif ($t == 'heatmapBackgroundData') {
$tracking_status = 4;
$hmbd = new SurveyHeatMapBackground();
$hmbd->ajax() ;
}
-elseif ($_GET['t'] == 'setDataView') {
+elseif ($t == 'setDataView') {
$tracking_status = 4;
if ($_POST['what'] != null && trim($_POST['what']) != '' && is_string($_POST['what'])){
@@ -364,25 +380,26 @@ elseif ($_GET['t'] == 'setDataView') {
SurveySession::append('data_view_settings','cur_rec_page','1');
}
}
-elseif ($_GET['t'] == 'surveyUsableResp') {
+elseif ($t == 'surveyUsableResp') {
$tracking_status = 4;
$sur = new SurveyUsableResp($anketa);
$sur->ajax();
}
-elseif($_GET['t'] == 'aaporCalculation'){
+elseif($t == 'aaporCalculation'){
$tracking_status = 4;
$ss = new SurveyStatistic();
$ss -> Init($anketa);
- if(!isset($_GET['m']))
+ if($m == ''){
$ss->DisplayAaporFullCalculation();
- else if(isset($_GET['m']) && $_GET['m'] == 'priblizek'){
+ }
+ else if($m == 'priblizek'){
$ss->DisplayAaporPriblizek();
}
}
-elseif ($_GET['t'] == 'appendMerge') {
+elseif ($t == 'appendMerge') {
$tracking_status = 4;
$am = new SurveyAppendMerge($anketa);
@@ -392,51 +409,51 @@ elseif ($_GET['t'] == 'appendMerge') {
/**************** OBJAVA ****************/
-elseif ($_GET['t'] == 'telephone') {
+elseif ($t == 'telephone') {
$tracking_status = 5;
$tp = new SurveyTelephone($anketa);
$tp->ajax();
}
-elseif ($_GET['t'] == 'invitations') {
+elseif ($t == 'invitations') {
$tracking_status = 5;
$SIN = new SurveyInvitationsNew($anketa);
$SIN -> ajax();
}
-elseif ($_GET['t'] == 'notifications') {
+elseif ($t == 'notifications') {
$tracking_status = 5;
$NO = new Notifications();
$NO->ajax();
}
-elseif ($_GET['t'] == 'simpleMailInvitation') {
+elseif ($t == 'simpleMailInvitation') {
$tracking_status = 5;
$SSMI = new SurveySimpleMailInvitation($anketa);
$SSMI -> ajax();
}
-elseif ($_GET['t'] == 'surveyBaseSetting') {
+elseif ($t == 'surveyBaseSetting') {
$tracking_status = 5;
$SBS = new SurveyBaseSetting($anketa);
$SBS -> ajax();
}
-elseif ($_GET['t'] == 'getSiteUrl') {
+elseif ($t == 'getSiteUrl') {
$tracking_status = 5;
$hmii = new GetSiteUrl();
$hmii->ajax() ;
}
-elseif($_GET['t'] == 'WPN'){
- if($_GET['a'] == 'wpn_send_notification'){
+elseif($t == 'WPN'){
+ if($a == 'wpn_send_notification'){
$tracking_status = 5;
$WPN = new WPN($anketa);
$WPN -> sendWebPushNotificationsToAll();
}
}
-elseif ($_GET['t'] == 'SurveyUrlLinks') {
+elseif ($t == 'SurveyUrlLinks') {
$tracking_status = 5;
$sul = new SurveyUrlLinks($anketa);
@@ -446,20 +463,20 @@ elseif ($_GET['t'] == 'SurveyUrlLinks') {
/**************** HIERARHIJA ****************/
-elseif ($_GET['t'] == 'hierarhy-means') {
+elseif ($t == 'hierarhy-means') {
$tracking_status = 6;
$sm = new HierarhijaAnalysis($anketa);
$sm -> ajax();
}
-elseif($_GET['t'] == 'hierarhija-ajax'){
+elseif($t == 'hierarhija-ajax'){
$tracking_status = 6;
$hierarhija = new \Hierarhija\HierarhijaAjax($anketa);
$hierarhija->ajax();
}
-elseif ($_GET['t'] == 'sa-uporabniki') {
+elseif ($t == 'sa-uporabniki') {
$tracking_status = 6;
if(!class_exists('Hierarhija\Ajax\AjaxHierarhijaDostopUporabnikovClass'))
@@ -467,23 +484,23 @@ elseif ($_GET['t'] == 'sa-uporabniki') {
$hierarhija_dostop = new Hierarhija\Ajax\AjaxHierarhijaDostopUporabnikovClass();
- if($_GET['a'] == 'add') {
+ if($a == 'add') {
$hierarhija_dostop->save();
}
- elseif($_GET['a'] == 'check'){
+ elseif($a == 'check'){
$hierarhija_dostop->checkUserEmail();
}
- elseif($_GET['a'] == 'delete'){
+ elseif($a == 'delete'){
$hierarhija_dostop->delete();
}
- elseif($_GET['a'] == 'edit') {
+ elseif($a == 'edit') {
$user_id = (!empty($_POST['id']) ? $_POST['id'] : null);
$hierarhija_dostop->popupNew($user_id);
}
- elseif($_GET['a'] == 'update') {
+ elseif($a == 'update') {
$hierarhija_dostop->update();
}
- elseif($_GET['a'] == 'show') {
+ elseif($a == 'show') {
$hierarhija_dostop->show();
}
else {
@@ -494,86 +511,105 @@ elseif ($_GET['t'] == 'sa-uporabniki') {
/**************** UPORABNIK ****************/
-elseif ($_GET['t'] == 'surveyList') {
+elseif ($t == 'surveyList') {
$SL = new SurveyList();
$SL->Ajax();
}
-elseif ($_GET['t'] == 'library') {
+elseif ($t == 'surveyListFolders') {
+ $SL = new SurveyListFolders();
+ $SL->ajax();
+}
+elseif ($t == 'library') {
$l = new Library();
$l->ajax();
}
-elseif ($_GET['t'] == 'help') {
+elseif ($t == 'libraryBranching') {
+ $lb = new LibraryBranching($anketa);
+ $lb->ajax();
+}
+elseif ($t == 'help') {
$h = new Help();
$h->ajax();
}
-elseif ($_GET['t'] == 'globalUserSettings') {
+elseif ($t == 'globalUserSettings') {
$sas = new SurveyAdminSettings();
$sas->setGlobalUserSetting();
}
-elseif($_GET['t'] == 'userAccess'){
+elseif($t == 'userAccess'){
$ua = UserAccess::getInstance($global_user_id);
$ua->ajax();
}
-elseif($_GET['t'] == 'userNarocila'){
+elseif($t == 'userNarocila'){
$UN = new UserNarocila();
$UN->ajax();
}
-elseif($_GET['t'] == 'userPlacila'){
+elseif($t == 'userPlacila'){
$UP = new UserPlacila();
$UP->ajax();
}
-elseif ($_GET['t'] == 'newSurvey') {
+elseif($t == 'domainChange'){
+ $usr_id = (isset($_POST['usr_id']) ? $_POST['usr_id'] : $global_user_id);
+
+ $dc = DomainChange::getInstance($usr_id);
+ $dc->ajax();
+}
+elseif ($t == 'newSurvey') {
$ns = new NewSurvey();
$ns->ajax();
}
-elseif ($_GET['a'] == 'user_tracking') {
- if($_GET['d'] == 'download'){
- return UserTrackingClass::init()->csvExport();
- }
+elseif ($a == 'user_tracking') {
+
+ if($d == 'download'){
+ return UserTrackingClass::init()->csvExport();
+ }
+}
+elseif ($t == 'archiveSurveys') {
+ $as = new ArchiveSurveys();
+ $as->ajax();
}
/**************** UPORABNIK - END ****************/
/**************** UNKNOWN, NAPREDNI MODULI ****************/
-elseif ($_GET['t'] == 'profileManager') {
+elseif ($t == 'profileManager') {
$tracking_status = -1;
$spm = new SurveyProfileManager();
$spm->ajax();
}
-elseif ($_GET['t'] == 'SurveyReminderTracking') {
+elseif ($t == 'SurveyReminderTracking') {
$tracking_status = -1;
$sur = new SurveyReminderTracking($anketa);
$sur->ajax();
}
-elseif ($_GET['t'] == 'inspect') {
+elseif ($t == 'inspect') {
$tracking_status = -1;
$SI = new SurveyInspect($anketa);
$SI -> ajax();
}
-elseif ($_GET['t'] == 'dostop') {
+elseif ($t == 'dostop') {
$tracking_status = -1;
$d = new Dostop();
$d->ajax();
}
-elseif ($_GET['t'] == 'missingProfiles') {
+elseif ($t == 'missingProfiles') {
$tracking_status = -1;
$smp = new SurveyMissingProfiles();
$smp->Init($anketa);
$smp->ajax();
}
-elseif ($_GET['t'] == 'statusProfile') {
+elseif ($t == 'statusProfile') {
$tracking_status = -1;
$ssp = new SurveyStatusProfiles();
$ssp -> Init($anketa);
$ssp->ajax();
}
-elseif ($_GET['t'] == 'timeProfile') {
+elseif ($t == 'timeProfile') {
global $global_user_id;
$tracking_status = -1;
@@ -582,7 +618,7 @@ elseif ($_GET['t'] == 'timeProfile') {
$tp -> Init($anketa,$global_user_id);
$tp -> ajax();
}
-elseif ($_GET['t'] == 'dataSettingProfile') {
+elseif ($t == 'dataSettingProfile') {
global $global_user_id;
$tracking_status = -1;
@@ -591,204 +627,217 @@ elseif ($_GET['t'] == 'dataSettingProfile') {
$dsp -> Init($anketa,$global_user_id);
$dsp -> ajax();
}
-elseif ($_GET['t'] == 'variableProfile') {
+elseif ($t == 'variableProfile') {
$tracking_status = -1;
$svp = new SurveyVariablesProfiles();
$svp -> Init($anketa,$global_user_id);
$svp->ajax();
}
-elseif ($_GET['t'] == 'export') {
+elseif ($t == 'export') {
$tracking_status = -1;
$se = new SurveyExport();
$se -> Init($anketa);
$se -> ajax();
}
-elseif ($_GET['t'] == 'conditionProfile') {
+elseif ($t == 'conditionProfile') {
$tracking_status = -1;
$scp = new SurveyConditionProfiles();
$scp -> Init($anketa,$global_user_id);
$scp -> ajax();
}
-elseif ($_GET['t'] == 'zankaProfile') {
+elseif ($t == 'zankaProfile') {
$tracking_status = -1;
$szp = new SurveyZankaProfiles();
$szp -> Init($anketa,$global_user_id);
$szp -> ajax();
}
-elseif ($_GET['t'] == 'slideshow') {
+elseif ($t == 'slideshow') {
$tracking_status = -1;
$ss = new SurveySlideshow($anketa);
$ss -> ajax();
}
-elseif ($_GET['t'] == 'chat') {
+elseif ($t == 'chat') {
$tracking_status = -1;
$sc = new SurveyChat($anketa);
$sc -> ajax();
}
-elseif ($_GET['t'] == 'panel') {
+elseif ($t == 'panel') {
$tracking_status = -1;
$sp = new SurveyPanel($anketa);
$sp -> ajax();
}
-elseif ($_GET['t'] == 'showTestSurveySMTP') {
+elseif ($t == 'email_access') {
+ $tracking_status = -1;
+
+ $sea = new SurveyEmailAccess($anketa);
+ $sea -> ajax();
+}
+elseif ($t == 'showTestSurveySMTP') {
$tracking_status = -1;
$sas = new SurveyAdminSettings();
$sas->ajax_showTestSurveySMTP();
}
-elseif ($_GET['t'] == 'evalvacija') {
+elseif ($t == 'evalvacija') {
$tracking_status = -1;
// UL EVALVACIJA
$eval = new Evalvacija($anketa);
$eval->ajax();
}
-elseif ($_GET['t'] == 'evoliTM') {
+elseif ($t == 'evoliTM') {
$tracking_status = -1;
// Evoli TeamMeter
$evoliTM = new SurveyTeamMeter($anketa);
$evoliTM->ajax();
}
+elseif ($t == 'kolektor') {
+ $tracking_status = -1;
+
+ // Modul za kolektor
+ $kolektor = new Kolektor();
+ $kolektor->ajax();
+}
/**************** UNKNOWN, NAPREDNI MODULI - END ****************/
/**************** MAZA ****************/
-elseif ($_GET['t'] == 'MAZA') {
+elseif ($t == 'MAZA') {
- if(isset($_GET['a'])){
+ if(isset($a)){
$anketa = $anketa;
- if($_GET['a'] == 'maza_send_notification'){
+ if($a == 'maza_send_notification'){
$tracking_status = 5;
$maza = new MAZA($anketa);
$maza->ajax_sendNotification();
}
- if($_GET['a'] == 'maza_send_notification_pwa'){
+ if($a == 'maza_send_notification_pwa'){
$tracking_status = 5;
$WPN = new WPN($anketa);
$WPN -> sendWebPushNotificationsToAll();
}
- else if($_GET['a'] == 'maza_on_off'){
+ else if($a == 'maza_on_off'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_maza_on_off();
}
- else if($_GET['a'] == 'maza_cancel_alarm'){
+ else if($a == 'maza_cancel_alarm'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_maza_cancel_alarm();
}
- else if($_GET['a'] == 'maza_generate_users'){
+ else if($a == 'maza_generate_users'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_maza_generate_users();
}
- else if($_GET['a'] == 'maza_survey_description'){
+ else if($a == 'maza_survey_description'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_maza_survey_description();
}
- else if($_GET['a'] == 'changeRepeatBy'){
+ else if($a == 'changeRepeatBy'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_changeRepeatBy();
}
- else if($_GET['a'] == 'changeTimeInDay'){
+ else if($a == 'changeTimeInDay'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_changeTimeInDay();
}
- else if($_GET['a'] == 'changeDayInWeek'){
+ else if($a == 'changeDayInWeek'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_changeDayInWeek();
}
- else if($_GET['a'] == 'changeEveryWhichDay'){
+ else if($a == 'changeEveryWhichDay'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_changeEveryWhichDay();
}
- else if($_GET['a'] == 'maza_save_repeater'){
+ else if($a == 'maza_save_repeater'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_saveRepeater();
}
- else if($_GET['a'] == 'cancelRepeater'){
+ else if($a == 'cancelRepeater'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_cancel_repeater();
}
- else if($_GET['a'] == 'insert_geofence'){
+ else if($a == 'insert_geofence'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_insert_geofence();
}
- else if($_GET['a'] == 'update_geofence'){
+ else if($a == 'update_geofence'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_update_geofence();
}
- else if($_GET['a'] == 'update_geofence_name'){
+ else if($a == 'update_geofence_name'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_update_geofence_name();
}
- else if($_GET['a'] == 'delete_geofence'){
+ else if($a == 'delete_geofence'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_delete_geofence();
}
- else if($_GET['a'] == 'get_all_geofences'){
+ else if($a == 'get_all_geofences'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->ajax_get_all_geofences();
}
- else if($_GET['a'] == 'maza_cancel_geofencing'){
+ else if($a == 'maza_cancel_geofencing'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_cancel_geofencing();
}
- else if($_GET['a'] == 'maza_run_geofences'){
+ else if($a == 'maza_run_geofences'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_run_geofences();
}
- else if($_GET['a'] == 'maza_cancel_entry'){
+ else if($a == 'maza_cancel_entry'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_cancel_entry();
}
- else if($_GET['a'] == 'maza_run_entry'){
+ else if($a == 'maza_run_entry'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_run_entry();
}
- else if($_GET['a'] == 'maza_run_activity'){
+ else if($a == 'maza_run_activity'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_run_activity();
}
- else if($_GET['a'] == 'maza_cancel_activity'){
+ else if($a == 'maza_cancel_activity'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_cancel_activity();
}
- else if($_GET['a'] == 'maza_run_tracking'){
+ else if($a == 'maza_run_tracking'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_run_tracking();
}
- else if($_GET['a'] == 'maza_cancel_tracking'){
+ else if($a == 'maza_cancel_tracking'){
$tracking_status = 0;
$maza = new MAZA($anketa);
$maza->maza_cancel_tracking();
@@ -808,7 +857,7 @@ else {
// Shranimo tracking
if($anketa != null && $anketa > 0){
- TrackingClass::update($anketa, $status);
+ TrackingClass::update($anketa, $tracking_status);
}
//nismo vezani na anketo, tracking uporabnika
else{
diff --git a/admin/survey/api/apidoc/index.html b/admin/survey/api/apidoc/index.html
index 5f04ded..9e81f37 100644
--- a/admin/survey/api/apidoc/index.html
+++ b/admin/survey/api/apidoc/index.html
@@ -1,669 +1,669 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <title>Loading...</title>
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
- <link href="vendor/prettify.css" rel="stylesheet" media="screen">
- <link href="css/style.css" rel="stylesheet" media="screen, print">
- <link href="img/favicon.ico" rel="icon" type="image/x-icon">
- <script src="vendor/polyfill.js"></script>
-</head>
-<body>
-
-<script id="template-sidenav" type="text/x-handlebars-template">
-<nav id="scrollingNav">
- <div class="sidenav-search">
- <input class="form-control search" type="text" placeholder="{{__ "Filter..."}}">
- <span class="search-reset">x</span>
- </div>
- <ul class="sidenav nav nav-list list">
- {{#each nav}}
- {{#if title}}
- {{#if isHeader}}
- {{#if isFixed}}
- <li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
- {{else}}
- <li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
- {{/if}}
- {{else}}
- <li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
- <a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
- </li>
- {{/if}}
- {{/if}}
- {{/each}}
- </ul>
-</nav>
-</script>
-
-<script id="template-project" type="text/x-handlebars-template">
- <div class="pull-left">
- <h1>{{name}}</h1>
- {{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
- </div>
- {{#if template.withCompare}}
- <div class="pull-right">
- <div class="btn-group">
- <button id="version" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown">
- <strong>{{version}}</strong>&nbsp;<span class="caret"></span>
- </button>
- <ul id="versions" class="dropdown-menu open-left">
- <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
- <li class="divider"></li>
- <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
- {{#each versions}}
- <li class="version"><a href="#">{{this}}</a></li>
- {{/each}}
- </ul>
- </div>
- </div>
- {{/if}}
- <div class="clearfix"></div>
-</script>
-
-<script id="template-header" type="text/x-handlebars-template">
- {{#if content}}
- <div id="api-_">{{{content}}}</div>
- {{/if}}
-</script>
-
-<script id="template-footer" type="text/x-handlebars-template">
- {{#if content}}
- <div id="api-_footer">{{{content}}}</div>
- {{/if}}
-</script>
-
-<script id="template-generator" type="text/x-handlebars-template">
- {{#if template.withGenerator}}
- {{#if generator}}
- <div class="content">
- {{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
- </div>
- {{/if}}
- {{/if}}
-</script>
-
-<script id="template-sections" type="text/x-handlebars-template">
- <section id="api-{{group}}">
- <h1>{{underscoreToSpace title}}</h1>
- {{#if description}}
- <p>{{{nl2br description}}}</p>
- {{/if}}
- {{#each articles}}
- <div id="api-{{group}}-{{name}}">
- {{{article}}}
- </div>
- {{/each}}
- </section>
-</script>
-
-<script id="template-article" type="text/x-handlebars-template">
- <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
- <div class="pull-left">
- <h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
- </div>
- {{#if template.withCompare}}
- <div class="pull-right">
- <div class="btn-group">
- <button class="version btn btn-default dropdown-toggle" data-toggle="dropdown">
- <strong>{{article.version}}</strong>&nbsp;<span class="caret"></span>
- </button>
- <ul class="versions dropdown-menu open-left">
- <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
- {{#each versions}}
- <li class="version"><a href="#">{{this}}</a></li>
- {{/each}}
- </ul>
- </div>
- </div>
- {{/if}}
- <div class="clearfix"></div>
-
- {{#if article.deprecated}}
- <p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
- {{{markdown article.deprecated.content}}}
- </p>
- {{/if}}
-
- {{#if article.description}}
- <p>{{{nl2br article.description}}}</p>
- {{/if}}
- <span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
- <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
-
- {{#if article.permission}}
- <p>
- {{__ "Permission:"}}
- {{#each article.permission}}
- {{name}}
- {{#if title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{/if}}
- {{/each}}
- </p>
- {{/if}}
-
- {{#if_gt article.examples.length compare=0}}
- <ul class="nav nav-tabs nav-tabs-examples">
- {{#each article.examples}}
- <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
- <a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
- </li>
- {{/each}}
- </ul>
-
- <div class="tab-content">
- {{#each article.examples}}
- <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}">
- <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre>
- </div>
- {{/each}}
- </div>
- {{/if_gt}}
-
- {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
- {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
- {{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
- {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
-
- {{subTemplate "article-sample-request" article=article id=id}}
- </article>
-</script>
-
-<script id="template-article-param-block" type="text/x-handlebars-template">
- {{#if params}}
- {{#each params.fields}}
- <h2>{{__ @key}}</h2>
- <table>
- <thead>
- <tr>
- <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
- {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
- <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
- </tr>
- </thead>
- <tbody>
- {{#each this}}
- <tr>
- <td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
- {{#if ../../_hasType}}
- <td>
- {{{type}}}
- </td>
- {{/if}}
- <td>
- {{{nl2br description}}}
- {{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
- {{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
- {{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
- {{#each allowedValues}}
- <code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
- {{/each}}
- </p>
- {{/if}}
- </td>
- </tr>
- {{/each}}
- </tbody>
- </table>
- {{/each}}
- {{#if_gt params.examples.length compare=0}}
- <ul class="nav nav-tabs nav-tabs-examples">
- {{#each params.examples}}
- <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
- <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
- </li>
- {{/each}}
- </ul>
-
- <div class="tab-content">
- {{#each params.examples}}
- <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
- <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{reformat content type}}</code></pre>
- </div>
- {{/each}}
- </div>
- {{/if_gt}}
- {{/if}}
-</script>
-
-<script id="template-article-sample-request" type="text/x-handlebars-template">
- {{#if article.sampleRequest}}
- <h2>{{__ "Send a Sample Request"}}</h2>
- <form class="form-horizontal">
- <fieldset>
- <div class="form-group">
- <label class="col-md-3 control-label" for="{{../id}}-sample-request-url"></label>
- <div class="input-group">
- <input id="{{../id}}-sample-request-url" type="text" class="form-control sample-request-url" value="{{article.sampleRequest.0.url}}" />
- <span class="input-group-addon">{{__ "url"}}</span>
- </div>
- </div>
-
- {{#if article.header}}
- {{#if article.header.fields}}
- <h3>{{__ "Headers"}}</h3>
- {{#each article.header.fields}}
- <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
- <div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
- {{#each this}}
- <div class="form-group">
- <label class="col-md-3 control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
- <div class="input-group">
- <input type="text" placeholder="{{field}}" id="sample-request-header-field-{{field}}" class="form-control sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
- <span class="input-group-addon">{{{type}}}</span>
- </div>
- </div>
- {{/each}}
- </div>
- {{/each}}
- {{/if}}
- {{/if}}
-
- {{#if article.parameter}}
- {{#if article.parameter.fields}}
- <h3>{{__ "Parameters"}}</h3>
- {{#each article.parameter.fields}}
- <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
- <div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
- {{#each this}}
- <label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
- <div class="input-group">
- <input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
- <div class="input-group-addon">{{{type}}}</div>
- </div>
- {{/each}}
- </div>
- {{/each}}
- {{/if}}
- {{/if}}
-
- <div class="form-group">
- <div class="controls pull-right">
- <button class="btn btn-primary sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
- </div>
- </div>
- <div class="form-group sample-request-response" style="display: none;">
- <h3>
- {{__ "Response"}}
- <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
- </h3>
- <pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre>
- </div>
- </fieldset>
- </form>
- {{/if}}
-</script>
-
-<script id="template-compare-article" type="text/x-handlebars-template">
- <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
- <div class="pull-left">
- <h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
- </div>
-
- <div class="pull-right">
- <div class="btn-group">
- <button class="btn btn-success" disabled>
- <strong>{{article.version}}</strong> {{__ "compared to"}}
- </button>
- <button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
- <strong>{{compare.version}}</strong>&nbsp;<span class="caret"></span>
- </button>
- <ul class="versions dropdown-menu open-left">
- <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
- <li class="divider"></li>
- {{#each versions}}
- <li class="version"><a href="#">{{this}}</a></li>
- {{/each}}
- </ul>
- </div>
- </div>
- <div class="clearfix"></div>
-
- {{#if article.description}}
- <p>{{{showDiff article.description compare.description "nl2br"}}}</p>
- {{else}}
- {{#if compare.description}}
- <p>{{{showDiff "" compare.description "nl2br"}}}</p>
- {{/if}}
- {{/if}}
-
- <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre>
-
- {{subTemplate "article-compare-permission" article=article compare=compare}}
-
- <ul class="nav nav-tabs nav-tabs-examples">
- {{#each_compare_title article.examples compare.examples}}
- {{#if typeSame}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
- </li>
- {{/if}}
-
- {{#if typeIns}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
- </li>
- {{/if}}
-
- {{#if typeDel}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
- </li>
- {{/if}}
- {{/each_compare_title}}
- </ul>
-
- <div class="tab-content">
- {{#each_compare_title article.examples compare.examples}}
-
- {{#if typeSame}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
- </div>
- {{/if}}
-
- {{#if typeIns}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
- </div>
- {{/if}}
-
- {{#if typeDel}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
- </div>
- {{/if}}
-
- {{/each_compare_title}}
- </div>
-
- {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
- {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
- {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
-
- {{subTemplate "article-sample-request" article=article id=id}}
-
- </article>
-</script>
-
-<script id="template-article-compare-permission" type="text/x-handlebars-template">
- <p>
- {{__ "Permission:"}}
- {{#each_compare_list_field article.permission compare.permission field="name"}}
- {{#if source}}
- {{#if typeSame}}
- {{source.name}}
- {{#if source.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
-
- {{#if typeIns}}
- <ins>{{source.name}}</ins>
- {{#if source.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
-
- {{#if typeDel}}
- <del>{{source.name}}</del>
- {{#if source.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
- {{else}}
- {{#if typeSame}}
- {{compare.name}}
- {{#if compare.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
-
- {{#if typeIns}}
- <ins>{{compare.name}}</ins>
- {{#if compare.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
-
- {{#if typeDel}}
- <del>{{compare.name}}</del>
- {{#if compare.title}}
- <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
- <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
- </button>
- {{#unless _last}}, {{/unless}}
- {{/if}}
- {{/if}}
- {{/if}}
- {{/each_compare_list_field}}
- </p>
-</script>
-
-<script id="template-article-compare-param-block" type="text/x-handlebars-template">
- {{#if source}}
- {{#each_compare_keys source.fields compare.fields}}
- {{#if typeSame}}
- <h2>{{__ source.key}}</h2>
- <table>
- <thead>
- <tr>
- <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
- {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
- <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
- </tr>
- </thead>
- {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
- </table>
- {{/if}}
-
- {{#if typeIns}}
- <h2><ins>{{__ source.key}}</ins></h2>
- <table class="ins">
- <thead>
- <tr>
- <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
- {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
- <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
- </tr>
- </thead>
- {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
- </table>
- {{/if}}
-
- {{#if typeDel}}
- <h2><del>{{__ compare.key}}</del></h2>
- <table class="del">
- <thead>
- <tr>
- <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
- {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
- <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
- </tr>
- </thead>
- {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
- </table>
- {{/if}}
- {{/each_compare_keys}}
-
- {{#if source.examples}}
- <ul class="nav nav-tabs nav-tabs-examples">
- {{#each_compare_title source.examples compare.examples}}
- {{#if typeSame}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
- </li>
- {{/if}}
-
- {{#if typeIns}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
- </li>
- {{/if}}
-
- {{#if typeDel}}
- <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
- <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
- </li>
- {{/if}}
- {{/each_compare_title}}
- </ul>
-
- <div class="tab-content">
- {{#each_compare_title source.examples compare.examples}}
-
- {{#if typeSame}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
- </div>
- {{/if}}
-
- {{#if typeIns}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
- </div>
- {{/if}}
-
- {{#if typeDel}}
- <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
- <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
- </div>
- {{/if}}
- {{/each_compare_title}}
- </div>
- {{/if}}
- {{/if}}
-</script>
-
-<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
- <tbody>
- {{#each_compare_field source compare}}
- {{#if typeSame}}
- <tr>
- <td class="code">
- {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
- {{#if source.optional}}
- {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
- {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
- {{/if}}
- {{else}}
- {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
- {{/if}}
- </td>
-
- {{#if source.type}}
- {{#if compare.type}}
- <td>{{{showDiff source.type compare.type}}}</td>
- {{else}}
- <td>{{{source.type}}}</td>
- {{/if}}
- {{else}}
- {{#if compare.type}}
- <td>{{{compare.type}}}</td>
- {{else}}
- {{#if ../../../../_hasType}}<td></td>{{/if}}
- {{/if}}
- {{/if}}
- <td>
- {{{showDiff source.description compare.description "nl2br"}}}
- {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
- </td>
- </tr>
- {{/if}}
-
- {{#if typeIns}}
- <tr class="ins">
- <td class="code">
- {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
- {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
- </td>
-
- {{#if source.type}}
- <td>{{{source.type}}}</td>
- {{else}}
- {{{typRowTd}}}
- {{/if}}
-
- <td>
- {{{nl2br source.description}}}
- {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
- </td>
- </tr>
- {{/if}}
-
- {{#if typeDel}}
- <tr class="del">
- <td class="code">
- {{{splitFill compare.field "." "&nbsp;&nbsp;"}}}
- {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
- </td>
-
- {{#if compare.type}}
- <td>{{{compare.type}}}</td>
- {{else}}
- {{{typRowTd}}}
- {{/if}}
-
- <td>
- {{{nl2br compare.description}}}
- {{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
- </td>
- </tr>
- {{/if}}
-
- {{/each_compare_field}}
- </tbody>
-</script>
-
-<div class="container-fluid">
- <div class="row">
- <div id="sidenav" class="span2"></div>
- <div id="content">
- <div id="project"></div>
- <div id="header"></div>
- <div id="sections"></div>
- <div id="footer"></div>
- <div id="generator"></div>
- </div>
- </div>
-</div>
-
-<div id="loader">
- <div class="spinner">
- <div class="spinner-container container1">
- <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
- </div>
- <div class="spinner-container container2">
- <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
- </div>
- <div class="spinner-container container3">
- <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
- </div>
- <p>Loading...</p>
- </div>
-</div>
-
-<script data-main="main.js" src="vendor/require.min.js"></script>
-</body>
-</html>
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <title>Loading...</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <link href="vendor/bootstrap.min.css" rel="stylesheet" media="screen">
+ <link href="vendor/prettify.css" rel="stylesheet" media="screen">
+ <link href="css/style.css" rel="stylesheet" media="screen, print">
+ <link href="img/favicon.ico" rel="icon" type="image/x-icon">
+ <script src="vendor/polyfill.js"></script>
+</head>
+<body>
+
+<script id="template-sidenav" type="text/x-handlebars-template">
+<nav id="scrollingNav">
+ <div class="sidenav-search">
+ <input class="form-control search" type="text" placeholder="{{__ "Filter..."}}">
+ <span class="search-reset">x</span>
+ </div>
+ <ul class="sidenav nav nav-list list">
+ {{#each nav}}
+ {{#if title}}
+ {{#if isHeader}}
+ {{#if isFixed}}
+ <li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
+ {{else}}
+ <li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
+ {{/if}}
+ {{else}}
+ <li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
+ <a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
+ </li>
+ {{/if}}
+ {{/if}}
+ {{/each}}
+ </ul>
+</nav>
+</script>
+
+<script id="template-project" type="text/x-handlebars-template">
+ <div class="pull-left">
+ <h1>{{name}}</h1>
+ {{#if description}}<h2>{{{nl2br description}}}</h2>{{/if}}
+ </div>
+ {{#if template.withCompare}}
+ <div class="pull-right">
+ <div class="btn-group">
+ <button id="version" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown">
+ <strong>{{version}}</strong>&nbsp;<span class="caret"></span>
+ </button>
+ <ul id="versions" class="dropdown-menu open-left">
+ <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
+ <li class="divider"></li>
+ <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
+ {{#each versions}}
+ <li class="version"><a href="#">{{this}}</a></li>
+ {{/each}}
+ </ul>
+ </div>
+ </div>
+ {{/if}}
+ <div class="clearfix"></div>
+</script>
+
+<script id="template-header" type="text/x-handlebars-template">
+ {{#if content}}
+ <div id="api-_">{{{content}}}</div>
+ {{/if}}
+</script>
+
+<script id="template-footer" type="text/x-handlebars-template">
+ {{#if content}}
+ <div id="api-_footer">{{{content}}}</div>
+ {{/if}}
+</script>
+
+<script id="template-generator" type="text/x-handlebars-template">
+ {{#if template.withGenerator}}
+ {{#if generator}}
+ <div class="content">
+ {{__ "Generated with"}} <a href="{{{generator.url}}}">{{{generator.name}}}</a> {{{generator.version}}} - {{{generator.time}}}
+ </div>
+ {{/if}}
+ {{/if}}
+</script>
+
+<script id="template-sections" type="text/x-handlebars-template">
+ <section id="api-{{group}}">
+ <h1>{{underscoreToSpace title}}</h1>
+ {{#if description}}
+ <p>{{{nl2br description}}}</p>
+ {{/if}}
+ {{#each articles}}
+ <div id="api-{{group}}-{{name}}">
+ {{{article}}}
+ </div>
+ {{/each}}
+ </section>
+</script>
+
+<script id="template-article" type="text/x-handlebars-template">
+ <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}">
+ <div class="pull-left">
+ <h1>{{article.groupTitle}}{{#if article.title}} - {{article.title}}{{/if}}</h1>
+ </div>
+ {{#if template.withCompare}}
+ <div class="pull-right">
+ <div class="btn-group">
+ <button class="version btn btn-default dropdown-toggle" data-toggle="dropdown">
+ <strong>{{article.version}}</strong>&nbsp;<span class="caret"></span>
+ </button>
+ <ul class="versions dropdown-menu open-left">
+ <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
+ {{#each versions}}
+ <li class="version"><a href="#">{{this}}</a></li>
+ {{/each}}
+ </ul>
+ </div>
+ </div>
+ {{/if}}
+ <div class="clearfix"></div>
+
+ {{#if article.deprecated}}
+ <p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
+ {{{markdown article.deprecated.content}}}
+ </p>
+ {{/if}}
+
+ {{#if article.description}}
+ <p>{{{nl2br article.description}}}</p>
+ {{/if}}
+ <span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
+ <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
+
+ {{#if article.permission}}
+ <p>
+ {{__ "Permission:"}}
+ {{#each article.permission}}
+ {{name}}
+ {{#if title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{/if}}
+ {{/each}}
+ </p>
+ {{/if}}
+
+ {{#if_gt article.examples.length compare=0}}
+ <ul class="nav nav-tabs nav-tabs-examples">
+ {{#each article.examples}}
+ <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
+ <a href="#examples-{{../id}}-{{@index}}">{{title}}</a>
+ </li>
+ {{/each}}
+ </ul>
+
+ <div class="tab-content">
+ {{#each article.examples}}
+ <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="examples-{{../id}}-{{@index}}">
+ <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{content}}</code></pre>
+ </div>
+ {{/each}}
+ </div>
+ {{/if_gt}}
+
+ {{subTemplate "article-param-block" params=article.header _hasType=_hasTypeInHeaderFields section="header"}}
+ {{subTemplate "article-param-block" params=article.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
+ {{subTemplate "article-param-block" params=article.success _hasType=_hasTypeInSuccessFields section="success"}}
+ {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
+
+ {{subTemplate "article-sample-request" article=article id=id}}
+ </article>
+</script>
+
+<script id="template-article-param-block" type="text/x-handlebars-template">
+ {{#if params}}
+ {{#each params.fields}}
+ <h2>{{__ @key}}</h2>
+ <table>
+ <thead>
+ <tr>
+ <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+ {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+ <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each this}}
+ <tr>
+ <td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
+ {{#if ../../_hasType}}
+ <td>
+ {{{type}}}
+ </td>
+ {{/if}}
+ <td>
+ {{{nl2br description}}}
+ {{#if defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{defaultValue}}}</code></p>{{/if}}
+ {{#if size}}<p class="type-size">{{__ "Size range:"}} <code>{{{size}}}</code></p>{{/if}}
+ {{#if allowedValues}}<p class="type-size">{{__ "Allowed values:"}}
+ {{#each allowedValues}}
+ <code>{{{this}}}</code>{{#unless @last}}, {{/unless}}
+ {{/each}}
+ </p>
+ {{/if}}
+ </td>
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ {{/each}}
+ {{#if_gt params.examples.length compare=0}}
+ <ul class="nav nav-tabs nav-tabs-examples">
+ {{#each params.examples}}
+ <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
+ <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
+ </li>
+ {{/each}}
+ </ul>
+
+ <div class="tab-content">
+ {{#each params.examples}}
+ <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
+ <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{reformat content type}}</code></pre>
+ </div>
+ {{/each}}
+ </div>
+ {{/if_gt}}
+ {{/if}}
+</script>
+
+<script id="template-article-sample-request" type="text/x-handlebars-template">
+ {{#if article.sampleRequest}}
+ <h2>{{__ "Send a Sample Request"}}</h2>
+ <form class="form-horizontal">
+ <fieldset>
+ <div class="form-group">
+ <label class="col-md-3 control-label" for="{{../id}}-sample-request-url"></label>
+ <div class="input-group">
+ <input id="{{../id}}-sample-request-url" type="text" class="form-control sample-request-url" value="{{article.sampleRequest.0.url}}" />
+ <span class="input-group-addon">{{__ "url"}}</span>
+ </div>
+ </div>
+
+ {{#if article.header}}
+ {{#if article.header.fields}}
+ <h3>{{__ "Headers"}}</h3>
+ {{#each article.header.fields}}
+ <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
+ <div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
+ {{#each this}}
+ <div class="form-group">
+ <label class="col-md-3 control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
+ <div class="input-group">
+ <input type="text" placeholder="{{field}}" id="sample-request-header-field-{{field}}" class="form-control sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
+ <span class="input-group-addon">{{{type}}}</span>
+ </div>
+ </div>
+ {{/each}}
+ </div>
+ {{/each}}
+ {{/if}}
+ {{/if}}
+
+ {{#if article.parameter}}
+ {{#if article.parameter.fields}}
+ <h3>{{__ "Parameters"}}</h3>
+ {{#each article.parameter.fields}}
+ <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}" name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
+ <div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
+ {{#each this}}
+ <label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
+ <div class="input-group">
+ <input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
+ <div class="input-group-addon">{{{type}}}</div>
+ </div>
+ {{/each}}
+ </div>
+ {{/each}}
+ {{/if}}
+ {{/if}}
+
+ <div class="form-group">
+ <div class="controls pull-right">
+ <button class="btn btn-primary sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
+ </div>
+ </div>
+ <div class="form-group sample-request-response" style="display: none;">
+ <h3>
+ {{__ "Response"}}
+ <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
+ </h3>
+ <pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre>
+ </div>
+ </fieldset>
+ </form>
+ {{/if}}
+</script>
+
+<script id="template-compare-article" type="text/x-handlebars-template">
+ <article id="api-{{article.group}}-{{article.name}}-{{article.version}}" {{#if hidden}}class="hide"{{/if}} data-group="{{article.group}}" data-name="{{article.name}}" data-version="{{article.version}}" data-compare-version="{{compare.version}}">
+ <div class="pull-left">
+ <h1>{{underscoreToSpace article.group}} - {{{showDiff article.title compare.title}}}</h1>
+ </div>
+
+ <div class="pull-right">
+ <div class="btn-group">
+ <button class="btn btn-success" disabled>
+ <strong>{{article.version}}</strong> {{__ "compared to"}}
+ </button>
+ <button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
+ <strong>{{compare.version}}</strong>&nbsp;<span class="caret"></span>
+ </button>
+ <ul class="versions dropdown-menu open-left">
+ <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
+ <li class="divider"></li>
+ {{#each versions}}
+ <li class="version"><a href="#">{{this}}</a></li>
+ {{/each}}
+ </ul>
+ </div>
+ </div>
+ <div class="clearfix"></div>
+
+ {{#if article.description}}
+ <p>{{{showDiff article.description compare.description "nl2br"}}}</p>
+ {{else}}
+ {{#if compare.description}}
+ <p>{{{showDiff "" compare.description "nl2br"}}}</p>
+ {{/if}}
+ {{/if}}
+
+ <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{{showDiff article.url compare.url}}}</code></pre>
+
+ {{subTemplate "article-compare-permission" article=article compare=compare}}
+
+ <ul class="nav nav-tabs nav-tabs-examples">
+ {{#each_compare_title article.examples compare.examples}}
+ {{#if typeSame}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
+ </li>
+ {{/if}}
+
+ {{#if typeIns}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
+ </li>
+ {{/if}}
+
+ {{#if typeDel}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
+ </li>
+ {{/if}}
+ {{/each_compare_title}}
+ </ul>
+
+ <div class="tab-content">
+ {{#each_compare_title article.examples compare.examples}}
+
+ {{#if typeSame}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
+ </div>
+ {{/if}}
+
+ {{#if typeIns}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
+ </div>
+ {{/if}}
+
+ {{#if typeDel}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
+ </div>
+ {{/if}}
+
+ {{/each_compare_title}}
+ </div>
+
+ {{subTemplate "article-compare-param-block" source=article.parameter compare=compare.parameter _hasType=_hasTypeInParameterFields section="parameter"}}
+ {{subTemplate "article-compare-param-block" source=article.success compare=compare.success _hasType=_hasTypeInSuccessFields section="success"}}
+ {{subTemplate "article-compare-param-block" source=article.error compare=compare.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
+
+ {{subTemplate "article-sample-request" article=article id=id}}
+
+ </article>
+</script>
+
+<script id="template-article-compare-permission" type="text/x-handlebars-template">
+ <p>
+ {{__ "Permission:"}}
+ {{#each_compare_list_field article.permission compare.permission field="name"}}
+ {{#if source}}
+ {{#if typeSame}}
+ {{source.name}}
+ {{#if source.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+
+ {{#if typeIns}}
+ <ins>{{source.name}}</ins>
+ {{#if source.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+
+ {{#if typeDel}}
+ <del>{{source.name}}</del>
+ {{#if source.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+ {{else}}
+ {{#if typeSame}}
+ {{compare.name}}
+ {{#if compare.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+
+ {{#if typeIns}}
+ <ins>{{compare.name}}</ins>
+ {{#if compare.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+
+ {{#if typeDel}}
+ <del>{{compare.name}}</del>
+ {{#if compare.title}}
+ <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+ <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+ </button>
+ {{#unless _last}}, {{/unless}}
+ {{/if}}
+ {{/if}}
+ {{/if}}
+ {{/each_compare_list_field}}
+ </p>
+</script>
+
+<script id="template-article-compare-param-block" type="text/x-handlebars-template">
+ {{#if source}}
+ {{#each_compare_keys source.fields compare.fields}}
+ {{#if typeSame}}
+ <h2>{{__ source.key}}</h2>
+ <table>
+ <thead>
+ <tr>
+ <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+ {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+ <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+ </tr>
+ </thead>
+ {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
+ </table>
+ {{/if}}
+
+ {{#if typeIns}}
+ <h2><ins>{{__ source.key}}</ins></h2>
+ <table class="ins">
+ <thead>
+ <tr>
+ <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+ {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+ <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+ </tr>
+ </thead>
+ {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
+ </table>
+ {{/if}}
+
+ {{#if typeDel}}
+ <h2><del>{{__ compare.key}}</del></h2>
+ <table class="del">
+ <thead>
+ <tr>
+ <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+ {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+ <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+ </tr>
+ </thead>
+ {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
+ </table>
+ {{/if}}
+ {{/each_compare_keys}}
+
+ {{#if source.examples}}
+ <ul class="nav nav-tabs nav-tabs-examples">
+ {{#each_compare_title source.examples compare.examples}}
+ {{#if typeSame}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
+ </li>
+ {{/if}}
+
+ {{#if typeIns}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><ins>{{{source.title}}}</ins></a>
+ </li>
+ {{/if}}
+
+ {{#if typeDel}}
+ <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
+ <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
+ </li>
+ {{/if}}
+ {{/each_compare_title}}
+ </ul>
+
+ <div class="tab-content">
+ {{#each_compare_title source.examples compare.examples}}
+
+ {{#if typeSame}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{showDiff source.content compare.content}}}</code></pre>
+ </div>
+ {{/if}}
+
+ {{#if typeIns}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{source.type}}"><code>{{{source.content}}}</code></pre>
+ </div>
+ {{/if}}
+
+ {{#if typeDel}}
+ <div class="tab-pane{{#if_eq index compare=0}} active{{/if_eq}}" id="{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">
+ <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
+ </div>
+ {{/if}}
+ {{/each_compare_title}}
+ </div>
+ {{/if}}
+ {{/if}}
+</script>
+
+<script id="template-article-compare-param-block-body" type="text/x-handlebars-template">
+ <tbody>
+ {{#each_compare_field source compare}}
+ {{#if typeSame}}
+ <tr>
+ <td class="code">
+ {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
+ {{#if source.optional}}
+ {{#if compare.optional}} <span class="label label-optional">{{__ "optional"}}</span>
+ {{else}} <span class="label label-optional label-ins">{{__ "optional"}}</span>
+ {{/if}}
+ {{else}}
+ {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
+ {{/if}}
+ </td>
+
+ {{#if source.type}}
+ {{#if compare.type}}
+ <td>{{{showDiff source.type compare.type}}}</td>
+ {{else}}
+ <td>{{{source.type}}}</td>
+ {{/if}}
+ {{else}}
+ {{#if compare.type}}
+ <td>{{{compare.type}}}</td>
+ {{else}}
+ {{#if ../../../../_hasType}}<td></td>{{/if}}
+ {{/if}}
+ {{/if}}
+ <td>
+ {{{showDiff source.description compare.description "nl2br"}}}
+ {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{showDiff source.defaultValue compare.defaultValue}}}</code><p>{{/if}}
+ </td>
+ </tr>
+ {{/if}}
+
+ {{#if typeIns}}
+ <tr class="ins">
+ <td class="code">
+ {{{splitFill source.field "." "&nbsp;&nbsp;"}}}
+ {{#if source.optional}} <span class="label label-optional label-ins">{{__ "optional"}}</span>{{/if}}
+ </td>
+
+ {{#if source.type}}
+ <td>{{{source.type}}}</td>
+ {{else}}
+ {{{typRowTd}}}
+ {{/if}}
+
+ <td>
+ {{{nl2br source.description}}}
+ {{#if source.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{source.defaultValue}}}</code><p>{{/if}}
+ </td>
+ </tr>
+ {{/if}}
+
+ {{#if typeDel}}
+ <tr class="del">
+ <td class="code">
+ {{{splitFill compare.field "." "&nbsp;&nbsp;"}}}
+ {{#if compare.optional}} <span class="label label-optional label-del">{{__ "optional"}}</span>{{/if}}
+ </td>
+
+ {{#if compare.type}}
+ <td>{{{compare.type}}}</td>
+ {{else}}
+ {{{typRowTd}}}
+ {{/if}}
+
+ <td>
+ {{{nl2br compare.description}}}
+ {{#if compare.defaultValue}}<p class="default-value">{{__ "Default value:"}} <code>{{{compare.defaultValue}}}</code><p>{{/if}}
+ </td>
+ </tr>
+ {{/if}}
+
+ {{/each_compare_field}}
+ </tbody>
+</script>
+
+<div class="container-fluid">
+ <div class="row">
+ <div id="sidenav" class="span2"></div>
+ <div id="content">
+ <div id="project"></div>
+ <div id="header"></div>
+ <div id="sections"></div>
+ <div id="footer"></div>
+ <div id="generator"></div>
+ </div>
+ </div>
+</div>
+
+<div id="loader">
+ <div class="spinner">
+ <div class="spinner-container container1">
+ <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
+ </div>
+ <div class="spinner-container container2">
+ <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
+ </div>
+ <div class="spinner-container container3">
+ <div class="circle1"></div><div class="circle2"></div><div class="circle3"></div><div class="circle4"></div>
+ </div>
+ <p>Loading...</p>
+ </div>
+</div>
+
+<script data-main="main.js" src="vendor/require.min.js"></script>
+</body>
+</html>
diff --git a/admin/survey/api/class.ApiController.php b/admin/survey/api/class.ApiController.php
index b35d867..40028d7 100644
--- a/admin/survey/api/class.ApiController.php
+++ b/admin/survey/api/class.ApiController.php
@@ -121,11 +121,10 @@ class ApiController{
// TUKAJ PRIDE DODATEN POGOJ CE GRE ZA PRIJAVO PREKO GOOGLA, FB... - V TEM PRIMERU NIMAMO PASSWORDA
if(!isset($this->data['Login']['password']) && isset($this->data['Login']['special_login'])){
- global $APP_special_login_key;
// DODATI FUNKCIJO checkSpecialLogin v SurveyMobile, kjer se pogleda samo če obstaja mail in nastavi ustrezno user id
if($this->data['Login']['special_login'] == 'nekajzavsakslucajv4x7in6' ||
- $this->data['Login']['special_login'] == $APP_special_login_key){
+ $this->data['Login']['special_login'] == AppSettings::getInstance()->getSetting('maza-APP_special_login_key')){
$user_id = $sm->googleLogin($this->data['Login']['username']);
}
}
diff --git a/admin/survey/api/class.ApiSurvey.php b/admin/survey/api/class.ApiSurvey.php
index 36b8d85..a589358 100644
--- a/admin/survey/api/class.ApiSurvey.php
+++ b/admin/survey/api/class.ApiSurvey.php
@@ -363,6 +363,65 @@ class ApiSurvey {
break;
+ // SAMO ZA GORANA - PLACILA
+ case 'getNarocilo':
+
+ // Klic dovolimo samo Goranu
+ if($global_user_id == '112696'){
+
+ if (isset($params['narocilo_id'])){
+ $narocilo = new UserNarocila();
+ $json_array = $narocilo->getNarocilo($params['narocilo_id']);
+ }
+ else{
+ $json_array['error'] = 'Narocilo ID is missing';
+ }
+ }
+ else{
+ $json_array['error'] = 'Denied for user '.$global_user_id;
+ }
+
+ break;
+
+ case 'placajNarocilo':
+
+ // Klic dovolimo samo Goranu
+ if($global_user_id == '112696'){
+
+ if (isset($params['narocilo_id'])){
+ $narocilo = new UserNarocila();
+ $json_array = $narocilo->payNarocilo($params['narocilo_id']);
+ }
+ else{
+ $json_array['error'] = 'Narocilo ID is missing';
+ }
+ }
+ else{
+ $json_array['error'] = 'Denied for user '.$global_user_id;
+ }
+
+ break;
+
+ case 'placajNarociloEracun':
+
+ // Klic dovolimo samo Goranu
+ if($global_user_id == '112696'){
+
+ if (isset($params['narocilo_id'])){
+ $narocilo = new UserNarocila();
+ $json_array = $narocilo->payNarociloEracun($params['narocilo_id']);
+ }
+ else{
+ $json_array['error'] = 'Narocilo ID is missing';
+ }
+ }
+ else{
+ $json_array['error'] = 'Denied for user '.$global_user_id;
+ }
+
+ break;
+
+
// MOBILE APP ONLY
case 'getMobileAppVersion':
$json_array = $this->getMobileAppVersion();
@@ -2144,21 +2203,25 @@ class ApiSurvey {
$res = sisplet_query("SELECT value FROM misc WHERE what='SurveyCookie'");
list ($SurveyCookie) = mysqli_fetch_row($res);
+ // Nastavimo se hash
+ $hash = Common::generateSurveyHash();
// GLASOVANJE
if ($survey_type == 0) {
- $sql = sisplet_query("INSERT INTO srv_anketa (id, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, survey_type, lang_admin, lang_resp, active, skin, show_intro, show_concl, locked, mobile_created) " .
- "VALUES ('', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '', '$url', '', '0', '$lang_admin', '$lang_resp', '0', '1kaBlue', '0', '0', '0', '$mobile_created')");
+ $sql = sisplet_query("INSERT INTO srv_anketa
+ (id, hash, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, survey_type, lang_admin, lang_resp, active, skin, show_intro, show_concl, locked, mobile_created)
+ VALUES
+ ('', '".$hash."', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '', '$url', '', '0', '$lang_admin', '$lang_resp', '0', '1kaBlue', '0', '0', '0', '$mobile_created')");
if (!$sql) {
$error = mysqli_error($GLOBALS['connect_db']);
}
$anketa = mysqli_insert_id($GLOBALS['connect_db']);
-
if ($anketa > 0) {
- $url .= 'a/' . $anketa;
+
+ $url .= 'a/' . $hash;
// vnesemo tudi 1. grupo aka page
$sql = sisplet_query("INSERT INTO srv_grupa (id, ank_id, naslov, vrstni_red) VALUES ('', '$anketa', '$lang[srv_stran] 1', '1')");
@@ -2219,8 +2282,8 @@ class ApiSurvey {
$zakljucek_besedilo = $purifier->purify_DB($zakljucek['besedilo']);
$show_concl = ($zakljucek['hide_zakljucek'] == '1') ? 0 : 1;
- $sql = sisplet_query("INSERT INTO srv_anketa (id, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, survey_type, lang_admin, lang_resp, active, skin, introduction, conclusion, show_intro, show_concl, locked, mobile_created) " .
- "VALUES ('', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '', '$url', '', '2', '$lang_admin', '$lang_resp', '$autoActiveSurvey', '1ka', '$uvod_besedilo', '$zakljucek_besedilo', '$show_intro', '$show_concl', '1', '$mobile_created')");
+ $sql = sisplet_query("INSERT INTO srv_anketa (id, hash, naslov, akronim, db_table, starts, expire, dostop, insert_uid, insert_time, edit_uid, edit_time, cookie, text, url, intro_opomba, survey_type, lang_admin, lang_resp, active, skin, introduction, conclusion, show_intro, show_concl, locked, mobile_created) " .
+ "VALUES ('', '".$hash."', '$naslov', '$akronim', '1', $starts, $expire, '0', '$global_user_id', NOW(), '$global_user_id', NOW(), '$SurveyCookie', '', '$url', '', '2', '$lang_admin', '$lang_resp', '$autoActiveSurvey', '1ka', '$uvod_besedilo', '$zakljucek_besedilo', '$show_intro', '$show_concl', '1', '$mobile_created')");
if (!$sql) {
$error = mysqli_error($GLOBALS['connect_db']);
}
@@ -2228,7 +2291,8 @@ class ApiSurvey {
if ($anketa > 0) {
- $url .= 'a/' . $anketa;
+
+ $url .= 'a/' . $hash;
// vnesemo tudi 1. grupo aka page
$sql = sisplet_query("INSERT INTO srv_grupa (id, ank_id, naslov, vrstni_red) VALUES ('', '$anketa', '$lang[srv_stran] 1', '1')");
@@ -2267,7 +2331,8 @@ class ApiSurvey {
$json_array['id'] = $anketa;
$json_array['note'] = 'Survey created';
- } else {
+ }
+ else {
$json_array['error'] = 'Error creating survey';
}
@@ -3117,11 +3182,19 @@ class ApiSurvey {
$updateActiveTime = ", starts=$starts, expire=$expire";
if ($active == 1) {
- $activity_insert_string = "INSERT INTO srv_activity (sid, starts, expire, uid) VALUES('" . $ank_id . "', $starts, $expire, '" . $global_user_id . "' )";
- $sql_insert = sisplet_query($activity_insert_string);
- //ignoriraj erorror, ce ze obstaja identicna vrstica
- /* if (!$sql_insert)
- $json_array['error'] = mysqli_error($GLOBALS['connect_db']); */
+ $sql_insert = sisplet_query("INSERT INTO srv_activity
+ (sid, starts, expire)
+ VALUES
+ ('".$ank_id."', ".$starts.", ".$expire.")
+ ON DUPLICATE KEY UPDATE
+ SET expire=".$expire."
+ ");
+ }
+ else{
+ $sql_insert = sisplet_query("UPDATE srv_activity
+ SET expire=".$expire."
+ WHERE sid='".$ank_id."'
+ ");
}
$sql = sisplet_query("UPDATE srv_anketa SET active=" . $active
@@ -3129,7 +3202,8 @@ class ApiSurvey {
if (!$sql) {
$json_array['error'] = mysqli_error($GLOBALS['connect_db']);
- } else {
+ }
+ else {
if (!isset($json_array['error']))
$json_array['note'] = 'Survey activity changed';
}
@@ -3377,7 +3451,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 +3498,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 . "')");
@@ -3519,14 +3593,14 @@ class ApiSurvey {
$add = false;
if (SurveyInfo::getInstance()->checkSurveyModule('uporabnost'))
- $link = 'main/survey/uporabnost.php?anketa=' . $anketa . '&skupina=' . $vre_id;
+ $link = 'main/survey/uporabnost.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash() . '&skupina=' . $vre_id;
else
- $link = 'main/survey/index.php?anketa=' . $anketa . '&skupina=' . $vre_id;
+ $link = 'main/survey/index.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash() . '&skupina=' . $vre_id;
if ($add) {
$f = @fopen($site_path . '.htaccess', 'a');
if ($f !== false) {
- fwrite($f, "\nRewriteRule ^" . $nice_url . '\b(.*) ' . $link . "&foo=\$1&%{QUERY_STRING}");
+ fwrite($f, "\nRewriteRule ^" . $nice_url . '\b(?!-)(.*) ' . $link . "&foo=\$1&%{QUERY_STRING}");
fclose($f);
$sqlI = sisplet_query("INSERT INTO srv_nice_links_skupine (id,ank_id,nice_link_id,vre_id,link) VALUES ('','$ank_id','$row[id]','$vre_id','$nice_url')");
@@ -3626,14 +3700,14 @@ class ApiSurvey {
$add = false;
if (SurveyInfo::getInstance()->checkSurveyModule('uporabnost'))
- $link = 'main/survey/uporabnost.php?anketa=' . $anketa . '&skupina=' . $vre_id;
+ $link = 'main/survey/uporabnost.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash() . '&skupina=' . $vre_id;
else
- $link = 'main/survey/index.php?anketa=' . $anketa . '&skupina=' . $vre_id;
+ $link = 'main/survey/index.php?anketa=' . SurveyInfo::getInstance()->getSurveyHash() . '&skupina=' . $vre_id;
if ($add) {
$f = @fopen($site_path . '.htaccess', 'a');
if ($f !== false) {
- fwrite($f, "\nRewriteRule ^" . $nice_url . '\b(.*) ' . $link . "&foo=\$1&%{QUERY_STRING}");
+ fwrite($f, "\nRewriteRule ^" . $nice_url . '\b(?!-)(.*) ' . $link . "&foo=\$1&%{QUERY_STRING}");
fclose($f);
$sqlI = sisplet_query("INSERT INTO srv_nice_links_skupine (id,ank_id,nice_link_id,vre_id,link) VALUES ('','$ank_id','$row[id]','$vre_id','$nice_url')");
@@ -3887,7 +3961,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 +4008,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 . "')");
diff --git a/admin/survey/classes/class.AppSettings.php b/admin/survey/classes/class.AppSettings.php
new file mode 100644
index 0000000..510c9c6
--- /dev/null
+++ b/admin/survey/classes/class.AppSettings.php
@@ -0,0 +1,195 @@
+<?php
+
+/*
+ Class ki skrbi za vse globalne nastavitve aplikacije (ki so bile vcasih v settings_optional.php)
+
+ Spremenljivke:
+
+*/
+
+
+
+class AppSettings {
+
+
+ private static $instance = null;
+ private $settings = array();
+
+ private $variables = array(
+
+ 'basic' => array(
+ 'debug',
+
+ // INSTALLATION TYPE (0->lastna, 1->www, 2->aai, 3->virtualka)
+ 'installation_type',
+
+ 'confirm_registration',
+ 'confirm_registration_admin',
+
+ 'gdpr_admin_email',
+
+ 'meta_admin_ids',
+ ),
+
+ // APP SETTINGS
+ 'info' => array(
+ 'app_settings-app_name',
+ 'app_settings-admin_email',
+ 'app_settings-owner',
+ 'app_settings-owner_website',
+ 'app_settings-footer_custom',
+ 'app_settings-footer_text',
+ 'app_settings-footer_survey_custom',
+ 'app_settings-footer_survey_text',
+ 'app_settings-email_signature_custom',
+ 'app_settings-email_signature_text',
+ 'app_settings-survey_finish_url',
+ 'app_settings-custom_logo',
+ 'app_settings-export_type',
+ ),
+
+ // APP LIMITS
+ 'limits' => array(
+ 'app_limits-clicks_per_minute_limit',
+ 'app_limits-question_count_limit',
+ 'app_limits-response_count_limit',
+ 'app_limits-invitation_count_limit',
+ 'app_limits-admin_allow_only_ip',
+ ),
+
+ // SMTP SETTINGS
+ 'smtp' => array(
+ 'email_server_settings-SMTPFrom',
+ 'email_server_settings-SMTPFromNice',
+ 'email_server_settings-SMTPReplyTo',
+ 'email_server_settings-SMTPHost',
+ 'email_server_settings-SMTPPort',
+ 'email_server_settings-SMTPSecure',
+ 'email_server_settings-SMTPAuth',
+ 'email_server_settings-SMTPUsername',
+ 'email_server_settings-SMTPPassword',
+ 'email_server_fromSurvey',
+ ),
+
+ 'modules' => array(
+
+ // GOOGLE
+ 'google-recaptcha_sitekey',
+ 'google-secret_captcha',
+ 'google-login_client_id',
+ 'google-login_client_secret',
+ 'google-maps_API_key',
+
+ // FACEBOOK
+ 'facebook-appid',
+ 'facebook-appsecret',
+
+ // MODULE MAZA
+ 'maza-FCM_server_key',
+ 'maza-APP_special_login_key',
+ 'maza-NextPinMainToken',
+ 'maza-NextPinMainPassword',
+
+ // MODULE HIERARHIJA
+ 'hierarhija-folder_id',
+ 'hierarhija-default_id',
+
+ // SQUALO MAIL
+ 'squalo-user',
+ 'squalo-key',
+ )
+ );
+
+
+ private function __construct(){
+
+ $this->prepareSettings();
+
+ }
+
+
+ public static function getInstance(){
+
+ if (self::$instance == null){
+ self::$instance = new AppSettings();
+ }
+
+ return self::$instance;
+ }
+
+
+ // Get all app settings from database (based on domain)
+ private function prepareSettings(){
+ global $site_domain;
+
+ $sqlSetting = sisplet_query("SELECT what, value FROM app_settings WHERE domain='".$site_domain."'");
+
+ while ($rowSetting = mysqli_fetch_array($sqlSetting)) {
+ $this->settings[$rowSetting['what']] = $rowSetting['value'];
+ }
+ }
+
+
+ // Get app setting
+ public function getSetting($what){
+
+ if(isset($this->settings[$what])){
+
+ // Nastavitev true
+ if($this->settings[$what] === '1' || $this->settings[$what] === true || $this->settings[$what] === 'true')
+ return true;
+
+ // Nastavitev false
+ if($this->settings[$what] === '0' || $this->settings[$what] === '' || $this->settings[$what] === false || $this->settings[$what] === 'false')
+ return false;
+
+ // Nastavitev array
+ if($what == 'confirm_registration_admin' || $what == 'meta_admin_ids' || $what == 'app_limits-admin_allow_only_ip')
+ return explode(',', $this->settings[$what]);
+
+ return $this->settings[$what];
+ }
+ else
+ return false;
+ }
+
+ // Save app setting
+ public function saveSetting($what, $value){
+ global $site_domain;
+
+ $sqlSetting = sisplet_query("UPDATE app_settings SET value='".$value."' WHERE what='".$what."' AND domain='".$site_domain."'");
+
+ $this->settings[$what] = $value;
+ }
+
+
+ // Display app settings
+ public function displaySettingsGroup($group){
+
+ $setting_variables = $this->variables[$group];
+
+
+ foreach($setting_variables as $what){
+ $this->displaySetting($what);
+ }
+
+ }
+
+ // Display app single setting
+ public function displaySetting($what){
+ global $lang;
+
+ if(!isset($this->settings[$what]))
+ return;
+
+ echo '<div class="osnovne_nastavitve_single">';
+
+ echo '<label>'.$lang['as_'.$what].': </label>';
+
+ echo '<input type="text" name="as_'.$what.'" value="'.htmlspecialchars($this->settings[$what]).'">';
+
+ echo '</div>';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.ArchiveSurveys.php b/admin/survey/classes/class.ArchiveSurveys.php
new file mode 100644
index 0000000..703f4b8
--- /dev/null
+++ b/admin/survey/classes/class.ArchiveSurveys.php
@@ -0,0 +1,345 @@
+<?php
+
+/*
+ Moznost masovnega izvoza in uvoza vseh anket uporabnika
+*/
+
+
+class ArchiveSurveys{
+
+
+ public function __construct($anketa = null){
+ global $site_path;
+ global $site_url;
+
+ define("ARCHIVE_FOLDER", $site_path.'admin/survey/SurveyBackup/');
+ define("ARCHIVE_URL", $site_url.'admin/survey/SurveyBackup/');
+ }
+
+
+ public function displayUserSurveys(){
+ global $site_path;
+ global $global_user_id;
+
+ echo '<form id="survey_archive_form">';
+
+ echo '<ul>';
+
+ // Loop cez vse ankete kjer je user avtor
+ $sql = sisplet_query("SELECT id, naslov, akronim FROM srv_anketa WHERE insert_uid='".$global_user_id."' AND active!='-1'");
+ while ($row = mysqli_fetch_array($sql)) {
+
+ echo '<li>';
+ echo ' <input type="checkbox" name="survey_archive[]" id="survey_archive_'.$row['id'].'" class="survey_archive_checkbox" value="'.$row['id'].'" onChange="archive_surveys_export_counter();">';
+ echo ' <label for="survey_archive_'.$row['id'].'">'.$row['naslov'].'</label>';
+ echo '</li>';
+ }
+
+ echo '</ul>';
+
+ echo '</form>';
+ }
+
+
+ // Izvedemo izvoz anket v paket
+ private function createSurveysArchive($survey_list, $data=true){
+ global $connect_db;
+ global $global_user_id;
+ global $lang;
+
+ // Nastavimo nastavitve php-ja, da zmore sprocesirati
+ //set_time_limit(1800);
+ ini_set('memory_limit', '1024M');
+ ini_set('max_input_time', 600);
+
+
+ // Pobrisemo zip ce obstaja od prej
+ if (file_exists(ARCHIVE_FOLDER.'archive_surveys_'.$global_user_id.'.zip')) {
+ unlink(ARCHIVE_FOLDER.'archive_surveys_'.$global_user_id.'.zip');
+ }
+
+
+ // Gremo cez seznam anket in ustvarimo .1ka izvoz za vsako posebej in jo dodamo v zip
+ $surveys_for_deletion = array();
+ foreach($survey_list as $ank_id){
+
+ // Odpremo oz. ustvarimo zip
+ $zip = new ZipArchive();
+ $zip_file = ARCHIVE_FOLDER.'archive_surveys_'.$global_user_id.'.zip';
+
+ if ($zip->open($zip_file, ZipArchive::CREATE) !== true) {
+ exit('Napaka pri ustvarjanju zip arhiva anket.');
+ }
+
+ SurveyCopy::setSrcSurvey($ank_id);
+ SurveyCopy::setSrcConectDb($connect_db);
+ SurveyCopy::setDestSite(0);
+
+ //SurveyCopy::downloadArrayFile($data);
+ $export_survey_array = SurveyCopy::getArrayVar($data);
+ $export_survey_string = base64_encode(serialize($export_survey_array));
+
+ // Ustvarimo datoteko za anketo
+ $export_survey_file_name = $export_survey_array['srv_anketa'][0]['naslov'].' '.date("j.n.Y").'.1ka';
+ $export_survey_file_content = $export_survey_string;
+
+ // Dodamo vsebino kot datoteka v zip
+ $zip->addFromString($export_survey_file_name, $export_survey_file_content);
+
+ // Zapremo zip
+ $zip->close();
+ }
+
+ return $lang['srv_archive_surveys_export_created'];
+ }
+
+ // Izvedemo uvoz paketa anket
+ private function importSurveysArchive($zipFile){
+ global $lang;
+ global $connect_db;
+ global $admin_type;
+
+ // Nastavimo nastavitve php-ja, da zmore sprocesirati
+ //set_time_limit(1800);
+ ini_set('memory_limit', '1024M');
+ ini_set('max_input_time', 600);
+
+
+ $zip = new ZipArchive();
+
+ // Razpakiramo zip paket
+ if ($zip->open($zipFile) === true) {
+
+ $success_count = 0;
+ $error_surveys = array();
+
+ SurveyCopy::setSrcSurvey(-1);
+ SurveyCopy::setSrcConectDb($connect_db);
+ SurveyCopy::setDestSite(0);
+
+ // loop cez vse arhivske datoteke v zip paketu
+ for ($i = 0; $i < $zip->numFiles; $i++) {
+
+ try{
+ // Dobimo ime datoteke in vsebino
+ $fileName = $zip->getNameIndex($i);
+ $fileContent = $zip->getFromIndex($i);
+
+ $array = unserialize(base64_decode($fileContent));
+
+ if (is_array($array) ) {
+
+ SurveyCopy::setSourceArray($array);
+
+ // Ce je vse ok ustvarimo kopijo ankete
+ if(SurveyCopy::getErrors() == ''){
+ $new_survey_id = SurveyCopy::doCopy();
+ $success_count++;
+ }
+ else{
+ $error_surveys[] = array('name'=>$fileName, 'error'=>SurveyCopy::getErrors());
+ }
+ }
+ }
+ catch (Exception $e) {
+ $error_surveys[] = array('name'=>$fileName, 'error'=>$e->getMessage());
+ }
+
+ // Resetiramo parametre classa - errorje in source array
+ SurveyCopy::reset();
+ }
+
+ $zip->close();
+
+
+ // Uspesno uvozene ankete
+ echo '<p>'.$lang['srv_archive_surveys_import_success'].': <span class="semi-bold">'.$success_count.'</span></p>';
+
+ // Izpisemo se ankete z errorji
+ if(count($error_surveys) > 0){
+
+ // Stevilo anket z napako
+ echo '<p>'.$lang['srv_archive_surveys_import_error_details'].': <span class="semi-bold red">'.count($error_surveys).'</span></p>';
+
+ // Loop cez vse ankete z napako
+ echo '<div class="error_details" style="overflow-y:auto; max-height:50vh;">';
+ foreach($error_surveys as $error_survey){
+ echo '<p class="red top16 semi-bold">'.$error_survey['name'].'</p>';
+
+ // Samo adminu izpišemo dejanski error
+ if($admin_type == 0)
+ echo '<p class="red italic">'.$error_survey['error'].'</p>';
+ }
+ echo '</div>';
+ }
+ }
+ // Zipa ni bilo mogoce odpreti
+ else {
+ echo '<p class="red">'.$lang['srv_archive_surveys_import_error_import'].'</p>';
+ }
+ }
+
+
+ public function ajax(){
+ global $lang;
+ global $global_user_id;
+
+ // Prikazemo popup s seznamom anket upporabnika za izvoz
+ if ($_GET['a'] == 'display_export') {
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_archive_surveys_export'].'</h2>';
+
+
+ echo '<div class="popup_main archive_surveys">';
+ $this->displayUserSurveys();
+ echo '</div>';
+
+ // Masovno oznacevanje checkboxov
+ echo '<div class="mass_select archive_surveys">';
+ echo ' <span id="switch_on" onClick="archive_surveys_export_toggle(1);" title="'.$lang['srv_select_all'].'"><span class="faicon checkbox-empty" /> '.$lang['srv_select_all'].'</span>';
+ echo ' <span id="switch_off" class="displayNone" onClick="archive_surveys_export_toggle(0);" title="'.$lang['srv_deselect_all'].'"><span class="faicon minus_square" /> '.$lang['srv_deselect_all'].'</span>';
+
+ echo ' <div class="mass_select_counter">'.$lang['srv_archive_surveys_export_counter'].': <span id="mass_select_counter_number">0</span></div>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onClick="archive_surveys_export();">'.$lang['srv_archive_surveys_export_create'].'</button>';
+ echo '</div>';
+ }
+
+ // Ustvarimo zip arhiv za izvoz in ponudimo gumb za download
+ elseif($_GET['a'] == 'export'){
+
+ $survey_list = isset($_POST['survey_archive']) ? $_POST['survey_archive'] : array();
+ $error = '';
+
+ // Napaka - nimamo oznacene nobene ankete
+ if(count($survey_list) == 0){
+ $error = $lang['srv_archive_surveys_export_error1'];
+ }
+ // Napaka - presezen limit anket
+ elseif(count($survey_list) > 100){
+ $error = $lang['srv_archive_surveys_export_error2'];
+ }
+
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_archive_surveys_export'].'</h2>';
+
+ // Imamo opozorila
+ if($error != ''){
+ echo '<div class="popup_main archive_surveys">';
+ echo '<p>'.$error.'</p>';
+ echo '</div>';
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="archive_surveys_display_export();">'.$lang['back'].'</button>';
+ echo '</div>';
+
+ return;
+ }
+
+ // Izvedemo izvoz in prikazemo gumb za download
+ try{
+ $response = $this->createSurveysArchive($survey_list);
+ }
+ catch (Exception $e) {
+ $error = $e->getMessage();
+ }
+
+ // Imamo napake pri pripravljanju paketa
+ if($error != ''){
+ echo '<div class="popup_main archive_surveys">';
+ echo '<p>'.$error.'</p>';
+ echo '</div>';
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="archive_surveys_display_export();">'.$lang['back'].'</button>';
+ echo '</div>';
+
+ return;
+ }
+
+
+ // Uspesno kreiran paket
+ echo '<div class="popup_main archive_surveys">';
+ echo $response;
+ echo '</div>';
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onClick="archive_surveys_download_export(\''.ARCHIVE_URL.'archive_surveys_'.$global_user_id.'.zip\');">'.$lang['srv_archive_surveys_export_download'].'</button>';
+ echo '</div>';
+ }
+
+ // Prikazemo popup za uvoz zip arhiva anket
+ if ($_GET['a'] == 'display_import') {
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_archive_surveys_import'].'</h2>';
+
+
+ echo '<div class="popup_main archive_surveys">';
+ echo '<form id="restore" action="ajax.php?a=archive_restore" method="post" name="restorefrm" enctype="multipart/form-data" >';
+
+ echo $lang['srv_archive_surveys_import_text'].'<br><br>';
+
+ echo '<input type="file" name="restore" id="archive_surveys_input" onChange="archive_surveys_select_import();" /></label>';
+
+ echo '<p id="archive_surveys_error" class="red top16 displayNone">'.$lang['srv_archive_surveys_import_error'].'</p>';
+ echo '<p id="archive_surveys_error2" class="red top16 displayNone">'.$lang['srv_archive_surveys_import_error2'].'</p>';
+ echo '<p id="archive_surveys_error3" class="red top16 displayNone">'.$lang['srv_archive_surveys_import_error3'].'</p>';
+
+ echo '</form>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['srv_zapri'].'</button>';
+ echo ' <button id="archive_surveys_import_button" class="medium blue displayNone" onClick="archive_surveys_import();">'.$lang['srv_archive_surveys_import_button'].'</button>';
+ echo '</div>';
+ }
+
+ // Izvedemo uvoz zip arhiva in prikazemo obvestilo (uspesno, napake)
+ elseif($_GET['a'] == 'import'){
+
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_archive_surveys_import'].'</h2>';
+
+
+ echo '<div class="popup_main archive_surveys">';
+
+ // zip file ustrezno nalozen
+ if (isset($_FILES['restore']) && $_FILES['restore']['error'] === UPLOAD_ERR_OK) {
+
+ $zipFile = $_FILES['restore']['tmp_name'];
+
+ // Izevedemo uvoz iz zip datoteke
+ try{
+ $this->importSurveysArchive($zipFile);
+ }
+ catch (Exception $e) {
+ echo '<p class="red">'.$lang['srv_archive_surveys_import_error_import'].'</p>';
+ echo '<p class="red italic top8">'.$e->getMessage().'</p>';
+ }
+ }
+ else {
+ echo '<p class="red">'.$lang['srv_archive_surveys_import_error_upload'].'</p>';
+ }
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder archive_surveys">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ }
+ }
+} \ No newline at end of file
diff --git a/admin/survey/classes/class.Cache.php b/admin/survey/classes/class.Cache.php
index 6635055..86d04a8 100644
--- a/admin/survey/classes/class.Cache.php
+++ b/admin/survey/classes/class.Cache.php
@@ -207,32 +207,95 @@ class Cache
$result['tip'] = $lang['srv_sklop_posebna_short'] . ' - ' . $lang['srv_vprasanje_tip_' . $spremenljivka['tip']];
break;
}
+
+ //$result['izrazanje'] = $spremenljivka['tip']; - preverjanje manjkajočih tipov za switch spodaj. Če je vse ok, se lahko odstrani @TG
+
switch ($spremenljivka['tip']) {
case 1 : // radio
+ $result['izrazanje'] = $lang['srv_vprasanje_radio'];
+ break;
case 2 : // check
+ $result['izrazanje'] = $lang['srv_vprasanje_checkbox'];
+ break;
case 3 : // drop
+ $result['izrazanje'] = $lang['srv_vprasanje_dropdown'];
+ break;
+ case 4 : // text
+ $result['izrazanje'] = $lang['srv_vprasanje_text'];
+ break;
+ case 5 : // nagovor
+ $result['izrazanje'] = $lang['srv_vprasanje_label'];
+ break;
case 6 : // mradio
+ $result['izrazanje'] = $lang['srv_vprasanje_multigrid'];
+ break;
+ case 7 : // number
+ $result['izrazanje'] = $lang['srv_vprasanje_number'];
+ break;
+ case 8 : // datum
+ $result['izrazanje'] = $lang['srv_vprasanje_datum'];
+ break;
+
+
+ //SOCIAL NETWORK VPRAŠANJA
+ case 9 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_9'];
+ break;
+ case 10 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_10'];
+ break;
+ case 11 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_11'];
+ break;
+ case 12 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_12'];
+ break;
+ case 13 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_13'];
+ break;
+
+
+ //AW
+ case 14 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_14'];
+ break;
+ case 15 :
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_15'];
+ break;
+
+
case 16 : // mcheck
+ $result['izrazanje'] = $lang['srv_vprasanje_multicheckbox'];
+ break;
case 17 : // razvrščanje
- $result['izrazanje'] = $lang['srv_analiza_vrsta_kate'];
+ $result['izrazanje'] = $lang['srv_vprasanje_ranking'];
+ break;
+ case 18 : // vsota
+ $result['izrazanje'] = $lang['srv_vprasanje_vsota'];
break;
- case 4 : // text
case 19 : // mtext
- case 21 : // text*
- $result['izrazanje'] = $lang['srv_analiza_vrsta_bese'];
+ $result['izrazanje'] = $lang['srv_vprasanje_multitext'];
break;
- case 7 : // number
- case 18 : // vsota
case 20 : // mnumber
+ $result['izrazanje'] = $lang['srv_vprasanje_multinumber'];
+ break;
+ case 21 : // text*
+ $result['izrazanje'] = $lang['srv_vprasanje_text'];
+ break;
case 22 : // kalkulacija
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_22'];
+ break;
+ case 24 : // kombinirana tabela
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_24'];
+ break;
case 25 : // kvota
- $result['izrazanje'] = $lang['srv_analiza_vrsta_stev'];
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_25'];
break;
- case 8 : // datum
- $result['izrazanje'] = $lang['srv_analiza_vrsta_stev'];
+ case 26 : // lokacija
+ $result['izrazanje'] = $lang['srv_vprasanje_tip_26'];
break;
- case 5 : // nagovor
- $result['izrazanje'] = $lang['srv_analiza_vrsta_nago'];
+ case 27 : // heatmap
+ $result['izrazanje'] = $lang['srv_vprasanje_heatmap'];
break;
}
diff --git a/admin/survey/classes/class.Common.php b/admin/survey/classes/class.Common.php
index 6f761b6..66946f0 100644
--- a/admin/survey/classes/class.Common.php
+++ b/admin/survey/classes/class.Common.php
@@ -19,7 +19,7 @@ class Common {
// konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/**
* Poskrbimo za samo eno instanco
@@ -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'");
@@ -311,6 +310,10 @@ class Common {
global $admin_type;
global $global_user_id;
+ $anketa = 0;
+ $grupa = 0;
+ $spremenljivka = 0;
+
if (isset ($_REQUEST['spremenljivka']))
$spremenljivka = $_REQUEST['spremenljivka'];
if (isset ($_REQUEST['anketa']))
@@ -708,27 +711,15 @@ class Common {
*/
function getFromEmail() {
global $global_user_id, $site_domain;
- $MailFrom = 'info@1ka.si';
- # nastavimo pošiljatelja
- # za SAFE.SI naredimo hardcoded da se pošilja kao iz SAFE.SI
- if (strpos($site_domain, "safe.si") === false)
- {
- #nismo iz SAFE.SI
- $r = sisplet_query("SELECT value FROM misc WHERE what='AlertFrom'");
- list ($MailFrom) = mysqli_fetch_row($r);
- }
- else
- {
- # smo na SAFE.SI
- $MailFrom = 'info@safe.si';
- }
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom') !== false)
+ $MailFrom = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
# Če je slučanjo napaka nastavimo info@1ka.si
- if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom))
- {
+ if ($MailFrom == null || trim($MailFrom) == '' || !$this->validEmail($MailFrom)){
$MailFrom = 'info@1ka.si';
}
+
return $MailFrom;
}
@@ -814,15 +805,21 @@ class Common {
return $result;
}
- static function formatNumber ($value, $digit = 0, $form=null,$sufix = "") {
+ static function formatNumber ($value, $digit = 0, $form=null, $sufix = "") {
+
# Kako izpisujemo decimalke in tisočice
- $default_seperators = array( 0=>array('decimal_point'=>'.', 'thousands'=>','),
- 1=>array('decimal_point'=>',', 'thousands'=>'.'));
+ $default_seperators = array(
+ 'decimal_point' => '.',
+ 'thousands' => ','
+ /*0=>array('decimal_point'=>'.', 'thousands'=>','),
+ 1=>array('decimal_point'=>',', 'thousands'=>'.')*/
+ );
if (is_array($form) && isset($form['decimal_point'])&& isset($form['thousands'])) {
$decimal_point = $form['decimal_point'];
$thousands = $form['thousands'];
- } else {
+ }
+ else {
$decimal_point = $default_seperators['decimal_point'];
$thousands = $default_seperators['thousands'];
}
@@ -844,7 +841,7 @@ class Common {
private $dataPiping_query = null; // kesiramo query, ker ga bomo ponavljali za vsako spremenljivko
public function dataPiping ($text, $usr_id, $loop_id=null, $lang_id=null) {
- if (stripos($text, "#") !== false) {
+ if ($text != null && stripos($text, "#") !== false) {
if ($this->dataPiping_query == null)
$this->dataPiping_query = sisplet_query("SELECT s.* FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='".self::$anketa."' AND s.gru_id=g.id AND s.tip!='5' AND (s.tip < '10' OR s.tip = '17' OR s.tip = '22' OR s.tip = '25' OR s.tip='21')");
if (mysqli_num_rows($this->dataPiping_query))
@@ -1125,7 +1122,7 @@ class Common {
while (!feof($f)) {
$r = fgets($f);
- if (strpos($r, "^".$nice_url.'\b(.*) ') !== false && strpos($r, "?anketa=".$ank_id."") !== false) {
+ if (strpos($r, "^".$nice_url.'\b') !== false && strpos($r, "?anketa=".$ank_id."") !== false) {
// kao pobrisemo vrstico
} else {
$output[] = $r;
@@ -1165,7 +1162,7 @@ class Common {
while($rowS = mysqli_fetch_array($sqlS)){
- if (strpos($r, "^".$rowS['link'].'\b(.*) ') !== false && strpos($r, "?anketa=".$ank_id."&skupina=".$rowS['vre_id']."") !== false) {
+ if (strpos($r, "^".$rowS['link'].'\b') !== false && strpos($r, "?anketa=".$ank_id."&skupina=".$rowS['vre_id']."") !== false) {
// pobrisemo vrstico in vnos v bazi
$sqlD = sisplet_query("DELETE FROM srv_nice_links_skupine WHERE ank_id='$ank_id' AND nice_link_id='$row[id]' AND vre_id='$rowS[vre_id]'");
@@ -1217,7 +1214,7 @@ class Common {
if($subdomain == 'english'){
// Nastavitve in podzavihki
- if ($_GET['anketa'] == '' && ($_GET['a'] == 'nastavitve' # in podzavihki
+ if ((!isset($_GET['anketa']) || $_GET['anketa'] == '') && ($_GET['a'] == 'nastavitve' # in podzavihki
|| $_GET['a'] == 'osn_pod'
|| $_GET['a'] == 'trajanje'
|| $_GET['a'] == 'dostop'
@@ -1606,7 +1603,7 @@ class Common {
}
//Urejanje - Nastavitve
- else if ($_GET['anketa'] != '' && $_GET['a'] == 'nastavitve') {
+ else if ((!isset($_GET['anketa']) || $_GET['anketa'] == '') && $_GET['a'] == 'nastavitve') {
$help_url = 'https://www.1ka.si/d/en/help/user-guide/edit/settings';
}
@@ -2076,29 +2073,23 @@ class Common {
return $help_url;
}
- // Nov algoritem za id ankete v url-ju (ni vec stevilka ampak string - vsako liho stevilko zamenjamo z ustrezno crko npr. 1234 -> A2C4)
- public static function encryptAnketaID($anketa_id){
+ // Nov algoritem za id ankete v url-ju za izpolnjevanje
+ public static function generateSurveyHash(){
+
+ $unique = false;
- // Ali imamo vklopljeno sifriranje id-ja anket v url-ju - ZENKRAT UGASNJENO
- //if(true){
- if(false){
- $anketa_arr = str_split($anketa_id);
- $anketa_string = '';
+ while(!$unique){
- foreach($anketa_arr as $pos => $num){
+ // Zgeneriramo random string z 8 znaki
+ $hash = substr(md5(uniqid(mt_rand(), true)), 0, 8);
- // Na lihih mestih pretvorimo stevilko v crko
- if($pos % 2 == 0)
- $anketa_string .= chr(97 + $num);
- else
- $anketa_string .= $num;
- }
- //$anketa_string = strtolower($anketa_string);
- }
- else
- $anketa_string = $anketa_id;
-
- return $anketa_string;
+ // Preverimo ce slucajno ze obstaja v bazi
+ $sql = sisplet_query("SELECT 1 FROM srv_anketa WHERE hash='".$hash."' LIMIT 1");
+ if (mysqli_num_rows($sql) == 0)
+ $unique = true;
+ }
+
+ return $hash;
}
// Algoritem, ki iz texta ustvari strukturo vprasanj in variabel (za uvoz anekte iz texta)
@@ -2148,21 +2139,132 @@ class Common {
}
// Izpise obvestilo, da ni podatkov
- static function noDataAlert() {
+ static function noDataAlert($location='') {
global $lang;
+ global $anketa;
+ global $site_url;
echo '<div class="no_data_alert">';
- echo $lang['srv_data_no_data'];
+
+ if($lang['id'] == '1')
+ echo '<img src="/public/img/images/no_data.svg" />';
+ else
+ echo '<img src="/public/img/images/no_data_eng.svg" />';
+
+ if($location == 'status') {
+ echo '<h2>'.$lang['srv_dashboard_no_data'].'</h2>';
+ }
+ else {
+ echo '<h2>'.$lang['srv_data_no_data'].'</h2>';
+ }
+
+ echo '<div id="note">';
+ if($location == 'status') {
+ echo '<p>'.$lang['srv_data_no_data3'].'</p>';
+ }
+ else {
+ echo '<p>'.$lang['srv_data_no_data2'].'</p>';
+ }
+ echo '</div>';
+
+ if($location == 'status') {
+ $buttonA = 'index.php?anketa='.$anketa.'&a=branching'; //urejanje
+ $buttonB = 'index.php?anketa='.$anketa.'&a=testiranje'; //testiranje
+ $textA = $lang['edit2'];
+ $textB = $lang['srv_testiranje'];
+ $textC = $lang['srv_vabila'];
+ }
+ else {
+ $buttonA = 'index.php?anketa='.$anketa.'&a=testiranje&m=testnipodatki'; //avtomatski testni vnos
+ $buttonB = SurveyInfo::getSurveyLink() . '?preview=on&testdata=on'; //ročni testni vnos
+ $textA = $lang['srv_testiranje_vnosi2'];
+ $textB = $lang['srv_archive_test_data_text2a'];
+ $textC = $lang['srv_anketa_share'];
+ }
+
+ $buttonC = 'index.php?anketa='.$anketa.'&amp;a=vabila'; //objava
+
+ echo '<div id="buttons">';
+ echo ' <a href="'.$buttonA.'"><button class="medium white-blue buttonA" onClick="window.location.href='.$buttonA.';return false;">'.$textA.'</button></a>';
+ echo ' <a href="'.$buttonB.'"><button class="medium white-blue buttonB" onClick="window.open('.$buttonB.', \'_blank\');return false;">'.$textB.'</button></a>';
+ echo ' <a href="'.$buttonC.'"><button class="medium blue buttonC">'.$textC.'</button></a>';
+ echo '</div>';
+
echo '</div>';
}
+ // Izpise obvestilo, da ni podatkov v javni povezavi
+ static function noDataAlertPublic($action) {
+ global $lang;
+ global $anketa;
+ global $site_url;
+
+ header('Cache-Control: no-cache');
+ header('Pragma: no-cache');
+
+ #izpišemo HTML
+ echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+ echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
+
+
+ echo '<head>';
+
+ echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
+ echo '<style>';
+ echo 'body{box-sizing: border-box; padding: 40px 20px; width: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column;} h2{font-weight: 300; font-size: 24px; margin-block-start: 0; margin-block-end: 0; margin-bottom: 16px; text-align: center;} img {width: 100%; max-width: 466px; margin-bottom: 32px;}';
+ echo '</style>';
+
+ echo '</head>';
+
+
+ echo '<body class="public_link data">';
+
+
+ switch ($action) {
+ case 'data':
+ case 'data_nijz':
+ echo '<h2>'.$lang['srv_publc_data_title_for'].SurveyInfo::getSurveyTitle() .'</h2>';
+ break;
+
+ case M_ANALYSIS_CHARTS:
+ echo '<h2>'.$lang['srv_publc_chart_title_for'].SurveyInfo::getSurveyTitle() .'</h2>';
+ break;
+
+ case M_ANALYSIS_CREPORT:
+ echo '<h2>'.$lang['srv_publc_creport_title_for'].SurveyInfo::getSurveyTitle() .'</h2>';
+ break;
+
+ case 'analysis':
+ echo '<h2>'.$lang['srv_publc_analysis_title_for'].SurveyInfo::getSurveyTitle() .'</h2>';
+ break;
+
+ default:
+ echo 'Error!';
+ break;
+ }
+
+ if($lang['id'] == '1')
+ echo '<img src="/public/img/images/no_data.svg" />';
+ else
+ echo '<img src="/public/img/images/no_data_eng.svg" />';
+
+ echo '<h2>'.$lang['srv_data_no_data'].'</h2>';
+
+ echo '</body>';
+
+
+ echo '</html>';
+ }
+
// Vrne string s signaturjem za email v ustreznem jeziku (default slovenski)
public static function getEmailSignature($lang_id = 0){
global $lang;
- global $app_settings;
- if(isset($app_settings['email_signature_custom']) && $app_settings['email_signature_custom'] == 1){
- $signature = '<br /><br /><br />'.$app_settings['email_signature_text'];
+ if(AppSettings::getInstance()->getSetting('app_settings-email_signature_custom') !== false){
+ $signature = '<br /><br /><br />'.AppSettings::getInstance()->getSetting('app_settings-email_signature_text');
}
else{
@@ -2174,9 +2276,9 @@ class Common {
// Logo
if($lang['id'] == '1')
- $signature .= '<img src="https://www.1ka.si/public/img/logo/1ka_slo.png" width=90 style="width:90px; height:auto; border:0;" />';
+ $signature .= '<img src="https://www.1ka.si/public/img/logo/1ka_logo_slo.jpg" width=90 style="width:90px; height:auto; border:0;" />';
else
- $signature .= '<img src="https://www.1ka.si/public/img/logo/1ka_eng.png" width=90 style="width:90px; height:auto; border:0;" />';
+ $signature .= '<img src="https://www.1ka.si/public/img/logo/1ka_logo_eng.jpg" width=90 style="width:90px; height:auto; border:0;" />';
$signature .= '<br/>-------------------------------------------------------------------<br/>';
diff --git a/admin/survey/classes/class.Dostop.php b/admin/survey/classes/class.Dostop.php
index 883e7ce..a06e0d9 100644
--- a/admin/survey/classes/class.Dostop.php
+++ b/admin/survey/classes/class.Dostop.php
@@ -37,7 +37,6 @@ class Dostop {
if ($anketa == 0) {
$anketa = $this->anketa;
}
- $uid = $global_user_id;
SurveyInfo::getInstance()->SurveyInit($anketa);
$rowa = SurveyInfo::getInstance()->getSurveyRow();
@@ -48,19 +47,19 @@ class Dostop {
}
// za demonstracijsko je posebno preverjanje
- if ($rowa['invisible'] == 1) {
+ if (isDemoSurvey($anketa)) {
return TRUE;
}
// posebej dostop za vsazga userja posebej
- $sql = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$uid'");
+ $sql = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$global_user_id'");
if (mysqli_num_rows($sql) > 0) {
return TRUE;
}
// dodatno imamo se ce je manager ali admin, potem vidi ankete podrejenih userjev
if ($admin_type == 1 || $admin_type == 0) {
- $sql = sisplet_query("SELECT COUNT(*) FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$uid')");
+ $sql = sisplet_query("SELECT COUNT(*) FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$global_user_id')");
$row = mysqli_fetch_array($sql);
if ($row[0] > 0) {
return TRUE;
@@ -76,24 +75,28 @@ class Dostop {
}
/**
- * Kao meta admin, ki vidi vse
+ * Meta admin, ki vidi vse ankete
*/
- static function isMetaAdmin()
- {
- global $global_user_id;
+ static function isMetaAdmin(){
+ global $global_user_id;
global $admin_type;
- global $mysql_database_name;
- // Samo na www in virtualkah
- if(($mysql_database_name == 'www1kasi' || $mysql_database_name == 'real1kasi') && $admin_type == '0'){
- // vvasja@gmail.com - id: 100, peter.h1203@gmail.com - id: 12611, 1ka.techsupport - id: 49089 (virtualke), 72253
- if (in_array($global_user_id, [100, 12611, 49089, 72253])) {
+ // Ce ni admin ni nikoli metaadmin
+ if($admin_type != '0'){
+ return FALSE;
+ }
+
+ $meta_admin_ids = AppSettings::getInstance()->getSetting('meta_admin_ids');
+
+ // Ce imamo nastavljene id-je za metaadmine v settings_optional
+ if(isset($meta_admin_ids) && !empty($meta_admin_ids)){
+
+ if (in_array($global_user_id, $meta_admin_ids)) {
return TRUE;
}
- }
-
+ }
// Gorenje ima svoje metaadmine
- if ($admin_type == '0' && Common::checkModule('gorenje')){
+ elseif(Common::checkModule('gorenje')){
global $meta_admin_emails;
$sql = sisplet_query("SELECT email FROM users WHERE id = '$global_user_id'");
@@ -130,15 +133,13 @@ class Dostop {
*
* @param mixed $anketa
*/
- function checkDostopSub($type, $anketa = 0)
- {
+ public function checkDostopSub($type, $anketa = 0){
global $admin_type;
global $global_user_id;
if ($anketa == 0) {
$anketa = $this->anketa;
}
- $uid = $global_user_id;
SurveyInfo::getInstance()->SurveyInit($anketa);
$rowa = SurveyInfo::getInstance()->getSurveyRow();
@@ -149,17 +150,28 @@ class Dostop {
}
// za demonstracijsko je posebno preverjanje
- if ($rowa['invisible'] == 1) {
+ if (isDemoSurvey($anketa)) {
+ return TRUE;
+ }
+
+ // ce je avtor ima vedno dostop do vsega
+ if ($global_user_id == $rowa['insert_uid']) {
return TRUE;
}
- $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$uid'");
+
+ $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id = '$anketa' AND uid='$global_user_id'");
if (mysqli_num_rows($sql) > 0) {
$row = mysqli_fetch_array($sql);
$dostop = explode(',', $row['dostop']);
if (in_array($type, $dostop)) {
- return TRUE;
+
+ // Odklepanje anekte - vrne ravno obratno
+ if($type == 'lock')
+ return FALSE;
+ else
+ return TRUE;
}
// managerji in admini majo vedno lepe linke in maile
@@ -170,7 +182,7 @@ class Dostop {
// administratorji in managerji imajo do max kar imajo njegovi podrejeni userji
if ($admin_type <= 1) {
- $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$uid')");
+ $sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$anketa' AND uid IN (SELECT user FROM srv_dostop_manage WHERE manager='$global_user_id')");
while ($row = mysqli_fetch_array($sql)) {
$dostop = explode(',', $row['dostop']);
@@ -190,82 +202,138 @@ class Dostop {
return TRUE;
}
- return FALSE;
+ // Odklepanje anekte - vrne ravno obratno
+ if($type == 'lock')
+ return TRUE;
+ else
+ return FALSE;
}
+ public function checkDostopSubFromNavigation($navigation){
+ global $admin_type;
+ global $global_user_id;
+
+ if ($navigation == NAVI_STATUS) {
+ $type = 'dashboard';
+ }
+ elseif ($navigation == NAVI_UREJANJE) {
+ if ($_GET['a'] == 'telephone')
+ $type = 'phone';
+ else
+ $type = 'edit';
+ }
+ elseif ($navigation == NAVI_TESTIRANJE) {
+ $type = 'test';
+ }
+ elseif ($navigation == NAVI_OBJAVA) {
+ $type = 'publish';
+ }
+ elseif ($navigation == NAVI_RESULTS && $_GET['m'] != 'monitoring') {
+ $type = 'data';
+ }
+ elseif ($navigation == NAVI_ANALYSIS) {
+ $type = 'analyse';
+ }
+ else{
+ return TRUE;
+ }
+
+ return $this->checkDostopSub($type);
+ }
+
+ // Izposemo obvestilo, da urednik nima dostopa do podstrani
+ public function displayDostopNoAccess($what=''){
+ global $lang;
+ global $site_url;
+
+ echo '<div class="user_dostop_sub_warning">';
+
+ echo ' <div class="no_access_title"> <span class="faicon lock_close yellow"></span>'.$lang['srv_dostop_sub_locked_title'].'</div>';
+
+ echo ' <div class="no_access_stavki">';
+ echo ' <p>'.$lang['srv_dostop_sub_locked_text'].'</p>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+
function ajax(){
- if ($_GET['a'] == 'manager_add_user') {
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+
+ if ($a == 'manager_add_user') {
$this->ajax_manager_add_user();
}
- elseif($_GET['a'] == 'add_new_user'){
+ elseif($a == 'add_new_user'){
$this->ajax_add_new_user();
}
- elseif ($_GET['a'] == 'anketa_user_dostop') {
+ elseif ($a == 'anketa_user_dostop') {
$this->ajax_anketa_user_dostop();
}
- elseif ($_GET['a'] == 'anketa_user_dostop_save') {
+ elseif ($a == 'anketa_user_dostop_save') {
$this->ajax_anketa_user_dostop_save();
}
- elseif ($_GET['a'] == 'edit_user') {
+ elseif ($a == 'edit_user') {
$this->ajax_edit_user();
}
- elseif ($_GET['a'] == 'edit_user_save') {
+ elseif ($a == 'edit_user_save') {
$this->ajax_edit_user_save();
}
- elseif ($_GET['a'] == 'admin_add_user') {
+ elseif ($a == 'admin_add_user') {
$this->ajax_admin_add_user();
}
- elseif ($_GET['a'] == 'admin_add_user_popup') {
+ elseif ($a == 'admin_add_user_popup') {
$this->ajax_admin_add_user_popup();
}
- elseif($_GET['a'] == 'find_user'){
+ elseif($a == 'find_user'){
$this->ajax_find_user();
}
- elseif ($_GET['a'] == 'edit_remove_user') {
+ elseif ($a == 'edit_remove_user') {
$this->ajax_edit_remove_user();
}
- elseif ($_GET['a'] == 'edit_remove_user_manager') {
+ elseif ($a == 'edit_remove_user_manager') {
$this->ajax_edit_remove_user_manager();
}
- elseif ($_GET['a'] == 'edit_remove_user_admin') {
+ elseif ($a == 'edit_remove_user_admin') {
$this->ajax_edit_remove_user_admin();
}
- elseif ($_GET['a'] == 'all_users_list') {
+ elseif ($a == 'all_users_list') {
- if ($_GET['m'] == 'delete') {
+ if ($m == 'delete') {
$this->ajax_all_users_list_delete();
}
- if ($_GET['m'] == 'ban') {
+ if ($m == 'ban') {
$this->ajax_all_users_list_ban();
}
else {
$this->ajax_all_users_list();
}
}
- elseif($_GET['a'] == 'my_users_list'){
+ elseif($a == 'my_users_list'){
$this->ajax_all_users_list_my();
}
- elseif ($_GET['a'] == 'delete_users_list') {
+ elseif ($a == 'delete_users_list') {
$this->ajax_delete_users_list();
}
- elseif ($_GET['a'] == 'unsigned_users_list') {
+ elseif ($a == 'unsigned_users_list') {
$this->ajax_unsigned_users_list();
}
- elseif ($_GET['a'] == 'unconfirmed_mail_user_list') {
+ elseif ($a == 'unconfirmed_mail_user_list') {
- if ($_GET['m'] == 'delete') {
+ if ($m == 'delete') {
$this->ajax_unconfirmed_mail_user_list_delet_user();
}
- elseif ($_GET['m'] == 'accept') {
+ elseif ($m == 'accept') {
$this->ajax_confirm_user_email();
}
else {
$this->ajax_unconfirmed_mail_user_list();
}
}
- elseif ($_GET['a'] == 'dodeljeni_uporabniki_display') {
+ elseif ($a == 'dodeljeni_uporabniki_display') {
$this->ajax_dodeljeni_uporabniki_display();
}
}
@@ -275,7 +343,7 @@ class Dostop {
*/
public function ajax_add_new_user()
{
- global $pass_salt, $site_url, $site_domain, $virtual_domain, $lang, $app_settings;
+ global $pass_salt, $site_url, $site_domain, $lang;
$email = $_POST['email'];
$name = $_POST['name'];
@@ -286,6 +354,7 @@ class Dostop {
include root_dir('lang/'.$jezik.'.php');
+ $error = '';
if ($email != '') {
@@ -294,7 +363,7 @@ class Dostop {
if ($password == '' || $password == $password2) {
- $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from, lang) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash(SHA256, $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1', $jezik)");
+ $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from, lang) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash('SHA256', $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1', $jezik)");
$id = mysqli_insert_id($GLOBALS['connect_db']);
} else {
@@ -317,26 +386,24 @@ class Dostop {
$UserContent .= $lang['register_add_user_content_edit'];
- $PageName = $app_settings['app_name'];
+ $PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
$change = '<a href="'.$site_url.'admin/survey/index.php?a=nastavitve&m=global_user_myProfile">';
- $out = '<a href="'.$this->page_urls['page_unregister'].'?email='.$email.'">';
// Ce gre slucajno za virtualko
- $Subject = ($virtual_domain) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
+ $Subject = (isVirtual()) ? $lang['register_user_subject_virtual'] : $lang['register_user_subject'];
$UserContent = str_replace("SFNAME", $name, $UserContent);
$UserContent = str_replace("SFMAIL", $email, $UserContent);
$UserContent = str_replace("SFWITH", $email, $UserContent);
$UserContent = str_replace("SFPAGENAME", $PageName, $UserContent);
$UserContent = str_replace("SFCHANGE", $change, $UserContent);
- $UserContent = str_replace("SFOUT", $out, $UserContent);
$UserContent = str_replace("SFEND", '</a>', $UserContent);
$Subject = str_replace("SFPAGENAME", $PageName, $Subject);
// Ce gre slucajno za virtualko
- if($virtual_domain)
+ if(isVirtual())
$Subject = str_replace("SFVIRTUALNAME", $site_domain, $Subject);
if ($password2 == "") {
@@ -384,7 +451,7 @@ class Dostop {
$error = 'email';
}
- header("Location: index.php?a=diagnostics&t=uporabniki&m=all&add=new&error=" . ($error !== FALSE ? $error : ''));
+ header("Location: index.php?a=diagnostics&t=uporabniki&m=all&add=new&error=".$error);
}
/**
@@ -411,6 +478,8 @@ class Dostop {
$password = $_POST['password'];
$password2 = $_POST['password2'];
+ $error = '';
+
if ($email != '') {
$sqlu = sisplet_query("SELECT id FROM users WHERE email='$email'");
@@ -418,7 +487,7 @@ class Dostop {
if ($password == '' || $password == $password2) {
- $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash(SHA256, $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
+ $s = sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surnname', '$email', '" . base64_encode((hash('SHA256', $password . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
$id = mysqli_insert_id($GLOBALS['connect_db']);
} else {
@@ -473,7 +542,7 @@ class Dostop {
$error = 'email';
}
- header("Location: index.php?a=diagnostics&t=uporabniki&m=my&error=" . ($error !== FALSE ? $error : ''));
+ header("Location: index.php?a=diagnostics&t=uporabniki&m=my&error=".$error);
}
/**
@@ -497,7 +566,8 @@ class Dostop {
echo '<div class="popup_close"><a href="#" onClick="anketa_user_dostop_close(); return false;">✕</a></div>';
- echo '<h3><span class="bold">';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">';
if ($r['type'] == 2 || $r['type'] == 3) {
echo $lang['admin_narocnik'];
@@ -511,7 +581,7 @@ class Dostop {
$r['email'] = iconv("iso-8859-2", "utf-8", $r['email']);
- echo ': ' . $r['name'] . ' ' . $r['surname'] . ' (' . $r['email'] . ')</span></h3>';
+ echo ': ' . $r['name'] . ' ' . $r['surname'] . ' (' . $r['email'] . ')</span>';
if ($r['type'] >= 2) {
@@ -520,49 +590,77 @@ class Dostop {
$dostop = explode(',', $row['dostop']);
echo '<form id="dostop">';
echo '<input type="hidden" name="uid" value="' . $uid . '">';
-
echo '<input type="hidden" name="aktiven" value="1" id="aktiven_1">';
- echo '<p><input type="checkbox" name="dostop[dashboard]" value="dashboard" id="dashboard" ' . (in_array('dashboard', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="dashboard">' . $lang['srv_dostop_dashboard'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[edit]" value="edit" id="edit" ' . (in_array('edit', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="edit">' . $lang['srv_dostop_edit'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[test]" value="test" id="test" ' . (in_array('test', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="test">' . $lang['srv_dostop_test'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[publish]" value="publish" id="publish" ' . (in_array('publish', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);"> <label for="publish">' . $lang['srv_dostop_publish'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[data]" value="data" id="data" ' . (in_array('data', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="data">' . $lang['srv_dostop_data'] . '</label></p>';
- echo '<p><input type="checkbox" name="dostop[analyse]" value="analyse" id="analyse" ' . (in_array('analyse', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="analyse">' . $lang['srv_dostop_analyse'] . '</label></p>';
-
- echo '<p><input type="checkbox" name="dostop[export]" value="export" id="export" ' . (in_array('export', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="export">' . $lang['srv_dostop_export'] . '</label></p>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[dashboard]" value="dashboard" id="dashboard" ' . (in_array('dashboard', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="dashboard">' . $lang['srv_dostop_dashboard'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[edit]" value="edit" id="edit" ' . (in_array('edit', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="edit">' . $lang['srv_dostop_edit'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[test]" value="test" id="test" ' . (in_array('test', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="test">' . $lang['srv_dostop_test'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[publish]" value="publish" id="publish" ' . (in_array('publish', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . ' onchange="dostop_language(this);">';
+ echo '<label for="publish">' . $lang['srv_dostop_publish'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[data]" value="data" id="data" ' . (in_array('data', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="data">' . $lang['srv_dostop_data'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[analyse]" value="analyse" id="analyse" ' . (in_array('analyse', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="analyse">' . $lang['srv_dostop_analyse'] . '</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[export]" value="export" id="export" ' . (in_array('export', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="export">' . $lang['srv_dostop_export'] . '</label>';
+ echo '</div>';
// Nastavitev, da ne more odklenit ankete
- echo '<p><input type="checkbox" name="dostop[lock]" value="lock" id="lock" ' . (in_array('lock', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '> <label for="lock">' . $lang['srv_dostop_lock'] . '</label></p>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[lock]" value="lock" id="lock" ' . (in_array('lock', $dostop) ? 'checked' : '') . ' ' . (in_array('phone', $dostop) ? ' disabled="disabled"' : '') . '>';
+ echo '<label for="lock">' . $lang['srv_dostop_lock'] . '</label>';
+ echo '</div>';
// Je anketar - ne more poceti nicesar razen izvajati telefonsko anketo (ob kliku se ostale avtomatsko ugasnejo in disablajo)
- echo '<p><input type="checkbox" name="dostop[phone]" value="phone" id="phone" ' . (in_array('phone', $dostop) ? 'checked' : '') . ' onchange="dostop_anketar(this);"> <label for="phone">' . $lang['srv_dostop_phone'] . '</label></p>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" name="dostop[phone]" value="phone" id="phone" ' . (in_array('phone', $dostop) ? 'checked' : '') . ' onchange="dostop_anketar(this);">';
+ echo '<label for="phone">' . $lang['srv_dostop_phone'] . '</label>';
+ echo '</div>';
+
+ echo '</div>';
// Če gre za Hierarhijo
if (SurveyInfo::checkSurveyModule('hierarhija', $this->anketa)) {
$tip = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE user_id='" . $uid . "' AND anketa_id='" . $this->anketa . "'", "obj");
if (!empty($tip) && !empty($tip->type)) {
- echo '<p><label>Uporabnik hierarhije s pravicami: </label>';
- echo '<select name="hierarchy_type" id="hierarchy-type-change" onchange="hierarhijaPravice()">
- <option value="10" ' . ($tip->type == 10 ? 'selected' : NULL) . '> Učitelj </option>
- <option value="2" ' . ($tip->type == 2 ? 'selected' : NULL) . '> Administrator </option>
- </select ></p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">Uporabnik hierarhije s pravicami:</span>';
+ echo '<select class="dropdown large" name="hierarchy_type" id="hierarchy-type-change" onchange="hierarhijaPravice()">
+ <option value="10" ' . ($tip->type == 10 ? 'selected' : NULL) . '> Učitelj </option>
+ <option value="2" ' . ($tip->type == 2 ? 'selected' : NULL) . '> Administrator </option>
+ </select >';
+ echo '</div>';
}
}
-
- echo '<div style="position: absolute; right: 10px; top: 50px; width: 200px;">';
-
// Ce je katerikoli od treh checkboxou ugasnjen imamo enablano editiranje samo posameznega jezik
$enable_lang = (!in_array('edit', $dostop) || !in_array('test', $dostop) || !in_array('publish', $dostop)) ? TRUE : FALSE;
$sqll = sisplet_query("SELECT * FROM srv_language WHERE ank_id = '$this->anketa'");
- if (mysqli_num_rows($sqll) > 0) {
- echo '<p><b>' . $lang['srv_passive_multilang'] . '</b></p>';
+ echo '<div class="setting_holder">';
+
+ if (mysqli_num_rows($sqll) > 0) {
+ echo '<span class="setting_title">' . $lang['srv_passive_multilang'] . ':</span>';
+
echo '<input type="hidden" name="dostop_language_edit" id="dostop_language_edit" value="' . ($enable_lang ? '1' : '0') . '">';
}
+
while ($rowl = mysqli_fetch_array($sqll)) {
$sqldl = sisplet_query("SELECT * FROM srv_dostop_language WHERE ank_id = '$this->anketa' AND uid = '$uid' AND lang_id='$rowl[lang_id]'");
@@ -575,16 +673,18 @@ class Dostop {
$checked = '';
}
- echo '<label><input class="dostop_language" type="checkbox" name="dostop_language[]" value="' . $uid . '-' . $rowl['lang_id'] . '" ' . $checked . ' ' . ($enable_lang ? '' : ' disabled="disabled"') . ' > ' . $rowl['language'] . '</label> <br>';
+ echo '<div class="setting_item">';
+ echo '<input class="dostop_language" type="checkbox" name="dostop_language[]" id="' . $uid . '-' . $rowl['lang_id'] . '" value="' . $uid . '-' . $rowl['lang_id'] . '" ' . $checked . ' ' . ($enable_lang ? '' : ' disabled') . ' >';
+ echo '<label ' . ($enable_lang ? '' : ' disabled') . ' for="' . $uid . '-' . $rowl['lang_id'] . '">' . $rowl['language'] . '</label>';
+ echo '</div>';
}
echo '</div>';
echo '</form>';
-
- echo '<div class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;" href="#"><span>' . $lang['edit1337'] . '</span></a></div>';
}
- // Manager - brez moznosti uporabe 1ka streznika
+
+ // Manager - brez moznosti uporabe 1ka streznika
elseif ($r['type'] == 1) {
$sql = sisplet_query("SELECT dostop FROM srv_dostop WHERE ank_id='$this->anketa' AND uid='$uid'");
@@ -629,8 +729,6 @@ class Dostop {
echo '</form>';
echo '<p>(' . $lang['srv_dostop_edit'] . ', ' . $lang['srv_dostop_data'] . ', ' . $lang['srv_dostop_export'] . ')</p>';
-
- echo '<div class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;" href="#"><span>' . $lang['edit1337'] . '</span></a></div>';
}
// Ostali ne morejo managerju nicesar spreminjati
else {
@@ -642,7 +740,10 @@ class Dostop {
echo '<p>(' . $lang['srv_dostop_edit'] . ', ' . $lang['srv_dostop_data'] . ', ' . $lang['srv_dostop_export'] . ')</p>';
}
- echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_gray" onclick="anketa_user_dostop_close(); return false;" href="#"><span>' . $lang['srv_zapri'] . '</span></a></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="anketa_user_dostop_close(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="anketa_user_dostop_save(\'' . $this->anketa . '\'); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
function ajax_anketa_user_dostop_save() {
@@ -680,7 +781,6 @@ class Dostop {
global $lang;
global $global_user_id;
global $admin_type;
- global $virtual_domain;
$uid = $_POST['uid'];
@@ -694,7 +794,8 @@ class Dostop {
echo '<form class="manager_add_user" name="manager_edit_user" action="ajax.php?t=dostop&a=edit_user_save&uid=' . $uid . '" method="post">';
- echo '<h2><strong>' . $lang['edit_user'] . '</strong></h2>';
+ echo '<h2>' . $lang['edit_user'] . '</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
// Segment tip uporabnika
echo '<div class="segment user_type">';
@@ -703,35 +804,65 @@ class Dostop {
// Emaila ne more vec editirat, ker je prevec problemov (izgubi ankete...)
echo '<input type="hidden" id="email" name="email" value="' . $row['email'] . '" />';
- echo '<p><label for="email">' . $lang['user2'] . ':</label>'.$row['name'].' '.$row['surname'].' ('.$row['email'].')</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['user2'] . ': '.$row['name'].' '.$row['surname'].' ('.$row['email'].')</span>';
+ echo '</div>';
// Admin lahko spreminja tip vseh userjev
if ($admin_type == 0) {
- echo '<p><label for="type">' . $lang['admin_type'] . '</label><select id="type" name="type">';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['admin_type'] . ':</span>';
+ echo '<select class="dropdown medium" id="type" name="type">';
echo '<option value="0" ' . ($row['type'] == '0' ? 'selected' : '') . '>' . $lang['admin_admin'] . '</option>';
echo '<option value="1" ' . ($row['type'] == '1' ? 'selected' : '') . '>' . $lang['admin_manager'] . '</option>';
echo '<option value="3" ' . ($row['type'] == '3' ? 'selected' : '') . '>' . $lang['admin_narocnik'] . '</option>';
- echo '</select></p>';
+ echo '</select>';
+ echo '</div>';
}
else {
echo '<input type="hidden" id="type" name="type" value="' . $row['type'] . '" />';
}
- echo '<p><label for="status">' . $lang['status'] . '</label><select name="status" id="status"><option value="1" ' . ($row['status'] == 1 ? 'selected' : '') . '>' . $lang['srv_user_notbanned'] . '</option><option value="0" ' . ($row['status'] == 0 ? 'selected' : '') . '>' . $lang['srv_user_banned'] . '</option></select></p>';
-
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['status'] . '</span>';
+ echo '<select class="dropdown medium" name="status" id="status"><option value="1" ' . ($row['status'] == 1 ? 'selected' : '') . '>' . $lang['srv_user_notbanned'] . '</option><option value="0" ' . ($row['status'] == 0 ? 'selected' : '') . '>' . $lang['srv_user_banned'] . '</option></select>';
+ echo '</div>';
+
echo '</div>';
// Segment osnovni podatki
echo '<div class="segment user_info">';
- echo '<p><label for="name">' . $lang['name'] . ':</label><input type="text" id="name" name="name" value="' . (!empty($row['name']) ? $row['name'] : '') . '" autocomplete="off" size="50"></p>';
- echo '<p><label for="surname">' . $lang['surname'] . ':</label><input type="text" id="surname" name="surname" value="' . (!empty($row['surname']) ? $row['surname'] : '') . '" size="50" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="password">' . $lang['password'] . ':</label><input type="password" id="password" name="password" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="password2">' . $lang['cms_register_user_repeat_password'] . ':</label><input type="password" id="password2" name="password2" readonly onfocus="this.removeAttribute(\'readonly\');"></p>';
- echo '<p><label for="subscription">'.$lang['srv_subscribe'].':</label>
- <input type="radio" id="subscriptionDa" name="gdpr_agree" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : '').'><label for="subscriptionDa" style="width: auto;">'.$lang['yes'].'</label>'.
- ' <input type="radio" id="subscriptionNe" class="spaceLeft" name="gdpr_agree" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : '').'><label for="subscriptionNe" style="width: auto;">'.$lang['no'].'</label>'.
- '</p>';
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['name'] . ':</span>';
+ echo '<input type="text" class="text medium" id="name" name="name" value="' . (!empty($row['name']) ? $row['name'] : '') . '" autocomplete="off" size="50">';
+ echo '</div>';
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['surname'] . ':</span>';
+ echo '<input type="text" class="text medium" id="surname" name="surname" value="' . (!empty($row['surname']) ? $row['surname'] : '') . '" size="50" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['password'] . ':</span>';
+ echo '<input type="password" class="text medium" id="password" name="password" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">' . $lang['cms_register_user_repeat_password'] . ':</span>';
+ echo '<input type="password" class="text medium" id="password2" name="password2" readonly onfocus="this.removeAttribute(\'readonly\');">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder horizontal">';
+ echo '<span class="setting_title">'.$lang['srv_subscribe'].':</span>';
+ echo '<input type="radio" id="subscriptionDa" name="gdpr_agree" value="1" '.($row['gdpr_agree'] == 1 ? 'checked="checked"' : '').'><label for="subscriptionDa" style="width: auto;">'.$lang['yes'].'</label>'.
+ ' <input type="radio" id="subscriptionNe" class="spaceLeft" name="gdpr_agree" value="0" '.($row['gdpr_agree'] == 0 ? 'checked="checked"' : '').'><label for="subscriptionNe" style="width: auto;">'.$lang['no'].'</label>';
+ echo '</div>';
$user_2fa_validate = User::option($uid, 'google-2fa-validation');
if($admin_type == 0 && !empty($user_2fa_validate) && $user_2fa_validate != 'NOT') {
@@ -754,19 +885,20 @@ class Dostop {
}
// Na virtualkah manager ne sme odstraniti uporabnika iz pregleda (zaradi omejitve)
- if($admin_type != '1' || !$virtual_domain){
+ if($admin_type != '1' || !isVirtual()){
$sqlu = sisplet_query("SELECT * FROM srv_dostop_manage WHERE manager='$global_user_id' AND user='$uid'");
if (mysqli_num_rows($sqlu) > 0) {
- echo '<br /><p><a href="ajax.php?t=dostop&a=edit_remove_user&uid=' . $uid . '" onclick="if ( confirm(\'?\')) { } else {return false;}">' . $lang['srv_manager_rem_user2'] . '</a></p>';
+ echo '<div class="setting_holder horizontal">';
+ echo '<a href="ajax.php?t=dostop&a=edit_remove_user&uid='.$uid.'"><button class="small blue" onclick="if ( confirm(\'?\')) { } else {return false;}">'.$lang['srv_manager_rem_user2'].'</button></a>';
+ echo '</div>';
}
}
echo '</div>';
// Segment paket
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<div class="segment user_package">';
$userAccess = UserAccess::getInstance($uid);
@@ -776,20 +908,20 @@ class Dostop {
$time_expire = (isset($userAccess_data['time_expire'])) ? date('d.m.Y', strtotime($userAccess_data['time_expire'])) : '';
// Paket
- echo '<p>';
- echo ' <label for="package">' . $lang['srv_access_package'] . ':</label>';
- echo ' <select name="package" id="package">';
+ echo '<div class="setting_holder horizontal">';
+ echo ' <span class="setting_title">' . $lang['srv_access_package'] . ':</span>';
+ echo ' <select name="package" id="package" class="dropdown medium">';
foreach($userAccess->getPackages() as $package_id => $package){
echo ' <option value="'.$package_id.'" '.($package_id == $active_package ? 'selected="selected"' : '').'>'.$package['name'].'</option>';
}
echo ' </select>';
- echo '</p>';
+ echo '</div>';
// Trajanje paketa
- echo '<p>';
- echo ' <label for="package_expire">' . ucfirst($lang['srv_access_package_valid']) . ':</label>';
- echo ' <input type="text" name="package_expire" id="package_expire" value="'.$time_expire.'" style="width:80px;">';
- echo '</p>';
+ echo '<div class="setting_holder horizontal">';
+ echo ' <span class="setting_title">' . ucfirst($lang['srv_access_package_valid']) . ':</span>';
+ echo ' <input type="text" name="package_expire" id="package_expire" value="'.$time_expire.'" class="medium">';
+ echo '</div>';
echo '
<script type="text/javascript">
@@ -807,7 +939,7 @@ class Dostop {
// SEZNAM ANKET
echo '<div class="survey_list">';
- echo ' <h3><strong>' . $lang['srv_ankete'] . '</strong></h3>';
+ echo ' <p class="semi-bold">' . $lang['srv_ankete'] . '</p>';
echo ' <ul>';
$sql = sisplet_query("SELECT srv_anketa.id, srv_anketa.naslov FROM srv_dostop, srv_anketa WHERE srv_dostop.uid='". $uid ."' AND srv_dostop.ank_id=srv_anketa.id ORDER BY srv_anketa.edit_time DESC");
@@ -822,10 +954,11 @@ class Dostop {
// GUMBI NA DNU
- echo '<p>';
- echo ' <div class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="edit_user_close();"><span>'.$lang['srv_zapri'].'</span></a></div>';
- echo ' <div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.manager_edit_user.submit();"><span>'.$lang['edit1337'].'</span></a></div>';
- echo '</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="edit_user_close();">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="document.manager_edit_user.submit();">'.$lang['edit1337'].'</button>';
+ echo '</div>';
}
function ajax_edit_user_save(){
@@ -1135,8 +1268,9 @@ class Dostop {
" WHERE u.email NOT LIKE ('D3LMD-%') AND u.email NOT LIKE ('UNSU8MD-%') ".$iskanjeSql;
// Filtri, ki jih datatables pošilja in po katerih filtriramo
- if($_POST['order'][0]['column'] < 12) {
+ if($_POST['order'][0]['column'] < 13) {
$orderPolje = [
+ "u.name",
"u.name ".$_POST['order'][0]['dir'].", u.surname",
"u.email",
"u.type",
@@ -1184,6 +1318,9 @@ class Dostop {
foreach ($vsi as $uporabnik) {
$seznam[] = [
+ '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
+ '<span class="gray"> | </span><a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'red' : 'link-sv-moder').'"></i></a>'.
+ '<span class="gray"> | </span><a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
(!empty($uporabnik->second_email) ? iconv(mb_detect_encoding( $uporabnik->second_email, mb_detect_order(), true), "UTF-8", $uporabnik->second_email) : iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email)),
$this->userTypeToText($uporabnik->type),
@@ -1195,10 +1332,7 @@ class Dostop {
(!empty($uporabnik->st_managerjev) ? $uporabnik->st_managerjev : 0),
$lang["users_gdpr".$uporabnik->gdpr_agree],
$uporabnik->registriran,
- $uporabnik->last_login,
- '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'link-rdec' : 'link-sv-moder').'"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>'
+ $uporabnik->last_login
];
}
}
@@ -1213,7 +1347,7 @@ class Dostop {
// Število filtriranih zadetkov
$recordFiltered = $recordsTotal;
- if(!empty($_POST['search']['value']))
+ if(!empty($_POST['search']['value']) && is_countable($vsi))
$recordFiltered = sizeof($vsi);
echo json_encode([
@@ -1262,8 +1396,9 @@ class Dostop {
// Filtri, ki jih datatables pošilja in po katerih filtriramo
- if($_POST['order'][0]['column'] < 10) {
+ if($_POST['order'][0]['column'] < 11) {
$orderPolje = [
+ "u.name",
"u.name ".$_POST['order'][0]['dir'].", u.surname",
"u.email",
"u.type",
@@ -1309,6 +1444,9 @@ class Dostop {
foreach ($vsi as $uporabnik) {
$seznam[] = [
+ '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
+ ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'red' : 'link-sv-moder').'"></i></a>'.
+ ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
(!empty($uporabnik->second_email) ? iconv(mb_detect_encoding( $uporabnik->second_email, mb_detect_order(), true), "UTF-8", $uporabnik->second_email) : iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email)),
$this->userTypeToText($uporabnik->type),
@@ -1318,30 +1456,26 @@ class Dostop {
(!empty($uporabnik->st_arhivskih) ? $uporabnik->st_arhivskih : 0),
$lang["users_gdpr".$uporabnik->gdpr_agree],
$uporabnik->registriran,
- $uporabnik->last_login,
- '<a href="#" onclick="edit_user(\''.$uporabnik->id.'\'); return false;" title="'.$lang['srv_info_modify'].'"><i class="fa fa-pencil-alt link-sv-moder"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'ban\'); return false;" title="'.$lang[($uporabnik->status == 0 ? 'srv_user_banned' : 'srv_user_notbanned')].'"><i class="fa fa-ban '.($uporabnik->status == 0 ? 'link-rdec' : 'link-sv-moder').'"></i></a>'.
- ' | <a href="#" onclick="vsiUporabnikiAkcija(\''.$uporabnik->id.'\', \'delete\'); return false;" title="'.$lang['srv_multicrosstabs_tables_delete_short'].'"><i class="fa fa-times link-sv-moder"></i></a>'
+ $uporabnik->last_login
];
}
}
// Število vseh zadetkov, ki jih imamo v bazi
- $recordsTotal = 0;
- $recordsTotal = sizeof($vsi);
+ $recordsTotal = (is_countable($vsi)) ? sizeof($vsi) : 0;
// Število filtriranih zadetkov
$recordFiltered = $recordsTotal;
if(!empty($_POST['search']['value']))
- $recordFiltered = sizeof($vsi);
+ $recordFiltered = $recordsTotal;
echo json_encode([
- "draw" => (!empty($_POST['draw']) ? $_POST['draw'] : 1),
- "recordsTotal" => $recordsTotal,
- "recordsFiltered" => $recordFiltered,
- "data" => $seznam // polje z vsebino
- ]);
+ "draw" => (!empty($_POST['draw']) ? $_POST['draw'] : 1),
+ "recordsTotal" => $recordsTotal,
+ "recordsFiltered" => $recordFiltered,
+ "data" => $seznam // polje z vsebino
+ ]);
}
/**
@@ -1507,7 +1641,6 @@ class Dostop {
public function ajax_confirm_user_email(){
global $pass_salt;
global $lang;
- global $app_settings;
$uid = (!empty($_POST['uid']) ? $_POST['uid'] : NULL);
@@ -1522,9 +1655,14 @@ class Dostop {
$r = mysqli_fetch_assoc($result);
$g = base64_encode((hash('SHA256', base64_decode($r['pass']) . $pass_salt)));
- sisplet_query("INSERT INTO users (type, email, name, surname, pass, status, gdpr_agree, when_reg, came_from, lang, manuallyApproved)
+ $sqlCopy = sisplet_query("INSERT INTO users (type, email, name, surname, pass, status, gdpr_agree, when_reg, came_from, lang, manuallyApproved)
VALUES ('" . $r['type'] . "', '" . $r['email'] . "', '" . $r['name'] . "', '" . $r['surname'] . "', '" . $g . "','" . $r['status'] . "', '" . $r['gdpr_agree'] . "','" . $r['when_reg'] . "', '" . $r['came_from'] . "', '" . $r['lang'] . "', 'Y')");
- sisplet_query("DELETE FROM users_to_be WHERE id='" . $uid . "' OR email='" . $r['email'] . "'");
+ if (!$sqlCopy) {
+ echo mysqli_error($GLOBALS['connect_db']);
+ return;
+ }
+
+ sisplet_query("DELETE FROM users_to_be WHERE id='" . $uid . "' OR email='" . $r['email'] . "'");
// Uporabniku posljemo email da je bil njegov racun aktiviran
@@ -1537,7 +1675,7 @@ class Dostop {
// Ce gre slucajno za virutalko
$Subject = $lang['confirmed_user_mail_subject'];
- $PageName = $app_settings['app_name'];
+ $PageName = AppSettings::getInstance()->getSetting('app_settings-app_name');
$ZaMail = '<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.0 Transitional//EN">'.'<html><head> <title>'.$Subject.'</title><meta content="text/html; charset=utf-8" http-equiv=Content-type></head><body>';
// Besedilo v lang dilu je potrebno popravit, ker nimamo vec cel kup parametrov
@@ -1593,13 +1731,13 @@ class Dostop {
$seznam = [];
foreach ($nepotrjeni as $uporabnik) {
$seznam[] = [
+ '<span onclick="potrdiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="' . $lang['confirm_user_in_db'] . '" class="faicon fa-check pointer blue"></span> | ' .
+ '<span onclick="izbrisiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="'.$lang['delete_user_in_db'].'" class="faicon fa-times pointer blue"></span>',
iconv(mb_detect_encoding( $uporabnik->name, mb_detect_order(), true), "UTF-8", $uporabnik->name) .' '.iconv(mb_detect_encoding( $uporabnik->surname, mb_detect_order(), true), "UTF-8", $uporabnik->surname),
iconv(mb_detect_encoding( $uporabnik->email, mb_detect_order(), true), "UTF-8", $uporabnik->email),
$this->userTypeToText($uporabnik->type),
$admin_languages[$uporabnik->lang],
$uporabnik->registriran,
- '<a href="#" onclick="potrdiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="' . $lang['confirm_user_in_db'] . '"><i class="fa fa-check link-sv-moder"></i> <span class="no-print"> | </span>' .
- '<a href="#" onclick="izbrisiNepotrjenegaUporabnika(' . $uporabnik->id . ')" title="'.$lang['delete_user_in_db'].'"><i class="fa fa-times link-sv-moder"></a>',
];
}
}
@@ -1645,7 +1783,7 @@ class Dostop {
echo ' - <span class="red italic">NEAKTIVEN</span>';
echo ' </span>';
- echo ' <span><a onClick="dodeljeni_uporabniki_remove(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['hour_remove'].'</a></span>';
+ echo ' <span class="faicon delete" onClick="dodeljeni_uporabniki_remove(\''.$manager.'\', \''.$rowUsers['id'].'\');" title="'.$lang['hour_remove'].'"></span>';
echo '</li>';
}
@@ -1654,18 +1792,13 @@ class Dostop {
}
// Dodajanje novega uporabnika
- echo '<h4>'.$lang['srv_manager_add_admin'].'</h4>';
- echo '<div class="add_user">';
- echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
-
- echo '<h3><b>'.$lang['srv_manager_add_user_popup'].'</b></h3>';
- echo '<p><select name="add_user_id" id="add_user_id" class="js-obstojeci-uporabniki-admin-ajax" style="width: 300px;"></select></p>';
+ echo '<div class="seting_holder add_user">';
- echo '<p><div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onClick="dodeljeni_uporabniki_add(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['add'].'</a>';
- echo '</div></p><br><br>';
-
+ echo '<label for="add_user_id">'.$lang['srv_manager_add_user_popup'].':</label>';
+ echo '<form class="manager_add_user" name="admin_add_dostop" action="ajax.php?t=dostop&a=admin_add_user" method="post">';
+ echo ' <select name="add_user_id" id="add_user_id" class="js-obstojeci-uporabniki-admin-ajax dropdown" style="width: 300px;"></select>';
+ echo ' <button class="medium blue" onClick="dodeljeni_uporabniki_add(\''.$manager.'\', \''.$rowUsers['id'].'\');">'.$lang['add'].'</button>';
echo '</form>';
echo '<script>$(\'.js-obstojeci-uporabniki-admin-ajax\').select2({
@@ -1681,8 +1814,8 @@ class Dostop {
echo '</div>';
- echo '<div class="buttons_holder">';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_zapri'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dodeljeni_uporabniki_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></span>';
+ echo '<div class="button_holder">';
+ echo ' <button class="blue medium" onclick="dodeljeni_uporabniki_close(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
}
@@ -1736,6 +1869,7 @@ class Dostop {
*/
function getManagersDostop()
{
+ $dostop = array();
$sql = sisplet_query("SELECT u.* FROM users u, srv_dostop_manage m WHERE u.id=m.manager AND m.user IN (SELECT uid FROM srv_dostop WHERE ank_id='$this->anketa') ");
while ($row = mysqli_fetch_array($sql)) {
diff --git a/admin/survey/classes/class.Forum.php b/admin/survey/classes/class.Forum.php
index a82ea10..88f365f 100644
--- a/admin/survey/classes/class.Forum.php
+++ b/admin/survey/classes/class.Forum.php
@@ -6,8 +6,6 @@ class Forum {
var $currentForum; // Trenutni forum kjer se nahaja user
var $currentThread; // Trenutna tema kjer se nahaja user
var $currentPost; // Trenutni post kjer se nahaja user
-
- var $currentForumNice; // NiceLink trenutnega foruma
var $displayPosts; // 0 zaporedno, 1 nitno, 2 stavcno
var $displayColumn; // 3, 2, 1 - stevilo stolpcev
@@ -34,11 +32,7 @@ class Forum {
$this->currentPost = $p;
$this->uid = $this->uid();
-
- $r = sisplet_query ("SELECT NiceLink FROM forum WHERE id='" .$this->currentForum ."'");
- $rr = mysqli_fetch_row ($r);
- $this->currentForumNice = $rr[0];
-
+
if (isset($_COOKIE['DP'])) {
$this->displayPosts = $_COOKIE['DP'];
} else {
@@ -135,7 +129,8 @@ class Forum {
if ($this->currentPost > 0) {
$parent = $this->currentPost;
- } elseif ($this->currentThread > 0) {
+ }
+ elseif ($this->currentThread > 0) {
$parent = $this->currentThread;
}
@@ -144,23 +139,13 @@ class Forum {
$resu = sisplet_query ("SELECT name FROM users WHERE id='" .$uid ."'");
$ru = mysqli_fetch_row ($resu);
$user = $ru[0];
- } else {
+ }
+ else {
$uid = 0;
$user = $avtor;
}
if ($admin_type == -1 || $global_user_id==0) {
- if (isset($_POST['SessID']) && isset($_POST['prepis'])) {
- // Prepis kode
- $handle = $_POST['SessID'];
- $resultCD = sisplet_query ("SELECT code FROM registers WHERE handle='$handle'");
- $sqlCD = mysqli_fetch_row($resultCD);
-
- if (strtolower ($_POST['prepis']) != strtolower ($sqlCD[0]) || mysqli_num_rows($resultCD)==0)
- die($lang['nu_regp_pict'] .'<br><br><a href="' .$site_url .'">' .$lang['home'] .'</a>');
-
- $vsebina = nl2br($vsebina); // neprijavljeni userji nimajo editorja in se ne nardijo <br>
- } else
die($lang['nu_regp_pict'] .'<br><br><a href="' .$site_url .'">' .$lang['home'] .'</a>');
}
@@ -173,9 +158,11 @@ class Forum {
$sql1 = sisplet_query("SELECT naslov FROM $t WHERE $_id = '$id'");
$row1 = mysqli_fetch_row($sql1);
$vsebina = $lang['news_comment_txt'].' <a href="'.$site_url.'index.php?fl=2&amp;lact=1&amp;bid='.$id.'">'.$row1[0].'</a>';
- } elseif ($new == '-1') { // navigacija
+ }
+ elseif ($new == '-1') { // navigacija
$vsebina = $lang['news_comment_txt'].' <a href="'.$site_url.'index.php?fl=1&amp;nt=9&amp;sid='.$id.'">'.$naslov.'</a>';
- } else { // novice
+ }
+ else { // novice
$t = $this->getTable($new);
$_id = 'sid';
@@ -187,52 +174,16 @@ class Forum {
}
}
- // obvescanje na mail - nov (neprijavljen) user se hoce narocit
- // Sem premaknil gor, da spremenimo ime avtorja preden dodamo post! --may
- if (isset($_POST['alertmail'])) {
+ $admin = isset($_POST['admin']) ? $_POST['admin'] : '';
- if ($_POST['alertmail'] != '') {
- $mail = $_POST['alertmail'];
- $sqla = sisplet_query("SELECT id FROM users WHERE email = '$mail'");
+ if (isset($_POST['admin_override']) && $_POST['admin_override'] == "1")
+ $admin = 0;
- if (mysqli_num_rows($sqla) > 0) {
- $rowa = mysqli_fetch_row($sqla);
- $narocnikID = $rowa[0];
- } else {
+ if (!isset($_POST['admin']))
+ $admin = 3;
- // Preveri ali je vzdevek ze zaseden- ce je, mu dodaj neko stevilko da bo unique
- $a2 = $avtor;
-
- $result = sisplet_query ("SELECT * FROM users WHERE name='$a2' AND surname=''");
- while (mysqli_num_rows ($result) > 0) {
- $a2 = $avtor .rand(0, 32767);
- $result = sisplet_query ("SELECT * FROM users WHERE name='$a2' AND surname=''");
- }
-
- $avtor = $a2;
- $g = base64_encode((hash('SHA256', '' .$pass_salt)));
-
- $sqln = sisplet_query("INSERT INTO users (email, name, when_reg, came_from, pass) VALUES ('" .$_POST['alertmail'] ."', '$avtor', NOW(), '2', '$g')");
- $narocnikID = mysqli_insert_id($GLOBALS['connect_db']);
-
- // Ker je noviregistriran mu dajmo se UID.
- $uid = $narocnikID;
- $user = "";
- }
-
- setcookie("uid", base64_encode ($mail), time()+3600*24*365, "/", $cookie_domain);
- setcookie("secret", base64_encode((hash('SHA256', '' .$pass_salt))), time()+3600*24*365, "/", $cookie_domain);
-
- $sqlaa = sisplet_query("INSERT INTO obvescanje_tema (uid, tid) VALUES ('" .$narocnikID ."', '" .$this->currentThread ."')");
- $sqlaa = sisplet_query("UPDATE post SET uid='" .$narocnikID ."', user='' WHERE id='" .$this->currentPost ."'");
- }
- }
-
- $admin = $_POST['admin'];
- if (isset ($_POST['admin_override']) && $_POST['admin_override'] == "1") $admin = 0;
-
- if (!isset ($_POST['admin'])) $admin = 3;
- if (isset ($_POST['sporocilo']) && !($new != 0 && $id != 0)) $admin = $_POST['sporocilo'];
+ if (isset($_POST['sporocilo']) && !($new != 0 && $id != 0))
+ $admin = $_POST['sporocilo'];
// preveri ce moras nastaviti dispauth
$la = sisplet_query ("SELECT lockedauth FROM forum WHERE id='" .$this->currentForum ."' AND lockedauth=1");
@@ -245,15 +196,6 @@ class Forum {
if (!$sql) $error = mysqli_error($GLOBALS['connect_db']);
$ittdd = mysqli_insert_id($GLOBALS['connect_db']); // tale ID je pomemben na koncu, ker se ga returna na koncu funkcije !
- // Ce je to nova tema, potem naredi link.
- if ($parent == 0) {
- $fnl = sisplet_query ("SELECT NiceLink FROM forum WHERE id='" .$this->currentForum ."'");
- $fnlr = mysqli_fetch_row ($fnl);
- $flink = preg_replace ("/(.*?[^\/])\/\/(.*?[^\/])\/(.*?[^\/])\/(.*?[^\/])\/(.*)/i", "$5", $rnlr[0]);
-
- sisplet_query ("UPDATE post SET NiceLink = '" .$site_url .'thread/' .$this->currentForum .'/' .$ittdd .'/' .$flink .'/' .$naslov .'/' ."' WHERE id='" .$ittdd ."'");
- }
-
// dodaj v index...
$this->setPost($ittdd);
@@ -266,59 +208,6 @@ class Forum {
}
$sql = sisplet_query("UPDATE post SET time2=NOW() WHERE id='".$this->currentThread."'");
-
-
- // obvescanje na mail
- if (isset($_POST['alert'])) {
- $sqlaa = sisplet_query("SELECT * FROM obvescanje_tema WHERE uid='" .$global_user_id ."' AND tid='" .$this->currentThread ."'");
- if (mysqli_num_rows($sqlaa) == 0) {
- $sqla = sisplet_query("INSERT INTO obvescanje_tema (uid, tid) VALUES ('" .$global_user_id ."', '" .$this->currentThread ."')");
- }
- } else {
- $sqlaa = sisplet_query("DELETE FROM obvescanje_tema WHERE uid='" .$global_user_id ."' AND tid='" .$this->currentThread ."'");
- }
-
- // hendlanje skupin - GROUP
- if (isset($_POST['group']) && $_POST['group']!='') {
-
- $group = $_POST['group'];
- $mails = explode("\n", $group);
-
- foreach ($mails as $key => $mail) {
- $mail = trim($mail);
- $sqla = sisplet_query("SELECT id FROM users WHERE email = '$mail'");
-
- if (mysqli_num_rows($sqla) > 0) {
- $rowa = mysqli_fetch_row($sqla);
- $narocnikID = $rowa[0];
- } else {
- $g = base64_encode((hash('SHA256', '' .$pass_salt)));
- $sqln = sisplet_query("INSERT INTO users (email, name, when_reg, camefrom, pass) VALUES ('$mail', '$mail', NOW(), '2', '$g')");
- $narocnikID = mysqli_insert_id($GLOBALS['connect_db']);
- }
-
- $sqlaa = sisplet_query("INSERT INTO obvescanje_tema (uid, tid) VALUES ('$narocnikID', '" .$this->currentThread ."')");
- $sqlaa = sisplet_query("INSERT INTO forum_group (uid, tid) VALUES ('$narocnikID', '" .$this->currentThread ."')");
- }
- $sqlaa = sisplet_query("INSERT INTO forum_group (uid, tid) VALUES ('" .$global_user_id ."', '" .$this->currentThread ."')");
- }
-
- if (isset($_GET['table'])) {
- $this->setTableID($_GET['table']);
- if (isset($_GET['column'])) {
- $this->setColumnID($_GET['column']);
- }
-
- $t = $this->getTable($this->tableID);
- $sqlc = sisplet_query("UPDATE $t SET thread='".$this->currentThread."' WHERE ".($this->tableID<=10?'s':'')."id='".$this->columnID."' AND thread='0'");
- }
- if (!isset($_GET['table']) && isset($_GET['column'])) {
- $sqlc = sisplet_query("UPDATE menu SET thread='" .$this->currentThread ."' WHERE id='" .$_GET['column'] ."'");
- }
- $user_id = $global_user_id;
-
- if ($mail_alert)
- include('alert.php');
}
return $ittdd;
@@ -368,24 +257,33 @@ class Forum {
global $skin_name;
if ($uid > 0) {
- $sql = sisplet_query("SELECT email, name, show_email FROM users WHERE id='$uid'");
+
+ $sql = sisplet_query("SELECT email, name, show_email FROM users WHERE id='$uid'");
$row = mysqli_fetch_row($sql);
- $return = '';
+
+ $return = '';
- if ($link == 1) $return .= '<a href="'.$site_url.'forums/?lact=2&amp;uid='.$uid.'">';
- if ($row[1] != '') {
+ if ($link == 1)
+ $return .= '<a href="'.$site_url.'forums/?lact=2&amp;uid='.$uid.'">';
+
+ if ($row[1] != '') {
$return .= $row[1];
- } elseif ($row[2] == 2) {
+ }
+ elseif ($row[2] == 2) {
$return .= $row[0];
- } else {
+ }
+ else {
$return .= $lang['user2'];
}
+
if ($link == 1) $return .= '</a>';
- return $return;
- } elseif ($user != '') {
+ return $return;
+ }
+ elseif ($user != '') {
return $user;
- } else {
- return $lang['guest'];
+ }
+ else {
+ return $lang['respondent'];
}
}
@@ -404,26 +302,10 @@ class Forum {
}
// Polepsa izpis datuma in ure
- function datetime($time) {
- global $admin_type;
-
- $sql = sisplet_query("SELECT value FROM misc WHERE what='ForumHourDisplay'");
- $row = mysqli_fetch_row($sql);
-
- // Funkcija se klice zelooooo pogosto, zato sem vrgel ven substr in sestavljam rocno, je hitreje.
- if ($row[0] == 0 || $admin_type==0)
- return $time[8] .$time[9] ."." .$time[5] .$time[6] ."." .$time[0] .$time[1] .$time[2] .$time[3] ." " .$time[11] .$time[12] .":" .$time[14] .$time[15];
- else
- return $time[8] .$time[9] ."." .$time[5] .$time[6] ."." .$time[0] .$time[1] .$time[2] .$time[3];
- }
-
- // Polepsa izpis datuma in ure
function datetime1($time) {
global $admin_type;
- $sql = sisplet_query("SELECT value FROM misc WHERE what='ForumHourDisplay'");
- $row = mysqli_fetch_row($sql);
- if ($row[0] == 0 || $admin_type==0)
+ if ($admin_type==0)
return $time[8] .$time[9] ."." .$time[5] .$time[6] ." " .$time[11] .$time[12] .":" .$time[14] .$time[15];
else
return $time[8] .$time[9] ."." .$time[5] .$time[6];
diff --git a/admin/survey/classes/class.GDPR.php b/admin/survey/classes/class.GDPR.php
index c5a6c2c..6bb7b2b 100644
--- a/admin/survey/classes/class.GDPR.php
+++ b/admin/survey/classes/class.GDPR.php
@@ -37,7 +37,7 @@ class GDPR{
array('country'=>'Portugal', 'drzava'=>'Portugalska', 'name'=>'Filipa CALVÃO', 'title'=>'President, Comissão Nacional de Protecção de Dados', 'email'=>'geral@cnpd.pt', 'phone'=>'+351 21 392 84 00', 'fax'=>'+351 21 397 68 32'),
array('country'=>'Romania', 'drzava'=>'Romunija', 'name'=>'Ancuţa Gianina OPRE', 'title'=>'President of the National Supervisory Authority for Personal Data Processing', 'email'=>'anspdcp@dataprotection.ro', 'phone'=>'+40 21 252 5599', 'fax'=>'+40 21 252 5757'),
array('country'=>'Slovakia', 'drzava'=>'Slovaška', 'name'=>'Soňa PŐTHEOVÁ', 'title'=>'President of the Office for Personal Data Protection of the Slovak Republic', 'email'=>'statny.dozor@pdp.gov.sk', 'phone'=>'+ 421 2 32 31 32 14', 'fax'=>'+ 421 2 32 31 32 34'),
- array('country'=>'Slovenia', 'drzava'=>'Slovenija', 'name'=>'Mojca PRELESNIK', 'title'=>'Information Commissioner of the Republic of Slovenia', 'email'=>'gp.ip@ip-rs.si', 'phone'=>'+386 1 230 9730', 'fax'=>'+386 1 230 9778'),
+ array('country'=>'Slovenia', 'drzava'=>'Slovenija', 'name'=>'Mojca PRELESNIK', 'title'=>'Informacijska pooblaščenka Republike Slovenije', 'email'=>'gp.ip@ip-rs.si', 'phone'=>'+386 1 230 9730', 'fax'=>'+386 1 230 9778'),
array('country'=>'Spain', 'drzava'=>'Španija', 'name'=>'María del Mar España Martí', 'title'=>'Director of the Spanish Data Protection Agency', 'email'=>'internacional@agpd.es', 'phone'=>'+34 91399 6200', 'fax'=>'+34 91455 5699'),
array('country'=>'Sweden', 'drzava'=>'Švedska', 'name'=>'Kristina SVAHN STARRSJÖ', 'title'=>'Director General of the Data Inspection Board', 'email'=>'datainspektionen@datainspektionen.se', 'phone'=>'+46 8 657 6100', 'fax'=>'+46 8 652 8652'),
array('country'=>'United Kingdom', 'drzava'=>'Velika Britanija', 'name'=>'Elizabeth DENHAM', 'title'=>'Information Commissioner', 'email'=>'international.team@ico.org.uk', 'phone'=>'+44 1625 545 745', 'fax'=>''),
@@ -55,53 +55,102 @@ class GDPR{
global $site_url;
global $lang;
- $survey_list = array();
- $survey_list = $this->getUserSurveys();
+ // Dobimo seznam vseh anket in stevilke
+ list($survey_list, $survey_count) = $this->getUserSurveys();
+
+
+ // 3 boxi na vrhu za filtriranje tabele (gdpr ankete, ne-gdpr ankete, potencialno gdpr ankete)
+ echo '<div class="gdpr-box-container">';
+
+ // Box 1 - gdpr ankete
+ echo ' <div class= "num_box num_box1 checked" id="num_box1" onclick="gdpr_ankete()">';
+
+ echo ' <div id="box_flex" class="box_flex">';
+ echo ' <input type="checkbox" name="GDPR ankete checkbox" id="gdpr_ankete_check" checked="checked" onclick="gdpr_ankete()">';
+ echo ' <div class="naslov_gdpr">'.$lang['srv_gdpr_survey_list_gdpr_surveys'].'</div>';
+ echo ' </div>';
+
+
+ echo ' <div class="box_text">';
+ echo ' <p id="p_num_of_surveys1"> <span class="num_of_surveys" id="num_of_surveys1"> '.$survey_count['gdpr'].' </span> '.$lang['srv_gdpr_survey_list_gdpr_surveys_note'].'</p>';
+ echo ' </div>';
+ echo ' </div>';
+
+ // Box 2 - gdpr ankete
+ echo ' <div class= "num_box num_box2 checked" id="num_box2" onclick="potenc_gdpr_ankete()">';
+
+ echo ' <div id="box_flex" class="box_flex potenc_gdpr">';
+ echo ' <input type="checkbox" name="Potencialno GDPR ankete" id="potenc_gdpr_ankete_check" checked="checked" onclick="potenc_gdpr_ankete()">';
+ echo ' <div class="naslov_gdpr">'.$lang['srv_gdpr_survey_list_potenc_gdpr_surveys'].'</div>';
+ echo ' </div>';
+
+ echo ' <div class="box_text">';
+ echo ' <p id="p_num_of_surveys2"> <span class="num_of_surveys" id="num_of_surveys2"> '.$survey_count['potential_gdpr'].' </span> '.$lang['srv_gdpr_survey_list_potenc_gdpr_surveys_note'].'</p>';
+ echo ' </div>';
- echo '<div style="font-style:italic; margin-top:-10px;">';
+ echo ' </div>';
+
+ // Box 3 - gdpr ankete
+ echo ' <div class= "num_box num_box3 checked" id="num_box3" onclick="ne_gdpr_ankete()">';
- echo '<p>'.$lang['srv_gdpr_survey_list_text'].'</p>';
+ echo ' <div id="box_flex" class="box_flex no_gdpr">';
+ echo ' <input type="checkbox" name="ne-gdpr ankete" id="ne_gdpr_ankete" checked="checked" onclick="ne_gdpr_ankete()" >';
+ echo ' <div class="naslov_gdpr">'.$lang['srv_gdpr_survey_list_no_gdpr_surveys'].'</div>';
+ echo ' </div>';
- echo $lang['srv_gdpr_survey_list_text2'].'<ul style="margin-top:2px;">';
- echo ' <li>'.$lang['srv_gdpr_survey_list_li_1'].'</li>';
- echo ' <li>'.$lang['srv_gdpr_survey_list_li_2'].'</li>';
- echo ' <li>'.$lang['srv_gdpr_survey_list_li_3'].'</li>';
- echo ' <li>'.$lang['srv_gdpr_survey_list_li_4'].'</li>';
- echo '</ul>';
+ echo ' <div class="box_text">';
+ echo ' <p id="p_num_of_surveys3"> <span class="num_of_surveys" id="num_of_surveys3"> '.$survey_count['no_gdpr'].' </span> '.$lang['srv_gdpr_survey_list_no_gdpr_surveys_note'].'</p>';
+ echo ' </div>';
- echo '<p>'.$lang['srv_gdpr_survey_list_text3'].'</p>';
+ echo ' </div>';
echo '</div>';
+ // Text med nastavitvami in tabelo
+ echo '<p class="bottom16">'.$lang['srv_gdpr_survey_list_text'].'</p>';
+
+ echo '<p class="top16 bottom16">'.$lang['srv_gdpr_survey_list_text3'].'</p>';
+
+
+ // Tabela anket
echo '<table class="gdpr_surveys">';
- echo '<tr>';
- echo '<th>'.$lang['srv_gdpr_survey_list_survey'].'</th>';
- echo '<th>'.$lang['srv_gdpr_survey_list_activity'].'</th>';
- echo '<th>'.$lang['srv_gdpr_survey_list_pot_gdpr'].'</th>';
- echo '<th>'.$lang['srv_gdpr_survey_list_gdpr'].'</th>';
- echo '</tr>';
+ // Naslovna vrstica
+ echo ' <tr>';
+ echo ' <th class="center">GDPR</th>';
+ echo ' <th>'.$lang['srv_gdpr_survey_list_survey'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_survey_list_activity'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_survey_list_pot_gdpr'].'</th>';
+ echo ' </tr>';
foreach($survey_list as $anketa){
// Nastavimo barvo vrstice
if($anketa['gdpr'] == 1)
- $color = ' class="green_row"';
+ $color = 'green_row';
elseif($anketa['potential_gdpr'] == 1)
- $color = ' class="red_row"';
+ $color = 'red_row';
else
- $color = '';
+ $color = 'grey_row';
+
+ echo '<tr class="'.$color.'">';
- echo '<tr '.$color.'>';
+ if($anketa['active']==1)
+ $anketa_active = $lang['yes'];
+ else
+ $anketa_active = $lang['no'];
- echo '<td><a href="'.$site_url.'admin/survey/index.php?anketa='.$anketa['id'].'&a=gdpr_settings">'.$anketa['naslov'].'</a></td>';
- echo '<td>'.$anketa['active'].'</td>';
- echo '<td>'.$anketa['potential_gdpr'].'</td>';
+ if($anketa['potential_gdpr']==1)
+ $anketa_potential_gdpr = $lang['yes'];
+ else
+ $anketa_potential_gdpr = $lang['no'];
- //echo '<td>'.$anketa['gdpr'].'</td>';
- echo '<td><input type="checkbox" value="1" class="pointer" onClick="setGDPRSurvey(\''.$anketa['id'].'\', this.checked); return false;" '.($anketa['gdpr'] == '1' ? ' checked="checked"' : '').'</td>';
+ echo ' <td class="center"><input type="checkbox" id="gdpr_'.$anketa['id'].'" value="1" onClick="setGDPRSurvey(\''.$anketa['id'].'\', this.checked); return false;" '.($anketa['gdpr'] == '1' ? ' checked="checked"' : '').'><label class="empty" for="gdpr_'.$anketa['id'].'"></label></td>';
+ echo ' <td><a href="'.$site_url.'admin/survey/index.php?anketa='.$anketa['id'].'&a=gdpr_settings">'.$anketa['naslov'].'</a></td>';
+ echo ' <td>'.$anketa_active.'</td>';
+ echo ' <td>'.$anketa_potential_gdpr.'</td>';
echo '</tr>';
}
@@ -116,48 +165,64 @@ class GDPR{
$user_settings = self::getUserSettings();
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
+
echo '<form name="settingsgdpr" id="form_gdpr_user_settings" method="post">';
echo ' <input name="submited" value="1" type="hidden">';
echo ' <fieldset><legend>'.$lang['srv_gdpr_user_settings_title'].'</legend>';
- echo '<p class="italic">'.$lang['srv_gdpr_user_settings_desc1'].'<br />';
- echo $lang['srv_gdpr_user_settings_desc2'].'<br /><br />';
- echo $lang['srv_gdpr_user_settings_desc3'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_gdpr_user_settings_desc1'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_gdpr_user_settings_desc2'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_gdpr_user_settings_desc3'].'</p>';
// PODATKI AVTORJA
// Opozorilo za obvezna polja
- if($user_settings['firstname'] == '' || $user_settings['lastname'] == '' || $user_settings['email'] == '')
- echo '<p><span class="red bold">'.$lang['srv_gdpr_user_settings_err'].'</span></p>';
- else
- echo '<br />';
-
- echo ' <div class="setting '.($user_settings['firstname'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_firstname'].':</label></span> ';
- echo ' <input class="text" name="firstname" value="'.$user_settings['firstname'].'" type="text"></div>';
+ echo '<p class="red bottom16">'.$lang['srv_gdpr_user_settings_err'].'</p>';
- echo ' <div class="setting '.($user_settings['lastname'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_lastname'].':</label></span> ';
- echo ' <input class="text" name="lastname" value="'.$user_settings['lastname'].'" type="text"></div>';
+ echo '<div class="setting_horizontal_wrapper">';
- $email = ($user_settings['email'] == '') ? User::getInstance()->primaryEmail() : $user_settings['email'];
- echo ' <div class="setting '.($user_settings['email'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_email'].':</label></span> ';
- echo ' <input class="text '.(isset($error['email']) ? ' red' : '').'" name="email" value="'.$email.'" type="text"> '.(isset($error['email']) ? '<span class="red italic">'.$lang['srv_remind_email_hard'].'</span>' : '').'</div>';
+ echo '<div class="setting_holder '.($user_settings['firstname'] == '' ? ' red' : '').'">';
+ echo '<label for="firstname">'.$lang['srv_gdpr_user_settings_firstname'].'*:</label>';
+ echo '<input class="large w200" id="firstname" name="firstname" value="'.$user_settings['firstname'].'" type="text">';
+ echo '</div>';
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_phone'].':</label></span> ';
- echo ' <input class="text" name="phone" value="'.$user_settings['phone'].'" type="text"></div>';
+ echo '<div class="setting_holder '.($user_settings['lastname'] == '' ? ' red' : '').'">';
+ echo '<label for="lastname">'.$lang['srv_gdpr_user_settings_lastname'].'*:</label>';
+ echo '<input class="large w200" id="lastname" name="lastname" value="'.$user_settings['lastname'].'" type="text">';
+ echo '</div>';
- echo ' <br />';
-
- // Naslov in drzava
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_address'].':</label></span> ';
- echo ' <input class="text" name="address" value="'.$user_settings['address'].'" type="text"></div>';
+ echo '</div>';
+
+ echo '<div class="setting_horizontal_wrapper">';
+
+ $email = ($user_settings['email'] == '') ? User::getInstance()->primaryEmail() : $user_settings['email'];
+ echo '<div class="setting_holder '.($user_settings['email'] == '' ? ' red' : '').'">';
+ echo '<label for="email">'.$lang['srv_gdpr_user_settings_email'].'*:</label>';
+ echo '<input class="large w200 '.(isset($error['email']) ? ' red' : '').'" id="email" name="email" value="'.$email.'" type="text"> '.(isset($error['email']) ? '<span class="red italic">'.$lang['srv_remind_email_hard'].'</span>' : '');
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_gdpr_user_settings_phone'].':</label>';
+ echo '<input class="large w200" name="phone" value="'.$user_settings['phone'].'" type="text">';
+ echo '</div>';
+
+ echo '</div>';
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_country'].':</label></span> ';
+ echo '<div class="setting_horizontal_wrapper">';
+ // Naslov in drzava
+ echo '<div class="setting_holder">';
+ echo '<label for="address">'.$lang['srv_gdpr_user_settings_address'].':</label>';
+ echo '<input class="large w200" name="address" value="'.$user_settings['address'].'" type="text">';
+ echo '</div>';
- echo ' <select name="country" onChange="editGDPRAuthority(this.value); return false;">';
- //echo ' <option value="" '.($user_settings['country'] == '' ? ' selected="selected"' : '').'>'.$lang['srv_gdpr_user_settings_country_select'].'</option>';
- $country_filter = array();
+ echo '<div class="setting_holder">';
+ echo '<label for="country">'.$lang['srv_gdpr_user_settings_country'].':</label>';
+ echo '<select class="dropdown large w200" id="country" name="country" onChange="editGDPRAuthority(this.value); return false;">';
+ $country_filter = array();
foreach(self::$authorities as $authority){
if (in_array($authority['country'], $country_filter)) {
@@ -171,94 +236,122 @@ class GDPR{
$country_filter[] = $authority['country'];
}
- echo ' </select>';
- echo ' </div>';
-
-
- echo ' <br />';
-
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
// ORGANIZACIJA ALI ZASEBNIK
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_type'].':</label></span> ';
- echo ' <label for="type_0"><input class="radio" name="type" id="type_0" value="0" type="radio" '.($user_settings['type'] != '1' ? ' checked="checked"' : '').' onClick="toggleGDPRDPO();"> '.$lang['srv_gdpr_user_settings_type_0'].'</label>';
- echo ' <label for="type_1"><input class="radio" name="type" id="type_1" value="1" type="radio" '.($user_settings['type'] == '1' ? ' checked="checked"' : '').' onClick="toggleGDPRDPO();"> '.$lang['srv_gdpr_user_settings_type_1'].'</label>';
- echo ' </div>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_user_settings_type'].':</span> ';
+
+ echo '<div class="setting_item">';
+ echo '<input class="radio" name="type" id="type_0" value="0" type="radio" '.($user_settings['type'] != '1' ? ' checked="checked"' : '').' onClick="toggleGDPRDPO();">';
+ echo '<label for="type_0"> '.$lang['srv_gdpr_user_settings_type_0'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input class="radio" name="type" id="type_1" value="1" type="radio" '.($user_settings['type'] == '1' ? ' checked="checked"' : '').' onClick="toggleGDPRDPO();">';
+ echo '<label for="type_1"> '.$lang['srv_gdpr_user_settings_type_1'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
// PODATKI PODJETJA
- echo ' <div id="gdpr_organization" '.($user_settings['type'] != '1' ? ' style="display:none;"' : '').'>';
+ echo ' <div id="gdpr_organization" '.($user_settings['type'] != '1' ? ' class="displayNone"' : '').'>';
- // Opozorilo za obvezna polja
- if($user_settings['organization'] == '' || $user_settings['organization_maticna'] == '')
- echo '<p><span class="red bold">'.$lang['srv_gdpr_user_settings_err2'].'</span></p>';
+ echo '<div class="setting_horizontal_wrapper">';
- echo ' <div class="setting '.($user_settings['organization'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_organization'].':</label></span> ';
- echo ' <input class="text" name="organization" value="'.$user_settings['organization'].'" type="text"></div>';
-
- echo ' <div class="setting '.($user_settings['organization_maticna'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_organization_maticna'].':</label></span> ';
- echo ' <input class="text" name="organization_maticna" value="'.$user_settings['organization_maticna'].'" type="text"></div>';
-
- /*echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_organization_davcna'].':</label></span> ';
- echo ' <input class="text" name="organization_davcna" value="'.$user_settings['organization_davcna'].'" type="text"></div>';*/
-
- echo ' </div>';
+ echo '<div class="setting_holder '.($user_settings['organization'] == '' ? 'red' : '').'">';
+ echo '<label for="organization">'.$lang['srv_gdpr_user_settings_organization'].'*:</label>';
+ echo '<input class="large w200" id="organization" name="organization" value="'.$user_settings['organization'].'" type="text">';
+ echo '</div>';
+
+ echo '<div class="setting_holder '.($user_settings['organization_maticna'] == '' ? 'red' : '').'">';
+ echo '<label for="organization_maticna">'.$lang['srv_gdpr_user_settings_organization_maticna'].'*:</label>';
+ echo '<input class="large w200" id="organization_maticna" name="organization_maticna" value="'.$user_settings['organization_maticna'].'" type="text">';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
// IMA DPO
- echo ' <div id="gdpr_has_dpo" '.($user_settings['type'] != '0' ? ' style="display:none;"' : '').'>';
-
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_has_dpo'].':</label></span> ';
- echo ' <label for="has_dpo_0"><input class="radio" name="has_dpo" id="has_dpo_0" value="0" type="radio" '.($user_settings['has_dpo'] != '1' ? ' checked="checked"' : '').' onClick="toggleGDPRHasDPO();"> '.$lang['no'].'</label>';
- echo ' <label for="has_dpo_1"><input class="radio" name="has_dpo" id="has_dpo_1" value="1" type="radio" '.($user_settings['has_dpo'] == '1' ? ' checked="checked"' : '').' onClick="toggleGDPRHasDPO();"> '.$lang['yes'].'</label>';
- echo ' </div>';
-
- echo '<br /><br />';
+ echo '<div id="gdpr_has_dpo" '.($user_settings['type'] != '0' ? ' class="displayNone"' : '').'>';
- echo ' </div>';
+ echo '<div class="setting_holder bottom16">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_user_settings_has_dpo'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input class="radio" name="has_dpo" id="has_dpo_0" value="0" type="radio" '.($user_settings['has_dpo'] != '1' ? ' checked="checked"' : '').' onClick="toggleGDPRHasDPO();">';
+ echo '<label for="has_dpo_0"> '.$lang['no'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input class="radio" name="has_dpo" id="has_dpo_1" value="1" type="radio" '.($user_settings['has_dpo'] == '1' ? ' checked="checked"' : '').' onClick="toggleGDPRHasDPO();">';
+ echo '<label for="has_dpo_1"> '.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
// DPO
- echo ' <div id="gdpr_dpo" '.($user_settings['type'] != '1' && $user_settings['has_dpo'] != '1' ? ' style="display:none;"' : '').'>';
+
+ echo '<div id="gdpr_dpo" '.($user_settings['type'] != '1' && $user_settings['has_dpo'] != '1' ? ' class="displayNone"' : '').'>';
- echo ' <p class="bold">'.$lang['srv_gdpr_user_settings_dpo'].':</p>';
+ echo '<p class="bottom16">'.$lang['srv_gdpr_user_settings_dpo'].':</p>';
- // Opozorilo za obvezna polja
- if($user_settings['dpo_firstname'] == '' || $user_settings['dpo_lastname'] == '' || $user_settings['dpo_email'] == '')
- echo '<p><span class="red bold">'.$lang['srv_gdpr_user_settings_err'].'</span></p>';
- else
- echo '<br />';
-
- echo ' <div class="setting '.($user_settings['dpo_firstname'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_dpo_firstname'].':</label></span> ';
- echo ' <input class="text" name="dpo_firstname" value="'.$user_settings['dpo_firstname'].'" type="text"></div>';
-
- echo ' <div class="setting '.($user_settings['dpo_lastname'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_dpo_lastname'].':</label></span> ';
- echo ' <input class="text" name="dpo_lastname" value="'.$user_settings['dpo_lastname'].'" type="text"></div>';
-
- echo ' <div class="setting '.($user_settings['dpo_email'] == '' ? ' red' : '').'"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_dpo_email'].':</label></span> ';
- echo ' <input class="text '.(isset($error['dpo_email']) ? ' red' : '').'" name="dpo_email" value="'.$user_settings['dpo_email'].'" type="text"> '.(isset($error['dpo_email']) ? '<span class="red italic">'.$lang['srv_remind_email_hard'].'</span>' : '').'</div>';
-
- echo ' <div class="setting"><span class="nastavitveSpan2"><label>'.$lang['srv_gdpr_user_settings_dpo_phone'].':</label></span> ';
- echo ' <input class="text" name="dpo_phone" value="'.$user_settings['dpo_phone'].'" type="text"></div>';
-
- echo ' </div>';
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder '.($user_settings['dpo_firstname'] == '' ? ' red' : '').'">';
+ echo '<label for="dpo_firstname">'.$lang['srv_gdpr_user_settings_dpo_firstname'].'*:</label>';
+ echo '<input class="large w200" id="dpo_firstname" name="dpo_firstname" value="'.$user_settings['dpo_firstname'].'" type="text">';
+ echo '</div>';
+
+ echo '<div class="setting_holder '.($user_settings['dpo_lastname'] == '' ? ' red' : '').'">';
+ echo '<label for="dpo_lastname">'.$lang['srv_gdpr_user_settings_dpo_lastname'].'*:</label>';
+ echo '<input class="large w200" id="dpo_lastname" name="dpo_lastname" value="'.$user_settings['dpo_lastname'].'" type="text">';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder '.($user_settings['dpo_email'] == '' ? ' red' : '').'">';
+ echo '<label for="dpo_email">'.$lang['srv_gdpr_user_settings_dpo_email'].'*:</label>';
+ echo '<input class="large w200 '.(isset($error['dpo_email']) ? ' red' : '').'" id="dpo_email" name="dpo_email" value="'.$user_settings['dpo_email'].'" type="text"> '.(isset($error['dpo_email']) ? '<span class="red italic">'.$lang['srv_remind_email_hard'].'</span>' : '');
+ echo '</div>';
+
+ echo '<div class="setting_holder ">';
+ echo '<label>'.$lang['srv_gdpr_user_settings_dpo_phone'].':</label>';
+ echo '<input class="large w200" name="dpo_phone" value="'.$user_settings['dpo_phone'].'" type="text">';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
// Podatki trenutne avtoritete
- echo '<div id="gdpr_authority_info">';
+ echo '<div class="setting_holder" id="gdpr_authority_info">';
self::displayGDPRAuthority($user_settings['country']);
echo '</div>';
- echo ' </fieldset>';
+ echo '</fieldset>';
// Gumb shrani
- echo '<div class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="editGDPRProfile(); return false;"><span>'.$lang['edit1337'].'</span></a></div>';
-
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="editGDPRProfile(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
// div za prikaz uspešnosti shranjevanja
- if ($_GET['s'] == '1') {
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
echo '<span class="clr"></span>';
echo '<div id="success_save"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
echo '</form>';
@@ -280,22 +373,22 @@ class GDPR{
$current_authorities[] = $authority;
}
- echo '<p class="bold">'.$lang['srv_gdpr_user_settings_authority'].':</p>';
+ echo '<p class="bottom8">'.$lang['srv_gdpr_user_settings_authority'].':</p>';
// Prikazemo podatke za vse avtoritete (lahko jih je vec na drzavo)
foreach ($current_authorities as $authority) {
echo '<div class="gdpr_authority_info_data">';
if($authority['name'] != '')
- echo '<span class="bold">'.$authority['name'].'</span><br />';
+ echo '<span class="authority_name">'.$authority['name'].'</span><br />';
if($authority['title'] != '')
echo '<span>'.$authority['title'].'</span><br />';
if($authority['email'] != '')
- echo '<span class="spaceLeft">'.$lang['srv_gdpr_user_settings_email'].': '.$authority['email'].'</span><br />';
+ echo '<span class="spaceLeft">'.$lang['srv_gdpr_user_settings_email'].': <div class="bold" > '.$authority['email'].'</div></span>';
if($authority['phone'] != '')
- echo '<span class="spaceLeft">'.$lang['srv_gdpr_user_settings_phone'].': '.$authority['phone'].'</span><br />';
+ echo '<span class="spaceLeft">'.$lang['srv_gdpr_user_settings_phone'].': <div class="bold" > '.$authority['phone'].'</div></span>';
if($authority['fax'] != '')
- echo '<span class="spaceLeft">Fax: '.$authority['fax'].'</span><br />';
+ echo '<span class="spaceLeft">Fax: <div class="bold" > '.$authority['fax'].'</div></span><br />';
echo '</div>';
}
@@ -307,9 +400,8 @@ class GDPR{
global $site_url;
global $lang;
- echo '<div style="font-style:italic; margin-top:-10px;">';
- echo '<p>'.$lang['srv_gdpr_requests_desc'].'</p>';
- echo '</div>';
+
+ echo '<p class="bottom16">'.$lang['srv_gdpr_requests_desc'].'</p>';
// Seznam cakajocih zahtevkov
$request_list = array();
@@ -319,108 +411,114 @@ class GDPR{
$request_list_done = array();
$request_list_done = $this->getUserRequests($ank_id=0, $status=1);
+
+ // Nimamo zahtevkov
+ if(count($request_list) == 0 &&count($request_list_done) == 0){
+ echo '<div class="gdpr_request_table_title bottom8">'.$lang['srv_gdpr_requests_none'].'</div>';
+ return;
+ }
+
+
+ // Tabela neizvrsenih zahtevkov
if(count($request_list) > 0){
+
+ echo '<div class="gdpr_request_table_title bottom8">'.$lang['srv_gdpr_requests_list_unresolved'].'</div>';
+
+ echo '<div class="table-horizontal-scroll-wrapper-outer" id="gdrp_requests_unresolved">';
+ echo '<div class="table-horizontal-scroll-wrapper-inner">';
echo '<table class="gdpr_surveys requests">';
echo '<tr>';
- echo '<th>'.$lang['srv_gdpr_requests_survey'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_recnum'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_ip'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_url'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_email'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_date'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_text'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_type'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_date_sent'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_done'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_comment'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_resolved'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_requests_survey'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_text'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_requests_email'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_type'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_date_sent'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_comment'].'</th>';
echo '</tr>';
foreach($request_list as $request_id => $request){
- echo '<tr '.($request['status'] == 0 ? ' class="red_row"' : '').'>';
+ echo '<tr>';
- echo '<td><a href="'.$site_url.'admin/survey/index.php?anketa='.$request['ank_id'].'&a=data">'.$request['naslov'].'</a></td>';
-
- //echo '<td>'.$request['recnum'].'</td>';
- //echo '<td>'.$request['ip'].'</td>';
- echo '<td>'.$request['url'].'</td>';
- echo '<td>'.$request['email'].'</td>';
- //echo '<td>'.$request['date'].'</td>';
- echo '<td>'.$request['text'].'</td>';
+ // Checkbox ce je zahteva opravljena
+ echo ' <td class="center"><input type="checkbox" id="gdrp_request_'.$request_id.'" value="1" onClick="setGDPRRequestStatus(\''.$request_id.'\', this.checked); return false;" '.($request['status'] == '1' ? ' checked="checked"' : '').'>';
+ echo ' <label class="empty" for="gdrp_request_'.$request_id.'"></label>';
+ echo ' </td>';
+
+ echo ' <td><div class="gdpr_requests_wrap"><a href="'.$site_url.'admin/survey/index.php?anketa='.$request['ank_id'].'&a=data">'.$request['naslov'].'</a></div></td>';
- echo '<td>'.$lang['srv_gdpr_requests_type_'.$request['type']].'</td>';
+ echo ' <td class="center"><span class="faicon envelope" onclick="show_gdpr_messeage('.$request_id.', '.$request['ank_id'].')"></span></td>';
+
+ echo ' <td>'.$request['email'].'</td>';
- echo '<td>'.date('j.n.Y', strtotime($request['datum'])).'</td>';
+ echo ' <td class="center">';
+ echo ' <div class="request_type type'.$request['type'].'">'.$lang['srv_gdpr_requests_type_'.$request['type']].'</div>';
+ echo ' </td>';
- // Checkbox ce je zahteva opravljena
- //echo '<td>'.($request['status'] == '1' ? $lang['srv_gdpr_requests_status_1'] : $lang['srv_gdpr_requests_status_0']).'</td>';
- echo '<td><input type="checkbox" value="1" class="pointer" onClick="setGDPRRequestStatus(\''.$request_id.'\', this.checked); return false;" '.($request['status'] == '1' ? ' checked="checked"' : '').'></td>';
+ echo ' <td class="center">'.date('j.n.Y', strtotime($request['datum'])).'</td>';
// Komentar avtorja
- echo '<td><textarea style="height:30px; width:200px;" onBlur="setGDPRRequestComment(\''.$request_id.'\', this.value);">'.$request['comment'].'</textarea></td>';
-
+ echo ' <td class="center">';
+ echo ' <textarea class="gdpr_requests_comment" onBlur="setGDPRRequestComment(\''.$request_id.'\', this.value);">'.$request['comment'].'</textarea>';
+ echo ' </td>';
echo '</tr>';
}
echo '</table>';
- }
- else{
- echo '<p>'.$lang['srv_gdpr_requests_none'].'</p>';
- }
-
+ echo '</div>';
+ echo '</div>';
+ }
// Tabela opravljenih zahtevkov
if(count($request_list_done) > 0){
+
+ echo '<div class="gdpr_request_table_title bottom8">'.$lang['srv_gdpr_requests_list_resolved'].'</div>';
- echo '<br /><span class="requests_table_title">'.$lang['srv_gdpr_requests_done'].'</span>';
-
- echo '<table class="gdpr_surveys requests" style="margin-top:0;">';
+ echo '<div class="table-horizontal-scroll-wrapper-outer">';
+ echo '<div class="table-horizontal-scroll-wrapper-inner">';
+ echo '<table class="gdpr_surveys requests">';
echo '<tr>';
- echo '<th>'.$lang['srv_gdpr_requests_survey'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_recnum'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_ip'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_url'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_email'].'</th>';
- //echo '<th>'.$lang['srv_gdpr_requests_date'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_text'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_type'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_date_sent'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_done'].'</th>';
- echo '<th>'.$lang['srv_gdpr_requests_comment'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_resolved'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_requests_survey'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_text'].'</th>';
+ echo ' <th>'.$lang['srv_gdpr_requests_email'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_type'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_date_sent'].'</th>';
+ echo ' <th class="center">'.$lang['srv_gdpr_requests_comment'].'</th>';
echo '</tr>';
foreach($request_list_done as $request_id => $request){
- echo '<tr '.($request['status'] == 0 ? ' class="red_row"' : '').'>';
+ echo '<tr>';
- echo '<td><a href="'.$site_url.'admin/survey/index.php?anketa='.$request['ank_id'].'&a=data">'.$request['naslov'].'</a></td>';
-
- //echo '<td>'.$request['recnum'].'</td>';
- //echo '<td>'.$request['ip'].'</td>';
- echo '<td>'.$request['url'].'</td>';
- echo '<td>'.$request['email'].'</td>';
- //echo '<td>'.$request['date'].'</td>';
- echo '<td>'.$request['text'].'</td>';
+ // Checkbox ce je zahteva opravljena
+ echo ' <td class="center"><input type="checkbox" id="gdrp_request_'.$request_id.'" value="1" onClick="setGDPRRequestStatus(\''.$request_id.'\', this.checked); return false;" '.($request['status'] == '1' ? ' checked="checked"' : '').'><label class="empty" for="gdrp_request_'.$request_id.'"></label></td>';
+ echo ' <td><div class="gdpr_requests_wrap"><a href="'.$site_url.'admin/survey/index.php?anketa='.$request['ank_id'].'&a=data">'.$request['naslov'].'</a></div></td>';
- echo '<td>'.$lang['srv_gdpr_requests_type_'.$request['type']].'</td>';
+ echo ' <td class="center"><span class="faicon envelope" onclick="show_gdpr_messeage('.$request_id.', '.$request['ank_id'].')"></span></td>';
+
+ echo ' <td>'.$request['email'].'</td>';
- echo '<td>'.date('j.n.Y', strtotime($request['datum'])).'</td>';
+ echo ' <td class="center">';
+ echo ' <div class="request_type type'.$request['type'].'">'.$lang['srv_gdpr_requests_type_'.$request['type']].'</div>';
+ echo ' </td>';
- // Checkbox ce je zahteva opravljena
- //echo '<td>'.($request['status'] == '1' ? $lang['srv_gdpr_requests_status_1'] : $lang['srv_gdpr_requests_status_0']).'</td>';
- echo '<td><input type="checkbox" value="1" class="pointer" onClick="setGDPRRequestStatus(\''.$request_id.'\', this.checked); return false;" '.($request['status'] == '1' ? ' checked="checked"' : '').'></td>';
+ echo ' <td class="center">'.date('j.n.Y', strtotime($request['datum'])).'</td>';
// Komentar avtorja
- echo '<td><textarea style="height:30px; width:200px;" onBlur="setGDPRRequestComment(\''.$request_id.'\', this.value);">'.$request['comment'].'</textarea></td>';
-
-
+ echo ' <td class="center">';
+ echo ' <textarea class="gdpr_requests_comment" onBlur="setGDPRRequestComment(\''.$request_id.'\', this.value);">'.$request['comment'].'</textarea>';
+ echo ' </td>';
echo '</tr>';
}
echo '</table>';
+ echo '</div>';
+ echo '</div>';
}
}
@@ -441,7 +539,10 @@ class GDPR{
ORDER BY date(r.datum) ASC");
if(mysqli_num_rows($sql) > 0){
- echo '<table class="gdpr_surveys requests">';
+ echo '<div class="table-horizontal-scroll-wrapper-outer">';
+ echo '<div class="table-horizontal-scroll-wrapper-inner">';
+
+ echo '<table class="gdpr_surveys requests all">';
echo '<tr>';
echo '<th>'.$lang['srv_gdpr_requests_author'].'</th>';
@@ -472,7 +573,7 @@ class GDPR{
echo '<td>'.$row['u_name'].' '.$row['u_surname'].'<br />('.$row['u_email'].')</td>';
// Odgovorna oseba
- echo '<td style="text-align:left; white-space:nowrap;">';
+ echo '<td style="text-align:left;">';
if($row['gu_firstname'] != '' || $row['gu_lastname'] != '' || $row['gu_email'] != '')
echo '<span class="bold">'.$lang['srv_gdpr_user_settings_firstname'].':</span> '.$row['gu_firstname'].' '.$row['gu_lastname'].($row['gu_email'] != '' ? ' ('.$row['gu_email'].')' : '').'<br />';
if($row['gu_phone'] != '')
@@ -482,7 +583,7 @@ class GDPR{
echo '</td>';
// Organizacija
- echo '<td style="text-align:left; white-space:nowrap;">';
+ echo '<td style="text-align:left;">';
if($row['gu_type'] == '1'){
if($row['gu_organization'] != '')
echo '<span class="bold">'.$lang['srv_gdpr_user_settings_organization'].':</span> '.$row['gu_organization'].'<br />';
@@ -514,6 +615,9 @@ class GDPR{
}
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
}
else{
echo '<p>'.$lang['srv_gdpr_requests_none'].'</p>';
@@ -534,10 +638,11 @@ class GDPR{
if(mysqli_num_rows($sql) > 0){
echo '<br />';
- echo '<a href="#" onClick="$(\'#table_requests_done\').toggle(); $(\'#requests_table_title_plus\').toggle(); $(\'#requests_table_title_minus\').toggle();">';
- echo ' <span class="requests_table_title"><span id="requests_table_title_plus">+</span><span id="requests_table_title_minus" style="display:none;">-</span> '.$lang['srv_gdpr_requests_done'].'</span>';
- echo '</a>';
+ echo ' <button onClick="$(\'#table_requests_done\').toggle(); $(\'#requests_table_title_simbol\').toggleClass(\'minus plus\'); $(this).toggleClass(\'border_blue\'); return false;" class="requests_table_title medium white-gray"><span id="requests_table_title_simbol" class="faicon blue plus"></span>'.$lang['srv_gdpr_requests_done'].'</button>';
+ echo '<div class="table-horizontal-scroll-wrapper-outer">';
+ echo '<div class="table-horizontal-scroll-wrapper-inner">';
+
echo '<table class="gdpr_surveys requests" id="table_requests_done" style="margin-top:0; display:none;">';
echo '<tr>';
@@ -569,7 +674,7 @@ class GDPR{
echo '<td>'.$row['u_name'].' '.$row['u_surname'].'<br />('.$row['u_email'].')</td>';
// Odgovorna oseba
- echo '<td style="text-align:left; white-space:nowrap;">';
+ echo '<td style="text-align:left;">';
if($row['gu_firstname'] != '' || $row['gu_lastname'] != '' || $row['gu_email'] != '')
echo '<span class="bold">'.$lang['srv_gdpr_user_settings_firstname'].':</span> '.$row['gu_firstname'].' '.$row['gu_lastname'].($row['gu_email'] != '' ? ' ('.$row['gu_email'].')' : '').'<br />';
if($row['gu_phone'] != '')
@@ -579,7 +684,7 @@ class GDPR{
echo '</td>';
// Organizacija
- echo '<td style="text-align:left; white-space:nowrap;">';
+ echo '<td style="text-align:left;">';
if($row['gu_type'] == '1'){
if($row['gu_organization'] != '')
echo '<span class="bold">'.$lang['srv_gdpr_user_settings_organization'].':</span> '.$row['gu_organization'].'<br />';
@@ -611,6 +716,9 @@ class GDPR{
}
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
}
}
@@ -651,98 +759,158 @@ class GDPR{
// GDPR nastavitve ankete
- echo '<fieldset class="wide">';
+ echo '<fieldset id="gdpr_anketa">';
echo '<legend>'.$lang['srv_gdpr_survey_settings'].'</legend>';
// Besedilo na vrhu
- echo '<p class="italic">'.$lang['srv_gdpr_survey_settings_desc1'].'</p>';
+ echo '<p>'.$lang['srv_gdpr_survey_settings_desc1'].'</p>';
- echo '<p class="italic">'.$lang['srv_gdpr_survey_settings_desc2'].' <a href="'.$site_url.'admin/survey/index.php?a=gdpr" target="_blank"><span class="bold">'.$lang['srv_here'].' >></span></a></p>';
+ echo '<p class="bottom16 top16">'.$lang['srv_gdpr_survey_settings_desc2'].' <a href="'.$site_url.'admin/survey/index.php?a=gdpr" target="_blank"><span class="bold">'.$lang['srv_here'].' >></span></a></p>';
- echo '<p class="italic">'.$lang['srv_gdpr_survey_settings_desc3'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_gdpr_survey_settings_desc3'].'</p>';
// Ali gre za gdpr anketo
- echo '<span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_data'].':</span>';
- echo '<label for="is_gdpr_1"><input type="radio" name="is_gdpr" id="is_gdpr_1" '.($gdpr_settings != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo '<label for="is_gdpr_0"><input type="radio" name="is_gdpr" id="is_gdpr_0" '.($gdpr_settings == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
+ echo '<div class="setting_holder">';
+ echo '<div class="fold ">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_data'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="is_gdpr" id="is_gdpr_1" '.($gdpr_settings['is_gdpr'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo '<label for="is_gdpr_1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="is_gdpr" id="is_gdpr_0" '.($gdpr_settings['is_gdpr'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo '<label for="is_gdpr_0">'.$lang['no'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
- echo '<br /><br />';
+ // Oznacena kot GDPR - prikazemo identifikatorje
+ echo '<div id="gdpr_data_identifiers" '.($gdpr_settings['is_gdpr'] == 0 ? ' style="display:none;"' : '').'>';
+ echo '<p class="semi-bold" >'.$lang['srv_gdpr_survey_gdpr_data_q'].'</p>';
- // Oznacena kot GDPR - prikazemo identifikatorje
- echo '<div id="gdpr_data_identifiers" '.($gdpr_settings == 0 ? ' style="display:none;"' : '').'>';
+ echo '<div class="setting_holder">';
- echo '<span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_data_q'].'</span><br /><br />';
-
// Osebni podatek ime
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_name'].':</span>';
- echo ' <label for="name_1"><input type="radio" name="name" id="name_1" '.($gdpr_settings['name'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo ' <label for="name_0"><input type="radio" name="name" id="name_0" '.($gdpr_settings['name'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
-
- echo ' <br />';
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_name'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="name" id="name_1" '.($gdpr_settings['name'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo '<label for="name_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="name" id="name_0" '.($gdpr_settings['name'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo '<label for="name_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
// Osebni podatek email
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_email'].':</span>';
- echo ' <label for="email_1"><input type="radio" name="email" id="email_1" '.($gdpr_settings['email'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo ' <label for="email_0"><input type="radio" name="email" id="email_0" '.($gdpr_settings['email'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
-
- echo ' <br />';
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_email'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="email" id="email_1" '.($gdpr_settings['email'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo ' <label for="email_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="email" id="email_0" '.($gdpr_settings['email'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo ' <label for="email_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
// Osebni podatek lokacija
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_location'].':</span>';
- echo ' <label for="location_1"><input type="radio" name="location" id="location_1" '.($gdpr_settings['location'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo ' <label for="location_0"><input type="radio" name="location" id="location_0" '.($gdpr_settings['location'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
-
- echo ' <br />';
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_location'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="location" id="location_1" '.($gdpr_settings['location'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo ' <label for="location_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="location" id="location_0" '.($gdpr_settings['location'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo ' <label for="location_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
// Osebni podatek telefon
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_phone'].':</span>';
- echo ' <label for="phone_1"><input type="radio" name="phone" id="phone_1" '.($gdpr_settings['phone'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo ' <label for="phone_0"><input type="radio" name="phone" id="phone_0" '.($gdpr_settings['phone'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
-
- echo ' <br />';
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_phone'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="phone" id="phone_1" '.($gdpr_settings['phone'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo ' <label for="phone_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="phone" id="phone_0" '.($gdpr_settings['phone'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo ' <label for="phone_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
// Osebni podatek spletni identifikator
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_web'].':</span>';
- echo ' <label for="web_1"><input type="radio" name="web" id="web_1" '.($gdpr_settings['web'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">'.$lang['yes'].'</label> ';
- echo ' <label for="web_0"><input type="radio" name="web" id="web_0" '.($gdpr_settings['web'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">'.$lang['no'].'</label> ';
-
- echo ' <br />';
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_web'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="web" id="web_1" '.($gdpr_settings['web'] != 0 ? ' checked':'').' value="1" onClick="showGDPRSettings();">';
+ echo ' <label for="web_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="web" id="web_0" '.($gdpr_settings['web'] == 0 ? ' checked':'').' value="0" onClick="showGDPRSettings();">';
+ echo ' <label for="web_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
// Osebni podatek drugo
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_other'].':</span>';
- echo ' <label for="other_1"><input type="radio" name="other" id="other_1" '.($gdpr_settings['other'] != 0 ? ' checked':'').' value="1" onChange="showGDPRSettings(); toggleGDPROtherText(this);">'.$lang['yes'].'</label> ';
- echo ' <label for="other_0"><input type="radio" name="other" id="other_0" '.($gdpr_settings['other'] == 0 ? ' checked':'').' value="0" onChange="showGDPRSettings(); toggleGDPROtherText(this);">'.$lang['no'].'</label> ';
-
+ echo '<div class="fold">';
+ echo '<span class="setting_title">'.$lang['srv_gdpr_survey_gdpr_other'].':</span>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="other" id="other_1" '.($gdpr_settings['other'] != 0 ? ' checked':'').' value="1" onChange="showGDPRSettings(); toggleGDPROtherText(this);">';
+ echo ' <label for="other_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="other" id="other_0" '.($gdpr_settings['other'] == 0 ? ' checked':'').' value="0" onChange="showGDPRSettings(); toggleGDPROtherText(this);">';
+ echo ' <label for="other_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '<div id="other_text" '.($gdpr_settings['other'] == 0 ? ' style="display:none;"' : '').'>';
+
if($language_slo){
- echo ' <span class="nastavitveSpan1">&nbsp;</span>';
- echo ' <textarea class="other" name="other_text_slo" id="other_text_slo" style="width:500px; height:80px; margin-top:10px;">'.$gdpr_settings['other_text_slo'].'</textarea> <span class="italic">'.$admin_languages['1'].'</span>';
+ echo ' <p class="gray top16">'.$lang['srv_gdpr_survey_gdpr_other_textA'].' ('.$admin_languages['1'].')</p>';
+ echo ' <textarea class="textarea" name="other_text_slo" id="other_text_slo" >'.$gdpr_settings['other_text_slo'].'</textarea>';
echo '<br />';
}
if($language_eng){
- echo ' <span class="nastavitveSpan1">&nbsp;</span>';
- echo ' <textarea class="other" name="other_text_eng" id="other_text_eng" style="width:500px; height:80px; margin-top:10px;">'.$gdpr_settings['other_text_eng'].'</textarea> <span class="italic">'.$admin_languages['2'].'</span>';
+ echo ' <p class="gray top16">'.$lang['srv_gdpr_survey_gdpr_other_textA'].' ('.$admin_languages['2'].')</p>';
+ echo ' <textarea class="textarea" name="other_text_eng" id="other_text_eng">'.$gdpr_settings['other_text_eng'].'</textarea>';
}
echo '</div>';
echo '</div>';
- echo ' <br /><br />';
-
-
// Oznacena kot GDPR - prikazemo dodatne nastavitve gdpr
echo '<div id="gdpr_data_settings" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
// Ali se uporabi 1ka template v uvodu
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_1ka_template'].':</span>';
- echo ' <label for="1ka_template_1"><input type="radio" name="1ka_template" id="1ka_template_1" '.(!isset($gdpr_settings['1ka_template']) || $gdpr_settings['1ka_template'] != 0 ? ' checked':'').' value="1" onClick="showGDPRTemplate(this.value);">'.$lang['yes'].'</label> ';
- echo ' <label for="1ka_template_0"><input type="radio" name="1ka_template" id="1ka_template_0" '.(isset($gdpr_settings['1ka_template']) && $gdpr_settings['1ka_template'] == 0 ? ' checked':'').' value="0" onClick="showGDPRTemplate(this.value);">'.$lang['no'].'</label> ';
+ echo '<div class="setting_holder">';
+ echo '<div class="fold">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_1ka_template'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="1ka_template" id="1ka_template_1" '.(!isset($gdpr_settings['1ka_template']) || $gdpr_settings['1ka_template'] != 0 ? ' checked':'').' value="1" onClick="showGDPRTemplate(this.value);">';
+ echo ' <label for="1ka_template_1">'.$lang['yes'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="1ka_template" id="1ka_template_0" '.(isset($gdpr_settings['1ka_template']) && $gdpr_settings['1ka_template'] == 0 ? ' checked':'').' value="0" onClick="showGDPRTemplate(this.value);">';
+ echo ' <label for="1ka_template_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
- echo ' <div class="spaceLeft floatRight red" style="display:inline; width:520px;">';
- // Obvestilo z linkom na preview preduvoda
+ /* Obvestilo z linkom na preview preduvoda
echo '<span id="gdpr_data_template" class="italic" '.(isset($gdpr_settings['1ka_template']) && $gdpr_settings['1ka_template'] == 0 ? ' style="display:none;"' : '').'>';
echo $lang['srv_gdpr_survey_gdpr_1ka_template_note'];
echo '<br /><span class="bold"><a href="#" onClick="previewGDPRIntro(); return false;">'.$lang['srv_gdpr_survey_gdpr_1ka_template_preview'].'</a></span>';
@@ -751,7 +919,7 @@ class GDPR{
echo ' <span id="gdpr_data_template_warning" class="italic red" '.(!isset($gdpr_settings['1ka_template']) || $gdpr_settings['1ka_template'] == 1 ? ' style="display:none;"' : '').'>'.$lang['srv_gdpr_survey_gdpr_1ka_template_warning'].'</span>';
echo ' </div>';
- echo ' <br /><br /><br /><br />';
+ echo ' <br /><br /><br /><br />';*/
// Podrobnosti o zbiranju podatkov (popup v uvodu)
/*if($gdpr_settings['about'] == ''){
@@ -764,109 +932,176 @@ class GDPR{
echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_about'].':<br /><br /><span class="italic">'.$lang['srv_gdpr_survey_gdpr_about_note'].'</span></span>';
echo ' <textarea name="about" id="about" style="width:500px; height:200px;" disabled="disabled">'.$about_text.'</textarea> ';*/
- echo ' <span class="nastavitveSpan1" >'.$lang['srv_gdpr_survey_gdpr_about'].':<br /><br /><span class="italic">'.$lang['srv_gdpr_survey_gdpr_about_note'].'</span></span>';
+ echo '<p class="semi-bold top16">'.$lang['srv_gdpr_survey_gdpr_about'].':</p>';
+ echo '<p class="top16">'.$lang['srv_gdpr_survey_gdpr_about_note'].'</p>';
+
if($language_slo){
$about_array = self::getGDPRInfoArray($ank_id, $language_id='1');
$about_text = self::getGDPRTextFromArray($about_array, $type='textarea');
-
- echo ' <textarea name="about" id="about" style="width:500px; height:200px;" disabled="disabled">'.$about_text.'</textarea> <span class="italic">'.$admin_languages['1'].'</span>';
- echo ' <br><br><span class="nastavitveSpan1">&nbsp;</span>';
+
+ echo ' <p class="semi-bold top16">'.$admin_languages['1'].'</p>';
+ echo ' <textarea name="about" class="textarea" id="about" disabled="disabled">'.$about_text.'</textarea>';
}
if($language_eng){
$about_array = self::getGDPRInfoArray($ank_id, $language_id='2');
$about_text = self::getGDPRTextFromArray($about_array, $type='textarea');
-
- echo ' <textarea name="about" id="about" style="width:500px; height:200px;" disabled="disabled">'.$about_text.'</textarea> <span class="italic">'.$admin_languages['2'].'</span>';
+
+ echo ' <p class="semi-bold top16">'.$admin_languages['2'].'</p>';
+ echo ' <textarea name="about" class="textarea" id="about" disabled="disabled">'.$about_text.'</textarea>';
}
- echo '<br /><br />';
-
// Povezava na splosne gdpr nastavitve - ce ni izpolnil osebnih podatkov, je rdec warning
- echo '<a href="'.$site_url.'admin/survey/index.php?a=gdpr" target="_blank"><span class="bold">'.$lang['srv_gdpr_general_settings'].'</span></a>';
if(!self::checkUserSettings())
- echo '<br /><span class="red italic">'.$lang['srv_gdpr_general_settings_warning'].'</span>';
+ echo '<p class="top16">'.$lang['srv_gdpr_general_settings_warninga'].'<a href="'.$site_url.'admin/survey/index.php?a=gdpr" target="_blank">'.$lang['srv_gdpr_general_settings_warningb'].'</a>!</p>';
- echo '<br /><br />';
-
echo '</div>';
echo '</fieldset>';
- echo '<br class="clr" />';
-
-
// Dodatne informacije
- echo '<fieldset id="gdpr_additional_info" class="wide" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
- echo '<legend>'.$lang['srv_gdpr_survey_settings'].'</legend>';
-
- echo ' <br />';
-
+ echo '<fieldset id="gdpr_additional_info"'.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
+ echo '<legend>'.$lang['srv_gdpr_general_settings_handling'].'</legend>';
// Cas hranjenja podatkov
- echo ' <span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_expire'].':</span>';
- echo ' <label for="expire_0"><input type="radio" name="expire" id="expire_0" '.($gdpr_settings['expire'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_expire_0'].'</label> ';
-
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span>';
- echo ' <label for="expire_1"><input type="radio" name="expire" id="expire_1" '.($gdpr_settings['expire'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_expire_1'].'</label> ';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_expire'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="expire" id="expire_0" '.($gdpr_settings['expire'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="expire_0">'.$lang['srv_gdpr_survey_gdpr_expire_0'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="expire" id="expire_1" '.($gdpr_settings['expire'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="expire_1">'.$lang['srv_gdpr_survey_gdpr_expire_1'].'</label> ';
+ echo '</div>';
+
if($language_slo){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text expire" placeholder="'.$lang['srv_gdpr_survey_gdpr_expire_1_placeholder'].'" name="expire_text_slo" id="expire_text_slo" value="'.$gdpr_settings['expire_text_slo'].'" '.($gdpr_settings['expire'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['1'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_expire_1_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text expire text large" name="expire_text_slo" id="expire_text_slo" value="'.$gdpr_settings['expire_text_slo'].'" '.($gdpr_settings['expire'] == 0 ? ' disabled="disabled"' : '').'><p>SLO</p>';
+ echo '</div>';
+ echo '</div>';
}
if($language_eng){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text expire" placeholder="'.$lang['srv_gdpr_survey_gdpr_expire_1_placeholder'].'" name="expire_text_eng" id="expire_text_eng" value="'.$gdpr_settings['expire_text_eng'].'" '.($gdpr_settings['expire'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['2'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_expire_1_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text expire text large" name="expire_text_eng" id="expire_text_eng" value="'.$gdpr_settings['expire_text_eng'].'" '.($gdpr_settings['expire'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
- echo ' <br /><br />';
-
+ echo '</div>';
// Drugi uporabniki podatkov
- echo ' <span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_other_users'].':</span>';
- echo ' <label for="other_users_0"><input type="radio" name="other_users" id="other_users_0" '.($gdpr_settings['other_users'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_other_users_0'].'</label> ';
-
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span>';
- echo ' <label for="other_users_1"><input type="radio" name="other_users" id="other_users_1" '.($gdpr_settings['other_users'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_other_users_1'].'</label> ';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_other_users'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="other_users" id="other_users_0" '.($gdpr_settings['other_users'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="other_users_0">'.$lang['srv_gdpr_survey_gdpr_other_users_0'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="other_users" id="other_users_1" '.($gdpr_settings['other_users'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="other_users_1">'.$lang['srv_gdpr_survey_gdpr_other_users_1'].'</label> ';
+ echo '</div>';
+
if($language_slo){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text other_users" placeholder="'.$lang['srv_gdpr_survey_gdpr_other_users_1_placeholder'].'" name="other_users_text_slo" id="other_users_text_slo" value="'.$gdpr_settings['other_users_text_slo'].'" '.($gdpr_settings['other_users'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['1'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_other_users_1_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text other_users text large" name="other_users_text_slo" id="other_users_text_slo" value="'.$gdpr_settings['other_users_text_slo'].'" '.($gdpr_settings['other_users'] == 0 ? ' disabled="disabled"' : '').'><p>SLO</p>';
+ echo '</div>';
+ echo '</div>';
}
if($language_eng){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text other_users" placeholder="'.$lang['srv_gdpr_survey_gdpr_other_users_1_placeholder'].'" name="other_users_text_eng" id="other_users_text_eng" value="'.$gdpr_settings['other_users_text_eng'].'" '.($gdpr_settings['other_users'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['2'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_other_users_1_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text other_users text large" name="other_users_text_eng" id="other_users_text_eng" value="'.$gdpr_settings['other_users_text_eng'].'" '.($gdpr_settings['other_users'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
- echo ' <br /><br />';
+ echo '</div>';
// Izvoz v tuje drzave
- echo ' <span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_export'].':</span>';
- echo ' <label for="export_0"><input type="radio" name="export" id="export_0" '.($gdpr_settings['export'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_export_0'].'</label> ';
-
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span>';
- echo ' <label for="export_1"><input type="radio" name="export" id="export_1" '.($gdpr_settings['export'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">'.$lang['srv_gdpr_survey_gdpr_export_country'].'</label> ';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_export'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export" id="export_0" '.($gdpr_settings['export'] == 0 ? ' checked':'').' value="0" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="export_0">'.$lang['srv_gdpr_survey_gdpr_export_0'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="export" id="export_1" '.($gdpr_settings['export'] != 0 ? ' checked':'').' value="1" onClick="toggleGDPRInfoText(this);">';
+ echo ' <label for="export_1">'.$lang['srv_gdpr_survey_gdpr_export_country'].'</label> ';
+ echo '</div>';
+
if($language_slo){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_country_placeholder'].'" name="export_country_slo" id="export_country_slo" value="'.$gdpr_settings['export_country_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['1'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_country_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text export text large" name="export_country_slo" id="export_country_slo" value="'.$gdpr_settings['export_country_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>SLO</p>';
+ echo '</div>';
+ echo '</div>';
}
if($language_eng){
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span><input type="text" class="line_text export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_country_placeholder'].'" name="export_country_eng" id="export_country_eng" value="'.$gdpr_settings['export_country_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['2'].'</span>';
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_country_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text export text large" name="export_country_eng" id="export_country_eng" value="'.$gdpr_settings['export_country_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
- echo ' <br /><br /><span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_export_user'].':</span>';
+ echo '<span class="setting_title semi-bold top8 indent">'.$lang['srv_gdpr_survey_gdpr_export_user'].':</span>';
+
if($language_slo){
- echo ' <input type="text" class="line_text export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_user_placeholder'].'" name="export_user_slo" id="export_user_slo" value="'.$gdpr_settings['export_user_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['1'].'</span>';
- echo ' <br />';
+
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_user_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text export text large" name="export_user_slo" id="export_user_slo" value="'.$gdpr_settings['export_user_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
if($language_eng){
- echo ' <input type="text" class="line_text export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_user_placeholder'].'" name="export_user_eng" id="export_user_eng" value="'.$gdpr_settings['export_user_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['2'].'</span>';
+
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_user_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text export text large" name="export_user_eng" id="export_user_eng" value="'.$gdpr_settings['export_user_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
- echo '<br /><br /><span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_export_legal'].':</span>';
+
+ echo '<span class="setting_title semi-bold top8 indent">'.$lang['srv_gdpr_survey_gdpr_export_legal'].':</span>';
+
if($language_slo){
- echo ' <input type="text" class="line_text long export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_legal_placeholder'].'" name="export_legal_slo" id="export_legal_slo" value="'.$gdpr_settings['export_legal_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['1'].'</span>';
- echo ' <br /><span class="nastavitveSpan1">&nbsp;</span>';
+
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_legal_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text long export text large" name="export_legal_slo" id="export_legal_slo" value="'.$gdpr_settings['export_legal_slo'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
if($language_eng){
- echo ' <input type="text" class="line_text long export" placeholder="'.$lang['srv_gdpr_survey_gdpr_export_legal_placeholder'].'" name="export_legal_eng" id="export_legal_eng" value="'.$gdpr_settings['export_legal_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'> <span class="italic">'.$admin_languages['2'].'</span>';
+
+ echo '<div class="setting_item indent">';
+ echo '<p>'.$lang['srv_gdpr_survey_gdpr_export_legal_placeholder'].':</p>';
+ echo '<div class="text_follow">';
+ echo '<input type="text" class="line_text long export text large" name="export_legal_eng" id="export_legal_eng" value="'.$gdpr_settings['export_legal_eng'].'" '.($gdpr_settings['export'] == 0 ? ' disabled="disabled"' : '').'><p>ENG</p>';
+ echo '</div>';
+ echo '</div>';
}
- echo ' <br /><br />';
+ echo '</div>';
// Pooblascena oseba za varstvo podatkov
@@ -905,11 +1140,11 @@ class GDPR{
else{
$gdpr_authorized = $gdpr_settings['authorized'];
}
- echo ' <span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_authorized'].':</span>';
- echo ' <input type="text" name="authorized" id="authorized" value="'.$gdpr_authorized.'">';
-
- echo ' <br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_authorized'].':</span>';
+ echo ' <input type="text" class="text large" name="authorized" id="authorized" value="'.$gdpr_authorized.'">';
+ echo '</div>';
// Kontaktni email
if($gdpr_settings['contact_email'] == ''){
@@ -928,46 +1163,32 @@ class GDPR{
else{
$gdpr_contact_email = $gdpr_settings['contact_email'];
}
- echo ' <span class="nastavitveSpan1">'.$lang['srv_gdpr_survey_gdpr_contact_email'].':</span>';
- echo ' <input type="text" name="contact_email" id="contact_email" value="'.$gdpr_contact_email.'">';
-
- echo ' <br /><br />';
-
- // Opomba
- echo ' <span class="nastavitveSpan1">'.$lang['note'].':</span>';
- if($language_slo){
- echo ' <textarea name="note_slo" id="note_slo" style="width:500px; height:80px;">'.$gdpr_settings['note_slo'].'</textarea> <span class="italic">'.$admin_languages['1'].'</span>';
- echo ' <span class="nastavitveSpan1">&nbsp;</span>';
- }
- if($language_eng){
- echo ' <textarea name="note_eng" id="note_eng" style="width:500px; height:80px;">'.$gdpr_settings['note_eng'].'</textarea> <span class="italic">'.$admin_languages['2'].'</span>';
- }
-
- echo ' <br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title semi-bold">'.$lang['srv_gdpr_survey_gdpr_contact_email'].':</span>';
+ echo ' <input type="text" class="text large" name="contact_email" id="contact_email" value="'.$gdpr_contact_email.'">';
+ echo '</div>';
echo '</fieldset>';
// Gumb shrani spremembe
- echo '<br class="clr" />';
- //echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $ank_id . '.submit(); return false;"><span>';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onClick="editGDPRSurvey(\''.$ank_id.'\'); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location.reload(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="editGDPRSurvey(\''.$ank_id.'\'); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+
+ echo '<div id="gdpr_bottom_wrap">';
- echo '<br /><br />';
-
+ echo '<div id="gdpr_bottom_wrap_left">';
// Export - informacije dane posamezniku
- echo '<fieldset id="gdpr_export_individual" class="wide" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
+ echo '<fieldset id="gdpr_export_individual" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
echo '<legend>'.$lang['srv_gdpr_survey_gdpr_export_individual'].'</legend>';
- echo ' <br />';
-
- echo '<a href="#" onClick="previewGDPRExport(\'1\'); return false;"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</a>';
- echo ' <br />';
+ echo '<a class="noline" href="#" onClick="previewGDPRExport(\'1\'); return false;"><span class="faicon preview link-right"></span>'.$lang['srv_poglejanketo2'].'</a>';
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
@@ -977,69 +1198,60 @@ class GDPR{
}
else{
- echo '<br />';
if($language_slo){
- echo '<span class="bold">'.$admin_languages['1'].':</span><br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_individual&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_individual&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - (Microsoft Word)</a>';
+ echo '<span class="semi-bold lang">'.$admin_languages['1'].':</span>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_individual&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - Adobe Acrobat</a>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_individual&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - Microsoft Word</a>';
- echo '<br /><br />';
}
if($language_eng){
- echo '<span class="bold">'.$admin_languages['2'].':</span><br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_individual&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_individual&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - (Microsoft Word)</a>';
+ echo '<span class="semi-bold lang">'.$admin_languages['2'].':</span>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_individual&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - Adobe Acrobat</a>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_individual&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - Microsoft Word</a>';
- echo '<br /><br />';
}
}
echo '</fieldset>';
+ echo '</div>'; #left
- echo ' <br />';
+ echo '<div id="gdpr_bottom_wrap_right">';
// Export - evidenca dejavnosti obdelav
- echo '<fieldset id="gdpr_export_activity" class="wide" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
+ echo '<fieldset id="gdpr_export_activity" '.(!$gdpr_show_advanced ? ' style="display:none;"' : '').'>';
echo '<legend>'.$lang['srv_gdpr_survey_gdpr_export_activity'].'</legend>';
- echo ' <br />';
-
- echo '<a href="#" onClick="previewGDPRExport(\'2\'); return false;"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</a>';
- echo ' <br />';
+ echo '<a href="#" class="noline" onClick="previewGDPRExport(\'2\'); return false;"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</a>';
if(!$userAccess->checkUserAccess($what='gdpr_export')){
$userAccess->displayNoAccess($what='gdpr_export');
}
else{
- echo '<br />';
if($language_slo){
- echo '<span class="bold">'.$admin_languages['1'].':</span><br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_activity&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo ' <br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_activity&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - (Microsoft Word)</a>';
+ echo '<span class="semi-bold lang">'.$admin_languages['1'].':</span>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_activity&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - Adobe Acrobat</a>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_activity&anketa='.$ank_id.'&language=1').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - Microsoft Word</a>';
- echo '<br /><br />';
}
if($language_eng){
- echo '<span class="bold">'.$admin_languages['2'].':</span><br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_activity&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo ' <br />';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_activity&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - (Microsoft Word)</a>';
-
- echo '<br /><br />';
+ echo '<span class="semi-bold lang">'.$admin_languages['2'].':</span>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_gdpr_activity&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon pdf"></span>&nbsp;PDF - Adobe Acrobat</a>';
+ echo '<a class="noline lang" href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_gdpr_activity&anketa='.$ank_id.'&language=2').'" target="_blank"><span class="faicon rtf"></span>&nbsp;DOC - Microsoft Word</a>';
}
}
echo '</fieldset>';
+
+ echo '</div>'; #right
+ echo '</div>'; #wrap
+
}
// Prikazemo vsebino zavihka gdpr - nastavitve posamezne ankete
@@ -1047,7 +1259,7 @@ class GDPR{
global $site_url;
global $lang;
- echo '<div style="font-style:italic; margin-top:-10px;">';
+ echo '<div style="margin-top:-10px;">';
echo '<p>'.$lang['srv_gdpr_requests_desc'].'</p>';
echo '</div>';
@@ -1058,6 +1270,7 @@ class GDPR{
$request_list_done = self::getUserRequests($ank_id, $status=1);
if(count($request_list) > 0){
+
echo '<table class="gdpr_surveys requests">';
echo '<tr>';
@@ -1106,7 +1319,8 @@ class GDPR{
// Tabela opravljenih zahtevkov
if(count($request_list_done) > 0){
- echo '<br /><span class="requests_table_title">'.$lang['srv_gdpr_requests_done'].'</span>';
+ //echo '<br /><span class="requests_table_title">'.$lang['srv_gdpr_requests_done'].'</span>';
+ echo '<br /><div class="requests_table_title">'.$lang['srv_gdpr_requests_done'].'</div>';
echo '<table class="gdpr_surveys requests" style="margin-top:0;">';
@@ -1155,13 +1369,16 @@ class GDPR{
global $lang;
global $site_url;
+ echo '<fieldset><legend>DPA</legend>';
+
echo '<p>'.$lang['srv_gdpr_dpa_text'].'</p>';
echo '<ul>';
- echo ' <li><a href="'.$site_url.'uploadi/dokumenti/DPA_SLO.pdf">'.$lang['srv_gdpr_dpa_slo'].'</a></li>';
- echo ' <li><a href="'.$site_url.'uploadi/dokumenti/DPA_ANG.pdf">'.$lang['srv_gdpr_dpa_eng'].'</a></li>';
+ echo ' <li><a href="https://www.1ka.si/uploadi/dokumenti/DPA_SLO.pdf" target="_blank">'.$lang['srv_gdpr_dpa_slo'].'</a>,</li>';
+ echo ' <li><a href="https://www.1ka.si/uploadi/dokumenti/DPA_ANG.pdf" target="_blank">'.$lang['srv_gdpr_dpa_eng'].'</a>.</li>';
echo '</ul>';
- echo '<p>'.$lang['srv_gdpr_dpa_info'].'</p>';
+ echo '<p class="top16">'.$lang['srv_gdpr_dpa_info'].'</p>';
+ echo '</fieldset>';
}
@@ -1180,12 +1397,24 @@ class GDPR{
$temp_naslov = array();
$temp_active = array();
+ $count_gdpr = 0;
+ $count_potential_gdpr = 0;
+ $count_no_gdpr = 0;
+
$key = 0;
foreach($surveys as $anketa){
$potential_gdpr = $this->potentialGDPRSurvey($anketa['id']);
$gdpr = $this->isGDPRSurvey($anketa['id']);
+ // Prestejemo ankete v posamezni skupini
+ if($gdpr == '1')
+ $count_gdpr++;
+ elseif($potential_gdpr == '1')
+ $count_potential_gdpr++;
+ else
+ $count_no_gdpr++;
+
$temp_gdpr[$key] = $gdpr;
$temp_gdpr_p[$key] = $potential_gdpr;
$temp_naslov[$key] = $anketa['naslov'];
@@ -1204,7 +1433,13 @@ class GDPR{
array_multisort($temp_gdpr, SORT_DESC, $temp_gdpr_p, SORT_DESC, $temp_active, SORT_DESC, $temp_naslov, SORT_DESC, $survey_list);
- return $survey_list;
+ $survey_count = array(
+ 'gdpr' => $count_gdpr,
+ 'potential_gdpr' => $count_potential_gdpr,
+ 'no_gdpr' => $count_no_gdpr
+ );
+
+ return array($survey_list, $survey_count);
}
// Pridobimo vse zahteve za izbris za userja (za vse ankete ali samo za doloceno anketo)
@@ -1249,13 +1484,38 @@ class GDPR{
global $lang;
$sql = sisplet_query("SELECT * FROM srv_gdpr_user WHERE usr_id='".$global_user_id."'");
- $row = mysqli_fetch_array($sql);
- if($row['country'] == ''){
- $row['country'] = ($lang['id'] == '1') ? 'Slovenija' : 'Slovenia';
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+
+ $gdpr_settings = $row;
+
+ if($gdpr_settings['country'] == ''){
+ $gdpr_settings['country'] = ($lang['id'] == '1') ? 'Slovenija' : 'Slovenia';
+ }
+ }
+ else{
+ $gdpr_settings = array(
+ 'usr_id' => '',
+ 'type' => '',
+ 'has_dpo' => '',
+ 'organization' => '',
+ 'organization_maticna' => '',
+ 'organization_davcna' => '',
+ 'dpo_phone' => '',
+ 'dpo_email' => '',
+ 'dpo_lastname' => '',
+ 'dpo_firstname' => '',
+ 'firstname' => '',
+ 'lastname' => '',
+ 'email' => '',
+ 'phone' => '',
+ 'address' => '',
+ 'country' => '',
+ );
}
- return $row;
+ return $gdpr_settings;
}
// Preverimo ce je uporabnik izpolnil gdpr profil
@@ -1266,15 +1526,15 @@ class GDPR{
$sql = sisplet_query("SELECT * FROM srv_gdpr_user WHERE usr_id='".$global_user_id."'");
$row = mysqli_fetch_array($sql);
- if($row['firstname'] == '' || $row['lastname'] == '' || $row['email'] == '')
+ if($row === null || $row['firstname'] == '' || $row['lastname'] == '' || $row['email'] == '')
return false;
// Ce ima dpo so obvezni ime, priimek in posta
- if(($row['type'] == '1' || $row['has_dpo'] == '1') && ($row['dpo_firstname'] == '' || $row['dpo_lastname'] == '' || $row['dpo_email'] == ''))
+ if($row === null || ($row['type'] == '1' || $row['has_dpo'] == '1') && ($row['dpo_firstname'] == '' || $row['dpo_lastname'] == '' || $row['dpo_email'] == ''))
return false;
// Za podjetje sta obvezni ime in maticna
- if($row['type'] == '1' && ($row['organization'] == '' || $row['organization_maticna'] == ''))
+ if($row === null || $row['type'] == '1' && ($row['organization'] == '' || $row['organization_maticna'] == ''))
return false;
return true;
@@ -1287,10 +1547,45 @@ class GDPR{
if(mysqli_num_rows($sql) > 0){
$row = mysqli_fetch_array($sql);
+ $row += array('is_gdpr' => '1');
+
return $row;
}
- else
- return 0;
+ else{
+ $data = array(
+ 'is_gdpr' => '0',
+ '1ka_template' => '0',
+ 'name' => '0',
+ 'email' => '0',
+ 'location' => '0',
+ 'phone' => '0',
+ 'web' => '0',
+ 'other' => '0',
+ 'other_text_slo' => '',
+ 'other_text_eng' => '',
+ 'about' => '',
+ 'expire' => '0',
+ 'expire_text_slo' => '',
+ 'expire_text_eng' => '',
+ 'other_users' => '0',
+ 'other_users_text_slo' => '',
+ 'other_users_text_eng' => '',
+ 'export' => '0',
+ 'export_country_slo' => '',
+ 'export_country_eng' => '',
+ 'export_user_slo' => '',
+ 'export_user_eng' => '',
+ 'export_legal_slo' => '',
+ 'export_legal_eng' => '',
+ 'authorized' => '',
+ 'contact_email' => '',
+ 'note_slo' => '',
+ 'note_eng' => ''
+ );
+
+ return $data;
+ }
+
}
// Vrne text za gdpr preduvod glede na to kaj je oznaceno da se zbira
@@ -1358,20 +1653,20 @@ class GDPR{
$naslov = '<h3 style="margin-top: 0;">'.$lang['srv_gdpr_intro_title'].'</h3>';
$naslov .= '<p>'.$lang['srv_gdpr_intro'].':</p>';
- $naslov .= '<ul>';
+ $naslov .= ' <ul>';
if($user_settings['name'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_name'].'</li>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_name'].'</li> ';
if($user_settings['email'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_email'].'</li>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_email'].'</li> ';
if($user_settings['location'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_location'].'</li>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_location'].'</li> ';
if($user_settings['phone'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_phone'].'</li>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_phone'].'</li> ';
if($user_settings['web'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_web'].'</li>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_web'].'</li> ';
if($user_settings['other'])
- $naslov .= '<li>'.$lang['srv_gdpr_intro_other'].' - '.$user_settings['other_text'.$translation].'</li>';
- $naslov .= '</ul>';
+ $naslov .= ' <li>'.$lang['srv_gdpr_intro_other'].' - '.$user_settings['other_text'.$translation].'</li> ';
+ $naslov .= '</ul> ';
$naslov .= '<p>'.$lang['srv_gdpr_intro2'];
$naslov .= ' '.$lang['srv_gdpr_intro3'].'</p>';
@@ -1471,8 +1766,6 @@ class GDPR{
// Poskrbi za vse potrebno ko respondent zahteva izbris oz. vpogled v podatke
public function sendGDPRRequest($request_data){
global $lang;
- global $gdpr_admin_email;
- global $app_settings;
$errors = array();
@@ -1570,10 +1863,10 @@ class GDPR{
else
$note = $request_data['gdpr-note'];
-
+
// Ce imamo vse potrebne podatke posredujemo zahtevo
if(empty($errors)){
-
+
// Zabelezimo zahtevo v bazo
$sql = sisplet_query("INSERT INTO srv_gdpr_requests
(usr_id, ank_id, email, url, datum, text, type)
@@ -1619,7 +1912,7 @@ class GDPR{
$content .= '<p>Prosimo, da <b>v roku enega meseca</b> izvršite zahtevo in o tem obvestite respondenta na zgoraj navedeni elektronski naslov respondenta (<a href="http://eur-lex.europa.eu/legal-content/SL/TXT/?uri=uriserv:OJ.L_.2016.119.01.0001.01.SLV&toc=OJ:L:2016:119:FULL" target="_blank">Člen 19 uredbe GDPR</a>).</p>';
- $content .= '<p>V primeru, da tega po enem mesecu ne boste izvršili, vas bomo ponovno obvestili. Če se zahteva ne izvrši, si pridružujemo pravico, da anketo izbrišemo.</p>';
+ $content .= '<p>V primeru, da tega po enem mesecu ne boste izvršili, vas bomo ponovno obvestili. Če se zahteva ne izvrši, si pridržujemo pravico, da anketo izbrišemo.</p>';
// Podpis
$signature = Common::getEmailSignature();
@@ -1635,7 +1928,7 @@ class GDPR{
//$MA->addRecipients('dusan.rutnik@gorenje.com');
$MA->addRecipients('gdpr@gorenje.com');
}
- elseif(isset($gdpr_admin_email) && $gdpr_admin_email != ''){
+ elseif(AppSettings::getInstance()->getSetting('gdpr_admin_email') !== false){
$MA->addRecipients($gdpr_admin_email);
}
else{
@@ -1644,20 +1937,17 @@ class GDPR{
}
$resultX = $MA->sendMail($content, $subject);
- }
- catch (Exception $e){
- }
+ }
+ catch (Exception $e){
+ }
// Vrnemo vse ok
- if($jezik == '2'){
- $success_text = 'Your request for the deletion, change or insight into your personal information for a particular survey is submitted to
- the author of the survey. The author of the survey must, within a month since you submitted the request, execute your
- request and inform you about it. If the author fails to do so within 30 days, we will delete the survey, including your information.';
- }else {
- $success_text = 'Prošnja za izbris, spremembo ali vpogled do vaših osebnih podatkov iz določene ankete je posredovana avtorju ankete.
- Avtor ankete mora v roku meseca dni od oddane zahteve urediti vašo zahtevo in vas o tem obvestiti.
- Če v roku 30 dni avtor tega ne izvede, bomo anketo izbrisali, vključno z vašimi podatki.';
- }
+ if($jezik == '2'){
+ $success_text = 'Your request for the deletion, change or insight into your personal information for a particular survey is submitted to the author of the survey.<br>The author of the survey must, within a month since you submitted the request, execute your request and inform you about it.<br>If the author fails to do so within 30 days, we will delete the survey, including your information.';
+ }
+ else {
+ $success_text = 'Prošnja za izbris, spremembo ali vpogled do vaših osebnih podatkov iz določene ankete je posredovana avtorju ankete.<br>Avtor ankete mora v roku meseca dni od oddane zahteve urediti vašo zahtevo in vas o tem obvestiti.<br>Če v roku 30 dni avtor tega ne izvede, bomo anketo izbrisali, vključno z vašimi podatki.';
+ }
$response = json_encode(array('success' => $success_text), true);
}
@@ -1687,42 +1977,57 @@ class GDPR{
// Pridobimo id ankete iz url-ja
if($arr[1] == 'a'){
- $data['ank_id'] = $arr[2];
+ $data['hash'] = $arr[2];
+
+ // Dobimo id ankete iz hasha
+ $sql = sisplet_query("SELECT a.id AS ank_id, a.naslov, u.id AS usr_id, u.lang, u.email
+ FROM srv_anketa a, users u
+ WHERE a.hash='".$data['hash']."' AND u.id=a.insert_uid
+ ");
+
+ // Anekta ne obstaja - nepravilen url
+ if(mysqli_num_rows($sql) == 0)
+ return false;
+
+ $row = mysqli_fetch_array($sql);
+
+ $data['url'] = $site_url.'a/'.$data['hash'];
+
+ $data['ank_id'] = $row['ank_id'];
+ $data['title'] = $row['naslov'];
+ $data['usr_id'] = $row['usr_id'];
+ $data['usr_lang'] = $row['lang'];
+ $data['author_email'] = $row['email'];
}
else{
// Preverimo ce imamo mogoce lep url
$nice_url = $arr[1];
- $sqlN = sisplet_query("SELECT ank_id, link FROM srv_nice_links WHERE link='".$nice_url."'");
- if(mysqli_num_rows($sqlN) > 0){
- $rowN = mysqli_fetch_array($sqlN);
- $data['ank_id'] = $rowN['ank_id'];
- }
- else
- return false;
- }
-
- // Nastavimo url ankete
- $data['url'] = $site_url.'a/'.$data['ank_id'];
-
- // Pridobimo avtorja in naslov ankete
- $sql = sisplet_query("SELECT a.naslov, u.id, u.lang, u.email
- FROM srv_anketa a, users u
- WHERE a.id='".$data['ank_id']."' AND u.id=a.insert_uid");
- if(mysqli_num_rows($sql) == 1){
- $row = mysqli_fetch_array($sql);
-
- $data['title'] = $row['naslov'];
- $data['usr_id'] = $row['id'];
+ $sql = sisplet_query("SELECT a.id AS ank_id, a.hash, a.naslov, u.id AS usr_id, u.lang, u.email
+ FROM srv_anketa a, srv_nice_links nl, users u
+ WHERE nl.link='".$nice_url."' AND nl.ank_id=a.id AND u.id=a.insert_uid
+ ");
+
+ // Anekta ne obstaja - nepravilen url
+ if(mysqli_num_rows($sql) == 0)
+ return false;
+
+ $row = mysqli_fetch_array($sql);
+
+ $data['url'] = $site_url.'/'.$nice_url;
+
+ $data['ank_id'] = $row['ank_id'];
+ $data['hash'] = $row['hash'];
+ $data['title'] = $row['naslov'];
+ $data['usr_id'] = $row['usr_id'];
$data['usr_lang'] = $row['lang'];
$data['author_email'] = $row['email'];
}
- else
- return false;
}
else
return false;
+
if(isset($data['ank_id']) && isset($data['usr_id']) && isset($data['title']) && isset($data['url']) && isset($data['author_email']))
return $data;
else
@@ -1762,63 +2067,63 @@ class GDPR{
echo ' <input id="lang_id" name="lang_id" value="'.$lang['id'].'" type="hidden">';
// Email
- echo ' <div class="form_row '.(isset($error['email']) ? ' red' : '').'"><div class="label"><label for="email">'.$lang['srv_gdpr_drupal_field_email'].':</label></div>';
- echo ' <input class="regfield" id="email" name="email" value="'.(isset($posted['email']) && !isset($error['email']) ? $posted['email'] : '').'" placeholder="'.$lang['email'].'" type="text">';
+ echo ' <div class="form_row input_field '.(isset($error['email']) ? ' red' : '').'"><div class="label"><label for="email">'.$lang['srv_gdpr_drupal_field_email'].':</label></div>';
+ echo ' <input class="regfield" id="email" name="email" value="'.(isset($posted['email']) && !isset($error['email']) ? $posted['email'] : '').'" >';
if(isset($error['email']) && $error['email'] != '1')
echo '<span class="spaceLeft">'.$error['email'].'</span>';
echo ' </div>';
// Ime ankete
- echo ' <div class="form_row '.(isset($error['srv-name']) ? ' red' : '').'"><div class="label"><label for="srv-name">'.$lang['srv_gdpr_drupal_field_srv-name'].':</label></div>';
- echo ' <input class="regfield" id="srv-name" name="srv-name" value="'.(isset($posted['srv-name']) && !isset($error['srv-name']) ? $posted['srv-name'] : '').'" placeholder="'.$lang['srv_gdpr_drupal_field_srv-name'].'" type="text">';
+ echo ' <div class="form_row input_field'.(isset($error['srv-name']) ? ' red' : '').'"><div class="label"><label for="srv-name">'.$lang['srv_gdpr_drupal_field_srv-name'].':</label></div>';
+ echo ' <input class="regfield" id="srv-name" name="srv-name" value="'.(isset($posted['srv-name']) && !isset($error['srv-name']) ? $posted['srv-name'] : '').'" >';
if(isset($error['srv-name']) && $error['srv-name'] != '1')
echo '<span class="spaceLeft">'.$error['srv-name'].'</span>';
echo ' </div>';
// URL ankete
- echo ' <div class="form_row '.(isset($error['srv-url']) ? ' red' : '').'"><div class="label"><label for="srv-url">'.$lang['srv_gdpr_drupal_field_srv-url'].':</label></div>';
- echo ' <input class="regfield" id="srv-url" name="srv-url" value="'.(isset($posted['srv-url']) && !isset($error['srv-url']) ? $posted['srv-url'] : '').'" placeholder="'.$lang['srv_gdpr_drupal_field_srv-url'].'" type="text">';
+ echo ' <div class="form_row input_field '.(isset($error['srv-url']) ? ' red' : '').'"><div class="label"><label for="srv-url">'.$lang['srv_gdpr_drupal_field_srv-url'].':</label></div>';
+ echo ' <input class="regfield" id="srv-url" name="srv-url" value="'.(isset($posted['srv-url']) && !isset($error['srv-url']) ? $posted['srv-url'] : '').'" >';
if(isset($error['srv-url']) && $error['srv-url'] != '1')
echo '<span class="spaceLeft">'.$error['srv-url'].'</span>';
echo ' </div>';
- echo ' <br />';
+ // echo ' <br />';
// Tip zahteve
echo ' <p>'.$lang['srv_gdpr_drupal_q1_title'].'</p>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_1">';
+ echo ' <div class="form_row zahtevek '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_1">';
echo ' <input type="radio" id="gdpr-action_1" name="gdpr-action" value="1" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '1' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer1'];
echo ' </label></div>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_2">';
+ echo ' <div class="form_row zahtevek '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_2">';
echo ' <input type="radio" id="gdpr-action_2" name="gdpr-action" value="2" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '2' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer2'];
echo ' </label></div>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_3">';
+ echo ' <div class="form_row zahtevek '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_3">';
echo ' <input type="radio" id="gdpr-action_3" name="gdpr-action" value="3" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '3' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer3'];
echo ' </label></div>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_4">';
+ echo ' <div class="form_row zahtevek '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_4">';
echo ' <input type="radio" id="gdpr-action_4" name="gdpr-action" value="4" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '4' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer4'];
echo ' </label></div>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_5">';
- echo ' <input type="radio" id="gdpr-action_5" name="gdpr-action" value="5" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '5' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer5'];
- echo ' </label></div>';
- echo ' <div class="form_row '.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_6">';
+ // echo ' <div class="form_row zahtevek'.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_5">';
+ // echo ' <input type="radio" id="gdpr-action_5" name="gdpr-action" value="5" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '5' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer5'];
+ // echo ' </label></div>';
+ echo ' <div class="form_row zahtevek'.(isset($error['gdpr-action']) ? ' red' : '').'"><label for="gdpr-action_6">';
echo ' <input type="radio" id="gdpr-action_6" name="gdpr-action" value="6" '.(isset($posted['gdpr-action']) && $posted['gdpr-action'] == '6' ? ' checked="checked"' : '').'> '.$lang['srv_gdpr_drupal_q1_answer6'];
echo ' </label></div>';
- echo ' <br />';
+ // echo ' <br />';
// Opomba
echo ' <p '.(isset($error['gdpr-note']) ? ' class="red"' : '').'>'.$lang['srv_gdpr_drupal_q2_note'].'</p>';
+ echo '<p class="opis"> Opis: </p>';
echo ' <textarea id="gdpr-note" name="gdpr-note" value="" '.(isset($error['gdpr-note']) ? ' class="red"' : '').'>'.(isset($posted['gdpr-note']) ? $posted['gdpr-note'] : '').'</textarea>';
- echo ' <br /><br />';
+ // echo ' <br /><br />';
// Poslji prosnjo
echo ' <p>'.$lang['srv_gdpr_drupal_end'].'</p>';
- //echo ' <input name="submit" value="'.$lang['srv_potrdi'].'" class="regfield" type="submit"><br />';
- echo ' <input name="submit" value="'.$lang['srv_potrdi'].'" class="regfield" type="button" onClick="sendGDPRRequest();"><br />';
+ echo ' <input name="submit" value="'.$lang['srv_potrdi2'].'" class="regfield" type="button" onClick="sendGDPRRequest();">';
echo ' </form>';
}
@@ -1886,8 +2191,9 @@ class GDPR{
if($gdpr_survey_settings['expire'] == '1' && $gdpr_survey_settings['expire_text'.$translation] != '')
$result[1]['text'][2] .= ' <strong>'.$gdpr_survey_settings['expire_text'.$translation].'</strong>.';
- else
- $result[1]['text'][2] .= ' <strong>'.$lang['srv_gdpr_survey_gdpr_about_text2_5'].'</strong>';
+ //text already included in srv_gdpr_survey_gdpr_evidenca_text7_2, so it can duplicate
+ /* else
+ $result[1]['text'][2] .= ' <strong>'.$lang['srv_gdpr_survey_gdpr_about_text2_5'].'</strong>'; */
// UPORABNIKI OSEBNI PODATKOV
@@ -2146,6 +2452,8 @@ class GDPR{
else
$br = '<br />';
+ $text = '';
+
// Loop po posameznih sklopih
foreach($text_array as $sklop){
@@ -2481,7 +2789,7 @@ class GDPR{
echo '<div id="preview_spremenljivka">';
- echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancle(); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancel(); return false;">✕</a></div>';
echo ' <div class="spremenljivka">';
@@ -2500,7 +2808,7 @@ class GDPR{
echo ' </div>';
// Gumba zapri
- //echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="preview_spremenljivka_cancle(); return false;"><span>Zapri</span></a></div>';
+ //echo '<div class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="preview_spremenljivka_cancel(); return false;"><span>Zapri</span></a></div>';
echo '</div>';
}
@@ -2516,9 +2824,9 @@ class GDPR{
$type = $_POST['type'];
- echo '<div id="preview_gdpr_export" class="divPopUp">';
+ echo '<div id="preview_gdpr_export">';
- echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancle(); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="preview_spremenljivka_cancel(); return false;">✕</a></div>';
echo '<div class="content">';
diff --git a/admin/survey/classes/class.GlobalMisc.php b/admin/survey/classes/class.GlobalMisc.php
index 8075284..446bf60 100644
--- a/admin/survey/classes/class.GlobalMisc.php
+++ b/admin/survey/classes/class.GlobalMisc.php
@@ -14,9 +14,13 @@ class GlobalMisc {
return self::$getMisc[$what];
$sql = sisplet_query("SELECT * FROM srv_misc WHERE what = '$what'");
- $row = mysqli_fetch_array($sql);
- return self::$getMisc[$what] = $row['value'];
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+ return self::$getMisc[$what] = $row['value'];
+ }
+
+ return false;
}
static function setMisc($what, $value) {
diff --git a/admin/survey/classes/class.HashUrl.php b/admin/survey/classes/class.HashUrl.php
index 1c4e536..b2f37a1 100644
--- a/admin/survey/classes/class.HashUrl.php
+++ b/admin/survey/classes/class.HashUrl.php
@@ -152,12 +152,13 @@ class HashUrl
public function setPage($string)
{
- if ($string == HashUrl::PAGE_ANALYSIS)
- {
+ if ($string == HashUrl::PAGE_ANALYSIS){
$this->_hash_page = HashUrl::PAGE_ANALYSIS;
}
- else
- {
+ elseif($string == 'data_nijz'){
+ $this->_hash_page = 'data_nijz';
+ }
+ else{
$this->_hash_page = HashUrl::PAGE_DATA;
}
}
diff --git a/admin/survey/classes/class.Help.php b/admin/survey/classes/class.Help.php
new file mode 100644
index 0000000..7f1b224
--- /dev/null
+++ b/admin/survey/classes/class.Help.php
@@ -0,0 +1,195 @@
+<?php
+
+/*
+ Class, ki skrbi za prikaz in urejanje vprasajckov
+*/
+
+
+class Help {
+
+ /**
+ * @desc izpise polje s helpom.
+ * ce smo v editmodu se bo prikazal textbox za urejanje helpa
+ * ce smo v navadnem modu se bo prikazal help box
+ */
+ public static function display ($what, $title='') {
+ global $admin_type, $lang;
+
+ $help = '';
+
+ $sql = sisplet_query("SELECT help FROM srv_help WHERE what='$what' AND lang='$lang[id]'");
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_array($sql);
+ $help = $row['help'];
+ }
+
+ if ($admin_type == 0 && isset($_COOKIE['edithelp'])) {
+ return ' <a href="/" id="help_'.$what.'" lang="'.$lang['id'].'" class="edithelp" onclick="return false;" title_txt="">'.(empty($title) ? '(?)' : '<span class="faicon help2 title20"></span>').'</a>';
+ }
+ elseif ($help != '') {
+ return ' <a href="/" id="help_'.$what.'" lang="'.$lang['id'].'" class="help" onclick="return false;" title_txt="">'.(empty($title) ? '(?)' : '<span class="faicon help2 title20"></span>').'</a>';
+ }
+
+ }
+
+
+ // Prikazemo zavihek z nastavitvami vprasajckov
+ public static function displaySettings(){
+ global $lang;
+
+
+ // Vklop / izklop urejanja vprasajckov
+ echo '<fieldset>';
+ echo ' <legend>' . $lang['help_settings_activate_editing'] . '</legend>';
+ echo ' <p class="bottom16" >' . $lang['help_settings_activate_editing'] . ' '.Help::display('srv_window_help').':</p>';
+ self::editToggle();
+ echo '</fieldset>';
+
+
+ // Urejanje vseh vprasajckov
+ echo '<fieldset>';
+ echo ' <legend>' . $lang['help_settings_list'] . '</legend>';
+ self::editVprasajcki();
+ echo '</fieldset>';
+ }
+
+ // vkljuci izkljuci editiranje helpa
+ private static function editToggle () {
+ global $lang;
+
+ if (isset($_COOKIE['edithelp'])) {
+ echo '<div class="button_holder bottom0">';
+ echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?t=help&a=edit_off\';return false;">'.$lang['srv_insend'].'</button>';
+ echo '</div>';
+ }
+ else {
+ echo '<div class="button_holder bottom0">';
+ echo '<button class="medium blue" onClick="window.location.href=\'ajax.php?t=help&a=edit_on\';return false;">'.$lang['start'].'</button>';
+ echo '</div>';
+ }
+ }
+
+ // Izpise seznam vprasajckov za urejanje
+ private static function editVprasajcki () {
+ global $lang;
+
+ $sql = sisplet_query("SELECT *
+ FROM srv_help h
+ LEFT JOIN users u
+ ON u.id=h.last_edit_usr_id
+ WHERE h.lang='".$lang['id']."'
+ ORDER BY h.last_edit_time DESC, h.what ASC
+ ");
+ while($row = mysqli_fetch_array($sql)){
+
+ echo '<div class="setting_holder help_edit">';
+
+ echo '<div class="col1">';
+ echo $row['what'].' '.self::display($row['what']);
+
+ echo '<div class="last_edit">';
+ echo 'Zadnje urejanje:<br>'.date('d.m.Y, H:i', strtotime($row['last_edit_time']));
+ if($row['email'] != '')
+ echo '<br>('.$row['email'].')';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="col2">';
+ echo ' <textarea id="edithelp_mass_'.$row['what'].'">'.$row['help'].'</textarea>';
+ echo '</div>';
+
+ echo '<div class="col3">';
+ echo ' <button class="small blue" onClick="save_help_mass(\''.$row['what'].'\', \''.$lang['id'].'\');">Shrani</button>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+
+
+ function ajax () {
+
+ if ($_GET['a'] == 'edit_on') {
+ $this->ajax_edit_on();
+ }
+ elseif ($_GET['a'] == 'edit_off') {
+ $this->ajax_edit_off();
+ }
+ elseif ($_GET['a'] == 'display_edit_help') {
+ $this->ajax_display_edit_help();
+ }
+ elseif ($_GET['a'] == 'save_help') {
+ $this->ajax_save_help();
+ }
+ elseif ($_GET['a'] == 'display_help') {
+ $this->ajax_display_help();
+ }
+ }
+
+ /**
+ * @desc vklopi editiranje helpa (nastavi cooike)
+ */
+ function ajax_edit_on () {
+
+ setcookie('edithelp', 'on');
+
+ header("Location: index.php?a=nastavitve&m=help_settings");
+ }
+
+ /**
+ * @desc izklopi editiranje helpa (nastavi cooike)
+ */
+ function ajax_edit_off () {
+
+ setcookie('edithelp', '', time()-3600);
+
+ header("Location: index.php?a=nastavitve&m=help_settings");
+ }
+
+ /**
+ * @desc prikaze formo za urejanje helpa
+ */
+ function ajax_display_edit_help () {
+ global $lang;
+
+ $l = (int)$_GET['lang'];
+
+ $what = substr($_REQUEST['what'], 5);
+
+ $sql = sisplet_query("SELECT help FROM srv_help WHERE what = '$what' AND lang='$l'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<textarea id="edithelp_'.$what.'" name="help" style="width:100%; height: 100px">'.$row['help'].'</textarea>';
+ echo '<input type="button" value="'.$lang['save'].'" onclick="save_help(\''.$what.'\', \''.$l.'\')" />';
+
+ }
+
+ /**
+ * @desc shrani help
+ */
+ function ajax_save_help () {
+ global $global_user_id;
+
+ $l = (int)$_GET['lang'];
+
+ $what = $_REQUEST['what'];
+ $help = $_POST['help'];
+
+ sisplet_query("REPLACE INTO srv_help (what, lang, help, last_edit_usr_id) VALUES ('".$what."', '".$l."', '".$help."', '".$global_user_id."')");
+ }
+
+ function ajax_display_help() {
+
+ $l = (int)$_GET['lang'];
+
+ $what = substr($_REQUEST['what'], 5);
+
+ $sql = sisplet_query("SELECT help FROM srv_help WHERE what = '$what' AND lang='$l'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<div class="qtip-help">'.nl2br($row['help']).'</div>';
+ }
+}
+
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.Library.php b/admin/survey/classes/class.Library.php
index a509fcc..8e3538e 100644
--- a/admin/survey/classes/class.Library.php
+++ b/admin/survey/classes/class.Library.php
@@ -5,8 +5,6 @@ class Library {
var $Branching;
var $tab = 2; // tab pove kater tab je odprt (od 4ih)
- var $tip = 1; // tip pove v bazi srv_library_folder za kater tip gre (0-vpra�anja, 1-ankete)
- var $prva = 0; // prva pove, ce je to library na prvi strani (1) ali v urejanju ankete (0)
// v odvisnosti od mode prilagajamu UI. (Mode je odvisen od tipa ankete - survey_type)
var $mode = -1; // mode: -1 -> library pri datotekah, 0 -> glasovanje, 1 -> forma, 2 -> ankata na več straneh, 3 -> ifi
@@ -32,28 +30,12 @@ class Library {
if (isset($_options['tab'])) {
$this->tab = $_options['tab'];
- if ($this->tab <= 1)
- $this->tip = 0;
- else
- $this->tip = 1;
}
else if (isset($_POST['tab'])) {
$this->tab = ($_POST['tab'] == 0 || $_POST['tab'] == 'undefined') ? 0 : $_POST['tab'];
- if ($this->tab <= 1)
- $this->tip = 0;
- else
- $this->tip = 1;
}
else {
$this->tab = 0;
- $this->tip = 0;
- }
-
- if (isset($_options['prva'])) {
- $this->prva = $_options['prva'];
- }
- else {
- $this->prva = 0;
}
if (isset($_GET['tab'])) $this->tab = (int)$_GET['tab'];
@@ -72,99 +54,45 @@ class Library {
if(isset($_GET['search']) && $_GET['search'] != ''){
$this->isSearch = 1;
$this->searchString = str_replace("\\", "", trim($_GET['search']));
-
- // Iscemo po naslovu ali vsebini
- $this->searchSettings['stype'] = (isset($_GET['stype'])) ? $_GET['stype'] : '0';
}
+
+ // Iscemo po naslovu ali vsebini
+ $this->searchSettings['stype'] = (isset($_GET['stype'])) ? $_GET['stype'] : '0';
}
-
- /**
- * @desc prikaze knjiznico znotraj ankete na desni
- */
- function display () {
- global $admin_type;
- global $global_user_id;
- global $lang;
-
- echo '<div id="library_title">';
- echo '<span class="faicon library"></span> '.$lang['srv_library'];
- echo '<a href="#" title="'.$lang['srv_zapri'].'" onclick="change_mode(\'toolboxback\', \'1\'); return false;"><span class="faicon close" style="float:right;"></span></a>';
- echo '</div>';
-
- $this->display_tabs();
-
- echo '<div id="library">';
-
- echo '<div id="libraryInner">';
- $this->display_folders();
- echo '</div><!-- id="libraryInner" -->';
-
- echo '</div><!-- id="library" -->';
- }
-
- /**
- * @desc prikaze tabe za izbiro
- */
- function display_tabs () {
- global $lang;
-
- echo '<p class="display_tabs">';
- echo '<span' . ($this->tab==0 || $this->tab==1 ? ' class="highlightTabBlackLeft"' : ' class="nohighlight"') . ' >';
- echo '<a href="/" onclick="display_knjiznica(\'0\'); return false;" title="'.$lang['srv_vprasanja'].'"><span>' . $lang['srv_vprasanja'] . '</span></a></span>';
- echo '<span' . ($this->tab==2 || $this->tab==3 ? ' class="highlightTabBlackRight"' : ' class="nohighlight"') . ' >';
- echo '<a href="/" onclick="display_knjiznica(\'2\'); return false;" title="'.$lang['srv_ankete'].'"><span>' . $lang['srv_ankete'] . '</span></a></span>';
- echo '</p>';
- }
-
+
function display_folders () {
global $global_user_id;
global $lang;
- // Knjiznica znotraj posamezne ankete
- if ($this->prva == 0) {
- $this->display_contentfolders(0, 0);
- $this->display_contentfolders(0, $global_user_id);
-
- if ($this->tip == 1) {
- echo '<p class="bold"><a href="index.php?a=knjiznica">'.$lang['srv_library_edit'].'</a><br>';
-
- $sql = sisplet_query("SELECT * FROM srv_library_anketa WHERE uid='".$global_user_id."' AND ank_id='".$this->SurveyAdmin->anketa."'");
- if (mysqli_num_rows($sql) == 0) {
- echo '<div class="buttonwrapper" style="float:left;">
- <a class="ovalbutton ovalbutton_orange btn_savesettings" onclick="add_to_my_library(); return false;" href="#"><span>'.$lang['srv_library_edit_add'].'</span></a>
- </div></p>';
- }
-
- } else {
- echo '<p>'.$lang['srv_library_q_txt'].'</p>';
- }
+ echo '<div class="advanced_search">';
+ echo ' <div id="searchLibrarySettings">';
+ $this->displaySearchSettings();
+ echo ' </div>';
+ echo '</div>';
+
+ // Na prvi strani imamo search
+ if($this->isSearch == 1){
+ echo '<div class="library_title">'.($this->tab == '3' ? $lang['srv_library_title_search_my'] : $lang['srv_library_title_search_public']).'</div>';
+ $this->display_contentfolders_searchList();
+ }
+ else{
+ echo '<div class="library_title">'.($this->tab == '3' ? $lang['srv_library_title_my'] : $lang['srv_library_title_public']).'</div>';
+ $this->display_contentfolders();
+ }
- //echo '<a style="padding:5px; background-color: white; bottom: 1px; position: absolute; right: 18px;" onclick="change_mode(\'toolboxback\', \'1\'); return false;" href="#">'.$lang['srv_zapri'].'</a>';
- }
- // Knjiznica na prvi strani zraven mojih anket
- else {
- // Na prvi strani imamo search
- if($this->isSearch == 1){
- echo '<div id="searchLibrarySettings">';
- $this->displaySearchSettings();
- echo '</div>';
-
- echo '<div class="clr"></div>';
-
- $this->display_contentfolders_searchList();
- }
- else{
- echo '<div id="searchLibrarySurveys">';
- $this->displaySearch();
- echo '</div>';
-
- echo '<div class="clr"></div>';
-
- $this->display_contentfolders();
- }
- }
+ // Klik izven "Vec" - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".library_more_box, .dots");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".library_more_box").addClass("displayNone");
+ }
+ });
+ </script>';
}
+
/**
* @desc prikaze folderje v knjiznici
@@ -189,198 +117,187 @@ class Library {
$language = " AND lang='$lang[id]' ";
}
- $cookie = $_COOKIE['library_folders'];
+ $cookie = isset($_COOKIE['library_folders']) ? $_COOKIE['library_folders'] : '';
+
// da se v url lahko doda odprte folderje: &libfolder=131-147 (more vkljucevat tudi parente)
if (isset($_GET['libfolder'])) $cookie .= '-'.$_GET['libfolder'].'-';
if ($parent == 0) {
- // v skrite html elemente shranimo tab, in prva
+ // v skrite html elemente shranimo tab
echo '<input type="hidden" name="lib_tab" id="lib_tab" value="'.($this->tab == 0 || $this->tab == "" ? "0" : "$this->tab").'">';
- echo '<input type="hidden" name="lib_tip" id="lib_tip" value="'.($this->tip == 0 || $this->tip== "" ? "0" : "$this->tip").'">';
- echo '<input type="hidden" name="lib_prva" id="lib_prva" value="'.($this->prva == 0 || $this->prva== "" ? "0" : "$this->prva").'">';
echo '<ul title="'.($uid==0?$lang['srv_library_left']:$lang['srv_library_left_right']).'" style="padding-left:0;" class="'.($admin_type==0 || $uid == $global_user_id?'can_edit':'').'">'."\n";
}
- $sql = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE uid='$uid' AND parent = '$parent' AND tip='$this->tip' $language ORDER BY naslov");
+ $sql = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE uid='$uid' AND parent = '$parent' AND tip='1' $language ORDER BY naslov");
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
if (mysqli_num_rows($sql) == 0 && $uid > 0 && $parent == 0) {
// za prvic ko pride user, da mu dodamo folder
- if ($this->tip == 0)
- $naslov = $lang['srv_moja_vprasanja'];
- else
- $naslov = $lang['srv_moje_ankete'];
+ $naslov = $lang['srv_moje_ankete'];
- sisplet_query("INSERT INTO srv_library_folder (uid, tip, naslov, parent, lang) VALUES ('$uid', '$this->tip', '$naslov', '0', '$lang[id]')");
+ sisplet_query("INSERT INTO srv_library_folder (uid, tip, naslov, parent, lang) VALUES ('$uid', '1', '$naslov', '0', '$lang[id]')");
- $sql = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE uid='$uid' AND parent = '$parent' AND tip='$this->tip' ORDER BY naslov");
+ $sql = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE uid='$uid' AND parent = '$parent' AND tip='1' ORDER BY naslov");
if (!$sql)
echo mysqli_error($GLOBALS['connect_db']);
}
while ($row = mysqli_fetch_array($sql)) {
+
if (strpos($cookie, '-'.$row['id'].'-')=== false && $parent!=0)
$hidden = true;
else
$hidden = false;
- echo ' <li id="li'.$row['id'].'" eid="'.$row['id'].'" class="folder" name="folder">';
+ echo ' <li id="li'.$row['id'].'" eid="'.$row['id'].'" class="folder '.($parent != 0 ? 'can_drag' : '').'" name="folder">';
- if ($parent != 0)
- echo ' <a href="/" onclick="javascript:library_folders_plusminus(\''.$row['id'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" id="f_pm_'.$row['id'].'"><span class="faicon icon-blue '.($hidden?'plus':'minus').'"></span></a>';
- else
- echo ' <span class="sprites spacer12"></span>';
- echo ' <span class="'.($parent!=0 || $uid>0 || $admin_type==0 ? ' folderdrop' : '').'" id="sp'.$row['id'].'" eid="'.$row['id'].'"><span class="faicon folder icon-blue'.($parent!=0?' movable':'').'"></span>'.
- ' <span title="'.$lang['srv_rename_profile'].'" '.($admin_type==0||$uid>0?' onclick="folder_rename(\''.$row['id'].'\'); return false;"':'').'>'.$row['naslov'].'</span>';
- if ($admin_type==0 || $uid>0)
- echo ' <a href="/" onclick="javascript:library_new_folder(\''.$row['id'].'\',\''.$uid.'\'); return false;"><span class="faicon add icon-blue-hover-orange small new_folder" id="new_folder_'.$row['id'].'" title="'.$lang['srv_newfolder'].'"></span></a>';
+ echo '<div class="folder_box_holder">';
+
+ // Drag handle
+ /*if($parent != 0)
+ echo '<span class="faicon move_updown folder_handle"></span>';*/
- if ($parent != 0 && ($admin_type==0||$uid>0) )
- echo ' <a href="/" onclick="javascript:library_delete_folder(\''.$row['id'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;"><span class="faicon remove icon-orange small delete_folder" id="delete_folder_'.$row['id'].'" title="'.$lang['srv_deletefolder'].'"></span></a>';
+ // Okvircek folderja
+ echo '<div eid="'.$row['id'].'" class="folder_box '.($hidden ? '' : 'open').' '.($parent!=0 || $uid>0 || $admin_type==0 ? ' folderdrop' : '').'">';
- echo ' </span>'."\n";
+ if ($parent != 0){
+ echo '<span onclick="library_folders_plusminus(\''.$row['id'].'\',\''.$this->tab.'\'); return false;" class="faicon folder_arrow_icon"></span>';
+ }
- echo '<ul id="folder_'.$row['id'].'"'.($hidden?' style="display:none"':'').'>'."\n";
+ echo '<div id="sp'.$row['id'].'" eid="'.$row['id'].'"><span class="faicon folder"></span>';
+ echo '<span '.($admin_type==0||$uid>0? 'title="'.$lang['srv_rename_profile'].'" onclick="folder_rename(\''.$row['id'].'\'); return false;"':'').'>'.$row['naslov'].'</span>';
+ if ($admin_type==0 || $uid>0)
+ echo '<span class="faicon add new_folder" id="new_folder_'.$row['id'].'" title="'.$lang['srv_newfolder'].'" onclick="javascript:library_new_folder(\''.$row['id'].'\',\''.$uid.'\'); return false;"></span>';
+ if ($parent != 0 && ($admin_type==0||$uid>0) )
+ echo '<span class="faicon remove delete_folder" id="delete_folder_'.$row['id'].'" title="'.$lang['srv_deletefolder'].'" onclick="javascript:library_delete_folder(\''.$row['id'].'\',\''.$this->tab.'\'); return false;"></span>';
+ echo '</div>';
- $this->display_contentfolders($row['id'], $uid);
+ echo '<div class="folder_clickable" onclick="library_folders_plusminus(\''.$row['id'].'\',\''.$this->tab.'\'); return false;"></div>';
- $this->display_ifs($row['id']);
+ echo '</div>';
- // Izpis spremenljivk v folderju - v root folderju ne izpisujemo vprasanj (ker jih itak ne sme bit)
- if(!($this->tip == 0 && $parent == 0 && $uid == 0)){
+ echo '</div>';
- if ($this->tip == 0)
- $sql1 = sisplet_query("SELECT * FROM srv_spremenljivka WHERE folder = '$row[id]' AND gru_id='-1' ORDER BY naslov ASC");
- else
- $sql1 = sisplet_query("SELECT * FROM srv_anketa a, srv_library_anketa l WHERE a.id=l.ank_id AND l.folder='$row[id]' AND l.uid='$uid' ORDER BY naslov ASC");
- if (!$sql1) echo mysqli_error($GLOBALS['connect_db']);
- if (mysqli_num_rows($sql1) > 0) {
+ // Vsebina folderja
+ echo ' <ul id="folder_'.$row['id'].'"'.($hidden?' style="display:none"':'').'>'."\n";
+ $this->display_contentfolders($row['id'], $uid);
- while ($row1 = mysqli_fetch_array($sql1)) {
+ // Izpis anket v folderju
+ $sql1 = sisplet_query("SELECT * FROM srv_anketa a, srv_library_anketa l WHERE a.id=l.ank_id AND l.folder='$row[id]' AND l.uid='$uid' ORDER BY naslov ASC");
+ if (!$sql1) echo mysqli_error($GLOBALS['connect_db']);
- echo '<li class="anketa tip'.$this->tip.'">';
- echo ' <div copy="'.$row1['id'].'" eid="'.$row1['id'].'" class="folder_container '.($this->tip==0?'new_spr':'').'" name="library">';
+ if (mysqli_num_rows($sql1) > 0) {
- echo ' <div class="folder_right">';
+ while ($row1 = mysqli_fetch_array($sql1)) {
- if ($this->tip == 0) {
- //echo '<a href="/" onclick="javascript:copy_spremenljivka(\''.$row1['id'].'\'); return false;"><img src="img_'.$this->skin.'/copy.png" title="'.$lang['srv_copy_spr'].'" /></a>';
- if ($admin_type==0 or $uid==$global_user_id)
- echo ' <a href="/" onclick="library_brisi_spremenljivko(\''.$row1['id'].'\', \''.$lang['srv_brisispremenljivkoconfirm'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_brisispremenljivko'].'"></span></a>';
- }
- else {
- SurveyInfo::getInstance()->SurveyInit($row1['id']);
-
- if ($this->prva == "1") {
-
- // Dodaj anketo v javno knjiznico
- if ($admin_type == 0 && $this->tab == 3) {
-
- $sqlPublic = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='".$row1['id']."' AND uid='0'");
- if (!$sqlPublic) echo mysqli_error($GLOBALS['connect_db']);
-
- // Anketa ze obstaja v javni knjiznici - jo pobrisemo
- if (mysqli_num_rows($sqlPublic) > 0) {
- echo ' <a href="/" onclick="surveyList_knjiznica_new(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_ank_lib_off'].'">';
- echo ' <span class="sprites faicon remove icon-orange small"></span> <span class="library_item_setting_text">'.$lang['srv_ank_lib_off'].'</span>';
- echo ' </a>';
- }
- // Anketo dodamo v javno knjiznico
- else{
- echo ' <a href="/" onclick="surveyList_knjiznica_new(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_ank_lib_on'].'">';
- echo ' <span class="sprites faicon library"></span> <span class="library_item_setting_text">'.$lang['srv_ank_lib_on'].'</span>';
- echo ' </a>';
- }
- }
-
- // nova anketa kot template iz knjiznice
- echo '<a href="/" onclick="anketa_copy(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_library_use_survey'].'"><span class="faicon copy"></span> <span class="library_item_setting_text">'.$lang['srv_anketacopy'].'</span></a> ';
- echo '<a href="'.$site_url.'main/survey/'.(!SurveyInfo::getInstance()->checkSurveyModule('uporabnost') ? 'index' : 'uporabnost').'.php?anketa='.$row1['id'].'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].'"><span class="faicon preview"></span> <span class="library_item_setting_text">'.$lang['srv_poglejanketo2'].'</span></a> ';
-
- // brisi iz knjiznice
- if ($admin_type == 0) {
- echo ' <a href="index.php?anketa='.$row1['id'].'" title="'.$lang['srv_editirajanketo'].'"><span class="faicon edit"></span> <span class="library_item_setting_text">'.$lang['edit3'].'</span></a>';
- }
-
- if ($admin_type==0 && $this->tab==2) {// sistemska
- echo ' <a href="/" onclick="library_del_anketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_4'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" title="'.$lang['srv_ank_lib_off'].'"><span class="sprites faicon remove icon-orange small"></span> <span class="library_item_setting_text">'.$lang['hour_remove'].'</span></a>';
- }
-
- if($this->tab==3){// moja knjiznica
- echo ' <a href="/" onclick="library_del_myanketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_3'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" title="'.$lang['srv_ank_mylib_off'].'"><span class="faicon remove icon-orange small"></span> <span class="library_item_setting_text">'.$lang['hour_remove'].'</span></a>';
- }
- }
- else {
- echo '<a href="'.$site_url.'main/survey/'.(!SurveyInfo::getInstance()->checkSurveyModule('uporabnost') ? 'index' : 'uporabnost').'.php?anketa='.$row1['id'].'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].'"><span class="faicon preview"></span></a>';
- // moznost da povozi anketo z anketo iz knjiznice
- //TEGA NE DOVOLIMO KER NI OK DA SE KAR PREPISE OBSTOJECO ANKETO - anketo iz knjiznice se lahko po novem dodaja samo iz mojih anket oz. pri ustvarjanju
- echo ' <a href="/" onclick="alert_copy_anketa(\''.$row1['id'].'\'); return false;"><span class="sprites copy_small" title="'.$lang['srv_copy_srv'].'"></span></a>';
- }
- }
- echo '</div>';
+ echo '<li eid="'.$row1['id'].'" class="anketa tip1 '.($admin_type==0 || $uid>0 ? 'can_drag' : '').'" name="library">';
- echo ' <div class="folder_left'.($this->tip==1?' indent"':'" onclick="library_spremenljivka_new(\''.$row1['id'].'\'); return false;"').'>';
- if ($this->tip == 1 && $this->prva == "0") {
- echo '<a href="/" onclick="javascript:library_anketa_plusminus(\''.$row1['id'].'\', this); return false;"><span class="faicon icon-blue plus" style="opacity: 0.3"></span></a> ';
- } else {
- if ($this->tip != 0)
- echo ' <span class="sprites spacer12"></span>';
- }
+ // Okvircek ankete
+ echo ' <div copy="'.$row1['id'].'" eid="'.$row1['id'].'" class="folder_container">';
- if ($this->tip == 0) {
- if ($row1['tip']==1 || $row1['tip']==2 || $row1['tip']==3 || $row1['tip']==21 || $row1['tip']==7)
- $ikonca = 'osnovna_vprasanja';
- elseif ($row1['tip']==6 || $row1['tip']==16 || $row1['tip']==19 || $row1['tip']==20)
- $ikonca = 'table';
- else
- $ikonca = 'other_vprasanja';
- } else {
- $ikonca = 'anketa';
- }
+ // Levo ime
+ echo '<div class="folder_left">';
- echo '<span class="faicon '.$ikonca.' mapca icon-blue" style="display:inline-block"></span> ';
- echo skrajsaj(strip_tags($row1['naslov']), 40).'</a>'."\n";
+ echo '<span class="faicon clipboard"></span> ';
+ echo skrajsaj(strip_tags($row1['naslov']), 40);
- echo ' </div>';
+ echo '</div>';
- if ($this->prva == "0") {
+ // Desne nastavitve
+ echo '<div class="folder_right">';
- echo '<div id="anketa_vprasanja_'.$row1['id'].'" class="anketa_vprasanja">';
- if ($this->tip == 1) {
- $sql2 = sisplet_query("SELECT s.id, s.naslov, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$row1[id]'");
- while ($row2 = mysqli_fetch_array($sql2)) {
+ // Tri pikice
+ echo '<span class="faicon dots" onClick="library_show_more(\''.$row1['id'].'\');"></span>';
- if ($row2['tip']==1 || $row2['tip']==2 || $row2['tip']==3 || $row2['tip']==21 || $row2['tip']==7)
- $ikonca = 'osnovna_vprasanja';
- elseif ($row2['tip']==6 || $row2['tip']==16 || $row2['tip']==19 || $row2['tip']==20)
- $ikonca = 'table';
- else
- $ikonca = 'other_vprasanja';
+ // Div ki se prikaze po kliku na 3 pikice
+ echo '<div class="library_more_box_holder">';
+ echo '<div id="library_more_box_'.$row1['id'].'" class="library_more_box displayNone">';
- echo '<span class="new_spr" copy="'.$row2['id'].'" onclick="library_spremenljivka_new(\''.$row2['id'].'\'); return false;"><span class="faicon '.$ikonca.' icon-blue" title="'.$lang['srv_copy_spr'].'" style="display:inline-block"></span>';
- echo ' '.skrajsaj(strip_tags($row2['naslov']), 40).'</span>';
+ SurveyInfo::getInstance()->SurveyInit($row1['id']);
+
+ // Dodaj anketo v javno knjiznico
+ if ($admin_type == 0 && $this->tab == 3) {
- }
- }
+ $sqlPublic = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='".$row1['id']."' AND uid='0'");
+ if (!$sqlPublic) echo mysqli_error($GLOBALS['connect_db']);
+ // Anketa ze obstaja v javni knjiznici - jo pobrisemo
+ if (mysqli_num_rows($sqlPublic) > 0) {
+ echo '<div class="line" onclick="surveyList_knjiznica_new(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_ank_lib_off'].'">';
+ echo ' <span class="faicon anketa_delete"></span>'.$lang['srv_ank_lib_off'];
echo '</div>';
}
+ // Anketo dodamo v javno knjiznico
+ else{
+ echo '<div class="line" onclick="surveyList_knjiznica_new(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_ank_lib_on'].'">';
+ echo ' <span class="faicon library"></span>'.$lang['srv_ank_lib_on'];
+ echo '</div>';
+ }
+ }
+
+ // Predogled
+ if(SurveyInfo::getInstance()->checkSurveyModule('uporabnost')){
+ echo '<a href="'.$site_url.'main/survey/uporabnost.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&preview=on" target="_blank" class="noline" title="'.$lang['srv_poglejanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon monitor"></span>'.$lang['srv_poglejanketo2'];
+ echo ' </div>';
+ echo '</a>';
+ }
+ else{
+ echo '<a href="'.$site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&preview=on" target="_blank" class="noline" title="'.$lang['srv_poglejanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon monitor"></span>'.$lang['srv_poglejanketo2'];
+ echo ' </div>';
+ echo '</a>';
+ }
+
+ // nova anketa kot template iz knjiznice
+ echo '<div class="line" onclick="anketa_copy(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_library_use_survey'].'">';
+ echo ' <span class="faicon copy"></span>'.$lang['srv_copy'];
+ echo '</div>';
+
+ // Uredi anketo
+ if ($admin_type == 0 || $this->tab==3) {
+ echo '<a href="index.php?anketa='.$row1['id'].'" class="noline" title="'.$lang['srv_editirajanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon edit"></span>'.$lang['edit3'];
+ echo ' </div>';
+ echo '</a>';
+ }
+
+ // sistemska
+ if ($admin_type==0 && $this->tab==2) {
+ echo '<div class="line" onclick="library_del_anketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_4'].'\',\''.$this->tab.'\'); return false;" title="'.$lang['srv_ank_lib_off'].'">';
+ echo ' <span class="sprites faicon anketa_delete"></span>'.$lang['hour_remove'];
+ echo '</div>';
+ }
+
+ // moja knjiznica
+ if($this->tab==3){
+ echo '<div class="line" onclick="library_del_myanketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_3'].'\',\''.$this->tab.'\'); return false;" title="'.$lang['srv_ank_mylib_off'].'">';
+ echo ' <span class="faicon anketa_delete"></span>'.$lang['hour_remove'];
+ echo '</div>';
+ }
- echo '</div></li>';
- }
+ echo '</div>';
+ echo '</div>';
+
- }
- }
+ echo ' </div>';
- echo ' </ul>'."\n";
+ echo '</li>';
+ }
+ }
+
+ echo ' </ul>'."\n";
echo ' </li>'."\n";
}
@@ -399,36 +316,6 @@ class Library {
<?php
}
}
-
- /**
- * @desc prikaze ife / bloke v knjiznici
- */
- function display_ifs ($folder) {
- global $lang, $admin_type;
-
- $sql = sisplet_query("SELECT * FROM srv_if WHERE folder = '$folder' ORDER BY label ASC, id ASC");
- while ($row = mysqli_fetch_array($sql)) {
-
- echo '<li class="anketa tip0">';
- echo ' <div eid="'.$row['id'].'" copy="'.$row['id'].'" class="folder_container new_if" name="library_if">';
-
- echo ' <div class="folder_right">';
- if ($admin_type==0 or $this->tab==1)
- echo ' <a href="/" onclick="library_if_remove(\''.$row['id'].'\', \''.$lang['srv_brisispremenljivkoconfirm'].'\'); return false;"><span class="faicon delete_circle icon-orange" title="'.($row['tip']==0?$lang['srv_if_rem']:$lang['srv_block_rem']).'"></span></a>';
- echo ' </div>';
-
- echo ' <div class="folder_left'.($this->tip==1?' indent':'').'" onclick="library_if_new(\''.$row['id'].'\'); return false;">';
-
- echo '<span class="faicon '.($row['tip']==0?'if':'b').' mapca icon-blue"></span> ';
-
- echo skrajsaj(strip_tags(($row['label']!=''?$row['label']:($row['tip']==0?$lang['srv_pogoj']:$lang['srv_blok']))), 40).'</a>'."\n";
-
- echo ' </div>';
-
- echo '</div></li>';
- }
-
- }
/**
@@ -450,12 +337,10 @@ class Library {
if ($uid == 0)
$language = " AND lang='$lang[id]' ";
- // v skrite html elemente shranimo tab, in prva
+ // v skrite html elemente shranimo tab
echo '<input type="hidden" name="lib_tab" id="lib_tab" value="'.$this->tab.'">';
- echo '<input type="hidden" name="lib_tip" id="lib_tip" value="1">';
- echo '<input type="hidden" name="lib_prva" id="lib_prva" value="1">';
- echo '<ul title="'.($uid == 0 ? $lang['srv_library_left'] : $lang['srv_library_left_right']).'" style="padding-left:0; margin-left:-12px; margin-top:10px;" class="'.($admin_type == 0 || $uid == $global_user_id ? 'can_edit' : '').'">'."\n";
+ echo '<ul title="'.($uid == 0 ? $lang['srv_library_left'] : $lang['srv_library_left_right']).'" class="'.($admin_type == 0 || $uid == $global_user_id ? 'can_edit' : '').'">'."\n";
// Sestavimo query za search po knjiznici
@@ -474,39 +359,13 @@ class Library {
while ($row1 = mysqli_fetch_array($sql1)) {
echo '<li class="anketa tip1">';
- echo ' <div copy="'.$row1['id'].'" eid="'.$row1['id'].'" class="folder_container" name="library">';
+ echo ' <div copy="'.$row1['id'].'" eid="'.$row1['id'].'" class="folder_container" name="library">';
- echo ' <div class="folder_right">';
-
- SurveyInfo::getInstance()->SurveyInit($row1['id']);
-
- // nova anketa kot template iz knjiznice
- echo '<a href="/" onclick="anketa_copy(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_library_use_survey'].'"><span class="faicon copy"></span> '.$lang['srv_anketacopy'].'</a> ';
-
- // Preview
- echo '<a href="'.$site_url.'main/survey/'.(!SurveyInfo::getInstance()->checkSurveyModule('uporabnost') ? 'index' : 'uporabnost').'.php?anketa='.$row1['id'].'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].'"><span class="faicon preview"></span> '.$lang['srv_poglejanketo2'].'</a> ';
-
- // Urejanje - admin
- if ($admin_type == 0)
- echo ' <a href="index.php?anketa='.$row1['id'].'" title="'.$lang['srv_editirajanketo'].'"><span class="faicon edit"></span> '.$lang['edit3'].'</a>';
-
- // Brisanje - admin iz javne knjiznice
- if ($admin_type == 0 && $this->tab == 2)
- echo ' <a href="/" onclick="library_del_anketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_4'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" title="'.$lang['srv_ank_lib_off'].'"><span class="faicon remove icon-orange small"></span> '.$lang['hour_remove'].'</a>';
-
- // Brisanje - uporabnik iz moje knjiznice
- if($this->tab == 3)
- echo ' <a href="/" onclick="library_del_myanketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_3'].'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" title="'.$lang['srv_ank_mylib_off'].'"><span class="faicon remove icon-orange small"></span> '.$lang['hour_remove'].'</a>';
-
- echo '</div>';
-
-
- echo ' <div class="folder_left'.($this->tip==1?' indent"':'" onclick="library_spremenljivka_new(\''.$row1['id'].'\'); return false;"').'>';
- echo ' <span class="sprites spacer12"></span>';
- $ikonca = 'anketa';
+ // Leva stran - ime
+ echo '<div class="folder_left">';
- echo '<span class="faicon '.$ikonca.' mapca icon-blue" style="display:inline-block"></span> ';
+ echo '<span class="faicon clipboard"></span>';
// Ce gre za search moramo ustrezno pobarvati najden del besede
$text_searched = $row1['naslov'];
@@ -516,17 +375,83 @@ class Library {
// Pobarvamo najden niz v naslovu ankete
preg_match_all("/$search_word+/i", $text_searched, $matches);
if (is_array($matches[0]) && count($matches[0]) >= 1) {
- foreach ($matches[0] as $match) {
- $text_searched = str_replace($match, '<span class="red">'.$match.'</span>', $text_searched);
- }
+
+ // Drugace vcasih pobrise presledek, ne vem kako drugace resit:)
+ $text_searched = str_replace(' ', '&nbsp;', $text_searched);
+
+ $text_searched = str_replace($matches[0][0], '<span class="red">'.$matches[0][0].'</span>', $text_searched);
}
}
}
- echo skrajsaj($text_searched, 40).'</a>'."\n";
+ echo skrajsaj($text_searched, 100);
+
+ echo '</div>';
- echo ' </div>';
- echo '</div></li>';
+
+ // Desne nastavitve
+ echo '<div class="folder_right">';
+
+ // Tri pikice
+ echo '<span class="faicon dots" onClick="library_show_more(\''.$row1['id'].'\');"></span>';
+
+ // Div ki se prikaze po kliku na 3 pikice
+ echo '<div class="library_more_box_holder">';
+ echo '<div id="library_more_box_'.$row1['id'].'" class="library_more_box displayNone">';
+
+ SurveyInfo::getInstance()->SurveyInit($row1['id']);
+
+ // Preview
+ if(SurveyInfo::getInstance()->checkSurveyModule('uporabnost')){
+ echo '<a href="'.$site_url.'main/survey/uporabnost.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&preview=on" class="noline" target="_blank" title="'.$lang['srv_poglejanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon monitor"></span>'.$lang['srv_poglejanketo2'];
+ echo ' </div>';
+ echo '</a>';
+ }
+ else{
+ echo '<a href="'.$site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&preview=on" class="noline" target="_blank" title="'.$lang['srv_poglejanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon monitor"></span>'.$lang['srv_poglejanketo2'];
+ echo ' </div>';
+ echo '</a>';
+ }
+
+ // nova anketa kot template iz knjiznice
+ echo '<div class="line" onclick="anketa_copy(\''.$row1['id'].'\'); return false;" title="'.$lang['srv_library_use_survey'].'">';
+ echo ' <span class="faicon copy"></span>'.$lang['srv_copy'];
+ echo '</div>';
+
+ // Urejanje - v moji knjiznici vsi, v javni samo admin
+ if ($admin_type == 0 || $this->tab == 3){
+ echo ' <a href="index.php?anketa='.$row1['id'].'" class="noline" title="'.$lang['srv_editirajanketo'].'">';
+ echo ' <div class="line">';
+ echo ' <span class="faicon edit"></span>'.$lang['edit3'];
+ echo ' </div>';
+ echo '</a>';
+ }
+
+ // Brisanje - admin iz javne knjiznice
+ if ($admin_type == 0 && $this->tab == 2){
+ echo '<div class="line" onclick="library_del_anketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_4'].'\',\''.$this->tab.'\'); return false;" title="'.$lang['srv_ank_lib_off'].'">';
+ echo ' <span class="faicon anketa_delete"></span>'.$lang['hour_remove'];
+ echo '</div>';
+ }
+
+ // Brisanje - uporabnik iz moje knjiznice
+ if($this->tab == 3){
+ echo '<div class="line" onclick="library_del_myanketa(\''.$row1['id'].'\', \''.$lang['srv_anketadeletelibrary_3'].'\',\''.$this->tab.'\'); return false;" title="'.$lang['srv_ank_mylib_off'].'">';
+ echo ' <span class="faicon anketa_delete"></span>'.$lang['hour_remove'];
+ echo '</div>';
+ }
+
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo ' </div>';
+ echo '</li>';
}
}
@@ -554,68 +479,51 @@ class Library {
global $lang;
global $site_url;
- echo '<span class="title">'.$lang['s_search_settings_lib'].'</span>';
-
echo '<form method="GET" id="1kasf2" action="'.$site_url.'admin/survey/index.php?a=knjiznica">';
- // Hidden polja za knjiznico
+ // Hidden polja za knjiznico
echo '<input type="hidden" name="a" value="knjiznica">';
if($this->tab == '3')
echo '<input type="hidden" name="t" value="moje_ankete">';
+ // Zgornja vrstica z geslom in gumbom za iskanje
+ echo '<div class="search_settings_top">';
+
// Iskano geslo
- echo '<p>';
- echo ' <span class="bold">'.$lang['s_search2'].':</span> <input type="text" name="search" id="searchMySurveyText" value="'.htmlentities($this->searchString).'" placeholder="' . $lang['s_search'] . '" />';
- echo '</p>';
+ echo '<div class="search_text">';
+ echo ' <input type="text" name="search" id="searchMySurveyText" value="'.htmlentities($this->searchString).'" placeholder="'.($this->tab == '3' ? $lang['s_search_Library_my'] : $lang['s_search_Library_public']).'" />';
+ echo '</div>';
// Iskanje po naslovu ali avtorju ali besedilu
- echo '<p>';
- echo ' <span>'.$lang['s_thru'].': </span>';
- echo ' <label for="stype_0"><input type="radio" name="stype" id="stype_0" value="0" '.($this->searchSettings['stype'] == '0' ? ' checked="checked"' : '').' />'.$lang['s_title'].'</label>';
- echo ' <label for="stype_1"><input type="radio" name="stype" id="stype_1" value="1" '.($this->searchSettings['stype'] == '1' ? ' checked="checked"' : '').' />'.$lang['s_text'].'</label>';
- echo '</p>';
-
- // Gumba isci in zapri
- echo '<span style="margin-top: 10px;" class="floatRight spaceRight">';
- echo ' <div class="buttonwrapper floatLeft spaceRight">';
- echo ' <a class="ovalbutton ovalbutton_gray" href="'.$site_url.'admin/survey/index.php?a=knjiznica'.($this->tab == '3' ? '&t=moje_ankete' : '').'"><span>'.$lang['srv_zapri'].'</span></a>';
- echo ' </div>';
- echo ' <div class="buttonwrapper floatRight">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#1kasf2\').submit(); return false;"><span>'.$lang['s_search'].'</span></a>';
- echo ' </div>';
- echo '</span>';
-
- // Link na isci po mojih anketah
- echo '<span class="link"><a href="'.$site_url.'admin/survey/index.php?search='.$this->searchString.'">'.$lang['s_search_mySurvey'].'</a></span>';
+ echo '<div class="search_type">';
+ echo ' <select name="stype" id="stype">';
+ echo ' <option value="0" '.($this->searchSettings['stype'] == '0' ? ' selected="selected"' : '').'>'.$lang['s_title'].'</option>';
+ echo ' <option value="1" '.($this->searchSettings['stype'] == '1' ? ' selected="selected"' : '').'>'.$lang['s_text'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ // Gumb isci
+ echo '<div class="search_button">';
+ echo ' <a href="#" onclick="$(\'#1kasf2\').submit(); return false;"><button class="medium blue">'.$lang['s_search'].'</button></a>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<input style="display: none;" value="Išči" type="submit">';
+ // Gumba za napredne nastavitve
+ echo '<div class="search_settings_advanced_buttons">';
+
+ // Gumb nazaj na moje ankete
+ echo ' <a href="'.$site_url.'admin/survey/index.php?a=pregledovanje&search='.htmlentities($this->searchString).'"><button type="button" class="white-black small">';
+ echo ' <span class="faicon clipboard_notes"></span>'.$lang['s_search_mySurvey'];
+ echo ' </button></a>';
+
+ echo '</div>';
+
+ echo '<input style="display: none;" value="Išči" type="submit">';
echo '</form>';
}
-
- // Prikazemo search okno za iskanje po anketah znotraj knjiznice
- private function displaySearch(){
- global $lang;
- global $site_url;
- echo '<form method="GET" id="1kasmysurvey" action="'.$site_url.'admin/survey/index.php">';
-
- // Hidden polja za knjiznico
- echo '<input type="hidden" name="a" value="knjiznica">';
- if($this->tab == '3')
- echo '<input type="hidden" name="t" value="moje_ankete">';
-
- //echo '<span class="sprites search"></span> ';
- echo '<input id="searchMySurvey" class="floatLeft" type="text" value="" placeholder="' . $lang['s_search_Library'] . '" name="search" />';
-
- //echo '<input type="submit" value="' . $lang['s_search'] . '" />';
- echo ' <div class="buttonwrapper floatLeft">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#1kasmysurvey\').submit(); return false;"><span>'.$lang['s_search2'].'</span></a>';
- echo ' </div>';
-
- echo '</form>';
- }
-
// vrne sql string za search po anketah glede na nastavitve searcha
private function getSearchString(){
@@ -666,17 +574,6 @@ class Library {
$this->tab = (int)$_GET['tab'];
if ($this->tab == 'undefined')
$this->tab = 0;
- if (isset($_POST['prva']))
- $this->prva = $_POST['prva'];
- else if (isset($_GET['prva']))
- $this->prva = $_GET['prva'];
- if ($this->prva == 'undefined')
- $this->prva = 0;
-
- if ($this->tab <= 1)
- $this->tip = 0;
- else
- $this->tip = 1;
if ($_GET['a'] == 'display_knjiznica') {
$this->ajax_display_knjiznica();
@@ -746,36 +643,11 @@ class Library {
$data = array();
- if ($this->tip == 0) {
- $spremenljivka = substr($_POST['spremenljivka'], 10); // odrezemo branching_
- $folder = $_POST['folder'];
-
- // v knjiznico dodamo spremenljivko
- if ($spremenljivka > 0) {
- $id = $this->Branching->nova_spremenljivka(-1, 0, 0, $spremenljivka);
- sisplet_query("UPDATE srv_spremenljivka SET folder = '$folder' WHERE id = '$id'");
-
- $data['response'] = $lang['srv_library_q_added'];
-
- // v knjiznico dodamo if/blok
- } else {
- $if = substr($_POST['spremenljivka'], 12); // odrezemo branching_if
-
- if ($if > 0) {
- $id = $this->Branching->if_copy(0, $if, true);
- sisplet_query("UPDATE srv_if SET folder = '$folder' WHERE id = '$id'");
-
- $data['response'] = $lang['srv_library_b_added'];
- }
- }
- }
-
ob_start();
$this->display_folders();
$data['folders'] = ob_get_clean();
echo json_encode($data);
-
}
@@ -790,12 +662,8 @@ class Library {
elseif ($this->tab == 1 or $this->tab == 3)
$uid = $global_user_id;
- if ($this->tip == 0) {
- sisplet_query("UPDATE srv_spremenljivka SET folder = '$folder' WHERE id = '$spremenljivka'");
- } else {
- sisplet_query("UPDATE srv_library_anketa SET folder = '$folder' WHERE ank_id = '$spremenljivka' AND uid='$uid'");
- }
- //$this->display();
+ sisplet_query("UPDATE srv_library_anketa SET folder='$folder' WHERE ank_id='$spremenljivka' AND uid='$uid'");
+
$this->display_folders();
}
@@ -817,9 +685,8 @@ class Library {
$folder = $_POST['folder'];
if ($drop != $folder)
- sisplet_query("UPDATE srv_library_folder SET parent = '$folder' WHERE id = '$drop' AND tip='$this->tip'");
+ sisplet_query("UPDATE srv_library_folder SET parent = '$folder' WHERE id = '$drop' AND tip='1'");
- //$this->display();
$this->display_folders();
}
@@ -830,9 +697,9 @@ class Library {
$sql = sisplet_query("SELECT naslov FROM srv_library_folder WHERE id = '$folder'");
$row = mysqli_fetch_array($sql);
- echo '<form method="post" onsubmit="javascript:library_folder_newname(\''.$folder.'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" style="display:inline">';
+ echo '<form method="post" onsubmit="javascript:library_folder_newname(\''.$folder.'\',\''.$this->tab.'\'); return false;" style="display:inline">';
echo '<span class="faicon folder icon-blue"></span> '.
- '<input type="text" name="naslov" id="naslov_'.$folder.'" value="'.$row['naslov'].'" onblur="javascript:library_folder_newname(\''.$folder.'\',\''.$this->tab.'\',\''.$this->prva.'\'); return false;" />';
+ '<input type="text" name="naslov" id="naslov_'.$folder.'" value="'.$row['naslov'].'" onblur="javascript:library_folder_newname(\''.$folder.'\',\''.$this->tab.'\'); return false;" />';
echo '</form>';
}
@@ -859,16 +726,19 @@ class Library {
$uid = $_POST['uid'];
- $s = sisplet_query("INSERT INTO srv_library_folder (uid, tip, naslov, parent) VALUES ('$uid', '$this->tip', '$lang[srv_newfolder]', '$folder')");
+ $s = sisplet_query("INSERT INTO srv_library_folder (uid, tip, naslov, parent) VALUES ('$uid', '1', '$lang[srv_newfolder]', '$folder')");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
$insert_id = mysqli_insert_id($GLOBALS['connect_db']);
- $_COOKIE['library_folders'] .= '-'.$insert_id.'-'; // $_COOKIE popravimo, da bo sprememba vidna tudi v display_folders()
+ // $_COOKIE popravimo, da bo sprememba vidna tudi v display_folders()
+ if(isset($_COOKIE['library_folders']))
+ $_COOKIE['library_folders'] .= '-'.$insert_id.'-';
+ else
+ $_COOKIE['library_folders'] = '-'.$insert_id.'-';
+
setcookie('library_folders', $_COOKIE['library_folders'], time()+2500000);
- // $this->display();
$this->display_folders();
-
}
function ajax_delete_folder () {
@@ -879,12 +749,7 @@ class Library {
$sql = sisplet_query("SELECT parent FROM srv_library_folder WHERE id = '$folder'");
$row = mysqli_fetch_array($sql);
- if ($this->tip == 0) {
- sisplet_query("UPDATE srv_spremenljivka SET folder = '$row[parent]' WHERE folder = '$folder'");
- sisplet_query("UPDATE srv_if SET folder = '$row[parent]' WHERE folder = '$folder'");
- } else {
- sisplet_query("UPDATE srv_library_anketa SET folder = '$row[parent]' WHERE folder = '$folder'");
- }
+ sisplet_query("UPDATE srv_library_anketa SET folder = '$row[parent]' WHERE folder = '$folder'");
sisplet_query("UPDATE srv_library_folder SET parent = '$row[parent]' WHERE parent = '$folder'");
@@ -902,13 +767,12 @@ class Library {
if ($collapsed == 0) {
$cookie .= '-'.$folder.'-';
- } else {
+ }
+ else {
$cookie = str_replace('-'.$folder.'-', '', $cookie);
}
setcookie('library_folders', $cookie, time()+2500000);
-
- echo '<span class="faicon icon-blue '.($collapsed==1?'plus':'minus').'"></span>';
}
function ajax_library_del_anketa () {
@@ -948,17 +812,17 @@ class Library {
global $global_user_id;
global $lang;
global $site_url;
+
$anketa = $_POST['anketa']; // nasa anketa (jo povozimo)
$ank_id = $_POST['ank_id']; // anketa, ki jo uporabimo za predlogo
$hierarhija = (empty($_POST['hierarhija']) ? false : true);
if($hierarhija && $ank_id == 'privzeta'){
- global $hierarhija_default_id;
-
- $ank_id = $hierarhija_default_id;
+ $ank_id = AppSettings::getInstance()->getSetting('hierarhija-default_id');
}
+
if ($anketa > 0) {
// preberemo osnovne podatke obstojece ankete (naslov.....)
@@ -968,11 +832,11 @@ class Library {
$sql2 = sisplet_query("SELECT naslov FROM srv_anketa WHERE id = '$ank_id'");
$row2 = mysqli_fetch_array($sql2);
- $sqls = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id='$anketa'");
+ $sqls = sisplet_query("SELECT ank_id, uid FROM srv_dostop WHERE ank_id='$anketa'");
$this->SurveyAdmin->anketa_delete($anketa);
-
- } else {
+ }
+ else {
$sql = sisplet_query("SELECT naslov, dostop FROM srv_anketa WHERE id = '$ank_id'");
$row = mysqli_fetch_array($sql);
@@ -983,14 +847,13 @@ class Library {
$naslov = " naslov='".(isset($_POST['naslov']) ? $_POST['naslov'] : $row['naslov'])."',";
$intro_opomba = " intro_opomba='".(addslashes($lang['srv_library_copy_of_note'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$ank_id.'">'.$row2['naslov'].'</a>'))."',";
-
- //$new_id = $this->SurveyAdmin->anketa_copy($ank_id);
$sas = new SurveyAdminSettings();
$new_id = $sas->anketa_copy($ank_id);
// popravimo naslov, opombo, dostop, in novega avtorja
sisplet_query("UPDATE srv_anketa SET $naslov $intro_opomba dostop='$row[dostop]', insert_uid='$global_user_id', edit_uid='$global_user_id' WHERE id='$new_id'");
- // vsilimo refresh podatkov
+
+ // vsilimo refresh podatkov
SurveyInfo :: getInstance()->resetSurveyData();
// dostop uporabimo od stare ankete in ne od skopirane (trnutno ne kopira pravic od prej, če ustvarjamo novo anketo)
@@ -1011,7 +874,8 @@ class Library {
(new \Hierarhija\Hierarhija($new_id))->izrisisSistemskoVprsanjeVloga();
echo $new_id;
- }else{
+ }
+ else{
echo 'index.php?anketa='.$new_id.'&a=branching';
}
}
@@ -1030,10 +894,10 @@ class Library {
// Če imamo hierarhijo in je privzeta anketa potem preverimo v settings_optional.php
if(!empty($_POST['hierarhija']) && $ank_id == 'privzeta'){
- global $hierarhija_default_id;
- $ank_id=$hierarhija_default_id;
+ $ank_id = AppSettings::getInstance()->getSetting('hierarhija-default_id');
}
- }else {
+ }
+ else {
$API_call = true;
}
@@ -1213,16 +1077,12 @@ class Library {
}
function repareTabs() {
- if ($this->tab >= 2)
- $this->tip = 1;
- else
- $this->tip = 0;
// popravimo tabe če smo v glasovanju ali formi
if ($this->mode < 2) {
- // uredimo tabe
+
+ // uredimo tabe
if ($this->tab==0 || $this->tab==1) {
- $this->tip = 1;
$this->tab=2;
}
}
diff --git a/admin/survey/classes/class.LibraryBranching.php b/admin/survey/classes/class.LibraryBranching.php
new file mode 100644
index 0000000..dd65602
--- /dev/null
+++ b/admin/survey/classes/class.LibraryBranching.php
@@ -0,0 +1,1193 @@
+<?php
+
+class LibraryBranching {
+
+
+ var $ank_id; // Anketa znotraj katere urejamo knjiznico
+
+ var $tab = 0; // tip pove v bazi srv_library_folder za kater tip gre - 0->vprasanja, 1->ankete (vprasanja iz anket)
+ var $folder_id = 0; // Trenutno aktiven folder
+ var $expanded_folders = array(); // Razprti folderji
+
+ var $root_folder = array(); // Root folderji (sistemski in uporabnikov)
+ var $folder_structure = array(); // Struktura direktorijev uporabnika
+
+
+ public function __construct ($ank_id=0) {
+
+ if($ank_id == 0)
+ die();
+
+ $this->ank_id = $ank_id;
+
+ // Nastavimo vse razprte folderje (vsi parenti ce je child aktiven)
+ $this->setExpandedFolders($this->folder_id);
+ }
+
+ // Loop cez folderje in rekurzivno nastavi razprte (parenti aktivnega)
+ private function setExpandedFolders($folder_id){
+
+ $this->expanded_folders[] = $folder_id;
+
+ if($folder_id == '0'){
+ return;
+ }
+
+ $sqlFolders = sisplet_query("SELECT parent FROM srv_library_folder WHERE id='".$folder_id."' AND tip='".$this->tab."'");
+ $rowFolders = mysqli_fetch_array($sqlFolders);
+
+ $this->setExpandedFolders($rowFolders['parent']);
+ }
+
+
+ /**
+ * @desc prikaze knjiznico znotraj ankete
+ */
+ private function displayLibrary() {
+ global $admin_type;
+ global $global_user_id;
+ global $lang;
+
+
+ // Naslov v oknu
+ echo '<h2><span class="faicon library"></span>'.$lang['srv_library_survey_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="popupClose();">✕</a></div>';
+
+ // Tabi (vprasanja, ankete)
+ echo '<div id="lib_tabs" class="lib_tabs">';
+ $this->displayTabs();
+ echo '</div>';
+
+ // Vsebina
+ echo '<div id="tab_content" class="tab_content">';
+ $this->displayTabContent();
+ echo '</div>';
+ }
+
+ // Prikazemo tabe - vprasanja / ankete
+ private function displayTabs(){
+ global $lang;
+
+ // Tab vprasanja
+ echo '<div id="tab_0" class="tab '.($this->tab == 0 ? 'active' : '').'" onClick="displayLibraryTab(\'0\'); return false;">';
+ echo $lang['srv_library_survey_tab_questions'];
+ echo '</div>';
+
+ // Tab ankete
+ echo '<div id="tab_1" class="tab '.($this->tab == 1 ? 'active' : '').'" onClick="displayLibraryTab(\'1\'); return false;">';
+ echo $lang['srv_library_survey_tab_surveys'];
+ echo '</div>';
+
+ echo '<input type="hidden" name="active_tab" id="active_tab" value="'.$this->tab.'">';
+ }
+
+ // Priazemo glavno vsebino glede na aktiven tab
+ public function displayTabContent(){
+ global $lang;
+
+ // Levi seznam folderjev
+ echo '<div id="lib_folder_list" class="content_left">';
+ $this->displayFolderList();
+ echo '</div>';
+
+
+ // Desna vsebina
+ echo '<div class="content_right">';
+
+ // Seznam vprasanj
+ echo '<div id="lib_question_list" class="question_list">';
+ $this->displayQuestionList();
+ echo '</div>';
+
+ // Item counter
+ echo '<div class="selected_items">'.$lang['srv_library_item_counter'].': <span id="selected_item_counter">0</span></div>';
+
+ // Gumbi na dnu
+ echo '<div class="button_holder">';
+ $this->displayButtons();
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ // Prikazemo seznam folderjev na levi
+ private function displayFolderList(){
+ global $global_user_id;
+ global $lang;
+
+ // Prikazemo seznam mojih folderjev v knjiznci
+ echo '<ul class="folder_list user">';
+ $this->displayFolderParent($parent=0, $uid=$global_user_id);
+ echo '</ul>';
+
+ // Prikazemo seznam javnih folderjev v knjiznci
+ echo '<ul class="folder_list public">';
+ $this->displayFolderParent($parent=0, $uid=0);
+ echo '</ul>';
+
+ // Prikazemo se skrit div za dodaten popup (rename, add - title)
+ echo '<div id="lib_additional_popup" class="divPopUp"></div>';
+
+ // Klik izven "Vec" - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".folder_item_settings, .dots_ver");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".folder_item_settings").addClass("displayNone");
+ $(".dots_ver_folder").removeClass("active");
+ }
+
+ var container2 = $(".item_settings, .dots_ver");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".item_settings").addClass("displayNone");
+ $(".dots_ver_item").removeClass("active");
+ }
+ });
+
+ initHideLibraryArrows();
+ </script>';
+ }
+
+ private function displayFolderParent($parent, $uid) {
+ global $lang;
+ global $admin_type;
+ global $global_user_id;
+ global $site_url;
+
+
+ // Ce gre za root mapo prikazemo z ustreznim jezikom
+ if ($parent == 0 && $uid == 0) {
+ $language = " AND lang='".$lang['id']."' ";
+ }
+
+ // Dobimo vse folderje za parenta
+ $sqlFolders = sisplet_query("SELECT id, naslov
+ FROM srv_library_folder
+ WHERE uid='".$uid."' AND parent='".$parent."' AND tip='".$this->tab."' ".$language."
+ ORDER BY naslov
+ ");
+ if (!$sqlFolders)
+ echo mysqli_error($GLOBALS['connect_db']);
+
+
+ // Za prvic ko pride user, da mu dodamo folder
+ if (mysqli_num_rows($sqlFolders) == 0 && $uid > 0 && $parent == 0){
+
+ // Nastavimo naslov mape
+ $naslov = ($this->tab == 0) ? $lang['srv_moja_vprasanja'] : $lang['srv_moje_ankete'];
+
+ sisplet_query("INSERT INTO srv_library_folder
+ (uid, tip, naslov, parent, lang)
+ VALUES
+ ('".$uid."', '".$this->tab."', '".$naslov."', '0', '".$lang['id']."')
+ ");
+
+ $sqlFolders = sisplet_query("SELECT id, naslov
+ FROM srv_library_folder
+ WHERE uid='".$uid."' AND parent='".$parent."' AND tip='".$this->tab."'
+ ORDER BY naslov
+ ");
+ if (!$sqlFolders)
+ echo mysqli_error($GLOBALS['connect_db']);
+ }
+
+
+ // Loop po vseh mapah znotraj parenta
+ while ($rowFolders = mysqli_fetch_array($sqlFolders)) {
+
+ // Nastavimo default prvi aktiven folder
+ if($this->folder_id == 0 && $parent == 0 && $uid == 0){
+ $this->folder_id = $rowFolders['id'];
+ $this->setExpandedFolders($this->folder_id);
+ }
+
+ $this->displayFolderItem($rowFolders['id'], $rowFolders['naslov'], $uid);
+
+ $expanded = in_array($rowFolders['id'], $this->expanded_folders) ? true : false;
+
+ echo '<ul id="folder_list_'.$rowFolders['id'].'" class="folder_list" '.($expanded ? '' : 'style="display:none;"').'>';
+
+ // Rekurzivno izpisemo childe
+ $this->displayFolderParent($rowFolders['id'], $uid);
+
+ // Smo tabu ankete - izpisemo se ankete v tem folderju
+ if($this->tab == '1'){
+
+ $sqlSurvey = sisplet_query("SELECT a.id, a.naslov FROM srv_anketa a, srv_library_anketa l WHERE a.id=l.ank_id AND l.folder='".$rowFolders['id']."' AND l.uid='".$uid."' ORDER BY naslov ASC");
+ if (!$sqlSurvey) echo mysqli_error($GLOBALS['connect_db']);
+
+ if (mysqli_num_rows($sqlSurvey) > 0) {
+
+ while ($rowSurvey = mysqli_fetch_array($sqlSurvey)) {
+
+ $this->displayFolderItemSurvey($rowSurvey['id'], $rowSurvey['naslov'], $uid);
+ }
+ }
+ }
+
+ echo '</ul>';
+ }
+ }
+
+ // Levi item - folder
+ private function displayFolderItem($id, $title, $uid) {
+ global $lang;
+ global $admin_type;
+
+ $expanded = in_array($id, $this->expanded_folders) ? true : false;
+ $active = ($this->folder_id == $id) ? true : false;
+
+ echo '<li id="folder_item_'.$id.'" class="folder_item '.($active ? 'active' : '').' '.($expanded ? 'open' : '').' '.(($uid != 0 || $admin_type == 0) ? 'droppable_folder' : '').'" folder-id="'.$id.'" onClick="openLibraryFolder(\''.$id.'\');">';
+
+
+ // Ikoni puscice in mape
+ echo ' <span id="folder_arrow_'.$id.'" class="faicon arrow" onClick="expandLibraryFolder(\''.$id.'\');"></span>';
+ echo ' <span id="folder_folder_'.$id.'" class="faicon folder"></span>';
+
+ // Naslov folderja
+ echo ' <span class="folder_item_title">'.$title.'</span>';
+
+ // Stevilo itemov v folderju
+ //echo ' <span class="folder_item_child_count">'.$child_count.'</span>';
+
+
+ // Urejanje folderja
+ if($uid != 0 || $admin_type == 0){
+ // Tri pikice za prikaz urejanja folderja
+ echo ' <span class="faicon dots_ver dots_ver_folder" onClick="showLibraryFolderEdit(this);"></span>';
+
+ // Skrit div za urejanje folderja
+ echo ' <div class="folder_item_settings displayNone">';
+ echo ' <ul>';
+ echo ' <li onClick="displayAddFolderPopup(\''.$id.'\', \''.$uid.'\');">'.$lang['srv_library_folder_add'].'</li>';
+ echo ' <li onClick="displayRenameFolderPopup(\''.$id.'\', \''.$title.'\');">'.$lang['srv_library_folder_rename'].'</li>';
+ if($id != $this->root_folder['user'])
+ echo ' <li onClick="deleteLibraryFolder(\''.$id.'\');">'.$lang['srv_library_folder_delete'].'</li>';
+ echo ' </ul>';
+ echo ' </div>';
+ }
+
+
+ echo '</li>';
+ }
+
+ // Levi item - anketa
+ private function displayFolderItemSurvey($id, $title, $uid) {
+ global $lang;
+
+ // Javne ankete
+ $type = ($uid == '0') ? 'public' : 'my';
+
+ echo '<li id="'.$type.'_survey_item_'.$id.'" class="folder_item survey_item '.($this->folder_id == $id ? 'active' : '').'" onClick="openLibrarySurvey(\''.$id.'\', \''.$type.'\');">';
+
+
+ // Ikoni puscice in mape
+ echo ' <span class="faicon clipboard"></span>';
+
+ // Naslov folderja - ankete
+ echo ' <span class="folder_item_title">'.$title.'</span>';
+
+
+ echo '</li>';
+ }
+
+
+ // Dodaten popup za ime direktorija pri dodajanju
+ private function displayAddFolderPopup($folder_id, $uid){
+ global $lang;
+
+ echo '<h2>'.$lang['srv_library_folder_name'].'</h2>';
+
+ echo '<div>';
+ echo ' <input type="text" id="lib_folder_name" class="large">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="closeAdditionalPopup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="addLibraryFolder(\''.$folder_id.'\', \''.$uid.'\');">'.$lang['srv_library_folder_add'].'</button>';
+ echo '</div>';
+ }
+
+ // Dodaten popup za ime direktorija pri preimenovanju
+ private function displayRenameFolderPopup($folder_id, $folder_name){
+ global $lang;
+
+ echo '<h2>'.$lang['srv_library_folder_name'].'</h2>';
+
+ echo '<div>';
+ echo ' <input type="text" id="lib_folder_name" class="large" value="'.$folder_name.'">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="closeAdditionalPopup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="renameLibraryFolder(\''.$folder_id.'\');">'.$lang['srv_library_folder_rename'].'</button>';
+ echo '</div>';
+ }
+
+
+ // Prikazemo seznam vprasanj v folderju
+ private function displayQuestionList(){
+ global $global_user_id;
+ global $lang;
+
+ // Folder ni nastavljen
+ if($this->folder_id == 0)
+ return;
+
+
+ // Naslov trenutnega folderja
+ $sqlCurrentFolder = sisplet_query("SELECT naslov FROM srv_library_folder WHERE id='".$this->folder_id."'");
+ $rowCurrentFolder = mysqli_fetch_array($sqlCurrentFolder);
+ echo '<div class="folder_title"><span class="faicon folder"></span>'.$rowCurrentFolder['naslov'].'</div>';
+
+
+ // Seznam vprasanj iz anket v knjiznici
+ if($this->tab == 1){
+
+ // Najprej zlistamo vse child folderje
+ $sqlFolders = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE parent='".$this->folder_id."' AND tip='".$this->tab."' ORDER BY naslov");
+ if (mysqli_num_rows($sqlFolders) > 0){
+
+ // Loop po vseh mapah znotraj parenta
+ while ($rowFolders = mysqli_fetch_array($sqlFolders)) {
+ $this->displayRightFolderItem($rowFolders['id'], $rowFolders['naslov']);
+ }
+ }
+
+ echo '<div class="spacer"></div>';
+
+ $sqlFolderSurveys = sisplet_query("SELECT a.id, a.naslov FROM srv_anketa a, srv_library_anketa l WHERE a.id=l.ank_id AND l.folder='".$this->folder_id."' ORDER BY naslov ASC");
+ while ($rowFolderSurveys = mysqli_fetch_array($sqlFolderSurveys)) {
+
+ // Naslov ankete
+ echo '<div id="survey_title_'.$rowFolderSurveys['id'].'" class="survey_title" onClick="toggleLibrarySurveyQuestions(\''.$rowFolderSurveys['id'].'\');">';
+ echo ' <span class="faicon clipboard"></span>';
+ echo ' <span class="title">'.$rowFolderSurveys['naslov'].'</span>';
+ echo '</div>';
+
+
+ // Seznam vprasanj v anketi
+ echo '<div id="survey_questions_'.$rowFolderSurveys['id'].'" class="survey_questions">';
+
+ $sqlQuestions = sisplet_query("SELECT s.id, s.naslov, s.lib_naslov, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='".$rowFolderSurveys['id']."' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
+ while ($rowQuestions = mysqli_fetch_array($sqlQuestions)) {
+
+ $this->displayRightQuestionItem($rowQuestions);
+ }
+
+ echo '</div>';
+ }
+ }
+ // Seznam vprasanj iz knjiznice
+ else{
+
+ // Najprej zlistamo vse child folderje
+ $sqlFolders = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE parent='".$this->folder_id."' AND tip='".$this->tab."' ORDER BY naslov");
+ if (mysqli_num_rows($sqlFolders) > 0){
+
+ // Loop po vseh mapah znotraj parenta
+ while ($rowFolders = mysqli_fetch_array($sqlFolders)) {
+ $this->displayRightFolderItem($rowFolders['id'], $rowFolders['naslov']);
+ }
+ }
+
+ echo '<div class="spacer"></div>';
+
+ $allow_edit = true;
+
+ // Loop po vseh vprasanjih v folderju
+ $sqlFolderQuestions = sisplet_query("SELECT s.id, s.naslov, s.lib_naslov, s.tip, f.uid AS folder_uid
+ FROM srv_spremenljivka s, srv_library_folder f
+ WHERE s.folder='".$this->folder_id."' AND s.gru_id='-1' AND f.id=s.folder
+ ORDER BY s.naslov ASC
+ ");
+ while ($rowFolderQuestions = mysqli_fetch_array($sqlFolderQuestions)) {
+
+ $this->displayRightQuestionItem($rowFolderQuestions);
+ }
+
+ // Loop po vseh if-ih/blokih v folderju
+ $sqlFolderIfs = sisplet_query("SELECT i.id, i.label, i.tip, f.uid AS folder_uid
+ FROM srv_if i, srv_library_folder f
+ WHERE i.folder='".$this->folder_id."' AND f.id=i.folder
+ ORDER BY i.label ASC, i.id ASC
+ ");
+ while ($rowFolderIfs = mysqli_fetch_array($sqlFolderIfs)) {
+
+ $this->displayRightIfItem($rowFolderIfs);
+ }
+
+ // Init drag/drop js
+ echo '<script>initDragLibraryItem();</script>';
+ }
+
+ }
+
+ // Prikazemo seznam vprasanj v anketah iz knjiznice v folderju
+ private function displaySurveyQuestionList(){
+ global $global_user_id;
+ global $lang;
+
+ // Folder ni nastavljen
+ if($this->folder_id == 0)
+ return;
+
+
+ // Naslov ankete
+ SurveyInfo :: getInstance()->SurveyInit($this->folder_id);
+ echo '<div class="folder_title"><span class="faicon clipboard"></span>'.SurveyInfo::getSurveyTitle().'</div>';
+
+ $sqlQuestions = sisplet_query("SELECT s.id, s.naslov, s.lib_naslov, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='".$this->folder_id."' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
+ while ($rowQuestions = mysqli_fetch_array($sqlQuestions)) {
+
+ $this->displayRightQuestionItem($rowQuestions);
+ }
+ }
+
+ // Prikazemo vrstico (item, folder) na desni
+ private function displayRightFolderItem($folder_id, $folder_name){
+ global $lang;
+
+ echo '<div id="folder_item_holder_'.$folder_id.'" class="folder_item_holder" onClick="openLibraryFolder(\''.$folder_id.'\');">';
+
+ echo ' <div class="folder_item_info">';
+ echo ' <span class="faicon folder_empty"></span>';
+ echo ' <span class="title">'.$folder_name.'</span>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ // Prikazemo 1 vrstico (item, vprasanje) na desni
+ private function displayRightQuestionItem($spremenljivka){
+ global $lang;
+ global $global_user_id;
+ global $admin_type;
+
+ echo '<div id="question_item_holder_'.$spremenljivka['id'].'" class="question_item_holder" onClick="selectLibraryItem(\''.$spremenljivka['id'].'\');">';
+
+ echo ' <input type="checkbox" id="question_item_check_'.$spremenljivka['id'].'" item-type="1" item-subtype="1" class="question_item_check" onClick="selectLibraryItem(\''.$spremenljivka['id'].'\');"><label for="question_item_check_'.$spremenljivka['id'].'"></label>';
+
+ echo ' <div id="question_item_info_'.$spremenljivka['id'].'" item-type="1" item-subtype="1" item-id="'.$spremenljivka['id'].'" class="question_item_info">';
+
+ echo ' <span class="faicon list"></span>';
+
+ if($spremenljivka['lib_naslov'] == '')
+ echo ' <span class="title">'.substr(strip_tags($spremenljivka['naslov']), 0, 40).'</span>';
+ else
+ echo ' <span class="title">'.substr(strip_tags($spremenljivka['lib_naslov']), 0, 40).'</span>';
+
+ echo '<div class="right_icons">';
+
+ // Preview
+ echo ' <span class="faicon monitor" onClick="previewVprasanje(\''.$spremenljivka['id'].'\');"></span>';
+
+ // Urejanje Vprasanja
+ if($this->tab == '0' && ($spremenljivka['folder_uid'] == $global_user_id || $admin_type == 0)){
+
+ // Tri pikice za prikaz urejanja vprasanja
+ echo ' <span class="faicon dots_ver dots_ver_item" onClick="showLibraryItemEdit(this);"></span>';
+
+ // Skrit div za urejanje vprasanja
+ echo ' <div class="item_settings displayNone">';
+ echo ' <ul>';
+ echo ' <li onClick="deleteLibraryItem(\''.$spremenljivka['id'].'\', \'1\');">'.$lang['srv_library_delete_q'].'</li>';
+ echo ' <li onClick="displayRenameLibraryItemPopup(\''.$spremenljivka['id'].'\', \'1\');">'.$lang['srv_library_rename_q'].'</li>';
+ echo ' </ul>';
+ echo ' </div>';
+ }
+
+ echo '</div>';
+
+
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ // Prikazemo 1 vrstico (item, if) na desni
+ private function displayRightIfItem($if){
+ global $lang;
+ global $global_user_id;
+ global $admin_type;
+
+ if($if['tip'] == 2){
+ $type_string = '<span class="item_type">[LOOP]</span>';
+ $icon = 'loop_32';
+ $type = 'loop';
+ $subtype = '2_2';
+ }
+ elseif($if['tip'] == 1){
+ $type_string = '<span class="item_type">[BLOCK]</span>';
+ $icon = 'block_32';
+ $type = 'block';
+ $subtype = '2_1';
+ }
+ else{
+ $type_string = '<span class="item_type">[IF]</span>';
+ $icon = 'if_32';
+ $type = 'if';
+ $subtype = '2_0';
+ }
+
+ $type_string = '';
+
+ echo '<div id="question_item_holder_'.$if['id'].'" class="question_item_holder" onClick="selectLibraryItem(\''.$if['id'].'\');">';
+
+ echo ' <input type="checkbox" id="question_item_check_'.$if['id'].'" item-type="2" item-subtype="'.$subtype.'" class="question_item_check" onClick="selectLibraryItem(\''.$if['id'].'\');"><label for="question_item_check_'.$spremenljivka['id'].'"></label>';
+
+ echo ' <div id="question_item_info_'.$if['id'].'" item-type="2" item-subtype="'.$subtype.'" item-id="'.$if['id'].'" class="question_item_info">';
+
+ echo ' <span class="faicon '.$icon.'"></span>';
+ echo ' <span class="title">'.$type_string.substr(strip_tags($if['label']), 0, 40).'</span>';
+
+
+ echo '<div class="right_icons">';
+
+ // Urejanje Vprasanja
+ if($this->tab == '0' && ($if['folder_uid'] == $global_user_id || $admin_type == 0)){
+
+ // Tri pikice za prikaz urejanja folderja
+ echo ' <span class="faicon dots_ver dots_ver_item" onClick="showLibraryItemEdit(this);"></span>';
+
+ // Skrit div za urejanje folderja
+ echo ' <div class="item_settings displayNone">';
+ echo ' <ul>';
+ echo ' <li onClick="deleteLibraryItem(\''.$if['id'].'\', \'2\');">'.$lang['srv_library_delete_'.$type].'</li>';
+ echo ' <li onClick="displayRenameLibraryItemPopup(\''.$if['id'].'\', \''.$subtype.'\');">'.$lang['srv_library_rename_'.$type].'</li>';
+ echo ' </ul>';
+ echo ' </div>';
+ }
+
+ echo '</div>';
+
+
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ /**
+ * Popup pri preimenovanju itema v knjiznici
+ */
+ private function displayRenameItemPopup($item_id, $type){
+ global $lang;
+ global $admin_type;
+ global $global_user_id;
+
+ // Podtip elementa (vprasanje, blok, if...)
+ if($type == '1'){
+
+ // Dobimo naslov
+ $sql = sisplet_query("SELECT lib_naslov FROM srv_spremenljivka WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+ $naslov = substr(strip_tags($row['lib_naslov']), 0, 40);
+
+ $subtype = 'q';
+ }
+ else{
+
+ // Dobimo naslov
+ $sql = sisplet_query("SELECT label FROM srv_if WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ $naslov = substr($row['label'], 0, 40);
+
+ if($type == '2_2')
+ $subtype = 'loop';
+ elseif($type == '2_1')
+ $subtype = 'block';
+ else
+ $subtype = 'if';
+ }
+
+
+ // Naslov okna glede na tip elementa (vprasanje, blok, if...)
+ echo '<h2>'.$lang['srv_library_rename_'.$subtype].'</h2>';
+
+ // Vsebina
+ echo '<div>';
+ echo ' <input type="text" id="lib_element_name" class="large" value="'.$naslov.'" maxlength="40">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="closeAdditionalPopup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="renameLibraryItem(\''.$item_id.'\', \''.$type.'\');">'.$lang['srv_library_rename_'.$subtype].'</button>';
+ echo '</div>';
+ }
+
+ // Dodaten popup za ime direktorija pri preimenovanju
+ private function displayRenameQuestionPopup($element_id){
+ global $lang;
+
+ echo '<h2>'.$lang['srv_library_folder_name'].'aaa</h2>';
+
+ echo '<div>';
+ echo ' <input type="text" id="lib_element_name" class="large" value="'.$folder_name.'">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="closeAdditionalPopup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="renameLibraryElement(\''.$element_id.'\', \''.$type.'\');">'.$lang['srv_library_folder_rename'].'</button>';
+ echo '</div>';
+ }
+
+
+ // Prikazemo gumbe
+ private function displayButtons(){
+ global $global_user_id;
+ global $lang;
+
+ echo '<button class="medium white-blue" onClick="popupClose();">'.$lang['edit1338'].'</button>';
+ echo '<button id="insert_library_button" class="medium blue" disabled="disabled" onClick="insertLibraryItemsIntoSurvey();">'.$lang['srv_library_survey_add'].'</button>';
+ }
+
+
+ /**
+ * Popup pri dodajanju itema v knjiznico - potrditev, izbira folderja, urejanje naslova
+ *
+ * type
+ * - 0->anketa
+ * - 1->vprasanja
+ * - 2->if/blok
+ */
+ private function displayAddIntoLibrary($item_id, $type){
+ global $lang;
+ global $admin_type;
+ global $global_user_id;
+
+ // Podtip elementa (vprasanje, blok, if...)
+ if($type == '1'){
+
+ // Dobimo naslov
+ $sql = sisplet_query("SELECT naslov, lib_naslov FROM srv_spremenljivka WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+ $naslov = ($row['lib_naslov'] == '') ? substr(strip_tags($row['naslov']), 0, 40) : substr(strip_tags($row['lib_naslov']), 0, 40);
+
+ $subtype = 'q';
+ }
+ else{
+
+ // Dobimo naslov
+ $sql = sisplet_query("SELECT label FROM srv_if WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ $naslov = substr($row['label'], 0, 40);
+
+ if($type == '2_2')
+ $subtype = 'loop';
+ elseif($type == '2_1')
+ $subtype = 'block';
+ else
+ $subtype = 'if';
+ }
+
+
+ // Naslov okna glede na tip elementa (vprasanje, blok, if...)
+ echo '<h2>'.$lang['srv_library_add_to_lib_title_'.$subtype].'</h2>';
+
+
+ // Vsebina
+ echo '<div class="content add_to_lib_content">';
+
+ echo '<label>'.$lang['srv_library_add_to_lib_name_'.$subtype].':</label>';
+ echo '<input id="lib_item_title" type="text" value="'.$naslov.'" maxlength="40">';
+
+ // Izbira direktorija
+ echo '<label>'.$lang['srv_library_add_to_lib_folder'].':</label>';
+
+ $this->getFolderStructure($uid=$global_user_id);
+ if($admin_type == 0)
+ $this->getFolderStructure($uid='0');
+
+ echo '<select id="lib_item_folder" class="dropdown">';
+ foreach($this->folder_structure as $folder){
+
+ echo '<option value="'.$folder['id'].'">';
+
+ for($i=0; $i<$folder['indent']; $i++){
+ echo '&nbsp;';
+ }
+
+ echo $folder['title'];
+
+ echo '</option>';
+ }
+ echo '</select>';
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="addIntoLibrary(\''.$item_id.'\', \''.$type.'\');">'.$lang['srv_library_add_to_lib'].'</button>';
+ echo '</div>';
+ }
+
+ private function displayAddIntoLibrarySuccess($item_id, $type, $success){
+ global $lang;
+
+ // Podtip elementa (vprasanje, blok, if...)
+ if($type == '1'){
+
+ // Dobimo naslov
+ $sql = sisplet_query("SELECT lib_naslov FROM srv_spremenljivka WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+ $naslov = strip_tags($row['lib_naslov']);
+
+ $subtype = 'q';
+ }
+ else{
+
+ // Dobimo tip (if ali blok) in naslov
+ $sql = sisplet_query("SELECT label FROM srv_if WHERE id='".$item_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ $naslov = $row['label'];
+
+ if($tip == '2_2')
+ $subtype = 'loop';
+ elseif($tip == '2_1')
+ $subtype = 'block';
+ else
+ $subtype = 'if';
+ }
+
+
+ // Naslov okna glede na tip elementa (vprasanje, blok, if...)
+ echo '<h2>'.$lang['srv_library_add_to_lib_title_'.$subtype].'</h2>';
+
+
+ // Vsebina
+ echo '<div class="content add_to_lib_content">';
+
+ if($success){
+ echo $lang['srv_library_add_to_lib_success_'.$subtype];
+ }
+ else{
+ echo $lang['srv_library_add_to_lib_success_err'];
+ }
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onClick="popupClose();">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ }
+
+
+ // Dobimo sistemski root folder in root folder uporabnika
+ private function setRootFolders(){
+ global $global_user_id;
+ global $lang;
+
+ // Root folder uporabnika
+ $sqlFolder = sisplet_query("SELECT id FROM srv_library_folder WHERE uid='".$global_user_id."' AND parent='0' AND tip='".$this->tab."' AND lang='".$lang['id']."'");
+
+ // Za prvic ko pride user, da mu dodamo folder
+ if (mysqli_num_rows($sqlFolder) == 0){
+
+ // Nastavimo naslov mape
+ $naslov = $lang['srv_moja_vprasanja'];
+
+ sisplet_query("INSERT INTO srv_library_folder
+ (uid, tip, naslov, parent, lang)
+ VALUES
+ ('".$global_user_id."', '".$this->tab."', '".$naslov."', '0', '".$lang['id']."')
+ ");
+
+ $this->root_folder['user'] = mysqli_insert_id($GLOBALS['connect_db']);
+ }
+ else{
+ $rowFolder = mysqli_fetch_array($sqlFolder);
+ $this->root_folder['user'] = $rowFolder['id'];
+ }
+
+
+ // Sistemski root folder
+ $sqlFolder = sisplet_query("SELECT id FROM srv_library_folder WHERE uid='0' AND parent='0' AND tip='".$this->tab."' AND lang='".$lang['id']."'");
+ $rowFolder = mysqli_fetch_array($sqlFolder);
+
+ $this->root_folder['system'] = $rowFolder['id'];
+ }
+
+ // Seznam folderjev uporabnika
+ private function getFolderStructure($uid, $parent=0, $indent=0){
+ global $global_user_id;
+ global $admin_type;
+ global $lang;
+
+
+ $sqlFolder = sisplet_query("SELECT id, naslov FROM srv_library_folder WHERE uid='".$uid."' AND parent='".$parent."' AND tip='0' AND lang='".$lang['id']."'");
+ if(mysqli_num_rows($sqlFolder) == 0){
+ return;
+ }
+
+ while($rowFolder = mysqli_fetch_array($sqlFolder)){
+
+ $this->folder_structure[] = array(
+ 'id' => $rowFolder['id'],
+ 'title' => $rowFolder['naslov'],
+ 'indent' => $indent
+ );
+
+ $indent_new = $indent+1;
+
+ $this->getFolderStructure($uid, $rowFolder['id'], $indent_new);
+ }
+
+ return;
+ }
+
+
+ /**
+ * @desc pohendla ajax klice
+ */
+ public function ajax () {
+ global $lang;
+ global $global_user_id;
+
+
+ $this->tab = (isset($_POST['tab'])) ? (int)$_POST['tab'] : 0;
+
+ // Nastavimo root folder
+ $this->setRootFolders();
+
+
+ // Odpremo popup s knjiznico
+ if ($_GET['a'] == 'displayLibraryPopup') {
+ $this->displayLibrary();
+
+ // Div za dodaten popup za preview
+ echo '<div id="vprasanje_preview" class="displayNone"></div>';
+ }
+
+ // Preklopimo tab v kniznici
+ elseif ($_GET['a'] == 'displayLibraryTabContent') {
+ $this->displayTabContent();
+ }
+
+ // Dodamo folder
+ elseif ($_GET['a'] == 'addFolder') {
+
+ $folder_id = $_POST['folder_id'];
+ $uid = $_POST['uid'];
+ $folder_name = $_POST['folder_name'];
+
+ if($folder_id != '' && $folder_id > 0){
+ $s = sisplet_query("INSERT INTO srv_library_folder (uid, tip, naslov, parent, lang) VALUES ('".$uid."', '".$this->tab."', '".$folder_name."', '".$folder_id."', '".$lang['id']."')");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+
+ $insert_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ // Nastavimo za aktivni folder in izrisemo na novo
+ $this->folder_id = $insert_id;
+
+ // Posodobimo vse razprte folderje (vsi parenti ce je child aktiven)
+ $this->setExpandedFolders($this->folder_id);
+
+ // Prikazemo folderje
+ $this->displayFolderList();
+ }
+ }
+
+ // Preimenujemo folder
+ elseif ($_GET['a'] == 'renameFolder') {
+
+ $folder_id = $_POST['folder_id'];
+ $folder_name = $_POST['folder_name'];
+
+ if($folder_id != '' && $folder_id > 0){
+
+ $s = sisplet_query("UPDATE srv_library_folder SET naslov='".$folder_name."' WHERE id='".$folder_id."'");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+
+ // Nastavimo za aktivni folder in izrisemo na novo
+ $this->folder_id = $folder_id;
+
+ // Posodobimo vse razprte folderje (vsi parenti ce je child aktiven)
+ $this->setExpandedFolders($this->folder_id);
+
+ $this->displayFolderList();
+ }
+ }
+
+ // Brisemo folder
+ elseif ($_GET['a'] == 'deleteFolder') {
+
+ $folder_id = $_POST['folder_id'];
+
+ if($folder_id != '' && $folder_id > 0){
+
+ $sql = sisplet_query("SELECT parent FROM srv_library_folder WHERE id = '".$folder_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ // Prestavimo vse iteme v parent folder
+ if ($this->tab == 0) {
+ sisplet_query("UPDATE srv_spremenljivka SET folder='".$row['parent']."' WHERE folder='".$folder_id."'");
+ sisplet_query("UPDATE srv_if SET folder='".$row['parent']."' WHERE folder='".$folder_id."'");
+ }
+ else {
+ sisplet_query("UPDATE srv_library_anketa SET folder='".$row['parent']."' WHERE folder='".$folder_id."'");
+ }
+
+ // Prestavimo vse child folderje v parent folder
+ sisplet_query("UPDATE srv_library_folder SET parent='".$row['parent']."' WHERE parent='".$folder_id."'");
+
+ // Pobrisemo folder
+ sisplet_query("DELETE FROM srv_library_folder WHERE id='".$folder_id."'");
+
+ // Nastavimo parenta za aktivni folder in izrisemo na novo
+ $this->folder_id = $row['parent'];
+
+ // Posodobimo vse razprte folderje (vsi parenti ce je child aktiven)
+ $this->setExpandedFolders($this->folder_id);
+
+ // Prikazemo fodlderje
+ $this->displayFolderList();
+ }
+ }
+
+ // Odpremo popup za poimenovanje novega folderja
+ elseif ($_GET['a'] == 'addFolderPopup') {
+
+ $folder_id = $_POST['folder_id'];
+ $uid = $_POST['uid'];
+
+ $this->displayAddFolderPopup($folder_id, $uid);
+ }
+
+ // Odpremo popup za poimenovanje folderja
+ elseif ($_GET['a'] == 'renameFolderPopup') {
+
+ $folder_id = $_POST['folder_id'];
+ $folder_name = $_POST['folder_name'];
+
+ $this->displayRenameFolderPopup($folder_id, $folder_name);
+ }
+
+
+ // Odpremo folder z vprasanji v knjiznici
+ elseif ($_GET['a'] == 'displayLibraryQuestionList') {
+
+ $this->folder_id = $_POST['folder_id'];
+
+ $this->displayQuestionList();
+ }
+
+ // Odpremo anketo z vprasanji v knjiznici
+ elseif ($_GET['a'] == 'displayLibrarySurveyQuestionList') {
+
+ $this->folder_id = $_POST['folder_id'];
+
+ $this->displaySurveyQuestionList();
+ }
+
+ // Dodajanje itema iz knjiznice v vprasalnik
+ elseif ($_GET['a'] == 'addIntoSurvey') {
+
+ $items = $_POST['items'];
+
+ $b = new Branching($this->ank_id);
+ $ba = new BranchingAjax($this->ank_id);
+
+ foreach(array_reverse($items) as $item){
+
+ $item_array = explode("_", $item);
+ $item_id = $item_array[0];
+ $item_type = $item_array[1];
+
+ // Poiscemo zadnji root element v anketi
+ /*$sql = sisplet_query("SELECT element_spr, element_if FROM srv_branching WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red DESC LIMIT 1");
+ $row = mysqli_fetch_array($sql);
+
+ // Zdanji element je if oz. blok
+ if($row['element_if'] > 0){
+ $endif = 1;
+ $last_spr = 0;
+ }
+ // Zadnji element je vprasanje
+ else{
+ $endif = 0;
+ $last_spr = $row['element_spr'];
+ }*/
+
+ // Dodamo if/blok v anketo
+ if($item_type == '2'){
+
+ //$spremenljivka = $last_spr;
+ $copy = $item_id;
+
+ $sqln = sisplet_query("SELECT MAX(i.number) AS number FROM srv_if i, srv_branching b WHERE b.ank_id='$this->ank_id' AND b.element_if=i.id");
+ $rown = mysqli_fetch_array($sqln);
+ $number = $rown['number'] + 1;
+
+ // Dobimo tip (if ali blok)
+ $sqlt = sisplet_query("SELECT tip FROM srv_if WHERE id='".$item_id."'");
+ $rowt = mysqli_fetch_array($sqlt);
+ $tip = $rowt['tip'];
+
+ $sql = sisplet_query("INSERT INTO srv_if (id, number, tip) VALUES ('', '$number', '$tip')");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ $if_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ $row['parent'] = 0;
+ $row['vrstni_red'] = 99999999;
+
+ $next_element = $b->find_next_element($row['parent'], $row['vrstni_red']);
+
+ if ($next_element == null) { // next_element je prazen na koncu ifa, takrat je tudi nov if prazen
+ $next_element['parent'] = 0;
+ $next_element['vrstni_red'] = 99999999;
+ $next_element['element_spr'] = 0;
+ $next_element['element_if'] = 0;
+ }
+
+ // dodajamo loop - preverimo da ga ne zelimo vgnezditi v drug loop
+ if ($tip == 2) {
+ // preverimo, da ga ne dodamo v ze obstojec loop
+ if ($b->find_loop_parent($next_element['parent']) > 0)
+ $add = false;
+
+ // preverimo, da ge ne dodamo direktno pred obstojec loop (ker potem objame obstojec loop in dobimo vgnezdenje)
+ if ($next_element['element_if'] > 0)
+ if ($b->find_loop_child($next_element['element_if']) > 0)
+ $add = false;
+ }
+
+ $b->if_new($endif=1, $next_element['parent'], $if_id, $next_element['vrstni_red'], $next_element['element_spr'], $next_element['element_if'], $copy, $no_content=false, $include_element=false);
+
+ $ba->check_loop();
+ $b->repare_vrstni_red();
+ }
+ // Dodamo vprasanje v anketo na konec
+ else{
+ $ba->spremenljivka_new($spremenljivka=0, $if=0, $endif=1, $copy=$item_id, $drop=0);
+ $b->repare_vrstni_red();
+ }
+ }
+
+ Common::getInstance()->Init($this->ank_id);
+ Common::getInstance()->prestevilci(0, $all=true);
+
+ $b->branching_struktura();
+ }
+
+ // Drop itema v drug folder
+ elseif ($_GET['a'] == 'dropItem') {
+
+ $item_id = $_POST['item_id'];
+ $item_type = $_POST['item_type'];
+ $folder_id = $_POST['folder_id'];
+
+ if($item_id != '' && $item_id > 0){
+
+ // if/blok
+ if ($item_type == '2') {
+ sisplet_query("UPDATE srv_if SET folder='".$folder_id."' WHERE id='".$item_id."'");
+ }
+ // spremenljivka
+ else {
+ sisplet_query("UPDATE srv_spremenljivka SET folder='".$folder_id."' WHERE id='".$item_id."'");
+ }
+ }
+ }
+
+ // Izbris itema iz knjiznice
+ elseif ($_GET['a'] == 'deleteItem') {
+
+ $item_id = $_POST['item_id'];
+ $item_type = $_POST['item_type'];
+
+ if($item_id != '' && $item_id > 0){
+
+ // if/blok
+ if ($item_type == '2') {
+ sisplet_query("DELETE FROM srv_if WHERE id='".$item_id."' AND folder!='0'");
+ }
+ // spremenljivka
+ else {
+ sisplet_query("DELETE FROM srv_spremenljivka WHERE id='".$item_id."'AND folder!='0'");
+ }
+ }
+ }
+
+ // Odpremo popup za preimenovanje itema
+ elseif ($_GET['a'] == 'displayRenameLibraryItemPopup') {
+
+ $item_id = $_POST['item_id'];
+ $type = $_POST['type'];
+
+ $this->displayRenameItemPopup($item_id, $type);
+ }
+
+ // Preimenujemo itema
+ elseif ($_GET['a'] == 'renameItem') {
+
+ $item_id = $_POST['item_id'];
+ $type = $_POST['type'];
+ $title = $_POST['title'];
+
+ $this->folder_id = $_POST['folder_id'];
+
+ if($item_id != '' && $item_id > 0){
+
+ if($type == '1'){
+ $s = sisplet_query("UPDATE srv_spremenljivka SET lib_naslov='".$title."' WHERE id='".$item_id."'");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+ }
+ elseif($type == '2_0' || $type == '2_1' || $type == '2_2'){
+ $s = sisplet_query("UPDATE srv_if SET label='".$title."' WHERE id='".$item_id."'");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+ }
+
+ $this->displayQuestionList();
+ }
+ }
+
+
+ // Odpremo popup za dodajanje itema v knjiznico
+ elseif ($_GET['a'] == 'displayAddIntoLibraryPopup') {
+
+ $item_id = $_POST['item_id'];
+ $type = $_POST['type'];
+
+ $this->displayAddIntoLibrary($item_id, $type);
+ }
+
+ // Dodajanje itema v knjiznico
+ elseif ($_GET['a'] == 'addIntoLibrary') {
+
+ $item_id = $_POST['item_id'];
+ $type = $_POST['type'];
+ $title = $_POST['title'];
+ $folder_id = $_POST['folder_id'];
+
+ if($folder_id == '' || $folder_id == 0)
+ $folder_id = $this->root_folder['user'];
+
+ if ($item_id > 0) {
+
+ $b = new Branching($this->ank_id);
+
+ // v knjiznico dodamo spremenljivko
+ if($type == '1') {
+ $id = $b->nova_spremenljivka(-1, 0, 0, $item_id);
+ sisplet_query("UPDATE srv_spremenljivka SET folder='".$folder_id."', lib_naslov='".$title."' WHERE id='".$id."'");
+
+ }
+ // v knjiznico dodamo if/blok
+ elseif($type == '2_0' || $type == '2_1' || $type == '2_2') {
+ $id = $b->if_copy(0, $item_id, true);
+ sisplet_query("UPDATE srv_if SET folder='".$folder_id."', label='".$title."' WHERE id='".$id."'");
+ }
+ }
+ }
+ }
+}
+
+?>
diff --git a/admin/survey/classes/class.NewSurvey.php b/admin/survey/classes/class.NewSurvey.php
index e3fefb8..4596541 100644
--- a/admin/survey/classes/class.NewSurvey.php
+++ b/admin/survey/classes/class.NewSurvey.php
@@ -14,7 +14,8 @@ class NewSurvey{
private $subpage; // Podstran na kateri se nahajamo (nova anketa, iz predloge, uvoz)
private $template_category; // Podstran kategorij predlog na kateri se nahajamo (vse predloge, organizacija dogodka...)
- private $templates; // Array vseh templatov
+ private $templates = array(); // Array vseh templatov
+
function __construct(){
global $site_url;
@@ -31,14 +32,17 @@ class NewSurvey{
global $site_path;
// Leva stran - meni
- echo '<div id="left_menu">';
+ echo '<div class="layout_left_item">';
$this->displayLeftMenu();
echo '</div>';
// Desna stran - vsebina
- echo '<div id="right_content">';
+ echo '<div class="layout_right_item">';
+ echo '<div class="layout_right_centering">';
+ echo '<span class="faicon fa-times ultra_dark_gray pointer" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;"></span>';
$this->displayRightContent();
echo '</div>';
+ echo '</div>';
}
// Izris levega menija
@@ -46,43 +50,39 @@ class NewSurvey{
global $lang;
global $site_url;
global $site_path;
- global $virtual_domain;
- global $debug;
global $admin_type;
- echo '<div class="title">'.$lang['srv_newSurvey_title'].':</div>';
-
// Nova anketa
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=new" title="'.$lang['srv_newSurvey_survey_new2'].'"><span class="item '.($this->subpage == 'new' ? ' active' : '').'" onClick="">'.$lang['srv_newSurvey_survey_new'].'</span></a>';
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=new" title="'.$lang['srv_newSurvey_survey_new2'].'"><span class="item '.($this->subpage == 'new' ? ' active' : '').'" onClick=""><span class="faicon fa-clipboard-list new_survey_menu_icon"></span>'.$lang['srv_newSurvey_survey_new'].'</span></a>';
// Anketa iz predloga (knjiznice) - samo na www.1ka.si, testu in arnesu
- if((strpos($site_url, 'www.1ka.si') !== false && !$virtual_domain)
+ if/**((strpos($site_url, 'www.1ka.si') !== false && !isVirtual())
|| strpos($site_url, 'test.1ka.si')
|| strpos($site_url, '1ka.arnes.si')
- || $debug == '1'){
+ || isDebug())**/(1){
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template" title="'.$lang['srv_newSurvey_survey_template2'].'"><span class="item '.($this->subpage == 'template' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_template'].'</span></a>';
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template" title="'.$lang['srv_newSurvey_survey_template2'].'"><span class="item '.($this->subpage == 'template' ? ' active' : '').'"><span class="faicon fa-file-image new_survey_menu_icon"></span>'.$lang['srv_newSurvey_survey_template'].'</span></a>';
if($this->subpage == 'template'){
- echo '<ul>';
+ echo '<ul class="template_type_menu">';
for($i=0; $i<=10; $i++){
- echo '<li><a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template&c='.$i.'" title="'.$lang['srv_newSurvey_survey_template_cat'.$i].'"><span class="subitem '.($this->subpage == 'template' && $this->template_category == $i ? ' active' : '').'">'.$lang['srv_newSurvey_survey_template_cat'.$i].'</span></a></li>';
+ echo '<li><a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template&c='.$i.'" title="'.$lang['srv_newSurvey_survey_template_cat'.$i].'"><span class="subitem '.($this->subpage == 'template' && $this->template_category == $i ? ' active' : '').'">'.$lang['srv_newSurvey_survey_template_cat'.$i].'</a></li>';
}
echo '</ul>';
}
}
// Kopiraj mojo anketo
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=copy" title="'.$lang['srv_newSurvey_survey_copy'].'"><span class="item '.($this->subpage == 'copy' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_copy'].'</span></a>';
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=copy" title="'.$lang['srv_newSurvey_survey_copy'].'"><span class="item '.($this->subpage == 'copy' ? ' active' : '').'"><span class="faicon copy new_survey_menu_icon"></span>'.$lang['srv_newSurvey_survey_copy'].'</span></a>';
- // Uvoz ankete
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=archive" title="'.$lang['srv_newSurvey_survey_archive2'].'"><span class="item '.($this->subpage == 'archive' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_archive'].'</span></a>';
+ // Uvoz ankete - 1ka format
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=archive" title="'.$lang['srv_newSurvey_survey_archive2'].'"><span class="item '.($this->subpage == 'archive' ? ' active' : '').'"><span class="faicon fa-file-upload new_survey_menu_icon"></span>'.$lang['srv_newSurvey_survey_archive'].'</span></a>';
// Anketa iz besedila
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=from_text" title="'.$lang['srv_newSurvey_survey_from_text'].'"><span class="item '.($this->subpage == 'from_text' ? ' active' : '').'">'.$lang['srv_newSurvey_survey_from_text'].'</span></a>';
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=from_text" title="'.$lang['srv_newSurvey_survey_from_text'].'"><span class="item '.($this->subpage == 'from_text' ? ' active' : '').'"><span class="faicon fa-file-word empty new_survey_menu_icon"></span>'.$lang['srv_newSurvey_survey_from_text'].'</span></a>';
if(HierarhijaHelper::aliImaDostopDoIzdelovanjaHierarhije()) {
- echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=hierarhija" title="'.$lang['srv_hierarchy'].'"><span class="item hierarhija-button '.($this->subpage == 'hierarhija' ? ' active' : '').'">'.$lang['srv_hierarchy'].'</span></a>';
+ echo '<a class="noline" href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=hierarhija" title="'.$lang['srv_hierarchy'].'"><span class="item hierarhija-button '.($this->subpage == 'hierarhija' ? ' active' : '').'"><span class="faicon fa-school new_survey_menu_icon"></span>'.$lang['srv_hierarchy'].'</span></a>';
}
}
@@ -130,22 +130,23 @@ class NewSurvey{
echo '<div class="fieldset">';
// Naslov
+ echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_new'] . '</div>';
echo '<div class="title">' . $lang['srv_noSurvey_settings'] . '</div>';
- echo '<div class="survey_title_text_holder">';
+ echo '<div class="setting_horizontal_wrapper">';
// Interno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_list_no_data_create'] . ':</span>';
- echo '<input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" size="40" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
- echo '<span id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_naslov_1">' . $lang['srv_list_no_data_create'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
+ echo '<span class="charalimit" id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
echo '</div>';
// Objavljeno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_novaanketa_kratkoime'] . ':</span>';
- echo '<input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" size="40" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
- echo '<span id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_akronim_1"">' . $lang['srv_novaanketa_kratkoime'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
+ echo '<span class="charalimit" id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
echo '</div>';
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
@@ -153,10 +154,10 @@ class NewSurvey{
$show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
$sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' ORDER BY naslov ASC");
if($show_folders == 1 && mysqli_num_rows($sql) > 0){
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_newSurvey_survey_new_folder'] . ':</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_folder">' . $lang['srv_newSurvey_survey_new_folder'] . Help::display('srv_nova_shrani').':</label>';
- echo '<select name="novaanketa_folder" id="novaanketa_folder">';
+ echo '<select class="dropdown large" name="novaanketa_folder" id="novaanketa_folder">';
echo '<option value="0">'.$lang['srv_newSurvey_survey_new_folder_def'].'</option>';
while($row = mysqli_fetch_array($sql)){
echo '<option value="'.$row['id'].'">'.$row['naslov'].'</option>';
@@ -181,8 +182,7 @@ class NewSurvey{
echo '<label for="newAnketaBlank_2"><div class="setting survey_type active">';
echo '<input type="radio" name="newAnketaBlank" id="newAnketaBlank_2" value="2" checked="checked" onClick="$(\'.survey_type\').removeClass(\'active\'); $(this).parent().parent().find(\'.survey_type\').addClass(\'active\');" />';
echo '<span class="radioSetting_type">';
- echo ' <div class="survey_type_title">' . $lang['srv_vrsta_survey_type_2'] . Help::display('srv_create_survey'). '</div>';
- echo ' <div class="survey_type_text">' . $lang['srv_noSurvey_type_2'] . '</div>';
+ echo '<div class="survey_type_title"><span class="faicon fa-clipboard-list"></span>' . $lang['srv_vrsta_survey_type_2'] . '</div>';
echo '</span>';
echo '</div></label>';
@@ -190,8 +190,7 @@ class NewSurvey{
echo '<label for="newAnketaBlank_1"><div class="setting survey_type">';
echo '<input type="radio" name="newAnketaBlank" id="newAnketaBlank_1" value="1" onClick="$(\'.survey_type\').removeClass(\'active\'); $(this).parent().parent().find(\'.survey_type\').addClass(\'active\');" />';
echo '<span class="radioSetting_type">';
- echo ' <div class="survey_type_title">' . $lang['srv_vrsta_survey_type_1'] . Help::display('srv_create_form'). '</div>';
- echo ' <div class="survey_type_text">' . $lang['srv_noSurvey_type_1'] . '</div>';
+ echo '<div class="survey_type_title"><span class="faicon list-alt empty"></span>' . $lang['srv_vrsta_survey_type_1'] . '</div>';
echo '</span>';
echo '</div></label>';
@@ -199,8 +198,7 @@ class NewSurvey{
echo '<label for="newAnketaBlank_0"><div class="setting survey_type">';
echo '<input type="radio" name="newAnketaBlank" id="newAnketaBlank_0" value="0" onClick="$(\'.survey_type\').removeClass(\'active\'); $(this).parent().parent().find(\'.survey_type\').addClass(\'active\');" />';
echo '<span class="radioSetting_type">';
- echo ' <div class="survey_type_title">' . $lang['srv_vrsta_survey_type_0'] . Help::display('srv_create_poll'). '</div>';
- echo ' <div class="survey_type_text">' . $lang['srv_noSurvey_type_0'] . '</div>';
+ echo ' <div class="survey_type_title"> <span class="faicon vote-yes"></span>' . $lang['srv_vrsta_survey_type_0'] . '</div>';
echo '</span>';
echo '</div></label>';
@@ -216,6 +214,8 @@ class NewSurvey{
// Gorenje ima svoj default skin
if(Common::checkModule('gorenje'))
echo '<input type="hidden" name="skin" id="noSurvey_skin_id" value="GorenjeGroup" /><br /><br />';
+ else if(Common::checkModule('automaticservis'))
+ echo '<input type="hidden" name="skin" id="noSurvey_skin_id" value="Automaticservis" /><br /><br />';
else
echo '<input type="hidden" name="skin" id="noSurvey_skin_id" value="1kaBlue" /><br /><br />';
@@ -272,12 +272,10 @@ class NewSurvey{
// Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
-
- echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
- echo '<a href="#" onclick="newAnketaBlank();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="newAnketaBlank();" id="noSurvey_create">'.$lang['next1'].'</button>';
+ echo '</div>';
}
@@ -290,27 +288,27 @@ class NewSurvey{
$this->setTemplates();
-
// 1. sklop - ime ankete
echo '<div class="fieldset">';
// Naslov
+ echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_template'] . '</div>';
echo '<div class="title">' . $lang['srv_noSurvey_settings'] . '</div>';
- echo '<div class="survey_title_text_holder">';
+ echo '<div class="setting_horizontal_wrapper">';
// Interno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_list_no_data_create'] . ':</span>';
- echo '<input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" size="40" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
- echo '<span id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_naslov_1">' . $lang['srv_list_no_data_create'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
+ echo '<span class="charalimit" id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
echo '</div>';
// Objavljeno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_novaanketa_kratkoime'] . ':</span>';
- echo '<input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" size="40" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
- echo '<span id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_akronim_1"">' . $lang['srv_novaanketa_kratkoime'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
+ echo '<span class="charalimit" id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
echo '</div>';
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
@@ -318,10 +316,10 @@ class NewSurvey{
$show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
$sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' ORDER BY naslov ASC");
if($show_folders == 1 && mysqli_num_rows($sql) > 0){
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_newSurvey_survey_new_folder'] . ':</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_folder">' . $lang['srv_newSurvey_survey_new_folder'] .Help::display('srv_nova_shrani'). ':</label>';
- echo '<select name="novaanketa_folder" id="novaanketa_folder">';
+ echo '<select class="dropdown large" name="novaanketa_folder" id="novaanketa_folder">';
echo '<option value="0">'.$lang['srv_newSurvey_survey_new_folder_def'].'</option>';
while($row = mysqli_fetch_array($sql)){
echo '<option value="'.$row['id'].'">'.$row['naslov'].'</option>';
@@ -338,25 +336,34 @@ class NewSurvey{
// 2. sklop - izbira predloge
echo '<div class="fieldset noSurvey_template">';
- echo '<div class="title">' . $lang['srv_newSurvey_survey_template_cat'.$this->template_category] . '</div>';
+ echo '<div class="title">' . $lang['srv_newSurvey_survey_template_choose'] . '</div>';
echo '<input type="hidden" name="noSurvey_template_id" id="noSurvey_template_id" value="">';
-
+
+ // Mobile dropdown za izbiro tipa predloge
+ echo '<select class="template_type_menu" onchange="location.href=this.value;">';
+ for($i=0; $i<=10; $i++){
+ echo '<option value="'.$site_url.'admin/survey/index.php?a=ustvari_anketo&b=template&c='.$i.'" '.($this->subpage == 'template' && $this->template_category == $i ? ' selected="selected"' : '').'>'.$lang['srv_newSurvey_survey_template_cat'.$i].'</option>';
+ }
+ echo '</select>';
+
+ echo '<div class="noSurvey_template_wrap">';
+ echo '<div class="noSurvey_template_holder">';
// Prikaz predlog
foreach($this->templates as $template_id => $template_name){
$this->displayRightContentTemplate($template_id);
}
+ echo '</div>';
+ echo '</div>';
echo '</div>';
// Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
-
- echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
- echo '<a href="#" onclick="newAnketaTemplate();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="newAnketaTemplate();" id="noSurvey_create" title="' . $lang['srv_create_survey']. '">'.$lang['next1'].'</button>';
+ echo '</div>';
}
// Pripravimo podatke o vseh predlogah na trenutni strani
@@ -404,43 +411,44 @@ class NewSurvey{
// Vsebina
+ echo '<div class="template_title">'.$template_data['naslov'].'</div>';
echo '<div class="template_content">';
- echo '<div class="template_content_white">';
- echo $lang['srv_newSurvey_survey_template_type'].': <span class="bold">'.$template_data['tip'].'</span>';
- echo '<br /><br /><br />';
if($template_data['opis'] != '')
- echo (strlen($template_data['opis']) > 155) ? substr($template_data['opis'], 0, 152).'...' : $template_data['opis'];
+ echo (strlen($template_data['opis']) > 140) ? substr($template_data['opis'], 0, 137).'...' : $template_data['opis'];
else
echo $template_data['naslov'];
+ echo '</div>';
+ // Predogled
+ echo '<div class="template_preview">';
+ echo '<a class="noline" href="'.$site_url.'a/'.$template_id.'?preview=on&no_preview=1&size=full" target="_blank"><span class="faicon preview"></span> '.$lang['srv_newSurvey_survey_template_preview'].'</a>';
echo '</div>';
- echo '<span class="template_title">'.$template_data['naslov'].'</span>';
-
- echo '</div>';
-
- // Predogled
- echo '<a href="'.$site_url.'a/'.$template_id.'?preview=on&no_preview=1&size=full" target="_blank" class="template_preview"><span class="faicon preview"></span> '.$lang['srv_newSurvey_survey_template_preview'].'</a>';
-
echo '</div>';
}
- // Vsebina za ustvarjanje ankete iz predloge
+ // Vsebina za kopiranje obstoječe ankete
private function displayRightContentCopy(){
global $lang;
global $site_url;
global $site_path;
global $global_user_id;
- // 1. sklop - tip ankete (navadna, forma, glasovanje)
+ //1. sklop ime ankete, mapa - se doda v 2. fazi redizajna @TG
+
+ // 2. sklop - seznam obstoječih anket
echo '<div class="fieldset">';
+ echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_copy'] . '</div>';
echo '<div class="title">'.$lang['srv_newSurvey_survey_copy_title'].'</div>';
//echo '<input placeholder="'.$lang['srv_newSurvey_survey_copy_text'].'" list="my_surveys" data-list-focus="true" style="width:300px;">';
//echo '<datalist id="my_surveys">';
- echo '<select name="my_surveys" id="my_surveys">';
+ echo '<p class="bottom32">'.$lang['srv_newSurvey_survey_copy_paragraph'].'</p>';
+ echo '<div class="setting_holder">';
+ echo '<select class="dropdown large" name="my_surveys" id="my_surveys">';
+ echo '<option value="0">'.$lang['srv_newSurvey_survey_copy_dropdown'].'</option>';
// Pridobimo seznam obstoječih anket
$sql = sisplet_query("SELECT id, naslov, akronim FROM srv_anketa WHERE insert_uid='".$global_user_id."' ORDER BY naslov ASC");
while($row = mysqli_fetch_array($sql)){
@@ -448,17 +456,17 @@ class NewSurvey{
}
//echo '</datalist>';
echo '</select>';
+ echo '</div>';
echo '</div>';
// Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
-
- echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
- echo '<a href="#" onclick="newAnketaCopy();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="newAnketaCopy();" id="noSurvey_create">'.$lang['next1'].'</button>';
+ echo '</div>';
}
// Vsebina za uvažanje ankete iz arhiva
@@ -471,42 +479,51 @@ class NewSurvey{
echo '<div class="fieldset">';
// Naslov
+ echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_archive'] . '</div>';
echo '<div class="title">' . $lang['srv_newSurvey_survey_archive_title'] . '</div>';
- echo $lang['srv_newSurvey_survey_archive_text2'];
+ echo '<p id="info_text_empty" class="bottom8">'.$lang['srv_arhiv_datoteka_save_txt2'].'</p>';
+ echo '<p id="info_text_populated" class="bottom8" style="display: none;">'.$lang['srv_newSurvey_survey_archive_text'].'</p>';
echo '<div class="setting archive">';
- echo '<form id="restore" action="ajax.php?a=archive_restore" method="post" name="restorefrm" enctype="multipart/form-data" >';
+ echo '<form id="restorefrm" action="ajax.php?a=archive_restore" method="post" name="restorefrm" enctype="multipart/form-data" >';
echo '<input type="hidden" name="has_data" value="0" />';
//echo '<input type="file" name="restore" onchange="document.restorefrm.submit();" />';
- echo '<input type="file" name="restore" class="pointer" />';
-
- echo $lang['srv_arhiv_datoteka_save_txt2'].'.';
+ echo '<input type="file" name="restore" id="restore" style="display: none;" onchange="checkFileExtension1ka();"/>';
+ //custom label
+ echo '<label id="file-input-label-empty" for="restore" class="custom-file-input-label"><span class="faicon publish right8"></span>'.$lang['srv_newSurvey_survey_archive_choosefile'].'</label>';
- echo '<br /><br />'.$lang['srv_newSurvey_survey_archive_text'].'.';
-
+ echo '<span id="file-input-label-clear" class="faicon trash blue right8 pointer" style="display: none;" onclick="clearFileInput();"></span>';
+ echo '<label id="file-input-label-populated" for="restore" class="custom-file-input-label" style="display: none;"></label>';
+
+ //echo $lang['srv_arhiv_datoteka_save_txt2'].'.';
+
+ echo '<br><br><br>';
+
echo '</form>';
echo '</div>';
// Izpis napake pri uvozu
if(isset($_GET['error'])){
if($_GET['error'] == '2')
- echo '<p><span class="red">'.$lang['srv_newSurvey_survey_archive_error2'].'</span></p>';
+ echo '<p class="top32 red">'.$lang['srv_newSurvey_survey_archive_error2'].'</p>';
else
- echo '<p><span class="red">'.$lang['srv_newSurvey_survey_archive_error1'].'</span></p>';
+ echo '<p class="top32 red">'.$lang['srv_newSurvey_survey_archive_error1'].'</p>';
}
echo '</div>';
- // Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
-
- echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
- echo '<a href="#" onclick="document.restorefrm.submit();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
+ echo '<p id="1ka_file_approved_text" style="display:none;"><span class="faicon check right8"></span>'.$lang['srv_newSurvey_survey_archive_valid'].'</p>';
+ echo '<p id="1ka_file_not_approved_text" style="display:none;"><span class="faicon xmark-fail right8"></span>'.$lang['srv_newSurvey_survey_archive_error3'].'</p>';
- echo '</div>';
+
+ // Gumba naprej in preklici
+ echo '<div class="button_holder" style="margin-top:12px;">';
+ echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
+ echo '<button disabled class="medium blue" onclick="document.restorefrm.submit();" id="noSurvey_create">'.$lang['next1'].'</button>';
+ echo '</div>';
}
@@ -533,7 +550,6 @@ class NewSurvey{
echo '<div class="setting archive" id="hierarhija-opcije-vklopa">';
if(!empty($_GET['c']) && $_GET['c'] == 'izbira'){
- global $hierarhija_default_id;
echo '<h4>'.$lang['srv_hierarchy_intro_select_title'].':</h4>';
echo '<div class="izbira">';
@@ -556,7 +572,7 @@ class NewSurvey{
echo '</div>';
echo '<label class="strong block"><input type="radio" id="prevzeta-anketa" name="izberi-anketo" onclick="pridobiKnjiznicoZaHierarhijo(\'privzeta\')" value="prevzeta" /><span class="enka-checkbox-radio"></span>'.$lang['srv_hierarchy_intro_option_default'].'
- <a href="/main/survey/index.php?anketa='.$hierarhija_default_id.'&amp;preview=on" target="_blank" title="Predogled ankete">
+ <a href="/main/survey/index.php?anketa='.AppSettings::getInstance()->getSetting('hierarhija-default_id').'&amp;preview=on" target="_blank" title="Predogled ankete">
<span class="faicon preview"></span>
</a>
</label>';
@@ -598,25 +614,28 @@ class NewSurvey{
// 1. sklop - ime ankete
+ echo '<div class="fieldset">';
+
echo '<div class="fieldset">';
// Naslov
+ echo '<div class="pre-title">' . $lang['srv_newSurvey_survey_from_text'] . '</div>';
echo '<div class="title">' . $lang['srv_noSurvey_settings'] . '</div>';
- echo '<div class="survey_title_text_holder">';
-
+ echo '<div class="setting_horizontal_wrapper">';
+
// Interno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_list_no_data_create'] . ':</span>';
- echo '<input type="text" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" size="40" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
- echo '<span id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_naslov_1">' . $lang['srv_list_no_data_create'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_naslov_1" name="novaanketa_naslov_1" placeholder="' . $lang['srv_novaanketa_polnoime'] . '" value="' . $lang['srv_novaanketa_polnoime'] . '" maxlength="' . ANKETA_NASLOV_MAXLENGTH . '" onfocus="if(this.value==\'' . $lang['srv_novaanketa_polnoime'] . '\') {this.value=\'\';}" />';
+ echo '<span class="charalimit" id="novaanketa_naslov_1_chars">0 / ' . ANKETA_NASLOV_MAXLENGTH . '</span>';
echo '</div>';
// Objavljeno ime
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_novaanketa_kratkoime'] . ':</span>';
- echo '<input type="text" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" size="40" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
- echo '<span id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_akronim_1"">' . $lang['srv_novaanketa_kratkoime'] . ':</label>';
+ echo '<input type="text" class="large" id="novaanketa_akronim_1" name="novaanketa_akronim_1" value="' . $lang['srv_novaanketa_ime_respondenti'] . '" placeholder="' . $lang['srv_novaanketa_ime_respondenti'] . '" maxlength="' . ANKETA_AKRONIM_MAXLENGTH . '" onfocus="$(this).attr(\'changed\',\'1\'); if(this.value==\'' . $lang['srv_novaanketa_ime_respondenti'] . '\') {this.value=\'\';}" changed="0" />';
+ echo '<span class="charalimit" id="novaanketa_akronim_1_chars">0 / ' . ANKETA_AKRONIM_MAXLENGTH . '</span>';
echo '</div>';
// Ce ima uporabnik mape, lahko izbere v katero mapo se anketa uvrsti
@@ -624,10 +643,10 @@ class NewSurvey{
$show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
$sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' ORDER BY naslov ASC");
if($show_folders == 1 && mysqli_num_rows($sql) > 0){
- echo '<div class="setting survey_title_text">';
- echo '<span class="label" style="float:left; width:180px;">' . $lang['srv_newSurvey_survey_new_folder'] . ':</span>';
+ echo '<div class="setting_holder">';
+ echo '<label for="novaanketa_folder">' . $lang['srv_newSurvey_survey_new_folder'] . Help::display('srv_nova_shrani').':</label>';
- echo '<select name="novaanketa_folder" id="novaanketa_folder">';
+ echo '<select class="dropdown large" name="novaanketa_folder" id="novaanketa_folder">';
echo '<option value="0">'.$lang['srv_newSurvey_survey_new_folder_def'].'</option>';
while($row = mysqli_fetch_array($sql)){
echo '<option value="'.$row['id'].'">'.$row['naslov'].'</option>';
@@ -640,13 +659,16 @@ class NewSurvey{
echo '</div>';
echo '</div>';
-
// 2. sklop - uvoz iz besedila
echo '<div class="fieldset anketa_from_text">';
// Naslov
- echo '<div class="title">' . $lang['srv_newSurvey_survey_from_text_title'] . ' '.Help::display('srv_create_survey_from_text').'</div>';
- echo '<div class="from_text_instructions">' . $lang['srv_newSurvey_survey_from_text_text'] . '</div>';
+ echo '<div class="title">' . $lang['srv_newSurvey_survey_from_text_title'] . ' '.Help::display('srv_create_survey_from_text', "title").'</div>';
+ echo '<p>' . $lang['srv_newSurvey_survey_from_text_text1'] . '</p>';
+ echo '<p>' . $lang['srv_newSurvey_survey_from_text_text2'] . '</p>';
+ echo '<p class="bottom32">' . $lang['srv_newSurvey_survey_from_text_text3'] . '</p>';
+
+ echo '<div class="from_text_sidebyside_holder">';
// Input okno za text
echo '<div id="input_field_holder"><div id="input_field">';
@@ -656,19 +678,20 @@ class NewSurvey{
// Preview okno
echo '<div id="preview_field_holder"><div id="preview_field">';
- echo '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
+ echo '<span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
echo '</div></div>';
- echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
// Gumba naprej in preklici
- echo '<div class="noSurvey_buttons">';
-
- echo '<a href="' . $site_url . 'admin/survey/index.php" title="' . $lang['srv_cancel'] . '"><span id="noSurvey_cancel">' . $lang['srv_cancel'] . '</span></a>';
- echo '<a href="#" onclick="newAnketaFromText();" title="' . $lang['srv_create_survey'] . '"><span id="noSurvey_create">' . $lang['next1'] . '</span></a>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location=\''.$site_url . 'admin/survey/index.php\';return false;" id="noSurvey_cancel">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="newAnketaFromText();" id="noSurvey_create">'.$lang['next1'].'</button>';
+ echo '</div>';
}
@@ -680,113 +703,158 @@ class NewSurvey{
global $lang;
global $site_url;
global $site_path;
+ global $global_user_id;
echo '<div class="noSurvey_sequence">';
- // Video
- if ($_GET['b'] == 'video') {
+
+ // Prva stran
- echo '<div class="main_holder video">';
+ echo '<div class="main_holder main">';
+ echo '<div id="no_survey">';
- echo '<span class="title">' . $lang['noSurvey_sequence_title'] . '</span>';
+ $sql = sisplet_query("SELECT * FROM users WHERE id='$global_user_id'");
+ $row = mysqli_fetch_array($sql);
- echo '<p style="text-align:center;"><iframe width="700" height="500" style="border:1px #8a9fbf solid;" src="//www.youtube.com/embed/1OeaQErrPrc" frameborder="0" allowfullscreen></iframe></p>';
-
- echo '</div>';
- }
- // Spisek funkcionalnosti
- elseif ($_GET['b'] == 'features') {
-
- echo '<div class="main_holder features">';
-
- echo '<span class="title">' . $lang['noSurvey_sequence_title'] . '</span>';
-
- echo $lang['noSurvey_sequence_features'];
-
- echo '<h2>' . $lang['noSurvey_sequence_features_h1'] . '</h2>';
- echo '<ul class="features">';
- echo '<li>' . $lang['noSurvey_sequence_features_li1'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li2'] . '</li>';
- echo '</ul>';
-
- echo '<h2>' . $lang['noSurvey_sequence_features_h2'] . '</h2>';
- echo '<ul class="features">';
- echo '<li>' . $lang['noSurvey_sequence_features_li3'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li4'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li5'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li6'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li7'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li8'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li9'] . '</li>';
- echo '</ul>';
-
- echo '<h2>' . $lang['noSurvey_sequence_features_h3'] . '</h2>';
- echo '<ul class="features">';
- echo '<li>' . $lang['noSurvey_sequence_features_li10'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li11'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li12'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li13'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li14'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li15'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li16'] . '</li>';
- echo '<li>' . $lang['noSurvey_sequence_features_li17'] . '</li>';
- echo '</ul>';
+ $text = $row['name'] . ' ' . $row['surname'];
+ $text = (strlen($text) > 25) ? substr($text, 0, 25) . '...' : $text;
+ $text = trim($text);
+ echo '<div class="no_survey_title">';
+ echo '<img src="/public/img/images/hand_icon.svg" />';
+ echo $lang['noSurvey_sequence_1'] . $text .'!';
echo '</div>';
- }
- // Prva stran
- else {
- echo '<div class="main_holder main">';
-
- // Leva stran
- echo '<div class="left_holder">';
- echo '<span class="title">' . $lang['noSurvey_sequence_title'] . '</span>';
- echo $lang['noSurvey_sequence_main'];
- echo '</div>';
+ // Video
+ if (isset($_GET['b']) && $_GET['b'] == 'video') {
- // Desna stran
- echo '<div class="right_holder">';
- echo '<img src="/public/img/images/first_survey.jpg">';
- echo '</div>';
+ echo '<div id="no_survey_video" class="main_holder video">';
+ if($lang['id'] == '1')
+ echo ' <p style="text-align:center;"><iframe width="800" height="450" src="//www.youtube.com/embed/mDd73NSA1xI" frameborder="0" allowfullscreen></iframe></p>';
+ else
+ echo ' <p style="text-align:center;"><iframe width="800" height="450" src="//www.youtube.com/embed/vX-6qe7KtQE" frameborder="0" allowfullscreen></iframe></p>';
+ echo '</div>';
+ }
+
+ // Spisek funkcionalnosti
+ if (isset($_GET['b']) && $_GET['b'] == 'features') {
+
+ echo '<div id="no_survey_features" class="main_holder features">';
+
+ echo '<p id="intro">'.$lang['noSurvey_sequence_features'].'</p>';
+
+ echo '<h2>' . $lang['noSurvey_sequence_features_h1'] . '</h2>';
+ echo '<ul class="features">';
+ echo '<li>' . $lang['noSurvey_sequence_features_li1'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li2'] . '</li>';
+ echo '</ul>';
+
+ echo '<h2>' . $lang['noSurvey_sequence_features_h2'] . '</h2>';
+ echo '<ul class="features">';
+ echo '<li>' . $lang['noSurvey_sequence_features_li3'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li4'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li5'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li6'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li7'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li8'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li9'] . '</li>';
+ echo '</ul>';
+
+ echo '<h2>' . $lang['noSurvey_sequence_features_h3'] . '</h2>';
+ echo '<ul class="features">';
+ echo '<li>' . $lang['noSurvey_sequence_features_li10'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li11'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li12'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li13'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li14'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li15'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li16'] . '</li>';
+ echo '<li>' . $lang['noSurvey_sequence_features_li17'] . '</li>';
+ echo '</ul>';
+ $cenik_link = ($lang['id'] == '1') ? 'https://www.1ka.si/d/sl/cenik' : 'https://www.1ka.si/d/en/services/';
+
+ echo '<p class="top16">'.$lang['noSurvey_sequence_button_cenik_text'].'<a target="_blank" href="'.$cenik_link.'">'.$lang['noSurvey_sequence_button_cenik'].'</a>.</p>';
+
+ echo '</div>';
+ }
+
+ // Ustvari anketo
+ echo '<div class="no_survey_box">';
+
+ echo '<div class="feature">';
+ echo '<div class="icon">';
+ echo '<span class="faicon fa-newspaper empty"></span>';
+ echo '</div>';
+ echo '<div class="name">';
+ echo $lang['noSurvey_sequence_button_create'];
+ echo '</div>';
echo '</div>';
- }
+ echo $lang['noSurvey_sequence_2'];
- // Gumbi na dnu
- echo '<div class="buttons_holder">';
+ $anketa_url = "'".$site_url.'/admin/survey/index.php?b=new_survey'."'";
- // Gumb ustvari anketo
- echo '<a href="'.$site_url.'/admin/survey/index.php?b=new_survey">';
- echo ' <div class="button">'.$lang['noSurvey_sequence_button_create'].'</div>';
- echo '</a>';
-
- // Gumb videovodic
- if($_GET['b'] != 'video'){
- echo '<a href="'.$site_url.'/admin/survey/index.php?b=video">';
- echo ' <div class="button button_gray">'.$lang['noSurvey_sequence_button_video'].'</div>';
- echo '</a>';
- }
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="window.location='.$anketa_url.';return false;">'.$lang['noSurvey_sequence_button_create'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
- // Gumb ogled funkcionalnosti
- if($_GET['b'] != 'features'){
- echo '<a href="'.$site_url.'/admin/survey/index.php?b=features">';
- echo ' <div class="button button_gray">'.$lang['noSurvey_sequence_button_advanced'].'</div>';
- echo '</a>';
- }
- // Gumb ogled cenika
- if($_GET['b'] == 'features'){
- $cenik_link = ($lang['id'] == '1') ? 'https://www.1ka.si/d/sl/cenik' : 'https://www.1ka.si/d/en/services/';
+ // Videovodic box
+ if(!isset($_GET['b']) || $_GET['b'] != 'video'){
- echo '<a href="'.$cenik_link.'" target="_blank">';
- echo ' <div class="button button_gray">'.$lang['noSurvey_sequence_button_cenik'].'</div>';
- echo '</a>';
- }
+ echo '<div class="no_survey_box">';
+
+ echo '<div class="feature">';
+ echo '<div class="icon">';
+ echo '<span class="faicon fa-film"></span>';
+ echo '</div>';
+ echo '<div class="name">';
+ echo $lang['noSurvey_sequence_3'];
+ echo '</div>';
+ echo '</div>';
+
+ echo $lang['noSurvey_sequence_4'];
+
+ $video_url = "'".$site_url.'/admin/survey/index.php?b=video'."'";
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$video_url.';return false;">'.$lang['noSurvey_sequence_button_video'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ }
- echo '</div>';
+ // Ogled funkcionalnosti box
+ if(!isset($_GET['b']) || $_GET['b'] != 'features'){
+
+ echo '<div class="no_survey_box">';
+
+ echo '<div class="feature">';
+ echo '<div class="icon">';
+ echo '<span class="faicon fa-toolbox"></span>';
+ echo '</div>';
+ echo '<div class="name">';
+ echo $lang['noSurvey_sequence_5'];
+ echo '</div>';
+ echo '</div>';
+
+ echo $lang['noSurvey_sequence_6'];
+
+ $features_url = "'".$site_url.'/admin/survey/index.php?b=features'."'";
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$features_url.';return false;">'.$lang['noSurvey_sequence_button_advanced'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+ echo '</div>';
echo '</div>';
}
@@ -802,7 +870,7 @@ class NewSurvey{
// Ce imamo prazno
if($text == ''){
- $text = '<span class="italic">'.$lang['srv_poglejanketo2'].'</span>';
+ $text = '<span class="caps bold">'.$lang['srv_poglejanketo2'].'</span>';
}
else{
// Pobrisemo vmesne odvecne presledke
@@ -815,7 +883,7 @@ class NewSurvey{
// Wrapamo naslove (prazna vrstica spredaj)
$text = preg_replace(
'/<br \/><br \/>([^<>]+)/',
- '<br /><br /><span class="title">$1</span>',
+ '<br /><br /><span class="variable_title">$1</span>',
$text
);
// Wrapamo variable (vsaka v novi vrstici)
@@ -826,27 +894,27 @@ class NewSurvey{
);
// Dodamo se textbox ce je samo vprasanje
$text = preg_replace(
- '/(<span class="title">[^<>]+<\/span>)<br \/><br \/>/',
- '$1<br /><input type="text" /><br /><br />',
+ '/(<span class="variable_title">[^<>]+<\/span>)<br \/><br \/>/',
+ '$1<br /><input type="text" class="large" /><br /><br />',
$text
);
// Wrapamo se prvo vrstico kot naslov
$text = preg_replace(
'/([^<>]+)<br \/>/',
- '<span class="title">$1</span><br />',
+ '<span class="variable_title">$1</span><br />',
$text, 1
);
// Dodamo se textbox na zadnjo vrstico ce je potrebno
$text = preg_replace(
- '/(<span class="title">[^<>]+<\/span>)\Z/',
- '$1<br /><input type="text" />',
+ '/(<span class="variable_title">[^<>]+<\/span>)\Z/',
+ '$1<br /><input type="text" class="large" />',
$text
);
- // Dodamo se textbox na prvo vrstico ce je potrebno
+ // Dodamo se textbox na prvo vrstico, ce je potrebno
$text = preg_replace(
- '/(<span class="title">[^<>]+<\/span>)<br \/><br \/>/',
- '$1<br /><input type="text" /><br /><br />',
+ '/(<span class="variable_title">[^<>]+<\/span>)<br \/><br \/>/',
+ '$1<br /><input type="text" class="large" /><br /><br />',
$text, 1
);
}
diff --git a/admin/survey/classes/class.Notifications.php b/admin/survey/classes/class.Notifications.php
index 1a88247..3604125 100644
--- a/admin/survey/classes/class.Notifications.php
+++ b/admin/survey/classes/class.Notifications.php
@@ -18,46 +18,77 @@ class Notifications {
public function display($tab=0){
global $admin_type, $global_user_id, $lang;
-
+
// Prikazemo poslana sporocila
if((isset($_GET['t']) && $_GET['t']=='sent') || $tab == 1){
-
+
+ echo '<div class="notifications_content">';
+
// Izpis vseh poslanih sporocil
if($admin_type == 0){
- echo '<div class="sent_list">';
+ echo '<div class="notifications_content_left">';
+
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon inv_sent_1"></span></div>';
+ echo '<h2>'.$lang['srv_notifications_sent'].'</h2>';
+ echo '</div>';
+
$this->displaySentMessages();
echo '</div>';
// obrazec za posiljanje sporocil
+ echo '<div class="notifications_content_right">';
+
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon inv_sent_0"></span></div>';
+ echo '<h2>'.$lang['srv_inv_message_draft_new'].'</h2>';
+ echo '</div>';
+
$this->sendMessageForm();
+ echo '</div>';
+
}
else
- echo $lang['srv_notifications_admin_alert'];
+ echo $lang['srv_notifications_admin_alert'];
+
+ echo '</div>';
}
// Prikazemo prejeta sporocila
else{
+
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon fa-inbox"></span></div>';
+ echo '<h2>'.$lang['srv_notifications_recieved'].'</h2>';
+ echo '</div>';
+
+ echo '<div class="notifications_content">';
+
+ echo '<div class="notifications_content_left">';
echo '<div class="recieved_list">';
$this->displayRecievedMessages();
echo '</div>';
+ echo '</div>';
+ echo '<div class="notifications_content_right">';
echo '<div id="message" style="display:none;"></div>';
+ echo '</div>';
+
+
+ echo '</div>';
+
}
-
- echo '<div class="clr"></div>';
}
private function displayRecievedMessages($active=0){
global $admin_type, $global_user_id, $lang;
- echo '<span class="bold">'.$lang['srv_notifications_recieved'].':</span>';
-
// Napolnimo array prejetih sporocil
$recievedMessages = array();
- $sql = sisplet_query("SELECT n.id AS id, n.recipient AS recipient, n.viewed AS viewed, m.id AS message_id, m.date AS date, m.title AS title, m.text AS text
+ $sql = sisplet_query("SELECT n.id AS id, n.recipient AS recipient, n.viewed AS viewed, m.id AS message_id, m.send_time AS send_time, m.title AS title, m.text AS text
FROM srv_notifications n, srv_notifications_messages m
WHERE n.recipient='".$global_user_id."' AND n.message_id=m.id
- ORDER BY m.date DESC");
+ ORDER BY m.send_time DESC");
while($row = mysqli_fetch_array($sql)){
$recievedMessages[$row['id']] = $row;
}
@@ -67,16 +98,25 @@ class Notifications {
if(count($recievedMessages) > 0){
foreach($recievedMessages as $message){
- echo '<a href="#" onclick="viewMessage(\''.$message['id'].'\'); return false;">';
- echo '<li class="'.($message['viewed'] == 0 ? ' unread':'').' '.($active > 0 && $message['id'] == $active ? ' active':'').'">';
-
- echo '<span class="bold">'.$message['title'].' <span class="italic">('.$message['date'].')</span></span>';
+ echo '<li class="'.($active > 0 && $message['id'] == $active ? ' active':'').'" onclick="viewMessage(\''.$message['id'].'\'); return false;">';
+
+ echo '<span class="faicon fa-circle '.($message['viewed'] == 0 ? ' unread':'').'"></span>';
+
+ echo '<div class="title_row">'; //sem noter pride še oznaka, če je obvestilo ali sporočilo
+ echo '<div class="subject">';
+ echo $message['title'];
+ echo '</div>';
+ echo '<div class="date">';
+ echo date('Y-m-d H:i:s', strtotime($message['send_time']));
+ echo '</div>';
+ echo '</div>';
- $text = strip_tags((strlen($message['text']) > 70) ? substr($message['text'], 0, 70).'...' : $message['text']);
- echo '<br />'.$text;
+ $text = strip_tags($message['text']);
+ echo '<div class="content">';
+ echo $text;
+ echo '</div>';
echo '</li>';
- echo '</a>';
}
}
@@ -85,43 +125,54 @@ class Notifications {
private function displaySentMessages(){
global $admin_type, $global_user_id, $lang;
-
- echo '<span class="bold">'.$lang['srv_notifications_sent'].':</span>';
-
+
// Napolnimo array poslanih sporocil
$sentMessages = array();
- $sql = sisplet_query("SELECT * FROM srv_notifications_messages WHERE author='".$global_user_id."' ORDER BY date DESC");
+ $sql = sisplet_query("SELECT * FROM srv_notifications_messages WHERE author='".$global_user_id."' ORDER BY send_time DESC");
while($row = mysqli_fetch_array($sql)){
$sentMessages[$row['id']] = $row;
}
-
- echo '<ul>';
-
if(count($sentMessages) > 0){
+
+ echo '<div class="sent_list">';
+ echo '<ul>';
+
foreach($sentMessages as $message_id => $message){
- //echo '<li '.($message['viewed'] == 0 ? ' class="unread"':'').'>';
echo '<li>';
+
+ echo '<div class="title_row">'; //sem noter pride še oznaka, če je obvestilo ali sporočilo
+ echo '<div class="subject">';
+ echo $message['title'];
+ echo '</div>';
+ echo '<div class="date">';
+ echo date('Y-m-d H:i:s', strtotime($message['send_time']));
+ echo '</div>';
+ echo '</div>';
- echo '<span class="bold">'.$message['title'].' <span class="italic">('.$message['date'].')</span></span>';
-
- $text = strip_tags((strlen($message['text']) > 70) ? substr($message['text'], 0, 70).'...' : $message['text']);
- echo '<br />'.$text;
+ $text = strip_tags($message['text']);
+ echo '<div class="content">';
+ echo $text;
+ echo '</div>';
// Gumb da se sporocilo razresi vsem (kot da so ga pregledali)
$sqlN = sisplet_query("SELECT message_id FROM srv_notifications WHERE message_id='".$message_id."' AND viewed='0'");
$count = mysqli_num_rows($sqlN);
if($count > 0){
- echo '<br />';
- echo '<a href="#" onclick="resolveMessages(\''.$message_id.'\'); return false;"><span class="link">'.$lang['srv_notifications_sent_resolve'].' ('.$count.')'.'</span></a>';
+ echo '<div class="resolve" onclick="resolveMessages(\''.$message_id.'\'); return false;">';
+ echo '<span class="faicon fa-check"></span>';
+ echo $lang['srv_notifications_sent_resolve'].' ('.$count.')';
+ echo '</div>';
}
echo '</li>';
- }
+ }
+ echo '</ul>';
+ echo '</div>';
}
-
- echo '</ul>';
+ else //Ni poslanih sporočil
+ echo '<p>'.$lang['srv_notifications_sent_none'].'.</p>';
}
// Obrazec za posiljanje sporocila
@@ -129,28 +180,59 @@ class Notifications {
global $admin_type, $global_user_id, $lang;
echo '<div class="send_form">';
- echo '<span class="clr bold">'.$lang['srv_notifications_send_reciever'].': </span><input type="text" name="recipient" id="recipient">';
-
- // Checkboxa za posiljenje vsem uporabnikoom (slo in ang)
- echo '<div style="padding-top:5px;"><input type="checkbox" value="1" name="recipient_all_slo" id="recipient_all_slo" onClick="recipient_all_disable_email();"> <label for="recipient_all_slo"><span class="clr bold">'.$lang['srv_notifications_send_all_slo'].'</span></label></div>';
- echo '<div style="padding-top:5px;"><input type="checkbox" value="1" name="recipient_all_ang" id="recipient_all_ang" onClick="recipient_all_disable_email();"> <label for="recipient_all_ang"><span class="clr bold">'.$lang['srv_notifications_send_all_ang'].'</span></label></div><br />';
-
- echo '<span class="clr bold">'.$lang['srv_notifications_send_title'].': </span><input type="text" name="title"><br /><br />';
- echo '<span class="clr bold">'.$lang['srv_notifications_send_text'].': </span><textarea name="notification"></textarea><br />';
+
+ //Prejemniki
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_notifications_send_reciever2'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" name="recipient_all_slo" id="recipient_all_slo" onChange="recipient_toggle(\'slo\');">';
+ echo '<label for="recipient_all_slo">'.$lang['srv_notifications_send_all_slo'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" name="recipient_all_ang" id="recipient_all_ang" onChange="recipient_toggle(\'ang\');">';
+ echo '<label for="recipient_all_ang">'.$lang['srv_notifications_send_all_ang'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" name="recipient_custom" id="recipient_custom" onChange="recipient_toggle(\'custom\');">';
+ echo '<label for="recipient_custom">'.$lang['srv_notifications_send_custom'].'</label>';
+ echo '<input type="text" class="text large disabled" name="recipient" id="recipient">';
+ echo '</div>';
+
+ echo '</div>';
+
+ // Naslov sporocila
+ echo '<div class="setting_holder">';
+ echo $lang['srv_notifications_send_title'].':';
+ echo '<input type="text" class="text large" name="title">';
+ echo '</div>';
+
+ // Besedilo sporocila (editor)
+ echo $lang['srv_notifications_send_text'].':';
+ echo '<div class="label">';
+ echo '<textarea id="notification" name="notification" autocomplete="off"></textarea>';
+ echo '</div>';
// Avtomatsko prikaži obvestilo po prijavi
- echo '<div style="padding-top:5px;"><input type="checkbox" value="1" name="force_show" id="force_show"> <label for="force_show"><span class="clr bold">'.$lang['srv_notifications_force_show'].'</span></label></div><br />';
-
- echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="sendNotification(); return false;">';
- echo '<span>'.$lang['srv_notifications_send'].'</span>';
- echo '</a></span>';
-
+ echo '<div class="auto_checkbox">';
+ echo '<input type="checkbox" value="1" name="force_show" id="force_show">';
+ echo '<label for="force_show">'.$lang['srv_notifications_force_show'].'</label>';
+ echo '</div>';
+
+ //Error notes
if($note != ''){
- echo '<br /><br />';
- echo '<span class="bold red">'.$note.'</span>';
+ echo '<p class="top16">'.$note.'</p>';
}
+
+ // Gumb pošlji
+ echo '<div class="button_holder '.($note != '' ? 'top16' : '').'">';
+ echo '<button class="medium blue" onclick="sendNotification(); return false;">'.$lang['srv_notifications_send'].'</button>';
+ echo '</div>';
echo '</div>';
+
+ // Inicializiramo editor
+ echo '<script type="text/javascript">create_editor_notification(\'notification\');</script>';
}
@@ -245,7 +327,7 @@ class Notifications {
if($recipient_all_slo == 1 || $recipient_all_ang == 1){
// Dodamo novo sporocilo v bazo
- $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, date, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
+ $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, send_time, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
$message_id = mysqli_insert_id($GLOBALS['connect_db']);
$note = '';
@@ -261,7 +343,7 @@ class Notifications {
$sql = sisplet_query("INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES ('".$message_id."', '".$rowU['id']."', '0')");
if(!$sql)
- $note .= mysqli_error($GLOBALS['connect_db']).'<br />';
+ $note .= '<span class="red">'.mysqli_error($GLOBALS['connect_db']).'</span>';
}
}
// Posiljamo na specificen mail
@@ -272,30 +354,46 @@ class Notifications {
$rowU = mysqli_fetch_array($sqlU);
// Dodamo novo sporocilo v bazo
- $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, date, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
+ $sql = sisplet_query("INSERT INTO srv_notifications_messages (author, send_time, title, text, force_show) VALUES ('".$global_user_id."', NOW(), '".$title."', '".$notification."', '".$force_show."')");
$message_id = mysqli_insert_id($GLOBALS['connect_db']);
// Dodamo novo sporocilo v bazo
$sql = sisplet_query("INSERT INTO srv_notifications (message_id, recipient, viewed) VALUES ('".$message_id."', '".$rowU['id']."', '0')");
if(!$sql)
- $note = mysqli_error($GLOBALS['connect_db']);
+ $note = '<span class="red">'.mysqli_error($GLOBALS['connect_db']).'</span>';
else
- $note = 'Sporočilo je bilo uspešno poslano uporabniku '.$recipient.' ('.$rowU['name'].' '.$rowU['surname'].').';
+ $note = '<span class="faicon success blue link-right"></span>'.$lang['srv_notifications_sent_success'].' '.$recipient.' ('.$rowU['name'].' '.$rowU['surname'].').';
}
else{
- $note = 'Vnešeni email ('.$recipient.') ne pripada nobenemu uporabniku!';
+ $note = '<span class="red">'.$lang['srv_notifications_sent_nouser1'].$recipient.$lang['srv_notifications_sent_nouser1'].'</span>';
}
}
+ echo '<div class="notifications_content">';
+
// Refresh vseh poslanih sporocil
- echo '<div class="sent_list">';
+ echo '<div class="notifications_content_left">';
+
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon inv_sent_1"></span></div>';
+ echo '<h2>'.$lang['srv_notifications_sent'].'</h2>';
+ echo '</div>';
+
$this->displaySentMessages();
echo '</div>';
// Refresh obrazca za posiljanje sporocil
+ echo '<div class="notifications_content_right">';
+
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon inv_sent_0"></span></div>';
+ echo '<h2>'.$lang['srv_inv_message_draft_new'].'</h2>';
+ echo '</div>';
+
$this->sendMessageForm($note);
-
- echo '<div class="clr"></div>';
+ echo '</div>';
+
+ echo '</div>';
}
public function ajax_resolveMessages(){
@@ -320,57 +418,80 @@ class Notifications {
$sql = sisplet_query("UPDATE srv_notifications SET viewed='1' WHERE id='$id'");
// Dobimo sporocilo
- $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.date AS date
+ $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.send_time AS send_time
FROM srv_notifications n, srv_notifications_messages m
WHERE n.id='$id' AND m.id=n.message_id");
$row = mysqli_fetch_array($sql);
// Refresh vseh prejetih sporocil
+ echo '<div class="title">';
+ echo '<div class="title_icon"><span class="faicon fa-inbox"></span></div>';
+ echo '<h2>'.$lang['srv_notifications_recieved'].'</h2>';
+ echo '</div>';
+
+ echo '<div class="notifications_content">';
+
+ echo '<div class="notifications_content_left">';
echo '<div class="recieved_list">';
$this->displayRecievedMessages($active=$id);
echo '</div>';
-
+ echo '</div>';
+
// Prikaz izbranega sporocila
+ echo '<div class="notifications_content_right">';
echo '<div id="message">';
- echo '<span class="bold">'.$row['title'].' <span class="italic">('.$row['date'].')</span></span>';
- echo '<p>'.nl2br($row['text']).'</p>';
+
+ echo '<div class="subject">';
+ echo $row['title'];
+ echo '</div>';
+
+ echo '<div class="date">';
+ echo '('.date('Y-m-d H:i:s', strtotime($row['send_time'])).')';
+ echo '</div>';
+
+ // Stara sporocila so brez editorja
+ $text = (strtotime($row['send_time']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
+ echo '<div class="content">';
+ echo $text;
+ echo '</div>';
+
echo '</div>';
echo '<div class="clr"></div>';
+
+ echo '</div>'; //div.notifications_content
}
- public function ajax_viewUnreadMessages(){
+ public function ajax_viewUnreadMessages($active=0){
global $lang, $global_user_id;
- echo '<h2>'.$lang['srv_notifications_unread'].'</h2>';
+ echo '<h2><span class="faicon envelope-open"></span>'.$lang['srv_notifications_unread'].'</h2>';
- echo '<ul>';
+ echo '<div class="unread_notifications_holder">';
// Loop cez vsa neprebrana sporocila
- $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.date AS date, n.viewed AS viewed
+ $sql = sisplet_query("SELECT n.id AS id, m.title AS title, m.text AS text, m.send_time AS send_time, n.viewed AS viewed
FROM srv_notifications n, srv_notifications_messages m
- WHERE n.recipient='".$global_user_id."' AND n.viewed='0' AND m.id=n.message_id
- ORDER BY m.date DESC");
+ WHERE n.recipient='".$global_user_id."' AND n.viewed='0' AND m.id=n.message_id
+ ORDER BY m.send_time DESC");
while($row = mysqli_fetch_array($sql)){
- echo '<li class="'.($row['viewed'] == 0 ? ' unread':'').' '.($active > 0 && $row['id'] == $active ? ' active':'').'">';
+ echo '<div class="unread_notification '.($row['viewed'] == 0 ? ' unread':'').' '.($active > 0 && $row['id'] == $active ? ' active':'').'">';
- echo '<span class="bold">'.$row['title'].' <span class="italic">('.$row['date'].')</span></span>';
+ echo '<span class="bold">'.$row['title'].' <span class="italic">('.date('Y-m-d H:i:s', strtotime($row['send_time'])).')</span></span>';
- echo '<br />'.nl2br($row['text']);
+ // Stara sporocila so brez editorja
+ $text = (strtotime($row['send_time']) < strtotime('2021-08-26')) ? nl2br($row['text']) : $row['text'];
+ echo '<br />'.$text;
- echo '</li>';
+ echo '</div>';
}
- echo '</ul>';
+ echo '</div>';
// Gumb za zapiranje
- echo '<div class="buttons_holder">';
- echo '<div class="buttonwrapper" title="'.$lang['srv_zapri'].'">';
- echo '<a class="ovalbutton ovalbutton" onclick="closeUnreadMessages(); return false;" href="#">';
- echo '<span>'.$lang['srv_zapri'].'</span>';
- echo '</a>';
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onclick="closeUnreadMessages(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
@@ -379,28 +500,25 @@ class Notifications {
}
public function ajax_viewGDPRMessage(){
- global $lang, $global_user_id, $aai_instalacija;
-
- echo '<h2>'.$lang['srv_notifications_unread'].'</h2>';
+ global $lang, $global_user_id;
- echo '<ul>';
- echo '<li class="unread active">';
+ echo '<h2><span class="faicon envelope-open"></span>'.$lang['srv_notifications_unread'].'</h2>';
- if(isset($aai_instalacija) && $aai_instalacija == true){
+ /* if(isAAI()){
echo '<span class="bold">'.$lang['srv_gdpr_notification_title_aai'].'</span>';
}
else{
echo '<span class="bold">'.$lang['srv_gdpr_notification_title'].'</span>';
}
- echo '<br /><br />';
+ echo '<br /><br />'; */
echo $lang['srv_gdpr_notification_text1'];
echo '<br /><br />';
echo $lang['srv_gdpr_notification_question'];
- echo '<br />';
+ echo '<br /><br />';
echo '<div class="spaceLeft gdpr_popup_radio"><input type="radio" name="gdpr_agree" id="gdpr_agree_1" value="1" onClick="enableGDPRPopupButton();"> <label for="gdpr_agree_1">'.$lang['srv_gdpr_notification_da'].'</label></div>';
//echo ' <a href="#" onClick="toggleGDPRMore();"><span class="bold">'.$lang['srv_invitation_nonActivated_more'].'</span></a>';
echo '<div class="spaceLeft gdpr_popup_radio"><input type="radio" name="gdpr_agree" id="gdpr_agree_0" value="0" onClick="enableGDPRPopupButton();"> <label for="gdpr_agree_0">'.$lang['srv_gdpr_notification_ne'].'</label></div>';
@@ -409,21 +527,13 @@ class Notifications {
echo '<br />';
- echo $lang['srv_gdpr_notification_pogoji'];
-
- echo '</li>';
- echo '</ul>';
+ echo $lang['srv_gdpr_notification_unsubscribe'];
// Gumb za zapiranje
- //echo '<div class="floatRight spaceRight" id="GDPR_popup_button">';
- echo '<div class="floatRight spaceRight" id="GDPR_popup_button" style="visibility: hidden;">';
- echo '<div class="buttonwrapper" title="'.$lang['save'].'">';
- echo '<a class="ovalbutton ovalbutton" onclick="saveGDPRMessage();" href="#">';
- echo '<span>'.$lang['save'].'</span>';
- echo '</a>';
- echo '</div>';
- echo '</div>';
+ echo '<div class="button_holder" id="GDPR_popup_button" style="visibility: hidden;">';
+ echo '<button class="medium blue" onclick="saveGDPRMessage(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
}
public function ajax_saveGDPRAgree(){
diff --git a/admin/survey/classes/class.Prevajanje.php b/admin/survey/classes/class.Prevajanje.php
index 7b0ac67..6c1e8ab 100644
--- a/admin/survey/classes/class.Prevajanje.php
+++ b/admin/survey/classes/class.Prevajanje.php
@@ -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();
@@ -114,8 +113,12 @@ class Prevajanje {
// default je pač prvi jezik v seznamu...
if ($this->lang_id==0) {
$lang_array = $this->get_all_translation_langs();
+
if (count($lang_array) > 0) {
- list($this->lang_id) = each($lang_array);
+
+ //list($this->lang_id) = each($lang_array);
+ reset($lang_array);
+ $this->lang_id = key($lang_array);
// redirectamo, da je nastavljen tudi v urlju
header("Location: index.php?anketa=".$this->anketa."&a=prevajanje&lang_id=".$this->lang_id);
@@ -132,22 +135,27 @@ class Prevajanje {
}
+ echo '<div class="prevajanje_holder">';
+
+
+ // Segment z zgornjimi nastavitvami
+ echo '<div class="section jezik_top_settings">';
$this->top_settings();
+ echo '</div>';
+
$sql = sisplet_query("SELECT * FROM srv_language WHERE ank_id = '$this->anketa'");
- if (mysqli_num_rows($sql) == 0) {
-
+ if (mysqli_num_rows($sql) == 0) {
//$this->dodaj_jezik(1);
-
- } else {
+ }
+ elseif ($rowa['multilang'] == 1) {
- if ($rowa['multilang'] == 1) {
-
- $this->urejanje();
-
- ?><script> var srv_meta_lang_id = <?=$this->lang_id?>; </script><?
- }
+ $this->urejanje();
+
+ ?><script> var srv_meta_lang_id = <?=$this->lang_id?>; </script><?
}
+
+ echo '</div>';
}
/**
@@ -167,6 +175,7 @@ class Prevajanje {
$lang_admin = $row['lang_admin'];
$lang_resp = $row['lang_resp'];
$lang_array = array();
+
// Preberemo razpoložljive jezikovne datoteke
if ($dir = opendir($site_path . 'lang')) {
while (($file = readdir($dir)) !== false) {
@@ -190,11 +199,10 @@ class Prevajanje {
}
- /**
- * Leva stran nastavitev
- */
-
- echo '<fieldset class="wide prevajanje" style="position:relative">';
+ echo '<div class="jezik_row">';
+
+ // Leva stran nastavitev
+ echo '<fieldset class="jezik_left settings">';
if ($this->user_dostop_edit == 1) {
@@ -208,42 +216,61 @@ class Prevajanje {
asort($lang_array);
-
- echo '<p><span class="nastavitveSpan1">'.$lang['srv_language_respons_1'].': </span><select name="lang_resp" onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_language_respons_1'].':</span>';
+ echo '<select class="dropdown large" name="lang_resp" onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;">';
foreach ($lang_array AS $key => $val) {
echo '<option value="'.$key.'" '.($key==$lang_resp?' selected':'').'>'.$val.'</option>';
}
- echo '</select> <a href="index.php?anketa='.$this->anketa.'&a=jezik">'.$lang['srv_extra_translations'].'</a></p>' . "\n\r";
+ echo '</select>';
+ echo '</div>';
$resp_change_lang = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang');
+ $resp_change_lang = ($resp_change_lang == '') ? 0 : $resp_change_lang;
if ($this->lang_id != 0) {
-
- echo '<p><span class="nastavitveSpan1"><label for="">'.$lang['srv_resp_change_lang'].':</label> </span>
- <label for="resp_change_lang_0"><input type="radio" name="resp_change_lang" id="resp_change_lang_0" value="0" '.($resp_change_lang==0?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />'.$lang['no'].'</label>
- <label for="resp_change_lang_1"><input type="radio" name="resp_change_lang" id="resp_change_lang_1" value="1" '.($resp_change_lang==1?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />'.$lang['yes'].'</label></p>';
-
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_resp_change_lang'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="resp_change_lang" id="resp_change_lang_0" value="0" '.($resp_change_lang==0?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />';
+ echo '<label for="resp_change_lang_0">'.$lang['no'].'</label> ';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="resp_change_lang" id="resp_change_lang_1" value="1" '.($resp_change_lang==1?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />';
+ echo '<label for="resp_change_lang_1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
if($resp_change_lang==1){
- $resp_change_lang_type = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang_type');
-
- echo '<p>';
+ $resp_change_lang_type = SurveySetting::getInstance()->getSurveyMiscSetting('resp_change_lang_type');
+ $resp_change_lang_type = ($resp_change_lang_type == '') ? 0 : $resp_change_lang_type;
- echo '<span class="nastavitveSpan1"><label for="">'.$lang['srv_resp_change_lang_type'].':</label> </span>
- <label for="resp_change_lang_type_0"><input type="radio" name="resp_change_lang_type" id="resp_change_lang_type_0" value="0" '.($resp_change_lang_type==0?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />'.$lang['srv_resp_change_lang_type_0'].'</label>
- <label for="resp_change_lang_type_1"><input type="radio" name="resp_change_lang_type" id="resp_change_lang_type_1" value="1" '.($resp_change_lang_type==1?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />'.$lang['srv_resp_change_lang_type_1'].'</label>';
-
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_resp_change_lang_type'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="resp_change_lang_type" id="resp_change_lang_type_0" value="0" '.($resp_change_lang_type==0?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />';
+ echo '<label for="resp_change_lang_type_0">'.$lang['srv_resp_change_lang_type_0'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="resp_change_lang_type" id="resp_change_lang_type_1" value="1" '.($resp_change_lang_type==1?' checked':'').' onchange="document.settingsanketa_' . $row['id'] . '.submit(); return false;" />';
+ echo '<label for="resp_change_lang_type_1">'.$lang['srv_resp_change_lang_type_1'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
}
- }
+ }
else {
- echo '<a href="index.php?anketa='.$this->anketa.'" style="position:absolute; top:0px; right:10px">'.$lang['srv_back_edit'].'</a>';
+ //echo '<a href="index.php?anketa='.$this->anketa.'" style="position:absolute; top:0px; right:10px">'.$lang['srv_back_edit'].'</a>';
}
+
+ //Standardne besede
+ echo '<p class="top16">'.$lang['srv_language_std_bes1'].'<a href="index.php?anketa='.$this->anketa.'&a=jezik">'.$lang['srv_language_std_bes2'].'</a>.</p>';
- // Jezik administrativnega vmesnika
- echo '<div style="position:absolute; right:20px; bottom:10px;"><span class="bold">';
- //printf ($lang['srv_language_admin_survey2'], 'index.php?anketa='.$this->anketa.'&a=nastavitve');
- echo '<a href="index.php?anketa='.$this->anketa.'&a=nastavitve">'.$lang['srv_language_admin_survey'].'</a>';
- echo '</span></div>';
echo '</form>';
}
@@ -251,36 +278,48 @@ class Prevajanje {
echo '</fieldset>';
- /**
- * Desna stran
- */
- echo '<fieldset class="wide prevajanje" style="position:relative; float:right;"><legend>'.$lang['srv_multilang'].'</legend>';
+ // Desna stran
+ echo '<fieldset class="jezik_right"><legend>'.$lang['srv_multilang'].'</legend>';
if ($this->lang_id != 0) {
$lang_array = $this->get_all_translation_langs();
foreach ($lang_array AS $key => $l) {
+
+ $bold = '';
+ $display = 'displayNone';
+ $active_urejanje = '';
+
+ if ($this->lang_id == $key) {
+ $bold = 'semi-bold';
+ $display = '';
+ $active_urejanje = '<div class="active_urejanje">'.$lang['edit2'].'</div>';
+ }
+
echo '<p>';
-
- echo '<a href="index.php?anketa='.$this->anketa.'&a=prevajanje&lang_id='.$key.'" style="font-size: 1.2em; display:inline-block; min-width: 150px; '.($this->lang_id==$key?' font-weight:bold':'').'">'.$l.'</a> ';
-
- echo '<span class="prevajanje_settings '.($key!=$this->lang_id?'transparent':'').'">';
-
- echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].': '.$lang['srv_preview_text'].'"><span class="faicon preview large"></span> '.$lang['srv_poglejanketo2'].'</a>&nbsp;&nbsp;-&nbsp;&nbsp;';
- echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'&preview=on&testdata=on" target="_blank" title="'.$lang['srv_survey_testdata2'].': '.$lang['srv_testdata_text'].'"><span class="faicon edit_square large"></span> '.$lang['srv_test'].'</a>&nbsp;&nbsp;-&nbsp;&nbsp;';
- echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'" target="_blank" title="'.$lang['url'].': '.SurveyInfo::getSurveyLink().'?language='.$key.'"><span class="faicon data_link_small large"></span> '.$lang['url'].'</a>&nbsp;&nbsp;-&nbsp;&nbsp;';
- // Pdf in rtf izvoz vprasalnika v tujem jeziku
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_pdf&anketa='.$this->anketa.'&type=1&language='.$key).'" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf large"></span> '.$lang['srv_export_hover_pdf'].'</a>&nbsp;&nbsp;-&nbsp;&nbsp;';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_rtf&anketa='.$this->anketa.'&type=1&language='.$key).'" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf large"></span> '.$lang['srv_export_hover_rtf'].'</a>';
-
+ echo '<div class="lang_name '.$bold.'">';
+ echo '<a href="index.php?anketa='.$this->anketa.'&a=prevajanje&lang_id='.$key.'">'.$l.'</a> ';
+ echo $active_urejanje;
+ echo '</div>';
+
+ echo '<div class="lang_content '.$display.'">';
+
+ echo '<div class="lang_column">';
+ echo '<div class="lang_item">';
+ echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'" target="_blank" title="'.$lang['url'].': '.SurveyInfo::getSurveyLink().'?language='.$key.'"><span class="faicon data_link"></span>'.$lang['srv_multilang_link'].'</a>';
+ echo '</div>';
+ echo '<div class="lang_item">';
+ echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'&preview=on" target="_blank" title="'.$lang['srv_poglejanketo'].': '.$lang['srv_preview_text'].'"><span class="faicon monitor"></span> '.$lang['srv_poglejanketo2'].'</a>';
+ echo '</div>';
+ echo '<div class="lang_item">';
+ echo '<a href="'.SurveyInfo::getSurveyLink().'?language='.$key.'&preview=on&testdata=on" target="_blank" title="'.$lang['srv_survey_testdata2'].': '.$lang['srv_testdata_text'].'"><span class="faicon edit_square"></span> '.$lang['srv_survey_testdata'].'</a>';
+ echo '</div>';
+ echo '</div>';
+
$d = new Dostop();
if ($d->checkDostopSub('edit')) {
-
- echo '<span class="prevajanje_settings_sub">';
-
- echo '<a href="index.php?anketa='.$this->anketa.'&a=jezik&lang_id='.$key.'"><span class="faicon compress"></span> '.$lang['srv_extra_translations'].'</a>';
-
+
$title = '';
$sqlu = sisplet_query("SELECT uid FROM srv_dostop_language WHERE ank_id='$this->anketa' AND lang_id='$key'");
while ($rowu = mysqli_fetch_array($sqlu)) {
@@ -289,18 +328,33 @@ class Prevajanje {
if ($title != '') $title .= ', ';
$title .= $row1['name'].' '.$row1['surname'].' ('.$row1['email'].')';
}
-
- echo '&nbsp;&nbsp;-&nbsp;&nbsp;<a href="index.php?anketa='.$this->anketa.'&a=dostop" title="'.$lang['srv_passive_multilang_1'].': '.$title.'"><span class="faicon users_small"></span> '.$lang['srv_users'].'</a>';
-
- if ($this->user_dostop_edit == 1)
- echo '&nbsp;&nbsp;-&nbsp;&nbsp;<a href="ajax.php?anketa='.$this->anketa.'&t=prevajanje&a=brisi_jezik&lang_id='.$key.'" onclick="if (!confirm(\''.$lang['srv_lang_rem_confirm'].'\')) return false"><span class="faicon delete_circle icon-orange"></span> '.$lang['srv_lang_rem'].'</a></span>';
-
- echo '</span>';
+
+ echo '<div class="lang_column">';
+ echo '<div class="lang_item">';
+ echo '<a href="index.php?anketa='.$this->anketa.'&a=jezik&lang_id='.$key.'"><span class="faicon paragraph"></span> '.$lang['srv_extra_translations'].'</a>';
+ echo '</div>';
+ echo '<div class="lang_item">';
+ echo '<a href="index.php?anketa='.$this->anketa.'&a=dostop" title="'.$lang['srv_passive_multilang_1'].': '.$title.'"><span class="faicon users"></span> '.$lang['srv_multilang_users'].'</a>';
+ echo '</div>';
+ echo '</div>';
}
-
- echo '</span>';
-
- echo '</p>';
+
+ echo '<div class="lang_column">';
+ echo '<div class="lang_item">';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_pdf&anketa='.$this->anketa.'&type=1&language='.$key).'" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span> '.$lang['srv_lang_pdf'].'</a>';
+ echo '</div>';
+ echo '<div class="lang_item">';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=vprasalnik_rtf&anketa='.$this->anketa.'&type=1&language='.$key).'" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span> '.$lang['srv_lang_rtf'].'</a>';
+ echo '</div>';
+ if ($this->user_dostop_edit == 1) {
+ echo '<div class="lang_item">';
+ echo '<a href="ajax.php?anketa='.$this->anketa.'&t=prevajanje&a=brisi_jezik&lang_id='.$key.'" onclick="if (!confirm(\''.$lang['srv_lang_rem_confirm'].'\')) return false"><span class="faicon trash empty"></span> '.$lang['srv_lang_rem'].'</a></span>';
+ echo '</div>';
+ }
+ echo '</div>';
+
+ echo '</div>';
+
}
}
@@ -308,9 +362,8 @@ class Prevajanje {
$this->dodaj_jezik();
echo '</fieldset>';
-
-
- echo '<div class="clr"></div><p></p>';
+
+ echo '</div>';
}
/**
@@ -331,19 +384,28 @@ class Prevajanje {
asort($lang_array);
- //echo '<form action="ajax.php?anketa='.$this->anketa.'&t=prevajanje&a=dodaj_jezik" method="post" name="dodaj_jezik" style="position:absolute; right:10px; top:0">';
echo '<form action="ajax.php?anketa='.$this->anketa.'&t=prevajanje&a=dodaj_jezik" method="post" name="dodaj_jezik" >';
- echo '<p><span class="bold">'.$lang['srv_prevajanje_dodaj'].': </span> ';
- echo '<select name="lang_id">';
+
+ echo '<div class="dodaj_prevod">';
+ echo '<div class="button_holder">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_prevajanje_dodaj'].':</span>';
+
+ echo '<select class="dropdown large" name="lang_id">';
echo '<option value="0"></option>';
foreach ($lang_array AS $key => $l) {
echo '<option value="'.$key.'">'.$l.'</option>';
}
echo '</select> ';
- echo '<input type="submit" value="'.$lang['srv_add_new_language'].'" />';
+ echo '</div>';
+
+ echo '<button class="medium blue" type="submit">'.$lang['srv_add_new_language'].'</button>';
+ echo '</div>'; //button_holder
- echo '</p>';
+ echo '</div>'; //dodaj_prevod
+
echo '</form>';
}
@@ -366,49 +428,49 @@ class Prevajanje {
function urejanje () {
global $lang;
global $lang1;
-
- /*echo '<div style="float:right">';
- $this->dodaj_jezik();
- echo '</div>';*/
-
- echo '<fieldset style="margin-top:40px; min-width:1100px;" class="locked">';
-
- /**
- * Leva stran
- */
- echo '<div class="jezik_left noborder" style="opacity:1; margin-bottom:30px;">';
- echo '<span class="red" style="font-weight:bold; font-size:1.2em;">'.$lang['srv_base_lang'].': <span style="font-size:1em">'.$lang1['language'];
+
+
+ // Segment z zgornjimi nastavitvami
+ echo '<div class="section jezik_additional_settings">';
+
+ echo '<div class="jezik_row">';
+
+ // Leva stran
+ echo '<div class="jezik_left">';
+ echo '<span class="title">'.$lang['srv_base_lang'].': <span class="title semi-bold">'.$lang1['language'];
echo '</span></span>';
$d = new Dostop();
if ($d->checkDostopSub('edit'))
- echo ' - '.$lang['srv_edit_in_edit'].' <a href="index.php?anketa='.$this->anketa.'">'.$lang['srv_urejanje'].'</a>';
+ echo ' - '.$lang['srv_edit_in_edit'].' <a href="index.php?anketa='.$this->anketa.'" style="pointer-events:auto;">'.$lang['srv_social_settings_text6'].'</a>';
echo '</div>';
- /**
- * Desna stran
- */
- echo '<div class="jezik_right noborder">';
-
- echo '<span class="red" style="font-weight:bold; font-size:1.2em;">'.$lang['srv_trans_lang'].': ';
+ // Desna stran
+ echo '<div class="jezik_right">';
+ echo ' <span class="title">'.$lang['srv_trans_lang'].': ';
$lang_array = $this->get_all_translation_langs();
- echo '<span style="font-size:1em">'.$lang_array[$this->lang_id].'</span>';
-
- echo '</span>';
+ echo ' <span class="title semi-bold">'.$lang_array[$this->lang_id].'</span>';
+ echo ' </span>';
echo '</div>';
-
-
+
+ echo '</div>';
+
+ echo '</div>';
+
+
// Prevajanje imena ankete
+ echo '<div class="section jezik_texti">';
$this->urejanje_texti();
-
+ echo '</div>';
+
+
// Prevajanje vprasanj
+ echo '<div class="section jezik_vprasanja">';
$this->urejanje_vprasanja();
+ echo '</div>';
- echo '</fieldset>';
-
- echo '<div class="clr"></div>';
-
+
?><script>
prevajanje_bind_click();
</script><?
@@ -421,15 +483,28 @@ class Prevajanje {
function urejanje_texti () {
global $lang;
- echo '<div class="clr"></div>';
- echo '<div class="jezik_left noborder"><h2 class="jezik_page">'.$lang['srv_novaanketa_kratkoime'].'</h2></div>';
- echo '<div class="jezik_right noborder"><h2 class="jezik_page">'.$lang['srv_novaanketa_kratkoime'].'</h2></div>';
-
- echo '<strong>';
+ echo '<div class="jezik_row">';
+ echo ' <div class="jezik_left"><p class="caps semi-bold bottom16">'.$lang['srv_survey_info'].'</p></div>';
+ echo ' <div class="jezik_right"><p class="caps semi-bold bottom16">'.$lang['srv_survey_info'].'</p></div>';
+ echo '</div>';
+
+ echo '<div class="jezik_row">';
+ echo ' <div class="jezik_left semi-bold">'.$lang['srv_novaanketa_kratkoime'].':</div>';
+ echo ' <div class="jezik_right semi-bold">'.$lang['srv_novaanketa_kratkoime'].':</div>';
+ echo '</div>';
+
+ echo '<div class="jezik_row">';
$this->extra_translation('srv_novaanketa_kratkoime');
- echo '</strong>';
+ echo '</div>';
+
+ echo '<div class="jezik_row">';
+ echo ' <div class="jezik_left semi-bold top16">'.$lang['note'].' ('.$lang['srv_internal'].'):</div>';
+ echo ' <div class="jezik_right semi-bold top16">'.$lang['note'].' ('.$lang['srv_internal'].'):</div>';
+ echo '</div>';
+ echo '<div class="jezik_row">';
$this->extra_translation('srv_anketa_opomba');
+ echo '</div>';
}
/**
@@ -442,7 +517,7 @@ class Prevajanje {
global $lang2;
$row = SurveyInfo::getInstance()->getSurveyRow();
-
+
if ($text == 'srv_novaanketa_kratkoime') { // akronim pri default jeziku je pac v srv_anketa
$value = (($row['akronim'] == null || $row['akronim'] == '') ? $row['naslov'] : $row['akronim'] );
} elseif ($text == 'srv_question_comment_text') { // "Vaš komentar k vprašanju" ni v lang, ampak je v settingsih
@@ -454,8 +529,8 @@ class Prevajanje {
if ($value == '') $value = $lang1[$text];
}
- echo '<div class="jezik_left">';
- echo '<p style="margin-left:10px">'.$value.'</p>';
+ echo '<div class="jezik_left vert_middle">';
+ echo '<span>'.$value.'</span>';
echo '</div>';
echo '<div class="jezik_right srvlang" id="srvlang_'.$text.'">';
@@ -473,15 +548,11 @@ class Prevajanje {
$value1 = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_'.$text.'_'.$this->lang_id);
if ($value1 == '' && $text != 'srv_anketa_opomba') $value1 = $def;
+
+ //if ($text == 'srv_novaanketa_kratkoime')
+ // echo $lang['srv_naslov'].': ';
- echo '<span style="margin-left: 10px; margin:10px; display:block; width:120px; float:left;">';
- if ($text == 'srv_novaanketa_kratkoime')
- echo $lang['srv_naslov'].': ';
- if ($text == 'srv_anketa_opomba')
- echo $lang['note'].' ('.$lang['srv_internal'].'): ';
- echo '</span>';
-
- echo '<p style="margin-left:10px; min-height:15px; min-width:200px; float:left; outline:1px dashed gray; cursor: text" class="editable" id="srvlang_'.$text.'_'.$this->lang_id.'" contenteditable="true" onblur="extra_translation_save(\''.$text.'\');">'.$value1.'</p>';
+ echo '<p class="editable" id="srvlang_'.$text.'_'.$this->lang_id.'" contenteditable="true" onblur="extra_translation_save(\''.$text.'\');">'.$value1.'</p>';
}
/**
@@ -492,34 +563,43 @@ class Prevajanje {
global $lang;
Cache::cache_all_srv_spremenljivka($this->anketa);
+
+ // Naslov prve strani (ime strani)
+ echo '<div class="jezik_row page">';
+ echo ' <div class="jezik_left">'.$lang['srv_intro_label'].'</div>';
+ echo ' <div class="jezik_right">'.$lang['srv_intro_label'].'</div>';
+ echo '</div>';
- echo '<div class="clr"></div>';
- echo '<div class="jezik_left noborder"><h2 class=" jezik_page">'.$lang['srv_intro_label'].'</h2></div>';
- echo '<div class="jezik_right noborder"><h2 class=" jezik_page">'.$lang['srv_intro_label'].'</h2></div>';
-
- $this->urejanje_vprasanje(-1);
+ // Urejanje texta uvoda
+ $this->urejanje_vprasanje(-1, -1);
$gru_id = 0;
- $sql = sisplet_query("SELECT s.id, g.naslov, g.id AS gru_id, g.vrstni_red FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.visible='1' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
+ $sql = sisplet_query("SELECT s.id, s.tip, g.naslov, g.id AS gru_id, g.vrstni_red FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.visible='1' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
if ($gru_id != $row['gru_id']) {
- echo '<div class="clr"></div>';
- echo '<div class="jezik_left noborder"><h2 class=" jezik_page">'.$lang['srv_stran'].' '.$row['vrstni_red'].'</h2></div>';
- echo '<div class="jezik_right noborder"><h2 class=" jezik_page">'.$lang['srv_stran'].' '.$row['vrstni_red'].'</h2></div>';
-
+
+ // Naslov vmesne strani (ime strani)
+ echo '<div class="jezik_row page">';
+ echo ' <div class="jezik_left">'.$lang['srv_stran'].' '.$row['vrstni_red'].'</div>';
+ echo ' <div class="jezik_right">'.$lang['srv_stran'].' '.$row['vrstni_red'].'</div>';
+ echo '</div>';
+
$gru_id = $row['gru_id'];
}
- $this->urejanje_vprasanje($row['id']);
+ $this->urejanje_vprasanje($row['id'], $row['tip']);
}
- echo '<div class="clr"></div>';
- echo '<div class="jezik_left noborder"><h2 class=" jezik_page">'.$lang['srv_end_label'].'</h2></div>';
- echo '<div class="jezik_right noborder"><h2 class=" jezik_page">'.$lang['srv_end_label'].'</h2></div>';
+ // Naslov zadnje strani (ime strani)
+ echo '<div class="jezik_row page">';
+ echo ' <div class="jezik_left">'.$lang['srv_end_label'].'</div>';
+ echo ' <div class="jezik_right">'.$lang['srv_end_label'].'</div>';
+ echo '</div>';
- $this->urejanje_vprasanje(-2);
+ // Urejanje texta uvoda
+ $this->urejanje_vprasanje(-2, -2);
}
/**
@@ -527,7 +607,7 @@ class Prevajanje {
*
* @param mixed $spremenljivka
*/
- function urejanje_vprasanje ($spremenljivka) {
+ function urejanje_vprasanje ($spremenljivka, $tip) {
global $lang;
global $lang1;
global $lang2;
@@ -551,6 +631,9 @@ class Prevajanje {
}
+ echo '<div class="jezik_row question tip_'.$tip.'">';
+
+
// LEVA STRAN PREVAJANJA
echo '<div class="jezik_left">';
@@ -568,7 +651,7 @@ class Prevajanje {
echo '</div>';
-
+
// DESNA STRAN PREVAJANJA
echo '<div class="jezik_right vprlang" id="vprlang_'.$spremenljivka.'">';
@@ -585,6 +668,9 @@ class Prevajanje {
$this->Branching->vprasanje($spremenljivka, true); //poklici izris vprasanja za prevajanje (za enkrat je drugi argument pomemben le za slider)
echo '</div>';
+
+
+ echo '</div>';
// Nastavimo nazaj originalen jezik vmesnika
diff --git a/admin/survey/classes/class.RecodeValues.php b/admin/survey/classes/class.RecodeValues.php
index eef65b0..2f4bd91 100644
--- a/admin/survey/classes/class.RecodeValues.php
+++ b/admin/survey/classes/class.RecodeValues.php
@@ -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);
@@ -445,7 +444,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == '0') ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -463,7 +462,7 @@ class RecodeValues {
echo '&nbsp;'.$lang['srv_recode_number_to'];
- echo '<select name="recode_number_type[]" onChange="recode_number_type_changed(this);">';
+ echo '<select class="dropdown medium" name="recode_number_type[]" onChange="recode_number_type_changed(this);">';
foreach (self::$options AS $oKey => $option) {
if ($option['variable'] == null && $oKey != '_0_') {
echo '<option disabled="disabled">'.$option['naslov'].'</option>';
@@ -495,7 +494,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == '0') ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -515,7 +514,7 @@ class RecodeValues {
# imamo rekodiranje v novo spremenljivko
$recode['vred_id'] = '-1';
- echo '<select name="recode_number_vrednost[]">';
+ echo '<select class="dropdown medium" name="recode_number_vrednost[]">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -668,48 +667,57 @@ class RecodeValues {
}
$sugestedName = strip_tags(self::$cacheSpremenljivka['naslov'].' - recoded');
echo'<div id="divRecodeSprOption">';
- echo '<label>'.$lang['srv_recode_to_spr'].'</label>';
+ echo '<label>'.$lang['srv_recode_to_spr'].': ';
if ( $_GET['t'] == 'charts' || $_POST['recIsCharts'] == 1 ) {
- echo $lang['srv_recode_to_spr_same'];
+ echo $lang['srv_recode_to_spr_same'].'</label>';
} else {
- echo '<label><input type="radio" name="recode_type" value="0" '.((int)$recode_type == 0 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;">'.$lang['srv_recode_to_spr_same'].'</label>';
- echo '<label><input type="radio" name="recode_type" value="1" '.((int)$recode_type == 1 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;">'.$lang['srv_recode_to_spr_new'].'</label>';
+ echo '</label><input type="radio" name="recode_type" id="recode_type0" value="0" '.((int)$recode_type == 0 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;"><label for="recode_type0">'.$lang['srv_recode_to_spr_same'].'</label>';
+ echo '<input type="radio" name="recode_type" id="recode_type1" value="1" '.((int)$recode_type == 1 ? ' checked="checked"' : '').'onchange="changeRecodeType();return false;"><label for="recode_type1">'.$lang['srv_recode_to_spr_new'].'</label>';
}
echo '</div>';
if ((int)$recode_type == 1) {
- echo'<span id="divRecodeSprNew" class="floatRecodeSpremenljivka">';
+ echo'<div id="divRecodeSprNew" class="top16 bottom16">';
if ((int)$to_spr_id == 0) {
- echo '<div class="new-spr" style="text-align: right">';
- echo $lang['srv_recode_to_spr_add_spr'].'<br/>';
+ echo '<div class="new-spr">';
+ //echo $lang['srv_recode_to_spr_add_spr'].'<br/>';
echo '<div id="coding_spr_new" >';
- echo '<p>'.$lang['srv_recode_to_spr_name'].' <input type="text" id="rec_spremenljivka_naslov" name="spremenljivka_naslov" default="1" contenteditable="true" value="'.$sugestedName.'" style="width: 123px" />';
+ echo '<p class="top16">'.$lang['srv_recode_to_spr_name'].' <input type="text" class="text medium" id="rec_spremenljivka_naslov" name="spremenljivka_naslov" default="1" contenteditable="true" value="'.$sugestedName.'"/>';
#echo '<a href="#" onclick="recodeSpremenljivkaNew(); return false;">'.$lang['add'].'</a>';
- echo '<a href="#" onclick="recodeSpremenljivkaNew(); return false;""><span class="faicon add small" title="'.$lang['add'].'"></span></a>';
+ echo '<button class="small blue" onclick="recodeSpremenljivkaNew(); return false;"">'.$lang['add'].'</button>';
echo '</p>';
echo '</div>';
echo '</div>';
} else {
- echo '<strong>'.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).'</strong><br/><br/>';
+ echo '<span class="semi-bold">'.$rowSpremenljivka['variable'].' - '.skrajsaj(strip_tags($rowSpremenljivka['naslov']), 40).'</span>';
$sql1 = sisplet_query("SELECT naslov FROM srv_vrednost WHERE spr_id='$to_spr_id' ORDER BY vrstni_red ASC");
+ $count = 0;
+ echo '<p class="top16 bottom16">'.$lang['srv_recode_valueset'];
while ($row1 = mysqli_fetch_array($sql1)) {
if ($rowSpremenljivka['tip'] == 1) {
- echo '<input type="radio" onclick="return false;" /><label> '.$row1['naslov'].'</label>';
- echo '<br/>';
+ if ($count == 0) {
+ $count = 1;
+ }
+ else {
+ echo ', ';
+ }
+ echo $row1['naslov'];
}
}
+ echo '</p>';
+ echo '<div class="setting_holder">';
if (mysqli_num_rows($sql1) == 0) {
echo '&nbsp;'.$lang['srv_novavrednost'].': '; $margin='0';
- } else { $margin = '23px';
+ } else { $margin = 'none-left';
}
- echo '<input type="text" name="vrednost_new" value="" '.(mysqli_num_rows($sql1)>0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' style="margin-left:'.$margin.'; width: 80px" /> ';
- echo '<a href="#" onclick="recodeVrednostNew(); return false;"><span class="faicon add small icon-as_link" title="'.$lang['add'].'"></span></a>';
- echo '<br>Napredne spremembe:'.Help::display('srv_recode_advanced_edit');
+ echo '<input class="text medium '.$margin.'" type="text" name="vrednost_new" value="" '.(mysqli_num_rows($sql1)>0?' placeholder="'.$lang['srv_novavrednost'].'" ':'').' /> ';
+ echo '<button class="small blue" onclick="recodeVrednostNew(); return false;">'.$lang['add'].'</button>';
+ echo '<p class="recode_end">Napredne spremembe:'.Help::display('srv_recode_advanced_edit').'</p>';
+ echo '</div>';
}
- echo '</span>';
+ echo '</div>';
}
- echo'<br class="clr" />';
}
if ( $displayType == 1 ) {
if (count(self::$variables)> 0) {
@@ -722,39 +730,37 @@ class RecodeValues {
//echo '<table style="width:65% !important;">';
echo '<table class="question_recode_table">';
echo '<tr>';
- echo '<th class="halfWidth" colspan="2">';
+ echo '<th class="main_head center" colspan="2">';
echo $lang['srv_recode_original'];
echo '</th>';
- echo '<td rowspan="2" style="vertical-align:top;">&nbsp;<span class="sprites arrow_switch"></span>&nbsp;</td>';
- echo '<th class="halfWidth" rowspan="2" style="vertical-align:top;">';
+ echo '<th class="main_head center" style="vertical-align:top;">';
echo $lang['srv_recode_to'];
echo '</th>';
echo '</tr>';
echo '<tr>';
- echo '<td class="halfWidth anl_ac gray">';
- echo $lang['srv_recode_to_label'];
- echo '</td>';
- echo '<td class="halfWidth anl_ac gray">';
- echo $lang['srv_recode_to_value'];
- echo '</td>';
+ echo '<th class="dark">';
+ echo $lang['srv_label'];
+ echo '</th>';
+ echo '<th class="dark center">';
+ echo $lang['srv_vrednost'];
+ echo '</th>';
+ echo '<th>';
+ echo '</th>';
echo '</tr>';
foreach (self::$variables AS $vKey => $variable) {
echo '<tr>';
- echo '<td class="anl_ac">';
+ echo '<td class="labela">';
echo $variable['naslov'];
echo '</td>';
- echo '<td class="anl_ac">';
+ echo '<td class="center">';
echo '&nbsp;&nbsp;['.$variable['variable'].']';
echo '</td>';
- # spacer
- echo '<td>&nbsp</td>';
- #
echo '<td>';
if ((int)$recode_type == 0) {
# imamo klasično rekodiranje
- echo '<select name="MVFQ_'.$variable['variable'].'">';
+ echo '<select class="dropdown medium" name="MVFQ_'.$variable['variable'].'">';
foreach (self::$options AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -775,7 +781,7 @@ class RecodeValues {
if (!isset($recodedFrom[$vKey])) {
$recodedFrom[$vKey] = '-1';
}
- echo '<select name="MVSNFQ_'.$vKey.'">';
+ echo '<select class="dropdown medium" name="MVSNFQ_'.$vKey.'">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {
@@ -817,7 +823,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == $recode['operator']) ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -835,7 +841,7 @@ class RecodeValues {
echo '&nbsp;'.$lang['srv_recode_number_to'];
$is_missing_value = false;
- echo '<select name="recode_number_type" onChange="recode_number_type_changed(this);">';
+ echo '<select class="dropdown medium" name="recode_number_type" onChange="recode_number_type_changed(this);">';
foreach (self::$options AS $oKey => $option) {
if ($oKey == '_0_' || $oKey == '_1_' || $oKey == '_2_') {
# privzeto izberemo prvi odgovor - veljavni, nato spodaj popravimo
@@ -876,7 +882,7 @@ class RecodeValues {
echo '<li>';
echo '<span class="faicon move_updown moveY"></span>';
printf($lang['srv_recode_number_if'],self::$cacheSpremenljivka['variable']);
- echo '&nbsp;<select name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
+ echo '&nbsp;<select class="dropdown medium" name="recode_number_operator[]" onChange="recode_operator_changed(this);">';
foreach (self::$_operators AS $value => $operator) {
$selected = ($value == $recode['operator']) ? ' selected="selected"' : '';
echo '<option value="'.$value.'"'.$selected.'>'.$operator.'</option>';
@@ -897,7 +903,7 @@ class RecodeValues {
$recodedFrom[$rKey] = '-1';
}
# imamo rekodiranje v novo spremenljivko
- echo '<select name="recode_number_vrednost[]">';
+ echo '<select class="dropdown medium" name="recode_number_vrednost[]">';
if (is_array($new_spr_vrednosti) && count($new_spr_vrednosti)>0) {
foreach ($new_spr_vrednosti AS $oKey => $option) {
if ($option['variable'] == null) {
diff --git a/admin/survey/classes/class.Setting.php b/admin/survey/classes/class.Setting.php
index ff39cfb..bb5ffc5 100644
--- a/admin/survey/classes/class.Setting.php
+++ b/admin/survey/classes/class.Setting.php
@@ -28,7 +28,7 @@ class Setting
// konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
diff --git a/admin/survey/classes/class.SurveyAapor.php b/admin/survey/classes/class.SurveyAapor.php
index 1418f60..7513a9b 100644
--- a/admin/survey/classes/class.SurveyAapor.php
+++ b/admin/survey/classes/class.SurveyAapor.php
@@ -162,7 +162,7 @@ class SurveyAapor {
echo 'Povezave:<br/>';
// echo '<a href="http://www.aapor.org/For_Researchers/4683.htm" target="_blank">';
- echo '<a href="https://www.esomar.org/knowledge-and-standards/research-resources/aapor-standard-definitions.php" target="_blank">';
+ echo '<a href="https://www.esomar.org/what-we-do/code-guidelines/AAPOR-Standard-Definitions-Final-Dispositions-of-Case-Codes-and-Outcome-Rates-for-Surveys" target="_blank">';
echo 'Standard Definitions – Final Dispositions of Case Codes and Outcome Rates for Surveys (PDF)';
echo '</a>';
echo '</div>';
diff --git a/admin/survey/classes/class.SurveyAktivnost.php b/admin/survey/classes/class.SurveyAktivnost.php
index 28b9e3f..3574f43 100644
--- a/admin/survey/classes/class.SurveyAktivnost.php
+++ b/admin/survey/classes/class.SurveyAktivnost.php
@@ -2,7 +2,6 @@
class SurveyAktivnost{
-
public function __construct(){
global $lang;
@@ -15,12 +14,12 @@ class SurveyAktivnost{
* @desc prikaze diagnostiko anket
*/
public function diagnostics() {
- global $lang, $global_user_id, $admin_type, $app_settings;
+ global $lang, $global_user_id, $admin_type;
$sum = 0;
$sum_survey = 0;
- if ($_GET['time'] > 0)
+ if (isset($_GET['time']) && $_GET['time'] > 0)
$time = $_GET['time'];
else
$time = '1 month';
@@ -53,56 +52,141 @@ class SurveyAktivnost{
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
+
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
- $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
- $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
- $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
-
- echo '<span>'.$lang['srv_narocilo_paket'].':</span>';
- echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
- echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
- echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label></span>';
- echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label></span>';
-
- echo '<span class="spaceLeft spaceRight bold">|</span>';
- }
+ //Osnova
+ echo '<div class="osnova">';
+ echo $lang['srv_diagnostics_basis'];
- echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label></span>';
+ echo '<select class="dropdown" name="type" onchange="this.form.submit();">';
+ echo ' <option value="users"' . ($type == 'users' ? ' selected' : '') . '>'.$lang['srv_diagnostics_respondentov'].'</option>';
+ echo ' <option value="emails"' . ($type == 'emails' ? ' selected' : '') . '>'.$lang['srv_diagnostics_emails'].'</option>';
+ echo ' <option value="pages"' . ($type == 'pages' ? ' selected' : '') . '>'.$lang['srv_diagnostics_strani'].'</option>';
+ echo ' <option value="analiza"' . ($type == 'analiza' ? ' selected' : '') . '>'.$lang['srv_diagnostics_analiza'].'</option>';
+ echo ' <option value="graph"' . ($type == 'graph' ? ' selected' : '') . '>'.$lang['srv_diagnostics_graph'].'</option>';
+ echo ' <option value="editing"' . ($type == 'editing' ? ' selected' : '') . '>'.$lang['srv_diagnostics_editing'].'</option>';
+ echo '</select>';
+ echo '</div>';
+
+
+ //Upoštevane enote
+ echo '<div class="enote">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'units\'); return false;"><span class="faicon plus"></span>'.$lang['srv_diagnostics_upostevane'].'</button>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Upoštevaj enote
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_upostevaj'].'</span>';
+
echo '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="ustrezni" id="ustrezni_hidden" value="'.$ustrezni.'" />';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '<div class="setting_item">';
+ echo '</span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="delnoustrezni" id="delnoustrezni_hidden" value="'.$delnoustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="neustrezni" id="neustrezni_hidden" value="'.$neustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label></span>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label></span>';
-
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span>'.$lang['lang'].': <select id="language" name="language">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="jezikpaket">';
+
+ //Jezik
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_jezik'].'</span>';
+
+ echo '<select class="dropdown w130" id="language" name="language">';
echo '<option value="0" '.($language=='0' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_all'].'</option>';
echo '<option value="1" '.($language=='1' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_slo'].'</option>';
echo '<option value="2" '.($language=='2' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_ang'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ //Paketi
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
+ $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
+ $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
+ $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_narocilo_paket'].'</span>';
+
+ echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>'; //div#jezikpaket
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
- echo '<input type="button" class="spaceLeft" value="'.$lang['srv_coding_filter'].'" onClick="this.form.submit();">';
-
- echo '<br /><br />';
-
- echo ''.$lang['srv_diagnostics_total'].' <select name="type" onchange="this.form.submit();">';
- echo '<option value="users"' . ($type == 'users' ? ' selected' : '') . '>'.$lang['srv_diagnostics_respondentov'].'</option>';
- echo '<option value="emails"' . ($type == 'emails' ? ' selected' : '') . '>'.$lang['srv_email-vabila'].'</option>';
- echo '<option value="pages"' . ($type == 'pages' ? ' selected' : '') . '>'.$lang['srv_diagnostics_strani'].'</option>';
- echo '<option value="analiza"' . ($type == 'analiza' ? ' selected' : '') . '>'.$lang['srv_diagnostics_analiza'].'</option>';
- echo '<option value="graph"' . ($type == 'graph' ? ' selected' : '') . '>'.$lang['srv_diagnostics_graph'].'</option>';
- echo '<option value="editing"' . ($type == 'editing' ? ' selected' : '') . '>'.$lang['srv_diagnostics_editing'].'</option>';
- echo '</select> '.$lang['srv_diagnostics_in'].' ';
-
- echo '<select id="diagnostics_date_selected" name="time" onchange="diagnosticsChooseDate()">';
+ echo ' </div>';
+
+ echo '</div>'; //div#dataSettingsCheckboxes
+
+
+ // n, število anket
+ echo '<div class="counter">';
+ echo ' <span class="counter_line"><span class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total'].' </span><span class="srv_diagnostic_total_sub_label">'.$sum.'</span></span>';
+ echo ' <span class="counter_line"><span class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total_survey'].' </span><span class="srv_diagnostic_total_survey_label">'.$sum_survey.'</span></span>';
+ echo '</div>';
+
+
+ // Datum
+ echo '<div id="end">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes_Date" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'date\'); return false;"><span class="faicon calendar_icon"></span>'.$lang['srv_diagnostics_date'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes_Date" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_date2'];
+ echo '<select class="dropdown w130" id="diagnostics_date_selected" name="time" onChange="this.form.submit();">';
echo '<option value="1 minute"' . ($time == '1 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_1 minute'].'</option>';
echo '<option value="5 minute"' . ($time == '5 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_5 minute'].'</option>';
echo '<option value="10 minute"' . ($time == '10 minute' ? ' selected' : '') . '>'.$lang['srv_diagnostics_10 minute'].'</option>';
@@ -119,26 +203,60 @@ class SurveyAktivnost{
echo '<option value="3 month"' . ($time == '3 month' ? ' selected' : '') . '>'.$lang['srv_diagnostics_3 month'].'</option>';
echo '<option value="6 month"' . ($time == '6 month' ? ' selected' : '') . '>'.$lang['srv_diagnostics_6 month'].'</option>';
echo '<option id="option_99date" value="99date"' . ($time == '99date' ? ' selected' : '') . '>'.$lang['srv_diagnostics_choose_date'].'</option>';
- echo '</select> ';
-
+ echo '</select>';
+ echo '</div>';
+
// Datum - od
- echo ''.$lang['srv_diagnostics_orfrom'].' <input type="text" id="from" name="from" value="' . $from . '" '. ($time != '99date' ? ' disabled' : '') .' />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_orfrom'];
+ echo '<div class="date_holder">';
+ echo '<input type="text" class="text '.($time != '99date'? 'disabled' : '').'" id="from" name="from" value="' . $from . '"/>';
+ echo '<span class="faicon calendar_icon blue" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
// Datum - do
- echo ' '.$lang['srv_diagnostics_to'].' <input type="text" id="to" name="to" value="' . $to . '" '. ($time != '99date' ? ' disabled' : '') .'/>';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="changeSelectOption()" id="to_img"></span>';
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_to'];
+ echo '<div class="date_holder">';
+ echo '<input type="text" class="text '. ($time != '99date'? 'disabled' : '') .'" id="to" name="to" value="' . $to . '"/>';
+ echo '<span class="faicon calendar_icon blue" onclick="changeSelectOption()" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
- echo '<input type="submit" class="spaceLeft pointer" value="'.$lang['hour_show'].'" />';
- echo '<label class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total'].'</label><label class="srv_diagnostic_total_sub_label">'.$sum.'</label>';
- echo '<label class="srv_diagnostic_total_sub">'.$lang['srv_diagnostics_sum_total_survey'].'</label><label class="srv_diagnostic_total_survey_label">'.$sum_survey.'</label>';
-
- echo '</form><br />';
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //div#dataSettingsCheckboxes_Date
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes");
+ var container2 = $("#dataSettingsCheckboxes_Date");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes").addClass("displayNone");
+ $("#toggleDataCheckboxes").removeClass("border_blue");
+ }
+ if (!container2.is(e.target) && container2.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes_Date").addClass("displayNone");
+ $("#toggleDataCheckboxes_Date").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+
+ echo '</div>'; // div.data_table_top_holder
+
+
+ echo '</form>';
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')
@@ -268,21 +386,32 @@ class SurveyAktivnost{
echo mysqli_error($GLOBALS['connect_db']);
}
+ // Tabela
global $site_url;
-
- echo '<table style="width:70%">';
+
+ echo '<table id="aktivnost_ankete_table">';
$max = -1;
+ echo '<tr>';
+ echo '<th>'.$lang['srv_ime'].'</th>';
+ echo '<th>'.$lang['email'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
while ($row = mysqli_fetch_array($sql)) {
if ($max == -1)
$max = max($row['responses'], $max)*1.3;
+ SurveyInfo::getInstance()->SurveyInit($row['ank_id']);
+
echo '<tr>';
- echo '<td><a href="'.SurveyInfo::getSurveyLink($row['ank_id']).'?preview=on&pages=all" target="_blank">' . $row['naslov'] . '</a></td>';
- echo '<td>'.$row['email'].'</td>';
+ echo '<td><a href="'.SurveyInfo::getSurveyLink().'?preview=on&pages=all" target="_blank">' . $row['naslov'] . '</a></td>';
+ echo '<td class="gray">'.$row['email'].'</td>';
$sum = $sum + $row['responses'];
$sum_survey = $sum_survey + 1;
- echo '<td style="width:60%"><div class="graph_lb" style="float: left; width:' . (round($row['responses'] / $max * 100, 0)) . '%">&nbsp;</div><div style="float:left">&nbsp;'.$row['responses'].'</div></td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo '<div class="graph_full" style="width:' . (round($row['responses'] / $max * 100, 0)) . '%">&nbsp;</div><div>&nbsp;'.$row['responses'].'</div';
+ echo '</div></td>';
echo '</tr>';
}
@@ -492,23 +621,71 @@ class SurveyAktivnost{
echo '<input type="hidden" name="a" value="diagnostics">';
echo '<input type="hidden" name="t" value="paradata">';
-
- // Vseh random enot
- echo '<span>'.$lang['srv_inv_dashboard_tbl_all'].'</span> <input type="text" name="limit" value="'.$limit.'" style="padding:1px 3px; font-size:12px; width:70px; margin-right:20px;" />';
-
+
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
+
+ //Vseh random enot
+ echo '<div class="osnova no_border">';
+ echo $lang['srv_inv_dashboard_tbl_all'];
+
+ echo '<input class="text" type="text" name="limit" value="'.$limit.'" />';
+ echo '</div>';
+
// Datum
- echo $lang['s_from'].' <input type="text" id="from" name="from" value="' . $date_from . '" />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="diagnosticsParadataChooseDate();" id="from_img"></span> ';
+ echo '<div id="end">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes_Date" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'date\'); return false;"><span class="faicon calendar_icon"></span>'.$lang['srv_diagnostics_date'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes_Date" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Datum - od
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_orfrom'];
+ echo '<div class="date_holder">';
+ echo '<input class="text" type="text" id="from" name="from" value="' . $date_from . '" />';
+ echo '<span class="faicon calendar_icon blue" onclick="diagnosticsParadataChooseDate();" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
+
+ // Datum - do
+ echo '<div class="setting_holder">';
+ echo $lang['srv_diagnostics_to'];
+ echo '<div class="date_holder">';
+ echo '<input class="text" type="text" id="to" name="to" value="' . $date_to . '" />';
+ echo '<span class="faicon calendar_icon blue" onclick="diagnosticsParadataChooseDate();" id="from_img"></span>';
+ echo '</div>';
+ echo '</div>';
- echo $lang['s_to'].' <input type="text" id="to" name="to" value="' . $date_to . '" />';
- echo ' <span class="faicon calendar_icon icon-as_link" onclick="diagnosticsParadataChooseDate();" id="to_img"></span>';
-
echo '<script>diagnosticsParadataChooseDate();</script>';
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; //div#dataSettingsCheckboxes_Date
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes_Date");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes_Date").addClass("displayNone");
+ $("#toggleDataCheckboxes_Date").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+ echo '</div>'; // div.data_table_top_holder
- // Gumb prikazi
- echo '<input type="button" class="pointer" value="'.$lang['hour_show'].'" onClick="this.form.submit();" style="margin-left:20px;">';
-
- echo '</form><br />';
+ echo '</form>';
// Gledamo vse veljavne respondente iz leta 2016
@@ -559,13 +736,17 @@ class SurveyAktivnost{
foreach($statistics as $key => $vals){
- echo '<fieldset style="width:60%;"><legend>'.$vals['title'].'</legend>';
+ echo '<fieldset><legend>'.$vals['title'].'</legend>';
// Sortiramo vrednosti po velikosti (od najvecje do najmanjse)
//ksort($vals);
arsort($vals);
- echo '<table style="width:100%;">';
+ echo '<table class="aktivnost_paradata_table">';
+ echo '<tr>';
+ echo '<th>'.$vals['title'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
$max = -1;
foreach($vals as $key2 => $val){
@@ -581,7 +762,11 @@ class SurveyAktivnost{
echo '<td>'.$key2.'</td>';
$max = max($val, $max) * 1.2;
- echo '<td style="width:80%"><div class="graph_lb" style="float: left; width:' . (round($val / $max * 100, 0)) . '%">&nbsp;</div><div style="float:left">&nbsp;'.$val.'</div></td>';
+
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo '<div class="graph_full" style="width:' . (round($val / $max * 100, 0)) . '%">&nbsp;</div><div>&nbsp;'.$val.'</div>';
+ echo '</div></td>';
echo '</tr>';
}
@@ -589,7 +774,7 @@ class SurveyAktivnost{
echo '</table>';
- echo '</fieldset><br />';
+ echo '</fieldset>';
}
}
@@ -690,9 +875,9 @@ class SurveyAktivnost{
if ($color == 'month') $label = date('M Y', strtotime($row['date']));
if ($color == 'day') $label = date('j.n.Y', strtotime($row['date']));
- echo '<span style="position: absolute; bottom: -15px; width: 90px;">'.$label;
+ /*echo '<span style="position: absolute; bottom: -15px; width: 90px;">'.$label;
if ( !$sumarium ) echo ' <span style="color:darkgray; font-size:70%" title="x̄ = '.$avg[$row['color']].'">('.$avg[$row['color']].')</span>';
- echo '</span>';
+ echo '</span>';*/
$prev_color = $row['color'];
}
@@ -712,12 +897,12 @@ class SurveyAktivnost{
}
private function diagnostics_show_interval ($t) {
- global $lang, $app_settings;
-
+ global $lang;
+
echo '<form name="intr" action="index.php" method="get">';
echo '<input type="hidden" name="a" value="diagnostics">';
echo '<input type="hidden" name="t" value="'.$t.'">';
-
+
$testdata = (isset($_GET['testdata']) && $_GET['testdata']=='1') ? 1 : 0;
$testdataauto = (isset($_GET['testdataauto']) && $_GET['testdataauto']=='1') ? 1 : 0;
$uvoz = (isset($_GET['uvoz']) && $_GET['uvoz']=='1') ? 1 : 0;
@@ -728,85 +913,165 @@ class SurveyAktivnost{
$mailsent = (isset($_GET['mailsent']) && $_GET['mailsent']=='1') ? 1 : 0;
$language = (isset($_GET['language'])) ? $_GET['language'] : 0;
-
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
- $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
- $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
- $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
-
- echo '<span>'.$lang['srv_narocilo_paket'].':</span>';
+ // Nastavitve nad tabelo
+ echo '<div class="data_table_top_holder graphs">';
- echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
- echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
- echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label></span>';
- echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label></span>';
-
- echo '<span class="spaceLeft spaceRight bold">|</span>';
- }
+ //Interval
+ echo '<div class="osnova">';
+ echo 'Interval:';
- echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label></span>';
+ echo '<select class="dropdown" name="interval" onchange="document.intr.submit();">';
+ if ( ! in_array($t, array('time_span_yearly', 'time_span')) ) {
+ echo '<option value="hour" '.($_GET['interval']=='hour'?'selected':'').'>'.$lang['srv_diagnostics_interval_hour'].'</option>';
+ }
+ echo '<option value="day" '.($_GET['interval']=='day'?'selected':'').'>'.$lang['srv_diagnostics_interval_day'].'</option>';
+ echo '<option value="week" '.($_GET['interval']=='week'?'selected':'').'>'.$lang['srv_diagnostics_interval_week'].'</option>';
+ echo '<option value="month" '.($_GET['interval']=='month'?'selected':'').'>'.$lang['srv_diagnostics_interval_month'].'</option>';
+ echo '<option value="year" '.($_GET['interval']=='year'?'selected':'').'>'.$lang['srv_diagnostics_interval_year'].'</option>';
+ echo '</select>';
+ echo '</div>';
+
+ //Upoštevane enote
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue" onClick="toggleAktivnostCheckboxes(\'units\'); return false;"><span class="faicon plus"></span>'.$lang['srv_diagnostics_upostevane'].'</button>';
+ echo '</div>';
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" class="displayNone">';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ // Upoštevaj enote
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_upostevaj'].'</span>';
+
echo '<input type="hidden" name="uvoz" id="uvoz_hidden" value="'.$uvoz.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdata" name="testdata" '.($testdata == 1 ? ' checked="checked"' : '').'"><label for="testdata">'.$lang['srv_diagnostics_filter_test'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="testdataauto" name="testdataauto" '.($testdataauto == 1 ? ' checked="checked"' : '').'"><label for="testdataauto">'.$lang['srv_diagnostics_filter_autotest'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="uvoz" '.($uvoz == 1 ? ' checked="checked"' : '').' onchange="$(\'#uvoz_hidden\').val('.($uvoz==1 ? '0' : '1').');"><label for="uvoz">'.$lang['srv_diagnostics_filter_import'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="ustrezni" id="ustrezni_hidden" value="'.$ustrezni.'" />';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '<div class="setting_item">';
+ echo '</span><input type="checkbox" id="ustrezni" '.($ustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#ustrezni_hidden\').val('.($ustrezni==1 ? '0' : '1').');"><label for="ustrezni">'.$lang['srv_diagnostics_filter_6'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="delnoustrezni" id="delnoustrezni_hidden" value="'.$delnoustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delnoustrezni" '.($delnoustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#delnoustrezni_hidden\').val('.($delnoustrezni==1 ? '0' : '1').');"><label for="delnoustrezni">'.$lang['srv_diagnostics_filter_5'].'</label>';
+ echo '</div>';
echo '<input type="hidden" name="neustrezni" id="neustrezni_hidden" value="'.$neustrezni.'" />';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label></span>';
- echo '<span class="spaceLeft"><input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label></span>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="neustrezni" '.($neustrezni == 1 ? ' checked="checked"' : '').' onchange="$(\'#neustrezni_hidden\').val('.($neustrezni==1 ? '0' : '1').');"><label for="neustrezni">'.$lang['srv_diagnostics_filter_34'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="mailsent" name="mailsent" '.($mailsent == 1 ? ' checked="checked"' : '').'><label for="mailsent">'.$lang['srv_diagnostics_filter_012'].'</label>';
+ echo '</div>';
- echo '<span class="spaceLeft bold">|</span><span class="spaceLeft"></span>'.$lang['lang'].': <select id="language" name="language">';
+ echo '</div>';
+
+ echo '<div id="jezikpaket">';
+
+ //Jezik
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_diagnostics_jezik'].'</span>';
+
+ echo '<select class="dropdown w130" id="language" name="language">';
echo '<option value="0" '.($language=='0' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_all'].'</option>';
echo '<option value="1" '.($language=='1' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_slo'].'</option>';
echo '<option value="2" '.($language=='2' ? ' selected' : '').'>'.$lang['srv_diagnostics_filter_lang_ang'].'</option>';
+ echo '</select>';
+
+ echo '</div>';
+
+ //Paketi
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+
+ $package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
+ $package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
+ $package_3ka = (isset($_GET['package_3ka']) && $_GET['package_3ka']=='0') ? 0 : 1;
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_narocilo_paket'].'</span>';
+
+ echo '<input type="hidden" name="package_1ka" id="package_1ka_hidden" value="'.$package_1ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_1ka" '.($package_1ka == 1 ? ' checked="checked"' : '').'" onchange="$(\'#package_1ka_hidden\').val('.($package_1ka==1 ? '0' : '1').');"><label for="package_1ka">1KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_2ka" id="package_2ka_hidden" value="'.$package_2ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_2ka" '.($package_2ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_2ka_hidden\').val('.($package_2ka==1 ? '0' : '1').');"><label for="package_2ka">2KA</label>';
+ echo '</div>';
+ echo '<input type="hidden" name="package_3ka" id="package_3ka_hidden" value="'.$package_3ka.'" />';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" value="1" id="package_3ka" '.($package_3ka == 1 ? ' checked="checked"' : '').' onchange="$(\'#package_3ka_hidden\').val('.($package_3ka==1 ? '0' : '1').');"><label for="package_3ka">3KA</label>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>'; //div#jezikpaket
+
+
+ // Gumb filtriraj
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="this.form.submit();">'.$lang['srv_diagnostics_filter'].'</button>';
+ echo '</div>';
- echo '<input type="button" class="spaceLeft" value="'.$lang['srv_coding_filter'].'" onClick="this.form.submit();">';
-
- echo '<br /><br />';
-
- echo 'Interval: <select name="interval" onchange="document.intr.submit();">';
- if ( ! in_array($t, array('time_span_yearly', 'time_span')) ) {
- echo '<option value="hour" '.($_GET['interval']=='hour'?'selected':'').'>'.$lang['srv_diagnostics_interval_hour'].'</option>';
- }
- echo '<option value="day" '.($_GET['interval']=='day'?'selected':'').'>'.$lang['srv_diagnostics_interval_day'].'</option>';
- echo '<option value="week" '.($_GET['interval']=='week'?'selected':'').'>'.$lang['srv_diagnostics_interval_week'].'</option>';
- echo '<option value="month" '.($_GET['interval']=='month'?'selected':'').'>'.$lang['srv_diagnostics_interval_month'].'</option>';
- echo '<option value="year" '.($_GET['interval']=='year'?'selected':'').'>'.$lang['srv_diagnostics_interval_year'].'</option>';
- echo '</select>';
-
- echo '</form><br />';
+ echo ' </div>';
+ echo '</div>'; //div#dataSettingsCheckboxes
+
+ // Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container1 = $("#dataSettingsCheckboxes");
+
+ if (!container1.is(e.target) && container1.has(e.target).length === 0){
+ $("#dataSettingsCheckboxes").addClass("displayNone");
+ $("#toggleDataCheckboxes").removeClass("border_blue");
+ }
+ });
+ </script>';
+
+ echo '</div>'; // div.data_table_top_holder
+
+ echo '</form>';
}
private function diagnostics_get_interval ($def = '') {
- if ($_GET['interval'] == '') $_GET['interval'] = $def;
+ if (!isset($_GET['interval']) || $_GET['interval'] == '')
+ $_GET['interval'] = $def;
if ($_GET['interval'] == 'year') {
$interval['srv_anketa'] = "YEAR(srv_anketa.insert_time)";
$interval['users'] = "YEAR(users.when_reg)";
$interval['srv_user'] = "YEAR(srv_user.time_insert)";
$interval['srv_tracking_active'] = "YEAR(srv_tracking_active.datetime)";
- } elseif ($_GET['interval'] == 'month') {
+ }
+ elseif ($_GET['interval'] == 'month') {
$interval['srv_anketa'] = "CONCAT( YEAR(srv_anketa.insert_time), '-', MONTH(srv_anketa.insert_time) )";
$interval['users'] = "CONCAT( YEAR(users.when_reg), '-', MONTH(users.when_reg) )";
$interval['srv_user'] = "CONCAT( YEAR(srv_user.time_insert), '-', MONTH(srv_user.time_insert) )";
$interval['srv_tracking_active'] = "CONCAT( YEAR(srv_tracking_active.datetime), '-', MONTH(srv_tracking_active.datetime) )";
- } elseif ($_GET['interval'] == 'week') {
+ }
+ elseif ($_GET['interval'] == 'week') {
$interval['srv_anketa'] = "CONCAT( YEAR(srv_anketa.insert_time), '-', WEEKOFYEAR(srv_anketa.insert_time) )";
$interval['users'] = "CONCAT( YEAR(users.when_reg), '-', WEEKOFYEAR(users.when_reg) )";
$interval['srv_user'] = "CONCAT( YEAR(srv_user.time_insert), '-', WEEKOFYEAR(srv_user.time_insert) )";
$interval['srv_tracking_active'] = "CONCAT( YEAR(srv_tracking_active.datetime), '-', WEEKOFYEAR(srv_tracking_active.datetime) )";
- } elseif ($_GET['interval'] == 'day') {
+ }
+ elseif ($_GET['interval'] == 'day') {
$interval['srv_anketa'] = "DATE(srv_anketa.insert_time)";
$interval['users'] = "DATE(users.when_reg)";
$interval['srv_user'] = "DATE(srv_user.time_insert)";
$interval['srv_tracking_active'] = "DATE(datetime)";
- } elseif ($_GET['interval'] == 'hour') {
+ }
+ elseif ($_GET['interval'] == 'hour') {
$interval['srv_anketa'] = "CONCAT( DATE(srv_anketa.insert_time), ' ', HOUR(srv_anketa.insert_time)) ";
$interval['users'] = "CONCAT( DATE(users.when_reg), ' ', HOUR(users.when_reg)) ";
$interval['srv_user'] = "CONCAT( DATE(srv_user.time_insert), ' ', HOUR(srv_user.time_insert)) ";
@@ -870,11 +1135,10 @@ class SurveyAktivnost{
// Filter po paketih, ce jih imamo
private function diagnostics_get_user_package(){
- global $app_settings;
$filter = '';
- if(isset($app_settings['commercial_packages']) && $app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
$package_1ka = (isset($_GET['package_1ka']) && $_GET['package_1ka']=='0') ? 0 : 1;
$package_2ka = (isset($_GET['package_2ka']) && $_GET['package_2ka']=='0') ? 0 : 1;
diff --git a/admin/survey/classes/class.SurveyAppendMerge.php b/admin/survey/classes/class.SurveyAppendMerge.php
index c16549a..4fa6651 100644
--- a/admin/survey/classes/class.SurveyAppendMerge.php
+++ b/admin/survey/classes/class.SurveyAppendMerge.php
@@ -6,6 +6,9 @@
*
*/
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\IOFactory;
+
class SurveyAppendMerge {
private $anketa;
@@ -24,9 +27,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) {
@@ -48,11 +49,13 @@ class SurveyAppendMerge {
global $lang, $site_path, $site_url;
$field_list = array();
+ $field_types = array();
- $sql = sisplet_query("SELECT s.id, s.variable, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1, 2, 3, 7, 8, 21) ORDER BY g.vrstni_red, s.vrstni_red");
+ $sql = sisplet_query("SELECT s.id, s.variable, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1, 2, 3, 7, 8, 21, 6) ORDER BY g.vrstni_red, s.vrstni_red");
while ($row = mysqli_fetch_array($sql)) {
- $field_list[$row['id']] = $row['variable'] . ' ('.($row['tip']==1?'radio':'').($row['tip']==2?'checkbox':'').($row['tip']==3?'dropdown':'').($row['tip']==21?'text':'').($row['tip']==7?'number':'').($row['tip']==8?'date':'').')';
+ $field_list[$row['id']] = $row['variable'] . ' ('.($row['tip']==1?'radio':'').($row['tip']==2?'checkbox':'').($row['tip']==3?'dropdown':'').($row['tip']==21?'text':'').($row['tip']==7?'number':'').($row['tip']==8?'date':'').($row['tip']==6?'table':'').')';
+ $field_types[$row['id']] = $row['tip'];
}
$import_type = isset($_POST['import_type']) ? (int)$_POST['import_type'] : 2;
@@ -69,15 +72,19 @@ class SurveyAppendMerge {
echo '<input type="hidden" name="do" value="0">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
- # sporočilo za personalizirana e-vabila in respondente iz baze
- echo $lang['srv_append_note'];
+ // Opis združevanja podatkov
+ echo '<p class="bottom16">'.$lang['srv_append_note'].'</p>';
// Korak 1
- echo $lang['srv_append_step1'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_append_step1'].'</p>';
+ echo '<div class="appendmerge_indent">';
+
+ echo '<ul>';
+ echo '<li>'.$lang['srv_append_step1_notea'].'</li>';
+ echo '<li>'.$lang['srv_append_step1_noteb'].'</li>';
+ echo '<li>'.$lang['srv_append_step1_notec'].'</li>';
+ echo '</ul>';
- echo $lang['srv_append_step1_note'];
-
echo '<div id="inv_field_container">';
echo '<ul class="connectedSortable">';
@@ -95,7 +102,7 @@ class SurveyAppendMerge {
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" name="fields[]" value="'.$field.'" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').' '.($merge?' onclick="merge_getItems();"':'').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" name="fields[]" value="'.$field.'" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').' '.($merge?' onclick="merge_getItems();"':'').'>';
echo '<label'.$label_for.' style="display: inline">'.$text_label.'</label>';
echo '</li>';
@@ -104,25 +111,34 @@ class SurveyAppendMerge {
}
}
}
- echo '</ul><br />';
+ echo '</ul>';
echo '</div>';
+
+ echo '<p>'.$lang['srv_append_step1_noted'].'</p>';
+
echo '</div>';
// Korak 2
- echo $lang['srv_append_step2'];
- echo '<div class="append_step">';
-
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { append_refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+ echo '<p class="bold">'.$lang['srv_append_step2'].'</p>';
+
+ echo '<div class="appendmerge_indent">';
- echo '<span><label><input name="inv_import_type" id="inv_import_type0" type="radio" value="0" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m='.$_GET['m'].'\');" checked="checked">';
- echo ''.$lang['srv_iz_seznama'].'</label></span>';
- echo '<span><label><input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m=upload_xls\');">';
- echo ''.$lang['srv_iz_excela'].'</label></span>';
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
+ echo '<script type="text/javascript">initAppendMergeConnectedSortable();</script>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_appendmerge_source'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input name="inv_import_type" id="inv_import_type0" type="radio" value="0" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m='.$_GET['m'].'\');" checked="checked">';
+ echo '<label for="inv_import_type0">'.$lang['srv_iz_seznama'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m=upload_xls\');">';
+ echo '<label for="inv_import_type1">'.$lang['srv_iz_excela'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
echo '<input type="hidden" name="do_merge" value="0" id="do_merge">';
@@ -133,21 +149,34 @@ class SurveyAppendMerge {
echo '<div id="inv_import_list"'.($import_type != 1 ? '' : ' style="display:none"').'>' ;
// Korak 3
- echo $lang['srv_append_step3'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_append_step3'].'</p>';
+ echo '<div class="appendmerge_indent">';
- echo $lang['srv_append_step3_note'];
+ //echo $lang['srv_append_step3_note'];
+
+ echo '<ul>';
+ echo '<li>'.$lang['srv_append_step3_note1'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note2'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note3'].'</li>';
+ echo '</ul>';
+
+ echo '<p class="top16 bottom16">'.$lang['srv_append_step3_note4'].'</p>';
+
+ echo '<ul>';
+ echo '<li>'.$lang['srv_append_step3_note5'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note6'].'</li>';
+ echo '</ul>';
+
+ echo '<p class="top16 bottom16">'.$lang['srv_append_step3_note7'].'</p>';
+ echo '<p>'.$lang['srv_append_step3_note8'].'</p>';
+ echo '<p>'.$lang['srv_append_step3_note9'].'</p>';
+
+ $recipients_list = isset($_POST['inv_recipients_list']) ? mysql_real_unescape_string( $_POST['inv_recipients_list']) : array();
- echo '<span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '</span>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_0">';
- echo implode(',',$field_lang);
- echo '</span>';
- echo '<br class="clr" /><textarea id="inv_recipients_list" cols="50" rows="9" name="inv_recipients_list" style="margin-bottom: 7px;">';
+ echo '<p class="top16">'.$lang['srv_append_step3_note10'].' <span id="inv_field_list" class="inv_type_0 bold">';
+ echo implode(', ',$field_lang);
+ echo '</span></p>';
+ echo '<textarea id="inv_recipients_list" name="inv_recipients_list"">';
if (is_array($recipients_list) && count($recipients_list) > 0 ) {
echo implode("\n",$recipients_list);
}
@@ -161,32 +190,28 @@ class SurveyAppendMerge {
echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' style="display:none"').'>' ;
// Korak 3
- echo $lang['srv_append_step3_xls'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_append_step3_xls'].'</p>';
+
+ echo '<div class="appendmerge_indent">';
- echo $lang['srv_mailing_upload_list'];
- echo ' <input type="file" name="recipientsFile" id="recipientsFile" />';
-
- echo '<br /><br />';
-
- echo $lang['srv_excel_upload_note'];
-
+ echo '<p class="top16 bottom16"><input type="file" name="recipientsFile" id="recipientsFile" /></p>';
+
echo '</div>';
echo '</div>'; # id=inv_import_file
- echo '<br class="clr" />';
- echo '<span id="inv_upload_recipients_nosbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="append_submit(); return false;">'.$lang['srv_inv_btn_add_recipients_add'].'</a></span>';
-
+ echo '<div class="button_holder bottom16">';
+ echo '<button class="medium blue" onclick="append_submit(); return false;">'.$lang['srv_append_add'].'</button>';
+ echo '</div>';
+
$d = new Dostop();
if ($d->checkDostopSub('edit')){
- echo '<span style="margin: 5px 20px; line-height:24px">';
+ echo '<span class="red">';
printf($lang['src_coding_alert'], $this->anketa);
echo '</span>';
}
echo '</form>';
- echo '<br class="clr"/>';
//echo '</div>'; # id=inv_import_list_container
@@ -203,15 +228,19 @@ class SurveyAppendMerge {
echo '<input type="hidden" name="do" value="0">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
- # sporočilo za personalizirana e-vabila in respondente iz baze
- echo $lang['srv_merge_note'];
-
+ //Opis združevanja podatkov
+ echo '<p class="bottom16">'.$lang['srv_merge_note'].'</p>';
+
// Korak 1
- echo $lang['srv_merge_step1'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_merge_step1'].'</p>';
+ echo '<div class="appendmerge_indent">';
+
+ echo '<ul>';
+ echo '<li>'.$lang['srv_merge_step1_notea'].'</li>';
+ echo '<li>'.$lang['srv_merge_step1_noteb'].'</li>';
+ echo '<li>'.$lang['srv_merge_step1_notec'].'</li>';
+ echo '</ul>';
- echo $lang['srv_merge_step1_note'];
-
echo '<div id="inv_field_container">';
echo '<ul class="connectedSortable">';
@@ -222,14 +251,13 @@ class SurveyAppendMerge {
$is_selected = false;
# če je polje obkljukano
- $css = $is_selected ? ' class="inv_field_enabled"' : '';
-
+ $css = $is_selected ? ' class="inv_field_enabled"' : '';
# labela sproži klik checkboxa
$label_for = ' for="'.$field.'_chk"';
- echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" name="fields[]" value="'.$field.'" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').' '.($merge?' onclick="merge_getItems();"':'').'>';
+ echo '<li id="'.$field.'"'.$css.' data-tip="'.$field_types[$field].'">';
+ echo '<input id="'.$field.'_chk" type="checkbox" name="fields[]" value="'.$field.'" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').' '.($merge?' onclick="merge_getItems();"':'').'>';
echo '<label'.$label_for.' style="display: inline">'.$text_label.'</label>';
echo '</li>';
@@ -238,33 +266,40 @@ class SurveyAppendMerge {
}
}
}
- echo '</ul><br />';
- echo '</div>';
+ echo '</ul>';
echo '</div>';
-
+ echo '<p>'.$lang['srv_merge_step1_noted'].'</p>';
+
+ echo '</div>';
+
// Korak 2
- echo $lang['srv_merge_step2'];
- echo '<div class="append_step">';
-
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { append_refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
-
- echo '<span><label><input name="inv_import_type" id="inv_import_type0" type="radio" value="0" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m='.$_GET['m'].'\');" checked="checked">';
- echo ''.$lang['srv_iz_seznama'].'</label></span>';
- echo '<span><label><input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m=upload_xls\');">';
- echo ''.$lang['srv_iz_excela'].'</label></span>';
-
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
-
- echo '</div>';
+ echo '<p class="bold">'.$lang['srv_merge_step2'].'</p>';
+
+ echo '<div class="appendmerge_indent">';
+ echo '<script type="text/javascript">initAppendMergeConnectedSortable();</script>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_appendmerge_source'].'</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input name="inv_import_type" id="inv_import_type0" type="radio" value="0" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m='.$_GET['m'].'\');" checked="checked">';
+ echo '<label for="inv_import_type0">'.$lang['srv_iz_seznama'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="append_change_import_type(\''.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m=upload_xls\');">';
+ echo '<label for="inv_import_type1">'.$lang['srv_iz_excela'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
// Korak 3
- echo $lang['srv_merge_step3'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_merge_step3'].'</p>';
+
+ echo '<div class="appendmerge_indent">';
echo '<input type="hidden" name="do_merge" value="1" id="do_merge">';
echo '<p>'.$lang['srv_izberite_identifikator'].'</p>';
@@ -277,25 +312,38 @@ class SurveyAppendMerge {
echo '<div id="inv_import_list"'.($import_type != 1 ? '' : ' style="display:none"').'>' ;
// Korak 4
- echo $lang['srv_merge_step4'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_merge_step4'].'</p>';
+
+ echo '<div class="appendmerge_indent">';
- echo $lang['srv_merge_step4_note'];
+ echo '<ul>';
+ echo '<li>'.$lang['srv_append_step3_note1'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note2'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note3'].'</li>';
+ echo '</ul>';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '</span>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_0">';
+ echo '<p class="top16 bottom16">'.$lang['srv_append_step3_note4'].'</p>';
+
+ echo '<ul>';
+ echo '<li>'.$lang['srv_append_step3_note5'].'</li>';
+ echo '<li>'.$lang['srv_append_step3_note6'].'</li>';
+ echo '</ul>';
+
+ echo '<p class="top16 bottom16">'.$lang['srv_append_step3_note7'].'</p>';
+ echo '<p>'.$lang['srv_append_step3_note8'].'</p>';
+ echo '<p>'.$lang['srv_append_step3_note9'].'</p>';
+
+ echo '<p class="top16">'.$lang['srv_append_step3_note10'].' <span id="inv_field_list" class="inv_type_0 bold">';
echo implode(',',$field_lang);
echo '</span>';
- echo '<br class="clr" /><textarea id="inv_recipients_list" cols="50" rows="9" name="inv_recipients_list" style="margin-bottom: 7px;">';
+
+ $recipients_list = isset($_POST['inv_recipients_list']) ? mysql_real_unescape_string( $_POST['inv_recipients_list']) : array();
+
+ echo '<textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($recipients_list) && count($recipients_list) > 0 ) {
echo implode("\n",$recipients_list);
}
echo '</textarea>';
- echo '<br class="clr"/>';
echo '</div>';
echo '</div>'; # id=inv_import_list
@@ -304,34 +352,27 @@ class SurveyAppendMerge {
echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' style="display:none"').'>' ;
// Korak 4
- echo $lang['srv_merge_step4'];
- echo '<div class="append_step">';
+ echo '<p class="bold">'.$lang['srv_merge_step4_xls'].'</p>';
+ echo '<div class="appendmerge_indent">';
- echo $lang['srv_mailing_upload_list'];
echo ' <input type="file" name="recipientsFile" id="recipientsFile" />';
- echo '<br class="clr" /><br />';
-
- echo $lang['srv_excel_upload_note'];
-
echo '</div>';
echo '</div>'; # id=inv_import_file
-
- echo '<br class="clr" />';
- echo '<span id="inv_upload_recipients_nosbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="append_submit(); return false;">'.$lang['srv_inv_btn_add_recipients_add'].'</a></span>';
-
+ echo '<div class="button_holder bottom16">';
+ echo '<button class="medium blue" onclick="append_submit(); return false;">'.$lang['srv_merge_add'].'</button>';
+ echo '</div>';
+
$d = new Dostop();
if ($d->checkDostopSub('edit')){
- echo '<span style="margin: 5px 20px; line-height:24px">';
+ echo '<span class="red">';
printf($lang['src_coding_alert'], $this->anketa);
echo '</span>';
}
echo '</form>';
- echo '<br class="clr"/>';
-
echo '</fieldset>';
}
}
@@ -342,14 +383,13 @@ class SurveyAppendMerge {
global $global_user_id;
# dodamo uporabnike
- $fields = $_POST['fields'];
+ $fields = isset($_POST['fields']) ? $_POST['fields'] : array();
$recipients_list = mysql_real_unescape_string( $_POST['inv_recipients_list'] );
- $merge = (int)$_POST['merge'];
+ $merge = isset($_POST['merge']) ? (int)$_POST['merge'] : 0;
$do_merge = (int)$_POST['do_merge'];
$import_type = (int)$_POST['inv_import_type'];
if ($_POST['do']=='1') $do = true; else $do = false;
-
-
+
// ce uploadamo datoteko
if ($import_type == 1) {
@@ -412,26 +452,31 @@ class SurveyAppendMerge {
// napaka
if ($result <= 0) {
echo '<h2>'.$lang['error'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="append_submit_close(); return false;"">✕</a></div>';
if ($result < 0)
echo '<p>'.$output.'</p>';
else
echo '<p>'.$lang['srv_append-merge_error_value'].'</p>';
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" onclick="append_submit_close(); return false;"><span>'.$lang['back'].'</span></a></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="append_submit_close(); return false;">'.$lang['back'].'</button>';
+ echo '</div>';
} else {
echo '<h2>'.$lang['srv_potrditev'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="append_submit_close(); return false;"">✕</a></div>';
if ($do_merge == 0)
echo '<p>'.$lang['srv_append-merge_process_1'].' '.$result.' '.$lang['srv_append-merge_process_2'].'. '.'</p>';
else
echo '<p>'.$lang['srv_append-merge_process_o_1'].' '.$result.' '.$lang['srv_append-merge_process_o_2'].'</p>';
-
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" onclick="append_submit_close(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange" onclick="append_submit(1); return false;"><span>'.$lang['srv_potrdi'].'</span></a></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="append_submit_close(); return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="append_submit(1); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
@@ -439,25 +484,27 @@ class SurveyAppendMerge {
} else {
echo '<h2>'.$lang['fin_import_ok'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="append_submit_close(); return false;"">✕</a></div>';
echo '<p>'.$output.'</p>';
- echo '<p>'.$lang['srv_append-merge_fin'].'</p>';
-
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" href="index.php?anketa='.$this->anketa.'&a=data'.(count($this->usr_ids) < 100?'&highlight_usr='.implode('-', $this->usr_ids).'':'').'"><span>'.$lang['data_show'].'</span></a></span>';
-
+ if ($do_merge == 0) echo '<p>'.$lang['srv_append-merge_fin'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="append_submit_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=data'.(count($this->usr_ids) < 100?'&highlight_usr='.implode('-', $this->usr_ids).'':'').'\'">'.$lang['data_show'].'</button>';
+ echo '</div>';
}
if ($import_type == 1){
- echo '<br /><br />';
echo '</fieldset>';
}
}
private $usr_ids = array();
- function appendData($do = true, $fields, $rawdata) {
+ function appendData($do, $fields, $rawdata) {
if ($do) TrackingClass::update($this->anketa, 1);
-
+
if (false) {
echo 'dumping for append:';
echo '<pre>';
@@ -480,7 +527,7 @@ class SurveyAppendMerge {
while ($row = mysqli_fetch_array($sql)) {
$tip[$row['id']] = $row['tip'];
- if ( in_array($row['tip'], array(1, 2, 3)) ) {
+ if ( in_array($row['tip'], array(1, 2, 3, 6)) ) {
$s = sisplet_query("SELECT id, variable FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
while ($r = mysqli_fetch_array($s)) {
@@ -496,7 +543,7 @@ class SurveyAppendMerge {
}
$added = 0;
foreach ($data AS $dataline) {
- $line = explode(',', $dataline);
+ $line = explode(';', $dataline);
foreach ($line AS $key => $val) {
$line[$key] = trim($val);
@@ -511,16 +558,16 @@ class SurveyAppendMerge {
}
function insertLine($line,$fields,$tip,$vre_id,$do,$fromExcel=false){
-
$added=0;
-
+
// izberemo random hash, ki se ni v bazi
$ip = GetIP();
do {
$rand = md5(mt_rand(1, mt_getrandmax()).'@'.$ip);
$sql = sisplet_query("SELECT id FROM srv_user WHERE cookie = '$rand'");
} while (mysqli_num_rows($sql) > 0);
-
+
+ $usr_id = 0;
// nov user
if ($do) {
$sql = sisplet_query("INSERT INTO srv_user (id, ank_id, cookie, time_insert, time_edit, last_status, lurker) VALUES ('', '$this->anketa', '$rand', NOW(), NOW(), '5', '0')");
@@ -531,41 +578,106 @@ class SurveyAppendMerge {
if ($usr_id > 0 || $do==false) {
$this->usr_ids[] = $usr_id;
-
+
$i = 0;
+ // pri excel uvozu so stolpci posebej pri check za vsak check, to je potem difference med stevcem spremenljivk ($i) in dejanskih stolpcev (i+vre_diff)
+ $vre_diff = 0;
foreach ($fields AS $id) {
-
+
if ($do) {
if ( in_array($tip[$id], array(1, 3)) ) {
-
- $vre = $vre_id[$id][$line[$i]];
-
+
+ $vre = isset($vre_id[$id][$line[$i+$vre_diff]]) ? $vre_id[$id][$line[$i+$vre_diff]] : '';
+
if ($vre != '') {
$sql = sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id, loop_id) VALUES ('$id', '$vre', '$usr_id', NULL)");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
}
} elseif ( in_array($tip[$id], array(2)) ) {
-
- $checks = explode(' ', $line[$i]);
-
- if ( count($checks) > 0 ) {
+
+ $checks = array();
+ //array vrednosti checkboxov (array 1 in 0 po vrsti, deljeni s presledkom)
+ if(!$fromExcel)
+ $checks = isset($line[$i+$vre_diff]) ? explode(' ', $line[$i+$vre_diff]) : array();
+ else{
+ //pri excel prestejemo vrednosti v spremenljivki
+ $sql = sisplet_query("SELECT COUNT(*) as cnt FROM srv_vrednost WHERE spr_id='$id'");
+ if ($sql) {
+ $row = mysqli_fetch_array($sql);
+ //izrezemo stolpce, ki so vrednosti spremenljivke checkbox
+ $checks = array_slice($line, $i+$vre_diff, $row['cnt']);
+ }
+ }
+
+ if ( count($checks) > 0) {
$sql = sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
- foreach ($checks AS $k => $v) {
-
- $vre = $vre_id[$id][$v];
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
- if ($vre != '') {
-
+ //ce obstaja vrednost in je checkbox nastavljen na 1, potem shrani v bazo vrednost
+ if ($vre != '' && $v == 1) {
$sql = sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id, loop_id) VALUES ('$id', '$vre', '$usr_id', NULL)");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
}
+ }
+
+ //ce smo v excel, pristejemo razliko vseh vrednosti v stevec (-1 ker se 1 steje sama spremenljivka)
+ if($fromExcel) $vre_diff += count($checks)-1;
+ }
+
+ } elseif ( in_array($tip[$id], array(6)) ) {
+
+ //podnobno, kot pri check, je tukaj vrednost vprasanje v tabeli
+ $checks = array();
+ //array vrednosti tabele (array 1 in 0 po vrsti, deljeni s presledkom)
+ if(!$fromExcel)
+ $checks = isset($line[$i+$vre_diff]) ? explode(' ', $line[$i+$vre_diff]) : array();
+ else{
+ //pri excel prestejemo vrednosti v spremenljivki
+ $sql = sisplet_query("SELECT COUNT(*) as cnt FROM srv_vrednost WHERE spr_id='$id'");
+ if ($sql) {
+ $row = mysqli_fetch_array($sql);
+ //izrezemo stolpce, ki so vrednosti spremenljivke tabela
+ $checks = array_slice($line, $i+$vre_diff, $row['cnt']);
+ }
+ }
+
+ if ( count($checks) > 0) {
+ $sql = sisplet_query("DELETE FROM srv_data_grid".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //get number of grids for this question
+ $sqlg = sisplet_query("SELECT grids FROM srv_spremenljivka WHERE id='$id'");
+ $grids_num = mysqli_fetch_array($sqlg)['grids'];
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
+
+ //ce obstaja vrednost jo shrani v bazo
+ if ($vre != '' && is_numeric($v) && $v > 0 && $v <= $grids_num) {
+ $sql = sisplet_query("INSERT INTO srv_data_grid".$this->db_table." (spr_id, vre_id, usr_id, grd_id, loop_id) VALUES ('$id', '$vre', '$usr_id', '$v', NULL)");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
}
+
+ //ce smo v excel, pristejemo razliko vseh vrednosti v stevec (-1 ker se 1 steje sama spremenljivka)
+ if($fromExcel) $vre_diff += count($checks)-1;
}
} elseif ( in_array($tip[$id], array(7, 21, 8)) ) {
@@ -576,21 +688,32 @@ class SurveyAppendMerge {
$vre = 0;
}
+ $value = $line[$i+$vre_diff];
+
if ($tip[$id] == 8)
{
#datum prekodiramo v pravo obliko
- $value = PHPExcel_Style_NumberFormat::toFormattedString($line[$i], "D.M.YYYY");
+ //$value = PHPExcel_Style_NumberFormat::toFormattedString($line[$i], "D.M.YYYY");
+
+ // Create a DateTime object from the input date string
+ $date = new DateTime($value);
+ // Format the date as "D.M.YYYY"
+ $value = $date->format('d.m.Y');
}
- else
- {
- $value = $line[$i];
- }
+ //brisi vse vejice in pusti samo zadnjo piko za decimalke
+ elseif($tip[$id] == 7){
+ // Replace all commas with dots
+ $value = str_replace(',', '.', $value);
+ // Remove all dots except the last one
+ $value = preg_replace('/\.(?=.*\.)/', '', $value);
+ }
+
$sql = sisplet_query("INSERT INTO srv_data_text".$this->db_table." (id, spr_id, vre_id, text, text2, usr_id, loop_id) VALUES ('', '$id', '$vre', '$value', '', '$usr_id', NULL)");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
}
}
-
+
$i++;
}
$added++;
@@ -598,7 +721,7 @@ class SurveyAppendMerge {
return $added;
}
- function mergeData($do = true, $fields, $rawdata, $merge) {
+ function mergeData($do, $fields, $rawdata, $merge) {
if ($do) TrackingClass::update($this->anketa, 1);
if (false) {
@@ -631,7 +754,7 @@ class SurveyAppendMerge {
while ($row = mysqli_fetch_array($sql)) {
$tip[$row['id']] = $row['tip'];
- if ( in_array($row['tip'], array(1, 2, 3)) ) {
+ if ( in_array($row['tip'], array(1, 2, 3, 6)) ) {
$s = sisplet_query("SELECT id, variable FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
while ($r = mysqli_fetch_array($s)) {
@@ -652,7 +775,7 @@ class SurveyAppendMerge {
foreach ($data AS $dataline) {
- $line = explode(',', $dataline);
+ $line = explode(';', $dataline);
foreach ($line AS $key => $val) {
$line[$key] = trim($val);
@@ -663,8 +786,8 @@ class SurveyAppendMerge {
// poiscemo userja za merge
if ( in_array($merge_tip, array(1, 2, 3)) ) {
- $sqlu = sisplet_query("SELECT usr_id FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$merge' AND vre_id='".$vre_id[$merge][$line[$merge_key]]."'");
-
+ $sqlu = sisplet_query("SELECT usr_id FROM srv_data_vrednost".$this->db_table." LEFT JOIN srv_user ON srv_user.id = srv_data_vrednost".$this->db_table.".usr_id WHERE spr_id='$merge' AND vre_id='".$vre_id[$merge][$line[$merge_key]]."' AND deleted = '0'");
+
} elseif ( in_array($merge_tip, array(7, 21, 8)) ) {
if ($merge_tip == 21) {
$vre = $vre_id[$merge];
@@ -672,7 +795,7 @@ class SurveyAppendMerge {
$vre = 0;
}
- $sqlu = sisplet_query("SELECT usr_id FROM srv_data_text".$this->db_table." WHERE spr_id='$merge' AND vre_id='$vre' AND text='$line[$merge_key]'");
+ $sqlu = sisplet_query("SELECT usr_id FROM srv_data_text".$this->db_table." LEFT JOIN srv_user ON srv_user.id = srv_data_vrednost".$this->db_table.".usr_id WHERE spr_id='$merge' AND vre_id='$vre' AND text='$line[$merge_key]' AND deleted = '0'");
}
if (!$sqlu) echo mysqli_error($GLOBALS['connect_db']);
@@ -706,38 +829,86 @@ class SurveyAppendMerge {
}
} elseif ( in_array($tip[$id], array(2)) ) {
-
+
$checks = explode(' ', $line[$i]);
-
+
if ( count($checks) > 0 ) {
-
+
$sql = sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
-
- foreach ($checks AS $k => $v) {
-
- $vre = $vre_id[$id][$v];
-
- if ($vre != '') {
+
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
+ //ce obstaja vrednost in je checkbox nastavljen na 1, potem shrani v bazo vrednost
+ if ($vre != '' && $v == 1) {
$sql = sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id, loop_id) VALUES ('$id', '$vre', '$usr_id', NULL)");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
}
}
}
-
+ } elseif ( in_array($tip[$id], array(6)) ) {
+
+ $checks = explode(' ', $line[$i]);
+
+ if ( count($checks) > 0 ) {
+
+ $sql = sisplet_query("DELETE FROM srv_data_grid".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //get number of grids for this question
+ $sqlg = sisplet_query("SELECT grids FROM srv_spremenljivka WHERE id='$id'");
+ $grids_num = mysqli_fetch_array($sqlg)['grids'];
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
+
+ //ce obstaja vrednost in je checkbox nastavljen na 1, potem shrani v bazo vrednost
+ if ($vre != '' && is_numeric($v) && $v > 0 && $v <= $grids_num) {
+ $sql = sisplet_query("INSERT INTO srv_data_grid".$this->db_table." (spr_id, vre_id, usr_id, grd_id, loop_id) VALUES ('$id', '$vre', '$usr_id', '$v', NULL)");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ }
} elseif ( in_array($tip[$id], array(7, 21, 8)) ) {
+ $value = $line[$i];
+
if ($tip[$id] == 21) {
$vre = $vre_id[$id];
} elseif ($tip[$id] == 7 || $tip[$id] == 8) {
$vre = 0;
+
+ if($tip[$id] == 8){
+ // Create a DateTime object from the input date string
+ $date = new DateTime($line[$i]);
+ // Format the date as "D.M.YYYY"
+ $value = $date->format('d.m.Y');
+ }
+
+ //brisi vse vejice in pusti samo zadnjo piko za decimalke
+ elseif($tip[$id] == 7){
+ // Replace all commas with dots
+ $value = str_replace(',', '.', $value);
+ // Remove all dots except the last one
+ $value = preg_replace('/\.(?=.*\.)/', '', $value);
+ }
}
// ker je primary nastavljen na ID, moramo najprej pobrisat
$sql = sisplet_query("DELETE FROM srv_data_text".$this->db_table." WHERE spr_id='$id' AND vre_id='$vre' AND usr_id='$usr_id'");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
- $sql = sisplet_query("INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ('$id', '$vre', '$line[$i]', '$usr_id')");
+ $sql = sisplet_query("INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ('$id', '$vre', '$value', '$usr_id')");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
}
}
@@ -757,8 +928,14 @@ class SurveyAppendMerge {
function upload_xls(){
global $lang, $site_url,$site_path,$global_user_id;
-
- echo '<fieldset><legend>'.$lang['srv_data_subnavigation_append'].'</legend>';
+
+ $do_merge = isset($_POST['do_merge']) ? (int)$_POST['do_merge'] : 0;
+
+ // prikazemo obvestilo in formo za potrditev
+ if ($do_merge == 1)
+ echo '<fieldset><legend>'.$lang['srv_data_subnavigation_merge'].'</legend>';
+ else
+ echo '<fieldset><legend>'.$lang['srv_data_subnavigation_append'].'</legend>';
if (isset($_POST['fields']) && count($_POST['fields']) > 0){
@@ -768,28 +945,32 @@ class SurveyAppendMerge {
&& (int)$_FILES['recipientsFile']['error'] == 0
&& (pathinfo($_FILES['recipientsFile']['name'],PATHINFO_EXTENSION) == 'xls' || pathinfo($_FILES['recipientsFile']['name'],PATHINFO_EXTENSION) == 'xlsx') )
{
-
+
$orig_parts = pathinfo($_FILES["recipientsFile"]["name"]);
$path_parts = pathinfo($_FILES["recipientsFile"]["tmp_name"]);
-
+
$fileName = $this->anketa.'_'.$global_user_id.'_'.$path_parts['filename'].'.'.$orig_parts['extension'];
$file = $site_path.'admin/survey/tmp/'.$fileName;
$move = move_uploaded_file($_FILES['recipientsFile']['tmp_name'], $file);
if ($move == true){
+ //$spreadsheet = new Spreadsheet();
+
#spremenljivke
$field_list = array();
- $sql = sisplet_query("SELECT s.id, s.variable, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1, 2, 3, 7, 8, 21) ORDER BY g.vrstni_red, s.vrstni_red");
+ $sql = sisplet_query("SELECT s.id, s.variable, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1, 2, 3, 7, 8, 21, 6) ORDER BY g.vrstni_red, s.vrstni_red");
while ($row = mysqli_fetch_array($sql)) {
- $field_list[$row['id']] = $row['variable'] . ' ('.($row['tip']==1?'radio':'').($row['tip']==2?'checkbox':'').($row['tip']==3?'dropdown':'').($row['tip']==21?'text':'').($row['tip']==7?'number':'').($row['tip']==8?'date':'').')';
+ $field_list[$row['id']] = $row['variable'] . ' ('.($row['tip']==1?'radio':'').($row['tip']==2?'checkbox':'').($row['tip']==3?'dropdown':'').($row['tip']==21?'text':'').($row['tip']==7?'number':'').($row['tip']==8?'date':'').($row['tip']==6?'table':'').')';
}
-
- include_once("./excel/PHPExcel.php");
- require_once("./excel/PHPExcel/IOFactory.php");
$result = array();
- $objPHPExcel = PHPExcel_IOFactory::load($file);
- $objWorksheet = $objPHPExcel->getActiveSheet();
+ $objPHPExcel = array();
+ if($orig_parts['extension'] == 'xls')
+ $objPHPExcel = IOFactory::createReader('Xls')->load($file);
+ else
+ $objPHPExcel = IOFactory::load($file);
+
+ $objWorksheet = $objPHPExcel->getSheet(0);
// Get worksheet dimensions
$highestRow = $objWorksheet->getHighestRow();
@@ -802,9 +983,11 @@ class SurveyAppendMerge {
$columns[] = $column;
}
- echo '<form id="append_xml" name="resp_uploader" enctype="multipart/form-data" method="POST" action="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m=append_xls">';
+ echo '<form id="append_xml" name="resp_uploader" enctype="multipart/form-data" method="POST" action="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=data&m='
+ .((isset($_POST['do_merge']) && $_POST['do_merge'] == 1) ? 'merge_xls' : 'append_xls').'">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
echo '<input type="hidden" name="file" value="'.$fileName.'">';
+ echo '<input type="hidden" name="merge" value="'.(isset($_POST["merge"]) ? $_POST["merge"] : 0).'">';
foreach ($_POST['fields'] AS $field)
{
echo '<input id="'.$field.'_chk" type="hidden" name="fields[]" value="'.$field.'" />';
@@ -813,12 +996,12 @@ class SurveyAppendMerge {
echo $lang['srv_append_xls_note'];
echo '<div id="inv_field_container">';
- echo '<div class="append_step">';
+ echo '<div class="appendmerge_indent">';
echo '<ul class="connectedSortable">';
foreach ($_POST['fields'] AS $spr_id)
{
- echo '<li class="inv_field_enabled"><label>'.$field_list[$spr_id].'</label></li>';
+ echo '<li class="inv_field_enabled nocursor"><label>'.$field_list[$spr_id].'</label></li>';
}
echo '</ul>';
echo '</div>';
@@ -826,32 +1009,41 @@ class SurveyAppendMerge {
if (count($columns) > 0){
- echo $lang['srv_append_xls_step1'];
+ echo '<p>'.$lang['srv_append_xls_step1'].'</p>';
echo '<div id="inv_field_container">';
- echo '<div class="append_step">';
+ echo '<div class="appendmerge_indent">';
echo '<ul class="connectedSortable">';
foreach ($columns AS $column){
- echo '<li><label><input type="checkbox" name="xls_column[]" value="'.$column.'">'.$column.'</label></li>';
+ echo '<li><input type="checkbox" name="xls_column[]" id="'.$column.'" value="'.$column.'"><label for="'.$column.'">'.$column.'</label></li>';
}
echo '</ul>';
echo '</div>';
echo '</div>';
}
+ echo $lang['srv_append_xls_step2'];
- echo $lang['srv_append_xls_step1'];
+ echo '<div class="appendmerge_indent">';
- echo '<div class="append_step">';
- echo '<p>'.$lang['srv_append_xls_step2_begin'].': <input name="start_row" type="number" min="1" max="'.(int)$highestRow.'" value="1"></p>';
- echo '<p>'.$lang['srv_append_xls_step2_end'].': <input name="end_row" type="number" min="1" max="'.(int)$highestRow.'" value="'.(int)$highestRow.'"></p>';
- echo '<span id="inv_upload_recipients_nosbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="$(\'#append_xml\').submit();">'.$lang['srv_inv_btn_add_recipients_add'].'</a></span>';
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_append_xls_step2_begin'].'</label>';
+ echo '<input name="start_row" type="number" min="1" max="'.(int)$highestRow.'" value="1">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_append_xls_step2_end'].'</label>';
+ echo '<input name="end_row" type="number" min="1" max="'.(int)$highestRow.'" value="'.(int)$highestRow.'">';
+ echo '</div>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button class="medium blue" onclick="$(\'#append_xml\').submit();">'.($do_merge == 1 ? $lang['srv_merge_add']:$lang['srv_append_add']).'</button>';
+ echo '</div>';
+
echo '</div>';
- echo '</form>';
- }
+ echo '</form>'; }
}
elseif(pathinfo($_FILES['recipientsFile']['name'],PATHINFO_EXTENSION) != 'xls' && pathinfo($_FILES['recipientsFile']['name'],PATHINFO_EXTENSION) != 'xlsx'){
echo $lang['srv_iz_excela_xls_error'];
@@ -862,7 +1054,7 @@ class SurveyAppendMerge {
}
else
{
- echo 'No list';
+ echo $lang['srv_append-merge_required_questions'];
}
echo '</fieldset>';
@@ -873,29 +1065,27 @@ class SurveyAppendMerge {
$fileName = $_POST['file'];
$file = $site_path.'admin/survey/tmp/'.$fileName;
+ $orig_parts = pathinfo($fileName);
$columns = $_POST['xls_column'];
$fields = $_POST['fields'];
- $do_merge = (int)$_POST['do_merge'];
-
if (file_exists($file)
&& is_array($columns) && count($columns ) > 0
&& is_array($fields) && count($fields ) > 0)
{
$do = 1;
-
- include_once("./excel/PHPExcel.php");
- require_once("./excel/PHPExcel/IOFactory.php");
- $objPHPExcel = PHPExcel_IOFactory::load($file);
- $objWorksheet = $objPHPExcel->getActiveSheet();
+ if($orig_parts['extension'] == 'xls')
+ $objPHPExcel = IOFactory::createReader('Xls')->load($file);
+ else
+ $objPHPExcel = IOFactory::load($file);
+
+ $objWorksheet = $objPHPExcel->getSheet(0);
// Get worksheet dimensions
$highestRow = $objWorksheet->getHighestRow();
$highestColumn = $objWorksheet->getHighestColumn();
-
-
$start_row = min($_POST['start_row'],$highestRow);
$end_row = min($_POST['end_row'],$highestRow);
@@ -912,7 +1102,7 @@ class SurveyAppendMerge {
while ($row = mysqli_fetch_array($sql)) {
$tip[$row['id']] = $row['tip'];
- if ( in_array($row['tip'], array(1, 2, 3)) ) {
+ if ( in_array($row['tip'], array(1, 2, 3, 6)) ) {
$s = sisplet_query("SELECT id, variable FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
while ($r = mysqli_fetch_array($s)) {
@@ -938,14 +1128,15 @@ class SurveyAppendMerge {
$line[] = mysqli_real_escape_string($GLOBALS['connect_db'], $value);
#$line[] = mysqli_real_escape_string($GLOBALS['connect_db'], $objWorksheet->getCell("$column$row")->getValue());
}
- $added += $this->insertLine($line,$fields,$tip,$vre_id,$do);
+ $added += $this->insertLine($line,$fields,$tip,$vre_id,$do, true);
}
$result = $added;
}
else
{
- echo $lang['srv_append-merge_error_file'];
+ if(!file_exists($file)) $result = -1;
+ else $result = -3;
}
if ($result == -1) {
@@ -958,10 +1149,7 @@ class SurveyAppendMerge {
// prikazemo obvestilo in formo za potrditev
- if ($do_merge == 1)
- echo '<fieldset><legend>'.$lang['srv_data_subnavigation_merge'].'</legend>';
- else
- echo '<fieldset><legend>'.$lang['srv_data_subnavigation_append'].'</legend>';
+ echo '<fieldset><legend>'.$lang['srv_data_subnavigation_append'].'</legend>';
if ( ! $do ) {
@@ -973,18 +1161,11 @@ class SurveyAppendMerge {
echo '<p>'.$output.'</p>';
else
echo '<p>'.$lang['merge_error_value'].'.</p>';
-
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" onclick="append_submit_close(); return false;"><span>'.$lang['back'].'</span></a></span>';
-
} else {
echo '<h2>'.$lang['srv_potrditev'].'</h2>';
- if ($do_merge == 0)
- echo '<p>'.$lang['srv_append-merge_process_1'].' '.$result.' '.$lang['srv_append-merge_process_2'].'. </p>';
- else
- echo '<p>'.$lang['srv_append-merge_process_o_1'].' '.$result.' '.$lang['srv_append-merge_process_o_2'].'</p>';
-
+ echo '<p>'.$lang['srv_append-merge_process_1'].' '.$result.' '.$lang['srv_append-merge_process_2'].'. </p>';
echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="append_submit(1); return false;"><span>'.$lang['srv_potrdi'].'</span></a></span>';
echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" onclick="append_submit_close(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
@@ -993,15 +1174,333 @@ class SurveyAppendMerge {
// shranjeno, prikazemo resultat
} else {
- echo '<h2>'.$lang['fin_import_ok'].'</h2>';
+ echo '<p class="bold bottom16">'.$lang['fin_import_ok'].'</p>';
echo '<p>'.$output.'</p>';
echo '<p>'.$lang['fin_import_ok_text'].'</p>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button class="medium blue" onclick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=data\'">'.$lang['data_show'].'</button>';
+ echo '</div>';
+ }
+
+ echo '</fieldset>';
+ }
+
+ function merge_xls() {
+ global $lang, $site_url,$site_path,$global_user_id;
+
+ $fileName = $_POST['file'];
+ $file = $site_path.'admin/survey/tmp/'.$fileName;
+ $orig_parts = pathinfo($fileName);
+
+ $columns = $_POST['xls_column'];
+ $fields = $_POST['fields'];
+
+ $merge = isset($_POST['merge']) ? (int)$_POST['merge'] : 0;
+
+ if (count($fields) <= 0) return -1;
+ if ($merge <= 0) return -2;
+
+ if (file_exists($file)
+ && is_array($columns) && count($columns ) > 0
+ && is_array($fields) && count($fields ) > 0)
+ {
+ $do = 1;
+
+ if($orig_parts['extension'] == 'xls')
+ $objPHPExcel = IOFactory::createReader('Xls')->load($file);
+ else
+ $objPHPExcel = IOFactory::load($file);
+
+ $objWorksheet = $objPHPExcel->getSheet(0);
+
+ // Get worksheet dimensions
+ $highestRow = $objWorksheet->getHighestRow();
+ $highestColumn = $objWorksheet->getHighestColumn();
+
+ $start_row = min($_POST['start_row'],$highestRow);
+ $end_row = min($_POST['end_row'],$highestRow);
+ if ($end_row < $start_row)
+ {
+ $end_row = $start_row;
+ }
+
+ #podatki spremenljivk
+ $ids = array();
+ $tip = array();
+ $vre_id = array();
+ $sql = sisplet_query("SELECT id, tip FROM srv_spremenljivka WHERE id IN (".implode(',', $fields).")");
+ while ($row = mysqli_fetch_array($sql)) {
+ $tip[$row['id']] = $row['tip'];
+
+ if ( in_array($row['tip'], array(1, 2, 3, 6)) ) {
+
+ $s = sisplet_query("SELECT id, variable FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ while ($r = mysqli_fetch_array($s)) {
+ $vre_id[$row['id']][$r['variable']] = $r['id'];
+ }
+
+ } elseif ( in_array($row['tip'], array(7, 21,8)) ) {
+ // v tekstovno spremenljivko pisemo v prvo polje
+ $s = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red");
+ $r = mysqli_fetch_array($s);
+ $vre_id[$row['id']] = $r['id'];
+ }
+ }
+
+ $merge_key = array_keys($fields, $merge);
+ $merge_key = $merge_key[0];
+
+ $subarray = array_slice($fields, 0, $merge_key);
+
+ //stej offset stolpcev v excel, v primeru da ena spremenljivka ni en stolpec (npr. checkboxi)
+ $column_offset = 0;
+ foreach($subarray as $spr_id){
+ if($tip[$spr_id] == 2){
+ //pri excel prestejemo vrednosti v spremenljivki
+ $sql = sisplet_query("SELECT COUNT(*) as cnt FROM srv_vrednost WHERE spr_id='$spr_id'");
+ if ($sql) {
+ $row1 = mysqli_fetch_array($sql);
+ //izrezemo stolpce, ki so vrednosti spremenljivke checkbox
+ $column_offset += $row1['cnt'];
+ }
+ //odstejemo ena, ker sama spremenljivka v originalnem arrayu je en column (vse vrednosti pod eno spremenljivko)
+ $column_offset--;
+ }
+ }
+
+ //pristejemo offset k merge_key
+ $merge_key += $column_offset;
+
+ $merge_tip = $tip[$merge];
+
+ $merged = 0;
- echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" href="index.php?anketa='.$this->anketa.'&a=data"><span>'.$lang['data_show'].'</span></a></span>';
+ for ($row = $start_row; $row <= $end_row; ++$row)
+ {
+ $line=array();
+ foreach ($columns AS $column)
+ {
+ $value = $objWorksheet->getCell("$column$row")->getCalculatedValue();
+ $line[] = mysqli_real_escape_string($GLOBALS['connect_db'], $value);
+ #$line[] = mysqli_real_escape_string($GLOBALS['connect_db'], $objWorksheet->getCell("$column$row")->getValue());
+ }
+
+ if ($line[$merge_key] != '') {
+
+ // poiscemo userja za merge
+ if ( in_array($merge_tip, array(1, 2, 3)) ) {
+
+ $sqlu = sisplet_query("SELECT usr_id FROM srv_data_vrednost".$this->db_table." LEFT JOIN srv_user ON srv_user.id = srv_data_vrednost".$this->db_table.".usr_id WHERE spr_id='$merge' AND vre_id='".$vre_id[$merge][$line[$merge_key]]."' AND deleted = '0'");
+
+ } elseif ( in_array($merge_tip, array(7, 21, 8)) ) {
+ if ($merge_tip == 21) {
+ $vre = $vre_id[$merge];
+ } elseif ($merge_tip == 7 || $merge_tip == 8) {
+ $vre = 0;
+ }
+
+ $sqlu = sisplet_query("SELECT usr_id FROM srv_data_text".$this->db_table." WHERE spr_id='$merge' AND vre_id='$vre' AND text='$line[$merge_key]'");
+ }
+ if (!$sqlu) echo mysqli_error($GLOBALS['connect_db']);
+
+ while ($rowu = mysqli_fetch_array($sqlu)) {
+
+ if ($do) {
+ $usr_id = $rowu['usr_id'];
+
+ $s = sisplet_query("UPDATE srv_user SET time_edit=NOW() WHERE id='$usr_id'");
+ if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+
+ $this->usr_ids[] = $usr_id;
+ }
+
+ $i = 0;
+ // pri excel uvozu so stolpci posebej pri check za vsak check, to je potem difference med stevcem spremenljivk ($i) in dejanskih stolpcev (i+vre_diff)
+ $vre_diff = 0;
+ foreach ($fields AS $id) {
+
+ if ($id != $merge) {
+
+ if ($do) {
+
+ if ( in_array($tip[$id], array(1, 3)) ) {
+
+ $vre = isset($vre_id[$id][$line[$i+$vre_diff]]) ? $vre_id[$id][$line[$i+$vre_diff]] : '';
+
+ if ($vre != '') {
+ $sql = sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ $sql = sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id, loop_id) VALUES ('$id', '$vre', '$usr_id', NULL)");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
+
+ } elseif ( in_array($tip[$id], array(2)) ) {
+
+ //pri excel prestejemo vrednosti v spremenljivki
+ $sql = sisplet_query("SELECT COUNT(*) as cnt FROM srv_vrednost WHERE spr_id='$id'");
+ if ($sql) {
+ $row1 = mysqli_fetch_array($sql);
+ //izrezemo stolpce, ki so vrednosti spremenljivke checkbox
+ $checks = array_slice($line, $i+$vre_diff, $row1['cnt']);
+ }
+
+ if ( count($checks) > 0 ) {
+
+ $sql = sisplet_query("DELETE FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
+
+ //ce obstaja vrednost in je checkbox nastavljen na 1, potem shrani v bazo vrednost
+ if ($vre != '' && $v == 1) {
+ $sql = sisplet_query("INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id, loop_id) VALUES ('$id', '$vre', '$usr_id', NULL)");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+
+ //pristej vrednosti k offsetu kot differencial stolpcev in odstej ena zaradi spremenljivke
+ if(count($checks) > 1) $vre_diff += count($checks)-1;
+ }
+ } elseif ( in_array($tip[$id], array(6)) ) {
+
+ //pri excel prestejemo vrednosti v spremenljivki
+ $sql = sisplet_query("SELECT COUNT(*) as cnt FROM srv_vrednost WHERE spr_id='$id'");
+ if ($sql) {
+ $row1 = mysqli_fetch_array($sql);
+ //izrezemo stolpce, ki so vrednosti spremenljivke checkbox
+ $checks = array_slice($line, $i+$vre_diff, $row1['cnt']);
+ }
+
+ if ( count($checks) > 0 ) {
+
+ $sql = sisplet_query("DELETE FROM srv_data_grid".$this->db_table." WHERE spr_id='$id' AND usr_id='$usr_id' AND loop_id IS NULL");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+ //pridobi samo array vseh vrednosti po vrsti (id-ji)
+ $vrednosti_ids = array_values($vre_id[$id]);
+
+ //get number of grids for this question
+ $sqlg = sisplet_query("SELECT grids FROM srv_spremenljivka WHERE id='$id'");
+ $grids_num = mysqli_fetch_array($sqlg)['grids'];
+
+ //pojdi cez vse checkbox vrednosti
+ foreach ($checks AS $index => $v) {
+ //preveri, ce obstaja index vrednosti v array vrednosti
+ $vre = isset($vrednosti_ids[$index]) ? $vrednosti_ids[$index] : '';
+
+ //ce obstaja vrednost potem shrani v bazo
+ if ($vre != '' && is_numeric($v) && $v > 0 && $v <= $grids_num) {
+ $sql = sisplet_query("INSERT INTO srv_data_grid".$this->db_table." (spr_id, vre_id, usr_id, grd_id, loop_id) VALUES ('$id', '$vre', '$usr_id', '$v', NULL)");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+
+ //pristej vrednosti k offsetu kot differencial stolpcev in odstej ena zaradi spremenljivke
+ if(count($checks) > 1) $vre_diff += count($checks)-1;
+ }
+ } elseif ( in_array($tip[$id], array(7, 21, 8)) ) {
+
+ $value = $line[$i+$vre_diff];
+
+ if ($tip[$id] == 21) {
+ $vre = $vre_id[$id];
+ } elseif ($tip[$id] == 7 || $tip[$id] == 8) {
+ $vre = 0;
+
+ if($tip[$id] == 8){
+ // Create a DateTime object from the input date string
+ $date = new DateTime($value);
+ // Format the date as "D.M.YYYY"
+ $value = $date->format('d.m.Y');
+ }
+
+ //brisi vse vejice in pusti samo zadnjo piko za decimalke
+ elseif($tip[$id] == 7){
+ // Replace all commas with dots
+ $value = str_replace(',', '.', $value);
+ // Remove all dots except the last one
+ $value = preg_replace('/\.(?=.*\.)/', '', $value);
+ }
+ }
+
+ // ker je primary nastavljen na ID, moramo najprej pobrisat
+ $sql = sisplet_query("DELETE FROM srv_data_text".$this->db_table." WHERE spr_id='$id' AND vre_id='$vre' AND usr_id='$usr_id'");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ $sql = sisplet_query("INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ('$id', '$vre', '$value', '$usr_id')");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ }
+ $i++;
+ }
+ $merged++;
+ }
+ }
+ }
+
+ $result = $merged;
+ }
+ else
+ {
+ if(!file_exists($file)) $result = -1;
+ else $result = -3;
+ }
+
+ if ($result == -1) {
+ $output = $lang['srv_append-merge_required_field'];
+ } elseif ($result == -2) {
+ $output = $lang['srv_append-merge_required_id'];
+ } elseif ($result == -3) {
+ $output = $lang['srv_append-merge_required_data'];
+ } elseif ($result >= 0) {
+ $output = $lang['srv_append-merge_merged_1'].' '.$result.' '.$lang['srv_append-merge_merged_2'];
+ }
+
+
+ // prikazemo obvestilo in formo za potrditev
+ echo '<fieldset><legend>'.$lang['srv_data_subnavigation_merge'].'</legend>';
+
+ if ( ! $do ) {
+
+ // napaka
+ if ($result <= 0) {
+ echo '<h2>'.$lang['error'].'</h2>';
+
+ if ($result < 0)
+ echo '<p>'.$output.'</p>';
+ else
+ echo '<p>'.$lang['merge_error_value'].'.</p>';
+ } else {
+
+ echo '<h2>'.$lang['srv_potrditev'].'</h2>';
+
+ echo '<p>'.$lang['srv_append-merge_process_o_1'].' '.$result.' '.$lang['srv_append-merge_process_o_2'].'</p>';
+
+ echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" onclick="append_submit(1); return false;"><span>'.$lang['srv_potrdi'].'</span></a></span>';
+ echo '<span id="inv_upload_recipients_no_sbmt" class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_gray" onclick="append_submit_close(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
+ }
+
+ // shranjeno, prikazemo resultat
+ } else {
+
+ echo '<p class="bold bottom16">'.$lang['fin_import_ok'].'</p>';
+
+ echo '<p>'.$output.'</p>';
+ //echo '<p>'.$lang['fin_import_ok_text'].'</p>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button class="medium blue" onclick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=data\'">'.$lang['data_show'].'</button>';
+ echo '</div>';
}
- echo '<br /><br />';
echo '</fieldset>';
}
diff --git a/admin/survey/classes/class.SurveyCheck.php b/admin/survey/classes/class.SurveyCheck.php
new file mode 100644
index 0000000..40dde28
--- /dev/null
+++ b/admin/survey/classes/class.SurveyCheck.php
@@ -0,0 +1,346 @@
+<?php
+
+/*
+ * Preverjanje ankete - limiti velikosti, vabil, preverjanmje phishinga...
+ *
+ * Zaenkrat samo preverjamo in posljemo mail adminu
+ *
+ */
+
+class SurveyCheck {
+
+
+ var $anketa;
+
+ public function __construct($anketa){
+
+ if($anketa == null || $anketa <= 0)
+ return 'ID ankete ne obstaja!';
+
+ $this->anketa = $anketa;
+ }
+
+
+ // Preverimo stevilo vprasanj v anketi
+ public function checkLimitSpremenljivke(){
+
+ // Ce limit ni nastavljen ignoriramo
+ if(!AppSettings::getInstance()->getSetting('app_limits-question_count_limit'))
+ return true;
+
+ // Dobimo stevilo vprasanj v anketi
+ $stevilo_vprasanj = SurveyInfo::getInstance()->getSurveyQuestionCount();
+
+ // Obvestilo (mail adminu) posljemo pri dosezeni stevilki
+ if($stevilo_vprasanj == AppSettings::getInstance()->getSetting('app_limits-question_count_limit')){
+ $this->sendAlert($alert_type='limit_spremenljivke', $stevilo_vprasanj);
+ }
+
+ // Ce je v anketi ze vec vprasanj kot je limit
+ if($stevilo_vprasanj > AppSettings::getInstance()->getSetting('app_limits-question_count_limit')){
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ // Preverimo stevilo poslanih vabil
+ public function checkLimitVabila(){
+
+ // Ce limit ni nastavljen ignoriramo
+ if(!AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit'))
+ return true;
+
+ // Prestejemo poslana vabila
+ $sql = sisplet_query("SELECT count(id) AS stevilo_vabil
+ FROM srv_invitations_recipients
+ WHERE ank_id='".$this->anketa."' AND sent='1'
+ ");
+ $row = mysqli_fetch_array($sql);
+
+ $stevilo_vabil = $row['stevilo_vabil'];
+
+ // Obvestilo (mail adminu) posljemo pri dosezeni stevilki
+ if($stevilo_vabil == AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit')){
+ $this->sendAlert($alert_type='limit_vabila', $stevilo_vabil);
+ }
+
+ // Ce je poslanih ze vec vabil kot je limit
+ if($stevilo_vabil > AppSettings::getInstance()->getSetting('app_limits-invitation_count_limit')){
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ // Preverimo stevilo responsov na anketo
+ public function checkLimitResponses(){
+
+ // Ce limit ni nastavljen ignoriramo
+ if(!AppSettings::getInstance()->getSetting('app_limits-response_count_limit'))
+ return true;
+
+ // Dobimo stevilo odgovorov na anketo
+ $stevilo_odgovorov = SurveyInfo::getInstance()->getSurveyAnswersCount();
+ $stevilo_odgovorov_limit = AppSettings::getInstance()->getSetting('app_limits-response_count_limit');
+
+ // Obvestilo (mail adminu) posljemo pri dosezeni stevilki
+ if($stevilo_odgovorov > 0 && $stevilo_odgovorov % $stevilo_odgovorov_limit === 0){
+ $this->sendAlert($alert_type='limit_responses', $stevilo_odgovorov);
+
+ // Deaktiviramo anketo, ce je aktivna ?
+ }
+
+ // Ce je na anketo ze vec responsov kot je limit
+ if($stevilo_odgovorov > AppSettings::getInstance()->getSetting('app_limits-response_count_limit')){
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ // Preverimo ce je anketa potencialno phishing
+ public function checkPhishing(){
+ global $global_user_id;
+
+
+ // Dobimo stevilo vprasanj v anketi
+ $stevilo_vprasanj = SurveyInfo::getInstance()->getSurveyQuestionCount();
+
+ // Ce imamo v anketi 0 ali vec kot 5 vprasanj je vse ok
+ if($stevilo_vprasanj >= 5 || $stevilo_vprasanj == 0){
+ return false;
+ }
+
+
+ // Dobimo stevilo anket uporabnika
+ $sqlA = sisplet_query("SELECT count(id) AS count_surveys FROM srv_anketa WHERE insert_uid='".$global_user_id."'");
+ $rowA = mysqli_fetch_array($sqlA);
+
+ // Ce ima uporabnik ze vec anket je vse ok
+ if($rowA['count_surveys'] > 1){
+ return false;
+ }
+
+
+ // Prestejemo vprasanja po tipu
+ $sql = sisplet_query("SELECT count(s.id) AS count_questions
+ FROM srv_spremenljivka s, srv_grupa g
+ WHERE g.ank_id='".$this->anketa."' AND g.id=s.gru_id
+ AND (tip='21' OR tip='5')
+ ");
+ $row = mysqli_fetch_array($sql);
+
+ // Ce imamo v anketi manj kot 5 vprasanj in so vsa tipa nagovor ali text je potencialen phishing
+ if($row['count_questions'] == $stevilo_vprasanj){
+
+ // Posljemo mail adminu
+ $this->sendAlert($alert_type='phishing');
+
+ return true;
+ }
+ else{
+ return false;
+ }
+ }
+
+ // Pri izpolnjevanju ankete preverimo stevilo klikov na minuto - ce jih je prevec, respondenta zavrnemo, drugace se lahko sql zafila in streznik ni vec odziven
+ public function checkClicksPerMinute(){
+
+ // Ce maximum na minuto ni nastavljen ignoriramo limit
+ if(!AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit'))
+ return true;
+
+ // Preverimo ce gre za izpolnjevanje ankete
+ if($_SERVER["SCRIPT_NAME"] != '/main/survey/index.php')
+ return true;
+
+ // Preverimo ce gre za prvi prihod na doloceno stran ankete in ne na prvo stran
+ if(isset($_GET['grupa']))
+ return true;
+
+ // Preverimo ce je id ankete ustrezno nastavljen
+ if(!isset($this->anketa) || $this->anketa <= 0)
+ return true;
+
+
+ $click_time = time();
+
+ $sql = sisplet_query("SELECT click_count, click_time FROM srv_clicks WHERE ank_id='".$this->anketa."'");
+ if (mysqli_num_rows($sql) > 0) {
+
+ list($click_count, $first_click_time) = mysqli_fetch_array($sql);
+
+ // Ce nismo znotraj minute vse resetiramo in pustimo naprej
+ if($click_time - $first_click_time > 60){
+ $sqlI = sisplet_query("UPDATE srv_clicks SET click_count='1', click_time='".$click_time."' WHERE ank_id='".$this->anketa."'");
+ return true;
+ }
+
+ // Click count je ok - pustimo naprej
+ if($click_count <= AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit')){
+ $sqlI = sisplet_query("UPDATE srv_clicks SET click_count=click_count+1 WHERE ank_id='".$this->anketa."'");
+
+ // Dosegli smo limit - posljemo mail adminu
+ if($click_count == AppSettings::getInstance()->getSetting('app_limits-clicks_per_minute_limit')){
+
+ // TODO - da se poslje samo 1x, drugace konstantno letijo maili:D
+ // Includamo vse da lahko posljemo mail
+ //include_once('../../vendor/autoload.php');
+
+ // Posljemo mail adminu
+ //$this->sendAlert($alert_type='limit_clicks', $click_count);
+ }
+
+ return true;
+ }
+ // Click count je previsok - ZAVRNEMO
+ else{
+ // Prikazemo error stran ki jo refreshamo na 5 sekund
+ $this->displayClicksPerMinuteError();
+
+ return false;
+ }
+ }
+ else{
+ $sqlI = sisplet_query("INSERT INTO srv_clicks (ank_id, click_count, click_time) VALUES ('".$this->anketa."', '1', '".$click_time."')");
+ }
+
+ return true;
+ }
+
+
+ // Posljemo obvestilo adminu o prebitem limitu, phishing anketi...
+ private function sendAlert($alert_type, $count=0){
+ global $site_url;
+
+ // Alerta ne posljemo na lastnih instalacijah
+ if(isLastnaInstalacija())
+ return;
+
+ // Dobimo hash ankete
+ $anketa_hash = SurveyInfo::getInstance()->getSurveyColumn('hash');
+
+ switch($alert_type){
+
+ case 'limit_spremenljivke':
+ $title = 'Opozorilo - dosežena omejitev vprašanj';
+ $content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> ima doseženo omejitev števila vprašanj ('.$count.')!';
+
+ break;
+
+ case 'limit_responses':
+ $title = 'Opozorilo - dosežena omejitev odgovorov';
+ $content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> ima doseženo omejitev števila odgovorov ('.$count.')!';
+
+ break;
+
+ case 'limit_vabila':
+ $title = 'Opozorilo - dosežena omejitev vabil';
+ $content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> ima doseženo omejitev poslanih vabil ('.$count.')!';
+
+ break;
+
+ case 'phishing':
+ $title = 'Opozorilo - potencialna phishing anketa';
+ $content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> - potencialen phishing!';
+
+ break;
+
+ case 'limit_clicks':
+ $title = 'Opozorilo - dosežena omejitev klikov na minuto';
+ $content = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'">Anketa '.$this->anketa.'</a> ima doseženo omejitev klikov na minuto ('.$count.')!';
+
+ break;
+ }
+
+ // Dodamo se link do predogleda
+ $content .= '<br><br>Predogled ankete: <a href="'.$site_url.'a/'.$anketa_hash.'&preview=on">'.$site_url.'a/'.$anketa_hash.'&preview=on</a>';
+
+ try{
+ $MA = new MailAdapter($anketa=null, $type='admin');
+ //$MA->addRecipients('peter.hrvatin@gmail.com');
+ $MA->addRecipients('info@1ka.si');
+ $resultX = $MA->sendMail($content, $title);
+ }
+ catch (Exception $e){
+ }
+
+ // Zalogiramo opozorilo
+ $SL = new SurveyLog();
+ $SL->addMessage(SurveyLog::ERROR, $title.' - anketa '.$this->anketa);
+ $SL->write();
+ }
+
+ // Prikazemo stran z errorjem za presezeno stevilo klikov na minuto
+ private function displayClicksPerMinuteError(){
+ global $site_url;
+
+ $refresh_every = 5;
+
+ echo '<!DOCTYPE html>';
+ echo '<html>';
+
+ echo '<head>';
+ echo ' <title>Server Limit Reached</title>';
+ echo ' <meta http-equiv="refresh" content="'.$refresh_every.'" />';
+ echo ' <meta name="viewport" content="width=device-width, initial-scale=1.0" />';
+
+ echo ' <style>
+ body{
+ display: flex;
+ align-content: center;
+ height: 90vh;
+
+ flex-wrap: wrap;
+ align-content: center;
+ }
+ .main{
+ max-width: 1200px;
+ margin: 50px auto;
+ padding: 0 20px;
+
+ font-family: Montserrat, Arial, Sans-Serif !important;
+ color: #505050;
+ }
+ h1{
+ color: #1e88e5;
+ text-align: center;
+ margin: 30px 0;
+ }
+ hr{
+ margin: 50px 0;
+
+ border: 0;
+ border-top: 1px solid #ddeffd;
+ }
+ .loading{
+ margin: 50px 0;
+ text-align: center;
+ }
+ img{
+ width: 80px;
+ height: 80px;
+ }
+ </style>';
+ echo '</head>';
+
+ echo '<body><div class="main">';
+ echo ' <div class="loading"><img src="'.$site_url.'/public/img/icons/spinner.gif" /></div>';
+ echo ' <h1>Dosežena omejitev strežnika</h1>';
+ echo ' <h3>Prosimo, počakajte nekaj trenutkov. Trenutno je doseženo maksimalno število vnosov ankete na minuto.</h3>';
+ echo ' <hr>';
+ echo ' <h1>Server Limit Reached</h1>';
+ echo ' <h3>Please wait a few moments. Currently, the maximum number of survey entries per minute has been reached.</h3>';
+ echo '</div></body>';
+
+ echo '</html>';
+
+ die();
+ }
+}
+
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyComments.php b/admin/survey/classes/class.SurveyComments.php
new file mode 100644
index 0000000..5a4b04b
--- /dev/null
+++ b/admin/survey/classes/class.SurveyComments.php
@@ -0,0 +1,1866 @@
+<?php
+
+/*
+ *
+ * Komentarji (testiranje->komentarji)
+ *
+ */
+
+class SurveyComments {
+
+
+ var $anketa;
+ var $db_table = '';
+
+
+ public function __construct($anketa){
+
+ if($anketa == null || $anketa <= 0)
+ return 'ID ankete ne obstaja!';
+
+ $this->anketa = $anketa;
+
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+ }
+
+
+ // Izpis komentarjev (testiranje -> komentarji)
+ public function display_komentarji(){
+
+
+ // Izpisemo meni (2 zavihka na vrhu)
+ $this->display_menu_komentarji();
+
+ // Izpisemo vsebino glede na zavihek
+ if($_GET['a'] == 'komentarji'){
+ $this->display_komentarji_na_vprasanja();
+ }
+ else{
+ $this->display_splosni_komentarji();
+ }
+ }
+
+ // Meni na vrhu (preklop med splosnimi in komentarji na vprasanja)
+ private function display_menu_komentarji() {
+ global $lang;
+
+ // Prestejemo komentarje (nereseni/vsi)
+ $comment_count = $this->testiranje_komentarji_count();
+
+ echo '<div id="komentarji_top">';
+ echo '<div id="komentarji_list">';
+
+ // Komentarji na vprasanja
+ $question_comment_link = 'window.location.href=\'index.php?anketa=' . $this->anketa . '&amp;a=' . A_KOMENTARJI_ANKETA . '\'; return false;';
+
+ echo '<div class="list_item '.($_GET['a'] == A_KOMENTARJI_ANKETA ? 'active' : '').'" onclick="'.$question_comment_link.'">';
+ echo $lang['srv_testiranje_komentarji_anketa_title'];
+ echo ' (' . ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']); //nerešeni
+ echo '/' . ($comment_count['survey_resp']['all'] + $comment_count['survey_admin']['all']) . ')'; //vsi
+ echo '</div>';
+
+
+ // Komentarji na anketo
+ $survey_comment_link = 'window.location.href=\'index.php?anketa=' . $this->anketa . '&amp;a=' . A_KOMENTARJI . '\'; return false;';
+
+ echo '<div class="list_item '.($_GET['a'] == A_KOMENTARJI ? ' active' : '').'" onclick="'.$survey_comment_link.'">';
+ echo $lang['srv_testiranje_komentarji_title'];
+ echo ' (' . $comment_count['question']['unresolved'];
+ echo '/' . $comment_count['question']['all'] . ')';
+ echo '</div>';
+
+
+ echo '</div>'; //#komentarji_list
+
+ //Link na nastavitev komentarjev
+ $d = new Dostop();
+
+ # nastavitve komentarjev
+ if ($d->checkDostopSub('edit')) {
+ echo '<div id="analiza_right_options_holder" class="right_options_holder">';
+
+ echo '<div title="' . $lang['settings'] . '" id="analiza_right_options">';
+ echo '<a href="index.php?anketa=' . $this->anketa . '&a=urejanje" title="' . $lang['srv_settings_komentarji1'] . '">';
+ echo '<span class="faicon wheel_32"></span>';
+ echo '</a>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+ }
+
+ // Izpis zavihka SPLOSNI KOMENTARJI
+ private function display_splosni_komentarji() {
+ global $lang;
+ global $site_url;
+ global $admin_type;
+ global $global_user_id;
+
+ $b = new Branching($this->anketa);
+ $f = new Forum;
+ $d = new Dostop();
+
+ SurveySetting::getInstance()->Init($this->anketa);
+ $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
+ $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment');
+ $survey_comment_resp = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment_resp');
+ $comment_count = $this->testiranje_komentarji_count();
+ $commentmarks = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks');
+ $commentmarks_who = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks_who');
+
+ $sortpostorder = ($sortpostorder == '') ? 0 : $sortpostorder;
+ $commentmarks = ($commentmarks == '') ? 0 : $commentmarks;
+ $commentmarks_who = ($commentmarks_who == '') ? 0 : $commentmarks_who;
+
+ $rowa = SurveyInfo::getInstance()->getSurveyRow();
+
+
+ # VV: privzeto naj bodo samo nerešeni komentarji
+ if (!isset($_GET['only_unresolved'])) {
+ $_GET['only_unresolved'] = 1;
+ }
+
+ # samo nerešeni komentarji
+ if ($commentmarks == 0) {
+ echo '<div class="">';
+ echo '<input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji_anketa&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" '.($_GET['only_unresolved']==1?'checked':'').' />';
+ echo '<label for="only_unresolved">'.$lang['srv_comments_unresolved'].'</label>';
+ echo '</div>';
+
+ }
+ else {
+ echo $lang['move_show'].': <select id="only_unresolved" class="dropdown" name="" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji_anketa&only_unresolved=\'+$(\'#only_unresolved\').val(); " >
+ <option value="0"'.($_GET['only_unresolved']==0?' selected="selected"':'').'>'.$lang['all2'].'</option>
+ <option value="1"'.($_GET['only_unresolved']==1?' selected="selected"':'').'>'.$lang['srv_comments_unresolved'].'</option>
+ <option value="2"'.($_GET['only_unresolved']==2?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
+ <option value="3"'.($_GET['only_unresolved']==3?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
+ <option value="4"'.($_GET['only_unresolved']==4?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
+ <option value="5"'.($_GET['only_unresolved']==5?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
+ </select>';
+ }
+
+ $only_unresolved = " ";
+ switch($_GET['only_unresolved']){
+ case 1:
+ $only_unresolved = " AND ocena <= '1' ";
+ break;
+ case 2:
+ $only_unresolved = " AND ocena = '0' ";
+ break;
+ case 3:
+ $only_unresolved = " AND ocena = '1' ";
+ break;
+ case 4:
+ $only_unresolved = " AND ocena = '2' ";
+ break;
+ case 5:
+ $only_unresolved = " AND ocena = '3' ";
+ break;
+ default:
+ break;
+ }
+
+ echo '<div class="komentarji_anketa_holder">';
+
+ // Splosni komentarji urednikov - levo
+ echo '<div class="komentarji_anketa komentarji_ured">';
+
+ echo '<div class="comment_type">';
+
+ echo $lang['srv_admin_comment'].':';
+ /*Sort
+ echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
+ echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
+
+ echo '</div>';
+
+ $sql = sisplet_query("SELECT * FROM post WHERE tid='$rowa[thread]' ".$only_unresolved." ");
+ $rows = (mysqli_num_rows($sql) == 0) ? 0 : mysqli_num_rows($sql) - 1;
+ if ($rows > 0){
+
+ $i=0;
+ while ($row = mysqli_fetch_array($sql)) {
+
+ if (($i != 0 && $sortpostorder==0) || ($i < $rows && $sortpostorder==1)) {
+
+ echo '<div class="comment_box '.($row['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$row['id'].'">';
+
+ echo '<div class="by">';
+
+ $datetime = strtotime($row['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+
+ echo '<p>'.$lang['srv_comments_user'].'<span class="user">'.$f->user($row['uid']).'</span> <span class="date">('.$datetime.')</span></p>';
+
+
+ if ($admin_type <= 1 || $rowa['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ echo '<div class="options">';
+
+ echo '<div class="solve">';
+ if ($row['ocena']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$row['id'].'" onClick="toggleCommentOptions(\''.$row['id'].'\');"></span>';
+
+ echo '<div class="options_dropdown displayNone" id="options_'.$row['id'].'">';
+
+ echo '<div class="line">';
+ echo ' <a href="javascript:comment_on_comment_splosni(\''.$row['id'].'\',\''.$f->user($row['uid']).'\',\''.$datetime.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+
+ echo '<div class="line" onClick="survey_comment_delete(\''.$row['id'].'\');">';
+ echo '<span class="faicon trash empty link-right"></span>';
+ echo $lang['srv_comment_delete'];
+ echo '</div>';
+
+ echo '</div>';
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".options_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+ echo '</div>'; //options
+
+ }
+
+ echo '</div>'; //by
+
+
+ echo '<div class="content">';
+ echo $row['vsebina'];
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="reply_to_text" id="comment_on_comment_splosni_'.$row['id'].'"></div>';
+ }
+
+ $i++;
+ }
+ }
+ // Nimamo komentarja
+ else{
+ // Ce so komentarji aktivirani
+ if($survey_comment != ''){
+ echo '<p class="bottom16">'.$lang['srv_no_comments_solved'].'</p>';
+ }
+ else{
+ echo '<p class="bottom16">'.$lang['srv_no_comments'].'</p>';
+ }
+ }
+
+ // Dodajanje novega komentarja
+
+ echo '<div id="comment_toggle_0_4" class="add_comment_toggle pointer" onClick="toggleAddComment(\'0_4\')">';
+ echo '<span class="faicon inline_comment link-right"></span>';
+ echo $lang['srv_survey_general_comment'];
+ echo '</div>';
+
+ echo '<div class="comment_wrapper" id="comment_wrapper_0_4">';
+ echo '<div class="new_comment" id="survey_comment_0_4">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field(0, '1', '4', false);
+ echo '</div>';
+ echo '</div>';
+
+
+ echo '</div>';
+
+
+ // Splosni komentarji respondentov - desno
+ echo '<div class="komentarji_anketa komentarji_resp">';
+
+ echo '<div class="comment_type">';
+ echo $lang['srv_repondent_comment'].':';
+ /*Sort
+ echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
+ echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
+ echo '</div>';
+
+ $orderby = '';
+
+ $sql = sisplet_query("SELECT * FROM srv_comment_resp WHERE ank_id='$this->anketa' ".$only_unresolved." ORDER BY comment_time $orderby, id $orderby");
+ if (mysqli_num_rows($sql) > 0) {
+
+ while ($row = mysqli_fetch_array($sql)) {
+
+ echo '<div class="comment_box '.($row['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$row['id'].'">';
+
+ $datetime = strtotime($row['comment_time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<div class="by">';
+
+ if($row['usr_id'] == 0){
+ echo '<p>Respondent <span class="date">('.$datetime.')</span></p>';
+ }
+ else{
+ $sqlU = sisplet_query("SELECT name FROM users WHERE id='$row[usr_id]'");
+ $rowU = mysqli_fetch_array($sqlU);
+
+ $user = $rowU['name'];
+
+ echo '<p>'.$lang['srv_comments_user'].'<span class="user">'.$user.'</span> <span class="date">('.$datetime.')</span></p>';
+
+ }
+
+ if ($admin_type <= 1 || $rowa['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ echo '<div class="options">';
+
+ echo '<div class="solve">';
+ if ($row['ocena']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (\'2\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_survey_comment\', ocena: (\'0\'), id: \''.$row['id'].'\', anketa: \''.$rowa['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$row['id'].'" onClick="toggleCommentOptions(\''.$row['id'].'\');"></span>';
+
+ echo '<div class="options_dropdown displayNone" id="options_'.$row['id'].'">';
+
+ echo '<div class="line">';
+ echo ' <a href="javascript:comment_on_comment_splosni_resp(\''.$row['id'].'\',\''.$f->user($row['uid']).'\',\''.$datetime.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+
+ echo '<div class="line" onClick="survey_respondent_comment_delete(\''.$row['id'].'\');">';
+ echo '<span class="faicon trash empty link-right"></span>';
+ echo $lang['srv_comment_delete'];
+ echo '</div>';
+
+ echo '</div>';
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".options_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+ echo '</div>'; //options
+ }
+
+ echo '</div>'; //by
+
+
+ echo '<div class="content">';
+ echo $row['comment'];
+ echo '</div>';
+
+
+ echo '</div>';
+
+ echo '<div class="reply_to_text" id="comment_on_comment_splosni_resp_'.$row['id'].'"></div>';
+ }
+ }
+ // Nimamo komentarja
+ else{
+ // Ce so komentarji aktivirani
+ if($survey_comment_resp != ''){
+ echo '<p class="bottom16">'.$lang['srv_no_comments_solved'].'</p>';
+ }
+ else{
+ echo '<p class="bottom16">'.$lang['srv_no_comments'].'</p>';
+ }
+ }
+
+ echo '</div>';
+
+ echo '</div>'; // div.komentarji_anketa_holder
+ }
+
+ // Izpis zavihka KOMENTARJI NA VPRASANJA
+ private function display_komentarji_na_vprasanja() {
+ global $lang;
+ global $site_url;
+ global $admin_type;
+ global $global_user_id;
+
+ $lang_admin = $lang;
+
+ //$sa = new SurveyAdmin(1, $this->anketa);
+ include_once('../../main/survey/app/global_function.php');
+ new \App\Controllers\SurveyController(true);
+ save('forceShowSpremenljivka', true);
+
+ $f = new Forum;
+ $c = 0;
+
+ $lang = $lang_admin;
+
+ $b = new Branching($this->anketa);
+
+ $d = new Dostop();
+
+ $rowi = SurveyInfo::getInstance()->getSurveyRow();
+
+ SurveySetting::getInstance()->Init($this->anketa);
+ $question_resp_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment_viewadminonly');
+ $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
+ $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
+ $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
+ $question_note_view = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_view');
+ $addfieldposition = SurveySetting::getInstance()->getSurveyMiscSetting('addfieldposition');
+ $commentmarks = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks');
+ $commentmarks_who = SurveySetting::getInstance()->getSurveyMiscSetting('commentmarks_who');
+
+ $sortpostorder = ($sortpostorder == '') ? 0 : $sortpostorder;
+ $commentmarks = ($commentmarks == '') ? 0 : $commentmarks;
+ $commentmarks_who = ($commentmarks_who == '') ? 0 : $commentmarks_who;
+ $question_comment_viewadminonly = ($question_comment_viewadminonly == '') ? 4 : $question_comment_viewadminonly;
+ $question_resp_comment_viewadminonly = ($question_resp_comment_viewadminonly == '') ? 4 : $question_resp_comment_viewadminonly;;
+
+ $comment_count = $this->testiranje_komentarji_count();
+
+
+ # VV: privzeto naj bodo samo nerešeni komentarji
+ if (!isset($_GET['only_unresolved'])) {
+ $_GET['only_unresolved'] = 1;
+ }
+
+
+ $sqlf1 = sisplet_query("SELECT p.id FROM post p WHERE p.tid='$rowi[thread]' AND p.ocena='5'");
+ while ($rowf1 = mysqli_fetch_array($sqlf1)) {
+ $s = sisplet_query("SELECT * FROM views WHERE pid='$rowf1[id]' AND uid='$global_user_id'");
+ if (mysqli_num_rows($s) == 0)
+ $show_survey_comment = 1;
+ }
+
+ // vsa vprasanja
+ echo '<div class="comment_checkboxes_wrap">';
+
+ echo '<div class="">';
+ echo '<input type="checkbox" id="all_questions" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji'.(isset($_GET['only_unresolved'])?'&only_unresolved='.$_GET['only_unresolved']:'').'&all_questions=\'+$(\'#all_questions:checked\').val()" value="1" '.(isset($_GET['all_questions']) && $_GET['all_questions'] == 1 ? 'checked' : '').' />';
+ echo '<label for="all_questions">'.$lang['srv_all_questions'].'</label>';
+ echo '</div>';
+
+ # samo nerešeni komentarji
+ if ($commentmarks == 0) {
+ echo '<div class="">';
+ echo '<input type="checkbox" id="only_unresolved" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji'.(isset($_GET['all_questions'])?'&all_questions='.$_GET['all_questions']:'').'&only_unresolved=\'+$(\'#only_unresolved:checked\').val()" value="1" '.($_GET['only_unresolved']==1?'checked':'').' />';
+ echo '<label for="only_unresolved">'.$lang['srv_comments_unresolved'].'</label>';
+ echo '</div>';
+
+ } else {
+ echo $lang['move_show'].': <select id="only_unresolved" class="dropdown" name="" onchange="window.location = \'index.php?anketa='.$this->anketa.'&a=komentarji&only_unresolved=\'+$(\'#only_unresolved\').val(); " >
+ <option value="0"'.($_GET['only_unresolved']==0?' selected="selected"':'').'>'.$lang['all2'].'</option>
+ <option value="1"'.($_GET['only_unresolved']==1?' selected="selected"':'').'>'.$lang['srv_comments_unresolved'].'</option>
+ <option value="2"'.($_GET['only_unresolved']==2?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
+ <option value="3"'.($_GET['only_unresolved']==3?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
+ <option value="4"'.($_GET['only_unresolved']==4?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
+ <option value="5"'.($_GET['only_unresolved']==5?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
+ </select>';
+ }
+ echo '</div>';
+ // echo ' '.Help::display('srv_comments_only_unresolved').'</span>';
+
+
+ // Nov nacin kjer se sprehodimo cez branching, ker imamo lahko tudi komentarje na ife in bloke
+ Common::getInstance()->Init($this->anketa);
+ $branching_array = Common::getBranchingOrder();
+ if (count($branching_array) > 0) {
+
+ $view = 1;
+
+ $b = new Branching($this->anketa);
+
+ echo '<ul>';
+
+ foreach($branching_array AS $element){
+
+ // Gre za if ali blok
+ if($element['if_id'] > 0){
+ $if_id = $element['if_id'];
+
+ $sql1 = sisplet_query("SELECT * FROM srv_if WHERE id = '$if_id'");
+ $row1 = mysqli_fetch_array($sql1);
+
+ $orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
+ $tid = $row1['thread'];
+
+ $only_unresolved = " ";
+ $only_unresolved2 = " ";
+ if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND ocena <= 1 ";
+ if ($_GET['only_unresolved'] == 1) $only_unresolved2 = " AND text2 <= 1 ";
+
+ if ($_GET['only_unresolved'] == 2) $only_unresolved = " AND ocena = 0 ";
+ if ($_GET['only_unresolved'] == 2) $only_unresolved2 = " AND text2 = 0 ";
+
+ if ($_GET['only_unresolved'] == 3) $only_unresolved = " AND ocena = 1 ";
+ if ($_GET['only_unresolved'] == 3) $only_unresolved2 = " AND text2 = 1 ";
+
+ if ($_GET['only_unresolved'] == 4) $only_unresolved = " AND ocena = 2 ";
+ if ($_GET['only_unresolved'] == 4) $only_unresolved2 = " AND text2 = 2 ";
+
+ if ($_GET['only_unresolved'] == 5) $only_unresolved = " AND ocena = 3 ";
+ if ($_GET['only_unresolved'] == 5) $only_unresolved2 = " AND text2 = 3 ";
+
+
+ $tema_vsebuje = substr($lang['srv_forum_intro'],0,10); // da ne prikazujemo 1. default sporocila
+
+ if ($admin_type <= $question_comment_viewadminonly) { // vidi vse komentarje
+ $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved ORDER BY time $orderby, id $orderby");
+ } elseif ($question_comment_viewauthor==1) { // vidi samo svoje komentarje
+ $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved AND uid='$global_user_id' ORDER BY time $orderby, id $orderby");
+ } else { // ne vidi nobenih komentarjev
+ $sqlt = sisplet_query("SELECT * FROM post WHERE 1=0");
+ }
+
+ if ((isset($_GET['all_questions']) && $_GET['all_questions']=='1') OR (mysqli_num_rows($sqlt) > 0)) {
+ $c++;
+
+ echo '<li id="branching_'.$if_id.'" class="spr">';
+ echo '<div class="spremenljivka_content">';
+
+ // Blok
+ if($row1['tip'] == 1){
+ echo '<div class="spremenljivka_settings">';
+ echo '<span class="conditions_display"><strong class="clr_bl">BLOCK</strong> <span class="colorblock">('.$row1['number'].')</span>';
+ echo '</div>';
+ }
+ // If
+ else{
+ echo '<div class="spremenljivka_settings">';
+ $b->conditions_display($if_id);
+ echo '</div>';
+ }
+
+ echo '</div>';
+ echo '</li>';
+
+ echo '<div class="question_comment_holder">';
+
+ if ($addfieldposition == 1) {
+ echo '<div id="survey_comment_'.$if_id.'_'.'4'.'" style="display:none"></div>';
+ echo '<p><a href="#" onclick="$(\'#comment_field_'.$if_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
+ echo '<p id="comment_field_'.$if_id.'" style="display:none">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($if_id, '1', '4', false);
+ echo '</p>';
+ }
+
+ echo '<div class="question_comment editor">';
+
+ echo '<div class="comment_type">';
+
+ echo $lang['srv_admin_comment'].':';
+
+ /*Sort
+ echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
+ echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
+
+ echo '</div>';
+
+ // komentarji na vprasanje
+ if ($row1['thread'] > 0) {
+
+ if (mysqli_num_rows($sqlt) > 0) {
+
+ $i = 0;
+ while ($rowt = mysqli_fetch_array($sqlt)) {
+
+ /*echo '<div class="comment_box '.($rowt['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$rowt['id'].'">';
+
+ echo '<div class="by">';
+ echo $lang['srv_comments_user'].'<span class="user">'.$f->user($rowt['uid']).'</span>'.$lang['srv_comments_user2'];
+ echo '</div>';
+
+ $datetime = strtotime($rowt['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<div class="date">';
+ echo $f->datetime1($rowt['time']);
+ echo '</div>';
+
+ echo '<div class="content">';
+ echo $rowt['vsebina'];
+ echo '</div>';
+
+
+ echo '<div class="bottom_options">';
+
+ if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ if ($commentmarks == 1) {
+ echo ' <select name="ocena" onchange="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: this.value, id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});">
+ <option value="0"'.($rowt['ocena']==0?' selected="selected"':'').'>'.$lang['srv_undecided'].'</option>
+ <option value="1"'.($rowt['ocena']==1?' selected="selected"':'').'>'.$lang['srv_todo'].'</option>
+ <option value="2"'.($rowt['ocena']==2?' selected="selected"':'').'>'.$lang['srv_done'].'</option>
+ <option value="3"'.($rowt['ocena']==3?' selected="selected"':'').'>'.$lang['srv_not_relevant'].'</option>
+ </select>';
+ }
+ else {
+
+ if ($rowt['ocena']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon arhiv link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+
+ echo '<div class="reply_to">';
+ echo ' <a href="javascript:comment_on_comment(\''.$rowt['id'].'\',\''.$f->user($rowt['uid']).'\',\''.$f->datetime1($rowt['time']).'\',\''.$if_id.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+ }
+ else {
+
+ echo '<p class="archived_comment"><span class="faicon arhiv link-right"></span>'.$lang['srv_comments_archived'].'</p>';
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon inv_sent_0 empty link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+
+ }
+ }
+ }
+
+ echo '</div>'; // .bottom_options
+ echo '</div>'; // comment_box
+
+
+ echo '<div class="reply_to_text" id="comment_on_comment_'.$if_id.'"></div>';*/
+
+
+
+
+
+
+ echo '<div class="comment_box '.($rowt['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$rowt['id'].'">';
+
+ echo '<div class="by">';
+
+ $datetime = strtotime($rowt['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<p>'.$lang['srv_comments_user'].'<span class="user">'.$f->user($rowt['uid']).'</span> <span class="date">('.$datetime.')</span></p>';
+
+
+ if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ echo '<div class="options">';
+
+ echo '<div class="solve">';
+ if ($rowt['ocena']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$rowt['id'].'" onClick="toggleCommentOptions(\''.$rowt['id'].'\');"></span>';
+
+ echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
+
+ echo '<div class="line">';
+ echo '<a href="javascript:comment_on_comment(\''.$rowt['id'].'\',\''.$f->user($rowt['uid']).'\',\''.$datetime.'\',\''.$if_id.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+
+ echo '<div class="line" onClick="comment_delete(\''.$rowt['id'].'\');">';
+ echo '<span class="faicon trash empty link-right"></span>';
+ echo $lang['srv_comment_delete'];
+ echo '</div>';
+
+ echo '</div>';
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".options_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+
+
+ echo '</div>'; //options
+
+ }
+
+ echo '</div>'; //by
+
+ echo '<div class="content">';
+ echo $rowt['vsebina'];
+ echo '</div>';
+
+
+ echo '</div>'; //comment_box
+
+ echo '<div class="reply_to_text" id="comment_on_comment_'.$rowt['id'].'"></div>';
+ }
+ }
+ }
+
+ if ($addfieldposition == '' || $addfieldposition == 0) {
+
+ $if_type = $row1['tip'] == '1' ? '6' : '5';
+ $if_type_title = $row1['tip'] == '1' ? $lang['srv_block_comment'] : $lang['srv_if_comment'];
+
+ echo '<div id="comment_toggle_'.$if_id.'_4" class="add_comment_toggle blue pointer" onClick="toggleAddComment(\''.$if_id.'_'.'4'.'\')">';
+ echo '<span class="faicon inline_comment link-right"></span>';
+ echo $if_type_title;
+ echo '</div>';
+
+ echo '<div class="comment_wrapper" id="comment_wrapper_'.$if_id.'_4">';
+
+ echo '<div class="new_comment" id="survey_comment_'.$if_id.'_4">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($if_id, $if_type, '4', false);
+ echo '</div>';
+ echo '</div>';
+ }
+
+ echo '</div>'; #editor
+
+ echo '<div class="question_comment resp">'; //prazen, respondenti ne komentirajo na IFe in bloke
+ echo '</div>';
+
+ echo '</div>'; #question_comment_holder
+
+ }
+ }
+ // Gre za navadno vprasanje
+ else{
+ $spr_id = $element['spr_id'];
+
+ $sql1 = sisplet_query("SELECT tip, thread, note FROM srv_spremenljivka WHERE id = '$spr_id'");
+ $row1 = mysqli_fetch_array($sql1);
+
+ $orderby = $sortpostorder == 1 ? 'DESC' : 'ASC';
+ $tid = $row1['thread'];
+
+ $only_unresolved = " ";
+ $only_unresolved2 = " ";
+ if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND ocena <= 1 ";
+ if ($_GET['only_unresolved'] == 1) $only_unresolved2 = " AND text2 <= 1 ";
+
+ if ($_GET['only_unresolved'] == 2) $only_unresolved = " AND ocena = 0 ";
+ if ($_GET['only_unresolved'] == 2) $only_unresolved2 = " AND text2 = 0 ";
+
+ if ($_GET['only_unresolved'] == 3) $only_unresolved = " AND ocena = 1 ";
+ if ($_GET['only_unresolved'] == 3) $only_unresolved2 = " AND text2 = 1 ";
+
+ if ($_GET['only_unresolved'] == 4) $only_unresolved = " AND ocena = 2 ";
+ if ($_GET['only_unresolved'] == 4) $only_unresolved2 = " AND text2 = 2 ";
+
+ if ($_GET['only_unresolved'] == 5) $only_unresolved = " AND ocena = 3 ";
+ if ($_GET['only_unresolved'] == 5) $only_unresolved2 = " AND text2 = 3 ";
+
+
+ $tema_vsebuje = substr($lang['srv_forum_intro'],0,10); // da ne prikazujemo 1. default sporocila
+
+ if ($admin_type <= $question_comment_viewadminonly) { // vidi vse komentarje
+ $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved ORDER BY time $orderby, id $orderby");
+ }
+ elseif ($question_comment_viewauthor==1) { // vidi samo svoje komentarje
+ $sqlt = sisplet_query("SELECT * FROM post WHERE vsebina NOT LIKE '%{$tema_vsebuje}%' AND tid='$tid' $only_unresolved AND uid='$global_user_id' ORDER BY time $orderby, id $orderby");
+ }
+ else { // ne vidi nobenih komentarjev
+ $sqlt = sisplet_query("SELECT * FROM post WHERE 1=0");
+ }
+
+ $sql2 = sisplet_query("SELECT COUNT(*) AS count FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spr_id' $only_unresolved2");
+ $row2 = mysqli_fetch_array($sql2);
+
+ if ( (isset($_GET['all_questions']) && $_GET['all_questions']=='1') OR ( mysqli_num_rows($sqlt) > 0 || $row2['count'] > 0 || $row1['note'] != '' ) ) {
+ $c++;
+
+ echo '<li id="branching_'.$spr_id.'" class="spr spr_tip_'.$row1['tip'].'">';
+ $b->vprasanje($spr_id);
+ echo '</li>';
+
+ if ($admin_type <= $question_note_view || $question_note_view == '') {
+
+ if ($row1['note'] != '') {
+ echo '<div style="float:left; width:100%; margin-left: 1%">';
+ echo '<p class="red"><b><a href="#" class="gray" onclick="$(\'.note-'.$spr_id.', .pl, .mn\').toggle(); return false;"><span class="pl">+</span><span class="mn" style="display:none">-</span> '.$lang['srv_note'].'</a></b></p>';
+ echo '<p class="note-'.$spr_id.' displayNone">'.nl2br($row1['note']).'</p>';
+ echo '</div>';
+ }
+ }
+
+ echo '<div class="question_comment_holder">';
+
+ if ($addfieldposition == 1) {
+ echo '<div id="survey_comment_'.$spr_id.'_'.'4'.'" style="display:none"></div>';
+ echo '<p><a href="#" onclick="$(\'#comment_field_'.$spr_id.'\').toggle(); return false;">'.$lang['srv_comments_add_comment'].'</a></p>';
+ echo '<p id="comment_field_'.$spr_id.'" style="display:none">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($spr_id, '1', '4', false);
+ echo '</p>';
+ }
+
+ echo '<div class="question_comment editor">';
+
+ echo '<div class="comment_type">';
+
+ echo $lang['srv_admin_comment'].':';
+
+ /*Sort
+ echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
+ echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
+
+ echo '</div>';
+
+ // komentarji urednikov
+ if ($row1['thread'] > 0) {
+
+ if (mysqli_num_rows($sqlt) > 0) {
+
+ $i = 0;
+ while ($rowt = mysqli_fetch_array($sqlt)) {
+
+
+ echo '<div class="comment_box '.($rowt['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$rowt['id'].'">';
+
+ echo '<div class="by">';
+
+ $datetime = strtotime($rowt['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<p>'.$lang['srv_comments_user'].'<span class="user">'.$f->user($rowt['uid']).'</span> <span class="date">('.$datetime.')</span></p>';
+
+
+ if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ echo '<div class="options">';
+
+ echo '<div class="solve">';
+ if ($rowt['ocena']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'question_comment\', ocena: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$rowt['id'].'" onClick="toggleCommentOptions(\''.$rowt['id'].'\');"></span>';
+
+ echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
+
+ echo '<div class="line">';
+ echo '<a href="javascript:comment_on_comment(\''.$rowt['id'].'\',\''.$f->user($rowt['uid']).'\',\''.$datetime.'\',\''.$spr_id.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+
+ echo '<div class="line" onClick="comment_delete(\''.$rowt['id'].'\');">';
+ echo '<span class="faicon trash empty link-right"></span>';
+ echo $lang['srv_comment_delete'];
+ echo '</div>';
+
+ echo '</div>';
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".options_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+
+
+ echo '</div>'; //options
+
+ }
+
+ echo '</div>'; //by
+
+ echo '<div class="content">';
+ echo $rowt['vsebina'];
+ echo '</div>';
+
+
+ echo '</div>'; //comment_box
+
+ echo '<div class="reply_to_text" id="comment_on_comment_'.$rowt['id'].'"></div>';
+ }
+
+ }
+
+ }
+
+ if ($addfieldposition == '' || $addfieldposition == 0) {
+
+ echo '<div id="comment_toggle_'.$spr_id.'_'.'4'.'" class="add_comment_toggle pointer" onClick="toggleAddComment(\''.$spr_id.'_'.'4'.'\')">';
+ echo '<span class="faicon inline_comment link-right"></span>';
+ echo $lang['srv_question_comment'];
+ echo '</div>';
+
+ echo '<div class="comment_wrapper" id="comment_wrapper_'.$spr_id.'_'.'4'.'">';
+
+ echo '<div class="new_comment" id="survey_comment_'.$spr_id.'_'.'4'.'">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($spr_id, '1', '4', false);
+ echo '</div>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ echo '<div class="question_comment resp">';
+
+ // komentarji respondentov
+
+ echo '<div class="comment_type">';
+ echo $lang['srv_repondent_comment'].':';
+ /*Sort
+ echo '<span class="faicon pointer blue fa-sort-amount-down"></span>';
+ echo '<span class="faicon pointer blue fa-sort-amount-up"></span>';*/
+ echo '</div>';
+
+ if ($row2['count'] > 0) {
+
+ if ($admin_type <= $question_resp_comment_viewadminonly) {
+
+ if ($_GET['only_unresolved'] == 1) $only_unresolved = " AND d.text2 <= 1 "; else $only_unresolved = " ";
+
+ $sqlt = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spr_id' $only_unresolved2 ORDER BY id $orderby");
+ if (!$sqlt) echo mysqli_error($GLOBALS['connect_db']);
+ while ($rowt = mysqli_fetch_array($sqlt)) {
+
+ echo '<div class="comment_box '.($rowt['text2']==0 ? '' : 'archived').'" id="comment_box_'.$rowt['id'].'">';
+
+ // Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja
+ $sqlTime = sisplet_query("SELECT time_edit FROM srv_user WHERE id='".$rowt['usr_id']."'");
+ if(mysqli_num_rows($sqlTime) > 0){
+
+ $rowTime = mysqli_fetch_array($sqlTime);
+
+
+ echo '<div class="by">';
+
+ if ( strpos($rowt['text'], '__DATE__') !== false ) {
+ $rowt['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowt['text']);
+ $datetime = '-';
+
+ }
+ else {
+
+ $datetime = strtotime($rowTime['time_edit']);
+ $datetime = date("d.m.Y G:i", $datetime);
+ }
+
+ echo '<p>Respondent <span class="date">('.$datetime.')</span></p>';
+
+
+ if ($admin_type <= 1 || $rowi['insert_uid']==$global_user_id || $commentmarks_who==0) {
+
+ echo '<div class="options">';
+
+ echo '<div class="solve">';
+ if ($rowt['text2']==0) {
+ echo '<p class="archive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'2\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="$.post(\'ajax.php?a=comment_ocena\', {type: \'respondent_comment\', text2: (\'0\'), id: \''.$rowt['id'].'\', anketa: \''.$rowi['id'].'\'}, function () {window.location.reload();});"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '<span class="faicon pointer fa-ellipsis-h" id="dots_'.$rowt['id'].'" onClick="toggleCommentOptions(\''.$rowt['id'].'\');"></span>';
+
+ echo '<div class="options_dropdown displayNone" id="options_'.$rowt['id'].'">';
+
+ echo '<div class="line">';
+ echo ' <a href="javascript:comment_on_comment_resp(\''.$rowt['id'].'\',\''.$f->user($rowt['usr_id']).'\',\''.$datetime.'\');"><span class="faicon fa-reply link-right"></span>'.$lang['srv_comment_comment'].'</a>';
+ echo '</div>';
+
+ echo '<div class="line" onClick="respondent_comment_delete(\''.$rowt['id'].'\');">';
+ echo '<span class="faicon trash empty link-right"></span>';
+ echo $lang['srv_comment_delete'];
+ echo '</div>';
+
+ echo '</div>';
+
+ //Klik izven razprith nastavitev - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".options_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+
+
+ echo '</div>'; //options
+
+ }
+
+ echo '</div>'; //by
+
+ }
+ else{
+ if ( strpos($rowt['text'], '__DATE__') !== false ) {
+ $rowt['text'] = str_replace('__DATE__', '', $rowt['text']);
+ }
+ }
+
+ echo '<div class="content">';
+ echo nl2br($rowt['text']);
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="reply_to_text" id="comment_on_comment_resp_'.$rowt['id'].'"></div>';
+ }
+ }
+ }
+ else {
+ echo $lang['srv_no_comments_resp'];
+ }
+
+ echo '</div>'; #div.question_comment.resp
+
+
+ echo '</div>'; #div.question_comment_holder
+ }
+ }
+
+ }
+
+ echo '</ul>';
+
+ if ($c == 0) {
+ echo '<div>';
+ echo $lang['srv_no_comments_solved'];
+ #echo '<a href="index.php?anketa='.$this->anketa.'&a=urejanje">'.$lang['srv_settings_komentarji'].'</a>';
+ echo '</div>';
+ }
+ }
+ else {
+ echo '<div>';
+ echo $lang['srv_no_comments'];
+ echo '</div>';
+ }
+
+ echo '</div>'; // branching
+ echo '<div id="vprasanje_float_editing"></div>';
+ }
+
+
+ // Izpis ikone v navigacijskem meniju
+ public function display_comments_icon(){
+ global $site_url;
+ global $global_user_id;
+ global $lang;
+
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ SurveySetting::getInstance()->Init($this->anketa);
+ $survey_comment = SurveySetting::getInstance()->getSurveyMiscSetting('survey_comment');
+ $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
+ $question_note_view = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_view');
+ $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment');
+
+
+ if ($survey_comment != '' || $question_comment != '' || $question_resp_comment == 1 || $this->testiranje_komentarji_komentarji_na_vprasanje(false) > 0) {
+
+ echo '<li>';
+ echo '<div id="quick_comments_link" class="newCss">';
+
+ $comment_count = $this->testiranje_komentarji_count();
+ $nereseno = ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']) + $comment_count['question']['unresolved'];
+
+ if($userAccess->checkUserAccess('komentarji')){
+ if ($nereseno > 0) {
+
+ if ($nereseno > 99)
+ $nereseno = '99+';
+
+ echo '<div class="fa-stack has_comment"><span class="faicon comments" id="nereseno" onclick="toggleCommentDropdown(); return false;">';
+ echo '<span class="comment_number">'.$nereseno.'</span>';
+
+ }
+ else {
+ echo '<div class="fa-stack" ><span class="faicon comments" id="vkljuceno" onclick="toggleCommentDropdown(); return false;">';
+ }
+ }
+ else{
+ if ($nereseno > 0)
+ echo '<div class="fa-stack"><span class="faicon comments icon-orange fa-stack-1x user_access_locked">';
+ else
+ echo '<div class="fa-stack"><span class="faicon comments user_access_locked">';
+ }
+
+ echo '</span></div>'; //zaključi ikono
+
+ //dropdown na klik ikone
+ echo '<div id="comment_dropdown" class="displayNone">';
+
+ echo '<div class="comment_dropdown_top">';
+
+ echo '<div class="title">';
+ echo '<span class="faicon comment_dropdown"></span>';
+ echo $lang['comments'];
+ echo '</div>';
+
+ echo '<div class="settings">';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=urejanje">';
+ echo ' <span class="faicon wheel_32"></span>';
+ echo ' </a>';
+ echo '</div>';
+
+ echo '</div>';
+
+ $comment_link = 'window.location.href=\'' . $site_url . 'admin/survey/index.php?anketa='.$this->anketa.'&a=komentarji_anketa\'; return false;';
+ echo '<div class="links" onclick="'.$comment_link.'">';
+ echo $lang['srv_testiranje_komentarji_anketa_overview'];
+ echo ' (<span class="red">' . ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']); //nerešeni
+ echo '</span>/' . ($comment_count['survey_resp']['all'] + $comment_count['survey_admin']['all']) . ')'; //vsi
+ echo '<span class="faicon fa-angle-right"></span>';
+ echo '</div>';
+
+ $comment_link = 'window.location.href=\'' . $site_url . 'admin/survey/index.php?anketa='.$this->anketa.'&a=komentarji\'; return false;';
+ echo '<div class="links" onclick="'.$comment_link.'">';
+ echo $lang['srv_testiranje_komentarji_overview'];
+ echo ' (<span class="red">' . $comment_count['question']['unresolved'];
+ echo '</span>/' . $comment_count['question']['all'] . ')';
+ echo '<span class="faicon fa-angle-right"></span>';
+ echo '</div>';
+
+ echo '<div class="first_holder_div" id="survey_comment_0_1">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field(0, '0', '1', false, false);
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="small white-blue" onclick="toggleCommentDropdown(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="small blue" onclick="add_comment(\'0\', \'0\', \'1\', $(\'#vsebina_0_1\').val()); actionNotePopup(\'comment_added\', \'success\');return false;">'.$lang['srv_comments_new'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_dropdown
+
+ // Klik izven - zapremo dropdown
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_dropdown");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $("#comment_dropdown").addClass("displayNone");
+ }
+ });
+ </script>';
+
+ echo '</div>';
+ echo '</li>';
+ }
+ // ce ni komentarjev, potem prikazemo link do nastavitev komentarjev
+ else {
+ echo '<li>';
+ echo '<div id="quick_comments_link" class="newCss">';
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+
+ if($userAccess->checkUserAccess('komentarji')) {
+ $comment_link = 'window.location.href=\'' . $site_url . 'admin/survey/ajax.php?anketa='.$this->anketa.'&a=comments_onoff&do=on\'; return false;';
+ echo '<div class="fa-stack inactive_comments" onclick="'.$comment_link.'"><span class="faicon comments" title="' . $lang['srv_preview_comments'] . '">';
+ }
+ else {
+ /* $comment_link = 'window.location.href=\'' . $site_url . 'admin/survey/ajax.php?anketa='.$this->anketa.'&a=urejanje\'; return false;';
+ echo '<div class="fa-stack" onclick="'.$comment_link.'"><span class="faicon comments user_access_locked" title="' . $lang['srv_preview_comments'] . '">'; */
+ $comment_link = 'window.location.href=\'' . $site_url . 'admin/survey/index.php?anketa='.$this->anketa.'&a=urejanje\'; return false;';
+ echo '<div class="fa-stack inactive_comments" onclick="'.$comment_link.'"><span class="faicon comments" title="' . $lang['srv_preview_comments'] . '">';
+ }
+ echo '</span></div>';
+
+ echo '</div>';
+ echo '</li>';
+ }
+ }
+
+
+ // Vrstica s komentarji pod posameznim vprasanjem v urejanju ankete
+ public function display_vprasanje_komentarji ($spremenljivka) {
+ global $lang;
+ global $admin_type;
+ global $global_user_id;
+
+
+ SurveySetting::getInstance()->Init($this->anketa);
+ $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
+ $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment');
+ $question_resp_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment_viewadminonly');
+
+ $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
+ $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
+
+ if (!($admin_type <= $question_comment && $question_comment!='') && !($question_resp_comment==1)) return;
+ if ($_GET['a'] == 'komentarji') return; // v komentarjih tut ne izpisujemo te vrstice
+
+ $tema_vsebuje = substr($lang['srv_forum_intro'], 0, 10); // da ne prikazujemo 1. default sporocila
+
+ $f = new Forum;
+
+
+ echo '<div id="surveycommentcontainer_'.$spremenljivka.'" class="printHide comment_container_inline">';
+
+
+ // komentarji na vprasanje
+ if ($admin_type <= $question_comment && $question_comment != '') {
+
+ // GUMB Dodaj komentar
+ echo '<div onClick="openCommentPopupInline(\'1\', \''.$spremenljivka.'\'); return false;" id="surveycomment_'.$spremenljivka.'_0" class="surveycomment noline" type="1" subtype="q_admin_add" spremenljivka="'.$spremenljivka.'" view="0" title="'.$lang['srv_question_comment'].'">';
+ echo ' <button class="small-rounded white-gray">';
+ echo ' <span class="faicon inline_comment"></span> ';
+ echo $lang['srv_add_comment'];
+ echo ' </button>';
+ echo '</div>';
+
+ // POPUP za dodaj komentar
+ echo '<div class="comment_inline_popup displayNone" id="comment_inline_add_'.$spremenljivka.'">';
+
+ echo '<div class="comment_inline_top">';
+ echo '<div class="title">';
+ echo '<span class="faicon fa-comment"></span>';
+ echo $lang['srv_add_comment'];
+ echo '</div>';
+ echo '<span class="gray" onClick="closeCommentPopupInline(\'1\', \''.$spremenljivka.'\'); return false;">✕</span>';
+ echo '</div>';
+
+ echo '<div class="first_holder_div" id="survey_comment_'.$spremenljivka.'_0">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($spremenljivka, '1', '0', false, false);
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="small white-blue" onclick="closeCommentPopupInline(\'1\', \''.$spremenljivka.'\'); return false;">'.$lang['edit1338'].'</button>';
+ echo ' <button class="small blue" onclick="add_comment(\''.$spremenljivka.'\', \'1\', \'0\', $(\'#vsebina_'.$spremenljivka.'_0\').val()); actionNotePopup(\'comment_added\', \'success\'); return false;">'.$lang['srv_comments_new'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_inline_popup
+
+ // Klik izven - zapremo popup
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_inline_add_'.$spremenljivka.'");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ closeCommentPopupInline(\'1\', \''.$spremenljivka.'\');
+ }
+ });
+ </script>';
+
+
+ // Poglej komentarje
+ if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) {
+
+ // Dobimo seznam komentarjev
+ $row = Cache::srv_spremenljivka($spremenljivka);
+ if ($row['thread'] == 0) {
+ $post_count = 0;
+ }
+ else {
+ if ($admin_type <= $question_comment_viewadminonly) {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE tid='$row[thread]' AND vsebina NOT LIKE '%{$tema_vsebuje}%' ORDER BY time");
+ }
+ elseif ($question_comment_viewauthor==1) {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE tid='$row[thread]' AND uid='$global_user_id' AND vsebina NOT LIKE '%{$tema_vsebuje}%' ORDER BY time");
+ }
+ else {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE 1 = 0");
+ }
+
+ $post_count = mysqli_num_rows($sqlP);
+ }
+
+
+ // GUMB za poglej komentarje
+ echo '<div onClick="openCommentPopupInline(\'2\', \''.$spremenljivka.'\'); return false;" id="surveycomment_'.$spremenljivka.'_1" class="surveycomment noline" type="1" subtype="q_admin_all" spremenljivka="'.$spremenljivka.'" view="1" title="'.$lang['srv_question_comments'].'">';
+ echo ' <button class="small-rounded white-gray" id="comment_add_'.$spremenljivka.'"'.($post_count== 0 ? ' style="display:none;"' : '').'>';
+ echo ' <span class="faicon inline_double_comment"></span> ';
+ echo $lang['srv_admin_comment'].($post_count > 0 ? ' ('.$post_count.')':'');
+ echo ' </button>';
+ echo '</div>';
+
+ // POPUP za poglej komentarje
+ echo '<div class="comment_inline_popup displayNone" id="comment_inline_editor_'.$spremenljivka.'">';
+
+ echo '<div class="comment_inline_top">';
+ echo '<div class="title">';
+ echo '<span class="faicon fa-comment"></span>';
+ echo $lang['srv_admin_comment'];
+ echo '</div>';
+ echo '<span class="gray" onClick="closeCommentPopupInline(\'2\', \''.$spremenljivka.'\'); return false;">✕</span>';
+ echo '</div>';
+
+ // Izpisemo seznam komentarjev
+ if($post_count > 0){
+
+ while($rowP = mysqli_fetch_array($sqlP)){
+
+ echo '<div class="comment_box '.($rowP['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$rowP['id'].'">';
+
+ echo '<div class="by">';
+
+ $datetime = strtotime($rowP['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<p><span class="user">'.$f->user($rowP['uid']).'</span> <span class="date">('.$datetime.')</span></p>';
+
+ // Razresi
+ echo '<div class="solve">';
+ if ($rowP['ocena']==0) {
+ echo '<p class="archive_comment" onclick="question_comment_solve(\'2\', \''.$rowP['id'].'\');"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="question_comment_solve(\'0\', \''.$rowP['id'].'\');"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '</div>'; //by
+
+
+ echo '<div class="content">';
+ echo $rowP['vsebina'];
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+
+ echo '<div class="button_holder">';
+ echo '<button class="small blue" onclick="closeCommentPopupInline(\'2\', \''.$spremenljivka.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_inline_popup
+
+ // Klik izven - zapremo popup
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_inline_editor_'.$spremenljivka.'");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ closeCommentPopupInline(\'2\', \''.$spremenljivka.'\');
+ }
+ });
+ </script>';
+ }
+ }
+
+
+ // komentarji respondentov
+ if (($question_resp_comment==1) AND ($admin_type <= $question_resp_comment_viewadminonly)) {
+
+ // Dobimo seznam komentarjev respondentov
+ $sqlP = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='0' AND vre_id='$spremenljivka' ORDER BY id ASC");
+
+ $post_count = mysqli_num_rows($sqlP);
+
+ if ($post_count > 0) {
+
+ // GUMB za komentarji respondentov
+ echo '<div onClick="openCommentPopupInline(\'3\', \''.$spremenljivka.'\'); return false;" id="surveycomment_'.$spremenljivka.'_2" class="surveycomment noline" type="2" subtype="q_resp_all" spremenljivka="'.$spremenljivka.'">';
+ echo ' <button class="small-rounded white-gray">';
+ echo ' <span class="faicon inline_comment icon-orange"></span> ';
+ echo $lang['srv_repondent_comment'].' ('.$post_count.')';
+ echo ' </button>';
+ echo '</div>';
+
+ // POPUP za komentarji respondentov
+ echo '<div class="comment_inline_popup displayNone" id="comment_inline_respondent_'.$spremenljivka.'">';
+
+ echo '<div class="comment_inline_top">';
+ echo ' <div class="title">';
+ echo ' <span class="faicon fa-comment"></span>';
+ echo $lang['srv_repondent_comment'];
+ echo ' </div>';
+ echo ' <span class="gray" onClick="closeCommentPopupInline(\'3\', \''.$spremenljivka.'\'); return false;">✕</span>';
+ echo '</div>';
+
+ // Izpisemo seznam komentarjev
+ while($rowP = mysqli_fetch_array($sqlP)){
+
+ echo '<div class="comment_box '.($rowP['text2']==0 ? '' : 'archived').'" id="comment_box_'.$rowP['id'].'">';
+
+ // Ce smo slucajno pobrisali testne vnose, nimamo casa vnosa komentarja
+ $sqlTime = sisplet_query("SELECT time_edit FROM srv_user WHERE id='".$rowP['usr_id']."'");
+ if(mysqli_num_rows($sqlTime) > 0){
+
+ $rowTime = mysqli_fetch_array($sqlTime);
+
+
+ echo '<div class="by">';
+
+ if ( strpos($rowP['text'], '__DATE__') !== false ) {
+ $rowP['text'] = str_replace('__DATE__', $f->datetime1($rowTime['time_edit']), $rowP['text']);
+ $datetime = '-';
+
+ }
+ else {
+
+ $datetime = strtotime($rowTime['time_edit']);
+ $datetime = date("d.m.Y G:i", $datetime);
+ }
+
+ echo '<p>Respondent <span class="date">('.$datetime.')</span></p>';
+
+ // Razresi
+ echo '<div class="solve">';
+ if ($rowP['text2']==0) {
+ echo '<p class="archive_comment" onclick="question_respondent_comment_solve(\'2\', \''.$rowP['id'].'\');"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="question_respondent_comment_solve(\'0\', \''.$rowP['id'].'\');"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '</div>'; //by
+
+ }
+ else{
+ if ( strpos($rowP['text'], '__DATE__') !== false ) {
+ $rowP['text'] = str_replace('__DATE__', '', $rowP['text']);
+ }
+ }
+
+ echo '<div class="content">';
+ echo nl2br($rowP['text']);
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onclick="closeCommentPopupInline(\'3\', \''.$spremenljivka.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_inline_popup
+
+ // Klik izven - zapremo popup
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_inline_respondent_'.$spremenljivka.'");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ closeCommentPopupInline(\'3\', \''.$spremenljivka.'\');
+ }
+ });
+ </script>';
+ }
+ echo '</span>';
+ }
+
+
+ echo '</div>';
+ }
+
+ // Vrstica s komentarji pod posameznim blokom ali ifom v urejanju ankete
+ public function display_if_komentarji ($if_id, $block=0) {
+ global $lang;
+ global $admin_type;
+ global $global_user_id;
+
+ SurveySetting::getInstance()->Init($this->anketa);
+ $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
+
+ $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
+ $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
+
+ if (!($admin_type <= $question_comment && $question_comment!='')) return;
+ if ($_GET['a'] == 'komentarji') return; // v komentarjih tut ne izpisujemo te vrstice
+
+ $f = new Forum;
+ $tema_vsebuje = substr($lang['srv_forum_intro'], 0, 10); // da ne prikazujemo 1. default sporocila
+
+ $type = ($block == 1) ? '6' : '5';
+
+
+ // komentarji na if ali blok
+ if ($admin_type <= $question_comment && $question_comment != '') {
+
+ echo '<div class="comment_container_inline">';
+
+ // Dobimo seznam komentarjev
+ $row = Cache::srv_if($if_id);
+ if ($row['thread'] == 0) {
+ $post_count = 0;
+ }
+ else {
+ if ($admin_type <= $question_comment_viewadminonly) {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE tid='$row[thread]' AND vsebina NOT LIKE '%{$tema_vsebuje}%' ORDER BY time");
+ }
+ elseif ($question_comment_viewauthor==1) {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE tid='$row[thread]' AND uid='$global_user_id' AND vsebina NOT LIKE '%{$tema_vsebuje}%' ORDER BY time");
+ }
+ else {
+ $sqlP = sisplet_query("SELECT * FROM post WHERE 1 = 0");
+ }
+
+ $post_count = mysqli_num_rows($sqlP);
+ }
+
+ // Poglej komentarje
+ if ($admin_type <= $question_comment_viewadminonly || $question_comment_viewauthor==1) {
+
+ // GUMB za poglej komentarje
+ echo '<div onClick="openIfCommentPopupInline(\'2\', \''.$if_id.'\'); return false;" id="surveycomment_'.$if_id.'_1" class="surveycomment noline" type="1" subtype="if_admin_all" spremenljivka="'.$if_id.'" view="1" title="'.$lang['srv_question_comments'].'">';
+ echo ' <button class="small-rounded white-gray" id="comment_add_'.$if_id.'"'.($post_count== 0 ? ' style="display:none;"' : '').'>';
+ echo ' <span class="faicon inline_double_comment"></span> ';
+ echo $lang['srv_admin_comment'].($post_count > 0 ? ' ('.$post_count.')':'');
+ echo ' </button>';
+ echo '</div>';
+
+ // POPUP za poglej komentarje
+ echo '<div class="comment_inline_popup displayNone" id="comment_if_inline_editor_'.$if_id.'">';
+
+ echo '<div class="comment_inline_top">';
+ echo '<div class="title">';
+ echo '<span class="faicon fa-comment"></span>';
+ echo $lang['srv_admin_comment'];
+ echo '</div>';
+ echo '<span class="gray" onClick="closeIfCommentPopupInline(\'2\', \''.$if_id.'\'); return false;">✕</span>';
+ echo '</div>';
+
+ // Izpisemo seznam komentarjev
+ if($post_count > 0){
+
+ while($rowP = mysqli_fetch_array($sqlP)){
+
+ echo '<div class="comment_box '.($rowP['ocena']==0 ? '' : 'archived').'" id="comment_box_'.$rowP['id'].'">';
+
+ echo '<div class="by">';
+
+ $datetime = strtotime($rowP['time']);
+ $datetime = date("d.m.Y G:i", $datetime);
+
+ echo '<p><span class="user">'.$f->user($rowP['uid']).'</span> <span class="date">('.$datetime.')</span></p>';
+
+ // Razresi
+ echo '<div class="solve">';
+ if ($rowP['ocena']==0) {
+ echo '<p class="archive_comment" onclick="question_comment_solve(\'2\', \''.$rowP['id'].'\');"> <span class="faicon fa-check link-right"></span>';
+ echo $lang['srv_comments_archive'].'</p>';
+ }
+ else {
+ echo '<p class="unarchive_comment" onclick="question_comment_solve(\'0\', \''.$rowP['id'].'\');"> <span class="faicon fa-undo link-right"></span>';
+ echo $lang['srv_comments_unarchive'].'</p>';
+ }
+ echo '</div>';
+
+ echo '</div>'; //by
+
+
+ echo '<div class="content">';
+ echo $rowP['vsebina'];
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+
+ echo '<div class="button_holder">';
+ echo '<button class="small blue" onclick="closeIfCommentPopupInline(\'2\', \''.$if_id.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_inline_popup
+
+ // Klik izven - zapremo popup
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_if_inline_editor_'.$if_id.'");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ closeIfCommentPopupInline(\'2\', \''.$if_id.'\');
+ }
+ });
+ </script>';
+ }
+
+
+ // GUMB Dodaj komentar
+ echo '<div onClick="openIfCommentPopupInline(\'1\', \''.$if_id.'\'); return false;" id="surveycomment_'.$if_id.'_0" class="surveycomment noline" type="1" subtype="if_admin_add" spremenljivka="'.$if_id.'" view="0" title="'.$lang['srv_question_comment'].'">';
+ echo ' <button class="small-rounded white-gray">';
+ echo ' <span class="faicon inline_comment"></span> ';
+ echo $lang['srv_add_comment'];
+ echo ' </button>';
+ echo '</div>';
+
+ // POPUP za dodaj komentar
+ echo '<div class="comment_inline_popup displayNone" id="comment_if_inline_add_'.$if_id.'">';
+
+ echo '<div class="comment_inline_top">';
+ echo '<div class="title">';
+ echo '<span class="faicon fa-comment"></span>';
+ echo $lang['srv_add_comment'];
+ echo '</div>';
+ echo '<span class="gray" onClick="closeIfCommentPopupInline(\'1\', \''.$if_id.'\'); return false;">✕</span>';
+ echo '</div>';
+
+ echo '<div class="first_holder_div" id="survey_comment_'.$if_id.'_0">';
+ $ba = new BranchingAjax($this->anketa);
+ $ba->add_comment_field($if_id, $type, '0', false, false);
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="small white-blue" onclick="closeIfCommentPopupInline(\'1\', \''.$if_id.'\'); return false;">'.$lang['edit1338'].'</button>';
+ echo ' <button class="small blue" onclick="add_comment(\''.$if_id.'\', \''.$type.'\', \'0\', $(\'#vsebina_'.$if_id.'_0\').val()); actionNotePopup(\'comment_added\', \'success\'); return false;">'.$lang['srv_comments_new'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; //comment_inline_popup
+
+ // Klik izven - zapremo popup
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $("#comment_if_inline_add_'.$if_id.'");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ closeIfCommentPopupInline(\'1\', \''.$if_id.'\');
+ }
+ });
+ </script>';
+
+ echo '</div>';
+ }
+ }
+
+
+ // $return pove a vrne text (true) ali samo številko (false)
+ private function testiranje_komentarji_komentarji_na_vprasanje ($return = true) {
+
+ # naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
+ $spremenljivke = Cache::cache_all_srv_spremenljivka($this->anketa, true);
+
+ $spr_id = array();
+ $threads = array();
+ $rowqr = array();
+ $rowqrf = array();
+ $rowtqa = array();
+ $rowtqu = array();
+
+ if ( is_array($spremenljivke) && count($spremenljivke) > 0 ) {
+ foreach ($spremenljivke as $id=>$value) {
+ $spr_id[] = $id;
+ if ((int)$value['thread'] > 0) {
+ $threads[] = $value['thread'];
+ }
+ }
+ }
+ if (count($spr_id) > 0) {
+ #preštejemo komentarje uporabnikov na vprašanja
+ # srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
+ $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).")";
+ $sqlqr = sisplet_query($strqr);
+ list($rowqr) = mysqli_fetch_row($sqlqr);
+
+ #končani komentarji respondentov
+ #text2 = 2 => končan
+ #text2 = 3 => nerelevantno
+ $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
+ $sqlqrf = sisplet_query($strqrf);
+ list($rowqrf) = mysqli_fetch_row($sqlqrf);
+
+ # preštejemo
+ if (count($threads) > 0) {
+ # vsi komentarji na anketo
+ $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0";
+ $sqlta = sisplet_query($strta);
+ list($rowtqa) = mysqli_fetch_row($sqlta);
+ # nerešeni komentarji: only_unresolved => ocena <= 1
+ $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena IN (2,3) ";
+ $sqltu = sisplet_query($strtu);
+ list($rowtqu) = mysqli_fetch_row($sqltu);
+ }
+ }
+
+ #vsi
+ $all = (int)((int)$rowqr + (int)$rowtqa);
+
+ # nerešeni
+ $unresolved = $all - (int)((int)$rowqrf + (int)$rowtqu);
+
+ if ($return)
+ // '(<span class="lightRed">'.$unresolved.'</span>/'.$all.')';
+ return $unresolved;
+ else
+ return $unresolved;
+
+ }
+
+ // Prestejemo vse komentarje
+ private function testiranje_komentarji_count () {
+
+ $comment_count = array();
+
+ $rowi = SurveyInfo::getInstance()->getSurveyRow();
+
+
+ // KOMENTARJI NA ANKETO - UREDNIK
+ # vsi komentarji na anketo
+ $strta = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0";
+ $sqlta = sisplet_query($strta);
+ list($rowta) = mysqli_fetch_row($sqlta);
+
+ # nerešeni komentarji: only_unresolved => ocena <= 1
+ $strtu = "SELECT count(*) FROM post WHERE tid='".$rowi['thread']."' AND parent > 0 AND ocena <= 1 ";
+ $sqltu = sisplet_query($strtu);
+ list($rowtu) = mysqli_fetch_row($sqltu);
+ //(int)$rowtu.'/'.(int)$rowta;
+ $comment_count['survey_admin']['all'] = (int)$rowta;
+ $comment_count['survey_admin']['unresolved'] = (int)$rowtu;
+
+
+ // KOMENTARJI NA ANKETO - RESPONDENT
+ # vsi komentarji na anketo
+ $strta = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->anketa."'";
+ $sqlta = sisplet_query($strta);
+ list($rowta) = mysqli_fetch_row($sqlta);
+
+ # nerešeni komentarji: only_unresolved => ocena <= 1
+ $strtu = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->anketa."' AND ocena <= 1 ";
+ $sqltu = sisplet_query($strtu);
+ list($rowtu) = mysqli_fetch_row($sqltu);
+ //(int)$rowtu.'/'.(int)$rowta;
+ $comment_count['survey_resp']['all'] = (int)$rowta;
+ $comment_count['survey_resp']['unresolved'] = (int)$rowtu;
+
+
+ // KOMENTARJI NA VPRASANJE
+ # naenkrat preberemo vse spremenljivke, da ne delamo queryja vsakic posebej
+ $spremenljivke = Cache::cache_all_srv_spremenljivka($this->anketa, true);
+ $spr_id=array();
+ $threads=array();
+ if ( is_array($spremenljivke) && count($spremenljivke) > 0 ) {
+
+ foreach ($spremenljivke as $id=>$value) {
+ $spr_id[] = $id;
+
+ if ((int)$value['thread'] > 0) {
+ $threads[] = $value['thread'];
+ }
+ }
+ }
+
+ $rowqr = array();
+ $rowtqa = array();
+ $rowqrf = array();
+ $rowtqu = array();
+ if (count($spr_id) > 0) {
+ #preštejemo komentarje uporabnikov na vprašanja
+ # srv_data_text where spr_id = 0 AND vre_id IN (id-ji spremenljivk)
+ $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).")";
+ $sqlqr = sisplet_query($strqr);
+ list($rowqr) = mysqli_fetch_row($sqlqr);
+
+ #končani komentarji respondentov
+ #text2 = 2 => končan
+ #text2 = 3 => nerelevantno
+ $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
+ $sqlqrf = sisplet_query($strqrf);
+ list($rowqrf) = mysqli_fetch_row($sqlqrf);
+
+ # preštejemo
+ if (count($threads) > 0) {
+ # vsi komentarji na anketo
+ $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0";
+ $sqlta = sisplet_query($strta);
+ list($rowtqa) = mysqli_fetch_row($sqlta);
+ # nerešeni komentarji: only_unresolved => ocena <= 1
+ $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena IN (2,3) ";
+ $sqltu = sisplet_query($strtu);
+ list($rowtqu) = mysqli_fetch_row($sqltu);
+ }
+ }
+
+ #vsi
+ $comment_count['question']['all'] = (int)((int)$rowqr + (int)$rowtqa);
+ $comment_count['question']['unresolved'] = $comment_count['question']['all'] - (int)((int)$rowqrf + (int)$rowtqu);
+
+ // KOMENTARJI NA IF ALI BLOK
+ # naenkrat preberemo vse ife in bloke, da ne delamo queryja vsakic posebej
+ $ifi = Cache::cache_all_srv_if($this->anketa, true);
+ $if_id = array();
+ $threads_if = array();
+ if ( is_array($ifi) && count($ifi) > 0 ) {
+
+ foreach ($ifi as $id=>$value) {
+ $if_id[] = $id;
+
+ if ((int)$value['thread'] > 0) {
+ $threads_if[] = $value['thread'];
+ }
+ }
+ }
+
+ $rowqr_if = array();
+ $rowtqa_if = array();
+ $rowqrf_if = array();
+ $rowtqu_if = array();
+ if (count($if_id) > 0) {
+
+ #preštejemo komentarje uporabnikov na vprašanja
+ # srv_data_text where if_id = 0 AND vre_id IN (id-ji spremenljivk)
+ $strqr = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$if_id).")";
+ $sqlqr = sisplet_query($strqr);
+ list($rowqr_if) = mysqli_fetch_row($sqlqr);
+
+ #končani komentarji respondentov
+ #text2 = 2 => končan
+ #text2 = 3 => nerelevantno
+ $strqrf = "SELECT count(*) FROM srv_data_text".$this->db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$if_id).") AND text2 IN (2,3)";
+ $sqlqrf = sisplet_query($strqrf);
+ list($rowqrf_if) = mysqli_fetch_row($sqlqrf);
+
+ # preštejemo
+ if (count($threads_if) > 0) {
+ # vsi komentarji na anketo
+ $strta = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads_if).") AND parent > 0";
+ $sqlta = sisplet_query($strta);
+ list($rowtqa_if) = mysqli_fetch_row($sqlta);
+ # nerešeni komentarji: only_unresolved => ocena <= 1
+ $strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads_if).") AND parent > 0 AND ocena IN (2,3) ";
+ $sqltu = sisplet_query($strtu);
+ list($rowtqu_if) = mysqli_fetch_row($sqltu);
+ }
+ }
+
+ $comment_count['question']['all'] += (int)((int)$rowqr_if + (int)$rowtqa_if);
+ $comment_count['question']['unresolved'] += ((int)((int)$rowqr_if + (int)$rowtqa_if)) - ((int)((int)$rowqrf_if + (int)$rowtqu_if));
+
+
+ return $comment_count;
+ }
+}
+
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyCondition.php b/admin/survey/classes/class.SurveyCondition.php
index 08b6239..1c90d63 100644
--- a/admin/survey/classes/class.SurveyCondition.php
+++ b/admin/survey/classes/class.SurveyCondition.php
@@ -68,41 +68,47 @@ class SurveyCondition
$popUp = new PopUp();
$popUp->setId('divConditionProfiles');
- $popUp->setHeaderText($lang[''].'Filtriranje s pogoji');
+ $popUp->setHeaderText($lang['srv_inv_filetr_with_condition']);
#vsebino shranimo v buffer
-
ob_start();
-
+
+ echo '<div class="popup_main with_menu">';
+
echo '<input type="hidden" id="chooseProfileJSAction" value="'.$this->_chooseProfileJSAction.'" />';
- echo '<div class="condition_profile_holder">';
+
+ echo '<div class="popup_left condition_profile_holder">';
- echo '<div id="condition_profile" class="select">';
- if (count($this->_conditions) > 0)
- {
+ echo '<div id="condition_profile" class="list select">';
+ if (count($this->_conditions) > 0){
foreach ($this->_conditions as $key => $value) {
- echo '<div class="option' . ( $pid == $value['id'] ? ' active' : '') . '" data-cid="' . $value['id'] . '" onclick="showSurveyCondition(\''.$value['id'].'\')">' . $value['name'] .'</div>';
+ echo '<div class="list_item option' . ( $pid == $value['id'] ? ' active' : '') . '" data-cid="' . $value['id'] . '" onclick="showSurveyCondition(\''.$value['id'].'\')">' . $value['name'] .'</div>';
}
}
echo '</div>';
echo '</div>';
+
# tukaj prikazemo vsebino ifa
- echo '<div id="div_cp_preview">';
+ echo '<div id="div_cp_preview class="popup_right">';
+
echo '<div id="div_cp_preview_content">';
- if ($pid > 0)
- {
+ if ($pid > 0){
$b = new Branching($this->_sid);
$b->condition_editing($pid, -2);
- } else {
- echo 'Dodaj nov pogoj:';
- echo '<input id="newSurveyConditionName" placeholder="Ime pogoja" >';
- echo '<a href="#" onclick="newSurveyCondition(); return false;" class="faicon if_add" style="margin-left: 5px;" title="Dodaj nov pogoj"> Dodaj nov pogoj</a>';
+ }
+ else {
+ echo $lang['srv_inv_add_new_condition'].':';
+ echo '<input style="margin-left: 8px;" id="newSurveyConditionName" placeholder="'.$lang['srv_inv_condition_name'].'" >';
+ echo '<a href="#" onclick="newSurveyCondition(); return false;" class="faicon if_add" style="margin-left: 8px;" title="'.$lang['srv_inv_add_new_condition'].'"> '.$lang['srv_inv_add_new_condition'].'</a>';
}
echo '</div>';
echo '</div>';
+ echo '</div>';
+
echo '<div id="surveyConditionCover"></div>';
echo '<div id="renameProfileDiv"></div>';
+
$content = ob_get_clean();
#dodamo vsebino
@@ -112,9 +118,8 @@ class SurveyCondition
$popUp->addButton(new PopUpCancelButton());
#dodamo gumb izberi profil
- $confirmAction = 'alert(\'No action set\')';
- if (isset($this->_chooseProfileJSAction) && !empty($this->_chooseProfileJSAction))
- {
+ $confirmAction = 'genericAlertPopup(\'alert_no_action_set\')';
+ if (isset($this->_chooseProfileJSAction) && !empty($this->_chooseProfileJSAction)){
$confirmAction = $this->_chooseProfileJSAction;
}
$button = new PopUpButton($lang['srv_choose_profile']);
@@ -137,9 +142,7 @@ class SurveyCondition
$popUp->addButton($button);
}
- echo $popUp;
-
-
+ echo $popUp;
}
private function newCondition()
@@ -166,7 +169,7 @@ class SurveyCondition
$result['cond_id'] = (int)$cond_id;
$str = "INSERT INTO srv_survey_conditions (ank_id, if_id, name) VALUES ('$this->_sid', '$if_id', '$name')";
$sql = sisplet_query($str);
- if (!sql)
+ if (!$sql)
{
}
else
@@ -222,8 +225,8 @@ class SurveyCondition
}
# pobrišemo še morebitne seje
- SurveySession::sessionStart($this->_sid);
- SurveySession::remove('invitationAdvancedConditionId');
+ //SurveySession::sessionStart($this->_sid);
+ //SurveySession::remove('invitationAdvancedConditionId');
echo json_encode($result);
return;
diff --git a/admin/survey/classes/class.SurveyConditionProfiles.php b/admin/survey/classes/class.SurveyConditionProfiles.php
index 20ae21a..54e471d 100644
--- a/admin/survey/classes/class.SurveyConditionProfiles.php
+++ b/admin/survey/classes/class.SurveyConditionProfiles.php
@@ -96,11 +96,16 @@ class SurveyConditionProfiles
public function getProfileName($pid) {
return self::$profiles[$pid]['name'];
}
+
+ public function getProfileConditionId($p_id = null){
+
+ return (int)($p_id == null ? self::$profiles[self :: $currentProfileId]['if_id'] : self::$profiles[$p_id]['if_id']);
+ }
/* Vrne ID in ime trenutno izbranega profila
*
*/
- function getCurentProfile() {
+ public function getCurentProfile() {
return array('id'=>self::$currentProfileId,'name'=>self::$profiles[self::$currentProfileId]['name']);
}
@@ -130,14 +135,14 @@ class SurveyConditionProfiles
static function DisplayLink($hideAdvanced = true) {
global $lang;
+
// profili statusov
$allProfiles = self :: $profiles;
$css = (self :: $currentProfileId == SCP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || self :: $currentProfileId != SCP_DEFAULT_PROFILE) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_condition_profile" title="' . $lang['srv_condition'] . '" onClick="conditionProfileAction(\'showProfiles\');">' . $lang['srv_condition'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="link_condition_profile" title="' . $lang['srv_condition'] . '" onClick="conditionProfileAction(\'showProfiles\');">' . $lang['srv_condition'] . '</span>'."\n";
echo '</li>';
}
}
@@ -154,32 +159,44 @@ class SurveyConditionProfiles
static function ajax() {
- $pid = $_POST['pid'];
+
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
+
switch ($_GET['a']) {
+
case 'show_condition_profile' :
self :: showProfiles($pid);
break;
+
case 'change_condition_profile' :
-# if (isset($_POST['condition_label']) && $_POST['condition_label'] != '') {
-# self :: setConditionLabel($pid,$_POST['condition_label']);
-# }
if (isset($_POST['condition_error']) && $_POST['condition_error'] != '') {
self :: setConditionError($pid,$_POST['condition_error']);
}
- self :: setDefaultProfileId($pid);
+
+ if (isset($_POST['meta_akcija']) && $_POST['meta_akcija'] == 'invitations') {
+ $SIN = new SurveyInvitationsNew($_POST['anketa']);
+ $SIN -> setAdvancedConditionProfile($_POST['pid']);
+ }
+ else
+ self :: setDefaultProfileId($pid);
break;
+
case 'condition_remove' :
self :: conditionRemove();
break;
+
case 'create_condition_profile' :
self :: createNewProfile();
break;
+
case 'delete_condition_profile' :
self :: deleteProfile();
break;
+
case 'rename_condition_profile' :
self :: renameProfile();
break;
+
default:
echo 'ERROR! Missing function for action: '.$_GET['a'].'! (SurveyConditionProfile)';
break;
@@ -202,38 +219,48 @@ class SurveyConditionProfiles
echo '<div class="popup_close"><a href="#" onClick="conditionProfileAction(\'cancle\'); return false;">✕</a></div>';
if ( self :: $currentProfileId != SCP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div class="condition_profile_holder">';
+
+ echo '<div class="popup_main with_menu">';
+
+ echo '<div class="popup_left condition_profile_holder">';
- echo '<div id="condition_profile" class="select">';
- foreach (self :: $profiles as $key => $value) {
-
- echo ' <div class="option' . ( $_currMPID == $value['id'] ? ' active' : '') . '" id="condition_profile_' . $value['id'] . '" value="'.$value['id'].'">';
-
- echo $value['name'];
-
- if($_currMPID == $value['id']){
- if ( self :: $profiles[$_currMPID]['if_id'] != 0) {
- echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="conditionProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete floatRight"></span></a>';
- }
- if ( self :: $profiles[$_currMPID]['if_id'] != 0) {
- echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="conditionProfileAction(\'renameAsk\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>';
- }
- }
-
- echo '</div>';
- }
- echo '</div>';
- echo '<div class="clr"></div>';
+ echo '<div id="condition_profile" class="list select">';
+ foreach (self :: $profiles as $key => $value) {
+
+ echo '<div class="list-item option' . ( $_currMPID == $value['id'] ? ' active' : '') . '" id="condition_profile_' . $value['id'] . '" value="'.$value['id'].'">';
+
+ echo $value['name'];
+
+ if($_currMPID == $value['id']){
+ echo '<div class="profile_icons">';
+
+ if ( self :: $profiles[$_currMPID]['if_id'] != 0) {
+ echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="conditionProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete floatRight"></span></a>';
+ }
+ if ( self :: $profiles[$_currMPID]['if_id'] != 0) {
+ echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="conditionProfileAction(\'renameAsk\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>';
+ }
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+ }
+ echo '</div>';
+
+ echo '<button class="small white-black" onclick="conditionProfileAction(\'newName\'); return false;"><span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'].'</button>';
+
echo '</div>';
// tukaj prikazemo vsebino ifa
- echo '<div id="div_cp_preview">';
+ echo '<div id="div_cp_preview" class="popup_right">';
+
echo ' <div id="div_cp_preview_content">';
if (self :: $profiles[$_currMPID]['if_id'] > 0) {
@@ -245,17 +272,17 @@ class SurveyConditionProfiles
}
echo ' </div>';
+
echo '</div>';
echo '</div>';
- echo '<div id="conditionProfileButtons">';
// gumbi: preklici, ustvari nov, pozeni trenutni
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="conditionProfileAction(\'run\'); return false;"><span>'.$lang['srv_run_selected_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="conditionProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="conditionProfileAction(\'cancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
+ echo '<div id="conditionProfileButtons" class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="conditionProfileAction(\'cancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo ' <button class="medium blue" onclick="conditionProfileAction(\'run\'); return false;">'.$lang['srv_run_selected_profile'].'</button>';
echo '</div>';
@@ -263,25 +290,50 @@ class SurveyConditionProfiles
echo '<div id="conditionProfileCoverDiv"></div>';
// div za shranjevanje novega profila
- echo '<div id="newProfile">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="conditionProfileAction(\'newCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="conditionProfileAction(\'newCreate\'); return false;"><span>'.$lang['srv_save_profile'].'</span></a></span></span>';
+ echo '<div id="newProfile">';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="conditionProfileAction(\'newCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="conditionProfileAction(\'newCreate\'); return false;">'.$lang['srv_save_profile'].'</button>';
+ echo '</div>';
+
echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self :: $profiles[$_currMPID]['name'] . '" size="45" />';
- echo '<input id="renameProfileId" type="hidden" value="' . self :: $profiles[$_currMPID]['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="conditionProfileAction(\'renameCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="conditionProfileAction(\'renameConfirm\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>';
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" class="text large" value="' . self :: $profiles[$_currMPID]['name'] . '"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . self :: $profiles[$_currMPID]['id'] . '" />';echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="conditionProfileAction(\'renameCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="conditionProfileAction(\'renameConfirm\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
echo '</div>';
+ echo '</div>';
+
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self :: $profiles[$_currMPID]['name'] . '</b>?';
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . self :: $profiles[$_currMPID]['name'] . '</span>?';
echo '<input id="deleteProfileId" type="hidden" value="' . self :: $profiles[$_currMPID]['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="conditionProfileAction(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="conditionProfileAction(\'deleteConfirm\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="conditionProfileAction(\'deleteCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="conditionProfileAction(\'deleteConfirm\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>';
}
@@ -322,8 +374,8 @@ class SurveyConditionProfiles
/* pobrisemo se za ifom*/
$sql = sisplet_query("SELECT * FROM srv_condition WHERE if_id = '$if'");
while ($row = mysqli_fetch_array($sql)) {
- if ((int)$row[id] > 0) {
- sisplet_query("DELETE FROM srv_condition_vre WHERE cond_id='$row[id]'");
+ if ((int)$row['id'] > 0) {
+ sisplet_query("DELETE FROM srv_condition_vre WHERE cond_id='".$row['id']."'");
}
}
if ((int)$if > 0) {
@@ -725,8 +777,8 @@ class SurveyConditionProfiles
$vre_id = (isset($options['vre']) && $options['vre'] != null) ? $options['vre'] : null;
$grd_id = (isset($options['grd']) && $options['grd'] != null) ? $options['grd'] : null;
$isDouble = (isset($options['isDouble']) && $options['isDouble'] != null) ? $options['isDouble'] : false;
- $tip = self::$_HEADER[$spr_id.'_0']['tip'];
- if ( $spr_id != null && count(self::$_HEADER[$spr_id.'_0']['grids']) > 0 ) {
+ $tip = isset(self::$_HEADER[$spr_id.'_0']['tip']) ? self::$_HEADER[$spr_id.'_0']['tip'] : null;
+ if ( $spr_id != null && isset(self::$_HEADER[$spr_id.'_0']['grids']) && count(self::$_HEADER[$spr_id.'_0']['grids']) > 0 ) {
switch ($tip) {
case 1 :
case 3 :
@@ -797,13 +849,6 @@ class SurveyConditionProfiles
}
-# static function setConditionLabel($pid,$condition_label) {
-# if ((int)$pid > 0 ) {
-# $updateString = "UPDATE srv_condition_profiles SET condition_label = '" . $condition_label . "' WHERE id = '" . $pid . "'";
-# $sqlInsert = sisplet_query($updateString);
-# }
-# }
-
static function setConditionError($pid,$condition_error) {
if ((int)$pid > 0 ) {
$updateString = "UPDATE srv_condition_profiles SET condition_error = '" . $condition_error . "' WHERE id = '" . $pid . "'";
@@ -811,47 +856,45 @@ class SurveyConditionProfiles
}
}
- static function getConditionString($if_id = null)
- {
+ static function getConditionString($if_id = null){
global $lang;
- # $condition_label = self::$profiles[self::$currentProfileId]['condition_label'];
ob_start();
$b = new Branching(self::$sid );
- if ($if_id == null || (int)$if_id == 0)
- {
+ if ($if_id == null || (int)$if_id == 0){
$if_id = (int)self::$profiles[self :: $currentProfileId]['if_id'];
}
+
$b->display_if_label($if_id);
- #$condition_label = mysqli_escape_string(ob_get_contents());
$condition_label = ob_get_contents();
ob_end_clean();
+
if ( $if_id > 0 && $condition_label != '') {
- echo '<div id="conditionProfileNote">';
- #if (self::$profiles[self :: $currentProfileId]['type'] == 'inspect') {
- # echo '<span class="floatLeft">'.$lang['srv_profile_data_is_filtred_zoom'].'</span>';
- #} else {
- echo '<span class="floatLeft">'.$lang['srv_profile_data_is_filtred'].'</span>';
- #}
- echo '<span class="floatLeft spaceLeft clr_if"><b>('.self::$profiles[self :: $currentProfileId]['name'].')</b></span>';
- echo '<span class="floatLeft spaceLeft">'.$condition_label.'</span>';
- // ali imamo napake v ifu
- if ((int)self::$profiles[$if_id]['condition_error'] != 0) {
- echo '<br>';
- echo '<span style="border:1px solid #009D91; background-color: #34D0B6; padding:5px; width:auto;"><img src="img_0/error.png" /> ';
- echo '<span class="red strong">'.$lang['srv_profile_condition_has_error'].'</span>';
- echo '</span>';
- }
- echo '<span class="as_link spaceLeft" id="link_condition_edit">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" id="link_condition_remove">'.$lang['srv_profile_remove'].'</span>';
- #if (self::$profiles[self :: $currentProfileId]['type'] == 'inspect') {
- # echo '<span class="as_link spaceLeft" onclick="window.location=\'index.php?anketa='.self::$sid.'&a=data&m=quick_edit&quick_view=1\'">'.$lang['srv_zoom_link_whoisthis'].'</span>';
- #}
+ echo '<div id="conditionProfileNote" class="filter_box">';
+
+ echo ' <div class="header">';
+
+ echo ' <span class="semi-bold">'.self::$profiles[self :: $currentProfileId]['name'].'</span>';
+
+ echo ' <span class="condition">'.$condition_label.'</span>';
+
+ // ali imamo napake v ifu
+ if (isset(self::$profiles[$if_id]['condition_error']) && (int)self::$profiles[$if_id]['condition_error'] != 0) {
+ echo ' <span class="red semi-bold">'.$lang['srv_profile_condition_has_error'].'</span>';
+ }
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" id="link_condition_edit" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" id="link_condition_remove" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo ' </div>';
+
echo '</div>';
- echo '<br class="clr" />';
+
return true;
}
@@ -913,7 +956,8 @@ class SurveyConditionProfiles
}
static function conditionRemove() {
- # nastavimo privzet profil oziroma brez pogojev.
+
+ # nastavimo privzet profil oziroma brez pogojev.
#Če pa je izbran profil bil slučajno inspect, ga v celoti odstranimo, da pobrišemo predhodne nastavitve zaradi gnezdenja
if (isset($_POST['pid']) && (int)$_POST['pid'] > 0) {
$currentProfileId = (int)$_POST['pid'];
diff --git a/admin/survey/classes/class.SurveyConnect.php b/admin/survey/classes/class.SurveyConnect.php
index e8fa818..c945305 100644
--- a/admin/survey/classes/class.SurveyConnect.php
+++ b/admin/survey/classes/class.SurveyConnect.php
@@ -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,29 @@ 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;
+
+ // Arhivska 3
+ case '3':
+ $db_table = '_archive3';
+ 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']);
diff --git a/admin/survey/classes/class.SurveyCopy.php b/admin/survey/classes/class.SurveyCopy.php
index 08f685a..ed0da77 100644
--- a/admin/survey/classes/class.SurveyCopy.php
+++ b/admin/survey/classes/class.SurveyCopy.php
@@ -130,13 +130,15 @@ class SurveyCopy {
// preberemo array
$array = self::getArraySource( $data );
-
- $array['srv_anketa'][0]['naslov'] = $array['srv_anketa'][0]['naslov'].' '.date("j.n.Y");
-
- // zapisemo file na disk
- $fp = fopen( dirname(__FILE__) . '/../SurveyBackup/'.$array['srv_anketa'][0]['id'].'-'.date("d.m.Y-H.i.s").'.1ka', 'w');
- fwrite($fp, serialize($array));
- fclose($fp);
+
+ if(isset($array['srv_anketa'][0])){
+ $array['srv_anketa'][0]['naslov'] = $array['srv_anketa'][0]['naslov'].' '.date("j.n.Y");
+
+ // zapisemo file na disk
+ $fp = fopen( dirname(__FILE__) . '/../SurveyBackup/'.$array['srv_anketa'][0]['id'].'-'.date("d.m.Y-H.i.s").'.1ka', 'w');
+ fwrite($fp, serialize($array));
+ fclose($fp);
+ }
}
@@ -203,6 +205,21 @@ class SurveyCopy {
}
+ /**
+ * vrne array ankete
+ *
+ */
+ static function getArrayVar ( $data = false ) {
+
+ // preberemo array
+ $array = self::getArraySource( $data );
+
+ $array['srv_anketa'][0]['naslov'] = $array['srv_anketa'][0]['naslov'].' '.date("j.n.Y");
+
+ // izpisemo serializiran array
+ return $array;
+ }
+
static function setSourceArray ($array) {
self::$source_array = $array;
}
@@ -215,13 +232,6 @@ class SurveyCopy {
$arr_src = array();
- // subqueryji mysql cist ubijejo zato sem razbil v 2 locena queryja... v bistvu si zakesiramo seznam spremenljivk in ifov
- // TODO ko se MySQL upgrada na 5.6 mogoce prestavit nazaj na navaden subquery, ali pa tut ne - bo za sprobat
-
-
- $qry_src_survey = sisplet_query("SELECT * FROM srv_anketa WHERE id = '".self :: $src_survey."'", self :: $src_connect_db);
- $anketa_array = self::sql2array($qry_src_survey);
-
//Če imamo vklopljeno hierarhijo, potem vrednosti spremenljivk od hierarhije ne kopiramo
// V kolikor imamo vklopljeno hierarhijo potem ne kopiramo spremenljivke od hierarhije
$hierarhija_sql = null;
@@ -380,8 +390,14 @@ class SurveyCopy {
$qry_src_user = sisplet_query("SELECT * FROM srv_user WHERE ank_id = '".self::$src_survey."'", self :: $src_connect_db);
$arr_src['srv_user'] = self::sql2array($qry_src_user);
- $qry_src_data_checkgrid = sisplet_query("SELECT * FROM srv_data_checkgrid WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
- $arr_src['srv_data_checkgrid'] = self::sql2array($qry_src_data_checkgrid);
+ $qry_src_data_checkgrid_archive1 = sisplet_query("SELECT * FROM srv_data_checkgrid_archive1 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_checkgrid_archive1'] = self::sql2array($qry_src_data_checkgrid_archive1);
+
+ $qry_src_data_checkgrid_archive2 = sisplet_query("SELECT * FROM srv_data_checkgrid_archive2 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_checkgrid_archive2'] = self::sql2array($qry_src_data_checkgrid_archive2);
+
+ $qry_src_data_checkgrid_archive3 = sisplet_query("SELECT * FROM srv_data_checkgrid_archive3 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_checkgrid_archive3'] = self::sql2array($qry_src_data_checkgrid_archive3);
$qry_src_data_checkgrid_active = sisplet_query("SELECT * FROM srv_data_checkgrid_active WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_checkgrid_active'] = self::sql2array($qry_src_data_checkgrid_active);
@@ -389,8 +405,14 @@ class SurveyCopy {
$qry_src_data_glasovanje = sisplet_query("SELECT * FROM srv_data_glasovanje WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_glasovanje'] = self::sql2array($qry_src_data_glasovanje);
- $qry_src_data_grid = sisplet_query("SELECT * FROM srv_data_grid WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
- $arr_src['srv_data_grid'] = self::sql2array($qry_src_data_grid);
+ $qry_src_data_grid_archive1 = sisplet_query("SELECT * FROM srv_data_grid_archive1 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_grid_archive1'] = self::sql2array($qry_src_data_grid_archive1);
+
+ $qry_src_data_grid_archive2 = sisplet_query("SELECT * FROM srv_data_grid_archive2 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_grid_archive2'] = self::sql2array($qry_src_data_grid_archive2);
+
+ $qry_src_data_grid_archive3 = sisplet_query("SELECT * FROM srv_data_grid_archive3 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_grid_archive3'] = self::sql2array($qry_src_data_grid_archive3);
$qry_src_data_grid_active = sisplet_query("SELECT * FROM srv_data_grid_active WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_grid_active'] = self::sql2array($qry_src_data_grid_active);
@@ -398,14 +420,26 @@ class SurveyCopy {
$qry_src_data_rating = sisplet_query("SELECT * FROM srv_data_rating WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_rating'] = self::sql2array($qry_src_data_rating);
- $qry_src_data_text = sisplet_query("SELECT * FROM srv_data_text WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
- $arr_src['srv_data_text'] = self::sql2array($qry_src_data_text);
+ $qry_src_data_text_archive1 = sisplet_query("SELECT * FROM srv_data_text_archive1 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_text_archive1'] = self::sql2array($qry_src_data_text_archive1);
+
+ $qry_src_data_text_archive2 = sisplet_query("SELECT * FROM srv_data_text_archive2 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_text_archive2'] = self::sql2array($qry_src_data_text_archive2);
+
+ $qry_src_data_text_archive3 = sisplet_query("SELECT * FROM srv_data_text_archive3 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_text_archive3'] = self::sql2array($qry_src_data_text_archive3);
$qry_src_data_text_active = sisplet_query("SELECT * FROM srv_data_text_active WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_text_active'] = self::sql2array($qry_src_data_text_active);
- $qry_src_data_textgrid = sisplet_query("SELECT * FROM srv_data_textgrid WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
- $arr_src['srv_data_textgrid'] = self::sql2array($qry_src_data_textgrid);
+ $qry_src_data_textgrid_archive1 = sisplet_query("SELECT * FROM srv_data_textgrid_archive1 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_textgrid_archive1'] = self::sql2array($qry_src_data_textgrid_archive1);
+
+ $qry_src_data_textgrid_archive2 = sisplet_query("SELECT * FROM srv_data_textgrid_archive2 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_textgrid_archive2'] = self::sql2array($qry_src_data_textgrid_archive2);
+
+ $qry_src_data_textgrid_archive3 = sisplet_query("SELECT * FROM srv_data_textgrid_archive3 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_textgrid_archive3'] = self::sql2array($qry_src_data_textgrid_archive3);
$qry_src_data_textgrid_active = sisplet_query("SELECT * FROM srv_data_textgrid_active WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_textgrid_active'] = self::sql2array($qry_src_data_textgrid_active);
@@ -413,14 +447,26 @@ class SurveyCopy {
$qry_src_data_upload = sisplet_query("SELECT * FROM srv_data_upload WHERE ank_id='".self::$src_survey."'", self :: $src_connect_db);
$arr_src['srv_data_upload'] = self::sql2array($qry_src_data_upload);
- $qry_src_data_vrednost = sisplet_query("SELECT * FROM srv_data_vrednost WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
- $arr_src['srv_data_vrednost'] = self::sql2array($qry_src_data_vrednost);
+ $qry_src_data_vrednost_archive1 = sisplet_query("SELECT * FROM srv_data_vrednost_archive1 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_vrednost_archive1'] = self::sql2array($qry_src_data_vrednost_archive1);
+
+ $qry_src_data_vrednost_archive2 = sisplet_query("SELECT * FROM srv_data_vrednost_archive2 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_vrednost_archive2'] = self::sql2array($qry_src_data_vrednost_archive2);
+
+ $qry_src_data_vrednost_archive3 = sisplet_query("SELECT * FROM srv_data_vrednost_archive3 WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
+ $arr_src['srv_data_vrednost_archive3'] = self::sql2array($qry_src_data_vrednost_archive3);
$qry_src_data_vrednost_active = sisplet_query("SELECT * FROM srv_data_vrednost_active WHERE spr_id IN (".$qry_cache_spr_id.")", self :: $src_connect_db);
$arr_src['srv_data_vrednost_active'] = self::sql2array($qry_src_data_vrednost_active);
- $qry_src_user_grupa = sisplet_query("SELECT * FROM srv_user_grupa WHERE usr_id IN (".$qry_cache_usr_id.")", self::$src_connect_db);
- $arr_src['srv_user_grupa'] = self::sql2array($qry_src_user_grupa);
+ $qry_src_user_grupa_archive1 = sisplet_query("SELECT * FROM srv_user_grupa_archive1 WHERE usr_id IN (".$qry_cache_usr_id.")", self::$src_connect_db);
+ $arr_src['srv_user_grupa_archive1'] = self::sql2array($qry_src_user_grupa_archive1);
+
+ $qry_src_user_grupa_archive2 = sisplet_query("SELECT * FROM srv_user_grupa_archive2 WHERE usr_id IN (".$qry_cache_usr_id.")", self::$src_connect_db);
+ $arr_src['srv_user_grupa_archive2'] = self::sql2array($qry_src_user_grupa_archive2);
+
+ $qry_src_user_grupa_archive3 = sisplet_query("SELECT * FROM srv_user_grupa_archive3 WHERE usr_id IN (".$qry_cache_usr_id.")", self::$src_connect_db);
+ $arr_src['srv_user_grupa_archive3'] = self::sql2array($qry_src_user_grupa_archive3);
$qry_src_user_grupa_active = sisplet_query("SELECT * FROM srv_user_grupa_active WHERE usr_id IN (".$qry_cache_usr_id.")", self::$src_connect_db);
$arr_src['srv_user_grupa_active'] = self::sql2array($qry_src_user_grupa_active);
@@ -473,8 +519,12 @@ class SurveyCopy {
// iz izvorne ankete preberemo vsa polja
if ( count($arr_src['srv_anketa']) > 0) {
+ // Nastavimo se hash nove ankete
+ $hash = Common::generateSurveyHash();
+
// predefinirana polja (vsilimo vrednosti)
$pre_set = array('id' => "NULL",
+ 'hash' => "'".$hash."'",
'backup' => "'0'",
'active' => "'0'",
'locked' => "'0'",
@@ -603,7 +653,7 @@ class SurveyCopy {
$new_grupa_ids[0] = 0; // pri srv_user_grupa je 0 za prvo stran
$new_spremenljivke_ids = array();
- if (count($new_grupa_ids) > 0) {
+ if (is_countable($new_grupa_ids) && count($new_grupa_ids) > 0) {
foreach ($new_grupa_ids as $old_grupa_id => $new_grupa_id) {
// spremenljivke, tabela srv_spremenljivka
@@ -625,7 +675,7 @@ class SurveyCopy {
// gridi - srv_grid
$new_grid_ids = array();
- if (count($new_spremenljivke_ids) > 0) {
+ if (is_countable($new_spremenljivke_ids) && count($new_spremenljivke_ids) > 0) {
foreach ($new_spremenljivke_ids AS $old_spremenljivka_id => $new_spremenljivka_id) {
// gridi, tabela srv_grid
@@ -634,7 +684,7 @@ class SurveyCopy {
$tmp_grid_ids = self :: preformCopyTable('srv_grid', 'variable', $src_srv_grid, $pre_set);
// shranimo stare in nove id-je spremenljivk
- if ( count($tmp_grid_ids) > 0 )
+ if ($tmp_grid_ids !=null && count($tmp_grid_ids) > 0 )
foreach ($tmp_grid_ids as $key => $value)
$new_grid_ids[$new_spremenljivka_id][$key] = $value;
@@ -664,28 +714,6 @@ class SurveyCopy {
$pre_set = array('sid' => "'".$new_survey_id."'");
$new_missing_values_ids = self::preformCopyTable('srv_missing_values', null, $arr_src['srv_missing_values'], $pre_set);
-
- // vrednosti - prestavljeno pod srv_if da se ne porusijo notranji pogoji! Patrik - zakaj je bilo to prestavljeno višje??
- /*$new_vrednosti_ids = array();
- if ( count($new_spremenljivke_ids) > 0) {
- foreach( $new_spremenljivke_ids AS $old_spremenljivka_id => $new_spremenljivka_id) {
-
- // vrednosti, tabela srv_vrednost
- $src_srv_vrednost = self::arrayfilter($arr_src['srv_vrednost'], 'spr_id', $old_spremenljivka_id);
- $pre_set = array('id' => "NULL",
- 'spr_id' => array('field'=>'spr_id', 'from'=>$new_spremenljivke_ids),
- 'vre_id' => array('field'=>'vre_id', 'from'=>$new_vrednosti_ids));
- $tmp_vrednosti_ids = self :: preformCopyTable('srv_vrednost', 'id', $src_srv_vrednost, $pre_set);
-
- // shranimo stare in nove id-je spremenljivk
- if ( count($tmp_vrednosti_ids) > 0 )
-
- foreach ($tmp_vrednosti_ids as $key => $value){
- $new_vrednosti_ids[$key] = $value;
- }
- }
- }*/
-
// splosne nastavitve ankete, tabela srv_survey_misc
$pre_set = array('sid' => "'".$new_survey_id."'");
@@ -705,7 +733,6 @@ class SurveyCopy {
foreach ($srv_if AS $row) {
// IF-i, tabela srv_if
- //$qry_src_if = sisplet_query("SELECT * FROM srv_if WHERE id = '".$row[id]."'", self :: $src_connect_db);
$qry_src_if = self::arrayfilter($arr_src['srv_if'], 'id', $row['id']);
$pre_set = array('id' => "NULL");
$tmp_if_ids = self :: preformCopyTable('srv_if', 'id', $qry_src_if, $pre_set);
@@ -715,7 +742,7 @@ class SurveyCopy {
// vrednosti
$new_vrednosti_ids = array();
- if ( count($new_spremenljivke_ids) > 0) {
+ if (is_countable($new_spremenljivke_ids) && count($new_spremenljivke_ids) > 0) {
foreach( $new_spremenljivke_ids AS $old_spremenljivka_id => $new_spremenljivka_id) {
// vrednosti, tabela srv_vrednost
@@ -726,7 +753,7 @@ class SurveyCopy {
$tmp_vrednosti_ids = self :: preformCopyTable('srv_vrednost', 'id', $src_srv_vrednost, $pre_set);
// shranimo stare in nove id-je spremenljivk
- if ( count($tmp_vrednosti_ids) > 0 )
+ if ( is_countable($tmp_vrednosti_ids) && count($tmp_vrednosti_ids) > 0 )
foreach ($tmp_vrednosti_ids as $key => $value)
$new_vrednosti_ids[$key] = $value;
@@ -736,7 +763,7 @@ class SurveyCopy {
// srv_calculation
// za vsak condition , če je spr_id > 0 priredimo novo, če ne damo enako (-1,-2)
- if (count($new_spremenljivke_ids) > 0) {
+ if (is_countable($new_spremenljivke_ids) && count($new_spremenljivke_ids) > 0) {
foreach ($new_spremenljivke_ids AS $old_spremenljivka_id => $new_spremenljivka_id) {
$srv_calculation = self::arrayfilter($arr_src['srv_calculation'], 'cnd_id', -$old_spremenljivka_id);
@@ -790,7 +817,7 @@ class SurveyCopy {
// condtition grid, tabela srv_condition_grid
- if (count($condition) > 0) {
+ if (is_countable($condition) && count($condition) > 0) {
foreach ($condition AS $orig => $bckp) {
// condtition grid, tabela srv_condition_grid
//$qry_src_condition_grid = sisplet_query("SELECT * FROM srv_condition_grid WHERE cond_id = '".$orig."'", self :: $src_connect_db);
@@ -803,7 +830,7 @@ class SurveyCopy {
}
// condtition vrednost, tabela srv_condition_vre
- if (count($condition) > 0) {
+ if (is_countable($condition) && count($condition) > 0) {
foreach ($condition AS $orig => $bckp) {
//$qry_src_condition_vre = sisplet_query("SELECT * FROM srv_condition_vre WHERE cond_id = '$orig'", self :: $src_connect_db);
$src_srv_condition_vre = self::arrayfilter($arr_src['srv_condition_vre'], 'cond_id', $orig);
@@ -843,7 +870,7 @@ class SurveyCopy {
// srv_calculation
// za vsak condition , če je spr_id > 0 priredimo novo, če ne damo enako (-1,-2)
- if (count($condition) > 0) {
+ if (is_countable($condition) && count($condition) > 0) {
foreach ($condition AS $orig => $bckp) {
//$qry_src_calculation = sisplet_query("SELECT * FROM srv_calculation WHERE cnd_id = '$orig'", self :: $src_connect_db);
$src_srv_calculation = self::arrayfilter($arr_src['srv_calculation'], 'cnd_id', $orig);
@@ -889,7 +916,7 @@ class SurveyCopy {
/**
* PODATKI
*/
- if ( $arr_src['data'] ) {
+ if ( isset($arr_src['data']) ) {
$ip = GetIP();
// srv_user
@@ -907,18 +934,34 @@ class SurveyCopy {
'ank_id' => "'".$new_survey_id."'");
$src_srv_user = self::arrayfilter($arr_src['srv_user'], 'id', $row_array['id']);
$tmp_user_ids = self::preformCopyTable('srv_user', 'id', $src_srv_user, $pre_set);
- if ( count($tmp_user_ids) > 0 )
+ if ( is_countable($tmp_user_ids) && count($tmp_user_ids) > 0 )
foreach ($tmp_user_ids as $key => $value)
$new_user_ids[$key] = $value;
}
- // srv_data_checkgrid - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_data_checkgrid_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
- self::preformCopyTable('srv_data_checkgrid_active', null, $arr_src['srv_data_checkgrid'], $pre_set);
+ self::preformCopyTable('srv_data_checkgrid_active', null, $arr_src['srv_data_checkgrid_archive1'], $pre_set);
+
+ // srv_data_checkgrid_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_checkgrid_active', null, $arr_src['srv_data_checkgrid_archive2'], $pre_set);
+
+ // srv_data_checkgrid_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_checkgrid_active', null, $arr_src['srv_data_checkgrid_archive3'], $pre_set);
// srv_data_checkgrid_active
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
@@ -933,13 +976,29 @@ class SurveyCopy {
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids));
self::preformCopyTable('srv_data_glasovanje', null, $arr_src['srv_data_glasovanje'], $pre_set);
- // srv_data_grid - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_data_grid_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_grid_active', null, $arr_src['srv_data_grid_archive1'], $pre_set);
+
+ // srv_data_grid_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_grid_active', null, $arr_src['srv_data_grid_archive2'], $pre_set);
+
+ // srv_data_grid_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
- self::preformCopyTable('srv_data_grid_active', null, $arr_src['srv_data_grid'], $pre_set);
+ self::preformCopyTable('srv_data_grid_active', null, $arr_src['srv_data_grid_archive3'], $pre_set);
// srv_data_grid_active
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
@@ -956,13 +1015,29 @@ class SurveyCopy {
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
self::preformCopyTable('srv_data_rating', null, $arr_src['srv_data_rating'], $pre_set);
- // srv_data_text - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_data_text_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('id' => "NULL",
'spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
- self::preformCopyTable('srv_data_text_active', 'id', $arr_src['srv_data_text'], $pre_set);
+ self::preformCopyTable('srv_data_text_active', 'id', $arr_src['srv_data_text_archive1'], $pre_set);
+
+ // srv_data_text_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('id' => "NULL",
+ 'spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_text_active', 'id', $arr_src['srv_data_text_archive2'], $pre_set);
+
+ // srv_data_text_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('id' => "NULL",
+ 'spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_text_active', 'id', $arr_src['srv_data_text_archive3'], $pre_set);
// srv_data_text_active
$pre_set = array('id' => "NULL",
@@ -972,13 +1047,29 @@ class SurveyCopy {
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
self::preformCopyTable('srv_data_text_active', 'id', $arr_src['srv_data_text_active'], $pre_set);
- // srv_data_textgrid - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_data_textgrid_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
- self::preformCopyTable('srv_data_textgrid_active', null, $arr_src['srv_data_textgrid'], $pre_set);
+ self::preformCopyTable('srv_data_textgrid_active', null, $arr_src['srv_data_textgrid_archive1'], $pre_set);
+
+ // srv_data_textgrid_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_textgrid_active', null, $arr_src['srv_data_textgrid_archive2'], $pre_set);
+
+ // srv_data_textgrid_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'grd_id' => array('field'=>'grd_id', 'from' => $new_grid_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_textgrid_active', null, $arr_src['srv_data_textgrid_archive3'], $pre_set);
// srv_data_textgrid_active
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
@@ -993,12 +1084,26 @@ class SurveyCopy {
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids));
self::preformCopyTable('srv_data_upload', null, $arr_src['srv_data_upload'], $pre_set);
- // srv_data_vrednost - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_data_vrednost_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_vrednost_active', null, $arr_src['srv_data_vrednost_archive1'], $pre_set);
+
+ // srv_data_vrednost_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
+ 'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
+ 'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
+ self::preformCopyTable('srv_data_vrednost_active', null, $arr_src['srv_data_vrednost_archive2'], $pre_set);
+
+ // srv_data_vrednost_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
'vre_id' => array('field'=>'vre_id', 'from' => $new_vrednosti_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids),
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
- self::preformCopyTable('srv_data_vrednost_active', null, $arr_src['srv_data_vrednost'], $pre_set);
+ self::preformCopyTable('srv_data_vrednost_active', null, $arr_src['srv_data_vrednost_archive3'], $pre_set);
// srv_data_vrednost_active
$pre_set = array('spr_id' => array('field'=>'spr_id', 'from' => $new_spremenljivke_ids),
@@ -1007,10 +1112,20 @@ class SurveyCopy {
'loop_id' => array('field'=>'loop_id', 'from' => $new_loop_data_ids));
self::preformCopyTable('srv_data_vrednost_active', null, $arr_src['srv_data_vrednost_active'], $pre_set);
- // srv_user_grupa - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ // srv_user_grupa_archive1 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('gru_id' => array('field'=>'gru_id', 'from' => $new_grupa_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids));
+ self::preformCopyTable('srv_user_grupa_active', null, $arr_src['srv_user_grupa_archive1'], $pre_set);
+
+ // srv_user_grupa_archive2 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
$pre_set = array('gru_id' => array('field'=>'gru_id', 'from' => $new_grupa_ids),
'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids));
- self::preformCopyTable('srv_user_grupa_active', null, $arr_src['srv_user_grupa'], $pre_set);
+ self::preformCopyTable('srv_user_grupa_active', null, $arr_src['srv_user_grupa_archive2'], $pre_set);
+
+ // srv_user_grupa_archive3 - VSE VEDNO KOPIRAMO V ACTIVE TABELE
+ $pre_set = array('gru_id' => array('field'=>'gru_id', 'from' => $new_grupa_ids),
+ 'usr_id' => array('field'=>'usr_id', 'from' => $new_user_ids));
+ self::preformCopyTable('srv_user_grupa_active', null, $arr_src['srv_user_grupa_archive3'], $pre_set);
// srv_user_grupa_active
$pre_set = array('gru_id' => array('field'=>'gru_id', 'from' => $new_grupa_ids),
@@ -1077,7 +1192,7 @@ class SurveyCopy {
self :: $errors[] = 'Could not run query: ' . mysqli_error($GLOBALS['connect_db']);
}
- if ( count($array_source) > 0 ) {
+ if (is_countable($array_source) && count($array_source) > 0) {
// zloopamo skozi polja druge tabele in predpripravimo insert string polja
if (mysqli_num_rows($dest_table_fields) > 0) {
@@ -1115,15 +1230,15 @@ class SurveyCopy {
*/
// ce polje v src datoteki ni nastavljeno ga damo na praznega
- if ( ! isset($row_src[$dest_field]) && ! isset($pre_set[$dest_field]) ) {
- $dest_value = "''";
-
- // ce je polje NULL, ga moramo rocno nastavit na NULL
- } elseif ($row_src[$dest_field] === NULL) {
- $dest_value = "NULL";
-
- } else {
-
+ if ( !isset($row_src[$dest_field]) && !isset($pre_set[$dest_field]) ) {
+ $dest_value = "''";
+ }
+ // ce je polje NULL, ga moramo rocno nastavit na NULL
+ //elseif ( $row_src[$dest_field] === NULL && !isset($pre_set[$dest_field]) ) { // Ce potrebujemo kompatibilnost za nazaj se lahko to vklopi
+ elseif ( $row_src[$dest_field] === NULL ) {
+ $dest_value = "NULL";
+ }
+ else {
$dest_value = isset($pre_set[$dest_field])
? ( !(is_array($pre_set[$dest_field]) && isset($pre_set[$dest_field]['field']) && isset($pre_set[$dest_field]['from']))
? $pre_set[$dest_field]
@@ -1133,7 +1248,6 @@ class SurveyCopy {
)
)
: "'".mysqli_real_escape_string($GLOBALS['connect_db'], $row_src[$dest_field])."'";
-
}
$insert_values .= $insert_values_prefix . $dest_value;
@@ -1159,7 +1273,9 @@ class SurveyCopy {
}
} else {
// lahko da je sql ne vrne id-ja (kadar ni primary key-a)
- $result[$row_src[$id_field]] = $row_src[$id_field];
+ if (isset($row_src[$id_field])) {
+ $result[$row_src[$id_field]] = $row_src[$id_field];
+ }
}
}
@@ -1223,11 +1339,23 @@ class SurveyCopy {
// Kopiramo odgovore
- // srv_data_vrednost
- $sqlD = sisplet_query("SELECT * FROM srv_data_vrednost WHERE usr_id='".$usr_id."'");
+ // srv_data_vrednost_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_data_vrednost_archive1 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_vrednost_archive1', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_vrednost_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_data_vrednost_archive2 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_vrednost_archive2', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_vrednost_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_data_vrednost_archive3 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'usr_id' => $new_usr_id,
'loop_id' => "NULL");
- self::preformCopyTable('srv_data_vrednost', null, self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_data_vrednost_archive3', null, self::sql2array($sqlD), $pre_set);
// srv_data_vrednost_active
$sqlD = sisplet_query("SELECT * FROM srv_data_vrednost_active WHERE usr_id='".$usr_id."'");
@@ -1235,12 +1363,26 @@ class SurveyCopy {
'loop_id' => "NULL");
self::preformCopyTable('srv_data_vrednost_active', null, self::sql2array($sqlD), $pre_set);
- // srv_data_text
- $sqlD = sisplet_query("SELECT * FROM srv_data_text WHERE usr_id='".$usr_id."'");
+ // srv_data_text_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_data_text_archive1 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'id' => "NULL",
'usr_id' => $new_usr_id,
'loop_id' => "NULL");
- self::preformCopyTable('srv_data_text', 'id', self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_data_text_archive1', 'id', self::sql2array($sqlD), $pre_set);
+
+ // srv_data_text_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_data_text_archive2 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'id' => "NULL",
+ 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_text_archive2', 'id', self::sql2array($sqlD), $pre_set);
+
+ // srv_data_text_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_data_text_archive3 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'id' => "NULL",
+ 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_text_archive3', 'id', self::sql2array($sqlD), $pre_set);
// srv_data_text_active
$sqlD = sisplet_query("SELECT * FROM srv_data_text_active WHERE usr_id='".$usr_id."'");
@@ -1249,11 +1391,23 @@ class SurveyCopy {
'loop_id' => "NULL");
self::preformCopyTable('srv_data_text_active', 'id', self::sql2array($sqlD), $pre_set);
- // srv_data_checkgrid
- $sqlD = sisplet_query("SELECT * FROM srv_data_checkgrid WHERE usr_id='".$usr_id."'");
+ // srv_data_checkgrid_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_data_checkgrid_archive1 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_checkgrid_archive1', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_checkgrid_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_data_checkgrid_archive2 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'usr_id' => $new_usr_id,
'loop_id' => "NULL");
- self::preformCopyTable('srv_data_checkgrid', null, self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_data_checkgrid_archive2', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_checkgrid_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_data_checkgrid_archive3 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_checkgrid_archive3', null, self::sql2array($sqlD), $pre_set);
// srv_data_checkgrid_active
$sqlD = sisplet_query("SELECT * FROM srv_data_checkgrid_active WHERE usr_id='".$usr_id."'");
@@ -1261,11 +1415,23 @@ class SurveyCopy {
'loop_id' => "NULL");
self::preformCopyTable('srv_data_checkgrid_active', null, self::sql2array($sqlD), $pre_set);
- // srv_data_grid
- $sqlD = sisplet_query("SELECT * FROM srv_data_grid WHERE usr_id='".$usr_id."'");
+ // srv_data_grid_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_data_grid_archive1 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_grid_archive1', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_grid_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_data_grid_archive2 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'usr_id' => $new_usr_id,
'loop_id' => "NULL");
- self::preformCopyTable('srv_data_grid', null, self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_data_grid_archive2', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_grid_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_data_grid_archive3 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_grid_archive3', null, self::sql2array($sqlD), $pre_set);
// srv_data_grid_active
$sqlD = sisplet_query("SELECT * FROM srv_data_grid_active WHERE usr_id='".$usr_id."'");
@@ -1273,11 +1439,23 @@ class SurveyCopy {
'loop_id' => "NULL");
self::preformCopyTable('srv_data_grid_active', null, self::sql2array($sqlD), $pre_set);
- // srv_data_textgrid
- $sqlD = sisplet_query("SELECT * FROM srv_data_textgrid WHERE usr_id='".$usr_id."'");
+ // srv_data_textgrid_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_data_textgrid_archive1 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'usr_id' => $new_usr_id,
'loop_id' => "NULL");
- self::preformCopyTable('srv_data_textgrid', null, self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_data_textgrid_archive1', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_textgrid_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_data_textgrid_archive2 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_textgrid_archive2', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_data_textgrid_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_data_textgrid_archive3 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'loop_id' => "NULL");
+ self::preformCopyTable('srv_data_textgrid_archive3', null, self::sql2array($sqlD), $pre_set);
// srv_data_textgrid_active
$sqlD = sisplet_query("SELECT * FROM srv_data_textgrid_active WHERE usr_id='".$usr_id."'");
@@ -1301,11 +1479,23 @@ class SurveyCopy {
$pre_set = array( 'usr_id' => $new_usr_id);
self::preformCopyTable('srv_data_glasovanje', null, self::sql2array($sqlD), $pre_set);
- // srv_user_grupa
- $sqlD = sisplet_query("SELECT * FROM srv_user_grupa WHERE usr_id='".$usr_id."'");
+ // srv_user_grupa_archive1
+ $sqlD = sisplet_query("SELECT * FROM srv_user_grupa_archive1 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'time_edit' => "NOW()");
+ self::preformCopyTable('srv_user_grupa_archive1', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_user_grupa_archive2
+ $sqlD = sisplet_query("SELECT * FROM srv_user_grupa_archive2 WHERE usr_id='".$usr_id."'");
+ $pre_set = array( 'usr_id' => $new_usr_id,
+ 'time_edit' => "NOW()");
+ self::preformCopyTable('srv_user_grupa_archive2', null, self::sql2array($sqlD), $pre_set);
+
+ // srv_user_grupa_archive3
+ $sqlD = sisplet_query("SELECT * FROM srv_user_grupa_archive3 WHERE usr_id='".$usr_id."'");
$pre_set = array( 'usr_id' => $new_usr_id,
'time_edit' => "NOW()");
- self::preformCopyTable('srv_user_grupa', null, self::sql2array($sqlD), $pre_set);
+ self::preformCopyTable('srv_user_grupa_archive3', null, self::sql2array($sqlD), $pre_set);
// srv_user_grupa_active
$sqlD = sisplet_query("SELECT * FROM srv_user_grupa_active WHERE usr_id='".$usr_id."'");
@@ -1338,10 +1528,12 @@ class SurveyCopy {
$array = array();
- while ($row = mysqli_fetch_assoc($sql)) {
-
- $array[] = $row;
-
+ if($sql){
+ while ($row = mysqli_fetch_assoc($sql)) {
+
+ $array[] = $row;
+
+ }
}
return $array;
@@ -1367,6 +1559,13 @@ class SurveyCopy {
return $arr;
}
+
+
+ public static function reset(){
+
+ self::$errors = null;
+ self::$source_array = null;
+ }
}
diff --git a/admin/survey/classes/class.SurveyCustomReport.php b/admin/survey/classes/class.SurveyCustomReport.php
index c0d9acf..94bcda2 100644
--- a/admin/survey/classes/class.SurveyCustomReport.php
+++ b/admin/survey/classes/class.SurveyCustomReport.php
@@ -19,6 +19,11 @@ class SurveyCustomReport {
public $creportProfile = 0; // trenutno izbrani profil porocila
public $creportAuthor = 0; // trenutno izbrani avtor porocila ki se ga ureja
+ public $db_table = null;
+ public $headFileName = null;
+ public $dataFileName = null;
+ public $dataFileStatus = null;
+
public $expanded = 0; // skrcen(0) ali razsirjen(1) nacin
function __construct($anketa) {
@@ -29,9 +34,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);
@@ -89,55 +93,90 @@ class SurveyCustomReport {
ob_start();
}
- if ($this->isArchive == false && $this->publicCReport == false) {
+ if ($this->isArchive == false && $this->publicCReport == false) {
echo '<input type="hidden" value="'.$this->expanded.'" id="creport_expanded" />';
$this->displayProfilePopups();
// Prva vrstica - seznam poročil
- echo '<div>';
- echo '<span class="pointer blue bold" style="font-size:14px;" onClick="showCReportProfiles();">'.$lang['srv_custom_report_list'].'</span>';
- echo ' <span id="creport_profile_setting_plus" class="pointer faicon add icon-as_link spaceLeft" title="'.$lang['srv_custom_report_create'].'" style="padding-bottom:1px;"></span>';
- echo '</div>';
-
- // Naslov
- echo '<h2 style="display:inline-block; color:#333;">';
-
- // Profil
- if($this->creportProfile == 0){
-
- $what = 'creport_default_profile_name';
- $sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='$this->creportAuthor' AND what='$what'");
-
- if(mysqli_num_rows($sql) == 0){
- $name = $lang['srv_custom_report_default'];
- }
- else{
- $row = mysqli_fetch_array($sql);
- $name = $row['value'];
- }
- }
- else{
- $profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
- }
- echo '<span style="font-weight: normal;">';
- echo $lang['srv_custom_report_profile'].': <span class="bold pointer blue" onClick="showCReportProfiles();">"'.$name.'"</span>';
- echo '</span>';
+ echo '<div id="custom_report_top">';
+
+
+ // Seznam porocil
+ echo ' <div class="custom_report_list">';
+
+ // Seznam avtorjevih porocil
+
+ // Prvo default porocilo
+ $sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='$global_user_id' AND what='creport_default_profile_name'");
+ if(mysqli_num_rows($sql) == 0){
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$global_user_id.'\');">';
+ echo $lang['srv_custom_report_default'];
+ echo '</div>';
+ }
+ else{
+ $row = mysqli_fetch_array($sql);
+
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$global_user_id.'\');">';
+ echo $row['value'];
+ echo '</div>';
+ }
+
+ // Loop po ostalih lastnih porocilih
+ $sqlReports = sisplet_query("SELECT * FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='$global_user_id'");
+ while($rowReports = mysqli_fetch_array($sqlReports)){
+ echo '<div class="list_item '.($this->creportProfile == $rowReports['id'] && $this->creportAuthor == $global_user_id ? 'active' : '').'" onClick="change_creport_profile(\''.$rowReports['id'].'\', \''.$global_user_id.'\');">';
+ echo $rowReports['name'];
+ echo '</div>';
+ }
+
+ // Loop po deljenih porocilih
+ $sqlSharedReports = sisplet_query("SELECT s.*, u.email FROM srv_custom_report_share s, users u WHERE ank_id='$this->ank_id' AND share_usr_id='$global_user_id' AND u.id=s.author_usr_id");
+ while($rowSharedReports = mysqli_fetch_array($sqlSharedReports)){
+
+ // Ce gre za osnovno porocilo ki ga ne more pobrisati
+ if($rowSharedReports['profile_id'] == 0){
+
+ // Dobimo ime osnovnega porocila
+ $what = 'creport_default_profile_name';
+ $sqlN = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='".$rowSharedReports['author_usr_id']."' AND what='$what'");
+ if(mysqli_num_rows($sqlN) == '0'){
+ $default_name = $lang['srv_custom_report_default'];
+ }
+ else{
+ $rowN = mysqli_fetch_array($sqlN);
+ $default_name = ($rowN['value'] == '') ? $lang['srv_custom_report_default'] : $rowN['value'];
+ }
+
+ echo '<div class="list_item '.($this->creportProfile == 0 && $this->creportAuthor == $rowSharedReports['author_usr_id'] ? 'active' : '').'" onClick="change_creport_profile(\'0\', \''.$rowSharedReports['author_usr_id'].'\');" id="creport_profile_0_'.$rowSharedReports['author_usr_id'].'" author="'.$rowSharedReports['author_usr_id'].'" value="0">';
+ echo $default_name . ' ('.$rowSharedReports['email'].')';
+ echo '</div>';
+ }
+ // Ce gre za dodatno porocilo ga imamo normalno v bazi
+ else{
+ $sql = sisplet_query("SELECT * FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='".$rowSharedReports['author_usr_id']."'");
+ while($row = mysqli_fetch_array($sql)){
+ echo '<div class="list_item '.($this->creportProfile == $row['id'] && $this->creportAuthor == $rowSharedReports['author_usr_id'] ? 'active' : '').'" onClick="change_creport_profile(\''.$row['id'].'\', \''.$rowSharedReports['author_usr_id'].'\');">';
+ echo $row['name'] . ' ('.$rowSharedReports['email'].')';
+ echo '</div>';
+ }
+ }
+ }
+
+ echo '</div>';
- echo '</h2>';
// Edit in add porocilo
- echo '<div style="display:inline-block; line-height:10px;">';
- echo ' <span id="creport_profile_setting_edit" class="faicon edit icon-as_link spaceLeft" style="margin-bottom:1px;" title="'.$lang['srv_custom_report_edit'].'"></span>';
+ echo ' <span id="creport_profile_setting_edit" class="faicon edit" title="'.$lang['srv_custom_report_edit'].'"></span>';
+ echo ' <span id="creport_profile_setting_plus" class="faicon add" title="'.$lang['srv_custom_report_create'].'"></span>';
// Osnova porocila (prazna, vsi grafi, vse frekvence...) - prikazemo samo ce je porocilo prazno
if($this->checkEmpty($this->ank_id)){
- echo '<span style="font-size:14px; font-weight: normal; margin-left: 20px;">';
- echo $lang['srv_custom_report_base'].': ';
+ echo '<span class="custom_report_base">';
+ echo $lang['srv_custom_report_base'].':';
- echo '<select name="custom_report_base" id="custom_report_base" onChange="addCustomReportAllElementsAlert(this.value);">';
+ echo '<select name="custom_report_base" id="custom_report_base" class="dropdown medium" onChange="addCustomReportAllElementsAlert(this.value);">';
echo ' <option value="0">'.$lang['srv_custom_report_base_0'].'</option>';
echo ' <option value="1">'.$lang['srv_sumarnik'].'</option>';
echo ' <option value="2">'.$lang['srv_frequency'].'</option>';
@@ -146,37 +185,27 @@ class SurveyCustomReport {
echo '</select>';
echo '</span>';
}
- echo '</div>';
-
- // Stevilo vseh porocil
- $sqlC = sisplet_query("SELECT id FROM srv_custom_report_profiles WHERE ank_id='$this->ank_id' AND usr_id='$global_user_id'");
- $report_count = mysqli_num_rows($sqlC);
- if($report_count > 0)
- echo '<div style="margin:-12px 0 20px 0; color:#555555; font-size:10px;">'.$lang['srv_custom_report_count'].': '.($report_count + 1).'</div>';
-
-
- // Preklop na skrcen/razsirjen pogled in predogled
- if ($this->isArchive == false && $this->publicCReport == false) {
-
- echo '<div id="custom_report_view">';
-
- if($this->expanded == 0)
- echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=1"><span class="faicon compress"></span> '.$lang['srv_custom_report_expanded_0'].'</a>';
- else
- echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=0"><span class="faicon expand"></span> '.$lang['srv_custom_report_expanded_1'].'</a>';
-
- // Preview
- echo ' &nbsp;<a title="'.$lang['srv_custom_report_preview'].'" onClick="showCReportPreview(); return false;" href="#"><span class="faicon preview pointer"></span> '.$lang['srv_custom_report_preview_short'].'</a>';
-
- echo '</div>';
- }
+
+ echo '</div>';
+
- }
-
- echo '<div id="custom_report_elements">';
+ // Preklop na skrcen/razsirjen pogled in predogled
+ echo '<div id="custom_report_view">';
+
+ if($this->expanded == 0)
+ echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=1" class="noline"><span class="faicon compress"></span> '.$lang['srv_custom_report_expanded_0'].'</a>';
+ else
+ echo '<a href="index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport&expanded=0" class="noline"><span class="faicon expand"></span> '.$lang['srv_custom_report_expanded_1'].'</a>';
+
+ // Preview
+ echo '<a title="'.$lang['srv_custom_report_preview'].'" class="noline" onClick="showCReportPreview(); return false;" href="#"><span class="faicon monitor"></span> '.$lang['srv_custom_report_preview_short'].'</a>';
+
+ echo '</div>';
+ }
-
+ echo '<div id="custom_report_elements" class="div_analiza_holder">';
+
// ce arhiviramo imamo razsirjene elemente
$this->expanded = ($this->isArchive == false && $this->publicCReport == false) ? $this->expanded : 1;
@@ -191,52 +220,63 @@ class SurveyCustomReport {
echo '<ul id="custom_report_sortable">';
- if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<div class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'">';
+
+ if ($this->isArchive == false && $this->publicCReport == false) {
+ echo '<li class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'">';
echo '<div class="add_element">';
$this->addNewElement(-1);
echo '</div>';
- echo '</div>';
+ echo '</li>';
}
-
+
+
// Loop po vseh dodanih elementih porocila
while($row = mysqli_fetch_array($sql)){
- echo '<li id="sortable_report_element_'.$row['id'].'">';
+ // V arhivih nimamo pagebreakov
+ if( $row['type'] == '-1' && ($this->isArchive != false || $this->publicCReport != false) ){
+ continue;
+ }
+
+
+ echo '<li id="sortable_report_element_'.$row['id'].'" class="'.($row['type'] == '-1' ? 'report_element_break' : 'report_element_standard').'">';
+
// Pagebreak
- if($row['type'] == '-1'){
- if ($this->isArchive == false && $this->publicCReport == false){
- $this->displayBreak($row);
- }
+ if($row['type'] == '-1'){
+ echo '<div class="report_element">';
+ $this->displayBreak($row);
+ echo '</div>';
}
+ // Navaden element
else{
echo '<div class="report_element '.($this->expanded == 1 && $this->isArchive == false && $this->publicCReport == false ? ' active':'').'" id="report_element_'.$row['id'].'">';
$this->displayReportElement($row['id'], $this->expanded);
echo '</div>';
}
+ // Separator za elementom
if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<div class="report_element_separator '.($this->expanded == 1 ? 'expanded' : '').'" id="report_element_separator_'.$row['id'].'">';
- if($row['vrstni_red'] < $counter){
- echo '<div class="add_element">';
- $this->addNewElement($row['id']);
- echo '</div>';
- }
- echo '</div>';
+ echo '<div id="report_element_separator_'.$row['id'].'" class="report_element_separator '.($row['vrstni_red'] == $counter ? 'last_separator' : '').'" >';
+ echo '<div class="add_element">';
+ $this->addNewElement($row['id']);
+ echo '</div>';
+ echo '</div>';
}
-
- echo '</li>';
+
+ echo '</li>';
}
+
echo '</ul>';
}
- else
- echo '<br /><br />';
+ else{
+ echo '<div class="first_element_text">'.$lang['srv_custom_report_begin'].'</div>';
+ }
+
if ($this->isArchive == false && $this->publicCReport == false) {
// Dodajanje novega porocila
- echo '<br />';
- echo '<div class="add_element">';
+ echo '<div class="add_element bottom">';
$this->addNewElement();
echo '</div>';
}
@@ -319,7 +359,7 @@ class SurveyCustomReport {
echo '<div class="report_element_settings" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
// Tip izpisa (sums, freq, opisne...)
- echo '<select name="report_element_type_'.$reportElement['id'].'" id="report_element_type_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'type\', this.value)">';
+ echo '<select name="report_element_type_'.$reportElement['id'].'" id="report_element_type_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'type\', this.value)">';
// Ce ni izbrana
if ( $reportElement['type'] == null || $reportElement['type'] == 0 ) {
@@ -329,11 +369,14 @@ class SurveyCustomReport {
echo '<option value="2" '.($reportElement['type'] == 2 ? 'selected="selected"' : '').'>'.$lang['srv_frequency'].'</option>';
echo '<option value="3" '.($reportElement['type'] == 3 ? 'selected="selected"' : '').'>'.$lang['srv_descriptor_short'].'</option>';
echo '<option value="4" '.($reportElement['type'] == 4 ? 'selected="selected"' : '').'>'.$lang['srv_chart'].'</option>';
- echo '<option value="5" '.($reportElement['type'] == 5 ? 'selected="selected"' : '').'>'.$lang['srv_crosstabs'].'</option>';
- echo '<option value="10" '.($reportElement['type'] == 10 ? 'selected="selected"' : '').'>'.$lang['srv_multicrosstab'].'</option>';
- echo '<option value="6" '.($reportElement['type'] == 6 ? 'selected="selected"' : '').'>'.$lang['srv_means_label'].'</option>';
- echo '<option value="7" '.($reportElement['type'] == 7 ? 'selected="selected"' : '').'>'.$lang['srv_ttest'].'</option>';
- echo '<option value="9" '.($reportElement['type'] == 9 ? 'selected="selected"' : '').'>'.$lang['srv_break'].'</option>';
+
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") != 0){
+ echo '<option value="5" '.($reportElement['type'] == 5 ? 'selected="selected"' : '').'>'.$lang['srv_crosstabs'].'</option>';
+ //echo '<option value="10" '.($reportElement['type'] == 10 ? 'selected="selected"' : '').'>'.$lang['srv_multicrosstab'].'</option>';
+ echo '<option value="6" '.($reportElement['type'] == 6 ? 'selected="selected"' : '').'>'.$lang['srv_means_label'].'</option>';
+ echo '<option value="7" '.($reportElement['type'] == 7 ? 'selected="selected"' : '').'>'.$lang['srv_ttest'].'</option>';
+ echo '<option value="9" '.($reportElement['type'] == 9 ? 'selected="selected"' : '').'>'.$lang['srv_break'].'</option>';
+ }
echo '</select>';
@@ -342,7 +385,7 @@ class SurveyCustomReport {
if($reportElement['type'] > 0 && $reportElement['type'] < 5){
// Izbira spremneljivke
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
// Ce ni izbrana
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == '' ) {
@@ -351,7 +394,7 @@ class SurveyCustomReport {
# preberemo header
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
# preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
+ if ((isset($spremenljivka['tip'])&&$spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
/*&& in_array($spremenljivka['tip'],array(1,2,3,6,7,8,16,17,18,20) )*/) {
@@ -363,7 +406,7 @@ class SurveyCustomReport {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
+ $only_valid += (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0);
}
}
}
@@ -389,7 +432,7 @@ class SurveyCustomReport {
$crossData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -398,11 +441,11 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($crossData1[0] == $variable['sequence'] && $crossData1[0] != null) ? ' selected="selected" ' : '')
+ . ( (isset($variable['sequence']) && $crossData1[0] == $variable['sequence'] && $crossData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -412,7 +455,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -420,12 +463,12 @@ class SurveyCustomReport {
}
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
-
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-'.$variable['grd_id'];
+
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-'.(isset($variable['grd_id'])?$variable['grd_id']:'');
echo '<option value="'.$value.'" '
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($crossData2[0] == $variable['sequence'] && $crossData2[0] != null) ? ' selected="selected" ' : '')
+ . ( (isset($variable['sequence']) && $crossData2[0] == $variable['sequence'] && $crossData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -434,8 +477,11 @@ class SurveyCustomReport {
echo '</select>';
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
// Nastavitve za MULTICROSSTABE
@@ -448,7 +494,7 @@ class SurveyCustomReport {
}
else{
// Izbira ze ustvarjene tabele
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -473,7 +519,7 @@ class SurveyCustomReport {
$meanData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -482,11 +528,12 @@ class SurveyCustomReport {
foreach ($variables1 as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
+
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($meanData1[0] == $variable['sequence'] && $meanData1[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$meanData1[0] == $variable['sequence'] && $meanData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -496,7 +543,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -505,11 +552,12 @@ class SurveyCustomReport {
foreach ($variables2 as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
+
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($meanData2[0] == $variable['sequence'] && $meanData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$meanData2[0] == $variable['sequence'] && $meanData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -519,8 +567,11 @@ class SurveyCustomReport {
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
// Nastavitve za TTEST
@@ -535,7 +586,7 @@ class SurveyCustomReport {
$ttestData2 = explode("-", $reportElement['spr2']);
// Izbira spremneljivke 1
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0 ) {
@@ -544,11 +595,11 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($ttestData1[0] == $variable['sequence'] && $ttestData1[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$ttestData1[0] == $variable['sequence'] && $ttestData1[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -558,7 +609,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -567,11 +618,11 @@ class SurveyCustomReport {
foreach ($numerus as $variable) {
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($ttestData2[0] == $variable['sequence'] && $ttestData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$ttestData2[0] == $variable['sequence'] && $ttestData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -581,8 +632,11 @@ class SurveyCustomReport {
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Tabela ';
- echo '<input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />Graf';
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
// Izbira dveh podvariabel za prvo variablo
@@ -601,7 +655,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 1
$variables = $this->classInstance->getVariableList(2);
- echo ' <select style="margin-left:20px;" name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
+ echo ' <select name="report_element_spr_id_'.$reportElement['id'].'" id="report_element_spr_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr1\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr1'] == null || $reportElement['spr1'] == 0){
@@ -610,11 +664,11 @@ class SurveyCustomReport {
if (count($variables)) {
foreach ($variables as $variable) {
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-undefined';
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-undefined';
echo '<option value="'.$value.'"'
- . ((int)$variable['canChoose'] == 1 ? '' : ' disabled="disabled" ')
- . ($breakData1[0] == $variable['sequence'] && $breakData1[0] != null ? ' selected="selected"':''). '> ';
+ . (isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1 ? '' : ' disabled="disabled" ')
+ . (isset($variable['sequence']) && $breakData1[0] == $variable['sequence'] && $breakData1[0] != null ? ' selected="selected"':''). '> ';
$text = ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' )) . $variable['variableNaslov'];
$text = (strlen($text) > 60) ? substr($text, 0, 57).'...' : $text;
@@ -630,7 +684,7 @@ class SurveyCustomReport {
// Izbira spremneljivke 2
$variables = $this->getBreakDependentVariableList();
- echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
+ echo ' <select name="report_element_spr2_id_'.$reportElement['id'].'" id="report_element_spr2_id_'.$reportElement['id'].'" class="dropdown medium" onChange="editCustomReportElement(\''.$reportElement['id'].'\', \'spr2\', this.value)">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $reportElement['spr2'] == null || $reportElement['spr2'] == 0 ) {
@@ -639,14 +693,14 @@ class SurveyCustomReport {
foreach ($variables as $variable) {
// Ce ni ista kot prva izbrana
- if($variable['spr_id'] != $breakData1[1]){
+ if(isset($variable['spr_id'])&&$variable['spr_id'] != $breakData1[1]){
$text = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
- $value = $variable['sequence'].'-'.$variable['spr_id'].'-'.$variable['grd_id'];
+ $value = (isset($variable['sequence'])?$variable['sequence']:'').'-'.(isset($variable['spr_id'])?$variable['spr_id']:'').'-'.(isset($variable['grd_id'])?$variable['grd_id']:'');
echo '<option value="'.$value.'" '
- . (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($breakData2[0] == $variable['sequence'] && $breakData2[0] != null) ? ' selected="selected" ' : '')
+ . (( isset($variable['canChoose'])&&(int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
+ . ( (isset($variable['sequence'])&&$breakData2[0] == $variable['sequence'] && $breakData2[0] != null) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $text . '</option>';
@@ -656,8 +710,11 @@ class SurveyCustomReport {
echo '</select>';
// Izbira podtipa (tabela / graf)
- echo ' <input style="margin-left:20px;" type="radio" value="0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />'.$lang['srv_table'];
- echo ' <input type="radio" value="1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />'.$lang['srv_chart'];
+ echo ' <input style="margin-left:16px;" type="radio" value="0" id="report_element_sub_type_'.$reportElement['id'].'_0" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 0 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_0">'.$lang['srv_table'].'</label>';
+
+ echo ' <input type="radio" value="1" id="report_element_sub_type_'.$reportElement['id'].'_1" name="report_element_sub_type_'.$reportElement['id'].'" '.($reportElement['sub_type'] == 1 ? 'checked="checked"' : '').' onClick="editCustomReportElement(\''.$reportElement['id'].'\', \'sub_type\', this.value)" />';
+ echo ' <label for="report_element_sub_type_'.$reportElement['id'].'_1">'.$lang['srv_chart'].'</label>';
}
echo '</div>';
@@ -669,14 +726,13 @@ class SurveyCustomReport {
global $site_path;
global $lang;
- echo '<div class="creport_bottom_settings">';
-
- echo '<a href="#" onclick="doArchiveCReport();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveCReportBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<div class="analysis_bottom_settings printHide">';
- echo '<a href="#" onClick="printAnaliza(\'CReport\'); return false;" title="'.$lang['hour_print2'].'"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_pdf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_rtf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf black very_large"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_rtf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=creport_pdf&anketa=' . $this->ank_id) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span></a>';
+
+ echo '<a href="#" onclick="doArchiveCReport();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveCReportBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail"></span></a>';
echo '</div>';
}
@@ -685,12 +741,12 @@ class SurveyCustomReport {
function displayTTestSubVar($reportElement){
global $lang;
- echo '<div id="ttestVariablesSpan" style="margin: 10px 0 10px 80px;">';
+ echo '<div id="ttestVariablesSpan" style="margin: 0 0 0 32px;">';
$ttestData1 = explode("-", $reportElement['spr1']);
$spr = $ttestData1[1];
- $check1 = $ttestData1[3];
- $check2 = $ttestData1[4];
+ $check1 = isset($ttestData1[3])?$ttestData1[3]:null;
+ $check2 = isset($ttestData1[4])?$ttestData1[4]:null;
# poiscemo pripadajoce variable
@@ -707,7 +763,8 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$sekvenca.'_'.$value || $check2 == $spr.'_'.$sekvenca.'_'.$value) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$value.') - '.$option.'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$value.'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$value.'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$value.') - '.$option.'</label><br/>';
}
break;
@@ -718,7 +775,8 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$variable['sequence'].'_'.$option || $check2 == $spr.'_'.$variable['sequence'].'_'.$option) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
}
break;
@@ -730,20 +788,22 @@ class SurveyCustomReport {
$checked = ($check1 == $spr.'_'.$sekvenca.'_'.$value || $check2 == $spr.'_'.$sekvenca.'_'.$value) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$value.') - '.$option.'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$value.'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$value.'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$value.') - '.$option.'</label><br/>';
}
break;
case 16: #mcheck
#nardimo inpute za vse opcije
- # poi��emo pripadajo�o sekvenco
+ # poiščemo pripadajočo sekvenco
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][$grid]['variables'] as $vid => $variable) {
$checked = ($check1 == $spr.'_'.$variable['sequence'].'_'.$option || $check2 == $spr.'_'.$variable['sequence'].'_'.$option) ? true : false;
$disabled = ($check1 != null && $check2 != null && !$checked) ? ' disabled="disabled"' : '';
- echo '<label '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<input id="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" name="subTtest" class="subTtest_'.$reportElement['id'].'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" '.($checked ? ' checked="checked"' : '').' onchange="editCustomReportTTestVar(\''.$reportElement['id'].'\');" '.$disabled.' />';
+ echo '<label for="subTtest_'.$reportElement['id'].'_'.$variable['variable'].'" '.($disabled == ' disabled="disabled"' ? 'class="gray"' : '').'>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
}
break;
@@ -783,20 +843,10 @@ class SurveyCustomReport {
// Ikone za razsiritev, kopiranje, brisanje posameznega elementa
echo '<div class="report_element_icons '.($expanded == 1 ? ' active' : '').'">';
- // Print element
- echo ' <span class="faicon print_small icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['PRN_Izpis'].'" onClick="printCustomReportElement(\''.strip_tags($title).'\', \'report_element_'.$reportElement['id'].'\'); return false;"></span>';
// Kopiraj element
echo ' <span class="faicon copy icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['srv_custom_report_copy'].'" onClick="copyCustomReportElement(\''.$reportElement['id'].'\');"></span>';
// Brisi element
echo ' <span class="faicon delete icon-grey_dark_link" style="margin-left: 10px;" title="'.$lang['srv_custom_report_delete'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');"></span>';
-
- // Uredi element
- /*if($reportElement['type'] != 8)
- if($expanded == 1)
- echo ' <span class="sprites pointer arrow_contract" style="margin-left: 10px;" title="'.$lang['srv_custom_report_contract'].'" onClick="expandCustomReportElement(\''.$reportElement['id'].'\');"></span>';
- else
- echo ' <span class="sprites pointer arrow_expand" style="margin-left: 10px;" title="'.$lang['srv_custom_report_expand'].'" onClick="expandCustomReportElement(\''.$reportElement['id'].'\');"></span>';
- */
echo '</div>';
@@ -835,17 +885,13 @@ class SurveyCustomReport {
function displayReportElementText($reportElement, $expanded){
global $lang;
- echo '<div class="report_element_text report_element_comment" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
+ echo '<div class="report_element_text report_element_comment" '.($expanded == 0 ? 'style="display:none;"' : '').'>';
if($expanded == 1 && $this->isArchive == false && $this->publicCReport == false){
- echo '<span class="bold">'.$lang['srv_inv_archive_comment'].':</span>';
-
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; float:right; margin:20px 18px 0 0;" onclick="creport_load_editor(this); return false;"></span>';
-
- /*echo '<textarea style="width:100%; height:80px;" class="creport_textarea" el_id="'.$reportElement['id'].'" id="report_element_text_'.$reportElement['id'].'" onBlur="editCustomReportElement(\''.$reportElement['id'].'\', \'text\', this.value)">';
- echo $reportElement['text'];
- echo '</textarea>';*/
+ echo '<span class="title">'.$lang['srv_inv_archive_comment'].':</span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_editor_title'].'" onclick="creport_load_editor(this); return false;"></span>';
+
echo '<div class="creport_text_inline" contenteditable="true" el_id="'.$reportElement['id'].'">';
echo $reportElement['text'];
echo '</div>';
@@ -862,14 +908,11 @@ class SurveyCustomReport {
// Izrisemo sumarnik element
function displaySum($reportElement, $expanded){
global $lang;
-
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_sumarnik'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -883,7 +926,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0)
+ if(isset($reportElement['spr1'])&&$expanded != 0)
SurveyAnalysis::displaySums($reportElement['spr1']);
echo '</div>';
@@ -892,14 +935,11 @@ class SurveyCustomReport {
// Izrisemo sumarnik element
function displayFreq($reportElement, $expanded){
global $lang;
-
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_frequency'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -914,7 +954,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0)
+ if(isset($reportElement['spr1'])&&$expanded != 0)
SurveyAnalysis::displayFrequency($reportElement['spr1']);
echo '</div>';
@@ -924,13 +964,10 @@ class SurveyCustomReport {
function displayDesc($reportElement, $expanded){
global $lang;
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+ if(isset($reportElement['spr1']) || $reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_descriptor'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -945,7 +982,7 @@ class SurveyCustomReport {
// Izpis tabele ali grafa za posamezen vnos
echo '<div class="report_element_data" '.($expanded == 0 ? ' style="display:none;"' : '').'>';
- if($expanded != 0){
+ if(isset($reportElement['spr1'])&&$expanded != 0){
SurveyAnalysis::displayDescriptives($reportElement['spr1']);
@@ -960,13 +997,10 @@ class SurveyCustomReport {
function displayChart($reportElement, $expanded){
global $lang;
- // Naslov
- $spr = SurveyAnalysis::$_HEADERS[$reportElement['spr1']];
-
- if($reportElement['spr1'] == '')
+ if(!isset($reportElement['spr1'])||$reportElement['spr1'] == '')
$title = $lang['srv_select_spr'];
else
- $title = $spr['variable'].' - '.$spr['naslov'];
+ $title = SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['variable'].' - '.SurveyAnalysis::$_HEADERS[$reportElement['spr1']]['naslov'];
$subtitle = '('.$lang['srv_chart'].')';
$title .= ' <span class="anl_ita">'.$subtitle.'</span>';
@@ -1010,7 +1044,8 @@ class SurveyCustomReport {
$crossData1 = explode("-", $reportElement['spr1']);
$crossData2 = explode("-", $reportElement['spr2']);
- $this->classInstance->setVariables($crossData1[0],$crossData1[1],$crossData1[2],$crossData2[0],$crossData2[1],$crossData2[2]);
+ $this->classInstance->setVariables($crossData1[0],(isset($crossData1[1])?$crossData1[1]:null),(isset($crossData1[2])?$crossData1[2]:null),
+ $crossData2[0],(isset($crossData2[1])?$crossData2[1]:null),(isset($crossData2[2])?$crossData2[2]:null));
// Naslov
if($reportElement['spr1'] == '' || $reportElement['spr2'] == '')
@@ -1024,7 +1059,7 @@ class SurveyCustomReport {
# za multicheckboxe popravimo naslov, na podtip
$sub_q1 = null;
$sub_q2 = null;
- if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
+ /* if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
foreach ($spr1['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_first['seq']) {
@@ -1040,12 +1075,12 @@ class SurveyCustomReport {
}
}
}
- }
+ } */
if ($sub_q1 == null) {
$sub_q1 .= strip_tags($spr1['naslov']);
$sub_q1 .= ($show_variables_values == true ? '&nbsp;('.strip_tags($spr1['variable']).')' : '');
}
- if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
+ /* if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
foreach ($spr2['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_second['seq']) {
@@ -1061,7 +1096,7 @@ class SurveyCustomReport {
}
}
}
- }
+ } */
if ($sub_q2 == null) {
$sub_q2 .= strip_tags($spr2['naslov']);
$sub_q2 .= ($show_variables_values == true ? ' ('.strip_tags($spr2['variable']).')' : '');
@@ -1165,9 +1200,9 @@ class SurveyCustomReport {
// Napolnimo podatke meansom
$meanData1 = explode("-", $reportElement['spr2']);
- $v_first = array('seq' => $meanData1[0], 'spr' => $meanData1[1], 'grd' => $meanData1[2]);
+ $v_first = array('seq' => $meanData1[0], 'spr' => (isset($meanData1[1])?$meanData1[1]:null), 'grd' => (isset($meanData1[2])?$meanData1[2]:null));
$meanData2 = explode("-", $reportElement['spr1']);
- $v_second = array('seq' => $meanData2[0], 'spr' => $meanData2[1], 'grd' => $meanData2[2]);
+ $v_second = array('seq' => $meanData2[0], 'spr' => (isset($meanData2[1])?$meanData2[1]:null), 'grd' => (isset($meanData1[2])?$meanData2[2]:null));
$means[0] = $this->classInstance->createMeans($v_first, $v_second);
@@ -1355,7 +1390,7 @@ class SurveyCustomReport {
$variables = $this->getBreakDependentVariableList();
foreach ($variables as $variable) {
- if($breakData2[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData2[0] == $variable['sequence']){
//$label2 = $variable['variableNaslov'];
$label2 = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
@@ -1464,13 +1499,13 @@ class SurveyCustomReport {
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->classInstance->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
$_dropdown_condition = (is_numeric($tip) && $tip != 5 && $tip != 8 && $tip != 9) ? true : false;
if ($_dropdown_condition) {
$cnt_all = (int)$spremenljivka['cnt_all'];
- if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22,25)) || ($tip == 6 && $spremenljivka['enota'] == 2) ) {
+ if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22,25)) || ($tip == 6 && isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 2) ) {
# pri tipu radio ali select dodamo tisto variablo ki ni polje "drugo"
if ($tip == 1 || $tip == 3 ) {
@@ -1537,7 +1572,7 @@ class SurveyCustomReport {
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$variablesList[] = array(
'tip'=>$tip,
@@ -1588,9 +1623,9 @@ class SurveyCustomReport {
function displayBreak($reportElement){
global $lang;
- echo '<span class="report_element_pb" title="'.$lang['srv_rem_pagebreak'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');">';
-
- echo '</span>';
+ echo '<div class="pb_text" title="'.$lang['srv_rem_pagebreak'].'" onClick="deleteCustomReportElement(\''.$reportElement['id'].'\');">'.$lang['srv_rem_pagebreak'].'</div>';
+
+ echo '<div class="pb_line"></div>';
}
// Izrisemo element z besedilom
@@ -1600,25 +1635,15 @@ class SurveyCustomReport {
// Glava elementa (naslov, ikone...)
$this->displayReportElementHead($reportElement, $expanded);
- echo '<div class="report_element_text" style="padding-top:15px; '.($expanded == 0 ? ' display:none;' : '').'">';
-
- /*if($expanded == 1){
-
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; display:block; float:right;" onclick="creport_load_editor(this); return false;"></span>';
-
- echo '<textarea style="width:100%; height:80px;" class="creport_textarea" el_id="'.$reportElement['id'].'" id="report_element_text_'.$reportElement['id'].'" onBlur="editCustomReportElement(\''.$reportElement['id'].'\', \'text\', this.value)">';
- echo $reportElement['text'];
- echo '</textarea>';
- }*/
- //else{
+ echo '<div class="report_element_text" '.($expanded == 0 ? 'style="display:none;"' : '').'">';
+
if ($this->isArchive == false && $this->publicCReport == false) {
- echo '<span class="faicon edit2" title="'.$lang['srv_editor_title'].'" style="cursor:pointer; display:block; float:right; margin:20px 18px 0 0;" onclick="creport_load_editor(this); return false;"></span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_editor_title'].'" onclick="creport_load_editor(this); return false;"></span>';
}
- echo '<br /><div class="creport_text_inline" '.($this->isArchive == false && $this->publicCReport == false ? ' contenteditable="true"':'').' el_id="'.$reportElement['id'].'">';
+ echo '<div class="creport_text_inline" '.($this->isArchive == false && $this->publicCReport == false ? ' contenteditable="true"':'').' el_id="'.$reportElement['id'].'">';
echo $reportElement['text'];
echo '</div>';
- //}
echo '</div>';
}
@@ -1630,19 +1655,18 @@ class SurveyCustomReport {
// Dodajanje vmes in na zacetku
if($id != 0){
- echo '<span class="pointer" title="'.$lang['srv_custom_report_add'].'" style="margin-left: 20px; " onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_light"></span> '.$lang['srv_custom_report_add'].'</span>';
+ echo '<span title="'.$lang['srv_custom_report_add'].'" onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add"></span>'.$lang['srv_custom_report_add'].'</span>';
- echo '<span class="pointer" title="'.$lang['srv_custom_report_add_text'].'" style="margin-left: 20px;" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_dark"></span> '.$lang['srv_custom_report_add_text'].'</span>';
+ echo '<span title="'.$lang['srv_custom_report_add_text'].'" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add"></span>'.$lang['srv_custom_report_add_text'].'</span>';
if($id > 0)
- echo '<span class="pointer" title="'.$lang['srv_add_pagebreak'].'" style="margin-left: 20px;" onClick="addPBCustomReportElement(\''.$id.'\');"><span class="faicon paragraph icon-blue"></span> '.$lang['srv_add_pagebreak'].'</span>';
+ echo '<span title="'.$lang['srv_add_pagebreak'].'" onClick="addPBCustomReportElement(\''.$id.'\');"><span class="faicon paragraph"></span>'.$lang['srv_add_pagebreak'].'</span>';
}
// Dodajanje na dnu (brez page breaka)
if($id == 0){
- echo '<span class="pointer" style="margin:-10px 0 10px 20px;" onClick="addEmptyCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_light" title="'.$lang['srv_custom_report_add'].'"></span> '.$lang['srv_custom_report_add'].'</span>';
-
- echo '<span class="pointer" style="margin:-10px 0 10px 20px;" onClick="addTextCustomReportElement(\''.$id.'\');"><span class="faicon add small icon-blue_dark" title="'.$lang['srv_custom_report_add_text'].'"></span> '.$lang['srv_custom_report_add_text'].'</span>';
+ echo '<button class="medium white-blue" onClick="addTextCustomReportElement(\''.$id.'\');" title="'.$lang['srv_custom_report_add_text'].'">'.$lang['srv_custom_report_add_text'].'</button>';
+ echo '<button class="medium blue" onClick="addEmptyCustomReportElement(\''.$id.'\');" title="'.$lang['srv_custom_report_add'].'">'.$lang['srv_custom_report_add'].'</button>';
}
}
@@ -1709,10 +1733,11 @@ class SurveyCustomReport {
}
$profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
+ //$name = $profile['name'];
- echo '<h2>'.$lang['srv_custom_report_profile_title'].'</h2>';
+ echo '<h2>'.$lang['srv_custom_report_profile_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="close_creport_profile(); return false;">✕</a></div>';
echo '<div id="creport_settings_profiles_left">';
@@ -1774,19 +1799,18 @@ class SurveyCustomReport {
// Ce je izbran custom profil imamo na dnu gumba brisi in preimenuj, pri default pa samo preimenuj
// Preimenuje, brise in share lahko samo za lastna porocila
if($this->creportAuthor == $global_user_id){
- echo '<div style="float:left; margin-bottom:10px;">';
- echo '<a href="#" onclick="creport_profile_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</a>'."\n";
+
+ echo '<p class="blue pointer top16 bottom8" onClick="creport_profile_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</p>';
if($this->creportProfile > 0)
- echo '<br /><a href="#" onclick="creport_profile_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</a>'."\n";
+ echo '<p class="blue pointer bottom8" onclick="creport_profile_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</p>';
+
+ echo '<p class="blue pointer bottom16" onclick="creport_profile_action(\'show_share\'); return false;">'.$lang['srv_custom_report_share'].'</p>';
- // Deli poročilo z drugimi uredniki
- echo '<br /><a href="#" onclick="creport_profile_action(\'show_share\'); return false;">'.$lang['srv_custom_report_share'].'</a>'."\n";
- echo '</div>';
}
- // Preberemo najkasneje editiran element (cas spreminjanja)
+ /*/ Preberemo najkasneje editiran element (cas spreminjanja)
$sqlt = sisplet_query("SELECT MAX(time_edit) FROM srv_custom_report WHERE ank_id='$this->ank_id' AND usr_id='$this->creportAuthor' AND profile='$this->creportProfile'");
if(mysqli_num_rows($sqlt) > 0){
$rowt = mysqli_fetch_array($sqlt);
@@ -1796,16 +1820,16 @@ class SurveyCustomReport {
$time_edit = $time_created;
// Cas kreirranja in urejanja profila
- echo '<div style="float:right; text-align:right;">';
+ echo '<div class="top16 bottom16">';
if($time_created != '' && $time_created != '0000-00-00 00:00:00'){
$time_created = strtotime($time_created);
- echo $lang['srv_custom_report_time_created'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span><br />';
+ echo '<p>'.$lang['srv_custom_report_time_created'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span></p>';
}
if($time_edit != '' && $time_edit != '0000-00-00 00:00:00'){
$time_edit = strtotime($time_edit);
- echo $lang['srv_custom_report_time_edited'].': <span class="bold">'.date("d.m.Y H:i", $time_edit).'</span>';
- }
+ echo '<p>'.$lang['srv_custom_report_time_edited'].': <span class="bold">'.date("d.m.Y H:i", $time_edit).'</span></p>';
+ }*/
echo '</div>';
@@ -1825,10 +1849,10 @@ class SurveyCustomReport {
$comment = $row['value'];
}
- echo '<span class="bold clr">'.$lang['srv_inv_archive_comment'].':</span>';
+ echo '<p>'.$lang['srv_inv_archive_comment'].':</p>';
// Komentar lahko popravlja samo avtor porocila
if($this->creportAuthor == $global_user_id)
- echo '<textarea onBlur="creport_profile_comment(this.value)">'.$comment.'</textarea>';
+ echo '<textarea class="textarea" onBlur="creport_profile_comment(this.value)">'.$comment.'</textarea>';
else
echo '<span>'.$comment.'</span>';
@@ -1837,48 +1861,70 @@ class SurveyCustomReport {
// cover Div
echo '<div id="dsp_cover_div"></div>'."\n";
-
- echo '<span class="clr"></span>';
- echo '<div style="position:absolute; bottom:20px; right:20px;">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="use_creport_profile(); return false;"><span>'.$lang['srv_save_and_run_profile'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_custom_report_create'].'"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="creport_profile_action(\'show_new\'); return false;"><span>'.$lang['srv_custom_report_create'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="close_creport_profile(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="close_creport_profile(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onclick="creport_profile_action(\'show_new\'); return false;">'.$lang['srv_custom_report_create'].'</button>';
+ echo '<button class="medium blue" onClick="use_creport_profile(); return false;">'.$lang['srv_save_and_run_profile'].'</button>';
+ echo '</div>';
- echo '</div>';
}
function displayProfilePopups(){
global $lang;
- global $global_user_id;
+ //global $global_user_id;
$profile = $this->getProfile($this->creportProfile);
- $name = $profile['name'];
+ //$name = $profile['name'];
// div za kreacijo novega
echo '<div id="newCReportProfile">';
- echo '<div style="float:left; width:410px; text-align:right;">'.$lang['srv_custom_report_name'].': '."\n";
- echo '<input id="newCReportProfileName" name="newCReportProfileName" type="text" value="" size="50" /></div>'."\n";
- echo '<div style="float:left; width:410px; text-align:right; padding:5px 0px;">'.$lang['srv_inv_archive_comment'].': '."\n";
- echo '<input id="newCReportProfileComment" name="newCReportProfileComment" type="text" value="" size="50" /></div>'."\n";
- echo '<br /><br /><br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'new\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_new\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
-
+
+ echo '<h2>'.$lang['srv_custom_report_create2'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="creport_profile_action(\'cancel_new\'); return false;">✕</a></div>';
+
+ echo '<p>'.$lang['srv_custom_report_name'].':</p>';
+ echo '<input id="newCReportProfileName" name="newCReportProfileName" type="text" value="" class="text large" />';
+
+ echo '<p class="top16">'.$lang['srv_inv_archive_comment'].':</p>';
+
+ echo '<input id="newCReportProfileComment" name="newCReportProfileComment" type="text" value="" class="text large" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_new\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'new\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+
+
// div za preimenovanje
- echo '<div id="renameCReportProfile">'.$lang['srv_custom_report_name'].': '."\n";
- echo '<input id="renameCReportProfileName" name="renameCReportProfileName" type="text" size="45" />'."\n";
- echo '<input id="renameCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />'."\n";
- echo '<br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameCReportProfile">';
+
+ echo '<p>'.$lang['srv_custom_report_name'].':</p>';
+ echo '<input id="renameCReportProfileName" name="renameCReportProfileName" type="text" class="text large" />';
+
+ echo '<input id="renameCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteCReportProfile">'.$lang['srv_custom_report_delete_confirm'].': <span id="deleteCReportProfileName" style="font-weight:bold;"></span>?'."\n";
+ echo '<div id="deleteCReportProfile">';
+
+ echo '<p>'.$lang['srv_custom_report_delete_confirm'].': <span id="deleteCReportProfileName" class="semi-bold"></span>?</p>';
echo '<input id="deleteCReportProfileId" type="hidden" value="' . $this->creportProfile . '" />'."\n";
- echo '<br /><br /><span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za deljenje z drugimi uredniki
echo '<div id="shareCReportProfile">';
@@ -1979,7 +2025,7 @@ class SurveyCustomReport {
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link creport" style="margin:5px; padding:5px;" >';
$what = 'creport_title_profile_'.$this->creportProfile;
$sql = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$anketa' AND uid='$this->creportAuthor' AND what='$what'");
@@ -1990,10 +2036,11 @@ class SurveyCustomReport {
$row = mysqli_fetch_array($sql);
$titleString = $row['value'];
}
- //echo '<h2>'.$lang['srv_publc_creport_title_for'] .$titleString.'</h2>';
+
echo '<h2>'.$titleString.'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
+ echo '<input type="hidden" name="anketa_hash" id="srv_meta_anketa_hash" value="' . SurveyInfo::getInstance()->getSurveyHash() . '" />';
echo '<div id="analiza_data">';
# ponastavimo nastavitve- filter
@@ -2198,7 +2245,7 @@ class SurveyCustomReport {
$vrstni_red = $row['vrstni_red'] + 1;
$sqlInsert = sisplet_query("INSERT INTO srv_custom_report (ank_id, usr_id, vrstni_red, type, sub_type, spr1, spr2, text, profile, time_edit) VALUES('$this->ank_id', '$this->creportAuthor', '$vrstni_red', '$row[type]', '$row[sub_type]', '$row[spr1]', '$row[spr2]', '$row[text]', '$row[profile]', NOW())");
- if (!$s) echo mysqli_error($GLOBALS['connect_db']);
+ if (!$sqlInsert) echo mysqli_error($GLOBALS['connect_db']);
$this->displayReport();
@@ -2225,16 +2272,17 @@ class SurveyCustomReport {
// Alert pri dodajanju prvega
if($_GET['a'] == 'first_alert'){
+ echo '<h2>'.$lang['srv_custom_report_insert'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">✕</a></div>';
+
echo $lang['srv_custom_report_first'];
- /*Ozna�eni element (tabela/graf) se je prenesel v poro�ilo po meri, kjer lahko prilagajate prikaz in zaporedje elementov*/
-
- echo '<a href="#" onClick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';"><span style="display: block; padding-top: 10px;">'.$lang['srv_custom_report_link'].'</span></a>';
- echo '<div class="buttons">';
-
- //echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_blue" href="#" onClick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';"><span>'.$lang['srv_custom_report'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
-
+
+ echo '<div class="button_holder">';
+
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="window.location = \''.$site_url.'admin/survey/index.php?anketa='.$this->ank_id.'&a=analysis&m=analysis_creport\';">'.$lang['srv_custom_report_link'].'</button>';
+
echo '</div>';
}
@@ -2334,7 +2382,7 @@ class SurveyCustomReport {
// prikaz previewja
if($_GET['a'] == 'report_preview'){
- echo '<h1 style="text-align: center; margin-top: 20px;">'.$lang['export_analisys_creport'].': '.SurveyInfo::getInstance()->getSurveyTitle().'</h1>';
+ echo '<h1 style="text-align: center; margin: 32px 0;">'.$lang['export_analisys_creport'].': '.SurveyInfo::getInstance()->getSurveyTitle().'</h1>';
$this->setUpReturnAsHtml(false);
$this->setUpIsForArchive(true);
@@ -2343,10 +2391,8 @@ class SurveyCustomReport {
$this->displayReport();
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="window.close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- //echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" />'.$lang['hour_print2'].'</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div id="navigationBottom" class="button_holder below float-right printHide">';
+ echo ' <button class="medium blue" onclick="window.close(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
}
@@ -2354,14 +2400,15 @@ class SurveyCustomReport {
if($_GET['a'] == 'all_elements_alert'){
$type = (isset($_POST['type'])) ? $_POST['type'] : 0;
+
+ echo '<h2>'.$lang['srv_custom_report_comments_add'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">✕</a></div>';
- echo '<div style="margin-bottom: 10px;">'.$lang['srv_custom_report_comments_alert'.$type].'</div>';
-
- echo '<div class="buttons">';
-
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();"><span>'.$lang['srv_custom_report_alert_no'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onClick="addCustomReportAllElements(\''.$type.'\');"><span>'.$lang['srv_custom_report_alert_yes'].'</span></a></div></span>';
-
+ echo '<p class="bottom16">'.$lang['srv_custom_report_comments_alert'.$type].'</p>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\'); $(\'#custom_report_alert\').fadeOut();">'.$lang['srv_custom_report_alert_no'].'</button>';
+ echo '<button class="medium blue" onclick="addCustomReportAllElements(\''.$type.'\');">'.$lang['srv_custom_report_alert_yes'].'</button>';
echo '</div>';
}
@@ -2537,8 +2584,6 @@ class SurveyCustomReport {
SurveyUserSetting :: getInstance()->saveSettings('default_creport_profile', $id);
SurveyUserSetting :: getInstance()->saveSettings('default_creport_author', $author);
-
- //$this->displayReport();
}
// urejanje komentarja profila
@@ -2558,9 +2603,12 @@ class SurveyCustomReport {
// prikazemo deljenje profila z drugimi uredniki
if($_GET['a'] == 'shareProfileShow') {
-
- echo '<span class="bold clr" style="display:block; margin-bottom:25px;">'.$lang['srv_custom_report_share_long'].':</span>'."\n";
-
+
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_custom_report_share_long'].':</span>';
+
+
if (isset ($_POST['id'])){
$id = $_POST['id'];
@@ -2572,16 +2620,25 @@ class SurveyCustomReport {
if($user['id'] != $global_user_id){
$sql = sisplet_query("SELECT * FROM srv_custom_report_share WHERE ank_id='".$this->ank_id."' AND profile_id='".$id."' AND author_usr_id='".$global_user_id."' AND share_usr_id='".$user['id']."' LIMIT 1");
$checked = (mysqli_num_rows($sql) > 0) ? ' checked="checked"' : '';
-
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" '.$checked.' name="share_usr_id[]" id="share_usr_id'.$user['id'].'" value="'.$user['id'].'"> ';
- echo '<label for="share_usr_id'.$user['id'].'">'.$user['email'].'</label><br />';
+ echo '<label for="share_usr_id'.$user['id'].'">'.$user['email'].'</label>';
+ echo '</div>';
+
}
}
}
-
- echo '<input id="shareCReportProfileId" type="hidden" value="' . $id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_profile_action(\'share\'); return false;"><span>'.$lang['srv_custom_report_share'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="creport_profile_action(\'cancel_share\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
+
+ echo '</div>';
+
+ echo '<input id="shareCReportProfileId" type="hidden" value="' . $id . '" />';
+
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="creport_profile_action(\'cancel_share\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="creport_profile_action(\'share\'); return false;">'.$lang['srv_custom_report_share'].'</button>';
+ echo '</div>';
}
// delimo profil z drugimi uredniki
diff --git a/admin/survey/classes/class.SurveyDataSettingProfiles.php b/admin/survey/classes/class.SurveyDataSettingProfiles.php
index 5b48f41..6185116 100644
--- a/admin/survey/classes/class.SurveyDataSettingProfiles.php
+++ b/admin/survey/classes/class.SurveyDataSettingProfiles.php
@@ -35,13 +35,11 @@ class SurveyDataSettingProfiles {
*
* @param $_surveyId
*/
- static function Init($_surveyId)
- {
-
+ static function Init($_surveyId){
global $global_user_id, $lang;
- if ($_surveyId && $global_user_id)
- {
+ if ($_surveyId && $global_user_id){
+
self::$surveyId = $_surveyId;
self::$uId = $global_user_id;
@@ -52,7 +50,8 @@ class SurveyDataSettingProfiles {
$dsp = SurveyUserSetting :: getInstance()->getSettings('default_dataSettingProfile_profile');
if ($dsp == -1 || $dsp > 0 ) {
self::$currentProfileId = $dsp;
- } else {
+ }
+ else {
self::$currentProfileId = 0;
self::SetDefaultProfile(0);
}
@@ -64,120 +63,121 @@ class SurveyDataSettingProfiles {
# ime damo iz lang fajla
self::$profiles['-1']['id'] = '-1';
self::$profiles['-1']['name'] =$lang['srv_temp_profile'];
- } else if($dsp == -1 ) {
+ }
+ else if($dsp == -1 ) {
// #seja ne obstaja zato privzet profil popravimo na 0
$dsp = 0;
self::$currentProfileId = 0;
self::SetDefaultProfile(0);
}
+
#dodamo privzet sistemski profil
- self::$profiles['0'] = array('id'=>0,
- 'name'=>$lang['srv_default_profile1'],
- 'dsp_ndp' => NUM_DIGIT_PERCENT, # stevilo digitalnih mest za odstotek
- 'dsp_nda' => NUM_DIGIT_AVERAGE, # stevilo digitalnih mest za povprecje
- 'dsp_ndd' => NUM_DIGIT_DEVIATION, # stevilo digitalnih mest za odklon
- 'dsp_res' => NUM_DIGIT_RESIDUAL, # stevilo digitalnih mest za residual
- 'dsp_sep' => self::$defaultSeperator, # privzet seperator
- 'crossChk0' => '1', # izpis frekvenc
- 'crossChk1' => '0', # izpis procentov po vrsticah
- 'crossChk2' => '0', # izpis procentov po stolpcih
- 'crossChk3' => '0', # izpis skupnih procentov
- 'crossChkEC' => '0', # izpis skupnih procentov
- 'crossChkRE' => '0', # izpis skupnih procentov
- 'crossChkSR' => '0', # izpis skupnih procentov
- 'crossChkAR' => '0', # izpis skupnih procentov
- 'doColor' => '1', # barvanje celic
- 'doValues' => '1', # prikaz vrednosti
- 'showCategories' => '1', # prikaz kategorij
- 'showOther' => '1', # prikaz polj drugo
- 'showNumbers' => '1', # prikaz števil
- 'showText' => '1', # prikaz tekstovnih odgovorov
- 'chartNumbering' => '0', # ostevilcevanje grafov
- 'chartFontSize' => '8', # velikost fonta grafov
- 'chartFP' => '0', # izpis prve strani pri izvozu grafov (PDF/RTF)
- 'chartTableAlign' => '0', # default poravnava tabel pri grafih (0->sredinska, 1->leva)
- 'chartTableMore' => '0', # prikaz vseh textovnih odg. v tabelah (0->ne prikazi vseh, 1->vsi)
- 'chartNumerusText' => '0', # pozicija numerusa
- 'chartAvgText' => '1', # prikaz povprecja
- 'chartPieZeros' => '0', # prikaz nicelnih vrednosti v kroznih grafih
- 'hideEmpty' => '1', # skrivanje spremenljivke, ki nima veljavnih vnosov
- 'hideAllSystem' => '0', # skrivanje vseh sistemskih spremenljivk
- 'numOpenAnswers' => self::$textAnswersMore['10'], # koliko odprtih odgovorov prikažemo privzeto
-# 'enableInspect' => '0', # ali je Inspect vklopljen
- 'dataPdfType' => '0', # način izpisa pdf - navaden, dolg, kratek pri izviozu podatkov v pdf/rtf
- 'exportDataNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete s podatki v pdf/rtf
- 'exportDataShowIf' => '1', # prikaz if stavkov pri izvozu ankete s podatki v pdf/rtf
- 'exportDataFontSize' => '10', # velikost fonta pri izvozu ankete spodatki v pdf/rtf
- 'exportDataShowRecnum' => '1', # prikaz recnuma respondenta pri izvozu ankete s podatki v pdf/rtf
- 'exportDataPB' => '0', # vsak respondent na svoji strani pri izvozu ankete s podatki v pdf/rtf
- 'exportDataSkipEmpty' => '0', # izpusti vprasanja brez odgovora pri izvozu ankete s podatki v pdf/rtf
- 'exportDataSkipEmptySub' => '0', # izpusti podvprasanja (multigridi) brez odgovora pri izvozu ankete s podatki v pdf/rtf
- 'exportDataLandscape' => '0', # landscape postavitev pri izvozu ankete s podatki v pdf/rtf
- 'exportNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete v pdf/rtf
- 'exportShowIf' => '1', # prikaz if stavkov pri izvozu ankete v pdf/rtf
- 'exportFontSize' => '10', # velikost fonta pri izvozu ankete v pdf/rtf
- 'exportShowIntro' => '0', # prikaz uvoda pri izvozu ankete v pdf/rtf
- 'dataShowIcons' => '1', # ali prikazujemo ikone za urejanje pri podatkih
- 'analysisGoTo' => '1', # Privzeto gremo na grafe
- 'analiza_legenda' => '0', # Privzeto ne prikazujemo legende
- );
+ self::$profiles['0'] = array(
+ 'id'=>0,
+ 'name'=>$lang['srv_default_profile1'],
+ 'dsp_ndp' => NUM_DIGIT_PERCENT, # stevilo digitalnih mest za odstotek
+ 'dsp_nda' => NUM_DIGIT_AVERAGE, # stevilo digitalnih mest za povprecje
+ 'dsp_ndd' => NUM_DIGIT_DEVIATION, # stevilo digitalnih mest za odklon
+ 'dsp_res' => NUM_DIGIT_RESIDUAL, # stevilo digitalnih mest za residual
+ 'dsp_sep' => self::$defaultSeperator, # privzet seperator
+ 'crossChk0' => '1', # izpis frekvenc
+ 'crossChk1' => '0', # izpis procentov po vrsticah
+ 'crossChk2' => '0', # izpis procentov po stolpcih
+ 'crossChk3' => '0', # izpis skupnih procentov
+ 'crossChkEC' => '0', # izpis skupnih procentov
+ 'crossChkRE' => '0', # izpis skupnih procentov
+ 'crossChkSR' => '0', # izpis skupnih procentov
+ 'crossChkAR' => '0', # izpis skupnih procentov
+ 'doColor' => '1', # barvanje celic
+ 'doValues' => '1', # prikaz vrednosti
+ 'showCategories' => '1', # prikaz kategorij
+ 'showOther' => '1', # prikaz polj drugo
+ 'showNumbers' => '1', # prikaz števil
+ 'showText' => '1', # prikaz tekstovnih odgovorov
+ 'chartNumbering' => '0', # ostevilcevanje grafov
+ 'chartFontSize' => '8', # velikost fonta grafov
+ 'chartFP' => '0', # izpis prve strani pri izvozu grafov (PDF/RTF)
+ 'chartTableAlign' => '0', # default poravnava tabel pri grafih (0->sredinska, 1->leva)
+ 'chartTableMore' => '0', # prikaz vseh textovnih odg. v tabelah (0->ne prikazi vseh, 1->vsi)
+ 'chartNumerusText' => '0', # pozicija numerusa
+ 'chartAvgText' => '1', # prikaz povprecja
+ 'chartPieZeros' => '0', # prikaz nicelnih vrednosti v kroznih grafih
+ 'hideEmpty' => '1', # skrivanje spremenljivke, ki nima veljavnih vnosov
+ 'hideAllSystem' => '0', # skrivanje vseh sistemskih spremenljivk
+ 'numOpenAnswers' => self::$textAnswersMore['10'], # koliko odprtih odgovorov prikažemo privzeto
+ 'dataPdfType' => '0', # način izpisa pdf - navaden, dolg, kratek pri izviozu podatkov v pdf/rtf
+ 'exportDataNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataShowIf' => '1', # prikaz if stavkov pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataFontSize' => '10', # velikost fonta pri izvozu ankete spodatki v pdf/rtf
+ 'exportDataShowRecnum' => '1', # prikaz recnuma respondenta pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataPB' => '0', # vsak respondent na svoji strani pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataSkipEmpty' => '0', # izpusti vprasanja brez odgovora pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataSkipEmptySub' => '0', # izpusti podvprasanja (multigridi) brez odgovora pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataLandscape' => '0', # landscape postavitev pri izvozu ankete s podatki v pdf/rtf
+ 'exportNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete v pdf/rtf
+ 'exportShowIf' => '1', # prikaz if stavkov pri izvozu ankete v pdf/rtf
+ 'exportFontSize' => '10', # velikost fonta pri izvozu ankete v pdf/rtf
+ 'exportShowIntro' => '0', # prikaz uvoda pri izvozu ankete v pdf/rtf
+ 'dataShowIcons' => '1', # ali prikazujemo ikone za urejanje pri podatkih
+ 'analysisGoTo' => '1', # Privzeto gremo na grafe
+ 'analiza_legenda' => '0', # Privzeto ne prikazujemo legende
+ );
# poiščemo še seznam vseh ostalih profilov uporabnika
-
- $stringSelect = "SELECT * FROM srv_datasetting_profile WHERE uid = '".self::getGlobalUserId()."' || uid = '0' ORDER BY id";
- $querySelect = sisplet_query($stringSelect);
+ $querySelect = sisplet_query("SELECT * FROM srv_datasetting_profile WHERE uid = '".self::getGlobalUserId()."' || uid = '0' ORDER BY id");
if(mysqli_num_rows($querySelect) > 0){
while ( $rowSelect = mysqli_fetch_assoc($querySelect) ) {
- self::$profiles[$rowSelect['id']] = array( 'id'=>$rowSelect['id'],
- 'name'=>$rowSelect['name'],
- 'dsp_ndp' => $rowSelect['dsp_ndp'],
- 'dsp_nda' => $rowSelect['dsp_nda'],
- 'dsp_ndd' => $rowSelect['dsp_ndd'],
- 'dsp_res' => $rowSelect['dsp_res'],
- 'dsp_sep' => $rowSelect['dsp_sep'],
- 'crossChk0' => 1, // $rowSelect['crossChk0'],
- 'crossChk1' => $rowSelect['crossChk1'],
- 'crossChk2' => $rowSelect['crossChk2'],
- 'crossChk3' => $rowSelect['crossChk3'],
- 'crossChkEC' => $rowSelect['crossChkEC'],
- 'crossChkRE' => $rowSelect['crossChkRE'],
- 'crossChkSR' => $rowSelect['crossChkSR'],
- 'crossChkAR' => $rowSelect['crossChkAR'],
- 'doColor' => $rowSelect['doColor'],
- 'doValues' => $rowSelect['doValues'],
- 'showCategories' => $rowSelect['showCategories'],
- 'showOther' => $rowSelect['showOther'],
- 'showNumbers' => $rowSelect['showNumbers'],
- 'showText' => $rowSelect['showText'],
- 'chartNumbering' => $rowSelect['chartNumbering'],
- 'chartFontSize' => $rowSelect['chartFontSize'],
- 'chartFP' => $rowSelect['chartFP'],
- 'chartTableAlign' => $rowSelect['chartTableAlign'],
- 'chartTableMore' => $rowSelect['chartTableMore'],
- 'chartNumerusText' => $rowSelect['chartNumerusText'],
- 'chartAvgText' => $rowSelect['chartAvgText'],
- 'chartPieZeros' => $rowSelect['chartPieZeros'],
- 'hideEmpty' => $rowSelect['hideEmpty'],
- 'hideAllSystem' => $rowSelect['hideAllSystem'],
- 'numOpenAnswers' => $rowSelect['numOpenAnswers'],
- # 'enableInspect' => $rowSelect['enableInspect'],
- 'dataPdfType' => $rowSelect['dataPdfType'],
- 'exportDataNumbering' => $rowSelect['exportDataNumbering'],
- 'exportDataShowIf' => $rowSelect['exportDataShowIf'],
- 'exportDataFontSize' => $rowSelect['exportDataFontSize'],
- 'exportDataShowRecnum' => $rowSelect['exportDataShowRecnum'],
- 'exportDataPB' => $rowSelect['exportDataPB'],
- 'exportDataSkipEmpty' => $rowSelect['exportDataSkipEmpty'],
- 'exportDataSkipEmptySub' => $rowSelect['exportDataSkipEmptySub'],
- 'exportDataLandscape' => $rowSelect['exportDataLandscape'],
- 'exportNumbering' => $rowSelect['exportNumbering'],
- 'exportShowIf' => $rowSelect['exportShowIf'],
- 'exportFontSize' => $rowSelect['exportFontSize'],
- 'exportShowIntro' => $rowSelect['exportShowIntro'],
- 'dataShowIcons' => $rowSelect['dataShowIcons'],
- 'analysisGoTo' => $rowSelect['analysisGoTo'],
- 'analiza_legenda' => $rowSelect['analiza_legenda'],
- );
+
+ self::$profiles[$rowSelect['id']] = array(
+ 'id'=>$rowSelect['id'],
+ 'name'=>$rowSelect['name'],
+ 'dsp_ndp' => $rowSelect['dsp_ndp'],
+ 'dsp_nda' => $rowSelect['dsp_nda'],
+ 'dsp_ndd' => $rowSelect['dsp_ndd'],
+ 'dsp_res' => $rowSelect['dsp_res'],
+ 'dsp_sep' => $rowSelect['dsp_sep'],
+ 'crossChk0' => 1, // $rowSelect['crossChk0'],
+ 'crossChk1' => $rowSelect['crossChk1'],
+ 'crossChk2' => $rowSelect['crossChk2'],
+ 'crossChk3' => $rowSelect['crossChk3'],
+ 'crossChkEC' => $rowSelect['crossChkEC'],
+ 'crossChkRE' => $rowSelect['crossChkRE'],
+ 'crossChkSR' => $rowSelect['crossChkSR'],
+ 'crossChkAR' => $rowSelect['crossChkAR'],
+ 'doColor' => $rowSelect['doColor'],
+ 'doValues' => $rowSelect['doValues'],
+ 'showCategories' => $rowSelect['showCategories'],
+ 'showOther' => $rowSelect['showOther'],
+ 'showNumbers' => $rowSelect['showNumbers'],
+ 'showText' => $rowSelect['showText'],
+ 'chartNumbering' => $rowSelect['chartNumbering'],
+ 'chartFontSize' => $rowSelect['chartFontSize'],
+ 'chartFP' => $rowSelect['chartFP'],
+ 'chartTableAlign' => $rowSelect['chartTableAlign'],
+ 'chartTableMore' => $rowSelect['chartTableMore'],
+ 'chartNumerusText' => $rowSelect['chartNumerusText'],
+ 'chartAvgText' => $rowSelect['chartAvgText'],
+ 'chartPieZeros' => $rowSelect['chartPieZeros'],
+ 'hideEmpty' => $rowSelect['hideEmpty'],
+ 'hideAllSystem' => $rowSelect['hideAllSystem'],
+ 'numOpenAnswers' => $rowSelect['numOpenAnswers'],
+ 'dataPdfType' => $rowSelect['dataPdfType'],
+ 'exportDataNumbering' => $rowSelect['exportDataNumbering'],
+ 'exportDataShowIf' => $rowSelect['exportDataShowIf'],
+ 'exportDataFontSize' => $rowSelect['exportDataFontSize'],
+ 'exportDataShowRecnum' => $rowSelect['exportDataShowRecnum'],
+ 'exportDataPB' => $rowSelect['exportDataPB'],
+ 'exportDataSkipEmpty' => $rowSelect['exportDataSkipEmpty'],
+ 'exportDataSkipEmptySub' => $rowSelect['exportDataSkipEmptySub'],
+ 'exportDataLandscape' => $rowSelect['exportDataLandscape'],
+ 'exportNumbering' => $rowSelect['exportNumbering'],
+ 'exportShowIf' => $rowSelect['exportShowIf'],
+ 'exportFontSize' => $rowSelect['exportFontSize'],
+ 'exportShowIntro' => $rowSelect['exportShowIntro'],
+ 'dataShowIcons' => $rowSelect['dataShowIcons'],
+ 'analysisGoTo' => $rowSelect['analysisGoTo'],
+ 'analiza_legenda' => $rowSelect['analiza_legenda'],
+ );
}
}
@@ -189,7 +189,63 @@ class SurveyDataSettingProfiles {
}
return true;
- } else {
+ }
+ // Gre za demo anketo
+ elseif(isDemoSurvey($_surveyId)){
+
+ #dodamo privzet sistemski profil
+ self::$profiles['0'] = array(
+ 'id'=>0,
+ 'name'=>$lang['srv_default_profile1'],
+ 'dsp_ndp' => NUM_DIGIT_PERCENT, # stevilo digitalnih mest za odstotek
+ 'dsp_nda' => NUM_DIGIT_AVERAGE, # stevilo digitalnih mest za povprecje
+ 'dsp_ndd' => NUM_DIGIT_DEVIATION, # stevilo digitalnih mest za odklon
+ 'dsp_res' => NUM_DIGIT_RESIDUAL, # stevilo digitalnih mest za residual
+ 'dsp_sep' => self::$defaultSeperator, # privzet seperator
+ 'crossChk0' => '1', # izpis frekvenc
+ 'crossChk1' => '0', # izpis procentov po vrsticah
+ 'crossChk2' => '0', # izpis procentov po stolpcih
+ 'crossChk3' => '0', # izpis skupnih procentov
+ 'crossChkEC' => '0', # izpis skupnih procentov
+ 'crossChkRE' => '0', # izpis skupnih procentov
+ 'crossChkSR' => '0', # izpis skupnih procentov
+ 'crossChkAR' => '0', # izpis skupnih procentov
+ 'doColor' => '1', # barvanje celic
+ 'doValues' => '1', # prikaz vrednosti
+ 'showCategories' => '1', # prikaz kategorij
+ 'showOther' => '1', # prikaz polj drugo
+ 'showNumbers' => '1', # prikaz števil
+ 'showText' => '1', # prikaz tekstovnih odgovorov
+ 'chartNumbering' => '0', # ostevilcevanje grafov
+ 'chartFontSize' => '8', # velikost fonta grafov
+ 'chartFP' => '0', # izpis prve strani pri izvozu grafov (PDF/RTF)
+ 'chartTableAlign' => '0', # default poravnava tabel pri grafih (0->sredinska, 1->leva)
+ 'chartTableMore' => '0', # prikaz vseh textovnih odg. v tabelah (0->ne prikazi vseh, 1->vsi)
+ 'chartNumerusText' => '0', # pozicija numerusa
+ 'chartAvgText' => '1', # prikaz povprecja
+ 'chartPieZeros' => '0', # prikaz nicelnih vrednosti v kroznih grafih
+ 'hideEmpty' => '1', # skrivanje spremenljivke, ki nima veljavnih vnosov
+ 'hideAllSystem' => '0', # skrivanje vseh sistemskih spremenljivk
+ 'numOpenAnswers' => self::$textAnswersMore['10'], # koliko odprtih odgovorov prikažemo privzeto
+ 'dataPdfType' => '0', # način izpisa pdf - navaden, dolg, kratek pri izviozu podatkov v pdf/rtf
+ 'exportDataNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataShowIf' => '1', # prikaz if stavkov pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataFontSize' => '10', # velikost fonta pri izvozu ankete spodatki v pdf/rtf
+ 'exportDataShowRecnum' => '1', # prikaz recnuma respondenta pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataPB' => '0', # vsak respondent na svoji strani pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataSkipEmpty' => '0', # izpusti vprasanja brez odgovora pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataSkipEmptySub' => '0', # izpusti podvprasanja (multigridi) brez odgovora pri izvozu ankete s podatki v pdf/rtf
+ 'exportDataLandscape' => '0', # landscape postavitev pri izvozu ankete s podatki v pdf/rtf
+ 'exportNumbering' => '1', # ostevilcevanje vprasanj pri izvozu ankete v pdf/rtf
+ 'exportShowIf' => '1', # prikaz if stavkov pri izvozu ankete v pdf/rtf
+ 'exportFontSize' => '10', # velikost fonta pri izvozu ankete v pdf/rtf
+ 'exportShowIntro' => '0', # prikaz uvoda pri izvozu ankete v pdf/rtf
+ 'dataShowIcons' => '1', # ali prikazujemo ikone za urejanje pri podatkih
+ 'analysisGoTo' => '1', # Privzeto gremo na grafe
+ 'analiza_legenda' => '0', # Privzeto ne prikazujemo legende
+ );
+ }
+ else {
return false;
}
@@ -199,7 +255,11 @@ class SurveyDataSettingProfiles {
*
*/
static function GetCurentProfileData() {
- return self::$profiles[self::$currentProfileId];
+
+ if(isset(self::$profiles[self::$currentProfileId]))
+ return self::$profiles[self::$currentProfileId];
+
+ return 0;
}
/** Vrne podatke podanega profofila
@@ -572,14 +632,9 @@ class SurveyDataSettingProfiles {
$css = (self::$currentProfileId == SDS_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || self::$currentProfileId != SDS_DEFAULT_PROFILE) {
- if ($_GET['a'] != 'data') {
- # v podatkih imamo nastavitve na prvem mestum zato ne rišemo spejsrja
- echo '<li class="space">&nbsp;</li>';
- }
echo '<li>';
- echo '<span class="as_link'.$css.'" id="dsp_link" title="' . $lang['srv_dsp_link_title'] . '">' . $lang['srv_dsp_link'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="dsp_link" title="' . $lang['srv_dsp_link_title'] . '">' . $lang['srv_dsp_link'] . '</span>'."\n";
echo '</li>';
-
}
}
@@ -616,47 +671,60 @@ class SurveyDataSettingProfiles {
}
$currentFilterProfile = $_all_profiles[$current_pid];
if ( self::$currentProfileId != SDS_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div id="dsp_profiles_left">';
- echo '<span id="dsp_profiles_holder">';
+
+ echo '<div class="popup_main with_menu">';
+
+ echo '<div id="dsp_profiles_left" class="popup_left">';
+ echo '<div id="dsp_profiles_holder">';
+
# zlistamo vse profile
- echo '<span id="dsp_profiles" class="select">';
+ echo '<div id="dsp_profiles" class="list select">';
if (count($_all_profiles)) {
- foreach ($_all_profiles as $id=>$profile) {
-
- echo '<div class="option' . ($current_pid == $id ? ' active' : '') . '" id="dataSetting_profile_' . $id . '" value="'.$id.'">';
+ foreach ($_all_profiles as $id=>$profile) {
+
+ echo '<div class="list-item option '.($current_pid == $id ? 'active' : '').'" id="dataSetting_profile_' . $id . '" value="'.$id.'">';
echo $profile['name'];
if($current_pid == $id){
- # sistemskega ne moremo izbrisati
+ echo '<div class="profile_icons">';
+
+ # sistemskega ne moremo izbrisati
if ($current_pid != 0) {
- echo ' <a href="#" onclick="dataSettingProfileAction(\'show_delete\'); return false;" value="'.$lang['srv_delete_profile'].'"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
+ echo ' <a href="#" onclick="dataSettingProfileAction(\'show_delete\'); return false;" value="'.$lang['srv_delete_profile'].'"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
}
# sistemskega in seje ne moremo preimenovati
if ($current_pid > 0) {
- echo ' <a href="#" onclick="dataSettingProfileAction(\'show_rename\'); return false;" value="'.$lang['srv_rename_profile'].'"><span class="faicon edit floatRight spaceRight"></span></a>'."\n";
+ echo ' <a href="#" onclick="dataSettingProfileAction(\'show_rename\'); return false;" value="'.$lang['srv_rename_profile'].'"><span class="faicon edit floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
}
}
- echo '</span>'; # dataSetting_profile
- echo '</span>'; # dsp_profiles_holder
-
- echo '</div>'; # dsp_profiles_left
+ echo '</div>'; # dataSetting_profile
- echo '<div id="dsp_profiles_right">'."\n";
+ // Gumb za dodajanje novega profila
+ echo '<button class="small white-black" title="'.$lang['srv_create_new_profile'].'" onclick="dataSettingProfileAction(\'show_create\'); return false;">';
+ echo ' <span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'];
+ echo '</button>';
+
+ echo '</div>'; # dsp_profiles_holder
+ echo '</div>'; # dsp_profiles_left
+
+
+ echo '<div id="dsp_profiles_right" class="popup_right">'."\n";
if ($current_pid == 0) {
- echo '<div id="dsp_note">';
+ echo '<div id="dsp_note" class="popup_right_note">';
echo $lang['srv_change_default_profile'];
echo '</div>'; // dataSetting_profile_note
- echo '<br class="clr" />'."\n";
}
echo '<div id="dsp_content">';
@@ -665,21 +733,25 @@ class SurveyDataSettingProfiles {
echo '</div>'; // dataSetting_profile_right
+ echo '</div>';
+
- echo '<div id="dsp_button_holder">'."\n";
+ echo '<div id="dsp_button_holder" class="button_holder">'."\n";
if ((int)$current_pid <= 0 ) {
- if ((int)$current_pid == 0) {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
+
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="dataSettingProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+
+ if ((int)$current_pid == 0) {
+ echo '<button class="medium white-blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="dataSettingProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'] . '" onclick="dataSettingProfileAction(\'run_profile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
+ }
+ else {
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="dataSettingProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
}
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
+ }
+ else {
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="dataSettingProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'] . '" onclick="dataSettingProfileAction(\'run_profile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
}
echo '</div>'."\n"; // dsp_button_holder
@@ -688,26 +760,51 @@ class SurveyDataSettingProfiles {
echo '<div id="dsp_cover_div"></div>'."\n";
// div za kreacijo novega
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="newProfileName" name="newProfileName" type="text" value="" size="45" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'do_create\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'cancel_create\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="dataSettingProfileAction(\'cancel_create\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="dataSettingProfileAction(\'do_create\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="45" />'."\n";
- echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'do_rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" class="text large"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="dataSettingProfileAction(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="dataSettingProfileAction(\'do_rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $currentFilterProfile['name'] . '</b>?'."\n";
- echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="dataSettingProfileAction(\'do_delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="dataSettingProfileAction(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $currentFilterProfile['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="dataSettingProfileAction(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="dataSettingProfileAction(\'do_delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
/** Funkcija prikaze osnovnih informacije profila
@@ -725,64 +822,64 @@ class SurveyDataSettingProfiles {
echo '<fieldset>';
echo '<legend>'.$lang['srv_results_filter_settings'].'</legend>';
- echo '<label><input id="showCategories" name="showCategories" type="checkbox" ' .
- (($cp['showCategories']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_kategorialneSpremenljivke'];
- echo '</label>';
-
- echo '<label><input id="showOther" name="showOther" type="checkbox" ' .
- (($cp['showOther']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- #(($cp['showCategories']) ? '' : ' disabled="disabled" ')
- echo $lang['srv_analiza_ShowOthersText'] ;
- echo '</label>';
+
+ echo '<div class="setting_line">';
+
+ echo ' <input id="showCategories" name="showCategories" type="checkbox" '.(($cp['showCategories']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo ' <label for="showCategories">'.$lang['srv_analiza_kategorialneSpremenljivke'].'</label>';
- echo '<label><input id="showNumbers" name="showNumbers" type="checkbox" ' .
- (($cp['showNumbers']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_numericneSpremenljivke'];
- echo '</label>';
+ echo ' <input id="showOther" name="showOther" type="checkbox" '.(($cp['showOther']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo ' <label for="showOther">'.$lang['srv_analiza_ShowOthersText'].'</label>';
- echo '<label><input id="showText" name="showText" type="checkbox" ' .
- (($cp['showText']) ? ' checked="checked" ' : ' ') . ' autocomplete="off"/>';
- echo '</label>';
+ echo ' <input id="showNumbers" name="showNumbers" type="checkbox" '.(($cp['showNumbers']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo ' <label for="showNumbers">'.$lang['srv_analiza_numericneSpremenljivke'].'</label>';
- echo $lang['srv_analiza_textovneSpremenljivke'];
+ echo ' <input id="showText" name="showText" type="checkbox" '.(($cp['showText']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo ' <label for="showText">'.$lang['srv_analiza_textovneSpremenljivke'].'</label>';
- echo '<br />'.$lang['srv_analiza_link'].': ';
- echo '<select id="analysisGoTo">';
- echo '<option value="0"'.((int)$cp['analysisGoTo'] == 0 ? ' selected="selected"' : '').'>'.$lang['srv_analiza_charts'].'</option>';
- echo '<option value="1"'.((int)$cp['analysisGoTo'] == 1 ? ' selected="selected"' : '').'>'.$lang['srv_sumarnik'].'</option>';
- echo '</select>';
+ echo '</div>';
+
- echo '<br/>';
+ echo '<div class="setting_line">';
+
+ echo ' <label>'.$lang['srv_analiza_link'].':<label>';
+ echo ' <select id="analysisGoTo">';
+ echo ' <option value="0"'.((int)$cp['analysisGoTo'] == 0 ? ' selected="selected"' : '').'>'.$lang['srv_analiza_charts'].'</option>';
+ echo ' <option value="1"'.((int)$cp['analysisGoTo'] == 1 ? ' selected="selected"' : '').'>'.$lang['srv_sumarnik'].'</option>';
+ echo ' </select>';
+
+ echo '</div>';
- echo '<label>';
- echo '<input id="analiza_legenda" name="analiza_legenda" type="checkbox" ' .(($cp['analiza_legenda'] == '1') ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_showLegend'];
- echo '</label>';
- echo '<br/>';
+ echo '<div class="setting_line">';
+
+ echo ' <input id="analiza_legenda" name="analiza_legenda" type="checkbox" ' .(($cp['analiza_legenda'] == '1') ? ' checked="checked" ' : '') . ' autocomplete="off" />';
+ echo ' <label for="analiza_legenda">'.$lang['srv_analiza_showLegend'].'</label>';
+
+ echo '</div>';
+
- echo '<label>';
- echo '<input id="hideEmpty" name="hideEmpty" type="checkbox" ' .
- (($cp['hideEmpty']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_hideEmpty'] ;
- echo '</label>';
+ echo '<div class="setting_line">';
+
+ echo ' <input id="hideEmpty" name="hideEmpty" type="checkbox" '.(($cp['hideEmpty']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo ' <label for="hideEmpty">'.$lang['srv_analiza_hideEmpty'].'</label>';
- echo '<br/>';
+ echo '</div>';
+
- echo '<label>';
- echo '<input id="hideAllSystem" name="hideAllSystem" type="checkbox" ' .
- (($cp['hideAllSystem']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_hideAllEmpty'] ;
- echo '</label>';
+ echo '<div class="setting_line">';
+
+ echo '<input id="hideAllSystem" name="hideAllSystem" type="checkbox" '.(($cp['hideAllSystem']) ? ' checked="checked" ' : '').' autocomplete="off" />';
+ echo '<label for="hideAllSystem">'.$lang['srv_analiza_hideAllEmpty'].'</label>';
- echo '<br/>';
+ echo '</div>';
+
- echo '<label>';
- echo $lang['srv_analiza_defAnsCnt'].": ";
+ echo '<div class="setting_line">';
+
+ echo '<label>'.$lang['srv_analiza_defAnsCnt'].":</label>";
echo '<select id="numOpenAnswers" name="numOpenAnswers" autocomplete="off">';
$lastElement = end(self::$textAnswersMore);
-
foreach (self::$textAnswersMore AS $key => $values) {
echo '<option'.((int)$cp['numOpenAnswers'] == $values ? ' selected="selected"' : '').' value="'.$values.'">';
if ($values != $lastElement) {
@@ -793,80 +890,100 @@ class SurveyDataSettingProfiles {
echo '</option>';
}
echo '</select>';
- echo '</label>';
+
+ echo '</div>';
echo '</fieldset>';
echo '<fieldset>';
echo '<legend>'.$lang['srv_results_base_settings'].'</legend>';
- echo '<span class="dsp_sett_label">'.$lang['srv_results_num_digits'].'</span>';
- echo '&nbsp;&nbsp;<span clsss="dsp_sett_label">'.$lang['srv_results_for_percents'].':&nbsp;</span><input type="text" id="dsp_ndp" name="dsp_ndp" value="'.$cp['dsp_ndp'].'" size="2" autocomplete="off">';
- echo '&nbsp;&nbsp;<span class="dsp_sett_label">'.$lang['srv_results_for_average'].':&nbsp;</span><input type="text" id="dsp_nda" name="dsp_nda" value="'.$cp['dsp_nda'].'" size="2" autocomplete="off">';
- echo '&nbsp;&nbsp;<span class="dsp_sett_label">'.$lang['srv_results_for_deviation'].':&nbsp;</span><input type="text" id="dsp_ndd" name="dsp_ndd" value="'.$cp['dsp_ndd'].'" size="2" autocomplete="off">';
-
- echo '<br/>'.$lang['srv_results_decimal_sign'].': ';
+
+
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_results_num_digits'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label for="dsp_ndp">'.$lang['srv_results_for_percents'].':</label>';
+ echo ' <input type="text" id="dsp_ndp" name="dsp_ndp" value="'.$cp['dsp_ndp'].'" size="2" autocomplete="off">';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label for="dsp_nda">'.$lang['srv_results_for_average'].':</label>';
+ echo ' <input type="text" id="dsp_nda" name="dsp_nda" value="'.$cp['dsp_nda'].'" size="2" autocomplete="off">';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label for="dsp_ndd">'.$lang['srv_results_for_deviation'].':</label>';
+ echo ' <input type="text" id="dsp_ndd" name="dsp_ndd" value="'.$cp['dsp_ndd'].'" size="2" autocomplete="off">';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo '<label>'.$lang['srv_results_decimal_sign'].':</label>';
foreach (self::$seperators AS $skey => $seperators) {
- echo '<label>';
- echo '<input type="radio" id="radio_dsp_sep_'.$skey.'" name="radio_dsp_sep" value="'.$skey.'"'.($cp['dsp_sep'] == $skey ? ' checked="checked"' : '').' autocomplete="off">';
- echo self::formatNumber('1234.56',2,$seperators);
- echo '</label>';
+ echo '<input type="radio" id="radio_dsp_sep_'.$skey.'" name="radio_dsp_sep" value="'.$skey.'"'.($cp['dsp_sep'] == $skey ? ' checked="checked"' : '').' autocomplete="off">';
+ echo '<label for="radio_dsp_sep_'.$skey.'">'.self::formatNumber('1234.56', 2, $seperators).'</label>';
}
+ echo '</div>';
+
echo '</fieldset>';
// Nastavitve za crosstabe - prikazemo samo v crosstabih
echo '<fieldset '.(isset($_POST['podstran']) && $_POST['podstran'] == 'crosstabs' ? '' : ' style="display:none;"').'>';
echo '<legend>'.$lang['srv_results_crostabs_settings'].'</legend>';
- echo '<span class="dsp_sett_label">'.$lang['srv_results_num_digits'].'</span>';
- echo '&nbsp;&nbsp;<span clsss="dsp_sett_label">'.$lang['srv_results_for_residual'].':&nbsp;</span><input type="text" id="dsp_res" name="dsp_res" value="'.$cp['dsp_res'].'" size="2" autocomplete="off">';
+
+ echo '<div class="setting_line">';
+ echo ' <label for="dsp_res">'.$lang['srv_results_num_digits'].' '.$lang['srv_results_for_residual'].':</label>';
+ echo ' <input type="text" id="dsp_res" name="dsp_res" value="'.$cp['dsp_res'].'" size="2" autocomplete="off">';
+ echo '</div>';
- echo '<div class="crossCheckHolder">' ;
- echo '<div class="crossCheckHolder">' ;
-// echo '<input id="crossCheck0" name="crossCheck0" type="checkbox" ' . ($cp['crossChk0'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span name="spn_residual" class="ctbChck_sp0">' . $lang['srv_analiza_crosstab_frekvence'] . '</span><br />';
- echo '<label>';
- echo '<input id="crossCheck1" name="crossCheck1" type="checkbox" ' . ($cp['crossChk1'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_sp1" class="ctbChck_sp1">' . $lang['srv_analiza_crosstab_odstotek_vrstice'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheck2" name="crossCheck2" type="checkbox" ' . ($cp['crossChk2'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_sp2" class="ctbChck_sp2">' . $lang['srv_analiza_crosstab_odstotek_stolpci'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheck3" name="crossCheck3" type="checkbox" ' . ($cp['crossChk3'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_sp3" class="ctbChck_sp3">' . $lang['srv_analiza_crosstab_odstotek_skupni'] . '</span><br />';
- echo '</label>';
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheck1" name="crossCheck1" type="checkbox" ' . ($cp['crossChk1'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheck1">'.$lang['srv_analiza_crosstab_odstotek_vrstice'].'</label>';
echo '</div>';
- echo '<div class="crossCheckHolder">' ;
- echo '<label>';
- echo '<input id="crossCheckEC" name="crossCheckEC" type="checkbox" ' . ($cp['crossChkEC'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_EC" class="crossCheck_EC">' . $lang['srv_analiza_crosstab_expected_count'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheckRE" name="crossCheckRE" type="checkbox" ' . ($cp['crossChkRE'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_RE" class="crossCheck_RE">' . $lang['srv_analiza_crosstab_residual'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheckSR" name="crossCheckSR" type="checkbox" ' . ($cp['crossChkSR'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_SR" class="crossCheck_SR">' . $lang['srv_analiza_crosstab_stnd_residual'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheckAR" name="crossCheckAR" type="checkbox" ' . ($cp['crossChkAR'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span id="spn_residual_AR" class="crossCheck_AR">' . $lang['srv_analiza_crosstab_adjs_residual'] . '</span><br />';
- echo '</label>';
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheck2" name="crossCheck2" type="checkbox" ' . ($cp['crossChk2'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheck2">'.$lang['srv_analiza_crosstab_odstotek_stolpci'].'</label>';
echo '</div>';
-
- echo '<div class="crossCheckHolder">' ;
- echo '<label>';
- echo '<input id="crossCheckColor" name="crossCheckColor" type="checkbox" ' . ($cp['doColor'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span class="crossCheckColor">' . $lang['srv_analiza_crosstab_color_residual1'] . '</span><br />';
- echo '</label>';
- echo '<label>';
- echo '<input id="crossCheckValues" name="crossCheckValues" type="checkbox" ' . ($cp['doValues'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/><span class="crossCheckValues">' . $lang['srv_analiza_crosstab_doValues'] . '</span>';
- echo '</label>';
- /*
- echo '<table id="tbl_color_ersidual" class="residual">';
- echo '<tr><td>'.$lang['srv_analiza_crosstab_value'].'</td><th>+</th><th>-</th></tr>';
- echo '<tr><td>1.1 - 2.0</td><td class="rsdl_bck1">&nbsp;</td><td class="rsdl_bck4">&nbsp;</td></tr>';
- echo '<tr><td>2.1 - 3.0</td><td class="rsdl_bck2">&nbsp;</td><td class="rsdl_bck5">&nbsp;</td></tr>';
- echo '<tr><td>3.1 '.$lang['srv_analiza_crosstab_and_more'].'</td><td class="rsdl_bck3">&nbsp;</td><td class="rsdl_bck6">&nbsp;</td></tr>';
- echo '</table>';
-*/
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheck3" name="crossCheck3" type="checkbox" ' . ($cp['crossChk3'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheck3">'.$lang['srv_analiza_crosstab_odstotek_skupni'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckEC" name="crossCheckEC" type="checkbox" ' . ($cp['crossChkEC'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckEC">'.$lang['srv_analiza_crosstab_expected_count'].'</label>';
echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckRE" name="crossCheckRE" type="checkbox" ' . ($cp['crossChkRE'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckRE">'.$lang['srv_analiza_crosstab_residual'].'</label>';
echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckSR" name="crossCheckSR" type="checkbox" ' . ($cp['crossChkSR'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckSR">'.$lang['srv_analiza_crosstab_stnd_residual'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckAR" name="crossCheckAR" type="checkbox" ' . ($cp['crossChkAR'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckAR">'.$lang['srv_analiza_crosstab_adjs_residual'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckColor" name="crossCheckColor" type="checkbox" ' . ($cp['doColor'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckColor">'.$lang['srv_analiza_crosstab_color_residual1'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheckValues" name="crossCheckValues" type="checkbox" ' . ($cp['doValues'] == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheckValues">'.$lang['srv_analiza_crosstab_doValues'].'</label>';
+ echo '</div>';
+
echo '</fieldset>';
@@ -874,195 +991,97 @@ class SurveyDataSettingProfiles {
echo '<fieldset>';
echo '<legend>'.$lang['srv_results_charts_settings'].'</legend>';
+
// default poravnava tabel
- echo $lang['srv_chart_table_defAlign'].': ';
- echo '<label>';
- echo '<input type="radio" id="chartTableAlign_0" name="chartTableAlign" value="0"'.($cp['chartTableAlign'] == 0 ? ' checked="checked"' : '').' autocomplete="off">'.$lang['srv_chart_table_defAlign_0'];
- echo '</label>';
- echo '<label>';
- echo '<input type="radio" id="chartTableAlign_1" name="chartTableAlign" value="1"'.($cp['chartTableAlign'] == 1 ? ' checked="checked"' : '').' autocomplete="off">'.$lang['srv_chart_table_defAlign_1'];
- echo '</label>';
+ echo '<div class="setting_line">';
+
+ echo ' <label>'.$lang['srv_chart_table_defAlign'].':</label>';
+
+ echo ' <input type="radio" id="chartTableAlign_0" name="chartTableAlign" value="0"'.($cp['chartTableAlign'] == 0 ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="chartTableAlign_0">'.$lang['srv_chart_table_defAlign_0'].'</label>';
+
+ echo ' <input type="radio" id="chartTableAlign_1" name="chartTableAlign" value="1"'.($cp['chartTableAlign'] == 1 ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="chartTableAlign_1">'.$lang['srv_chart_table_defAlign_1'].'</label>';
+
+ echo '</div>';
+
+
// velikost pisave v grafih
- echo '<br /><label>' . $lang['srv_export_font'] . ': </label>';
- echo '<select name="chartFontSize" id="chartFontSize" >';
+ echo '<div class="setting_line">';
+
+ echo '<label for="chartFontSize">'.$lang['srv_export_font'].':</label>';
+ echo '<select name="chartFontSize" id="chartFontSize">';
echo ' <option value="8"'.((int)$cp['chartFontSize'] == 8 ? ' selected="selected"' : '').'>8</option>';
echo ' <option value="9"'.((int)$cp['chartFontSize'] == 9 ? ' selected="selected"' : '').'>9</option>';
echo ' <option value="10"'.((int)$cp['chartFontSize'] == 10 ? ' selected="selected"' : '').'>10</option>';
echo ' <option value="11"'.((int)$cp['chartFontSize'] == 11 ? ' selected="selected"' : '').'>11</option>';
echo ' <option value="12"'.((int)$cp['chartFontSize'] == 12 ? ' selected="selected"' : '').'>12</option>';
echo '</select>';
+
+ echo '</div>';
+
// prikaz texta ob numerusu
- echo '<br /><label>' . $lang['srv_chart_numerusText'] . ': </label>';
- echo '<select name="chartNumerusText" id="chartNumerusText" >';
+ echo '<div class="setting_line">';
+
+ echo '<label for="chartNumerusText">' . $lang['srv_chart_numerusText'] . ':</label>';
+ echo '<select name="chartNumerusText" id="chartNumerusText">';
echo ' <option value="0"'.((int)$cp['chartNumerusText'] == 0 ? ' selected="selected"' : '').'>' . $lang['srv_chart_numerusText_0'] . '</option>';
echo ' <option value="1"'.((int)$cp['chartNumerusText'] == 1 ? ' selected="selected"' : '').'>' . $lang['srv_chart_numerusText_1'] . '</option>';
echo ' <option value="2"'.((int)$cp['chartNumerusText'] == 2 ? ' selected="selected"' : '').'>' . $lang['srv_chart_numerusText_2'] . '</option>';
echo ' <option value="3"'.((int)$cp['chartNumerusText'] == 3 ? ' selected="selected"' : '').'>' . $lang['srv_chart_numerusText_3'] . '</option>';
echo ' <option value="4"'.((int)$cp['chartNumerusText'] == 4 ? ' selected="selected"' : '').'>' . $lang['without'] . '</option>';
echo '</select>';
+
+ echo '</div>';
+
// prikaz povprecja
- echo '<br /><label>' . $lang['srv_chart_showAvg_long'] . ': </label>';
- echo '<select name="chartAvgText" id="chartAvgText" >';
+ echo '<div class="setting_line">';
+
+ echo '<label for="chartAvgText">' . $lang['srv_chart_showAvg_long'] . ':</label>';
+ echo '<select name="chartAvgText" id="chartAvgText">';
echo ' <option value="1"'.((int)$cp['chartAvgText'] == 1 ? ' selected="selected"' : '').'>' . $lang['yes'] . '</option>';
echo ' <option value="0"'.((int)$cp['chartAvgText'] == 0 ? ' selected="selected"' : '').'>' . $lang['no'] . '</option>';
echo '</select>';
+
+ echo '</div>';
+
// stevilcenje vprasanj
- echo '<br />';
- echo '<label>';
- echo '<input id="chartNumbering" name="chartNumbering" type="checkbox" ' .
- (($cp['chartNumbering']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_nastavitveStevilcenje'];
- echo '</label>';
+ echo '<div class="setting_line">';
+
+ echo '<input id="chartNumbering" name="chartNumbering" type="checkbox" '.(($cp['chartNumbering']) ? ' checked="checked" ' : '').' autocomplete="off"/>';
+ echo '<label for="chartNumbering">' . $lang['srv_nastavitveStevilcenje'] . ':</label>';
+
+ echo '</div>';
+
+
// uvodna stran v izvozu
- echo '<br />';
- echo '<label>';
- echo '<input id="chartFP" name="chartFP" type="checkbox" ' .
- (($cp['chartFP']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_chart_frontpage'] ;
- echo '</label>';
- // prikaz textovnih odgovorov (vec)
- /*echo '<br />';
- echo '<label>';
- echo '<input id="chartTableMore" name="chartTableMore" type="checkbox" ' .
- (($cp['chartTableMore']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_chart_table_more'] ;
- echo '</label>';*/
+ echo '<div class="setting_line">';
+
+ echo '<input id="chartFP" name="chartFP" type="checkbox" '.(($cp['chartFP']) ? ' checked="checked" ' : '').' autocomplete="off"/>';
+ echo '<label for="chartFP">' . $lang['srv_chart_frontpage'] . ':</label>';
+
+ echo '</div>';
+
+
// prikaz nicelnih vrednosti v kroznih grafih
- echo '<br />';
- echo '<label>';
- echo '<input id="chartPieZeros" name="chartPieZeros" type="checkbox" ' .
- (($cp['chartPieZeros']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_chart_pieZeros'] ;
- echo '</label>';
- echo '</fieldset>';
-
-# echo '<label>'.$lang['srv_displaydata_showIcon'].'</label>';
-# echo '&nbsp;<input id="dataShowIcons0" name="dataShowIcons" type="radio" value="0"' .
-# (($cp['dataShowIcons'] != 1) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
-# echo '<label for="dataShowIcons0">'.$lang['no'].'</label>';
-#
-# echo '&nbsp;<input id="dataShowIcons1" name="dataShowIcons" type="radio" value="1"' .
-# (($cp['dataShowIcons'] == 1) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
-# echo '<label for="dataShowIcons1">'.$lang['yes'].'</label>';
-# echo '<br/>';
-
-
- #Nastavitve za izvoz podatkov - PRESTAVLJENO V SPLOSNE NASTAVITVE ANKETE
- /*echo '<fieldset style="width: 43%; float: left;">';
- echo '<legend>'.$lang['srv_export_results_settings'].'</legend>';
-
- echo '<label>' . $lang['srv_displaydata_type'] . ': </label>';
- echo '<select name="dataPdfType" id="dataPdfType" >';
- echo ' <option value="0"'.((int)$cp['dataPdfType'] == 0 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type0'] . '</option>';
- echo ' <option value="1"'.((int)$cp['dataPdfType'] == 1 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type1'] . '</option>';
- echo ' <option value="2"'.((int)$cp['dataPdfType'] == 2 ? ' selected="selected"' : '').'>' . $lang['srv_displaydata_type2'] . '</option>';
- echo '</select>';
- echo Help :: display('displaydata_pdftype');
-
- // ostevilcevanje vprasanj pri izvozih
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataNumbering" name="exportDataNumbering" type="checkbox" ' .
- (($cp['exportDataNumbering']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_nastavitveStevilcenje'];
- echo '</label>';
- // prikaz recnumov respondentov pri izvozih
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataShowRecnum" name="exportDataShowRecnum" type="checkbox" ' .
- (($cp['exportDataShowRecnum']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_show_recnum'];
- echo '</label>';
- // page break med posameznimi respondenti
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataPB" name="exportDataPB" type="checkbox" ' .
- (($cp['exportDataPB']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_pagebreak'];
- echo '</label>';
- // izpusti vprasanja brez odgovora
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataSkipEmpty" name="exportDataSkipEmpty" type="checkbox" ' .
- (($cp['exportDataSkipEmpty']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_skip_empty'];
- echo '</label>';
- // izpusti podvprasanja brez odgovora
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataSkipEmptySub" name="exportDataSkipEmptySub" type="checkbox" ' .
- (($cp['exportDataSkipEmptySub']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_skip_empty_sub'];
- echo '</label>';
- // landscape postavitev izvoza - V DELU
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataLandscape" name="exportDataLandscape" type="checkbox" ' .
- (($cp['exportDataLandscape']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_landscape'];
- echo '</label>';
- // prikaz pogojev pri izvozih
- echo '<br />';
- echo '<label>';
- echo '<input id="exportDataShowIf" name="exportDataShowIf" type="checkbox" ' .
- (($cp['exportDataShowIf']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_if'];
- echo '</label>';
- // velikost pisave v izvozih
- echo '<br /><label>' . $lang['srv_export_font'] . ': </label>';
- echo '<select name="exportDataFontSize" id="exportDataFontSize" >';
- echo ' <option value="8"'.((int)$cp['exportDataFontSize'] == 8 ? ' selected="selected"' : '').'>8</option>';
- echo ' <option value="10"'.((int)$cp['exportDataFontSize'] == 10 ? ' selected="selected"' : '').'>10</option>';
- echo ' <option value="12"'.((int)$cp['exportDataFontSize'] == 12 ? ' selected="selected"' : '').'>12</option>';
- echo '</select>';
-
+ echo '<div class="setting_line">';
+
+ echo '<input id="chartPieZeros" name="chartPieZeros" type="checkbox" '.(($cp['chartPieZeros']) ? ' checked="checked" ' : '').' autocomplete="off"/>';
+ echo '<label for="chartPieZeros">' . $lang['srv_chart_pieZeros'] . ':</label>';
+
+ echo '</div>';
+
+
echo '</fieldset>';
-
-
- #Nastavitve za izvoz vprasalnika - PRESTAVLJENO V SPLOSNE NASTAVITVE ANKETE
- echo '<fieldset style="width: 43%; float: right; margin-bottom: 40px;">';
- echo '<legend>'.$lang['srv_export_survey_settings'].'</legend>';
-
- // ostevilcevanje vprasanj pri izvozih
- echo '<label>';
- echo '<input id="exportNumbering" name="exportNumbering" type="checkbox" ' .
- (($cp['exportNumbering']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_nastavitveStevilcenje'];
- echo '</label>';
- // prikaz pogojev pri izvozih
- echo '<br />';
- echo '<label>';
- echo '<input id="exportShowIf" name="exportShowIf" type="checkbox" ' .
- (($cp['exportShowIf']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_if'];
- echo '</label>';
- // velikost pisave v izvozih
- echo '<br /><label>' . $lang['srv_export_font'] . ': </label>';
- echo '<select name="exportFontSize" id="exportFontSize" >';
- echo ' <option value="8"'.((int)$cp['exportFontSize'] == 8 ? ' selected="selected"' : '').'>8</option>';
- echo ' <option value="10"'.((int)$cp['exportFontSize'] == 10 ? ' selected="selected"' : '').'>10</option>';
- echo ' <option value="12"'.((int)$cp['exportFontSize'] == 12 ? ' selected="selected"' : '').'>12</option>';
- echo '</select>';
-
- // prikaz uvoda pri izvozih
- echo '<br />';
- echo '<label>';
- echo '<input id="exportShowIntro" name="exportShowIntro" type="checkbox" ' .
- (($cp['exportShowIntro']) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_export_intro'];
- echo '</label>';
- echo '</fieldset>';*/
-
- //echo '<span class="clr"></span>';
}
public static function ajax() {
switch ($_GET['a']) {
case 'showProfile':
- self::displayProfiles($_POST['pid']);
+ self::displayProfiles(isset($_POST['pid'])?$_POST['pid']:'');
break;
case 'createProfile':
self::createNewProfile();
@@ -1093,17 +1112,7 @@ class SurveyDataSettingProfiles {
case 'refreshDropdown':
self::DisplayLinkDropdown();
break;
-/*
- case 'show_inspectListSpr':
- self::showInspectListSpr();
- break;
- case 'saveInspectListVars':
- self::saveInspectListVars();
- break;
- case 'displayInspectVars':
- self::displayInspectVars();
- break;
-*/
+
case 'removeKategoriesProfile':
self::removeKategoriesProfile();
break;
@@ -1113,6 +1122,9 @@ class SurveyDataSettingProfiles {
case 'changeDataIconsSettings':
self::changeDataIconsSettings();
break;
+ case 'changeDataFullscreen':
+ self::changeDataFullscreen();
+ break;
case 'changeUsabilityIconsSettings':
self::changeUsabilityIconsSettings();
break;
@@ -1230,13 +1242,15 @@ class SurveyDataSettingProfiles {
}
static function getVariableTypeNote() {
-
+ $prefix='';
+
if (SurveyDataSettingProfiles :: getSetting('showCategories') == 0
|| SurveyDataSettingProfiles :: getSetting('showNumbers') == 0
|| SurveyDataSettingProfiles :: getSetting('showOther') == 0
|| SurveyDataSettingProfiles :: getSetting('showText') == 0) {
echo '<div id="variableTypeNote">Spremenljivke tipa: <strong>';
+
if (self :: getSetting('showCategories') == 0) {
echo $prefix.'kategorije';
$prefix=', ';
@@ -1253,12 +1267,15 @@ class SurveyDataSettingProfiles {
echo $prefix.'besedilo';
$prefix=', ';
}
+
echo '</strong> niso prikazane. ';
echo '<span id="link_variableType_profile_setup" class="as_link">Nastavi</span>';
echo '&nbsp;<span id="link_variableType_profile_remove" class="as_link">Odstrani</span>';
echo '</div>';
- return true;
- } else {
+
+ return true;
+ }
+ else {
return false;
}
}
@@ -1329,6 +1346,19 @@ class SurveyDataSettingProfiles {
session_commit();
}
}
+
+ static function changeDataFullscreen(){
+ session_start();
+
+ if (isset($_POST['data_fullscreen'])){
+ if($_POST['data_fullscreen'] == '1') {
+ $_SESSION['sid_'.self::$surveyId]['data_fullscreen'] = true;
+ } else {
+ $_SESSION['sid_'.self::$surveyId]['data_fullscreen'] = false;
+ }
+ session_commit();
+ }
+ }
static function changeUsabilityIconsSettings(){
session_start();
@@ -1399,7 +1429,7 @@ class SurveyDataSettingProfiles {
// Shranimo residuale za crosstabe
static function saveResidualProfileSetting() {
global $lang;
-
+ $updatequery = null;
$pid = (isset($_POST['pid'])) ? $_POST['pid'] : -1;
if(isset($_POST['value'])){
diff --git a/admin/survey/classes/class.SurveyDiagnostics.php b/admin/survey/classes/class.SurveyDiagnostics.php
index 9a8b01a..49ce651 100644
--- a/admin/survey/classes/class.SurveyDiagnostics.php
+++ b/admin/survey/classes/class.SurveyDiagnostics.php
@@ -143,14 +143,8 @@ class SurveyDiagnostics
$_pripombe = true;
}
-
- echo '<span class="srv_diagnostic_note">';
- echo $this->printNote();
- #
- echo '</span>';
-
- SurveySetting::getInstance()->Init($this->anketa);
+ SurveySetting::getInstance()->Init($this->sid);
$preview_disableif = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disableif');
$preview_disablealert = SurveySetting::getInstance()->getSurveyMiscSetting('preview_disablealert');
$preview_displayifs = SurveySetting::getInstance()->getSurveyMiscSetting('preview_displayifs');
@@ -158,26 +152,35 @@ class SurveyDiagnostics
$preview_hidecomment = SurveySetting::getInstance()->getSurveyMiscSetting('preview_hidecomment');
$preview_options = ''.($preview_disableif==1?'&disableif=1':'').($preview_disablealert==1?'&disablealert=1':'').($preview_displayifs==1?'&displayifs=1':'').($preview_displayvariables==1?'&displayvariables=1':'').($preview_hidecomment==1?'&hidecomment=1':'').'';
+ /* - ZAČASNO ZAKOMENTIRAN TOOLTIP (prekriva vsebino za redizajn) @TG
echo '<br><div style="display:inline-block; margin: 0 0 10px 20px">';
echo '<span class="tooltip">';
- echo '<a href="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" target="_blank" style="font-size:15px"><span class="faicon edit_square"></span> '.$lang['srv_survey_testdata'].'</a>';
- echo ' ('.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.') ';
echo '<span class="expanded-tooltip bottom light" style="left: -40px;">';
echo '<b>' . $lang['srv_survey_testdata2'] . ':</b> '.$lang['srv_testdata_text'].'';
echo '<p>'.$lang['srv_preview_testdata_longtext'].'</p>';
echo '<span class="arrow"></span>';
echo '</span>'; // expanded-tooltip bottom
- echo '</span>'; // tooltip
-
- echo ' - <a href="#" id="popup-open" onclick="javascript:testiranje_preview_settings(); return false;" title="'.$lang['settings'].'"><span class="sprites settings"></span> '.$lang['srv_uredniske_nastavitve'].'</a>';
+ echo '</span>'; // tooltip */
+
+ // TESTIRANJE
+ echo '<h2>'.$lang['srv_diagnostika_testiranje'].'</h2>';
+
+ echo '<p class="bottom16">'.$lang['srv_diagnostika_testiranje_notea'].'<a href="index.php?anketa=' . $this->sid . '&a=testiranje&m=testnipodatki">'.$lang['srv_diagnostika_testiranje_noteb'].'</a>'.$lang['srv_diagnostika_testiranje_notec'].'</p>';
+
+ echo '<div class="button_holder">';
+ echo ' <div class="input_box">';
+ echo ' <span class="faicon link-chain link-right blue"></span>';
+ echo ' <input type="text" onClick="this.select();" value="'.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'" readonly/>';
+ echo ' </div>';
+ echo ' <button type="button" class="medium blue" onclick="CopyToClipboard(\''.SurveyInfo::getSurveyLink().'&preview=on&testdata=on'.$preview_options.'\'); actionNotePopup(\'link_copied\', \'success\');">'.$lang['srv_diagnostika_testiranje_copy'].'</button>';
echo '</div>';
+
+ //Nastavitve testnega vnosa - popup
+ echo '<p class="top16"><a href="' .$site_url . '/admin/survey/index.php?anketa=' . $this->sid . '&a=urejanje" title="' . $lang['srv_uredniske_nastavitve'] . '">'. $lang['srv_uredniske_nastavitve'] .'</a></p>';
- if ( isset($_GET['popup']) && $_GET['popup'] == 'open' ) {
- ?><script> $(function() { $('#popup-open').click(); }); </script><?php
- }
-
- echo '<br/>';
+ // DIAGNOSTIKA
+
# predviden čas ankete
list($total,$skupni_cas) = $this->time;
@@ -190,404 +193,384 @@ class SurveyDiagnostics
if ($total < 120) { # 2min
$time = $lang['srv_diagnostic_time_1'];
+ $time_chart = 20;
} else if ($total < 300) { # 5min
$time = $lang['srv_diagnostic_time_2'];
+ $time_chart = 40;
} else if ($total < 900) { # 15 min
$time = $lang['srv_diagnostic_time_3'];
+ $time_chart = 60;
} else if ($total < 1800) { # 30 min
$time = $lang['srv_diagnostic_time_4'];
+ $time_chart = 80;
} else { #> 30 min
$time = $lang['srv_diagnostic_time_5'];
+ $time_chart = 100;
}
-
+ $excess = 100 - $time_chart;
+ $display_length = "'[".$time_chart.",".$excess."]'"; //array za chart
+
# Kompleksnost
if ((int)($this->cnt_blocks + $this->cnt_conditions) == 0) {
$kompleksnost = $lang['srv_diagnostic_complexity_1'];
+ $complex_chart = 20;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) == 1) {
$kompleksnost = $lang['srv_diagnostic_complexity_2'];
+ $complex_chart = 40;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) < 10) {
$kompleksnost = $lang['srv_diagnostic_complexity_3'];
+ $complex_chart = 60;
} else if ((int)($this->cnt_blocks + $this->cnt_conditions) < 50) {
$kompleksnost = $lang['srv_diagnostic_complexity_4'];
+ $complex_chart = 80;
} else {
$kompleksnost = $lang['srv_diagnostic_complexity_5'];
+ $complex_chart = 100;
}
-
- #OPOZORILA
- echo '<div class="floatLeft">';
- echo '<div id="srv_diagnostic_results" >';
+ $excess = 100 - $complex_chart;
+ $display_complex = "'[".$complex_chart.",".$excess."]'"; //array za chart
+
+ echo '<h2>'.$lang['srv_testiranje_diagnostika'].'</h2>';
+
echo '<table class="srv_diagnostic_results">';
echo '<tr>';
echo '<th>'.$lang['srv_diagnostika_table_title1'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<th class="center">'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<th class="center">'.$lang['srv_diagnostika_table_title2'].'</th>';
echo '</tr>';
- #Preveč ali premalo opomnikov (reminder).
-
+
#Napake - v IFih, Zankah
+
+ //Link - kako odkriti logične in tehnične napake
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank"';
+
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_1'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_CONDITIONS,$this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
+ $color_status = 'notok';
+ $msg_status = $lang['srv_diagnostic_neustreza'];
}
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
#Napake - v validacijah
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_3'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_VALIDATIONS, $this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
+ $color_status = 'notok';
+ $msg_status = $lang['srv_diagnostic_neustreza'];
}
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'">'.$msg_status.'</div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
- #napake - Podovojenost imen varianel
+ #napake - Podovojenost imen variabel
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_5_element_2'].'</td>';
- echo '<td>';
if (in_array(DIAG_INVALID_VARIABLENAMES,$this->diagnostic_note)) {
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_neustreza1'].'</a>';
- echo '</span>';
- echo '<span>&nbsp;';
- echo '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1" title="'.$lang['srv_check_pogoji'].'"><span class="faicon bug"></span></a> '."\n";
- echo '</span>';
- }
+ $color_status = 'notok';
+ $msg_status = '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1" title="'.$lang['srv_check_pogoji'].'">'.$lang['srv_diagnostic_neustreza'].'</a>';
+ $link_status = 'href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&checkDuplicate=1"';
+ }
else {
- echo '<span class="green">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/kako-odkriti-logicne-tehnicne-napake-vprasalniku?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- else
- echo '<a href="https://www.1ka.si/d/en/help/faq/how-do-i-detect-logical-and-technical-errors-the-questionnaire?from1ka=1" target="_blank">'.$lang['srv_diagnostic_ustreza'].'</a>';
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = '<a class="noline" '.$link_status.' >'.$lang['srv_diagnostic_ustreza'].'<a/>';
}
- echo '</td>';
- echo '</tr>';
-
- echo '</table>';
- echo '</div>';
- echo '<br/><br/>';
-
- echo '<div id="srv_diagnostic_results" >';
- echo '<table class="srv_diagnostic_results">';
-# echo '<COLGROUP><COL width="50%"><COL><COL><COLGROUP>';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title2'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'">'.$msg_status.'</div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
-
+
+ #OPOZORILA
# Preveč podvprašanj na eni strani.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank"';
if (in_array(DIAG_SPR_ON_PAGE,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
- echo '</td>';
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
# Preveč vprašanj v bloku.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_2'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/premajhna-strukturiranost-vprasalnika?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/premajhna-strukturiranost-vprasalnika?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/insufficiently-structured-questionnaire?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/insufficiently-structured-questionnaire?from1ka=1" target="_blank"';
if (in_array(DIAG_SPR_IN_BLOCK,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
- echo '</td>';
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
# Preveč podpvprašanj v multigridu
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_1_element_3'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-podvprasanj-bloku-prevec-vprasanj-na-eni-strani?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-subquestions-block-and-too-many-questions-on-one-page?from1ka=1" target="_blank"';
if (in_array(DIAG_SUB_Q_IN_GRID,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
}
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</td>';
echo '</tr>';
#Začetek ankete z neprimernimi vprašanji.
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/zacetek-ankete-z-neprimernimi-vprasanji?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/zacetek-ankete-z-neprimernimi-vprasanji?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/beginning-the-survey-with-inappropriate-questions?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/beginning-the-survey-with-inappropriate-questions?from1ka=1" target="_blank"';
if (in_array(DIAG_UNAPROPRIATE_START,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza2']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
}
- echo '</td>';
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
+
# predolga anketa - opozorilo
if (in_array(DIAG_TIME_HARD_LIMIT,$this->diagnostic_note)) {
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_2'].'</td>';
- echo '<td>';
- echo '<span class="red">';
-
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
- else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
- echo $lang['srv_diagnostic_neustreza'];
- echo '</a>';
- echo '</span>';
- echo '</td>';
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
+
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
}
- echo '</table>';
- echo '</div>';
-
+
# PRIPOROČILA
- echo '<br/><br/>';
- echo '<div id="srv_diagnostic_results" >';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title3'].'</th>';
- echo '<th>'.$lang['srv_diagnostika_table_title'].'</th>';
- echo '</tr>';
- #Preveč ali premalo opomnikov (reminder).
+ #Preveč ali premalo opomnikov (reminder) - 2 vrstici
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_3_element_1'].'</td>';
- echo '<td>';
if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank"';
else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank">%s</a>';
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank"';
if (in_array(DIAG_REMINDER_ON_IF,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
- }
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_3_element_2'].'</td>';
- echo '<td>';
-
- if($lang['id'] == '1')
- $link = '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/prevec-ali-premalo-opomnikov?from1ka=1" target="_blank">%s</a>';
- else
- $link = '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/too-many-or-too-few-reminders?from1ka=1" target="_blank">%s</a>';
if (in_array(DIAG_REMINDER_ON_MGRID,$this->diagnostic_note)) {
- echo '<span class="red">';
- printf($link,$lang['srv_diagnostic_neustreza']);
- echo '</span>';
- } else {
- echo '<span class="green">';
- printf($link,$lang['srv_diagnostic_ustreza']);
- echo '</span>';
- }
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+ }
+ else {
+ $color_status = 'ok';
+ $msg_status = $lang['srv_diagnostic_ustreza'];
+ }
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline '.$color_status.' faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
+
# predolga naketa - priporočilo
if (in_array(DIAG_TIME_SOFT_LIMIT,$this->diagnostic_note)) {
echo '<tr>';
echo '<td>'.$lang['srv_diagnostic_2_element_2'].'</td>';
- echo '<td>';
- echo '<span class="red">';
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
- else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
+ if($lang['id'] == '1')
+ $link_status = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
+ else
+ $link_status = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
- echo $lang['srv_diagnostic_neustreza'];
- echo '</a>';
- echo '</span>';
- echo '</td>';
+ $color_status = 'rec';
+ $msg_status = $lang['srv_diagnostic_rec'];
+
+ echo '<td class="center"><div class="status_wrapper"><div class="status '.$color_status.'"><a class="noline" '.$link_status.'>'.$msg_status.'</a></div></div></td>';
+ echo '<td class="center"><a class="noline faicon open_icon" '.$link_status.'></a></td>';
echo '</tr>';
}
- echo '</table>';
- echo '</div>';
- echo '</div>';
-
- # Trajanje - linki
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_info_duration'].'</th>';
- echo '<th></th>';
- echo '<th></th>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_testiranje_predvidenicas'].'</td>';
- echo '<td>'.$skupni_cas.'</td>';
- echo '<td><a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m=predvidenicas" title="'.$lang['srv_testiranje_predvidenicas'].'">'.$lang['details'].'</a></td>';
- echo '</tr>';
+ echo '</table>';
+
+ // LASTNOSTI ANKETE
+ echo '<h2>'.$lang['srv_testiranje_diagnostika_lastnosti'].'</h2>';
+
+ echo '<div class="lastnosti_wrapper">';
+
+ echo '<div class="lastnosti_left">';
+
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_neto_v_cas'].'</div>';
+
+ // Dejansko trajanje
$sas = new SurveyAdminSettings();
$dejanski_cas = ($sas->testiranje_cas(1) == null) ? '-' : $sas->testiranje_cas(1);
- echo '<tr>';
- echo '<td>'.$lang['srv_testiranje_cas'].'</td>';
- echo '<td>'.$dejanski_cas.'</td>';
- echo '<td><a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m='.M_TESTIRANJE_CAS.'" title="'.$lang['srv_testiranje_cas'].'">'.$lang['details'].'</a></td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- echo '<br /><br />';
-
-
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostika_table_title4'].'</th>';
- echo '<th colspan="2">'.$lang['srv_diagnostika_table_title'].'</th>';
- echo '</tr>';
- /*echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_0'].'</td>';
- echo '<td colspan="2">'.$skupni_cas.'</td>';
- echo '</tr>';*/
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_5'].'</td>';
+ echo '<p class="time">'.$dejanski_cas.'</p>';
+ if ($sas->testiranje_cas(1) == null)
+ echo $lang['srv_data_no_data'];
+ else
+ echo '<a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m='.M_TESTIRANJE_CAS.'">'.$lang['srv_testiranje_cas_info'].'</a>';
+ echo '</div>'; #box
- echo '<td colspan="2">';
+ //Ocena trajanja
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_testiranje_predvidenicas'].'</div>';
+ echo '<p class="time">'.$skupni_cas.'</p>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&amp;a='.A_TESTIRANJE.'&amp;m=predvidenicas">'.$lang['srv_testiranje_predvidenicas_info'].'</a>';
+ echo '</div>'; #box
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank">';
+ echo '</div>'; #lastnosti_left
+
+ echo '<div class="lastnosti_middle">';
+ // Dolžina ankete
+ if($lang['id'] == '1')
+ $link_time = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kako-dolga-naj-bo-moja-anketa?from1ka=1" target="_blank"';
else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank">';
+ $link_time = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/how-long-should-my-survey-be?from1ka=1" target="_blank"';
+
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_diagnostic_1_element_5'].'</div>';
+
+ echo '<div class="diagnostic_graph">';
+
+ echo '<div class="circle">';
+ echo '<canvas id="survey_length"></canvas>';
+ echo '</div>';
+ echo '<script type="text/javascript"> diagnosticsChart(\'survey_length\','.$display_length.'); </script>';
+
+ echo '<div class="other_text">';
+ echo '<p class="desc">'.$time.'</p>';
+ echo '<a '.$link_time.'>'.$lang['srv_diagnostic_time_extra'].'</a>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; #box
- echo $time;
- echo '</a>';
-# echo Help::display('srv_diag_time').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_9'].'</td>';
- echo '<td colspan="2">'.(int)SurveyInfo::getSurveyGroupCount().'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_5'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_spremenljivka.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_5a'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_hidden.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_8'].'</td>';
- echo '<td colspan="2">'.(int)SurveyInfo::getSurveyVariableCount().'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_2'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_conditions.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_3'].'</td>';
- echo '<td colspan="2">'.(int)$this->cnt_blocks.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_4'].'</td>';
- echo '<td colspan="2">'.(int)$this->globina.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_1_element_4'].'</td>';
- echo '<td colspan="2">';
-
- if($lang['id'] == '1')
- echo '<a href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kaj-pomeni-kompleksnost-ankete?from1ka=1" target="_blank">';
+ // Kompleksnost ankete
+ if($lang['id'] == '1')
+ $link_complex = 'href="https://www.1ka.si/d/sl/spletne-ankete/osnovna-priporocila/kaj-pomeni-kompleksnost-ankete?from1ka=1" target="_blank"';
else
- echo '<a href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/what-does-survey-complexity-mean?from1ka=1" target="_blank">';
-
- echo $kompleksnost;
- echo '</a>';
- #echo Help::display('srv_diag_complexity').'</td>';
- echo '</tr>';
+ $link_complex = 'href="https://www.1ka.si/d/en/web-surveys/basic-recommendations/what-does-survey-complexity-mean?from1ka=1" target="_blank"';
- echo '</table>';
+ echo '<div class="box">';
+ echo '<div class="title">'.$lang['srv_diagnostic_1_element_4'].'</div>';
+ echo '<div class="diagnostic_graph">';
+
+ echo '<div class="circle">';
+ echo '<canvas id="survey_complex"></canvas>';
echo '</div>';
- echo '<br /><br />';
+ echo '<script type="text/javascript"> diagnosticsChart(\'survey_complex\','.$display_complex.'); </script>';
+ echo '<div class="other_text">';
+ echo '<p class="desc">'.$kompleksnost.'</p>';
+ echo '<a '.$link_complex.'>'.$lang['srv_diagnostic_complexity_extra'].'</a>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>'; #box
+ echo '</div>'; #lastnosti_middle
+
+ //Ostale lastnosti ankete
+ echo '<div class="lastnosti_right">';
+
+ echo '<div class="box">';
+ echo '<div class="vertical_section">';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_9'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_5'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_5a'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_8'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_2'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_3'].':</div>';
+ echo '<div class="item">'.$lang['srv_diagnostic_4_element_4'].':</div>';
+ echo '</div>';
+ echo '<div class="vertical_section second">';
+ echo '<div class="item">'.(int)SurveyInfo::getSurveyGroupCount() . ' ' . ((int)SurveyInfo::getSurveyGroupCount() == 1 ? $lang['page']: $lang['srv_diagnostics_strani']).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_spremenljivka . ' ' . ((int)$this->cnt_spremenljivka == 1 ? $lang['srv_casi_po_vprasanjih_vprasanje'] : ((int)$this->cnt_spremenljivka == 2 ? $lang['srv_info_questions2'] : ((int)$this->cnt_spremenljivka > 4 || (int)$this->cnt_spremenljivka == 0 ? $lang['srv_info_questions1'] : $lang['srv_info_questions3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_hidden . ' '. ((int)$this->cnt_hidden == 1 ? $lang['srv_hidden_text'] : ((int)$this->cnt_hidden == 2 ? $lang['srv_hidden_text2'] : ((int)$this->cnt_hidden > 4 || (int)$this->cnt_hidden == 0 ? $lang['srv_hidden_text4'] : $lang['srv_hidden_text3']) )). ' ' . ((int)$this->cnt_hidden == 1 ? $lang['srv_casi_po_vprasanjih_vprasanje'] : ((int)$this->cnt_hidden == 2 ? $lang['srv_info_questions2'] : ((int)$this->cnt_hidden > 4 || (int)$this->cnt_hidden == 0 ? $lang['srv_info_questions1'] : $lang['srv_info_questions3']) )).'</div>';
+ echo '<div class="item">'.(int)SurveyInfo::getSurveyVariableCount() . ' ' . ((int)SurveyInfo::getSurveyVariableCount() == 1 ? $lang['srv_spremenljivka'] : ((int)SurveyInfo::getSurveyVariableCount() == 2 ? $lang['srv_spremenljivka2'] : ((int)SurveyInfo::getSurveyVariableCount() > 4 || (int)SurveyInfo::getSurveyVariableCount() == 0 ? $lang['srv_spremenljivka4'] : $lang['srv_spremenljivka3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_conditions . ' ' . ((int)$this->cnt_conditions == 1 ? $lang['srv_pogoj'] : ((int)$this->cnt_conditions == 2 ? $lang['srv_pogoj2'] : ((int)$this->cnt_conditions > 4 || (int)$this->cnt_conditions == 0 ? $lang['srv_pogoj4'] : $lang['srv_pogoj3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->cnt_blocks . ' ' . ((int)$this->cnt_blocks == 1 ? $lang['srv_blok'] : ((int)$this->cnt_blocks == 2 ? $lang['srv_blok2'] : ((int)$this->cnt_blocks > 4 || (int)$this->cnt_blocks == 0 ? $lang['srv_blok4'] : $lang['srv_blok3']) )).'</div>';
+ echo '<div class="item">'.(int)$this->globina.'</div>';
+ echo '</div>';
+ echo '</div>'; #box
+
+ echo '</div>'; #lastnosti_right
+
+ echo '</div>'; #lastnosti_wrapper
+
+
+ // KOMENATRJI
# nerazrešeni komentarji uporabnikov $commentsUser,$commentsUserFinished
$commentsUserUnresolved = $commentsUser - $commentsUserFinished;
if (( (int)$commentsAll
@@ -597,39 +580,53 @@ class SurveyDiagnostics
+(int)$commentsUser
+(int)$commentsUserFinished
) > 0 ) {
- echo '<div id="srv_diagnostic_results_right">';
- echo '<table class="srv_diagnostic_results">';
- echo '<tr>';
- echo '<th>'.$lang['srv_diagnostic_4_element_0'].'</th>';
- echo '<th>'.$lang['srv_diagnostic_unresolved'].'</th>';
- echo '<th>'.$lang['srv_diagnostic_all'].'</th>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_1'].'</td>';
- echo '<td>'.(int)$commentsUnresolved.'</td>';
- echo '<td>'.(int)$commentsAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_1a'].'</td>';
- echo '<td>'.(int)$commentsUserSurveyUnresolved.'</td>';
- echo '<td>'.(int)$commentsUserSurveyAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_6'].'</td>';
- echo '<td>'.(int)$commentsQuestionUnresolved.'</td>';
- echo '<td>'.(int)$commentsQuestionAll.'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_diagnostic_4_element_7'].'</td>';
- echo '<td>'.(int)$commentsUserUnresolved.'</td>';
- echo '<td>'.(int)$commentsUser.'</td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- }
-
+
+ echo '<h2>'.$lang['srv_diagnostic_4_element_0'].'</h2>';
+
+ echo '<div class="komentarji_wrapper">';
+
+ echo '<div class="komentarji_left">';
+ echo '<div class="title">'.$lang['srv_testiranje_komentarji_anketa'].'</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_admin_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUnresolved.'/'.(int)$commentsAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_repondent_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUserSurveyUnresolved.'/'.(int)$commentsUserSurveyAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ $b = new Branching($this->anketa['id']);
+
+ $id = $b->anketa;
+
+ echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$id.'&a=komentarji_anketa">'.$lang['srv_testiranje_komentarji_anketa_link'].'</a>';
+
+ echo '</div>'; #komentarji_left
+
+
+ echo '<div class="komentarji_right">';
+ echo '<div class="title">'.$lang['srv_testiranje_komentarji_title'].'</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_admin_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsQuestionUnresolved.'/'.(int)$commentsQuestionAll.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<div class="comment_count">';
+ echo '<div>'.$lang['srv_repondent_comment2'].'</div>';
+ echo '<div><span class="semi-bold">'.(int)$commentsUserUnresolved.'/'.(int)$commentsUser.'</span> '.$lang['srv_inv_archive_comment2'].'</div>';
+ echo '</div>';
+
+ echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$id.'&a=komentarji">'.$lang['srv_testiranje_komentarji_title_link'].'</a>';
+
+ echo '</div>'; #komentarji_right
+
+ echo '</div>'; #komentarji_wrapper
+ }
- echo '<br /><br />';
echo '</div>'; # id="srv_diagnostic"
}
@@ -700,7 +697,8 @@ class SurveyDiagnostics
# vsako spremenljivko preverimo samo 1x :)
if ( !in_array(DIAG_REMINDER_ON_IF,$this->diagnostic_note)
&& !isset($_spr_reminders[$row_condition_spr['spr_id']])) {
- if ((int)$this->spremenljivke[$row_condition_spr['spr_id']]['reminder'] == 0) {
+
+ if (!isset($this->spremenljivke[$row_condition_spr['spr_id']]['reminder']) || (int)$this->spremenljivke[$row_condition_spr['spr_id']]['reminder'] == 0) {
$this->diagnostic_note[] = DIAG_REMINDER_ON_IF;
}
@@ -769,7 +767,7 @@ class SurveyDiagnostics
$sas = new SurveyAdminSettings();
$total = $sas->testiranje_predvidenicas(2);
$this->time = array( $total,
- (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'min ':'').''.round(bcmod($total, 60), 0).'s'
+ (bcdiv($total, 60, 0)>0?bcdiv($total, 60, 0).'<span class="time_text">min</span> ':'').''.round(bcmod($total, 60), 0).'<span class="time_text">s</span>'
);
if ($total >= TIME_SOFT_LIMIT) {
@@ -782,8 +780,10 @@ class SurveyDiagnostics
}
function testComments() {
+
$spr_id=array();
$threads=array();
+
if ( is_array($this->spremenljivke) && count($this->spremenljivke) > 0 ) {
foreach ($this->spremenljivke as $id=>$value) {
$spr_id[] = $id;
@@ -792,9 +792,20 @@ class SurveyDiagnostics
}
}
}
+
+ $rowqr = 0;
+ $rowqrf = 0;
+ $rowta = 0;
+ $rowtu = 0;
+ $rowtar = 0;
+ $rowtur = 0;
+
+ $rowtqa = 0;
+ $rowtqu = 0;
+
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)
@@ -804,7 +815,7 @@ class SurveyDiagnostics
#končani komentarji respondentov
#text2 = 2 => končan
- #text2 = 3 => nerelevantno
+ #text2 = 3 => nerelevantno
$strqrf = "SELECT count(*) FROM srv_data_text".$db_table." WHERE spr_id=0 AND vre_id IN (".implode(',',$spr_id).") AND text2 IN (2,3)";
$sqlqrf = sisplet_query($strqrf);
list($rowqrf) = mysqli_fetch_row($sqlqrf);
@@ -814,23 +825,21 @@ class SurveyDiagnostics
$sqlta = sisplet_query($strta);
list($rowta) = mysqli_fetch_row($sqlta);
- # nerešeni komentarji: only_unresolved => ocena <= 1
+ # nerešeni komentarji: only_unresolved => ocena <= 1
$strtu = "SELECT count(*) FROM post WHERE tid='".$this->surveyInfo['thread']."' AND parent > 0 AND ocena <= 1 ";
$sqltu = sisplet_query($strtu);
list($rowtu) = mysqli_fetch_row($sqltu);
- # vsi komentarji na anketo respondentov
+ # vsi komentarji na anketo respondentov
$strtar = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->sid."'";
$sqltar = sisplet_query($strtar);
list($rowtar) = mysqli_fetch_row($sqltar);
- # nerešeni komentarji respondentov na anketo: only_unresolved => ocena <= 1
+ # nerešeni komentarji respondentov na anketo: only_unresolved => ocena <= 1
$strtur = "SELECT count(*) FROM srv_comment_resp WHERE ank_id='".$this->sid."' AND ocena <= 1 ";
$sqltur = sisplet_query($strtur);
list($rowtur) = mysqli_fetch_row($sqltur);
- $rowtqa = 0;
- $rowtqu = 0;
# preštejemo
if (count($threads) > 0) {
# vsi komentarji na anketo
@@ -842,10 +851,11 @@ class SurveyDiagnostics
$strtu = "SELECT count(*) FROM post WHERE tid IN (".implode(',',$threads).") AND parent > 0 AND ocena <= 1 ";
$sqltu = sisplet_query($strtu);
list($rowtqu) = mysqli_fetch_row($sqltu);
-
}
}
+
$this->comments = array($rowta,$rowtu,$rowtqa,$rowtqu,$rowqr,$rowqrf,$rowtar,$rowtur);
+
return $this->comments;
}
@@ -890,7 +900,7 @@ class SurveyDiagnostics
}
function countHidden() {
- if (count($this->spremenljivke) > 0) {
+ if (is_countable($this->spremenljivke) && count($this->spremenljivke) > 0) {
foreach ($this->spremenljivke as $spremenljivka) {
if ((int)$spremenljivka['visible'] == 0) {
$this->cnt_hidden++;
diff --git a/admin/survey/classes/class.SurveyExport.php b/admin/survey/classes/class.SurveyExport.php
index 89133dc..893c1c3 100644
--- a/admin/survey/classes/class.SurveyExport.php
+++ b/admin/survey/classes/class.SurveyExport.php
@@ -11,12 +11,16 @@
*
*/
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\IOFactory;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+
DEFINE (NEW_LINE, "\n");
DEFINE (TMP_EXT, '.tmp');
DEFINE (STR_DLMT, '|');
DEFINE (DAT_EXT, '.dat');
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if (!defined('EXPORT_FOLDER')) define("EXPORT_FOLDER", "admin/survey/SurveyData");
class SurveyExport
{
@@ -47,7 +51,7 @@ class SurveyExport
private $_EXPORT_EXCEL_HEAD = true; # ali izvažamo header za excel
private $_EXPORT_EXCEL_REPLACE = array(); # ali izvažamo zamenjave za excel
- private $_SPECIAL_EXPORT = false; # samo za posebne primere kadar "moramo" izpisovati skrite sistemske variable (preko get se pošlje special_export=true
+ //private $_SPECIAL_EXPORT = false; # samo za posebne primere kadar "moramo" izpisovati skrite sistemske variable (preko get se pošlje special_export=true
private $_HEADERS = array(); # array z header podatki
@@ -87,8 +91,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();
@@ -112,14 +115,6 @@ class SurveyExport
# za profil časov
SurveyTimeProfiles :: Init($this->sid, $global_user_id);
-
- $result = sisplet_query ("SELECT value FROM misc WHERE what='SurveyExport'");
- list ($SurveyExport) = mysqli_fetch_row ($result);
- $adminTypes = array(0=>$lang['forum_admin'],1=>$lang['forum_manager'],2=>$lang['forum_clan'],3=>$lang['forum_registered'] );
-
- if ($SurveyExport<$admin_type) {
- die ($lang['srv_export_no_access'].$adminTypes[$admin_type]);
- }
# manjkajoče vrednosti
$this->SMV = new SurveyMissingValues($this->sid);
@@ -145,14 +140,14 @@ class SurveyExport
self::exportSpss();
break;
case 'excel':
- self::exportExcel();
+ self::exportCSV();
break;
case 'excel_xls':
self::exportExcelXls();
break;
- case 'txt':
+ /* case 'txt':
self::exportText();
- break;
+ break; */
}
}
@@ -160,30 +155,47 @@ class SurveyExport
*
*/
private function setUpFilter() {
+ global $global_user_id;
if ($this->_fileStatus >= 0) {
+ $filter_testdata = null;
+
$this->_HEADERS = unserialize(file_get_contents($this->_headFileName));
-
+
$this->exportSettings = array();
- foreach ($_SESSION AS $pkey => $pvalue)
+ //mislim, da se to ne porablja vec - smo sli iz seje v nastavitev na anketo
+ foreach ($_SESSION AS $pkey => $pvalue)
{
// if starts with export
if (!strncmp($pkey, "export", strlen("export")))
{
#ali iz seje ali preko requesta
$this->exportSettings[ltrim($pkey, "{export}")] = $pvalue
- || $_REQUEST[lcfirst($pvalue)];
+ || (isset($_REQUEST[lcfirst($pvalue)]) ? $_REQUEST[lcfirst($pvalue)] : null);
}
}
+
+ //pridobi nastavitve za export ankete
+ //kateri podatki so v export se sedaj veze na naketo (0-onlydata, 1-data in paradata, 2-identifikatorji)
+ $sql_export_mode = sisplet_query("SELECT value FROM srv_user_setting_for_survey
+ WHERE sid = '" . $this->sid . "' AND what='default_export_data_mode' AND uid='$global_user_id'");
+ $export_mode = 0;
+ if($sql_export_mode){
+ $export_mode = mysqli_fetch_assoc($sql_export_mode);
+ $export_mode = isset($export_mode['value']) ? $export_mode['value'] : 0;
+ }
+
+ $this->exportSettings['export_data'] = $export_mode;
- $this->_EXPORT_HIDDEN_SYSTEM = ($this->exportSettings['HiddenSystem']) ? true : false;
- $this->_EXPORT_HIDDEN_SYSTEM = ((int)$_REQUEST['hiddenSystem'] == 1 || $_REQUEST['hiddenSystem'] == 'true') ? true : $this->_EXPORT_HIDDEN_SYSTEM;
+ $this->_EXPORT_HIDDEN_SYSTEM = ($this->exportSettings['export_data'] == 2);
+ //$this->_EXPORT_HIDDEN_SYSTEM = (isset($_REQUEST['hiddenSystem']) && ((int)$_REQUEST['hiddenSystem'] == 1 || $_REQUEST['hiddenSystem'] == 'true')) ? true : $this->_EXPORT_HIDDEN_SYSTEM;
- $this->_EXPORT_FULL_META = ($this->exportSettings['FullMeta'] || !$this->_EXPORT_HIDDEN_SYSTEM) ? true : false;
- $this->_EXPORT_ONLY_DATA = ($this->exportSettings['OnlyData'] || !$this->_EXPORT_HIDDEN_SYSTEM) ? true : false;
+ $this->_EXPORT_FULL_META = (($this->exportSettings['export_data'] == 1)/* && !$this->_EXPORT_HIDDEN_SYSTEM */);
+ $this->_EXPORT_ONLY_DATA = (($this->exportSettings['export_data'] == 0)/* && !$this->_EXPORT_HIDDEN_SYSTEM */);
- $this->_SPECIAL_EXPORT = ($_REQUEST['special_export'] == 'true') ? true : false;
+ //nikjer v kodi nisem nasel 'special_export'
+ //$this->_SPECIAL_EXPORT = (isset($_REQUEST['special_export']) && $_REQUEST['special_export'] == 'true') ? true : false;
# filtriranje po statusih
$this->_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
@@ -197,6 +209,8 @@ class SurveyExport
# filtriranje po časih
$_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
+ $filter_usability = null;
+
# ali imamo filter na uporabnost
if (isset($this->_HEADERS['usability']['variables'][0]['sequence']) && (int)$this->_HEADERS['usability']['variables'][0]['sequence'] > 0) {
$usability_data_sequence = $this->_HEADERS['usability']['variables'][0]['sequence'];
@@ -233,8 +247,8 @@ class SurveyExport
# ne prikazujemo user-idja
$not_svp_pv['uid'] = 'uid';
- # ne prikazujemo recnumberja
- //$not_svp_pv['recnum'] = 'recnum';
+ # ne prikazujemo casa klik na nagovor
+ $not_svp_pv['unx_ins_date'] = 'unx_ins_date';
# ne prikazujemo meta podatkov
if ($this->_EXPORT_FULL_META == false) {
@@ -253,16 +267,16 @@ class SurveyExport
foreach ($this->_HEADERS AS $spid => $spremenljivka) {
# privzeto spremenljivke ne prikazujemo
$_can_show = false;
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : null;
# če spremenljivka ni v neprikazanih jo prikažemo
if (!in_array($spid, $not_svp_pv)) {
# če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
# potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
- if ($this->_EXPORT_HIDDEN_SYSTEM == true && $spremenljivka['hide_system'] == '1' || $this->_SPECIAL_EXPORT == true) {
+ if ($this->_EXPORT_HIDDEN_SYSTEM == true && isset($spremenljivka['hide_system']) && $spremenljivka['hide_system'] == '1' /* || $this->_SPECIAL_EXPORT == true */) {
# prikazujemo sistemske, in spremenljivka je sistemska
$_can_show = true;
} else
- if ( $this->_EXPORT_HIDDEN_SYSTEM == false && $spremenljivka['hide_system'] !== '1' ) {
+ if ($this->_EXPORT_HIDDEN_SYSTEM == false && (!isset($spremenljivka['hide_system']) || $spremenljivka['hide_system'] !== '1' )) {
# prikazujemo nesistemske, in spremenljivka ni sistemska
$_can_show = true;
}
@@ -281,15 +295,13 @@ class SurveyExport
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- if (($tip !== 'sm' && $tip !== 'm') || $this->exportSettings['FullMeta'] > 0) {
+ if (($tip !== 'sm' && $tip !== 'm') || ($this->exportSettings['export_data'] == 1)) {
$_tmp_filter[]= $variable['sequence'];
}
}
}
}
}
-
- $spr_cont++;
}
}
}
@@ -317,12 +329,218 @@ class SurveyExport
echo 'Error! Empty file name!';
}
}
+
+ // Print data into active sheet
+ public function printSheetData($sheet, $data, $top_left = 'A1')
+ {
+ // Sample data
+ $sheet->fromArray(
+ $data, // The data to set
+ NULL, // Array values with this value will not be set
+ $top_left // Top left coordinate of the worksheet range where
+ );
+ }
- /** naredimo izvoz za excel - xls
+ /** naredimo izvoz za excel - xls
*
*/
function exportExcelXls() {
- global $site_path;
+ global $site_path, $lang;
+
+ $folder = $site_path . EXPORT_FOLDER.'/';
+
+ if ($this->_fileStatus >= 0 && $this->_dataFileName !== null && $this->_dataFileName !== '' && $this->_headFileName !== null && $this->_headFileName !== '') {
+
+ //za labele
+ $var_labels = array();
+ $missing_values = array();
+ $missing_values['-1'] = $lang['srv_bottom_data_legend_note_li1a'];
+ $missing_values['-2'] = $lang['srv_bottom_data_legend_note_li2a'];
+ $missing_values['-3'] = $lang['srv_bottom_data_legend_note_li3a'];
+ $missing_values['-4'] = $lang['srv_bottom_data_legend_note_li4a'];
+ $missing_values['-5'] = $lang['srv_bottom_data_legend_note_li5a'];
+ $missing_values['-97'] = $lang['srv_other_97'];
+ $missing_values['-98'] = $lang['srv_other_98'];
+ $missing_values['-99'] = $lang['srv_other_99'];
+
+ $data_table = array();
+
+ $spreadsheet = new Spreadsheet();
+ // Zavihek strani
+ $sheet = $spreadsheet->getActiveSheet();
+ $sheet->setTitle($lang['srv_podatki']);
+
+ $writer = new Xlsx($spreadsheet);
+
+ //stevec stolpcev po headerju
+ $stevec_headerja = 0;
+ # naredimo header row
+ foreach ($this->_HEADERS AS $spid => $spremenljivka) {
+ if (isset($this->_SVP_PV[$spid])) {
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || ($this->exportSettings['export_data'] == 1)){
+ $data_table[0][] = strip_tags($variable['variable']);
+ $data_table[1][] = strip_tags($variable['naslov']);
+ $data_table_labels[0][] = strip_tags($variable['variable']);
+ $data_table_labels[1][] = strip_tags($variable['naslov']);
+
+ //labele po stolpcih, da se jih kasneje zamenja
+ $var_labels[$stevec_headerja] = $missing_values;
+ //dodamo vrednosti custom missingov
+ if(isset($spremenljivka['missing_values']))
+ $var_labels[$stevec_headerja] = $spremenljivka['missing_values']+$var_labels[$stevec_headerja];
+
+ if( in_array($spremenljivka['tip'], array(1,6,3))){
+ //dodamo na mesto stolpca, kjer se bodo zamenjali podatki z labelami
+ $var_labels[$stevec_headerja] = $var_labels[$stevec_headerja]+$spremenljivka['options'];
+ }
+ elseif( in_array($spremenljivka['tip'], array(2,16))){
+ //dodamo na mesto stolpca, kjer se bodo zamenjali podatki z labelami
+ $var_labels[$stevec_headerja] = $var_labels[$stevec_headerja]+array("0"=>$lang['srv_checked_value_0'], "1"=>$lang['srv_checked_value_1']);
+ }
+
+ $stevec_headerja++;
+ }
+ }
+ }
+ }
+ }
+
+ # sfiltriramo podatke
+ exec ('awk -F'.$this->_QUOTE.STR_DLMT.$this->_QUOTE.' '.$this->_QUOTE.$this->_CURRENT_STATUS_FILTER.' {print $0}'.$this->_QUOTE.' '.$this->_dataFileName.' > '.$this->_dataFileName .'_data1'.TMP_EXT);
+ if (IS_WINDOWS) {
+ #filtri spremenljivk
+ $cmdLn1_1 = 'cut -d "|" -f '.$this->_VARIABLE_FILTER.' '.$this->_dataFileName .'_data1'.TMP_EXT.' > '.$this->_dataFileName .'_data1_1'.TMP_EXT;
+ } else {
+ #filtri spremenljivk
+ $cmdLn1_1 = 'cut -d \'|\' -f '.$this->_VARIABLE_FILTER.' '.$this->_dataFileName .'_data1'.TMP_EXT.' > '.$this->_dataFileName .'_data1_1'.TMP_EXT;
+ }
+ $out1_1 = shell_exec($cmdLn1_1);
+
+ //gremo cez podatke, zacnemo z vrstico 3 zaradi headerja
+ $line_num = 2;
+ $fileLines = file($this->_dataFileName .'_data1_1'.TMP_EXT, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+ foreach ($fileLines as $line) {
+ $line_arr = explode('|', $line);
+ foreach ($line_arr as $index=>$cell) {
+ //labele
+ if(in_array($index, array_keys($var_labels))){
+ $data_table_labels[$line_num][] = isset($var_labels[$index][$cell]) ? $var_labels[$index][$cell] : $cell;
+ $data_table[$line_num][] = $cell;
+ }
+ //grobi podatki
+ else{
+ $data_table_labels[$line_num][] = $cell;
+ $data_table[$line_num][] = $cell;
+ }
+ }
+ $line_num ++;
+ }
+
+ //sprintamo vse podatke (skupaj s header) v tabelo
+ $this->printSheetData($sheet, $data_table);
+
+ // Style table header
+ $range_header = $this->getRange(0, 2, 0, count($data_table[0])-1);
+
+ $style_header = array(
+ /* 'font' => array(
+ 'bold' => true
+ ),
+ 'alignment' => array(
+ 'center' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+ ),
+ 'borders' => array(
+ 'allBorders' => array('borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN),
+ ), */
+ 'fill' => array(
+ 'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
+ 'startColor' => [
+ 'argb' => 'FFF0F0F0',
+ ],
+ 'endColor' => [
+ 'argb' => 'FFF0F0F0',
+ ],
+ ),
+ );
+ //set style to header
+ $sheet->getStyle($range_header)->applyFromArray($style_header);
+ //freeze header
+ $sheet->freezePane('A3');
+
+ //SHEET Z LABELAMI
+ // Create a new sheet with
+ $secondSheet = new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet($spreadsheet, $lang['srv_dataIcons_labels']);
+ // Add the new sheet to the spreadsheet
+ $spreadsheet->addSheet($secondSheet);
+ //sprintamo vse podatke (skupaj s header) v tabelo
+ $this->printSheetData($secondSheet, $data_table_labels);
+ //set style to header
+ $secondSheet->getStyle($range_header)->applyFromArray($style_header);
+ //freeze header
+ $secondSheet->freezePane('A3');
+
+ $spreadsheet->setActiveSheetIndex(0);
+
+ $file_name_full = $this->_dataFileName . '.xlsx';
+
+ //shranimo datoteko
+ $writer->save($file_name_full);
+
+ // Set headers for file download
+ header('Content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+ header('Content-Disposition: attachment; filename="anketa' . $this->sid . '-' . date('Y-m-d') . '.xlsx"');
+ header('Pragma: public');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Content-Transfer-Encoding: binary');
+ header('Expires: 0');
+ ob_clean();
+ flush();
+
+ // Output file contents for download
+ readfile($file_name_full);
+
+ #pobrišemo vse tmp datoteke
+ foreach (glob($folder . 'export_data_'.$this->sid.'_*'.TMP_EXT) as $fileToDelete) {
+ unlink($fileToDelete);
+ }
+ unlink ($file_name_full);
+
+ } else {
+ echo '';
+ }
+
+ exit;
+ }
+
+ // Get range
+ private function getRange($row_start, $row_end, $col_start, $col_end)
+ {
+ $start_col_name = $this->getExcelColumn($col_start);
+ $end_col_name = $this->getExcelColumn($col_end);
+
+ $range = $start_col_name . $row_start . ':' . $end_col_name . $row_end;
+ return $range;
+ }
+
+ //get excel name of column based on number of column
+ private function getExcelColumn($col_number) {
+ $base = ord('A');
+ $letters = '';
+
+ while ($col_number >= 0) {
+ $letters = chr($col_number % 26 + $base) . $letters;
+ $col_number = (int)($col_number / 26) - 1;
+ }
+
+ return $letters;
+ }
+
+ /** naredimo izvoz za excel - xls (stara verzija s html zapisom)
+ *
+ */
+ function exportExcelXlsOld() {
global $site_path;
$folder = $site_path . EXPORT_FOLDER.'/';
@@ -342,7 +560,7 @@ class SurveyExport
foreach ($spremenljivka['grids'] AS $gid => $grid) {
foreach ($grid['variables'] AS $vid => $variable ){
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || ($this->exportSettings['export_data'] == 1)){
$output1 .= '<td>'.strip_tags($variable['variable']).'</td>';
$output2 .= '<td>'.strip_tags($variable['naslov']).'</td>';
}
@@ -434,35 +652,36 @@ class SurveyExport
exit;
}
- /** naredimo izvoz za excel
+ /** naredimo izvoz za csv
*
*/
- function exportExcel() {
+ function exportCSV() {
global $site_path;
$folder = $site_path . EXPORT_FOLDER.'/';
session_start();
if ($this->_fileStatus >= 0 && $this->_dataFileName !== null && $this->_headFileName !== null) {
+ $file_csv = ((int)$_POST['export_format'] == 1);
+ $extension = ($file_csv) ? '.csv' : '.txt';
+
if ($_POST['export_delimit'] == 0) {
$field_delimit = ';';
- $replace_what = $_POST['replace_what0'];
- $replace_with = $_POST['replace_with0'];
+ $replace_what = isset($_POST['replace_what0']) ? $_POST['replace_what0'] : array();
+ $replace_with = isset($_POST['replace_with0']) ? $_POST['replace_with0'] : array();
} else {
$field_delimit = ',';
- $replace_what = $_POST['replace_what1'];
- $replace_with = $_POST['replace_with1'];
+ $replace_what = isset($_POST['replace_what1']) ? $_POST['replace_what1'] : array();
+ $replace_with = isset($_POST['replace_with1']) ? $_POST['replace_with1'] : array();
}
#zapišemo v temp file
- $file_handler = fopen($this->_dataFileName.'.csv',"w");
+ $file_handler = fopen($this->_dataFileName.$extension,"w");
$output1 = '';
$output2 = '';
-
fclose($file_handler);
-
# sfiltriramo podatke
exec ('awk -F'.$this->_QUOTE.STR_DLMT.$this->_QUOTE.' '.$this->_QUOTE.$this->_CURRENT_STATUS_FILTER.' {print $0}'.$this->_QUOTE.' '.$this->_dataFileName.' > '.$this->_dataFileName .'_data1'.TMP_EXT);
@@ -484,13 +703,16 @@ class SurveyExport
exec('sed '.$this->_QUOTE .'s/'.$replace_what[$i].'/'.$replace_with[$i].'/g'.$this->_QUOTE .' '.$this->_dataFileName .'_data1_'.($i+1).TMP_EXT.' > '.$this->_dataFileName .'_data1_'.($i+2).TMP_EXT);
$_new_filename = '_data1_'.($i+2);
}
-
+
} else {
$_new_filename = '_data1_1';
}
# zamenjamo | z ;
- exec('sed '.$this->_QUOTE.'s/|/\x22'.$field_delimit.'=\x22/g'.$this->_QUOTE.' '.$this->_dataFileName .$_new_filename.TMP_EXT.' >> '.$this->_dataFileName.'.csv');
+ if($file_csv)
+ exec('sed '.$this->_QUOTE.'s/|/\x22'.$field_delimit.'=\x22/g'.$this->_QUOTE.' '.$this->_dataFileName .$_new_filename.TMP_EXT.' >> '.$this->_dataFileName.$extension);
+ else
+ exec('sed '.$this->_QUOTE.'s/|/'.$field_delimit.'/g'.$this->_QUOTE.' '.$this->_dataFileName .'_data1_1'.TMP_EXT.' >> '.$this->_dataFileName.$extension);
$convertType = 1; // kateri tip konvertiranja uporabimo
$convertTypes[1] = array('charSet' => 'windows-1250',
@@ -500,14 +722,14 @@ class SurveyExport
# izvedemo download
- if ($fd = fopen ($this->_dataFileName.'.csv', "r")) {
- $fsize = filesize($this->_dataFileName.'.csv');
- $path_parts = pathinfo($this->_dataFileName.'.csv');
+ if ($fd = fopen ($this->_dataFileName.$extension, "r")) {
+ $fsize = filesize($this->_dataFileName.$extension);
+ $path_parts = pathinfo($this->_dataFileName.$extension);
$ext = strtolower($path_parts["extension"]);
#ob_clean();
#header('Content-type: application/vnd.ms-excel; charset='.$convertTypes[$convertType]['charSet']);
header('Content-type: text/csv; charset='.$convertTypes[$convertType]['charSet']);
- header('Content-Disposition: attachment; filename="anketa'.$this->sid.'-'.date('Y-m-d').'.csv"');
+ header('Content-Disposition: attachment; filename="anketa'.$this->sid.'-'.date('Y-m-d').$extension.'"');
# ker iz zacasne datoteke preberemo samo podatke brez headerja (header izpisujemo posebej)
# ne moremo podati content-lenght. Razen če bi predhodno vsae zapisali v tmp datoteko in potem prebrali dolžino
# header('Content-length: '.$fsize);
@@ -521,14 +743,14 @@ class SurveyExport
echo $convertTypes[$convertType]['BOMchar'];
# naredimo header row
- if ((int)$_POST['export_labels'] == 1) {
+ if ((int)$_POST['export_headers'] == 1) {
foreach ($this->_HEADERS AS $spid => $spremenljivka) {
if (isset($this->_SVP_PV[$spid])) {
if (count($spremenljivka['grids']) > 0) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
foreach ($grid['variables'] AS $vid => $variable ){
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(($spremenljivka['tip'] !== 'sm' && ($spremenljivka['tip'] !== 'm') || $this->exportSettings['export_data'] == 1)){
$output1 .= str_replace($replace_what, $replace_with, strip_tags($variable['variable'])) . $field_delimit;
$output2 .= str_replace($replace_what, $replace_with, strip_tags($variable['naslov'])) . $field_delimit;
}
@@ -542,10 +764,10 @@ class SurveyExport
}
while ($line= fgets ($fd)) {
- echo '="';
+ if($file_csv) echo '="';
$line = str_replace(array("\r","\n"), array("",""), $line);
print ($line);
- print ('"');
+ if($file_csv) print ('"');
print ("\r\n");
}
}
@@ -558,7 +780,7 @@ class SurveyExport
foreach (glob($folder . 'export_data_'.$this->sid.'*dat_data*'.TMP_EXT) as $fileToDelete) {
unlink($fileToDelete);
}
- unlink ($this->_dataFileName.'.csv');
+ unlink ($this->_dataFileName.$extension);
}
else {
echo 'x2:Napaka!';
@@ -567,16 +789,26 @@ class SurveyExport
exit;
}
- /** naredimo izvoz za txt
+ /** naredimo izvoz za txt SEDAJ JE TO VKLJUCENO V CSV
*
*/
- function exportText() {
+ /* function exportText() {
global $site_path;
$folder = $site_path . EXPORT_FOLDER.'/';
if ($this->_fileStatus >= 0 && $this->_dataFileName !== null && $this->_dataFileName !== '' && $this->_headFileName !== null && $this->_headFileName !== '') {
+ if ($_POST['export_delimit'] == 0) {
+ $field_delimit = ';';
+ $replace_what = isset($_POST['replace_what0']) ? $_POST['replace_what0'] : array();
+ $replace_with = isset($_POST['replace_with0']) ? $_POST['replace_with0'] : array();
+ } else {
+ $field_delimit = ',';
+ $replace_what = isset($_POST['replace_what1']) ? $_POST['replace_what1'] : array();
+ $replace_with = isset($_POST['replace_with1']) ? $_POST['replace_with1'] : array();
+ }
+
#zapišemo v temp file
$file_handler = fopen($this->_dataFileName.'.txt',"w");
@@ -585,7 +817,7 @@ class SurveyExport
$output2 = '';
// array za labele (ce jih izpisujemo)
- $display_labels = true;
+ $display_labels = ((int)$_POST['export_labels'] == 1);
$labels = array();
# naredimo header row
@@ -594,7 +826,7 @@ class SurveyExport
foreach ($spremenljivka['grids'] AS $gid => $grid) {
foreach ($grid['variables'] AS $vid => $variable ){
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || (isset($this->exportSettings['FullMeta']) && $this->exportSettings['FullMeta'] > 0)){
$output1 .= strip_tags($variable['variable']).';';
$output2 .= strip_tags($variable['naslov']).';';
}
@@ -663,10 +895,10 @@ class SurveyExport
# dodami boomchar za utf-8
echo $convertTypes[$convertType]['BOMchar'];
- /*while(!feof($fd)) {
- $buffer = fread($fd, 2048);
- echo $buffer.'';
- }*/
+ //while(!feof($fd)) {
+ // $buffer = fread($fd, 2048);
+ // echo $buffer.'';
+ //}
$i=0;
// Loop po vrsticah
while(($line = fgets($fd)) !== false) {
@@ -718,7 +950,7 @@ class SurveyExport
}
exit;
- }
+ } */
// shranim SPS in A00, potem pokličem spss in je.
private function exportSav () {
@@ -753,7 +985,7 @@ class SurveyExport
header("Content-Transfer-Encoding: Binary");
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\"");
- readfile($file_url);
+ /* if(file_exists($file_url)) */readfile($file_url);
}
@@ -820,7 +1052,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;
@@ -870,7 +1102,7 @@ class SurveyExport
foreach ($grid['variables'] AS $vid => $variable ){
$seq=$variable['sequence'];
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(!isset($spremenljivka['tip']) || ($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['export_data'] == 1){
# vsako v svojo vrstico
if (substr($variable['spss'],0,1) == 'F') {
@@ -951,7 +1183,7 @@ class SurveyExport
if (count($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(!isset($spremenljivka['tip']) || ($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['export_data'] == 1){
switch ($spremenljivka['tip']) {
case '2':
@@ -1016,7 +1248,7 @@ class SurveyExport
if (count($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['export_data'] == 1){
if ($variable['other'] != 1) {
$variable = $this->getCleanString($variable['variable']);
@@ -1034,7 +1266,7 @@ class SurveyExport
if (count($spremenljivka['options']) > 0) {
foreach ($spremenljivka['options'] AS $okey =>$option) {
- if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['FullMeta'] > 0){
+ if(($spremenljivka['tip'] !== 'sm' && $spremenljivka['tip'] !== 'm') || $this->exportSettings['export_data'] == 1){
if ($spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 16) {
# pri čekboxu prevedemo
@@ -1121,7 +1353,7 @@ class SurveyExport
if ($pspp == false)
$resultString .= $mkey . ' \'' . $this->getCleanString($missing_value).'\''.NEW_LINE;
else {
- if (strpos ($this->getCleanString($unset_value), "&#39;")===false) {
+ if (strpos ($this->getCleanString($missing_value), "&#39;")===false) {
$resultString .= $mkey . ' "' . $this->getCleanString($missing_value).'"'.' ';
}
else {
@@ -1266,7 +1498,7 @@ class SurveyExport
$out3 = shell_exec($cmdLn3);
$out4 = shell_exec($cmdLn4);
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
print_r('<br>'.$cmdLn1);
print_r('<br>'.$cmdLn2);
print_r('<br>'.$cmdLn3);
@@ -1361,19 +1593,16 @@ 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);
+ $array_SPSS[$spr_id] = isset($array_SPSS[$spr_id]) ? max((int)$text,$array_SPSS[$spr_id],$max_missing) : max((int)$text,0,$max_missing);
}
return $array_SPSS;
}
@@ -1408,7 +1637,7 @@ class SurveyExport
return $new_string;
}
- private function getVariableLabels($spr_id){
+ /* private function getVariableLabels($spr_id){
global $lang;
$s = sisplet_query("SELECT tip FROM srv_spremenljivka WHERE id = '$spr_id'");
@@ -1460,6 +1689,6 @@ class SurveyExport
}
return $response;
- }
+ } */
}
?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyExportProfiles.php b/admin/survey/classes/class.SurveyExportProfiles.php
index f34e7b0..8422817 100644
--- a/admin/survey/classes/class.SurveyExportProfiles.php
+++ b/admin/survey/classes/class.SurveyExportProfiles.php
@@ -22,7 +22,7 @@ class SurveyExportProfiles
protected function __construct() {}
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
diff --git a/admin/survey/classes/class.SurveyInfo.php b/admin/survey/classes/class.SurveyInfo.php
index 5e24766..49a2e7e 100644
--- a/admin/survey/classes/class.SurveyInfo.php
+++ b/admin/survey/classes/class.SurveyInfo.php
@@ -37,7 +37,7 @@ class SurveyInfo
protected function __construct() {}
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -100,13 +100,17 @@ class SurveyInfo
*/
static function getSurveyColumn ($key) {
$row = self::getSurveyRow();
- return $row[$key];
+ return $row != null ? $row[$key] : null;
}
static function getSurveyRow () {
if (!self::$rowSurveyInit) {
$querySurveyInit = sisplet_query("SELECT * FROM srv_anketa WHERE id = '".self::$surveyId."'");
self::$rowSurveyInit = mysqli_fetch_assoc($querySurveyInit);
+
+ // Dodatno ciscenje texta naslova ankete - ne smemo imeti nobenih tag-ov
+ self::$rowSurveyInit['naslov'] = strip_tags(self::$rowSurveyInit['naslov']);
+ self::$rowSurveyInit['akronim'] = strip_tags(self::$rowSurveyInit['akronim']);
}
return self::$rowSurveyInit;
@@ -159,8 +163,9 @@ class SurveyInfo
// te funkcije ohranimo, da se obdrzi kompatibilnost za nazaj. Za naprej se lahko uporabi kar direktno getSurveyColumn (v primerih kjer se lahko)
static function getSurveyId() { return self::$surveyId; }
- static function getSurveyTitle() { return strip_tags(self::getSurveyColumn('naslov')); }
- static function getSurveyAkronim() { return strip_tags(self::getSurveyColumn('akronim')); }
+ static function getSurveyHash() { return self::getSurveyColumn('hash'); }
+ static function getSurveyTitle() { return strip_tags(is_string(self::getSurveyColumn('naslov')) ? self::getSurveyColumn('naslov') : ''); }
+ static function getSurveyAkronim() { return strip_tags(is_string(self::getSurveyColumn('akronim')) ? self::getSurveyColumn('akronim') : ''); }
static function getSurveyActive() { return self::getSurveyColumn('active'); }
static function getSurveyFolder() { return self::getSurveyColumn('folder'); }
static function getSurveyInfo() { return self::getSurveyColumn('intro_opomba'); }
@@ -168,8 +173,8 @@ class SurveyInfo
static function getSurveyShowIntro() { return self::getSurveyColumn('show_intro'); }
static function getSurveyShowConcl() { return self::getSurveyColumn('show_concl'); }
- static function getSurveyIntro() { return strip_tags(self::getSurveyColumn('introduction')); }
- static function getSurveyConcl() { return strip_tags(self::getSurveyColumn('conclusion')); }
+ static function getSurveyIntro() { return strip_tags(is_string(self::getSurveyColumn('introduction')) ? self::getSurveyColumn('introduction') : ''); }
+ static function getSurveyConcl() { return strip_tags(is_string(self::getSurveyColumn('conclusion')) ? self::getSurveyColumn('conclusion') : ''); }
static function getSurveyCountType() { return self::getSurveyColumn('countType'); }
static function getSurveyInsertUid() { return self::getSurveyColumn('insert_uid'); }
static function getSurveyInsertName() {
@@ -193,7 +198,7 @@ class SurveyInfo
}
}
static function getSurveyInsertDate() { $insertDateTime = explode(" ", self::getSurveyColumn('insert_time')); $tmpDate = explode('-',$insertDateTime[0]); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
- static function getSurveyInsertTime() { $insertDateTime = explode(" ", self::getSurveyColumn('insert_time')); return $insertDateTime[1]; }
+ static function getSurveyInsertTime() { $insertDateTime = explode(" ", (self::getSurveyColumn('insert_time'))); return $insertDateTime[1]; }
static function getSurveyEditUid() { return self::getSurveyColumn('edit_uid'); }
static function getSurveyEditName() {
if (trim(self::getUserEditInfo('name')) || trim(self::getUserEditInfo('surname'))) {
@@ -214,10 +219,10 @@ class SurveyInfo
return $lang['srv_anonymous'];
}
}
- static function getSurveyEditDate() { $editDateTime = explode(" ", self::getSurveyColumn('edit_time')); $tmpDate = explode('-',$editDateTime[0]); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
- static function getSurveyEditTime() { $editDateTime = explode(" ", self::getSurveyColumn('edit_time')); return $edit_time = $editDateTime[1]; }
- static function getSurveyStartsDate() { $tmpDate = explode('-',self::getSurveyColumn('starts')); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
- static function getSurveyExpireDate() { $tmpDate = explode('-',self::getSurveyColumn('expire')); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
+ static function getSurveyEditDate() { $editDateTime = explode(" ", (self::getSurveyColumn('edit_time'))); $tmpDate = explode('-',$editDateTime[0]); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
+ static function getSurveyEditTime() { $editDateTime = explode(" ", (self::getSurveyColumn('edit_time'))); return $edit_time = $editDateTime[1]; }
+ static function getSurveyStartsDate() { $tmpDate = explode('-',(self::getSurveyColumn('starts'))); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
+ static function getSurveyExpireDate() { $tmpDate = explode('-',(self::getSurveyColumn('expire'))); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0]; }
static function getSurveyFirstEntryDate() {
if (self::getFirstLast('frst') == '0000-00-00 00:00:00' || self::getFirstLast('frst') == null)
@@ -230,8 +235,27 @@ class SurveyInfo
$lastDateTime = explode(" ", self::getFirstLast('lst')); $tmpDate = explode('-',$lastDateTime[0]); return $tmpDate[2].".".$tmpDate[1].".".$tmpDate[0];
}
- static function getSurveyFirstEntryTime() { $firstDateTime = explode(" ", self::getFirstLast('frst')); $tmpDate = explode(':',$firstDateTime[1]); return $tmpDate[0].":".$tmpDate[1].":".$tmpDate[2]; }
- static function getSurveyLastEntryTime() { $lastDateTime = explode(" ", self::getFirstLast('lst')); $tmpDate = explode(':',$lastDateTime[1]); return $tmpDate[0].":".$tmpDate[1].":".$tmpDate[2]; }
+ static function getSurveyFirstEntryTime() {
+
+ if(!is_string(self::getFirstLast('frst')))
+ return '';
+
+ $firstDateTime = explode(" ", self::getFirstLast('frst'));
+ $tmpDate = explode(':',$firstDateTime[1]);
+
+ return $tmpDate[0].":".$tmpDate[1].":".$tmpDate[2];
+ }
+
+ static function getSurveyLastEntryTime() {
+
+ if(!is_string(self::getFirstLast('lst')))
+ return '';
+
+ $lastDateTime = explode(" ", self::getFirstLast('lst'));
+ $tmpDate = explode(':',$lastDateTime[1]);
+
+ return $tmpDate[0].":".$tmpDate[1].":".$tmpDate[2];
+ }
static function getSurveyGroupCount() {
if (!self::$cntGroups) {
@@ -361,34 +385,20 @@ class SurveyInfo
return self::$access_users;
}
- /** Polovimo vse datume aktivnosti ankete
+ /** Polovimo datume prvega aktiviranja in zadnjega deaktiviranja ankete
*
* @return unknown_type
*/
static function getSurveyActivity() {
$activity = array();
- if ( self::getSurveyColumn('active') == 1 ) {
- $_starts = self::getSurveyColumn('starts');
- $_expire = self::getSurveyColumn('expire');
-
- // izberemo samo unikatne zapise ki niso enaki trenutni aktivnosti
- $str = "SELECT DISTINCT starts, expire FROM srv_activity WHERE not(starts = '".$_starts."' AND expire = '".$_expire."') AND sid = '".self::getSurveyId()."'";
- $qry = sisplet_query($str);
- while ($row = mysqli_fetch_assoc($qry)) {
- $activity[] = array('starts'=>$row['starts'],'expire'=>$row['expire']);
- }
- // dodamo trenutno nastavljeno aktivnost
- $activity[] = array('starts'=>$_starts,'expire'=>$_expire);
-
- } else {
- // anketa ni aktivna, preberemo samo iz tabele aktivnosti
- $str = "SELECT DISTINCT starts, expire FROM srv_activity WHERE sid = '".self::getSurveyId()."'";
- $qry = sisplet_query($str);
- while ($row = mysqli_fetch_assoc($qry)) {
- $activity[] = array('starts'=>$row['starts'],'expire'=>$row['expire']);
- }
-
+
+ $sql = sisplet_query("SELECT starts, expire FROM srv_activity WHERE sid='".self::getSurveyId()."'");
+
+ if(mysqli_num_rows($sql) > 0){
+ $row = mysqli_fetch_assoc($sql);
+ $activity[] = array('starts'=>$row['starts'],'expire'=>$row['expire']);
}
+
return $activity;
}
@@ -468,7 +478,7 @@ class SurveyInfo
echo ($showIcons ? '<span class="sprites clock_play" title="'.$lang['srv_info_activity'].'"></span> ' : '');
echo $lang['srv_info_activity']. ': </span>';
$activity = self:: getSurveyActivity();
- if ( count($activity) > 0 ) {
+ if (is_countable($activity) && count($activity) > 0 ) {
$prefix = '';
foreach ($activity as $active) {
$_starts = explode('-',$active['starts']);
@@ -477,7 +487,8 @@ class SurveyInfo
echo $prefix.$_starts[2].'.'.$_starts[1].'.'.$_starts[0].'-'.$_expire[2].'.'.$_expire[1].'.'.$_expire[0];
$prefix = '; ';
}
- } else {
+ }
+ else {
echo $lang['srv_anketa_noactive2'].'!';
}
echo "<br />";
@@ -510,14 +521,18 @@ class SurveyInfo
}
}
- static function doVariablesCount($query) {
+ static function doVariablesCount($query){
+
// zloopamo skozi vprašanja in za vsako vprašan je preberemo št variabel
$cnt= 0;
while ($rowVprasanje = mysqli_fetch_assoc($query)) {
$spr_id= $rowVprasanje['id'];
- switch ( $rowVprasanje['tip'] ) { // v odvisnosti od tipa vprašanja pohandlamo podatke
+
+ // v odvisnosti od tipa vprašanja pohandlamo podatke
+ switch ( $rowVprasanje['tip'] ) {
+
case 1: // radio
case 3: // dropdown
$cnt++; // za sam header
@@ -529,12 +544,12 @@ class SurveyInfo
}
}
break;
+
case 2: // checkbox
case 6: // multigrid
case 18: // vsota
case 17: // ranking
case 21: // text*
-// $cnt++; // za sam header
$sqlSrvVred = self::select_sql_vrednost($rowVprasanje['id']);
while ( $rowSrvVred = mysqli_fetch_assoc($sqlSrvVred) ) {
$cnt++; // za vsako variablo
@@ -543,6 +558,7 @@ class SurveyInfo
}
}
break;
+
case 4: // text
case 8: // datum
case 7: // number
@@ -553,6 +569,7 @@ class SurveyInfo
$cnt+=2;
}
break;
+
case 16: // multicheckbox
case 19: // multitext
case 20: // multinumber
@@ -570,17 +587,21 @@ class SurveyInfo
}
}
break;
- case 26: // lokacija
- if($rowVprasanje['enota'] == 3){
- $sqlSrvVred = self::select_sql_vrednost($rowVprasanje['id']);
- while ( $rowSrvVred = mysqli_fetch_assoc($sqlSrvVred) ) {
- $cnt++; // za vsako variablo
- }
- }
- else
- $cnt++; // moja lokacija in multilokacija je 1
+
+ // lokacija
+ case 26:
+ if($rowVprasanje['enota'] == 3){
+ $sqlSrvVred = self::select_sql_vrednost($rowVprasanje['id']);
+ while ( $rowSrvVred = mysqli_fetch_assoc($sqlSrvVred) ) {
+ $cnt++; // za vsako variablo
+ }
+ }
+ else
+ $cnt++; // moja lokacija in multilokacija je 1
break;
- case 27: // heatmap
+
+ // heatmap
+ case 27:
$cnt++; // za koordinate
$sqlSrvVred = self::select_sql_vrednost($rowVprasanje['id']);
while ( $rowSrvVred = mysqli_fetch_assoc($sqlSrvVred) ) { //za morebitna obmocja
@@ -642,10 +663,9 @@ class SurveyInfo
if ($anketa == false)
$anketa = self::$surveyId;
-
- // V get-u ni vec id ankete ampak string (zaradi zascite, da en more kdorkoli dostopati do vseh anket)
- $anketa_string = Common::encryptAnketaID($anketa);
-
+
+ $anketa_string = self::getSurveyHash();
+
if ( ! isset( self::$surveyLink[$anketa_string] ) ) {
$sqll = sisplet_query("SELECT link FROM srv_nice_links WHERE ank_id = '".$anketa."' ORDER BY id ASC LIMIT 1");
@@ -656,7 +676,7 @@ class SurveyInfo
}
else {
if (self::checkSurveyModule('uporabnost') && $uporabnost == true) // na redirectih pa v form action ne sme it na uporabnost (ker se odpira znotraj frama)
- $link = $site_url.'main/survey/uporabnost.php?anketa=' . $anketa_string ;
+ $link = $site_url.'main/survey/uporabnost.php?anketa=' . $anketa_string;
else
$link = $site_url.'a/' . $anketa_string ;
}
@@ -666,6 +686,17 @@ class SurveyInfo
return self::$surveyLink[$anketa_string];
}
+
+ static function getRawSurveyLink ($uporabnost = true) {
+ global $site_url;
+
+ $anketa_string = self::getSurveyHash();
+
+ if (self::checkSurveyModule('uporabnost') && $uporabnost == true) // na redirectih pa v form action ne sme it na uporabnost (ker se odpira znotraj frama)
+ return $site_url.'main/survey/uporabnost.php?anketa=' . $anketa_string;
+ else
+ return $site_url.'a/' . $anketa_string ;
+ }
static function getRespondentLanguage() {
global $lang;
@@ -838,7 +869,7 @@ class SurveyInfo
return false;
}
else{
- if(self::$surveyModules[$module] > 0)
+ if(isset(self::$surveyModules[$module]) && self::$surveyModules[$module] > 0)
return true;
else
return false;
@@ -847,5 +878,78 @@ 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;
+
+ // Arhivska 3
+ case '3':
+ $db_table_string = '_archive3';
+ break;
+
+ // Aktivna anketa
+ case '1':
+ default:
+ $db_table_string = '_active';
+ break;
+ }
+
+ return $db_table_string;
+ }
+
+
+ // Preverimo, ce je anketa ze potekla oz. bi se morala avtomatsko aktivirati
+ public static function checkSurveyActive(){
+
+ $anketa = self::$surveyId;
+ $active = self::getSurveyActive();
+
+ $starts = self::getSurveyStartsDate();
+ $expire = self::getSurveyExpireDate();
+
+ $currentDate = new DateTime();
+ $startDateTime = new DateTime($starts . ' 00:00:00');
+ $endDateTime = new DateTime($expire . ' 23:59:59');
+
+ // Anketa je aktivna - pogledamo, ce jo moramo deaktivirati
+ if($active == '1' && ($currentDate < $startDateTime || $currentDate > $endDateTime)){
+ // pretecena anketa, kontroliramo datum na: starts in expire
+ sisplet_query("UPDATE srv_anketa SET active='0' WHERE id='".$anketa."'");
+
+ SurveyInfo:: getInstance()->SurveyInit($anketa);
+ // vsilimo refresh podatkov
+ SurveyInfo:: getInstance()->resetSurveyData();
+
+ $active = '0';
+ }
+ // Anketa ni aktivna - pogledamo, ce jo moramo aktivirati
+ /*elseif($active == '0' && $currentDate >= $startDateTime && $currentDate <= $endDateTime){
+ // neaktivna anketa, kontroliramo datum na: starts in expire
+ sisplet_query("UPDATE srv_anketa SET active='1' WHERE id='".$anketa."'");
+
+ SurveyInfo:: getInstance()->SurveyInit($anketa);
+ // vsilimo refresh podatkov
+ SurveyInfo:: getInstance()->resetSurveyData();
+
+ $active = '1';
+ }*/
+
+ return $active;
+ }
}
?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyInpect.php b/admin/survey/classes/class.SurveyInpect.php
index 6bfac12..3f7ce92 100644
--- a/admin/survey/classes/class.SurveyInpect.php
+++ b/admin/survey/classes/class.SurveyInpect.php
@@ -516,9 +516,8 @@ class SurveyInspect {
$css = ($this->enableInspect == SI_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $this->enableInspect != SI_DEFAULT_PROFILE) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_inspect" title="' . $lang['srv_inspect_setting'] . '" onClick="show_inspect_settings();">' . $lang['srv_inspect_setting'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="link_inspect" title="' . $lang['srv_inspect_setting'] . '" onClick="show_inspect_settings();">' . $lang['srv_inspect_setting'] . '</span>'."\n";
echo '</li>';
}
@@ -543,50 +542,78 @@ class SurveyInspect {
echo '<h2>'.$lang['srv_inspect_setting'].'</h2>';
if ( $this->enableInspect != SI_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
+
+ echo '<div class="popup_main">';
+
+
# Nastavitve za Inspect
- echo '<p>'.$lang['srv_inspect_setting_link'].'</p>';
- echo '<p>';
- echo '<label>'.$lang['srv_inspect_setting_enabled'].'</label>';
- echo '&nbsp;<input id="enableInspect0" name="enableInspect" type="radio" value="0"' .
- (($this->enableInspect == false) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo '<label for="enableInspect0">'.$lang['no'].'</label>';
-
- echo '&nbsp;<input id="enableInspect1" name="enableInspect" type="radio" value="1"' .
- (($this->enableInspect == true) ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo '<label for="enableInspect1">'.$lang['yes'].'</label>';
- echo Help :: display('srv_crosstab_inspect');
- echo '</p>';
- echo '<p>';
- echo '<div>';
- echo '<span class="floatLeft">'.$lang['srv_inspect_goto_note'].'</span>&nbsp;';
- echo '<span class="floatLeft">';
- echo '<label><input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_ANALIZE.'" value="'.SI_GOTO_ANALIZE.'"'.($this->inspect_goto == SI_GOTO_ANALIZE ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off"/>'.$lang['srv_inspect_goto_'.SI_GOTO_ANALIZE].'</label><br/>';
- echo '<label><input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_VPOGLED.'" value="'.SI_GOTO_VPOGLED.'"'.($this->inspect_goto == SI_GOTO_VPOGLED ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off"/>'.$lang['srv_inspect_goto_'.SI_GOTO_VPOGLED].'</label> <br/>';
- echo '<label><input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_PODATKI.'" value="'.SI_GOTO_PODATKI.'"'.($this->inspect_goto == SI_GOTO_PODATKI ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off"/>'.$lang['srv_inspect_goto_'.SI_GOTO_PODATKI].'</label>';
- echo '</span>';
+ echo '<p class="bottom16">';
+ echo $lang['srv_inspect_setting_link'];
+ echo '</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<p class="setting_title">'.$lang['srv_inspect_setting_enabled'].'</p>';
+
+ echo '<div class="horizontal">';
+
+ echo '<div class="setting_item">';
+ echo ' <input id="enableInspect0" name="enableInspect" type="radio" value="0" '.(($this->enableInspect == false) ? ' checked="checked" ' : '').' autocomplete="off">';
+ echo ' <label for="enableInspect0">'.$lang['no'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input id="enableInspect1" name="enableInspect" type="radio" value="1" '.(($this->enableInspect == true) ? ' checked="checked" ' : '') . ' autocomplete="off">';
+ echo ' <label for="enableInspect1">'.$lang['yes'].' '.Help :: display('srv_crosstab_inspect').'</label>';
echo '</div>';
- echo'</p>';
- echo'<br class="clr">';
- echo '<p>';
- echo '<div id="inspectListDiv" '.($this->inspect_goto != SI_GOTO_PODATKI ? ' class="displayNone"' : '').'>';
- echo '<span>'.$lang['srv_inspect_setting_show_variables'].'</span>';
- echo '<span id="inspectListSpr" class="as_link">';
+
+ echo '</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder">';
+ echo '<p class="setting_title">'.$lang['srv_inspect_goto_note'].'</p>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_ANALIZE.'" value="'.SI_GOTO_ANALIZE.'"'.($this->inspect_goto == SI_GOTO_ANALIZE ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off">';
+ echo ' <label>'.$lang['srv_inspect_goto_'.SI_GOTO_ANALIZE].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_VPOGLED.'" value="'.SI_GOTO_VPOGLED.'"'.($this->inspect_goto == SI_GOTO_VPOGLED ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off">';
+ echo ' <label>'.$lang['srv_inspect_goto_'.SI_GOTO_VPOGLED].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="inspectGoto" id="inspectGoto_'.SI_GOTO_PODATKI.'" value="'.SI_GOTO_PODATKI.'"'.($this->inspect_goto == SI_GOTO_PODATKI ? ' checked="checked"' : '').' onchange="inspectRadioChange();return false;" autocomplete="off">';
+ echo ' <label>'.$lang['srv_inspect_goto_'.SI_GOTO_PODATKI].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div id="inspectListDiv" class="settings_block" '.($this->inspect_goto != SI_GOTO_PODATKI ? ' class="displayNone"' : '').'>';
+ echo ' <div class="setting_line">';
+ echo $lang['srv_inspect_setting_show_variables'];
+ echo ' <span id="inspectListSpr" class="as_link">';
$this->displayInspectVars();
- echo '</span>';
+ echo ' </span>';
+ echo ' </div>';
echo '</div>';
- echo '</p>';
- echo '<span class="floatRight" title="'.$lang['srv_save_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inspectSaveSettings(); return false;"><span>'.$lang['srv_save_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inspectCloseSettings(); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
// cover Div
echo '<div id="inspect_cover_div"></div>'."\n";
+
+
+ echo '</div>';
+
+ // Gumbi
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="inspectCloseSettings(); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo ' <button class="medium blue" title="'.$lang['srv_save_profile'].'" onclick="inspectSaveSettings(); return false;">'.$lang['srv_save_profile'] . '</button>';
+ echo '</div>';
}
function displayInspectVars() {
@@ -608,31 +635,42 @@ class SurveyInspect {
}
function showInspectListSpr() {
-
global $lang, $site_url;
+
$all_spr = Cache::cache_all_srv_spremenljivka($this->sid);
$vars = $_SESSION['dataSetting_profile'][$this->sid]['InspectListVars'];
+
echo '<div id="dsp_inspect_cover">';
- echo '<div id="dsp_inspect_spr_select">';
- echo '<span>'.$lang['srv_inspect_choose'].'</span>';
+
+ echo '<h2>'.$lang['srv_questions'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#inspect_cover_div\').hide(); $(\'#fullscreen\').removeClass(\'z-index200\').fadeOut();">✕</a></div>';
+
+
+ echo '<div id="dsp_inspect_spr_select" class="popup_main">';
+
+ echo '<div class="setting_line">'.$lang['srv_inspect_choose'].'</div>';
+
+ echo '<div class="settings_block">';
foreach ($all_spr AS $id => $spremenljivka) {
- echo '<div class="dsp_inspect_var">';
- echo '<input name="dsp_inspect_vars" id="dsp_inspect_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox"'
- .(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
- echo '<label for="dsp_inspect_var_'.$spremenljivka['id'].'">'.$spremenljivka['variable'].' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo '<div class="setting_line dsp_inspect_var">';
+
+ echo ' <input name="dsp_inspect_vars" id="dsp_inspect_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox"'.(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
+ echo ' <label for="dsp_inspect_var_'.$spremenljivka['id'].'">'.$spremenljivka['variable'].' - '.strip_tags($spremenljivka['naslov']).'</label>';
+
echo '</div>';
}
+ echo '</div>';
echo '</div>';
- echo '<div class="inv_FS_btm">';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span id="dsp_inspect_cancel" class="floatLeft spaceLeft buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#"><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<span id="dsp_inspect_save" class="floatRight spaceRight buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#"><span>'.$lang['srv_zapri'].'</span></a></span>';
- echo '<div class="clr" />';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button id="dsp_inspect_cancel" class="medium white-blue">'.$lang['srv_cancel'].'</button>';
+ echo ' <button id="dsp_inspect_save" class="medium blue">'.$lang['srv_zapri'].'</button>';
echo '</div>';
- #echo '</div>';
+
echo '</div>';
}
@@ -660,8 +698,11 @@ class SurveyInspect {
function getConditionString() {
global $lang;
+ global $site_url;
+
#preverimi ali imamo nastavljen pogoj za inspect
$if_id = (int)SurveyUserSetting :: getInstance()->getSettings('inspect_if_id');
+
if ($if_id > 0) {
ob_start();
$b = new Branching($this->sid);
@@ -673,34 +714,36 @@ class SurveyInspect {
if ( $if_id > 0 && $condition_label != '') {
- echo '<div id="conditionProfileNote">';
- echo '<span class="floatLeft">'.$lang['srv_profile_data_is_filtred_zoom'].'</span>';
- echo '<span class="floatLeft spaceLeft">'.$condition_label.'</span>';
- // ali imamo napake v ifu
- #TODO
- # if ((int)self::$profiles[self :: $currentProfileId]['condition_error'] != 0) {
- # echo '<br>';
- # echo '<span style="border:1px solid #009D91; background-color: #34D0B6; padding:5px; width:auto;"><img src="img_0/error.png" /> ';
- # echo '<span class="red strong">'.$lang['srv_profile_condition_has_error'].'</span>';
- # echo '</span>';
- # }
- #
+ echo '<div id="conditionProfileNote" class="filter_box inspect">';
+
+ echo ' <div class="header">';
+ echo ' <span class="semi-bold">'.$lang['srv_profile_data_is_filtred_zoom'].'</span>';
+
+ echo ' <span class="condition">'.$condition_label.'</span>';
+
session_start();
- global $site_url;
+
if (isset($_SESSION['inspectFromPodstran'][$this->sid])) {
$inspect_comeFrom = '\''.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=analysis&m='.$_SESSION['inspectFromPodstran'][$this->sid].'\'';
unset($_SESSION['inspectFromPodstran'][$this->sid]);
- } else {
+ }
+ else {
$pageURL = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
$inspect_comeFrom = '\''.$pageURL.'\'';
}
- echo '<span class="as_link spaceLeft" id="link_condition_edit">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="window.location=\'index.php?anketa='.$this->sid.'&a=data&m=quick_edit&quick_view=1\'">'.$lang['srv_zoom_link_whoisthis'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="doZoomFromInspect();return false">Segmentiraj'.$lang[''].'</span>';
- echo '<span class="as_link spaceLeft" onclick="inspectRemoveCondition('.$inspect_comeFrom.');">'.$lang['srv_profile_remove'].'</span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" id="link_condition_edit"></span>';
+ echo ' <span class="faicon help2" onclick="window.location=\'index.php?anketa='.$this->sid.'&a=data&m=quick_edit&quick_view=1\'" title="'.$lang['srv_zoom_link_whoisthis'].'"></span>';
+ echo ' <span class="faicon" onclick="doZoomFromInspect();return false">Segmentiraj</span>';
+ echo ' <span class="faicon delete" onclick="inspectRemoveCondition('.$inspect_comeFrom.');"></span>';
+ echo ' </div>';
+
+ echo ' </div>';
+
echo '</div>';
- echo '<br class="clr" />';
+
return true;
}
}
diff --git a/admin/survey/classes/class.SurveyList.php b/admin/survey/classes/class.SurveyList.php
index a9377e1..9efbcb0 100644
--- a/admin/survey/classes/class.SurveyList.php
+++ b/admin/survey/classes/class.SurveyList.php
@@ -21,55 +21,55 @@ if(session_id() == '') {session_start();}
class SurveyList {
- private $surveys_ids = array(); # array z id-ji anket
- private $settingsArray = array(); # array z nastavitvami
+ protected $surveys_ids = array(); # array z id-ji anket
+ protected $settingsArray = array(); # array z nastavitvami
- private $parentFolder; # osnovni direktorij
- private $currentFolder; # trenutni direktorij
- private $folders = array(); # array z direktoriji
+ protected $parentFolder; # osnovni direktorij
+ protected $currentFolder; # trenutni direktorij
+ protected $folders = array(); # array z direktoriji
- private $user_id = null; # ali filtriramo po userju
- private $g_uid = null; # globalna nastavitev user_id
- private $g_adminType = null; # globalna nastavitev adminType
+ protected $user_id = null; # ali filtriramo po userju
+ protected $g_uid = null; # globalna nastavitev user_id
+ protected $g_adminType = null; # globalna nastavitev adminType
- private $onlyPhone = false; # Ali prikazujemo samo telefonske ankete
+ protected $onlyPhone = false; # Ali prikazujemo samo telefonske ankete
- private $lang_id = 0; # nastavitev languageType
+ protected $lang_id = 0; # nastavitev languageType
- private $gdpr = 0; # nastavitev gdpr filter za ankete
+ protected $gdpr = 0; # nastavitev gdpr filter za ankete
- private $dostopCondition = null; # shranimo omejitve dostopa (glede na tip uporabnika in uporabniški uid)
- private $folderCondition = null; # shranimo omejevanja folderjev
+ protected $dostopCondition = null; # shranimo omejitve dostopa (glede na tip uporabnika in uporabniški uid)
+ protected $folderCondition = null; # shranimo omejevanja folderjev
- private $libraryCondition = null; # shranimo novo omejevanje folderjev (moja knjiznica)
- private $currentLibrary; # trenutni direktorij moje knjiznice
+ protected $libraryCondition = null; # shranimo novo omejevanje folderjev (moja knjiznica)
+ protected $currentLibrary; # trenutni direktorij moje knjiznice
- private $filter = null; # filter za ime ankete
+ protected $filter = null; # filter za ime ankete
- private $show_folders = 0; # ali prikazujemo mape ali ne (default zaenkrat da)
+ protected $show_folders = 0; # ali prikazujemo mape ali ne (default zaenkrat da)
- private $isSearch = 0; # ali izvajamo search po anektah
- private $searchString = ''; # geslo po katerem iscemo po anketah
- private $searchStringProcessed = array(); # geslo po katerem iscemo po anketah, obdelano (skrajsano da isce tudi po drugih sklanjatvah)
- private $searchSettings = array(); # nastavitve searcha
+ protected $isSearch = 0; # ali izvajamo search po anektah
+ protected $searchString = ''; # geslo po katerem iscemo po anketah
+ protected $searchStringProcessed = array(); # geslo po katerem iscemo po anketah, obdelano (skrajsano da isce tudi po drugih sklanjatvah)
+ protected $searchSettings = array(); # nastavitve searcha
# privzete nastavitve
- private $pageno = 1; # na kateri strani navigacije smo
- private $max_pages = 1; # koliko strani imamo
- private $sortby = SRV_LIST_ORDER_BY; # id polja po katerem sortiramo
- private $sorttype = SRV_LIST_ORDER_TYPE; # tip sortiranja 1= deac, 0 = asc
- private $rec_per_page = SRV_LIST_REC_PER_PAGE; # število zapisov na stran
- private $orderByText = false; # ali sortiramo po tekstovnem polju (takrat uporabimo upper)
+ protected $pageno = 1; # na kateri strani navigacije smo
+ protected $max_pages = 1; # koliko strani imamo
+ protected $sortby = SRV_LIST_ORDER_BY; # id polja po katerem sortiramo
+ protected $sorttype = SRV_LIST_ORDER_TYPE; # tip sortiranja 1= deac, 0 = asc
+ protected $rec_per_page = SRV_LIST_REC_PER_PAGE; # število zapisov na stran
+ protected $orderByText = false; # ali sortiramo po tekstovnem polju (takrat uporabimo upper)
# privzete možnosti
- private $sort_types_options = array(1=>'DESC',2=>'ASC'); # možni načini sortiranja
- private $appropriateStatus = '5,6'; # statusi ki veljajo kot ustrezni
+ protected $sort_types_options = array(1=>'DESC',2=>'ASC'); # možni načini sortiranja
+ protected $appropriateStatus = '5,6'; # statusi ki veljajo kot ustrezni
# možni načini sortiranja
- private $order_by_options = array(
+ protected $order_by_options = array(
1=>'naslov',
2=>'active',
3=>'lib_glb',
@@ -95,7 +95,7 @@ class SurveyList {
);
# polja za prikaz
- private $dataFields = array(
+ protected $dataFields = array(
1=>array('id'=>1,'visible'=>1,'order_by'=>'naslov','header_field'=>'sl_naslov','alsoResize'=>'.sl_naslov','minWidth'=>100,'data_field'=>'naslov','data_type'=>'naslov', 'data_css'=>'sl_naslov_padding', 'order_text'=>true),
2=>array('id'=>2,'visible'=>1,'order_by'=>'active','header_field'=>'sl_active','lang_label'=>'sl_active_1','alsoResize'=>'.sl_active','minWidth'=>20,'maxWidth'=>30,'data_field'=>'active','data_type'=>'active','data_css'=>'anl_ac'),
3=>array('id'=>3,'visible'=>0,'order_by'=>'lib_glb','header_field'=>'sl_lib_glb','lang_label'=>'sl_lib_glb_1','alsoResize'=>'.sl_lib_glb','minWidth'=>20,'maxWidth'=>30,'data_field'=>'lib_glb','data_type'=>'lib_glb','data_css'=>'anl_ac'),
@@ -168,7 +168,7 @@ class SurveyList {
// Ali prikazujemo folderje ali ne
$userAccess = UserAccess::getInstance($global_user_id);
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
if($userAccess->checkUserAccess('my_survey_folders') && !$detect->isMobile() && !$detect->isTablet())
$this->show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
@@ -228,11 +228,33 @@ class SurveyList {
}
+ // Vrnemo, ce imamo vklopljene folderje ali ne
+ public static function hasFolders(){
+ global $global_user_id;
+
+ $show_folders = 0;
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ $detect = New \Detection\MobileDetect;
+
+ if($userAccess->checkUserAccess('my_survey_folders') && !$detect->isMobile() && !$detect->isTablet()){
+ UserSetting::getInstance()->Init($global_user_id);
+ $show_folders = UserSetting::getInstance()->getUserSetting('survey_list_folders');
+ }
+
+ if($show_folders == '1')
+ return true;
+ else
+ return false;
+ }
+
+
/**
* @desc prikaze zgornjo navigacijo
*/
function display_sub_tabs () {
- global $lang, $global_user_id, $admin_type, $site_domain, $aai_instalacija;
+ global $lang, $global_user_id, $admin_type, $site_domain;
$SLCount = $this->countSurveys();
@@ -247,55 +269,45 @@ class SurveyList {
if ($admin_type == 0) {
echo '<ul class="secondNavigation">';
- #zavihek osnovni pregled uporabnikov
- echo '<li>';
- echo '<a class="no-img single '.((!isset($_GET['m']) || $_GET['m'] == 'my') ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki" title="'.$lang['n_users_list_all'].'">';
+ #zavihek moji uporabniki
+ echo '<li class="'.((!isset($_GET['m']) || $_GET['m'] == 'my') ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki" title="'.$lang['n_users_list'].'">';
echo $lang['n_users_list'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
+ #zavihek dodajanje uporabnikov
+ echo '<li class="'.($_GET['m'] == 'add' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=add" title="'.$lang['n_users_list_add'].'">';
+ echo $lang['n_users_list_add'].'</a>';
+ echo '</li>';
+
#zavihek seznam vseh uporabnikov
- echo '<li>';
- echo '<a class="no-img single '.($_GET['m'] == 'all' ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki&m=all" title="'.$lang['n_users_list_all'].'">';
+ echo '<li class="'.($_GET['m'] == 'all' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=all" title="'.$lang['n_users_list_all'].'">';
echo $lang['n_users_list_all'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
#zavihek izbrisani uporabniki
- echo '<li>';
- echo '<a class="no-img single '.(!empty($_GET['m']) && $_GET['m'] == 'izbrisani' ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki&m=izbrisani" title="'.$lang['n_deleted_users'].'">';
+ echo '<li class="'.(!empty($_GET['m']) && $_GET['m'] == 'izbrisani' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=izbrisani" title="'.$lang['n_deleted_users'].'">';
echo $lang['n_deleted_users'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
#zavihek odjavljeni uporabniki
- echo '<li>';
- echo '<a class="no-img single '.(!empty($_GET['m']) && $_GET['m'] == 'nepotrjeni' ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki&m=nepotrjeni" title="'.$lang['n_unconfirmed_users'].'">';
+ echo '<li class="'.(!empty($_GET['m']) && $_GET['m'] == 'nepotrjeni' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=nepotrjeni" title="'.$lang['n_unconfirmed_users'].'">';
echo $lang['n_unconfirmed_users'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
#zavihek nepotrjenih uporabnikov
- echo '<li>';
- echo '<a class="no-img single '.(!empty($_GET['m']) && $_GET['m'] == 'odjavljeni' ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki&m=odjavljeni" title="'.$lang['n_unsigned_users'].'">';
+ echo '<li class="'.(!empty($_GET['m']) && $_GET['m'] == 'odjavljeni' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=odjavljeni" title="'.$lang['n_unsigned_users'].'">';
echo $lang['n_unsigned_users'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
#zavihek sa modul
- echo '<li>';
- echo '<a class="no-img single '.(!empty($_GET['m']) && $_GET['m'] == 'sa-modul' ? 'active' : '').'"'
- .' href="index.php?a=diagnostics&t=uporabniki&m=sa-modul" title="'.$lang['srv_hierarchy_users_access'].'">';
+ echo '<li class="'.(!empty($_GET['m']) && $_GET['m'] == 'sa-modul' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=sa-modul" title="'.$lang['srv_hierarchy_users_access'].'">';
echo $lang['srv_hierarchy_users_access'].'</a>';
echo '</li>';
@@ -307,11 +319,17 @@ class SurveyList {
echo '<ul class="secondNavigation">';
- #zavihek osnovni pregled uporabnikov
- echo '<li>';
- echo '<a class="no-img single active" href="index.php?a=diagnostics&t=uporabniki" title="'.$lang['n_users_list_all'].'">';
+ #zavihek moji uporabniki
+ echo '<li class="'.((!isset($_GET['m']) || $_GET['m'] == 'my') ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki" title="'.$lang['n_users_list'].'">';
echo $lang['n_users_list'].'</a>';
echo '</li>';
+
+ #zavihek dodajanje uporabnikov
+ echo '<li class="'.($_GET['m'] == 'add' ? 'active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=uporabniki&m=add" title="'.$lang['n_users_list_add'].'">';
+ echo $lang['n_users_list_add'].'</a>';
+ echo '</li>';
echo '</ul>';
}
@@ -320,50 +338,35 @@ class SurveyList {
if ($admin_type == 0) {
echo '<ul class="secondNavigation">';
+
#zavihek ankete
- echo '<li>';
- echo '<a class="no-img side-left'.(($_GET['t']=='ankete'||$_GET['a']=='diagnostics')&& !isset($_GET['t']) ? ' active' : '').'"'
- .' href="index.php?a=diagnostics" title="'.$lang['srv_ankete'].'">';
+ echo '<li class="'.(($_GET['t']=='ankete'||$_GET['a']=='diagnostics')&& !isset($_GET['t']) ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics" title="'.$lang['srv_ankete'].'">';
echo $lang['srv_ankete'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img'.(($_GET['t']=='time_span_daily') ? ' active' : '').'"'
- .' href="index.php?a=diagnostics&t=time_span_daily" title="'.$lang['srv_weekly_diagnostics'].'">';
+ echo '<li class="'.(($_GET['t']=='time_span_daily') ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=time_span_daily" title="'.$lang['srv_weekly_diagnostics'].'">';
echo $lang['srv_weekly_diagnostics'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img'.(($_GET['t']=='time_span_monthly') ? ' active' : '').'"'
- .' href="index.php?a=diagnostics&t=time_span_monthly" title="'.$lang['srv_monthly_diagnostics'].'">';
+ echo '<li class="'.(($_GET['t']=='time_span_monthly') ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=time_span_monthly" title="'.$lang['srv_monthly_diagnostics'].'">';
echo $lang['srv_monthly_diagnostics'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img'.(($_GET['t']=='time_span_yearly') ? ' active' : '').'"'
- .' href="index.php?a=diagnostics&t=time_span_yearly" title="'.$lang['srv_yearly_diagnostics'].'">';
+ echo '<li class="'.(($_GET['t']=='time_span_yearly') ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=time_span_yearly" title="'.$lang['srv_yearly_diagnostics'].'">';
echo $lang['srv_yearly_diagnostics'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img side-right'.(($_GET['t']=='time_span') ? ' active' : '').'"'
- .' href="index.php?a=diagnostics&t=time_span&uvoz=0&ustrezni=1&delnoustrezni=1&neustrezni=0" title="'.$lang['srv_all_diagnostics'].'">';
+ echo '<li class="'.(($_GET['t']=='time_span') ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=time_span&uvoz=0&ustrezni=1&delnoustrezni=1&neustrezni=0" title="'.$lang['srv_all_diagnostics'].'">';
echo $lang['srv_all_diagnostics'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img side-right'.(($_GET['t']=='paradata') ? ' active' : '').'"'
- .' href="index.php?a=diagnostics&t=paradata" title="'.$lang['srv_metapodatki'].'">';
+ echo '<li class="'.(($_GET['t']=='paradata') ? ' active' : '').'">';
+ echo '<a href="index.php?a=diagnostics&t=paradata" title="'.$lang['srv_metapodatki'].'">';
echo $lang['srv_metapodatki'].'</a>';
echo '</li>';
@@ -378,17 +381,14 @@ class SurveyList {
echo '<ul class="secondNavigation">';
#zavihek javna knjižnica
- echo '<li>';
- echo '<a class="no-img side-left'.(($_GET['t']=='javne_ankete'||$_GET['a']=='knjiznica')&& !isset($_GET['t']) ? ' active' : '').'"'
- .' href="index.php?a=knjiznica" title="'.$lang['srv_javna_knjiznica'].'">';
+ echo '<li class="'.(($_GET['t']=='javne_ankete'||$_GET['a']=='knjiznica')&& !isset($_GET['t']) ? ' active' : '').'">';
+ echo '<a href="index.php?a=knjiznica" title="'.$lang['srv_javna_knjiznica'].'">';
echo $lang['srv_javna_knjiznica'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
# Zavihek moja knjižnica
- echo '<li>';
- echo '<a class="no-img side-right'.($_GET['t'] == 'moje_ankete' ? ' active' : '').'"'
- .' href="index.php?a=knjiznica&t=moje_ankete" title="'.$lang['srv_moja_knjiznica'].'">';
+ echo '<li class="'.($_GET['t'] == 'moje_ankete' ? ' active' : '').'">';
+ echo '<a href="index.php?a=knjiznica&t=moje_ankete" title="'.$lang['srv_moja_knjiznica'].'">';
echo $lang['srv_moja_knjiznica'].'</a>';
echo '</li>';
@@ -402,75 +402,77 @@ class SurveyList {
echo '<ul class="secondNavigation">';
if ($admin_type == '0') {
+
#zavihek sistemske
- echo '<li>';
- echo '<a class="no-img side-left'.($tab=='system' || $tab == '' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=system" title="'.$lang['srv_settingsSystem'].'">';
+ echo '<li class="'.($tab=='system' || $tab == '' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=system" title="'.$lang['srv_settingsSystem'].'">';
echo $lang['srv_settingsSystem'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
+
# Zavihek ocenjevanje trajanja
- echo '<li>';
- echo '<a class="no-img'.($tab=='predvidenicasi' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=predvidenicasi" title="'.$lang['srv_testiranje_predvidenicas'].'">';
+ echo '<li class="'.($tab=='predvidenicasi' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=predvidenicasi" title="'.$lang['srv_testiranje_predvidenicas'].'">';
echo $lang['srv_testiranje_predvidenicas'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
- # Zavihek mape
- echo '<li>';
- echo '<a class="no-img'.($tab=='collectData' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=collectData" title="'.$lang['srv_collectData'].'">';
- echo $lang['srv_collectData'].'</a>';
- echo '</li>';
- echo '<li class="space"></li>';
+
# Zavihek lep url
- echo '<li>';
- echo '<a class="no-img'.($tab=='nice_links' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=nice_links" title="'.$lang['srv_nice_url'].'">';
+ echo '<li class="'.($tab=='nice_links' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=nice_links" title="'.$lang['srv_nice_url'].'">';
echo $lang['srv_nice_url'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
+
# ankete z administrativnim dostopom
- echo '<li>';
- echo '<a class="no-img'.($tab=='anketa_admin' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=anketa_admin" title="'.$lang['srv_anketa_admin'].'">';
+ echo '<li class="'.($tab=='anketa_admin' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=anketa_admin" title="'.$lang['srv_anketa_admin'].'">';
echo $lang['srv_anketa_admin'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
+
# zbrisane ankete
- echo '<li>';
- echo '<a class="no-img'.($tab=='anketa_deleted' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=anketa_deleted" title="'.$lang['srv_anketa_deleted'].'">';
+ echo '<li class="'.($tab=='anketa_deleted' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=anketa_deleted" title="'.$lang['srv_anketa_deleted'].'">';
echo $lang['srv_anketa_deleted'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
+
# Zbrisani podatki
- echo '<li>';
- echo '<a class="no-img'.($tab=='data_deleted' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=data_deleted" title="'.$lang['srv_data_deleted'].'">';
+ echo '<li class="'.($tab=='data_deleted' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=data_deleted" title="'.$lang['srv_data_deleted'].'">';
echo $lang['srv_data_deleted'].'</a>';
echo '</li>';
+
+ # Vprasajcki
+ echo '<li class="'.($tab=='help_settings' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=help_settings" title="'.$lang['help_settings'].'">';
+ echo $lang['help_settings'].'</a>';
+ echo '</li>';
}
-
- // nastavitve uporabnika
- if($admin_type == 0)
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img side-right'.($tab=='global_user_settings' ? ' active' : '').'"'
- .' href="index.php?a=nastavitve&amp;m=global_user_settings" title="'.$lang['srv_user_settings'].'">';
+
+ echo '<li class="'.($tab=='global_user_settings' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=global_user_settings" title="'.$lang['srv_user_settings'].'">';
echo $lang['srv_user_settings'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
-
+
// Moj profil
- echo '<li>';
- echo '<a class="no-img side-right' . ($tab == 'global_user_myProfile' ? ' active' : '') . '"' . ' href="index.php?a=nastavitve&amp;m=global_user_myProfile" title="' . $lang['edit_data'] . '">';
+ echo '<li class="'.($tab == 'global_user_myProfile' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=global_user_myProfile" title="' . $lang['edit_data'] . '">';
echo $lang['edit_data'] . '</a>';
echo '</li>';
-
+
echo '</ul>';
+
+ echo '<div class="separator"></div>';
+
+ // Arhiv sprememb
+ echo '<ul class="secondNavigationArchive">';
+
+ echo '<li class="'.($tab == 'global_user_ChangeArchive' ? ' active' : '').'">';
+ echo '<a href="index.php?a=nastavitve&amp;m=global_user_ChangeArchive" title="' . $lang['srv_survey_archives_tracking_archive'] . '">';
+ echo $lang['srv_survey_archives_tracking_archive'] . '</a>';
+ echo '</li>';
+
+ echo '</ul>';
+
+
+
}
#podnavigacija za obvestila
if(($_GET['a']=='obvestila')) {
@@ -478,20 +480,16 @@ class SurveyList {
echo '<ul class="secondNavigation">';
# prejeta obvestila
- echo '<li>';
- echo '<a class="no-img side-right'.(!isset($_GET['t']) ? ' active' : '').'"'
- .' href="index.php?a=obvestila" title="'.$lang['srv_notifications_recieved'].'">';
+ echo '<li class="'.(!isset($_GET['t']) ? ' active' : '').'">';
+ echo '<a href="index.php?a=obvestila" title="'.$lang['srv_notifications_recieved'].'">';
echo $lang['srv_notifications_recieved'].'</a>';
echo '</li>';
if ($admin_type == '0') {
-
- echo '<li class="space"></li>';
-
+
# poslana obvestila
- echo '<li>';
- echo '<a class="no-img side-left'.($_GET['t']=='sent' ? ' active' : '').'"'
- .' href="index.php?a=obvestila&amp;t=sent" title="'.$lang['srv_notifications_sent'].'">';
+ echo '<li class="'.($_GET['t']=='sent' ? ' active' : '').'">';
+ echo '<a href="index.php?a=obvestila&amp;t=sent" title="'.$lang['srv_notifications_sent'].'">';
echo $lang['srv_notifications_sent'].'</a>';
echo '</li>';
}
@@ -504,19 +502,15 @@ class SurveyList {
echo '<ul class="secondNavigation">';
# moja narocila
- echo '<li>';
- echo '<a class="no-img side-right'.(!isset($_GET['m']) ? ' active' : '').'"'
- .' href="index.php?a=narocila" title="'.$lang['srv_narocila_my'].'">';
+ echo '<li class="'.(!isset($_GET['m']) ? ' active' : '').'">';
+ echo '<a href="index.php?a=narocila" title="'.$lang['srv_narocila_my'].'">';
echo $lang['srv_narocila_my'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
# placila - samo admini
if ($admin_type == '0') {
- echo '<li>';
- echo '<a class="no-img side-right'.((isset($_GET['m']) && $_GET['m'] == 'placila') ? ' active' : '').'"'
- .' href="index.php?a=narocila&m=placila" title="'.$lang['srv_placila'].'">';
+ echo '<li class="'.((isset($_GET['m']) && $_GET['m'] == 'placila') ? ' active' : '').'">';
+ echo '<a href="index.php?a=narocila&m=placila" title="'.$lang['srv_placila'].'">';
echo $lang['srv_placila'].'</a>';
echo '</li>';
}
@@ -529,49 +523,35 @@ class SurveyList {
echo '<ul class="secondNavigation">';
// Nastavitve uporabnika
- echo '<li>';
- echo '<a class="no-img side-right'.(!isset($_GET['m']) || $_GET['m']=='gdpr_user' ? ' active' : '').'"'
- .' href="index.php?a=gdpr&amp;m=gdpr_user" title="'.$lang['srv_gdpr_user_settings'].'">';
+ echo '<li class="'.(!isset($_GET['m']) || $_GET['m']=='gdpr_user' ? ' active' : '').'">';
+ echo '<a href="index.php?a=gdpr&amp;m=gdpr_user" title="'.$lang['srv_gdpr_user_settings'].'">';
echo $lang['srv_gdpr_user_settings'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
// Seznam anket
- echo '<li>';
- echo '<a class="no-img side-right'.($_GET['m']=='gdpr_survey_list' ? ' active' : '').'"'
- .' href="index.php?a=gdpr&amp;m=gdpr_survey_list" title="'.$lang['srv_gdpr_survey_list'].'">';
+ echo '<li class="'.($_GET['m']=='gdpr_survey_list' ? ' active' : '').'">';
+ echo '<a href="index.php?a=gdpr&amp;m=gdpr_survey_list" title="'.$lang['srv_gdpr_survey_list'].'">';
echo $lang['srv_gdpr_survey_list'].'</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
// DPA
- echo '<li>';
- echo '<a class="no-img side-right'.($_GET['m']=='gdpr_dpa' ? ' active' : '').'"'
- .' href="index.php?a=gdpr&amp;m=gdpr_dpa" title="'.$lang['srv_gdpr_dpa'].'">';
+ echo '<li class="'.($_GET['m']=='gdpr_dpa' ? ' active' : '').'">';
+ echo '<a href="index.php?a=gdpr&amp;m=gdpr_dpa" title="'.$lang['srv_gdpr_dpa'].'">';
echo $lang['srv_gdpr_dpa'].'</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
// Zahteve za izbris
- echo '<li>';
+ echo '<li class="'.($_GET['m']=='gdpr_requests' ? ' active' : '').'">';
$request_counter = GDPR::countUserUnfinishedRequests();
$request_counter_text = ($request_counter > 0) ? ' <sup class="red" style="vertical-align: top;">('.$request_counter.')</sup>' : '';
- echo '<a class="no-img side-right'.($_GET['m']=='gdpr_requests' ? ' active' : '').'"'
- .' href="index.php?a=gdpr&amp;m=gdpr_requests" title="'.$lang['srv_gdpr_requests'].'">';
+ echo '<a href="index.php?a=gdpr&amp;m=gdpr_requests" title="'.$lang['srv_gdpr_requests'].'">';
echo $lang['srv_gdpr_requests'].$request_counter_text.'</a>';
echo '</li>';
// Vse zahteve za izbris - samo ADMINI
- if($admin_type == '0'){
-
- echo '<li class="space"></li>';
-
- echo '<li>';
- echo '<a class="no-img side-right'.($_GET['m']=='gdpr_requests_all' ? ' active' : '').'"'
- .' href="index.php?a=gdpr&amp;m=gdpr_requests_all" title="'.$lang['srv_gdpr_requests_all'].'">';
+ if($admin_type == '0'){
+ echo '<li class="'.($_GET['m']=='gdpr_requests_all' ? ' active' : '').'">';
+ echo '<a href="index.php?a=gdpr&amp;m=gdpr_requests_all" title="'.$lang['srv_gdpr_requests_all'].'">';
echo $lang['srv_gdpr_requests_all'].'</a>';
echo '</li>';
}
@@ -582,36 +562,29 @@ class SurveyList {
echo '<ul class="secondNavigation">';
# Izvozi za ul evalvacijo
- echo '<li>';
- echo '<a class="no-img side-right'.((!isset($_GET['t']) || $_GET['t'] == 'export') ? ' active' : '').'"'
- .' href="index.php?a=ul_evalvation" title="Izvozi">';
+ echo '<li class="'.((!isset($_GET['t']) || $_GET['t'] == 'export') ? ' active' : '').'">';
+ echo '<a href="index.php?a=ul_evalvation" title="Izvozi">';
echo 'Izvozi</a>';
echo '</li>';
if ($admin_type == 0) {
- echo '<li class="space"></li>';
-
+
# Uvozi - samo admini
- echo '<li>';
- echo '<a class="no-img side-left'.($_GET['t']=='import' ? ' active' : '').'"'
- .' href="index.php?a=ul_evalvation&amp;t=import" title="Uvozi">';
+ echo '<li class="'.($_GET['t']=='import' ? ' active' : '').'">';
+ echo '<a href="index.php?a=ul_evalvation&amp;t=import" title="Uvozi">';
echo 'Uvozi</a>';
echo '</li>';
- echo '<li class="space"></li>';
-
# Testiranje - samo admini
- echo '<li>';
- echo '<a class="no-img side-left'.($_GET['t']=='test' ? ' active' : '').'" href="index.php?a=ul_evalvation&amp;t=test" title="Testiranje">';
+ echo '<li class="'.($_GET['t']=='test' ? ' active' : '').'">';
+ echo '<a href="index.php?a=ul_evalvation&amp;t=test" title="Testiranje">';
echo 'Testiranje</a>';
echo '</li>';
-
- echo '<li class="space"></li>';
-
+
# GC - samo admini
- echo '<li>';
- echo '<a class="no-img side-left'.($_GET['t']=='gc' ? ' active' : '').'" href="index.php?a=ul_evalvation&amp;t=gc" title="GC">';
+ echo '<li class="'.($_GET['t']=='gc' ? ' active' : '').'">';
+ echo '<a href="index.php?a=ul_evalvation&amp;t=gc" title="GC">';
echo 'GC</a>';
echo '</li>';
}
@@ -620,9 +593,10 @@ class SurveyList {
}
echo '<div id="secondNavigation_links"></div>'; # id="secondNavigation_links"
+
+ $this->language_change();
+
echo '</div>'; #<div class="secondNavigation" >
-
- $this->language_change();
}
/**
@@ -687,22 +661,25 @@ class SurveyList {
$css_1 = 'off';
$css_10 = 'on';
}
+ if ($_GET['a'] == 'kolektor') {
+ $css_1 = 'off';
+ $css_11 = 'on';
+ }
echo '<div id="firstNavigation" class="frontpage">';
- echo '<ol class="smaller left-side left-1ka">';
- echo '<li class="moja1ka">';
+ echo '<ol class="navigation_buttons_list">';
+
+ echo '<li class="moja1ka active_'.$css_1.'">';
echo '<a href="index.php?a=pregledovanje" title="' . $lang['srv_pregledovanje'] . '">';
- echo '<div class="smaller-singlebutton-'.$css_1.'">'. $lang['srv_pregledovanje'] . '</div>';
+ echo '<div class="smaller-singlebutton-'.$css_1.'"><span class="faicon clipboard_notes"></span>'. $lang['srv_pregledovanje'] . '</div>';
echo '</a>';
echo '</li>';
$SLCountPhoneSurvey = $this->countPhoneSurveys();
if ($SLCountPhoneSurvey > 0 && $admin_type != '0') {
- #echo '<li class="spaceLarge">&nbsp;</li>';
- echo '<li class="spaceBig">&nbsp;</li>';
- echo '<li>';
+ echo '<li class="active_'.$css_6.'">';
echo '<a href="index.php?a=phoneSurveys" title="' . $lang['srv_telephone_surveys'] . '">';
echo '<div class="smaller-singlebutton-'.$css_6.'">' . $lang['srv_telephone_surveys'] . '</div>';
echo '</a>';
@@ -712,9 +689,7 @@ class SurveyList {
$SLCount = $this->countSurveys();
if ($SLCount > 0 && $admin_type <= 1) {
- #echo '<li class="spaceLarge">&nbsp;</li>';
- echo '<li class="spaceBig">&nbsp;</li>';
- echo '<li>';
+ echo '<li class="active_'.$css_2.'">';
echo '<a href="index.php?a=diagnostics" title="' . $lang['srv_diagnostics'] . '">';
echo '<div class="smaller-singlebutton-'.$css_2.'">'. $lang['srv_diagnostics'] . '</div>';
echo '</a>';
@@ -724,47 +699,30 @@ class SurveyList {
# uporabniki
if ($admin_type <= 1 /*or true*/) {
# ni smiselno da ostali uporabniki vidijo zavihek, ker so tako prikazane samo njihove ankete
- echo '<li class="spaceBig">&nbsp;</li>';
- echo '<li>';
+ echo '<li class="active_'.$css_5.'">';
echo '<a href="index.php?a=diagnostics&t=uporabniki" title="' . $lang['hour_users'] . '">';
echo '<div class="smaller-singlebutton-'.$css_5.'">'. $lang['hour_users'] . '</div>';
echo '</a>';
echo '</li>';
}
- echo '<li class="spaceBig">&nbsp;</li>';
- echo '<li>';
+
+ // Knjiznica
+ echo '<li class="active_'.$css_3.'">';
echo '<a href="index.php?a=knjiznica" title="' . $lang['srv_library'] . '">';
echo '<div class="smaller-singlebutton-'.$css_3.'">'. $lang['srv_library'] . '</div>';
echo '</a>';
echo '</li>';
- # Nastavitve
- //if ($admin_type == 0) {
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
- echo '<a href="index.php?a=nastavitve'.($admin_type != 0 ? '&m=global_user_settings' : '').'" title="' . $lang['settings'] . '">';
- echo '<div class="smaller-singlebutton-'.$css_4.'">' . $lang['settings'] . '</div>';
- echo '</a>';
- echo '</li>';
- //}
-
- # Streznik
- if ($admin_type == 0 && false) {
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
- echo '<a href="http://www.1ka.si/SAR/" title="'.$lang['srv_sar'].'" target="_blank">';
- echo '<div class="smaller-singlebutton-off">'/*<span class="sprites streznik_off"></span>'*/.$lang['srv_sar'].'</div>';
- echo '</a>';
- echo '</li>';
- }
+ // Nastavitve
+ echo '<li class="active_'.$css_4.'">';
+ echo '<a href="index.php?a=nastavitve'.($admin_type != 0 ? '&m=global_user_settings' : '').'" title="' . $lang['settings'] . '">';
+ echo '<div class="smaller-singlebutton-'.$css_4.'">' . $lang['settings'] . '</div>';
+ echo '</a>';
+ echo '</li>';
# Obvestila - zaenkrat samo admin
if ($admin_type == 0) {
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
+ echo '<li class="active_'.$css_7.'">';
echo '<a href="index.php?a=obvestila'.($admin_type == 0 ? '&t=sent' : '').'" title="' . $lang['srv_notifications'] . '">';
echo '<div class="smaller-singlebutton-'.$css_7.'">'.$lang['srv_notifications'].'</div>';
echo '</a>';
@@ -772,11 +730,8 @@ class SurveyList {
}
# Narocila - samo ce imamo vklopljene pakete
- global $app_settings;
- if($app_settings['commercial_packages']){
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
+ echo '<li class="active_'.$css_10.'">';
echo '<a href="index.php?a=narocila" title="' . $lang['srv_narocila'] . '">';
echo '<div class="smaller-singlebutton-'.$css_10.'">'.$lang['srv_narocila'].'</div>';
echo '</a>';
@@ -784,9 +739,7 @@ class SurveyList {
}
# GDPR
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
+ echo '<li class="active_'.$css_9.'">';
$request_counter = GDPR::countUserUnfinishedRequests();
$request_counter_text = (true) ? ' <sup class="red" style="vertical-align: baseline; position: relative; top: -0.4em;">('.$request_counter.')</sup>' : '';
echo '<a href="index.php?a=gdpr'.($request_counter > 0 ? '&m=gdpr_requests' : '').'" title="' . $lang['srv_gdpr_settings'] . '">';
@@ -796,14 +749,21 @@ class SurveyList {
# UL evalvacija razne nastavitve, uvozi, izvozi - samo na anketa.uni-lj.si/student (zaenkrat samo admin)
if (Common::checkModule('evalvacija') == '1' && $admin_type == 0) {
- echo '<li class="spaceBig">&nbsp;</li>';
-
- echo '<li>';
+ echo '<li class="active_'.$css_8.'">';
echo '<a href="index.php?a=ul_evalvation" title="UL evalvacije">';
echo '<div class="smaller-singlebutton-'.$css_8.'">UL evalvacije</div>';
echo '</a>';
echo '</li>';
}
+
+ # kolektor modul - samo na njihovi instalaciji
+ if (Common::checkModule('kolektor') == '1') {
+ echo '<li class="active_'.$css_11.'">';
+ echo '<a href="index.php?a=kolektor" title="Kolektor">';
+ echo '<div class="smaller-singlebutton-'.$css_11.'">Kolektor</div>';
+ echo '</a>';
+ echo '</li>';
+ }
echo '</ol>';
@@ -834,7 +794,7 @@ class SurveyList {
break;
}
- echo '<ol class="smaller left-side help-1ka" >';
+ echo '<ol class="help-1ka">';
echo ' <li>';
echo ' <a href="'.$help_url.'" title="'.$lang['srv_settings_help'].'" target="_blank" >';
echo ' <div class="smaller-singlebutton-off">'.$lang['srv_settings_help'].'</div>';
@@ -952,252 +912,135 @@ class SurveyList {
public function getSurveys() {
global $global_user_id;
global $lang;
-
- // ali imamo star napreden vmesnik za moje ankete
- $advancedMySurveys = UserSetting::getInstance()->getUserSetting('advancedMySurveys');
-
- // Nastavitve zgoraj - nekatere niso prikazane pri searchu
+
+
+ // Gumba za ustvarjanje ankete - nekatere niso prikazane pri searchu
if($this->isSearch != 1){
- // Gumb za ustvarjanje ankete
- echo '<div id="anketa_new_float">';
- $this->new_anketa_div();
- echo '</div>';
-
- // Paginacija
- echo '<div id="pagination">';
- $this->displayPagiantion();
- echo '</div>';
+ // Gumb za ustvarjanje ankete
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ /*echo '<div class="first_line">';
+ $this->new_anketa_div();
+ echo '</div>';*/
+ }
+ else{
+ echo '<div class="first_line">';
+ $this->new_anketa_div();
+ echo '</div>';
+ }
}
- // Sort gumb - samo v novem vmesniku
- if($advancedMySurveys != 1 && $this->onlyPhone == false){
- echo '<div id="sortButton">';
- $this->displaySortButton();
- echo '</div>';
- }
-
- // Gumb za filtriranje - samo v novem vmesniku
- //if($this->g_adminType <= 1){
- if($advancedMySurveys != 1 && $this->onlyPhone == false){
- //echo '<div id="filterButton">';
- $this->displayFilterButton();
- //echo '</div>';
- }
-
- // Preklop na pogled s folderji (samo ce imamo nov vmesnik)
- if($this->isSearch != 1){
- if($advancedMySurveys != 1 && $this->onlyPhone == false){
- //echo '<div id="folderSwitch">';
- $this->displayFolderSwitch();
- //echo '</div>';
- }
- }
-
- // Nastavitve zgoraj - nekatere niso prikazane pri searchu
+
+ // Druga vrstica - filtri in iskanje
+ echo '<div class="second_line '.($this->isSearch == 1 ? 'advanced_search' : '').'">';
+
+ // Nastavitve zgoraj - nekatere niso prikazane pri searchu
if($this->isSearch != 1){
- // Gumb z nastavitvami pogleda - za star vmesnik
- if ($this->onlyPhone == false && $advancedMySurveys == 1){
- $this->displaySettingsUrl();
- }
// Okno za search po mojeih anketah
echo '<div id="searchMySurveys">';
$this->displaySearch();
echo '</div>';
- }
-
- // Izris seznama anket - star oz. nov design
- if($advancedMySurveys == 1){
- $this->displaySurveyList();
- }
- else{
- if($this->show_folders == 1 && $this->isSearch != 1){
-
- // Info box za posamezno anketo (hover)
- echo '<div id="survey_list_info"></div>';
-
- echo '<div class="clr"></div>';
-
- // Loop po vseh folderjih prvega nivoja - samo na prvi strani
- if($this->pageno == 1){
- // Plus za dodajanje folderja
- echo '<div style="margin: 15px 0 -15px 0"><a style="vertical-align:0px; line-height:18px;" href="#" title="'.$lang['srv_mySurvey_create_folder'].'" onClick="create_folder(\''.$folder['id'].'\'); return false;">';
- echo '<span style="vertical-align:middle;" class="faicon add icon-blue-hover-orange pointer"></span> <span style="vertical-align:middle;" class="bold">'.$lang['srv_mySurvey_create_folder'].'</span>';
- echo '</a></div>';
-
- $sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' AND parent='0' ORDER BY naslov ASC");
- if(mysqli_num_rows($sql) > 0) {
- while($row = mysqli_fetch_array($sql)){
- echo '<div id="folder_holder_'.$row['id'].'" class="folder_holder level1">';
- $this->displayNewFolder($row);
- echo '</div>';
- }
- }
- }
-
- // Na koncu se izpisemo ankete ki niso v nobenem folderju
- $row = array('id'=>0, 'naslov'=>$lang['srv_mySurvey_unallocated']);
- echo '<div id="folder_holder_0" class="folder_holder level1">';
- $this->displayNewFolder($row);
- echo '</div>';
-
- echo '<script type="text/javascript">surveyList_folder_init();</script>';
- }
- // Ce ne prikazujemo map je vse po starem
- else{
- // Info box za posamezno anketo (hover)
- echo '<div id="survey_list_info"></div>';
-
- echo '<div id="div_sl_new_-1" class="div_sl_new">';
- $this->displayNewSurveyList($folder=-1);
- echo '</div>';
- }
-
- // Paginacija - se na dnu - ni prikazana pri searchu
- if($this->isSearch != 1){
- echo '<div id="pagination" class="bottom">';
- $this->displayPagiantion();
- echo '</div><br /><br />';
- }
- }
- }
-
- function displaySurveyList() {
- global $lang;
-
- if ($this->onlyPhone == true) {
- $this->settingsArray = array();
- # prikažemo samo naslov
- $this->settingsArray['naslov'] = $this->dataFields[1];;
- echo '<input type="hidden" id="onlyPhone" name="onlyPhone" value="1">';
- }
-
- echo '<div id="div_sl">';
- if ( SRV_LIST_GET_AS_LIST == true) {
- echo '<br class="clr" />';
- // labelo za aktivno, in knji?nico popravimo kar ro?no - nardimo slikice
- $lang['srv_h_sl_active_1'] = '<span class="faicon star_on" title="'.$lang['srv_anketa_active'].'"></span>';
- $lang['srv_h_sl_delete_1'] = '';
- $lang['srv_h_sl_lib_glb_1'] = '<span class="sprites library_admin_on" title="'.$lang['srv_ank_lib_on'].'"></span>';
- $lang['srv_h_sl_lib_usr_1'] = '<span class="sprites library_on" title="'.$lang['srv_ank_mylib_on'].'"></span>';
- $ankete = $this->getSurveysAsList();
-
- echo '<input type="hidden" id="sortby" value="'.(isset($_POST['sortby']) ? $_POST['sortby'] : null).'">';
- echo '<input type="hidden" id="sorttype" value="'.(isset($_POST['sorttype']) ? $_POST['sorttype'] : null).'">';
-
- echo '<ul id="surveyList" >';
- // izpi?emo header celice
- echo '<li class="sl_header">';
- $grupaName = "";
- $groupWidths = array();
-
- if (count($this->settingsArray) > 0 ){
- foreach ( $this->settingsArray as $opcija ) {
- if ($opcija['visible'] == 1) {
- // preverimo ali smo zaklju?ili prej?njo grupo
- if ((!isset($opcija['header_grupa']) && $grupaName != "") || // nismo ve? v grupi stara ?e obstaja
- ( isset($opcija['header_grupa']) && $grupaName != "" && $opcija['header_grupa'] != $grupaName)) { // smo v grupi ampak ime ni enako prej?njemu
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '</div>';
- $grupaName = "";
- }
- // preverimo ali naredimo novo grupo (Vnesel / urejal)
- if (isset($opcija['header_grupa']) && $grupaName == "") { // smo v grupi polj pod in imamo podpolja: ime priimek, email, datum
- // imamo za?etek grupe nari?emo ?tartne dive
- echo '<div id="'.$opcija['header_grupa'].'_holder" class="floatLeft" style="padding:0px; margin:0px; border:none; height:100%;">';
- echo '<div id="'.$opcija['header_grupa'].'_title" style="height:26px; /*border-bottom: 1px solid #C2D2C9;*/ padding:0px; margin:0px; /*border-right:1px solid #C2D2C9;*/">';
- echo '<div id="'.$opcija['header_grupa'].'" class="floatLeft anl_ac" style="border:none;">'.$lang['srv_'.$opcija['header_grupa']].'</div>';
- // nastavimo sirino grupe na 0
- $groupWidths[$opcija['header_grupa']] = 0;
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '<div style="height:26px;padding:0px; margin:0px; border:none;">';
- $grupaName = $opcija['header_grupa'];
- }
- echo '<div id="h_'.$opcija['header_field'].'" class="floatLeft sl_header_field '.$opcija['header_field'].' anl_ac" baseCss="'.$opcija['header_field'].'">'
- . $this->createOrderUrl( $opcija['id'], (isset($opcija['lang_label']) ? $lang['srv_h_'.$opcija['lang_label']] : $lang['srv_h_'.$opcija['header_field']] ) )
- . '</div>';
- }
- flush(); @ob_flush();
- }
- }
- // na koncu ?e preverimo ali imamo kon?ano grupo ?ene nardimo zaklju?na diva
- if ($grupaName != "") {
- echo '<div class="clr"></div>';
- echo '</div>';
- echo '</div>';
- $grupaName = "";
- }
- echo '</li>';
- $cnt = 1;
- if (count($ankete)) {
- foreach ( $ankete as $anketa ) {
- $eavenOdd = $cnt&1;
- $cnt++;
- $anketa_answers_cnt = $anketa['answers'];
- $anketa_is_active = $anketa['active'];
- $anketa_is_copy = isset($anketa['insert_uid']) && $anketa['insert_uid'] == -1 ? true : false;
- $anketa_i_uid= isset($anketa['insert_uid']) ? $anketa['insert_uid'] : null;
- $anketa_e_uid= isset($anketa['edit_uid']) ? $anketa['edit_uid'] : null;
- $anketa_canEdit= $anketa['canEdit'];
- echo '<li id="anketa_list_'.$anketa['id'].'" class="sl_bck_'.$eavenOdd.'">';
- // za vsako vidno polje za header izpi?emopodatek
- foreach ( $this->settingsArray as $opcija ) {
-
- if (isset($opcija['visible']) && $opcija['visible'] == 1) {
- echo '<div class="floatLeft '.$opcija['header_field'].' '.(isset($opcija['data_css']) ? $opcija['data_css'] : null).' sl_bck_br_'.$eavenOdd.'" title="'.$anketa[$opcija['data_field']].'" >';
- if (isset($opcija['data_type'])) {
- $this->echoText($anketa[$opcija['data_field']], $opcija['data_type'], $anketa['id'], array('answers_cnt'=>$anketa_answers_cnt, 'is_active'=>$anketa_is_active, 'anketa_is_copy'=>$anketa_is_copy, 'anketa_i_uid'=>$anketa_i_uid, 'anketa_e_uid'=>$anketa_e_uid,'anketa_canEdit'=>$anketa_canEdit));
- } else {
- $this->echoText($anketa[$opcija['data_field']], 'text', $anketa['id'], array('answers_cnt'=>$anketa_answers_cnt, 'is_active'=>$anketa_is_active, 'anketa_is_copy'=>$anketa_is_copy, 'anketa_i_uid'=>$anketa_i_uid, 'anketa_e_uid'=>$anketa_e_uid,'anketa_canEdit'=>$anketa_canEdit));
- }
- echo '</div>';
- }
- }
- echo '</li>';
- }
- }
- echo '</ul>';
- // izpi?emo javascript za resizable
- echo '<script type="text/javascript">';
- echo '$(document).ready(function() {';
- // echo '$().ready(function() {';
- foreach ( $this->settingsArray as $opcija ) {
- if ($opcija['visible'] == 1) {
- echo '$("#h_'.$opcija['header_field'].'").resizable({handles:"e", alsoResize: "'.$opcija['alsoResize'].'"'.
- (isset($opcija['minWidth'])?', minWidth: '.$opcija['minWidth']:'').(isset($opcija['maxWidth'])?', maxWidth: '.$opcija['maxWidth']:'').
- ', stop: function(event, ui) { save_surveyListCssSettings(event, ui); }'.'});';
- }
- }
+ // Paginacija
+ echo '<div class="pagination top">';
+ $this->displayPagiantion();
+ echo '</div>';
- // ponastavimo ?irine celic z JS
- $css_data = $this->getCssSetings();
- if (isset($css_data) && count($css_data)>0) {
- foreach ($css_data as $css_key => $css) {
- echo '$(".'.$css_key.'").width('.$css.');';
- }
- }
-
- // prika?emo seznam
- echo '$("#surveyList").show();';
- // header title priredimo sirino
+ // Filtri na desni
+ if($this->onlyPhone == false){
- foreach ( $groupWidths as $grupa => $widths ) {
- //echo '$("#'.$grupa.'").css( { "width": ($("#'.$grupa.'_holder").width()-5)+"px"});';
- // chrome bux fix --mitja
- echo '$("#'.$grupa.'").css( { "width": "100%"});';
- }
- echo '});';
- echo '</script>';
+ echo '<div class="filters">';
+
+ // Preklop na pogled s folderji (samo ce imamo nov vmesnik)
+ //echo '<div id="folderSwitch">';
+ $this->displayFolderSwitch();
+ //echo '</div>';
+
+ // Gumb za filtriranje
+ //echo '<div id="filterButton">';
+ $this->displayFilterButton();
+ //echo '</div>';
+
+ // Gumb za sortiranje
+ echo '<div id="sortButton">';
+ $this->displaySortButton();
+ echo '</div>';
+
+ echo '</div>';
+ }
}
+ else{
+ // Okno z nastavitvami searcha
+ echo '<div id="searchSettings">';
+ $this->displaySearchSettings();
+ echo '</div>';
+ }
+
+ echo '</div>';
+
- echo '</div>'; // id="div_sl"
-
- }
+ // Izris seznama anket
+ if($this->show_folders == 1 && $this->isSearch != 1){
+
+ echo '<div class="div_sl_new folders">';
+ // Loop po vseh folderjih prvega nivoja - samo na prvi strani
+ if($this->pageno == 1){
+
+ // Plus za dodajanje folderja
+ echo '<div class="folder_add_first"><a href="#" title="'.$lang['srv_mySurvey_create_folder'].'" onClick="create_folder(\''.(isset($folder['id'])?$folder['id']:0).'\'); return false;">';
+ echo ' <span class="faicon add"></span><span>'.$lang['srv_mySurvey_create_folder'].'</span>';
+ echo '</a></div>';
+
+ $sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE usr_id='$global_user_id' AND parent='0' ORDER BY naslov ASC");
+ if(mysqli_num_rows($sql) > 0) {
+ while($row = mysqli_fetch_array($sql)){
+ echo '<div id="folder_holder_'.$row['id'].'" class="folder_holder level1">';
+ $this->displayNewFolder($row);
+ echo '</div>';
+ }
+ }
+ }
+
+ // Na koncu se izpisemo ankete ki niso v nobenem folderju
+ $row = array('id'=>0, 'naslov'=>$lang['srv_mySurvey_unallocated']);
+ echo '<div id="folder_holder_0" class="folder_holder level1">';
+ $this->displayNewFolder($row);
+ echo '</div>';
+
+ echo '<script type="text/javascript">surveyList_folder_init();</script>';
+
+ echo '</div>';
+ }
+ // Ce ne prikazujemo map je vse po starem
+ else{
+
+ echo '<div class="div_sl_new">';
+ $this->displayNewSurveyList($folder=-1);
+ echo '</div>';
+ }
+
+ // Paginacija - se na dnu - ni prikazana pri searchu
+ if($this->isSearch != 1){
+ echo '<div class="pagination_bottom_holder">';
+ echo ' <div class="pagination bottom">';
+ $this->displayPagiantion();
+ echo ' </div>';
+ echo '</div>';
+ }
+
+ // Klik izven "Vec" - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".survey_other_box, .dots");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".survey_other_box").addClass("displayNone");
+ }
+ });
+ </script>';
+ }
/** Kreacija nove ankete
*/
@@ -1206,14 +1049,20 @@ class SurveyList {
global $admin_type;
global $site_url;
- echo '<span id="buttonCreate" class="floatLeft"><a href="' . $site_url . 'admin/survey/index.php?a=ustvari_anketo" title="' . $lang['srv_create_survey'] . '">';
+ echo '<a href="'.$site_url.'admin/survey/index.php?a=ustvari_anketo" title="'.$lang['srv_create_survey'].'">';
+ echo ' <button class="large blue button_create">';
echo $lang['srv_create_survey'];
- echo '</a></span>';
+ echo ' </button>';
+ echo '</a>';
// uporabniki z vklopljeno moznostjo imajo tudi hitro ustvarjanje ankete (brez vnosa imena in izbire skina)
$oneclickCreateMySurveys = UserSetting::getInstance()->getUserSetting('oneclickCreateMySurveys');
if ($oneclickCreateMySurveys == 1) {
- echo '<span class="floatLeft" style="margin:10px 0 0 20px; font-weight:600;"><a style="vertical-align:0px; line-height:18px;" href="#" onclick="newAnketaBlank();" title="' . $lang['one_click_create'] . '"><span style="vertical-align:top;" class="faicon add icon-blue-hover-orange"></span> <span>'.$lang['one_click_create'].'</span></a>';
+ echo '<div class="button_quick_create">';
+ echo ' <a href="#" onclick="newAnketaBlank();" title="'.$lang['one_click_create'].'">';
+ echo ' <span class="faicon add"></span><span>'.$lang['one_click_create'].'</span>';
+ echo ' </a>';
+ echo '</div>';
}
}
@@ -1225,16 +1074,7 @@ class SurveyList {
if (SRV_LIST_GET_AS_LIST == true) {
$ankete = $this->getSurveysAsListNew($folder);
-
- // Ce searchamo izrisemo napredne nastavitve za search
- if($this->isSearch == 1){
- echo '<div id="searchSettings">';
- $this->displaySearchSettings();
- echo '</div>';
-
- echo '<div class="clr"></div>';
- }
-
+
echo '<input type="hidden" id="sortby" value="'.(isset($_POST['sortby']) ? $_POST['sortby'] : null).'">';
echo '<input type="hidden" id="sorttype" value="'.(isset($_POST['sorttype']) ? $_POST['sorttype'] : null).'">';
@@ -1265,80 +1105,48 @@ class SurveyList {
// HEADER VRSTICA
echo '<tr class="sl_header_new">';
-
- // Info ikona
- echo '<td class="col1">';
- echo '</td>';
-
- // Tip ankete (forma, navadna, glasovanje)
- //echo '<td class="col2"></td>';
- // Aktivnost ankete
- echo '<td class="col2"></td>';
-
+
// Naslov
- echo '<td class="col3">';
+ echo '<td class="col1">';
echo $this->createOrderUrlNew(1, $lang['title']);
echo '</td>';
// Trajanje - status
- echo '<td class="col4">';
+ echo '<td class="col2">';
echo $this->createOrderUrlNew(18, 'Status');
echo '</td>';
- // Tip + st. vprasanj
- echo '<td class="col5">';
- echo '';
- echo $this->createOrderUrlNew(19, $lang['srv_tip']);
+ // Ustvarjeno
+ echo '<td class="col3">';
+ echo $this->createOrderUrlNew(10, $lang['srv_created']);
echo '</td>';
// Zadnji vnos
- echo '<td class="col6">';
+ echo '<td class="col4">';
echo $this->createOrderUrlNew(16, $lang['srv_last_insrt']);
echo '</td>';
// Sprememba
- echo '<td class="col7">';
+ echo '<td class="col5">';
echo $this->createOrderUrlNew(14, $lang['change']);
echo '</td>';
- // Ikona1
- echo '<td class="col8"></td>';
-
- // Ikona2
- echo '<td class="col9"></td>';
-
+ // Ostalo
+ echo '<td class="col6">';
+ echo $lang['more2'];
+ echo '</td>';
+
echo '</tr>';
// VRSTICE Z ANKETAMI
foreach ( $ankete as $anketa ) {
- echo '<tr id="anketa_list_'.$anketa['id'].'" class="anketa_list '.($this->show_folders == 1 ? ' mySurvey_draggable' : '').'" anketa_id="'.$anketa['id'].'">';
-
- // Info ikona
- echo '<td class="col1">';
- //var_dump($anketa);
- echo '<span id="info_icon_'.$anketa['id'].'" anketa="'.$anketa['id'].'" class="faicon info icon-as_link pointer icon-center" title="'.$lang['srv_survey_info'].'" onClick="surveyList_info(\''.$anketa['id'].'\');"></span>';
- echo '</td>';
-
- // Aktivnost - neaktivna, aktivna, zakljucena
- echo '<td class="col2">';
- if ($anketa['active'] == 1) {
- echo '<div class="dot blue" title="'.$lang['srv_anketa_active2'].'"></div>';
- } else {
- $sqlA = sisplet_query("SELECT sid FROM srv_activity WHERE sid='".$anketa['id']."'");
- if (mysqli_num_rows($sqlA) > 0) {
- # anketa je zaključena
- echo '<div class="dot grey" title="'.$lang['srv_survey_non_active'].'"></div>';
- } else {
- # anketa je neaktivna
- echo '<div class="dot grey" title="'.$lang['srv_survey_non_active_notActivated'].'"></div>';
- }
- }
- echo '</td>';
-
+ echo '<tr id="anketa_list_'.$anketa['id'].'" class="anketa_list '.($this->show_folders == 1 ? ' mySurvey_draggable' : '').'" anketa_id="'.$anketa['id'].'">';
+
// Naslov
- echo '<td class="col3">';
+ echo '<td class="col1">';
+
if(strlen($anketa['naslov']) > 60)
$text = substr($anketa['naslov'],0,60);
else
@@ -1352,133 +1160,199 @@ class SurveyList {
// Pobarvamo najden niz v naslovu ankete
preg_match_all("/$search_word+/i", $text_searched, $matches);
if (is_array($matches[0]) && count($matches[0]) >= 1) {
- foreach ($matches[0] as $match) {
- $text_searched = str_replace($match, '<span class="red">'.$match.'</span>', $text_searched);
- }
+
+ // Drugace vcasih pobrise presledek, ne vem kako drugace resit:)
+ $text_searched = str_replace(' ', '&nbsp;', $text_searched);
+
+ $text_searched = str_replace($matches[0][0], '<span class="red">'.$matches[0][0].'</span>', $text_searched);
}
}
}
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.$anketa['id'].'&a='.A_REDIRECTLINK.'" title="'.$text.'">';
- echo '<span class="title">'.$text_searched.'</span>';
- echo '</a>';
+ // Zgornja vrstica
+ echo '<div class="top_line">';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$anketa['id'].'&a='.A_REDIRECTLINK.'" title="'.$text.'">'.$text_searched.'</a>';
+ echo '</div>';
- $i_time = substr($anketa['i_time'], 0, 8);
- $i_time = explode('.', $i_time);
- echo '<br /><span class="small">';
+ // Spodnja vrstica
+ echo '<div class="bottom_line">';
+
if($anketa['mobile_created'] == '1')
echo '<span class="red spaceRight pointer" title="'.$lang['srv_mobile_survey'].'">M</span>';
- // Ce gre za search moramo ustrezno pobarvati najden del besede
- $name_searched = $anketa['i_name'];
- $surname_searched = $anketa['i_surname'];
- if($this->isSearch == 1 && $this->searchSettings['stype'] == '1'){
- foreach($this->searchStringProcessed as $search_word){
-
- // Pobarvamo najden niz v imenu
- preg_match_all("/$search_word+/i", $name_searched, $matches);
- if (is_array($matches[0]) && count($matches[0]) >= 1) {
- foreach ($matches[0] as $match) {
- $name_searched = str_replace($match, '<span class="red">'.$match.'</span>', $name_searched);
- }
- }
-
- // Pobarvamo najden niz v priimku
- preg_match_all("/$search_word+/i", $surname_searched, $matches);
- if (is_array($matches[0]) && count($matches[0]) >= 1) {
- foreach ($matches[0] as $match) {
- $surname_searched = str_replace($match, '<span class="red">'.$match.'</span>', $surname_searched);
- }
- }
- }
- }
- echo $lang['srv_h_sl_avtor'].': '.$name_searched.' '.$surname_searched.', '.$i_time[0].'.'.$i_time[1].'.20'.$i_time[2].'</span>';
+
+ if($anketa['survey_type'] == 0)
+ echo $lang['srv_vrsta_survey_type_0'];
+ elseif($anketa['survey_type'] == 1)
+ echo $lang['srv_vrsta_survey_type_1'];
+ elseif(SurveyInfo::checkSurveyModule('hierarhija', $anketa['id']))
+ echo $lang['srv_vrsta_survey_type_10'];
+ else
+ echo $lang['srv_vrsta_survey_type_2'];
+
+ echo ', '.$lang['srv_h_sl_stvprasanj'].': '. $anketa['variables'];
+ echo '</div>';
+
echo '</td>';
+
// Trajanje - status
- echo '<td class="col4">';
+ echo '<td class="col2">';
+
if ($anketa['active'] == 1) {
$now = time();
$do = explode('.', $anketa['trajanjedo']);
$do = strtotime($do[0].'.'.$do[1].'.20'.$do[2]);
$trajanje = $do - $now;
$trajanje = floor($trajanje/60/60/24) + 1;
- if($trajanje >= 0){
+
+ if($trajanje >= 0){
+
// Ce je aktivna za vec kot 2000 dni je trajna
- if($trajanje > 2000)
- echo $lang['srv_trajna_anketa'];
- else
- echo $lang['more'].' '.$trajanje.' '.$lang['hour_days'];
+ if($trajanje > 2000){
+ $status_text = $lang['srv_trajna_anketa'];
+ }
+ else{
+ $status_text = $lang['more'].' '.$trajanje.' '.$lang['hour_days'];
+ }
}
else{
- echo $lang['srv_trajna_anketa'];
+ $status_text = $lang['srv_trajna_anketa'];
}
+
+ $status_color = 'green';
}
else {
$sqlA = sisplet_query("SELECT sid FROM srv_activity WHERE sid='".$anketa['id']."'");
- if (mysqli_num_rows($sqlA) > 0) {
+
+ if (mysqli_num_rows($sqlA) > 0) {
# anketa je zaključena
- echo $lang['srv_survey_list_closed'];
- } else {
+ $status_text = $lang['srv_survey_list_closed'];
+ $status_color = 'blue';
+ }
+ else {
# anketa je neaktivna
- echo $lang['srv_survey_list_inpreparation'];
+ $status_text = $lang['srv_survey_list_inpreparation'];
+ $status_color = 'gray';
}
}
+
+ echo ' <div class="status_box '.$status_color.'">'.$status_text.'</div>';
+
echo '</td>';
- // Tip + st. vprasanj
- echo '<td class="col5">';
- if($anketa['survey_type'] == 0)
- echo $lang['srv_vrsta_survey_type_0'];
- elseif($anketa['survey_type'] == 1)
- echo $lang['srv_vrsta_survey_type_1'];
- elseif(SurveyInfo::checkSurveyModule('hierarhija', $anketa['id']))
- echo $lang['srv_vrsta_survey_type_10'];
- else
- echo $lang['srv_vrsta_survey_type_2'];
-
- echo '<br /><span class="small">'.$lang['srv_h_sl_stvprasanj'].': '. $anketa['variables'].'</span>';
+
+ // Ustvarjeno
+ echo '<td class="col3">';
+
+ // Ce gre za search moramo ustrezno pobarvati najden del besede
+ $name_searched = $anketa['i_name'];
+ $surname_searched = $anketa['i_surname'];
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '1'){
+ foreach($this->searchStringProcessed as $search_word){
+
+ // Pobarvamo najden niz v imenu
+ preg_match_all("/$search_word+/i", $name_searched, $matches);
+ if (is_array($matches[0]) && count($matches[0]) >= 1) {
+ foreach ($matches[0] as $match) {
+ $name_searched = str_replace($match, '<span class="red">'.$match.'</span>', $name_searched);
+ }
+ }
+
+ // Pobarvamo najden niz v priimku
+ preg_match_all("/$search_word+/i", $surname_searched, $matches);
+ if (is_array($matches[0]) && count($matches[0]) >= 1) {
+ foreach ($matches[0] as $match) {
+ $surname_searched = str_replace($match, '<span class="red">'.$match.'</span>', $surname_searched);
+ }
+ }
+ }
+ }
+
+ $i_time = substr($anketa['i_time'], 0, 8);
+ $i_time = explode('.', $i_time);
+
+ echo '<div class="top_line">';
+ echo $i_time[0].'.'.$i_time[1].'.20'.$i_time[2];
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo $name_searched.' '.$surname_searched;
+ echo '</div>';
+
echo '</td>';
+
// Zadnji vnos
- echo '<td class="col6">';
+ echo '<td class="col4">';
+
+ echo '<div class="top_line">';
if($anketa['answers'] > 0){
$v_time = substr($anketa['v_time_last'], 0, 8);
$v_time = explode('.', $v_time);
- echo $v_time[0].'.'.$v_time[1].'.20'.$v_time[2].'<br />';
+
+ // Nimamo parapodatkov
+ if($anketa['v_time_last'] == '00.00.00 0:00')
+ echo $lang['srv_survey_list_no_paradata'];
+ else
+ echo $v_time[0].'.'.$v_time[1].'.20'.$v_time[2];
}
else{
- echo '/<br />';
+ echo '/';
}
- echo '<span class="small">'.$lang['srv_info_answers'].': '.$anketa['answers'].'</span>';
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo $lang['srv_info_answers_no'].': '.$anketa['answers'];
+ echo '</div>';
+
echo '</td>';
+
// Sprememba
- echo '<td class="col7">';
+ echo '<td class="col5">';
+
+ echo '<div class="top_line">';
$e_time = substr($anketa['e_time'], 0, 8);
$e_time = explode('.', $e_time);
- echo $e_time[0].'.'.$e_time[1].'.20'.$e_time[2].'<br />';
-
- echo '<a href="#" onclick="surveyList_user(\'e\',\'#edit_user_'.$anketa['id'].'\');">';
- echo '<span id="edit_user_'.$anketa['id'].'" euid="'.$anketa['edit_uid'].'" class="email">'.$anketa['e_email'].'</span>';
- echo '</a>';
+ echo $e_time[0].'.'.$e_time[1].'.20'.$e_time[2];
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo ' <span id="edit_user_'.$anketa['id'].'" euid="'.$anketa['edit_uid'].'" onclick="surveyList_user(\'e\',\'#edit_user_'.$anketa['id'].'\');">'.$anketa['e_email'].'</span>';
+ echo '</div>';
+
echo '</td>';
- // Knjiznica - uporabnik
- echo '<td class="col8">';
- echo '<a href="#" title="'.($anketa['lib_usr'] == 1 ? $lang['srv_ank_mylib_off'] : $lang['srv_ank_mylib_on']).'" onclick="surveyList_myknjiznica_new(\''.$anketa['id'].'\'); return false;">';
- echo '<span class="sprites '.($anketa['lib_usr'] == 1 ? ' sl_active_on': ' sl_active_off').'"></span>';
- echo '</a>';
- echo '</td>';
+
+ // Ostalo
+ echo '<td class="col6 other_link">';
- // Knjiznica - global (samo admin)
- echo '<td class="col9">';
- if ($this->g_adminType == 0){
- echo '<a href="#" title="'.($anketa['lib_glb'] == 1 ? $lang['srv_ank_lib_off'] : $lang['srv_ank_lib_on']).'" onclick="surveyList_knjiznica_new(\''.$anketa['id'].'\'); return false;">';
- echo '<span class="sprites '.($anketa['lib_glb'] == 1 ? ' sl_library_on': ' sl_library_off').'"></span>';
- echo '</a>';
- }
+ echo ' <span class="faicon dots" onClick="surveyList_show_more(\''.$anketa['id'].'\');"></span>';
+
+ // Hover okno
+ echo ' <div class="survey_other_box_holder">';
+ echo ' <div id="survey_other_box_'.$anketa['id'].'" class="survey_other_box displayNone"><ul>';
+
+ SurveyInfo::getInstance()->SurveyInit($anketa['id']);
+ echo ' <li><a href="' . SurveyInfo::getSurveyLink() . '?preview=on" target="_blank" title="'.$lang['srv_poglejanketo2'].'"><span class="faicon monitor"></span> '.$lang['srv_poglejanketo2'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=testiranje"><span class="faicon test"></span>'.$lang['srv_testiranje'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=vabila"><span class="faicon publish"></span>'.$lang['srv_vabila'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=data"><span class="faicon data"></span>'.$lang['srv_podatki'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=analysis"><span class="faicon chart"></span>'.$lang['srv_analiza'].'</a></li>';
+
+ echo ' <li><div class="line"></li>';
+
+ echo ' <li><input type="checkbox" id="lib_private_'.$anketa['id'].'" '.($anketa['lib_usr'] == 1 ? 'checked="checked"' : '').' onclick="surveyList_myknjiznica_new(\''.$anketa['id'].'\'); return false;"><label for="lib_private_'.$anketa['id'].'">'.$lang['srv_moja_knjiznica'].'</label></li>';
+ if ($this->g_adminType == 0){
+ echo ' <li><input type="checkbox" id="lib_public_'.$anketa['id'].'" '.($anketa['lib_glb'] == 1 ? 'checked="checked"' : '').' onclick="surveyList_knjiznica_new(\''.$anketa['id'].'\'); return false;"><label for="lib_public_'.$anketa['id'].'">'.$lang['srv_javna_knjiznica'].'</label></li>';
+ }
+
+ echo ' </ul></div>';
+ echo ' </div>';
+
echo '</td>';
-
+
+
echo '</tr>';
}
@@ -1499,41 +1373,56 @@ class SurveyList {
// Izris nerazvrscenih anket
if($folder['id'] == 0){
- echo '<div class="folder_title droppable" id="folder_0" folder_id="0">';
+ echo '<div class="folder_title open droppable" id="folder_0" folder_id="0">';
- echo '<a href="#" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"><span class="faicon minus icon-blue pointer"></span></a>';
+ echo '<span class="faicon folder_arrow_icon" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"></span>';
- echo ' <span class="spaceRight" style="vertical-align:0px;">'.$folder['naslov'].'</span>';
+ echo ' <span>'.$folder['naslov'].'</span>';
+
+ // Dodaten div za klik za razpiranje
+ echo '<div class="folder_clickable" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"></div>';
// Ikona za dodajanje folderja
echo '</div>';
- echo '<div id="folder_content_0" class="folder_content '.(/*$this->pageno == 1*/false ? ' closed' : '').'">';
+ echo '<div id="folder_content_0" class="folder_content">';
$this->displayNewSurveyList($folder=0);
echo '</div>';
}
else{
- echo '<div class="folder_title mySurvey_draggable droppable" id="folder_'.$folder['id'].'" folder_id="'.$folder['id'].'">';
- if($folder['open'] == 1)
- echo '<a href="#" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"><span class="faicon minus icon-blue pointer"></span></a>';
- else
- echo '<a href="#" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"><span class="faicon plus icon-blue pointer"></span></a>';
+ echo '<div class="folder_title '.($folder['open'] == 1 ? 'open' : 'closed').' mySurvey_draggable droppable" id="folder_'.$folder['id'].'" folder_id="'.$folder['id'].'">';
+ // Puscica za odpiranje/zapiranje
+ echo '<span class="faicon folder_arrow_icon" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"></span>';
+
+ // Ikona mape
+ echo '<span class="faicon folder_icon"></span>';
+
// Naslov folderja
- echo ' <span class="faicon folder icon-blue"></span> <span id="folder_title_text_'.$folder['id'].'" class="folder_title_text spaceRight" style="vertical-align:0px;"><a href="#" onClick="edit_title_folder(\''.$folder['id'].'\'); return false;">'.$folder['naslov'].'</a></span>';
+ echo '<div id="folder_title_text_'.$folder['id'].'" class="folder_title_text" onClick="edit_title_folder(\''.$folder['id'].'\'); return false;">'.$folder['naslov'].'</div>';
- // Ikona za dodajanje folderja
- echo ' <a href="#" title="'.$lang['srv_mySurvey_create_subfolder'].'" onClick="create_folder(\''.$folder['id'].'\'); return false;"><span class="faicon add icon-blue pointer map_holder_control"></span></a>';
+
+ echo '<div class="map_holder_control">';
+
+ // Ikona za dodajanje folderja
+ echo '<a href="#" title="'.$lang['srv_mySurvey_create_subfolder'].'" onClick="create_folder(\''.$folder['id'].'\'); return false;"><span class="faicon add"></span></a>';
// Ikona za brisanje folderja
- echo ' <a href="#" title="'.$lang['srv_mySurvey_delete_folder'].'" onClick="delete_folder(\''.$folder['id'].'\'); return false;"><span class="faicon remove icon-orange pointer map_holder_control"></span></a>';
+ echo '<a href="#" title="'.$lang['srv_mySurvey_delete_folder'].'" onClick="delete_folder(\''.$folder['id'].'\'); return false;"><span class="faicon remove"></span></a>';
// Ikona za kopiranje folderja - samo admini
if($admin_type == 0)
- echo ' &nbsp;<a href="#" title="'.$lang['srv_mySurvey_copy_folder'].'" onClick="copy_folder(\''.$folder['id'].'\'); return false;"><span class="faicon copy icon-blue_soft pointer map_holder_control"></span></a>';
+ echo '<a href="#" title="'.$lang['srv_mySurvey_copy_folder'].'" onClick="copy_folder(\''.$folder['id'].'\'); return false;"><span class="faicon copy"></span></a>';
echo '</div>';
+
+
+ // Dodaten div za klik za razpiranje
+ echo '<div class="folder_clickable" onClick="toggle_folder(\''.$folder['id'].'\'); return false;"></div>';
+
+
+ echo '</div>';
echo '<div id="folder_content_'.$folder['id'].'" class="folder_content '.($folder['open'] == 1 ? '' : ' closed').' '.($folder['parent'] != 0 ? ' subfolder' : '').'">';
@@ -1565,6 +1454,7 @@ class SurveyList {
# ali sploh izrisujemo paginacijo
if ($this->max_pages > 1) {
+
if ($this->onlyPhone == false) {
$baseUrl = $site_url."admin/survey/index.php?pageno=";
} else {
@@ -1574,12 +1464,11 @@ class SurveyList {
# povezava na prejšnjo stran
$prev_page = $this->pageno - 1;
if($prev_page >= 1) {
- //echo('<div><a href="'.$baseUrl.$prev_page.'">'.$lang['previous_page_short'].'</a></div>');
- echo('<div><a href="'.$baseUrl.$prev_page.'"><span class="faicon pagination_left icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- //echo('<div class="disabledPage">'.$lang['previous_page_short'].'</div>');
- echo('<div class="disabledPage"><span class="faicon pagination_left icon-blue_soft"></span></div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
}
# povezave za vmesne strani
@@ -1587,44 +1476,46 @@ class SurveyList {
$skipped = false;
for($a = 1; $a <= $this->max_pages; $a++) {
if ($this->max_pages < ((SRV_LIST_GROUP_PAGINATE+1) * 2) || $a <= SRV_LIST_GROUP_PAGINATE || $a > ($this->max_pages-SRV_LIST_GROUP_PAGINATE)
-
|| ( abs($a-$this->pageno) < SRV_LIST_GROUP_PAGINATE)) {
if ($skipped == true) {
+
echo '<div class="spacePage">.&nbsp;.&nbsp;.</div>';
+
$skipped = false;
}
+
if($a == $this->pageno) {
# brez href povezave
- echo('<div class="currentPage">'.$a.'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$a.'">'.$a.'</a></div>');
+ echo '<div class="page_number currentPage">'.$a.'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$a.'"><div class="page_number">'.$a.'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
+
# povezava na naslednjo stran
$next_page = $this->pageno + 1;
if($next_page <= $this->max_pages) {
- //echo('<div><a href="'.$baseUrl.$next_page.'">'.$lang['next_page_short'].'</a></div>');
- echo('<div><a href="'.$baseUrl.$next_page.'"><span class="faicon pagination_right icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- //echo('<div class="disabledPage">'.$lang['next_page_short'].'</div>');
- echo('<div class="disabledPage"><span class="faicon pagination_right icon-blue_soft"></span></div>');
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
}
}
}
// Prikazemo gumb za sortiranje seznama anket
- private function displaySortButton(){
+ protected function displaySortButton(){
global $lang, $site_url;
- echo $lang['orderby'];
- //echo ' <img style="margin-left:5px; vertical-align:middle;" src="'.$site_url.'admin/survey/img_new/bullet_arrow_down.png">';
-
-
+ echo '<span class="faicon sort"></span>';
+
echo '<div id="sortSettings">';
echo '<ul>';
@@ -1638,14 +1529,14 @@ class SurveyList {
$img_src = 'sort_descending';
}
- echo '<a href="#" onClick="surveyList_goTo(\'1\',\''.($this->sortby != 1 ? '1' : $sort).'\')"><li '.($this->sortby == 1 ? ' class="active"' : '').'>'.$lang['sort_by_title'].' <span class="faicon '.($this->sortby != 1 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'6\',\''.($this->sortby != 6 ? '1' : $sort).'\')"><li '.($this->sortby == 6 ? ' class="active"' : '').'>'.$lang['sort_by_qcount'].' <span class="faicon '.($this->sortby != 6 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'5\',\''.($this->sortby != 5 ? '1' : $sort).'\')"><li '.($this->sortby == 5 ? ' class="active"' : '').'>'.$lang['sort_by_answercount'].' <span class="faicon '.($this->sortby != 5 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'16\',\''.($this->sortby != 16 ? '1' : $sort).'\')"><li '.($this->sortby == 16 ? ' class="active"' : '').'>'.$lang['sort_by_insert'].' <span class="faicon '.($this->sortby != 16 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'14\',\''.($this->sortby != 14 ? '1' : $sort).'\')"><li '.($this->sortby == 14 ? ' class="active"' : '').'>'.$lang['sort_by_edit'].' <span class="faicon '.($this->sortby != 14 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'18\',\''.($this->sortby != 18 ? '1' : $sort).'\')"><li '.($this->sortby == 18 ? ' class="active"' : '').'>Status <span class="faicon '.($this->sortby != 18 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'7\',\''.($this->sortby != 7 ? '1' : $sort).'\')"><li '.($this->sortby == 7 ? ' class="active"' : '').'>'.$lang['sort_by_author'].' <span class="faicon '.($this->sortby != 7 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
- echo '<a href="#" onClick="surveyList_goTo(\'11\',\''.($this->sortby != 11 ? '1' : $sort).'\')"><li '.($this->sortby == 11 ? ' class="active"' : '').' style="border:0;">'.$lang['sort_by_editor'].' <span class="faicon '.($this->sortby != 11 ? 'sort_unsorted' : $img_src).'"></span></li></a>';
+ echo '<li '.($this->sortby == 1 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'1\',\''.($this->sortby != 1 ? '1' : $sort).'\')">'.$lang['sort_by_title'].' <span class="faicon '.($this->sortby != 1 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 6 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'6\',\''.($this->sortby != 6 ? '1' : $sort).'\')">'.$lang['sort_by_qcount'].' <span class="faicon '.($this->sortby != 6 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 5 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'5\',\''.($this->sortby != 5 ? '1' : $sort).'\')">'.$lang['sort_by_answercount'].' <span class="faicon '.($this->sortby != 5 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 16 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'16\',\''.($this->sortby != 16 ? '1' : $sort).'\')">'.$lang['sort_by_insert'].' <span class="faicon '.($this->sortby != 16 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 14 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'14\',\''.($this->sortby != 14 ? '1' : $sort).'\')">'.$lang['sort_by_edit'].' <span class="faicon '.($this->sortby != 14 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 18 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'18\',\''.($this->sortby != 18 ? '1' : $sort).'\')">Status <span class="faicon '.($this->sortby != 18 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 7 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'7\',\''.($this->sortby != 7 ? '1' : $sort).'\')"><li '.($this->sortby == 7 ? ' class="active"' : '').'>'.$lang['sort_by_author'].' <span class="faicon '.($this->sortby != 7 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 11 ? ' class="active"' : '').' style="border:0;"><a href="#" onClick="surveyList_goTo(\'11\',\''.($this->sortby != 11 ? '1' : $sort).'\')">'.$lang['sort_by_editor'].' <span class="faicon '.($this->sortby != 11 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
echo '</ul>';
@@ -1653,29 +1544,26 @@ class SurveyList {
}
// Prikazemo gumb za filtriranje seznama anket
- private function displayFilterButton(){
+ protected function displayFilterButton(){
global $lang, $site_url, $admin_languages;
echo '<div id="filterButton" '.(($this->user_id || $this->lang_id != 0 || $this->gdpr != 0) ? 'class="active"' : '').'>';
- echo $lang['srv_analiza_filter'];
- //echo ' <img style="margin-left:5px; vertical-align:middle;" src="'.$site_url.'admin/survey/img_new/bullet_arrow_down.png">';
-
+ echo '<span class="faicon filter"></span>';
echo '<div id="filterSettings">';
echo '<ul>';
-
-
+
# filter po uporabniku
echo '<li>';
- echo '<span class="filter_title">'.$lang['srv_list_author'].'</span><br />';
+ echo '<span class="filter_title">'.$lang['srv_list_author'].'</span>';
// Ce preklapljamo v searchu moramo refreshati celo stran (druga js funkcija)
$reload = ($this->isSearch == 1) ? '_reload' : '';
- echo '<input type="radio" name="filter_mySurveys" id="filter_mySurveys_0" value="0" '.(!$this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'clr\',\'0\');"> <label for="filter_mySurveys_0">'.$lang['srv_list_all_surveys'].'</label>';
- echo '<br /><input type="radio" name="filter_mySurveys" id="filter_mySurveys_1" value="1" '.($this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'uid\',\''.$this->g_uid.'\');"> <label for="filter_mySurveys_1">'.$lang['srv_list_my_surveys'].'</label>';
+ echo '<span class="filter_line"><input type="radio" name="filter_mySurveys" id="filter_mySurveys_0" value="0" '.(!$this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'clr\',\'0\');"> <label for="filter_mySurveys_0">'.$lang['srv_list_all_surveys'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_mySurveys" id="filter_mySurveys_1" value="1" '.($this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'uid\',\''.$this->g_uid.'\');"> <label for="filter_mySurveys_1">'.$lang['srv_list_my_surveys'].'</label></span>';
echo '</li>';
@@ -1683,11 +1571,11 @@ class SurveyList {
# filter po jeziku
echo '<li>';
- echo '<span class="filter_title">'.$lang['srv_sl_set_language'].'</span><br />';
+ echo '<span class="filter_title">'.$lang['srv_sl_set_language'].'</span>';
- echo '<input type="radio" name="filter_language" id="filter_language_0" value="0" '.((int)$this->lang_id == 0 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'0\');"> <label for="filter_language_0">'.$lang['srv_sl_set_language_all'].'</label>';
- echo '<br /><input type="radio" name="filter_language" id="filter_language_1" value="1" '.((int)$this->lang_id == 1 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'1\');"> <label for="filter_language_1">'.$admin_languages['1'].'</label>';
- echo '<br /><input type="radio" name="filter_language" id="filter_language_2" value="2" '.((int)$this->lang_id == 2 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'2\');"> <label for="filter_language_2">'.$admin_languages['2'].'</label>';
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_0" value="0" '.((int)$this->lang_id == 0 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'0\');"> <label for="filter_language_0">'.$lang['srv_sl_set_language_all'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_1" value="1" '.((int)$this->lang_id == 1 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'1\');"> <label for="filter_language_1">'.$admin_languages['1'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_2" value="2" '.((int)$this->lang_id == 2 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'2\');"> <label for="filter_language_2">'.$admin_languages['2'].'</label></span>';
echo '</li>';
@@ -1695,11 +1583,10 @@ class SurveyList {
# filter po GDPR anketah
echo '<li>';
- echo '<span class="filter_title">'.$lang['srv_gdpr'].'</span><br />';
+ echo '<span class="filter_title">'.$lang['srv_gdpr'].'</span>';
- echo '<input type="radio" name="filter_gdpr" id="filter_gdpr_0" value="0" '.((int)$this->gdpr == 0 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'0\');"> <label for="filter_gdpr_0">'.$lang['srv_list_all_surveys'].'</label>';
- echo '<br /><input type="radio" name="filter_gdpr" id="filter_gdpr_1" value="1" '.((int)$this->gdpr == 1 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'1\');"> <label for="filter_gdpr_1">'.$lang['srv_list_gdpr_gdpr'].'</label>';
- //echo '<br /><input type="radio" name="filter_gdpr" id="filter_gdpr_2" value="2" '.((int)$this->gdpr == 2 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'2\');"> <label for="filter_gdpr_2">'.$lang['srv_list_gdpr_no_gdpr'].'</label>';
+ echo '<span class="filter_line"><input type="radio" name="filter_gdpr" id="filter_gdpr_0" value="0" '.((int)$this->gdpr == 0 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'0\');"> <label for="filter_gdpr_0">'.$lang['srv_list_all_surveys'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_gdpr" id="filter_gdpr_1" value="1" '.((int)$this->gdpr == 1 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'1\');"> <label for="filter_gdpr_1">'.$lang['srv_list_gdpr_gdpr'].'</label></span>';
echo '</li>';
@@ -1711,8 +1598,8 @@ class SurveyList {
}
// Prikazemo preklop med navadnim pogledom in pogledom s folderji
- private function displayFolderSwitch(){
- global $lang, $global_user_id;
+ protected function displayFolderSwitch(){
+ global $lang, $global_user_id, $site_url;
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
@@ -1721,11 +1608,19 @@ class SurveyList {
if(!$userAccess->checkUserAccess('my_survey_folders')){
echo '<div title="'.$lang['srv_mySurvey_show_folders_desc'].'" id="folderSwitch" class="user_access_locked" onClick="popupUserAccess(\'my_survey_folders\');">';
echo $lang['srv_mySurvey_show_folders'];
+ echo ' <div class="switch_folders off"></div>';
echo '</div>';
}
else{
- echo '<div title="'.$lang['srv_mySurvey_show_folders_desc'].'" id="folderSwitch" '.($this->show_folders == 1 ? ' class="active"' : '').' onClick="switchFolder(\''.$this->show_folders.'\');">';
- echo $lang['srv_mySurvey_show_folders'];
+ echo '<div title="'.$lang['srv_mySurvey_show_folders_desc'].'" id="folderSwitch" onClick="switchFolder(\''.$this->show_folders.'\');">';
+ echo ' <span>'.$lang['srv_mySurvey_show_folders'].'</span>';
+
+ // Stikalo za folderje
+ if($this->show_folders == 1)
+ echo ' <div class="switch_folders on"></div>';
+ else
+ echo ' <div class="switch_folders off"></div>';
+
echo '</div>';
}
}
@@ -1739,103 +1634,101 @@ class SurveyList {
}
// Prikazemo nastavitve za napredno iskanje ce iscemo po anketah
- private function displaySearchSettings(){
+ protected function displaySearchSettings(){
global $lang;
global $site_url;
- // Posebej imamo skrito polje s parametri da jih ohranimo pri ajax klicih
- echo '<input type="hidden" id="searchParams" name="searchParams" value="'.$this->getSearchParams().'" />';
-
- echo '<span class="title">'.$lang['s_search_settings_my'].'</span>';
+ // NAPREDNE NASTAVITVE ISKANJA
+ $show_advanced_search = false;
+ if($this->searchSettings['sstatus'] != '0'
+ || $this->searchSettings['sidatefrom'] != ''
+ || $this->searchSettings['sidateto'] != ''
+ || $this->searchSettings['sedatefrom'] != ''
+ || $this->searchSettings['sedateto'] != ''){
- echo '<form method="GET" id="1kasf2" action="'.$site_url.'admin/survey/index.php">';
+ $show_advanced_search = true;
+ }
+
+ echo '<form method="GET" id="1kasf2" action="'.$site_url.'admin/survey/index.php">';
+
+
+ // Zgornja vrstica z geslom in gumbom za iskanje
+ echo '<div class="search_settings_top">';
+
+ // Posebej imamo skrito polje s parametri da jih ohranimo pri ajax klicih
+ echo '<input type="hidden" id="searchParams" name="searchParams" value="'.$this->getSearchParams().'" />';
// Iskano geslo
- echo '<p>';
- echo ' <span class="bold">'.$lang['s_search2'].':</span> <input type="text" name="search" id="searchMySurveyText" value="'.htmlentities($this->searchString).'" placeholder="' . $lang['s_search'] . '" />';
- echo '</p>';
+ echo '<div class="search_text">';
+ echo ' <input type="text" name="search" id="searchMySurveyText" value="'.htmlentities($this->searchString).'" placeholder="'.$lang['s_search'].'" />';
+ echo '</div>';
// Iskanje po naslovu ali avtorju ali besedilu
- echo '<p>';
- echo ' <span>'.$lang['s_thru'].': </span>';
- echo ' <label for="stype_0"><input type="radio" name="stype" id="stype_0" value="0" '.($this->searchSettings['stype'] == '0' ? ' checked="checked"' : '').' />'.$lang['s_title'].'</label>';
- echo ' <label for="stype_1"><input type="radio" name="stype" id="stype_1" value="1" '.($this->searchSettings['stype'] == '1' ? ' checked="checked"' : '').' />'.$lang['s_author'].'</label>';
- echo ' <label for="stype_2"><input type="radio" name="stype" id="stype_2" value="2" '.($this->searchSettings['stype'] == '2' ? ' checked="checked"' : '').' />'.$lang['s_text'].'</label>';
- echo '</p>';
-
-
- // NAPREDNE NASTAVITVE ISKANJA
- $show_advanced_search = false;
- if($this->searchSettings['sstatus'] != '0'
- || $this->searchSettings['sidatefrom'] != ''
- || $this->searchSettings['sidateto'] != ''
- || $this->searchSettings['sedatefrom'] != ''
- || $this->searchSettings['sedateto'] != ''){
+ echo '<div class="search_type">';
+ echo ' <select name="stype" id="stype">';
+ echo ' <option value="0" '.($this->searchSettings['stype'] == '0' ? ' selected="selected"' : '').'>'.$lang['s_title'].'</option>';
+ echo ' <option value="1" '.($this->searchSettings['stype'] == '1' ? ' selected="selected"' : '').'>'.$lang['s_author'].'</option>';
+ echo ' <option value="2" '.($this->searchSettings['stype'] == '2' ? ' selected="selected"' : '').'>'.$lang['s_text'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ // Gumb isci
+ echo '<div class="search_button">';
+ echo ' <a href="#" onclick="$(\'#1kasf2\').submit(); return false;"><button class="medium blue">'.$lang['s_search'].'</button></a>';
+ echo '</div>';
+
+ echo '</div>';
- $show_advanced_search = true;
- }
- echo '<span class="advancedSearchButton clr bold spaceLeft">';
- echo ' <a href="#" onClick="showAdvancedSearch(); return false;">';
- echo '<span class="faicon '.($show_advanced_search ? ' minus': 'plus').'"></span> ' . $lang['s_advanced'];
- echo ' </a>';
- echo '</span>';
+ // Gumba za napredne nastavitve
+ echo '<div class="search_settings_advanced_buttons">';
- echo '<div id="advancedSearch" '.($show_advanced_search ? '' : ' style="display:none;"').'>';
+ echo ' <button type="button" id="advanced_settings_button" class="white-black small '.($show_advanced_search ? 'active': '').'" onClick="showAdvancedSearch(); return false;">';
+ echo ' <span class="faicon search"></span>'.$lang['s_advanced'];
+ echo ' </button>';
+
+ // Gumb nazaj na moje ankete
+ echo ' <a href="'.$site_url.'admin/survey/index.php?a=pregledovanje"><button type="button" class="white-black small">';
+ echo ' <span class="faicon clipboard_notes"></span>'.$lang['s_search_mySurvey_back'];
+ echo ' </button></a>';
+
+ echo '</div>';
+
- // Metaadmin lahko dodatno omeji search po avtorju
- if(Dostop::isMetaAdmin()){
- echo '<p>';
- echo ' <span class="bold">'.$lang['s_search_metaadmin'].':</span> <input type="text" name="onlyAuthor" id="onlyAuthor" value="'.htmlentities($this->searchSettings['onlyAuthor']).'" placeholder="' . $lang['s_search'] . '" />';
- echo '</p>';
- }
+ // Okno z naprednimi nastavitvami
+ echo '<div id="advancedSearch" class="search_settings_advanced" '.($show_advanced_search ? '' : ' style="display:none;"').'>';
// Status ankete (aktivna, neaktivna, zakljucena)
- echo '<p>';
- echo ' <span>'.$lang['s_activity'].': </span>';
- echo ' <label for="sstatus_0"><input type="radio" name="sstatus" id="sstatus_0" value="0" '.($this->searchSettings['sstatus'] == '0' ? ' checked="checked"' : '').' />'.$lang['s_all_surveys'].'</label>';
- echo ' <label for="sstatus_1"><input type="radio" name="sstatus" id="sstatus_1" value="1" '.($this->searchSettings['sstatus'] == '1' ? ' checked="checked"' : '').' />'.$lang['s_active_surveys'].'</label>';
- echo ' <label for="sstatus_2"><input type="radio" name="sstatus" id="sstatus_2" value="2" '.($this->searchSettings['sstatus'] == '2' ? ' checked="checked"' : '').' />'.$lang['s_nonactive_surveys'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['s_activity'].': </span>';
+ echo ' <div class="setting_line"><input type="radio" name="sstatus" id="sstatus_0" value="0" '.($this->searchSettings['sstatus'] == '0' ? ' checked="checked"' : '').'><label for="sstatus_0">'.$lang['s_all_surveys'].'</label></div>';
+ echo ' <div class="setting_line"><input type="radio" name="sstatus" id="sstatus_1" value="1" '.($this->searchSettings['sstatus'] == '1' ? ' checked="checked"' : '').'><label for="sstatus_1">'.$lang['s_active_surveys'].'</label></div>';
+ echo ' <div class="setting_line"><input type="radio" name="sstatus" id="sstatus_2" value="2" '.($this->searchSettings['sstatus'] == '2' ? ' checked="checked"' : '').'><label for="sstatus_2">'.$lang['s_nonactive_surveys'].'</label></div>';
+ echo '</div>';
// Datum ustvarjanja ankete
- echo '<p>';
- echo ' <span class="spaceRight">'.$lang['s_itime'].': </span>';
- echo ' <span class="spaceRight">'.$lang['s_from2'].' <input type="text" id="sidatefrom" name="sidatefrom" value="'.$this->searchSettings['sidatefrom'].'" autocomplete="off" size="12" /></span>';
- echo ' <span>'.$lang['s_to'].' <input type="text" id="sidateto" name="sidateto" value="'.$this->searchSettings['sidateto'].'" autocomplete="off" size="12" /></span>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['s_itime'].': </span>';
+ echo ' <div class="setting_line"><span>'.$lang['srv_activate_duration_manual_from'].' <input type="text" id="sidatefrom" name="sidatefrom" value="'.$this->searchSettings['sidatefrom'].'" autocomplete="off" size="12" /></span></div>';
+ echo ' <div class="setting_line"><span>'.$lang['srv_activate_duration_manual_to'].' <input type="text" id="sidateto" name="sidateto" value="'.$this->searchSettings['sidateto'].'" autocomplete="off" size="12" /></span></div>';
+ echo '</div>';
// Datum zadnjega urejanja ankete
- echo '<p>';
- echo ' <span class="spaceRight">'.$lang['s_etime'].': </span>';
- echo ' <span class="spaceRight">'.$lang['s_from2'].' <input type="text" id="sedatefrom" name="sedatefrom" value="'.$this->searchSettings['sedatefrom'].'" autocomplete="off" size="12" /></span>';
- echo ' <span>'.$lang['s_to'].' <input type="text" id="sedateto" name="sedateto" value="'.$this->searchSettings['sedateto'].'" autocomplete="off" size="12" /></span>';
- echo '</p>';
-
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['s_etime'].': </span>';
+ echo ' <div class="setting_line"><span>'.$lang['srv_activate_duration_manual_from'].' <input type="text" id="sedatefrom" name="sedatefrom" value="'.$this->searchSettings['sedatefrom'].'" autocomplete="off" size="12" /></span></div>';
+ echo ' <div class="setting_line"><span>'.$lang['srv_activate_duration_manual_to'].' <input type="text" id="sedateto" name="sedateto" value="'.$this->searchSettings['sedateto'].'" autocomplete="off" size="12" /></span></div>';
echo '</div>';
-
-
- // Gumba isci in zapri
- echo '<span style="margin-top: 10px;" class="floatRight spaceRight">';
- echo ' <div class="buttonwrapper floatLeft spaceRight">';
- echo ' <a class="ovalbutton ovalbutton_gray" href="'.$site_url.'admin/survey/index.php"><span>'.$lang['s_search_mySurvey_back'].'</span></a>';
- echo ' </div>';
- echo ' <div class="buttonwrapper floatRight">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#1kasf2\').submit(); return false;"><span>'.$lang['s_search'].'</span></a>';
- echo ' </div>';
- echo '</span>';
-
- // Gumb nazaj na moje ankete
- /*echo '<span style="margin:5px 20px 0 5px;" class="floatRight bold">';
- echo ' <a href="'.$site_url.'admin/survey/index.php"><span>'.$lang['s_search_mySurvey_back'].'</span></a>';
- echo '</span>';*/
-
- // Link na isci po knjiznici
- echo '<span class="link"><a href="'.$site_url.'admin/survey/index.php?a=knjiznica&search='.$this->searchString.'">'.$lang['s_search_Library'].'</a></span>';
-
- echo '<input style="display: none;" value="Išči" type="submit">';
-
- echo '</form>';
+
+ // Metaadmin lahko dodatno omeji search po avtorju
+ if(Dostop::isMetaAdmin()){
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['s_search_metaadmin'].': </span>';
+ echo ' <div class="setting_line"><input type="text" name="onlyAuthor" id="onlyAuthor" value="'.htmlentities($this->searchSettings['onlyAuthor']).'" placeholder="'.$lang['s_search'].'"></div>';
+ echo '</div>';
+ }
+
+ echo '</div>';
// JS za koledar
@@ -1849,11 +1742,15 @@ class SurveyList {
changeYear: true,
dateFormat: "dd.mm.yy",
showAnim: "slideDown",
- showOn: "button",
+ showOn: "both",
buttonText: ""
});
});
- </script>';
+ </script>';
+
+ echo '<input style="display: none;" value="Išči" type="submit">';
+
+ echo '</form>';
}
// Prikazemo search okno za iskanje po anketah
@@ -1863,13 +1760,12 @@ class SurveyList {
echo '<form method="GET" id="1kasmysurvey" action="'.$site_url.'admin/survey/index.php">';
- //echo '<span class="sprites search"></span> ';
- echo '<input id="searchMySurvey" type="text" value="" placeholder="' . $lang['s_search_mySurvey'] . '" name="search" />';
+ echo '<input id="searchMySurvey" type="text" value="" placeholder="'.$lang['s_search_mySurvey'].'" name="search" />';
- //echo '<input type="submit" value="' . $lang['s_search'] . '" />';
- echo ' <div class="buttonwrapper floatRight">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="$(\'#1kasmysurvey\').submit(); return false;"><span>'.$lang['s_search2'].'</span></a>';
- echo ' </div>';
+ echo ' <button class="medium white-black" onclick="$(\'#1kasmysurvey\').submit(); return false;">';
+ //echo $lang['s_search2'];
+ echo ' <span class="faicon search"></span>';
+ echo ' </button>';
echo '</form>';
}
@@ -1887,7 +1783,7 @@ class SurveyList {
if ($this->g_uid > 0) {
$saved_surveyList_string = UserSetting::getInstance()->getUserSetting('survey_list_order');
$saved_surveyList_visible_string = UserSetting::getInstance()->getUserSetting('survey_list_visible');
- $saved_surveyList_visible = array_unique(explode(",",$saved_surveyList_visible_string));
+ $saved_surveyList_visible = array_unique(explode(",",isset($saved_surveyList_visible_string)?$saved_surveyList_visible_string:''));
if (isset($saved_surveyList_string) && $saved_surveyList_string != "" && !$display_default ) {
$saved_surveyList_order = array_unique(explode(",",$saved_surveyList_string));
$izBaze = true;
@@ -2033,6 +1929,11 @@ class SurveyList {
$stringSurveyList .= "LEFT OUTER JOIN srv_spremenljivka AS ss ON ss.gru_id = sg.id ";
$stringSurveyList .= "LEFT OUTER JOIN srv_vrednost AS sv ON sv.spr_id = ss.id ";
}
+
+ // Ce iscemo po imenu ankete moramo dodat se tabele srv_nice_links za lepe linke
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '0'){
+ $stringSurveyList .= "LEFT OUTER JOIN srv_nice_links AS nl ON sa.id = nl.ank_id ";
+ }
$stringSurveyList .= "WHERE sa.backup='0' AND sa.id>0 AND active >= '0' AND invisible = '0' ";
@@ -2173,32 +2074,8 @@ class SurveyList {
}
return $result;
}
-
- private function createOrderUrl($id=null, $txt) {
-
- if (!isset($id) || $id == null || $id == "") {
- $id=1;
- }
-
- if ($this->sortby != $id ) {
- $img_src = 'sort_unsorted';
- $result='<div onClick="surveyList_goTo(\''.$id.'\',\'1\')">'.$txt.'</div>';
- } else {
-
- if ($this->sorttype == 2) {
- $img_src = 'sort_ascending';
- $result='<div onClick="surveyList_goTo(\''.$id.'\',\'1\')" class="red">'.$txt.'<span class="faicon '.$img_src.'" title=""></span></div>';
- } else {
- $img_src = 'sort_descending';
-
- $result='<div onClick="surveyList_goTo(\''.$id.'\',\'2\')" class="red">'.$txt.'<span class="faicon '.$img_src.'" title=""></span></div>';
- }
- }
-
- return $result;
- }
-
- private function createOrderUrlNew($id=null, $txt) {
+
+ protected function createOrderUrlNew($id, $txt) {
global $site_url;
if (!isset($id) || $id == null || $id == "") {
@@ -2207,11 +2084,13 @@ class SurveyList {
if ($this->sortby != $id ) {
$result='<div onClick="surveyList_goTo(\''.$id.'\',\'1\')">'.$txt.'</div>';
- } else {
+ }
+ else {
if ($this->sorttype == 2) {
$result='<div class="active" onClick="surveyList_goTo(\''.$id.'\',\'1\')">'.$txt.'<span class="active faicon after sort_up_arrow icon-orange"/></div>';
- } else {
+ }
+ else {
$result='<div class="active" onClick="surveyList_goTo(\''.$id.'\',\'2\')">'.$txt.'<span class="active faicon after sort_down_arrow icon-orange"/></div>';
}
}
@@ -2229,7 +2108,7 @@ class SurveyList {
$result = '<strong><a href="'.$site_url.'admin/survey/index.php?anketa='.$id.'&a='.A_REDIRECTLINK.'" title="'.$text.'">'.$text.'</a></strong>';
} elseif ($type == 'active') {
$result = '<a href="/" onclick="anketa_active(\''.$id.'\',\''.(int)$text.'\',\'true\'); return false;">' .
- '<span class="faicon '.((int)$text==1?'star_on':'star_off').'" alt="'.(int)$text.'" title="'.((int)$text==1?$lang['srv_anketa_active']:$lang['srv_anketa_noactive']).'"></span>'.
+ '<span class="faicon '.((int)$text==1?'star_on':'star_off').'" alt="'.(int)$text.'" title="'.((int)$text==1?$lang['srv_anketa_active']:$lang['srv_anketa_noactive']).'"> </span>'.
'</a>';
} elseif ($type == 'delete') {
if ((int)$options['anketa_canEdit'] > 0) {
@@ -2415,8 +2294,6 @@ class SurveyList {
$cnt1hour = mysqli_num_rows($qry1hour);
$cnt12hour = mysqli_num_rows($qry12hour);
$cnt24hour = mysqli_num_rows($qry24hour);
-
-
}
@@ -2545,7 +2422,7 @@ class SurveyList {
}
/** vrne sql string za omejevanje dostopa uporabniku */
- function getLanguageLimit() {
+ protected function getLanguageLimit() {
global $global_admin_type;
if ((int)$this->lang_id > 0) {
@@ -2554,7 +2431,7 @@ class SurveyList {
}
/** vrne sql string za omejevanje dostopa uporabniku */
- function getDostopAnketa() {
+ protected function getDostopAnketa() {
global $global_admin_type;
global $global_user_id;
@@ -2607,7 +2484,7 @@ class SurveyList {
}
/** vrne order string za SQL s katerim sortiramo */
- private function getOrderString() {
+ protected function getOrderString() {
if (!isset($this->sortby) || (int)$this->sortby == 0) {
$this->sortby = SRV_LIST_ORDER_BY;
@@ -2640,13 +2517,13 @@ class SurveyList {
}
/** vrne Limit string za SQL s katerim prika?emo posamezno stran */
- private function getLimitString() {
+ protected function getLimitString() {
$result = " LIMIT " . ($this->pageno * $this->rec_per_page - $this->rec_per_page) . ", " . $this->rec_per_page;
return $result;
}
// vrne sql string za search po anketah glede na nastavitve searcha
- private function getSearchString(){
+ protected function getSearchString(){
$search_text = mysqli_real_escape_string($GLOBALS['connect_db'], $this->searchString);
$search_text = stripslashes(stripslashes($search_text));
@@ -2700,7 +2577,7 @@ class SurveyList {
}
// Search po naslovu
else{
- $result = " AND (LOWER(sa.naslov) LIKE LOWER('".$search_text."') OR LOWER(sa.akronim) LIKE LOWER('".$search_text."'))";
+ $result = " AND (LOWER(sa.naslov) LIKE LOWER('".$search_text."') OR LOWER(sa.akronim) LIKE LOWER('".$search_text."') OR LOWER(nl.link) LIKE LOWER('".$search_text."'))";
}
// Search po statusu (aktivne, neaktivne)
@@ -2745,7 +2622,7 @@ class SurveyList {
}
// Dobimo vse parametri searcha
- private function getSearchParams(){
+ protected function getSearchParams(){
global $site_url;
$params = '';
@@ -2862,12 +2739,15 @@ class SurveyList {
$anketa = $_POST['anketa'];
$sql = sisplet_query("SELECT * FROM srv_library_anketa WHERE ank_id='$anketa' AND uid='$global_user_id'");
+
if (mysqli_num_rows($sql) > 0) {
sisplet_query("DELETE FROM srv_library_anketa WHERE ank_id='$anketa' AND uid='$global_user_id'");
sisplet_query("UPDATE srv_survey_list SET lib_usr='0' WHERE id='$anketa'");
- } else {
+ }
+ else {
$sql1 = sisplet_query("SELECT * FROM srv_library_folder WHERE uid='$global_user_id' AND tip='1' AND parent='0'");
$row1 = mysqli_fetch_array($sql1);
+
sisplet_query("INSERT INTO srv_library_anketa (ank_id, uid, folder) VALUES ('$anketa', '$global_user_id', '$row1[id]')");
sisplet_query("UPDATE srv_survey_list SET lib_usr='1' WHERE id='$anketa'");
}
@@ -3077,25 +2957,31 @@ class SurveyList {
$to_update = $meta_surveys_ids;
- # poiščemmo katere ankete so OK, in jih odstranimo iz seznama anket potrebnih za update
- $stringSurveyList = "SELECT id FROM srv_survey_list WHERE id IN (".implode(',', $meta_surveys_ids).")"
- #. " AND (updated = '0' OR (updated = '1' AND TIME_TO_SEC(TIMEDIFF(NOW(),last_updated)) < ".SRV_LIST_UPDATE_TIME_LIMIT.")) AND ( last_updated IS NOT NULL)";
- . " AND updated = '0' AND last_updated IS NOT NULL";
- $sqlSurveyList = sisplet_query($stringSurveyList);
- while ( $rowSurveyList = mysqli_fetch_assoc($sqlSurveyList)) {
- if (isset($to_update[$rowSurveyList['id']])) {
- unset($to_update[$rowSurveyList['id']]);
- }
- }
+ if(!empty($meta_surveys_ids)){
+
+ # poiščemmo katere ankete so OK, in jih odstranimo iz seznama anket potrebnih za update
+ $sqlSurveyList = sisplet_query("SELECT id
+ FROM srv_survey_list
+ WHERE id IN (".implode(',', $meta_surveys_ids).")
+ AND updated = '0' AND last_updated IS NOT NULL
+ ");
+ while ( $rowSurveyList = mysqli_fetch_assoc($sqlSurveyList)) {
+ if (isset($to_update[$rowSurveyList['id']])) {
+ unset($to_update[$rowSurveyList['id']]);
+ }
+ }
+ }
+
}
else{
$to_update = $this->surveys_ids;
# poiščemmo katere ankete so OK, in jih odstranimo iz seznama anket potrebnih za update
- $stringSurveyList = "SELECT id FROM srv_survey_list WHERE id IN (".implode(',', $this->surveys_ids).")"
- #. " AND (updated = '0' OR (updated = '1' AND TIME_TO_SEC(TIMEDIFF(NOW(),last_updated)) < ".SRV_LIST_UPDATE_TIME_LIMIT.")) AND ( last_updated IS NOT NULL)";
- . " AND updated = '0' AND last_updated IS NOT NULL";
- $sqlSurveyList = sisplet_query($stringSurveyList);
+ $sqlSurveyList = sisplet_query("SELECT id
+ FROM srv_survey_list
+ WHERE id IN (".implode(',', $this->surveys_ids).")
+ AND updated = '0' AND last_updated IS NOT NULL
+ ");
while ( $rowSurveyList = mysqli_fetch_assoc($sqlSurveyList)) {
if (isset($to_update[$rowSurveyList['id']])) {
unset($to_update[$rowSurveyList['id']]);
@@ -3111,10 +2997,6 @@ class SurveyList {
. ' IF(ISNULL(sla1.lib_glb),0,sla1.lib_glb) AS lib_glb,'
. ' IF(ISNULL(sla2.lib_usr),0,sla2.lib_usr) AS lib_usr,'
- // Po novem ne joinamo s tabelo "users", ker je lahko query pocasen in zaklene tabelo - potem pa vse zasteka (dodano preventivno)
- //. ' sa.edit_uid, us1.name AS e_name, us1.surname AS e_surname, us1.email AS e_email,'
- //. ' sa.insert_uid, us2.name AS i_name, us2.surname AS i_surname, us2.email AS i_email,'
-
. " us3.vnos_time_first AS v_time_first, us3.vnos_time_last AS v_time_last,"
. ' IF(ISNULL(us3.answers),0,us3.answers) as answers,'
. ' IF(ISNULL(g.variables),0,g.variables) as variables,'
@@ -3126,16 +3008,13 @@ class SurveyList {
AS sla1 ON sla1.ank_id = sa.id"
. " LEFT OUTER JOIN ( SELECT ank_id, uid, COUNT(*) AS lib_usr FROM srv_library_anketa as sla WHERE sla.uid = '".$this->g_uid."' AND sla.ank_id IN (".implode(',', $to_update).") GROUP BY ank_id )
AS sla2 ON sla2.ank_id = sa.id"
-
- //. ' LEFT OUTER JOIN users AS us1 ON us1.id = sa.edit_uid'
- //. ' LEFT OUTER JOIN users AS us2 ON us2.id = sa.insert_uid'
- . ' LEFT OUTER JOIN ( SELECT us3.ank_id, COUNT(us3.ank_id) as answers, MIN( us3.time_insert ) as vnos_time_first, MAX( us3.time_insert ) as vnos_time_last, preview FROM srv_user as us3 WHERE us3.ank_id IN ('.implode(',', $to_update).') AND us3.preview = \'0\' AND us3.deleted=\'0\' GROUP BY us3.ank_id )
+ . ' LEFT OUTER JOIN ( SELECT us3.ank_id, COUNT(us3.ank_id) as answers, MIN( us3.time_insert ) as vnos_time_first, MAX( us3.time_insert ) as vnos_time_last, preview FROM srv_user as us3 WHERE us3.ank_id IN ('.implode(',', $to_update).') AND us3.preview = \'0\' AND us3.deleted=\'0\' AND us3.testdata=\'0\' AND (us3.last_status=\'5\' OR us3.last_status=\'6\') AND us3.lurker=\'0\' GROUP BY us3.ank_id )
AS us3 ON us3.ank_id = sa.id'
. ' LEFT OUTER JOIN ( SELECT g.ank_id, COUNT(s.gru_id) as variables FROM srv_grupa g, srv_spremenljivka s WHERE g.id = s.gru_id AND g.ank_id IN ('.implode(',', $to_update).') GROUP BY g.ank_id )
AS g ON g.ank_id = sa.id'
- //spodaj dodaj AND us5.lurker=\'0\'
+
. ' LEFT OUTER JOIN ( SELECT us5.ank_id, COUNT(us5.ank_id) as approp, preview FROM srv_user as us5 WHERE last_status IN (' . $this->appropriateStatus . ') AND us5.ank_id IN ('.implode(',', $to_update).') AND us5.preview =\'0\' AND us5.deleted=\'0\' GROUP BY us5.ank_id )
AS us5 ON us5.ank_id = sa.id'
@@ -3160,12 +3039,6 @@ class SurveyList {
$values = array();
while ( $row = mysqli_fetch_assoc($sqlUpdateList)) {
- /*$row[i_name] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[i_name]);
- $row[i_surname] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[i_surname]);
- $row[i_email] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[i_email]);
- $row[e_name] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[e_name]);
- $row[e_surname] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[e_surname]);
- $row[e_email] = mysqli_real_escape_string($GLOBALS['connect_db'], $row[e_email]);*/
$row['i_name'] = mysqli_real_escape_string($GLOBALS['connect_db'], $users[$row['id']]['i_name']);
$row['i_surname'] = mysqli_real_escape_string($GLOBALS['connect_db'], $users[$row['id']]['i_surname']);
diff --git a/admin/survey/classes/class.SurveyListFolders.php b/admin/survey/classes/class.SurveyListFolders.php
new file mode 100644
index 0000000..cedb687
--- /dev/null
+++ b/admin/survey/classes/class.SurveyListFolders.php
@@ -0,0 +1,1206 @@
+<?php
+
+/**
+ * Moje ankete - nov prikaz direktorijev (19.9.2022)
+ */
+
+
+class SurveyListFolders extends SurveyList{
+
+
+ private $current_folder = array();
+ private $surveys_count = array();
+
+
+ // Prikazemo pogled s folderji
+ public function getSurveys() {
+ global $global_user_id;
+ global $lang;
+
+
+ // Nastavimo trenutni folder na root
+ $this->current_folder = array(
+ 'id' => 0,
+ 'naslov' => $lang['srv_mySurvey_all_surveys']
+ );
+
+
+ echo '<div class="survey_list_folders">';
+
+ // Levi meni s folderji
+ echo ' <div id="left_content" class="left_content">';
+ $this->displayLeftContent();
+ echo ' </div>';
+
+ // Desna vsebina
+ echo ' <div id="right_content" class="right_content">';
+ $this->displayRightContent();
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // JS za drag/drop
+ echo '<script type="text/javascript">mySurvey_folder_init();</script>';
+ }
+
+
+
+ // Izpisemo levo stran - seznam folderjev
+ private function displayLeftContent(){
+ global $lang;
+
+ echo '<div class="title">'.$lang['srv_mySurvey_your_folders'].'</div>';
+
+ // Izpisemo seznam folder s seznamom childov v rootu
+ echo '<ul id="folder_list_0" class="folder_list">';
+ $this->displayFolderList(0);
+ echo '</ul>';
+
+ // Prikazemo se skrit div za dodaten popup (rename, add - title)
+ echo '<div id="mySurvey_additional_popup" class="divPopUp"></div>';
+
+ // Klik izven "Vec" - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".folder_item_settings, .dots_ver");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".folder_item_settings").addClass("displayNone");
+ $(".dots_ver_folder").removeClass("active");
+ }
+
+ var container2 = $(".item_settings, .dots_ver");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".item_settings").addClass("displayNone");
+ $(".dots_ver_item").removeClass("active");
+ }
+ });
+
+ initHideLibraryArrows();
+ </script>';
+ }
+
+ // Izpisemo seznam folderjev za posameznega parenta
+ private function displayFolderList($folder_id){
+ global $global_user_id;
+
+ // Izpisemo folder box
+ $folder_open = $this->displayFolder($folder_id);
+
+ // Izpisemo se vse subfolderje
+ echo '<ul id="folder_list_'.$folder_id.'" class="folder_list" '.($folder_open ? '' : 'style="display:none;"').'">';
+
+ $sqlChildren = sisplet_query("SELECT id FROM srv_mysurvey_folder WHERE usr_id='".$global_user_id."' AND parent='".$folder_id."' ORDER BY naslov ASC");
+ while($rowChildren = mysqli_fetch_array($sqlChildren)){
+ $this->displayFolderList($rowChildren['id']);
+ }
+
+ echo '</ul>';
+ }
+
+ // Izpisemo posamezen folder
+ private function displayFolder($folder_id){
+ global $lang;
+ global $global_user_id;
+
+ // Ce gre za root folder dobimo stevilo anket brez folderja
+ if($folder_id == '0'){
+
+ // Prestejemo ankete po folderjih
+ $this->countSurveysInFolders();
+
+ // Preverimo, ce ni noben drug folder aktiviran - potem je aktiviran root
+ $sql = sisplet_query("SELECT COUNT(id) AS active_count FROM srv_mysurvey_folder WHERE active='1' AND usr_id='".$global_user_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ $folder_active = ($row['active_count'] == 0) ? 'active' : '';
+ $folder_open = 'open';
+ }
+ // Ce ne gre za root folder dobimo podatke o folderju
+ else{
+
+ // Dobimo podatke folderja
+ $sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE id='".$folder_id."'");
+ if (!$sql)
+ echo mysqli_error($GLOBALS['connect_db']);
+
+ $row = mysqli_fetch_array($sql);
+
+ // Nastavimo, ce je to trenutno odprt folder
+ if($row['active'] == '1')
+ $this->current_folder = $row;
+
+ $folder_active = ($row['active'] == '1') ? 'active' : '';
+ $folder_open = ($row['open'] == '1') ? 'open' : '';
+ }
+
+
+ // Izrisemo folder box
+ // Ce je root
+ if($folder_id == '0'){
+ echo '<li id="folder_item_'.$folder_id.'" class="folder_item '.$folder_open.' '.$folder_active.' mySurvey_droppable" folder_id="'.$folder_id.'" onClick="mySurvey_folder_activate(\''.$folder_id.'\');">';
+
+ echo '<span class="faicon folder"></span>';
+
+ echo '<div class="folder_item_title">'.$lang['srv_mySurvey_all_surveys'].'</div>';
+ echo '<span class="folder_item_child_count">'.(isset($this->surveys_count['0']) ? $this->surveys_count['0'] : '0').'</span>';
+
+ // Urejanje folderja
+ // Tri pikice za prikaz urejanja folderja
+ echo ' <span class="faicon dots_ver dots_ver_folder" onClick="mySurvey_folder_show_edit(this);"></span>';
+
+ // Skrit div za urejanje folderja
+ echo ' <div class="folder_item_settings displayNone">';
+ echo ' <ul>';
+ echo ' <li onClick="mySurvey_folder_add_popup(\''.$folder_id.'\');">'.$lang['srv_mySurvey_create_subfolder'].'</li>';
+ echo ' </ul>';
+ echo ' </div>';
+ }
+ else{
+ echo '<li id="folder_item_'.$folder_id.'" class="folder_item '.$folder_open.' '.$folder_active.' mySurvey_draggable mySurvey_droppable" folder_id="'.$folder_id.'" onClick="mySurvey_folder_activate(\''.$folder_id.'\');">';
+
+ echo '<span class="faicon arrow" onClick="mySurvey_folder_toggle(\''.$folder_id.'\');"></span>';
+ echo '<span class="faicon folder"></span>';
+
+ echo '<div class="folder_item_title">'.$row['naslov'].'</div>';
+ echo '<span class="folder_item_child_count">'.(isset($this->surveys_count[$folder_id]) ? $this->surveys_count[$folder_id] : '0').'</span>';
+
+ // Urejanje folderja
+ // Tri pikice za prikaz urejanja folderja
+ echo ' <span class="faicon dots_ver dots_ver_folder" onClick="mySurvey_folder_show_edit(this);"></span>';
+
+ // Skrit div za urejanje folderja
+ echo ' <div class="folder_item_settings displayNone">';
+ echo ' <ul>';
+ echo ' <li onClick="mySurvey_folder_add_popup(\''.$folder_id.'\');">'.$lang['srv_mySurvey_create_subfolder'].'</li>';
+ echo ' <li onClick="mySurvey_folder_rename_popup(\''.$folder_id.'\', \''.$row['naslov'].'\');">'.$lang['srv_mySurvey_rename_folder'].'</li>';
+ echo ' <li onClick="mySurvey_folder_delete(\''.$folder_id.'\');">'.$lang['srv_mySurvey_delete_folder'].'</li>';
+ echo ' </ul>';
+ echo ' </div>';
+ }
+
+ echo '</li>';
+
+
+ // Vrnemo, ce je folder odprt ali ne
+ if($folder_open == 'open')
+ return true;
+ else
+ return false;
+ }
+
+ // Dodaten popup za ime direktorija pri dodajanju
+ private function displayAddFolderPopup($folder_id){
+ global $lang;
+
+ echo '<h2>'.$lang['srv_library_folder_name'].'</h2>';
+
+ echo '<div>';
+ echo ' <input type="text" id="mySurvey_folder_name" class="large">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="mySurvey_folder_close_popup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="mySurvey_folder_add(\''.$folder_id.'\');">'.$lang['srv_mySurvey_create_subfolder'].'</button>';
+ echo '</div>';
+ }
+
+ // Dodaten popup za ime direktorija pri preimenovanju
+ private function displayRenameFolderPopup($folder_id, $folder_name){
+ global $lang;
+
+ echo '<h2>'.$lang['srv_library_folder_name'].'</h2>';
+
+ echo '<div>';
+ echo ' <input type="text" id="mySurvey_folder_name" class="large" value="'.$folder_name.'">';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="mySurvey_folder_close_popup();">'.$lang['edit1338'].'</button>';
+ echo ' <button class="medium blue" onClick="mySurvey_folder_rename(\''.$folder_id.'\');">'.$lang['srv_mySurvey_rename_folder'].'</button>';
+ echo '</div>';
+ }
+
+
+
+ // Izpisemo desnostran - vsebino odprtega folderja
+ private function displayRightContent(){
+
+ // Naslov trenutnega folderja
+ echo '<div class="folder_title">';
+ $this->displayFolderTitle();
+ echo '</div>';
+
+
+ // Vrstica z gumbi, filtri - niso prikazane pri searchu
+ echo '<div class="second_line">';
+
+ if($this->isSearch != 1){
+ $this->displayButtonsRow();
+ }
+ else{
+ // Okno z nastavitvami searcha
+ echo '<div id="searchSettings">';
+ $this->displaySearchSettings();
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ # koliko imamo strani
+ $survey_count = (isset($this->surveys_count[$this->current_folder['id']]) ? $this->surveys_count[$this->current_folder['id']] : 0);
+ $this->max_pages = (int)$this->rec_per_page > 0 ? ceil($survey_count / $this->rec_per_page) : 1;
+
+ # katera je trenutna stran
+ if (isset($_GET['pageno']) && (int)$_GET['pageno'] > 0) {
+ # izbrana stran ne more biti večja, kot pa imamo vseh strani
+ $this->pageno = min((int)$_GET['pageno'], $this->max_pages);
+ }
+
+
+ // Izris seznama anket
+ echo '<div class="div_sl_new folders">';
+ $this->displayNewSurveyList();
+ echo '</div>';
+
+ // Paginacija - se na dnu - ni prikazana pri searchu
+ if($this->isSearch != 1){
+ echo '<div class="pagination_bottom_holder">';
+ echo ' <div class="pagination bottom">';
+ $this->displayPagiantion();
+ echo ' </div>';
+ echo '</div>';
+ }
+
+
+ // Footer
+ echo '<footer id="srv_footer" class="folders_footer">';
+ $this->displayFooter();
+ echo '</footer>';
+ }
+
+ // Naslov folderja na vrhu
+ private function displayFolderTitle(){
+
+ echo '<span class="faicon folder"></span>';
+ echo $this->current_folder['naslov'];
+ }
+
+ // Izpisemo vrstico z gombi na vrhu (ustvari novo anketo, filtri...)
+ private function displayButtonsRow(){
+ global $global_user_id;
+
+ // Gumb za ustvarjanje ankete
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ /*echo '<div class="create_buttons">';
+ $this->new_anketa_div();
+ echo '</div>';*/
+ }
+ else{
+ echo '<div class="create_buttons">';
+ $this->new_anketa_div();
+ echo '</div>';
+ }
+
+ // Filtri na desni
+ echo '<div class="filters">';
+
+ // Okno za search po mojeih anketah
+ echo ' <div id="searchMySurveys">';
+ $this->displaySearch();
+ echo ' </div>';
+
+ // Preklop na pogled s folderji (samo ce imamo nov vmesnik)
+ //echo '<div id="folderSwitch">';
+ $this->displayFolderSwitch();
+ //echo '</div>';
+
+ // Gumb za filtriranje
+ //echo '<div id="filterButton">';
+ $this->displayFilterButton();
+ //echo '</div>';
+
+ // Gumb za sortiranje
+ echo ' <div id="sortButton">';
+ $this->displaySortButton();
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ // Prikazemo gumb za sortiranje seznama anket
+ protected function displaySortButton(){
+ global $lang, $site_url;
+
+ echo '<span class="faicon sort"></span>';
+
+ echo '<div id="sortSettings">';
+
+ echo '<ul>';
+
+ if($this->sorttype == 2){
+ $sort = 1;
+ $img_src = 'sort_ascending';
+ }
+ else{
+ $sort = 2;
+ $img_src = 'sort_descending';
+ }
+
+ echo '<li '.($this->sortby == 1 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'1\',\''.($this->sortby != 1 ? '1' : $sort).'\')">'.$lang['sort_by_title'].' <span class="faicon '.($this->sortby != 1 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 6 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'6\',\''.($this->sortby != 6 ? '1' : $sort).'\')">'.$lang['sort_by_qcount'].' <span class="faicon '.($this->sortby != 6 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 5 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'5\',\''.($this->sortby != 5 ? '1' : $sort).'\')">'.$lang['sort_by_answercount'].' <span class="faicon '.($this->sortby != 5 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 16 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'16\',\''.($this->sortby != 16 ? '1' : $sort).'\')">'.$lang['sort_by_insert'].' <span class="faicon '.($this->sortby != 16 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 14 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'14\',\''.($this->sortby != 14 ? '1' : $sort).'\')">'.$lang['sort_by_edit'].' <span class="faicon '.($this->sortby != 14 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 18 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'18\',\''.($this->sortby != 18 ? '1' : $sort).'\')">Status <span class="faicon '.($this->sortby != 18 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 7 ? ' class="active"' : '').'><a href="#" onClick="surveyList_goTo(\'7\',\''.($this->sortby != 7 ? '1' : $sort).'\')"><li '.($this->sortby == 7 ? ' class="active"' : '').'>'.$lang['sort_by_author'].' <span class="faicon '.($this->sortby != 7 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+ echo '<li '.($this->sortby == 11 ? ' class="active"' : '').' style="border:0;"><a href="#" onClick="surveyList_goTo(\'11\',\''.($this->sortby != 11 ? '1' : $sort).'\')">'.$lang['sort_by_editor'].' <span class="faicon '.($this->sortby != 11 ? 'sort_unsorted' : $img_src).'"></span></a></li>';
+
+ echo '</ul>';
+
+ echo '</div>';
+ }
+
+ // Prikazemo gumb za filtriranje seznama anket
+ protected function displayFilterButton(){
+ global $lang, $site_url, $admin_languages;
+
+ echo '<div id="filterButton" '.(($this->user_id || $this->lang_id != 0 || $this->gdpr != 0) ? 'class="active"' : '').'>';
+
+ echo '<span class="faicon filter"></span>';
+
+ echo '<div id="filterSettings">';
+ echo '<ul>';
+
+ # filter po uporabniku
+ echo '<li>';
+
+ echo '<span class="filter_title">'.$lang['srv_list_author'].'</span>';
+
+ // Ce preklapljamo v searchu moramo refreshati celo stran (druga js funkcija)
+ $reload = ($this->isSearch == 1) ? '_reload' : '';
+
+ echo '<span class="filter_line"><input type="radio" name="filter_mySurveys" id="filter_mySurveys_0" value="0" '.(!$this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'clr\',\'0\');"> <label for="filter_mySurveys_0">'.$lang['srv_list_all_surveys'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_mySurveys" id="filter_mySurveys_1" value="1" '.($this->user_id ? 'checked="checked"' : '').' onclick="surveyList_user'.$reload.'(\'uid\',\''.$this->g_uid.'\');"> <label for="filter_mySurveys_1">'.$lang['srv_list_my_surveys'].'</label></span>';
+
+ echo '</li>';
+
+
+ # filter po jeziku
+ echo '<li>';
+
+ echo '<span class="filter_title">'.$lang['srv_sl_set_language'].'</span>';
+
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_0" value="0" '.((int)$this->lang_id == 0 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'0\');"> <label for="filter_language_0">'.$lang['srv_sl_set_language_all'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_1" value="1" '.((int)$this->lang_id == 1 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'1\');"> <label for="filter_language_1">'.$admin_languages['1'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_language" id="filter_language_2" value="2" '.((int)$this->lang_id == 2 ? 'checked="checked"' : '').' onclick="surveyList_language'.$reload.'(\'2\');"> <label for="filter_language_2">'.$admin_languages['2'].'</label></span>';
+
+ echo '</li>';
+
+
+ # filter po GDPR anketah
+ echo '<li>';
+
+ echo '<span class="filter_title">'.$lang['srv_gdpr'].'</span>';
+
+ echo '<span class="filter_line"><input type="radio" name="filter_gdpr" id="filter_gdpr_0" value="0" '.((int)$this->gdpr == 0 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'0\');"> <label for="filter_gdpr_0">'.$lang['srv_list_all_surveys'].'</label></span>';
+ echo '<span class="filter_line"><input type="radio" name="filter_gdpr" id="filter_gdpr_1" value="1" '.((int)$this->gdpr == 1 ? 'checked="checked"' : '').' onclick="surveyList_gdpr'.$reload.'(\'1\');"> <label for="filter_gdpr_1">'.$lang['srv_list_gdpr_gdpr'].'</label></span>';
+
+ echo '</li>';
+
+
+ echo '</ul>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ // Izpisemo footer
+ private function displayFooter(){
+ global $lang;
+ global $site_frontend;
+ global $mysql_database_name;
+ global $admin_type;
+
+
+ // Leva stran footerja
+ echo '<div class="footer_left">';
+
+ // Custom footer
+ if(AppSettings::getInstance()->getSetting('app_settings-footer_custom') !== false){
+ echo '<div class="footer_line">';
+ echo AppSettings::getInstance()->getSetting('app_settings-footer_text');
+ echo '</div>';
+ }
+ // Default footer
+ else{
+
+ // First left line - links
+ echo '<div class="footer_line">';
+
+ echo $lang['srv_footer_links'];
+
+ if(isAAI())
+ echo '<span class="footer_item"><a href="https://www.1ka.si/d/sl/pomoc/pogosta-vprasanja/pogosta-vprasanja-o-arnes-aai-prijavi-uporabi-orodja-1ka" target="_blank">'.$lang['aa4'].'</a></span>';
+
+ echo '</div>';
+
+
+ // Second left line - version...
+ echo '<div class="footer_line">';
+
+ // Verzijo izpišemo samo za admine
+ if ($admin_type == 0) {
+
+ // Verzija 1ka
+ $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what='version'", "obj");
+ if (!empty($sqlVersion)) {
+ echo '<span class="footer_item">'.$lang['srv_footer_1ka_version'].': ' . $sqlVersion->value . '</span>';
+ }
+
+ // Verzija Drupal
+ if ($site_frontend == 'drupal') {
+ $sqlDrupal = sisplet_query("SELECT value FROM misc WHERE what='drupal version'", "obj");
+ if (!empty($sqlDrupal)) {
+ echo '<span class="footer_item">Drupal: ' . $sqlDrupal->value . '</span>';
+ }
+ }
+ }
+
+ echo '<span class="footer_item">Copyright (©) 2002-'.date('Y').' '.$lang['srv_footer_copyright'].'</span>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ // Desna stran footerja - report a bug
+ echo '<div id="reportabug" class="footer_right">';
+
+ // www.1ka.si ima se link na go instrukcije
+ if($mysql_database_name == 'real1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'test21kasi'){
+
+ echo '<a href="#" onClick="consultingPopupOpen();"><span class="faicon external_link"></span> '.$lang['srv_svetovanje'].'</a>';
+ echo '<br>';
+ }
+
+ // Posebej report buga za gorenje
+ if (Common::checkModule('gorenje')){
+ echo '<a href="https://helpdesk.gorenje.com/SubmitSR.jsp" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+ }
+ else{
+ // Slovenski jezik
+ if ($lang['id'] == 1){
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+
+ // Zacasen gumb na desni
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032" target="_blank"><div class="right_help_button">'.$lang['srv_footer_reportabug2'].'</div></a>';
+ }
+ // Angleski jezik
+ else{
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"><span class="faicon inline_comment"></span> '.$lang['srv_footer_reportabug'].'</a>';
+
+ // Zacasen gumb na desni
+ echo '<a href="https://www.1ka.si/a/72864?Q1=292032&language=2" target="_blank"><div class="right_help_button">'.$lang['srv_footer_reportabug2'].'</div></a>';
+ }
+ }
+
+ echo '</div>';
+ }
+
+ // Izposemo tabelo z anketami
+ public function displayNewSurveyList($folder=0) {
+ global $lang;
+ global $site_url;
+ global $global_user_id;
+
+
+ $ankete = $this->getSurveysAsListNew($folder);
+
+ echo '<input type="hidden" id="sortby" value="'.(isset($_POST['sortby']) ? $_POST['sortby'] : null).'">';
+ echo '<input type="hidden" id="sorttype" value="'.(isset($_POST['sorttype']) ? $_POST['sorttype'] : null).'">';
+
+ if ($count = count($ankete)) {
+
+ // Naslov za search
+ if($this->isSearch == 1){
+ if($count == 1)
+ $hits = $lang['s_hits_1'];
+ elseif($count == 2)
+ $hits = $lang['s_hits_2'];
+ elseif($count == 3 || $count == 4)
+ $hits = $lang['s_hits_34'];
+ else
+ $hits = $lang['s_hits'];
+
+ // Ce imamo vec kot 1000 zadetkov izpisemo samo 1000 in opozorilo
+ if($count < 1000)
+ $cnt_text = '<span class="italic">('.$count.' '.$hits.')</span>';
+ else
+ $cnt_text = '<span class="italic">('.$lang['s_hits_1000'].')</span>';
+
+ echo '<span class="search_title">'.$lang['s_search_mySurvey_title'].' '.$cnt_text.':</span>';
+ }
+
+ echo '<table id="surveyList_new">';
+
+
+ // HEADER VRSTICA
+ echo '<tr class="sl_header_new">';
+
+ // Naslov
+ echo '<td class="col1">';
+ echo $this->createOrderUrlNew(1, $lang['title']);
+ echo '</td>';
+
+ // Trajanje - status
+ echo '<td class="col2">';
+ echo $this->createOrderUrlNew(18, 'Status');
+ echo '</td>';
+
+ // Ustvarjeno
+ echo '<td class="col3">';
+ echo $this->createOrderUrlNew(10, $lang['srv_created']);
+ echo '</td>';
+
+ // Zadnji vnos
+ echo '<td class="col4">';
+ echo $this->createOrderUrlNew(16, $lang['srv_last_insrt']);
+ echo '</td>';
+
+ // Sprememba
+ echo '<td class="col5">';
+ echo $this->createOrderUrlNew(14, $lang['change']);
+ echo '</td>';
+
+ // Ostalo
+ echo '<td class="col6">';
+ echo $lang['more2'];
+ echo '</td>';
+
+ echo '</tr>';
+
+
+ // VRSTICE Z ANKETAMI
+ foreach ( $ankete as $anketa ) {
+
+ echo '<tr id="anketa_list_'.$anketa['id'].'" class="anketa_list '.($this->show_folders == 1 ? ' mySurvey_draggable' : '').'" anketa_id="'.$anketa['id'].'">';
+
+
+ // Naslov
+ echo '<td class="col1">';
+
+ if(strlen($anketa['naslov']) > 60)
+ $text = substr($anketa['naslov'],0,60);
+ else
+ $text = $anketa['naslov'];
+
+ // Ce gre za search moramo ustrezno pobarvati najden del besede
+ $text_searched = $text;
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '0'){
+ foreach($this->searchStringProcessed as $search_word){
+
+ // Pobarvamo najden niz v naslovu ankete
+ preg_match_all("/$search_word+/i", $text_searched, $matches);
+ if (is_array($matches[0]) && count($matches[0]) >= 1) {
+
+ // Drugace vcasih pobrise presledek, ne vem kako drugace resit:)
+ $text_searched = str_replace(' ', '&nbsp;', $text_searched);
+
+ $text_searched = str_replace($matches[0][0], '<span class="red">'.$matches[0][0].'</span>', $text_searched);
+ }
+ }
+ }
+
+ // Zgornja vrstica
+ echo '<div class="top_line">';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$anketa['id'].'&a='.A_REDIRECTLINK.'" title="'.$text.'">'.$text_searched.'</a>';
+ echo '</div>';
+
+ // Spodnja vrstica
+ echo '<div class="bottom_line">';
+
+ if($anketa['mobile_created'] == '1')
+ echo '<span class="red spaceRight pointer" title="'.$lang['srv_mobile_survey'].'">M</span>';
+
+ if($anketa['survey_type'] == 0)
+ echo $lang['srv_vrsta_survey_type_0'];
+ elseif($anketa['survey_type'] == 1)
+ echo $lang['srv_vrsta_survey_type_1'];
+ elseif(SurveyInfo::checkSurveyModule('hierarhija', $anketa['id']))
+ echo $lang['srv_vrsta_survey_type_10'];
+ else
+ echo $lang['srv_vrsta_survey_type_2'];
+
+ echo ', '.$lang['srv_h_sl_stvprasanj'].': '. $anketa['variables'];
+ echo '</div>';
+
+ echo '</td>';
+
+
+ // Trajanje - status
+ echo '<td class="col2">';
+
+ if ($anketa['active'] == 1) {
+ $now = time();
+ $do = explode('.', $anketa['trajanjedo']);
+ $do = strtotime($do[0].'.'.$do[1].'.20'.$do[2]);
+ $trajanje = $do - $now;
+ $trajanje = floor($trajanje/60/60/24) + 1;
+
+ if($trajanje >= 0){
+
+ // Ce je aktivna za vec kot 2000 dni je trajna
+ if($trajanje > 2000){
+ $status_text = $lang['srv_trajna_anketa'];
+ }
+ else{
+ $status_text = $lang['more'].' '.$trajanje.' '.$lang['hour_days'];
+ }
+ }
+ else{
+ $status_text = $lang['srv_trajna_anketa'];
+ }
+
+ $status_color = 'green';
+ }
+ else {
+ $sqlA = sisplet_query("SELECT sid FROM srv_activity WHERE sid='".$anketa['id']."'");
+
+ if (mysqli_num_rows($sqlA) > 0) {
+ # anketa je zaključena
+ $status_text = $lang['srv_survey_list_closed'];
+ $status_color = 'blue';
+ }
+ else {
+ # anketa je neaktivna
+ $status_text = $lang['srv_survey_list_inpreparation'];
+ $status_color = 'gray';
+ }
+ }
+
+ echo ' <div class="status_box '.$status_color.'">'.$status_text.'</div>';
+
+ echo '</td>';
+
+
+ // Ustvarjeno
+ echo '<td class="col3">';
+
+ // Ce gre za search moramo ustrezno pobarvati najden del besede
+ $name_searched = $anketa['i_name'];
+ $surname_searched = $anketa['i_surname'];
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '1'){
+ foreach($this->searchStringProcessed as $search_word){
+
+ // Pobarvamo najden niz v imenu
+ preg_match_all("/$search_word+/i", $name_searched, $matches);
+ if (is_array($matches[0]) && count($matches[0]) >= 1) {
+ foreach ($matches[0] as $match) {
+ $name_searched = str_replace($match, '<span class="red">'.$match.'</span>', $name_searched);
+ }
+ }
+
+ // Pobarvamo najden niz v priimku
+ preg_match_all("/$search_word+/i", $surname_searched, $matches);
+ if (is_array($matches[0]) && count($matches[0]) >= 1) {
+ foreach ($matches[0] as $match) {
+ $surname_searched = str_replace($match, '<span class="red">'.$match.'</span>', $surname_searched);
+ }
+ }
+ }
+ }
+
+ $i_time = substr($anketa['i_time'], 0, 8);
+ $i_time = explode('.', $i_time);
+
+ echo '<div class="top_line">';
+ echo $i_time[0].'.'.$i_time[1].'.20'.$i_time[2];
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo $name_searched.' '.$surname_searched;
+ echo '</div>';
+
+ echo '</td>';
+
+
+ // Zadnji vnos
+ echo '<td class="col4">';
+
+ echo '<div class="top_line">';
+ if($anketa['answers'] > 0){
+ $v_time = substr($anketa['v_time_last'], 0, 8);
+ $v_time = explode('.', $v_time);
+
+ // Nimamo parapodatkov
+ if($anketa['v_time_last'] == '00.00.00 0:00')
+ echo $lang['srv_survey_list_no_paradata'];
+ else
+ echo $v_time[0].'.'.$v_time[1].'.20'.$v_time[2];
+ }
+ else{
+ echo '/';
+ }
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo $lang['srv_info_answers_no'].': '.$anketa['answers'];
+ echo '</div>';
+
+ echo '</td>';
+
+
+ // Sprememba
+ echo '<td class="col5">';
+
+ echo '<div class="top_line">';
+ $e_time = substr($anketa['e_time'], 0, 8);
+ $e_time = explode('.', $e_time);
+ echo $e_time[0].'.'.$e_time[1].'.20'.$e_time[2];
+ echo '</div>';
+
+ echo '<div class="bottom_line">';
+ echo ' <span id="edit_user_'.$anketa['id'].'" euid="'.$anketa['edit_uid'].'" onclick="surveyList_user(\'e\',\'#edit_user_'.$anketa['id'].'\');">'.$anketa['e_email'].'</span>';
+ echo '</div>';
+
+ echo '</td>';
+
+
+ // Ostalo
+ echo '<td class="col6 other_link">';
+
+ echo ' <span class="faicon dots" onClick="surveyList_show_more(\''.$anketa['id'].'\');"></span>';
+
+ // Hover okno
+ echo ' <div class="survey_other_box_holder">';
+ echo ' <div id="survey_other_box_'.$anketa['id'].'" class="survey_other_box displayNone"><ul>';
+
+ SurveyInfo::getInstance()->SurveyInit($anketa['id']);
+ echo ' <li><a href="' . SurveyInfo::getSurveyLink() . '?preview=on" target="_blank" title="'.$lang['srv_poglejanketo2'].'"><span class="faicon monitor"></span> '.$lang['srv_poglejanketo2'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=testiranje"><span class="faicon test"></span>'.$lang['srv_testiranje'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=vabila"><span class="faicon publish"></span>'.$lang['srv_vabila'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=data"><span class="faicon data"></span>'.$lang['srv_podatki'].'</a></li>';
+ echo ' <li><a href="index.php?anketa='.$anketa['id'].'&a=analysis"><span class="faicon chart"></span>'.$lang['srv_analiza'].'</a></li>';
+
+ echo ' <li><div class="line"></li>';
+
+ echo ' <li><input type="checkbox" id="lib_private_'.$anketa['id'].'" '.($anketa['lib_usr'] == 1 ? 'checked="checked"' : '').' onclick="surveyList_myknjiznica_new(\''.$anketa['id'].'\'); return false;"><label for="lib_private_'.$anketa['id'].'">'.$lang['srv_moja_knjiznica'].'</label></li>';
+ if ($this->g_adminType == 0){
+ echo ' <li><input type="checkbox" id="lib_public_'.$anketa['id'].'" '.($anketa['lib_glb'] == 1 ? 'checked="checked"' : '').' onclick="surveyList_knjiznica_new(\''.$anketa['id'].'\'); return false;"><label for="lib_public_'.$anketa['id'].'">'.$lang['srv_javna_knjiznica'].'</label></li>';
+ }
+
+ echo ' </ul></div>';
+ echo ' </div>';
+
+ echo '</td>';
+
+
+ echo '</tr>';
+ }
+
+ echo '</table>';
+ }
+ else{
+ // Naslov za prazen search
+ if($this->isSearch == 1)
+ echo '<span class="search_title">'.$lang['s_search_mySurvey_nothing'].'.</span>';
+ }
+ }
+
+
+ // Prestejemo ankete po folderjih
+ private function countSurveysInFolders(){
+ global $global_user_id;
+ global $global_admin_type;
+
+ $query_string = "SELECT a.id AS ank_id, ma.folder AS folder_id
+ FROM srv_anketa a
+ LEFT OUTER JOIN srv_mysurvey_anketa ma
+ ON a.id = ma.ank_id AND ma.usr_id='".$global_user_id."'
+ WHERE a.backup='0' AND a.id>0 AND active>='0' AND a.invisible='0'";
+
+ // Filter za dostop - samo avtor
+ if ($this->user_id){
+ $query_string .= " AND a.insert_uid='".$global_user_id."'";
+ }
+ // Filter za dostop - vse anekte z dostopom
+ else{
+ // posebej za managerje, ki vidijo ankete svojih uporabnikov
+ $manage = '';
+ if ($global_admin_type == 1 || $global_admin_type == 0)
+ $manage = " OR uid IN (".SurveyCopy::prepareSubquery(sisplet_query("SELECT user FROM srv_dostop_manage WHERE manager='".$global_user_id."' ")).") ";
+
+ $query_string .= " AND (a.id IN (".SurveyCopy::prepareSubquery(sisplet_query("SELECT ank_id FROM srv_dostop WHERE uid='".$global_user_id."' $manage"))."))";
+ }
+
+ // GDPR filter
+ if($this->gdpr == 1){
+ $query_string .= " AND EXISTS (SELECT * FROM srv_gdpr_anketa sgdpr WHERE sgdpr.ank_id=a.id) ";
+ }
+
+ // Filter za jezik
+ if ((int)$this->lang_id > 0) {
+ $query_string .= " AND a.lang_admin='".(int)$this->lang_id."'";
+ }
+
+
+ $sql = sisplet_query($query_string);
+ while($row = mysqli_fetch_array($sql)){
+ $folder_id = ($row['folder_id'] != null) ? $row['folder_id'] : 0;
+
+ if(!isset($this->surveys_count[$folder_id]))
+ $this->surveys_count[$folder_id] = 1;
+ else
+ $this->surveys_count[$folder_id]++;
+ }
+ }
+
+ // Dobimo seznam anket za nov prikaz (starega se naceloma ne uporablja vec)
+ private function getSurveysAsListNew() {
+
+ $result = array();
+
+ // ce imas hkrati dostop do ankete (srv_dostop) in preko managerskega dostopa (srv_dostop_manage) se brez DISTINCT podvajajo ankete
+ $stringSurveyList = "SELECT DISTINCT sa.id, sa.folder, '1' as del, sa.naslov, sa.active, sa.mobile_created, sa.edit_time, ";
+ $stringSurveyList .= 'sal.lib_glb AS lib_glb, ';
+ $stringSurveyList .= 'sal.lib_usr AS lib_usr, ';
+ $stringSurveyList .= "sa.edit_uid, sal.e_name AS e_name, sal.e_surname AS e_surname, sal.e_email AS e_email, ";
+ $stringSurveyList .= "sa.insert_uid, sal.i_name AS i_name, sal.i_surname AS i_surname, sal.i_email AS i_email, ";
+ $stringSurveyList .= "date_format(edit_time, '%d.%m.%y %k:%i') AS e_time, ";
+ $stringSurveyList .= "date_format(insert_time, '%d.%m.%y %k:%i') AS i_time, ";
+ $stringSurveyList .= "date_format(sal.a_first, '%d.%m.%y %k:%i') AS v_time_first, date_format(sal.a_last, '%d.%m.%y %k:%i') AS v_time_last, ";
+
+ $stringSurveyList .= "sal.answers as answers, "; // vedno prestejemo odgovore
+ $stringSurveyList .= "sal.variables as variables, ";
+ $stringSurveyList .= "date_format(sa.starts, '%d.%m.%y') as trajanjeod, ";
+ $stringSurveyList .= "date_format(sa.expire, '%d.%m.%y') as trajanjedo, ";
+ $stringSurveyList .= "approp, ";
+ $stringSurveyList .= "sd.canEdit, sa.survey_type "; // tega pustim tukaj, da ni problemov z vejico
+
+
+ // Ce searchamo po besedah dodamo se uvod, zakljucek, naslove vprasanj in vrednosti vprasanj
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '2'){
+ $stringSurveyList .= ", sa.introduction AS introduction, sa.conclusion AS conclusion ";
+
+ $stringSurveyList .= ", sg.id AS sg_id, sg.ank_id AS sg_ank_id ";
+ $stringSurveyList .= ", ss.id AS ss_id, ss.naslov AS ss_naslov, ss.gru_id AS ss_gru_id ";
+ $stringSurveyList .= ", sv.id AS sv_id, sv.naslov AS sv_naslov, sv.spr_id AS sv_spr_id ";
+ }
+
+
+ $stringSurveyList .= "FROM srv_anketa sa ";
+ $stringSurveyList .= "LEFT OUTER JOIN srv_survey_list AS sal ON sal.id = sa.id " ;
+ $stringSurveyList .= "LEFT OUTER JOIN srv_library_anketa AS sla ON sla.ank_id = sa.id " ;
+
+ # kdo lahko ureja anketo (briše)
+ // tega substringy se ne da dodatno razbit z prepareSubquery, ker selectamo 2 elementa...
+ $stringSurveyList .= "LEFT OUTER JOIN (SELECT 1 AS canEdit, ank_id FROM srv_dostop WHERE FIND_IN_SET('edit', dostop ) ='1' AND aktiven = '1' AND uid = '$this->g_uid' OR uid IN (".SurveyCopy::prepareSubquery(sisplet_query("SELECT user FROM srv_dostop_manage WHERE manager = '".$this->g_uid."'")).")) AS sd ON sd.ank_id = sa.id " ;
+
+
+ if($this->current_folder['id'] > 0)
+ $stringSurveyList .= "LEFT OUTER JOIN srv_mysurvey_anketa AS sf ON sf.ank_id = sa.id ";
+
+ // Ce iscemo po kljucnih besedah moramo dodat se tabele srv_grupa, srv_spremenljivka in srv_vrednost
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '2'){
+ $stringSurveyList .= "LEFT OUTER JOIN srv_grupa AS sg ON sg.ank_id = sa.id ";
+ $stringSurveyList .= "LEFT OUTER JOIN srv_spremenljivka AS ss ON ss.gru_id = sg.id ";
+ $stringSurveyList .= "LEFT OUTER JOIN srv_vrednost AS sv ON sv.spr_id = ss.id ";
+ }
+
+ // Ce iscemo po imenu ankete moramo dodat se tabele srv_nice_links za lepe linke
+ if($this->isSearch == 1 && $this->searchSettings['stype'] == '0'){
+ $stringSurveyList .= "LEFT OUTER JOIN srv_nice_links AS nl ON sa.id = nl.ank_id ";
+ }
+
+
+ $stringSurveyList .= "WHERE sa.backup='0' AND sa.id>0 AND active >= '0' AND invisible = '0' ";
+
+ if($this->current_folder['id'] > 0)
+ $stringSurveyList .= "AND sf.usr_id='$this->g_uid' AND sf.folder='".$this->current_folder['id']."' ";
+ elseif($this->current_folder['id'] == 0)
+ $stringSurveyList .= "AND NOT EXISTS (SELECT * FROM srv_mysurvey_anketa sma WHERE sma.ank_id=sa.id AND sma.usr_id='$this->g_uid') ";
+
+
+ // GDPR filter
+ if($this->gdpr == 1)
+ $stringSurveyList .= "AND EXISTS (SELECT * FROM srv_gdpr_anketa sgdpr WHERE sgdpr.ank_id=sa.id) ";
+ elseif($this->gdpr == 2)
+ $stringSurveyList .= "AND NOT EXISTS (SELECT * FROM srv_gdpr_anketa sgdpr WHERE sgdpr.ank_id=sa.id) ";
+
+
+ // Ce izvajamo search po anketah
+ if($this->isSearch == 1){
+ // Filter glede na search
+ $stringSurveyList .= $this->getSearchString();
+
+ // Filter glede na jezik ankete
+ $stringSurveyList .= $this->getLanguageLimit();
+ // Filter glede na dostop do ankete
+ $stringSurveyList .= $this->getDostopAnketa();
+ // Vrstni red anket
+ $stringSurveyList .= $this->getOrderString();
+
+ // Ce iscemo po kljucnih besedah moramo na koncu grupirat po anketi
+ if($this->searchSettings['stype'] == '2'){
+ //$stringSurveyList .= " GROUP BY id";
+ //$stringSurveyList .= " LIMIT 1000";
+ }
+ else{
+ // Limit anket
+ //$stringSurveyList .= $this->getLimitString();
+ $stringSurveyList .= " LIMIT 1000";
+ }
+ }
+ else{
+ // Filter glede na jezik ankete
+ $stringSurveyList .= $this->getLanguageLimit();
+ // Filter glede na dostop do ankete
+ $stringSurveyList .= $this->getDostopAnketa();
+ // Vrstni red anket
+ $stringSurveyList .= $this->getOrderString();
+ // Limit anket
+ $stringSurveyList .= $this->getLimitString();
+ }
+
+
+ $sqlSurveyList = sisplet_query($stringSurveyList);
+ if (!$sqlSurveyList) {
+ print_r("ERROR in query:");
+ print_r($stringSurveyList);
+ echo mysqli_error($GLOBALS['connect_db']);
+ }
+
+ while ($rowSurveyList = mysqli_fetch_assoc($sqlSurveyList)) {
+ $result[$rowSurveyList['id']] = $rowSurveyList;
+ }
+
+ return $result;
+ }
+
+
+ /** Funkcija ki kiče podfunkcije za ajax del
+ *
+ *
+ */
+ public function ajax() {
+ global $global_user_id;
+ global $lang;
+
+
+ // Aktiviramo folder in prikazemo ankete v tem folderju
+ if($_GET['a'] == 'mysurvey_folder_activate'){
+
+ $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : '0';
+
+
+ // Nastavimo vse folderje na neaktivne
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET active='0' WHERE usr_id='".$global_user_id."'");
+
+ // Nastavimo izbran folder na aktivnega
+ if($folder_id > '0')
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET active='1' WHERE usr_id='".$global_user_id."' AND id='".$folder_id."'");
+
+ // Prestejemo ankete po folderjih
+ $this->countSurveysInFolders();
+
+ // Nastavimo current folder
+ if($folder_id == '0'){
+
+ $this->current_folder = array(
+ 'id' => 0,
+ 'naslov' => $lang['srv_mySurvey_all_surveys']
+ );
+ }
+ else{
+ // Dobimo podatke folderja
+ $sql = sisplet_query("SELECT * FROM srv_mysurvey_folder WHERE id='".$folder_id."'");
+ if (!$sql)
+ echo mysqli_error($GLOBALS['connect_db']);
+
+ $row = mysqli_fetch_array($sql);
+
+ $this->current_folder = $row;
+ }
+
+
+ // Na novo prikazemo desno stran
+ $this->displayRightContent();
+
+ // JS za drag/drop
+ echo '<script type="text/javascript">mySurvey_folder_init();</script>';
+ }
+
+ // Razsirimo/skrcimo folder
+ if($_GET['a'] == 'mysurvey_folder_toggle'){
+
+ $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : '0';
+ $open = isset($_POST['open']) ? $_POST['open'] : '0';
+
+ // Nastavimo izbran folder na odprtega
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET open='".$open."' WHERE usr_id='".$global_user_id."' AND id='".$folder_id."'");
+ }
+
+
+ // Pokazemo popup za poimenovanje novega subfolderja
+ if($_GET['a'] == 'mysurvey_folder_add_popup'){
+
+ $folder_id = $_POST['folder_id'];
+
+ $this->displayAddFolderPopup($folder_id);
+ }
+
+ // Ustvarimo nov subfolder
+ if($_GET['a'] == 'mysurvey_folder_add'){
+
+ $folder_id = $_POST['folder_id'];
+ $folder_name = $_POST['folder_name'];
+
+ // Razpremo parent folder
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET open='1' WHERE id='".$folder_id."' AND usr_id='$global_user_id'");
+
+ $sql = sisplet_query("INSERT INTO srv_mysurvey_folder (usr_id, parent, naslov) VALUES ('".$global_user_id."','".$folder_id."', '".$folder_name."')");
+
+ $new_folder_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ $this->displayLeftContent();
+
+ // JS za drag/drop
+ echo '<script type="text/javascript">mySurvey_folder_init();</script>';
+ }
+
+ // Pokazemo popup za preimenovanje folderja
+ if($_GET['a'] == 'mysurvey_folder_rename_popup'){
+
+ $folder_id = $_POST['folder_id'];
+ $folder_name = $_POST['folder_name'];
+
+ $this->displayRenameFolderPopup($folder_id, $folder_name);
+ }
+
+ // Preimenujemo folder
+ if($_GET['a'] == 'mysurvey_folder_rename'){
+
+ $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : '0';
+ $folder_name = isset($_POST['folder_name']) ? $_POST['folder_name'] : '';
+ $folder_name = strip_tags($folder_name);
+
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET naslov='".$folder_name."' WHERE id='".$folder_id."' AND usr_id='".$global_user_id."'");
+
+ $this->displayLeftContent();
+
+ // JS za drag/drop
+ echo '<script type="text/javascript">mySurvey_folder_init();</script>';
+ }
+
+ // Pobrisemo folder
+ if($_GET['a'] == 'mysurvey_folder_delete'){
+
+ $folder_id = isset($_POST['folder_id']) ? $_POST['folder_id'] : 0;
+
+ if($folder_id > 0){
+
+ // Dobimo parent folderja
+ $sqlParent = sisplet_query("SELECT parent, active FROM srv_mysurvey_folder WHERE id='".$folder_id."' AND usr_id='".$global_user_id."'");
+ $rowParent = mysqli_fetch_array($sqlParent);
+
+ // Ce je parent root, pobrisemo ankete ki so bile znotraj folderja
+ if($rowParent['parent'] == '0'){
+ $sql = sisplet_query("DELETE FROM srv_mysurvey_anketa WHERE folder='".$folder_id."' AND usr_id='".$global_user_id."'");
+ }
+ // Drugace jih prestavimo v parenta
+ else{
+ $sql = sisplet_query("UPDATE srv_mysurvey_anketa SET folder='".$rowParent['parent']."' WHERE folder='".$folder_id."' AND usr_id='".$global_user_id."'");
+
+ // Ce je bil active, nastavimo parenta za active
+ if($rowParent['active'] == '1'){
+ $sql2 = sisplet_query("UPDATE srv_mysurvey_folder SET active='1' WHERE id='".$rowParent['parent']."' AND usr_id='".$global_user_id."'");
+ }
+ }
+
+ // Nastavimo subfolderjem novega parenta
+ $sql3 = sisplet_query("UPDATE srv_mysurvey_folder SET parent='".$rowParent['parent']."' WHERE parent='".$folder_id."' AND usr_id='".$global_user_id."'");
+
+ // Na koncu se pobrisemo prazen folder
+ $sql4 = sisplet_query("DELETE FROM srv_mysurvey_folder WHERE id='".$folder_id."' AND usr_id='".$global_user_id."'");
+ }
+
+ $this->getSurveys();
+ }
+
+
+ // Drop folderja
+ if($_GET['a'] == 'mysurvey_folder_drop'){
+
+ $drag_folder_id = isset($_POST['drag_folder_id']) ? $_POST['drag_folder_id'] : 0;
+ $parent_folder_id = isset($_POST['parent_folder_id']) ? $_POST['parent_folder_id'] : 0;
+
+ if($drag_folder_id > 0){
+
+ // Preverimo, ce nismo droppali folder v svojega childa - tega nikoli ne pustimo, ker potem vse izgine
+ if(!$this->checkFolderIsChild($parent_folder_id, $drag_folder_id)){
+
+ // Nastavimo folderju novega parenta
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET parent='".$parent_folder_id."' WHERE id='".$drag_folder_id."' AND usr_id='".$global_user_id."'");
+
+ // Parenta razpremo
+ $sql = sisplet_query("UPDATE srv_mysurvey_folder SET open='1' WHERE id='".$parent_folder_id."' AND usr_id='".$global_user_id."'");
+ }
+ }
+
+ $this->getSurveys();
+ }
+
+ // Drop ankete
+ if($_GET['a'] == 'mysurvey_survey_drop'){
+
+ $drag_survey_id = isset($_POST['drag_survey_id']) ? $_POST['drag_survey_id'] : 0;
+ $parent_folder_id = isset($_POST['parent_folder_id']) ? $_POST['parent_folder_id'] : 0;
+
+ if($drag_survey_id > 0){
+
+ // Ce prestavimo v root, samo pobrisemo anketo iz srv_mysurvey_anketa
+ if($parent_folder_id == '0'){
+ $sql = sisplet_query("DELETE FROM srv_mysurvey_anketa WHERE ank_id='".$drag_survey_id."' AND usr_id='".$global_user_id."'");
+ }
+ // Prestavimo anketo v subfolder
+ else{
+ $sql = sisplet_query("INSERT INTO srv_mysurvey_anketa
+ (ank_id, usr_id, folder)
+ VALUES
+ ('".$drag_survey_id."', '".$global_user_id."', '".$parent_folder_id."')
+ ON DUPLICATE KEY UPDATE
+ folder='".$parent_folder_id."'");
+ }
+ }
+
+ $this->getSurveys();
+ }
+ }
+
+ // Rekurzivno preverimo, ce je nek folder child drugega folderja
+ private function checkFolderIsChild($folder_id, $parent_folder_id){
+
+ // Ce je parent 0, je root in koncamo - folder ni child
+ if($folder_id == '0')
+ return false;
+
+ $sql = sisplet_query("SELECT parent FROM srv_mysurvey_folder WHERE id='".$folder_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ if($row['parent'] == $parent_folder_id){
+ return true;
+ }
+ else{
+ return $this->checkFolderIsChild($row['parent'], $parent_folder_id);
+ }
+ }
+
+
+
+}
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyMissingProfiles.php b/admin/survey/classes/class.SurveyMissingProfiles.php
index d957a29..bb9e251 100644
--- a/admin/survey/classes/class.SurveyMissingProfiles.php
+++ b/admin/survey/classes/class.SurveyMissingProfiles.php
@@ -95,66 +95,96 @@ class SurveyMissingProfiles
}
if ( self::$currentProfileId != SMP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo ' <div id="missing_profile_holder">';
+ echo '<div class="popup_main with_menu">';
+
+ echo ' <div id="missing_profile_holder" class="popup_left">';
self :: DisplayProfileOptions($pid);
+ echo '<button class="small white-black" onclick="missingProfileAction(\'newName\'); return false;"><span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'].'</button>';
echo ' </div>';
-
- echo ' <div id="missing_profile_data_holder">';
+ echo ' <div id="missing_profile_data_holder" class="popup_right">';
self :: DisplayProfileData($pid);
echo ' </div>';
+ echo '</div>';
+
// GUMBI
- echo '<div style="margin: 15px 0 0 0; float:right;">';
- # shrani kot seja
+ echo '<div class="button_holder">';
+
+ # preklici - zapri
+ echo '<button class="medium white-blue" onclick="missingProfileAction(\'cancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+
+ # shrani kot seja
if (self::$profiles[$pid]['system'] == 1 || $pid == -1) {
$run_lbl = $lang['srv_run_as_session_profile'];
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="missingProfileAction(\'runSession\'); return false;"><span>'.$run_lbl.'</span></a></span></span>';
- } else {
+ echo '<button class="medium blue" onclick="missingProfileAction(\'runSession\'); return false;">'.$run_lbl.'</</button>';
+ }
+ else {
# shrani - pozeni
$run_lbl = $lang['srv_run_profile'];
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="missingProfileAction(\'run\'); return false;"><span>'.$run_lbl.'</span></a></span></span>';
+ echo '<button class="medium blue" onclick="missingProfileAction(\'run\'); return false;">'.$run_lbl.'</</button>';
}
- # shrani kot nov profil
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="missingProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'].'</span></a></span></span>';
- # preklici - zapri
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="missingProfileAction(\'cancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '</div>';
+
+ echo '</div>';
// cover Div
- echo '<div id="missingProfileCoverDiv"></div>'."\n";
+ echo '<div id="missingProfileCoverDiv"></div>';
// div za shranjevanje novega profila
- echo '<div id="newProfile">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="missingProfileAction(\'newSave\'); return false;"><span>'.$lang['srv_save_profile'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="missingProfileAction(\'newCancle\');; return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="newProfile">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="missingProfileAction(\'newCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="missingProfileAction(\'newSave\'); return false;">'.$lang['srv_save_profile'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" size="45" />'."\n";
- echo '<input id="renameProfileId" type="hidden" value="' . $pid . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="missingProfileAction(\'rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="missingProfileAction(\'renameCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" class="text large" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" />';
+ echo '<input id="renameProfileId" type="hidden" value="' . $pid . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="missingProfileAction(\'renameCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="missingProfileAction(\'rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self::$profiles[$pid]['name'] . '</b>?'."\n";
- echo '<input id="deleteProfileId" type="hidden" value="' . $pid . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="missingProfileAction(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="missingProfileAction(\'deleteConfirm\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . self::$profiles[$pid]['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $pid . '" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="missingProfileAction(\'deleteCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="missingProfileAction(\'deleteConfirm\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+ echo '</div>';
}
static function DisplayProfileData($pid) {
@@ -164,103 +194,142 @@ class SurveyMissingProfiles
$_tpes_array = array(MISSING_TYPE_DESCRIPTOR=>$lang['srv_analiza_arhiviraj_type_'.MISSING_TYPE_DESCRIPTOR],MISSING_TYPE_FREQUENCY=>$lang['srv_analiza_arhiviraj_type_'.MISSING_TYPE_FREQUENCY],MISSING_TYPE_CROSSTAB=>$lang['srv_analiza_arhiviraj_type_'.MISSING_TYPE_CROSSTAB]);
$_sys_missings = self::$smv->GetMissingValuesForSurvey();
$_sys_unset = self::$smv->GetUnsetValuesForSurvey();
- echo '<div id="infoMissingProfile">' . $lang['srv_missing_profile_title1'] . '</div >';
- echo '<div id="missingProfileFieldsetHolder1">'.NEW_LINE;
+
+ echo '<div id="infoMissingProfile" class="profile_right_note">' . $lang['srv_missing_profile_title1'] . '</div>';
+
+ echo '<div id="missingProfileFieldsetHolder1">';
- echo '<fieldset id="missingProfileFieldset">'.NEW_LINE;
- echo '<legend>' . $lang['srv_missing_profile_title2'] . '</legend>'.NEW_LINE;
+ echo '<fieldset id="missingProfileFieldset">';
+ echo '<legend>' . $lang['srv_missing_profile_title2'] . '</legend>';
+
+ echo '<form name="" id="" autocomplete="off">';
+
+ echo '<table id="missing_table_1">';
+ echo '<tr>';
foreach ($_tpes_array AS $tkey => $tlabel) {
- echo '<div style="float:left; width:100px; text-align:center;">'. $tlabel .'</div>'.NEW_LINE;
+ echo '<th class="center">'. $tlabel .'</th>';
}
- echo '<div class="clr"></div>'.NEW_LINE;
- echo '<form name="" id="" autocomplete="off">'.NEW_LINE;
+ echo '<th></th>';
+ echo '</tr>';
+
# loop sozi sistemske missinge
foreach ($_sys_unset as $mkey => $mvalue) {
+ echo '<tr>';
+
# loop skozi tipe
foreach ($_tpes_array AS $tkey => $tlabel) {
- echo '<div style="float:left; width:100px; text-align:center;">'.NEW_LINE;
+ echo '<td class="center">';
echo '<input name="profile_value[]" type="checkbox" id="mv_'.$tkey.'_'.$mkey . '"' .
(isset($curentProfileData[$tkey][$mkey]) ? ' checked' : '').
- '/>'.NEW_LINE;
- echo '</div>'.NEW_LINE;
+ '/>';
+ echo '<label class="empty"></label>';
+ echo '</td>';
}
- echo '<div style="float:left; width:150px;">'.NEW_LINE;
+ echo '<td>';
echo '(' . $mkey . ") " . $mvalue;
- echo '</div>'.NEW_LINE;
- echo '<div class="clr"></div>'.NEW_LINE;
+ echo '</td>';
+
+ echo '</tr>';
}
- echo '</form>'.NEW_LINE;
- echo '</fieldset>'.NEW_LINE;
+
+
+ echo '</table>';
+
+ echo '</form>';
+ echo '</fieldset>';
- echo '<fieldset id="missingProfileFieldset">'.NEW_LINE;
- echo '<legend>' . $lang['srv_missing_profile_title3'] . '</legend>'.NEW_LINE;
+ echo '<fieldset id="missingProfileFieldset">';
+ echo '<legend>' . $lang['srv_missing_profile_title3'] . '</legend>';
+
+ echo '<table id="missing_table_2">';
+ echo '<tr>';
foreach ($_tpes_array AS $tkey => $tlabel) {
- echo '<div style="float:left; width:100px; text-align:center;">'. $tlabel .'</div>'.NEW_LINE;
+ echo '<th class="center">'. $tlabel .'</th>';
}
- echo '<div class="clr"></div>'.NEW_LINE;
- echo '<form name="" id="" autocomplete="off">'.NEW_LINE;
+ echo '<th></th>';
+ echo '</tr>';
+
+ echo '<form name="" id="" autocomplete="off">';
+
# loop sozi sistemske missinge
- foreach ($_sys_missings as $mkey => $mvalue) {
+ foreach ($_sys_unset as $mkey => $mvalue) {
+ echo '<tr>';
+
# loop skozi tipe
foreach ($_tpes_array AS $tkey => $tlabel) {
- echo '<div style="float:left; width:100px; text-align:center;">'.NEW_LINE;
+ echo '<td class="center">';
echo '<input name="profile_value[]" type="checkbox" id="mv_'.$tkey.'_'.$mkey . '"' .
(isset($curentProfileData[$tkey][$mkey]) ? ' checked' : '').
- '/>'.NEW_LINE;
- echo '</div>'.NEW_LINE;
+ '/>';
+ echo '<label class="empty"></label>';
+ echo '</td>';
}
- echo '<div style="float:left; width:150px;">'.NEW_LINE;
+ echo '<td>';
echo '(' . $mkey . ") " . $mvalue;
- echo '</div>'.NEW_LINE;
- echo '<div class="clr"></div>'.NEW_LINE;
+ echo '</td>';
+
+ echo '</tr>';
}
- echo '</form>'.NEW_LINE;
- echo '</fieldset>'.NEW_LINE;
- echo '</div>'.NEW_LINE;
- echo '<div id="missingProfileFieldsetHolder1">'.NEW_LINE;
+
+ echo '</table>';
+
+ echo '</form>';
+ echo '</fieldset>';
+
+ echo '</div>';
+
+ echo '<div id="missingProfileFieldsetHolder1">';
echo '<fieldset id="missingProfileFieldset">';
echo '<legend>'.$lang['srv_missing_profile_title5'].'</legend>';
# prikažemo še radio gumbe za način prikaza MV
$radio_selected = self::$profiles[$pid]['display_mv_type'];
- echo '<div style="margin-bottom:8px;">';
+
+ echo '<div class="mv_settings_other">';
echo '<input name="display_mv_type" id="display_mv_type_0" type="radio" value="0"'.($radio_selected == 0 ? ' checked' : '').'><label for="display_mv_type_0">'.$lang['srv_missing_profile_display_radio0'].'</label>';
echo '&nbsp;&nbsp;<input name="display_mv_type" id="display_mv_type_1" type="radio" value="1"'.($radio_selected == 1 ? ' checked' : '').'><label for="display_mv_type_1">'.$lang['srv_missing_profile_display_radio1'].'</label>';
echo '&nbsp;&nbsp;<input name="display_mv_type" id="display_mv_type_2" type="radio" value="2"'.($radio_selected == 2 ? ' checked' : '').'><label for="display_mv_type_2">'.$lang['srv_missing_profile_display_radio2'].'</label>';
echo '</div>';
- echo '<div style=" width:auto; text-align:left;">'.NEW_LINE;
+
+ echo '<div class="setting_holder">';
echo '<input name="show_zerro" id="show_zerro" type="checkbox" ' .
(self::$profiles[$pid]['show_zerro'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>'.NEW_LINE;
- echo $lang['srv_missing_profile_other_show_zerro'];
- echo '</div>'.NEW_LINE;
- echo '<div style=" width:auto; text-align:left;">'.NEW_LINE;
+ echo '<label>'.$lang['srv_missing_profile_other_show_zerro'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
echo '<input name="merge_missing" id="merge_missing" type="checkbox" ' .
- (self::$profiles[$pid]['merge_missing'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>'.NEW_LINE;
- echo $lang['srv_missing_profile_other_merge_missing'];
+ (self::$profiles[$pid]['merge_missing'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>';
+ echo '<label>'.$lang['srv_missing_profile_other_merge_missing'].'</label>';
echo '</div>';
- echo ' <div class="clr"></div>';
+
echo '</fieldset>';
- echo '</div>'.NEW_LINE;
+ echo '</div>';
}
static function DisplayProfileOptions($pid) {
global $lang;
- echo '<div id="missing_profile" class="select">';
+ echo '<div id="missing_profile" class="list select">';
+
foreach ( self::$profiles as $key => $profile ) {
- echo '<div id="missing_profile_'.$profile['id'].'" class="option' . ($profile['id'] == $pid ? ' active' : '') . '" value="' . $profile['id'] . '">';
+ echo '<div id="missing_profile_'.$profile['id'].'" class="list-item option' . ($profile['id'] == $pid ? ' active' : '') . '" value="' . $profile['id'] . '">';
echo $profile['name'];
if($profile['id'] == $pid){
+ echo '<div class="profile_icons">';
+
if (self::$profiles[$pid]['system'] != 1 ) {
- echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="missingProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
+ echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="missingProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
}
if (self::$profiles[$pid]['system'] != 1 && $pid != -1) {
- echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="missingProfileAction(\'renameAsk\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>'."\n";
+ echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="missingProfileAction(\'renameAsk\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
@@ -268,11 +337,8 @@ class SurveyMissingProfiles
echo '</div>';
echo '<script>';
- echo '$(function() {';
- echo 'scrollToProfile("#missing_profile_'.$pid.'");';
- echo '});';
+ echo ' $( function(){scrollToProfile("#missing_profile_'.$pid.'");} );';
echo '</script>';
-
}
/** klici ajax funkcij
@@ -532,17 +598,16 @@ class SurveyMissingProfiles
static function DisplayLink($hideAdvanced = true) {
global $lang;
+
// profili missingov
$missingProfiles = self :: getProfiles();
$izbranMissingProfile = self :: getCurentProfileId();
$css = ($izbranMissingProfile == SMP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $izbranMissingProfile != SMP_DEFAULT_PROFILE ) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_missing_profile" title="' . $lang['srv_analiza_setup_profile'] . '" onClick="show_missing_profiles();">' . $lang['srv_analiza_setup_profile'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="link_missing_profile" title="' . $lang['srv_analiza_setup_profile'] . '" onClick="show_missing_profiles();">' . $lang['srv_analiza_setup_profile'] . '</span>'."\n";
echo '</li>';
-
}
}
diff --git a/admin/survey/classes/class.SurveyMissingValues.php b/admin/survey/classes/class.SurveyMissingValues.php
index 5ea0377..6205edc 100644
--- a/admin/survey/classes/class.SurveyMissingValues.php
+++ b/admin/survey/classes/class.SurveyMissingValues.php
@@ -44,14 +44,19 @@ class SurveyMissingValues
* @param mixed $anketa
*/
function __construct ($anketa = 0) {
+
if (self::$anketa == null) {
- if (isset ($_GET['anketa']) && (int)$_GET['anketa'] > 0) {
+
+ if ((int)$anketa > 0) {
+ self::$anketa = (int)$anketa;
+ }
+ elseif (isset ($_GET['anketa']) && (int)$_GET['anketa'] > 0) {
self::$anketa = $_GET['anketa'];
- } elseif (isset ($_POST['anketa']) && (int)$_POST['anketa'] > 0) {
+ }
+ elseif (isset ($_POST['anketa']) && (int)$_POST['anketa'] > 0) {
self::$anketa = $_POST['anketa'];
- } elseif ((int)$anketa > 0) {
- self::$anketa = (int)$anketa;
}
+
# polovimo nastavitve ankete če obstaja
if (self::$anketa != null && (int)self::$anketa > 0) {
@@ -220,7 +225,7 @@ class SurveyMissingValues
while ( $rowSystemSetting_filters = mysqli_fetch_assoc($sqlSystemSetting_filters) )
{
# naredimo prevode:
- $result[$rowSystemSetting_filters['filter']] = $lang['srv_mv_'.$rowSystemSetting_filters['text']] != '' ? $lang['srv_mv_'.$rowSystemSetting_filters['text']] : $rowSystemSetting_filters['text'];;
+ $result[$rowSystemSetting_filters['filter']] = isset($lang['srv_mv_'.$rowSystemSetting_filters['text']]) ? $lang['srv_mv_'.$rowSystemSetting_filters['text']] : $rowSystemSetting_filters['text'];;
}
self::$_systemFiltersByType[$type] = $result;
return self::$_systemFiltersByType[$type];
@@ -467,6 +472,10 @@ class SurveyMissingValues
echo '<fieldset>';
echo '<legend>'.$lang['srv_survey_missing_title'].':</legend>';
+
+ echo '<p class="bottom16">'.$lang['srv_survey_missing_text'].':</p>';
+
+
$_survey_missing_values = self::GetSurveyMissingValues();
if (self::$mySqlErrNo == '1062') {
@@ -474,26 +483,21 @@ class SurveyMissingValues
}
if ( count($_survey_missing_values) > 0 ) {
- echo '<table class="mv_tbl">';
- echo '<tr>';
- echo '<th style="width:50px;">';
- echo ' <i style="color:gray;text-align:right">'.$lang['srv_filter_vrednost'].'</i>';
- echo '</th>';
- echo '<th style="width:250px;">';
- echo ' <i style="color:gray;">'.$lang['srv_label'].'</i>';
- echo '</th>';
- echo '<th style="width:20px;">';
- echo ' <i style="color:gray;text-align:right">'.'</i>';
- echo '</th>';
- echo '<th>&nbsp;</th>';
+ echo '<table id="missing_value_table">';
+ //Table header
+ echo '<tr>';
+ echo '<th class="vrednost">'.$lang['srv_filter_vrednost'].'</th>';
+ echo '<th>'.$lang['srv_label'].'</th>';
+ echo '<th></th>';
echo '</tr>';
+
foreach ( $_survey_missing_values as $type => $type_missing_values) {
foreach ($type_missing_values AS $type_missing_value) {
$key = $type_missing_value['value'];
$text = $type_missing_value['text'];
$sysValue = $type_missing_value['defSysVal'];
- echo '<tr class="spr_sysFilter'.$type.'">';
+ echo '<tr>';
echo '<td>';
echo '<input name="mv_value_input" id="mv_value_'.$type.'_'.$key.'" type="text" value="'.$key.'" class="mv_value_input">';
@@ -501,30 +505,22 @@ class SurveyMissingValues
echo '<td>';
echo '<input name="mv_text_input" id="mv_text_'.$type.'_'.$key.'" type="text" value="'.$text.'" class="mv_text_input">';
echo '</td>';
- echo '<td class="anl_ac">';
- if ($sysValue != null) {
- echo '['.$sysValue.']';
- }
- echo '</td>';
echo '<td>';
- echo '&nbsp;<span class="faicon remove smaller orange pointer" name="mv_delete_img" id="mv_img_'.$type.'_'.$key.'" title="'.$lang['srv_filtri_izbrisi_filter'].'"/>';
+ echo '<span class="faicon trash empty blue" name="mv_delete_img" id="mv_img_'.$type.'_'.$key.'" title="'.$lang['srv_filtri_izbrisi_filter'].'"/>';
echo '</td>';
echo '</tr>';
}
}
- echo '<tr class="spr_sysFilter3">';
- echo '<td>&nbsp;</td>';
- echo '<td>&nbsp;</td>';
- echo '<td>';
- echo '&nbsp;<span name="mv_add_img" id="mv_add_img" class="faicon add icon-blue smaller pointer"></span>';
- echo '</td>';
- echo '</tr>';
echo '</table>';
}
if ($si_mv == '0') {
echo '<span class="mv_link_disabled">'.$lang['srv_survey_missing_default'].'</span><br/>';
} else {
- echo '<span id="link_use_sistem_mv" onclick="useSystemMissingValues(); return false;" class="as_link">'.$lang['srv_survey_missing_default'].'</span><br/>';
+ echo '<span class="pointer blue" name="mv_add_img" id="mv_add_img"><span class="faicon plus_circle link-right"></span>'.$lang['srv_survey_missing_add'].'</span>';
+
+ echo '<div class="button_holder top16 bottom0">';
+ echo '<button id="link_use_sistem_mv" class="medium white-black" onClick="useSystemMissingValues(); return false;">'.$lang['srv_survey_missing_default'].'</button>';
+ echo '</div>';
}
echo '</div>';
@@ -652,7 +648,7 @@ class SurveyMissingValues
echo '<table class="mv_tbl">';
echo '<tr>';
echo '<th style="width:50px;">';
- echo ' <i style="color:gray;text-align:right">'.$lang['srv_filter_vrednost'].'</i>';
+ echo ' <i style="color:gray;text-align:right">'.$lang['srv_filter_vrednost'].'test</i>';
echo '</th>';
echo '<th style="width:250px;">';
echo ' <i style="color:gray;">'.$lang['srv_filter_variabla'].'</i>';
@@ -703,21 +699,12 @@ class SurveyMissingValues
if ($_REQUEST['a'] != 'missing') {
if ($what == 'start') {
$sa=new SurveyAdmin(self::$anketa);
- echo '<span class="floatLeft">';
- echo '<div id="globalSetingsLinks" class="baseSettings">';
+ echo '<div class="layout_left_item">';
$sa->showGlobalSettingsLinks();
- echo '</div>';
- echo '<br class="clr"/><br/>';
- echo '<div id="globalSetingsLinks" class="aditionalSettings">';
$sa->showAdditionalSettingsLinks();
echo '</div>';
- echo '<br class="clr"/>';
- echo '</span>';
- echo '<div id="globalSetingsList" >';
-
- } else {
- echo '</div>';
}
+
}
}
}
diff --git a/admin/survey/classes/class.SurveyParaAnalysis.php b/admin/survey/classes/class.SurveyParaAnalysis.php
index f5813cf..6af23c5 100644
--- a/admin/survey/classes/class.SurveyParaAnalysis.php
+++ b/admin/survey/classes/class.SurveyParaAnalysis.php
@@ -47,19 +47,19 @@ class SurveyParaAnalysis{
private $spr_type;
- function __construct($anketa)
- {
- if ((int)$anketa > 0)
- {
+ function __construct($anketa){
+ global $global_user_id;
+
+ if ((int)$anketa > 0){
+
$this->anketa = $anketa;
SurveyAnalysisHelper::getInstance()->Init($this->anketa);
# 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);
@@ -311,100 +311,108 @@ class SurveyParaAnalysis{
}
echo '<div id="dataSettingsCheckboxes" class="paraAnalysisGraph" '.($showSettings ? '' : ' style="display:none;"').'>';
- echo '<div id="toggleDataCheckboxes2" onClick="toggleDataCheckboxes(\'paraAnalysisGraph\');"><span class="faicon close icon-orange" style="padding-bottom:2px;"></span> '.$lang['srv_para_close_settings'].'</div>';
-
- echo '<table id="para_settings"><tr><th>Spremenljivke</th><th rowspan="2" class="anl_bl spacer"></th><th>Prekinitve</th><th rowspan="2" class="anl_bl spacer"></th><th>Podrobno</th></tr>';
- echo '<tr><td>';
- # spremenljivke
- echo '<div class="floatLeft">';
- echo '<label>';
+
+ echo '<div class="wrap1360 page_'.$_GET['a'].' subpage_'.$_GET['m'].'">';
+
+ //Spremenljivke
+ echo '<div class="section" id="one">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_para_label_variables'].'</span>';
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_question_basic" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_question_basic == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_para_show_question_basic'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_question_basic">'.$lang['srv_para_show_question_basic'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_graph_basic" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_graph_basic == true ? ' checked="checked"' : '').' autocomplete="off" >';
- echo $lang['srv_para_show_show_graph_basic'];
- echo '</label>';
+ echo '<label for="show_graph_basic">'.$lang['srv_para_show_show_graph_basic'].'</label>';
+ echo '</div>';
echo '</div>';
- # end:spremenljivke
- echo '</td><td>';
- # prekinitve
- echo '<div class="floatLeft">';
- echo '<label>';
+
+ echo '</div>';
+
+ //Prekinitve
+ echo '<div class="section" id="two">';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_para_label_breaks'].'</span>';
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_question_breaks" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_question_breaks == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_para_show_question_breaks'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_question_breaks">'.$lang['srv_para_show_question_breaks'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_graph_breaks" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_graph_breaks == true ? ' checked="checked"' : '').' autocomplete="off" >';
- echo $lang['srv_para_show_show_graph_breaks'];
- echo '</label>';
- echo '<br/>';
- echo '<label>'.$lang['srv_para_graph_type'].':';
+ echo '<label for="show_graph_breaks">'.$lang['srv_para_show_show_graph_breaks'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ /*echo '<label>'.$lang['srv_para_graph_type'].':';
echo '<select id="show_graph_breaks_type" onchange="changeParaAnalysisSelect(this);" autocomplete="off">';
echo '<option value="0"'.((int)$this->show_graph_breaks_type == 0 ? ' selected="selected"' : '').'>'.$lang['srv_para_graph_type0'].'</option>';
echo '<option value="1"'.((int)$this->show_graph_breaks_type == 1 ? ' selected="selected"' : '').'>'.$lang['srv_para_graph_type1'].'</option>';
echo '<option value="2"'.((int)$this->show_graph_breaks_type == 2 ? ' selected="selected"' : '').'>'.$lang['srv_para_graph_type2'].'</option>';
echo '</select>';
- echo '</label>';
+ echo '</label>';*/
+
echo '</div>';
-
- # end: prekinitve
- echo '</td><td>';
- # podrobno
- echo '<div class="floatLeft">';
- echo '<label>';
+
+ // Podrobno
+ echo '<div class="section" id="three">';
+ echo '<span class="setting_title">'.$lang['srv_para_label_details'].'</span>';
+
+ echo '<div class="subsection">';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_with_zero" onclick="changeParaAnalysisCbx(this,true);" '.($this->show_with_zero == false ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_para_only_valid'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_with_zero">'.$lang['srv_para_only_valid'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_with_other" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_with_other == true ? ' checked="checked"' : '').' autocomplete="off" >';
- echo $lang['srv_para_show_rows_other'];
- echo '</label>';
+ echo '<label for="show_with_other">'.$lang['srv_para_show_rows_other'].'</label>';
+ echo '</div>';
echo '</div>';
- echo '<div class="floatLeft spaceLeftBig anl_bl">';
- echo '<label>';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_categories" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_categories == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_analiza_kategorialneSpremenljivke'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_categories">'.$lang['srv_analiza_kategorialneSpremenljivke'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_numbers" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_numbers == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_analiza_numericneSpremenljivke'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_numbers">'.$lang['srv_analiza_numericneSpremenljivke'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_text" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_text == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_analiza_textovneSpremenljivke'];
- echo '</label>';
+ echo '<label for="show_text">'.$lang['srv_analiza_textovneSpremenljivke'].'</label>';
echo '</div>';
-
- echo '<div class="floatLeft spaceLeftBig">';
- echo '<label>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_question_advanced" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_question_advanced == true ? ' checked="checked"' : '').' autocomplete="off">';
- echo $lang['srv_para_show_question_advanced'];
- echo '</label>';
- echo '<br/>';
- echo '<label>';
+ echo '<label for="show_question_advanced">'.$lang['srv_para_show_question_advanced'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="show_graph_advanced" onclick="changeParaAnalysisCbx(this,false);" '.($this->show_graph_advanced == true ? ' checked="checked"' : '').' autocomplete="off" >';
- echo $lang['srv_para_show_show_graph_advanced'];
- echo '</label>';
+ echo '<label for="show_graph_advanced">'.$lang['srv_para_show_show_graph_advanced'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
echo '</div>';
-
- # end:podrobno
- echo '</td></tr></table>';
-
- if ($paraType == 'basic') {
- }
- if ($paraType == 'advanced') {
- }
-
- echo '<div class="clr"></div>';
-
echo '</div>'; // konec diva zapiranje nastavitev
-
+
+ if ($showSettings) {
+ echo '<script type="text/javascript">
+ toggle_drop_settings_margin();
+ </script>';
+ }
echo '<div id="div_para_data">';
@@ -562,66 +570,24 @@ class SurveyParaAnalysis{
$rows = $data;
$baseColspan = 6;
+
+ echo '<h2>'.$lang['srv_para_label_breaks'].'</h2>';
echo '<table id="tbl_para_analitics" class="graph'.($showGraph ? ' showGraph' : '').'">';
- echo '<tr class="persist-header">';
- echo '<th class="anl_w50 pointer" ';
- if ($sort_field == 'variable') {
- if ($sort_type == SORT_DESC) {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=v&sort_type=" . SORT_ASC . "')\"";
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=v&sort_type=" . SORT_DESC . "')\"";
- }
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=v&sort_type=" . SORT_ASC . "')\"";
- }
- echo '>';
- echo '<span class="floatLeft pointer">' . $lang['srv_para_variable'] . '</span>';
- if ($sort_field == 'variable') {
- echo '<span class="floatRight faicon '.$sort_type_sprite.'">&nbsp;</span>';
- }
- echo'</th>';
+
+ echo '<tr>';
+ echo '<th>' . $lang['srv_para_variable'] . '</th>';
if ($showQuestion) {
- echo '<th class="anl_w200" >'.$lang['srv_para_question'].'</th>';
- }
- echo '<th class="anl_w50" title="'.$lang['srv_para_breaks'].'">'.$lang['srv_para_breaks_short'].'</th>';
- if ($show_delta) {
- echo '<th class="anl_w50" title="'.$lang['srv_para_breaks_delta'].'">'.$lang['srv_para_breaks_delta_short'].'</th>';
- }
-
-/*
- * echo '<th class="anl_w70" title="'.$lang['srv_para_breaks_value'].'"';
- if ($sort_field == 'ns') {
- if ($sort_type == SORT_DESC) {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_ASC . "')\"";
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_DESC . "')\"";
- }
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_ASC . "')\"";
+ echo '<th>'.$lang['srv_para_question'].'</th>';
}
+ echo '<th title="'.$lang['srv_para_breaks'].'">'.$lang['srv_para_breaks_short'].'</th>';
- echo '>';
- echo '<span>' . $lang['srv_para_breaks_short']. Help :: display('srv_item_nonresponse') . '</span>';
- if ($sort_field == 'ns') {
- echo '<span class="floatRight faicon '.$sort_type_sprite.'">&nbsp;</span>';
+ if ($show_delta) {
+ echo '<th title="'.$lang['srv_para_breaks_delta'].'">'.$lang['srv_para_breaks_delta_short'].'</th>';
}
-*/
- echo '<th class="anl_w50" title="'.$lang['srv_para_breaks_value'].'">';
- echo '<span>' . $lang['srv_para_breaks_value_short']. '</span>';
- echo '</th>';
- echo '<th class="anl_w50" title="'.$lang['srv_para_breaks_value_bruto'].'">';
- echo '<span>' . $lang['srv_para_breaks_value_bruto_short'].'</span>';
- echo '</th>';
- echo '<th class="anl_w50" title="'.$lang['srv_para_breaks_value_neto'].'">';
- echo '<span>' . $lang['srv_para_breaks_value_neto_short'].'</span>';
- echo '</th>';
-# echo '<th class="anl_w70 pointer" title="'.$lang['srv_para_breaks_value_bruto'].'">';
-# echo '<span>' . $lang['srv_para_breaks_value_bruto_short']. '</span>';
-# echo '</th>';
-# echo '<th class="anl_w75 pointer" title="'.$lang['srv_para_breaks_value_neto'].'">';
-# echo '<span>' . $lang['srv_para_breaks_value_neto_short']. '</span>';
-# echo '</th>';
+ echo '<th title="'.$lang['srv_para_breaks_value'].'">' . $lang['srv_para_breaks_value_short'] . '</th>';
+ echo '<th title="'.$lang['srv_para_breaks_value_bruto'].'">' . $lang['srv_para_breaks_value_bruto_short'] . '</th>';
+ echo '<th title="'.$lang['srv_para_breaks_value_neto'].'">' . $lang['srv_para_breaks_value_neto_short'] . '</th>';
if ($showGraph) {
echo '<th class="anl_bb" title="' . $lang['srv_para_breaks_graph_title'] . '">' . $lang['srv_para_breaks_graph_title'] . '</th>';
}
@@ -631,9 +597,8 @@ class SurveyParaAnalysis{
$oldPage = reset($sprPage);
$newPage = $oldPage;
echo '<tr>';
- echo '<td colspan="' . ($baseColspan + (int)$showQuestion + (int)$showGraph). '" class=" para_page_break">
+ echo '<td colspan="' . ($baseColspan + (int)$showQuestion + (int)$showGraph). '" class="para_page_break">
<span>' . $pages[$newPage] . '</span></td>';
- //echo '<td class="empty_cell"></td>';
echo '</tr>';
}
@@ -643,37 +608,35 @@ class SurveyParaAnalysis{
if ($newPage != $oldPage) {
$oldPage = $newPage;
echo '<tr>';
- echo '<td colspan="' . ($baseColspan + (int)$showQuestion + (int)$showGraph). '" class=" para_page_break">
+ echo '<td colspan="' . ($baseColspan + (int)$showQuestion + (int)$showGraph). '" class="para_page_break">
<span>' . $pages[$newPage] . '</span></td>';
- //echo '<td class="empty_cell"></td>';
echo '</tr>';
}
}
- echo '<tr class="'.$css_sublcass.'">';
- echo '<td >';
- echo '<span class="anl_variabla">';
- echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $row['spid'] . '\'); return false;" href="#">' . $row['variable'] . '</a>';
- echo '</span>';
- echo '</td>';
+ echo '<tr>';
+ echo '<td><a onclick="showspremenljivkaSingleVarPopup(\'' . $row['spid'] . '\'); return false;" href="#">' . $row['variable'] . '</a></td>';
+
if ($showQuestion) {
echo '<td>';
echo (strlen($row['naslov']) > 40 ? substr($row['naslov'],0,40)."..." : $row['naslov']);
echo '</td>';
}
+
$val = 0;
if (isset($row['values'][-3])) {
$val = $row['values'][-3];
}
echo '<td>'.$val.'</td>';
+
if ($show_delta) {
echo '<td>'.$row['delta'].'</td>';
}
+
echo '<td>'.common::formatNumber($row['sp']*100,1).'</td>';
echo '<td>'.common::formatNumber($row['sp_bruto']*100,1).'</td>';
echo '<td>'.common::formatNumber($row['sp_neto']*100,1).'</td>';
- #echo '<td>'.common::formatNumber($value,2).'</td>';
if ($showGraph) {
$width = $row['sp'];
if ((int)$showGraphType == 1) {
@@ -682,22 +645,20 @@ class SurveyParaAnalysis{
$width = $row['sp_neto'];
}
- echo '<td class="empty_cell">';
+ echo '<td class="graph_cell">';
if ($row['sp'] > 0) {
- echo '<div class="para_analitics_bar" style="'.'width:'.($width*100).'%; text-align:right; padding-right:5px; color:green;"></div>';
+ echo '<div class="graph_full" style="'.'width:'.($width*100).'%;"></div>';
} else {
- echo '<div class="para_analitics_bar null_value" style="'.'width:1px"></div>';
+ echo '/';
}
echo '</td>';
}
echo '</tr>';
-
}
echo '</table>';
#SurveyAnalysisHelper::getInstance()->displayMissingLegend();
$this->displayLink();
- echo '<br class="clr" />';
}
@@ -801,6 +762,8 @@ class SurveyParaAnalysis{
}
}
*/
+
+ /*SORTIRANJE
$sort_type = SORT_ASC;
if (isset($_REQUEST['sort_type'])
&& ((int)$_REQUEST['sort_type'] == SORT_DESC || (int)$_REQUEST['sort_type'] == SORT_ASC)) {
@@ -840,78 +803,48 @@ class SurveyParaAnalysis{
$rows = array_reverse($rows);
}
- }
+ }*/
$this->displayFormula();
+
+ echo '<h2>'.$lang['srv_para_label_variables'].'</h2>';
echo '<table id="tbl_para_analitics" class="graph'.($showGraph ? ' showGraph' : '').'">';
- echo '<tr class="persist-header">';
- echo '<th class="pointer" ';
- if ($sort_field == 'variable') {
- if ($sort_type == SORT_DESC) {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=variable&sort_type=" . SORT_ASC . "')\"";
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=variable&sort_type=" . SORT_DESC . "')\"";
- }
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=variable&sort_type=" . SORT_ASC . "')\"";
- }
- echo '>';
- echo '<span class="floatLeft pointer">' . $lang['srv_para_variable'] . '</span>';
- if ($sort_field == 'variable') {
- echo '<span class="floatRight sprites '.$sort_type_sprite.'">&nbsp;</span>';
- }
- echo'</th>';
+
+ echo '<tr>';
+ echo '<th>' . $lang['srv_para_variable'] . '</th>';
if ($showQuestion) {
echo '<th>'.$lang['srv_para_question'].'</th>';
}
if ($show_delta) {
- echo '<th class="anl_w50" title="'.$lang[''].'">delta</th>';
- }
- echo '<th class="anl_w50 pointer" title="'.$lang['srv_para_unaswered'].'"';
- if ($sort_field == 'ns') {
- if ($sort_type == SORT_DESC) {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_ASC . "')\"";
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_DESC . "')\"";
- }
- } else {
- echo " onclick=\"window.location.assign('" . $pageUrl . "&sort=ns&sort_type=" . SORT_ASC . "')\"";
+ echo '<th title="'.$lang[''].'">delta</th>';
}
- echo '>';
- echo '<span>' . $lang['srv_para_unaswered_short'] . ' %</span>'; // . Help :: display('srv_item_nonresponse')
- if ($sort_field == 'ns') {
- echo '<span class="floatRight sprites '.$sort_type_sprite.'">&nbsp;</span>';
- }
- echo '</th>';
+ echo '<th>' . $lang['srv_para_unaswered_short'] . ' %</th>';
if ($showGraph) {
- echo '<th class="anl_bb" title="' . $lang['srv_para_unaswered_graph_title'] . '">' . $lang['srv_para_unaswered_graph_title'] . '</th>';
+ echo '<th title="' . $lang['srv_para_unaswered_graph_title'] . '">' . $lang['srv_para_unaswered_graph_title'] . '</th>';
}
echo '</tr>';
-
+
foreach ($rows AS $row) {
- echo '<tr class="'.$css_sublcass.'">';
- echo '<td >';
- echo '<span class="anl_variabla">';
+ echo '<tr>';
+ echo '<td>';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $row['spid'] . '\'); return false;" href="#">' . $row['variable'] . '</a>';
- echo '</span>';
echo '</td>';
if ($showQuestion) {
echo '<td>';
- echo (strlen($row['naslov']) > 40 ? substr($row['naslov'],0,40)."..." : $row['naslov']);
+ echo (strlen($row['naslov']) > 80 ? substr($row['naslov'],0,80)."..." : $row['naslov']);
echo '</td>';
}
if ($show_delta) {
echo '<td>'.$row['delta'].'</td>';
}
echo '<td>'.common::formatNumber($row['ns']*100,1).'</td>';
- #echo '<td>'.common::formatNumber($value,2).'</td>';
if ($showGraph) {
- echo '<td class="empty_cell">';
+ echo '<td class="graph_cell">';
if ($row['ns'] > 0) {
- echo '<div class="para_analitics_bar" style="'.'width:'.($row['ns']*100).'%; text-align:right; padding-right:5px; color:green;"></div>';
+ echo '<div class="graph_full" style="'.'width:'.($row['ns']*100).'%;"></div>';
} else {
- echo '<div class="para_analitics_bar null_value" style="'.'width:1px"></div>';
+ echo '/';
}
echo '</td>';
}
@@ -922,7 +855,6 @@ class SurveyParaAnalysis{
#SurveyAnalysisHelper::getInstance()->displayMissingLegend();
$this->displayLink();
- echo '<br class="clr" />';
}
function displayGraphDataAdvanced( ) {
@@ -965,47 +897,56 @@ class SurveyParaAnalysis{
$this->displayFormula();
+
+ echo '<div id="scroll1">';
+ echo '<div id="scroll2">';
+
+ echo '<script>
+ check_para_wrap();
+ </script>';
+
+ echo '<table id="tbl_para_analitics" class="podrobno">';
-
- echo '<table id="tbl_para_analitics" class="persist-area">';
- echo '<tr class="persist-header">';
+ echo '<tr>';
// Dodatna stolpca zaradi izvoza za Katjo Lozar
if($admin_type == '0'){
- echo '<th style="width:30px;">ID VPRASANJA</th>';
- echo '<th style="width:30px;">ID VARIABLE</th>';
+ echo '<th class="center">ID VPRAŠANJA</th>';
+ echo '<th class="center">ID VARIABLE</th>';
}
- echo '<th>'.$lang['srv_para_variable'].'</th>';
+ echo '<th class="left">'.$lang['srv_para_variable'].'</th>';
if ($showQuestion) {
- echo '<th>'.$lang['srv_para_question'].'</th>';
+ echo '<th class="left">'.$lang['srv_para_question'].'</th>';
}
- echo '<th >'.$lang['srv_para_valid'].'</th>';
+ //echo '<th >'.$lang['srv_para_valid'].'</th>';
foreach ($this->_missings AS $value => $text) {
$cnt_miss++;
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_mv_'.$text]."\" >{$value}<br/>(".$lang['srv_mv_'.$text].")</th>";
+ echo "<th class=\"left\" title=\"".$lang['srv_mv_'.$text]."\" >{$value}<br>(".$lang['srv_mv_'.$text].")</th>";
}
foreach ($this->_unsets AS $value => $text)
{
$cnt_undefined++;
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_mv_'.$text]."\">{$value}<br/>(".$lang['srv_mv_'.$text].")</th>";
+ echo "<th class=\"left\" title=\"".$lang['srv_mv_'.$text]."\">{$value} (".$lang['srv_mv_'.$text].")</th>";
}
if ($show_delta) {
- echo "<th class=\"anl_w50\" title=\"".$lang['']."delta\">".$lang['']."&Delta;</th>";
+ echo "<th title=\"".$lang['']."delta\">".$lang['']."&Delta;</th>";
}
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_para_nonconceptual']."\">".$lang['srv_para_nonconceptual']."</th>";
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_para_approp']."\">".$lang['srv_para_approp']."</th>";
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_para_all_units']."\">".$lang['srv_para_all_units']."</th>";
+ echo "<th title=\"".$lang['srv_para_nonconceptual']."\">".$lang['srv_para_nonconceptual']."</th>";
+ echo "<th title=\"".$lang['srv_para_approp']."\">".$lang['srv_para_approp']."</th>";
+ echo "<th title=\"".$lang['srv_para_all_units']."\">".$lang['srv_para_all_units']."</th>";
if ($isNotStandardProfile)
{
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_para_status']."\">".$lang['srv_para_status']."</th>";
+ echo "<th title=\"".$lang['srv_para_status']."\">".$lang['srv_para_status']."</th>";
}
- echo "<th class=\"anl_w50\" title=\"".$lang['srv_para_unaswered']."\">".$lang['srv_para_unaswered_short']. Help :: display('srv_item_nonresponse')."</th>";
+ echo "<th title=\"".$lang['srv_para_unaswered']."\">".$lang['srv_para_unaswered_short']. Help :: display('srv_item_nonresponse')."</th>";
if ($showGraph) {
- echo '<th class="anl_bb">' . $lang['srv_para_unaswered_graph_title'] . '</th>';
+ echo '<th class="left">' . $lang['srv_para_unaswered_graph_title_br'] . '</th>';
}
echo '</tr>';
+
+
foreach ($headerVariablesId AS $key => $headerVariableId)
{
$spr = $this->_HEADERS[$headerVariableId];
@@ -1024,29 +965,24 @@ class SurveyParaAnalysis{
echo '<tr class="multiGroupHeader">';
if($admin_type == '0'){
- echo '<td>'.$spr['spr_id'].'</td>';
- echo '<td></td>';
+ echo '<td class="center">'.$spr['spr_id'].'</td>';
+ echo '<td class="center"></td>';
}
+
+ $count_missing = count($this->_missings);
if ($showQuestion) {
- echo '<td class="showQuestion">';
- echo '<span class="anl_variabla">';
+ echo '<td class="left semi-bold">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
echo '</td>';
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan).'">';
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan).'">';
echo $spr['naslov'];
echo '</td>';
} else {
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan).'">';
- echo '<span class="anl_variabla">';
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan).'">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
echo '</td>';
}
- if ($showGraph) {
- echo '<td class="empty_cell30"></td>';
- }
echo '</tr>';
}
else {
@@ -1068,72 +1004,56 @@ class SurveyParaAnalysis{
echo '<tr class="multiGroupHeader">';
if($admin_type == '0'){
- echo '<td>'.$spr['spr_id'].'</td>';
- echo '<td></td>';
+ echo '<td class="center">'.$spr['spr_id'].'</td>';
+ echo '<td class="center"></td>';
}
if ($showQuestion) {
- echo '<td class="showQuestion">';
- echo '<span class="anl_variabla">';
+ echo '<td class="left semi-bold">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
echo '</td>';
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan ).'">';
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan+4).'">';
echo $spr['naslov'];
echo '</td>';
} else {
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan ).'">';
- echo '<span class="anl_variabla">';
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan+3).'">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
echo '</td>';
}
- if ($showGraph) {
- echo '<td class="empty_cell30"></td>';
- }
echo '</tr>';
}
else
{ #dodamo header za grupo
+
+
echo '<tr class="multiVariablesHeader">';
if($admin_type == '0'){
- echo '<td>'.$spr['spr_id'].'</td>';
- echo '<td></td>';
+ echo '<td class="center">'.$spr['spr_id'].'</td>';
+ echo '<td class="center"></td>';
}
if ($showQuestion) {
- echo '<td class="showQuestion">';
+ echo '<td class="left semi-bold">';
if (count($grids) > 1) {
- echo '<span class="anl_variabla">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $grid['variable'] . '</a>';
- echo '</span>';
} else {
- echo '<span class="anl_variabla">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
}
echo '</td>';
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan).'">';
- echo $grid['naslov'];
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan+4).'">';
+ echo (strlen($grid['naslov']) > 30 ? substr($grid['naslov'],0,30)."..." : $grid['naslov']);
echo '</td>';
} else {
- echo '<td colspan="'.(count($this->_missings)+count($this->_unsets)+$added_colspan).'">';
+ echo '<td class="left semi-bold" colspan="'.($count_missing+count($this->_unsets)+$added_colspan+3).'">';
if (count($grids) > 1) {
- echo '<span class="anl_variabla">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $grid['variable'] . '</a>';
- echo '</span>';
} else {
- echo '<span class="anl_variabla">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $spr['variable'] . '</a>';
- echo '</span>';
}
echo '</td>';
}
- if ($showGraph) {
- echo '<td class="empty_cell30"></td>';
- }
echo '</tr>';
}
}
@@ -1169,28 +1089,26 @@ class SurveyParaAnalysis{
}
$delta = $data_seq['delta'];
*/
- echo '<tr class="'.$css_sublcass.'">';
+ echo '<tr>';
if($admin_type == '0'){
- echo '<td rowspan="'.($showPercent*2).'">'.$spr['spr_id'].'</td>';
- echo '<td rowspan="'.($showPercent*2).'">'.$variable['vr_id'].'</td>';
+ echo '<td class="center" rowspan="'.($showPercent*2).'">'.$spr['spr_id'].'</td>';
+ echo '<td class="center" rowspan="'.($showPercent*2).'">'.$variable['vr_id'].'</td>';
}
//echo '<td style="border-top:0px none !important;border-bottom:0px none !important;">&nbsp;</td>';
- echo '<td rowspan="'.($showPercent*2).'">';
- echo '<span class="anl_variabla">';
+ echo '<td class="left" rowspan="'.($showPercent*2).'">';
echo '<a onclick="showspremenljivkaSingleVarPopup(\'' . $key . '\'); return false;" href="#">' . $variable['variable'] . '</a>';
- echo '</span>';
echo '</td>';
if ($showQuestion) {
- echo '<td class="showQuestion" rowspan="'.($showPercent*2).'">';
- echo $variable['naslov'];
+ echo '<td class="left" rowspan="'.($showPercent*2).'">';
+ echo (strlen($variable['naslov']) > 30 ? substr($variable['naslov'],0,30)."..." : $variable['naslov']);
echo '</td>';
}
- echo '<td>';
+ /*echo '<td>';
echo (int)$data_seq['veljavni'];
- echo '</td>';
+ echo '</td>';*/
foreach ($this->_missings AS $value => $text) {
$missing = 0;
if (isset($data_seq['values'][$value])) {
@@ -1217,11 +1135,11 @@ class SurveyParaAnalysis{
}
echo "<td rowspan=\"".($showPercent*2)."\">" . common::formatNumber($data_seq['ns'],2) . "</td>";
if ($showGraph) {
- echo "<td rowspan=\"".($showPercent*2)."\" class=\"empty_cell30\">";
+ echo "<td rowspan=\"".($showPercent*2)."\" class=\"graph_cell left\">";
if ($data_seq['ns'] > 0) {
- echo '<div class="para_analitics_bar" style="'.'width:'.($data_seq['ns']*100).'%; text-align:right; padding-right:5px; color:green;"></div>';
+ echo '<div class="graph_full" style="'.'width:'.($data_seq['ns']*100).'%;"></div>';
} else {
- echo '<div class="para_analitics_bar null_value" style="'.'width:1px"></div>';
+ echo '/';
}
echo '</td>';
}
@@ -1230,19 +1148,19 @@ class SurveyParaAnalysis{
if ($showPercent)
{
echo '<tr class="'.$css_sublcass.' percent">';
- echo '<td>';
+ /*echo '<td>';
$val = 0;
if ($percent_all > 0) {
$val = $data[$seq]['veljavni'] / $percent_all * 100;
}
echo common::formatNumber($val,0,null,'%') ;
- echo '</td>';
+ echo '</td>';*/
foreach ($this->_missings AS $value => $text) {
$val = 0;
if ($percent_all > 0 && isset($data[$seq]['values'][$value])) {
$val = ($data[$seq]['values'][$value] / $percent_all * 100);
}
- echo '<td>'.common::formatNumber($val,0,null,'%').'</td>';
+ echo '<td class="dashed">'.common::formatNumber($val,0,null,'%').'</td>';
}
foreach ($this->_unsets AS $value => $text)
{
@@ -1250,7 +1168,7 @@ class SurveyParaAnalysis{
if ($percent_all > 0 && isset($data[$seq]['values'][$value])) {
$val = ($data[$seq]['values'][$value] / $percent_all * 100);
}
- echo '<td>'.common::formatNumber($val,0,null,'%').'</td>';
+ echo '<td class="dashed">'.common::formatNumber($val,0,null,'%').'</td>';
}
echo '</tr>';
}
@@ -1260,14 +1178,14 @@ class SurveyParaAnalysis{
}
}
echo '</table>';
+ echo '</div>';
+ echo '</div>';
SurveyAnalysisHelper::getInstance()->displayMissingLegend();
-
- echo '<br class="clr" />';
-
}
- function getVariables()
- {
+ function getVariables() {
+
+ $dvp = SurveyUserSetting :: getInstance()->getSettings('default_variable_profile');
$_currentVariableProfile = SurveyVariablesProfiles :: checkDefaultProfile($dvp);
$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables($this->_PROFILE_ID_VARIABLE );
@@ -1397,10 +1315,18 @@ class SurveyParaAnalysis{
$vseEnote += $cnt;
if (is_numeric($key) && (isset($this->_missings[(int)$key]) || isset($this->_unsets[(int)$key]))) {
+
// shranimo vrednosti -1 ... -99 za prikaz v tabeli podrobno
- $values[(int)$key] += $cnt;
+ if(isset($values[(int)$key]))
+ $values[(int)$key] += $cnt;
+ else
+ $values[(int)$key] = $cnt;
+
+ if(isset($this->cols_with_value[(int)$key]))
+ $this->cols_with_value[(int)$key] += $cnt;
+ else
+ $this->cols_with_value[(int)$key] = $cnt;
- $this->cols_with_value[(int)$key] += $cnt;
if (isset($this->_unsets[$key])) {
$nevsebinski += $cnt;
@@ -1423,7 +1349,11 @@ class SurveyParaAnalysis{
} else {
- $this->cols_with_value['valid'] += $cnt;
+ if(isset($this->cols_with_value['valid']))
+ $this->cols_with_value['valid'] += $cnt;
+ else
+ $this->cols_with_value['valid'] = $cnt;
+
$veljavni += $cnt;
}
}
@@ -1466,14 +1396,6 @@ class SurveyParaAnalysis{
$_variable = $variable['variable'];
$_naslov = $variable['naslov'];
- if (count($variables) > 1 && in_array($tip, array(2,18,17))) {
- $_variable = $spr['variable'];
- $_naslov = $spr['naslov'];
- }
- if ($tip == 16 ) {
- $_variable = $grid['variable'];
- $_naslov = $grid['naslov'];
- }
$result[$seq]['spid'] = $headerVariableId;
$result[$seq]['sid'] = $spr['spr_id'];
diff --git a/admin/survey/classes/class.SurveyParaGraph.php b/admin/survey/classes/class.SurveyParaGraph.php
index 891af1b..e20ee5b 100644
--- a/admin/survey/classes/class.SurveyParaGraph.php
+++ b/admin/survey/classes/class.SurveyParaGraph.php
@@ -39,13 +39,13 @@ class SurveyParaGraph{
$paraData = $this->collectParaGraphDataNew();
- echo '<p>'.$lang['srv_para_graph_text'].'</p>';
+ //echo '<p>'.$lang['srv_para_graph_text'].'</p>';
// PC, tablica, mobi
echo '<fieldset><legend>'.$lang['srv_para_graph_device'].'</legend>';
- // Filter po napravi
+ /* Filter po napravi
echo '<div style="margin:5px 0 15px 5px;">';
echo '<label>'.$lang['srv_analiza_filter'].': </label>';
echo '<label for="paraGraph_filter_pc"><input type="checkbox" id="paraGraph_filter_pc" '.($this->paraGraph_filter['pc']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device0'].'</label>';
@@ -53,32 +53,43 @@ class SurveyParaGraph{
echo ' <label for="paraGraph_filter_tablet"><input type="checkbox" id="paraGraph_filter_tablet" '.($this->paraGraph_filter['tablet']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device2'].'</label>';
echo ' <label for="paraGraph_filter_robot"><input type="checkbox" id="paraGraph_filter_robot" '.($this->paraGraph_filter['robot']==1 ? ' checked="checked"' : '').' onClick="changeParaGraphFilter();">'.$lang['srv_para_graph_device3'].'</label>';
echo '&nbsp;&nbsp;&nbsp;<label>('.$lang['srv_para_graph_filteredCnt'].' '.$paraData['allCount'].')</label>';
- echo '</div>';
+ echo '</div>';/*/
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device0'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['pcCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['pcCount'].'</span></span>';
+ echo '<th>'.$lang['srv_para_graph_device'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_para_graph_device0'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['pcCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['pcCount'].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device1'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['mobiCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['mobiCount'].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_device1'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['mobiCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['mobiCount'].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_device2'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['tabletCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['tabletCount'].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_device2'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['tabletCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['tabletCount'].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
@@ -87,7 +98,7 @@ class SurveyParaGraph{
echo '<th nowrap>'.$lang['srv_para_graph_device3'].'</th>';
echo '<td style="width:100%">';
echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['robotCount']/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['robotCount'].'</span></span>';
+ echo ' <span >'.$paraData['robotCount'].'</span>';
echo '</td>';
echo '</tr>';
@@ -102,7 +113,12 @@ class SurveyParaGraph{
// Browser
echo '<fieldset><legend>'.$lang['srv_para_graph_browser'].'</legend>';
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_para_graph_browser'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
if(count($paraData['browser']) > 0){
if(count($paraData['browser']) > 1)
@@ -112,10 +128,12 @@ class SurveyParaGraph{
if($key != $lang['srv_para_graph_other_slo'] && $key != $lang['srv_para_graph_other_ang']){
echo '<tr>';
- echo '<th nowrap>'.$key.'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $browserCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$browserCnt.'</span></span>';
+ echo '<td>'.$key.'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $browserCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$browserCnt.'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
@@ -123,20 +141,24 @@ class SurveyParaGraph{
if(isset($paraData['browser'][$lang['srv_para_graph_other_slo']]) && $paraData['browser'][$lang['srv_para_graph_other_slo']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['browser'][$lang['srv_para_graph_other_slo']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['browser'][$lang['srv_para_graph_other_slo']].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
if(isset($paraData['browser'][$lang['srv_para_graph_other_ang']]) && $paraData['browser'][$lang['srv_para_graph_other_ang']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['browser'][$lang['srv_para_graph_other_ang']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['browser'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['browser'][$lang['srv_para_graph_other_ang']].'</span>';
+ echo '</div';
echo '</td>';
echo '</tr>';
}
@@ -153,7 +175,12 @@ class SurveyParaGraph{
// Operacijski sistem
echo '<fieldset><legend>'.$lang['srv_para_graph_os'].'</legend>';
- echo '<table style="width:100%">';
+ echo '<table class="parapodatki_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_para_graph_os'].'</th>';
+ echo '<th>'.$lang['srv_stevilo_enot'].'</th>';
+ echo '</tr>';
if(count($paraData['os']) > 0){
if(count($paraData['os']) > 1)
@@ -163,10 +190,12 @@ class SurveyParaGraph{
if($key != $lang['srv_para_graph_other_slo'] && $key != $lang['srv_para_graph_other_ang']){
echo '<tr>';
- echo '<th nowrap>'.$key.'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $osCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$osCnt.'</span></span>';
+ echo '<td>'.$key.'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $osCnt/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$osCnt.'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
@@ -174,20 +203,24 @@ class SurveyParaGraph{
if(isset($paraData['os'][$lang['srv_para_graph_other_slo']]) && $paraData['os'][$lang['srv_para_graph_other_slo']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['os'][$lang['srv_para_graph_other_slo']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_slo']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['os'][$lang['srv_para_graph_other_slo']].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
if(isset($paraData['os'][$lang['srv_para_graph_other_ang']]) && $paraData['os'][$lang['srv_para_graph_other_ang']] > 0){
echo '<tr>';
- echo '<th nowrap>'.$lang['srv_para_graph_other'].'</th>';
- echo '<td style="width:100%">';
- echo ' <div class="graph_lb" style="text-align: right; float: left; width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
- echo ' <span style="display: block; margin: auto auto auto 5px; float: left">'.$paraData['os'][$lang['srv_para_graph_other_ang']].'</span></span>';
+ echo '<td>'.$lang['srv_para_graph_other'].'</td>';
+ echo '<td class="graph_cell">';
+ echo '<div class="graph_cell">';
+ echo ' <div class="graph_full" style="width: '.($paraData['allCount']>0 ? $paraData['os'][$lang['srv_para_graph_other_ang']]/$paraData['allCount']*85 : '0').'%">&nbsp;</div>';
+ echo ' <span >'.$paraData['os'][$lang['srv_para_graph_other_ang']].'</span>';
+ echo '</div>';
echo '</td>';
echo '</tr>';
}
@@ -236,7 +269,7 @@ class SurveyParaGraph{
'os' => array()
);
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
// Loop cez vse ustrezne respondente
while($rowu = mysqli_fetch_array($sqlu)){
@@ -382,13 +415,18 @@ class SurveyParaGraph{
function paraGraphFixOld(){
global $lang;
+ // Ce ni nastavljen broscap, ne naredimo nicesar
+ if(!get_cfg_var('browscap'))
+ return;
+
if(isset($_GET['refresh']) && $_GET['refresh'] == 1)
$sqlu = sisplet_query("SELECT id, useragent FROM srv_user WHERE ank_id='".$this->anketa."' AND last_status>'2' AND useragent!='' AND preview='0' AND deleted='0'");
else
$sqlu = sisplet_query("SELECT id, useragent FROM srv_user WHERE ank_id='".$this->anketa."' AND last_status>'2' AND useragent!='' AND browser='' AND preview='0' AND deleted='0'");
+
if(mysqli_num_rows($sqlu) > 0){
- $detect = New Mobile_Detect();
+ $detect = New \Detection\MobileDetect;
$cnt = 0;
while($rowu = mysqli_fetch_array($sqlu)){
diff --git a/admin/survey/classes/class.SurveyPostProcess.php b/admin/survey/classes/class.SurveyPostProcess.php
index 4b79ae5..2af0cbf 100644
--- a/admin/survey/classes/class.SurveyPostProcess.php
+++ b/admin/survey/classes/class.SurveyPostProcess.php
@@ -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();
@@ -42,26 +41,33 @@ class SurveyPostProcess {
function displayTab () {
global $lang;
- echo '<fieldset><legend>'.$lang['srv_compute'].'</legend>';
+ echo '<fieldset id="calculations"><legend>'.$lang['srv_compute'].'</legend>';
echo '<script>__vnosi=1;</script>';
$b = new Branching($this->anketa);
$sql = sisplet_query("SELECT s.id, s.naslov, s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip='22'");
+ $count = 0;
if (mysqli_num_rows($sql) > 0) {
- echo '<p>'.$lang['srv_compute_list'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_compute_list'].'</p>';
while ($row = mysqli_fetch_array($sql)) {
-
- echo '<p>'.$row['naslov'].': <a href="" onclick="calculation_editing(\'-'.$row['id'].'\'); return false;"><b> '.$row['variable'].'= '.$b->calculations_display(-$row['id'], 1).'</b></a></p>';
+ $count +=1;
+ echo '<div class="icon_holder">';
+ echo '<p>'.$row['naslov'].' '.$count.': '.$b->calculations_display(-$row['id'], 1).'</p>';
+ echo '<span class="faicon edit aslink" onclick="calculation_editing(\'-'.$row['id'].'\'); return false;"></span>';
+ echo '<span class="faicon trash empty aslink" onclick="brisi_spremenljivko(\''.$row['id'].'\'); return false;"></span>';
+ echo '</div>';
}
}
- echo '<p><a href="" onclick="spremenljivka_new(0, 0, 1, 0, 22); return false;">'.$lang['srv_add_compute'].'</a></p>';
+ echo '<a class="noline" href="#" onClick="spremenljivka_new(0, 0, 1, 0, 22); return false;"><span class="faicon plus_circle link-right"></span>'.$lang['srv_add_compute'].'</a>';
if (mysqli_num_rows($sql) > 0) {
- echo '<span class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="postprocess_start_calculation(); return false;">'.$lang['srv_compute_start'].'</a></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="postprocess_start_calculation(); return false;">'.$lang['srv_compute_start'].'</button>';
+ echo '</div>';
}
echo '</legend>';
@@ -94,9 +100,13 @@ class SurveyPostProcess {
$freq = SurveyAnalysis::getFrequencys();
$ok = false;
-
- echo '<p id="ok">'.$lang['srv_mass_coding'].': ';
- echo '<select name="spr_id" id="mass_coding_spr_id" style="width:250px">';
+
+ echo '<div id="ok">';
+
+ echo '<div class="setting_holder">';
+ echo '<label for="mass_coding_spr_id">'.$lang['srv_mass_coding'].'</label>';
+
+ echo '<select class="dropdown large w400" name="spr_id" id="mass_coding_spr_id">';
foreach (SurveyAnalysis::$_HEADERS AS $key => $h) {
@@ -117,22 +127,37 @@ class SurveyPostProcess {
}
}
- echo '</select> ';
+ echo '</select>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
- echo '<select name="coding_type" id="coding_type">';
+ echo '<label for="coding_type">'.$lang['srv_mass_coding_count'].'</label>';
+ echo '<select class="dropdown large w400" name="coding_type" id="coding_type">';
echo '<option value="1">'.$lang['srv_coding_one'].'</option>';
echo '<option value="2">'.$lang['srv_coding_multi'].'</option>';
echo '</select> ';
-
- echo '<input type="submit" value="'.$lang['srv_save_and_run_profile'].'" onclick="$(this).prop(\'disabled\', true); mass_coding($(\'#mass_coding_spr_id\').val(), $(\'#coding_type\').val()); return false;"></p>';
-
+
+ echo '</div>';
+
+ echo '<div class="button_holder intext">';
+ echo '<button class="medium blue" type="submit" onclick="$(this).prop(\'disabled\', true); mass_coding($(\'#mass_coding_spr_id\').val(), $(\'#coding_type\').val()); return false;">'.$lang['srv_mass_coding_run'].'</button>';
+ echo '</div>';
+ echo '</div>';
if (!$ok) {
- ?><script> $('#ok').hide(); </script><?
- echo '<p>'.$lang['srv_mass_coding_no_vars'].'</p>';
+ ?><script> $('#ok').addClass('displayNone'); </script><?
+ echo '<p class="bold">'.$lang['srv_mass_coding_no_vars'].'</p>';
+ }
+ else {
+ ?><script> $('#ok').removeClass('displayNone'); </script><?
}
- echo '<p>'.$lang['srv_mass_coding_txt'].'</p>';
+ echo '<p class="top16">'.$lang['srv_mass_coding_txt1'].'</p>';
+ echo '<p class="top16">'.$lang['srv_mass_coding_txt2'].'</p>';
+ echo '<p class="top16">'.$lang['srv_mass_coding_txt3'].'</p>';
+ echo '<p class="top16">'.$lang['srv_mass_coding_txt4'].'</p>';
echo '</fieldset>';
}
@@ -143,6 +168,7 @@ class SurveyPostProcess {
*/
function displayCoding () {
global $lang;
+ global $global_user_id;
//$this->updateTracking($this->anketa, 4);
echo '<fieldset><legend>'.$lang['srv_hand_coding'].'</legend>';
@@ -159,21 +185,24 @@ class SurveyPostProcess {
SurveyAnalysis::Init($this->anketa);
$freq = SurveyAnalysis::getFrequencys();
- echo '<p class="coding-refresh"><a href="index.php?anketa='.$this->anketa.'&a=data&m=coding">'.$lang['src_coding_refresh'].'</a></p>';
-
-
SurveyVariablesProfiles::Init($this->anketa, $global_user_id);
$variables = SurveyVariablesProfiles::getProfileVariables(-1);
if (SurveyVariablesProfiles::getCurentProfileId() != -1)
$variables = array();
- echo '<p>'.$lang['srv_hand_coding_text'] . '</p>';
-
- echo '<p><label id="link_variable_profile_remove" onclick="removeVariableProfile();"><input type="radio" name="filter" '.(count($variables)==0?'checked':'').'> '.$lang['srv_coding_spr_1'].'</label></p>';
-
- echo '<p><label onclick="coding_filter($(\'#mass_coding_spr_id\').val());"><input type="radio" name="filter" '.(count($variables)>0?'checked':'').' onclick="return false;"> '.$lang['srv_coding_spr'].':</label> ';
- echo '<select name="spr_id" id="mass_coding_spr_id" style="width:200px" onchange="coding_filter($(\'#mass_coding_spr_id\').val()); return false;">';
-
+ echo '<p class="bottom16">'.$lang['srv_hand_coding_text'] . '</p>';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="filter" '.(count($variables)==0?'checked':'').'>';
+ echo '<label id="link_variable_profile_remove" onclick="removeVariableProfile();"> '.$lang['srv_coding_spr_1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="filter" '.(count($variables)>0?'checked':'').' onclick="return false;">';
+ echo '<label onclick="coding_filter($(\'#mass_coding_spr_id\').val());"> '.$lang['srv_coding_spr'].':</label>';
+ echo '<select name="spr_id" id="mass_coding_spr_id" class="dropdown medium '.(count($variables)>0?'':'disabled').'" onchange="coding_filter($(\'#mass_coding_spr_id\').val()); return false;">';
+
SurveyAnalysis::Init($this->anketa);
$freq = SurveyAnalysis::getFrequencys();
@@ -197,10 +226,11 @@ class SurveyPostProcess {
}
echo '</select> ';
- //echo '<input type="submit" value="'.$lang['srv_coding_filter'].'" onclick="$(this).prop(\'disabled\', true); coding_filter($(\'#mass_coding_spr_id\').val()); return false;"> ('.$lang['srv_coding_spr2'].')</p>';
- if ( count($variables)>0 )
- echo '('.$lang['srv_coding_spr2'].')';
- echo '</p>';
+ echo '</div>';
+
+ echo '<div class="setting_item coding-refresh"><p class="top4 bottom4"><a href="index.php?anketa='.$this->anketa.'&a=data&m=coding">'.$lang['src_coding_refresh'].'</a></p></div>';
+
+ echo '</div>';
SurveyDataDisplay::displayVnosiHTML();
@@ -216,7 +246,7 @@ class SurveyPostProcess {
function ajax() {
$this->anketa = $_REQUEST['anketa'];
- $this->spremenljivka = $_REQUEST['spremenljivka'];
+ $this->spremenljivka = isset($_REQUEST['spremenljivka']) ? $_REQUEST['spremenljivka'] : null;
if ($_GET['a'] == 'postprocess_start_calculation') {
$this->ajax_postprocess_start_calculation();
@@ -514,8 +544,10 @@ class SurveyPostProcess {
\App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($spr_id);
echo '<div class="buttons_holder">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="javascript:$(\'#submit\').click(); return false;"><span>'.$lang['srv_potrdi'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="javascript:edit_data_close();"><span>'.$lang['srv_cancel'].'</span></a></div></span>';
+
+ echo '<button class="medium white-blue" onclick="javascript:edit_data_close();">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onClick="javascript:$(\'#submit\').click(); return false;">'.$lang['srv_potrdi'].'</button>';
+
echo '</div>';
echo '</form>';
@@ -574,8 +606,8 @@ class SurveyPostProcess {
echo '<form action="ajax.php?t=postprocess&a=edit_data_question_save&anketa='.$this->anketa.'">';
echo '<input type="hidden" name="spr_id" value="'.$spr_id.'" />';
echo '<input type="hidden" name="visible_'.$spr_id.'" value="1" />';
-
- echo '<select name="vrednost_'.$spr_id.'" onchange="edit_data_inline_edit_save(this.parentNode.getAttribute(\'name\'));">';
+
+ echo '<select class="fullwidth dropdown" name="vrednost_'.$spr_id.'" onchange="edit_data_inline_edit_save(this.parentNode.getAttribute(\'name\'));">';
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$spr_id' ORDER BY vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
@@ -588,7 +620,7 @@ class SurveyPostProcess {
function ajax_get_inline_edit_all () {
- $spr = $_POST['spr'];
+ $spr = isset($_POST['spr']) ? $_POST['spr'] : array();
$response = array();
@@ -603,7 +635,7 @@ class SurveyPostProcess {
$output['html'] .= '<input type="hidden" name="spr_id" value="'.$spr_id.'" />';
$output['html'] .= '<input type="hidden" name="visible_'.$spr_id.'" value="1" />';
- $output['html'] .= '<select name="vrednost_'.$spr_id.'" onchange="edit_data_inline_edit_save(this.parentNode.getAttribute(\'name\'));">';
+ $output['html'] .= '<select class="fullwidth dropdown" name="vrednost_'.$spr_id.'" onchange="edit_data_inline_edit_save(this.parentNode.getAttribute(\'name\'));">';
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$spr_id' ORDER BY naslov ASC");
while ($row = mysqli_fetch_array($sql)) {
@@ -632,7 +664,9 @@ class SurveyPostProcess {
} else {
$coding_id = $spr_id;
}
- echo '<h3 style="margin: 7px 10px">'.$lang['srv_hand_coding'].'</h3>';
+ echo '<div class="popup_close"><a href="#" onClick="toggle_coding_div(); return false;">✕</a></div>';
+ echo '<h2><span class="faicon fa-code-branch blue"></span>'.$lang['srv_hand_coding'].'</h2>';
+
echo '<form id="coding_'.$usr_id.'">';
echo '<input type="hidden" value="'.$usr_id.'" name="usr_id">';
@@ -644,23 +678,34 @@ class SurveyPostProcess {
while ($row = mysqli_fetch_array($sql)) {
echo '<fieldset style="position: relative">';
+
+ //Zgornji sivi del
+ echo '<div class="variable_name">';
- echo '<p style="float:left; min-height:20px"><strong>'.skrajsaj(strip_tags($row['naslov']), 20).'</strong> <a href="" onclick="$(\'.edit_'.$row['id'].'\').toggle(); return false;" title="'.$lang['edit2'].'"><span class="faicon edit"></span></a></p>';
- echo '<p class="edit_'.$row['id'].'" style="display:none; float:left; margin-left:10px">'.$lang['srv_tip'].': ';
- echo '<select name="tip" onchange="if (confirm(\''.$lang['srv_change_q_tip'].'\')) {coding_tip(\''.$row['id'].'\', \''.$usr_id.'\', $(this).val());} return false;"><option value="1" '.($row['tip']==1?'selected':'').'>'.$lang['srv_vprasanje_tip_1'].'</option><option value="2" '.($row['tip']==2?'selected':'').'>'.$lang['srv_vprasanje_tip_2'].'</option><option value="3" '.($row['tip']==3?'selected':'').'>'.$lang['srv_vprasanje_tip_3'].'</option></select>';
- //echo '<a href="#" onclick="if (confirm(\''.$lang['srv_change_q_tip'].'\')) {coding_tip(\''.$row['id'].'\', \''.$usr_id.'\', \''.($row['tip']==1?'2':'1').'\');} return false;" title="'.$lang['srv_change_q_tip'].'">'.($row['tip']==1?$lang['srv_vprasanje_tip_1']:$lang['srv_vprasanje_tip_2']).'</a>';
- echo ' <a href="index.php?anketa='.$this->anketa.'&spr_id='.$row['id'].'#branching_'.$row['id'].'">'.$lang['srv_napredno_urejanje'].'</a> <a href="" onclick="brisi_spremenljivko(\''.$row['id'].'\'); return false;" title="'.$lang['srv_brisispremenljivko'].'"><span class="faicon delete icon-grey_dark_link"></span></a></p>';
-
- echo '<input id="visible_'.$row['row'].'" type="hidden" value="1" name="visible_'.$row['id'].'">';
+ echo '<div class="osnovno">';
+ echo '<p class=semi-bold>'.skrajsaj(strip_tags($row['naslov']), 20).'</p>';
+ echo '<span class="faicon edit pointer blue" onclick="$(\'.edit_'.$row['id'].'\').toggle(); return false;" title="'.$lang['edit2'].'"></span>';
+ echo '<span class="faicon delete empty blue pointer" onclick="brisi_spremenljivko(\''.$row['id'].'\'); return false;" title="'.$lang['srv_brisispremenljivko'].'"></span>';
+ echo '</div>';
+
+ echo '<div class="urejanje edit_'.$row['id'].'" style="display:none;">'.$lang['srv_tip'].': ';
+ echo '<select name="tip" class="dropdown small" onchange="if (confirm(\''.$lang['srv_change_q_tip'].'\')) {coding_tip(\''.$row['id'].'\', \''.$usr_id.'\', $(this).val());} return false;"><option value="1" '.($row['tip']==1?'selected':'').'>'.$lang['srv_vprasanje_tip_1'].'</option><option value="2" '.($row['tip']==2?'selected':'').'>'.$lang['srv_vprasanje_tip_2'].'</option><option value="3" '.($row['tip']==3?'selected':'').'>'.$lang['srv_vprasanje_tip_3'].'</option></select>';
+ echo '<a class="noline" href="index.php?anketa='.$this->anketa.'&spr_id='.$row['id'].'#branching_'.$row['id'].'">'.$lang['srv_napredno_urejanje'].'</a></div>';
+
+ echo '</div>';
+
+ //Spodnji del
+ echo '<div class="variable_content">';
- //echo '<input type="hidden" value="'.$row['id'].'" name="spr_id">';
+ echo '<input id="visible_'.$row['id'].'" type="hidden" value="1" name="visible_'.$row['id'].'">';
- echo '<p style="clear:both">';
if ($row['tip'] == 3) {
echo '<select name="vrednost_'.$row['id'].'">';
}
$sql1 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' ORDER BY vrstni_red ASC");
while ($row1 = mysqli_fetch_array($sql1)) {
+
+ echo '<div class="setting_holder horizontal">';
$sql2 = sisplet_query("SELECT * FROM srv_data_vrednost".$this->db_table." WHERE spr_id='$row[id]' AND vre_id='$row1[id]' AND usr_id='$usr_id'");
if (mysqli_num_rows($sql2) > 0)
@@ -675,46 +720,48 @@ class SurveyPostProcess {
}
if ($row['tip'] == 1 || $row['tip'] == 2) {
- echo '<span style="display:none; color:gray; float:right" class="edit_'.$row['id'].'"><select onchange="coding_merge(\''.$row['id'].'\', \''.$row1['id'].'\', \''.$usr_id.'\', this.value)" style="width:150px">';
+ echo '<span style="display:none;" class="edit_'.$row['id'].'"><select class="dropdown small" onchange="coding_merge(\''.$row['id'].'\', \''.$row1['id'].'\', \''.$usr_id.'\', this.value)" style="width:150px">';
echo '<option value="0">'.$lang['srv_coding_merge'].':</option>';
$sql2 = sisplet_query("SELECT id, naslov FROM srv_vrednost WHERE spr_id='$row[id]' AND id != '$row1[id]' ORDER BY vrstni_red ASC");
while ($row2 = mysqli_fetch_array($sql2))
echo '<option value="'.$row2['id'].'">'.$row2['naslov'].'</option>';
- echo '</select></span><br />';
+ echo '</select>';
}
+
+ echo '</div>';
}
if ($row['tip'] == 3) {
echo '</select>';
}
- echo '<input type="text" name="vrednost_new_'.$row['id'].'" value="" placeholder="'.$lang['srv_novavrednost'].'" style="margin-left:23px; width: 80px" /> <a href="#" onclick="coding_vrednost_new(\''.$row['id'].'\', \''.$usr_id.'\', $(\'input[name=vrednost_new_'.$row['id'].']\').val()); return false;"><span class="faicon add small icon-as_link" title="'.$lang['add'].'"></span></a>';
- echo '</p>';
+ echo '<input type="text" class="text small" name="vrednost_new_'.$row['id'].'" value="" placeholder="'.$lang['srv_novavrednost'].'"/> <a href="#" onclick="coding_vrednost_new(\''.$row['id'].'\', \''.$usr_id.'\', $(\'input[name=vrednost_new_'.$row['id'].']\').val()); return false;"><span class="faicon add blue pointer" title="'.$lang['add'].'"></span></a>';
+
+ echo '</div>'; #div.variable_content
echo '</fieldset>';
}
} else {
- echo '<fieldset>';
- echo '<p>'.$lang['srv_coding_no_spr'].'</p>';
- echo '</fieldset>';
+ echo '<p class="italic bottom16">'.$lang['srv_coding_no_spr'].'</p>';
}
- echo '<div class="new-spr">';
- echo '<a href="#" onclick="'.(true?' $(\'#coding_spr_new\').toggle();':'').' return false;">'.$lang['srv_coding_new'].'</a>';
- echo '<div id="coding_spr_new" '.(true?' style="display:none"':'').'>';
- echo '<p>'.$lang['name'].': <input type="text" name="spremenljivka_new" value="" style="width: 123px" /> <a href="#" onclick="coding_spremenljivka_new(\''.$coding_id.'\', \''.$usr_id.'\', $(\'input[name=spremenljivka_new]\').val()); return false;">'.$lang['add'].'</a></p>';
+
+ echo '<div class="button_holder left" id="dodaj_spr">';
+ echo '<button class="medium blue" onclick="'.(true?' $(\'#coding_spr_new\').toggle(); $(\'#dodaj_spr\').toggle();':'').' return false;">'.$lang['srv_coding_new'].'</button>';
echo '</div>';
+
+ echo '<div class="setting_holder horizontal" id="coding_spr_new" '.(true?' style="display:none"':'').'>';
+ echo '<p>'.$lang['name'].':</p>';
+ echo '<div class="button_holder inline">';
+ echo '<input type="text" class="text large" name="spremenljivka_new" value=""/>';
+ echo '<button class="medium blue" onclick="coding_spremenljivka_new(\''.$coding_id.'\', \''.$usr_id.'\', $(\'input[name=spremenljivka_new]\').val()); return false;">'.$lang['add'].'</button>';
+ echo '<button class="medium white-blue" onclick="$(\'#coding_spr_new\').toggle(); $(\'#dodaj_spr\').toggle(); return false;">'.$lang['edit1338'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder left">';
+ echo '<button class="medium white-blue" onclick="coding_save(\''.$usr_id.'\'); return false;">'.$lang['save'].'</button>';
echo '</div>';
-
-
-
- echo '<p style="margin:20px 10px 10px 10px">';
-
- if (mysqli_num_rows($sql) > 0) {
- //echo '<input type="submit" value="'.$lang['srv_close_profile'].'" onclick="coding_save(\''.$usr_id.'\'); return false;"> ';
- }
- echo '<a href="#" onclick="coding_save(\''.$usr_id.'\'); return false;">'.$lang['srv_close_profile'].'</a>';
- echo '</p>';
echo '</form>';
@@ -780,7 +827,7 @@ class SurveyPostProcess {
SurveyVariablesProfiles::Init($this->anketa, $global_user_id);
$variables = SurveyVariablesProfiles::getProfileVariables(0);
- if ( count($variables['variables']) > 0 ) {
+ if ( isset($variables['variables']) && count($variables['variables']) > 0 ) {
SurveyVariablesProfiles::setProfileVariables(0, implode(',', $variables['variables']).','.$spr_new.'_0');
SurveyVariablesProfiles::setDefaultProfile(0);
}
@@ -862,12 +909,18 @@ class SurveyPostProcess {
session_start();
$_SESSION['sid_'.$this->anketa]['dataIcons_labels'] = true;
+ echo '<h2><span class="faicon blue fa-check-circle"></span>'.$lang['srv_auto_coding_end_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="popupClose();">✕</a></div>';
+
echo '<p>';
printf($lang['srv_auto_coding_end'], $this->mass_coding_auto_vars, $link);
echo '</p>';
-
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="popupClose(); window.location.reload(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
}
private $mass_coding_auto_vars = 0;
@@ -894,7 +947,7 @@ class SurveyPostProcess {
// imamo sekvenco polja (pozicijo v text fajlu)
if ($sequence != false) {
- $besede = $freq[$sequence]['valid'];
+ $besede = isset($freq[$sequence]['valid']) ? $freq[$sequence]['valid'] : array();
$koreni = array();
// sestavimo array korenov
@@ -931,6 +984,7 @@ class SurveyPostProcess {
// array obrnemo, da imamo vrstni_red => koren
$i = 1;
+ $koren = array();
foreach ($koreni AS $key => $val) {
$koren[$i++] = $key;
}
diff --git a/admin/survey/classes/class.SurveyQuotas.php b/admin/survey/classes/class.SurveyQuotas.php
index 7f71e73..4059521 100644
--- a/admin/survey/classes/class.SurveyQuotas.php
+++ b/admin/survey/classes/class.SurveyQuotas.php
@@ -154,37 +154,46 @@ class SurveyQuotas {
echo '<div class="popup_close"><a href="#" onClick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">✕</a></div>';
- echo '<div id="quota_editing_inner">';
+ echo '<div id="quota_editing_inner" class="podatki">';
$this->quota_editing_inner($condition, $vrednost);
echo '</div>';
- echo '<div id="bottom_space">';
+ echo '<div id="bottom_options">';
$row = Cache::srv_spremenljivka(-$condition);
- if ($condition < 0) {
- echo '<p style="float:left; padding:0; margin:0; margin-left:20px">'.$lang['srv_variable'].': <input type="text" id="variable_'.(-$condition).'" value="'.$row['variable'].'" onkeyup="quota_edit_variable(\''.-$condition.'\');" style="width:60px" /></p>';
+ if ($condition < 0) {
+ echo '<div class="setting_horizontal_wrapper">';
+
+ echo '<div class="setting_holder">';
+ echo ' <label>'.$lang['srv_variable'].':</label>';
+ echo ' <input type="text" id="variable_'.(-$condition).'" class="large" value="'.$row['variable'].'" onkeyup="quota_edit_variable(\''.-$condition.'\');" />';
+ echo '</div>';
+
+ echo '</div>';
}
+ echo '</div>';
- echo '<div id="condition_editing_close">';
- // kvota kot spremenljivka (lahko jo zbrisemo)
- if ($condition < 0) {
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;"><span>'.$lang['srv_anketadelete_txt'].'</span></a>';
- echo '</span>';
- }
+ echo '<div id="condition_editing_close" class="podatki">';
+ echo ' <div class="button_holder">';
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
+ // kalkulacija kot spremenljivka (lahko jo zbrisemo)
+ if ($condition < 0)
+ echo ' <button class="medium white-blue" onclick="brisi_spremenljivko(\''.(-$condition).'\'); return false;">'.$lang['srv_anketadelete_txt'].'</button>';
- echo '<span class="buttonwrapper floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
-
- echo '</div>';
+ echo ' <button class="medium white-blue" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onclick="quota_editing_close(\''.$condition.'\', \''.$vrednost.'\'); return false;">'.$lang['srv_potrdi'].'</button>';
+
+ echo ' </div>';
echo '</div>';
+
+
+ ?><script>
+ $('#quota_editing_inner').sortable({items: 'form', handle: '.move', stop: function () {
+ quota_sort(<?=$condition?>);
+ } });
+ </script><?
}
private function quota_editing_inner ($condition, $vrednost=0) {
@@ -192,23 +201,16 @@ class SurveyQuotas {
echo '<div class="quota_editing_preview">';
- echo '<h2>'.$lang['srv_quota'].'</h2>';
+ echo '<h2><span class="blue faicon edit"></span>'.$lang['srv_quota'].'</h2>';
echo '<div id="quota_editing_calculations">';
echo $this->quota_display($condition, 1);
echo '</div>';
+
echo '</div>';
- echo '<div class="condition_editing_body">';
- echo '<h2>'.$lang['srv_edit_quota'].'</h2>';
- echo '</div>';
-
- // Vrednost kvote
- /*$rowS = Cache::srv_spremenljivka(-$condition);
- echo '<div id="quota_value_holder">';
- echo $lang['srv_quota_value'].': ';
- echo ' <input type="text" name="value" id="quota_value" value="'.$rowS['vsota_limit'].'" style="width:50px" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 9, 0);" onBlur="quota_value_edit(\''.$rowS['id'].'\');">';
- echo '</div>';*/
-
+
+ echo '<div class="quota_editing_body">';
+
$sql = sisplet_query("SELECT id FROM srv_quota WHERE cnd_id = '$condition' ORDER BY vrstni_red");
if (mysqli_num_rows($sql) == 0) {
sisplet_query("INSERT INTO srv_quota (id, cnd_id, vrstni_red) VALUES ('', '$condition', '1')");
@@ -218,12 +220,14 @@ class SurveyQuotas {
$this->quota_edit($row['id'], $vrednost);
}
- echo '<p id="quota_editing_operators" style="margin-left:62px">'.$lang['srv_add_cond'].':
- <a href="#" onclick="quota_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
- <a href="#" onclick="quota_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
- </p>';
+ echo '<p id="quota_editing_operators" class="div_quota_bottom">'.$lang['srv_add_cond'].':
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'0\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;+&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'1\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;-&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'2\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;*&nbsp;</strong></a>,
+ <a href="#" onclick="quota_add(\''.$condition.'\', \'3\', \''.$vrednost.'\'); return false;" class="noline"><strong style="font-size:18px">&nbsp;/&nbsp;</strong></a>
+ </p>';
+
+ echo '</div>';
}
/**
@@ -251,74 +255,76 @@ class SurveyQuotas {
if (!$sql_count) die();
$row_count = mysqli_fetch_array($sql_count);
- if ($row['vrstni_red'] == 1 && $row_count['count'] > 1) {
- echo '<table class="tbl_condition_editing">';
- echo '<tr>';
- echo '<th style="text-align:center; width:50px">'.$lang['srv_oklepaji'].'</th>'; // gumbi oklepaji
- echo '<th style="width:70px">&nbsp;</th>'; // logicni operatorji
- echo '<th style="width:50px">&nbsp;</th>'; // oklepaji
- echo '<th >&nbsp;</th>';
- echo '<th style="text-align:center; width:50px;">'.$lang['srv_zaklepaji'].'</th>'; // gumbi zaklepaji
- echo '<th style="text-align:center; width:60px">'.$lang['edit2'].'</th>'; // move
- echo '</tr>';
- echo '</table>';
-
- } elseif ($row['vrstni_red'] == 1) {
- echo '<table class="tbl_condition_editing"><tr><th>&nbsp;</th></tr></table>';
+
+ // operator
+ if ($row['vrstni_red'] > 1) {
+ echo '<div class="condition_editing_row operator">';
+
+ if ($row['operator']==0)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'1\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;+&nbsp;</a>';
+ if ($row['operator']==1)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'2\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;-&nbsp;</a>';
+ if ($row['operator']==2)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'3\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;*&nbsp;</a>';
+ if ($row['operator']==3)
+ echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'0\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;/&nbsp;</a>';
+
+ echo '</div>';
}
+
// form
echo '<form name="quota_'.$quota.'" id="quota_'.$quota.'" action="" method="post" onsubmit="quota_edit(\''.$quota.'\'); return false;">'."\n\r";
- echo '<table class="tbl_condition_editing" style="margin-bottom:10px; padding-bottom:10px; background-color:white">';
- echo '<tr>';
+
+ echo '<div class="condition_editing_row">';
+
+ // move
+ echo '<div class="move_holder">';
+ if ($row_count['count'] != 1 )
+ echo '<span class="faicon move_updown move" title="'.$lang['srv_move'].'"></span>';
+ echo '</div>';
+
+ // Srednji bel del
+ echo '<div class="white_holder">';
// left_bracket
+ echo '<div class="column bracket left">';
+
if ($row_count['count'] != 1 || $row['left_bracket']>0 || $row['right_bracket']>0) {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add small"></span></a>';
- if ($row['left_bracket'] > 0)
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon add small"></span></a>';
- else
- echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- }
- else {
- echo '<td class="tbl_ce_lol white" style="width:50px; text-align:center;" >';
- }
- echo '</td>';
- // operator
- echo '<td class="tbl_ce_tb white" style="width:77px; text-align:center">';
+ echo '<div class="bracket_icons">';
- if ($row['vrstni_red'] == 1) {
- // nimamo nic..
- } else {
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'plus\' ); return false;" title="'.$lang['srv_oklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ if ($row['left_bracket'] > 0)
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'left\', \'minus\'); return false;" title="'.$lang['srv_oklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
+ else
+ echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- if ($row['operator']==0)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'1\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;+&nbsp;</a>';
- if ($row['operator']==1)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'2\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;-&nbsp;</a>';
- if ($row['operator']==2)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'3\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;*&nbsp;</a>';
- if ($row['operator']==3)
- echo '<a href="#" onclick="quota_operator_edit(\''.$quota.'\', \'0\'); return false;" style="font-weight:bold; font-size:18px" title="'.$lang['srv_edit_condition_conjunction'].'">&nbsp;/&nbsp;</a>';
- }
+ echo '</div>';
- echo '</td>';
+ echo '<div class="bracket_text">'.$lang['srv_oklepaji'].'</div>';
+ }
+ echo '</div>';
// left_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket left">';
+
for ($i=$row['left_bracket']; $i>0; $i--) {
- echo ' ( '; }
- echo '</td>';
+ echo ' ( ';
+ }
+
+ echo '</div>';
// spremenljivka
- echo '<td class="tbl_ce_tb white" style="width:auto">';
+ echo '<div class="column variable">';
+
if ($row['spr_id']==0) echo '<span class="red">'.$lang['srv_select_spr'].'!</span>';
- echo '<br />';
- echo '<select name="quota_spremenljivka_'.$quota.'" id="quota_spremenljivka_'.$quota.'" size="1" style="width:150px" onchange="javascript:quota_edit(\''.$quota.'\', \''.$vrednost.'\');">'."\n\r";
+
+ echo '<select name="quota_spremenljivka_'.$quota.'" id="quota_spremenljivka_'.$quota.'" class="dropdown medium" size="1" style="width:150px" onchange="javascript:quota_edit(\''.$quota.'\', \''.$vrednost.'\');">'."\n\r";
echo '<option value="0"></option>';
@@ -443,61 +449,54 @@ class SurveyQuotas {
echo '</select>';
-
- // Vrednost kvote
- /*echo ' <input type="text" name="value" id="quota_value_'.$quota.'" value="'.$row['value'].'" style="width:40px" >';
- echo '<script type="text/javascript">'; // shranimo ko zapustmo input polje
- echo '$(document).ready(function() {' .
- ' $("input#quota_value_'.$quota.'").bind("blur", {}, function(e) {' .
- ' quota_edit(\''.$quota.'\', \''.$vrednost.'\'); return false; ' .
- ' });' .
- '});';
- echo '</script>';*/
-
-
- echo '<br />&nbsp;'."\n\r";
- echo '</td>';
+ echo '</div>';
// right_bracket
- echo '<td class="tbl_ce_tb white" style="width:40px; text-align:center">';
+ echo '<div class="column display_bracket right">';
+
for ($i=$row['right_bracket']; $i>0; $i--) {
echo ' ) ';
}
- echo '</td>';
+
+ echo '</div>';
// right_bracket buttons
+ echo '<div class="column bracket right">';
+
if ($row_count['count'] != 1 || $row['right_bracket']>0 || $row['left_bracket']>0) {
- echo '<td class="tbl_ce_lor" style="width:50px; text-align:center" nowrap>';
+
+ echo '<div class="bracket_icons">';
+
if ($row['right_bracket'] > 0)
echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'minus\'); return false;" title="'.$lang['srv_zaklepaj_rem'].'"><span class="faicon delete_circle"></span></a>';
else
echo '<span class="faicon delete_circle icon-grey_normal"></span>';
- echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add small"></span></a>';
+ echo '<a href="#" onclick="javascript:quota_bracket_edit_new(\''.$quota.'\', \''.$vrednost.'\', \'right\', \'plus\' ); return false;" title="'.$lang['srv_zaklepaj_add'].'"><span class="faicon add"></span></a>';
+
+ echo '</div>';
+
+ echo '<div class="bracket_text">'.$lang['srv_zaklepaji'].'</div>';
}
- else {
- echo '<td class="tbl_ce_lor white" style="width:50px; text-align:center" nowrap>';
- }
- echo '</td>';
- // move
- echo '<td class="tbl_ce_bck_blue white" style="text-align:right; width:30px">';
- if ($row_count['count'] != 1 )
- echo '<img src="img_0/move_updown.png" class="move" title="'.$lang['srv_move'].'" />';
- echo '</td>';
+ echo '</div>';
+
+ echo '</div>';
+
// remove
- echo '<td class="tbl_ce_bck_blue white" style="text-align:left; width:30px">';
+ echo '<div class="delete_holder">';
+
$sql3 = sisplet_query("SELECT id FROM srv_quota WHERE cnd_id='$row[cnd_id]'");
if (mysqli_num_rows($sql3) != 1 )
echo ' <a href="#" onclick="quota_remove(\''.$row['cnd_id'].'\', \''.$quota.'\', \''.$vrednost.'\'); return false;" title="'.$lang['srv_if_rem'].'"><span class="faicon delete icon-grey_dark_link delte-if-block"></span></a>'."\n\r";
- echo '</td>';
+
+ echo '</div>';
- echo '</tr>';
- echo '</table>';
+ echo '</div>';
echo '</form>'."\n\r";
}
diff --git a/admin/survey/classes/class.SurveyRecoding.php b/admin/survey/classes/class.SurveyRecoding.php
index 53f789e..1189faf 100644
--- a/admin/survey/classes/class.SurveyRecoding.php
+++ b/admin/survey/classes/class.SurveyRecoding.php
@@ -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() {
@@ -63,8 +62,8 @@ class SurveyRecoding
function DisplaySettings() {
global $lang;
echo '<fieldset><legend>'.$lang['srv_data_subnavigation_recode'].'</legend>';
- echo $lang['srv_recode_note'].'<br/><br/>';
- echo $lang['srv_recode_note_text'].'<br/><br/>';
+ echo '<p class="bottom16">'.$lang['srv_recode_note'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_recode_note_text'].'</p>';
#poiščemo spremenljivke ki so morda rekodirane v drugo spremenljivko
/*
$qry_str = "select distinct spr1, spr2 from srv_recode_vrednost WHERE ank_id = '$this->anketa'";
@@ -110,11 +109,16 @@ class SurveyRecoding
$qry_str = "SELECT s.id, s.variable, s.naslov FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$this->anketa' AND s.tip IN (1,2,3,6,16,17,7,18,20,22,25)ORDER BY g.vrstni_red ASC, s.vrstni_red ASC";
$sql = sisplet_query($qry_str);
if (mysqli_num_rows($sql)) {
+
+
+
echo '<table id="recode_table">';
- echo '<thead><tr>';
- echo '<th colspan="4">'.$lang['srv_recode_h_variable'].'</th>';
- echo '<th colspan="5">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
- echo '</tr></thead>';
+ echo '<tr>';
+ echo '<th></th>';
+ echo '<th>'.$lang['srv_recode_h_variable'].'</th>';
+ echo '<th>'.$lang['srv_recode_h_scale'].'</th>';
+ echo '<th class="center functions_column" colspan="2">'.$lang['srv_recode_h_actions'].Help::display('srv_recode_h_actions').'</th>';
+ echo '</tr>';
while (list($spr_id, $variable, $naslov) = mysqli_fetch_row($sql)) {
$vmv = new RecodeValues($this->anketa,$spr_id);
$hasRecoded = $vmv->hasRecodedValues() || in_array($spr_id,$recodedFrom);
@@ -150,20 +154,16 @@ class SurveyRecoding
$css_even_odd = ( ($cnt_even_odd & 1) ? ' odd' : ' even' );
echo '<tr id="recoding_variable_div_'.$spr_id.'" class="recoding_variable_div'.$css_even_odd.$css_border.'">';
- echo '<td style="width:auto;">';
- SurveyAnalysis::showIcons($spr_id.'_0',$row,'desc',array('noReport' => true, 'showChart' => false));
- echo '</td>';
- echo '<td style="width:25px; text-align:center;" class="gray">';
- echo $icon1;
- echo '</td>';
+
echo '<td>';
- echo '<span class="gray">'.$icon2.'</span>';
- echo '<span class="green'.$css_strong.'">';
+ SurveyAnalysis::showIcons($spr_id.'_0',$row,'desc',array('noReport' => true, 'showChart' => false), true);
+ echo '</td>';
+ echo '<td>';
echo '<a onclick="showspremenljivkaSingleVarPopup(\''.$spr_id.'_0\'); return false;" href="#">';
echo $variable;
echo '</a>';
- echo '</span> - <span class="spaceRight'.$css_strong.'">'.skrajsaj(strip_tags($naslov),40).'</span>';
+ echo ' - '.skrajsaj(strip_tags($naslov),40);
if ($key) {
$row1 = Cache::srv_spremenljivka($key);
@@ -172,60 +172,57 @@ class SurveyRecoding
echo '</td>';
- echo '<td class="gray" style="padding-right:10px; padding-left:10px;">';
+ echo '<td>';
$legend = Cache::spremenljivkaLegenda($spr_id);
- echo '('.$legend['izrazanje'].' - '.$legend['skala'].')';
+ echo $legend['skala'];
echo '</td>';
- echo '<td style="width:50px; text-align:center;" >';
+
+ echo '<td class="functions_column">';
+ echo '<div class="functions">';
+
#dodaj
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="silver">'.$lang['srv_recode_add'].'</span>';
+ echo '<div class="sep sep silver">'.$lang['srv_recode_add'].'</div>';
} else {
- echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</span>';
+ echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_add'].'</div>';
}
}
- echo '</td>';
- echo '<td style="padding-right:10px; padding-left:10px;text-align:center;">';
# uredi
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</span>';
+ echo '<div class="sep as_link" onclick="showQuestionRecode(\''.$spr_id.'\');">'.$lang['srv_recode_edit'] .'</div>';
} else {
- echo '<span class="silver">'.$lang['srv_recode_edit'] .'</span>';
+ echo '<div class="sep silver">'.$lang['srv_recode_edit'] .'</div>';
}
}
- echo '</td>';
- echo '<td style="padding-right:10px; padding-left:10px; text-align:center;">';
# odstrani
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ((int)$hasRecoded > 0) {
- echo '<span class="as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</span>';
+ echo '<div class="sep as_link" onclick="removeQuestionRecode(\''.$spr_id.'\',\''.$lang['srv_recode_confirm_delete'].'\');">'.$lang['srv_recode_remove'].'</div>';
} else {
- echo '<span class="silver" >'.$lang['srv_recode_remove'].'</span>';
+ echo '<div class="sep silver" >'.$lang['srv_recode_remove'].'</div>';
}
}
- echo '</td>';
-
- echo '<td style="padding-right:10px; padding-left:10px;">';
if ($is_recoded_new == true) {
- echo '<span class="silver">&nbsp;</span>';
+ echo '<div class="sep silver">&nbsp;</div>';
} else {
if ($hasRecoded) {
- echo '<label><span class="as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</span></label>';
+ echo '<label><div class="sep as_link" onclick="enableRecodeVariable(\''.$spr_id.'\',this);">'.($enabled ? $lang['srv_recode_enabled'] : $lang['srv_recode_disabled']).'</div></label>';
#echo '<label><input type="checkbox" id="recoding_variable_cb_'.$spr_id.'" onchange="enableRecodeVariable(\''.$spr_id.'\',this);"'.($enabled?' checked="checked"':'').' autocomplete="off">'.$lang['srv_recode_enable'].'</label>';
} else {
- echo '<span class="silver">'.$lang['srv_recode_enabled'].'</span>';
+ echo '<div class="sep silver">'.$lang['srv_recode_enabled'].'</div>';
}
}
+ echo '</div>';
echo '</td>';
$visible= ((int)$row['visible'] == 1) ? true : false;
@@ -243,7 +240,7 @@ class SurveyRecoding
session_start();
- if ($_SESSION['showRunRecodeButton'][$this->anketa] == true) {
+ if (isset($_SESSION['showRunRecodeButton'][$this->anketa]) && $_SESSION['showRunRecodeButton'][$this->anketa] == true) {
echo '<br/><div class="buttonwrapper floatLeft" id="btnRunRecode" title="'.$lang['srv_compute_start'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="runRecodeVredonosti($(\'#question_recode_run_note\'));">'.$lang['srv_compute_start'].'</a></div>';
echo '<br /><br />';
}
@@ -271,12 +268,12 @@ class SurveyRecoding
$vmv = new RecodeValues($this->anketa,$spr_id);
$vmv->DisplayMissingValuesForQuestion();
#echo '</span>';
-
- echo '<div class="recodeButtonHolder buttons_holder">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="saveQuestionRecode(); return false;">'.$lang['save'].'</a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="cancelQuestionRecode(); return false;"><span>'.$lang['srv_cancel'].'</span></a></div></span>';
- echo '<br class="clr"/>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="cancelQuestionRecode(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="saveQuestionRecode(); return false;">'.$lang['save'].'</button>';
echo '</div>';
+
} else {
echo 'Napaka!';
}
@@ -478,21 +475,21 @@ class SurveyRecoding
}
}
-
}
+
if (count($all_recoded) == 0) {
echo $lang['srv_recode_summary_nothing'];
- } else {
+ }
+ else {
#var_dump($all_recoded);#
- echo '<span id="div_recent_recoding_1" class="as_link" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggle();">+ '.$lang['srv_recode_summary'].'</span>';
- echo '<span id="div_recent_recoding_2" class="as_link displayNone" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggle();">- '.$lang['srv_recode_summary'].'</span>';
+ echo '<span id="div_recent_recoding_1" class="as_link" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggleClass(\'displayNone\');">+ '.$lang['srv_recode_summary'].'</span>';
+ echo '<span id="div_recent_recoding_2" class="as_link displayNone" onclick="$(\'#div_recent_recoding, #div_recent_recoding_1, #div_recent_recoding_2\').toggleClass(\'displayNone\');">- '.$lang['srv_recode_summary'].'</span>';
echo '<div id="div_recent_recoding" class="displayNone">';
foreach ($all_recoded AS $msg) {
echo $msg['txt']."<br/>";
}
echo '</div>';
}
-
}
function enableRecodeVariable() {
diff --git a/admin/survey/classes/class.SurveyReminderTracking.php b/admin/survey/classes/class.SurveyReminderTracking.php
index e41871b..8701b39 100644
--- a/admin/survey/classes/class.SurveyReminderTracking.php
+++ b/admin/survey/classes/class.SurveyReminderTracking.php
@@ -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);
diff --git a/admin/survey/classes/class.SurveyRespondents.php b/admin/survey/classes/class.SurveyRespondents.php
index 07dac48..7386663 100644
--- a/admin/survey/classes/class.SurveyRespondents.php
+++ b/admin/survey/classes/class.SurveyRespondents.php
@@ -46,7 +46,7 @@ class SurveyRespondents {
'odnos' => array('naslov'=>$lang['srv_system_variables_relation']));
}
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -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
diff --git a/admin/survey/classes/class.SurveySetting.php b/admin/survey/classes/class.SurveySetting.php
index 21198aa..ae2aa55 100644
--- a/admin/survey/classes/class.SurveySetting.php
+++ b/admin/survey/classes/class.SurveySetting.php
@@ -18,7 +18,7 @@ class SurveySetting
// konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -59,10 +59,14 @@ class SurveySetting
if (isset($this->getSurveyMiscSetting[$what])) {
return $this->getSurveyMiscSetting[$what];
}
-
if (is_string($what))
{
- $stringSelect = "SELECT value FROM srv_survey_misc WHERE sid='".self::$sid ."' AND what = '".$what."'";
+ if(is_array(self::$sid)){
+ $sid = implode('',self::$sid);
+ }else{
+ $sid=self::$sid;
+ }
+ $stringSelect = "SELECT value FROM srv_survey_misc WHERE sid='".$sid ."' AND what = '".$what."'";
$sqlSelect = sisplet_query($stringSelect);
if (mysqli_num_rows($sqlSelect) > 0)
{
diff --git a/admin/survey/classes/class.SurveySkupine.php b/admin/survey/classes/class.SurveySkupine.php
index b559adc..2b40b4a 100644
--- a/admin/survey/classes/class.SurveySkupine.php
+++ b/admin/survey/classes/class.SurveySkupine.php
@@ -65,39 +65,60 @@ class SurveySkupine {
echo '<fieldset><legend>'.$lang['srv_skupine'].'</legend>';
echo '<div id="skupine">';
-
- echo '<br />'.$lang['srv_skupine_insert'].' '.Help::display('srv_skupine');
-
- if($spr_id != 0){
-
- // dodajanje skupin za anketo
- $vrednosti = $this->getVrednosti($spr_id);
- foreach($vrednosti as $vrednost){
- echo '<p>';
-
- echo '<strong>'.$vrednost['naslov'].'</strong>';
-
- $link = $vrednost['url'];
- if(isset($vrednost['nice_url']))
- $link = $vrednost['nice_url'];
- echo ' (<a href="'.$link.'" target="_blank" title="URL skupine '.$vrednost['naslov'].'">'.$link.'</a>)';
-
- echo '<span class="faicon delete_circle icon-orange_link spaceLeft" style="margin-bottom:1px;" onclick="delete_skupina(\'1\', \''.$vrednost['id'].'\', \''.$vrednost['naslov'].'\');"></span>';
-
- echo '</p>';
- }
- }
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik - ce ni ni gumba za dodajanje skupin
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik - ce ni, ni gumba za dodajanje skupin
if(!$userAccess->checkUserAccess($what='skupine')){
- echo '<br />';
$userAccess->displayNoAccess($what='skupine');
}
else{
- echo '<p class="add_skupina_button"><input type="text" name="skupina" autocomplete="off" onKeyUp="add_skupina_enter(\'1\', event);" /> <input type="button" value="'.$lang['add'].'" onclick="add_skupina(\'1\');" /></p>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_skupine_insert'].' '.Help::display('srv_skupine').'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <label for="skupina">'.$lang['group_name'].':</label>';
+ echo ' <div class="button_holder inline">';
+ echo ' <input type="text" id="skupina" name="skupina" class="large" autocomplete="off" onKeyUp="add_skupina_enter(\'1\', event);" />';
+ echo ' <button class="medium blue" onclick="add_skupina(\'1\');">'.$lang['add'].'</button>';
+ echo ' </div>';
+
+ echo '</div>';
}
+
+ // izpis skupin za anketo
+ $vrednosti = $this->getVrednosti($spr_id);
+ echo '<table id="groups_table" '.(($spr_id == 0) ? 'class="displayNone"' : '').'>';
+
+ echo '<tr>';
+ echo '<th></th>';
+ echo '<th>'.$lang['group_name'].'</th>';
+ echo '<th>'.$lang['group_URL'].'</th>';
+ echo '<th>'.$lang['group_answer_count'].'</th>';
+ echo '</tr>';
+
+ if($spr_id != 0){
+ foreach($vrednosti as $vrednost){
+
+ // Dobimo stevilo odgovorov za skupino
+ $count_answers = $this->countSkupinaAnswers($vrednost['id']);
+
+ echo '<tr>';
+
+ echo ' <td><a><span class="faicon trash empty" onclick="delete_skupina(\'1\', \''.$vrednost['id'].'\');"></span></a></td>';
+ echo ' <td>'.$vrednost['naslov'].'</td>';
+
+ $link = (isset($vrednost['nice_url'])) ? $vrednost['nice_url'] : $vrednost['url'];
+
+ echo ' <td><a href="'.$link.'" target="_blank" title="URL skupine '.$vrednost['naslov'].'">'.$link.'</a><a href="#"><span class="faicon copy link-left empty" onclick="CopyToClipboard(\''. $link .'\');" return false;"></span></a></td>';
+ echo ' <td class="right">'.$count_answers.'</td>';
+
+ echo '</tr>';
+ }
+ }
+ echo '</table>';
echo '</div>';
+
echo '</fieldset>';
}
@@ -159,6 +180,23 @@ class SurveySkupine {
return 0;
}
+ // Prestejemo stevilo odgovorov za doloceno skupino
+ private function countSkupinaAnswers($vre_id){
+
+ $answer_count = 0;
+
+ $sql = sisplet_query("SELECT count(u.id) AS answer_count
+ FROM srv_user u, srv_data_vrednost_active v
+ WHERE v.vre_id='".$vre_id."' AND u.id=v.usr_id AND u.deleted='0'
+ ");
+ $row = mysqli_fetch_array($sql);
+
+ $answer_count = $row['answer_count'];
+
+ return $answer_count;
+
+ }
+
// Vrnemo url za doloceno skupino
function getUrl($spr_id, $vre_id){
global $global_user_id;
@@ -263,7 +301,8 @@ class SurveySkupine {
$add = false;
$anketa = $this->anketa;
- $nice_url = $row['link'];
+ $nice_url = $row['link'];
+ $skupina_string = strtolower($lang['srv_skupina']);
$sql2 = sisplet_query("SELECT vrstni_red FROM srv_vrednost WHERE id='$vre_id'");
$row2 = mysqli_fetch_array($sql2);
@@ -284,14 +323,14 @@ class SurveySkupine {
if (strlen($nice_url) < 3) $add = false;
if (SurveyInfo::getInstance()->checkSurveyModule('uporabnost'))
- $link = 'main/survey/uporabnost.php?anketa='.$anketa.'&skupina='.$vre_id;
+ $link = 'main/survey/uporabnost.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&'.$skupina_string.'='.$vre_id;
else
- $link = 'main/survey/index.php?anketa='.$anketa.'&skupina='.$vre_id;
+ $link = 'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&'.$skupina_string.'='.$vre_id;
if ($add) {
$f = @fopen($site_path.'.htaccess', 'a');
if ($f !== false) {
- fwrite($f, "\nRewriteRule ^".$nice_url.'\b(.*) '.$link."&foo=\$1&%{QUERY_STRING}");
+ fwrite($f, "\nRewriteRule ^".$nice_url.'\b(?!-)(.*) '.$link."&foo=\$1&%{QUERY_STRING}");
fclose($f);
$sqlI = sisplet_query("INSERT INTO srv_nice_links_skupine (id,ank_id,nice_link_id,vre_id,link) VALUES ('','$this->anketa','$row[id]','$vre_id','$nice_url')");
@@ -300,18 +339,25 @@ class SurveySkupine {
}
- // Vrnemo novo geslo, ki ga vstavimo v html
- echo '<p>';
-
- echo '<strong>'.$naslov_vrednost.'</strong>';
+ // Vstavljanje v html tabelo
+ echo '<tr>';
+
+ //Skupine
if($skupine == 1){
+ echo '<td><a><span class="faicon trash empty" onclick="delete_skupina(\''.$skupine.'\', \''.$vre_id.'\');"></span></a></td>';
+ echo '<td>'.stripslashes($naslov_vrednost).'</td>';
$link = $this->getUrl($spr_id, $vre_id);
- echo ' (<a href="'.$link.'" target="_blank" title="URL skupine '.$naslov_vrednost.'">'.$link.'</a>)';
+ echo '<td><a href="'.$link.'" target="_blank" title="URL skupine '.stripslashes($naslov_vrednost).'">'.$link.'</a><a href="#"><span class="faicon copy link-left empty" onclick="CopyToClipboard(\''. $link .'\');" return false;"></span></a></td>';
+ echo '<td class="right">0</td>';
}
- echo '<span class="faicon delete_circle icon-orange_link spaceLeft" style="margin-bottom:1px;" onclick="delete_skupina(\''.$skupine.'\', \''.$vre_id.'\', \''.$naslov_vrednost.'\');"></span>';
-
- echo '</p>';
+ //Gesla
+ if($skupine == 2){
+ echo '<td>'.stripslashes($naslov_vrednost).'</td>';
+ echo '<td class="right"><button class="table-inline blue caps" type="button" onclick="delete_skupina(\''.$skupine.'\', \''.$vre_id.'\');">'.$lang['srv_password_remove'].'</button></td>';
+ }
+
+ echo '</tr>';
}
}
@@ -319,9 +365,8 @@ class SurveySkupine {
$skupine = (isset($_POST['skupine'])) ? $_POST['skupine'] : 1;
$vre_id = (isset($_POST['vre_id'])) ? $_POST['vre_id'] : 0;
- $naslov = (isset($_POST['text'])) ? $_POST['text'] : '';
- $sql2 = sisplet_query("SELECT vrstni_red FROM srv_vrednost WHERE id='$vre_id'");
+ $sql2 = sisplet_query("SELECT vrstni_red, naslov FROM srv_vrednost WHERE id='$vre_id'");
$row2 = mysqli_fetch_array($sql2);
$index = $row2['vrstni_red'];
@@ -337,7 +382,7 @@ class SurveySkupine {
// Ce gre za password ga zbrisemo
if($skupine == 2){
- $password = $_POST['text'];
+ $password = $row2['naslov'];
if ($password != '') {
$s = sisplet_query("DELETE FROM srv_password WHERE ank_id='$this->anketa' AND password = '$password'");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
@@ -354,13 +399,14 @@ class SurveySkupine {
$anketa = $this->anketa;
$nice_url = $row['link'].'_'.$index;
+ $skupina_string = strtolower($lang['srv_skupina']);
$f = fopen($site_path.'.htaccess', 'rb');
if ($f !== false) {
$output = array();
while (!feof($f)) {
$r = fgets($f);
- if (strpos($r, "^".$nice_url.'\b(.*) ') !== false && strpos($r, "?anketa=".$anketa."&skupina=".$vre_id."") !== false) {
+ if (strpos($r, "^".$nice_url.'\b') !== false && strpos($r, "?anketa=".$anketa."&".$skupina_string."=".$vre_id."") !== false) {
// kao pobrisemo vrstico in vnos v bazi
$sqlD = sisplet_query("DELETE FROM srv_nice_links_skupine WHERE ank_id='$anketa' AND nice_link_id='$row[id]' AND vre_id='$vre_id'");
}
@@ -389,19 +435,18 @@ class SurveySkupine {
if ($_GET['a'] == 'show_add_password_mass') {
// Naslov
- echo '<h2>' . $lang['srv_password_add_mass'] . '</h2>';
+ echo '<h2><span class="faicon blue flipX file-import"></span>' . $lang['srv_password_add_mass'] . '</h2>';
echo '<div class="popup_close"><a href="#" onClick="popupImportAnketaFromText_close();">✕</a></div>';
- echo '<p class="bold">' . $lang['srv_password_add_mass_instructions'] . '</p>';
- //echo '<span class="italic">' . $lang['srv_password_add_mass_sample'] . '</span></p>';
-
- echo '<textarea id="add_passwords_mass" name="add_passwords_mass" style="width:99%; height:300px; box-sizing:border-box; padding:5px;"></textarea>';
+ echo '<p>' . $lang['srv_password_add_mass_instructions'] . '</p>';
- echo '<br /><br />';
+ echo '<textarea id="add_passwords_mass" name="add_passwords_mass" style="width:100%; height:300px; box-sizing:border-box; padding:5px;"></textarea>';
- echo '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onClick="execute_add_passwords_mass();">'.$lang['srv_password_add_mass_execute'].'</a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onClick="popupImportAnketaFromText_close();">'.$lang['srv_zapri'].'</a></span>';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="popupImportAnketaFromText_close();">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium blue" onClick="execute_add_passwords_mass();">'.$lang['srv_password_add_mass_execute'].'</button>';
+ echo '</div>';
}
// Masovno dodajanje gesel
diff --git a/admin/survey/classes/class.SurveyStaticHtml.php b/admin/survey/classes/class.SurveyStaticHtml.php
index 744d81f..5c9884e 100644
--- a/admin/survey/classes/class.SurveyStaticHtml.php
+++ b/admin/survey/classes/class.SurveyStaticHtml.php
@@ -27,271 +27,217 @@ class SurveyStaticHtml
$this->table_id = SurveyUserSetting:: getInstance()->getSettings('default_mc_table');
- if (isset($this->table_id) && $this->table_id != '')
+ /*if (isset($this->table_id) && $this->table_id != '')
$sql = sisplet_query("SELECT name FROM srv_mc_table WHERE id='$this->table_id' AND ank_id='$this->sid' AND usr_id='$global_user_id'");
else
$sql = sisplet_query("SELECT name FROM srv_mc_table WHERE ank_id='$this->sid' AND usr_id='$global_user_id' ORDER BY time_created ASC");
- $row = mysqli_fetch_array($sql);
+ $row = mysqli_fetch_array($sql);*/
+
echo '<div class="mc_settings_links">';
- echo '<ul>';
- // Izbiro tabele (popup) in dodajanje
- echo '<li>';
- echo '<span onClick="show_mc_tables();">' . $lang['srv_table'] . ': <span class="bold">' . $row['name'] . '</span></span>';
- echo '<span id="mc_tables_plus" class="pointer spaceLeft faicon add icon-blue" title="' . $lang['srv_multicrosstabs_tables_add'] . '"></span></span>';
- echo '</li>';
- echo '<li class="space">&nbsp;</li>';
+ // Seznam tabel
+ echo '<div class="table_list">';
+
+ $sql = sisplet_query("SELECT id, name FROM srv_mc_table WHERE ank_id='$this->sid' AND usr_id='$global_user_id' ORDER BY time_created ASC");
+ while($row = mysqli_fetch_array($sql)){
+ echo '<div class="table_item '.($row['id'] == $this->table_id ? 'active' : '').'">';
+ echo ' <span onClick="switch_mc_table(\''.$row['id'].'\');">'.$row['name'].'</span>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ // Nastavtve, dodajanje tabele
+ echo '<div class="table_settings">';
+
+ // Urejanje
+ echo ' <span class="faicon edit" onClick="show_mc_tables();"></span>';
+
+ // Dodajanje
+ echo ' <span id="mc_tables_plus" class="faicon add" title="'.$lang['srv_multicrosstabs_tables_add'].'"></span>';
// Nastavitve tabele (popup)
- echo '<li>';
- echo '<span class="gray" onClick="showMCSettings();">' . $lang['srv_multicrosstabs_settings'] . '</span>';
- echo '</li>';
+ echo ' <span class="faicon wheel_32" onClick="showMCSettings();" title="'.$lang['srv_multicrosstabs_settings'].'"></span>';
+
+ echo '</div>';
+
- echo '</ul>';
echo '</div>';
}
- function displayAnalizaPreview()
- {
+ function displayAnalizaPreview(){
global $lang;
- echo '<div id="srv_analiza_preview_div" class="displayNone;">';
- echo '<div class="top-left"></div>';
- echo '<div class="top-right"></div>';
- echo '<div class="inside">';
-
- echo '<div id="srv_analiza_preview_sub_1" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_1'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledSumarnik.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_1
-
- echo '<div id="srv_analiza_preview_sub_2" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_2'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledOpisne.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_2
-
- echo '<div id="srv_analiza_preview_sub_3" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_3'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledFrekvence.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_3
-
- echo '<div id="srv_analiza_preview_sub_4" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_4'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledTabele.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_4
-
- echo '<div id="srv_analiza_preview_sub_5" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_5'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledPovprecja.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_5
-
-
- echo '<div id="srv_analiza_preview_sub_6" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_6'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledTTest.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_6
-
- echo '<div id="srv_analiza_preview_sub_7" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_7'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledRazbitje.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_7
-
- echo '<div id="srv_analiza_preview_sub_8" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_8'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledMultitabele.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_8
-
- echo '<div id="srv_analiza_preview_sub_9" class="srv_analiza_preview_sub hidden">';
- echo '<span class="red">' . $lang['srv_analize_preview_sample_choose'] . '</span><br/>';
- echo '<div id="srv_preview_analiza">';
- echo '<span class="large">' . $lang['srv_analize_preview_sample'] . '</span>';
- echo '<span class="large">' . $lang['srv_analize_preview_9'] . '</span>';
- echo $lang['srv_analysys_perview_sample'];
- include 'staticHtml/AnalizaPredogledNeodgovori.html';
- echo '</div>'; //srv_preview_analiza
- echo '</div>'; //srv_analiza_preview_sub_9
-
- echo '</div>'; // inside
- echo '<div class="bottom-left"></div>';
- echo '<div class="bottom-right"></div>';
- echo '</div>'; // srv_analiza_preview_div
+
+ $preview_files = array(
+ 1 => 'sumarnik.svg',
+ 2 => 'opisne.svg',
+ 3 => 'frekvence.svg',
+ 4 => 'tabela.svg',
+ 5 => 'povprecja.svg',
+ 6 => 'ttest.svg',
+ 7 => 'razbitje.svg',
+ 8 => 'multitabela.svg'
+ );
+
+
+ echo '<div id="srv_analiza_preview_div">';
+
+ for($i=1; $i<9; $i++){
+
+ echo '<div id="srv_analiza_preview_sub_'.$i.'" class="srv_analiza_preview_sub displayNone">';
+
+ echo '<div class="title">';
+ echo ' <span class="faicon table_icon"></span>'.$lang['srv_analize_preview_'.$i];
+ echo '</div>';
+
+ echo '<div class="content">';
+ if($i != 7)
+ echo ' <img src="../../../public/img/analysis_previews/'.$preview_files[$i].'">';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
}
- public function displayArchiveNavigation($showDiv = true)
+ public function displayArchiveNavigation()
{
global $lang, $admin_type, $global_user_id;
+
+ $userAccess = UserAccess::getInstance($global_user_id);
$d = new Dostop();
- $sa = new SurveyAdmin();
- $this->survey_type = $sa->getSurvey_type($this->sid);
+ //$sa = new SurveyAdmin();
+ SurveyInfo::getInstance()->SurveyInit($this->sid);
+ $this->survey_type = SurveyInfo::getInstance()->getSurveyColumn("survey_type");
- echo '<div id="globalSetingsLinks" class="archive">';
- echo '<ul class="">';
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+ $appendMerge = isset($_GET['appendMerge']) ? $_GET['appendMerge'] : '';
+
+ if(!$userAccess->checkUserAccess('arhivi')){
+ echo '<div class="archive user_access_locked locked">';
+ }
+ //echo '<span class="menu_left-title title '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').'">'.$lang['srv_arhivi'].'</span>'; //POGLEJ
+ echo '<span class="menu_left-title '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked locked' : '').'">'.$lang['srv_arhivi'].'</span>'; //POGLEJ
+
+ //echo '<ul class="menu_left-list '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').' locked">';
+ echo '<ul class="menu_left-list '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked locked' : '').' ">';
# arhivi vprasalnika
if ($d->checkDostopSub('edit')) {
- echo '<li' . ($_GET['a'] == A_ARHIVI && $_GET['m'] != 'data' && $_GET['m'] != 'changes' && $_GET['m'] != 'survey' && $_GET['m'] != 'survey_data' && $_GET['m'] != 'testdata' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . $_js_links[1] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '" title="' . $lang['srv_questionnaire_archives'] . '"><span>' . $lang['srv_questionnaire_archives'] . '</span></a>';
+ echo '<li' . ($a == A_ARHIVI && $m != 'data' && $m != 'changes' && $m != 'survey' && $m != 'survey_data' && $m != 'testdata' ? ' class="active"' : '') . '>';
+ //echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '" title="' . $lang['srv_questionnaire_archives'] . '"><span>' . $lang['srv_questionnaire_archives'] . '</span></a>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '" title="' . $lang['srv_questionnaire_archives'] . '">' . $lang['srv_questionnaire_archives'] . '</a>';
echo '</li>';
}
# arhivi podatkov
if ($d->checkDostopSub('edit') && $this->survey_type > 0) {
- echo '<li' . ($_GET['a'] == A_ARHIVI && $_GET['m'] == 'data' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . $_js_links[1] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=data" title="' . $lang['srv_arhiv_data'] . '"><span>' . $lang['srv_arhiv_data'] . '</span></a>';
+ echo '<li' . ($a == A_ARHIVI && $m == 'data' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=data" title="' . $lang['srv_data_archives'] . '">' . $lang['srv_data_archives'] . '</a>';
echo '</li>';
}
# arhivi objave
if ($d->checkDostopSub('publish')) {
- echo '<li' . ($_GET['a'] == A_INVITATIONS && $_GET['m'] == 'view_archive' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . $_js_links[2] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_INVITATIONS . '&m=view_archive' . '" title="' . $lang['srv_archive_invitation'] . '"><span>' . $lang['srv_archive_invitation'] . '</span></a>';
+ echo '<li' . ($a == A_INVITATIONS && $m == 'view_archive' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_INVITATIONS . '&m=view_archive' . '" title="' . $lang['srv_archive_invitation_menu'] . '">' . $lang['srv_archive_invitation_menu'] . '</a>';
echo '</li>';
}
# arhivi analiz
if ($d->checkDostopSub('analyse')) {
- echo '<li' . ($_GET['a'] == A_ANALYSIS && $_GET['m'] == M_ANALYSIS_ARCHIVE ? ' class="highlightLineTab"' : ' class="nonhighlight"') . $_js_links[3] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_ARCHIVE . '" title="' . $lang['srv_archive_analysis'] . '"><span>' . $lang['srv_archive_analysis'] . '</span></a>';
+ echo '<li' . ($a == A_ANALYSIS && $m == M_ANALYSIS_ARCHIVE ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_ARCHIVE . '" title="' . $lang['srv_archive_analysis_menu'] . '">' . $lang['srv_archive_analysis_menu'] . '</a>';
echo '</li>';
}
- # uvoz/izvoz ankete ali ankete s podatki
- if ($d->checkDostopSub('edit')) {
- echo '<li' . ($_GET['a'] == A_ARHIVI && ($_GET['m'] == 'survey' || $_GET['m'] == 'survey_data') ? ' class="navi_tracking highlightLineTab"' : ' class="navi_tracking nonhighlight"') . $_js_links[1] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=survey" title="' . $lang['srv_survey_archives'] . '"><span>' . $lang['srv_survey_archives'] . '</span></a>';
+ # arhivi testnih vnosov
+ if ($this->survey_type > 1) {
+ echo '<li' . ($a == A_ARHIVI && $m == 'testdata' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=testdata" title="' . $lang['srv_arhiv_testdata_menu'] . '">' . $lang['srv_arhiv_testdata_menu'] . '</a>';
echo '</li>';
+ }
- if ($_GET['a'] == A_ARHIVI && ($_GET['m'] == 'survey' || $_GET['m'] == 'survey_data')) {
- echo '<ul id="sub_navi_tracking">';
+ echo '</ul>';
+ if(!$userAccess->checkUserAccess('arhivi')){
+ echo '</div>';
+ }
- // Uvoz/izvoz ankete
- echo '<li ' . ($_GET['a'] == A_ARHIVI && $_GET['m'] == 'survey' && $_GET['appendMerge'] != '1' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=survey" title="' . $lang['srv_survey_archives_ie'] . '"><span>' . $lang['srv_survey_archives_ie'] . '</span></a>';
- echo '</li>';
+ # uvoz/izvoz ankete ali ankete s podatki
+ if ($d->checkDostopSub('edit')) {
+ echo '<span class="menu_left-title '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').'">'.$lang['srv_survey_archives_title'].'</span>';
- // Uvoz/izvoz ankete in podatkov
- echo '<li ' . ($_GET['a'] == A_ARHIVI && $_GET['m'] == 'survey_data' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=survey_data" title="' . $lang['srv_survey_archives_ie_data'] . '"><span>' . $lang['srv_survey_archives_ie_data'] . '</span></a>';
- echo '</li>';
+ echo '<ul class="menu_left-list" id="sub_navi_tracking">';
- echo '</ul>';
- }
- }
+ // Uvoz/izvoz ankete
+ echo '<li ' . ($a == A_ARHIVI && $m == 'survey' && $appendMerge != '1' ? ' class="active"' : ' ') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=survey" title="' . $lang['srv_survey_archives_ie'] . '">' . $lang['srv_survey_archives_ie'] . '</a>';
+ echo '</li>';
- # arhivi testnih vnosov
- if ($this->survey_type > 1) {
- $str_testdata = "SELECT count(*) FROM srv_user WHERE ank_id='" . $this->sid . "' AND (testdata='1' OR testdata='2') AND deleted='0'";
- $query_testdata = sisplet_query($str_testdata);
- list($testdata) = mysqli_fetch_row($query_testdata);
- if ((int)$testdata > 0) {
- echo '<li' . ($_GET['a'] == A_ARHIVI && $_GET['m'] == 'testdata' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=testdata" title="' . $lang['srv_arhiv_testdata'] . '"><span>' . $lang['srv_arhiv_testdata'] . '</span></a>';
- echo '</li>';
- }
+ // Uvoz/izvoz ankete in podatkov
+ echo '<li ' . ($a == A_ARHIVI && $m == 'survey_data' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ARHIVI . '&m=survey_data" title="' . $lang['srv_survey_archives_ie_data'] . '">' . $lang['srv_survey_archives_ie_data'] . '</a>';
+ echo '</li>';
+
+ echo '</ul>';
}
# arhivi sprememb
if ($d->checkDostopSub('edit')) {
- echo '<li' . ($_GET['a'] == A_TRACKING || $_GET['a'] == A_TRACKING_HIERARHIJA ? ' class="navi_tracking highlightLineTab"' : ' class="navi_tracking nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '" title="' . $lang['srv_survey_archives_tracking'] . '"><span>' . $lang['srv_survey_archives_tracking'] . '</span></a>';
- echo '</li>';
+ echo '<span class="menu_left-title '.(!$userAccess->checkUserAccess('arhivi') ? 'user_access_locked' : '').'">'.$lang['srv_survey_archives_tracking'].'</span>';
- if ($_GET['a'] == A_TRACKING || $_GET['a'] == A_TRACKING_HIERARHIJA) {
- echo '<ul id="sub_navi_tracking">';
-
- // Vse spremembe ankete
- echo '<li ' . ($_GET['a'] == A_TRACKING && $_GET['m'] != 'tracking_data' && $_GET['appendMerge'] != '1' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '" title="' . $lang['srv_survey_archives_tracking_survey'] . '"><span>' . $lang['srv_survey_archives_tracking_survey'] . '</span></a>';
- echo '</li>';
+ echo '<ul class="menu_left-list" id="sub_navi_tracking">';
- $hierarhija = false;
- if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- $uporabnik = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE anketa_id='".$this->sid."' AND user_id='".$global_user_id."'", "obj");
- if (!empty($uporabnik) && $uporabnik->type == 1)
- $hierarhija = true;
- }
-
- if ($hierarhija) {
+ // Vse spremembe ankete
+ echo '<li ' . ($a == A_TRACKING && $m != 'tracking_data' && $appendMerge != '1' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '" title="' . $lang['srv_survey_archives_tracking_survey_menu'] . '">' . $lang['srv_survey_archives_tracking_survey_menu'] . '</a>';
+ echo '</li>';
- // Vsi podatki o gradnji hierarhije, šifrantov in ostalega
- echo '<li ' . ($_GET['a'] == A_TRACKING_HIERARHIJA && $_GET['m'] == 'hierarhija' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING_HIERARHIJA. '&m=hierarhija" title="' . $lang['srv_survey_archives_tracking_hierarchy_structure'] . '"><span>' . $lang['srv_survey_archives_tracking_hierarchy_structure'] . '</span></a>';
- echo '</li>';
+ $hierarhija = false;
+ if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
+ $uporabnik = sisplet_query("SELECT type FROM srv_hierarhija_users WHERE anketa_id='".$this->sid."' AND user_id='".$global_user_id."'", "obj");
+ if (!empty($uporabnik) && $uporabnik->type == 1)
+ $hierarhija = true;
+ }
- // Vse spremembe pri dodajanju udeležencev
- echo '<li ' . ($_GET['a'] == A_TRACKING_HIERARHIJA && $_GET['m'] == 'udelezenci' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING_HIERARHIJA . '&m=udelezenci" title="' . $lang['srv_survey_archives_tracking_hierarchy_users'] . '"><span>' . $lang['srv_survey_archives_tracking_hierarchy_users'] . '</span></a>';
- echo '</li>';
- }
+ if ($hierarhija) {
- // Spremembe na podatkih
- echo '<li ' . ($_GET['a'] == A_TRACKING && $_GET['m'] == 'tracking_data' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '&m=tracking_data" title="' . $lang['srv_survey_archives_tracking_data'] . '"><span>' . $lang['srv_survey_archives_tracking_data'] . '</span></a>';
+ // Vsi podatki o gradnji hierarhije, šifrantov in ostalega
+ echo '<li ' . ($a == A_TRACKING_HIERARHIJA && $m == 'hierarhija' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING_HIERARHIJA. '&m=hierarhija" title="' . $lang['srv_survey_archives_tracking_hierarchy_structure'] . '">' . $lang['srv_survey_archives_tracking_hierarchy_structure'] . '</a>';
echo '</li>';
- // Append/Merge (uvozi)
- echo '<li ' . ($_GET['a'] == A_TRACKING && $_GET['appendMerge'] == '1' ? ' class="highlightLineTab"' : ' class="nonhighlight"') . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '&appendMerge=1" title="' . $lang['srv_survey_archives_tracking_append'] . '"><span>' . $lang['srv_survey_archives_tracking_append'] . '</span></a>';
+ // Vse spremembe pri dodajanju udeležencev
+ echo '<li ' . ($a == A_TRACKING_HIERARHIJA && $m == 'udelezenci' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING_HIERARHIJA . '&m=udelezenci" title="' . $lang['srv_survey_archives_tracking_hierarchy_users'] . '">' . $lang['srv_survey_archives_tracking_hierarchy_users'] . '</a>';
echo '</li>';
-
- echo '</ul>';
}
- }
-
+ // Spremembe na podatkih
+ echo '<li ' . ($a == A_TRACKING && $m == 'tracking_data' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '&m=tracking_data" title="' . $lang['srv_survey_archives_tracking_data_menu'] . '">' . $lang['srv_survey_archives_tracking_data_menu'] . '</a>';
+ echo '</li>';
+ // Append/Merge (uvozi)
+ echo '<li ' . ($a == A_TRACKING && $appendMerge == '1' ? ' class="active"' : '') . '>';
+ echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_TRACKING . '&appendMerge=1" title="' . $lang['srv_survey_archives_tracking_append'] . '">' . $lang['srv_survey_archives_tracking_append'] . '</a>';
+ echo '</li>';
+ }
echo '</ul>';
- echo '</div>';
+
}
public function displayTestDataBar($showAnalizeCheckbox = false)
{
global $lang;
-
$str_testdata = "SELECT count(*) FROM srv_user WHERE ank_id='" . $this->sid . "' AND (testdata='1' OR testdata='2') AND deleted='0'";
$query_testdata = sisplet_query($str_testdata);
list($testdata) = mysqli_fetch_row($query_testdata);
@@ -300,18 +246,18 @@ class SurveyStaticHtml
$query_autogen_testdata = sisplet_query($str_autogen_testdata);
list($autogen_testdata) = mysqli_fetch_row($query_autogen_testdata);
- echo '<div class="display_data_test_data_note"><span class="faicon warning icon-orange spaceRight"></span> ';
+ echo '<div class="top_note display_data_test_data_note">';
+
+ echo '<div class="title">';
+ echo ' <span class="faicon warning"></span> '.$lang['srv_testni_podatki_alert_title'];
+ echo '</div>';
- echo $lang['srv_testni_podatki_alert'] . ' <a href="#" onClick="delete_test_data();">' . $lang['srv_delete_testdata'] . '</a>';
- echo ' (' . $testdata . '). ';
+ echo $lang['srv_testni_podatki_alert'] . ' <a href="#" onClick="delete_test_data();">'.$lang['srv_delete_testdata'].' ('.$testdata.')</a>.';
if ($autogen_testdata > 0) {
- echo $lang['srv_autogen_testni_podatki_alert'] . ' <a href="index.php?anketa=' . $this->sid . '&a=testiranje&m=testnipodatki&delete_autogen_testdata=1">' . $lang['srv_delete_autogen_testdata'] . '</a>';
- echo ' (' . $autogen_testdata . '). ';
+ echo ' '.$lang['srv_autogen_testni_podatki_alert'].' <a href="index.php?anketa=' . $this->sid . '&a=testiranje&m=testnipodatki&delete_autogen_testdata=1">'.$lang['srv_delete_autogen_testdata'].' ('.$autogen_testdata.')</a>.';
}
if ($showAnalizeCheckbox == true && false) {
- # print_r("<pre>");
- # print_r($_SESSION);
session_start();
$checked = (isset($_SESSION['testData'][$this->sid]['includeTestData']) && $_SESSION['testData'][$this->sid]['includeTestData'] == 'false') ? '' : ' checked="checked"';
echo '&nbsp;<label><input id="cnx_include_test_data" type="checkbox"' . $checked . ' onchange="surveyAnalisysIncludeTestData();" autocomplete="off">V analizah upoštevaj tudi testne vnose.';
@@ -342,14 +288,19 @@ class SurveyStaticHtml
if( in_array($data_file_status, array(FILE_STATUS_SRV_DELETED, FILE_STATUS_NO_DATA))
&& in_array($podstran, array(
- 'para_analysis_graph', 'para_graph', 'usable_resp',
- 'data', 'quick_edit', 'variables', 'export',
+ 'status', 'para_analysis_graph', 'para_graph', 'usable_resp', 'status_advanced',
+ 'data', 'quick_edit', 'variables', 'export',
'sumarnik', 'descriptor', 'frequency', 'crosstabs', 'ttest', 'means', 'break', 'multicrosstabs', 'charts', 'analysis_links'
)) ){
return;
}
+ //V komentarjih ni tega menija
+ if($podstran == "komentarji" || $podstran == "komentarji_anketa") {
+ return;
+ }
+
// Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
$userAccess = UserAccess::getInstance($global_user_id);
@@ -363,6 +314,9 @@ class SurveyStaticHtml
$borderLeft = '';
+
+ echo '<div class="left_options_holder">';
+
// Navigacija analiz - ANALIZE
if ($analiza) {
echo '<div id="analizaSubNav">';
@@ -372,70 +326,47 @@ class SurveyStaticHtml
$borderLeft = ' class="borderLeft"';
}
-
// Preklop med porocilom po meri in navadnimi porocili
if ($podstran == 'analysis_creport' || $podstran == 'analysis_links') {
echo '<div id="additional_navigation">';
// Link na navadna porocila
- echo '<a href="index.php?anketa=' . $this->sid . '&a=analysis&m=analysis_links"><span ' . ($podstran == 'analysis_links' ? ' class="active"' : '') . '>' . $lang['srv_standard_report'] . '</span></a>';
+ echo '<span '.($podstran == 'analysis_links' ? ' class="active"' : '').'><a href="index.php?anketa=' . $this->sid . '&a=analysis&m=analysis_links">'.$lang['srv_standard_report'] . '</a></span>';
// Link na porocilo po meri
- echo '<a href="index.php?anketa=' . $this->sid . '&a=analysis&m=analysis_creport"><span ' . ($podstran == 'analysis_creport' ? ' class="active"' : '') . '>' . $lang['srv_custom_report'] . '</span></a>';
+ echo '<span '.($podstran == 'analysis_creport' ? ' class="active"' : '').'><a href="index.php?anketa=' . $this->sid . '&a=analysis&m=analysis_creport">'.$lang['srv_custom_report'].'</a></span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
}
// Preklop na vpogled, hitri seznam, spremenljivke (podatki)
- elseif ($podstran == 'data') {
+ elseif ($podstran == 'data' || $podstran == 'quick_edit' || $podstran == 'variables') {
echo '<div id="additional_navigation">';
+ // Link na osnovno tabelo s podatki
+ echo '<span '.($podstran == 'data' ? ' class="active"' : '').'><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '">'.$lang['srv_lnk_data'].'</a></span>';
+
// Link na vpogled
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '&m=quick_edit&quick_view=1"><span>' . $lang['srv_lnk_vpogled'] . '</span></a>';
+ echo '<span '.($podstran == 'quick_edit' ? ' class="active"' : '').'><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '&m=quick_edit&quick_view=1">'.$lang['srv_lnk_vpogled'].'</a></span>';
// Link na spremenljivke
- echo '<a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_VARIABLE_VIEW . '"><span>' . $lang['srv_lnk_pregled_variabel'] . '</span></a>';
+ echo '<span '.($podstran == 'variables' ? ' class="active"' : '').'><a href="' . $site_url . 'admin/survey/index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '&m=' . M_COLLECT_DATA_VARIABLE_VIEW . '">'.$lang['srv_lnk_pregled_variabel'].'</a></span>';
// Link na hitri seznam
- echo '<a href="#" onClick="displayDataPrintPreview();"><span style="padding-right:0px !important;">' . $lang['srv_data_print_preview_link'] . '</span></a>';
- echo '<span style="margin-right:40px;">' . Help:: display('srv_data_print_preview') . '</span>';
+ echo '<span><a href="#" onClick="displayDataPrintPreview();">'.$lang['srv_data_print_preview_link'].'</a> '.Help:: display('srv_data_print_preview').'</span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
- }
- // Link nazaj na podatke - vpogled
- elseif ($podstran == 'quick_edit') {
- echo '<div id="additional_navigation">';
-
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '"><span class="faicon arrow_back" title="' . $lang['srv_lnk_back_to_data'] . '"></span></a>';
- echo '<a href="#"><span class="active">' . $lang['srv_data_title_quick_view'] . '</span></a>';
-
- echo '</div>';
-
- $borderLeft = ' class="borderLeft"';
- }
- // Link nazaj na podatke - Spremenljivke
- elseif ($podstran == 'variables') {
- echo '<div id="additional_navigation">';
-
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_COLLECT_DATA . '"><span class="faicon arrow_back" title="' . $lang['srv_lnk_back_to_data'] . '"></span></a>';
- echo '<a href="#"><span class="active">' . $lang['srv_data_title_variable_view'] . '</span></a>';
-
- echo '</div>';
-
- $borderLeft = ' class="borderLeft"';
- }
+ }
// Link nazaj na diagnostiko - Ocenjevanje trajanja
elseif ($podstran == 'ocena_trajanja') {
echo '<div id="additional_navigation">';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_diagnostika_base'] . '"><span class="active">' . $lang['srv_testiranje_predvidenicas'] . '</span></a>';
- echo '<a href="#"></a>';
+ echo '<span class="active"><a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_diagnostika_base'] . '">'.$lang['srv_testiranje_predvidenicas'].'</a></span>';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_CAS . '" title="' . $lang['srv_testiranje_diagnostika_base'] . '"><span>' . $lang['srv_testiranje_cas'] . '</span></a>';
- echo '<a href="#"></a>';
+ echo '<span><a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_CAS . '" title="' . $lang['srv_testiranje_diagnostika_base'] . '">'.$lang['srv_testiranje_cas'].'</a></span>';
echo '</div>';
@@ -445,111 +376,68 @@ class SurveyStaticHtml
elseif ($podstran == 'dejanski_casi') {
echo '<div id="additional_navigation">';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_predvidenicas'] . '"><span>' . $lang['srv_testiranje_predvidenicas'] . '</span></a>';
- echo '<a href="#"></a>';
+ echo '<span><a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_PREDVIDENI . '" title="' . $lang['srv_testiranje_predvidenicas'] . '">'.$lang['srv_testiranje_predvidenicas'].'</a></span>';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_CAS . '" title="' . $lang['srv_testiranje_cas'] . '"><span class="active">' . $lang['srv_testiranje_cas'] . '</span></a>';
- echo '<a href="#"></a>';
+ echo '<span class="active"><a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_TESTIRANJE . '&amp;m=' . M_TESTIRANJE_CAS . '" title="' . $lang['srv_testiranje_cas'] . '">'.$lang['srv_testiranje_cas'].'</a></span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
}
- // Link nazaj na komentarje
- elseif ($podstran == 'komentarji' || $podstran == 'komentarji_anketa') {
-
- // Prestejemo komentarje (nereseni/vsi)
- $sas = new SurveyAdminSettings();
- $comment_count = $sas->testiranje_komentarji_count();
-
- echo '<div id="additional_navigation">';
-
- //Komentarji na vprasanja
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI_ANKETA . '" title="' . $lang['srv_testiranje_komentarji_anketa_title'] . '">';
- echo '<span ' . ($_GET['a'] == A_KOMENTARJI_ANKETA ? 'class="active"' : '') . '>';
- echo $lang['srv_testiranje_komentarji_anketa_title'];
- echo '</span>';
- echo '</a>';
-
- echo '<span class="bold" style="margin-right: 50px;"> (';
- if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
- echo '<span class="orange">';
- echo($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved']);
- if ($comment_count['survey_resp']['unresolved'] + $comment_count['survey_admin']['unresolved'] > 0)
- echo '</span>';
- echo '/' . ($comment_count['survey_resp']['all'] + $comment_count['survey_admin']['all']);
- echo ')</span>';
-
- // Komentarji na anketo
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=' . A_KOMENTARJI . '" title="' . $lang['srv_testiranje_komentarji_title'] . '">';
- echo '<span ' . ($_GET['a'] == A_KOMENTARJI ? ' class="active"' : '') . '>';
- echo $lang['srv_testiranje_komentarji_title'];
- echo '</span>';
- echo '</a>';
-
- echo '<span class="bold"> (';
- if ($comment_count['question']['unresolved'] > 0)
- echo '<span class="orange">';
- echo $comment_count['question']['unresolved'];
- if ($comment_count['question']['unresolved'] > 0)
- echo '</span>';
- echo '/' . $comment_count['question']['all'];
- echo ')</span>';
-
- echo '</div>';
-
- $borderLeft = ' class="borderLeft"';
- } elseif ($podstran == 'theme-editor') {
+ elseif ($podstran == 'theme-editor') {
echo '<div id="additional_navigation">';
$mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? '&mobile=1' : '';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=tema'.$mobile.'" title="' . $lang['srv_themes_select'] . '"><span class="faicon arrow_back"></span></a>';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_mod'] . '"><span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] != 'css' && $_GET['t'] != 'upload' ? ' class="active"' : '') . '>' . $lang['srv_themes_mod'] . '</span></a>';
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&t=css&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_edit'] . '"><span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] == 'css' ? ' class="active"' : '') . '>' . $lang['srv_themes_edit'] . '</span></a>';
+ echo '<span><a href="index.php?anketa=' . $this->sid . '&amp;a=tema'.$mobile.'" title="' . $lang['srv_themes_select'] . '"><span class="faicon arrow_back"></span></a></span>';
+ echo '<span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] != 'css' && $_GET['t'] != 'upload' ? ' class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_mod'] . '">' . $lang['srv_themes_mod'] . '</a></span>';
+ echo '<span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] == 'css' ? ' class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&t=css&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_edit'] . '">' . $lang['srv_themes_edit'] . '</a></span>';
// Za mobilno temo zaenkrat nimamo uploada css-ja
if($mobile == '')
- echo '<a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&t=upload&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_upload_css'] . '"><span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] == 'upload' ? ' class="active"' : '') . '>' . $lang['srv_themes_upload_css'] . '</span></a>';
+ echo '<span ' . ($_GET['a'] == 'theme-editor' && $_GET['t'] == 'upload' ? ' class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&amp;a=theme-editor&t=upload&profile='. $_GET['profile'] . $mobile.'" title="' . $lang['srv_themes_upload_css'] . '">' . $lang['srv_themes_upload_css'] . '</a></span>';
echo '</div>';
$borderLeft = ' class="borderLeft"';
- } // Link nazaj na podatke - Spremenljivke
+ }
+ // Link nazaj na podatke - Spremenljivke
elseif ($podstran == 'para_analysis_graph') {
// Info o neodgovorih
echo '<div id="nonresponse_info">';
echo $lang['srv_para_graph_text2'];
echo '</div>';
- $borderLeft = ' class="borderLeft"';
- echo '<div id="additional_navigation" ' . $borderLeft . ' style="padding-left: 40px;">';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '"><span ' . (!isset($_GET['m']) || $_GET['m'] == '' ? 'class="active"' : '') . '>' . $lang['srv_para_label_variables'] . '</span></a>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '&m=breaks"><span ' . ($_GET['m'] === 'breaks' ? 'class="active"' : '') . '>' . $lang['srv_para_label_breaks'] . '</span></a>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '&m=advanced"><span ' . ($_GET['m'] === 'advanced' ? 'class="active"' : '') . '>' . $lang['srv_para_label_details'] . '</span></a>';
+ echo '<div id="additional_navigation" class="nonresponse">';
+ echo '<span ' . (!isset($_GET['m']) || $_GET['m'] == '' ? 'class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '">' . $lang['srv_para_label_variables'] . '</a></span>';
+ echo '<span ' . ($_GET['m'] === 'breaks' ? 'class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '&m=breaks">' . $lang['srv_para_label_breaks'] . '</a></span>';
+ echo '<span ' . ($_GET['m'] === 'advanced' ? 'class="active"' : '') . '><a href="index.php?anketa=' . $this->sid . '&a=' . A_NONRESPONSE_GRAPH . '&m=advanced">' . $lang['srv_para_label_details'] . '</a></span>';
echo '</div>';
+
$borderLeft = ' class="borderLeft"';
}
elseif ($podstran == 'aapor') {
echo '<div id="additional_navigation">';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . NAVI_AAPOR . '&m=aapor1"><span>' . $lang['srv_lnk_AAPOR1'] . '</span></a>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . NAVI_AAPOR . '&m=aapor2"><span>' . $lang['srv_lnk_AAPOR2'] . '</span></a>';
+ echo '<span><a href="index.php?anketa=' . $this->sid . '&a=' . NAVI_AAPOR . '&m=aapor1">' . $lang['srv_lnk_AAPOR1'] . '</a></span>';
+ echo '<span><a href="index.php?anketa=' . $this->sid . '&a=' . NAVI_AAPOR . '&m=aapor2">' . $lang['srv_lnk_AAPOR2'] . '</a></span>';
+
echo '</div>';
}
elseif ($podstran == 'diagnostics') {
echo '<div id="additional_navigation">';
+
echo '<a href="index.php?anketa=' . $this->sid . '&a=' . NAVI_AAPOR . '&m=aapor1"><span>' . $lang['srv_lnk_AAPOR1'] . '</span></a>';
- echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'paraAnalysisGraph\');"><span class="faicon ' . ($arrow == 1 ? ' dropup_blue' : 'dropdown_blue') . '"></span> ' . $lang['srv_data_settings_checkboxes'] . '</div>';
+ echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'paraAnalysisGraph\');"><span class="faicon ' . ($arrow == 1 ? ' fa-angle-up' : 'fa-angle-down') . '"></span> ' . $lang['srv_data_settings_checkboxes'] . '</div>';
+
echo '</div>';
-
}
// Nastavitve tabele (checkboxi) - PODATKI
if ($podstran == 'para_analysis_graph') {
$arrow = (isset($_SESSION['sid_' . $this->sid]['paraAnalysisGraph_settings'])) ? $_SESSION['sid_' . $this->sid]['paraAnalysisGraph_settings'] : 0;
- echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'paraAnalysisGraph\');"><span class="faicon ' . ($arrow == 1 ? ' dropup_blue' : 'dropdown_blue') . '"></span> ' . $lang['srv_data_settings_checkboxes'] . '</div>';
+ echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'paraAnalysisGraph\');"><span class="faicon blue ' . ($arrow == 1 ? ' fa-angle-up' : 'fa-angle-down') . '"></span> ' . $lang['srv_data_settings_checkboxes'] . '</div>';
}
// Info o uporabnih enotah
@@ -570,6 +458,7 @@ class SurveyStaticHtml
// Radio status (vsi, ustrezni...)
if ($analiza || in_array($podstran, array('data', 'export', 'charts', 'analysis_creport', 'analysis_links', 'para_graph', 'reminder_tracking', 'heatmap'))) {
echo '<div id="dataOnlyValid" ' . $borderLeft . '>';
+ echo '<span class="dataOnlyValid_label">'.$lang['srv_data_valid_label'].':</span>';
SurveyStatusProfiles::displayOnlyValidCheckbox();
echo '</div>';
}
@@ -586,12 +475,15 @@ class SurveyStaticHtml
echo '</div>';
}
+ echo '</div>';
+
+
// Nastavitve na desni
if ($analiza || in_array($podstran, array('data', 'export', 'charts', 'analysis_creport', 'analysis_links', 'dejanski_casi', 'para_analysis_graph', 'heatmap'))) {
$active_filter = $this->filteredData($podstran);
- echo '<div id="analiza_right_options_holder">';
+ echo '<div id="analiza_right_options_holder" class="right_options_holder">';
if ($analiza || in_array($podstran, array('charts'))) {
@@ -602,7 +494,7 @@ class SurveyStaticHtml
$lastElement = end(SurveyDataSettingProfiles::$textAnswersMore);
$cp = SurveyDataSettingProfiles::GetCurentProfileData();
foreach (SurveyDataSettingProfiles::$textAnswersMore AS $key => $values) {
- echo '<option' . ((int)$cp['numOpenAnswers'] == $values ? ' selected="selected"' : '') . ' value="' . $values . '">';
+ echo '<option' . (isset($cp['numOpenAnswers']) && (int)$cp['numOpenAnswers'] == $values ? ' selected="selected"' : '') . ' value="' . $values . '">';
if ($values != $lastElement) {
echo $values;
} else {
@@ -613,200 +505,187 @@ class SurveyStaticHtml
echo '</select>';
echo '</div>';
- // Nastavitve za filtre (po spr, zoom, statusi...)
- echo '<div title="' . $lang['settings'] . '" id="analiza_right_options2" class="spaceRight spaceLeft">';
- echo '<span id="filters_span2" class="faicon wheel_32 pointer icon-as_link"></span>';
- $this->displayAnalizaRightOptions2($podstran);
- echo '</div>';
+ // Nastavitve pri grafih
+ if(in_array($podstran, array('charts'))){
+ echo '<div title="' . $lang['settings'] . '" id="analiza_right_options2" class="spaceRight spaceLeft">';
+ echo '<span id="filters_span2" class="faicon wheel_32"></span>';
+ $this->displayAnalizaRightOptions2($podstran);
+ echo '</div>';
+ }
+ // Nastavitve pri analizah - brez popupa - samo klik na zobnik
+ else{
+ echo '<div title="' . $lang['settings'] . '" id="analiza_right_options2" class="spaceRight spaceLeft">';
+ echo ' <span id="filters_span2" class="faicon wheel_32" onClick="dataSettingProfileAction(\'showProfiles\');"></span>';
+ echo '</div>';
+ }
}
elseif ($podstran == 'data' || $podstran == 'export') {
// Ikona za ponovno generiranje datoteke
- echo '<span title="' . $lang['srv_deleteSurveyDataFile_link'] . '" class="faicon refresh icon-as_link pointer spaceRight spaceLeft" onClick="changeColectDataStatus(); return false;"></span>';
+ echo '<span title="' . $lang['srv_deleteSurveyDataFile_link'] . '" class="faicon refresh" onClick="changeColectDataStatus(); return false;"></span>';
}
echo '<div title="' . $lang['filters'] . '" id="analiza_right_options" '.(!$userAccess->checkUserAccess($what='filters') ? 'class="user_access_locked"' : '').'>';
echo '<span id="filters_span" class="faicon filter pointer"></span>';
$this->displayAnalizaRightOptions($podstran);
echo '</div>';
- echo Help::display('srv_data_filter');
+ if($podstran != 'dejanski_casi')
+ echo Help::display('srv_data_filter');
echo '</div>';
}
- // Link na nastavitve komentarjev
- elseif ($podstran == 'komentarji' || $podstran == 'komentarji_anketa') {
-
- $d = new Dostop();
-
- # nastavitve komentarjev
- if ($d->checkDostopSub('edit')) {
- echo '<div id="analiza_right_options_holder">';
- echo '<div title="' . $lang['settings'] . '" id="analiza_right_options">';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=urejanje" title="' . $lang['srv_settings_komentarji1'] . '">';
- echo '<span class="faicon wheel_32 pointer icon-as_link"></span>';
- //echo '<span id="filters_span" class="bold pointer">'.$lang['settings'].'</span>';
- echo '</a>';
- echo '</div>';
- echo '</div>';
- }
- }
- // Nastavitve statusa
- elseif ($podstran == 'status') {
-
- $ss = new SurveyStatistic();
- $ss->Init($this->sid);
-
- echo '<div id="div_status_filtri_right" class="floatRight">';
-
- echo '<div id="dashboardEmailInvitationFilter" style="position:absolute; right:20px; top:46px;">';
- echo $ss->emailInvitationFilter($this->emailInvitation);
- echo '</div>';
-
- echo '<ul>';
- # če imamo vabila
- $row = SurveyInfo::getSurveyRow();
-
- if ($row['email'] || $row['user_base']) {
- if ($ss->cnt_all == $ss->cnt_email) {
- echo '<li>';
- # filter za emaile
- echo $lang['srv_statistic_email_invitation'];
- echo '<select id="filter_email_status" name="filter_email_status" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
- echo '<option value="0" disabled="disabled">' . $lang['srv_statistic_email_invitation_all'] . '</option>';
- echo '<option value="1" selected="selected">' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
- echo '<option value="2" disabled="disabled">' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
- echo '</select>';
- echo '</li>';
- } else {
- echo '<li>';
- # filter za emaile
- echo $lang['srv_statistic_email_invitation'];
- echo '<select id="filter_email_status" name="filter_email_status" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
- echo '<option value="0"' . ($ss->emailInvitation == 0 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_all'] . '</option>';
- echo '<option value="1"' . ($ss->emailInvitation == 1 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
- echo '<option value="2"' . ($ss->emailInvitation == 2 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
- echo '</select>';
- echo '</li>';
- }
- }
- echo '<li>';
- # filter za čase
- $TimeProfileData = SurveyTimeProfiles:: GetDates();
- $separator = ($row['email'] || $row['user_base']) ? true : false;
- SurveyTimeProfiles::DisplayLink(false, $separator);
- echo '</li>';
- echo '</ul>';
-
- echo '</div>';
- }
-
echo '</div>';
}
- public function displayAnalizaSubNavigation($showDiv = true)
- {
+ public function displayAnalizaSubNavigation(){
global $lang, $admin_type, $global_user_id;
- $_js_links = array();
-
- UserSetting:: getInstance()->Init($global_user_id);
- $show_analiza_preview = (int)UserSetting:: getInstance()->getUserSetting('showAnalizaPreview') == 1 ? true : false;
- if ($show_analiza_preview == true) {
- for ($i = 1; $i <= 9; $i++) {
- $_js_links[$i] = ' onmouseover="show_anl_prev(' . $i . '); return false;" onmouseout="hide_anl_prev(); return false"';
- }
+ $userAccess = UserAccess::getInstance($global_user_id);
+ $current_package = $userAccess->getPackage();
+ $user_package = $userAccess->getPackage(); // paket, ki ga ima uporabnik (1, 2 , 3)
+ $dostop_styling = "";
+ if ($user_package != "-1" && $user_package != "" && !$userAccess->isAnketaOld())
+ $dostop_styling = "dostop_".$user_package."ka";
+ $_js_links = array();
+ for ($i=1; $i<9; $i++) {
+ $_js_links[$i] = ' onmouseover="show_anl_prev('.$i.'); return false;" onmouseout="hide_anl_prev(); return false"';
}
+
if ($_GET['m'] != M_ANALYSIS_CHARTS && $_GET['m'] != M_ANALYSIS_LINKS && $_GET['m'] != M_ANALYSIS_CREPORT) {
- if (true) {
- echo '<span class="srv_statistic_menu">' . $lang['srv_statistic_menu'] . Help::display('srv_menu_statistic') . '&nbsp;</span>';
- echo '<div id="globalSetingsLinks" class="analiza">';
- }
+
+ echo '<span>'.$lang['srv_statistic_menu'].' '.Help::display('srv_menu_statistic').'</span>';
+
+ echo '<div id="globalSetingsLinks" class="analiza" >';
+
if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')) {
- echo '<ul class="analizaSubNavigation">';
- echo '<li' . ($_GET['m'] == M_ANALYSIS_MEANS_HIERARHY ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[5] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_means'] . '"><span>' . $lang['srv_means'] . '</span></a>';
- echo '</li>';
- echo '</ul>';
+ echo '<div class="analizaSubNavigation">';
- } else {
- echo '<ul class="analizaSubNavigation">';
- echo '<li' . ($_GET['m'] == M_ANALYSIS_SUMMARY ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[1] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_SUMMARY . '" title="' . $lang['srv_sumarnik'] . '"><span>' . $lang['srv_sumarnik'] . '</span></a>';
- echo '</li>';
+ echo ' <div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_MEANS_HIERARHY ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[5].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS_HIERARHY . '" title="' . $lang['srv_means'] . '"><span>' . $lang['srv_means'] . '</span></a>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+ else {
+
+ echo '<div class="analizaSubNavigation '.($dostop_styling != "" && $current_package!=3 ? 'user_access_locked' : '').'" onmouseenter="show_menu(); return false;" onmouseleave="hide_menu(); return false">';
+
+ # sumarnik
+ echo ' <div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_SUMMARY ? 'highlightLineTab' : 'nonhighlight displayNone"').'" '.$_js_links[1].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_SUMMARY . '" title="' . $lang['srv_sumarnik'] . '"><span>' . $lang['srv_sumarnik'] . '</span></a>';
+ echo ' </div>';
+
# opisne
- echo '<li' . ($_GET['m'] == M_ANALYSIS_DESCRIPTOR ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[2] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_DESCRIPTOR . '" title="' . $lang['srv_descriptor'] . '"><span>' . $lang['srv_descriptor_short'] . '</span></a>';
- echo '</li>';
+ echo ' <div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_DESCRIPTOR ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[2].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_DESCRIPTOR . '" title="' . $lang['srv_descriptor'] . '"><span>' . $lang['srv_descriptor_short'] . '</span></a>';
+ echo ' </div>';
+
# frekvence
- echo '<li' . ($_GET['m'] == M_ANALYSIS_FREQUENCY ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[3] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_FREQUENCY . '" title="' . $lang['srv_frequency'] . '"><span>' . $lang['srv_frequency'] . '</span></a>';
- echo '</li>';
- # crostabs
- echo '<li' . ($_GET['m'] == M_ANALYSIS_CROSSTAB ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[4] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_CROSSTAB . '" title="' . $lang['srv_crosstabs'] . '"><span>' . $lang['srv_crosstabs'] . '</span></a>';
- echo '</li>';
- # multicrostabs
- echo '<li' . ($_GET['m'] == M_ANALYSIS_MULTICROSSTABS ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[8] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MULTICROSSTABS . '" title="' . $lang['srv_multicrosstabs'] . '"><span>' . $lang['srv_multicrosstabs'] . '</span></a>';
- echo '</li>';
- # povprečaj
- echo '<li' . ($_GET['m'] == M_ANALYSIS_MEANS ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[5] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS . '" title="' . $lang['srv_means'] . '"><span>' . $lang['srv_means'] . '</span></a>';
- echo '</li>';
- # ttest
- if ($admin_type == 0) {
- echo '<li' . ($_GET['m'] == M_ANALYSIS_TTEST ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[6] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_TTEST . '" title="' . $lang['srv_ttest'] . '"><span>' . $lang['srv_ttest'] . '</span></a>';
- echo '</li>';
+ echo ' <div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_FREQUENCY ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[3].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_FREQUENCY . '" title="' . $lang['srv_frequency'] . '"><span>' . $lang['srv_frequency'] . '</span></a>';
+ echo ' </div>';
+
+ // Pri glasovanju nimamo teh modulov ker imamo samo 1 vprasanje
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") != 0){
+
+ if($dostop_styling != "" && $current_package == 1){
+ //echo '<div class="analysis_locked">';
+ //$analysis_locked_show = $_GET['m'] == M_ANALYSIS_CROSSTAB ? 'displayAnalysis' : 'displayNone';
+ if($_GET['m'] == M_ANALYSIS_CROSSTAB || $_GET['m'] == M_ANALYSIS_MULTICROSSTABS || $_GET['m'] == M_ANALYSIS_MEANS || $_GET['m'] == M_ANALYSIS_TTEST || $_GET['m'] == M_ANALYSIS_BREAK){
+ $analysis_locked_show = 'displayAnalysis';
+ }else{
+ $analysis_locked_show = 'displayNone';
+ }
+ echo '<div class="analysis_locked '.$analysis_locked_show.'">';
+ }
+
+ # crostabs
+ echo '<div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_CROSSTAB ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[4].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_CROSSTAB . '" title="' . $lang['srv_crosstabs'] . '"><span>' . $lang['srv_crosstabs'] . '</span></a>';
+ echo '</div>';
+
+ if($dostop_styling != "" && $current_package == 2){
+ //echo '<div class="analysis_locked">';
+ if($_GET['m'] == M_ANALYSIS_MULTICROSSTABS || $_GET['m'] == M_ANALYSIS_MEANS || $_GET['m'] == M_ANALYSIS_TTEST || $_GET['m'] == M_ANALYSIS_BREAK){
+ $analysis_locked_show = 'displayAnalysis';
+ }else{
+ $analysis_locked_show = 'displayNone';
+ }
+ echo '<div class="analysis_locked '.$analysis_locked_show.'">';
+ }
+
+ # multicrostabs
+ echo '<div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_MULTICROSSTABS ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[8].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MULTICROSSTABS . '" title="' . $lang['srv_multicrosstabs'] . '"><span>' . $lang['srv_multicrosstabs'] . '</span></a>';
+ echo '</div>';
+
+ # povprečaj
+ echo '<div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_MEANS ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[5].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_MEANS . '" title="' . $lang['srv_means'] . '"><span>' . $lang['srv_means'] . '</span></a>';
+ echo '</div>';
+
+ # ttest
+ if ($admin_type == 0) {
+ echo '<div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_TTEST ? 'highlightLineTab' : 'nonhighlight displayNone').'" '.$_js_links[6].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_TTEST . '" title="' . $lang['srv_ttest'] . '"><span>' . $lang['srv_ttest'] . '</span></a>';
+ echo '</div>';
+ }
+
+ # break
+ echo '<div class="analizaSubNavigation_item '.($_GET['m'] == M_ANALYSIS_BREAK ? 'highlightLineTab' : 'nonhighlight displayNone') . $_js_links[7].'>';
+ echo ' <a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_BREAK . '" title="' . $lang['srv_break'] . '"><span>' . $lang['srv_break'] . '</span></a>';
+ echo '</div>';
+
+ if($dostop_styling != "" && $current_package != 3){
+ echo '</div>';
+ }
}
- # break
- echo '<li' . ($_GET['m'] == M_ANALYSIS_BREAK ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"') . $_js_links[7] . '>';
- echo '<a href="index.php?anketa=' . $this->sid . '&a=' . A_ANALYSIS . '&m=' . M_ANALYSIS_BREAK . '" title="' . $lang['srv_break'] . '"><span>' . $lang['srv_break'] . '</span></a>';
- echo '</li>';
- # para statistike - so pod status??
- /*if ($admin_type === '0') {
-
- echo '<li'.($_GET['m']==M_ANALYSIS_PARA ? ' class="highlightLineTab"' : ' class="nonhighlight displayNone"').$_js_links[9].'>';
- echo '<a href="index.php?anketa='.$this->sid.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_PARA.'" title="'.$lang['srv_para_neodgovori'].'"><span>'.$lang['srv_para_neodgovori'].'</span></a>';
- echo '</li>';
- } */
- # predogled
- echo '<li class="previewCheck displayNone">';
- echo '<label><input type="checkbox" id="cbx_shoq_analiza_preview" onchange="change_analiza_preview();"' . ($show_analiza_preview == true ? ' checked=checked' : '') . '>' . $lang['srv_preview'] . '</label>';
- echo '</li>';
- echo '</ul>';
- }
- if ($showDiv) {
+
echo '</div>';
}
- ?>
- <script>
+
+ echo '</div>';
+
+
+ ?><script>
+ <?php $m = $_GET['m']; ?>
+ data_m = "<?php echo $m; ?>";
+ dostop_styling = "<?php echo $dostop_styling; ?>";
+ current_package = "<?php echo $current_package; ?>";
+
+ function show_menu(){
+ if((data_m == 'crosstabs' || data_m == 'multicrosstabs' || data_m == 'means' || data_m == 'ttest' || data_m == 'break')&&(dostop_styling != "" && current_package == 1)){
+ $('.analysis_locked').removeClass('displayAnalysis');
+ }else if((data_m == 'multicrosstabs' || data_m == 'means' || data_m == 'ttest' || data_m == 'break')&&(dostop_styling != "" && current_package == 2)){
+ $('.analysis_locked').removeClass('displayAnalysis');
+ }
+ }
+ function hide_menu(){
+ if((data_m == 'crosstabs' || data_m == 'multicrosstabs' || data_m == 'means' || data_m == 'ttest' || data_m == 'break')&&(dostop_styling != "" && current_package == 1)){
+ $('.analysis_locked').addClass('displayAnalysis');
+ }else if((data_m == 'multicrosstabs' || data_m == 'means' || data_m == 'ttest' || data_m == 'break')&&(dostop_styling != "" && current_package == 2)){
+ $('.analysis_locked').addClass('displayAnalysis');
+ }
+ }
+
function show_anl_prev(tip) {
$("#srv_analiza_preview_div").show();
- //var tip = parseInt($(event.target).parent().attr('anl_prv'));
-
if (tip > 0) {
// skrijemo ostale previev-e
- $('.srv_analiza_preview_sub').addClass('hidden');
+ $('.srv_analiza_preview_sub').addClass('displayNone');
// prikažemo ustrezen predogled
- $('#srv_analiza_preview_sub_' + tip).removeClass('hidden');
+ $('#srv_analiza_preview_sub_' + tip).removeClass('displayNone');
}
}
function hide_anl_prev() {
$("#srv_analiza_preview_div").hide();
+
}
- // mousever preview vprasanja
- //$('#globalSetingsLinks ul li a').bind('mouseover', function (event) {
-
- //}).bind('mouseout', function (event) {
-
- //});
- </script>
- <?php
-
+ </script><?php
}
+
$this->displayAnalizaPreview();
}
@@ -884,11 +763,11 @@ class SurveyStaticHtml
echo '<div id="div_analiza_filtri_right" class="floatRight">';
echo '<ul>';
- if ($podstran == 'export') {
+ /* if ($podstran == 'export') {
echo '<li>';
- echo '<span class="as_link" id="link_export_setting" onClick="$(\'#fade\').fadeTo(\'slow\', 1);$(\'#div_export_setting_show\').fadeIn(\'slow\'); return false;" title="' . $lang['srv_dsp_link'] . '">' . $lang['srv_dsp_link'] . '</span>';
+ echo ' <span id="link_export_setting" onClick="$(\'#fade\').fadeTo(\'slow\', 1);$(\'#div_export_setting_show\').fadeIn(\'slow\'); return false;" title="' . $lang['srv_dsp_link'] . '">' . $lang['srv_dsp_link'] . '</span>';
echo '</li>';
- }
+ } */
# filter za nastavitve
# div za filtre statusov
@@ -900,14 +779,11 @@ class SurveyStaticHtml
SurveyConditionProfiles::DisplayLink(false);
# filter za čase
SurveyTimeProfiles::DisplayLink(false);
- # generiranje datoteke s podatki - dodana lastna ikona za generiranje datoteke
- //SurveyStatusProfiles :: FileGeneratingSetting(false);
echo '</ul>';
echo '</div>'; # id="div_analiza_filtri_right" class="floatRight"
}
elseif ($podstran == 'dejanski_casi') {
- echo '<div id="div_analiza_filtri_right">';
SurveyStatusCasi:: Init($this->sid);
@@ -915,7 +791,7 @@ class SurveyStaticHtml
// nastavitve iz popupa
$rezanje = SurveyUserSetting::getInstance()->getSettings('rezanje');
- if ($rezanje == '') $rezanje = 1;
+ if ($rezanje == '') $rezanje = 0;
$rezanje_meja_sp = SurveyUserSetting::getInstance()->getSettings('rezanje_meja_sp');
if ($rezanje_meja_sp == '') $rezanje_meja_sp = 5;
$rezanje_meja_zg = SurveyUserSetting::getInstance()->getSettings('rezanje_meja_zg');
@@ -925,36 +801,38 @@ class SurveyStaticHtml
$rezanje_predvidena_zg = SurveyUserSetting::getInstance()->getSettings('rezanje_predvidena_zg');
if ($rezanje_predvidena_zg == '') $rezanje_predvidena_zg = 200;
- // profili rezanja
- $statusCasi = SurveyStatusCasi:: getProfiles();
- echo '<div>' . "\n";
- echo '<a href="#" onclick="vnosi_show_rezanje_casi(); return false;" id="link_rezanje_casi" title="' . $lang['srv_rezanje'] . '">' . $lang['srv_rezanje'] . '</a><br/>';
- echo '<span id="div_vnosi_status_profile_dropdownd" style="font-size:10px">';
+ echo '<div id="div_analiza_filtri_right" class="casi">';
+ echo '<ul>';
- if ($rezanje == 0) {
+ // profili rezanja
+ echo ' <li>';
+ echo ' <span onclick="vnosi_show_rezanje_casi(); return false;" id="link_rezanje_casi" title="'.$lang['srv_rezanje'].'">';
+ echo $lang['srv_rezanje'];
+ echo ' <div style="font-size:10px">';
+ if ($rezanje == 0)
echo '(' . $lang['srv_rezanje_meja_sp'] . ': ' . $rezanje_meja_sp . '%, ' . $lang['srv_rezanje_meja_zg'] . ': ' . $rezanje_meja_zg . '%)';
-
- } else {
+ else
echo '(' . $rezanje_predvidena_sp . '% ' . $lang['srv_and'] . ' ' . $rezanje_predvidena_zg . '% ' . $lang['srv_rezanje_predvidenega'] . ')';
- }
-
- echo '</span>';
- echo '</div>';
+ echo ' </div>';
+ echo ' </span>';
+ echo ' </li>';
+
// profili statusov
- $statusCasi = SurveyStatusCasi:: getProfiles();
- echo '<div style="margin-top: 15px;">';
- echo '<span class="as_link" id="link_status_casi" title="' . $lang['srv_statusi'] . '">' . $lang['srv_statusi'] . ': </span>';
- echo '<span id="div_vnosi_status_profile_dropdown">';
- echo '<select id="vnosi_current_status_casi" name="vnosi_current_status_casi" onchange="statusCasiAction(\'change\'); return false;" >';
+ $statusCasi = SurveyStatusCasi::getProfiles();
+ $izbranStatusCasi = SurveyStatusCasi::getCurentProfileId();
+ echo ' <li>';
+ //echo '<label id="link_status_casi" title="' . $lang['srv_statusi'] . '">' . $lang['srv_statusi'] . ': </span>';
+ echo ' <span>'.$lang['srv_statusi'].':</span>';
+ echo ' <select id="vnosi_current_status_casi" name="vnosi_current_status_casi" onChange="statusCasiAction(\'change\'); return false;">';
foreach ($statusCasi as $key => $value) {
echo ' <option' . ($izbranStatusCasi == $value['id'] ? ' selected="selected"' : '') . ' value="' . $value['id'] . '">' . $value['name'] . '</option>';
}
- echo '</select>';
- echo '</span>';
- echo '</div>';
+ echo ' </select>';
+ echo '</li>';
+ echo '</ul>';
echo '</div>';
}
else {
@@ -1104,15 +982,16 @@ class SurveyStaticHtml
}
}
- public function displayChartOptions()
- {
+ public function displayChartOptions(){
global $lang, $admin_type;
+ SurveyChart::Init($this->sid);
+
// Nastavitev HQ grafov
- echo '<li><label>';
- echo $lang['srv_chart_hq'] . ': ';
- echo '<input type="checkbox" name="chart_hq" id="chart_hq" onClick="changeChartHq(this)" ' . (SurveyChart::$quality == 3 ? ' checked="checked"' : '') . '>';
- echo '</label></li>';
+ echo '<li>';
+ echo ' <input type="checkbox" name="chart_hq" id="chart_hq" onClick="changeChartHq(this)" '.(SurveyChart::$quality == 3 ? ' checked="checked"' : '').'>';
+ echo ' <label for="chart_hq">'.$lang['srv_chart_hq'] . '</label>';
+ echo '</li>';
// Nastavitev skina grafov
@@ -1171,19 +1050,14 @@ class SurveyStaticHtml
break;
}
}
-
+
+ $hideAdvanced = (isset($_SESSION['AnalysisAdvancedLinks'][$this->sid]) && $_SESSION['AnalysisAdvancedLinks'][$this->sid] == true) ? true : false;
if ($hideAdvanced == false) {
echo '<li>';
- echo '<span class="as_link" id="link_chart_color" title="' . $lang['srv_chart_skin'] . '">' . $lang['srv_chart_skin'] . ': <span style="font-weight: 500;">' . $name . '</span></span>';
+ echo ' <span id="link_chart_color" title="' . $lang['srv_chart_skin'] . '">' . $lang['srv_chart_skin'] . ': <span style="font-weight: 500;">' . $name . '</span></span>';
echo '</li>';
}
-
- // Separator
- /*echo '<li style="border-bottom:1px #0C377A dashed;">';
- echo '</li>';
- echo '<li>';
- echo '</li>';*/
}
diff --git a/admin/survey/classes/class.SurveyStatistic.php b/admin/survey/classes/class.SurveyStatistic.php
index 89910fe..76b92f0 100644
--- a/admin/survey/classes/class.SurveyStatistic.php
+++ b/admin/survey/classes/class.SurveyStatistic.php
@@ -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;
@@ -538,7 +537,8 @@ class SurveyStatistic {
*/
function prepareStatusView() {
- $email_filter_string = null;
+ $email_filter_string = null;
+ $user_id_to_check_link = array(); # id-ji uporabnikov pri katerih imamo direkten klik. naknadno ugotavljamo ali je slučajno e-mail vabilo
if ($this->emailInvitation > 0) {
if ($this->emailInvitation == 1) {
$email_filter_string = ' AND inv_res_id is not NULL ';
@@ -555,9 +555,7 @@ class SurveyStatistic {
.$email_filter_string
);
if (mysqli_num_rows($qry) > 0) {
-
- $user_id_to_check_link = array(); # id-ji uporabnikov pri katerih imamo direkten klik. naknadno ugotavljamo ali je slučajno e-mail vabilo
-
+ $_tmp_direct = 0;
while ($row = mysqli_fetch_assoc($qry)) {
if ($this->emailInvitation == 1 && $row['inv_res_id'] != null){
@@ -612,8 +610,12 @@ class SurveyStatistic {
else if ($row['referer'] != "" && $row['referer'] != "0"){
$parsed = parse_url($row['referer']);
$this->cntValidRedirections += 1;
- $this->userRedirections["valid"][$parsed['host']] += 1;
- //$this->userRedirections["cntAll"] += 1;
+
+ if(isset($this->userRedirections["valid"][$parsed['host']]))
+ $this->userRedirections["valid"][$parsed['host']] += 1;
+ else
+ $this->userRedirections["valid"][$parsed['host']] = 1;
+
$this->maxCharRedirection = max($this->maxCharRedirection , strlen ($parsed['host']) );
$this->maxRedirection = max($this->maxRedirection , $this->userRedirections["valid"][$parsed['host']] );
}
@@ -639,7 +641,7 @@ class SurveyStatistic {
}
# od direktnega klika odštejemo e-mail vabila
- if (count($user_id_to_check_link)> 0) {
+ if (is_countable($user_id_to_check_link) && count($user_id_to_check_link)> 0) {
$qryEmail = sisplet_query("SELECT COUNT(*) as cnt FROM srv_userstatus WHERE usr_id IN (".implode(',', $user_id_to_check_link).") AND status IN (".implode(',', $this->emailStatus).")");
$rwsEmail = mysqli_fetch_assoc($qryEmail);
@@ -653,7 +655,12 @@ class SurveyStatistic {
}
// prestejemo max stevilo klikov za lepsi izris tabele
- $this->maxRedirection = max($this->maxRedirection , $this->userRedirections["2"], $this->userRedirections["1"], $this->userRedirections["0"],$this->userRedirections["direct"], $this->userRedirections['email']);
+ $this->userRedirections["0"] = isset($this->userRedirections["0"]) ? $this->userRedirections["0"] : 0;
+ $this->userRedirections["1"] = isset($this->userRedirections["1"]) ? $this->userRedirections["1"] : 0;
+ $this->userRedirections["2"] = isset($this->userRedirections["2"]) ? $this->userRedirections["2"] : 0;
+ $this->userRedirections["direct"] = isset($this->userRedirections["direct"]) ? $this->userRedirections["direct"] : 0;
+ $this->userRedirections['email'] = isset($this->userRedirections['email']) ? $this->userRedirections['email'] : 0;
+ $this->maxRedirection = max($this->maxRedirection , $this->userRedirections["2"], $this->userRedirections["1"], $this->userRedirections["0"], $this->userRedirections["direct"], $this->userRedirections['email']);
# izracunamo realne frekvence po statusih
# Klik na anketo - vsak ki je končal anketo (itd...) je "najbrž" tudi kliknil na anketo..
@@ -705,7 +712,7 @@ class SurveyStatistic {
* DisplayDataView - prikate panelo z kliki po datumih
*/
function Display() {
- global $lang, $site_url;
+ global $lang, $site_url, $admin_type;
$dashboardHtml = null;
@@ -728,34 +735,69 @@ class SurveyStatistic {
$_sql_string = "SELECT DATE_FORMAT(dashboard_update_time,'%d.%m.%Y %H:%i:%s') FROM srv_data_files WHERE sid = '".$this->surveyId."'";
$_sql_qry = sisplet_query($_sql_string);
list($dashboard_update_time) = mysqli_fetch_row($_sql_qry);
- echo '<span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
-
- #preberemo podatke o datoteki
- echo $SDF->getDataFileInfo();
-
+
+
+ echo '<div class="dashboard_top_settings">';
+
+ // Obvestilo o datoteki vidijo samo admini
+ if($admin_type == 0){
+ echo '<div class="dashboard_top_info">';
+ echo ' <span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
+ echo $SDF->getDataFileInfo();
+ echo '</div>';
+ }
+
+ echo ' <div id="div_status_filtri_right" class="dashboard_top_filters">';
+ $this->displayTopFilters();
+ echo ' </div>';
+
+ echo '</div>';
+
+
# preberemo cache file in ga zehamo
echo $this->ReadCacheFile();
}
else {
+
+ // Ce ne zbiramo parapodatkov casov resevanja izpisemo opozorilo
+ if($paradata_date == 1){
+ echo '<div class="top_note dashboard_paradata_note">';
+ echo ' <div class="title">';
+ echo ' <span class="faicon warning"></span> '.$lang['srv_warning'];
+ echo ' </div>';
+ echo $lang['srv_dashboard_paradata_date_warning'];
+ echo '</div>';
+ }
- $dashboard_update_time = date("d.m.Y, H:i:s");
- echo '<span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
-
- #preberemo podatke o datoteki
- echo $SDF->getDataFileInfo();
-
- // Ce ne zbiramo parapodatkov casov resevanja izpisemo opozorilo
- if($paradata_date == 1)
- echo '<br /><br /><span>'.$lang['srv_dashboard_paradata_date_warning'].'</span>';
+ echo '<div class="dashboard_top_settings">';
+
+ echo ' <div class="dashboard_top_info">';
+
+ // Obvestilo o datoteki vidijo samo admini
+ if($admin_type == 0){
+ $dashboard_update_time = date("d.m.Y, H:i:s");
+ echo ' <span id="srv_dashboard_updated">'.$lang['srv_dashboard_updated'].$dashboard_update_time.'</span>';
+
+ #preberemo podatke o datoteki
+ echo $SDF->getDataFileInfo();
+ }
// Prikazemo filter na datum ce je vklopljen
if (SurveyTimeProfiles::getCurentProfileId() != STP_DEFAULT_PROFILE){
- echo '<br class="clr" /><br class="clr" />';
- echo '<div id="displayFilterNotes">';
+ echo ' <div id="displayFilterNotes">';
SurveyTimeProfiles :: printIsDefaultProfile();
- echo '</div>';
+ echo ' </div>';
}
+ echo ' </div>';
+
+ echo ' <div id="div_status_filtri_right" class="dashboard_top_filters">';
+ $this->displayTopFilters();
+ echo ' </div>';
+
+ echo '</div>';
+
+
# Cache file ne obstaja. Če imamo privzete nastavitve vseh filtrov, shranimo prikazan html v datoteko
# spodnje ehote shranimo v spremenljivko ki jo popotrebi keširanja shranimo v datoteko.
@@ -775,19 +817,19 @@ class SurveyStatistic {
$row_all_users = mysqli_fetch_assoc($qry_all_users);
$allUserCount = $row_all_users['user_count'];
+
+ echo '<div class="dashboard_boxes">';
+
// nimamo še vnosov
- if ($allUserCount == 0 || $paradata_date == 1) {
+ if ($allUserCount == 0 || ($paradata_date == 1 && !SurveyInfo::getInstance()->checkSurveyModule('voting'))){
- // zgornji boxi
- echo '<table class="dashboard dashboard_single">';
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
+ echo '<div class="dashboard_box" name="div_statistic_info" id="div_statistic_info">';
+ $this->DisplayInfoView();
+ echo '</div>';
+
+ echo '<div class="dashboard_box">';
+ Common::noDataAlert('status');
echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
}
// imamo vnose, prikažemo statistiko
else {
@@ -795,57 +837,46 @@ class SurveyStatistic {
$this->PrepareDateView();
$this->PrepareStatusView();
- echo '<table class="dashboard">';
- echo '<tr>';
-
- // zgornji boxi
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
+
+ echo '<div class="dashboard_box" name="div_statistic_info" id="div_statistic_info" >';
+ $this->DisplayInfoView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_status" id="div_statistic_status" >'."\n";
- $this -> DisplayStatusView();
+
+ echo '<div class="dashboard_box" name="div_statistic_status" id="div_statistic_status" >';
+ $this->DisplayStatusView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_answer_state" id="div_statistic_answer_state" >'."\n";
- $this -> DisplayAnswerStateView();
+
+ echo '<div class="dashboard_box" name="div_statistic_answer_state" id="div_statistic_answer_state" >';
+ $this->DisplayAnswerStateView();
echo '</div>';
- echo '</td>';
- echo '</tr>';
- // spodnji boxi
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_referals">';
- $this -> DisplayReferalsView();
+
+ echo '<div class="dashboard_box" id="div_statistic_referals">';
+ $this->DisplayReferalsView();
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_visit">';
- echo '<span class="dashboard_title">'.$lang['srv_statistic_timeline_title'].'</span>'.Help :: display('srv_statistic_timeline_title');
- $this -> DisplayFilters();
- echo '<br/>';
- echo '<div name="div_statistic_visit_data" id="div_statistic_visit_data" >'."\n";
- $this -> DisplayDateView();
- echo '</div>';
+
+ echo '<div class="dashboard_box" id="div_statistic_visit">';
+ echo ' <div class="box_title">'.$lang['srv_statistic_timeline_title'].' '.Help :: display('srv_statistic_timeline_title').'</div>';
+
+ $this->DisplayFilters();
+
+ echo ' <div name="div_statistic_visit_data" id="div_statistic_visit_data" >';
+ $this->DisplayDateView();
+ echo ' </div>';
+
echo '</div>';
- echo '</td>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_pages_state">';
- $this -> DisplayPagesStateView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
+ echo '<div class="dashboard_box" id="div_statistic_pages_state">';
+ $this->DisplayPagesStateView();
+ echo '</div>';
}
+
+ echo '</div>';
+
# HTML zapišemo v spremenljivko
@@ -866,19 +897,67 @@ class SurveyStatistic {
$timestamp = (int)$time1 + (int)$time2;
- $this->WriteToCacheFile($dashboardHtml,$timestamp);
+ $this->WriteToCacheFile($dashboardHtml, $timestamp);
}
+
# izpišemo HTML v browser
echo $dashboardHtml;
}
-
- echo '<div class="clr"></div>';
- echo '<span >';
- echo '</span>';
-
+
$dashboardHtml = null;
}
+
+ // Prikazemo filtre na vrhu dashboarda
+ function DisplayTopFilters(){
+ global $lang;
+
+ if($this->emailInvitation == 1 || $this->emailInvitation == 2){
+ echo '<div id="dashboardEmailInvitationFilter" class="filter_setting">';
+ $this->emailInvitationFilter($this->emailInvitation);
+ echo '</div>';
+ }
+
+ # če imamo vabila - filter za emaile
+ $row = SurveyInfo::getSurveyRow();
+
+ if ($row['user_base']) {
+
+ if ($this->cnt_all == $this->cnt_email) {
+
+ echo '<div class="filter_setting">';
+
+ echo $lang['srv_statistic_email_invitation'];
+ echo ' <select id="filter_email_status" name="filter_email_status" class="dropdown small" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
+ echo ' <option value="0" disabled="disabled">' . $lang['srv_statistic_email_invitation_all'] . '</option>';
+ echo ' <option value="1" selected="selected">' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
+ echo ' <option value="2" disabled="disabled">' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
+ echo ' </select>';
+
+ echo '</div>';
+ }
+ else {
+ echo '<div class="filter_setting">';
+
+ echo $lang['srv_statistic_email_invitation'];
+ echo ' <select id="filter_email_status" name="filter_email_status" class="dropdown small" onchange="statisticRefreshAllBoxes(\'invitation\'); return false;" >';
+ echo ' <option value="0"' . ($this->emailInvitation == 0 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_all'] . '</option>';
+ echo ' <option value="1"' . ($this->emailInvitation == 1 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_only_email'] . '</option>';
+ echo ' <option value="2"' . ($this->emailInvitation == 2 ? ' selected="selected"' : '') . '>' . $lang['srv_statistic_email_invitation_no_email'] . '</option>';
+ echo ' </select>';
+
+ echo '</div>';
+ }
+ }
+
+ # filter za čase
+ echo '<div class="filter_setting">';
+ echo ' <div id="link_time_profile" class="filter_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">';
+ echo ' <span class="faicon calendar_icon"></span>'.$lang['srv_time_profile_link'];
+ echo ' </div>';
+ echo '</div>';
+ }
+
/** Funkcija prikaze osnovnih informacij
*
*/
@@ -886,28 +965,29 @@ class SurveyStatistic {
global $lang;
global $site_url;
- echo '<div class="dashboard_title">'.$lang['srv_statistic_info_title'].Help :: display('srv_statistic_info_title').'</div><br/>';
- //SurveyInfo::getInstance()->DisplayInfoBox(false);
- /* zaradi nenehnih sprememb (Vasja) se ne da naredit univerzalno, */
+ echo '<div class="box_title">'.$lang['srv_statistic_info_title'].Help :: display('srv_statistic_info_title').'</div>';
-
- echo '<table style="width:100%;">';
+ echo '<table>';
echo '<COLGROUP><COL width="90px"><COL width="100px"><COL width="90px"><COL width="100px"></COLGROUP>';
# ime ankete
- echo '<tr><td>';
+ echo '<tr>';
+ echo '<td>';
echo $lang['srv_info_name'].':';
echo '</td><td colspan="3">';
echo htmlentities(SurveyInfo::getSurveyTitle(), ENT_QUOTES, "UTF-8");
echo '</td>';
echo '</tr>';
+
+
+ #opomba
if (SurveyInfo::getSurveyInfo()) {
- #opomba
+
// prikažemo 30 znakov na mouseover pa kompletno
echo '<tr><td>';
echo $lang['srv_info_note'].':';
echo '</td><td colspan="3" title="' . SurveyInfo::getSurveyInfo() . '">';
- echo htmlentities($this->limitString(SurveyInfo::getSurveyInfo(),30), ENT_QUOTES, "UTF-8");
+ echo htmlentities(is_string($this->limitString(SurveyInfo::getSurveyInfo(),30)), ENT_QUOTES, "UTF-8");
echo '</td></tr>';
}
@@ -948,7 +1028,8 @@ class SurveyStatistic {
echo '</td><td colspan="3">';
echo $lang['srv_vrsta_survey_type_'.(SurveyInfo::getSurveyType()>2 ? 2 : SurveyInfo::getSurveyType())] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' );
echo '</td></tr>';
- # vprašanj, variabel
+
+ # vprašanj, variabel
echo '<tr><td>';
echo $lang['srv_info_questions']. ':';
echo '</td><td>';
@@ -958,13 +1039,15 @@ class SurveyStatistic {
echo '</td><td>';
echo SurveyInfo::getSurveyVariableCount();
echo '</td></tr>';
- # stevilo strani
+
+ # stevilo strani
echo '<tr><td>';
echo $lang['srv_info_pages']. ':';
echo '</td><td>';
echo SurveyInfo::getSurveyGroupCount();
echo '</td></tr>';
- # uporabnikov, odgovorov
+
+ # uporabnikov, odgovorov
echo '<tr><td>';
echo $lang['srv_analiza_stUporabnikov']. ':';
echo '</td><td>';
@@ -974,32 +1057,51 @@ class SurveyStatistic {
echo '</td><td>';
echo SurveyInfo::getSurveyApropriateAnswersCount();
echo '</td></tr>';
- # jezik izpolnjevanja
+
+ # jezik izpolnjevanja
echo '<tr><td>';
echo $lang['srv_info_language']. ':';
echo '</td><td colspan="3" >';
echo SurveyInfo::getRespondentLanguage();
echo '</td></tr>';
- # autor
+
+ # autor
echo '<tr><td>';
echo $lang['srv_info_creator']. ':';
- echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyInsertEmail().'">';
- echo SurveyInfo::getSurveyInsertName();
+ // Demo anketa ima to fiksno
+ if(isDemoSurvey($this->surveyId)){
+ echo '</td><td colspan="3" title="1KA user">';
+ echo '1KA user, 1.1.24, 00:00';
+ echo '</td></tr>';
+ }
+ else{
+ echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyInsertEmail().'">';
+ echo SurveyInfo::getSurveyInsertName();
if (SurveyInfo::getSurveyInsertDate() && SurveyInfo::getSurveyInsertDate() != "00.00.0000")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyInsertDate(),DATE_FORMAT_SHORT);
if (SurveyInfo::getSurveyInsertTime() && SurveyInfo::getSurveyInsertTime() != "00:00:00")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyInsertTime(),TIME_FORMAT_SHORT);
- echo '</td></tr>';
- # spreminjal
+ echo '</td></tr>';
+ }
+
+ # spreminjal
echo '<tr><td>';
echo $lang['srv_info_modify']. ':';
- echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyEditEmail().'">';
- echo SurveyInfo::getSurveyEditName();
+ // Demo anketa ima to fiksno
+ if(isDemoSurvey($this->surveyId)){
+ echo '</td><td colspan="3" title="1KA user">';
+ echo '1KA user, 1.1.24, 00:00';
+ echo '</td></tr>';
+ }
+ else{
+ echo '</td><td colspan="3" title="'.SurveyInfo::getSurveyEditEmail().'">';
+ echo SurveyInfo::getSurveyEditName();
if (SurveyInfo::getSurveyEditDate() && SurveyInfo::getSurveyEditDate() != "00.00.0000")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyEditDate(),DATE_FORMAT_SHORT);
if (SurveyInfo::getSurveyEditTime() && SurveyInfo::getSurveyEditTime() != "00:00:00")
echo SurveyInfo::getDateTimeSeperator() . $this->dateFormat(SurveyInfo::getSurveyEditTime(),TIME_FORMAT_SHORT);
- echo '</td></tr>';
+ echo '</td></tr>';
+ }
#dostop, Kdo razen avtorja ima dostop
$dostop = SurveyInfo::getSurveyAccessUsers();
@@ -1016,28 +1118,31 @@ class SurveyStatistic {
echo '</td></tr>';
}
- # aktivnost
+
+ # aktivnost
$activity = SurveyInfo:: getSurveyActivity();
$_last_active = end($activity);
echo '<tr><td>';
echo $lang['srv_displaydata_status']. ':';
echo '</td><td colspan="3">';
if (SurveyInfo::getSurveyColumn('active') == 1) {
- echo '<span style="width:auto; color: green;">'.$lang['srv_anketa_active2'].'</span>';
- } else {
+ echo '<span class="active">'.$lang['srv_anketa_active2'].'</span>';
+ }
+ else {
# preverimo ali je bila anketa že aktivirana
if (!isset($_last_active['starts'])) {
# anketa še sploh ni bila aktivirana
- echo '<span style="width:auto; color:orange;">'.$lang['srv_survey_non_active_notActivated'].'</span>';
- } else {
+ echo '<span class="not_activated">'.$lang['srv_survey_non_active_notActivated'].'</span>';
+ }
+ else {
# anketa je že bila aktivirna ampak je sedaj neaktivna
- echo '<span style="width:auto; color:orange;">'.$lang['srv_survey_non_active'].'</span>';
+ echo '<span class="non_active">'.$lang['srv_survey_non_active'].'</span>';
}
}
-
echo '</td></tr>';
+
# trajanje: datumi aktivnosti
- if ( count($activity) > 0 ) {
+ if (is_countable($activity) && count($activity) > 0 ) {
echo '<tr><td>';
echo $lang['srv_info_activity']. ':';
echo '</td><td colspan="3">';
@@ -1048,31 +1153,44 @@ class SurveyStatistic {
echo $prefix.$_starts[2].'.'.$_starts[1].'.'.$_starts[0].'-'.$_expire[2].'.'.$_expire[1].'.'.$_expire[0];
- # echo $prefix . $this->dateFormat($active['starts'],DATE_FORMAT_SHORT).'-'.$this->dateFormat($active['expire'],DATE_FORMAT_SHORT);
$prefix = '; ';
}
echo '</td></tr>';
}
-
- # predviceni cas trajanja enkete
+
+ # Dejanski in predviceni cas trajanja enkete
$sas = new SurveyAdminSettings();
- $skupni_cas = $sas->testiranje_cas(1);
$skupni_predvideni_cas = $sas->testiranje_predvidenicas(1);
-
+
$d = new Dostop();
-
+
echo '<tr><td>';
echo $lang['srv_info_duration']. ':';
echo '</td><td colspan="3">';
- echo ($skupni_cas!=''?'<a href="index.php?anketa='.$this->surveyId.'&a='.A_REPORTI . '&m='.M_TESTIRANJE_CAS.'">':'').$skupni_cas.($skupni_cas!=''?'</a>, ':'');
- echo ''.$lang['srv_predvideno'].': ';
+ list($skupni_cas, $mediana) = $sas->testiranje_cas(2);
+
+ // Dejanski cas imamo samo ce imamo response
+ if($skupni_cas != ''){
+ echo ($skupni_cas != '' ? '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=cas">' : '').$skupni_cas.($mediana != '' ? '</a>' : '');
+
+ // Mediana
+ if($mediana != ''){
+ echo ' ('.$lang['median'].': ';
+ echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=cas">'.$mediana.'</a>)';
+ }
+
+ echo ', ';
+ }
+
+ // Predvideni cas imamo vedno
+ echo $lang['srv_predvideno'].': ';
+
if ($d->checkDostopSub('test'))
- echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=predvidenicas">';
- echo $skupni_predvideni_cas;
- if ($d->checkDostopSub('test'))
- echo '</a>';
+ echo '<a href="index.php?anketa='.$this->surveyId.'&a=testiranje&m=predvidenicas">'.$skupni_predvideni_cas.'</a>';
+ else
+ echo $skupni_predvideni_cas;
echo '</td></tr>';
@@ -1085,33 +1203,20 @@ class SurveyStatistic {
if ($prvi_vnos_date != null) {
echo '<tr><td>';
echo $lang['srv_info_first_entry']. ':';
- echo '</td><td '.( $zadnji_vnos_date == null ? 'colspan="3"' : '').'>';
+ echo '</td><td colspan="3">';
echo $this->dateFormat($prvi_vnos_date,DATE_FORMAT_SHORT);
echo $prvi_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->dateFormat($prvi_vnos_time,TIME_FORMAT_SHORT)) : '';
- echo '</td>';
+ echo '</td></tr>';
}
if ($zadnji_vnos_date != null) {
- echo '<td>';
+ echo '<tr><td>';
echo $lang['srv_info_last_entry']. ':';
- echo '</td><td '.( $prvi_vnos_date == null ? 'colspan="3"' : '').'>';
+ echo '</td><td colspan="3">';
echo $this->dateFormat($zadnji_vnos_date,DATE_FORMAT_SHORT);
echo $zadnji_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->dateFormat($zadnji_vnos_time,TIME_FORMAT_SHORT)) : '';
echo'</td></tr>';
}
-/*
- #linki - urejanje
- echo '<tr><td>';
- echo $lang['srv_stat_edit'] . ':';
- echo '</td><td colspan="3">';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->getSurveyId().'">' . $lang['srv_stat_edit_survey'] . '</a>,';
- echo ' <a href="index.php?anketa='.$this->getSurveyId().'&a=komentarji">'.$lang['comments'].'</a>';
- echo '</td></tr>';
-
- #linki - povezave
-
- */
-
list($commentsAll,$commentsUnresolved,$commentsQuestionAll,$commentsQuestionUnresolved,$commentsUser,$commentsUserFinished,$commentsUserSurveyAll,$commentsUserSurveyUnresolved) = $this->comments;
@@ -1156,98 +1261,259 @@ class SurveyStatistic {
echo '</table>';
}
+ /** Funkcija prikaže statuse
+ * KONČNI STATUSI
+ */
+ function DisplayStatusView() {
+ global $lang;
+
+ echo '<div class="box_title">';
+ echo $lang['srv_statistic_status_title'].' '.Help :: display('srv_statistic_status_title');
+ echo '</div>';
+
+ echo '<div class="box_top_settings">';
+ echo ' <input id="hideNullValues_status" name="hideNullValues_status" type="checkbox" onchange="statisticStatusRefresh(); return false;"'.($this->hideNullValues_status ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="hideNullValues_status">'.$lang['srv_statistic_hide_null'].Help::display('srv_status_koncni0').'</label>';
+ echo '</div>';
+
+
+ $cntValid = 0; // da vemo ali izpisemo skupne
+ $cntNonValid = 0; // da vemo ali izpisemo skupne
+ $cntInvitation = 0; // da vemo ali izpisemo skupne
+
+
+ echo '<table>';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_metric'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '</tr>';
+
+
+ foreach ($this->appropriateStatus as $status) {
+ if (!($this->hideNullValues_status && $this->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
+ echo '<tr>';
+ echo '<td>'. $lang['srv_userstatus_'.$status] . ' ('.$status.')</td>';
+ echo '<td>'. $this->userByStatus['valid'][$status].'</td>';
+ echo '</tr>';
+
+ $cntValid++;
+ }
+ }
+ // vsota vlejavnih
+ if ($cntValid > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_valid'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']).'</td>';
+ echo '</tr>';
+ }
+
+ // izpišemo še neveljavne
+ foreach ($this->unAppropriateStatus as $status) {
+ if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_userstatus_'.$status] . ' ('.$status.')</td>';
+ echo '<td>' . $this->userByStatus['nonvalid'][$status]
+ . ( ( isset($this->userByStatus['valid'][$status]) && $this->userByStatus['valid'][$status] > 0 )
+ ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
+ : '').'</td>';
+
+ echo '</tr>';
+
+ $cntNonValid++;
+ }
+ }
+
+ // vsota nevlejavnih
+ if ($cntNonValid > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_nonvalid'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['nonvalid']).'</td>';
+ echo '</tr>';
+ }
+
+ // Klikov na povezavo
+ SurveySetting::getInstance()->setSID($this->surveyId);
+ $view_count = SurveySetting::getInstance()->getSurveyMiscSetting('view_count');
+ if ($view_count == "") $view_count = 0;
+ if ($view_count > 0 || !$this->hideNullValues_status){
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_view'].'</td>';
+ echo '<td>'.($view_count).'</td>';
+ echo '</tr>';
+ }
+
+ // Vsota anketiranih
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum_surveyed'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']).'</td>';
+ echo '</tr>';
+
+ // Testni
+ if ((int)$this->testDataCount > 0) {
+ echo '<tr>';
+ echo '<td>('.$lang['srv_statistic_redirection_test'].')</td>';
+ echo '<td>'.((int)$this->testDataCount).'</td>';
+ echo '</tr>';
+ }
+
+
+ # preštejemo še neposlana vabila
+ $str = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id='".$this->getSurveyId()."' AND sent='0' AND deleted='0'";
+
+ $qry = sisplet_query($str);
+ list($cntUnsent) = mysqli_fetch_row($qry);
+ $this->userByStatus['invitation'][0] = (int)$cntUnsent;
+
+ # še email vabila
+ // ker izpade čudno, statusov email neposlan
+ if (count(array_filter($this->userByStatus['invitation'])) > 0 || !$this->hideNullValues_status){
+
+ echo '</tr>';
+ echo '<td>'.$lang['srv_statistic_nonsurveyed_title'].'</td>';
+ echo '<tr>';
+
+ foreach ($this->invitationStatus as $status){
+
+ if (!($this->hideNullValues_status && $this->userByStatus['invitation'][$status] == 0)) {// da ne delamo po neporebnem
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_email_status_'.$status].' ('.$status.')</td>';
+ echo '<td>'.$this->userByStatus['invitation'][$status].'</td>';
+ echo '</tr>';
+
+ $cntInvitation++;
+ }
+ }
+ }
+
+ // vsota emaili
+ if ($cntInvitation > 0 || !$this->hideNullValues_status) {
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_sum2'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['invitation']).'</td>';
+ echo '</tr>';
+ }
+
+
+ // Vsota vseh
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_sum_all'].'</td>';
+ echo '<td>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']+$this->cntUserByStatus['invitation']).'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+
+
+ // Uporabnost respondentov
+ $sur = new SurveyUsableResp($this->surveyId, $generateDatafile=false);
+ if($sur->hasDataFile()){
+ $usability = $sur->calculateData();
+
+ echo '<table id="tbl_answ_usability">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_usability'].' ('.$sur->bottom_usable_limit.'%/'.$sur->top_usable_limit.'%)</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_usableResp_usable_unit'].'</td>';
+ echo '<td>'.$usability['usable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['usable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_usableResp_partusable_unit'].'</td>';
+ echo '<td>'.$usability['partusable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['partusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '<tr><td>'.$lang['srv_usableResp_unusable_unit'].'</td>';
+ echo '<td>'.$usability['unusable'].'</td>';
+ if($usability['all'] > 0)
+ echo '<td>'.$this->formatNumber($usability['unusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
+ else
+ echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+ }
+ }
+
/** Funkcija prikaže statuse odgovorov
*
*/
- function DisplayAnswerStateView() {
+ function DisplayAnswerStateView() {
global $lang;
if ($this->emailInvitation == 1) {
$order = array('email','3ll','4ll','5ll',5,6);
- } else {
+ }
+ else {
$order = array('3ll','4ll','5ll',5,6);
}
+
if(true) {
$this->realUsersByStatus[0]['cnt'] = $this->cntUserByStatus['invitation'];
}
- echo '<div class="floatLeft"><span class="dashboard_title">'.$lang['srv_statistic_answer_state_title'].'</span>'.Help :: display('srv_statistic_answer_state_title');
- echo '</div>';
- echo '<div class="floatRight">'.$lang['srv_statistic_answer_state_base'].': ';
- echo '<select id="userStatusBase" onchange="changeUserStatusBase()">';
+
+
+ echo '<div class="box_title">'.$lang['srv_statistic_answer_state_title'].' '.Help :: display('srv_statistic_answer_state_title').'</div>';
+
+ echo '<div class="box_top_settings">';
+ echo $lang['srv_statistic_answer_state_base'].': ';
+ echo '<select id="userStatusBase" class="dropdown small" onchange="changeUserStatusBase()">';
foreach ($order as $key) {
echo '<option '.($this->realUsersByStatus_base.'' == $key.'' ? ' selected="selected"' : '').' value="'.$key.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
echo '</select>';
echo '</div>';
- echo '<br class="clr"/>';
- echo '<br />';
- echo '<table id="tbl_answ_state">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_status'].'</strong></th><td><strong>'.$lang['srv_statistic_answer_state_frequency'].'</strong></td><td><strong>'.$lang['srv_statistic_answer_state_percent'].'</strong></td></tr>';
- foreach ($order as $key) {
+
+ echo '<table id="tbl_answ_state">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_status'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ foreach ($order as $key) {
+
if ($this->realUsersByStatus_base == $key) {
$base_found = true;
}
- echo '<tr><th>'.$lang['srv_userstatus_'.$key].'</th>';
+
+ echo '<tr>';
+
+ echo '<td>'.$lang['srv_userstatus_'.$key].'</td>';
+
#frekvenca
echo '<td>'.($this->realUsersByStatus[$key]['cnt'] > 0 ? $this->realUsersByStatus[$key]['cnt'] : '0').'</td>';
- #procenti
- ;
+
+ #procenti
echo '<td>';
- #echo ( (float)$this->realUsersByStatus[$key]['percent'] > 1.0)
echo ( $base_found == false)
? '--'
: $this->formatNumber($this->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%');
echo '</td>';
- echo '</tr>';
- }
- echo '</table>';
-
-
- echo '<br />';
-
-
- // Uporabnost respondentov
- $sur = new SurveyUsableResp($this->surveyId, $generateDatafile=false);
- if(!$sur->hasDataFile())
- echo '<br />';
-// echo $lang['srv_dashboard_no_file'].'<br /><br />';
- else{
- $usability = $sur->calculateData();
- echo '<table id="tbl_answ_usability">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_usability'].' ('.$sur->bottom_usable_limit.'%/'.$sur->top_usable_limit.'%)</strong></th><td><strong>'./*$lang['srv_statistic_answer_state_frequency'].*/'</strong></td><td><strong>'./*$lang['srv_statistic_answer_state_percent'].*/'</strong></td></tr>';
+ echo '</tr>';
+ }
- echo '<tr><th>'.$lang['srv_usableResp_usable_unit'].'</th>';
- echo '<td>'.$usability['usable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['usable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
-
- echo '<tr><th>'.$lang['srv_usableResp_partusable_unit'].'</th>';
- echo '<td>'.$usability['partusable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['partusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
-
- echo '<tr><th>'.$lang['srv_usableResp_unusable_unit'].'</th>';
- echo '<td>'.$usability['unusable'].'</td>';
- if($usability['all'] > 0)
- echo '<td>'.$this->formatNumber($usability['unusable']/$usability['all']*100, NUM_DIGIT_PERCENT, '%').'</td>';
- else
- echo '<td>'.$this->formatNumber(0, NUM_DIGIT_PERCENT, '%').'</td>';
- echo '</tr>';
+ echo '</table>';
- echo '</table>';
-
- echo '<br />';
- }
-
+
// Breakoffi
$status3 = (isset($this->userByStatus['nonvalid']['3'])) ? $this->userByStatus['nonvalid']['3'] : 0;
$status4 = (isset($this->userByStatus['nonvalid']['4'])) ? $this->userByStatus['nonvalid']['4'] : 0;
@@ -1255,13 +1521,21 @@ class SurveyStatistic {
$status5l = (isset($this->userByStatus['nonvalid']['5l'])) ? $this->userByStatus['nonvalid']['5l'] : 0;
$status6 = (isset($this->userByStatus['valid']['6'])) ? $this->userByStatus['valid']['6'] : 0;
$all = (isset($this->realUsersByStatus['3ll']['cnt'])) ? $this->realUsersByStatus['3ll']['cnt'] : 0;
- if($all > 0){
+
+ if($all > 0){
+
echo '<table id="tbl_answ_breakoff">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_answer_state_breakoff'].'</strong></th><td><strong>'./*$lang['srv_statistic_answer_state_frequency'].*/'</strong></td><td><strong>'./*$lang['srv_statistic_answer_state_percent'].*/'</strong></td></tr>';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
$introBreakoff = $status3 + $status4;
$introBreakoffPercent = $introBreakoff / $all;
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_1'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_1'].'</td>';
echo '<td>'.$introBreakoff.'</td>';
echo '<td>'.$this->formatNumber($introBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').'</td>';
echo '</tr>';
@@ -1270,14 +1544,16 @@ class SurveyStatistic {
$qBreakoffPercent = $qBreakoff / $all;
if(($all - $status3 - $status4) > 0)
$qBreakoffNeto = $qBreakoff / ($all - $status3 - $status4);
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_2'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_2'].'</td>';
echo '<td>'.$qBreakoff.'</td>';
echo '<td>'.$this->formatNumber($qBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').' (neto '.$this->formatNumber($qBreakoffNeto*100, NUM_DIGIT_PERCENT, '%').')</td>';
echo '</tr>';
$totalBreakoff = $status3 + $status4 + $status5 + $status5l;
$totalBreakoffPercent = $totalBreakoff / $all;
- echo '<tr><th>'.$lang['srv_statistic_answer_state_breakoff_3'].'</th>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_statistic_answer_state_breakoff_3'].'</td>';
echo '<td>'.$totalBreakoff.'</td>';
echo '<td>'.$this->formatNumber($totalBreakoffPercent*100, NUM_DIGIT_PERCENT, '%').'</td>';
echo '</tr>';
@@ -1372,262 +1648,160 @@ class SurveyStatistic {
}
return $json_array;
- }
-
- /** Funkcija prikaže statuse
- * KONČNI STATUSI
- */
- function DisplayStatusView() {
- global $lang;
-
- echo '<span class="floatLeft dashboard_title">'.$lang['srv_statistic_status_title'].Help :: display('srv_statistic_status_title');
- echo '</span>';
-
- echo '<span class="floatRight">';
- echo $lang['srv_statistic_hide_null'];
- echo '<input id="hideNullValues_status" name="hideNullValues_status" type="checkbox" onchange="statisticStatusRefresh(); return false;"'.($this->hideNullValues_status ? ' checked="checked"' : '').' autocomplete="off">';
- echo '</span>';
-
- echo '<br class="clr"/><br/>';
-
- $cntValid = 0; // da vemo ali izpisemo skupne
- $cntNonValid = 0; // da vemo ali izpisemo skupne
- $cntInvitation = 0; // da vemo ali izpisemo skupne
- foreach ($this->appropriateStatus as $status) {
- if (!($this->hideNullValues_status && $this->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['valid'][$status].'<br/>';
- $cntValid++;
- }
- }
- // vsota vlejavnih
- if ($cntValid > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_valid'].'</span>'.($this->cntUserByStatus['valid']).'<br/></div><br/>';
- }
-
- // izpišemo še neveljavne
- foreach ($this->unAppropriateStatus as $status) {
- if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['nonvalid'][$status]
- . ( ( $index <= 2 && $this->userByStatus['valid'][$status] > 0 )
- ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
- : '')
- . '<br/>';
- $cntNonValid++;
- }
- }
- // se status null (neznan status)
- /*if (!($this->hideNullValues_status && $this->userByStatus['nonvalid'][-1] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_userstatus_null'] . ' (null) :</span>' . (isset($this->userByStatus['nonvalid'][-1]) ? $this->userByStatus['nonvalid'][-1] : '0') . '<br/>';
- $cntNonValid++;
- }*/
-
- // vsota nevlejavnih
- if ($cntNonValid > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_nonvalid'].'</span>'.($this->cntUserByStatus['nonvalid']).'<br></div><br/>';
- }
-
- // Klikov na povezavo
- SurveySetting::getInstance()->setSID($this->surveyId);
- $view_count = SurveySetting::getInstance()->getSurveyMiscSetting('view_count');
- if ($view_count == "") $view_count = 0;
- if ($view_count > 0 || !$this->hideNullValues_status)
- echo '<div class="full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_view'].'</span>'.($view_count).'<br /><br /></div>';
-
- // Vsota anketiranih
- echo '<div class="anl_dash_bt full strong "><span class="dashboard_status_span">'.$lang['srv_statistic_redirection_sum_surveyed'].'</span>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']).'<br></div>';
- // Testni
- if ((int)$this->testDataCount > 0) {
- echo '<div class="full"><span class="dashboard_status_span">('.$lang['srv_statistic_redirection_test'].')</span>'.((int)$this->testDataCount).'<br></div>';
- }
-
- echo '<br class="clr"/>';
-
-
- # preštejemo še neposlana vabila
- $str = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id='".$this->getSurveyId()."' AND sent='0' AND deleted='0'";
-
- $qry = sisplet_query($str);
- list($cntUnsent) = mysqli_fetch_row($qry);
- $this->userByStatus['invitation'][0] = (int)$cntUnsent;
-
- # še email vabila
- // ker izpade čudno, statusov email neposlan
- if (count(array_filter($this->userByStatus['invitation'])) > 0 || !$this->hideNullValues_status){
-
- echo '<span class="floatLeft strong">'.$lang['srv_statistic_nonsurveyed_title'];
- echo '</span>';
- echo '<br class="clr"/>';
-
- foreach ($this->invitationStatus as $status)
- {
- if (!($this->hideNullValues_status && $this->userByStatus['invitation'][$status] == 0)) {// da ne delamo po neporebnem
- echo '<span class="dashboard_status_span">' . $lang['srv_statistic_email_status_'.$status] . ' ('.$status.') :</span>' . $this->userByStatus['invitation'][$status]
- #. ( ( $status <= 2 && $this->userByStatus['invitation'][$status] > 0 )
- # ? '&nbsp;<a href="#" onclick="survey_statistic_status(\''.$status.'\')">'.$lang['srv_statistic_detail'].'</a>'
- # : '')
- . '<br/>';
- $cntInvitation++;
- }
- }
- }
-
- // vsota emaili
- if ($cntInvitation > 0 || !$this->hideNullValues_status) {
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_sum2'].'</span>'.($this->cntUserByStatus['invitation']).'<br/></div><br/>';
- }
-
-
- // Vsota vseh
- echo '<div class="anl_dash_bt full strong"><span class="dashboard_status_span">'.$lang['srv_statistic_sum_all'].'</span>'.($this->cntUserByStatus['valid']+$this->cntUserByStatus['nonvalid']+$this->cntUserByStatus['invitation']).'<br></div>';
- }
-
+ }
+
/** Funkcija za prikaz referalov
* #KLIK NA ANKETO#
* #PREUSMERITVE#
*/
- function DisplayReferalsView() {
+ function DisplayReferalsView() {
global $lang;
global $admin_type;
- echo '<div><span class="dashboard_title">'.$lang['srv_statistic_redirection_title'].'</span>'.Help :: display('srv_statistic_redirection_title').'</div>';
+ echo '<div class="box_title">'.$lang['srv_statistic_redirection_title'].' '.Help :: display('srv_statistic_redirection_title').'</div>';
// izrisemo graf
if ( ( $this->cntValidRedirections + $this->cntNonValidRedirections ) > 0) {
$maxValue = $this->maxRedirection * GRAPH_REDUCE;
$value_sum = 0;
- echo '<table class="survey_referals_tbl">'."\n";
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_site'] . '</strong></th>'."\n";
- echo '<td class="anl_ar"><strong>'.$lang['srv_statistic_redirection_click'].'</strong></td>'."\n";
- echo '</tr>'."\n";
+ echo '<table class="survey_referals_tbl">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_redirection_site'].'</td>';
+ echo '<td>'.$lang['srv_statistic_redirection_click'].'</td>';
+ echo '</tr>';
if (count($this->userRedirections["valid"])) {
foreach ($this->userRedirections["valid"] as $key => $value) {
if ($key == 'email')
{
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email'] . '</th>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_email'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
}
else
{
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $key . '</th>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $key . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
}
$value_sum += $value;
}
}
+
// dodamo še direktni link
if ($this->userRedirections["direct"] > 0) {
$value = $this->userRedirections["direct"];
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_direct'] . '</th>'."\n";
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_direct'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
+
$value_sum += $value;
- }
+ }
+
// dodamo še email klik
- // @Uros to je identicno, kot zgoraj v foreach, na koncu se gleda rezultat iz valid...se to sploh rabi?
+ // @Uros to je identicno, kot zgoraj v foreach, na koncu se gleda rezultat iz valid...se to sploh rabi?
if ($this->userRedirections["email"] > 0) {
$value = $this->userRedirections["email"];
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email'] . '</th>'."\n";
+
+ echo '<tr>';
+
+ echo '<td>' . $lang['srv_statistic_redirection_email'] . '</td>';
+
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
+
$value_sum += $value;
}
+
// dodamo sumo
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum_clicked'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.$value_sum.'</td>'."\n";
- echo '</tr>'."\n";
- echo '<tr class="">'."\n";
- echo '<th colspan="2">&nbsp;</th>'."\n";
- echo '</tr>'."\n";
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum'].'</td>';
+ echo '<td>'.$value_sum.'</td>';
+ echo '</tr>';
- /*
- // dodamo se neveljavne
- $value_sum_nonvalid = 0;
- for ($key = 2; $key >= 0; $key--) {
- $value = $this->userRedirections["$key"];
- if ($value > 0) {
- echo '<tr>'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;">' . $lang['srv_statistic_redirection_email_'.$key] . '</th>'."\n";
- $width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_ly" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
- $value_sum_nonvalid += $value;
- }
- }
- // dodamo sumo
- if ($value_sum_nonvalid > 0 ) {
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum_nonvalid'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.$value_sum_nonvalid.'</td>'."\n";
- echo '</tr>'."\n";
- echo '<tr class="">'."\n";
- echo '<th colspan="2">&nbsp;</th>'."\n";
- echo '</tr>'."\n";
- }
- */
- if (!($value_sum_nonvalid == 0 || $value_sum == 0 )) {
- echo '<tr class="anl_dash_bt strong">'."\n";
- echo '<th style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum'] . '</strong></th>'."\n";
- echo '<td style="text-align:left">'.($value_sum+$value_sum_nonvalid).'</td>'."\n";
- echo '</tr>'."\n";
- }
- echo '</table>'."\n";
+ echo '</table>';
- echo '<div id="referal_detail"><span class="dashboard_title">'.$lang['srv_statistic_details'].'</span></div>';
+
+ echo '<div id="referal_detail">';
+
+ echo '<span class="dashboard_title">'.$lang['srv_statistic_details'].'</span>';
+
if ($this->cntValidRedirections > 0) {
- echo '<div class="spaceLeft"><a href="#" onclick="survey_statistic_referal(this); return false;" value="0" title="'.$lang['srv_statistic_detail_referal'].'">'.$lang['srv_statistic_detail_referal'].'</a></div>';
- } else {
- echo '<div class="spaceLeft">'.$lang['srv_statistic_show_no_referals'].'</div>';
+ echo '<span><a href="#" onclick="survey_statistic_referal(this); return false;" value="0" title="'.$lang['srv_statistic_detail_referal'].'">'.$lang['srv_statistic_detail_referal'].'</a></span>';
+ }
+ else {
+ echo '<span>'.$lang['srv_statistic_show_no_referals'].'</span>';
}
- echo '<div class="spaceLeft"><a href="#" onclick="ip_list_podrobno(this); return false;" value="0" title="'.$lang['srv_statistic_detail_IP'].'">'.$lang['srv_statistic_detail_IP'].'</a></div>';
- }
-/*
- #echo '<div><p><strong>'.$lang['srv_count_ip_list'].': '.count($this->ip_list).'</strong></p></div>';
- echo '<div><p><strong>'.$lang['srv_detail_ip_list'].': </strong></p></div>';
- echo '<p>&nbsp;<a href="#" onclick="ip_list_podrobno(this); return false;" value="0">'.$lang['srv_statistic_detail'].'</a></p>';
-*/
- # skrita div aza podrobnosti
- echo '<div id="survey_referals" class="displayNone"></div>';
- echo '<div id="ip_list_podrobno" class="displayNone"></div>';
+
+ echo '<span><a href="#" onclick="ip_list_podrobno(this); return false;" value="0" title="'.$lang['srv_statistic_detail_IP'].'">'.$lang['srv_statistic_detail_IP'].'</a></span>';
+
+ # skrita div aza podrobnosti
+ echo '<div id="survey_referals" style="display:none;"></div>';
+ echo '<div id="ip_list_podrobno" style="display:none;"></div>';
+
+ echo '</div>';
+ }
}
/** Funkcija za prikaz klikov po straneh
*
*/
- function DisplayPagesStateView() {
+ function DisplayPagesStateView() {
global $lang;
# ali lovimo samo strani ki niso bile preskočene
$grupa_jump = "AND ug.preskocena = 0 ";
- echo '<span class="dashboard_title">'.$lang['srv_statistic_pages_state_title'].'</span>'.Help :: display('srv_statistic_pages_state_title');
+ echo '<div class="box_title">'.$lang['srv_statistic_pages_state_title'].' '.Help :: display('srv_statistic_pages_state_title').'</div>';
+
+ echo '<div class="box_top_settings">';
+
// Filter po osnovi
if ($this->emailInvitation == 1) {
$order = array('email','3ll','4ll','5ll',5,6);
- } else {
+ }
+ else {
$order = array('3ll','4ll','5ll',5,6);
}
- echo '<div class="floatRight">'.$lang['srv_statistic_answer_state_base'].': ';
- echo '<select id="pageUserStatusBase" onchange="changePageUserStatusBase()">';
+
+ echo $lang['srv_statistic_answer_state_base'].': ';
+ echo '<select id="pageUserStatusBase" class="dropdown small" onchange="changePageUserStatusBase()">';
foreach ($order as $key) {
echo '<option '.($this->pageUsersByStatus_base.'' == $key.'' ? ' selected="selected"' : '').' value="'.$key.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
echo '</select>';
+
echo '</div>';
+
$status_filter_string = '';
switch($this->pageUsersByStatus_base){
@@ -1655,15 +1829,16 @@ class SurveyStatistic {
$status_filter_string = "AND u.last_status='6' AND u.lurker='0'";
break;
}
-
- echo '<br class="clr">';
-
+
$pages=array();
$maxValue = 0;
+
+ $email_filter_string = '';
if ($this->emailInvitation > 0) {
if ($this->emailInvitation == 1) {
$email_filter_string = ' AND inv_res_id is not NULL ';
- } else if($this->emailInvitation == 2) {
+ }
+ else if($this->emailInvitation == 2) {
$email_filter_string = ' AND inv_res_id is NULL ';
}
}
@@ -1683,66 +1858,77 @@ class SurveyStatistic {
$maxValue = max($maxValue, $this->realUsersByStatus['3ll']['cnt']);
$maxValue = $maxValue * GRAPH_REDUCE;
- echo '<table class="survey_referals_tbl">'."\n";
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;"><strong>' . $lang['srv_statistic_answer_state_status'] . '</strong></th>'."\n";
- echo '<td class="anl_ar"><strong>'.$lang['srv_statistic_redirection_click'].'</strong></td>'."\n";
- echo '</tr>'."\n";
+
+ echo '<table class="survey_referals_tbl">';
+
+ echo '<tr class="row1">';
+ echo '<td>'.$lang['srv_statistic_answer_state_status'].'</td>';
+ echo '<td>'.$lang['srv_statistic_redirection_click'].'</td>';
+ echo '</tr>';
# status 3 - "Klik na anketo"
$value = $this->realUsersByStatus['3ll']['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_3'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_3'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
# status 4 - "Klik na prvo stran"
$value = $this->realUsersByStatus['4ll']['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_4'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_4'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
# status 5 - "Za&#269;el izpolnjevati",
$value = $this->realUsersByStatus[5]['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_5'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_5'] . '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
#strani
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td></td>';
+ echo '</tr>';*/
foreach ($pages as $key => $page) {
$value = $page['cnt'];
- echo '<tr>'."\n";
- //echo '<th style="width: 10pt;">' . $page['naslov'] . '</th>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_stran'].' '.$page['vrstni_red']. '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_stran'].' '.$page['vrstni_red']. '</td>';
$width = ($maxValue && $value) ? (round($value / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+ echo '</tr>';
}
#strani
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td</td>';
+ echo '</tr>';*/
# status 6 - "Koncal",
$value6 = $this->realUsersByStatus[6]['cnt'];
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_6'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_6'] . '</td>';
$width = ($maxValue && $value6) ? (round($value6/ $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value6.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value6.'</span>';
+ echo '</td>';
+ echo '</tr>';
#če imamo lurkerje 6l dodamo skupaj konačal anketo (to je 6 + 6l) in nato še koliko jih je samo s statusom 6 (končal anketo)
# status 6l - "Koncal - lurker", izpišemo samo če obstajajo 6l
@@ -1751,28 +1937,31 @@ class SurveyStatistic {
$valueall = $this->realUsersByStatus['6ll']['cnt'] ;
# končal s tem da je lurker (6l)
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_6l'].'' . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_6l'].'' . '</td>';
$width = ($maxValue && $lurkerjev) ? (round($lurkerjev / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$lurkerjev.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$lurkerjev.'</span>';
+ echo '</td>';
+ echo '</tr>';
#črta
- echo '<tr class="anl_dash_bb">'."\n";
- echo '<th style="width:10pt;">' . $lang[''] . '</th>'."\n";
- echo '<td style="text-align:center">'.$lang[' '].'</td>'."\n";
- echo '</tr>'."\n";
+ /*echo '<tr>';
+ echo '<td></td>';
+ echo '<td></td>';
+ echo '</tr>';*/
# končal ne glede na to ali je lurker
- echo '<tr>'."\n";
- echo '<th style="width: 10pt;">' . $lang['srv_userstatus_all'] . '</th>'."\n";
+ echo '<tr>';
+ echo '<td>' . $lang['srv_userstatus_all'] . '</td>';
$width = ($maxValue && $valueall) ? (round($valueall / $maxValue * 100, 0)) : "0";
- echo '<td><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$valueall.'</span></td>'."\n";
- echo '</tr>'."\n";
-
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$valueall.'</span>';
+ echo '</td>';
+ echo '</tr>';
}
- echo '</table>'."\n";
+ echo '</table>';
}
/** Funkcija za prikaz seznam referalov
@@ -1788,9 +1977,7 @@ class SurveyStatistic {
$email_filter_string = ' AND inv_res_id is NULL ';
}
}
-
- echo '<br/><div class="dashboard_title">'.$lang['srv_statistic_referals_list'].Help :: display('srv_statistic_referals_list').'</div>';
-
+
// še podatke o uporabniku
$sql_userInfo = sisplet_query("SELECT referer, COUNT(*) as cnt FROM srv_user WHERE ank_id = '".$this->getSurveyId()."' AND preview = '0' AND deleted='0' AND time_insert BETWEEN '".$this->startDate."' AND '".$this->endDate."' + INTERVAL 1 ".$email_filter_string ." DAY GROUP BY referer");
if (mysqli_num_rows($sql_userInfo) > 0) {
@@ -1805,7 +1992,8 @@ class SurveyStatistic {
}
}
echo '</table>';
- } else {
+ }
+ else {
echo $lang['srv_statistic_show_no_referals'];
}
}
@@ -1827,10 +2015,8 @@ class SurveyStatistic {
# IP-je lovimo preko ajaxa
$string_sql = "SELECT COUNT(id) AS count, ip FROM srv_user WHERE ank_id='".$this->getSurveyId()."' AND preview = '0' AND deleted='0' AND (time_insert BETWEEN '".$this->startDate."' AND '".$this->endDate."' + INTERVAL 1 DAY) ".$email_filter_string." GROUP BY ip ORDER BY count DESC, ip ASC";
$sql = sisplet_query($string_sql);
-
- echo '<br/><div class="dashboard_title">'.$lang['srv_statistic_IP_list'].Help :: display('srv_statistic_IP_list').'</div>';
- if (mysqli_num_rows($sql) > 0) {
- #echo '<div class="dashboard_title">'.$lang[''].'</div>';
+
+ if (mysqli_num_rows($sql) > 0) {
echo '<table>';
while ($row = mysqli_fetch_array($sql)) {
@@ -1885,34 +2071,41 @@ class SurveyStatistic {
function DisplayFilters () {
global $lang;
+ echo '<div class="box_top_settings">';
+
// Kumulativa
- echo '<span class="floatRight" style="display:inline-block; vertical-align: middle;">';
- echo $lang['srv_statistic_hide_null'];
- echo '<input id="hideNullValues_dates" name="hideNullValues_dates" type="checkbox" onclick="statisticFilterDateRefresh();"'.($this->hideNullValues_dates ? ' checked="checked"' : '').' autocomplete="off">';
- echo '</span>';
+ echo '<div>';
+ echo ' <input id="hideNullValues_dates" name="hideNullValues_dates" type="checkbox" onclick="statisticFilterDateRefresh();"'.($this->hideNullValues_dates ? ' checked="checked"' : '').' autocomplete="off">';
+ echo ' <label for="hideNullValues_dates">'.$lang['srv_statistic_hide_null'].Help::display('srv_status_cas0').'</label>';
+ echo '</div>';
// Skrij 0
- echo '<span class="floatRight" style="display:inline-block; margin-right:10px; vertical-align: middle;">';
- echo '<label for="timelineDropDownType" autocomplete="off">'.$lang['srv_statistic_kumulativa'].': </label>';
- echo '<input type="checkbox" id="timelineDropDownType" name="timelineDropDownType" value="0" '.($this->timelineDropDownType == 1 ? ' checked="checked"' : '').' autocomplete="off" style="margin:0px!important;" onclick="statisticDropdownChange();" >';
- echo '</span>';
-
- echo '<br class="clr"/>';
+ echo '<div>';
+ echo ' <input type="checkbox" id="timelineDropDownType" name="timelineDropDownType" value="0" '.($this->timelineDropDownType == 1 ? ' checked="checked"' : '').' autocomplete="off" style="margin:0px!important;" onclick="statisticDropdownChange();" >';
+ echo ' <label for="timelineDropDownType" autocomplete="off">'.$lang['srv_statistic_kumulativa'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
+
+ echo '<div class="box_top_settings">';
+
// Osnova
- echo '<span id="span_timelineDropDownType" class="floatLeft">';
+ echo '<div id="span_timelineDropDownType">';
$this->DisplayTimelineDropdowns();
- echo '</span>';
+ echo '</div>';
// Oblika
- echo '<span class="floatRight">';
- echo '<label>'.$lang['srv_statistic_period'].'</label>:'."\n";
- echo '<select id="period" name="period" size="1" onchange="statisticFilterDateRefresh();" autocomplete="off" >'."\n";
+ echo '<div>';
+ echo $lang['srv_statistic_period'].':';
+ echo ' <select id="period" name="period" class="dropdown small" size="1" onchange="statisticFilterDateRefresh();" autocomplete="off" >';
foreach ( $this->periods as $key => $_period) {
- echo '<option value="' . $_period . '" ' . ( $_period == $this->period ? ' selected="selected" ' : '') . '>'.$lang['srv_statistic_period_' . $_period ].'</option>'."\n";
+ echo ' <option value="' . $_period . '" ' . ( $_period == $this->period ? ' selected="selected" ' : '') . '>'.$lang['srv_statistic_period_' . $_period ].'</option>';
}
- echo '</select>'."\n";
- echo '</span>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '</div>';
}
function DisplayTimelineDropdowns() {
@@ -1921,25 +2114,25 @@ class SurveyStatistic {
echo $lang['srv_statistic_answer_state_base'].': ';
if ($this->timelineDropDownType == 0) {
- echo '<select name="type" id="type" onchange="statisticFilterDateRefresh();" autocomplete="off">'."\n";
+ echo '<select name="type" id="type" class="dropdown small" onchange="statisticFilterDateRefresh();" autocomplete="off">';
echo '<option value="'.TYPE_ALL.'"' . ($this -> type == TYPE_ALL ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_userstatus_total'].'</option>';
echo '<option value="'.TYPE_APPROPRIATE.'"' . ($this -> type == TYPE_APPROPRIATE ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_userstatus_appropriate'].'</option>';
- echo '<option value="'.TYPE_STATUS_6.'"' . ($this -> type == TYPE_STATUS_6 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6'].' (6)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_5.'"' . ($this -> type == TYPE_STATUS_5 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5'].' (5)</option>'."\n";
+ echo '<option value="'.TYPE_STATUS_6.'"' . ($this -> type == TYPE_STATUS_6 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6'].' (6)</option>';
+ echo '<option value="'.TYPE_STATUS_5.'"' . ($this -> type == TYPE_STATUS_5 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5'].' (5)</option>';
echo '<option value="'.TYPE_INAPPROPRIATE.'"' . ($this -> type == TYPE_INAPPROPRIATE ? ' selected' : '') . 'class="opt_bold">'.$lang['srv_userstatus_inappropriate'].'</option>';
- echo '<option value="'.TYPE_STATUS_6l.'"' . ($this -> type == TYPE_STATUS_6l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6l'].' (6l)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_5l.'"' . ($this -> type == TYPE_STATUS_5l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5l'].' (5l)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_4.'"' . ($this -> type == TYPE_STATUS_4 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_4'].' (4)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_3.'"' . ($this -> type == TYPE_STATUS_3 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_3'].' (3)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_2.'"' . ($this -> type == TYPE_STATUS_2 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_2'].' (2)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_1.'"' . ($this -> type == TYPE_STATUS_1 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_1'].' (1)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_0.'"' . ($this -> type == TYPE_STATUS_0 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_0'].' (0)</option>'."\n";
- echo '<option value="'.TYPE_STATUS_NULL.'"' . ($this -> type == TYPE_STATUS_NULL ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_null'].' (-1)</option>'."\n";
- echo '<option value="'.TYPE_PAGES.'"' . ($this -> type == TYPE_PAGES ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_strani'].'</option>'."\n";
- echo '<option value="'.TYPE_ANALYSIS.'"' . ($this -> type == TYPE_ANALYSIS ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_analiza'].'</option>'."\n";
+ echo '<option value="'.TYPE_STATUS_6l.'"' . ($this -> type == TYPE_STATUS_6l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_6l'].' (6l)</option>';
+ echo '<option value="'.TYPE_STATUS_5l.'"' . ($this -> type == TYPE_STATUS_5l ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_5l'].' (5l)</option>';
+ echo '<option value="'.TYPE_STATUS_4.'"' . ($this -> type == TYPE_STATUS_4 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_4'].' (4)</option>';
+ echo '<option value="'.TYPE_STATUS_3.'"' . ($this -> type == TYPE_STATUS_3 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_3'].' (3)</option>';
+ echo '<option value="'.TYPE_STATUS_2.'"' . ($this -> type == TYPE_STATUS_2 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_2'].' (2)</option>';
+ echo '<option value="'.TYPE_STATUS_1.'"' . ($this -> type == TYPE_STATUS_1 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_1'].' (1)</option>';
+ echo '<option value="'.TYPE_STATUS_0.'"' . ($this -> type == TYPE_STATUS_0 ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_0'].' (0)</option>';
+ echo '<option value="'.TYPE_STATUS_NULL.'"' . ($this -> type == TYPE_STATUS_NULL ? ' selected' : '') . '>&nbsp;&nbsp;'.$lang['srv_userstatus_null'].' (-1)</option>';
+ echo '<option value="'.TYPE_PAGES.'"' . ($this -> type == TYPE_PAGES ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_strani'].'</option>';
+ echo '<option value="'.TYPE_ANALYSIS.'"' . ($this -> type == TYPE_ANALYSIS ? ' selected' : '') . ' class="opt_bold">'.$lang['srv_diagnostics_analiza'].'</option>';
- echo '</select>'."\n";
+ echo '</select>';
}
else {
$order = array(
@@ -1948,7 +2141,7 @@ class SurveyStatistic {
'5ll'=>TYPE_STATUS_KUMULATIVE_5ll,
5=>TYPE_STATUS_KUMULATIVE_5,
6=>TYPE_STATUS_KUMULATIVE_6,);
- echo '<select name="type" id="type" onchange="statisticFilterDateRefresh();" autocomplete="off">'."\n";
+ echo '<select name="type" id="type" class="dropdown small" onchange="statisticFilterDateRefresh();" autocomplete="off">';
foreach ($order as $key => $value) {
echo '<option value="'.$value.'" '.($this -> type .'' == $value.'' ? ' selected="selected"' : '').' value="'.$value.'" >'.$lang['srv_userstatus_'.$key].'</option>';
}
@@ -1965,34 +2158,39 @@ class SurveyStatistic {
$this->maxValue *= GRAPH_REDUCE;
$cnt=0;
- echo '<table class="survey_referals_tbl">'."\n";
+ echo '<table class="survey_referals_tbl">';
if ($this->arrayRange) {
foreach ($this->arrayRange as $key => $value) {
$label = $this->formatStatsString($key, $this->period);
- echo '<tr>'."\n";
- echo '<td style="width:90px;">' . $label . '</td>'."\n";
+ echo '<tr>';
+
+ echo '<td>' . $label . '</td>';
+
$width = ($this->maxValue && $value) ? (round($value / $this->maxValue * 100, 0)) : "0";
- echo '<td style=""><div class="graph_db" style="text-align:right; float:left; width:'.$width.'%">&nbsp;</div><span style="display:block; margin:auto; margin-left:5px; width:20px; float:left">'.$value.'</span></td>'."\n";
- echo '</tr>'."\n";
+ echo '<td><div class="graph_db" style="width:'.$width.'%">&nbsp;</div>';
+ echo '<span class="graph_text">'.$value.'</span>';
+ echo '</td>';
+
+ echo '</tr>';
$cnt+=$value;
}
// dodamo sumo
- echo '<tr >'."\n";
- echo '<th class="anl_dash_bt strong" style="width:'.($this->maxCharRedirection+2).'pt;"><strong>' . $lang['srv_statistic_redirection_sum'] . '</strong></th>'."\n";
- echo '<td class="anl_dash_bt strong" style="text-align:left">'.$cnt.' </td>'."\n";
- echo '</tr>'."\n";
+ echo '<tr class="row_sum">';
+ echo '<td>'.$lang['srv_statistic_redirection_sum'].'</td>';
+ echo '<td>'.$cnt.' </td>';
+ echo '</tr>';
}
else {
- echo '<td style="width:70%"><div style="background-color:#EFF2F7; border-left:1px solid #B9C5D9;">'.$lang['srv_no_data'].'</div></td>'."\n";
+ echo '<td style="width:70%"><div style="background-color:#EFF2F7; border-left:1px solid #B9C5D9;">'.$lang['srv_no_data'].'</div></td>';
}
- echo '</table>'."\n";
+ echo '</table>';
}
// pomozne funkcije
@@ -2146,7 +2344,7 @@ class SurveyStatistic {
global $site_path;
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
-
+ $lastFiles = '';
# preverimo timestampe
$str_qry_surveys = "SELECT id, UNIX_TIMESTAMP(GREATEST(insert_time,edit_time)) as time FROM srv_anketa WHERE id ='".$this->surveyId."'";
$qry_surveys = sisplet_query($str_qry_surveys);
@@ -2211,21 +2409,25 @@ class SurveyStatistic {
*
* @param HTML $data
*/
- function WriteToCacheFile($data,$timestamp) {
+ function WriteToCacheFile($data, $timestamp) {
global $site_path;
+
if ($this->surveyId !== null && $data !== null && $data !== '') {
+
# če imamo default filtre zapišemo v datoteko; Prav tako mora bit izbran osnovni profil intervala z id = 0
if ( $this->isDefaultFilters == true) {
+
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
$fileToUse = $folder . 'export_dashboard_'.$this->surveyId.'.html';
+
# pobrišemo morebitne predhodne header datoteke ankete
if (file_exists($fileToUse)) {
unlink($fileToUse);
}
$df = fopen($fileToUse, 'w') or die("can't open file");
- fwrite($df, $data);
+ fwrite($df, is_string($data));
fclose($df);
$str_qry_exist_files_update = "INSERT INTO srv_data_files (sid, dashboard_file_time, dashboard_update_time) VALUES ('".$this->surveyId."','".$timestamp."',NOW()) ON DUPLICATE KEY UPDATE dashboard_file_time = '".$timestamp."', dashboard_update_time = NOW()";
@@ -2240,10 +2442,13 @@ class SurveyStatistic {
*/
function ReadCacheFile() {
global $site_path;
+
if ($this->surveyId !== null) {
+
# nastavimo folder
$folder = $site_path . EXPORT_FOLDER.'/';
$dashboardFile = null;
+
# prebermo fajl:
foreach (glob($folder . 'export_dashboard_'.$this->surveyId.'.html') as $filesToUse) {
if ( $dashboardFile == null) {
@@ -2256,123 +2461,13 @@ class SurveyStatistic {
$data = fread($df, filesize($dashboardFile));
fclose($df);
+
return $data;
}
+
return null;
}
-
-
- /** Funkcija klice funkcije za prikaz statistike
- * DisplayInfoView - prikaze panelo z osnovnimi informacijami
- * DisplayStatusView - prikaze panelo z kliki po statusih
- * DisplayReferalsView - prikaze panelo z redirekcijami in referali
- * DisplayDataView - prikate panelo z kliki po datumih
- */
- function WriteDashboardToFile($sid,$timestamp) {
-
- global $lang, $site_url;
- if ((int)$sid > 0) {
-
- # spodnje ehote shranimo v spremenljivko ki jo popotrebi keširanja shranimo v datoteko.
-
- // preverimo ali ima anketa kakšne vnose
- $str_qry_all_users = "SELECT count(u.id) AS user_count FROM srv_user AS u " . "WHERE u.ank_id = '".$this->getSurveyId()."' AND preview = '0' AND deleted='0' ";
- $qry_all_users = sisplet_query($str_qry_all_users);
- $row_all_users = mysqli_fetch_assoc($qry_all_users);
- $allUserCount = $row_all_users['user_count'];
-
- ob_start();
-
- #echo '<div class="floatLeft" id="updateTime">'.$lang['srv_dashboard_updated'].date("d.m.Y, H:i").'</div>';
-
- if ($allUserCount == 0) { // nimamo še vnosov
-
- // zgornji boxi
- echo '<table class="dashboard dashboard_single">';
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
- echo '</table>';
-
- // 1) če ankete še nima nobenega klika, naj se pri poročilu ne prikaže nobena od šestih analiza,
- // ampak naj pise: Anketa nima še nobenega vnosa« zreaven naj bo v SIVEM zavihka UREJANJE
- // 2) Če nima anketa nobenega klika in ni niti aktivirana, pa napisite:
- // Anketa še ni aktivvirajna. Zraven naj bo sta siva zavihkja Urejanje vprašalnika in Objave&vabila
-
-
- } else {
-
- // imamo vnose, prikažemo statistiko
- $this->PrepareDateView();
- $this->PrepareStatusView();
-
- echo '<table class="dashboard">';
- echo '<tr>';
-
- // zgornji boxi
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
- $this -> DisplayInfoView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_status" id="div_statistic_status" >'."\n";
- $this -> DisplayStatusView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_answer_state" id="div_statistic_answer_state" >'."\n";
- $this -> DisplayAnswerStateView();
- echo '</div>';
- echo '</td>';
- echo '</tr>';
-
- // spodnji boxi
- echo '<tr>';
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_referals">';
- $this -> DisplayReferalsView();
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_visit">';
- echo '<span class="dashboard_title">'.$lang['srv_statistic_timeline_title'].'</span>'.Help :: display('srv_statistic_timeline_title');
- echo '<form name="frm_statistic_filter" id="frm_statistic_filter" autocomplete="off">'."\n";
- // echo '<div name="div_statistic_filter" id="div_statistic_filter" >'."\n";
- $this -> DisplayFilters();
- // echo '</div>';
- echo '</form>';
- echo '<br/>';
-
- echo '<div name="div_statistic_visit_data" id="div_statistic_visit_data" >'."\n";
- $this -> DisplayDateView();
- echo '</div>';
- echo '</div>';
- echo '</td>';
-
- echo '<td>';
- echo '<div class="dashboard_cell" id="div_statistic_pages_state">';
- $this -> DisplayPagesStateView();
- echo '</div>';
- echo '</td>';
-
- echo '</tr>';
- echo '</table>';
- }
-
- # HTML zapišemo v spremenljivko
- $dashboardHtml = ob_get_clean();
- $this->WriteToCacheFile($dashboardHtml,$timestamp);
- }
- }
-
+
function changeInvitationFilter() {
$this->emailInvitationFilter($_POST['filter_email_status']);
}
@@ -2424,14 +2519,14 @@ class SurveyStatistic {
$this->PrepareDateView();
$this->PrepareStatusView();
-
+ $allCnt = 0;
echo '<table class="dashboard dashboard_single">';
echo '<tr>';
// zgornji boxi
echo '<td>';
- echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >'."\n";
+ echo '<div class="dashboard_cell" name="div_statistic_info" id="div_statistic_info" >';
{
$lang_array = array();
@@ -2442,13 +2537,20 @@ class SurveyStatistic {
$lang_array[$rowl['lang_id']] = $rowl['language'];
}
- echo '<span class="dashboard_title">'.$lang['srv_statistic_lang_title'].'</span>';
- echo '<br/>';
+ echo '<div class="box_title">'.$lang['srv_statistic_lang_title'].'</div>';
+
+
echo '<table id="tbl_answ_state">';
- echo '<tr class="anl_dash_bb "><th><strong>'.$lang['srv_statistic_lang'].'</strong></th><td><strong>'.$lang['srv_statistic_answer_state_frequency'].'</strong></td><td><strong>'.$lang['srv_statistic_answer_state_percent'].'</strong></td></tr>';
- foreach ($this->respondentLangArray as $key => $cnt) {
+
+ echo '<tr class="anl_dash_bb ">';
+ echo '<td>'.$lang['srv_statistic_lang'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_frequency'].'</td>';
+ echo '<td>'.$lang['srv_statistic_answer_state_percent'].'</td>';
+ echo '</tr>';
+
+ foreach ($this->respondentLangArray as $key => $cnt) {
$allCnt+=$cnt;
- echo '<tr><th>'.$lang_array[$key].'</th>';
+ echo '<tr><td>'.$lang_array[$key].'</td>';
#frekvenca
echo '<td>'.(int)$cnt.'</td>';
#procenti
@@ -2460,10 +2562,13 @@ class SurveyStatistic {
echo '</td>';
echo '</tr>';
}
- echo '<tr class="anl_dash_bt "><th><strong>'.$lang['srv_statistic_sum'].'</strong></th>';
- #frekvenca
+
+ echo '<tr class="anl_dash_bt "><td>'.$lang['srv_statistic_sum'].'</td>';
+
+ #frekvenca
echo '<td><strong>'.(int)$allCnt.'</strong></td>';
- #procenti
+
+ #procenti
echo '<td>';
$percent = 100;
echo $this->formatNumber((int)$percent,NUM_DIGIT_PERCENT,'%');
@@ -2475,8 +2580,8 @@ class SurveyStatistic {
echo '</div>';
echo '</td>';
echo '</tr>';
+
echo '</table>';
-
}
}
?> \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyStatisticProfiles.php b/admin/survey/classes/class.SurveyStatisticProfiles.php
index 3f56e4f..6aad0c8 100644
--- a/admin/survey/classes/class.SurveyStatisticProfiles.php
+++ b/admin/survey/classes/class.SurveyStatisticProfiles.php
@@ -41,7 +41,7 @@ class SurveyStatisticProfiles {
protected function __construct() { }
- final private function __clone() {}
+ private function __clone() {}
static function getSurveyId() { return self::$surveyId; }
static function getGlobalUserId() { return self::$uId; }
diff --git a/admin/survey/classes/class.SurveyStatusCasi.php b/admin/survey/classes/class.SurveyStatusCasi.php
index 27cc59b..851c306 100644
--- a/admin/survey/classes/class.SurveyStatusCasi.php
+++ b/admin/survey/classes/class.SurveyStatusCasi.php
@@ -27,13 +27,40 @@ class SurveyStatusCasi
}
static function RefreshData() {
- # preberemo podatke vseh porfilov ki so na voljo in jih dodamo v array
- $stringSelect = "SELECT * FROM srv_status_casi WHERE uid = '".self::getGlobalUserId()."' OR (uid = '0' AND `system` =1) ORDER BY id";
- $querySelect = sisplet_query($stringSelect);
+ global $lang;
+
+ // Profila za status - prej smo imeli to v bazi ampak ni potrebe, ker sta itak samo 2 in ne pustimo vec custom profilov
+ self::$profiles['1'] = array(
+ 'id' => '1',
+ 'uid' => '0',
+ 'name' => $lang['srv_userstatus_6'],
+ 'system' => '1',
+ 'statusnull' => '0',
+ 'status0' => '0',
+ 'status1' => '0',
+ 'status2' => '0',
+ 'status3' => '0',
+ 'status4' => '0',
+ 'status5' => '0',
+ 'status6' => '1',
+ 'statuslurker' => '0'
+ );
+ self::$profiles['2'] = array(
+ 'id' => '2',
+ 'uid' => '0',
+ 'name' => $lang['srv_userstatus_total'],
+ 'system' => '1',
+ 'statusnull' => '1',
+ 'status0' => '1',
+ 'status1' => '1',
+ 'status2' => '1',
+ 'status3' => '1',
+ 'status4' => '1',
+ 'status5' => '1',
+ 'status6' => '1',
+ 'statuslurker' => '1'
+ );
- while ( $rowSelect = mysqli_fetch_assoc($querySelect) ) {
- self::$profiles[$rowSelect['id']] = $rowSelect;
- }
# poiscemo privzet profil
self::$currentProfileId = SurveyUserSetting :: getInstance()->getSettings('default_status_casi');
if (!self::$currentProfileId || self::$currentProfileId == 1)
@@ -54,8 +81,10 @@ class SurveyStatusCasi
return true;
}
}
+
static function DisplayProfile( $pid = null) {
global $lang;
+
if ($pid == null ) {
$pid = self::$currentProfileId;
}
@@ -90,29 +119,21 @@ class SurveyStatusCasi
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="statusCasiAction(\'newSave\'); return false;"><span>'.$lang['srv_save_profile'].'</span></a></span></span>'."\n";
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="showHideNewMissingProfile(\'false\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
echo '</div>'."\n";
-/*
- // div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" size="45" />'."\n";
- echo '<input id="renameProfileId" type="hidden" value="' . $pid . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="(); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
-*/
+
// div za brisanje
echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self::$profiles[$pid]['name'] . '</b>?'."\n";
echo '<input id="deleteProfileId" type="hidden" value="' . $pid . '" />'."\n";
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="statusCasiAction(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="statusCasiAction(\'deleteConfirm\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
echo '</div>'."\n";
-
}
static function DisplayProfileData($pid) {
global $lang;
+
$curentProfileData = self :: $profiles[$pid];
-// echo '<div id="status_profile_notes" >help?'.'</div>';
- echo '<div id="statusProfileFieldsetHolder" >';
+
+ echo '<div id="statusProfileFieldsetHolder" >';
echo '<fieldset id="missingProfileFieldset">'."\n";
echo '<legend>' . $lang['srv_missing_profile_title4'] . '</legend>'."\n";
echo '<form name="" id="" autocomplete="off">'."\n";
diff --git a/admin/survey/classes/class.SurveyStatusProfiles.php b/admin/survey/classes/class.SurveyStatusProfiles.php
index 11946a3..1563ddd 100644
--- a/admin/survey/classes/class.SurveyStatusProfiles.php
+++ b/admin/survey/classes/class.SurveyStatusProfiles.php
@@ -7,7 +7,8 @@
*/
session_start();
-DEFINE (STR_DLMT, "|");
+if (!defined(STR_DLMT)) define(STR_DLMT, "|");
+
class SurveyStatusProfiles
{
@@ -133,16 +134,18 @@ class SurveyStatusProfiles
}
# če smo v vpogledu pohandlammo posebej
- if (($_podstran == A_COLLECT_DATA && $_GET['m'] == 'quick_edit') || $_POST['podstran'] == 'quick_edit') {
+ if (($_podstran == A_COLLECT_DATA && isset($_GET['m']) && $_GET['m'] == 'quick_edit') || (isset($_POST['podstran']) && $_POST['podstran'] == 'quick_edit')) {
$_podstran = 'vpogled';
}
+
+
self::$currentProfileId = SurveyUserSetting :: getInstance()->getSettings('default_status_profile_'.$_podstran);
if (!self::$currentProfileId) {
-
#self::$currentProfileId = 2;
self::$currentProfileId = self::$survayDefaultUstrezni; # je lahko 2 ali 3
}
+
# ustrezni je lahko samo če so kakšni ustrezni zapisi v bazi ob pogoju da pa neustrezni obstajajao
if (self::$allValidCount == 0 && self::$allUserCount > 0) {
if (self::$currentProfileId == 2 || self::$currentProfileId == 3 ) {
@@ -153,16 +156,18 @@ class SurveyStatusProfiles
# ce imamo nastavljen curent pid in profil z tem pid ne obstaja nastavomo na privzet profil
if (self::$currentProfileId != 1) {
+
if (!isset(self::$profiles[self::$currentProfileId])) {
self::$currentProfileId = 1;
- }
+ }
}
# ce ne obstajajo podatki za cpid damo error
if (!isset(self::$profiles[self::$currentProfileId])) {
die("Profile data is missing!");
return false;
- } else {
+ }
+ else {
return true;
}
}
@@ -186,7 +191,7 @@ class SurveyStatusProfiles
static function DisplayProfile( $pid = null) {
global $lang;
-
+
if ($pid == null ) {
$pid = self::$currentProfileId;
}
@@ -197,29 +202,46 @@ class SurveyStatusProfiles
#vsebino shranimo v buffer
ob_start();
- if ( self::$currentProfileId != SSP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
+
+
+ if ( self::$currentProfileId != SSP_DEFAULT_PROFILE ) {
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
- echo ' <div id="status_profile_holder">';
+ echo '<div class="popup_main with_menu">';
+
+ echo ' <div id="status_profile_holder" class="popup_left">';
self :: DisplayProfileOptions($pid);
echo ' </div>';
- echo ' <div id="status_profile_data_holder">';
+ echo ' <div id="status_profile_data_holder" class="popup_right">';
self :: DisplayProfileData($pid);
- echo ' <br class="clr" />';
echo ' </div>';
-
+
+ echo ' </div>';
+
+
// cover Div
echo '<div id="statusProfileCoverDiv"></div>';
// div za shranjevanje novega profila
- echo '<div id="newProfile">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />';
+ echo '<div id="newProfile">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+
$button = new PopUpButton($lang['srv_save_profile']);
echo $button -> setFloat('right')
->setButtonColor('orange')
@@ -227,12 +249,26 @@ class SurveyStatusProfiles
$button = new PopUpButton($lang['srv_cancel']);
echo $button -> setFloat('right')
-> addAction('onClick','statusProfileAction(\'newCancel\'); return false;');
+
+ echo '</div>';
+
echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" size="45" />';
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" class="text large" />';
echo '<input id="renameProfileId" type="hidden" value="' . $pid . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+
+
$button = new PopUpButton($lang['srv_rename_profile_yes']);
echo $button -> setFloat('right')
->setButtonColor('orange')
@@ -242,65 +278,54 @@ class SurveyStatusProfiles
echo $button -> setFloat('right')
-> addAction('onClick','statusProfileAction(\'renameCancel\'); return false;');
echo '</div>';
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self::$profiles[$pid]['name'] . '</b>?';
- echo '<input id="deleteProfileId" type="hidden" value="' . $pid . '" />';
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . self::$profiles[$pid]['name'] . '</span>?';
+
+ echo '<input id="deleteProfileId" type="hidden" value="' . $pid . '" />';
+
+ echo '<div class="button_holder">';
$button = new PopUpButton($lang['srv_delete_profile_yes']);
- echo $button -> setFloat('right')
- ->setButtonColor('orange')
+ echo $button -> setButtonColor('orange')
-> addAction('onClick','statusProfileAction(\'deleteConfirm\'); return false;');
$button = new PopUpButton($lang['srv_cancel']);
- echo $button -> setFloat('right')
- -> addAction('onClick','statusProfileAction(\'deleteCancel\'); return false;');
+ echo $button -> addAction('onClick','statusProfileAction(\'deleteCancel\'); return false;');
echo '</div>';
+ echo '</div>';
$content = ob_get_clean();
#dodamo vsebino
$popUp->setContent($content);
- /*
- if ($pid < 0) { #Imamo sejo, lahko poženemo samo kot sejo
- $run_lbl = $lang['srv_run_as_session_profile'];
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="statusProfileAction(\'runSession\'); return false;"><span>'.$run_lbl.'</span></a></span></span>';
- } else {
- # shrani - pozeni
- $run_lbl = $lang['srv_run_profile'];
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick=""><span>'.$run_lbl.'</span></a></span></span>';
- $run_lbl = $lang['srv_run_as_session_profile'];
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="statusProfileAction(\'runSession\'); return false;"><span>'.$run_lbl.'</span></a></span></span>';
-
- }
- */
- $button = new PopUpButton($lang['srv_choose_profile']);
- $button -> setFloat('right')
- ->setButtonColor('orange')
- -> addAction('onClick','statusProfileAction(\'choose\'); return false;');
+
+ # dodamo gumb Prekliči
+ $button = new PopUpCancelButton();
$popUp->addButton($button);
#dodamo gumb shrani
- if (self::$profiles[$pid]['system'] != 1 && $pid != -1)
- {
+ if (self::$profiles[$pid]['system'] != 1 && $pid != -1){
$button = new PopUpButton($lang['srv_save_profile']);
- $button -> setFloat('right')
- -> addAction('onClick','statusProfileAction(\'save\'); return false;');
+ $button -> addAction('onClick','statusProfileAction(\'save\'); return false;');
$popUp->addButton($button);
}
$button = new PopUpButton($lang['srv_new_profile_name']);
- $button -> setFloat('right')
- -> addAction('onClick','statusProfileAction(\'newName\'); return false;');
+ $button -> addAction('onClick','statusProfileAction(\'newName\'); return false;');
$popUp->addButton($button);
-
- # dodamo gumb Prekliči
- $button = new PopUpCancelButton();
- $button -> setFloat('right');
+
+ $button = new PopUpButton($lang['srv_choose_profile']);
+ $button ->setButtonColor('orange')
+ -> addAction('onClick','statusProfileAction(\'choose\'); return false;');
$popUp->addButton($button);
+
echo $popUp;
}
@@ -321,56 +346,50 @@ class SurveyStatusProfiles
# preverimo kaere statuse disejblamo na podlagi izbire načina kreiranja datoteke (samo 5,6 / vsi satusi)
list($collect_all_status) = mysqli_fetch_row(sisplet_query("SELECT collect_all_status FROM srv_data_files WHERE sid = '".self::$sid."'"));
- echo '<table><tr>';
+
+ echo '<div class="valid_units_wrap">';
+
// dodamo veljavne
foreach (self::$appropriateStatus as $index) {
- if ($cnt&1) {
- echo '</tr><tr>';
- }
- echo '<td style="width:50%">';
- echo '<label><input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
+ echo '<div class="valid_units_box">';
+ echo '<input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
($curentProfileData['status'.$index] == 1 ? ' checked="checked"' : '') .
- ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled="true"' : '' ). '/>';
+ ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled' : '' ). '/><label for="' . $index . '">';
echo '<span'.($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' class="gray"' : '' ).'>'.$lang['srv_userstatus_' . $index]. ' ('.$index.')</span>';
- echo '</label></td>';
- $cnt++;
+ echo '</label></div>';
}
+
// dodamo neveljavne
foreach (self::$unAppropriateStatus as $index) {
- if ($cnt&1)
- echo '</tr><tr>';
- echo '<td style="width:50%">';
- echo '<label><input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
+ echo '<div class="valid_units_box">';
+ echo '<input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
($curentProfileData['status'.$index] == 1 ? ' checked="checked"' : '') .
- ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled="true"' : '' ) . '/>';
+ ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled' : '' ) . '/><label for="' . $index . '">';
//echo $lang['srv_userstatus_' . $index]. " (".$index.")";
echo '<span'.($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' class="gray"' : '' ).'>'.$lang['srv_userstatus_' . $index]. ' ('.$index.')</span>';
- echo '</label></td>';
- $cnt++;
+ echo '</label></div>';
}
+
// dodamo null
foreach (self::$unKnownStatus as $index) {
-
- if ($cnt&1)
- echo '</tr><tr>';
- echo '<td style="width:50%">';
- echo '<label><input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
+ echo '<div class="valid_units_box">';
+ echo '<input name="srv_userstatus[]" type="checkbox" id="' . $index . '"' .
($curentProfileData['status'.$index] == 1 ? ' checked="checked"' : '') .
- ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled="true"' : '' ) . '/>';
+ ($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' disabled' : '' ) . '/><label for="' . $index . '">';
//echo $lang['srv_userstatus_' . $index]. " (".$index.")";
echo '<span'.($disabled || ( (int)$collect_all_status == 0 && $index < 5 ) ? ' class="gray"' : '' ).'>'.$lang['srv_userstatus_' . $index]. ' ('.$index.')</span>';
- echo '</label></td>';
- $cnt++;
+ echo '</label></div>';
}
- echo '</tr></table>';
+ echo '</div>'; #valid_units_wrap
echo '</fieldset>';
-
+ $html_disabled = '';
+ $css_disabled = '';
if ($disabled ) {
$html_disabled = ' disabled="true"';
- $css_disabled = ' class="gray"';
+ $css_disabled = ' disabled';
}
@@ -379,19 +398,51 @@ class SurveyStatusProfiles
// lurkerji
# lurker = 0 - obveezno ni lurker, lurker = 1 - obvezno je lurker, lurker = 2 - je ali ni lurker
- #echo '<hr><label><input type="checkbox" name="srv_userstatus[]" id="lurker" '.($curentProfileData['statuslurker'] == 1 ? ' checked="checked"' : '') . ($disabled ? ' disabled="true"' : '' ) . '> '.$lang['srv_lurkers'].'</label>';
- echo '<label'.$css_disabled.'>'.$lang['srv_lurkers'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_lurker" value="0" '.((int)$curentProfileData['statuslurker'] == 0 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['no'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_lurker" value="1" '.((int)$curentProfileData['statuslurker'] == 1 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['srv_only_empty'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_lurker" value="2" '.((int)$curentProfileData['statuslurker'] == 2 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['srv_also'].'</label>';
- echo '<br/><label class="small">'.$lang['srv_lurkers_subnote'].'</label>';
+ #echo '<hr><label><input type="checkbox" name="srv_userstatus[]" id="lurker" '.($curentProfileData['statuslurker'] == 1 ? ' checked="checked"' : '') . ($disabled ? ' disabled' : '' ) . '> '.$lang['srv_lurkers'].'</label>';
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo '<p class="setting_title">'.$lang['srv_lurkers'];
+ echo '<br><span class="italic">'.$lang['srv_lurkers_subnote'].'</span></p>';
+
+ echo '<div class="horizontal">';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_lurker0" name="srv_us_lurker" value="0" '.((int)$curentProfileData['statuslurker'] == 0 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_lurker0">'.$lang['no'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_lurker1" name="srv_us_lurker" value="1" '.((int)$curentProfileData['statuslurker'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_lurker1">'.$lang['srv_only_empty'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_lurker2" name="srv_us_lurker" value="2" '.((int)$curentProfileData['statuslurker'] == 2 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_lurker2">'.$lang['srv_also'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
// testni vnosi
# testni = 0 - obveezno ni testni, testni = 1 - obvezno je tesni, testni = 2 - je ali ni testni
- echo '<br/><br/><label'.$css_disabled.'>'.$lang['srv_testni_vnos'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_testni" value="0" '.((int)$curentProfileData['statustestni'] == 0 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['no'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_testni" value="1" '.((int)$curentProfileData['statustestni'] == 1 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['srv_only_test'].'</label>';
- echo '<label'.$css_disabled.'><input type="radio" name="srv_us_testni" value="2" '.((int)$curentProfileData['statustestni'] == 2 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['srv_also'].'</label>';
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo '<p class="setting_title">'.$lang['srv_testni_vnos'].'</p>';
+
+ echo '<div class="horizontal">';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_testni0" name="srv_us_testni" value="0" '.((int)$curentProfileData['statustestni'] == 0 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_testni0">'.$lang['no'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_testni1" name="srv_us_testni" value="1" '.((int)$curentProfileData['statustestni'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_testni1">'.$lang['srv_only_test'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" id="srv_us_testni2" name="srv_us_testni" value="2" '.((int)$curentProfileData['statustestni'] == 2 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_testni2">'.$lang['srv_also'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
echo '</fieldset>';
@@ -401,10 +452,25 @@ class SurveyStatusProfiles
echo '<legend>' . $lang['srv_usableResp_usable_unit'] . '</legend>';
// 2->uporabni, 1->delno uporabni, 0->neuporabni
- echo '<label'.$css_disabled.'><input type="checkbox" name="srv_us_nonusable" value="1" '.((int)$curentProfileData['statusnonusable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '> '.$lang['srv_usableResp_unusable'].'</label>';
- echo '<span class="spaceLeft"></span><label'.$css_disabled.'><input type="checkbox" name="srv_us_partusable" value="1" '.((int)$curentProfileData['statuspartusable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>'.$lang['srv_usableResp_partusable'].'</label>';
- echo '<span class="spaceLeft"></span><label'.$css_disabled.'><input type="checkbox" name="srv_us_usable" value="1" '.((int)$curentProfileData['statususable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>'.$lang['srv_usableResp_usable'].'</label>';
+
+ echo '<div class="setting_holder '.$css_disabled.'">';
+ echo '<div class="horizontal">';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="srv_us_nonusable" name="srv_us_nonusable" value="1" '.((int)$curentProfileData['statusnonusable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_nonusable">'.$lang['srv_usableResp_unusable'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="srv_us_partusable" name="srv_us_partusable" value="1" '.((int)$curentProfileData['statuspartusable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_partusable">'.$lang['srv_usableResp_partusable'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="srv_us_usable" name="srv_us_usable" value="1" '.((int)$curentProfileData['statususable'] == 1 ? ' checked="checked"' : '') .$html_disabled. '>';
+ echo '<label for="srv_us_usable">'.$lang['srv_usableResp_usable'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+ echo '</div>';
echo '</fieldset>';
echo '</form>';
@@ -418,15 +484,18 @@ class SurveyStatusProfiles
$_sql_qry = sisplet_query($_sql_string);
$_sql_row = mysqli_fetch_assoc($_sql_qry);
- echo '<div id="status_profile" class="select">';
+ echo '<div id="status_profile" class="list select">';
+
foreach ( self::$profiles as $key => $profile ) {
if ($key != 1 || ($key == 1 && (int)$_sql_row['collect_all_status'] > 0 )) {
- echo '<div id="status_profile_'.$profile['id'].'" class="option' . ($profile['id'] == $pid ? ' active' : '') . '" value="'.$profile['id'].'" '.($profile['id'] == $pid ? '' : ' onclick="show_status_profile_data(' . $profile['id'] . '); return false;"').'>';
+ echo '<div id="status_profile_'.$profile['id'].'" class="list-item option' . ($profile['id'] == $pid ? ' active' : '') . '" value="'.$profile['id'].'" '.($profile['id'] == $pid ? '' : ' onclick="show_status_profile_data(' . $profile['id'] . '); return false;"').'>';
echo $profile['name'];
if($profile['id'] == $pid){
+ echo '<div class="profile_icons">';
+
#dodamo gumb izbriši
if (self::$profiles[$pid]['system'] != 1 ){
echo ' <a href="#" onclick="statusProfileAction(\'deleteAsk\'); return false;" value="'.$lang['srv_delete_profile'].'"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
@@ -435,6 +504,8 @@ class SurveyStatusProfiles
if (self::$profiles[$pid]['system'] != 1 && $pid != -1){
echo ' <a href="#" onclick="statusProfileAction(\'renameAsk\'); return false;" value="'.$lang['srv_rename_profile'].'"><span class="faicon edit floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
@@ -443,9 +514,7 @@ class SurveyStatusProfiles
echo '</div>';
echo '<script>';
- echo '$(function() {';
- echo 'scrollToProfile("#status_profile_'.$pid.'");';
- echo '});';
+ echo ' $(function(){ scrollToProfile("#status_profile_'.$pid.'"); });';
echo '</script>';
}
@@ -453,8 +522,11 @@ class SurveyStatusProfiles
*
*/
static function ajax() {
- $pid = $_POST['pid'];
+
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
+
switch ($_GET['a']) {
+
case 'displayProfile' :
if (isset($pid) && $pid != null)
{
@@ -462,34 +534,42 @@ class SurveyStatusProfiles
}
self :: DisplayProfile($pid);
break;
+
case 'chooseProfile' :
self :: setDefaultProfileId($pid);
break;
+
case 'saveProfile':
self :: saveProfile($pid);
break;
+
case 'run_status_profile':
self :: saveProfile($pid);
self :: setDefaultProfileId($pid);
break;
+
case 'save_status_profile':
$new_id = self :: saveNewProfile($pid);
self :: setDefaultProfileId($new_id);
echo $new_id;
break;
+
case 'deleteProfile':
self :: DeleteProfile($pid);
break;
+
case 'renameProfile':
self :: renameProfile($pid);
-
break;
- case 'showColectDataSetting':
- self :: showColectDataSetting();
+
+ case 'showInvalidResponsesWarning':
+ self :: showInvalidResponsesWarning();
break;
+
case 'saveCollectDataSetting':
self :: saveCollectDataSetting();
break;
+
case 'changeOnlyValidRadio':
self :: changeOnlyValidRadio();
break;
@@ -568,12 +648,14 @@ class SurveyStatusProfiles
}
static function setDefaultProfileId($pid=null, $podstran = null) {
+
# ce je seja, preverimo ali obstaja cene nardimo privzetega 1
if ($pid == -1) {
if (!(isset($_SESSION['statusProfile']))) {
$pid = null;
}
}
+
if ($podstran == null ) {
if ( isset($_POST['meta_akcija']) ) {
$_action = $_POST['meta_akcija'];
@@ -596,7 +678,7 @@ class SurveyStatusProfiles
}
# če smo v vpogledu pohandlammo posebej
- if (($_action == A_COLLECT_DATA && $_GET['m'] == 'quick_edit') || $_POST['podstran'] == 'quick_edit') {
+ if (($_action == A_COLLECT_DATA && isset($_GET['m']) && $_GET['m'] == 'quick_edit') || $_POST['podstran'] == 'quick_edit') {
$_action = 'vpogled';
}
@@ -684,7 +766,7 @@ class SurveyStatusProfiles
$mpds = self::getStatusArray((int)$pid);
}
$result = '';
-
+ $prefix = '';
if ($mpds) {
$result .= ' AND last_status IN (';
foreach ( self::$appropriateStatus as $index) {
@@ -727,11 +809,15 @@ class SurveyStatusProfiles
return $result;
}
+
static function getStatusArray($pid=null) {
+
if ($pid == null) {
$pid = self::$currentProfileId;
}
- $mpd = self::$profiles[$pid];
+
+ $mpd = isset(self::$profiles[$pid]) ? self::$profiles[$pid] : null;
+
return $mpd;
}
@@ -953,96 +1039,35 @@ class SurveyStatusProfiles
static function DisplayLink($hideAdvanced = true, $hideSeperator = false) {
global $lang;
+
// profili statusov
$statusProfiles = self :: getProfiles();
$izbranStatusProfile = self :: getCurentProfileId();
$css = ($izbranStatusProfile == SSP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $izbranStatusProfile != SSP_DEFAULT_PROFILE) {
- if ($hideSeperator == false) {
- echo '<li class="space">&nbsp;</li>';
- }
+
echo '<li>';
- echo '<span class="as_link'.$css.'" onclick="show_status_profile();return false;" title="' . $lang['srv_statusi'] . '">' . $lang['srv_statusi'] . '</span>';
- echo '</li>';
-
+ echo ' <span class="'.$css.'" onclick="show_status_profile(); return false;" title="' . $lang['srv_statusi'] . '">' . $lang['srv_statusi'] . '</span>';
+ echo '</li>';
}
}
- public static function FileGeneratingSetting($hideAdvanced = true) {
+ static function showInvalidResponsesWarning() {
global $lang, $admin_type;
-
- $_sql_string = "SELECT collect_all_status FROM srv_data_files WHERE sid = '".self::$sid."'";
- $_sql_qry = sisplet_query($_sql_string);
- $_sql_row = mysqli_fetch_assoc($_sql_qry);
- echo '<li class="space">&nbsp;</li>';
- echo '<li>';
- $css = ((int)$_sql_row['collect_all_status'] > 0 ? ' gray' : '');
- echo '<span class="as_link'.$css.'" onclick="showColectDataSetting(); return false;" title="' . $lang['srv_collect_data_setting_note'] . '">' . $lang['srv_collect_data_setting_note'] . '</span>';
- echo '</li>';
-
- return;
- }
-
- static function showColectDataSetting() {
- global $lang, $admin_type;
+ echo '<h2>'.$lang['srv_invalid_units_warning_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="popupClose(); return false;">✕</a></div>';
- $_sql_string = "SELECT collect_all_status FROM srv_data_files WHERE sid = '".self::$sid."'";
- $_sql_qry = sisplet_query($_sql_string);
- list($collect_all_status) = mysqli_fetch_row($_sql_qry);
-
- $str_qry_cnt_user = "SELECT count(*) FROM srv_user AS u WHERE u.ank_id = '".self::$sid."'";
- $_qry_cnt_user = sisplet_query($str_qry_cnt_user);
- list($all_user_cnt) = mysqli_fetch_row($_qry_cnt_user);
- #vsebino shranimo v buffer
- $content = '';
-
- # kadar imamo uporabnikov več kakor ONLY_VALID_LIMIT (5000) ne dovolimo nastaviti na vse statuse, zato dodamo obvestilo
- # le admin lahko nastavi da generira tudi nad 5000 takrat nastavimo collect_all_status = 2
- if ($all_user_cnt > ONLY_VALID_LIMIT && (int)$admin_type > 1)
- {
- $content .= '<span class="red strong">';
- $content .= 'Anketa vsebuje več kakor '.ONLY_VALID_LIMIT.' respondentov, zato je dovoljen prikaz le ustreznih!';
- $content .= '</span><br/><br/>';
- $content .= '<span class="gray">'.$lang['srv_collect_data_setting_note'] . Help :: display('srv_collect_data_setting').'</span>';
- $content .= '<label class="gray">';
- $content .= '<input type="checkbox" id="collect_all_status" name="collect_all_status" '.((int)$collect_all_status > 0 ? '' : ' checked' ).' autocomplete="off" disabled="disabled">';
- $content .= $lang['srv_collect_all_status_0'].'</label>';
- }
- else
- {
- $content .= '<span '.($admin_type <= 1 ? '' : ' class="gray"').'>'.$lang['srv_collect_data_setting_note'] . Help :: display('srv_collect_data_setting').'</span>';
- $content .= '<label'.($admin_type <= 1 ? '' : ' class="gray"').'>';
- $content .= '<input type="checkbox" id="collect_all_status" name="collect_all_status" '.((int)$collect_all_status > 0 ? '' : ' checked').' autocomplete="off"'.($admin_type <= 1 ? '' : ' disabled="disabled"').'>';
- $content .= $lang['srv_collect_all_status_0'].'</label>';
- }
- $content .= '<br class="clr">';
- $content .= '<br class="clr">';
- $content .= '<span class="bold as_link" onclick="deleteSurveyDataFile(\''.$lang['srv_deleteSurveyDataFile_confirm'].'\');" title="'.$lang['srv_deleteSurveyDataFile_link'].'">'.$lang['srv_deleteSurveyDataFile_link'].'</span>';
-
-
- $popUp = new PopUp();
- $popUp->setId('div_data_file');
- $popUp -> setHeaderText($lang['srv_file_settings']);
-
- #dodamo vsebino
- $popUp -> setContent($content);
-
- #dodamo gumb izberi profil
- $button = new PopUpButton($lang['srv_save_profile']);
- $button -> setFloat('right')
- -> setButtonColor('orange')
- -> addAction('onClick','changeColectDataStatus(); return false;');
- $popUp->addButton($button);
-
- # dodamo gumb Prekliči
- $button = new PopUpCancelButton();
- $button -> setFloat('right');
- $popUp->addButton($button);
+ echo '<div class="popup_content">';
+ echo ' <p class="bottom16">'.$lang['srv_invalid_units_warning_text'].'</p>';
+ echo '</div>';
- echo $popUp;
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="refreshDataFile(); return false;">'.$lang['no'].'</button>';
+ echo ' <button class="medium blue" onClick="deleteInvalidAnswers(); return false;">'.$lang['yes'].'</button>';
+ echo '</div>';
}
@@ -1112,10 +1137,14 @@ class SurveyStatusProfiles
$values = self::getProfilesValues();
$collect_all_status = $values['all_status'];
+
+ $disabledValid = '';
+ $disabledGray = '';
+ $disabledAll = '';
+ $disabledAllGray = '';
// če ni ustreznih uporabnikov je privzeto vsi
if (self::$allValidCount == 0) {
-
$pid = 1;
$disabledValid = ' disabled="disabled"';
$disabledGray = ' gray';
@@ -1133,36 +1162,35 @@ class SurveyStatusProfiles
}
}
- echo '<label class="middle'.$disabledAllGray.'">';
echo '<input type="radio" id="statusAllUnit" name="statusOnlyValid" value="1"'.($pid == 1?' checked="checked"':'').$disabledAll.' onchange="changeOnlyValidRadio();" autocomplete="off">';
- echo $lang['srv_data_all_units'].'&nbsp;('.(int)self::$allUserCount.')';
- echo '</label>';
- echo '&nbsp;';
+ echo '<label for="statusAllUnit" class="middle'.$disabledAllGray.'">'.$lang['srv_data_all_units'].'&nbsp;('.(int)self::$allUserCount.')</label>';
if (self::$survayDefaultUstrezni == 2) {
- echo '<label class="middle'.$disabledGray .'">';
echo '<input type="radio" id="statusValidUnit" name="statusOnlyValid" value="2"'.($pid==2?' checked="checked"':'').$disabledValid.' onchange="changeOnlyValidRadio();" autocomplete="off">';
- echo $lang['srv_data_valid_units'].'&nbsp;('.(int)self::$allValidCount.')';
- echo '</label>';
+ echo '<label for="statusValidUnit" class="middle'.$disabledGray.'">'.$lang['srv_data_valid_units'].'&nbsp;('.(int)self::$allValidCount.') '.Help::display('srv_data_only_valid').'</label>';
}
else {
- echo '<label class="middle'.$disabledGray .'">';
echo '<input type="radio" id="statusValidUnit" name="statusOnlyValid" value="3"'.($pid==3?' checked="checked"':'').$disabledValid.' onchange="changeOnlyValidRadio();" autocomplete="off">';
- echo $lang['srv_data_finished_units'].'&nbsp;('.(int)self::$allValidCount.')';
+ echo '<label for="statusValidUnit" class="middle'.$disabledGray.'">'.$lang['srv_data_finished_units'].' ('.(int)self::$allValidCount.') '.Help::display('srv_data_only_valid').'</label>';
}
-
- echo '&nbsp;'.Help::display('srv_data_only_valid');
+
+ // Zapisemo stevilo odgovorov v hidden variablo za js
+ echo '<input type="hidden" name="statusAllCount" value="'.(int)self::$allUserCount.'">';
+ echo '<input type="hidden" name="statusOnlyValidCount" value="'.(int)self::$allValidCount.'">';
+ echo '<input type="hidden" name="statusOnlyInvalidCount" value="'.((int)self::$allUserCount - (int)self::$allValidCount).'">';
}
static function changeOnlyValidRadio() {
+
if (isset($_POST['checked']) && (int)$_POST['checked'] > 0) {
$dpid = (int)$_POST['checked'];
- } else {
+ }
+ else {
#$dpid = 2;
$dpid = (int)self::$survayDefaultUstrezni;
}
+
self::setDefaultProfileId($dpid);
-
}
/** preveri obstoj profila in vrne enak id če obstaja, če ne vrne id privzetega profila
diff --git a/admin/survey/classes/class.SurveyTelephone.php b/admin/survey/classes/class.SurveyTelephone.php
index 390544e..3be12b4 100644
--- a/admin/survey/classes/class.SurveyTelephone.php
+++ b/admin/survey/classes/class.SurveyTelephone.php
@@ -205,9 +205,18 @@ class SurveyTelephone {
$date_to = '';
if(isset($_GET['date_to']))
$date_to = strtotime($_GET['date_to']);
+
+ echo '<div class="set_horizontal">';
+
+ echo $lang['s_from'].':';
+ echo '<input type="text" class="text small" name="tel_dash_dateFrom" id="tel_dash_dateFrom" value="'.($date_from == '' ? $date_from : date('d.m.Y', $date_from)).'">';
+ echo $lang['s_to'].':';
+ echo '<input type="text" class="text small" name="tel_dash_dateTo" id="tel_dash_dateTo" value="'.($date_to == '' ? $date_to : date('d.m.Y', $date_to)).'">';
+
+ echo '<a href="'.$site_url.'/admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_TELEPHONE.'&m=dashboard">'.$lang['srv_telephone_dashboard_legend_datum'].'</a>';
+
+ echo '</div>';
- echo '<span class="spaceRight">'.$lang['s_from'].': <input type="text" name="tel_dash_dateFrom" id="tel_dash_dateFrom" value="'.($date_from == '' ? $date_from : date('d.m.Y', $date_from)).'" style="width:70px" ></span>';
- echo '<span class="spaceLeft spaceRight">'.$lang['s_to'].': <input type="text" name="tel_dash_dateTo" id="tel_dash_dateTo" value="'.($date_to == '' ? $date_to : date('d.m.Y', $date_to)).'" style="width:70px" ></span>';
echo '<script type="text/javascript">';
echo '$(document).ready(function() {' .
' $("#tel_dash_dateFrom, #tel_dash_dateTo").datepicker({
@@ -225,11 +234,11 @@ class SurveyTelephone {
});' .
'});';
echo '</script>';
- echo '<span class="spaceLeft"><a href="'.$site_url.'/admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_TELEPHONE.'&m=dashboard">'.$lang['srv_clear'].'</a></span>';
echo '</div>';
-
+
+ $statusi_all = 0;
while ($row = mysqli_fetch_assoc($qry)) {
$date = strtotime($row['insert_time']);
@@ -238,8 +247,15 @@ class SurveyTelephone {
if( ($date == null && $date_from == null && $date_to == null)
|| ($date != null && ($date_from == null || $date >= $date_from) && ($date_to == null || $date <= $date_to)) ){
- $statusi[$row['schstatus']] ++;
- $statusi_anketar[$row['usrid']] ++;
+ if(isset($statusi[$row['schstatus']]))
+ $statusi[$row['schstatus']] ++;
+ else
+ $statusi[$row['schstatus']] = 1;
+
+ if(isset($statusi[$row['schstatus']]))
+ $statusi_anketar[$row['usrid']] ++;
+ else
+ $statusi_anketar[$row['usrid']] = 1;
if($row['schstatus'] != '')
$contacted++;
@@ -254,21 +270,28 @@ class SurveyTelephone {
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
echo '<table class="inv_dashboard_table">';
+
echo '<tr>';
- echo '<th>'.$lang['srv_telephone_dashboard_all_respondents'].'</th>';
- echo '<th>'.(int)$statusi_all.'</th>';
- echo '<th>-</th>';
- echo '<th>100%</th>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_statistic_answer_state_frequency'].'</th>';
+ echo '<th>'.$lang['srv_statistic_answer_state_percent'].'</th>';
+ echo '</tr>';
+
+
+ echo '<tr class="semi-bold">';
+ echo '<td>'.$lang['srv_telephone_dashboard_all_respondents'].'</td>';
+ echo '<td>'.(int)$statusi_all.'</td>';
+ echo '<td>100%</td>';
echo '</tr>';
# poslano enotam
- echo '<tr>';
- echo '<th>'.$lang['srv_telephone_dashboard_all_contacted'].'</th>';
- echo '<th>'.(int)$contacted .'</th>';
- echo '<th>'.((int)$contacted > 0 ? '100%' : '0%').'</th>';
- echo '<th>'.Common::formatNumber(( (int)$contacted > 0 ? (int)$contacted*100/(int)$statusi_all : 0),0,'','%').'</th>';
+ echo '<tr class="semi-bold">';
+ echo '<td>'.$lang['srv_telephone_dashboard_all_contacted'].'</td>';
+ echo '<td>'.(int)$contacted .'</td>';
+ //echo '<td>'.((int)$contacted > 0 ? '100%' : '0%').'</td>';
+ echo '<td>'.Common::formatNumber(( (int)$contacted > 0 ? (int)$contacted*100/(int)$statusi_all : 0),0,'','%').'</td>';
echo '</tr>';
foreach (array('R','Z','N','T','P','A','U','D') AS $st) {
- if ((int)$statusi[$st] > 0) {
+ if (isset($statusi[$st]) && (int)$statusi[$st] > 0) {
if ($st == 'U') {
$css=' class="red"';
} else {
@@ -277,7 +300,7 @@ class SurveyTelephone {
echo '<tr>';
echo '<td>'.$lang['srv_telephone_status_'.$st].'</td>';
echo '<td'.$css.'>'.(int)$statusi[$st].'</td>';
- echo '<td'.$css.'>'.Common::formatNumber(((int)$statusi[$st] > 0 ? (int)$statusi[$st]*100/(int)$contacted : 0),0,'','%').'</td>';
+ //echo '<td'.$css.'>'.Common::formatNumber(((int)$statusi[$st] > 0 ? (int)$statusi[$st]*100/(int)$contacted : 0),0,'','%').'</td>';
echo '<td'.$css.'>'.Common::formatNumber(((int)$statusi[$st] > 0 ? (int)$statusi[$st]*100/(int)$statusi_all : 0),0,'','%').'</td>';
echo '</tr>';
}
@@ -410,22 +433,20 @@ class SurveyTelephone {
echo '<td class="">'.Common::formatNumberSimple(((int)$recipients_by_status['contacted'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['contacted'] : 0),0,'%').'</td>';
echo '</tr>';
echo '</table>';
- echo '<br>';
echo '</div>';
echo '</fieldset>';
}
// Sumarni pregled po anketarjih
- echo '<br/>';
- echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_telephone_dashboard_legend_anketar'].'</legend>';
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_telephone_dashboard_legend_anketar'].Help::display('srv_telefon_anketarji').':</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<table class="inv_dashboard_table">';
-
+
echo '<tr>';
- echo '<th>'.$lang['srv_telephone_dashboard_all_contacted'].'</th>';
- echo '<th>'.(int)$contacted .'</th>';
- echo '<th>'.((int)$contacted > 0 ? '100%' : '0%').'</th>';
+ echo '<th>'.$lang['srv_telephone_call_anketar'].'</th>';
+ echo '<th>'.$lang['srv_statistic_answer_state_frequency'].'</th>';
+ echo '<th>'.$lang['srv_statistic_answer_state_percent'].'</th>';
echo '</tr>';
# Loop cez vse anketarje
@@ -434,18 +455,23 @@ class SurveyTelephone {
foreach($all_users as $user){
echo '<tr>';
echo '<td>'.$user['name'].' '.$user['surname'].' <span class="gray">('.$user['email'].')</span></td>';
- echo '<td>'.(int)$statusi_anketar[$user['id']].'</td>';
- echo '<td>'.Common::formatNumberSimple(((int)$statusi_anketar[$user['id']] > 0 ? (int)$statusi_anketar[$user['id']]*100/(int)$recipients_by_status['contacted'] : 0),0,'%').'</td>';
+ echo '<td>'.(isset($statusi_anketar[$user['id']]) ? (int)$statusi_anketar[$user['id']] : '').'</td>';
+ echo '<td>'.Common::formatNumberSimple((isset($statusi_anketar[$user['id']]) && (int)$statusi_anketar[$user['id']] > 0 ? (int)$statusi_anketar[$user['id']]*100/(int)$recipients_by_status['contacted'] : 0),0,'%').'</td>';
echo '</tr>';
}
+ echo '<tr class="semi-bold">';
+ echo '<td>'.$lang['srv_telephone_dashboard_all_contacted'].'</td>';
+ echo '<td>'.(int)$contacted .'</td>';
+ echo '<td>'.((int)$contacted > 0 ? '100%' : '0%').'</td>';
+ echo '</tr>';
+
echo '</table>';
- echo '<br>';
echo '</div>';
echo '</fieldset>';
} else {
- echo '<p>'.$lang['srv_telephone_no_respondents'].'</p>';
+ echo '<p class="bottom32">'.$lang['srv_telephone_no_respondents'].'</p>';
}
}
@@ -516,7 +542,6 @@ class SurveyTelephone {
function addRecipientsView( $fields = array(), $recipients_list=null) {
#prikažemo vmesnik za dodajanje respondentov
global $lang;
- echo '<h2>'.$lang['srv_inv_add_recipients_heading'].'</h2>';
echo '<div id="inv_import">';
$this->displayAddRecipientsView($fields, $recipients_list);
@@ -560,12 +585,12 @@ class SurveyTelephone {
# profili respondentov
echo '<div id="inv_recipients_profiles_holder">';
- echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span><br/>';
+ echo '<p>'.$lang['srv_inv_recipient_select_list'].'</p>';
$this->listRecipientsProfiles();
echo '</div>'; # id=inv_recipients_profiles_holder
- echo '<div id="inv_import_list_container">';
+ echo '<fieldset id="inv_import_list_container"><legend>'.$lang['srv_inv_recipiens_from'].'</legend>';
$sqlSysMapping = sisplet_query("SELECT * FROM srv_invitations_mapping WHERE sid = '$this->sid'");
if (mysqli_num_rows($sqlSysMapping) > 0) {
@@ -573,23 +598,20 @@ class SurveyTelephone {
list($sysUserToAdd) = mysqli_fetch_row($sysUserToAddQuery);
}
- echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" checked="checked" autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
- /*echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
+ /*echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" checked="checked" autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
+ echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
echo '<span><input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label></span>';
echo '<span><input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system']
.($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label></span>';
echo Help::display('inv_recipiens_from_system');*/
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
if ($import_type == 3) {
#$this->displayFromSystemVariables();
$this->createSystemVariablesMapping();
} else {
# sporočilo za personalizirana e-vabila in respondente iz baze
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_field_note'].'</span>';
- echo '<br >';
+ echo '<p>'.$lang['srv_inv_recipiens_field_note'].'</p>';
echo '<div id="inv_field_container">';
echo '<ul class="connectedSortable">';
$field_lang = array();
@@ -603,9 +625,10 @@ class SurveyTelephone {
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
+
if ($is_selected == 1) {
$field_lang[] = $lang['srv_'.$field];
}
@@ -613,32 +636,25 @@ class SurveyTelephone {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+ echo '<script type="text/javascript">initTelephoneConnectedSortable();</script>';
# iz seznama
echo '<div id="inv_import_list"'.($import_type != 1 ? '' : ' class="hidden"').'>' ;
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_email_note'];
- echo '<br class="clr" /><span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_telephone_add_sample'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '</span>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_0">';
+ echo '<p>'.$lang['srv_inv_recipiens_email_note'].'</p>';
+ echo '<p class="top16">'.$lang['srv_inv_recipiens_sample2'].'</p>';
+ echo '<p class="top16 gray italic">'.$lang['srv_telephone_add_sample'].'</p>';
+
+ echo '<p class="top16">'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="bold inv_type_0">';
echo implode(',',$field_lang);
echo '</span>';
- echo '<br class="clr" /><textarea id="inv_recipients_list" cols="50" rows="9" name="inv_recipients_list">';
+
+ echo '<textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($recipients_list) && count($recipients_list) > 0 ) {
echo implode("\n",$recipients_list);
}
echo '</textarea>';
- echo '<br class="clr"/>';
#podatki o profilu
- echo '<br class="clr"/>';
$ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
echo '<span class="floatLeft">';
@@ -668,20 +684,21 @@ class SurveyTelephone {
}
echo '</span>';
- # če že imamo prejemnike v bazi ponudimo gumb naprej
- echo '<span class="buttonwrapper floatRight spaceLeft" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="phn_add_recipients(); return false;"><span>'.$lang['srv_telephone_add'].'</span></a></span>';
- # če je začasen avtor, ne ponudimo shrani
- if ((int)$ppid != 0) {
- echo '<span class="buttonwrapper floatRight spaceLeft" ><a class="ovalbutton ovalbutton_gray" href="#" onclick="phnSaveProfile(); return false;"><span>'.$lang['srv_telephone_save'].'</span></a></span>';
- }
- echo '<span class="buttonwrapper floatRight spaceLeft" ><a class="ovalbutton ovalbutton_gray" href="#" onclick="phnGetNewProfileName(); return false;"><span>'.$lang['srv_telephone_save_new'].'</span></a></span>';
-
echo '</div>'; # id=inv_import_list
}
- echo '</div>'; # id=inv_import_list_container
+ echo '<div class="button_holder">';
+ # če je začasen avtor, ne ponudimo shrani
+ if ((int)$ppid != 0) {
+ echo '<button class="medium white-blue" onclick="phnSaveProfile(); return false;">'.$lang['srv_telephone_save'].'</button>';
+ }
+ echo '<button class="medium white-blue" onclick="phnGetNewProfileName(); return false;">'.$lang['srv_telephone_save_new'].'</button>';
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ echo '<button class="medium blue" onclick="phn_add_recipients(); return false;">'.$lang['srv_telephone_add'].'</button>';
+ echo '</div>';
- echo '<br class="clr"/>';
+ echo '</fieldset>'; # id=inv_import_list_container
+ echo '</div>'; # id=inv_import
}
function listRecipientsProfiles() {
@@ -721,7 +738,6 @@ class SurveyTelephone {
}
echo '</ol>';
echo '</div>';
- echo '<br class="clr" />';
if ((int)$ppid > 0) {
# polovimo še ostale porfile
$sql_string = "SELECT pid FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ";
@@ -731,11 +747,8 @@ class SurveyTelephone {
# če je iz iste ankete, potem lahko urejamo
echo '<a href="#" onclick="phnDeleteProfile();" title="'.$lang['srv_inv_recipients_delete_profile'].'">'.$lang['srv_inv_recipients_delete_profile'].'</a><br/>';
echo '<a href="#" onclick="phnEditProfile();" title="'.$lang['srv_inv_recipients_edit_profile'].'">'.$lang['srv_inv_recipients_edit_profile'].'</a><br/>';
- echo '<br class="clr"/>';
}
}
-
- echo '<br class="clr" />';
}
function displayNavigation() {
@@ -750,7 +763,7 @@ class SurveyTelephone {
if (!isset($_POST['noNavi']) || (isset($_POST['noNavi']) && $_POST['noNavi'] != 'true')) {
$_sub_action = $_GET['m'];
- $active_step[] = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'');
+ $active_step = array('1'=>'', '2'=>'', '3'=>'', '4'=>'', '5'=>'', '6'=>'', '7'=>'');
switch ($_sub_action) {
case 'phn_status':
@@ -788,73 +801,72 @@ class SurveyTelephone {
$spaceChar = '&nbsp;';
- echo '<div class="phn_step_nav'.$active_step[1].'">';
- echo '<div class="phn_step">';
- echo '<a href="'.$this->addUrl('dashboard').'">';
- echo '<span class="label">'.$lang['srv_telephone_navi_dashboard'].'</span>';
- echo '</a>';
- echo '</div>';
- echo '</div>';
-
if ($this->telephoneSprId) {
#space
- echo '<div class="phn_space">&nbsp;</div>';
- $class_yellow = ' yellow';
- echo '<div class="phn_step_nav yellow">';
+ echo '<div class="phn_step_nav">';
#navigacija
- echo '<div class="phn_step'.$class_yellow.$active_step[2].'">';
- echo '<a href="'.$this->addUrl('recipients_lists').'">';
- echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_telephone_navi_add'].'</span>';
- echo '</a>';
+ echo '<div class="phn_step menu'.$active_step['2'].'" onClick="window.location.href=\''.$this->addUrl('recipients_lists').'\';return false;">';
+ echo '<div class="square">1</div>';
+ echo '<div class="label">'.$lang['srv_telephone_navi_add'].'</div>';
echo '</div>';
-
- echo '<div class="phn_step_space'.$class_yellow.'">'.$spaceChar.'</div>';
- echo '<div class="phn_step'.$class_yellow.$active_step[3].'">';
- echo '<a href="'.$this->addUrl('view_recipients').'">';
- echo '<span class="circle">2</span>';
- echo '<span class="label">'.$lang['srv_telephone_navi_view'].'</span>';
- if ($disabled == false) {
- echo '</a>';
- }
- echo '</div>';
+ echo '<div class="inv_space"></div>';
+
- echo '<div class="phn_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
+ echo '<div class="phn_step menu'.$active_step['3'].'" onClick="window.location.href=\''.$this->addUrl('view_recipients').'\';return false;">';
+ echo '<div class="square">2</div>';
+ echo '<div class="label">'.$lang['srv_telephone_navi_view'].'</div>';
+ echo '</div>';
+
+ echo '<div class="inv_space"></div>';
+
- echo '<div class="phn_step'.$class_yellow.$css_disabled.$active_step[4].'">';
- echo '<a href="'.$this->addUrl('start_call').'">';
- echo '<span class="circle">3</span>';
- echo '<span class="label" >'.$lang['srv_telephone_navi_start_call'].'</span>';
- echo '</a>';
+ echo '<div class="phn_step menu'.$active_step['4'].'" onClick="window.location.href=\''.$this->addUrl('start_call').'\';return false;">';
+ echo '<div class="square">3</div>';
+ echo '<div class="label" >'.$lang['srv_telephone_navi_start_call'].'</div>';
echo '</div>';
+
echo '</div>';
#space
- echo '<div class="phn_space">&nbsp;</div>';
+
+ echo '<div id="tel_settings_holder">';
// Cakalni seznam
- echo '<div class="phn_step_nav'.$active_step[6].'" style="margin-right:20px; width:90px;">';
- echo '<div class="phn_step">';
+ echo '<div class="phn_step_nav'.$active_step['6'].'">';
+ echo '<div class="phn_step settings">';
echo '<a href="'.$this->addUrl('calling_list').'">';
+ echo '<span class="faicon fa-address-book"></span>';
echo '<span class="label">'.$lang['srv_telephone_navi_waiting_list'].'</span>';
echo '</a>';
echo '</div>';
echo '</div>';
}
+ else {
+ echo '<div id="tel_settings_holder">';
+ }
// Nastavitve
- echo '<div class="phn_step_nav'.$active_step[5].'">';
- echo '<div class="phn_step">';
+ echo '<div class="phn_step_nav'.$active_step['5'].'">';
+ echo '<div class="phn_step settings">';
echo '<a href="'.$this->addUrl('settings').'">';
+ echo '<span class="faicon fa-cog"></span>';
echo '<span class="label">'.$lang['srv_telephone_navi_settings'].'</span>';
echo '</a>';
echo '</div>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<br class="clr" />';
+ echo '<div class="phn_step_nav'.$active_step['1'].'">';
+ echo '<div class="phn_step settings">';
+ echo '<a href="'.$this->addUrl('dashboard').'">';
+ echo '<span class="faicon fa-chart-line"></span>';
+ echo '<span class="label">'.$lang['srv_telephone_navi_dashboard'].'</span>';
+ echo '</a>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
}
}
}
@@ -867,9 +879,8 @@ class SurveyTelephone {
// Najprej cakalna vrsta (stevilke ki se bodo prikazale kasneje)
$this->waitingList();
- echo '<br /><br />';
-
// Se vrsta stevilk ki se trenutno klicejo
+ echo '<div id="tel_line_wrap">';
echo '<h2>'.$lang['srv_telephone_navi_calling_list'].'</h2>';
// Dobimo seznam vseh ki se niso bili klicani
@@ -910,7 +921,7 @@ class SurveyTelephone {
$sql_row = mysqli_fetch_assoc($sql_query_filterd_all);
foreach ($default_fields AS $key => $value) {
# če polje še ni dodano in če ni prazno, ga dodamo
- if ($fields[$key] == 0 && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
+ if ((!isset($fields[$key]) || $fields[$key] == 0) && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
$fields[$key] = 1;
$sql_select_fields[] = 'i.'.$key;
}
@@ -957,30 +968,35 @@ class SurveyTelephone {
// Stevilo stevilk v vrsti
echo '<div id="srv_invitation_note">'.$lang['srv_telephone_calling_list_count'].': '.count($toCall).'</div>';
-
- echo '<br class="clr"/>';
+ echo '</div>';
// Izrisemo tabelo
- echo '<div style="display:inline-block;">';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tbl_recipients_list" class="phone">';
// Header tabele
echo '<tr>';
- echo '<th class="tbl_icon">&nbsp;</th>';
+ echo '<th class="tbl_icon"></th>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed'){
#echo '<th class="anl_ac tbl_icon_'.$fkey.' inv_'.$fkey.'_1" title="'.$lang['srv_inv_recipients_'.$fkey].'">&nbsp;</th>';
echo '<th class="anl_ac tbl_icon_'.$fkey.'" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].'</th>';
- } else if ($fkey == 'ps_icon' ) {
- echo '<th class="anl_ac tbl_icon" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].'</th>';
- } else if ($fkey == 'date_inserted' || $fkey == 'schedule_call_time' ) {
+ }
+ else if ($fkey == 'ps_icon' ) {
+ echo '<th class="anl_ac tbl_icon"></th>';
+ }
+ else if ($fkey == 'date_inserted' || $fkey == 'schedule_call_time' ) {
echo '<th class="anl_ac tbl_date" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].'</th>';
- } else if ($fkey == 'schstatus' ) {
+ }
+ else if ($fkey == 'schstatus' ) {
echo '<th class="anl_ac" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].'</th>';
- } else if ($fkey == 'last_status' ) {
+ }
+ else if ($fkey == 'last_status' ) {
echo '<th class="anl_ac" title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
- } else {
+ }
+ else {
echo '<th title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].'</th>';
}
}
@@ -1033,7 +1049,7 @@ class SurveyTelephone {
break;
}
# če je odjavljen damo isto ikonco za zaklepanje
- if ((int)$row_users['unsubscribed'] == 1) {
+ if (isset($row_users['unsubscribed']) && (int)$row_users['unsubscribed'] == 1) {
$icon = ' phn_ico_status_key';
}
@@ -1045,7 +1061,7 @@ class SurveyTelephone {
case 'ps_icon':
echo '<td class="anl_ac'.$icon.'" onclick="phnGoToUser(\''.$sql_row['id'].'\')">';
- echo '&nbsp;';
+ echo '<span class="faicon blue phone pointer"></span>';
echo '</td>';
break;
case 'last_status':
@@ -1075,11 +1091,7 @@ class SurveyTelephone {
case 'email':
echo '<td>';
echo '<span class="as_link" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
- if ($filter != '') {
- echo $this->hightlight($sql_row[$fkey],$filter);
- } else {
- echo $sql_row[$fkey];
- }
+ echo $sql_row[$fkey];
echo '</span>';
echo '</td>';
break;
@@ -1098,12 +1110,7 @@ class SurveyTelephone {
break;
default:
echo '<td class="tbl_inv_left">';
- if ($filter != '') {
- echo $this->hightlight($sql_row[$fkey],$filter);
- } else {
- echo $sql_row[$fkey];
- }
-
+ echo $sql_row[$fkey];
echo '</td>';
break;
}
@@ -1117,12 +1124,12 @@ class SurveyTelephone {
echo '</table>';
echo '</div>';
+ echo '</div>';
}
else {
- echo $lang['srv_telephone_calling_list_empty'].'<br class="clr">';
+ echo $lang['srv_telephone_calling_list_empty'];
}
-
- echo '<br /><br /><br />';
+ echo '</div>';
}
// Seznam stevilk ki so v vrsti za klicanje
@@ -1130,6 +1137,7 @@ class SurveyTelephone {
global $lang;
global $site_url;
+ echo '<div id="tel_line_wrap0">';
echo '<h2>'.$lang['srv_telephone_navi_waiting_list'].'</h2>';
@@ -1218,11 +1226,12 @@ class SurveyTelephone {
// Stevilo stevilk v vrsti
echo '<div id="srv_invitation_note">'.$lang['srv_telephone_waiting_list_count'].': '.count($toCall).'</div>';
+ echo '</div>';
- echo '<br class="clr"/>';
// Izrisemo tabelo
- echo '<div style="display:inline-block;">';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tbl_recipients_list" class="phone">';
// Header tabele
@@ -1306,7 +1315,7 @@ class SurveyTelephone {
case 'ps_icon':
echo '<td class="anl_ac'.$icon.'" onclick="phnGoToUser(\''.$sql_row['id'].'\')">';
- echo '&nbsp;';
+ echo '<span class="blue faicon phone pointer"></span>';
echo '</td>';
break;
case 'last_status':
@@ -1336,11 +1345,7 @@ class SurveyTelephone {
case 'email':
echo '<td>';
echo '<span class="as_link" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
- if ($filter != '') {
- echo $this->hightlight($sql_row[$fkey],$filter);
- } else {
- echo $sql_row[$fkey];
- }
+ echo $sql_row[$fkey];
echo '</span>';
echo '</td>';
break;
@@ -1359,12 +1364,7 @@ class SurveyTelephone {
break;
default:
echo '<td class="tbl_inv_left">';
- if ($filter != '') {
- echo $this->hightlight($sql_row[$fkey],$filter);
- } else {
- echo $sql_row[$fkey];
- }
-
+ echo $sql_row[$fkey];
echo '</td>';
break;
}
@@ -1378,10 +1378,12 @@ class SurveyTelephone {
echo '</table>';
echo '</div>';
+ echo '</div>';
}
else {
- echo $lang['srv_telephone_waiting_list_empty'].'<br class="clr">';
+ echo $lang['srv_telephone_waiting_list_empty'];
}
+ echo '</div>';
}
@@ -1404,13 +1406,15 @@ class SurveyTelephone {
global $lang, $site_url;
#preglej prejemnike
- #echo '<h2>'.$lang['srv_inv_heading_step2'].$lang['srv_inv_edit_recipients_heading'].'</h2>';
echo '<h2>'.$lang['srv_inv_edit_recipients_heading'].'</h2>';
- #polovimo prejemnike ki ne želijo prejemati obvestil
# nastavimo filter
session_start();
- $filter = $_SESSION['inv_filter']['value'];
+
+ $filter = isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value'] : '';
+ $mysql_filter = '';
+ $mysql_filter2 = '';
+
if ($filter != '') {
$mysql_filter = " AND ("
. "i.email LIKE '%".$filter."%'"
@@ -1478,7 +1482,7 @@ class SurveyTelephone {
while ($sql_row = mysqli_fetch_assoc($sql_query_filterd_all)) {
foreach ($default_fields AS $key => $value) {
# če polje še ni dodano in če ni prazno, ga dodamo
- if ($fields[$key] == 0 && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
+ if ((!isset($fields[$key]) || $fields[$key] == 0) && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
$fields[$key] = 1;
$sql_select_fields[] = 'i.'.$key;
}
@@ -1541,39 +1545,28 @@ class SurveyTelephone {
$lists = array();
$lists['-1'] = array('name'=>$lang['srv_invitation_new_templist']);
$lists['0'] = array('name'=>$lang['srv_invitation_new_templist_author']);
- if (count($lids) > 0 ) {
+ if (is_countable($lids) && count($lids) > 0) {
$sql_string_lists = "SELECT name, pid from srv_invitations_recipients_profiles WHERE pid IN(".implode(',',$lids).") ";
$sql_query_lists = sisplet_query($sql_string_lists);
while ($row_lists = mysqli_fetch_assoc($sql_query_lists)) {
$lists[$row_lists['pid']] = array('name'=>$row_lists['name']);
}
}
- if (count($msgs) > 0) {
- echo '<span class="inv_msg_note">';
- foreach($msgs as $msg) {
- echo '* '.$msg.'<br />';
- }
- echo '</span>';
- }
- if (count($errors) > 0) {
- echo '<span class="inv_error_note">';
- foreach($errors as $error) {
- echo '* '.$error.'<br />';
- }
- echo '</span>';
- }
- if ($count_all > 0 ) {
+
+ if ($count_all > 0) {
+
+ echo '<div id="filter_wrap">';
// dodamo filtriranje
echo '<div id="inv_rec_filter">';
- echo '<label>'.$lang['srv_invitation_recipients_filter'].'</label> <input id="tel_rec_filter_value" type="text" onchange="tel_filter_recipients(); return false;" value="'.$_SESSION['inv_filter']['value'].'">';
+ echo $lang['srv_invitation_recipients_filter'];
+ echo '<input id="tel_rec_filter_value" type="text" class="text large" value="'.(isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value'] : '').'" onChange="tel_filter_recipients(); return false;">';
echo '</div>';
echo '<form id="frm_inv_rec_export" name="resp_uploader" method="post" autocomplete="off">';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
echo '<input type="hidden" name="noNavi" id="noNavi" value="true">';
- //echo '<br class="clr"/>';
echo '<div id="srv_invitation_note" style="padding-top:8px;">';
if ($filter != '') {
@@ -1585,21 +1578,22 @@ class SurveyTelephone {
if ($count_all > 0 && mysqli_num_rows($sql_query_filterd) != $count_all )
echo $lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd);
else
- echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
+ echo $lang['srv_invitation_num_respondents'].(int)$count_all;
}
echo '</div>';
-
- echo '<br class="clr"/>';
+ echo '</div>';
if (mysqli_num_rows($sql_query_filterd) > 0 && $count_all > 0) {
$this->displayPagination($filtred_all);
- echo '<div style="display:inline-block;">';
+ echo '<div>';
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tbl_recipients_list" class="phone">';
echo '<tr>';
# checkbox
- echo '<th class="tbl_icon" colspan="3" >&nbsp;</th>';
+ echo '<th></th>';
/*
* # uredi
echo '<th class="tbl_liks">&nbsp;</th>';
@@ -1614,7 +1608,7 @@ class SurveyTelephone {
#echo '<th class="anl_ac tbl_icon_'.$fkey.' inv_'.$fkey.'_1" title="'.$lang['srv_inv_recipients_'.$fkey].'">&nbsp;</th>';
echo '<th'.$this->addSortField($fkey).' class="anl_ac tbl_icon_'.$fkey.'" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].$this->addSortIcon($fkey).'</th>';
} else if ($fkey == 'ps_icon' ) {
- echo '<th'.$this->addSortField($fkey).' class="anl_ac tbl_icon" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].$this->addSortIcon($fkey).'</th>';
+ //echo '<th'.$this->addSortField($fkey).' class="anl_ac tbl_icon" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].$this->addSortIcon($fkey).'</th>';
} else if ($fkey == 'date_inserted' || $fkey == 'schedule_call_time' ) {
echo '<th'.$this->addSortField($fkey).' class="anl_ac tbl_date pointer" title="'.$lang['srv_telephone_respondents_'.$fkey].'">'.$lang['srv_telephone_respondents_'.$fkey].$this->addSortIcon($fkey).'</th>';
} else if ($fkey == 'schstatus' ) {
@@ -1647,28 +1641,28 @@ class SurveyTelephone {
;
break;
}
+
# če je odjavljen damo isto ikonco za zaklepanje
- if ((int)$row_users['unsubscribed'] == 1) {
+ if (isset($row_users['unsubscribed']) && (int)$row_users['unsubscribed'] == 1) {
$icon = ' phn_ico_status_key';
}
echo '<tr>';
# checkbox
- echo '<td><input type="checkbox" name="inv_rids[]" value="'.$sql_row['id'].'"></td>';
+ echo '<td><div class="icons"><input type="checkbox" id="'.$sql_row['id'].'" name="inv_rids[]" value="'.$sql_row['id'].'"><label for="'.$sql_row['id'].'" class="empty"></label>';
#izbriši
- echo '<td class="tbl_inv_left"><span class="faicon delete_circle icon-orange_link" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span></td>';
+ echo '<span class="faicon trash empty blue" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
#uredi
- echo '<td class="tbl_inv_left"><span class="faicon quick_edit edit smaller icon-as_link" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span></td>';
+ echo '<span class="faicon edit blue" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
switch ($fkey) {
case 'ps_icon':
- echo '<td class="anl_ac'.$icon.'" onclick="phnGoToUser(\''.$sql_row['id'].'\')">';
- echo '&nbsp;';
- echo '</td>';
+ echo '<span class="faicon blue phone" onclick="phnGoToUser(\''.$sql_row['id'].'\')"></span>';
+ echo '</div></td>';
break;
case 'last_status':
echo '<td title="'.$lang['srv_userstatus_'.$sql_row[$fkey]].'">';
@@ -1741,24 +1735,29 @@ class SurveyTelephone {
@ob_flush();
}
echo '</table>';
+ echo '</div>';
+ echo '</div>';
echo '<div id="inv_bottom_edit">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="inv_switch_on"><a href="javascript:inv_selectAll(true);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="inv_switch_off" style="display:none;"><a href="javascript:inv_selectAll(false);">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_invitation_recipients_delete_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'export\');"><span class="sprites xls delete" style="height:14px; width:16px;" title="'.$lang['srv_invitation_recipients_export_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
+ /*echo '<a href="javascript:inv_selectAll(true);"><span class="faicon arrow_up blue"></span> ';
+ echo '<span id="inv_switch_on">'.$lang['srv_select_all'].'</a></span>';
+ echo '<span id="inv_switch_off" style="display:none;"><a href="javascript:inv_selectAll(false);">'.$lang['srv_deselect_all'].'</a></span>';*/
+ echo '<a href="#" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon trash empty blue" title="'.$lang['srv_invitation_recipients_delete_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
+ echo '<a href="#" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
echo '</div>';
echo '</div>';
} else {
- echo $lang['srv_inv_list_no_recipients_filtred'].'<br class="clr">';
+ echo $lang['srv_inv_list_no_recipients_filtred'];
}
echo '</form>';
} else {
- echo $lang['srv_inv_list_no_recipients'].'<br class="clr">';
+ echo $lang['srv_inv_list_no_recipients'];
}
-
- echo '<br /><br />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location.href=\''.$this->addUrl('recipients_lists').'\';return false;">'.$lang['back'].'</button>';
+ echo '<button class="medium blue" onClick="window.location.href=\''.$this->addUrl('start_call').'\';return false;">'.$lang['next1'].'</button>';
+ echo '</div>';
}
@@ -1770,23 +1769,27 @@ class SurveyTelephone {
#preverimo koliko številk imamo na voljo
$numbersAvailable = $this->getAllNumbers();
+
+ echo '<fieldset><legend>'.$lang['srv_telephone_call_start'].'</legend>';
# preverimo aktivnost ankete
if ($this->surveySettings['active'] != 1) {
- echo $lang['srv_inv_error9'];
+ echo '<p class="bottom16">'.$lang['srv_inv_error9'].'</p>';
if ($this->isAnketar == true) {
return;
}
}
if (count($numbersAvailable) > 0 ) {
- echo '<h2>'.$lang['srv_telephone_call_available'];
+ echo '<p class="bottom16">'.$lang['srv_telephone_call_available'];
echo ' '.count($numbersAvailable);
- echo '</h2>';
- echo '<h2><a href="index.php?anketa='.$this->sid.'&a='.A_TELEPHONE.'&m=call">'.$lang['srv_call_start'].'</a></h2>';
+ echo '</p>';
+ echo '<button class="medium blue" onClick="window.location.href=\'index.php?anketa='.$this->sid.'&a='.A_TELEPHONE.'&m=call\'; return false;">'.$lang['srv_call_start'].'</button>';
} else {
$this->getNextTimeCall();
}
+
+ echo '</fieldset>';
}
/**
@@ -1798,7 +1801,7 @@ class SurveyTelephone {
$schedule = false;
// stevilka je izbrana - klicana
- if ($_GET['usr_id'] != '' && (int)$_GET['usr_id'] > 0) {
+ if (isset($_GET['usr_id']) && $_GET['usr_id'] != '' && (int)$_GET['usr_id'] > 0) {
$usr_id = (int)$_GET['usr_id'];
// zbrisemo cookie za izpolnjevanje -- da ne dobi od prejsnjega, ce je nehu nekje vmes
@@ -1816,12 +1819,12 @@ class SurveyTelephone {
#uporabnik ni izbran določimo izberemo ga naklučno oziroma če smo dogovorjeni
$row = $this->get_next_number();
$usr_id = $row['usr_id'];
- $schedule = (int)$row['schedule'] == 1 ? true : false;
+ $schedule = isset($row['schedule']) && (int)$row['schedule'] == 1 ? true : false;
}
if ((int)$usr_id > 0) {
# preverimo ali je uporabnik že začel klicat
- $openedSurvey = ($_GET['usr_id'] != '' && (int)$_GET['usr_id'] > 0) ? true : false;
+ $openedSurvey = (isset($_GET['usr_id']) && $_GET['usr_id'] != '' && (int)$_GET['usr_id'] > 0) ? true : false;
$this->userCallToShow($usr_id,$openedSurvey,$schedule);
// Po novem ze ob prikazu stevilke zaklenemo respondenta (da ga ne moreta 2 anketarja hkrati poklicati preden odpreta anketo)
@@ -1837,30 +1840,52 @@ class SurveyTelephone {
function settings() {
global $lang, $site_url;
- echo '<fieldset><legend>'.$lang['settings'].'</legend>';
+ echo '<fieldset id="tel_setting"><legend>'.$lang['settings'].'</legend>';
echo '<form id="phn_settings" method="post">';
- echo '<p>'.$lang['srv_call_settings_z'].' <input type="text" name="status_z" value="'.$this->status_z.'" style="width:20px" /> '.$lang['srv_call_settings_min'].'</p>';
- echo '<p>'.$lang['srv_call_settings_n'].' <input type="text" name="status_n" value="'.$this->status_n.'" style="width:20px" /> '.$lang['srv_call_settings_min'].'</p>';
- echo '<p>'.$lang['srv_call_settings_d'].' <input type="text" name="status_d" value="'.$this->status_d.'" style="width:20px" /> '.$lang['srv_call_settings_min'].'</p>';
- echo '<p>'.$lang['srv_call_settings_max'].' <input type="text" name="max_calls" value="'.$this->max_calls.'" style="width:20px" /> '.$lang['srv_call_settings_calls'].'</p>';
+
+ echo '<div class="set_horizontal">';
+ echo $lang['srv_call_settings_z'];
+ echo '<input type="text" class="text medium" name="status_z" value="'.$this->status_z.'"/>';
+ echo $lang['srv_call_settings_min'];
+ echo '</div>';
+ echo '<div class="set_horizontal">';
+ echo $lang['srv_call_settings_n'];
+ echo '<input type="text" class="text medium" name="status_n" value="'.$this->status_n.'"/>';
+ echo $lang['srv_call_settings_min'];
+ echo '</div>';
+ echo '<div class="set_horizontal">';
+ echo $lang['srv_call_settings_d'];
+ echo '<input type="text" class="text medium" name="status_d" value="'.$this->status_d.'"/>';
+ echo $lang['srv_call_settings_min'];
+ echo '</div>';
+ echo '<div class="set_horizontal">';
+ echo $lang['srv_call_settings_max'];
+ echo '<input type="text" class="text medium" name="max_calls" value="'.$this->max_calls.'"/>';
+ echo $lang['srv_call_settings_min'];
+ echo '</div>';
// Vrstni red klicanja
- echo '<p>';
- echo $lang['srv_call_settings_call_order'].': <select name="call_order">';
+ echo '<div class="setting_holder">';
+ echo $lang['srv_call_settings_call_order'].':';
+ echo '<select name="call_order" class="dropdown medium">';
echo '<option value="0" '.($this->call_order==0 ? ' selected="selected"' : '').'>'.$lang['srv_call_settings_call_order_0'].'</option>';
echo '<option value="1" '.($this->call_order==1 ? ' selected="selected"' : '').'>'.$lang['srv_call_settings_call_order_1'].'</option>';
echo '<option value="2" '.($this->call_order==2 ? ' selected="selected"' : '').'>'.$lang['srv_call_settings_call_order_2'].'</option>';
echo '<option value="3" '.($this->call_order==3 ? ' selected="selected"' : '').'>'.$lang['srv_call_settings_call_order_3'].'</option>';
echo '</select>';
- echo '</p>';
-
+ echo '</div>';
+
#$str = "SELECT sd.uid, u.name, u.surname, u.email FROM srv_dostop AS sd LEFT JOIN users AS u ON sd.uid = u.id WHERE sd.ank_id ='$this->sid' AND FIND_IN_SET('phone',sd.dostop )>0";
#polovimo vse userje ki imajo dostop
- echo '<p>';
- echo $lang['srv_telephone_settings_access_list'];
+
+
+ echo '<div class="setting_holder">';
+ echo '<p class="setting_title">';
+ echo $lang['srv_telephone_settings_access_list'];
printf ($lang['srv_telephone_settings_access_list_link'],$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_DOSTOP);
- echo '<table style="margin-left:20px;"><tr><th>Anketar</th><th class="anl_al">Ime, priimek, email</th></tr>';
+ echo '</p>';
+
$str = "SELECT sd.uid,FIND_IN_SET('phone',sd.dostop ) AS anketar, u.name, u.surname, u.email FROM srv_dostop AS sd LEFT JOIN users AS u ON sd.uid = u.id WHERE sd.ank_id ='$this->sid'";
$qry = sisplet_query($str);
while ($sql_row = mysqli_fetch_assoc($qry)) {
@@ -1874,24 +1899,23 @@ class SurveyTelephone {
if (trim($sql_row['email'])) {
$avtor[] = iconv("iso-8859-2", "utf-8",'<span class="gray">('.trim ($sql_row['email']).')</span>');
}
-
- echo '<tr><td>';
- echo '<input name="dostop['.$sql_row['uid'].']" type="checkbox"'.($sql_row['anketar']>0?' checked="checked"':'').'>';
- echo '</td><td>';
- if ( count($avtor) > 0 ) {
- echo implode(', ',$avtor);
+
+ if ( count($avtor) > 0 ) {
+ $label = implode(', ',$avtor);
}
- echo '</td></tr>';
+
+ echo '<div class="setting_item">';
+ echo '<input name="dostop['.$sql_row['uid'].']" id="dostop['.$sql_row['uid'].']" type="checkbox"'.($sql_row['anketar']>0?' checked="checked"':'').'>';
+ echo '<label for="dostop['.$sql_row['uid'].']">'.$label.'</label>';
+ echo '</div>';
}
- echo '</table>';
- echo '</p>';
- echo '<span class="buttonwrapper floatLeft"><a class="ovalbutton ovalbutton_orange" href="#" onclick="phn_settings_save(); return false;">'.$lang['srv_telephone_settings_save'].'</a></span>';
+ echo '</div>';
echo '</form>';
- echo '<br /><br />';
echo '</fieldset>';
-
- echo '<div id="success_save" style="display:none;">'.$lang['srv_success_save'].'</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onclick="phn_settings_save(); return false;">'.$lang['srv_telephone_settings_save'].'</button>';
+ echo '</div>';
}
function settingsSave() {
@@ -1944,43 +1968,58 @@ class SurveyTelephone {
function addSortField($field){
- $type = 'ASC';
session_start();
- if ($_SESSION['phn_rec_sort_field'] == $field) {
- if ($_SESSION['phn_rec_sort_type'] == 'DESC') {
+
+ $type = 'ASC';
+
+ if (isset($_SESSION['phn_rec_sort_field']) && $_SESSION['phn_rec_sort_field'] == $field) {
+ if (isset($_SESSION['phn_rec_sort_type']) && $_SESSION['phn_rec_sort_type'] == 'DESC') {
$type = 'ASC';
- } else {
+ }
+ else {
$type = 'DESC';
}
- } else {
+ }
+ else {
$type = 'ASC';
}
+
return ' onclick="phn_set_sort_field(\''.$field.'\',\''.$type.'\');" ';
}
+
function addSortIcon($field){
+
session_start();
- if ($_SESSION['phn_rec_sort_field'] == $field) {
- if ($_SESSION['phn_rec_sort_type'] == 'DESC') {
+
+ if (isset($_SESSION['phn_rec_sort_field']) && $_SESSION['phn_rec_sort_field'] == $field) {
+ if (isset($_SESSION['phn_rec_sort_type']) && $_SESSION['phn_rec_sort_type'] == 'DESC') {
return ' <span class="faicon sort_descending icon-blue"></span>';
-
- } else {
+ }
+ else {
return ' <span class="faicon sort_ascending icon-blue"></span>';
}
}
+
return;
}
+
function setSortField() {
session_start();
+
if (isset($_POST['field']) && trim($_POST['field']) != '') {
$_SESSION['phn_rec_sort_field'] = trim($_POST['field']);
- } else {
+ }
+ else {
$_SESSION['phn_rec_sort_field'] = 'date_inserted';
}
+
if (isset($_POST['type']) && trim($_POST['type']) != '') {
$_SESSION['phn_rec_sort_type'] = trim($_POST['type']);
- } else {
+ }
+ else {
$_SESSION['phn_rec_sort_type'] = 'ASC';
}
+
session_commit();
}
@@ -2533,7 +2572,7 @@ class SurveyTelephone {
$recipent_array = array();
$i = 0;
foreach ($fields AS $field) {
- $recipent_array[$field] = $line_array[$i];
+ $recipent_array[$field] = isset($line_array[$i]) ? $line_array[$i] : '';
$i++;
}
@@ -2911,10 +2950,8 @@ class SurveyTelephone {
echo '<br/><br/>';
echo $lang['srv_inv_recipient_list_comment'];
echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" ></textarea>';
- echo '<br class="clr" /><br class="clr" />';
echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="phnSaveNewProfile(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<br class="clr" />';
echo '</div>'; # id="inv_view_arch_recipients"
echo '<script type="text/javascript">';
echo "$('#rec_profile_name').focus();";
@@ -3050,10 +3087,8 @@ class SurveyTelephone {
echo '<input type="hidden" id="rec_profile_pid" value="'.$pid.'" >';
- echo '<br class="clr" /><br class="clr" />';
echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="phnUpdateProfile(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<br class="clr" />';
echo '</div>'; # id="inv_view_arch_recipients"
}
@@ -3106,6 +3141,8 @@ class SurveyTelephone {
$sql1 = sisplet_query("SELECT * FROM srv_invitations_recipients WHERE id = '$usr_id' AND deleted='0'");
$row1 = mysqli_fetch_array($sql1);
+
+ echo '<fieldset><legend>'.$lang['srv_telephone_call_start'].'</legend>';
echo '<table id="phn_call_table">';
# echo '<table style="width:100%" border="1">';
@@ -3115,14 +3152,24 @@ class SurveyTelephone {
<th style="width:34%">'.$lang['srv_telephone_table_comments'].'</th>
</tr>';
- echo '<tr><td valign="top">';
+ echo '<tr><td>';
$canCall = true;
$userStatus = array();
$last_status = '';
$sql2 = sisplet_query("SELECT DATE_FORMAT(insert_time, '%d.%m.%Y %H:%i:%s'), status FROM srv_telephone_history WHERE rec_id='$usr_id' ORDER BY insert_time ASC");
if (mysqli_num_rows($sql2) > 0 ) {
while (list($insert_time, $status) = mysqli_fetch_array($sql2)) {
- echo '<p>'.$insert_time.' - <strong>'.$lang['srv_telephone_status_'.$status].'</strong></p>';
+ echo '<div class="pregled_klicev">';
+ echo '<div id="top">';
+ echo '<div id="datum">';
+ echo $insert_time;
+ echo '</div>';
+ echo '<div id="status">';
+ echo $lang['srv_telephone_status_'.$status.'2'];
+ echo '</div>';
+ echo '</div>';
+ echo '<div id="comment">';
+ echo '</div>';
if ($status == 'U' || $status == 'R') {
# preverimo ali lahko uporabnika še kontaktiramo
$canCall = false;
@@ -3133,28 +3180,32 @@ class SurveyTelephone {
} else {
echo $lang['srv_telephone_status_'];
}
+
echo '</td>';
- echo '<td valign="top">';
+ echo '<td>';
if ($canCall == true) {
if ($openedSurvey) {
# zaprli smo aktivno anketo, prikažemo naslednji korak oz. izbiro zaključne akcije
- echo '<h2 class="red">'.$lang['srv_telephone_calling_number_end'].'</h2>';
- echo '<h2 class="red">'.$row1['phone'].'</h2>';
+ echo '<p class="bottom16">'.$lang['srv_telephone_calling_number_end'].$row1['phone'].'</p>';
} else {
- echo '<h2 class="red">'.$lang['srv_telephone_calling_number'].($schedule == true ? $lang['srv_telephone_call_was_schedule']:'').'</h2>';
- echo '<h2 class="red">'.$row1['phone'].'</h2>';
+ echo '<p class="bottom16">'.$lang['srv_telephone_calling_number'].($schedule == true ? $lang['srv_telephone_call_was_schedule']:' ').$row1['phone'].'</p>';
}
-
+
+ echo '<p class="bottom16 semi-bold caps">'.$lang['srv_telephone_calling_number_info'].'</p>';
+
if($row1['firstname'] != '')
- echo '<h2>'.$lang['name'].': '.$row1['firstname'].'</h2>';
+ echo '<p>'.$lang['name'].': '.$row1['firstname'].'<p>';
if($row1['lastname'] != '')
- echo '<h2>'.$lang['surname'].': '.$row1['lastname'].'</h2>';
+ echo '<p>'.$lang['surname'].': '.$row1['lastname'].'</p>';
if($row1['email'] != '')
- echo '<h2>'.$lang['email'].': '.$row1['email'].'</h2>';
+ echo '<p>'.$lang['email'].': '.$row1['email'].'</p>';
if($row1['custom'] != '')
- echo '<h2>Custom: '.$row1['custom'].'</h2>';
+ echo '<p>Custom: '.$row1['custom'].'</p>';
+
+ if($row1['firstname'] != '' || $row1['lastname'] != '' || $row1['email'] != '' || $row1['custom'] != '')
+ echo '<p class="bottom16"></p>';
}
else {
# onemogočimo ponovno klicanje uporabnika ker je zaključena ali je zavrnil
@@ -3189,43 +3240,40 @@ class SurveyTelephone {
$intro = $lang['srv_intro'];
}
- echo '<p>'.$lang['srv_telephone_call_introduction'];
+ echo '<p class="semi-bold caps bottom16">'.$lang['srv_telephone_call_introduction'].'</p>';
echo '<div class="phn_user_intro">';
echo $intro;
echo '</div>';
- echo '</p>';
- echo '<br/>';
echo '</td>';
- echo '<td valign="top">';
-
+ echo '<td>';
if ($canCall == true) {
- if ($openedSurvey) {
+ /*if ($openedSurvey) {
# zaprli smo aktivno anketo, prikažemo naslednji korak oz. izbiro zaključne akcije
echo '<p class="red strong">'.$lang['srv_telephone_calling_step_action'].'</p>';
} else {
echo '<p class="red strong">'.$lang['srv_telephone_calling_next_step'].'</p>';
- }
+ }*/
- echo '<div style="padding-left: 20px;">';
+ echo '<div>';
if ($openedSurvey) {
# uporqabnik je odprl anketo
- echo '<p><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=U">'.$lang['srv_call_successful2'].'</a></p>';
+ echo '<p class="bottom8"><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=U">'.$lang['srv_call_successful2'].'</a></p>';
} else {
# uporabnik še ni odprl ankete
- echo '<p><span class="as_link" onclick="phnStartSurvey(\''.$usr_id.'\');">'.$lang['srv_call_open_startCall'].$lang['srv_call_open'].'</span></p>';
+ echo '<button class="small blue" onclick="phnStartSurvey(\''.$usr_id.'\');">'.$lang['srv_call_open'].'</button>';
}
if ($openedSurvey) {
} else {
# če smo na userju, potem smo ga dobili, zato ne more bit nedosegljiv ali zaseden
- echo '<p><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=Z">'.$lang['srv_call_zaseden'].'</a></p>';
- echo '<p><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=N">'.$lang['srv_call_ga_ni'].'</a></p>';
+ echo '<p class="bottom8"><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=Z">'.$lang['srv_call_zaseden'].'</a></p>';
+ echo '<p class="bottom8"><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=N">'.$lang['srv_call_ga_ni'].'</a></p>';
}
- echo '<p><a href="#" onclick="phnShowPopupAddMarker(\''.$usr_id.'\',\'T\'); return false;">'.$lang['srv_call_zmenjen'].'</a></p>';
- echo '<p><a href="#" onclick="phnShowPopupAddMarker(\''.$usr_id.'\',\'P\'); return false;">'.$lang['srv_call_prekinjen'].'</a></p>';
+ echo '<p class="bottom8"><a href="#" onclick="phnShowPopupAddMarker(\''.$usr_id.'\',\'T\'); return false;">'.$lang['srv_call_zmenjen'].'</a></p>';
+ echo '<p class="bottom8"><a href="#" onclick="phnShowPopupAddMarker(\''.$usr_id.'\',\'P\'); return false;">'.$lang['srv_call_prekinjen'].'</a></p>';
echo '<p><a href="ajax.php?anketa='.$this->sid.'&t='.A_TELEPHONE.'&m=addmark&usr_id='.$usr_id.'&status=D">'.$lang['srv_call_prelozen'].'</a></p>';
# preverimo koliko številk še imamo razen trenutno izbrane
@@ -3236,18 +3284,16 @@ class SurveyTelephone {
if ($allUsers > 0) {
// Dovolimo izbrati novo stevilko samo v primeru ko imamo nakljucno sortiranje
if($this->call_order == 0)
- echo '<p><br /><a href="'.$this->addUrl('clear_current').'">'.$lang['srv_telephone_call_action_cancel_nextNumber'].' ('.count($toCall).')</a></p>';
+ echo '<p class="top16 bottom16"><a href="'.$this->addUrl('clear_current').'">'.$lang['srv_telephone_call_action_cancel_nextNumber'].' ('.count($toCall).')</a></p>';
}
# na voljo je samo ta številka, ne moremo ponudit druge
else {
- echo '<p><br /><a href="'.$this->addUrl('start_call').'">'.$lang['srv_telephone_call_action_cancel_preview'].' ('.count($toCall).')</a></p>';
+ echo '<p class="top16 bottom16"><a href="'.$this->addUrl('start_call').'">'.$lang['srv_telephone_call_action_cancel_preview'].' ('.count($toCall).')</a></p>';
}
// Razveljavimo zadnji status (undo)
if($last_status == 'A')
- echo '<p><a href="#" onClick="phnUndoStatus(\''.$usr_id.'\')">'.$lang['srv_telephone_call_action_undo_status'].' (»'.$last_status.'«)</a></p>';
-
- echo '<div id="telephone_popup" />';
+ echo '<p class="bottom16"><a href="#" onClick="phnUndoStatus(\''.$usr_id.'\')">'.$lang['srv_telephone_call_action_undo_status'].' (»'.$last_status.'«)</a></p>';
echo '</div>';
} else {
@@ -3276,38 +3322,56 @@ class SurveyTelephone {
// Razveljavimo zadnji status (undo)
echo '<p><a href="#" onClick="phnUndoStatus(\''.$usr_id.'\')">'.$lang['srv_telephone_call_action_undo_status'].' (»'.$last_status.'«)</a></p>';
}
+
+ $qry_comment = sisplet_query("SELECT comment from srv_telephone_comment WHERE rec_id = '$usr_id'");
+ if(mysqli_num_rows($qry_comment) > 0){
+ $row_comment = mysqli_fetch_assoc($qry_comment);
+
+ echo $lang['srv_telephone_call_comment'];
+
+ echo '<div id="phn_user_comment" class="editable" onblur="phnSetUserComment(this,\''.$usr_id.'\');return false;" contentEditable="true">';
+ echo $row_comment['comment'];
+ echo '</div>';
+ }
+
+
# spodnje akcije
# če je anketar ne prikazujemo nextAction
if ($this->isAnketar == false) {
- echo '<div style="border-top:1px solid gray;">';
- echo '<p>';
+
session_start();
$nextAction = 1;
if (isset($_SESSION['phnNextAction'][$this->sid]) && (int)$_SESSION['phnNextAction'][$this->sid]==0) {
$nextAction = 0;
}
- echo '<label><input type="radio" name="phnNextAction" id="phn_exit" value="0"'.($nextAction == 0?' checked="checked"':'').' onchange="phnNextActionChange(this); return false;">';
+
+ /*echo '<div class="button_holder">';
+ echo '<button class="small white-blue" onclick="phnNextActionChange(0);">'.$lang['srv_telephone_call_action_cancel'].'</button>';
+ echo '<button class="small blue" onclick="phnNextActionChange(1);">'.$lang['srv_telephone_call_action_nextNumber'].'</button>';
+ echo '</div>';*/
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="phnNextAction" id="phn_exit" value="0"'.($nextAction == 0?' checked="checked"':'').' ; return false;"><label for="phn_exit">';
echo $lang['srv_telephone_call_action_cancel'].'</label>';
- echo '<label><input type="radio" name="phnNextAction" id="phn_next" value="1"'.($nextAction == 1?' checked="checked"':'').' onchange="phnNextActionChange(this); return false;">';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="phnNextAction" id="phn_next" value="1"'.($nextAction == 1?' checked="checked"':'').' onchange="phnNextActionChange(this); return false;"><label for="phn_next">';
echo $lang['srv_telephone_call_action_nextNumber'].'</label>';
- echo '</p>';
echo '</div>';
+
+ echo '</div>';
+
+
+
}
-
- $str_comment = "SELECT comment from srv_telephone_comment WHERE rec_id = '$usr_id'";
- $qry_comment = sisplet_query($str_comment);
- $row_comment = mysqli_fetch_assoc($qry_comment);
- echo '<p>';
- echo $lang['srv_telephone_call_comment'];
- echo '<div id="phn_user_comment" class="editable" onblur="phnSetUserComment(this,\''.$usr_id.'\');return false;" contentEditable="true">';
- echo $row_comment['comment'];
- echo '</div>';
- echo '</p>';
echo '</td></tr>';
echo '</table>';
+ echo '</fieldset>';
}
@@ -3316,9 +3380,10 @@ class SurveyTelephone {
*/
function displayPagination($all_records) {
global $lang,$site_url;
+
#trenutna stran
$page = isset($_GET['page']) ? $_GET['page'] : '1';
- $current = is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
+ $current = (is_numeric($page) && (int)$page > 0) ? $page : '1';
$all = ceil($all_records / REC_ON_PAGE);
@@ -3398,11 +3463,12 @@ class SurveyTelephone {
function startSurvey() {
# nastavimo marker na A
# in vrnemo dva urlja, enega za reload strani, drugega pa odpiranje ankete
- global $lang,$site_url, $global_user_id;
+ global $lang, $site_url, $global_user_id;
$return = array('error'=>'1', 'msg'=>'Napaka','reloadUrl'=>'','surveyUrl'=>'');
if ((int)$_POST['usr_id'] > 0) {
+
$usr_id = (int)$_POST['usr_id'];
# nastavimo url za nastavitev statusa in reload strani
@@ -3423,7 +3489,7 @@ class SurveyTelephone {
$user_data = mysqli_fetch_assoc($chk_query);
# sestavimo še url za odpiranje izpolnjevanja ankete
- $return['surveyUrl'] = $site_url.'a/'.Common::encryptAnketaID($this->sid).'&survey-'.$this->sid.'&code='.$user_data['pass'];
+ $return['surveyUrl'] = $site_url.'a/'.SurveyInfo::getInstance()->getSurveyHash().'&survey-'.$this->sid.'&code='.$user_data['pass'];
$return['error'] = '';
}
else {
@@ -3472,7 +3538,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);
@@ -3481,7 +3547,7 @@ class SurveyTelephone {
sisplet_query("COMMIT");
# sestavimo še url za odpiranje izpolnjevanja ankete
- $return['surveyUrl'] = $site_url.'a/'.Common::encryptAnketaID($this->sid).'&survey-'.$this->sid.'&code='.$res_row[password];
+ $return['surveyUrl'] = $site_url.'a/'.SurveyInfo::getInstance()->getSurveyHash().'&survey-'.$this->sid.'&code='.$res_row[password];
$return['error'] = '';
}
}
@@ -3497,6 +3563,11 @@ class SurveyTelephone {
$newDate = date('d.m.Y H:i', time()+3600 );
$marker = $_POST['marker'];
$usr_id = (int)$_POST['usr_id'];
+
+ echo '<h2>'.$lang['srv_inv_recipients_status'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#telephone_popup\').hide(); $(\'#fade\').fadeOut(\'slow\');">✕</a></div>';
+
+ $button_setting = '';
if ($usr_id > 0 && ($marker == 'P' || $marker == 'T')) {
if ($marker == 'T') {
@@ -3508,8 +3579,11 @@ class SurveyTelephone {
}
echo '<p><form name="'.$marker.'">';
- echo '<input id="'.$marker.'_datetime" type="text" name="'.$marker.'_datetime" value="'.$newDate.'" />
- <span class="faicon calendar_icon icon-as_link" id="'.$marker.'_datetime_image"></span>
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<input id="'.$marker.'_datetime" type="text" class="text large" name="'.$marker.'_datetime" value="'.$newDate.'" />
+ <span class="faicon calendar_icon blue pointer" id="'.$marker.'_datetime_image"></span>
<script type="text/javascript">
Calendar.setup({
inputField : "'.$marker.'_datetime",
@@ -3517,16 +3591,23 @@ class SurveyTelephone {
button : "'.$marker.'_datetime_image",
singleClick : true
});
- </script></form>
- </p>';
-
+ </script></form>';
+ echo '</div>';
+ echo '</div>';
+ }
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#telephone_popup\').hide(); $(\'#fade\').fadeOut(\'slow\');">'.$lang['edit1338'].'</button>';
+
+ if ($usr_id > 0 && ($marker == 'P' || $marker == 'T')){
+
if ($marker == 'T') {
- echo '<span class="buttonwrapper floatRight spaceRight" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="phnAddMarker(\''.$usr_id.'\',\''.$marker.'\'); return false;"><span>'.$lang['srv_call_zmenjen'].'</span></a></span>';
+ echo '<button class="medium blue" onclick="phnAddMarker(\''.$usr_id.'\',\''.$marker.'\'); return false;">'.$lang['srv_call_zmenjen'].'</button>';
} else if ($marker == 'P') {
- echo '<span class="buttonwrapper floatRight spaceRight" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="phnAddMarker(\''.$usr_id.'\',\''.$marker.'\'); return false;"><span>'.$lang['srv_call_prekinjen'].'</span></a></span>';
+ echo '<button class="medium blue" onclick="phnAddMarker(\''.$usr_id.'\',\''.$marker.'\'); return false;">'.$lang['srv_call_prekinjen'].'</button>';
}
}
- echo '<span class="buttonwrapper floatRight spaceRight" ><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#telephone_popup\').hide(); $(\'#fade\').fadeOut(\'slow\'); "><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '</div>';
}
// Nastavimo filter za pregled respondentov
diff --git a/admin/survey/classes/class.SurveyTextAnalysis.php b/admin/survey/classes/class.SurveyTextAnalysis.php
index 2f083e8..e5e1ad8 100644
--- a/admin/survey/classes/class.SurveyTextAnalysis.php
+++ b/admin/survey/classes/class.SurveyTextAnalysis.php
@@ -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!';
diff --git a/admin/survey/classes/class.SurveyTheme.php b/admin/survey/classes/class.SurveyTheme.php
index 9793b76..978d6be 100644
--- a/admin/survey/classes/class.SurveyTheme.php
+++ b/admin/survey/classes/class.SurveyTheme.php
@@ -15,7 +15,6 @@ class SurveyTheme {
global $site_domain;
global $global_user_id;
global $admin_type;
- global $debug;
$this->sid = $sid;
@@ -65,14 +64,13 @@ class SurveyTheme {
10 => 'Otroci4.css',
11 => 'Embed.css',
12 => 'Embed2.css',
- 13 => 'Slideshow.css'
+ //13 => 'Slideshow.css'
);
- //if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
- $standard_skins[14] = 'Uni.css';
- $standard_skins[15] = 'Fdv.css';
- $standard_skins[16] = 'Cdi.css';
- $standard_skins[17] = 'WebSM.css';
- //}
+
+ $standard_skins[14] = 'Uni.css';
+ $standard_skins[15] = 'Fdv.css';
+ $standard_skins[16] = 'Cdi.css';
+ $standard_skins[17] = 'WebSM.css';
// Novi safe skini so v loceni skupini
$safe_skins = array(
@@ -96,11 +94,10 @@ class SurveyTheme {
5 => 'MobilePurple.css',
6 => 'MobileBlack.css'
);
- //if((($admin_type == '0' || $admin_type == '1') && (strpos($site_url, 'www.1ka.si') || strpos($site_url, 'test.1ka.si'))) || $debug == '1'){
- $mobile_skins[7] = 'MobileUni.css';
- $mobile_skins[8] = 'MobileFdv.css';
- $mobile_skins[9] = 'MobileCdi.css';
- //}
+
+ $mobile_skins[7] = 'MobileUni.css';
+ $mobile_skins[8] = 'MobileFdv.css';
+ $mobile_skins[9] = 'MobileCdi.css';
// Safe skini
if(in_array($file, $safe_skins)){
@@ -164,7 +161,7 @@ class SurveyTheme {
break;
case 'checboxThemeSave':
$this->ajaxSaveChecboxTheme($_POST['anketa'],$_POST['checkbox']);
- breake;
+ break;
default:
print_r("<pre>");
@@ -182,6 +179,7 @@ class SurveyTheme {
$groupId = 0;
echo '<div class="themes-content">';
+
echo '<div id="div_theme_groups">';
$this->displayGroupSelector($groupId);
@@ -222,7 +220,7 @@ class SurveyTheme {
// preusmeritev, ko kliknemo na prilagodi pri sistemski MOBILNI temi in naredimo nov profil
if ( isset($_GET['profile_new_mobile']) ) {
- if ($_GET['name'] != '')
+ if (isset($_GET['name']) && $_GET['name'] != '')
$name = $_GET['name'];
else
$name = $_GET['profile_new_mobile'].'';
@@ -240,10 +238,10 @@ class SurveyTheme {
$row = SurveyInfo::getInstance()->getSurveyRow();
// urejanje CSSa
- if ( $_GET['t'] == 'css' ) {
+ if (isset($_GET['t']) && $_GET['t'] == 'css') {
// CSS za mobilen skin
- if($_GET['mobile'] == '1'){
+ if(isset($_GET['mobile']) && $_GET['mobile'] == '1'){
$sqlp = sisplet_query("SELECT usr_id, skin FROM srv_theme_profiles_mobile WHERE id = '".$_GET['profile']."'");
$rowp = mysqli_fetch_array($sqlp);
@@ -316,12 +314,6 @@ class SurveyTheme {
echo '<div class="themes-content">';
- $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$_GET['profile']."'");
- $row = mysqli_fetch_array($sql);
-
- echo '<h2>'.$lang['srv_themes_mod'].': <span class="red">'.$row['name'].'</span></h2>';
- //self::displayTabs();
-
if ( !isset($_GET['t']) ) {
$ste = new SurveyThemeEditor($this->sid);
@@ -350,22 +342,114 @@ class SurveyTheme {
$simple_name = $this->current_skin;
if ($row['skin_profile'] == 0) {
- $skin_name = $this->strip_name($simple_name);
- } else {
+ $skin_name = self::strip_name($simple_name);
+ }
+ else {
$sqla = sisplet_query("SELECT name FROM srv_theme_profiles WHERE id = '".$row['skin_profile']."'");
$rowa = mysqli_fetch_array($sqla);
$skin_name = $rowa['name'];
}
+ echo '<h2 class="first">'.$lang['srv_current_theme'].'</h2>';
+
+ //AKTIVNA SPLOŠNA TEMA
+ echo '<div class="theme_list active_theme">';
+
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="desc">('.$lang['srv_current_theme_general'].')</span>';
+ echo '</div>';
+
+ if($row['skin_profile'] == 0){
+ $preview_link = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme='.$simple_name.'';
+ $modify_link = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&profile_new=' . $simple_name . '\'';
+ }
+ else {
+ $preview_link = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme_profile='.$row['skin_profile'];
+ $modify_link = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&profile=' . $row['skin_profile'] . '\'';
+ }
+
+ //Gumbi
+ echo '<div class="options option1" >';
+
+ echo '<span class="faicon dots" onclick="$(\'#buttons-window1\').toggleClass(\'displayNone\');"> </span>';
+
+ // echo '<img src="\public\img\icons\dots.svg">';
+ echo '<i class="fa-solid fa-ellipsis"></i>';
+ echo ' </button>';
+
+ echo '<div class= "buttons-window displayNone buttons-window1" id="buttons-window1">';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$preview_link.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href='.$modify_link.'" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+
+ //AKTIVNA MOBILNA TEMA
+ $simple_name = $this->current_mobile_skin;
+
+ if ($row['skin_profile_mobile'] == 0) {
+ $skin_name = self::strip_name($simple_name);
+ } else {
+ $sqla = sisplet_query("SELECT name FROM srv_theme_profiles_mobile WHERE id = '".$row['skin_profile_mobile']."'");
+ $rowa = mysqli_fetch_array($sqla);
+ $skin_name = $rowa['name'];
+ }
+
+ echo '<div class="theme_list active_theme">';
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="desc">('.$lang['srv_current_theme_mobile'].')</span>';
+ echo '</div>';
- echo '<span class="theme_header">'.$lang['srv_current_theme'].': ';
- if($row['skin_profile'] == 0){
- echo '<a href="index.php?anketa=' . $this->sid . '&a=theme-editor&profile_new=' . $simple_name . '"><span class="bold" style="font-size:16px;">' . $skin_name . '</span>' . '</a>';
- }else {
- echo '<a href="index.php?anketa=' . $this->sid . '&a=theme-editor&profile=' . $row['skin_profile'] . '"><span class="bold" style="font-size:16px;">' . $skin_name . '</span>' . '</a>';
+ if($row['skin_profile_mobile'] == 0){
+ $preview_link_mobile = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme='.$simple_name.'&mobile=1';
+ $modify_link_mobile = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&mobile=1&profile_new_mobile=' . $simple_name . '\'';
+ }
+ else {
+ $preview_link_mobile = SurveyInfo::getSurveyLink().'&no_preview=1&preview=on&theme_profile='.$row['skin_profile_mobile'].'&mobile=1';
+ $modify_link_mobile = '\'index.php?anketa=' . $this->sid . '&a=theme-editor&mobile=1&profile=' . $row['skin_profile_mobile'] . '\'';
}
+
+ //Gumbi
+ echo '<div class="options">';
+
+ echo '<span class="faicon dots" onclick="$(\'#buttons-window2\').toggleClass(\'displayNone\');"> </span>';
+
+ echo '<div class="buttons-window displayNone" id="buttons-window2">';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$preview_link_mobile.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href='.$modify_link_mobile.'" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ echo '</div>';
- echo '</span><br /><br />';
+ echo '</div>';
+
+ echo '</div>';
+
}
function displayAdvancedSettings ($groupId) {
@@ -448,8 +532,6 @@ class SurveyTheme {
global $lang, $site_url;
global $global_user_id;
- //if (count($this->groups[$groupId]['skins'])>0 || $groupId == -1) {
-
$rowa = SurveyInfo::getSurveyRow();
if($groupId == -2)
@@ -459,12 +541,15 @@ class SurveyTheme {
elseif ($groupId != -1)
echo '<h2>'.$lang['srv_system_themes'].'</h2>';
else{
- echo '<h2>'.$lang['srv_user_themes'].' ';
- echo '<span class="user_themes_button faicon plus icon-blue pointer" style="margin-bottom:6px;" onClick="toggle_custom_themes(); return false;"> </span>';
+ echo '<h2 class="pointer" onClick="toggle_custom_themes(); return false;"><span class="user_themes_button faicon fa-angle-down"> </span>'.$lang['srv_user_themes'].' ';
echo '</h2>';
}
- echo '<div id="div_theme_group" '.($groupId==-1 ? ' class="custom" style="display:none;"' : '').'>';
+ if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) {
+ echo '<div id="theme_grid_holder">';
+ }
+
+ echo '<div class="div_theme_group '.($groupId==-1 ? ' custom' : '').'">';
$sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id='$this->sid' ORDER BY vrstni_red ASC LIMIT 1");
$rowg = mysqli_fetch_array($sqlg);
@@ -501,24 +586,56 @@ class SurveyTheme {
$skin = $row['skin'];
$src = ''.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$row['id'].'';
$is_current_skin = ($rowa['skin_profile'] == $row['id']) ? true : false;
-
- echo '<div class="custom_theme_holder '.($is_current_skin ? ' active' : '').'">';
-
- // Title
- echo '<span class="custom_theme_title" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$row['name'].'" title="'.$lang['srv_changetheme'].'" onclick="te_change_profile(\''.$row['id'].'\', true); return false;" alt="'.$row['name'].'">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
-
- // Preview theme
- echo ' <a href="#" class="theme_links_preview" src="'.$src.'"><span class="custom_theme_preview"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</span></a>';
- // Delete theme
- if ($groupId == -1)
- echo ' <a href="#" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', false); return false;" class="theme_delete" css="'.urlencode($skin).'"><span class="custom_theme_delete"><span class="faicon delete_circle icon-orange"></span> '.$lang['srv_anketadelete_txt'].'</span></a>';
-
- // Edit theme
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'"><span class="custom_theme_edit"><span class="faicon palette"></span> '.$lang['edit3'].'</span></a>';
-
+ echo '<div class="theme_list" onclick="te_change_profile(\''.$row['id'].'\', true);">';
+
+ echo '<div class="theme">';
+ echo ' <span class="name">'.$skin_name.'</span>';
+ echo ' <span class="name">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
+ echo ' <span class="desc">('.$lang['srv_current_theme_general'].')</span>';
echo '</div>';
+
+
+ echo '<div class="options options'.$row['id'].'" id="options'.$row['id'].'">';
+
+ echo '<span class="faicon dots" onclick="show_settings(\''.$row['id'].'\'); event.stopPropagation();"> </span>';
+
+ echo '<div class="buttons-window displayNone" id="additional_settings_'.$row['id'].'">';
+
+ //Aktiviraj
+ echo '<div class="button" onclick="te_change_profile(\''.$row['id'].'\', true); event.stopPropagation();" title="'.$lang['srv_te_theme_activate2'].'">';
+ echo '<span class="faicon fa-hand-pointer"></span>';
+ echo '<div class="aktiviraj">';
+ echo $lang['srv_te_theme_activate'] ;
+ echo '</div>';
+ echo '</div>';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$src.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href=\'index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ //Izbriši
+ if ($groupId == -1) {
+ echo '<div class="button theme_delete" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', false); event.stopPropagation();" title="'.$lang['srv_te_theme_delete2'].'">';
+ echo '<span class="faicon trash empty"></span>';
+ echo $lang['srv_anketadelete_txt'];
+ echo '</div>';
+ }
+
+ echo '</div>'; // additional_settings
+ echo '</div>'; //div.options
+
+ echo '</div>'; //div.theme_list
+
$profiles++;
}
@@ -529,31 +646,72 @@ class SurveyTheme {
$skin = $row['skin'];
$src = ''.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$row['id'].'&mobile=1';
$is_current_skin = ($rowa['skin_profile_mobile'] == $row['id']) ? true : false;
-
- echo '<div class="custom_theme_holder '.($is_current_skin ? ' active' : '').'">';
-
- // Title
- echo '<span class="custom_theme_title" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$row['name'].'" title="'.$lang['srv_changetheme'].'" onclick="te_change_profile(\''.$row['id'].'\', true, true); return false;" alt="'.$row['name'].'">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').' <span class="italic">('.$lang['srv_mobile_theme'].')</span></span>';
-
- // Preview theme
- echo ' <a href="#" class="theme_links_preview" src="'.$src.'"><span class="custom_theme_preview"><span class="faicon preview"></span>'.$lang['srv_poglejanketo2'].'</span></a>';
- // Delete theme
- if ($groupId == -1)
- echo ' <a href="#" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', true); return false;" class="theme_delete" css="'.urlencode($skin).'"><span class="custom_theme_delete"><span class="faicon delete_circle icon-orange"></span> '.$lang['srv_anketadelete_txt'].'</span></a>';
-
- // Edit theme
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'&mobile=1"><span class="custom_theme_edit"><span class="faicon palette"></span> '.$lang['edit3'].'</span></a>';
-
+ echo '<div class="theme_list" onclick="te_change_profile(\''.$row['id'].'\', true, true); return false;">';
+
+ echo '<div class="theme">';
+ echo '<span class="name">'.$skin_name.'</span>';
+ echo '<span class="name">'.substr($row['name'], 0, 30).(strlen($row['name']) > 30 ? '...' : '').'</span>';
+ echo '<span class="desc">('.$lang['srv_mobile_theme'].')</span>';
echo '</div>';
+
+ //Gumbi
+ echo '<div class="options options_mobile'.$row['id'].'" id="options'.$row['id'].'">';
+
+ echo '<span class="faicon dots" onclick="show_settings_mobile(\''.$row['id'].'\'); event.stopPropagation();"></span>';
+
+ echo '<div class="buttons-window" id="additional_settings_mobile_'.$row['id'].'">';
+ //Aktiviraj
+ echo '<div class="button" onclick="te_change_profile(\''.$row['id'].'\', true, true); event.stopPropagation();" title="'.$lang['srv_te_theme_activate2'].'">';
+ echo '<span class="faicon fa-hand-pointer"></span>';
+ echo '<div class="aktiviraj">';
+ echo $lang['srv_te_theme_activate'];
+ echo '</div>';
+ echo '</div>';
+
+ //Predogled
+ echo '<div class="button theme_links_preview" src="'.$src.'" title="'.$lang['srv_poglejanketo2'].'">';
+ echo '<span class="faicon fa-desktop"></span>';
+ echo $lang['srv_poglejanketo2'];
+ echo '</div>';
+
+ //Prilagodi
+ echo '<div class="button palette" onclick="window.location.href=\'index.php?anketa='.$this->sid.'&a=theme-editor&profile='.$row['id'].'&mobile=1\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'">';
+ echo '<span class="faicon palette"></span>';
+ echo $lang['srv_te_theme_edit'];
+ echo '</div>';
+
+ //Izbriši
+ if ($groupId == -1) {
+ echo '<div class="button theme_delete" onclick="if (confirm(\''.$lang['srv_ask_delete'].'\')) te_delete_profile(\''.$row['id'].'\', true); event.stopPropagation();" title="'.$lang['srv_te_theme_delete2'].'">';
+ echo '<span class="faicon trash empty"></span>';
+ echo $lang['srv_anketadelete_txt'];
+ echo '</div>';
+ }
+
+ echo '</div>'; //additional settings
+ echo '</div>'; //div.options
+
+ echo '</div>'; //div.theme_list
+
$profiles++;
}
-
- if(mysqli_num_rows($sql) > 0)
- echo '<br />';
}
+
+ // Klik izven - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".buttons-window, .options");
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".buttons-window").addClass("displayNone");
+ }
+ });
+ </script>';
+
+
+ // Splošne teme - GRID
if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) {
foreach ($this->groups[$groupId]['skins'] AS $skinid => $skin) {
@@ -565,39 +723,67 @@ class SurveyTheme {
if(substr($skin, 0, 6) == 'Mobile')
$src .= '&mobile=1';
- echo '<div class="theme_label '.($is_current_skin || $is_current_mobile_skin ? 'span_theme_current' : '').'">';
+ // Preview slika
+ $css = urlencode($skin);
+ $gid = $groupId;
+
+
+ echo '<div class="theme_label '.($is_current_skin || $is_current_mobile_skin ? 'span_theme_current' : '').'" onclick="changeTheme(\''.$gid.'\', \''.$css.'\');" title="'.$lang['srv_te_theme_activate2'].'">';
echo '<div class="theme_label_content">';
- // Preview slika
- if ($groupId == -1) echo '<a href="#" class="theme_delete theme" gid="'.$groupId.'" css="'.urlencode($skin).'">'.$lang['srv_anketadelete_txt'].'</a>';
- //echo '<span class="theme_links_rename as_link" theme="'.urlencode($skin).'">Preimenuj</span>';
- if ($groupId == -1)
- echo '<img src="'.$site_url.'public/img/skins_previews/'.($groupId==-1?'usertheme':urlencode($simple_name)).'.png" onclick="te_change_profile_oldskin(\''.$simple_name.'\', true); return false;" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
+ if ($groupId == -1)
+ echo '<a href="#" class="theme_delete theme" gid="'.$groupId.'" css="'.urlencode($skin).'">'.$lang['srv_anketadelete_txt'].'</a>';
+
+ if ($groupId == -1) {
+ echo '<img src="'.$site_url.'public/img/skins_previews/'.($groupId==-1?'usertheme':urlencode($simple_name)).'.png" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
+ }
else
echo '<img src="'.$site_url.'public/img/skins_previews/'.urlencode($simple_name).'.png" class="theme" gid="'.$groupId.'" css="'.urlencode($skin).'" alt="'.$simple_name.'" title="'.$lang['srv_changetheme'].'">';
-
+
+ echo '</div>';
+
+ //Gumbi
+ echo '<div class="theme_label_options">';
+
// Ime teme
+ echo "<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>";
echo '<span class="theme_name">';
- echo $this->strip_name($simple_name.($simple_name=='1kaBlue' || $simple_name=='MobileBlue' ? ' ('.$lang['default'].')' : ''));
+ echo self::strip_name($simple_name.($simple_name=='1kaBlue' || $simple_name=='MobileBlue' ? '<div class="privzeto"> ('.$lang['default'].') </div>' : ''));
+
// Vprasajcki
- if($simple_name == 'Embed' || $simple_name == 'Embed2' || $simple_name == 'Fdv' || $simple_name == 'Uni' || $simple_name == 'Slideshow')
- echo ' '.Help :: display('srv_skins_'.$simple_name);
+ if( in_array($simple_name, array('Fdv', 'Cdi', 'Uni', 'MobileFdv', 'MobileCdi', 'MobileUni')) ){
+ echo ' '.Help::display('srv_skins_Fdv');
+ }
+ elseif($simple_name == 'Embed' || $simple_name == 'Embed2' || $simple_name == 'Slideshow'){
+ echo ' '.Help::display('srv_skins_'.$simple_name);
+ }
+
if($groupId == -1)
echo ' (CSS)';
echo '</span>';
+
+ echo '<div class="buttons_flex">';
+
+ // Prilagodi - samo ce je tema aktivna
+ if($is_current_skin || $is_current_mobile_skin){
+
+ if ($groupId == -3)
+ $link = 'index.php?anketa='.$this->sid.'&a=theme-editor&profile_new_mobile='.$rowa['mobile_skin'];
+ else
+ $link = 'index.php?anketa='.$this->sid.'&a=theme-editor&profile_new='.$rowa['skin'];
+
+ echo ' <span class="faicon palette" onclick="window.location.href=\''.$link.'\'; event.stopPropagation();" title="'.$lang['srv_te_theme_edit'].'"></span>';
+ }
+
+ // Predogled
+ echo ' <span class="faicon fa-desktop" onclick="window.location.href=\''.$src.'\'; event.stopPropagation();" title="'.$lang['srv_poglejanketo2'].'"></span>';
+
+ echo '</div>'; // div.buttons_flex
echo '</div>';
-
- if($is_current_skin)
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile_new='.$rowa['skin'].'"><span class="faicon palette"></span> '.$lang['srv_te_theme_edit'].'</a>';
-
- if($is_current_mobile_skin)
- echo ' <a href="index.php?anketa='.$this->sid.'&a=theme-editor&profile_new_mobile='.$rowa['mobile_skin'].'"><span class="faicon palette"></span> '.$lang['srv_te_theme_edit'].'</a>';
-
- echo '<a href="#" class="theme_links_preview" src="'.$src.'"><span class="faicon preview"></span> '.$lang['srv_poglejanketo2'].'</a>';
- echo '</div>';
+ echo '</div>'; //div.theme_label
}
}
elseif ($profiles == 0) {
@@ -606,6 +792,10 @@ class SurveyTheme {
}
echo '</div>';
+
+ if ( isset($this->groups[$groupId]['skins']) && count($this->groups[$groupId]['skins']) > 0 ) { // div#theme_grid_holder
+ echo '</div>';
+ }
}
function changeTheme($css, $gid) {
@@ -666,9 +856,10 @@ class SurveyTheme {
function changeProgressbar() {
$progressbar = $_POST['progressbar'];
- $strUpdate = "UPDATE srv_anketa SET progressbar = '$progressbar' WHERE id=".$this->sid;
- $updated = sisplet_query($strUpdate);
+
+ $updated = sisplet_query("UPDATE srv_anketa SET progressbar = '$progressbar' WHERE id=".$this->sid);
sisplet_query("COMMIT");
+
SurveyInfo :: getInstance()->resetSurveyData();
}
@@ -799,16 +990,24 @@ class SurveyTheme {
}
// iz imena skina odstrani uid stevilko userja in _
- function strip_name ($simple_name) {
-
+ static function strip_name ($simple_name) {
+ global $lang;
+
// Popravimo se default skine - vstavimo presledek da lepse izgleda
$skins = array(
- '1kaBlue (Privzeto)', '1kaRed', '1kaOrange', '1kaGreen', '1kaPurple', '1kaBlack', '1kaOffice', '1kaNature',
- 'MobileBlue (Privzeto)', 'MobileRed', 'MobileOrange', 'MobileGreen', 'MobilePurple', 'MobileBlack',
+ '1kaBlue ('.$lang['default'].')', '1kaBlue', '1kaRed', '1kaOrange', '1kaGreen', '1kaPurple', '1kaBlack', '1kaOffice', '1kaNature',
+ 'MobileBlue ('.$lang['default'].')', 'MobileBlue', 'MobileRed', 'MobileOrange', 'MobileGreen', 'MobilePurple', 'MobileBlack',
'MobileUni', 'MobileFdv', 'MobileCdi'
);
if(in_array($simple_name, $skins)){
- $simple_name = preg_replace('/(?<!\ )[A-Z]/', ' $0', $simple_name);
+
+ $name_array = explode(' ', $simple_name);
+ $name_array[0] = preg_replace('/(?<!\ )[A-Z]/', ' $0', $name_array[0]);
+
+ $simple_name = $name_array[0];
+
+ if(isset($name_array[1]))
+ $simple_name .= ' '.$name_array[1];
}
if ( is_numeric( substr($simple_name, 0, strpos($simple_name, '_')) ) )
@@ -826,17 +1025,30 @@ class SurveyTheme {
$default = 'Default';
$skin = ($row['skin'] == '') ? $default : $row['skin'];
- echo '<br /><span class="bold">'.$lang['srv_add_theme_upload'].'</span>';
- echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&profile='.$_GET['profile'].'" method="post">';
- echo '<p><label for="skin">' . $lang['srv_uploadtheme'] . ':</label> ';
+ $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
+ $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+
+ echo '<fieldset id="theme-upload"><legend>'.$lang['srv_themes_upload_css'].'</legend>';
+
+ $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$profile."'");
+ $row = mysqli_fetch_array($sql);
+
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$row['name'].'</span></h2>';
+
+ echo '<p class="bottom16">'.$lang['srv_add_theme_upload'].':</p>';
+ echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&profile='.$profile.'" method="post">';
echo '<input type="file" name="fajl" onchange="submit();">';
- echo ' (' . $lang['srv_skintmpl1'] . ' <a href="' . $site_url . 'main/survey/skins/'.$skin.'.css" target="_blank">' . $lang['srv_skintmpl'] . '</a>)';
- echo '</p></form>';
+ echo '</form>';
+ echo '<p class="top16">'.$lang['srv_skintmpl1'] . ' <a href="' . $site_url . 'main/survey/skins/'.$skin.'.css" target="_blank">' . $lang['srv_skintmpl'] . '</a>.</p>';
- echo '<p style="font-size:90%; color: gray">'.$lang['srv_skin_disclamer'].'</p>';
+ echo '<p class="top16">'.$lang['srv_skin_disclamer'].'</p>';
+
+ echo '<p class="top16">'.$lang['srv_skin_warning'].'</p>';
echo '<a href="#" onclick="$(\'#vrednost_edit\').hide().html(\'\'); return false;" style="position:absolute; right:10px; bottom:10px">'.$lang['srv_zapri'].'</a>';
+
+ echo '</fieldset>';
}
@@ -849,16 +1061,20 @@ class SurveyTheme {
$row = SurveyInfo::getInstance()->getSurveyRow();
- $skin = $_GET['skin'];
+ $skin = isset($_GET['skin']) ? $_GET['skin'] : '';
+ $profile = isset($_GET['profile']) ? $_GET['profile'] : '';
+ $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+
+ echo '<div id="theme-edit-wrap">';
echo '<div id="theme-editor">';
+
+ $sql = sisplet_query("SELECT name FROM srv_theme_profiles".$mobile." WHERE id = '".$profile."'");
+ $row = mysqli_fetch_array($sql);
- echo '<div id="theme-editor-warning">'.$lang['srv_themes_edit_warning'].'</div>';
-
- echo '<form name="editcss" action="ajax.php?anketa='.$this->sid.'&a=save_editcss" method="post" onsubmit="return false;">';
-
- $profile = $_GET['profile'];
- $mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? true : false;
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$row['name'].'</span></h2>';
+
+ echo '<form name="editcss" action="ajax.php?anketa='.$this->sid.'&a=save_editcss" method="post" onsubmit="return false;">';
$sqlp = sisplet_query("SELECT usr_id FROM srv_theme_profiles".($mobile ? '_mobile' : '')." WHERE id = '$profile'");
$rowp = mysqli_fetch_array($sqlp);
@@ -869,54 +1085,17 @@ class SurveyTheme {
echo '<input type="hidden" name="skin_name" value="'.$skin_name.'">';
echo '<input type="hidden" name="profile" value="'.$_GET['profile'].'">';
echo '<input type="hidden" name="mobile" value="'.($mobile ? '1' : '0').'">';
-
- echo '<br />';
-
- echo '<span class="bold">'.$lang['srv_themes_edit'].'</span>';
- echo '<p><textarea name="css_content" style="width:100%; height: 400px">';
-
- readfile('../../main/survey/skins/'.$skin.'.css');
-
- echo '</textarea></p>';
-
- echo '<p>';
-
- echo '<p><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings floatLeft spaceRight" href="#" onclick="';
- ?>$.post('ajax.php?anketa=<?=$this->sid?>&a=save_editcss', $('form[name=editcss]').serialize(), function (data) {
- //if ( $('input[name=skin_name]').val() != $('input[name=old_name]').val() ) {
- // window.location.href = 'index.php?anketa=<?=$this->sid?>&a=edit_css&skin='+data;
- //} else {
- var iframe = document.getElementById('theme-preview-iframe');
- iframe.src = iframe.src;
- if ( $('input[name=current_skin]').is(':checked') ) $('input[name=current_skin]').attr('disabled', true);
- //}
- }); return false;<?php
- echo '"><span>'. $lang['edit1337'] . '</span></a>';
-
- //echo '<a class="ovalbutton ovalbutton_gray spaceRight floatLeft" href="index.php?anketa='.$this->sid.'&a=tema"><span>'.$lang['srv_theme_save_as_new'].'</span></a>';
-
- echo '<a class="ovalbutton ovalbutton_gray floatLeft" href="index.php?anketa='.$this->sid.'&a=tema"><span>'.$lang['back'].'</span></a></p>';
- echo '<div class="clr"></div>';
- echo '</div></p>';
- echo '</form>';
-
- echo '<br /><p><a href="#" onclick="javascript:$(\'#show_more\').slideToggle(); return false;">'.$lang['srv_upload_pic'].'</a></p>';
+
+ //Upload slike / Logo
+ /*echo '<p class="top16"><a href="#" onclick="javascript:$(\'#show_more\').slideToggle(); return false;">'.$lang['srv_upload_pic'].'</a></p>';
echo '<fieldset id="show_more" style="'.($_GET['pic']=='open'?'':'display:none;').' margin-bottom:40px">';
-
- echo '<br /><span class="bold">'.$lang['srv_upload_pic'].':</span>';
- /*echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&logo=1" method="post" />';
- echo '<p><label for="skin">' . $lang['srv_upload_logo'] . ':</label> ';
- echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
- echo '</p></form>'; */
-
+ echo '<p class="bottom16">'.$lang['srv_upload_pic'].':</p>';
echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->sid . '&skin='.$skin.'&profile='.$_GET['profile'].'" method="post" />';
- echo '<p><label for="skin">' . $lang['srv_upload_pic2'] . ':</label> ';
echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
echo '</p></form>';
- echo '<p style="font-size:90%; color: gray">'.$lang['srv_upload_pic_disclaimer'].'</p><br />';
-
+
// prikazemo uploadane slike
$dir = opendir($site_path . 'main/survey/uploads/');
$skinsArray = array();
@@ -937,9 +1116,36 @@ class SurveyTheme {
}
}
}
- echo '</fieldset>';
- echo '<div id="success_save"></div>';
+ echo '</fieldset>';*/
+
+ echo '<p class="top16 bottom16">'.$lang['srv_skin_warning_edit'].'</p>';
+
+ echo '<p><textarea id="css_content" name="css_content">';
+
+ readfile('../../main/survey/skins/'.$skin.'.css');
+
+ echo '</textarea></p>';
+
+ echo '<p>';
+
+ echo '<div class="button_holder css_edit">';
+ echo '<button class="medium white-blue" onClick="window.location.href=\'index.php?anketa='.$this->sid.'&a=tema\';return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="';
+ ?>$.post('ajax.php?anketa=<?=$this->sid?>&a=save_editcss', $('form[name=editcss]').serialize(), function (data) {
+ //if ( $('input[name=skin_name]').val() != $('input[name=old_name]').val() ) {
+ // window.location.href = 'index.php?anketa=<?=$this->sid?>&a=edit_css&skin='+data;
+ //} else {
+ var iframe = document.getElementById('theme-preview-iframe');
+ iframe.src = iframe.src;
+ if ( $('input[name=current_skin]').is(':checked') ) $('input[name=current_skin]').attr('disabled', true);
+ //}
+ }); return false;<?php
+ echo '"><span>'. $lang['edit1337'].'</button>';
+ echo '</div>';
+
+
+ echo '</form>';
echo '</div>';
@@ -947,16 +1153,11 @@ class SurveyTheme {
$row = mysqli_fetch_array($sql);
$grupa = $row['id'];
- //echo '<div id="theme-preview"><iframe id="theme-preview-iframe" src="'.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme='.$skin.'"></iframe></div>';
echo '<div id="theme-preview"><iframe id="theme-preview-iframe" src="'.SurveyInfo::getSurveyLink().'&grupa='.$grupa.'&no_preview=1&preview=on&theme_profile='.$_GET['profile'].'&theme-preview=1'.($mobile ? '&mobile=1' : '').'"></iframe><div class="theme-overflow"></div></div>';
-
- //echo '</div>';
-
- //echo '<div class="clr"></div>';
-
- //echo '</div>';
SurveyThemeEditor::new_theme_alert($skin_name, true);
+ echo '</div>';
+
}
function ajax_add_theme () {
diff --git a/admin/survey/classes/class.SurveyThemeEditor.php b/admin/survey/classes/class.SurveyThemeEditor.php
index ef85967..527f285 100644
--- a/admin/survey/classes/class.SurveyThemeEditor.php
+++ b/admin/survey/classes/class.SurveyThemeEditor.php
@@ -48,12 +48,20 @@ class SurveyThemeEditor {
SurveyInfo::getInstance()->SurveyInit($this->anketa);
$row = SurveyInfo::getInstance()->getSurveyRow();
- $sqla = sisplet_query("SELECT id, name, logo FROM srv_theme_profiles".$this->mobile." WHERE id = '$this->profile'");
+ $sqla = sisplet_query("SELECT id, name, logo FROM srv_theme_profiles".$this->mobile." WHERE id='$this->profile'");
$rowa = mysqli_fetch_array($sqla);
- self::new_theme_alert($rowa['name']);
+ $skin_name = SurveyTheme::strip_name($rowa['name']);
+
+
+ self::new_theme_alert($skin_name);
+
+ echo '<div id="theme-edit-wrap">';
echo '<div id="theme-editor">';
+
+ echo '<h2>'.$lang['srv_themes_mod2'].': <span class="name">'.$skin_name.'</span></h2>';
+
echo '<input type="hidden" name="profile" id="profile" value="'.$this->profile.'">';
$mobile = (isset($_GET['mobile']) && $_GET['mobile'] == '1') ? 1 : 0;
@@ -61,131 +69,129 @@ class SurveyThemeEditor {
echo '<div id="picker"></div>';
- echo '<fieldset><legend>'.$lang['srv_skinname'].'</legend>';
- echo '<p>'.$lang['srv_skinname'].': <input type="text" name="skin-name" value="'.$rowa['name'].'" onblur="te_change_name(this);"></p>';
- echo '</fieldset>';
-
- echo '<br />';
+ echo '<h3>'.$lang['srv_skinname'].'</h3>';
+ echo '<input type="text" class="text medium" id="skin-name" name="skin-name" value="'.$skin_name.'" onblur="te_change_name(this);">';
// Mobilni skin nima logotipa
if($mobile != 1){
- echo '<fieldset><legend>'.$lang['srv_upload_logo'].'</legend>';
+ echo '<h3>'.$lang['srv_upload_logo'].'</h3>';
echo '<form name="upload" enctype="multipart/form-data" action="upload.php?anketa=' . $this->anketa . '&logo=1&te=1&profile='.$this->profile.'" method="post" />';
- echo '<p>' . $lang['srv_upload_logo'] . ': ';
echo '<input type="file" name="fajl" onchange="submit();" onmouseout="survey_upload();" />';
if ($rowa['logo'] != '') {
echo '<p>'.$rowa['logo'];
- echo ' <a href="#" onclick="survey_remove_logo(\''.$this->profile.'\'); return false" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon delete_circle icon-orange_link"></span></a>';
+ echo ' <a href="#" onclick="survey_remove_logo(\''.$this->profile.'\'); return false" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
echo '</p>';
}
echo '</p></form>';
- echo '</fieldset>';
- echo '<br />';
}
// Mobilni skin nima progressbara
if($mobile != 1){
$sqlg = sisplet_query("SELECT id FROM srv_grupa WHERE ank_id = '$this->anketa'");
if (mysqli_num_rows($sqlg) > 1) {
- echo '<fieldset><legend>'.$lang['srv_te_progressbar'].'</legend>';
- echo '<div id="theme_progressbar">';
- echo '<p><label>' . $lang['srv_te_progressbar_show'] . ':</label> ';
- echo '<label for="theme_progressbar_1"><input type="radio" id="theme_progressbar_1" name="progressbar" value="1"' . ($row['progressbar'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>' . $lang['yes'] . '</label> ';
- echo '<label for="theme_progressbar_0"><input type="radio" id="theme_progressbar_0" name="progressbar" value="0"' . ($row['progressbar'] == 0 ? ' checked="checked"' : '') . ' autocomplete="off"/>' . $lang['no1'] . '</label> ';
- echo '</p></div>'; # id="theme_progressbar"
- echo '</fieldset>';
-
- echo '<br />';
+
+ $sqlAnketa = sisplet_query("SELECT progressbar FROM srv_anketa WHERE id='$this->anketa'");
+ $rowAnketa = mysqli_fetch_array($sqlAnketa);
+
+ echo '<h3>'.$lang['srv_te_progressbar'].'</h3>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">' . $lang['srv_te_progressbar_show'] . '</span>';
+
+ echo '<div class="setting_item" id="theme_progressbar">';
+ echo '<input type="radio" id="theme_progressbar_1" name="progressbar" value="1"' . ($rowAnketa['progressbar'] == 1 ? ' checked="checked"' : '') . ' autocomplete="off"/>';
+ echo '<label for="theme_progressbar_1">' . $lang['yes'] . '</label> ';
+ echo '</div>';
+ echo '<div class="setting_item" id="theme_progressbar">';
+ echo '<input type="radio" id="theme_progressbar_0" name="progressbar" value="0"' . ($rowAnketa['progressbar'] == 0 ? ' checked="checked"' : '') . ' autocomplete="off"/>';
+ echo '<label for="theme_progressbar_0">' . $lang['no1'] . '</label> ';
+ echo '</div>';
+
+ echo '</div>';
}
}
- echo '<fieldset><legend>'.$lang['srv_te_survey_h_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_survey_h_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(1, 1);
$this->displayOption(1, 4);
$this->displayOption(1, 2);
$this->displayOption(1, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_outer_frame'].'</legend>';
+ echo '<h3>'.$lang['srv_te_background_color'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(6, 3);
- echo '</fieldset>';
-
- echo '<br />';
-
- echo '<fieldset><legend>'.$lang['srv_te_question_border'].'</legend>';
- $this->displayOption(5, 5);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_question_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_question_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(2, 1);
$this->displayOption(2, 4);
$this->displayOption(2, 2);
+ echo '</div>';
+ echo '<div class="columns top16">';
$this->displayOption(5, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ $this->displayOption(5, 5);
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_answers_text'].'</legend>';
+ echo '<h3>'.$lang['srv_te_answers_text'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(3, 1);
$this->displayOption(3, 4);
- $this->displayOption(3, 2);
+ echo '</div>';
+ echo '<div class="columns top16">';$this->displayOption(3, 2);
$this->displayOption(4, 3);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
// Custom checkbox/radio (stars, smilies, thumbs)
- echo '<fieldset>';
// Radio/checkboxi za pc
if($mobile != 1){
- echo '<legend>'.$lang['srv_te_custom_checkbox_radio'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_checkbox_radio'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(7, 7);
$this->displayOption(7, 15);
+ echo '</div>';
//$this->displayOption(10, 17);
}
// Radio/checkboxi za mobitel
else{
- echo '<legend>'.$lang['srv_te_custom_mobile_checkbox_radio'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_mobile_checkbox_radio'].'</h3>';
+ echo '<div class="columns">';
$this->displayOption(7, 8);
$this->displayOption(7, 16);
+ echo '</div>';
// Za mobitel ne rabimo accessibility ikon
//$this->displayOption(10, 17);
}
- echo '</fieldset>';
-
- echo '<br />';
// Tooltipster/slovar/glossary
- echo '<fieldset><legend>'.$lang['srv_te_custom_glossary_popup'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_glossary_popup'].Help::display('srv_oblika_slovarSlovar').'</h3>';
+ echo '<div class="columns">';
$this->displayOption(8, 9);
$this->displayOption(8, 11);
$this->displayOption(8, 10);
$this->displayOption(8, 12);
- echo '</fieldset>';
-
- echo '<br />';
+ echo '</div>';
- echo '<fieldset><legend>'.$lang['srv_te_custom_glossary_keywords'].'</legend>';
+ echo '<h3>'.$lang['srv_te_custom_glossary_keywords'].Help::display('srv_oblika_slovarIKljucna').'</h3>';
+ echo '<div class="columns">';
$this->displayOption(9, 9);
$this->displayOption(9, 13);
$this->displayOption(9, 14);
- echo '</fieldset>';
-
-
- echo '<p><label><input type="checkbox" name="current_skin" value="1" '.($row['skin_profile'] == $rowa['id']?'checked disabled':'').' onchange="$(this).attr(\'disabled\', true); te_change_profile(\''.$this->profile.'\'); return false;"> '.$lang['srv_save_set_theme'].'</label></p>';
-
- echo '<p>';
- echo '<div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange floatLeft" href="index.php?anketa='.$this->anketa.'&a=tema"><span>'.$lang['edit1337'].'</span></a></div>';
- echo '</p>';
-
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onClick="window.location.href=\'index.php?anketa='.$this->anketa.'&a=tema\';return false;">'.$lang['edit1337'].'</button>';
echo '</div>';
+ echo '</div>';
+
$this->preview();
+
+ echo '</div>';
?>
<script>
@@ -195,8 +201,6 @@ class SurveyThemeEditor {
</script>
<?
- //echo '</div>';
-
}
static function new_theme_alert ($name, $css=false) {
@@ -233,29 +237,38 @@ class SurveyThemeEditor {
$sql = sisplet_query("SELECT value FROM srv_theme_editor".$this->mobile." WHERE profile_id='$this->profile' AND id='$id' AND type='$type'");
$row = mysqli_fetch_array($sql);
- echo '<p>';
-
+ $row['value'] = isset($row['value']) ? $row['value'] : '';
+
// pisava
if ($type == 1) {
+
+ echo '<div class="setting_box">';
- echo ''.$lang['srv_te_font_family'].': <select name="font'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
- echo '<option value=""'.(''==$row['value']?' selected':'').' style="font-size:13px">'.$lang['srv_te_default'].'</option>';
+ echo ''.$lang['srv_te_font_family'].': <select class="dropdown large auto-save" name="font'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
+ echo '<option value=""'.(''==$row['value']?' selected':'').'">'.$lang['srv_te_default'].'</option>';
foreach (self::$fonts AS $key => $val) {
echo '<option value="'.$key.'"'.($key==$row['value']?' selected':'').' style="font-family: '.$val.'; font-size:13px">'.substr($val, 0, strpos($val, ',')).'</option>';
}
echo '</select> ';
-
+
if ($row['value'] != '')
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div> ';
// barva pisave, barva ozadja
} elseif (($type == 3 && $id != 1) || in_array($type, [2, 9, 10, 13, 15, 16])) {
- if ($row['value'] == '') $value = '#000000'; else $value = $row['value'];
+ if ($row['value'] == '')
+ $value = '#000000';
+ else
+ $value = $row['value'];
+
+ echo '<div class="setting_box">';
if ($type == 2 || $type == 9)
echo ''.$lang['srv_te_font_color'].': ';
- elseif ($type == 3)
+ elseif($type == 3)
echo ''.$lang['srv_te_background_color'].': ';
elseif($type == 10)
echo ''.$lang['srv_te_custom_border_color'].': ';
@@ -266,17 +279,23 @@ class SurveyThemeEditor {
elseif($type == 16)
echo ''.$lang['srv_te_custom_icon_mobile_color'].': ';
- if ($row['value'] == '') echo '<span><a href="#" onclick="$(\'#color-'.$id.'-'.$type.'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span>';
+ if ($row['value'] == '') echo '<div class="input_box"><a href="#" onclick="$(\'#color-'.$id.'-'.$type.'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></div>';
- echo '<span id="color-'.$id.'-'.$type.'" '.($row['value']==''?'style="display:none;"':'').'>';
- echo '<input type="text" id="color'.$id.'-'.$type.'" class="colorwell auto-save" name="color'.$id.'-'.$type.'" value="'.$value.'" data-id="'.$id.'" data-type="'.$type.'"> ';
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
- echo '</span>';
+ echo '<div id="color-'.$id.'-'.$type.'" '.($row['value']==''?'style="display:none;"':'').'>';
+ echo '<input type="text" class="text large colorwell auto-save" id="color'.$id.'-'.$type.'" name="color'.$id.'-'.$type.'" value="'.$value.'" data-id="'.$id.'" data-type="'.$type.'"> ';
+ echo '</div>';
+
+ if ($row['value'] != '')
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div>';
// velikost pisave
} elseif ($type == 4) {
+
+ echo '<div class="setting_box">';
- echo ''.$lang['srv_te_font_size'].': <select name="fontsize'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo ''.$lang['srv_te_font_size'].': <select class="dropdown large auto-save" name="fontsize'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=50; $i<=200; $i+=10) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').' style="font-size: '.$i.'%;">'.$i.'%</option>';
@@ -284,25 +303,33 @@ class SurveyThemeEditor {
echo '</select> ';
if ($row['value'] != '')
- echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="sprites arrow_undo"></span></a>';
-
+ echo '<a href="#" onclick="te_remove_setting(\''.$id.'\', \''.$type.'\'); return false;" title="'.$lang['srv_te_remove_setting'].'"><span class="faicon trash"></span></a>';
+
+ echo '</div> ';
+
// border vprasanja
} elseif ($type == 5) {
if ($row['value'] == '') $value = '1'; else $value = $row['value'];
- echo $lang['srv_te_question_border'].': <select name="question_border'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
- echo '<option value="" '.(''==$row['value']?' selected':'').'>'.$lang['default'].'</option>';
+ echo '<div class="setting_box">';
+
+ echo $lang['srv_te_question_border'].':<select class="dropdown large auto-save" name="question_border'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
+ echo '<option value="" '.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
echo '<option value="0" '.($row['value']=='0'?' selected':'').'>'.$lang['srv_te_question_border_0'].'</option>';
echo '<option value="1" '.($row['value']=='1'?' selected':'').'>'.$lang['srv_te_question_border_1'].'</option>';
echo '<option value="2" '.($row['value']=='2'?' selected':'').'>'.$lang['srv_te_question_border_2'].'</option>';
echo '</select> ';
+ echo '</div> ';
// izbira custom checkbox/radio gumbov
} elseif($type == 7 ) {
+
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_icon_pc'] . ': ';
- echo '<select id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">
- <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['default'].'</option>
+ echo '<select class="dropdown large auto-save" id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'">
+ <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['srv_te_default'].'</option>
<option value="18" '.($row['value'] == 18 ? " selected":"").'>18 px</option>
<option value="21" '.($row['value'] == 21 ? " selected":"").'>21 px</option>
<option value="25" '.($row['value'] == 25 ? " selected":"").'>25 px</option>
@@ -312,13 +339,14 @@ class SurveyThemeEditor {
<option value="45" '.($row['value'] == 45 ? " selected":"").'>45 px</option>
<option value="50" '.($row['value'] == 50 ? " selected":"").'>50 px</option>
<option value="55" '.($row['value'] == 55 ? " selected":"").'>55 px</option>
- </select>';
+ </select></div>';
} elseif($type == 8) {
+ echo '<div class="setting_box">';
echo $lang['srv_te_custom_icon_mobile'] . ': ';
- echo '<select id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">
- <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['default'].'</option>
+ echo '<select class="dropdown large auto-save" id="izbira-checkbox-gumbov" data-id="'.$id.'" data-type="'.$type.'">
+ <option value="0" '.(($row['value'] == 0 || is_null($row['value'])) ? " selected":"").'>'.$lang['srv_te_default'].'</option>
<option value="21" '.($row['value'] == 20 ? " selected":"").'>20 px</option>
<option value="25" '.($row['value'] == 25 ? " selected":"").'>25 px</option>
<option value="30" '.($row['value'] == 30 ? " selected":"").'>30 px</option>
@@ -327,44 +355,55 @@ class SurveyThemeEditor {
<option value="45" '.($row['value'] == 45 ? " selected":"").'>45 px</option>
<option value="50" '.($row['value'] == 50 ? " selected":"").'>50 px</option>
<option value="55" '.($row['value'] == 55 ? " selected":"").'>55 px</option>
- </select>';
+ </select></div>';
// Izpišemo border opcije
} elseif($type == 11) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_border_size'].': ';
- echo '<select name="bordersize'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name="bordersize'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=1; $i<=6; $i++) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').'>'.$i.'px</option>';
}
echo '</select> ';
+ echo '</div> ';
} elseif($type == 12) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_border_radius'].': ';
- echo '<select name="borderradius'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name="borderradius'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
for ($i=5; $i<=30; $i+=5) {
echo '<option value="'.$i.'"'.($i==$row['value']?' selected':'').'>'.$i.'px</option>';
}
echo '</select> ';
+ echo '</div> ';
// Stil pisave bold, italic, underline
} elseif($type == 14) {
+ echo '<div class="setting_box">';
+
echo $lang['srv_te_custom_font_style_keywords'].': ';
- echo '<select name=""keyword_style'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save">';
+ echo '<select class="dropdown large auto-save" name=""keyword_style'.$id.'" data-id="'.$id.'" data-type="'.$type.'">';
echo '<option value=""'.(''==$row['value']?' selected':'').'>'.$lang['srv_te_default'].'</option>';
echo '<option value="bold" '.('bold'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_bold'].'</option>';
echo '<option value="italic" '.('italic'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_italic'].'</option>';
echo '<option value="underline" '.('underline'==$row['value']?' selected':'').'>'.$lang['srv_te_custom_font_style_keywords_underline'].'</option>';
echo '</select> ';
+ echo '</div> ';
// Accessibility checkbox (radio/checkboxi niso obarvani)
} elseif($type == 17) {
+ echo '<div class="setting_box">';
+
echo '<label for="accessibility'.$id.'">'.$lang['srv_te_custom_icon_accessibility'].': ';
echo '<input type="checkbox" value="1" name="accessibility'.$id.'" id="accessibility'.$id.'" data-id="'.$id.'" data-type="'.$type.'" class="auto-save" '.($row['value'] == '1' ? ' checked="checked"' : '').'></label>';
+ echo '</div> ';
}
- echo '</p>';
}
function preview () {
diff --git a/admin/survey/classes/class.SurveyTimeProfiles.php b/admin/survey/classes/class.SurveyTimeProfiles.php
index 0c88b11..37628c7 100644
--- a/admin/survey/classes/class.SurveyTimeProfiles.php
+++ b/admin/survey/classes/class.SurveyTimeProfiles.php
@@ -74,9 +74,9 @@ class SurveyTimeProfiles {
self::$profiles['-1'] = array('id'=>'-1',
'name'=>$lang['srv_temp_profile'],
'type'=>$_SESSION['time_profile'][self::$surveyId]['type'],
- 'starts'=>$_SESSION['time_profile'][self::$surveyId]['starts'],
- 'ends'=>$_SESSION['time_profile'][self::$surveyId]['ends'],
- 'interval_txt'=>$_SESSION['time_profile'][self::$surveyId]['interval_txt']);
+ 'starts'=>(isset($_SESSION['time_profile'][self::$surveyId]['starts']) ? $_SESSION['time_profile'][self::$surveyId]['starts'] : null),
+ 'ends'=>(isset($_SESSION['time_profile'][self::$surveyId]['ends']) ? $_SESSION['time_profile'][self::$surveyId]['ends'] : null),
+ 'interval_txt'=>(isset($_SESSION['time_profile'][self::$surveyId]['interval_txt']) ? $_SESSION['time_profile'][self::$surveyId]['interval_txt'] : null));
$dsp = -1;
} else {
@@ -361,13 +361,9 @@ class SurveyTimeProfiles {
$css = ($izbranProfil == STP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $izbranProfil != STP_DEFAULT_PROFILE) {
- if ($showseperator == true) {
- echo '<li class="space">&nbsp;</li>';
- }
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">' . $lang['srv_time_profile_link'] . '</span>';
+ echo ' <span class="'.$css.'" id="link_time_profile" title="' . $lang['srv_time_profile_link_title'] . '" onClick="timeProfileAction(\'showProfiles\');">' . $lang['srv_time_profile_link'] . '</span>';
echo '</li>';
-
}
}
@@ -390,25 +386,30 @@ class SurveyTimeProfiles {
$currentFilterProfile = $_all_profiles[$current_pid];
if ( $current_pid != STP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div class="time_profile_left_right floatLeft">';
- echo '<div class="time_profile_holder">';
- # zlistamo vse profile
- echo '<div id="time_profile" class="select">';
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div class="time_profile_holder popup_left">';
+
+ # zlistamo vse profile
+ echo '<div id="time_profile" class="list select">';
if (count($_all_profiles)) {
foreach ($_all_profiles as $id=>$profile) {
- echo '<div class="option' . ($current_pid == $id ? ' active' : '') . '" id="time_profile_' . $id . '" value="'.$id.'">';
+ echo '<div class="list-item option' . ($current_pid == $id ? ' active' : '') . '" id="time_profile_' . $id . '" value="'.$id.'">';
echo $profile['name'];
if($current_pid == $id){
+ echo '<div class="profile_icons">';
+
# privzetega profila ne moremo ne zbrisat ne preimenovat
if ($current_pid != 0) {
echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="timeProfileAction(\'show_delete\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>';
@@ -416,68 +417,96 @@ class SurveyTimeProfiles {
if ($current_pid > 0) {
echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="timeProfileAction(\'show_rename\'); return false;"><span class="faicon edit floatRight spaceRight"></span></a>';
}
+ echo '</div>';
}
echo '</div>';
}
}
- echo ' </div>'; // time_profile
- echo '</div>'; //time_profile_holder
- echo '</div>'; //time_profile_left
+ echo '</div>';
+
+ echo '<button class="small white-black" title="'.$lang['srv_create_new_profile'].'" onclick="timeProfileAction(\'show_create\'); return false;"><span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'] . '</button>';
+
+ echo '</div>';
- echo '<div class="time_profile_left_right floatRight">';
- echo '<div id="time_profile_content">';
+ echo '<div id="time_profile_content" class="profile_right">';
self::DisplayProfileData($current_pid);
echo '</div>'; // time_profile_content
- echo '</div>'; // time_profile_right
+
+
+ echo '</div>';
- echo '<div class="time_profile_button_right_holder floatRight">';
+ echo '<div class="button_holder">';
if ($current_pid == 0) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
-# echo '<span class="floatRight spaceRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else if ($current_pid == -1) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'run_profile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'show_create\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else if ($current_pid == -1) {
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else {
+ echo '<button class="medium white-black" title="'.$lang['srv_close_profile'].'" onclick="timeProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium white-blue" title="'.$lang['srv_run_as_session_profile'].'" onclick="timeProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'].'" onclick="timeProfileAction(\'run_profile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
}
- echo '</div>'; // time_profile_button_right_holder
+ echo '</div>';
// cover Div
echo '<div id="timeProfileCoverDiv"></div>';
// div za kreacijo novega
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="newProfileName" name="newProfileName" type="text" value="" size="50" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_create\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_create\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="timeProfileAction(\'cancel_create\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_create\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="50" />';
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" class="text large" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="50" />';
echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="timeProfileAction(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>';
-
+
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $currentFilterProfile['name'] . '</b>?';
+ echo '<div id="deleteProfileDiv">';
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $currentFilterProfile['name'] . '</span>?';
echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="timeProfileAction(\'do_delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>';
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="timeProfileAction(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>';
- echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="timeProfileAction(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="timeProfileAction(\'do_delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
}
/** Funkcija prikaze osnovnih informacije profila
@@ -499,22 +528,30 @@ class SurveyTimeProfiles {
$time = $p_data['interval_txt'];
}
- echo '<input type="radio" name="type" id="time_date_type" value="0" '.($type == '0' ? ' checked="checked"' : '').' autocomplete="off"><label> ' . $lang['srv_time_profile_from'] . ': </label>';
- echo '<input id="startDate" type="text" name="startDate" value="' . $p_data['starts'] . '" onclick="changeTimeProfileType();" readonly="true" '.' autocomplete="off"/>&nbsp;';
- echo '<span class="faicon calendar_icon icon-as_link" id="starts_img"></span>';
- echo '<label> ' . $lang['srv_time_profile_to'] . ': </label>';
- echo '<input id="endDate" type="text" name="endDate" value="' . $p_data['ends'] . '" onclick="changeTimeProfileType();" readonly="true" '.'cautocomplete="off"/>&nbsp;';
- echo '<span class="faicon calendar_icon icon-as_link" id="expire_img"></span>' . "\n" ;
- echo '<br />';
- echo '<p><input type="radio" name="type" id="time_date_interval" value="1" '.($type == '0' ? '' : ' checked="checked"').' autocomplete="off">'.$lang['srv_statistic_period_label'].':';
- echo '<select name="stat_interval" id="stat_interval" onclick="changeTimeProfileType(\'interval\');" '.'autocomplete="off">';
- echo '<option value="" selected="true">'.$lang['srv_time_profile_choose_interval'].'</option>';
+ echo '<div class="setting_holder">';
+ echo '<p class="setting_title">' . $lang['srv_time_profile_time'] . '</p>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="type" id="time_date_type" value="0" '.($type == '0' ? ' checked="checked"' : '').' autocomplete="off"><label for="time_date_type">' . $lang['srv_time_profile_from'] . ':</label>';
+ echo ' <input id="startDate" type="text" class="text medium" name="startDate" value="' . $p_data['starts'] . '" onclick="changeTimeProfileType();" readonly="true" '.' autocomplete="off"/>&nbsp;';
+ echo ' <span class="faicon calendar_icon pointer blue" id="starts_img"></span>';
+ echo ' <label>' . $lang['srv_time_profile_to'] . ':</label>';
+ echo ' <input id="endDate" type="text" class="text medium" name="endDate" value="' . $p_data['ends'] . '" onclick="changeTimeProfileType();" readonly="true" '.'cautocomplete="off"/>&nbsp;';
+ echo ' <span class="faicon calendar_icon pointer blue" id="expire_img"></span>' . "\n" ;
+ echo '</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input type="radio" name="type" id="time_date_interval" value="1" '.($type == '0' ? '' : ' checked="checked"').' autocomplete="off"><label for="time_date_interval">'.$lang['srv_statistic_period_label'].':</label>';
+ echo ' <select class="dropdown medium" name="stat_interval" id="stat_interval" onclick="changeTimeProfileType(\'interval\');" '.'autocomplete="off">';
+ echo ' <option value="" selected="true">'.$lang['srv_time_profile_choose_interval'].'</option>';
foreach (self::$STP_ARRAYS as $INTERVAL) {
- echo '<option value="'.$INTERVAL.'"' . ($time == $INTERVAL ? ' selected' : '') . '>'.$lang['srv_diagnostics_'.$INTERVAL].'</option>';
+ echo ' <option value="'.$INTERVAL.'"' . ($time == $INTERVAL ? ' selected' : '') . '>'.$lang['srv_diagnostics_'.$INTERVAL].'</option>';
}
- echo '</select>';
- echo '</p>';
-
+ echo ' </select>';
+ echo '</div>';
+
+ echo '</div>';
+
echo '<script type="text/javascript">';
# za profil id=0 (privzet profil ne pustimo spreminjat
echo
@@ -538,24 +575,25 @@ class SurveyTimeProfiles {
}
public static function ajax() {
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
switch ($_GET['a']) {
case 'showProfile':
- self::displayProfiles($_POST['pid']);
+ self::displayProfiles($pid);
break;
case 'createProfile':
self::createNewProfile();
break;
case 'changeProfile':
- self::ChooseProfile($_POST['pid']);
+ self::ChooseProfile($pid);
break;
case 'renameProfile':
- self::RenameProfile($_POST['pid'], $_POST['name']);
+ self::RenameProfile($pid, $_POST['name']);
break;
case 'deleteProfile':
- self::DeleteProfile($_POST['pid']);
+ self::DeleteProfile($pid);
break;
case 'saveProfile':
- self::SaveProfile($_POST['pid'],$_POST['type'],$_POST['startDate'],$_POST['endDate'],$_POST['stat_interval']);
+ self::SaveProfile($pid,$_POST['type'],$_POST['startDate'],$_POST['endDate'],$_POST['stat_interval']);
break;
default:
print_r("<pre>");
@@ -659,33 +697,38 @@ class SurveyTimeProfiles {
*/
static function printIsDefaultProfile() {
global $lang;
+
if (self::$currentProfileId != 0) {
+
$cp_data = self::GetCurentProfileData();
- echo '<div id="timeProfileDafaultNote">';
+
+ echo '<div id="timeProfileDafaultNote" class="filter_box">';
+ echo ' <div class="header">';
+
# odvisno od tipa profila izpišemo ali obdobje ali interval
if ($cp_data['type'] == 0) {
# obdobje: od - do
- echo $lang['srv_time_profile_filter_dates'];
- echo date(STP_DATE_FORMAT, strtotime($cp_data['starts']));
- echo $lang['srv_time_profile_filter_dates_2'];
- echo date(STP_DATE_FORMAT, strtotime($cp_data['ends']));
- } else {
+ echo '<span class="semi-bold">'.$lang['obdobje_od'].':</span>&nbsp;'.date(STP_DATE_FORMAT, strtotime($cp_data['starts']));
+ echo '&nbsp;<span class="semi-bold">'.$lang['obdobje_do'].':</span>&nbsp;'.date(STP_DATE_FORMAT, strtotime($cp_data['ends']));
+ }
+ else {
# interval: zadnjih x dni
- echo $lang['srv_time_profile_filter_period'];
- echo ($lang['srv_diagnostics_'.$cp_data['interval_txt']]);
+ echo '<span class="semi-bold">'.$lang['srv_time_profile_filter_period'].':</span>&nbsp;'.($lang['srv_diagnostics_'.$cp_data['interval_txt']]);
}
- echo '&nbsp;&nbsp;&nbsp;';
- echo '<span class="as_link" id="link_time_profile_edit">'.$lang['srv_profile_edit'].'</span>';
- echo '&nbsp;&nbsp;';
- echo '<span class="as_link" id="link_time_profile_remove">'.$lang['srv_profile_remove'].'</span>';
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" id="link_time_profile_edit" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" id="link_time_profile_remove" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
echo '</div>';
- echo '<br class="clr"/>';
return true;
-
- } else {
+ }
+ else {
return false;
}
}
diff --git a/admin/survey/classes/class.SurveyUrlLinks.php b/admin/survey/classes/class.SurveyUrlLinks.php
index 0fa3856..4fafb89 100644
--- a/admin/survey/classes/class.SurveyUrlLinks.php
+++ b/admin/survey/classes/class.SurveyUrlLinks.php
@@ -56,29 +56,36 @@ class SurveyUrlLinks
$podstran = $_REQUEST['podstran'];
$m = $_REQUEST['m'];
-
- $popUp = new PopUp();
- $popUp->setId('div_survey_links');
- $popUp->setHeaderText($lang['srv_public_link_title'].':');
-
+
+ echo '<div id="div_survey_links">';
+
+ echo '<h2>'.$lang['srv_public_link_title'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
+
#vsebino shranimo v buffer
ob_start();
-
- echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
if ($msg != null){
- echo ($msg);
- echo '<br />';
+ echo '<p class="bottom16">'.($msg);
+ echo '</p>';
}
$hashUrl = new HashUrl($this->_anketa);
$links = $hashUrl->getSurveyHashes();
if (count($links) == 0){
- echo $lang['srv_public_link_noLink'].'<br />';
+ echo '<p class="bottom16">'.$lang['srv_public_link_noLink'].'</p>';
+ }
+
+ echo '<p class="bottom16"><a href="#" onclick="addSurveyUrlLink(\''.$podstran.'\',\''.$m.'\');">'.$lang['srv_public_link_addLink'].'</a></p>';
+
+ // Dodaten link posebej za NIJZ
+ global $site_domain;
+ if($site_domain == 'anketa.nijz.si' && ($podstran == 'data' || $podstran == 'data_nijz')){
+ echo '<p class="bottom16"><a href="#" onclick="addSurveyUrlLink(\'data_nijz\',\''.$m.'\');">NIJZ - '.$lang['srv_public_link_addLink'].'</a></p>';
}
- echo '<p><a href="#" onclick="addSurveyUrlLink(\''.$podstran.'\',\''.$m.'\');">'.$lang['srv_public_link_addLink'].'</a></p>';
+
if (count($links) > 0){
- echo '<caption>'.$lang['srv_public_link_existing'].'</caption>';
+ echo '<caption>'.$lang['srv_public_link_existing'].':</caption>';
echo '<table class="tbl_survey_links">';
echo '<tr>';
@@ -118,7 +125,7 @@ class SurveyUrlLinks
echo '</span></td>';
echo '<td style="text-align: center;">';
- echo '<input type="checkbox" name="hash_link_refresh" id="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" data-hash="'.$link['hash'].'" data-anketa="'.$this->_anketa.'" onchange="hash_refresh_change(this);"'. (($link['refresh'] == '1') ? ' checked' : '') .'>';
+ echo '<input type="checkbox" name="hash_link_refresh" id="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" data-hash="'.$link['hash'].'" data-anketa="'.$this->_anketa.'" onchange="hash_refresh_change(this);"'. (($link['refresh'] == '1') ? ' checked' : '') .'><label for="hash_link_refresh_'.$this->_anketa.'_'.$link['hash'].'" class="empty"></label>';
echo '</td>';
echo '<td>';
@@ -155,19 +162,12 @@ class SurveyUrlLinks
echo '</table>';
}
-
- #dodamo vsebino
- $content = ob_get_clean();
- $popUp->setContent($content);
-
- # dodamo gumb Preklici
- $buttonClose = new PopUpCancelButton();
- $buttonClose->setCaption($lang['srv_zapri'])->setTitle($lang['srv_zapri']);
- $buttonClose->setFloat('right');
- $popUp->addButton($buttonClose);
- echo $popUp;
-
+ echo '<div class="button_holder">';
+ echo '<button class="medium blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
function addLink(){
@@ -175,12 +175,9 @@ class SurveyUrlLinks
global $global_user_id;
#zaenkrat samo za podatke in par analiz
- $podstran = (isset($_REQUEST['podstran']) && ($_REQUEST['podstran'] == A_COLLECT_DATA || $_REQUEST['podstran'] == A_ANALYSIS ))
- ? $_REQUEST['podstran']
- : 'data';
- $m = (isset($_REQUEST['m']))
- ? $_REQUEST['m']
- : '';
+ $podstran = (isset($_REQUEST['podstran']) && ($_REQUEST['podstran'] == A_COLLECT_DATA || $_REQUEST['podstran'] == A_ANALYSIS || $_REQUEST['podstran'] == 'data_nijz')) ? $_REQUEST['podstran'] : 'data';
+
+ $m = (isset($_REQUEST['m'])) ? $_REQUEST['m'] : '';
# polovimo trenutno nastavljene profile
SurveyUserSetting::getInstance()->Init($this->_anketa, $global_user_id);
@@ -244,8 +241,8 @@ class SurveyUrlLinks
function saveRefresh() {
$hashUrl = new HashUrl($this->_anketa);
- $hash = $_REQUEST['hash'];
- $refresh = $_REQUEST['refresh'];
+ $hash = isset($_REQUEST['hash']) ? $_REQUEST['hash'] : null;
+ $refresh = isset($_REQUEST['refresh']) ? $_REQUEST['refresh'] : null;
$hashUrl->updateRefresh($hash,$refresh);
}
@@ -253,8 +250,9 @@ class SurveyUrlLinks
function saveAccessPassword() {
$hashUrl = new HashUrl($this->_anketa);
- $hash = $_REQUEST['hash'];
- $pass = $_REQUEST['access_password'];
+ $hash = isset($_REQUEST['hash']) ? $_REQUEST['hash'] : null;
+ $pass = isset($_REQUEST['access_password']) ? $_REQUEST['access_password'] : null;
+ $comment = isset($_REQUEST['comment']) ? $_REQUEST['comment'] : null;
// firefox na koncu vsakega contenteditable doda <br>, ki ga tukaj odstranimo
if (substr($comment, -4) == '<br>') {
diff --git a/admin/survey/classes/class.SurveyUsableResp.php b/admin/survey/classes/class.SurveyUsableResp.php
index 48e5cea..a494727 100644
--- a/admin/survey/classes/class.SurveyUsableResp.php
+++ b/admin/survey/classes/class.SurveyUsableResp.php
@@ -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);
@@ -431,10 +430,12 @@ class SurveyUsableResp{
$this->_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
# filtriranje po časih
- $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
-
+ if(isset($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']))
+ $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK($this->_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
+ else
+ $_time_profile_awk = '';
+
# dodamo še ife
-
SurveyConditionProfiles :: setHeader($this->_HEADERS);
$_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
@@ -589,13 +590,15 @@ class SurveyUsableResp{
if (empty($freqData)) {
continue;
}
-
+
foreach ($freqData AS $key => $cnt){
if (is_numeric($key) && (isset($this->_missings[(int)$key]) || isset($this->_unsets[(int)$key])))
- $this->cols_with_value[(int)$key] += $cnt;
- elseif($key != 'recnum')
- $this->cols_with_value['valid'] += $cnt;
+ $this->cols_with_value[(int)$key] = isset($this->cols_with_value[(int)$key]) ? $this->cols_with_value[(int)$key] += $cnt : 1;
+ elseif($key != 'recnum' && isset($this->cols_with_value['valid']))
+ $this->cols_with_value['valid'] = isset($this->cols_with_value['valid']) ? $this->cols_with_value['valid'] += $cnt : 1;
+
}
+
}
return $frequency;
@@ -686,6 +689,10 @@ class SurveyUsableResp{
$usablePercent = $UCL * 100;
+ $usability['unusable'] = 0;
+ $usability['partusable'] = 0;
+ $usability['usable'] = 0;
+ $usability['all'] = 0;
if($usablePercent < (int)$this->bottom_usable_limit){
$css_usable = 'unusable';
$status = 0;
diff --git a/admin/survey/classes/class.SurveyUserSession.php b/admin/survey/classes/class.SurveyUserSession.php
index a839878..b23be27 100644
--- a/admin/survey/classes/class.SurveyUserSession.php
+++ b/admin/survey/classes/class.SurveyUserSession.php
@@ -39,12 +39,21 @@ class SurveyUserSession
}
self::$ank_id = $anketa;
+ // Ce ni prijavljen v 1ko nastavimo usr_id na avtorja ankete, da se prikazejo njegovi grafi
+ if($global_user_id == -1){
+ SurveyInfo::getInstance()->SurveyInit(self::$ank_id);
+ $usr_id = SurveyInfo::getInstance()->getSurveyColumn("insert_uid");
+ }
+ else{
+ $usr_id = $global_user_id;
+ }
+
# preberemo vse nastavitve za to anketo - ce jih se nimamo
if (!is_countable(self::$dataArray) || count(self::$dataArray) == 0) {
- $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$global_user_id'");
+ $sql = sisplet_query("SELECT data FROM srv_user_session WHERE ank_id='" . self::$ank_id . "' AND usr_id='$usr_id'");
$row = mysqli_fetch_array($sql);
- self::$dataArray = unserialize($row['data']);
+ self::$dataArray = ($row != null ? unserialize($row['data']) : array());
}
}
diff --git a/admin/survey/classes/class.SurveyUserSetting.php b/admin/survey/classes/class.SurveyUserSetting.php
index 0627f2a..f93782e 100644
--- a/admin/survey/classes/class.SurveyUserSetting.php
+++ b/admin/survey/classes/class.SurveyUserSetting.php
@@ -18,7 +18,7 @@
protected function __construct() {}
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -65,10 +65,12 @@
static function getSettings($what) {
- $selectSql = "SELECT value FROM srv_user_setting_for_survey WHERE sid = '".self::$surveyId."' AND uid = '".self::$userId."' AND what = '".$what."'";
+
+ $selectSql = "SELECT value FROM srv_user_setting_for_survey WHERE sid = '".(!is_array(self::$surveyId)?self::$surveyId:self::$surveyId['id'])."' AND uid = '".self::$userId."' AND what = '".$what."'";
$sqlUserSetting = sisplet_query($selectSql);
$rowUserSetting = mysqli_fetch_assoc($sqlUserSetting);
- return $rowUserSetting['value'];
+
+ return $rowUserSetting['value'] ?? null;
}
static function getAll() {
@@ -100,7 +102,7 @@
$delete = sisplet_query($deleteString);
}
- return $insert;
+ return $delete;
}
static function getUserRow () {
diff --git a/admin/survey/classes/class.SurveyVariableView.php b/admin/survey/classes/class.SurveyVariableView.php
index 4dc1557..c2d04b7 100644
--- a/admin/survey/classes/class.SurveyVariableView.php
+++ b/admin/survey/classes/class.SurveyVariableView.php
@@ -33,6 +33,8 @@ class VariableView {
#inicializiramo class za datoteke
self::$SDF = SurveyDataFile::get_instance();
self::$SDF->init($sid);
+
+ self::$SDF->prepareFiles();
self::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
@@ -44,23 +46,18 @@ class VariableView {
public static function displayVariables() {
global $lang;
- echo '<table class="variableView">';
+ echo '<table class="variableView">';
- echo '<thead><tr>';
- echo '<th>'.$lang['srv_variableView_h_'].'</th>';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_variableView_h_name'].'</th>';
echo '<th>'.$lang['srv_variableView_h_type'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_width'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_decimals'].'</th>';
- echo '<th>'.$lang['srv_variableView_h_label'].'</th>';
echo '<th>'.$lang['srv_variableView_h_measure'].'</th>';
- echo '</tr></thead>';
-
- echo '<tbody>';
+ echo '<th>'.$lang['srv_variableView_h_label'].'</th>';
+ echo '</tr>';
foreach (self::$_HEADERS AS $skey => $spremenljivka) {
-
- if (is_numeric($spremenljivka['tip']) && $spremenljivka['tip'] != '' && $spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
-
+ if (isset($spremenljivka['tip']) && is_numeric($spremenljivka['tip']) && $spremenljivka['tip'] != '' && $spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
+
$spss = $spremenljivka['grids'][0]['variables'][0]['spss'];
$spss_type = substr($spss,0,1);
$spss_length = explode('.',substr($spss,1));
@@ -70,16 +67,13 @@ class VariableView {
echo '<tr>';
echo '<td>'.$spremenljivka['variable'].'</td>';
- echo '<td>'.$legenda['izrazanje'].'</td>';
- echo '<td>'.(int)$spss_length['0'].'</td>';
- echo '<td>'.(int)$spss_length['1'].'</td>';
- echo '<td>'.$spremenljivka['naslov'].'</td>';
+ echo '<td class="nowrap">'.$legenda['izrazanje'].'</td>';
echo '<td>'.$legenda['skala'].'</td>';
+ echo '<td>'.((strlen($spremenljivka['naslov']) > 100) ? substr($spremenljivka['naslov'], 0, 97).'...' : $spremenljivka['naslov']).'</td>';
echo '</tr>';
}
}
- echo '</tbody>';
echo '</table>';
}
} \ No newline at end of file
diff --git a/admin/survey/classes/class.SurveyVariablesProfiles.php b/admin/survey/classes/class.SurveyVariablesProfiles.php
index 110f767..eafd63f 100644
--- a/admin/survey/classes/class.SurveyVariablesProfiles.php
+++ b/admin/survey/classes/class.SurveyVariablesProfiles.php
@@ -11,7 +11,7 @@
*
*/
DEFINE ('SVP_DEFAULT_PROFILE', 0);
-DEFINE (NEW_LINE, "\n");
+if (!defined(NEW_LINE)) define(NEW_LINE, "\n");
class SurveyVariablesProfiles
{
@@ -149,7 +149,7 @@ class SurveyVariablesProfiles
}
# ce profil ni inspect ali ce ga ne ignoriramone vrnemo variable
- $variables = unserialize(self::$profiles[$pid]['variables']);
+ $variables = isset(self::$profiles[$pid]['variables']) ? unserialize(self::$profiles[$pid]['variables']) : null;
if (is_array($variables))
{
$result=array();
@@ -185,9 +185,8 @@ class SurveyVariablesProfiles
$css = ($izbranProfil == SVP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || $css != ' gray') {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" onclick="displayVariableProfile();" title="'.$lang['srv_filtri'].'">'.$lang['srv_filtri'].'</span>';
+ echo ' <span class="'.$css.'" onclick="displayVariableProfile();" title="'.$lang['srv_filtri'].'">'.$lang['srv_filtri'].'</span>';
echo '</li>';
}
@@ -215,14 +214,26 @@ class SurveyVariablesProfiles
}
$variable_label = implode(', ',$vars);
- echo '<div id="variableProfileNote">';
- echo '<span class="floatLeft">'.$lang['srv_profile_variables_is_filtred'].'</span>';
- echo '<span class="floatLeft">'.$variable_label.'</span>';
- echo '<span class="as_link spaceLeft" onclick="displayVariableProfile();">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="removeVariableProfile();">'.$lang['srv_profile_remove'].'</span>';
- echo '</div>';
- echo '<br class="clr" />';
+ echo '<div id="variableProfileNote" class="filter_box">';
+
+ echo ' <div class="header">';
+ echo ' <span class="semi-bold">'.$lang['srv_profile_variables_is_filtred'].'</span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" onclick="displayVariableProfile();" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" onclick="removeVariableProfile();" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo ' </div>';
+
+
+ echo ' <div class="content">';
+ echo ' <span class="floatLeft">'.$variable_label.'</span>';
+ echo ' </div>';
+
+ echo '</div>';
+
return true;
}
return false;
@@ -245,7 +256,7 @@ class SurveyVariablesProfiles
static function ajax() {
- $pid = $_POST['pid'];
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
if ($_POST['podstran'] == 'monitoring') {
self::$monitoring = true; self::refreshAvailableProfiles();
@@ -253,14 +264,14 @@ class SurveyVariablesProfiles
switch ($_GET['a']) {
case 'displayProfile':
- self::displayProfiles($_POST['pid']);
+ self::displayProfiles($pid);
break;
case 'changeProfile':
- self::displayProfiles($_POST['pid']);
+ self::displayProfiles($pid);
break;
case 'chooseProfile':
- self::chooseProfile($_POST['pid']);
+ self::chooseProfile($pid);
break;
case 'saveProfile':
self::saveProfile();
@@ -269,10 +280,10 @@ class SurveyVariablesProfiles
$new_id = self :: newProfileVariables();
break;
case 'renameProfile':
- $updated = self::renameVariableProfile($_POST['pid'],$_POST['name']);
+ $updated = self::renameVariableProfile($pid,$_POST['name']);
break;
case 'deleteProfile':
- self::deleteVariableProfile($_POST['pid']);
+ self::deleteVariableProfile($pid);
break;
}
}
@@ -281,6 +292,8 @@ class SurveyVariablesProfiles
static function displayProfiles ($cvp = null) {
global $lang;
+ $pid = isset($_POST['pid']) ? $_POST['pid'] : null;
+
$popUp = new PopUp();
$popUp->setId('div_variable_profiles');
$popUp->setHeaderText($lang['srv_spremenljivke_settings']);
@@ -292,144 +305,188 @@ class SurveyVariablesProfiles
if ($cvp == null)
$cvp = self::$currentId;
+
$svp_ap = self::$profiles;
$svp_pv = self :: getProfileVariables($cvp);
$svp_av = self::$SDF->getSurveyVariables();
if ( self::$currentId != SVP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note red">';
echo $lang['srv_not_default_setting'];
echo '</div>';
- echo '<br class="clr" />';
}
- echo '<div class="variable_profile_holder">';
- echo ' <div id="variable_profile" class="select">';
+
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div class="variable_profile_holder popup_left">';
+
+ echo ' <div id="variable_profile" class="list select">';
foreach ($svp_ap as $key => $value) {
- echo '<div class="option'.($cvp==$value['id']?' active':'').'" value="'.$value['id'].'" '.($cvp==$value['id'] ? '' : ' onclick="changeVariableProfile(\''.$value['id'].'\');"').'>';
+ echo '<div class="list-item option'.($cvp==$value['id']?' active':'').'" value="'.$value['id'].'" '.($cvp==$value['id'] ? '' : ' onclick="changeVariableProfile(\''.$value['id'].'\');"').'>';
echo $value['name'];
if($cvp == $value['id']){
+
+ echo '<div class="profile_icons">';
+
// izbriši
if ((int)$cvp != 0){
- echo ' <a href="#" onclick="variableProfileAction(\'deleteAsk\'); return false;" value="'.$lang['srv_delete_profile'].'"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
+ echo ' <a href="#" onclick="variableProfileAction(\'deleteAsk\'); return false;" value="'.$lang['srv_delete_profile'].'"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
}
// preimenuj
if ((int)$cvp != 0){
- echo ' <a href="#" onclick="variableProfileAction(\'renameAsk\'); return false;" value="'.$lang['srv_rename_profile'].'"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'."\n";
+ echo ' <a href="#" onclick="variableProfileAction(\'renameAsk\'); return false;" value="'.$lang['srv_rename_profile'].'"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
}
echo ' </div>';
- // izberi / odznaci vse
- echo '<div style="position:absolute; bottom:20px; left:20px;">';
- echo '<a href="#" onClick="variableProfileSelectAll(1); return false;">'.$lang['srv_select_all'].'</a>';
- echo ' / <a href="#" onClick="variableProfileSelectAll(0); return false;">'.$lang['srv_deselect_all'].'</a>';
- echo '</div>';
-
echo '</div>';
- echo '<div id="vp_list">';
+ echo '<div id="vp_list" class="popup_right">';
$empty = count($svp_pv) == 0;
- echo '<ul id="vp_list_ul" class="left">';
- if (count($svp_av) > 0)
- {
- foreach($svp_av as $key => $variabla)
- {
+ echo '<div id="vp_list_ul" class="settings_block">';
+ if (count($svp_av) > 0){
+
+ foreach($svp_av as $key => $variabla){
$_name = self::$SDF->getVariableName($key);
$checked = ($empty || in_array($key, $svp_pv));
- echo '<li'.($checked?' class="selected"':'').'>';
- echo '<label>';
- echo '<input type="checkbox" '.($checked?' checked="checekd"':'').' name="vp_list_li" value="'.$key.'" id="variable_'.$key.'" onchange="variableProfileCheckboxChange(this);">'.limitString($_name);
- echo '</label></li>';
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" '.($checked?' checked="checekd"':'').' name="vp_list_li" value="'.$key.'" id="variable_'.$key.'" onchange="variableProfileCheckboxChange(this);">';
+ echo ' <label for="variable_'.$key.'">'.limitString($_name).'</label>';
+ echo '</div>';
}
}
- echo '</ul>';
+ echo '</div>';
+
+ // izberi / odznaci vse
+ echo '<div class="settings_block">';
+ echo ' <div class="setting_line">';
+ echo ' <a href="#" onClick="variableProfileSelectAll(1); return false;">'.$lang['srv_select_all'].'</a> / <a href="#" onClick="variableProfileSelectAll(0); return false;">'.$lang['srv_deselect_all'].'</a>';
+ echo ' </div>';
+ echo '</div>';
echo '</div>';
+
+
+ echo '</div>';
+
+
// cover Div
echo '<div id="variableProfileCoverDiv"></div>';
// div za shranjevanje novega profila
- echo '<div id="newProfile">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />';
+ echo '<div id="newProfile">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+
+ $button = new PopUpButton($lang['srv_cancel']);
+ echo $button -> setFloat('right')
+ -> addAction('onClick','variableProfileAction(\'newCancel\'); return false;');
+
$button = new PopUpButton($lang['srv_save_profile']);
echo $button -> setFloat('right')
->setButtonColor('orange')
-> addAction('onClick','variableProfileAction(\'newSave\'); return false;');
- $button = new PopUpButton($lang['srv_cancel']);
- echo $button -> setFloat('right')
- -> addAction('onClick','variableProfileAction(\'newCancel\'); return false;');
+
+ echo '</div>';
+
echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': ';
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="'.$svp_ap[$cvp]['name'].'" size="45" />';
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="'.$svp_ap[$cvp]['name'].'" class="text large" />';
echo '<input id="renameProfileId" type="hidden" value="'.$pid.'" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+
+ $button = new PopUpButton($lang['srv_cancel']);
+ echo $button -> setFloat('right')
+ -> addAction('onClick','variableProfileAction(\'renameCancel\'); return false;');
+
$button = new PopUpButton($lang['srv_rename_profile_yes']);
echo $button -> setFloat('right')
->setButtonColor('orange')
-> addAction('onClick','variableProfileAction(\'renameProfile\'); return false;');
- $button = new PopUpButton($lang['srv_cancel']);
- echo $button -> setFloat('right')
- -> addAction('onClick','variableProfileAction(\'renameCancel\'); return false;');
+ echo '</div>';
+
echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>'.$svp_ap[$cvp]['name'].'</b>?';
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">'.$svp_ap[$cvp]['name'].'</span>?';
echo '<input id="deleteProfileId" type="hidden" value="'.$pid.'" />';
- $button = new PopUpButton($lang['srv_delete_profile_yes']);
- echo $button -> setFloat('right')
- ->setButtonColor('orange')
- -> addAction('onClick','variableProfileAction(\'deleteConfirm\'); return false;');
+ echo '<div class="button_holder">';
$button = new PopUpButton($lang['srv_cancel']);
echo $button -> setFloat('right')
-> addAction('onClick','variableProfileAction(\'deleteCancel\'); return false;');
+
+ $button = new PopUpButton($lang['srv_delete_profile_yes']);
+ echo $button -> setFloat('right')
+ ->setButtonColor('orange')
+ -> addAction('onClick','variableProfileAction(\'deleteConfirm\'); return false;');
+
+ echo '</div>';
+
echo '</div>';
$content = ob_get_clean();
#dodamo vsebino
$popUp->setContent($content);
- # gumb izberi
- $button = new PopUpButton($lang['srv_choose_profile']);
- $button -> setFloat('right')
- ->setButtonColor('orange')
- -> addAction('onClick','variableProfileAction(\'choose\'); return false;');
+ # dodamo gumb Preklici
+ $button = new PopUpCancelButton();
$popUp->addButton($button);
# gumb shrani
- if ((int)$cvp != 0)
- {
+ if ((int)$cvp != 0){
$button = new PopUpButton($lang['srv_save_profile']);
- $button -> setFloat('right')
- ->setButtonColor('gray')
- -> addAction('onClick','variableProfileAction(\'save\'); return false;');
+ $button->addAction('onClick','variableProfileAction(\'save\'); return false;');
$popUp->addButton($button);
}
# gumb shrani kot now
$button = new PopUpButton($lang['srv_new_profile_name']);
- $button -> setFloat('right')
- -> addAction('onClick','variableProfileAction(\'newName\'); return false;');
+ $button->addAction('onClick','variableProfileAction(\'newName\'); return false;');
$popUp->addButton($button);
- # dodamo gumb Preklici
- $button = new PopUpCancelButton();
- $button -> setFloat('right');
+ # gumb izberi
+ $button = new PopUpButton($lang['srv_choose_profile']);
+ $button -> setFloat('right')
+ ->setButtonColor('orange')
+ -> addAction('onClick','variableProfileAction(\'choose\'); return false;');
$popUp->addButton($button);
-
echo $popUp;
}
@@ -464,7 +521,7 @@ class SurveyVariablesProfiles
return $pid;
}
- function saveProfile()
+ static function saveProfile()
{
global $lang;
diff --git a/admin/survey/classes/class.SurveyZankaProfiles.php b/admin/survey/classes/class.SurveyZankaProfiles.php
index 7b341a6..af2ed21 100644
--- a/admin/survey/classes/class.SurveyZankaProfiles.php
+++ b/admin/survey/classes/class.SurveyZankaProfiles.php
@@ -126,13 +126,13 @@ class SurveyZankaProfiles {
static function DisplayLink($hideAdvanced = true) {
global $lang;
+
// profili statusov
$allProfiles = self :: $profiles;
$css = (self::$currentProfileId == SZP_DEFAULT_PROFILE ? ' gray' : '');
if ($hideAdvanced == false || self::$currentProfileId != SZP_DEFAULT_PROFILE) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_zanka_profile" title="' . $lang['srv_zanke'] . '" onClick="zankaProfileAction(\'showProfiles\');">' . $lang['srv_zanke'] . '</span>'."\n";
+ echo ' <span class="'.$css.'" id="link_zanka_profile" title="' . $lang['srv_zanke'] . '" onClick="zankaProfileAction(\'showProfiles\');">' . $lang['srv_zanke'] . '</span>'."\n";
echo '</li>';
}
@@ -174,6 +174,7 @@ class SurveyZankaProfiles {
break;
}
}
+
static function showProfiles ($pid = null) {
global $lang;
@@ -206,69 +207,79 @@ class SurveyZankaProfiles {
}
}
}
- #echo '<div id="currentZankaProfile">'.$lang['srv_analiza_selected_profile'].': <b>' . self::$profiles[$pid]['name'] . '</b></div >'.NEW_LINE;
if ( self::$currentProfileId != SZP_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div class="zanka_profile_holder">'.NEW_LINE;
- echo ' <div id="zanka_profile" class="select">'.NEW_LINE;
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div class="popup_left zanka_profile_holder">'.NEW_LINE;
+
+ echo ' <div id="zanka_profile" class="list select">'.NEW_LINE;
if (count(self::$profiles) > 0 ){
foreach (self::$profiles as $key => $value) {
if ($value['id'] != null) {
- echo '<div class="option' . ($pid == $value['id'] ? ' active' : '') . '" id="zanka_profile_' . $value['id'] . '" value="'.$value['id'].'">';
+ echo '<div class="list-item option' . ($pid == $value['id'] ? ' active' : '') . '" id="zanka_profile_' . $value['id'] . '" value="'.$value['id'].'">';
echo $value['name'];
if($value['id'] == $pid){
+
+ echo '<div class="profile_icons">';
+
if ( $pid != 0) {
- # sistemskega ne pustimo izbrisat
+ # sistemskega ne pustimo izbrisat
echo ' <a href="#" title="'.$lang['srv_delete_profile'].'" onclick="zankaProfileAction(\'deleteAsk\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'.NEW_LINE;
}
if ( $pid > 0) {
- # seje in sistemskega ne pustimo preimenovat
+ # seje in sistemskega ne pustimo preimenovat
echo ' <a href="#" title="'.$lang['srv_rename_profile'].'" onclick="zankaProfileAction(\'renameAsk\'); return false;"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'.NEW_LINE;
- }
+ }
+
+ echo '</div>';
}
echo '</div>'.NEW_LINE;
}
}
}
- echo ' </div>'.NEW_LINE;
- echo '<div class="clr"></div>'.NEW_LINE;
+ echo ' <button class="small white-black" onclick="zankaProfileAction(\'newName\'); return false;">'.$lang['srv_save_new_profile'].'</button>'.NEW_LINE;
+
+ echo ' </div>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+
// izrišemo dva stolpca z možnostjo premikanja enih in drugih variabelS
- echo '<div id="fs_list">'.NEW_LINE;
- echo '<div class="left link_no_decoration">'.NEW_LINE;
+ echo '<div id="fs_list" class="popup_right">'.NEW_LINE;
+
+ echo '<div id="skupine_left">';
+
+ echo '<div class="top">'.NEW_LINE;
+
+ echo '<div class="select">'.NEW_LINE;
echo $lang['srv_select'].NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_3\');">'.$lang['srv_all'].'</a>'.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_3\');">'.$lang['srv_none'].'</a> '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_3\');">'.$lang['srv_all'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_3\');">'.$lang['srv_none'].'</a> - '.NEW_LINE;
echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_3\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
echo '</div>'.NEW_LINE;
- echo '<div class="left link_no_decoration" style="width:200px; text-align:center">'.NEW_LINE;
- echo '<a href="#" onclick="zankaProfileAction(\'clearDdsZanka\'); return false;">'.$lang['srv_clear'].'</a>'.NEW_LINE;
+
+ echo '<div class="clear_multiply">'.NEW_LINE;
echo '<input type="checkbox" name="mnozenje" id="mnozenje" value="1"'.($mnozenje==1?' checked="checked"':'').' autocomplete="off"/><label for="mnozenje">'.$lang['srv_analiza_krat'].'</label>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+ echo '</div>'.NEW_LINE; #top
- echo '<div class="right link_no_decoration">'.NEW_LINE;
- echo $lang['srv_select'].NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_4\');">'.$lang['srv_all'].'</a>'.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_4\');">'.$lang['srv_none'].'</a> '.NEW_LINE;
- echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_4\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
- echo '</div>'.NEW_LINE;
- echo '<br class="clr" />'.NEW_LINE;
- echo '<br />'.NEW_LINE;
- echo '<div class="left fs_container">'.NEW_LINE;
+ echo '<div class="fs_container">'.NEW_LINE;
echo '<ul id="fs_list_3" class="left">'.NEW_LINE;
$sdf = SurveyDataFile::get_instance();
$sdf->init($sid);
@@ -280,7 +291,31 @@ class SurveyZankaProfiles {
}
echo '</ul>'.NEW_LINE;
echo '</div>'.NEW_LINE;
- echo '<div class="right fs_container">'.NEW_LINE;
+
+
+ echo '</div>'; #left
+
+
+
+ echo '<div id="skupine_right">';
+
+ echo '<div class="top">'.NEW_LINE;
+ echo '<div class="select">'.NEW_LINE;
+ echo $lang['srv_select'].NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectAll(\'fs_list_4\');">'.$lang['srv_all'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectNone(\'fs_list_4\');">'.$lang['srv_none'].'</a> - '.NEW_LINE;
+ echo '<a href="#" onclick="return $.dds.selectInvert(\'fs_list_4\');">'.$lang['srv_invert'].'</a>'.NEW_LINE;
+ echo '</div>'.NEW_LINE;
+
+
+ echo '<div class="clear_multiply">'.NEW_LINE;
+ echo '</div>'.NEW_LINE;
+
+ echo '</div>'.NEW_LINE; #top
+
+
+
+ echo '<div class="fs_container">'.NEW_LINE;
echo '<ul id="fs_list_4" class="left">'.NEW_LINE;
if (count($selected_variables) > 0 ) {
foreach($selected_variables as $key => $variabla) {
@@ -290,6 +325,9 @@ class SurveyZankaProfiles {
}
echo '</ul>'.NEW_LINE;
echo '</div>'.NEW_LINE;
+
+ echo '</div>'; #right
+
echo '<script type="text/javascript">'.NEW_LINE;
echo '$(document).ready(function() {';
echo '$(function(){'.NEW_LINE;
@@ -303,45 +341,77 @@ class SurveyZankaProfiles {
echo '});'.NEW_LINE;
echo '</script>'.NEW_LINE;
- echo '<br class="clr" />'.NEW_LINE;
-
echo '</div>'.NEW_LINE;
- echo '<div id="missingProfilebuttons">'.NEW_LINE;
- if ((int)$pid < 0 ) {// pri seji in sistemskem ne pustimo shranjevanja
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'runSession\'); return false;"><span>'.$lang['srv_run_as_session_profile'].'</span></a></span></span>'.NEW_LINE;
- } else {
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'run\'); return false;"><span>'.$lang['srv_save_and_run_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'runSession\'); return false;"><span>'.$lang['srv_run_as_session_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '</div>';
+
+
+ echo '<div id="missingProfilebuttons" class="button_holder">'.NEW_LINE;
+
+ echo '<button class="medium white-blue" onclick="zankaProfileAction(\'cancle\'); return false;">'.$lang['srv_close_profile'].'</button>'.NEW_LINE;
+
+ // pri seji in sistemskem ne pustimo shranjevanja
+ if ((int)$pid < 0 ) {
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'runSession\'); return false;">'.$lang['srv_run_as_session_profile'].'</button>'.NEW_LINE;
+ }
+ else {
+ echo '<button class="medium white-blue" onclick="zankaProfileAction(\'runSession\'); return false;">'.$lang['srv_run_as_session_profile'].'</button>'.NEW_LINE;
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'run\'); return false;">'.$lang['srv_save_and_run_profile'].'</button>'.NEW_LINE;
}
-
- echo '<span class="floatRight spaceLeft"><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'newName\'); return false;"><span>'.$lang['srv_save_new_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft"><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'cancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
-
+
echo '</div>'.NEW_LINE;
+
+
echo '<div id="zankaProfileCoverDiv"></div>'.NEW_LINE;
// div za shranjevanje novega profila
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': '.NEW_LINE;
- echo '<input id="newProfileName" name="newProfileName" type="text" size="45" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'newCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'newCreate\'); return false;"><span>'.$lang['srv_save_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'newCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'newCreate\'); return false;">'.$lang['srv_save_profile'].'</button>';
+ echo '</div>';
+
echo '</div>'.NEW_LINE;
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '.NEW_LINE;
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" size="45" />'.NEW_LINE;
- echo '<input id="renameProfileId" type="hidden" value="' . $czp . '" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'renameConfirm\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'renameCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . self::$profiles[$pid]['name'] . '" class="text large"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'renameCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'renameConfirm\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
echo '</div>'.NEW_LINE;
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . self::$profiles[$pid]['name'] . '</b>?'.NEW_LINE;
- echo '<input id="deleteProfileId" type="hidden" value="' . $czp . '" />'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zankaProfileAction(\'deleteConfirm\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'.NEW_LINE;
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zankaProfileAction(\'deleteCancle\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'.NEW_LINE;
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . self::$profiles[$pid]['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $czp . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zankaProfileAction(\'deleteCancle\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zankaProfileAction(\'deleteConfirm\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>'.NEW_LINE;
}
@@ -460,15 +530,16 @@ class SurveyZankaProfiles {
*/
static function getFiltersForLoops() {
$result = array();
- $_spr_for_loops = explode(',',self::$profiles[self::$currentProfileId]['variables']);
+ $_spr_for_loops = isset(self::$profiles[self::$currentProfileId]['variables']) ? explode(',',self::$profiles[self::$currentProfileId]['variables']) : array();
+ $_results = array();
$i = 0;
if (count($_spr_for_loops) > 0) {
foreach ($_spr_for_loops AS $_spr) {
$sdf = SurveyDataFile::get_instance();
$sdf->init(self::$sid);
$_spr_data = $sdf->getHeaderVariable($_spr);
- if ($_spr_data['tip'] == 1 || $_spr_data['tip'] == 3) {
+ if (isset($_spr_data['tip']) && $_spr_data['tip'] == 1 || $_spr_data['tip'] == 3) {
# radio oz, dropdown
# zloopamo skozi opcije
@@ -479,7 +550,7 @@ class SurveyZankaProfiles {
}
}
- } else if ($_spr_data['tip'] === '2') {
+ } else if (isset($_spr_data['tip']) && $_spr_data['tip'] === '2') {
# checkbox
#zloopamo po vrednostih in dodamo filtre za 1-checked 2-not checked
foreach ($_spr_data['grids'] as $g_key => $grid) {
@@ -498,7 +569,7 @@ class SurveyZankaProfiles {
}
# če mamo množenje, lahko izvedemo samo nad dvema spremenljivkama
- if (self::$profiles[self::$currentProfileId]['mnozenje'] == 1) {
+ if (isset(self::$profiles[self::$currentProfileId]['mnozenje']) && self::$profiles[self::$currentProfileId]['mnozenje'] == 1) {
if (count($_results[0]) > 0) {
foreach ($_results[0] AS $_result0) {
if (count($_results[1]) > 0) {
@@ -517,8 +588,7 @@ class SurveyZankaProfiles {
}
}
} else {
-
- $result = $_results[0];
+ $result = isset($_results[0]) ? $_results[0] : array();
}
return $result;
}
diff --git a/admin/survey/classes/class.SurveyZoom.php b/admin/survey/classes/class.SurveyZoom.php
index 593a1ee..ed1c953 100644
--- a/admin/survey/classes/class.SurveyZoom.php
+++ b/admin/survey/classes/class.SurveyZoom.php
@@ -122,11 +122,9 @@ class SurveyZoom
$css = (self::$currentProfileId == 0 ? ' gray' : '');
if ($hideAdvanced == false || self::$currentProfileId != 0) {
- echo '<li class="space">&nbsp;</li>';
echo '<li>';
- echo '<span class="as_link'.$css.'" id="link_zoom" title="'.$lang['srv_zoom_setting'].'" onclick="showZoomSettings();">'.$lang['srv_zoom_setting'].'</span>';
+ echo ' <span class="'.$css.'" id="link_zoom" title="'.$lang['srv_zoom_setting'].'" onclick="showZoomSettings();">'.$lang['srv_zoom_setting'].'</span>';
echo '</li>';
-
}
}
@@ -216,23 +214,30 @@ class SurveyZoom
$currentFilterProfile = self::$profiles[$current_pid];
if ( self::$currentProfileId != ZOOM_DEFAULT_PROFILE ) {
- echo '<div id="not_default_setting">';
+ echo '<div id="not_default_setting" class="popup_note">';
echo $lang['srv_not_default_setting'];
- echo '</div><br class="clr displayNone">';
+ echo '</div>';
}
- echo '<div id="zoom_profiles_left">';
- echo '<span id="zoom_profiles_holder">';
+
+ echo '<div class="popup_main with_menu">';
+
+
+ echo '<div id="zoom_profiles_left" class="popup_left">';
+ echo '<div id="zoom_profiles_holder">';
+
# zlistamo vse profile
- echo '<span id="zoom_profiles" class="select">';
+ echo '<div id="zoom_profiles" class="list select">';
if (count(self::$profiles)) {
foreach (self::$profiles as $id => $profile) {
- echo '<div class="option' . ($current_pid == $id ? ' active' : '') . '" id="zoom_profile_' . $id . '" value="'.$id.'" '.($current_pid == $id ? '' : ' onclick="zoomChangeProfile(\''.$id.'\')"').'>';
+ echo '<div class="list-item option' . ($current_pid == $id ? ' active' : '') . '" id="zoom_profile_' . $id . '" value="'.$id.'" '.($current_pid == $id ? '' : ' onclick="zoomChangeProfile(\''.$id.'\')"').'>';
echo $profile['name'];
if($current_pid == $id){
+ echo '<div class="profile_icons">';
+
# sistemskega ne moremo izbrisati
if ($current_pid != 0) {
echo '<a href="#" title="'.$lang['srv_delete_profile'].'" onclick="zoomProfileAction(\'showDelete\'); return false;"><span class="faicon delete_circle icon-orange_link floatRight" style="margin-top:1px;"></span></a>'."\n";
@@ -242,23 +247,29 @@ class SurveyZoom
if ($current_pid > 0) {
echo '<a href="#" title="'.$lang['srv_rename_profile'].'" onclick="zoomProfileAction(\'showRename\'); return false;"><span class="faicon edit icon-as_link floatRight spaceRight"></span></a>'."\n";
}
+
+ echo '</div>';
}
echo '</div>';
}
}
- echo '</span>'; # zoom_profilea
- echo '</span>'; # zoom_profiles_holder
-
+ echo '</div>'; # zoom_profilea
+
+ // Gumb za dodajanje novega profila
+ echo '<button class="small white-black" title="'.$lang['srv_create_new_profile'].'" onclick="zoomProfileAction(\'newName\'); return false;">';
+ echo ' <span class="faicon plus_32"></span>'.$lang['srv_create_new_profile'];
+ echo '</button>';
+
+ echo '</div>'; # zoom_profiles_holder
echo '</div>'; # zoom_profiles_left
- echo '<div id="zoom_profiles_right">'."\n";
+ echo '<div id="zoom_profiles_right" class="popup_right">'."\n";
if ($current_pid == 0) {
- echo '<div id="zoom_note">';
+ echo '<div id="zoom_note" class="popup_right_note">';
echo $lang['srv_change_default_profile'];
echo '</div>'; // zoom_profile_note
- echo '<br class="clr" />'."\n";
}
echo '<div id="zoom_content">';
@@ -266,20 +277,23 @@ class SurveyZoom
echo '</div>'; // zoom_profile_content
echo '</div>'; // zoom_profile_right
+
+
+ echo '</div>';
- echo '<div id="zoom_button_holder">'."\n";
+ echo '<div id="zoom_button_holder" class="button_holder">'."\n";
+
if ((int)$current_pid <= 0 ) {
- echo '<span class="floatRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
- } else {
- echo '<span class="floatRight" title="'.$lang['srv_save_run_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'runProfile\'); return false;"><span>'.$lang['srv_run_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_run_as_session_profile'] . '"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'run_session_profile\'); return false;"><span>'.$lang['srv_run_as_session_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_create_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newName\'); return false;"><span>'.$lang['srv_create_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_close_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancel\'); return false;"><span>'.$lang['srv_close_profile'] . '</span></a></div></span>';
-
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="zoomProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="zoomProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ }
+ else {
+ echo '<button class="medium white-blue" title="'.$lang['srv_close_profile'].'" onclick="zoomProfileAction(\'cancel\'); return false;">'.$lang['srv_close_profile'] . '</button>';
+ echo '<button class="medium white-blue" title="'.$lang['srv_run_as_session_profile'] . '" onclick="zoomProfileAction(\'run_session_profile\'); return false;">'.$lang['srv_run_as_session_profile'] . '</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_save_run_profile'] . '" onclick="zoomProfileAction(\'runProfile\'); return false;">'.$lang['srv_run_profile'] . '</button>';
}
+
echo '</div>'."\n"; // zoom_button_holder
@@ -287,26 +301,54 @@ class SurveyZoom
//echo '<div id="zoom_cover_div"></div>'."\n";
// div za kreacijo novega
- echo '<div id="newProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="newProfileName" name="newProfileName" type="text" value="" size="45" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'newCreate\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'newCancel\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="newProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newProfileName" name="newProfileName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'newCancel\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'newCreate\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameProfileDiv">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" size="45" />'."\n";
- echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'doRename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancelRename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameProfileDiv">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameProfileName" name="renameProfileName" type="text" value="' . $currentFilterProfile['name'] . '" class="text large"/>';
+ echo '<input id="renameProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'cancelRename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'doRename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteProfileDiv">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $currentFilterProfile['name'] . '</b>?'."\n";
- echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="zoomProfileAction(\'doDelete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="zoomProfileAction(\'cancelDelete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteProfileDiv">';
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $currentFilterProfile['name'] . '</span>?';
+ echo '<input id="deleteProfileId" type="hidden" value="' . $currentFilterProfile['id'] . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="zoomProfileAction(\'cancelDelete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="zoomProfileAction(\'doDelete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
/** Funkcija prikaze osnovnih informacije profila
@@ -314,9 +356,11 @@ class SurveyZoom
*/
function DisplayProfileData($current_pid=null) {
global $lang;
+
if (isset($_POST['error'])) {
echo '<span class="red">* '.$lang[$_POST['error']].'</span><br/>';
}
+
# podatki profila
if ($current_pid == null) {
$current_pid = self::$currentProfileId;
@@ -326,39 +370,44 @@ class SurveyZoom
$all_spr = Cache::cache_all_srv_spremenljivka(self::$sid,true);
- echo '<span>'.$lang['srv_zoom_choose'].'</span>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_zoom_choose'];
+ echo '</div>';
+
if (count($all_spr) > 0)
foreach ($all_spr AS $id => $spremenljivka) {
if ( in_array($spremenljivka['tip'], array(1,2,3) ) ) {
- echo '<div class="zoom_var">';
-
- echo '<label>';
- echo '<input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox"'
- .(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
- echo strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
-
+ echo '<div class="settings_block">';
+
+ echo ' <div class="setting_line">';
+ echo ' <input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'" value="'.$spremenljivka['id'].'" type="checkbox" '.(is_array($vars) && in_array($spremenljivka['id'],$vars) ? ' checked' : '').'>';
+ echo ' <label for="zoom_var_'.$spremenljivka['id'].'">'.strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' </div>';
+
echo '</div>';
- } else if ( in_array($spremenljivka['tip'], array(6,16,17))) {
- echo '<div class="zoom_var">';
-
+ }
+ else if ( in_array($spremenljivka['tip'], array(6,16,17))) {
+ echo '<div class="settings_block">';
+
# izpišemo glavno spremenljivko
- echo '<label style="margin-left:20px;">';
- echo strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' <div class="setting_line">';
+ echo ' <label>'.strip_tags($spremenljivka['variable']).' - '.strip_tags($spremenljivka['naslov']).'</label>';
+ echo ' </div>';
# izpišemo gride (zamaknjeno)
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$id' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label style="margin-left:25px; margin-top:5px;">';
- echo '<input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'" value="'.$spremenljivka['id'].'_'.$row['id'].'" type="checkbox"'
- .(is_array($vars) && in_array($spremenljivka['id'].'_'.$row['id'],$vars) ? ' checked' : '').'>';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
+ echo ' <div class="setting_line indent">';
+ echo ' <input name="zoom_vars" id="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'" value="'.$spremenljivka['id'].'_'.$row['id'].'" type="checkbox" '.(is_array($vars) && in_array($spremenljivka['id'].'_'.$row['id'],$vars) ? ' checked' : '').'>';
+ echo ' <label for="zoom_var_'.$spremenljivka['id'].'_'.$row['id'].'">'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
+ echo ' </div>';
}
+
echo '</div>';
}
}
-
- echo '<br class="clr"/>';
}
/* Shranimo izbrane variable in resetiramo if na 0, ter pobrišemo morebitni pogoj če obstaja
@@ -464,36 +513,45 @@ class SurveyZoom
static function displayZoomConditions($showDiv = true) {
global $lang;
-
- $vars = self::$profiles[self::$currentProfileId]['vars'];
+
+ $vars = isset(self::$profiles[self::$currentProfileId]['vars']) ? self::$profiles[self::$currentProfileId]['vars'] : '';
$all_spr = Cache::cache_all_srv_spremenljivka(self::$sid);
if (is_countable($vars) && count($vars) > 0) {
$conditions = self::$profiles[self::$currentProfileId]['conditions'];
+
if ($showDiv == true) {
- echo '<div id="div_zoom_condition" '.(self::$showVariables == false ? ' style="display:none"' : '').'>';
+ echo '<div id="div_zoom_condition" class="filter_box" '.(self::$showVariables == false ? ' style="display:none"' : '').'>';
}
- echo '<span class="" style="display:inline-block; width:100%">';
- echo '<b>'.$lang['srv_zoom'].'</b>';
- echo '&nbsp;"'.self::$profiles[self::$currentProfileId]['name'].'"';
- echo '<span class="as_link spaceLeft" onclick="showZoomSettings();">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" id="span_zoom_condition_remove" onclick="removeZoomProfile();">'.$lang['srv_profile_remove'].'</span>';
-
- # dodamo še +/- za razpiranje variabel
- echo '<span class="floatRight spaceLeft">';
- echo '<span id="zoomSpritesMinus" class="'.(self::$extended == true ? '' : ' displayNone').'">';
- echo '<span class="pointer faicon icon-blue minus" onClick="toggleAllZoom(\'1\')" >&nbsp;</span>';
- echo '</span>';
- echo '<span id="zoomSpritesPlus" class="'.(self::$extended == true ? ' displayNone' : '').'">';
- echo '<span class="pointer faicon icon-blue plus" onClick="toggleAllZoom(\'0\')">&nbsp;</span>';
- echo '</span>';
- echo '</span>';
-
- echo '</span>';
- echo '<br/>';
- echo '<span class="floatLeft'.( self::$extended == false ? ' displayNone': '').'" >';
- echo '<ul >';
+
+
+ echo '<div class="header">';
+
+ echo ' <span class="semi-bold">'.$lang['srv_zoom'].'&nbsp;</span>';
+ echo ' <span class="title">'.self::$profiles[self::$currentProfileId]['name'].'</span>';
+
+ # dodamo še +/- za razpiranje variabel
+ echo ' <span class="expand_icon">';
+ echo ' <span id="zoomSpritesMinus" class="'.(self::$extended == true ? '' : ' displayNone').'">';
+ echo ' <span class="pointer faicon icon-blue arrow2_u" onClick="toggleAllZoom(\'1\')" ></span>';
+ echo ' </span>';
+ echo ' <span id="zoomSpritesPlus" class="'.(self::$extended == true ? ' displayNone' : '').'">';
+ echo ' <span class="pointer faicon icon-blue arrow2_d" onClick="toggleAllZoom(\'0\')"></span>';
+ echo ' </span>';
+ echo ' </span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" title="'.$lang['srv_profile_edit'].'" onclick="showZoomSettings();"></span>';
+ echo ' <span class="faicon delete" id="span_zoom_condition_remove" title="'.$lang['srv_profile_remove'].'" onclick="removeZoomProfile();"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="content '.( self::$extended == false ? 'displayNone': '').'">';
+ echo '<ul>';
+
IF (count($vars) > 0 && is_array($vars)) {
foreach ($vars AS $_spr) {
$_spr_tmp = explode('_',$_spr);
@@ -508,54 +566,63 @@ class SurveyZoom
} else {
$row = Cache::srv_spremenljivka($spr);
}
+
echo '<li id="zoom_var_condition_'.$_spr.'">';
- echo '<div class="zoom_short_text" title="('.strip_tags($row['variable']).') '.strip_tags($row['naslov']).'">';
- echo '(<b>'.strip_tags($row['variable']).'</b>) ';
- echo strip_tags($row['naslov']);
+
+ echo '<div class="zoom_question" title="('.strip_tags($row['variable']).') '.strip_tags($row['naslov']).'">';
+ echo ' <span class="semi-bold">('.strip_tags($row['variable']).')</span> '.strip_tags($row['naslov']);
echo '</div>';
- echo '<div class="zoom_short_text">';
- #echo '<div class="zoom_short_text'.( self::$extended == false ? ' displayNone': '').'">';
+
+ echo '<div class="zoom_variable">';
if (isset($vre) && $vre > 0) {
# imamo multigride polovimo grids
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_grid WHERE spr_id='$spr' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
- echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;"';
- if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
- if (in_array($row['id'],$_conditions[(int)$vre])) {
- echo 'checked="checekd"';
+
+ $checked = '';
+ if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
+ if (in_array($row['id'],$_conditions[(int)$vre])) {
+ $checked = 'checked="checked"';
}
}
- echo ' autocomplete="off">';
+
+ echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;" autocomplete="off">';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
- echo "<br>";
+ echo '<label for="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
+ echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']);
+ echo '</label>';
}
- } else {
+ }
+ else {
# imamo navaden polovimo vrednosti
$sql = sisplet_query("SELECT id, naslov, variable FROM srv_vrednost WHERE spr_id='$spr' AND other = 0 ORDER BY vrstni_red");
while ($row = mysqli_fetch_assoc($sql)) {
- echo '<label title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
- echo '<input neme="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;"';
- if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
- if (in_array($row['id'],$_conditions[(int)$vre])) {
- echo 'checked="checekd"';
+
+ $checked = '';
+ if (is_array($_conditions) && isset($_conditions[(int)$vre])) {
+ if (in_array($row['id'],$_conditions[(int)$vre])) {
+ $checked = 'checked="checked"';
}
}
- echo '>';
- echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'</label>';
- echo "<br>";
+
+ echo '<input name="zoom_cond_'.$spr.'[]" id="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" value="'.$spr.'_'.$vre.'_'.$row['id'].'" type="checkbox" onchange="changeZoomCheckbox(); return false;" '.$checked.'>';
+
+ echo '<label for="zoom_cond_'.$spr.'_'.$vre.'_'.$row['id'].'" title="'.strip_tags($row['variable']).' - '.strip_tags($row['naslov']).'">';
+ echo strip_tags($row['variable']).' - '.strip_tags($row['naslov']);
+ echo '</label>';
}
}
+
echo '</div>';
+
echo '</li>';
}
}
echo '</ul>';
- echo '</span>';
+ echo '</div>';
if ($showDiv == true) {
echo '</div>';
@@ -836,7 +903,7 @@ class SurveyZoom
static function generateAwkCondition() {
global $global_user_id;
- $zoom_if_id = (int)self::$profiles[self::$currentProfileId]['if_id'];
+ $zoom_if_id = isset(self::$profiles[self::$currentProfileId]['if_id']) ? (int)self::$profiles[self::$currentProfileId]['if_id'] : 0;
if ($zoom_if_id > 0 ) {
SurveyConditionProfiles :: Init(self::$sid, $global_user_id);
@@ -849,42 +916,31 @@ class SurveyZoom
static function getConditionString() {
global $lang;
-# $condition_label = self::$profiles[self::$currentProfileId]['condition_label'];
- ob_start();
- $b = new Branching(self::$sid );
- $if_id = (int)self::$profiles[self::$currentProfileId]['if_id'];
- $b->display_if_label($if_id);
- #$condition_label = mysqli_escape_string(ob_get_contents());
- $condition_label = ob_get_contents();
- ob_end_clean();
+ ob_start();
+ $b = new Branching(self::$sid );
+ $if_id = isset(self::$profiles[self::$currentProfileId]['if_id']) ? (int)self::$profiles[self::$currentProfileId]['if_id'] : 0;
+ $b->display_if_label($if_id);
+ $condition_label = ob_get_contents();
+ ob_end_clean();
if ( $if_id > 0 && $condition_label != '') {
- echo '<div id="conditionProfileNote" class="segmenti">';
- echo '<span class="floatLeft spaceRight">';
- # dodamo še +/- za razpiranje variabel
- echo '<span id="zoomSpritesMinus1" class="'.(self::$showVariables == true ? '' : ' displayNone').'">';
- echo '<span class="pointer faicon icon-blue minus" onClick="toggleShowZoomVariables(\'1\')" >&nbsp;</span>';
- echo '</span>';
- echo '<span id="zoomSpritesPlus1" class="'.(self::$showVariables == true ? ' displayNone' : '').'">';
- echo '<span class="pointer faicon icon-blue plus" onClick="toggleShowZoomVariables(\'0\')">&nbsp;</span>';
- echo '</span>';
- echo '</span >';
+
+ echo '<div id="conditionProfileNote" class="segmenti filter_box">';
+
+ echo ' <div class="header">';
- echo '<span class="floatLeft">'.$lang['srv_zoom_filter_note'].'</span>';
- echo '<span class="floatLeft spaceLeft">'.$condition_label.'</span>';
-/*
- // ali imamo napake v ifu
- if ((int)self::$profiles[self :: $currentProfileId]['condition_error'] != 0) {
- echo '<br>';
- echo '<span style="border:1px solid #009D91; background-color: #34D0B6; padding:5px; width:auto;"><img src="img_0/error.png" /> ';
- echo '<span class="red strong">'.$lang['srv_profile_condition_has_error'].'</span>';
- echo '</span>';
- }
- */
- echo '<span class="as_link spaceLeft" onclick="showZoomSettings();">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="removeZoomCheckbox();">'.$lang['srv_profile_remove'].'</span>';
+ echo ' <span class="semi-bold">'.$lang['srv_zoom'].'</span>';
+ echo ' <span class="condition">'.$condition_label.'</span>';
+
+ echo ' <div class="icons">';
+ echo ' <span class="faicon edit" onclick="showZoomSettings();" title="'.$lang['srv_profile_edit'].'"></span>';
+ echo ' <span class="faicon delete" onclick="removeZoomCheckbox();" title="'.$lang['srv_profile_remove'].'"></span>';
+ echo ' </div>';
+
+ echo ' </div>';
+
echo '</div>';
- echo '<br class="clr" />';
+
return true;
}
@@ -893,23 +949,25 @@ class SurveyZoom
function doZoomFromInspect() {
global $lang;
+
# polovimo id-je variabel iz inspect profila in nastavimo zoom profil
$SI = new SurveyInspect(self::$sid);
$variables_to_add = $SI->getInspectVariables();
+ # shranjujenmo v sejo
session_start();
- # shranjujenmo v sejo
- # dodamo profil in ga izberemo za privzetega
- $_SESSION['surveyZoom'][self::$sid] = array('id'=>-1, 'name'=>$lang['srv_zoom_profile_session'],'vars'=>$variables_to_add, 'conditions'=> '', 'if_id'=>0);
- self::$profiles[-1] = array('id'=>$pid, 'sid'=>self::$sid, 'uid'=>self::$uid, 'name'=>$lang['srv_zoom_profile_session'], 'vars'=>$variables_to_add,'conditions'=>'');
- self::SetDefaultProfile(-1);
- self::$currentProfileId = -1;
- session_commit();
+ # dodamo profil in ga izberemo za privzetega
+ $_SESSION['surveyZoom'][self::$sid] = array('id'=>-1, 'name'=>$lang['srv_zoom_profile_session'],'vars'=>$variables_to_add, 'conditions'=> '', 'if_id'=>0);
+ self::$profiles[-1] = array('id'=>$pid, 'sid'=>self::$sid, 'uid'=>self::$uid, 'name'=>$lang['srv_zoom_profile_session'], 'vars'=>$variables_to_add,'conditions'=>'');
+ self::SetDefaultProfile(-1);
+ self::$currentProfileId = -1;
-
+ session_commit();
+
# prikažemo segmente
- $showDiv = ((int)$_POST['showDiv'] == 1)?true:false;
+ $showDiv = ((int)$_POST['showDiv'] == 1) ? true : false;
+
self::displayZoomConditions($showDiv);
}
} \ No newline at end of file
diff --git a/admin/survey/classes/class.User.php b/admin/survey/classes/class.User.php
index 2d73f55..232400b 100644
--- a/admin/survey/classes/class.User.php
+++ b/admin/survey/classes/class.User.php
@@ -96,18 +96,42 @@ class User {
public static function findByEmail($email = null){
$user_id = sisplet_query("SELECT id FROM users WHERE email='".$email."'", "obj");
- if(!empty($user_id)){
- return $user_id->id;
- }
+ if(!empty($user_id)){
+ return $user_id->id;
+ }
- // Preverimo, če uporablja alternativni email
- $alternativni = sisplet_query("SELECT user_id FROM user_emails WHERE email='".$email."'", "obj");
- if(!empty($alternativni)){
- return $alternativni->user_id;
- }
+ // Preverimo, če uporablja alternativni email
+ $alternativni = sisplet_query("SELECT user_id FROM user_emails WHERE email='".$email."'", "obj");
+ if(!empty($alternativni)){
+ return $alternativni->user_id;
+ }
- return null;
- }
+ return null;
+ }
+
+ public static function findByEmail_AAI($email, $aai_id){
+
+ $user_id = sisplet_query("SELECT id FROM users WHERE email='".$email."'", "obj");
+ if(!empty($user_id)){
+
+ // Ce se nimamo zabelezenega aai_id-ja (uuid), ga pri prvi novi prijavi zabelezimo
+ sisplet_query("UPDATE users SET aai_id='".$aai_id."' WHERE id='".$user_id->id."' AND email='".$email."' AND aai_id=''");
+
+ return $user_id->id;
+ }
+
+ // Preverimo, če obstaja racun s tem aai id (uuid)
+ $user_id = sisplet_query("SELECT id FROM users WHERE aai_id='".$aai_id."'", "obj");
+ if(!empty($user_id)){
+
+ // Ce obstaja pomeni da je bil aai email spremenjen - ga popravimo se v bazi
+ sisplet_query("UPDATE users SET email='".$email."' WHERE id='".$user_id->id."' AND aai_id='".$aai_id."'");
+
+ return $user_id->id;
+ }
+
+ return null;
+ }
public function insertAlternativeEmail($email = NULL, $active = 0)
{
@@ -147,7 +171,8 @@ class User {
if(!empty($option)){
sisplet_query("UPDATE user_options SET option_value='".$value."' WHERE user_id='".$this->user->id."' AND id='".$option->id."'");
- }else{;
+ }
+ else{;
sisplet_query("INSERT INTO user_options (user_id, option_name, option_value, created_at) VALUES ('".$this->user->id."', '".$name."', '".$value."', NOW())");
}
}
diff --git a/admin/survey/classes/class.UserSetting.php b/admin/survey/classes/class.UserSetting.php
index 58f9488..c8c62ff 100644
--- a/admin/survey/classes/class.UserSetting.php
+++ b/admin/survey/classes/class.UserSetting.php
@@ -33,7 +33,7 @@
protected function __construct() {}
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -98,7 +98,7 @@
static function getUserId() { return self::$userId; }
static function getUserSetting($what) {
- return self::$user_setting[$what];
+ return self::$user_setting[$what] ?? null;
}
/** @desc ponastavi nastavitev in shrani v bazo
diff --git a/admin/survey/classes/class.Vprasanje.php b/admin/survey/classes/class.Vprasanje.php
index 50ba1b6..bfceb6a 100644
--- a/admin/survey/classes/class.Vprasanje.php
+++ b/admin/survey/classes/class.Vprasanje.php
@@ -13,6 +13,8 @@ class Vprasanje {
var $db_table = '';
var $expanded = 0;
+
+ protected $survey_type = null;
/**
* konstruktor
@@ -31,8 +33,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;
@@ -43,65 +44,102 @@ class Vprasanje {
*
*/
function display () {
-
- $this->tabs();
+ global $lang;
+
+ $row = Cache::srv_spremenljivka($this->spremenljivka);
+
+
+ echo '<div class="vprasanje_edit_holder">';
+
+ echo '<div id="vprasanje_header">';
+ echo ' <span class="faicon edit"></span>'.$lang['settings'];
+ echo '</div>';
+
+ // Uvod, kalkulacija in kvota nimajo tabov
+ if($this->spremenljivka != -1 && $row['tip'] != '22' && $row['tip'] != '25'){
+ echo '<div id="vprasanje_tabs">';
+ $this->tabs();
+ echo '</div>';
+ }
echo '<div id="vprasanje_edit">';
$this->vprasanje_edit();
echo '</div>';
- $this->edit_buttons();
+ echo '<div class="button_holder">';
+ $this->edit_buttons();
+ echo '</div>';
+
+ echo '</div>';
}
+
/**
* izrise tabe pri urejanju vprasanja
*
*/
- function tabs () {
+ private function tabs () {
global $lang;
global $admin_type;
$row = Cache::srv_spremenljivka($this->spremenljivka);
$rows = SurveyInfo::getInstance()->getSurveyRow();
- echo '<div id="vprasanje_tabs">';
-
- echo '<a href="#" class="tab_link active" id="tab_link_0" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'0\'); return false;">'.$lang['srv_osnovno'].'</a>';
-
if ($this->spremenljivka > 0 && !Demografija::getInstance()->isDemografija($row['variable']) ) {
- // Tab napredno
- echo '<a href="#" class="tab_link" id="tab_link_1" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'1\'); return false;">'.$lang['srv_napredno'].'</a>';
-
- // Tab pogoji
- echo '<a href="#" class="tab_link" id="tab_link_2" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'2\'); return false;">'.$lang['srv_condition'].'</a>';
-
- // Tab validacija
- echo '<a href="#" class="tab_link" id="tab_link_7" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'7\'); return false;">'.$lang['srv_validation'].'</a>';
-
- // Tab opomba
- echo '<a href="#" class="tab_link" id="tab_link_3" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'3\'); return false;">'.$lang['srv_note'].($row['note']!=''?'*':'').'</a>';
-
- // Tab tracking sprememb na vprašanju
- if (($admin_type == 0 || $admin_type == 1) && $rows['vprasanje_tracking'] > 0){
- echo '<div class="tab_link_tracking">';
- echo '<a href="#" class="tab_link" id="tab_link_6" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'6\'); return false;" title="'.$lang['hour_archive'].'"><span>'.$lang['hour_archive'].'</span></a>';
- echo '</div>';
- }
+ // Tab osnovno
+ echo '<div class="tab_link active" id="tab_link_0" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'0\'); return false;">';
+ echo ' <span>'.$lang['srv_osnovno'].'</span>';
+ echo '</div>';
+
+ // Tab napredno
+ echo '<div class="tab_link" id="tab_link_1" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'1\'); return false;">';
+ echo ' <span>'.$lang['srv_napredno'].'</span>';
+ echo '</div>';
+
+ // Tab validacija
+ echo '<div class="tab_link" id="tab_link_7" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'7\'); return false;">';
+ echo ' <span>'.$lang['srv_validation'].'</span>';
+ echo '</div>';
+
+ // Tab tracking sprememb na vprašanju
+ if (($admin_type == 0 || $admin_type == 1) && $rows['vprasanje_tracking'] > 0){
+ echo '<div class="tab_link tracking" id="tab_link_6" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'6\'); return false;" title="'.$lang['hour_archive'].'">';
+ echo ' <span><span>'.$lang['hour_archive'].'</span>';
+ echo '</div>';
+ }
}
else {
- $star = '';
+ // Uvod
if ($this->spremenljivka == -1) {
- if ($rows['thread_intro']!=0 || $rows['intro_note']!='') $star = '*';
- } else {
- if ($rows['thread_concl']!=0 || $rows['concl_note']!='') $star = '*';
+
+ // Tab osnovno
+ /*echo '<div class="tab_link active" id="tab_link_0" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'0\'); return false;">';
+ echo ' <span>'.$lang['srv_osnovno'].'</span>';
+ echo '</div>';
+
+ // Tab opomba
+ $star = '';
+ if ($rows['thread_intro']!=0 || $rows['intro_note']!='')
+ $star = '*';
+
+ echo '<div class="tab_link" id="tab_link_3" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'3\'); return false;">';
+ echo ' <span>'.$lang['srv_note'].$star.'</span>';
+ echo '</div>';*/
+ }
+ else {
+ // Tab osnovno
+ echo '<div class="tab_link active" id="tab_link_0" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'0\'); return false;">';
+ echo ' <span>'.$lang['srv_osnovno'].'</span>';
+ echo '</div>';
+
+ // Tab napredno
+ echo '<div class="tab_link" id="tab_link_1" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'1\'); return false;">';
+ echo ' <span>'.$lang['srv_napredno'].'</span>';
+ echo '</div>';
}
-
- echo '<a href="#" class="tab_link" id="tab_link_3" onclick="vprasanje_tab(\''.$this->spremenljivka.'\', \'3\'); return false;">'.$lang['srv_note'].$star.'</a>';
- }
-
- echo '</div>';
+ }
}
/**
@@ -117,36 +155,59 @@ class Vprasanje {
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'" />';
echo '<input type="hidden" name="spremenljivka" value="'.$this->spremenljivka.'" />';
- echo '<div id="tab_0" class="tab" style="display:block">';
- $this->vprasanje_osnovno();
- echo '</div>';
-
- if ($this->spremenljivka > 0) {
-
- echo '<div id="tab_1" class="tab" style="display:none">';
- $this->vprasanje_napredno();
- echo '</div>';
-
- echo '<div id="tab_2" class="tab" style="display:none">';
- $this->vprasanje_pogoji();
- echo '</div>';
-
- echo '<div id="tab_7" class="tab" style="display:none">';
- $this->vprasanje_validation();
- echo '</div>';
-
- echo '<div id="tab_6" class="tab" style="display:none">';
- $this->vprasanje_display_tracking();
- echo '</div>';
- }
-
- echo '<div id="tab_3" class="tab" style="display:none">';
- $this->vprasanje_komentarji();
- echo '</div>';
+
+ // Uvod
+ if ($this->spremenljivka == -1) {
+ echo '<div id="tab_0" class="tab" style="display:block">';
+ $this->edit_uvod();
+ echo '</div>';
+ }
+ // Zakljucek
+ elseif ($this->spremenljivka == -2) {
+ echo '<div id="tab_0" class="tab" style="display:block">';
+ $this->edit_zakljucek();
+ echo '</div>';
+
+ echo '<div id="tab_1" class="tab" style="display:none">';
+ $this->edit_zakljucek_napredno();
+ echo '</div>';
+ }
+ // Statistika
+ elseif($this->spremenljivka == -3) {
+ echo '<div id="tab_0" class="tab" style="display:block">';
+ $this->edit_statistika();
+ echo '</div>';
+ }
+ // Vprasanje
+ else {
+
+ // Kalkulacija in kvota imata samo validacijo, nobenih drugih nastavitev
+ if($row['tip'] == '22' || $row['tip'] == '25'){
+
+ echo '<div id="tab_7" class="tab" style="display:block">';
+ $this->vprasanje_validation();
+ echo '</div>';
+ }
+ else{
+ echo '<div id="tab_0" class="tab" style="display:block">';
+ $this->vprasanje_osnovno();
+ echo '</div>';
+
+ echo '<div id="tab_1" class="tab" style="display:none">';
+ $this->vprasanje_napredno();
+ echo '</div>';
+
+ echo '<div id="tab_7" class="tab" style="display:none">';
+ $this->vprasanje_validation();
+ echo '</div>';
+
+ echo '<div id="tab_6" class="tab" style="display:none">';
+ $this->vprasanje_display_tracking();
+ echo '</div>';
+ }
+ }
echo '</form>';
-
- echo '<span id="vprasanje_edit_bottom_placeholder"></span>';
}
/**
@@ -157,320 +218,314 @@ class Vprasanje {
global $lang;
global $site_url;
- //uvod
- if ($this->spremenljivka == -1) {
- $this->edit_uvod();
-
- //zakljucek
- } elseif ($this->spremenljivka == -2) {
- $this->edit_zakljucek();
-
- //statistika
- } elseif($this->spremenljivka == -3) {
- $this->edit_statistika();
-
- } else {
-
- $row = Cache::srv_spremenljivka($this->spremenljivka);
- $spremenljivkaParams = new enkaParameters($row['params']);
-
- // demografija
- if (Demografija::getInstance()->isDemografija($row['variable'])) {
-
- // variabla na vrhu in izbira druge demografije
- $this->variable();
-
- // izbira tipa demografije
- echo '<fieldset><legend>'.$lang['srv_question_type'].'</legend>';
- echo '<p><span class="title">'.$lang['srv_select_type'].':</span><span class="content"><select style="width:150px" name="tip" id="spremenljivka_tip_' . $row['id'] . '" size="1" spr_id="' . $row['id'] . '" onChange="change_demografija(\'' . $row['id'] . '\', $(this).val());" data-ajax="true">';
-
- foreach (Demografija::getInstance()->getSeznam($row['variable']) AS $variabla) {
- echo '<option value="'.Demografija::getInstance()->getSpremenljivkaID($variabla).'" '.($row['variable'] == $variabla?'selected':'').'>'.$variabla.'</option>';
- }
-
- echo '</select></span></p>';
-
- echo '<script type="text/javascript">';
- echo '$(document).ready(function() { ';
- echo '$("#spremenljivka_tip_' . $row['id'] . '").selectbox();'; // kreira custom dropdown z možnostjo predogleda vprašanja
- echo '});';
- echo '</script>';
-
- echo '<p><strong>'.$lang[$row['variable']].'</strong></p>';
-
- echo '</fieldset>';
-
- // reminder
- $this->edit_reminder();
-
-
- }
- // navadno vprasanje
- else {
-
- // variabla na vrhu
- $this->variable(1);
-
- // prikaz vprasanja - postavitev
- if ( in_array($row['tip'], array(1, 2, 3, 6, 7, 16, 17, 20, 9, 26, 27)) ) {
- $this->edit_subtip();
- }
-
- // Nastavitev za postavitev texbox za besedilo, number, datum - vodoravno ob ali pod vprasanjem
- if ( in_array($row['tip'], array(21, 7, 8)) ) {
+ $row = Cache::srv_spremenljivka($this->spremenljivka);
+ $spremenljivkaParams = new enkaParameters($row['params']);
+
+ // demografija
+ if (Demografija::getInstance()->isDemografija($row['variable'])) {
+
+ // variabla na vrhu in izbira druge demografije
+ $this->variable();
+
+ // izbira tipa demografije
+ echo '<fieldset><legend>'.$lang['srv_question_type'].'</legend>';
+ echo '<p><span class="title">'.$lang['srv_select_type'].':</span><span class="content"><select style="width:150px" name="tip" id="spremenljivka_tip_' . $row['id'] . '" size="1" spr_id="' . $row['id'] . '" onChange="change_demografija(\'' . $row['id'] . '\', $(this).val());" data-ajax="true">';
+
+ foreach (Demografija::getInstance()->getSeznam($row['variable']) AS $variabla) {
+ echo '<option value="'.Demografija::getInstance()->getSpremenljivkaID($variabla).'" '.($row['variable'] == $variabla?'selected':'').'>'.$variabla.'</option>';
+ }
+
+ echo '</select></span></p>';
+
+ echo '<script type="text/javascript">';
+ echo '$(document).ready(function() { ';
+ echo '$("#spremenljivka_tip_' . $row['id'] . '").selectbox();'; // kreira custom dropdown z možnostjo predogleda vprašanja
+ echo '});';
+ echo '</script>';
+
+ echo '<p><strong>'.$lang[$row['variable']].'</strong></p>';
+
+ echo '</fieldset>';
+
+ // reminder
+ $this->edit_reminder();
+ }
+ // navadno vprasanje
+ else {
+
+ // TIP IN PODTIP VPRASANJA
+ echo '<fieldset class="first">';
- // Ce nimamo slider-ja
- if($row['tip'] != 7 || $row['ranking_k'] != 1){
- $this->edit_orientation();
- }
- }
-
- // datum-min/max date
- if ( in_array($row['tip'], array(8)) ) {
- $this->edit_date_range();
- $this->edit_date_withTime();
- }
-
- // Lokacija
- if ( in_array($row['tip'], array(26)) ) {
- $this->edit_input_type_map();
- $this->fokus_mape();
- $this->userLocation();
- $this->markerPodvprasanje();
- $this->naslov_podvprasanja_map();
- $this->st_markerjev();
- $this->dodaj_SearchBox();
- }
-
- // pri nagovoru ni smiselno dodajat opozoril
- if ( ! in_array($row['tip'], array(5)) ) {
- $this->edit_reminder();
- }
+ // Izbira tipa vprasanja
+ $this->variable(1);
+
+ // prikaz vprasanja - postavitev
+ if ( in_array($row['tip'], array(1, 2, 3, 6, 7, 16, 17, 20, 9, 26, 27)) ) {
+ $this->edit_subtip();
+ }
+
+ // Nastavitev za postavitev texbox za besedilo, number, datum - vodoravno ob ali pod vprasanjem
+ if ( in_array($row['tip'], array(21, 7, 8)) ) {
- // opomba na vprasanje
- $this->edit_opomba();
-
- if (($row['tip'] == 7 || $row['tip'] == 20) && $row['ranking_k'] == 1) {
+ // Ce nimamo slider-ja
+ if($row['tip'] != 7 || $row['ranking_k'] != 1){
+ $this->edit_orientation();
+ }
+ }
- echo '<fieldset><legend>'.$lang['slider_properties_note'].'</legend>';
- $this->edit_sliders_settings();
- echo '</fieldset>';
- }
+ echo '</fieldset>';
+
+
+ // POGOSTE NASTAVITVE
+ echo '<fieldset><legend>'.$lang['srv_common_settings'].'</legend>';
+
+ // datum-min/max date
+ if ( in_array($row['tip'], array(8)) ) {
+ $this->edit_date_range();
+ $this->edit_date_withTime();
+ }
- // Hotspot
- if( in_array($row['tip'], array(1, 2, 6, 17)) ){
- $this->edit_hot_spot_settings();
- }
-
- if ( in_array($row['tip'], array(6, 16, 19, 20)) ) {
+ // Lokacija
+ if ( in_array($row['tip'], array(26)) ) {
+ $this->edit_input_type_map();
+ $this->fokus_mape();
+ $this->userLocation();
+ $this->markerPodvprasanje();
+ $this->naslov_podvprasanja_map();
+ $this->st_markerjev();
+ $this->dodaj_SearchBox();
+ }
- if ($row['ranking_k'] != 1){
- echo '<fieldset><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
- }
- if ( in_array($row['tip'], array(6, 16)) ) {
- $this->edit_grid_subtitle();
- }
-
- $this->edit_grid();
-
- // Uporaba label
- $this->edit_column_labels();
-
- // Ponovi glavo v gridu vsakih x vrstic
- if ( in_array($row['tip'], array(6, 16)) )
- $this->edit_grid_repeat_header();
-
- $this->edit_drag_and_drop_new_look();
-
- if ($row['ranking_k'] != 1){
- echo '</fieldset>';
- }
-
- // Merska lestvica (ordinalna ali nominalna)
- if ($row['tip'] == 6){
- $this->edit_skala_new();
- }
-
- echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
- $this->edit_grid_missing();
- echo '</fieldset>';
- }
+ // pri nagovoru ni smiselno dodajat opozoril
+ if ( ! in_array($row['tip'], array(5)) ) {
+ $this->edit_reminder();
+ }
- // kategorije vprasanj
- if ( in_array($row['tip'], array(1, 2, 3, 6, 16, 17, 18, 19, 20, 24)) ) {
-
- if ( in_array($row['tip'], array(1, 2, 3, 17, 18)) ){
- echo '<fieldset class="kategorije_odgovorov" id="kategorije_odgovorov_'.$row['id'].'"><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
- }
- else{
- echo '<fieldset><legend>'.$lang['srv_podvprasanja'].'</legend>';
- }
-
- if ( in_array($row['tip'], array(24)) ) {
- $this->edit_multiple_subtitle();
- }
-
- if ( in_array($row['tip'], array(6, 16, 19, 18, 20, 24)) ) {
- $this->edit_grid_width();
-
- if ( in_array($row['tip'], array(6, 16, 19, 20, 24)) ) {
- $this->edit_grid_align();
- }
- }
-
- // kategorije vprasanja - hitro dodajanje
- $this->edit_vrednost();
-
- // razvrscanje
- if(!in_array($row['orientation'], [9,11])) {
- $this->edit_random();
- }
-
- if ( in_array($row['tip'], array(1, 2, 3, 6, 16)) ) {
- $this->edit_selectbox_size();
- }
+ if ($row['tip'] == 1 || $row['tip'] == 3 || $row['tip'] == 6){
+ $this->edit_skala_new();
+ }
- // Slikice namesto radio gumbov (smiley, thumbs up...) - $row['orientation'] == 9
- if(in_array($row['tip'], array(1, 2))){
- $this->edit_custom_picture_radio();
- }
+ // opomba na vprasanje
+ $this->edit_opomba();
- if(in_array($row['tip'], array(1, 6))){
- $this->edit_visual_analog_scale();
- }
+ // Crta pod nagovorom
+ if ($row['tip'] == 5) {
+ $this->edit_nagovor_line();
+ }
-
- // razvrscanje - moznosti
- if ( in_array($row['tip'], array(17)) ) {
- $this->edit_ranking_moznosti();
- }
-
- echo '</fieldset>';
- }
-
- // Merska lestvica (ordinalna ali nominalna)
- if ($row['tip'] == 1 || $row['tip'] == 3){
- $this->edit_skala_new();
- }
- // manjkajoce vrednosti
- if ($row['tip'] <= 3) {
- echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
- $this->edit_missing();
- echo '</fieldset>';
- }
-
- // editiranje vrednosti pri datumu
- if ( in_array($row['tip'], array(8)) ) {
+ echo '</fieldset>';
- echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
-
- $this->edit_vrednost_datum();
-
- // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
- $this->edit_alert_show_missing();
-
- echo '</fieldset>';
- }
-
-
-
- if ( in_array($row['tip'], array(7, 19, 20, 21)) ) {
+
+ if (($row['tip'] == 7 || $row['tip'] == 20) && $row['ranking_k'] == 1) {
+
+ echo '<fieldset><legend>'.$lang['slider_properties_note'].'</legend>';
+ $this->edit_sliders_settings();
+ echo '</fieldset>';
+ }
+
+ // Hotspot
+ if( in_array($row['tip'], array(1, 2, 6, 17)) ){
+ $this->edit_hot_spot_settings();
+ }
- $captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
+ // Heatmap
+ if ($row['tip'] == 27) {
+ $this->edit_heatmap_settings();
+ }
+
+ if ( in_array($row['tip'], array(6, 16, 19, 20)) ) {
- //ce ni elektronski podpis, upload ali captcha
- if($row['signature'] != 1 && $row['upload'] < 1 && $captcha != 1){
- $displayFieldset = 'display: block';
- }
- else{
- $displayFieldset = 'display: none';
- }
+ if ($row['ranking_k'] != 1){
+ echo '<fieldset><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
+ }
+ if ( in_array($row['tip'], array(6, 16)) ) {
+ $this->edit_grid_subtitle();
+ }
+
+ $this->edit_grid();
+
+ // Uporaba label
+ $this->edit_column_labels();
+
+ // Ponovi glavo v gridu vsakih x vrstic
+ if ( in_array($row['tip'], array(6, 16)) )
+ $this->edit_grid_repeat_header();
+
+ $this->edit_drag_and_drop_new_look();
+
+ if ($row['ranking_k'] != 1){
+ echo '</fieldset>';
+ }
+ }
- echo '<fieldset style="'.$displayFieldset.'" class="kategorije_odgovorov" id="kategorijeOdgovorov_'.$this->spremenljivka.'"><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
+ // kategorije vprasanj
+ if ( in_array($row['tip'], array(1, 2, 3, 6, 16, 17, 18, 19, 20, 24)) ) {
+
+ if ( in_array($row['tip'], array(1, 2, 3, 17, 18)) ){
+ echo '<fieldset class="kategorije_odgovorov" id="kategorije_odgovorov_'.$row['id'].'"><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
+ }
+ else{
+ echo '<fieldset><legend>'.$lang['srv_podvprasanja'].'</legend>';
+ }
- if ( in_array($row['tip'], array(21)) ) {
- $this->edit_textboxes();
- }
+ if ( in_array($row['tip'], array(24)) ) {
+ $this->edit_multiple_subtitle();
+ }
+
+ if ( in_array($row['tip'], array(6, 16, 19, 18, 20, 24)) ) {
+ $this->edit_grid_width();
- if ( in_array($row['tip'], array(7)) ) {
- if ($row['ranking_k'] == 0){ //ce je izbrano stevilo in ne drsnik
- $this->edit_num_size();
- $this->edit_num_enota();
- }
+ if ( in_array($row['tip'], array(6, 16, 19, 20, 24)) ) {
+ $this->edit_grid_align();
}
-
+ }
+
+ // kategorije vprasanja - hitro dodajanje
+ $this->edit_vrednost();
+
+ // razvrscanje -- za tip 1 se mora prikazati v drugem vrstnem redu
+ if(!in_array($row['orientation'], [9,11]) && $row['tip'] !== '1') {
+ $this->edit_random();
+ }
+
+ if ( in_array($row['tip'], array(1, 2, 3, 6, 16)) ) {
+ $this->edit_selectbox_size();
+ }
+
+ // Slikice namesto radio gumbov (smiley, thumbs up...) - $row['orientation'] == 9
+ if(in_array($row['tip'], array(1, 2))){
+ $this->edit_custom_picture_radio();
+ }
+
+ // visualne barvne ni za grid
+ if(in_array($row['tip'], array(1/* , 6 */))){
+ $this->edit_visual_analog_scale();
+ $this->edit_visual_analog_type();
+ }
+
+
+ // razvrscanje - moznosti
+ if ( in_array($row['tip'], array(17)) ) {
+ $this->edit_ranking_moznosti();
+ }
+
+ echo '</fieldset>';
+ }
+
+
+ if ( in_array($row['tip'], array(7, 19, 20, 21)) ) {
+
+ $captcha = ($spremenljivkaParams->get('captcha') ? $spremenljivkaParams->get('captcha') : 0);
+
+ //ce ni elektronski podpis, upload ali captcha
+ if($row['signature'] != 1 && $row['upload'] < 1 && $captcha != 1){
+ $displayFieldset = 'display: block';
+ }
+ else{
+ $displayFieldset = 'display: none';
+ }
+
+ if ($row['ranking_k'] == 0)
+ echo '<fieldset style="'.$displayFieldset.'" class="kategorije_odgovorov" id="kategorijeOdgovorov_'.$this->spremenljivka.'"><legend>'.$lang['srv_kategorije_odgovorov'].'</legend>';
+
+ if ( in_array($row['tip'], array(21)) ) {
+ $this->edit_textboxes();
+ }
+
+ if ( in_array($row['tip'], array(7)) ) {
if ($row['ranking_k'] == 0){ //ce je izbrano stevilo in ne drsnik
- $this->edit_width();
+ $this->edit_num_size();
+ $this->edit_num_enota();
}
-
- echo '</fieldset>';
+ }
+
+ if ($row['ranking_k'] == 0){ //ce je izbrano stevilo in ne drsnik
+ $this->edit_width();
+ }
+
+ if ($row['ranking_k'] == 0)
+ echo '</fieldset>';
- // Poseben segment za upload datoteke
- if($row['upload'] == 1){
- $displayFieldset = 'display: block';
- }
- else{
- $displayFieldset = 'display: none';
- }
+ // Poseben segment za upload datoteke
+ if($row['upload'] == 1){
+ $displayFieldset = 'display: block';
+ }
+ else{
+ $displayFieldset = 'display: none';
+ }
+
+ echo '<fieldset style="'.$displayFieldset.'" class="upload_info"><legend>'.$lang['srv_vprasanje_upload_limit_title'].' '.Help::display('srv_upload_limit').'</legend>';
+ echo '<p>'.$lang['srv_vprasanje_upload_limit'].'</p>';
+ echo '<p>'.$lang['srv_vprasanje_upload_limit_type'].'</p>';
+ echo '</fieldset>';
+ }
+
+ // manjkajoce vrednosti - besedilo
+ if ( in_array($row['tip'], array(21)) ) {
+
+ echo '<input type="hidden" name="edit_vrednost_besedilo" value="1" />';
+
+ //missingi so sli v branching na bottom box
+ //echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
+ //$this->edit_vrednost_missing();
+ //echo '</fieldset>';
+ }
+
+ // Sirina polja "drugo" (ce je v vprasanju)
+ if (in_array($row['tip'], array(1,2,3,6,16,19,20,24)))
+ $this->edit_other_field();
+
+ if ( in_array($row['tip'], array(7, 18, 20, 21)) ) {
+
+ // ce je izbrano stevilo in ne drsnik - omejitve vnosa
+ if ($row['ranking_k'] == 0){
+
+ echo '<fieldset>';
+ //echo ' <legend class="pointer" onClick="fieldsetToggle(this);"><span class="faicon arrow2_d"></span>'.$lang['srv_num_limits'].'</legend>';
+ echo ' <legend>'.$lang['srv_num_limits'].'</legend>';
+
+ //echo ' <div class="fieldset_holder" style="display:none;">';
+ echo ' <div class="fieldset_holder">';
+
+ if ($row['tip'] != 21)
+ $this->edit_number();
+
+ $this->edit_limit();
+
+ echo ' </div>';
- echo '<fieldset style="'.$displayFieldset.'" class="upload_info"><legend>'.$lang['srv_vprasanje_upload_limit_title'].' '.Help::display('srv_upload_limit').'</legend>';
- echo '<p>'.$lang['srv_vprasanje_upload_limit'].'</p>';
- echo '<p>'.$lang['srv_vprasanje_upload_limit_type'].'</p>';
echo '</fieldset>';
}
-
- // manjkajoce vrednosti - besedilo
- if ( in_array($row['tip'], array(21)) ) {
- echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
- $this->edit_vrednost_besedilo();
-
- // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
- $this->edit_alert_show_missing();
- echo '</fieldset>';
- }
-
- // Sirina polja "drugo" (ce je v vprasanju)
- if (in_array($row['tip'], array(1,2,3,6,16,19,20,24)))
- $this->edit_other_field();
-
- if ( in_array($row['tip'], array(7, 18, 20)) ) {
-
- if ($row['ranking_k'] == 0){ //ce je izbrano stevilo in ne drsnik
- $this->edit_number();
- }
-
- if ($row['tip'] == 7) {
- echo '<fieldset><legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
- $this->edit_vrednost_number();
-
- // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
- $this->edit_alert_show_missing();
+ }
- echo '</fieldset>';
- }
- }
-
- if ( in_array($row['tip'], array(22)) ) {
- $this->edit_compute();
- }
-
- if ( in_array($row['tip'], array(9)) ) {
- $this->edit_name_generator();
- }
-
- if ( in_array($row['tip'], array(7,18,20, 21)) ) {
- if ($row['ranking_k'] == 0){ //ce je izbrano stevilo in ne drsnik
- $this->edit_limit();
- }
- }
-
- // Crta pod nagovorom
- if ($row['tip'] == 5) {
- $this->edit_nagovor_line();
- }
- }
- }
+ if ($row['tip'] == 7) {
+
+ echo '<input type="hidden" name="edit_vrednost_number" value="1" />';
+
+ //missingi so sli v branching na bottom box
+ //echo '<fieldset>';
+ //echo ' <legend class="pointer" onClick="fieldsetToggle(this);"><span class="faicon arrow2_d"></span>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
+ //echo ' <legend>'.$lang['srv_manjkajoce_vrednosti2'].' '.Help::display('srv_missing_values').'</legend>';
+
+ //echo ' <div class="fieldset_holder" style="display:none;">';
+ //echo ' <div class="fieldset_holder">';
+ //$this->edit_vrednost_missing();
+ //echo ' </div>';
+
+ //echo '</fieldset>';
+ }
+
+ if ( in_array($row['tip'], array(22)) ) {
+ $this->edit_compute();
+ }
+
+ if ( in_array($row['tip'], array(9)) ) {
+ $this->edit_name_generator();
+ }
+
+
+ }
}
function edit_sliders_settings(){
@@ -537,185 +592,225 @@ class Vprasanje {
$slider_VmesneCrtice_opacity = 1;
$disable_slider_VmesneCrtice = '';
}
-
- //echo '<input type="hidden" name="MinMaxLabelsDefaultFlag" value="1" />';
-
+
+
// Polje size moramo imeti - drugace se pobrise vse iz srv_vrednost in se ne shranjuje vec
echo '<input type="hidden" value="1" name="size" id="num_size">';
- //Drsna rocica
- echo '<label for="slider_handle_'.$this->spremenljivka.'"><div class="dropsliderhandle" >'; //drsna rocica
- echo '<p><span class="title" >'.$lang['slider_handle_note'].':</span>';
- //echo $slider_handle;
- echo '<span class="content">';
- echo '<input type="checkbox" value="0" name="slider_handle" '.( $slider_handle == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_handle_'.$this->spremenljivka.'">';
-
- //echo '<input type="hidden" value="1" name="slider_handle" id="slider_handle_hidden_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_handle_hidden.' type="hidden" value="1" name="slider_handle" id="slider_handle_hidden_'.$this->spremenljivka.'">';
- //echo '<input type="checkbox" value="1" name="slider_handle" '.( $slider_handle == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_handle_'.$this->spremenljivka.'">';
+ // Drsna rocica
+ echo '<div class="vprasanje_setting_holder dropsliderhandle">';
- //echo '<input type="hidden" value="0" name="slider_handle" id="slider_handle_hidden_'.$this->spremenljivka.'">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="0" name="slider_handle" '.( $slider_handle == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_handle_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_handle_'.$this->spremenljivka.'">'.$lang['slider_handle_note'].'</label>';
+ echo ' <input '.$disable_slider_handle_hidden.' type="hidden" value="1" name="slider_handle" id="slider_handle_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
- echo '</span></p>';
- echo '</div></label>';
-
- //Stevilka nad izbrano tocko
- echo '<label for="slider_window_number_'.$this->spremenljivka.'"><div class="dropsliderwindownumber" >';
- echo '<p><span class="title" >'.$lang['slider_window_number_title'].':</span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="0" name="slider_window_number" '.( $slider_window_number == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_window_number_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_window_number_hidden.' type="hidden" value="1" name="slider_window_number" id="slider_window_number_hidden_'.$this->spremenljivka.'">';
- //echo '<input '.$disable_slider_window_number_hidden.' value="1" name="slider_window_number" id="slider_window_number_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
+ echo '</div>';
+
+ // Stevilka nad izbrano tocko
+ echo '<div class="vprasanje_setting_holder dropsliderwindownumber">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="0" name="slider_window_number" '.( $slider_window_number == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_window_number_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_window_number_'.$this->spremenljivka.'">'.$lang['slider_window_number_title'].'</label>';
+ echo ' <input '.$disable_slider_window_number_hidden.' type="hidden" value="1" name="slider_window_number" id="slider_window_number_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Nakazi mozne odgovore
if ($admin_type == 0){
- //Nakazi mozne odgovore
- echo '<label for="slider_nakazi_odgovore_'.$this->spremenljivka.'"><div class="dropslidernakaziodgovore" >';
- echo '<p><span class="title" >'.$lang['srv_slider_nakazi_odgovore'].':</span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="slider_nakazi_odgovore" '.( $slider_nakazi_odgovore == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_nakazi_odgovore_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_nakazi_odgovore_hidden.' type="hidden" value="0" name="slider_nakazi_odgovore" id="slider_nakazi_odgovore_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
+
+ echo '<div class="vprasanje_setting_holder dropslidernakaziodgovore">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="1" name="slider_nakazi_odgovore" '.( $slider_nakazi_odgovore == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_nakazi_odgovore_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_nakazi_odgovore_'.$this->spremenljivka.'">'.$lang['srv_slider_nakazi_odgovore'].'</label>';
+ echo ' <input '.$disable_slider_nakazi_odgovore_hidden.' type="hidden" value="0" name="slider_nakazi_odgovore" id="slider_nakazi_odgovore_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
+ echo '</div>';
}
-
-
- //Korak drsnika
+ // Korak drsnika
$viewMinMaxNumLabels = ($slider_VmesneDescrLabel == 1) ? '; display:none;' : '';
- echo '<div class="dropsliderhandle_step_'.$this->spremenljivka.'" style="opacity: '.$slider_handle_step_opacity.''.$viewMinMaxNumLabels.'">'; //korak drsnika
- echo '<p><span class="title" >'.$lang['slider_handle_step_note'].':</span>';
- echo '<span class="content"><select name="slider_handle_step" id="slider_handle_step_'.$this->spremenljivka.'" '.$disable_slider_handle_step.'>';
+
+ echo '<div class="vprasanje_setting_holder dropsliderhandle_step_'.$this->spremenljivka.'" style="opacity: '.$slider_handle_step_opacity.''.$viewMinMaxNumLabels.'">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['slider_handle_step_note'].':</label>';
+ echo ' <span class="content"><select name="slider_handle_step" id="slider_handle_step_'.$this->spremenljivka.'" '.$disable_slider_handle_step.'>';
for($i=1; $i<=10; $i++){
echo '<option value="'.$i.'"'.($slider_handle_step == $i ? ' selected="true"' : '') . '>'.$i.'</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
- //Min in max vrednosti
+
+ // Min in max vrednosti
$viewMinMaxNumLabels = ($slider_VmesneDescrLabel == 1) ? ' style="display:none;"' : '';
- echo '<div class="MinMaxNumLabels_'.$this->spremenljivka.'" '.$viewMinMaxNumLabels.'>'; //ureditev min in max stevilk
- echo '<p>';
- echo $lang['srv_num_min'] . '<input type="text" name="slider_MinNumLabel" id="slider_MinNumLabel_'.$this->spremenljivka.'" value="' . $slider_MinNumLabel . '" size="8" onkeyup="checkNumber(this, 6, 2); sliderCopytoMinNumLabelTemp('.$this->spremenljivka.');"></input> ';
- echo $lang['srv_num_limit'] . '<input type="text" name="slider_MaxNumLabel" id="slider_MaxNumLabel_'.$this->spremenljivka.'" value="' . $slider_MaxNumLabel . '" size="8" onkeyup="checkNumber(this, 6, 2); sliderCopytoMaxNumLabelTemp('.$this->spremenljivka.');"></input> ';
- echo '</p>';
+
+ echo '<div class="vprasanje_setting_holder MinMaxNumLabels_'.$this->spremenljivka.'" '.$viewMinMaxNumLabels.'">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_min'].':</label>';
+ echo ' <span class="content"><input type="text" name="slider_MinNumLabel" id="slider_MinNumLabel_'.$this->spremenljivka.'" value="' . $slider_MinNumLabel . '" size="8" onkeyup="checkNumber(this, 6, 2); sliderCopytoMinNumLabelTemp('.$this->spremenljivka.');"></input></span>';
+ echo ' </div>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_limit'].':</label>';
+ echo ' <span class="content"><input type="text" name="slider_MaxNumLabel" id="slider_MaxNumLabel_'.$this->spremenljivka.'" value="' . $slider_MaxNumLabel . '" size="8" onkeyup="checkNumber(this, 6, 2); sliderCopytoMaxNumLabelTemp('.$this->spremenljivka.');"></input></span>';
+ echo ' </div>';
+
echo '</div>';
- //temp Min in Max style="display: none"
- echo '<div class="MinMaxNumLabelsTemp" style="display: none" >'; //ureditev temp min in max stevilk, za vrnitev stevilskih label, ki so bile prej izbrane
- echo '<p>';
- echo $lang['srv_num_min'] . '<input type="text" name="slider_MinNumLabelTemp" id="slider_MinNumLabelTemp_'.$this->spremenljivka.'" value="' . $slider_MinNumLabelTemp . '" size="8" onkeyup="checkNumber(this, 6, 2);"></input> ';
- echo $lang['srv_num_limit'] . '<input type="text" name="slider_MaxNumLabelTemp" id="slider_MaxNumLabelTemp_'.$this->spremenljivka.'" value="' . $slider_MaxNumLabelTemp . '" size="8" onkeyup="checkNumber(this, 6, 2);"></input> ';
- echo '</p>';
+
+ // temp Min in Max style="display: none"
+ echo '<div class="vprasanje_setting_holder MinMaxNumLabelsTemp" style="display:none;">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_min'].':</label>';
+ echo ' <span class="content"><input type="text" name="slider_MinNumLabelTemp" id="slider_MinNumLabelTemp_'.$this->spremenljivka.'" value="' . $slider_MinNumLabelTemp . '" size="8" onkeyup="checkNumber(this, 6, 2);"></input></span>';
+ echo ' </div>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_limit'].':</label>';
+ echo ' span class="content"><input type="text" name="slider_MaxNumLabelTemp" id="slider_MaxNumLabelTemp_'.$this->spremenljivka.'" value="' . $slider_MaxNumLabelTemp . '" size="8" onkeyup="checkNumber(this, 6, 2);"></input></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Vmesne crtice
+ echo '<div class="vprasanje_setting_holder slider_VmesneCrtice_'.$this->spremenljivka.' dropVmesneCrtice" style="opacity: '.$slider_VmesneCrtice_opacity.'">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input '.$disable_slider_VmesneCrtice.' type="checkbox" value="1" name="slider_VmesneCrtice" '.( $slider_VmesneCrtice == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneCrtice_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_VmesneCrtice_'.$this->spremenljivka.'">'.$lang['slider_VmesneCrtice_note'].'</label>';
+ echo ' <input '.$disable_slider_VmesneCrtice_hidden.' type="hidden" value="0" name="slider_VmesneCrtice" id="slider_VmesneCrtice_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
echo '</div>';
- //temp Min in Max - konec
-
- //Vmesne crtice
- echo '<label class="slider_VmesneCrtice_'.$this->spremenljivka.'" for="slider_VmesneCrtice_'.$this->spremenljivka.'"><div class="dropVmesneCrtice" style="opacity: '.$slider_VmesneCrtice_opacity.'">'; //ureditev prikazovanja in skrivanja vmesnih crtic
- echo '<p><span class="title" >'.$lang['slider_VmesneCrtice_note'].':</span>';
- echo '<span class="content">';
- echo '<input '.$disable_slider_VmesneCrtice.' type="checkbox" value="1" name="slider_VmesneCrtice" '.( $slider_VmesneCrtice == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneCrtice_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_VmesneCrtice_hidden.' type="hidden" value="0" name="slider_VmesneCrtice" id="slider_VmesneCrtice_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
-
- //Stevilske labele
- //echo '<p><span class="title" >'.$lang['slider_NumLabel_note'].':</span></p>';
-
- echo '<div class="dropNumLabelNew">';
-
- echo '<label for="slider_VmesneNumLabel_'.$this->spremenljivka.'"><p><span class="title" >'.$lang['slider_NumLabel_note'].':</span>'; //ureditev prikazovanja in skrivanja stevilskih vmesnih label
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="slider_VmesneNumLabel" '.( $slider_VmesneNumLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneNumLabel_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_VmesneNumLabel_hidden.' type="hidden" value="0" name="slider_VmesneNumLabel" id="slider_VmesneNumLabel_hidden_'.$this->spremenljivka.'">';
- echo '</span></p></label>';
-
- echo '<label for="slider_MinMaxNumLabelNew_'.$this->spremenljivka.'"><p><span class="title" >'.$lang['slider_MinMaxNumLabel_note'].':</span>';
- echo '<span class="content">'; //ureditev prikazovanja in skrivanja stevilskih label za min in max na sliderju s pips-i
- echo '<input type="checkbox" value="0" name="slider_MinMaxNumLabelNew" '.( $slider_MinMaxNumLabelNew == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_MinMaxNumLabelNew_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_MinMaxNumLabelNew_hidden.' type="hidden" value="1" name="slider_MinMaxNumLabelNew" id="slider_MinMaxNumLabelNew_hidden_'.$this->spremenljivka.'">';
- echo '</span></p></label>';
+
+
+ // Stevilske labele
+ echo '<div class="vprasanje_setting_holder dropNumLabelNew">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="1" name="slider_VmesneNumLabel" '.( $slider_VmesneNumLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneNumLabel_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_VmesneNumLabel_'.$this->spremenljivka.'">'.$lang['slider_NumLabel_note'].'</label>';
+ echo ' <input '.$disable_slider_VmesneNumLabel_hidden.' type="hidden" value="0" name="slider_VmesneNumLabel" id="slider_VmesneNumLabel_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<div class="vprasanje_setting_holder dropNumLabelNew">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="0" name="slider_MinMaxNumLabelNew" '.( $slider_MinMaxNumLabelNew == 0 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_MinMaxNumLabelNew_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_MinMaxNumLabelNew_'.$this->spremenljivka.'">'.$lang['slider_MinMaxNumLabel_note'].'</label>';
+ echo ' <input '.$disable_slider_MinMaxNumLabelNew_hidden.' type="hidden" value="1" name="slider_MinMaxNumLabelNew" id="slider_MinMaxNumLabelNew_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
echo '</div>';
- //Opisne labele
- echo '<div class="dropDescriptiveLabel" >';
- echo '<label for="slider_MinMaxLabel_'.$this->spremenljivka.'"><p><span class="title">'.$lang['slider_MinMaxLabel_note'].'</span></label>';
- echo '<span class="content">'; //ureditev prikazovanja in skrivanja opisnih label za min in max
- echo '<input type="checkbox" value="1" name="slider_MinMaxLabel" '.( $slider_MinMaxLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_MinMaxLabel_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_MinMaxLabel_hidden.' type="hidden" value="0" name="slider_MinMaxLabel" id="slider_MinMaxLabel_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
+ // Opisne labele
+ echo '<div class="vprasanje_setting_holder dropDescriptiveLabel">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="1" name="slider_MinMaxLabel" '.( $slider_MinMaxLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_MinMaxLabel_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_MinMaxLabel_'.$this->spremenljivka.'">'.$lang['slider_MinMaxLabel_note'].'</label>';
+ echo ' <input '.$disable_slider_MinMaxLabel_hidden.' type="hidden" value="0" name="slider_MinMaxLabel" id="slider_MinMaxLabel_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<div class="vprasanje_setting_holder dropDescriptiveLabel">';
- echo '<label for="slider_VmesneDescrLabel_'.$this->spremenljivka.'"><p><span class="title">'.$lang['slider_VmesneLabel_note'].'</span></label>'; //ureditev prikazovanja in skrivanja opisnih vmesnih label
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="slider_VmesneDescrLabel" '.( $slider_VmesneDescrLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneDescrLabel_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_VmesneDescrLabel_hidden.' type="hidden" value="0" name="slider_VmesneDescrLabel" id="slider_VmesneDescrLabel_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="1" name="slider_VmesneDescrLabel" '.( $slider_VmesneDescrLabel == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_VmesneDescrLabel_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_VmesneDescrLabel_'.$this->spremenljivka.'">'.$lang['slider_VmesneLabel_note'].'</label>';
+ echo ' <input '.$disable_slider_VmesneDescrLabel_hidden.' type="hidden" value="0" name="slider_VmesneDescrLabel" id="slider_VmesneDescrLabel_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
+ echo '</div>';
- echo '</div>';
+
+ // prikaz dropdowna za default vrednosti opisnih vmesnih label
+ echo '<div class="vprasanje_setting_holder slider_DescriptiveLabel_defaults" '.$displayDescriptiveLabels.'>';
- // prikaz dropdowna za default vrednosti opisnih vmesnih label
- echo '<p class="slider_DescriptiveLabel_defaults" '.$displayDescriptiveLabels.'>'; //echo '<p class="grid_defaults" '.$display.'>';
- echo '<span class="title">'.$lang['srv_defaultDescrLabel'].':</span>';
- echo '<span class="content"><select name="slider_DescriptiveLabel_defaults" id="slider_DescriptiveLabel_defaults_'.$this->spremenljivka.'" style="width:100px" onChange="slider_defaultDescrLabels_value('.$this->spremenljivka.', this.value); switchSliderOpisneLabeleEditMode('.$this->spremenljivka.', \'\');">';
- //echo '<span class="content"><select name="slider_DescriptiveLabel_defaults" id="slider_DescriptiveLabel_defaults_'.$this->spremenljivka.'" style="width:100px" onChange="slider_defaultDescrLabels_value('.$this->spremenljivka.', this.value);">';
- echo '<option value="0">'.$lang['s_without'].'</option>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_defaultDescrLabel'].':</label>';
+ echo ' <span class="content"><select name="slider_DescriptiveLabel_defaults" id="slider_DescriptiveLabel_defaults_'.$this->spremenljivka.'" style="width:100px" onChange="slider_defaultDescrLabels_value('.$this->spremenljivka.', this.value); switchSliderOpisneLabeleEditMode('.$this->spremenljivka.', \'\');">';
+ echo ' <option value="0">'.$lang['s_without'].'</option>';
foreach($default_grid_values AS $key => $value){
- //echo '<option value="'.$key.'">'.$value['name'].'</option>';
- echo '<option value="'.$key.'"'.($slider_DescriptiveLabel_defaults == $key ?' selected':'').'>'.$value['name'].'</option>';
+ echo ' <option value="'.$key.'"'.($slider_DescriptiveLabel_defaults == $key ?' selected':'').'>'.$value['name'].'</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
- echo '<div class="dropNumofDescrLabels" '.$displayDescriptiveLabels.'>';
- echo '<p><span class="title" >'.$lang['srv_NumDescrLabels_note'].':</span>';
- echo '<span class="content"><select name="slider_NumofDescrLabels" id="slider_NumofDescrLabels_'.$this->spremenljivka.'" onChange="slider_checkbox_prop('.$this->spremenljivka.');">';
- echo '<option value="2"'.($slider_NumofDescrLabels =='2'?' selected':'').'>2</option>';
- echo '<option value="3"'.($slider_NumofDescrLabels =='3'?' selected':'').'>3</option>';
- echo '<option value="4"'.($slider_NumofDescrLabels =='4'?' selected':'').'>4</option>';
- echo '<option value="5"'.($slider_NumofDescrLabels =='5'?' selected':'').'>5</option>';
- echo '<option value="6"'.($slider_NumofDescrLabels =='6'?' selected':'').'>6</option>';
- echo '<option value="7"'.($slider_NumofDescrLabels =='7'?' selected':'').'>7</option>';
- echo '<option value="8"'.($slider_NumofDescrLabels =='8'?' selected':'').'>8</option>';
- echo '<option value="9"'.($slider_NumofDescrLabels =='9'?' selected':'').'>9</option>';
- echo '<option value="10"'.($slider_NumofDescrLabels =='10'?' selected':'').'>10</option>';
- echo '<option value="11"'.($slider_NumofDescrLabels =='11'?' selected':'').'>11</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder dropNumofDescrLabels" '.$displayDescriptiveLabels.'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_NumDescrLabels_note'].':</label>';
+ echo ' <span class="content"><select name="slider_NumofDescrLabels" id="slider_NumofDescrLabels_'.$this->spremenljivka.'" onChange="slider_checkbox_prop('.$this->spremenljivka.');">';
+ echo ' <option value="2"'.($slider_NumofDescrLabels =='2'?' selected':'').'>2</option>';
+ echo ' <option value="3"'.($slider_NumofDescrLabels =='3'?' selected':'').'>3</option>';
+ echo ' <option value="4"'.($slider_NumofDescrLabels =='4'?' selected':'').'>4</option>';
+ echo ' <option value="5"'.($slider_NumofDescrLabels =='5'?' selected':'').'>5</option>';
+ echo ' <option value="6"'.($slider_NumofDescrLabels =='6'?' selected':'').'>6</option>';
+ echo ' <option value="7"'.($slider_NumofDescrLabels =='7'?' selected':'').'>7</option>';
+ echo ' <option value="8"'.($slider_NumofDescrLabels =='8'?' selected':'').'>8</option>';
+ echo ' <option value="9"'.($slider_NumofDescrLabels =='9'?' selected':'').'>9</option>';
+ echo ' <option value="10"'.($slider_NumofDescrLabels =='10'?' selected':'').'>10</option>';
+ echo ' <option value="11"'.($slider_NumofDescrLabels =='11'?' selected':'').'>11</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
- //Labele podrocij
- echo '<label for="slider_labele_podrocij_'.$this->spremenljivka.'"><div class="check_slider_labele_podrocij" >';
- echo '<p><span class="title" >'.$lang['srv_slider_labele_podrocij'].':</span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="slider_labele_podrocij" '.( $slider_labele_podrocij == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_labele_podrocij_'.$this->spremenljivka.'">';
- echo '<input '.$disable_slider_labele_podrocij_hidden.' type="hidden" value="0" name="slider_labele_podrocij" id="slider_labele_podrocij_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
-
- //Labele podrocij - prikaz dropdowna z moznimi stevilkami podrocij
- echo '<div class="drop_slider_stevilo_label_podrocij" '.$displayStevLabelPodrocij.'>';
- echo '<p><span class="title" >'.$lang['srv_slider_stevilo_label_podrocij'].':</span>';
- echo '<span class="content"><select name="slider_StevLabelPodrocij" id="slider_StevLabelPodrocij_'.$this->spremenljivka.'" onChange="slider_checkbox_prop('.$this->spremenljivka.');">';
- echo '<option value="1"'.($slider_StevLabelPodrocij =='1'?' selected':'').'>1</option>';
- echo '<option value="2"'.($slider_StevLabelPodrocij =='2'?' selected':'').'>2</option>';
- echo '<option value="3"'.($slider_StevLabelPodrocij =='3'?' selected':'').'>3</option>';
- echo '<option value="4"'.($slider_StevLabelPodrocij =='4'?' selected':'').'>4</option>';
- echo '<option value="5"'.($slider_StevLabelPodrocij =='5'?' selected':'').'>5</option>';
- echo '<option value="6"'.($slider_StevLabelPodrocij =='6'?' selected':'').'>6</option>';
- echo '<option value="7"'.($slider_StevLabelPodrocij =='7'?' selected':'').'>7</option>';
- echo '<option value="8"'.($slider_StevLabelPodrocij =='8'?' selected':'').'>8</option>';
- echo '<option value="9"'.($slider_StevLabelPodrocij =='9'?' selected':'').'>9</option>';
- echo '<option value="10"'.($slider_StevLabelPodrocij =='10'?' selected':'').'>10</option>';
- echo '</select></span>';
- echo '</p>';
+
+ // Labele podrocij
+ echo '<div class="vprasanje_setting_holder check_slider_labele_podrocij">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" value="1" name="slider_labele_podrocij" '.( $slider_labele_podrocij == 1 ? ' checked="checked"' : '') .' onChange="slider_checkbox_prop('.$this->spremenljivka.');" id="slider_labele_podrocij_'.$this->spremenljivka.'">';
+ echo ' <label for="slider_labele_podrocij_'.$this->spremenljivka.'">'.$lang['srv_slider_labele_podrocij'].'</label>';
+ echo ' <input '.$disable_slider_labele_podrocij_hidden.' type="hidden" value="0" name="slider_labele_podrocij" id="slider_labele_podrocij_hidden_'.$this->spremenljivka.'">';
+ echo ' </div>';
+
echo '</div>';
+
+ // Labele podrocij - prikaz dropdowna z moznimi stevilkami podrocij
+ echo '<div class="vprasanje_setting_holder drop_slider_stevilo_label_podrocij" '.$displayStevLabelPodrocij.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_slider_stevilo_label_podrocij'].':</label>';
+ echo ' <span class="content"><select name="slider_StevLabelPodrocij" id="slider_StevLabelPodrocij_'.$this->spremenljivka.'" onChange="slider_checkbox_prop('.$this->spremenljivka.');">';
+ echo ' <option value="1"'.($slider_StevLabelPodrocij =='1'?' selected':'').'>1</option>';
+ echo ' <option value="2"'.($slider_StevLabelPodrocij =='2'?' selected':'').'>2</option>';
+ echo ' <option value="3"'.($slider_StevLabelPodrocij =='3'?' selected':'').'>3</option>';
+ echo ' <option value="4"'.($slider_StevLabelPodrocij =='4'?' selected':'').'>4</option>';
+ echo ' <option value="5"'.($slider_StevLabelPodrocij =='5'?' selected':'').'>5</option>';
+ echo ' <option value="6"'.($slider_StevLabelPodrocij =='6'?' selected':'').'>6</option>';
+ echo ' <option value="7"'.($slider_StevLabelPodrocij =='7'?' selected':'').'>7</option>';
+ echo ' <option value="8"'.($slider_StevLabelPodrocij =='8'?' selected':'').'>8</option>';
+ echo ' <option value="9"'.($slider_StevLabelPodrocij =='9'?' selected':'').'>9</option>';
+ echo ' <option value="10"'.($slider_StevLabelPodrocij =='10'?' selected':'').'>10</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
function edit_hot_spot_settings(){
@@ -806,7 +901,7 @@ class Vprasanje {
}
echo '<span class="title" id="color-region-'.$row['id'].'" '.($hotspot_region_color==''?'style="display:none;"':'').'>'.$lang['srv_hotspot_region_color_text'].': <span id="help_hotspot_region_color" class="spaceLeft">'.Help::display('srv_hotspot_region_color').' </span>';
- echo '<input type="text" id="color-region'.$row['id'].'" class="colorwell auto-save" name="hotspot_region_color" value="'.$value.'" data-id="'.$row['id'].'" data-type="'.$type.'" >';
+ echo ' <input type="text" id="color-region'.$row['id'].'" class="colorwell auto-save" name="hotspot_region_color" value="'.$value.'" data-id="'.$row['id'].'">';
echo '</span>';
//echo '<div id="picker"></div>';
@@ -843,7 +938,7 @@ class Vprasanje {
}
echo '<br /><span class="title" id="color-visibility-'.$row['id'].'" '.($hotspot_visibility_color==''?'style="display:none;"':'').'>'.$lang['srv_hotspot_visibility_color_text'].': <span id="help_hotspot_visibility_color" class="spaceLeft">'.Help::display('srv_hotspot_visibility_color').' </span>';
- echo '<input type="text" id="color-visibility'.$row['id'].'" class="colorwell auto-save" name="hotspot_visibility_color" value="'.$value.'" data-id="'.$row['id'].'" data-type="'.$type.'" >';
+ echo '<input type="text" id="color-visibility'.$row['id'].'" class="colorwell auto-save" name="hotspot_visibility_color" value="'.$value.'" data-id="'.$row['id'].'">';
echo '</span>';
echo '<div id="picker"></div>';
@@ -884,27 +979,22 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
- if($row['signature'] != 1){ //ce ni elektronski podpis
- $displayOrientation = 'display: block';
- }else{
- $displayOrientation = 'display: none';
- }
- //echo '<p>';
- echo '<p id="orientation_'.$this->spremenljivka.'" style="'.$displayOrientation.' ">';
- echo '<span class="title" >'.$lang['srv_orientacija'].': </span>';
-
- //echo (int)$row['orientation'];
- echo '<span class="content"><select name="orientation" id="spremenljivka_orientation_' . $row['id'] . '" spr_id="'.$row['id'].'">';
-
- echo '<option value="1"' . (($row['orientation'] == 1 || $row['orientation'] == 2) ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
- //echo '<option value="1"' . ($row['orientation'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
- echo '<option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
- if($row['tip'] == 21)
- echo '<option value="3"' . (($row['orientation'] == 3 || $row['orientation'] == 3) ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
-
- echo '</select></span>';
-
- echo '</p>';
+ // ce ni elektronski podpis
+ $displayOrientation = ($row['signature'] != 1) ? '' : 'style="display: none"';
+
+ echo '<div id="orientation_'.$this->spremenljivka.'" class="vprasanje_setting_holder" '.$displayOrientation.'>';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_orientacija'].': </label>';
+ echo ' <span class="content"><select name="orientation" id="spremenljivka_orientation_' . $row['id'] . '" spr_id="'.$row['id'].'">';
+ echo ' <option value="1"' . (($row['orientation'] == 1 || $row['orientation'] == 2) ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
+ echo ' <option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
+ if($row['tip'] == 21)
+ echo ' <option value="3"' . (($row['orientation'] == 3 || $row['orientation'] == 3) ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
@@ -917,19 +1007,28 @@ class Vprasanje {
$min = $newParams->get('date_range_min');
$max = $newParams->get('date_range_max');
- echo '<p>';
- echo '<span class="title" >'.$lang['srv_vprasanje_date_range_min'].': </span>'.Help::display('edit_date_range');
- echo '<span class="content">';
- echo '<input type="number" value="'.$min.'" name="date_range_min" id="date_range_min_' . $row['id'] . '" spr_id="'.$row['id'].'" size="4" style="margin-top:-12px;" />';
- echo '</span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_date_range_min'].': '.Help::display('edit_date_range').'</label>';
+ echo ' <span class="content">';
+ echo ' <input type="number" value="'.$min.'" name="date_range_min" id="date_range_min_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' </span>';
+ echo ' </div>';
- echo '<p>';
- echo '<span class="title" >'.$lang['srv_vprasanje_date_range_max'].': </span>'.Help::display('edit_date_range');
- echo '<span class="content">';
- echo '<input type="number" min="0" value="'.$max.'" name="date_range_max" id="date_range_max_' . $row['id'] . '" spr_id="'.$row['id'].'" size="4" style="margin-top:-12px;" />';
- echo '</span>';
- echo '</p>';
+ echo '</div>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_date_range_max'].': '.Help::display('edit_date_range').'</label>';
+ echo ' <span class="content">';
+ echo ' <input type="number" min="0" value="'.$max.'" name="date_range_max" id="date_range_max_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
}
function edit_date_withTime() {
@@ -940,12 +1039,15 @@ class Vprasanje {
$newParams = new enkaParameters($row['params']);
$withTime = $newParams->get('date_withTime');
- echo '<p>';
- echo '<span class="title"><label for="date_withTime_' . $row['id'] . '">'.$lang['srv_vprasanje_date_withTime'].'</label>: </span>';
- echo '<span class="content"><input type="hidden" name="date_withTime" value="0">';
- echo '<input type="checkbox" value="1" '.(($withTime == 1) ? 'checked' : '').' name="date_withTime" id="date_withTime_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
- echo '</span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="date_withTime" value="0">';
+ echo ' <input type="checkbox" value="1" '.(($withTime == 1) ? 'checked' : '').' name="date_withTime" id="date_withTime_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' <label for="date_withTime_'.$row['id'].'">'.$lang['srv_vprasanje_date_withTime'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
@@ -961,29 +1063,29 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$newParams = new enkaParameters($row['params']);
- //$min = $newParams->get('date_range_min');
$max = $newParams->get('max_markers') ? $newParams->get('max_markers') : 1;
$input = $newParams->get('multi_input_type') ? $newParams->get('multi_input_type') : 'marker';
- echo '<p id="max_markers_map" '. (($row['enota'] == 2 && $input =='marker') ? '' : 'style="display: none;"').'>';
- echo '<span class="title">'.$lang['srv_vprasanje_max_marker_map'].': '.Help::display('srv_vprasanje_max_marker_map').'</span>';
- echo '<span class="content">';
-
- //roleta
- echo '<select name="max_markers" id="max_markers_' . $row['id'] . '" spr_id="'.$row['id'].'">';
- echo '<option value="1" '.(($max == 1) ? ' selected="true" ' : '').'>1</option>';
- echo '<option value="2" '.(($max == 2) ? ' selected="true" ' : '').'>2</option>';
- echo '<option value="3" '.(($max == 3) ? ' selected="true" ' : '').'>3</option>';
- echo '<option value="4" '.(($max == 4) ? ' selected="true" ' : '').'>4</option>';
- echo '<option value="5" '.(($max == 5) ? ' selected="true" ' : '').'>5</option>';
- echo '<option value="6" '.(($max == 6) ? ' selected="true" ' : '').'>6</option>';
- echo '<option value="7" '.(($max == 7) ? ' selected="true" ' : '').'>7</option>';
- echo '<option value="8" '.(($max == 8) ? ' selected="true" ' : '').'>8</option>';
- echo '<option value="9" '.(($max == 9) ? ' selected="true" ' : '').'>9</option>';
- echo '<option value="10" '.(($max == 10) ? ' selected="true" ' : '').'>10</option>';
-
- echo '</select></span>';
- echo '</p>';
+
+ echo '<div id="max_markers_map" class="vprasanje_setting_holder" '.(($row['enota'] == 2 && $input =='marker') ? '' : 'style="display: none;"').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_max_marker_map'].': '.Help::display('srv_vprasanje_max_marker_map').'</label>';
+ echo ' <span class="content"><select name="max_markers" id="max_markers_' . $row['id'] . '" spr_id="'.$row['id'].'">';
+ echo ' <option value="1" '.(($max == 1) ? ' selected="true" ' : '').'>1</option>';
+ echo ' <option value="2" '.(($max == 2) ? ' selected="true" ' : '').'>2</option>';
+ echo ' <option value="3" '.(($max == 3) ? ' selected="true" ' : '').'>3</option>';
+ echo ' <option value="4" '.(($max == 4) ? ' selected="true" ' : '').'>4</option>';
+ echo ' <option value="5" '.(($max == 5) ? ' selected="true" ' : '').'>5</option>';
+ echo ' <option value="6" '.(($max == 6) ? ' selected="true" ' : '').'>6</option>';
+ echo ' <option value="7" '.(($max == 7) ? ' selected="true" ' : '').'>7</option>';
+ echo ' <option value="8" '.(($max == 8) ? ' selected="true" ' : '').'>8</option>';
+ echo ' <option value="9" '.(($max == 9) ? ' selected="true" ' : '').'>9</option>';
+ echo ' <option value="10" '.(($max == 10) ? ' selected="true" ' : '').'>10</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -995,13 +1097,17 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$newParams = new enkaParameters($row['params']);
$fokus = $newParams->get('fokus_mape'); //dobi fokus mape
-
- echo '<p id="fokus_mape" '.($row['enota'] == 3 ? 'style="display: none;"' : '').'>';
- echo '<span class="title" >'.$lang['srv_vprasanje_fokus_map'].': </span>';
- echo '<span class="content">';
- echo '<input type="text" value="'.$fokus.'" name="fokus_mape" id="fokus_mape_' . $row['id'] . '" spr_id="'.$row['id'].'" size="20" />';
- echo '</span>';
- echo '</p>';
+
+ echo '<div id="fokus_mape" class="vprasanje_setting_holder" '.($row['enota'] == 3 ? 'style="display: none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_fokus_map'].': </label>';
+ echo ' <span class="content">';
+ echo ' <input type="text" value="'.$fokus.'" name="fokus_mape" id="fokus_mape_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -1016,12 +1122,16 @@ class Vprasanje {
$naslov = $newParams->get('naslov_podvprasanja_map'); //dobi naslov podvprasanja mape
$marpod = $newParams->get('marker_podvprasanje'); //ali dodam podvprasanje v infowindow
- echo '<p id="naslov_podvprasanja_map" '.(($marpod == 1 || $row['enota'] == 3) ? '' : 'style="display: none;"').'>';
- echo '<span class="title" >'.$lang['srv_vprasanje_naslov_podvprasanja_map'].': '.Help::display('naslov_podvprasanja_map').'</span>';
- echo '<span class="content">';
- echo '<input type="text" value="'.$naslov.'" name="naslov_podvprasanja_map" id="naslov_podvprasanja_map_' . $row['id'] . '" spr_id="'.$row['id'].'" size="25" />';
- echo '</span>';
- echo '</p>';
+ echo '<div id="naslov_podvprasanja_map" class="vprasanje_setting_holder half-half" '.(($marpod == 1 || $row['enota'] == 3) ? '' : 'style="display: none;"').'>';
+
+ echo '<div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_naslov_podvprasanja_map'].': '.Help::display('naslov_podvprasanja_map').'</label>';
+ echo ' <span class="content">';
+ echo ' <input type="text" value="'.$naslov.'" name="naslov_podvprasanja_map" id="naslov_podvprasanja_map_' . $row['id'] . '" spr_id="'.$row['id'].'" size="25" />';
+ echo ' </span>';
+ echo '</div>';
+
+ echo '</div>';
}
/**
@@ -1035,12 +1145,15 @@ class Vprasanje {
$usrloc = $newParams->get('user_location'); //ali se poizve trenutna lokacija
$input = $newParams->get('multi_input_type') ? $newParams->get('multi_input_type') : 'marker';
- echo '<p id="user_location_map" '. ((($row['enota'] == 2 && $input !== 'marker') || $row['enota'] == 3) ? 'style="display: none;"' : '').'>';
- echo '<label for="user_location_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_user_location_map'].': '.Help::display('user_location_map').'</label>';
- echo '<span class="content"><input type="hidden" name="user_location" value="0">';
- echo '<input type="checkbox" value="1" '.(($usrloc == 1) ? 'checked' : '').' name="user_location" id="user_location_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
- echo '</span>';
- echo '</p>';
+ echo '<div id="user_location_map" class="vprasanje_setting_holder" '. ((($row['enota'] == 2 && $input !== 'marker') || $row['enota'] == 3) ? 'style="display: none;"' : '').'>';
+
+ echo '<div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="user_location" value="0">';
+ echo ' <input type="checkbox" value="1" '.(($usrloc == 1) ? 'checked' : '').' name="user_location" id="user_location_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' <label for="user_location_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_user_location_map'].' '.Help::display('user_location_map').'</label>';
+ echo '</div>';
+
+ echo '</div>';
}
/**
@@ -1054,14 +1167,15 @@ class Vprasanje {
$marpod = $newParams->get('marker_podvprasanje'); //ali dodam podvprasanje v infowindow
$input = $newParams->get('multi_input_type') ? $newParams->get('multi_input_type') : 'marker';
- echo '<p id="marker_podvprasanje" '. ((($row['enota'] == 3) || $input !== 'marker') ? 'style="display: none;"' : '').' >';
- echo '<label for="marker_podvprasanje_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_marker_podvpr_map'].': '.Help::display('marker_podvprasanje').'</label>';
-
- echo '<span class="content"><input type="hidden" name="marker_podvprasanje" value="0">';
- echo '<input type="checkbox" value="1" '.(($marpod == 1) ? 'checked' : '' ). ' onChange="show_infowindow_map();"'.
- ' name="marker_podvprasanje" id="marker_podvprasanje_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
- echo '</span>';
- echo '</p>';
+ echo '<div id="marker_podvprasanje" class="vprasanje_setting_holder" '.((($row['enota'] == 3) || $input !== 'marker') ? 'style="display: none;"' : '').' >';
+
+ echo '<div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="marker_podvprasanje" value="0">';
+ echo ' <input type="checkbox" value="1" '.(($marpod == 1) ? 'checked' : '' ).' onChange="show_infowindow_map();" name="marker_podvprasanje" id="marker_podvprasanje_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' <label for="marker_podvprasanje_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_marker_podvpr_map'].' '.Help::display('marker_podvprasanje').'</label>';
+ echo '</div>';
+
+ echo '</div>';
}
/**
@@ -1075,14 +1189,15 @@ class Vprasanje {
$marpod = $newParams->get('dodaj_searchbox'); //ali dodam podvprasanje v infowindow
$input = $newParams->get('multi_input_type') ? $newParams->get('multi_input_type') : 'marker';
- echo '<p id="dodaj_searchbox" '.($row['enota'] == 3 || $input != 'marker' ? 'style="display: none;"' : '').'>';
- echo '<label for="dodaj_searchbox_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_show_searchbox_map'].': '
- .Help::display('dodaj_searchbox').'</label>';
- echo '<span class="content"><input type="hidden" name="dodaj_searchbox" value="0">';
- echo '<input type="checkbox" value="1" '.(($marpod == 1) ? 'checked' : '').
- ' name="dodaj_searchbox" id="dodaj_searchbox_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
- echo '</span>';
- echo '</p>';
+ echo '<div id="dodaj_searchbox" class="vprasanje_setting_holder" '.($row['enota'] == 3 || $input != 'marker' ? 'style="display: none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="dodaj_searchbox" value="0">';
+ echo ' <input type="checkbox" value="1" '.(($marpod == 1) ? 'checked' : '').' name="dodaj_searchbox" id="dodaj_searchbox_' . $row['id'] . '" spr_id="'.$row['id'].'" />';
+ echo ' <label for="dodaj_searchbox_' . $row['id'] . '" class="title">'.$lang['srv_vprasanje_show_searchbox_map'].' '.Help::display('dodaj_searchbox').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
@@ -1096,83 +1211,88 @@ class Vprasanje {
global $admin_type;
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
- //echo '<h2>'.$row['variable'].' - '.$lang['srv_napredno_urejanje'].'</h2>';
- $this->variable();
-
-
- // Spremenljivka
- echo '<fieldset><legend>'.$lang['srv_spremenljivka'].'</legend>';
- $this->edit_variable();
- $this->edit_label();
- echo '</fieldset>';
-
-
- // Lastnosti
- echo '<fieldset><legend>'.$lang['srv_lastnosti'].'</legend>';
- $this->edit_sistem();
-
- //echo '<p class="heading">'.$lang['srv_prikaz_vprasanja'].'</p>';
- $this->edit_visible();
-
- // Disabled vprasanje - vprasanje je onemogoceno za respondente (zaenkrat samo osnovni radio, dropdown in text)
- if(in_array($row['tip'], array(1,3,4,21)))
- $this->edit_disabled();
- // Vprasanje lahko zaklene samo admin, manager ali avtor (drugace ga lahko zaklene sam sebi in potem ne more vec urejat)
- $author = SurveyInfo::getInstance()->getSurveyColumn("insert_uid");
- if($admin_type == 0 || $admin_type == 1 || $global_user_id == $author)
- $this->edit_locked();
-
+ $this->variable();
+
+ // Spremenljivka
+ echo '<fieldset class="first">';
+
+ $this->edit_variable();
+
+ $this->edit_label();
+
+ $this->edit_sistem();
+
+ // Dodaj vprasanje v knjiznico
+ $this->add_into_library();
+
+ echo '</fieldset>';
+
+
+ // Lastnosti
+ echo '<fieldset><legend>'.$lang['srv_lastnosti'].'</legend>';
+
+ if ($row['tip'] <= 2 )
+ $this->edit_stolpci();
+
+ if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 6)
+ $this->edit_presetValue();
+
+ if($row['tip'] == 2) {
+ $this->edit_checkbox_max_limit();
+ $this->edit_checkbox_min_limit();
+ }
+
+ if ($row['tip'] == 6 || $row['tip'] == 16 || $row['tip'] == 19 || $row['tip'] == 20)
+ $this->edit_grid_dynamic();
+
+ //echo '<p class="heading">'.$lang['srv_prikaz_vprasanja'].'</p>';
+ $this->edit_visible();
+
+ // Disabled vprasanje - vprasanje je onemogoceno za respondente (zaenkrat samo osnovni radio, dropdown in text)
+ if(in_array($row['tip'], array(1,3,4,21)))
+ $this->edit_disabled();
+
$this->edit_timer();
-
- if ($row['tip'] <= 2 )
- $this->edit_stolpci();
-
- if($row['tip'] == 2) {
- $this->edit_checkbox_max_limit();
- $this->edit_checkbox_min_limit();
- }
-
+
if($row['tip'] <= 3)
- $this->edit_stat();
-
- if ($row['tip'] == 6)
- $this->edit_grid_dynamic();
-
- if ($row['tip'] == 1 || $row['tip'] == 6) {
- $this->edit_onchange_submit();
- }
-
- if ($row['tip'] == 1 || $row['tip'] == 3)
- $this->edit_inline_edit();
-
- if ($row['tip'] != 5)
- $this->edit_showOnAllPages();
-
+ $this->edit_stat();
+
+ // Vprasanje lahko zaklene samo admin, manager ali avtor (drugace ga lahko zaklene sam sebi in potem ne more vec urejat)
+ $author = SurveyInfo::getInstance()->getSurveyColumn("insert_uid");
+ if($admin_type == 0 || $admin_type == 1 || $global_user_id == $author)
+ $this->edit_locked();
+
if ($row['tip'] == 1 || $row['tip'] == 2 && (in_array($row['orientation'], array(0,1,2))))
- $this->edit_hideRadio();
-
- if($row['tip'] == 1 || $row['tip'] == 2 || $row['tip'] == 6)
- $this->edit_presetValue();
-
- // Nastavitev za prikaz prejsnjih odgovorov pod text vprasanjem
- if ($row['tip'] == 21)
- $this->edit_show_prevAnswers();
-
- echo '</fieldset>';
-
- // Posebni tipi text vprasanja (signature, captcha, upload, email)
- if ($row['tip'] == 21){
- echo '<fieldset><legend>'.$lang['srv_advanced_subtype'].'</legend>';
-
+ $this->edit_hideRadio();
+
+ if ($row['tip'] == 1 || $row['tip'] == 6) {
+ $this->edit_onchange_submit();
+ }
+
+ if ($row['tip'] == 1 || $row['tip'] == 3)
+ $this->edit_inline_edit();
+
+ if ($row['tip'] != 5)
+ $this->edit_showOnAllPages();
+
+ // Nastavitev za prikaz prejsnjih odgovorov pod text vprasanjem
+ if ($row['tip'] == 21)
+ $this->edit_show_prevAnswers();
+
+ echo '</fieldset>';
+
+ // Posebni tipi text vprasanja (signature, captcha, upload, email)
+ if ($row['tip'] == 21){
+ echo '<fieldset><legend>'.$lang['srv_advanced_subtype'].'</legend>';
+
$this->edit_upload();
$this->edit_signature();
- $this->edit_captcha();
- $this->edit_email_verify();
-
- echo '</fieldset>';
- }
+ $this->edit_captcha();
+ $this->edit_email_verify();
+
+ echo '</fieldset>';
+ }
}
/**
@@ -1213,48 +1333,82 @@ class Vprasanje {
$r['spr'] = $this->spremenljivka;
$r['if'] = 0;
$r['endif'] = 1;
-
- echo '<p id="if_preview">'.$lang['srv_question_no_if'].'</p>';
-
- echo '<p id="if_preview_link"><a href="#" onclick="if_new(\''.$r['spr'].'\', \''.$r['if'].'\', \''.$r['endif'].'\', \'0\'); return false;"><span class="bold">'.$lang['srv_add_condition_question'].'</span></a></p>';
-
+
+ echo '<div id="if_preview" class="vprasanje_setting_holder space_bottom">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo $lang['srv_question_no_if'];
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="vprasanje_setting_holder space_bottom">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <button id="if_preview_link" class="small white-blue" onclick="if_new(\''.$r['spr'].'\', \''.$r['if'].'\', \''.$r['endif'].'\', \'0\'); return false;">'.$lang['srv_add_condition_question'].'</button>';
+ echo ' </div>';
+ echo '</div>';
+
if ($count > 1) {
+
$parents = $b->get_parents($this->spremenljivka);
+
if ($parents != '') {
- echo '<p><b>'.$lang['srv_question_no_if_in_nested_if'].':</b> ';
+
+ echo '<div class="vprasanje_setting_holder space_bottom">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo $lang['srv_question_no_if_in_nested_if'].':';
+ echo ' </div>';
+
$parents = explode(' ', $parents);
+
foreach ($parents AS $p) {
- $p = str_replace('p_', '', $p);
- echo '<br />';
+ $p = str_replace('p_', '', $p);
+ echo ' <div class="vprasanje_setting_line">';
$b->conditions_display($p);
+ echo ' </div>';
}
- echo '</p>';
+
+ echo '</div>';
}
}
-
- } else {
-
- //echo '<h2>'.$rows['variable'].' - '.$lang['srv_edit_condition_question'].'</h2>';
-
- echo '<p id="if_preview">';
-
+ }
+ else {
+
+ echo '<div id="if_preview" class="vprasanje_setting_holder space_bottom">';
+ echo ' <div class="vprasanje_setting_line">';
$b->conditions_display($row['parent']);
- echo '</p>';
-
- echo '<p><a href="#" onclick="condition_editing(\''.$row['parent'].'\'); return false;">'.$lang['srv_if_edit'].'</a></p>';
+ echo ' </div>';
+ echo '</div>';
+ echo '<div id="if_preview" class="vprasanje_setting_holder space_bottom">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <button class="small white-blue" onclick="condition_editing(\''.$row['parent'].'\'); return false;">'.$lang['srv_if_edit'].'</button>';
+ echo ' </div>';
+ echo '</div>';
+
if ($row['parent'] != 0) {
$parents = $b->get_parents(0, $row['parent']);
+
if ($parents != '') {
- echo '<p><b>'.$lang['srv_question_in_if_in_nested_if'].':</b> ';
+
+ echo '<fieldset>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo $lang['srv_question_in_if_in_nested_if'].':';
+ echo ' </div>';
+
$parents = explode(' ', $parents);
+
foreach ($parents AS $p) {
$p = str_replace('p_', '', $p);
- echo '<br />';
+ echo ' <div class="vprasanje_setting_line"><div>';
$b->conditions_display($p);
+ echo ' </div></div>';
}
- echo '</p>';
+
+ echo '</div>';
+ echo '</fieldset>';
}
}
@@ -1273,212 +1427,84 @@ class Vprasanje {
$this->variable();
+
$sql = sisplet_query("SELECT if_id, reminder, reminder_text FROM srv_validation v WHERE v.spr_id='$this->spremenljivka'");
if (mysqli_num_rows($sql) > 0) {
echo '<input type="hidden" value="1" name="validationedit">';
$b = new Branching($this->anketa);
-
+
while ($row = mysqli_fetch_array($sql)) {
+
+ echo '<fieldset>';
- echo '<fieldset>';
- echo '<p><a href="#" onclick="validation_edit(\''.$this->spremenljivka.'\', \''.$row['if_id'].'\'); return false;" title="'.$lang['srv_if_edit'].'">';
+ echo '<div class="vprasanje_setting_holder">';
+
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <a href="#" onclick="validation_edit(\''.$this->spremenljivka.'\', \''.$row['if_id'].'\'); return false;" title="'.$lang['srv_if_edit'].'">';
$b->conditions_display($row['if_id']);
- echo '</a></p>';
-
- echo '<p>';
- echo '<span class="title">'.$lang['srv_alert_type'].':</span>';
-
- echo '<span class="content">';
- echo '<select name="validation-'.$row['if_id'].'-reminder">';
- echo '<option value="0" '.($row['reminder']==0?'selected':'').'>'.$lang['srv_reminder_off2'].'</option>';
- echo '<option value="1" '.($row['reminder']==1?'selected':'').'>'.$lang['srv_reminder_soft2'].'</option>';
- echo '<option value="2" '.($row['reminder']==2?'selected':'').'>'.$lang['srv_reminder_hard2'].'</option>';
- echo '</select>';
- echo '</span>';
-
- echo '</p>';
- echo '<p><span class="title">'.$lang['srv_alert_text'].':</span>';
-
- echo '<span class="content"><input type="text" name="validation-'.$row['if_id'].'-reminder_text" value="'.$row['reminder_text'].'"></span>';
+ echo ' </a>';
+ echo ' </div>';
- echo '</p>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_alert_type'].':</label>';
- echo '<p class="floatLeft spaceRight bold"><a href="#" onclick="validation_if_remove(\''.$this->spremenljivka.'\', \''.$row['if_id'].'\'); return false;">'.$lang['srv_validation_remove'].'</a></p>';
+ echo ' <span class="content">';
+ echo ' <select name="validation-'.$row['if_id'].'-reminder">';
+ echo ' <option value="0" '.($row['reminder']==0?'selected':'').'>'.$lang['srv_reminder_off2'].'</option>';
+ echo ' <option value="1" '.($row['reminder']==1?'selected':'').'>'.$lang['srv_reminder_soft2'].'</option>';
+ echo ' <option value="2" '.($row['reminder']==2?'selected':'').'>'.$lang['srv_reminder_hard2'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+ echo ' </div>';
+
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_alert_text'].'</label>';
+ echo ' <span class="content"><input type="text" name="validation-'.$row['if_id'].'-reminder_text" value="'.htmlentities($row['reminder_text']).'"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
- echo '</fieldset>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <button class="small black-white" onclick="validation_if_remove(\''.$this->spremenljivka.'\', \''.$row['if_id'].'\'); return false;">'.$lang['srv_validation_remove'].'</button>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
}
-
- } else {
- echo '<p>'.$lang['srv_validation_no'].'</p>';
- }
+ }
+ else {
+ echo '<div class="vprasanje_setting_holder space_bottom">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <p>'.$lang['srv_validation_no'].'</p>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik - drugace skrijemo gumb za dodajanje validacije
- $userAccess = UserAccess::getInstance($global_user_id);
+ // Gumb za dodajanje validacije
+ echo '<div class="vprasanje_setting_holder space_bottom">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ $userAccess = UserAccess::getInstance($global_user_id); // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik - drugace skrijemo gumb za dodajanje validacije
if(!$userAccess->checkUserAccess($what='validation')){
$userAccess->displayNoAccess($what='validation');
}
- else{
- echo '<p><a href="#" onclick="validation_new(\''.$this->spremenljivka.'\'); return false;"><span class="bold">'.$lang['srv_validation_new'].'</span></a></p>';
+ else{
+ echo '<button class="small white-blue" onclick="validation_new(\''.$this->spremenljivka.'\'); return false;">'.$lang['srv_validation_new'].'</button>';
}
- }
-
- /**
- * prikaze komentarje na vprasanje
- *
- */
- function vprasanje_komentarji () {
- global $lang;
- global $admin_type;
- global $global_user_id;
-
- SurveySetting::getInstance()->Init($this->anketa);
- SurveyInfo::getInstance()->SurveyInit($this->anketa);
-
- if ($this->spremenljivka > 0) {
- $rows = Cache::srv_spremenljivka($this->spremenljivka);
- $this->variable();
- }
- else {
- $row = SurveyInfo::getInstance()->getSurveyRow();
-
- if ($this->spremenljivka == -1) {
- $rows['variable'] = $lang['srv_intro_label'];
- $rows['note'] = $row['intro_note'];
- $rows['thread'] = $row['thread_intro'];
-
- echo '<h2>'.$rows['variable'].'</h2>';
- }
- elseif ($this->spremenljivka == -2) {
- $rows['variable'] = $lang['srv_end_label'];
- $rows['note'] = $row['concl_note'];
- $rows['thread'] = $row['thread_concl'];
-
- echo '<h2>'.$rows['variable'].'</h2>';
- }
- }
-
-
- $question_note_view = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_view');
- $question_note_write = SurveySetting::getInstance()->getSurveyMiscSetting('question_note_write');
-
- if ($question_note_view == '' || $question_note_view >= $admin_type) {
-
- if ($question_note_write == '' || $question_note_write >= $admin_type) {
- echo '<p>'.$lang['srv_note'];
- //echo '<span class="red pointer" onclick="this.style.display=\'none\'; create_editor(\'note\');"> - '.$lang['srv_editor'].'</span>';
- echo '<a href="#" title="'.$lang['srv_editor_title'].'" onmouseover="this.style.display=\'none\'; create_editor(\'note\');"><span class="faicon edit spaceLeft"></span></a>';
- echo '<textarea name="note" id="note" style="width:99%; height:150px">'.$rows['note'].'</textarea></p>';
- } else {
- echo '<p>'.$lang['srv_note'].'';
- echo '<textarea name="note" id="note" style="width:99%; height:150px" disabled>'.$rows['note'].'</textarea></p>';
- }
- }
-
- // tukaj prikazujemo samo se opombo
- return;
-
- $question_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment');
- //$question_comment = 4; // vedno prikazemo
- $question_resp_comment = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment');
- $question_resp_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_resp_comment_viewadminonly');
- $question_comment_viewadminonly = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewadminonly');
- $question_comment_viewauthor = SurveySetting::getInstance()->getSurveyMiscSetting('question_comment_viewauthor');
- $sortpostorder = SurveySetting::getInstance()->getSurveyMiscSetting('sortpostorder');
- $addfieldposition = SurveySetting::getInstance()->getSurveyMiscSetting('addfieldposition');
-
- if (($admin_type <= $question_comment && $question_comment != '') || $question_resp_comment==1) {
-
- $f = new Forum;
-
- $spremenljivka = $this->spremenljivka;
- $type = 1;
- $view = 3;
-
- echo '<div id="survey_comment_'.$spremenljivka.'_'.$view.'">';
- echo '<div style="width:45%; float:left">';
- echo '<h3 class="red"><b>'.$lang['comments'].'</b>';
- echo '<span class="sprites '.($sortpostorder==1?'up':'down').'" style="float:right" title="'.($sortpostorder==1?$lang['forum_desc']:$lang['forum_asc']).'"></span>';
- echo '</h3>';
-
- if ($addfieldposition == 1) {
- $b = new BranchingAjax($this->anketa);
- $b->add_comment_field($spremenljivka, $type, $view, false);
- echo '<br /><br />';
- }
-
- // komentarji na vprašanje
- if ($rows['thread'] > 0) {
-
- $tid = $rows['thread'];
-
- $orderby = $sortpostorder == 1 ? 'DESC' : 'ASC' ;
-
- if ($admin_type <= $question_comment_viewadminonly) { // vidi vse komentarje
- $sql = sisplet_query("SELECT * FROM post WHERE tid='$tid' ORDER BY time $orderby, id $orderby");
- } elseif ($question_comment_viewauthor == 1) { // vidi samo svoje komentarje
- $sql = sisplet_query("SELECT * FROM post WHERE tid='$tid' AND uid='$global_user_id' ORDER BY time $orderby, id $orderby");
- } else { // ne vidi nobenih komentarjev
- $sql = sisplet_query("SELECT * FROM post WHERE 1=0");
- }
-
- if (mysqli_num_rows($sql) > 0) {
- $i = 0;
- while ($row = mysqli_fetch_array($sql)) {
- if (($i != 0 && $sortpostorder==0) || ($i < $rowss-1 && $sortpostorder==1)) {
- if ($row['ocena'] == 0) echo '<span style="color:black">';
- elseif ($row['ocena'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['ocena'] == 2) echo '<span style="color:lightgray">';
- elseif ($row['ocena'] == 3) echo '<span style="color:lightgray">';
- else echo '<span>';
-
- echo '<b>'.$f->user($row['uid']).'</b> ('.$f->datetime1($row['time']).'):';
- echo '<br/>'.$row['vsebina'].'<hr>';
-
- echo '</span>';
- }
- $i++;
- }
- }
-
- }
-
- if ($addfieldposition == '' || $addfieldposition == 0) {
- $b = new BranchingAjax($this->anketa);
- $b->add_comment_field($spremenljivka, $type, $view, false);
- }
-
- echo '</div>';
- echo '</div>';
-
- if ($admin_type <= $question_resp_comment_viewadminonly) {
- $sql = sisplet_query("SELECT d.*, u.time_edit FROM srv_data_text".$this->db_table." d, srv_user u WHERE d.spr_id='0' AND d.vre_id='$this->spremenljivka' AND u.id=d.usr_id ORDER BY d.id ASC");
-
- // komentarji respondentov
- $sql = sisplet_query("SELECT d.*, u.time_edit FROM srv_data_text".$this->db_table." d, srv_user u WHERE d.spr_id='0' AND d.vre_id='$this->spremenljivka' AND u.id=d.usr_id ORDER BY d.id ASC");
- if (mysqli_num_rows($sql) > 0) {
-
- echo '<div style="width:45%; float:right">';
- echo '<h3 class="red"><b>'.$lang['srv_repondent_comment'].'</b></h3>';
-
- while ($row = mysqli_fetch_array($sql)) {
- if ($row['text2'] == 0) echo '<span style="color:black">';
- elseif ($row['text2'] == 1) echo '<span style="color:darkgreen">';
- elseif ($row['text2'] == 2) echo '<span style="color:lightgray">';
- elseif ($row['text2'] == 3) echo '<span style="color:lightgray">';
- else echo '<span>';
-
- echo $f->datetime1($row['time_edit']).':<br />'.$row['text'].'<hr>';
-
- echo '</span>';
- }
-
- echo '</div>';
-
- }
- }
- }
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -1499,134 +1525,6 @@ class Vprasanje {
echo '</span>';
}
-
-
- /**
- * urejanje label za grafe
- *
- */
- /*function vprasanje_grafi () {
- global $lang;
-
- $row = Cache::srv_spremenljivka($this->spremenljivka);
-
- //echo '<h2>'.$row['variable'].' - '.$lang['srv_grafi_urejanje'].'</h2>';
- $this->variable();
-
- // Enable/disable editiranje label posebej za grafe
- $this->edit_graf();
-
- // Gumb za kopiranje besedila iz osnovnega urejanja
- echo '<div class="chart_copy" '.($row['edit_graf'] == 0 ? ' style="display: none;"' : '').'><p>';
- echo $lang['srv_edit_chart_copy'].': ';
- echo '<input type="button" name="copy_graf" value="'.$lang['srv_edit_chart_copyB'].'" onClick="copy_chart();" />';
-
- //echo '<a class="ovalbutton ovalbutton_gray" onclick="copy_chart();" href="#">
- // <span>'.$lang['srv_edit_chart_copyB'].'</span>
- // </a>';
-
- echo '</p></div>';
-
- $show = ($row['edit_graf'] == 0) ? ' style="display:none;"' : '';
-
- echo '<div class="chart_editing" '.$show.'>';
-
- // Urejanje naslova spremenljivke
- $text = $row['naslov_graf'] == '<p></p>' ? $row['naslov'] : $row['naslov_graf'];
- if (strtolower(substr($text, 0, 3)) == '<p>' && strtolower(substr($text, -4)) == '</p>' && strrpos($text, '<p>') == 0) {
- $text = substr($text, 3);
- $text = substr($text, 0, -4);
- }
- echo '<p>';
- echo '<textarea style="width:99%; height:60px;" name="naslov_graf" id="naslov_graf" class="chart_label">'.$text.'</textarea>';
- echo '</p>';
-
- // Urejanje naslovov variabel
- $sql1 = sisplet_query("SELECT id, naslov, naslov_graf, variable, other FROM srv_vrednost WHERE spr_id = '$this->spremenljivka' ORDER BY vrstni_red ASC");
- if (!$sql1) echo mysqli_error($GLOBALS['connect_db']);
-
- echo '<input type="hidden" name="edit_vrednost_graf" value="1" />';
-
- echo '<div id="vrednosti_holder"><ul class="vrednost_sort">';
- while ($row1 = mysqli_fetch_array($sql1)) {
-
- $text = $row1['naslov_graf'] == '' ? $row1['naslov'] : $row1['naslov_graf'];
-
- echo '<li id="vrednost_'.$vrednost.'" '.($row1['other'] == 1 ? 'class="li_other"' : '').'>';
-
- $gridWidth = 42;
-
- echo '<textarea name="vrednost_graf_'.$row1['id'].'" id="'.$row1['variable'].'_graf" class="vrednost_textarea chart_label" style="width:'.$gridWidth.'%;">'.$text.'</textarea> ';
- echo '['.$row1['variable'].']</span>';
- if ($row1['other'] == 1) echo ' <input type="text" disabled style="width:40px" />';
-
- echo '</li>';
- }
-
- echo '</ul>';
-
- echo '</div>';
-
-
- // Urejanje label za gride
- //if($row['tip'] == 6 || $row['tip'] == 16 || $row['tip'] == 19 || $row['tip'] == 20){
- if($row['tip'] == 6 || $row['tip'] == 16 || $row['tip'] == 19 || $row['tip'] == 20 || $row['tip'] == 2){
-
- echo '<div class="grid_settings">';
- echo '<input type="hidden" name="edit_grid_graf" value="1" />';
-
- echo '<table id="grids" style="width:100%">';
-
- echo '<tr>';
- for ($i=1; $i<=$row['grids']; $i++) {
- echo '<td>'.$i.'</td>';
- }
-
- //dodatne vrednosti (ne vem, zavrnil...)
- if (count($already_set_mv) > 0 ) {
- echo '<td></td>';
- if (count($missing_values) > 0) {
- foreach ($missing_values AS $mv_key => $mv_text) {
- if (isset($already_set_mv[$mv_key])) {
- echo '<td>'.$mv_key.'</td>';
- }
- }
- }
- }
- echo '</tr>';
-
- echo '<tr>';
- for ($i=1; $i<=$row['grids']; $i++) {
- $sql1 = sisplet_query("SELECT naslov, naslov_graf FROM srv_grid WHERE id='$i' AND spr_id='$this->spremenljivka'");
- $row1 = mysqli_fetch_array($sql1);
- $text = $row1['naslov_graf'] == '' ? $row1['naslov'] : $row1['naslov_graf'];
- echo '<td><input type="text" name="grid_graf_'.$i.'" id="grid_naslov_'.$i.'_graf" class="chart_label" value="'.$text.'" /></td>';
- }
-
- //dodatne vrednosti (ne vem, zavrnil...)
- if (count($already_set_mv) > 0 ) {
- echo '<td></td>';
- if (count($missing_values) > 0) {
- foreach ($missing_values AS $mv_key => $mv_text) {
- if (isset($already_set_mv[$mv_key])) {
- echo '<td><input type="text" name="grid_'.$mv_key.'_graf" class="chart_label" value="'.$already_set_mv[$mv_key].'" /></td>';
- }
- }
- }
- }
- echo '</tr>';
-
- echo '</table>';
- echo '</div>';
- }
-
- echo '</div>';
-
-
- // sirina labele grafa (navadna ali 50%)
- //$this->wide_graf();
- }*/
-
/**
* prikaz trackinga sprememb spremenljivke
*
@@ -1695,22 +1593,35 @@ class Vprasanje {
}
// obicna roleta za tip
else {
-
- echo '<span class="content"><select name="tip" id="spremenljivka_tip_' . $row['id'] . '" size="1" spr_id="' . $row['id'] . '" onChange="change_tip(\'' . $row['id'] . '\', $(this).val());">';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo '<div class="vprasanje_setting_line right-190">';
+
+ echo '<label>'.$lang['srv_question_type'].':</label>';
+
+ echo '<span class="content"><select name="tip" id="spremenljivka_tip_' . $row['id'] . '" size="1" spr_id="' . $row['id'] . '" onChange="change_tip(\'' . $row['id'] . '\', $(this).val(), \'0\');">';
echo '<option value="1"' . ($row['tip'] == 1 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_radio'] . '</option>';
echo '<option value="2"' . ($row['tip'] == 2 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_checkbox'] . '</option>';
if($this->survey_type != 0){
- if ($row['tip'] == 3) // star tip, ostane samo za kompatibilnost, ce je kje ostal se star tip
- //echo '<option value="3"' . ($row['tip'] == 3 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_dropdown'] . '</option>';
+ // star tip, ostane samo za kompatibilnost, ce je kje ostal se star tip
+ if ($row['tip'] == 3){
if ($row['info']){
echo '<option value="3"' . ($row['tip'] == 3 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_checkbox'] .'</option>';
}
else{
echo '<option value="3"' . ($row['tip'] == 3 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_radio'] .'</option>';
}
+ }
+ echo '<option value="21"' . ($row['tip'] == 21 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_text'] . '</option>';
+ if ($row['tip'] == 4) // star tip, ostane samo za kompatibilnost, ce je kje ostal se star tip
+ echo '<option value="4"' . ($row['tip'] == 4 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_text'] . '</option>';
+
+ echo '<option value="7"' . ($row['tip'] == 7 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_number'] . '</option>';
+
echo '<option value="6"' . ($row['tip'] == 6 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_multigrid'] . '</option>';
echo '<option value="16"' . ($row['tip'] == 16 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_multicheckbox'] . '</option>';
echo '<option value="19"' . ($row['tip'] == 19 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_multitext'] . '</option>';
@@ -1718,15 +1629,9 @@ class Vprasanje {
if($userAccess->checkUserAccess($what='question_type_multitable'))
echo '<option value="24"' . ($row['tip'] == 24 ? ' selected="true"' : '') . '>' . $lang['srv_survey_table_multiple'] . '</option>';
-
- echo '<option value="21"' . ($row['tip'] == 21 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_text'] . '</option>';
-
- if ($row['tip'] == 4) // star tip, ostane samo za kompatibilnost, ce je kje ostal se star tip
- echo '<option value="4"' . ($row['tip'] == 4 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_text'] . '</option>';
-
- echo '<option value="7"' . ($row['tip'] == 7 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_number'] . '</option>';
+
echo '<option value="5"' . ($row['tip'] == 5 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_label'] . '</option>';
-
+
if($userAccess->checkUserAccess($what='question_type_location'))
echo '<option value="26"' . ($row['tip'] == 26 ? ' selected="true"' : '') . '>' . $lang['srv_vprasanje_location'] . '</option>';
@@ -1752,9 +1657,11 @@ class Vprasanje {
}
echo '</select></span>';
- //echo '</p>';
-
-
+
+ echo '</div>';
+
+ echo '</div>';
+
echo '<script type="text/javascript">';
echo '$(document).ready(function() { ';
echo '$("#spremenljivka_tip_' . $row['id'] . '").selectbox();'; // kreira custom dropdown z možnostjo predogleda vprašanja
@@ -1814,57 +1721,44 @@ class Vprasanje {
$this->edit_subtype_map();
}
- //podtip heatmap
- if ($row['tip'] == 27) {
- $this->edit_heatmap_settings();
- }
-
echo '<script type="text/javascript">';
echo ' $(document).ready(function() {';
echo ' $("#spremenljivka_podtip_' . $row['id'] . '").selectbox();'; // kreira custom dropdown z možnostjo predogleda vprašanja
echo ' });';
echo '</script>';
}
-
- /**
- * urejanje naslova
- *
- */
- function edit_naslov($editor = true) {
- global $lang;
-
- $row = Cache::srv_spremenljivka($this->spremenljivka);
-
- // ce je ena vrstica pobrisemo <p> in </p>
- if (strtolower(substr($row['naslov'], 0, 3)) == '<p>' && strtolower(substr($row['naslov'], -4)) == '</p>' && strrpos($row['naslov'], '<p>') == 0) {
- $row['naslov'] = substr($row['naslov'], 3);
- $row['naslov'] = substr($row['naslov'], 0, -4);
- }
- echo '<p>';
- if ($editor)
- echo '<span class="red pointer" onmouseover="this.style.display=\'none\'; create_editor(\'naslov\');">'.$lang['srv_editor'].'</span><br />';
- echo '<textarea name="naslov" id="naslov">'.$row['naslov'].'</textarea>';
- echo '</p>';
- }
-
/**
* urejanje variable
*
*/
function edit_variable () {
global $lang;
-
+ global $site_domain;
+
$row = Cache::srv_spremenljivka($this->spremenljivka);
- #'email','ime','priimek','telefon','naziv','drugo'
- if ( in_array($row['variable'], array('email','telefon','ime','priimek','naziv','drugo')) && $row['sistem']==1 )
- $disabled = true; else $disabled = false;
- echo '<p><span class="title">'.$lang['srv_variable'].': '.Help::display('edit_variable').'</span><span class="content"><input type="text" name="variable" value="'.$row['variable'].'" onkeyup="vprasanje_check_variable(this);" '.($disabled?'disabled':'').' maxlength="10" /></span></p>';
+ #'email','ime','priimek','telefon','naziv','drugo'
+ if (in_array($row['variable'], array('email','telefon','ime','priimek','naziv','drugo')) && $row['sistem']==1)
+ $disabled = true;
+ else
+ $disabled = false;
- //echo '<p><span class="title">'.$lang['srv_datapiping'].': '.Help::display('DataPiping').'</span> '.$lang['srv_datapiping_txt'].'</p>';
-
- }
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ if($site_domain == 'anketa.nijz.si'){
+ echo ' <label>'.$lang['srv_variable'].': '.Help::display('edit_variable').'</label>';
+ echo ' <span class="content"><input type="text" name="variable" value="'.$row['variable'].'" '.($disabled?'disabled':'').' /></span>';
+ }
+ else{
+ echo ' <label>'.$lang['srv_variable'].': '.Help::display('edit_variable').'</label>';
+ echo ' <span class="content"><input type="text" name="variable" value="'.$row['variable'].'" onkeyup="vprasanje_check_variable(this);" '.($disabled?'disabled':'').' maxlength="10" /></span>';
+ }
+ echo ' </div>';
+
+ echo '</div>';
+ }
/**
* urejanje variable
@@ -1876,7 +1770,14 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
#'email','ime','priimek','telefon','naziv','drugo'
- echo '<p><span class="title">'.$lang['srv_label'].':</span><span class="content"><input type="text" name="label" value="'.$row['label'].'" maxlength="80" /></span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_label'].':</label>';
+ echo ' <span class="content"><input type="text" name="label" value="'.$row['label'].'" maxlength="80" /></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -1885,13 +1786,8 @@ class Vprasanje {
*/
function variable ($edit_tip = 0) {
- $row = Cache::srv_spremenljivka($this->spremenljivka);
-
- //echo '<h2><div contenteditable="true" onkeyup="vprasanje_check_variable(this); $(\'#spremenljivka_content_'.$row['id'].' .variable_name\').html( $(this).html() );" onblur="inline_variable(\''.$row['id'].'\', this);" class="editable" style="display:inline-block; width:115px; overflow:hidden; cursor:text">'.$row['variable'].'</div>';
- echo '<h2>'.$row['variable'].'';
- if ($edit_tip == 1) $this->edit_tip();
- echo '</h2>';
-
+ if ($edit_tip == 1)
+ $this->edit_tip();
}
//edit opombe
@@ -1900,17 +1796,34 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p style="margin-bottom: 32px"><label for="_info" class="title">'.$lang['srv_note2'].':</label>';
- //echo '<span class="content"><textarea name="info" style="width:200px">'.$row['info'].'</textarea></span>';
- //echo '<span class="content"><input type="radio" name="info" value="" '.($row['info']==''?' checked':'').'>'.$lang['no'].'';
- //echo '<input type="radio" name="info" value="'.($row['info']!=''?$row['info']:$lang['note']).'" id="radiothis" '.($row['info']!=''?' checked':'').'>'.$lang['yes'].'</span>';
- echo '<span class="content"><input type="hidden" name="info" value="">';
- echo '<input type="checkbox" id="_info" name="info" value="'.($row['info']!=''?$row['info']:$lang['note']).'" '.($row['info']!=''?' checked':'').'></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="info" value="">';
+ echo ' <input type="checkbox" id="_info" name="info" value="'.($row['info']!=''?$row['info']:$lang['note']).'" '.($row['info']!=''?' checked':'').'>';
+ echo ' <label for="_info" class="title">'.$lang['srv_note2'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
// ob spremembi opombe, damo drug value tudi na radio Da, da se ob shranjevanju desnega menija shrani nova opomba, ce je bila spremenenjena
?><script> $('div.spremenljivka_info.info_inline[spr_id=<?=$this->spremenljivka?>]').live('blur', function() { $('#_info').val( $(this).html() ); }) </script><?
}
+
+ // dodajanje elementa v knjiznico
+ private function add_into_library(){
+ global $lang;
+
+ $row = Cache::srv_spremenljivka($this->spremenljivka);
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line with-icon">';
+ echo ' <span onClick="displayAddIntoLibraryPopup(\''.$this->spremenljivka.'\', \'1\');"><span class="faicon library"></span>'.$lang['srv_library_add_to_lib_title_q2'].'</span>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
//editiranje naslova uvoda
function edit_uvod() {
@@ -1918,8 +1831,6 @@ class Vprasanje {
global $admin_type;
$row = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<h2>'.$lang['srv_intro_label'].'</h2>';
if ($row['introduction'] == '') {
$lang_admin = SurveyInfo::getInstance()->getSurveyColumn('lang_admin');
@@ -1945,52 +1856,83 @@ class Vprasanje {
$text = substr($text, 0, -4);
}
+
+ echo '<fieldset><legend>'.$lang['srv_common_settings'].'</legend>';
+
// Opomba
- $opomba = $row['intro_opomba'];
- echo '<p>'.$lang['note'].' ('.$lang['srv_internal'].'): ';
- echo '<textarea name="intro_opomba" class="texteditor info" >'.$opomba.'</textarea>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['note'].' ('.$lang['srv_internal'].'): </label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <textarea name="intro_opomba" class="texteditor info" >'.$row['intro_opomba'].'</textarea>';
+ echo ' </div>';
+
+ echo '</div>';
- /*if ($row['user_base'] == 1 && (int)$row['individual_invitation'] > 0) {
- $disabled = 'disabled';
- } else*/ $disabled = '';
+
+ $disabled = '';
// Prikaz uvoda
- echo '<p>';
- echo '<span class="title">'.$lang['srv_show_intro'].': </span>';
- echo '<input type="radio" name="show_intro" value="0" id="show_intro_0" '.(($row['show_intro'] == 0) ? ' checked="checked" ' : '').' '.$disabled.' onClick="$(\'.intro_static_setting\').hide();" /><label for="show_intro_0">'.$lang['no1'].'</label>';
- echo '<input type="radio" name="show_intro" value="1" id="show_intro_1" '.(($row['show_intro'] == 1) ? ' checked="checked" ' : '').' '.$disabled.' onClick="$(\'.intro_static_setting\').show();" /><label for="show_intro_1">'.$lang['yes'].'</label>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label class="title">'.$lang['srv_show_intro'].': </label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" name="show_intro" value="0" id="show_intro_0" '.(($row['show_intro'] == 0) ? ' checked="checked" ' : '').' '.$disabled.' onClick="$(\'.intro_static_setting\').hide();" /><label for="show_intro_0">'.$lang['no1'].'</label>';
+ echo ' <input type="radio" name="show_intro" value="1" id="show_intro_1" '.(($row['show_intro'] == 1) ? ' checked="checked" ' : '').' '.$disabled.' onClick="$(\'.intro_static_setting\').show();" /><label for="show_intro_1">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Staticen uvod, ki ne ustvari userja (user se ustvari sele na naslednji strani) - za recimo embeddane ankete...
- //if($admin_type == 0){
- echo '<p class="intro_static_setting" '.($row['show_intro'] == 0 ? ' style="display:none;"' : '').'>';
- echo '<span class="title">'.$lang['srv_show_intro_static'].': </span>';
- echo '<input type="radio" name="intro_static" id="intro_static_0" value="0" '.(($row['intro_static'] == 0) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_0">'.$lang['srv_show_intro_static_0'].'</label>';
- echo '<input type="radio" name="intro_static" id="intro_static_1" value="1" '.(($row['intro_static'] == 1) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_1">'.$lang['srv_show_intro_static_1'].'</label>';
- echo '<input type="radio" name="intro_static" id="intro_static_2" value="2" '.(($row['intro_static'] == 2) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_2">'.$lang['srv_show_intro_static_2'].'</label>';
- echo '</p>';
- //}
-
- //dodaten naslov gumba za naprej
+ echo '<div class="vprasanje_setting_holder intro_static_setting" '.($row['show_intro'] == 0 ? ' style="display:none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_show_intro_static'].': </label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" name="intro_static" id="intro_static_0" value="0" '.(($row['intro_static'] == 0) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_0">'.$lang['srv_show_intro_static_0'].'</label>';
+ echo ' <input type="radio" name="intro_static" id="intro_static_1" value="1" '.(($row['intro_static'] == 1) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_1">'.$lang['srv_show_intro_static_1'].'</label>';
+ echo ' <input type="radio" name="intro_static" id="intro_static_2" value="2" '.(($row['intro_static'] == 2) ? ' checked="checked" ' : '').' '.$disabled.' /><label for="intro_static_2">'.$lang['srv_show_intro_static_2'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Dodaten naslov gumba za naprej
SurveySetting::getInstance()->Init($this->anketa);
$srv_nextpage_uvod = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_nextpage_uvod');
if ($srv_nextpage_uvod != '')
$text = $srv_nextpage_uvod;
else
$text = $lang_srv_nextpage_uvod;
- echo '<p><label for="srv_nextpage_uvod">'.$lang['srv_nextpage_uvod'].':</label> <input type="text" name="srv_nextpage_uvod" id="srv_nextpage_uvod" value="'.$text.'" style="width:200px"></span></p>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label for="srv_nextpage_uvod">'.$lang['srv_nextpage_uvod'].':</label>';
+ echo ' <span class="content"><input type="text" name="srv_nextpage_uvod" id="srv_nextpage_uvod" value="'.$text.'"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
}
- //editiranje naslova zakljucka in osnovnih nastavitev (skok na url...)
+ // editiranje naslova zakljucka in osnovnih nastavitev (skok na url...)
function edit_zakljucek() {
global $lang;
global $site_url;
$row = SurveyInfo::getInstance()->getSurveyRow();
SurveySetting::getInstance()->Init($this->anketa);
-
- echo '<h2>'.$lang['srv_end_label'].'</h2>';
if ($row['conclusion'] == '') {
$lang_admin = SurveyInfo::getInstance()->getSurveyColumn('lang_admin');
@@ -2017,21 +1959,112 @@ class Vprasanje {
$text = substr($text, 0, -4);
}
+
+ echo '<fieldset><legend>'.$lang['srv_common_settings'].'</legend>';
+
// opomba
- $opomba = $row['concl_opomba'];
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['note'].' ('.$lang['srv_internal'].'): </label>';
+ echo ' </div>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <textarea name="concl_opomba" class="texteditor info" >'.$row['concl_opomba'].'</textarea>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_show_concl'].': </label>';
+ echo ' </div>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" id="show_concl_0" name="show_concl" value="0" '.(($row['show_concl'] == 0) ? ' checked="checked" ' : '').' /><label for="show_concl_0">'.$lang['no1'].'</label>';
+ echo ' <input type="radio" id="show_concl_1" name="show_concl" value="1" '.(($row['show_concl'] == 1) ? ' checked="checked" ' : '').' /><label for="show_concl_1">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+
- echo '<p>'.$lang['note'].' ('.$lang['srv_internal'].'): ';
- echo '<textarea name="concl_opomba" class="texteditor info" >'.$opomba.'</textarea>';
- echo '</p>';
+ // Dodatne nastavitve
+ echo '<fieldset><legend>'.$lang['srv_extra_settings'].'</legend>';
+
+ // Povezava za naknadno urejanje
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" id="concl_return_edit" name="concl_return_edit" value="1" '.($row['concl_return_edit'] == 1 ? ' checked' : '').'/>';
+ echo ' <label for="concl_return_edit">'.$lang['srv_concl_return_edit'].'</label>';
+ echo ' </div>';
+ echo '</div>';
- echo '<p>';
- echo '<span class="title">'.$lang['srv_show_concl'].': </span>';
- echo '<input type="radio" id="show_concl_0" name="show_concl" value="0" '.(($row['show_concl'] == 0) ? ' checked="checked" ' : '').' /><label for="show_concl_0">'.$lang['no1'].'</label>';
- echo '<input type="radio" id="show_concl_1" name="show_concl" value="1" '.(($row['show_concl'] == 1) ? ' checked="checked" ' : '').' /><label for="show_concl_1">'.$lang['yes'].'</label>';
- echo '</p>';
+
+ // Povezava na pdf
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" id="concl_PDF_link" name="concl_PDF_link" value="1" '.($row['concl_PDF_link'] == 1 ? ' checked' : '').'/>';
+ echo ' <label for="concl_PDF_link">'.$lang['srv_concl_PDF_link'].' '.Help :: display('srv_concl_PDF_link').'</label>';
+ echo ' </div>';
+ echo '</div>';
+
+ // link na urejanje texta ce je anketa ze zakljucena
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_concl_deactivation_text'].' '.Help::display('srv_concl_deactivation_text').'</label>';
+ echo ' </div>';
+
+ $value = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_survey_non_active');
+ if ($value == '') $value = $lang['srv_survey_non_active'];
+ echo ' <div class="vprasanje_setting_line concl_deactivation">';
+ echo ' <textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:100%; height:32px;">'.$value.'</textarea>';
+ echo ' <span class="faicon edit" onclick="vprasanje_jezik_edit_zakljucek(\'srvlang_srv_survey_non_active\');"></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>';
+ }
+
+ // Editiranje naprednih nastavitev zakljucka
+ function edit_zakljucek_napredno() {
+ global $lang;
+ global $site_url;
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+ SurveySetting::getInstance()->Init($this->anketa);
+ if ($row['conclusion'] == '') {
+ $lang_admin = SurveyInfo::getInstance()->getSurveyColumn('lang_admin');
+ $lang_resp = SurveyInfo::getInstance()->getSurveyColumn('lang_resp');
+
+ // nastavimo na jezik za respondentov vmesnik
+ $file = '../../lang/'.$lang_resp.'.php';
+ include($file);
+
+ $text = $lang['srv_end'];
+ $lang_srv_prevpage = $lang['srv_prevpage'];
+ $lang_srv_konec = $lang['srv_konec'];
+
+ // nastavimo nazaj na admin jezik
+ $file = '../../lang/'.$lang_admin.'.php';
+ include($file);
+ }
+ else {
+ $text = $row['conclusion'];
+ }
+
+ if (strtolower(substr($text, 0, 3)) == '<p>' && strtolower(substr($text, -4)) == '</p>' && strrpos($text, '<p>') == 0) {
+ $text = substr($text, 3);
+ $text = substr($text, 0, -4);
+ }
+
- //dodatne nastaitve (skok na url ...)
+ // Dodatne nastaitve (skok na url ...)
echo '<fieldset><legend>'.$lang['srv_concl_link'].'</legend>';
if ($row['url'] != '')
@@ -2039,41 +2072,74 @@ class Vprasanje {
else
$url = $site_url;
- echo '<p>';
- echo '<input type="radio" id="concl_link_1" name="concl_link" value="1" '.($row['concl_link'] == 0 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()"><label for="concl_link_1">'.$lang['srv_concl_link_close'].'</label> ';
- // Rekurzivno - samo pri navadni anketi
- if($row['survey_type'] > 1)
- echo '<br /><input type="radio" id="concl_link_2" name="concl_link" value="2" '.($row['concl_link'] == 2 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()"><label for="concl_link_2">'.$lang['srv_concl_link_rec'].'</label> ';
- echo '<br /><input type="radio" id="concl_link_0" name="concl_link" value="0" '.($row['concl_link'] == 1 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').show()"><label for="concl_link_0">'.$lang['srv_concl_link_go'].'</label> ';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" id="concl_link_1" name="concl_link" value="1" '.($row['concl_link'] == 0 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()"><label for="concl_link_1">'.$lang['srv_concl_link_close'].'</label> ';
+ echo ' </div>';
+
+ // Rekurzivno - samo pri navadni anketi
+ if($row['survey_type'] > 1){
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" id="concl_link_2" name="concl_link" value="2" '.($row['concl_link'] == 2 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').hide()"><label for="concl_link_2">'.$lang['srv_concl_link_rec'].'</label> ';
+ echo ' </div>';
+ }
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" id="concl_link_0" name="concl_link" value="0" '.($row['concl_link'] == 1 ? ' checked' : '').' onclick="$(\'#srv_concl_link_go\').show()"><label for="concl_link_0">'.$lang['srv_concl_link_go'].'</label> ';
+ echo ' </div>';
+
+ echo '</div>';
+
// Ce skocimo na custom url prikazemo urejanje url-ja in dodatne nastavitve za parametre v url (usr_id, status...)
- echo '<div id="srv_concl_link_go" '.($row['concl_link'] == 0 || $row['concl_link'] == 2 ?' style="display:none"':'').'">';
-
+ echo '<div id="srv_concl_link_go" '.($row['concl_link'] == 0 || $row['concl_link'] == 2 ?' style="display:none"':'').'">';
+
// URL
- echo '<p><label for="url">'.$lang['srv_url'].':</label> <input type="text" name="url" id="url_concl_sett" value="'.$url.'" style="width:200px"></p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line inline">';
+ echo ' <label for="url">'.$lang['srv_url'].':</label>';
+ echo ' <span class="content"><input type="text" name="url" id="url_concl_sett" value="'.$url.'"></span>';
+ echo ' </div>';
+ echo '</div>';
+
// Parametri
- echo '<p>';
- echo $lang['srv_concl_link_params'].':<br />';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_concl_link_params'].':</label>';
+ echo ' </div>';
+
$concl_url_usr_id = SurveySetting::getInstance()->getSurveyMiscSetting('concl_url_usr_id');
- echo '<input type="hidden" name="concl_url_usr_id" value="0">';
- echo '<span class="spaceLeft spaceright"><input type="checkbox" name="concl_url_usr_id" id="concl_url_usr_id" value="1" '.($concl_url_usr_id==1 ? ' checked="checked"' : '').'> <label for="concl_url_usr_id">'.$lang['srv_concl_link_usr_id'].'</label></span>';
- echo '<br />';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="concl_url_usr_id" value="0">';
+ echo ' <input type="checkbox" name="concl_url_usr_id" id="concl_url_usr_id" value="1" '.($concl_url_usr_id==1 ? ' checked="checked"' : '').'> <label for="concl_url_usr_id">'.$lang['srv_concl_link_usr_id'].'</label>';
+ echo ' </div>';
+
$concl_url_status = SurveySetting::getInstance()->getSurveyMiscSetting('concl_url_status');
- echo '<input type="hidden" name="concl_url_status" value="0">';
- echo '<span class="spaceLeft"><input type="checkbox" name="concl_url_status" id="concl_url_status" value="1" '.($concl_url_status==1 ? ' checked="checked"' : '').'> <label for="concl_url_status">'.$lang['srv_concl_link_status'].'</label></span>';
- echo '<br />';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="concl_url_status" value="0">';
+ echo ' <input type="checkbox" name="concl_url_status" id="concl_url_status" value="1" '.($concl_url_status==1 ? ' checked="checked"' : '').'> <label for="concl_url_status">'.$lang['srv_concl_link_status'].'</label>';
+ echo ' </div>';
+
$concl_url_recnum = SurveySetting::getInstance()->getSurveyMiscSetting('concl_url_recnum');
- echo '<input type="hidden" name="concl_url_recnum" value="0">';
- echo '<span class="spaceLeft"><input type="checkbox" name="concl_url_recnum" id="concl_url_recnum" value="1" '.($concl_url_recnum==1 ? ' checked="checked"' : '').'> <label for="concl_url_recnum">'.$lang['srv_concl_link_recnum'].'</label></span>';
- echo '</p>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="concl_url_recnum" value="0">';
+ echo ' <input type="checkbox" name="concl_url_recnum" id="concl_url_recnum" value="1" '.($concl_url_recnum==1 ? ' checked="checked"' : '').'> <label for="concl_url_recnum">'.$lang['srv_concl_link_recnum'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
-
// Text za datapiping v url-ju
- echo '<p>'.$lang['srv_concl_link_datapiping'].'</p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <p>'.$lang['srv_concl_link_datapiping'].'</p>';
+ echo ' </div>';
+ echo '</div>';
+
+
echo '</div>';
echo '</fieldset>';
@@ -2081,46 +2147,49 @@ class Vprasanje {
echo '<fieldset><legend>'.$lang['srv_extra_settings'].'</legend>';
- echo '<p><label for="concl_back_button">'.$lang['srv_concl_back_button_show'].'</label><span class="content"><input type="checkbox" id="concl_back_button" name="concl_back_button" value="1" '.($row['concl_back_button'] == 1 ? ' checked' : '').' onclick=" if (this.checked) { $(\'#srv_prevpage_span\').show(); } else { $(\'#srv_prevpage_span\').hide(); }" /></span>';
-
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" id="concl_back_button" name="concl_back_button" value="1" '.($row['concl_back_button'] == 1 ? ' checked' : '').' onclick=" if (this.checked) { $(\'#srv_prevpage_span\').show(); } else { $(\'#srv_prevpage_span\').hide(); }" />';
+ echo ' <label for="concl_back_button">'.$lang['srv_concl_back_button_show'].'</label>';
+ echo ' </div>';
+ echo '</div>';
+
// dodaten naslov gumba zakljucek
- $srv_prevpage = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_prevpage');
+ /*$srv_prevpage = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_prevpage');
if ($srv_prevpage != '')
$text = $srv_prevpage;
else
$text = $lang_srv_prevpage;
- echo '<br /><span id="srv_prevpage_span"'.($row['concl_back_button']==0?' style="display:none"':'').'> <label for="srv_prevpage">'.$lang['srv_prevpage'].':</label> <span class="content"><input type="text" name="srv_prevpage" id="srv_prevpage" value="'.$text.'" style="width:190px"></span></span></p>';
-
-
- echo '<p><label for="concl_end_button">'.$lang['srv_concl_end_button_show'].'</label><span class="content"><input type="checkbox" id="concl_end_button" name="concl_end_button" value="1" '.($row['concl_end_button'] == 1 ? ' checked' : '').' onclick=" if (this.checked) { $(\'#srv_konec_span\').show(); } else { $(\'#srv_konec_span\').hide(); }" /></span>';
-
+
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div id="srv_prevpage_span" class="vprasanje_setting_line half-half" '.($row['concl_back_button']==0?' style="display:none"':'').'>';
+ echo ' <label for="srv_prevpage">'.$lang['srv_prevpage'].':</label>';
+ echo ' <span class="content"><input type="text" name="srv_prevpage" id="srv_prevpage" value="'.$text.'"></span>';
+ echo ' </div>';
+ echo '</div>';*/
+
+
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" id="concl_end_button" name="concl_end_button" value="1" '.($row['concl_end_button'] == 1 ? ' checked' : '').' onclick=" if (this.checked) { $(\'#srv_konec_span\').show(); } else { $(\'#srv_konec_span\').hide(); }" />';
+ echo ' <label for="concl_end_button">'.$lang['srv_concl_end_button_show'].'</label>';
+ echo ' </div>';
+ echo '</div>';
+
// dodaten naslov gumba zakljucek
$srv_konec = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_konec');
if ($srv_konec != '')
$text = $srv_konec;
else
$text = $lang_srv_konec;
- echo '<br /><span id="srv_konec_span"'.($row['concl_end_button']==0?' style="display:none"':'').'> <label for="srv_konec">'.$lang['srv_konec'].':</label> <span class="content"><input type="text" name="srv_konec" id="srv_konec" value="'.$text.'" style="width:190px"></span></span></p>';
-
- // Povezava za naknadno urejanje
- echo '<p><label for="concl_return_edit">'.$lang['srv_concl_return_edit'].'</label><span class="content"><input type="checkbox" id="concl_return_edit" name="concl_return_edit" value="1" '.($row['concl_return_edit'] == 1 ? ' checked' : '').'/></span></p>';
-
- // Povezava na pdf
- echo '<p><label for="concl_PDF_link">'.$lang['srv_concl_PDF_link'].'</label><span class="content"><input type="checkbox" id="concl_PDF_link" name="concl_PDF_link" value="1" '.($row['concl_PDF_link'] == 1 ? ' checked' : '').'/></span>'.Help :: display('srv_concl_PDF_link').'</p>';
-
- // link na urejanje texta ce je anketa ze zakljucena
- echo '<p>';
- echo $lang['srv_concl_deactivation_text'].' '.Help::display('srv_concl_deactivation_text').'<br />';
-
- $value = SurveySetting::getInstance()->getSurveyMiscSetting('srvlang_srv_survey_non_active');
- if ($value == '') $value = $lang['srv_survey_non_active'];
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div id="srv_konec_span" class="vprasanje_setting_line half-half" '.($row['concl_end_button']==0?' style="display:none"':'').'>';
+ echo ' <label for="srv_konec">'.$lang['srv_button_text'].':</label>';
+ echo ' <span class="content"><input type="text" name="srv_konec" id="srv_konec" value="'.$text.'"></span>';
+ echo ' </div>';
+ echo '</div>';
- echo '<textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:260px; height:30px;">'.$value.'</textarea>';
- echo '<span class="faicon edit icon-as_link small" onclick="vprasanje_jezik_edit_zakljucek(\'srvlang_srv_survey_non_active\');" style="float: right; margin-top: 1px;"></span>';
- echo '</p>';
-
-
echo '</fieldset>';
}
@@ -2129,8 +2198,6 @@ class Vprasanje {
global $lang;
$row = SurveyInfo::getInstance()->getSurveyRow();
-
- echo '<h2>'.$lang['srv_statistic_label'].'</h2>';
$text = $row['statistics'];
@@ -2139,10 +2206,25 @@ class Vprasanje {
$text = substr($text, 0, -4);
}
- // text
- echo '<p><span class="title">Besedilo statistike:</span>';
- echo '<textarea name="statistics">'.$text.'</textarea>';
- echo '</p>';
+
+ echo '<fieldset><legend>'.$lang['srv_common_settings'].'</legend>';
+
+
+ // Text
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>Besedilo statistike:</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <textarea name="statistics">'.$text.'</textarea>';
+ echo ' </div>';
+
+ echo ' </div>';
+
+
+ echo '</fieldset>';
}
// navadna/sistemska spr
@@ -2154,11 +2236,15 @@ class Vprasanje {
if ( in_array($row['variable'], array('email','telefon','ime','priimek','naziv','drugo')) && $row['sistem']==1 )
$disabled = true; else $disabled = false;
- echo '<p>';
- echo '<label for="sistem" class="title">'.$lang['srv_sistemska'].': '.Help::display('srv_sistemska_edit').'</label>';
- echo '<span class="content"><input type="hidden" name="sistem" value="0" />';
- echo '<input type="checkbox" id="sistem" name="sistem" value="1" '.(($row['sistem'] == 1) ? ' checked="checked" ' : '').' '.($disabled?'disabled':'').' />';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="sistem" value="0" />';
+ echo ' <input type="checkbox" id="sistem" name="sistem" value="1" '.(($row['sistem'] == 1) ? ' checked="checked" ' : '').' '.($disabled?'disabled':'').' />';
+ echo ' <label for="sistem" class="title">'.$lang['srv_sistemska'].' '.Help::display('srv_sistemska_edit').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// skrito/vidno vprasanje
@@ -2167,24 +2253,36 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<label for="visible" class="title">'.$lang['srv_visible'].': </label>';
- //echo '<span class="content"><input type="radio" name="visible" value="0" '.(($row['visible'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'];
- //echo '<input type="radio" name="visible" value="1" '.(($row['visible'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'];
- echo '<span class="content"><input type="hidden" name="visible" value="0" />';
- echo '<input type="checkbox" id="visible" name="visible" value="1" '.(($row['visible'] == 1) ? ' checked="checked" ' : '').' onClick="show_dostop(this.checked);" />';
- echo '</span></p>';
-
- echo '<div id="dostop" '.($row['visible'] == 1 ? '' : ' style="display:none;"').'><p>';
- echo '<span class="title">'.$lang['srv_visible_dostop'].': </span>';
- echo '<span class="content"><select name="dostop">';
- echo '<option value="4"'.($row['dostop']==4?' selected':'').'>'.$lang['see_everybody'].'</option>';
- echo '<option value="3"'.($row['dostop']==3?' selected':'').'>'.$lang['see_registered'].'</option>';
- echo '<option value="2"'.($row['dostop']==2?' selected':'').'>'.$lang['see_member'].'</option>';
- echo '<option value="1"'.($row['dostop']==1?' selected':'').'>'.$lang['see_manager'].'</option>';
- echo '<option value="0"'.($row['dostop']==0?' selected':'').'>'.$lang['see_admin'].'</option>';
- echo '</select></span>';
- echo '</p></div>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="visible" value="1" />';
+ echo ' <input type="checkbox" id="visible" name="visible" value="0" '.(($row['visible'] != 1) ? ' checked="checked" ' : '').' onClick="show_dostop(this.checked);" />';
+ echo ' <label for="visible" class="title">'.$lang['srv_visible'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div id="dostop" class="vprasanje_setting_holder" '.($row['visible'] == 0 ? '' : ' style="display:none;"').'>';
+
+ /* echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_visible_dostop'].': </label>';
+ echo ' <span class="content"><select name="dostop">';
+ echo ' <option value="4"'.($row['dostop']==4?' selected':'').'>'.$lang['see_everybody'].'</option>';
+ echo ' <option value="3"'.($row['dostop']==2 || $row['dostop']==3?' selected':'').'>'.$lang['see_registered'].'</option>';
+ echo ' <option value="1"'.($row['dostop']==1?' selected':'').'>'.$lang['see_manager'].'</option>';
+ echo ' <option value="0"'.($row['dostop']==0?' selected':'').'>'.$lang['see_admin'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>'; */
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="dostop" value="4" />';
+ echo ' <input type="checkbox" id="_dostop" name="dostop" value="0" '.(($row['dostop'] == '0') ? ' checked="checked" ' : '').'/>';
+ echo ' <label for="_dostop" class="title">'.$lang['srv_visible_dostop_admin'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// odklenjeno/zaklenjeno vprasanje
@@ -2193,11 +2291,15 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<label for="locked" class="title">'.$lang['srv_locked'].': '.Help::display('srv_spremenljivka_lock').'</label>';
- echo '<span class="content"><input type="hidden" name="locked" value="0" />';
- echo '<input type="checkbox" id="locked" name="locked" value="1" '.(($row['locked'] == 1) ? ' checked="checked" ' : '').' />';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="locked" value="0" />';
+ echo ' <input type="checkbox" id="locked" name="locked" value="1" '.(($row['locked'] == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="locked">'.$lang['srv_locked'].' '.Help::display('srv_spremenljivka_lock').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// omogoceno/onemogoceno vprasanje pri resevanju
@@ -2209,11 +2311,19 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$disabled_vprasanje = ($spremenljivkaParams->get('disabled_vprasanje') ? $spremenljivkaParams->get('disabled_vprasanje') : 0);
- echo '<p>';
- echo '<label for="disabled_vprasanje" class="title">'.$lang['srv_disabled'].': '.Help::display('srv_disabled_question').'</label>';
- echo '<span class="content"><input type="hidden" name="disabled_vprasanje" value="0" />';
- echo '<input type="checkbox" id="disabled_vprasanje" name="disabled_vprasanje" value="1" '.(($disabled_vprasanje == 1) ? ' checked="checked" ' : '').' />';
- echo '</span></p>';
+ // ODSTRANJENO - ostane samo tam, kjer je vklopljeno zaradi kompatibilnosti za nazaj
+ if($disabled_vprasanje == '1'){
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="disabled_vprasanje" value="0" />';
+ echo ' <input type="checkbox" id="disabled_vprasanje" name="disabled_vprasanje" value="1" '.(($disabled_vprasanje == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="disabled_vprasanje">'.$lang['srv_disabled'].' '.Help::display('srv_disabled_question').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
/**
@@ -2233,9 +2343,33 @@ class Vprasanje {
$display = ( ($row['tip'] == 6 && ($row['enota'] == 4 || $row['enota'] == 5 || ($row['enota'] == 1 && $diferencial_trak == 1) || ($row['enota'] == 0 && $diferencial_trak == 1)) ) || ($row['tip'] == 6 && $row['enota'] == 8) || ($row['tip'] == 20 && $row['ranking_k'] == 1)) ? ' style="display:none;"' : '';
- echo '<div class="drop_grids_num" '.$display_1.'>';
- echo '<p><span class="title" >'.$lang['srv_odgovorov'].':</span>';
- echo '<span class="content"><select name="grids_count" id="grids_count" onChange="change_selectbox_size(\'' . $row['id'] . '\', $(this).val(), \'' . $lang['srv_select_box_vse'] . '\'); change_trak_num_of_titles(\'' . $row['id'] . '\', $(this).val());">';
+ if ($row['ranking_k'] != 1){
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ $grid_var = ($spremenljivkaParams->get('grid_var') ? $spremenljivkaParams->get('grid_var') : 0);
+
+ echo '<div class="vprasanje_setting_holder grid_var_class" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="grid_var" value="0">';
+ echo ' <input type="checkbox" id="grid_var" name="grid_var" value="1" '.($grid_var == 1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="grid_var" class="title">'.$lang['srv_edit_values'].' '.Help::display('srv_grid_var').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+
+ // Vrednosti na traku tip
+ if($row['tip'] == 6){
+ $this->edit_trak_tabela();
+ }
+
+
+ echo '<div class="vprasanje_setting_holder drop_grids_num" '.$display_1.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_odgovorov'].':</label>';
+ echo ' <span class="content"><select name="grids_count" id="grids_count" onChange="change_selectbox_size(\'' . $row['id'] . '\', $(this).val(), \'' . $lang['srv_select_box_vse'] . '\'); change_trak_num_of_titles(\'' . $row['id'] . '\', $(this).val());">';
// Vedno imamo najmanj 2 grida (drugace so stvari cudne v analizah) - namesto 1 se uporabi navaden radio tip vprasanja
// Pri number sliderju se rabi 1 (mogoče še kje - npr checkbox itd.... ) analize morajo delati tudi v tem primeru :P
@@ -2254,43 +2388,35 @@ class Vprasanje {
echo '<option value="11"' . ($row['grids'] == '11' ? ' selected' : '') . '>11</option>';
echo '<option value="12"' . ($row['grids'] == '12' ? ' selected' : '') . '>12</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
+
// Slikovni tip
if($row['tip'] == 6){
- //if($row['enota'] == 12) {
- $this->edit_custom_picture_radio();
- //}
-
- $this->edit_trak_tabela();
+ $this->edit_custom_picture_radio();
}
+
// prikaz dropdowna za default vrednosti gridov
- if ($row['tip'] == 6 /*&& $row['grids'] == 5*/){
- //echo '<p class="grid_defaults">';
- echo '<p class="grid_defaults_class" '.$display.'>';
- echo '<span class="title">'.$lang['srv_defaultGrid'].':</span>';
- echo '<span class="content"><select name="grid_defaults" id="grid_defaults" style="width:100px">';
- //echo '<span class="content"><select name="grid_defaults" id="grid_defaults" style="width:100px" onChange="vprasanje_save(true)">';
- echo '<option value="0">'.$lang['s_without'].'</option>';
+ if ($row['tip'] == 6){
+
+ echo '<div class="vprasanje_setting_holder grid_defaults_class" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_defaultGrid'].':</label>';
+ echo ' <span class="content"><select name="grid_defaults" id="grid_defaults">';
+
+ echo '<option value="0">'.$lang['s_without'].'</option>';
foreach($default_grid_values AS $key => $value){
echo '<option value="'.$key.'">'.$value['name'].'</option>';
}
- echo '</select></span>';
- echo '</p>';
- }
-
- if ($row['ranking_k'] != 1){
- $spremenljivkaParams = new enkaParameters($row['params']);
- $grid_var = ($spremenljivkaParams->get('grid_var') ? $spremenljivkaParams->get('grid_var') : 0);
-
- echo '<p class="grid_var_class" '.$display.'><label for="grid_var" class="title">'.$lang['srv_edit_values'].':</label>';
- echo ' '.Help::display('srv_grid_var');
- echo '<span class="content">';
- echo '<input type="hidden" name="grid_var" value="0">';
- echo '<input type="checkbox" id="grid_var" name="grid_var" value="1" '.($grid_var == 1 ? ' checked="checked"' : '').'></span></p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
}
@@ -2312,14 +2438,22 @@ class Vprasanje {
while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
$already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov'];
}
- echo '<p>';
- if (count($missing_values) > 0) {
+
+ if (count($missing_values) > 0) {
+
+ echo '<div id="missing_settings_holder">';
+ echo ' <div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line inline">';
foreach ($missing_values AS $mv_key => $mv_text) {
- echo '<input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked' : '').' name="missing_value_checkbox[]" id="missing_value_'.$mv_key.'" value="'.$mv_key.'" title="'.$mv_text.'""></input> '; // ,\''.$mv_key.'\',\''.$mv_text.'\'
- echo '<label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
- }
+ echo ' <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked' : '').' name="missing_value_checkbox[]" id="missing_value_'.$mv_key.'" value="'.$mv_key.'" title="'.$mv_text.'""></input> ';
+ echo ' <label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+ }
+ echo ' </div>';
+
+ echo ' </div>';
+ echo '</div>';
}
- echo '</p>';
}
/**
@@ -2331,14 +2465,21 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$rowA = SurveyInfo::getInstance()->getSurveyRow();
- $display = ($row['enota'] == 3 ? '' : 'display: none;');
-
-
- echo '<div class="grid_subtitle" style="'.$display.'">';
-
- echo '<p><span class="title">'.$lang['srv_grid_subtitle1'].':</span><span class="content"><input type="text" size="23" name="grid_subtitle1" value="'.$row['grid_subtitle1'].'" /></span></p>';
- echo '<p><span class="title">'.$lang['srv_grid_subtitle2'].':</span><span class="content"><input type="text" size="23" name="grid_subtitle2" value="'.$row['grid_subtitle2'].'" /></span></p>';
-
+ $display = ($row['enota'] == 3 ? '' : ' style="display: none;"');
+
+
+ echo '<div class="vprasanje_setting_holder grid_subtitle" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_grid_subtitle1'].':</label>';
+ echo ' <span class="content"><input type="text" size="23" name="grid_subtitle1" value="'.$row['grid_subtitle1'].'" /></span>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_grid_subtitle2'].':</label>';
+ echo ' <span class="content"><input type="text" size="23" name="grid_subtitle2" value="'.$row['grid_subtitle2'].'" /></span>';
+ echo ' </div>';
+
echo '</div>';
}
@@ -2354,85 +2495,107 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- //Če gre za vizualno skalo ali slikovni tip potem opcij ne prikazujemo. Še vedno pa izpišemo, da delujejo če nekdo zamenja tip vprašanaj
- $displayNone = '';
- if(in_array($row['orientation'], [9,11]))
- $displayNone = 'style="display:none";';
+ // Hitro dodajanje kategorij
+ echo '<div class="vprasanje_setting_holder">';
- // Prednastavljene vrednosti odgovorov (dropdown)
- if ($row['tip'] == 1) {
+ echo ' <div class="vprasanje_setting_line with-icon">';
+
- echo '<p class="radio_defaults_class">';
- echo '<span class="title">'.$lang['srv_defaultGrid'].':</span>';
- echo '<span class="content"><select name="radio_defaults" id="radio_defaults" style="width:100px">';
- echo '<option value="0">'.$lang['s_without'].'</option>';
- foreach($default_grid_values AS $key => $value){
- echo '<option value="'.$key.'">'.$value['name'].'</option>';
- }
- echo '</select></span>';
- echo '</p>';
- }
+ if ( in_array($row['tip'], array(6, 16, 19, 20)) ){
+ echo '<span onclick="vrednost_fastadd(\''.$this->spremenljivka.'\'); return false;" class="pointer"><span class="faicon file-import"></span> ';
+ echo $lang['srv_question_fastadd'].'&nbsp;';
+ echo '</span>';
+
+ echo Help::display('srv_question_fastadd');
+ }
+ else{
+ echo '<span onclick="vrednost_fastadd(\''.$this->spremenljivka.'\'); return false;" class="pointer"><span class="faicon file-import"></span> ';
+ echo $lang['srv_vrednost_fastadd'].'&nbsp;';
+ echo '</span>';
+
+ echo Help::display('srv_vrednost_fastadd');
+ }
+
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // inline hitro dodajanje slik - zaenkrat samo radio in checkbox - v testiranju, zato samo za admine
+ if (in_array($row['tip'], array(1,2)) && $row['orientation'] == 1) {
+
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ $quickImage = ($spremenljivkaParams->get('quickImage') ? $spremenljivkaParams->get('quickImage') : 0);
+
+ echo '<div class="vprasanje_setting_holder">';
- // inline urejanje variabel vrednosti
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" value="0" name="quickImage" />';
+ echo ' <input type="checkbox" id="quickImage" name="quickImage" value="1" '.($quickImage == 1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="quickImage" class="title">'.$lang['srv_edit_quick_image'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+
+ // inline urejanje variabel vrednosti
if ( in_array($row['tip'], array(1,2,3))) {
$spremenljivkaParams = new enkaParameters($row['params']);
$grid_var = ($spremenljivkaParams->get('grid_var') ? $spremenljivkaParams->get('grid_var') : 0);
- echo '<p '.$displayNone.'><label for="grid_var" class="title">'.$lang['srv_edit_values'].':</label>';
- echo ' '.Help::display('srv_grid_var');
- echo '<span class="content">';
- echo '<span class="content"><input type="hidden" name="grid_var" value="0" />';
- echo '<input type="checkbox" id="grid_var" name="grid_var" value="1" '.($grid_var == 1 ? 'checked="checked"' : '').'></span></p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="grid_var" value="0" />';
+ echo ' <input type="checkbox" id="grid_var" name="grid_var" value="1" '.($grid_var == 1 ? 'checked="checked"' : '').'>';
+ echo ' <label for="grid_var" class="title">'.$lang['srv_edit_values'].' '.Help::display('srv_grid_var').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// Obratni vrstni red vrednosti
if($row['tip'] == 1 || $row['tip'] == 3){
$reverse_var = ($spremenljivkaParams->get('reverse_var') ? $spremenljivkaParams->get('reverse_var') : 0);
-
- echo '<p '.$displayNone.'><label for="reverse_var" class="title">'.$lang['srv_reverse_values'].':</label>';
- echo '<span class="content">';
- echo '<span class="content"><input type="hidden" name="reverse_var" value="0" />';
- echo '<input type="checkbox" '.($reverse_var == '1' ? ' checked="checked" ': '').' value="1" id="reverse_var" name="reverse_var"></span></p>';
+
+ // ODSTRANJENO - ostane samo tam, kjer je vklopljeno zaradi kompatibilnosti za nazaj
+ if($reverse_var == '1'){
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="reverse_var" value="0" />';
+ echo ' <input type="checkbox" '.($reverse_var == '1' ? ' checked="checked" ': '').' value="1" id="reverse_var" name="reverse_var">';
+ echo ' <label for="reverse_var" class="title">'.$lang['srv_reverse_values'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
- }
-
- // besedilo za vsoto
- if ($row['tip'] == 18) {
- //echo '<div style="width:60%; height: 1px; border-top: 1px black solid;"></div>';
+ }
- if($row['vsota'] == '')
- $vsotaText = $lang['srv_vsota_text'];
- else
- $vsotaText = $row['vsota'];
-
- // echo '<p id="vrednost_'.$row['id'].'" class="vrednost_vsota">';
- // echo '<textarea name="vsota">'.$vsotaText.'</textarea>';
- // echo '</p>';
- }
+ // Prednastavljene vrednosti odgovorov (dropdown)
+ if ($row['tip'] == 1) {
- echo '<p '.$displayNone.'><span onclick="vrednost_fastadd(\''.$this->spremenljivka.'\'); return false;" class="pointer"><span class="sprites paste_word"></span> ';
+ $this->edit_random();
- if ( in_array($row['tip'], array(6, 16, 19, 20)) )
- echo $lang['srv_question_fastadd'].' '.Help::display('srv_question_fastadd');
- else
- echo $lang['srv_vrednost_fastadd'].' '.Help::display('srv_vrednost_fastadd');
+ echo '<div class="vprasanje_setting_holder">';
- echo '</span></p>';
+ echo ' <div class="vprasanje_setting_line half-half radio_defaults_class">';
+ echo ' <label>'.$lang['srv_defaultGrid'].':</label>';
+ echo ' <span class="content"><select name="radio_defaults" id="radio_defaults">';
+ echo ' <option value="0">'.$lang['s_without'].'</option>';
+ foreach($default_grid_values AS $key => $value){
+ echo ' <option value="'.$key.'">'.$value['name'].'</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
-
- // inline hitro dodajanje slik - zaenkrat samo radio in checkbox - v testiranju, zato samo za admine
- if (in_array($row['tip'], array(1,2)) && $row['orientation'] == 1) {
-
- $spremenljivkaParams = new enkaParameters($row['params']);
- $quickImage = ($spremenljivkaParams->get('quickImage') ? $spremenljivkaParams->get('quickImage') : 0);
-
- echo '<p><label for="quickImage" class="title">'.$lang['srv_edit_quick_image'].':</label>';
- echo '<span class="content">';
- echo '<span class="content"><input type="hidden" value="0" name="quickImage" />';
- echo '<input type="checkbox" id="quickImage" name="quickImage" value="1" '.($quickImage == 1 ? ' checked="checked"' : '').'></span></p>';
- }
+ echo '</div>';
+ }
}
/**
@@ -2445,9 +2608,6 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
if ($row['tip'] <= 3) {
-
- //echo '<p class="vrednost_new">';
- echo '<p>';
//dodatne missing vrednosti (ne vem, zavrnil...)
# preberemo iz class.SurveyMissingValues
@@ -2461,27 +2621,29 @@ class Vprasanje {
while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
$already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov'];
}
- //echo '<span class="floatRight">';
+
+
if (count($missing_values) > 0) {
-
+
+ echo '<div id="missing_settings_holder">';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line inline">';
foreach ($missing_values AS $mv_key => $mv_text) {
- echo '<span class="floatLeft">';
- echo '<input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked); show_alert_missing();" id="missing_value_'.$mv_key.'">';
- echo '<label for="missing_value_'.$mv_key.'" class="pointer">'. $mv_text . '</label> ';
- //echo '<br/>';
- echo '</span>';
+ echo ' <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked);" id="missing_value_'.$mv_key.'">';
+ echo ' <label for="missing_value_'.$mv_key.'" class="pointer">'. $mv_text . '</label> ';
}
+ echo ' </div>';
+
+ echo '</div>';
+
+ // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
+ if ($row['tip'] <= 2)
+ $this->edit_alert_show_missing();
+
+ echo '</div>';
}
- //echo '</span>';
-
- echo '<span class="clr"></span>';
-
- //echo '</p></div>';
- echo '</p>';
-
- // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
- if ($row['tip'] <= 2)
- $this->edit_alert_show_missing();
}
}
@@ -2540,15 +2702,14 @@ class Vprasanje {
}
switch ($row['random']) {
- //case 0 : echo $lang['srv_random_off'];
- //break;
case 1 : echo ' '.$lang['srv_random_on'];
break;
+
case 2 : echo ' '.$lang['srv_sort_asc'];
break;
+
case 3 : echo ' '.$lang['srv_sort_desc'];
break;
-
}
}
@@ -2598,24 +2759,30 @@ class Vprasanje {
echo '<div class="popup_close"><a href="#" onClick="vrednost_cancel(); return false;">✕</a></div>';
echo '<h2>'.$lang['srv_kategorije_odgovorov_title'].'</h2>';
-
- echo '<div class="left-float"><span class="title">'.(in_array($rows['tip'], array(2,6,16,19,20))?$lang['srv_spremenljivka']:$lang['srv_vrednost']).':</span> <input type="text" name="vrednost_variable" value="'.$row['variable'].'" '.(in_array($rows['tip'], array(2,6,16,19,20)) ? ' onkeyup="vprasanje_check_variable(this);"' : '').'></div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.(in_array($rows['tip'], array(2,6,16,19,20))?$lang['srv_spremenljivka']:$lang['srv_vrednost']).':</span>';
+ echo '<input type="text" class="text large w200" name="vrednost_variable" value="'.$row['variable'].'" '.(in_array($rows['tip'], array(2,6,16,19,20)) ? ' onkeyup="vprasanje_check_variable(this);"' : '').'>';
+ echo '</div>';
// RAZVRSTI odgovore
- echo '<div class="left-float"><span class="title">'.$lang['sort'].':</span> ';
- echo '<select name="vrednost_random">';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['sort'].':</span>';
+
+ echo '<select class="dropdown large w200" name="vrednost_random">';
echo '<option value="0"'.($row['random']==0?' selected':'').'>'.$lang['srv_random_off2'].'</option>';
echo '<option value="1"'.($row['random']==1?' selected':'').'>'.$lang['srv_random_on2'].'</option>';
echo '<option value="2"'.($row['random']==2?' selected':'').'>'.$lang['srv_sort_asc2'].'</option>';
echo '<option value="3"'.($row['random']==3?' selected':'').'>'.$lang['srv_sort_desc2'].'</option>';
echo '</select>';
- echo '</div>';
+
+ echo '</div>';
- echo '<div style="clear:both;"></div>';
-
- echo '<div>'.$lang['srv_vprasanje_text'].' <span onmouseover="$(this).hide(); create_editor(\'vrednost_naslov\');" class="red pointer"> - '.$lang['srv_editor'].'</span>: <textarea id="vrednost_naslov" name="vrednost_naslov" style="width:99%">'.$row['naslov'].'</textarea></div>';
+ echo '<div><p class="bottom4">'.$lang['srv_vprasanje_text'].'<span onmouseover="$(this).hide(); create_editor(\'vrednost_naslov\');" class="pointer"> - '.$lang['srv_editor'].'</span>:</p>';
+
+ echo '<textarea class="top0" id="vrednost_naslov" name="vrednost_naslov" style="width:99%">'.$row['naslov'].'</textarea></div>';
- echo '<p>';
+ echo '<p class="top16">';
if ($row['if_id'] > 0) {
echo $lang['srv_podif_edit'].': ';
echo '<a href="#" onclick="vrednost_condition_editing(\''.$vrednost.'\'); return false;">';
@@ -2624,17 +2791,14 @@ class Vprasanje {
echo '</a>';
} else {
echo $lang['srv_podif_new'].': ';
- echo '<span class="faicon odg_if_not inline inline_if_not" onclick="vrednost_condition_editing(\''.$vrednost.'\'); return false;" title="'.$lang['srv_podif_edit'].'" style="cursor: pointer;"></span>';
+ echo '<span class="faicon odg_if_not inline inline_if_not blue pointer" onclick="vrednost_condition_editing(\''.$vrednost.'\'); return false;" title="'.$lang['srv_podif_edit'].'"></span>';
}
echo '</p>';
-
- echo '<span class="buttonwrapper spaceLeft floatRight">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="vrednost_save(\''.$vrednost.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
-
- echo '<span class="buttonwrapper spaceLeft floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
- echo '</span>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="vrednost_cancel(); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo ' <button class="medium blue" onclick="vrednost_save(\''.$vrednost.'\'); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
echo '</form>';
@@ -2687,19 +2851,19 @@ class Vprasanje {
$lang_id = $_POST['lang_id'];
$spr_id = $_POST['spr_id'];
- //$sql = sisplet_query("SELECT * FROM srv_vrednost WHERE id = '$vrednost'");
$sql = sisplet_query("SELECT id, tip, enota, params, orientation, design FROM srv_spremenljivka WHERE id = '$spr_id'");
$row = mysqli_fetch_array($sql);
$spremenljivkaParams = new enkaParameters($row['params']);
$hotspot_image = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
- //$rows = Cache::srv_spremenljivka($row['spr_id']);
if($row['tip'] == 1 || $row['tip'] == 2){
$enota_orientation = $row['orientation'];
- }else if($row['tip'] == 6){
+ }
+ else if($row['tip'] == 6){
$enota_orientation = $row['enota'];
- }else if($row['tip'] == 17){
+ }
+ else if($row['tip'] == 17){
$enota_orientation = $row['design'];
}
@@ -2712,24 +2876,22 @@ class Vprasanje {
//izris editorja s sliko
echo '<div><textarea id="hotspot_image" name="hotspot_image" style="width:99%">'.$hotspot_image.'</textarea></div>';
- //izris editorja s sliko - konec
echo '<br />';
-
- //gumb Potrdi
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="hotspot_image_save(\''.$row['id'].'\'); hotspot_image_resize(\''.$row['id'].'\'); show_hot_spot_settings_from_editor (\''.$row['id'].'\', \''.$enota_orientation.'\', \''.$row['tip'].'\'); hotspot_image_button_update(\''.$row['id'].'\', \''.$lang['srv_hot_spot_load_image'].'\', \''.$lang['srv_hot_spot_edit_image'].'\'); return false; "><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
- //gumb Potrdi - konec
+ //Gumba Potrdi in Zapri
+ echo '<div class="button_holder">';
+
+ //gumb Potrdi
+ echo '<button class="small white-blue" href="#" onclick="hotspot_image_save(\''.$row['id'].'\'); hotspot_image_resize(\''.$row['id'].'\'); show_hot_spot_settings_from_editor (\''.$row['id'].'\', \''.$enota_orientation.'\', \''.$row['tip'].'\'); hotspot_image_button_update(\''.$row['id'].'\', \''.$lang['srv_hot_spot_load_image'].'\', \''.$lang['srv_hot_spot_edit_image'].'\'); return false; "><span>'.$lang['srv_potrdi'].'</span></button>';
+
//gumb Zapri
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
- echo '</span>';
- //gumb Zapri - konec
+ echo '<button class="small blue" href="#" onclick="vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></button>'."\n\r";
+
+ echo '</div>';
+ //Gumba Potrdi in Zapri - konec
echo '</form>';
-
}
function hotspot_edit_regions () {
@@ -2749,23 +2911,20 @@ class Vprasanje {
$hotspot_image_height = $_POST['hotspot_image_height'];
$hotspot_image_width = $_POST['hotspot_image_width'];
$spr_id = $rows['id'];
- //$region_name = $_POST['region_name'];
- //echo $vrednost;
//poberi iz baze, kateri je zadnji vneseni indeks obmocja $last_hotspot_region_index
- //$sqlR = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id = $spr_id order by region_index DESC LIMIT 1");
$sqlR = sisplet_query("SELECT region_index FROM srv_hotspot_regions WHERE spr_id = $spr_id order by region_index DESC LIMIT 1");
- //$sqlR2 = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id = $spr_id AND vre_id = $vrednost");
$sqlR2 = sisplet_query("SELECT region_coords, region_name, region_index FROM srv_hotspot_regions WHERE spr_id = $spr_id AND vre_id = $vrednost");
- //$sqlR3 = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id= $spr_id ");
$sqlR3 = sisplet_query("SELECT region_coords, vre_id FROM srv_hotspot_regions WHERE spr_id= $spr_id ");
$rowR = mysqli_fetch_array($sqlR);
$rowR2 = mysqli_fetch_array($sqlR2);
+ $hotspot_image_coords = '';
if(mysqli_num_rows($sqlR) == 0){
$last_hotspot_region_index = -1;
- }else{
+ }
+ else{
$last_hotspot_region_index = $rowR['region_index'];
}
@@ -2773,105 +2932,94 @@ class Vprasanje {
$hotspot_image_coords = $rowR2['region_coords'];
$region_name = $rowR2['region_name'];
$hotspot_region_index = $rowR2['region_index'];
- }else{
+ }
+ else{
$region_name = "";
$hotspot_region_index = -2;
}
echo '<form name="hotspot_region_edit" onsubmit="hotspot_save_regions(); return false;">';
- //echo '$last_hotspot_region_index: '.$last_hotspot_region_index;
- //echo '$hotspot_region_index: '.$hotspot_region_index;
-
- echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
- echo '<input type="hidden" name="spremenljivka" value="'.$row['spr_id'].'">';
- echo '<input type="hidden" name="vrednost" value="'.$vrednost.'">';
- echo '<input type="hidden" name="lang_id" value="'.$lang_id.'">';
- echo '<div><p id="slika_'.$row['spr_id'].'" style="width:99%; display: none;">'.$row['naslov'].'</p></div>';
-
- echo '<div id="slika_'.$row['spr_id'].'_container" >';
+ echo '<input type="hidden" name="anketa" value="'.$this->anketa.'">';
+ echo '<input type="hidden" name="spremenljivka" value="'.$row['spr_id'].'">';
+ echo '<input type="hidden" name="vrednost" value="'.$vrednost.'">';
+ echo '<input type="hidden" name="lang_id" value="'.$lang_id.'">';
- //********* za prikazovanje obstojecih obmocij @ urejanju/dodajanju novega obmocja ********
+ echo '<div><p id="slika_'.$row['spr_id'].'" style="width:99%; display: none;">'.$row['naslov'].'</p></div>';
+
+ echo '<div id="slika_'.$row['spr_id'].'_container" >';
- $findme = 'img';
- $pos = strpos($hotspot_image, $findme);
- if($pos === false) { //string NOT present
-
- }
- else { //string present
- $usemap = 'id="hotspot_'.$row['id'].'_image" usemap="#hotspot_'.$row['id'].'_usemap" style="z-index: 1; height:'.$hotspot_image_height.'px; width: '.$hotspot_image_width.'px; position: relative; top: 15px;"'; //z-index: 1, da bo slika pod canvas in prave dimenzije in na pravi poziciji
- //v $hotspot_image je potrebno dodati usemap="#hotspot_image_'.$row['id'].'" za identificiranje mape
- $hotspot_image = substr_replace($hotspot_image, $usemap, 5, 0); //dodaj zeleni string v $hotspot_image
- }
-
- //prikaz slike
- echo $hotspot_image;
-
- //ureditev map
- if(mysqli_num_rows($sqlR3) != 0){ //ce je kaksno obmocje v bazi
- echo '<map id="hotspot_'.$row['id'].'_map" name="hotspot_'.$row['id'].'_usemap">';
- while ($rowR3 = mysqli_fetch_array($sqlR3)) {
- echo '<area coords="'.$rowR3['region_coords'].'" name="'.$rowR3['vre_id'].'" shape="poly" href="#">';
- }
- echo '</map>';
- }
-
- ?>
- <script>
- $(document).ready(function () {
- mapinit_editor(<?=$row['id']?>); //uredi delovanje imagemapster in prikazovanja obmocij ter tooltip-ov
- });
- </script>
- <?
-
- //********* za prikazovanje obstojecih obmocij @ urejanju/dodajanju novega obmocja - konec *********
-
- echo '<div style="clear:both;"></div>';
-
- echo '
- <script language="javascript" type="text/javascript" src="./script/jquery/jquery.canvasAreaDraw.js"></script>
- <textarea id="hotspot_region_coords_'.$row['spr_id'].'" style="display: none;" rows=3 name="hotspot_region_coords_'.$row['spr_id'].'" class="canvas-area" disabled
- placeholder="Shape Coordinates"
- data-image-url="'.$src_image.'" data-canvas-id="canvas_'.$row['spr_id'].'" data-spr-id="'.$row['spr_id'].'" image-height="'.$hotspot_image_height.'" image-width="'.$hotspot_image_width.'" image-coords="'.$hotspot_image_coords.'" clear_button="'.$lang['srv_hotspot_clear_region_points'].'"></textarea>
- ';
-
- echo '</div>';
+ //********* za prikazovanje obstojecih obmocij @ urejanju/dodajanju novega obmocja ********
- echo '<br />';
-
+ $findme = 'img';
+ $pos = strpos($hotspot_image, $findme);
+ if($pos === false) { //string NOT present
+
+ }
+ else { //string present
+ $usemap = 'id="hotspot_'.$row['id'].'_image" usemap="#hotspot_'.$row['id'].'_usemap" style="z-index: 1; height:'.$hotspot_image_height.'px; width: '.
+ $hotspot_image_width.'px; position: relative; top: 0px;"'; //z-index: 1, da bo slika pod canvas in prave dimenzije in na pravi poziciji
+ //$hotspot_image_width.'px; position: relative; top: 15px;"'; //z-index: 1, da bo slika pod canvas in prave dimenzije in na pravi poziciji
+ //v $hotspot_image je potrebno dodati usemap="#hotspot_image_'.$row['id'].'" za identificiranje mape
+ $hotspot_image = substr_replace($hotspot_image, $usemap, 5, 0); //dodaj zeleni string v $hotspot_image
+ }
+
+ // prikaz slike
+ echo $hotspot_image;
+
+ // ureditev map
+ if(mysqli_num_rows($sqlR3) != 0){ //ce je kaksno obmocje v bazi
+ echo '<map id="hotspot_'.$row['id'].'_map" name="hotspot_'.$row['id'].'_usemap">';
+ while ($rowR3 = mysqli_fetch_array($sqlR3)) {
+ echo '<area coords="'.$rowR3['region_coords'].'" name="'.$rowR3['vre_id'].'" shape="poly" href="#">';
+ }
+ echo '</map>';
+ }
+
+ ?>
+ <script>
+ $(document).ready(function () {
+ mapinit_editor(<?=$row['id']?>); //uredi delovanje imagemapster in prikazovanja obmocij ter tooltip-ov
+ });
+ </script>
+ <?
+
+ //********* za prikazovanje obstojecih obmocij @ urejanju/dodajanju novega obmocja - konec *********
- //polje za vnos imena obmocja
- echo '<span class="buttonwrapper spaceRight">';
- echo $lang['srv_hot_spot_region_name'].': ';
- echo '<input name="hotspot_region_name" value="'.$region_name.'">';
- echo '</span>';
- //polje za vnos imena obmocja - konec
-
- echo '<br />';
- echo '<br />';
-
+ echo '<div style="clear:both;"></div>';
+
+ echo '
+ <script language="javascript" type="text/javascript" src="./script/jquery/jquery.canvasAreaDraw.js"></script>
+ <textarea id="hotspot_region_coords_'.$row['spr_id'].'" style="display: none;" rows=3 name="hotspot_region_coords_'.$row['spr_id'].'" class="canvas-area" disabled
+ placeholder="Shape Coordinates"
+ data-image-url="'.$src_image.'" data-canvas-id="canvas_'.$row['spr_id'].'" data-spr-id="'.$row['spr_id'].'" image-height="'.$hotspot_image_height.'" image-width="'.$hotspot_image_width.'" image-coords="'.$hotspot_image_coords.'" clear_button="'.$lang['srv_hotspot_clear_region_points'].'"></textarea>
+ ';
+
+ echo '</div>';
- //gumb Potrdi
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="hotspot_save_regions('.$row['spr_id'].', '.$last_hotspot_region_index.', '.$vrednost.', '.$hotspot_region_index.'); return false; "><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
- //gumb Potrdi - konec
+ echo '<br />';
+
+ //polje za vnos imena obmocja
+ echo $lang['srv_hot_spot_region_name'].': ';
+ echo '<input name="hotspot_region_name" value="'.$region_name.'">';
+
+ //Gumba Potrdi in Zapri
+ echo '<div class="button_holder">';
+ // gumb Potrdi
+ echo '<button class="small white-blue" href="#" onclick="hotspot_save_regions('.$row['spr_id'].', '.$last_hotspot_region_index.', '.$vrednost.', '.$hotspot_region_index.'); return false; "><span>'.$lang['srv_potrdi'].'</span></button>';
- //gumb Zapri - konec
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="hotspot_region_cancel('.$row['spr_id'].', '.$vrednost.'); vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
- echo '</span>';
- //gumb Zapri - konec
+ // gumb Zapri - konec
+ echo '<button class="small blue" href="#" onclick="hotspot_region_cancel('.$row['spr_id'].', '.$vrednost.'); vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></button>'."\n\r";
+
+ echo '</div>';
+ //Gumba Potrdi in Zapri - konec
+
+ // tekst z navodili
+ echo '<br />'.$lang['srv_hotspot_edit_region_msg'];
+ echo '<div id="hotspot_tips_'.$row['spr_id'].'" style="display:none">'.$lang['srv_hotspot_edit_region_tip_delete'].' <br />'.$lang['srv_hotspot_edit_region_tip_move'].'</div>';
+ // tekst z navodili - konec
- //tekst z navodili
- echo '<br />';
- echo '<br />'.$lang['srv_hotspot_edit_region_msg'];
- echo '<div id="hotspot_tips_'.$row['spr_id'].'" style="display:none">'.$lang['srv_hotspot_edit_region_tip_delete'].' <br />
- '.$lang['srv_hotspot_edit_region_tip_move'].'</div>';
- //tekst z navodili - konec
-
-
echo '</form>';
}
@@ -2882,10 +3030,11 @@ class Vprasanje {
function vrednost_fastadd() {
global $lang;
- echo '<h2>'.$lang['srv_vrednost_fastadd'].'</h2>';
+ echo '<h2><span class="faicon blue flipX file-import"></span>'.$lang['srv_vrednost_fastadd'].'</h2>';
echo '<div class="popup_close"><a href="#" onClick="vrednost_cancel(); return false;">✕</a></div>';
+
echo '<form name="vrednost_fastadd_form" onsubmit="vrednost_fastadd_save(); return false;">';
echo '<input type="hidden" name="anketa" value="'.$this->anketa.'" />';
@@ -2894,77 +3043,73 @@ class Vprasanje {
echo '<p><textarea name="fastadd" style="width:99%; height:100px"></textarea></p>';
echo '<p>'.$lang['srv_vrednost_fastadd_txt'].'</p>';
-
- echo '<span class="buttonwrapper floatRight">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="vrednost_fastadd_save(\''.$this->spremenljivka.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
- echo '</span>';
-
- echo '<span class="buttonwrapper spaceRight floatRight">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
- echo '</span>';
-
+
echo '</form>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="vrednost_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
+ echo ' <button class="medium blue" onclick="vrednost_fastadd_save(\''.$this->spremenljivka.'\'); return false;"><span>'.$lang['srv_potrdi'].'</span></a>';
+ echo '</div>';
+
?><script> $('textarea[name=fastadd]').focus(); </script><?php
}
- //editiranje vrednosti pri besedilu
- function edit_vrednost_besedilo(){
+ // editiranje missing vrednosti pri besedilu, stevilu in datumu
+ function edit_vrednost_missing(){
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
-
- $taSize = ($spremenljivkaParams->get('taSize') ? $spremenljivkaParams->get('taSize') : 1);
- $taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1);
-
- //default sirina
- if($taWidth == -1)
- $taWidth = 30;
-
- echo '<input type="hidden" name="edit_vrednost_besedilo" value="1" />';
-
- # manjkajoče vrednosti
- //dodatne missing vrednosti (ne vem, zavrnil...)
- # preberemo iz class.SurveyMissingValues
+
+ # preberemo missing vrednosti iz class.SurveyMissingValues - kateri so na voljo v anketi
$smv = new SurveyMissingValues($this->anketa);
- # katere missinge imamo na voljo
$missing_values = $smv->GetUnsetValuesForSurvey();
- #kateri missingi so nastavljeni
+ # kateri missingi so nastavljeni
$already_set_mv = array();
$sql_grid_mv = sisplet_query("SELECT naslov, other FROM srv_vrednost WHERE spr_id='".$this->spremenljivka."' AND other != 0");
while ($row_grid_mv = mysqli_fetch_array($sql_grid_mv)) {
$already_set_mv[$row_grid_mv['other']] = $row_grid_mv['naslov'];
}
-
+
- echo '<p>';
+ if($row['tip'] == '7')
+ echo '<input type="hidden" name="edit_vrednost_number" value="1" />';
+ elseif($row['tip'] == '21')
+ echo '<input type="hidden" name="edit_vrednost_besedilo" value="1" />';
- if (count($missing_values) > 0) {
+
+ if (count($missing_values) > 0) {
+
+ echo '<div id="missing_settings_holder">';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line inline">';
foreach ($missing_values AS $mv_key => $mv_text) {
- echo '<input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked); show_alert_missing();" id="missing_value_'.$mv_key.'">';
- echo '<label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+ echo ' <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked);" id="missing_value_'.$mv_key.'">';
+ echo ' <label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
}
+ echo ' </div>';
+
+ echo '</div>';
+
+ // naknaden prikaz missinga ne vem ob opozorilu (samo ce imamo vklopljeno opozorilo in missing ne vem)
+ $this->edit_alert_show_missing();
+
+ echo '</div>';
}
- echo '</p>';
}
- //editiranje vrednosti pri number
+ // editiranje missing vrednosti pri number
function edit_vrednost_number(){
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
-
- $taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1);
- //default sirina
- if($taWidth == -1)
- $taWidth = 10;
-
- echo '<input type="hidden" name="edit_vrednost_number" value="1" />';
-
-
+
//dodatne missing vrednosti (ne vem, zavrnil...)
# preberemo iz class.SurveyMissingValues
$smv = new SurveyMissingValues($this->anketa);
@@ -2979,26 +3124,31 @@ class Vprasanje {
}
- echo '<p>';
+ echo '<input type="hidden" name="edit_vrednost_number" value="1" />';
if (count($missing_values) > 0) {
+
foreach ($missing_values AS $mv_key => $mv_text) {
- echo '<input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked); show_alert_missing();" id="missing_value_'.$mv_key.'">';
- echo '<label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked);" id="missing_value_'.$mv_key.'">';
+ echo ' <label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
}
- echo '</p>';
}
- //editiranje vrednosti pri datumu
+ // editiranje missing vrednosti pri datumu
function edit_vrednost_datum(){
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
-
- # manjkajoče vrednosti
-
+
//dodatne missing vrednosti (ne vem, zavrnil...)
# preberemo iz class.SurveyMissingValues
$smv = new SurveyMissingValues($this->anketa);
@@ -3013,16 +3163,19 @@ class Vprasanje {
}
- echo '<p>';
-
if (count($missing_values) > 0) {
foreach ($missing_values AS $mv_key => $mv_text) {
- echo '<input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked); show_alert_missing();" id="missing_value_'.$mv_key.'">';
- echo '<label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" '.(isset($already_set_mv[$mv_key]) ? ' checked="checked"' : '').' onChange="vrednost_new_dodatne(\'' . $row['id'] . '\', \''.$mv_key.'\', \''.$row['tip'].'\', this.checked);" id="missing_value_'.$mv_key.'">';
+ echo ' <label for="missing_value_'.$mv_key.'" class="pointer">'.$mv_text.'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
}
- echo '</p>';
-
}
function edit_grid_subtype(){
@@ -3031,69 +3184,100 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
$prikazi_vas_ali_slikovni_tip = 'show_custom_picture_radio(\''.$row['id'].'\', this.value);';
- echo '<p><span class="title">'.$lang['srv_orientacija'].':</span>';
- //echo '<span class="content"><select id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" name="enota" onChange="change_diferencial(\'' . $row['id'] . '\', this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_nastavitve_tabela_da_ne(\'' . $row['id'] . '\', this.value); max_diff_labels(\'' . $row['id'] . '\', this.value, \'' . $lang['srv_maxdiff_label1'] . '\',\'' . $lang['srv_maxdiff_label2'] . '\',\'' . $lang['srv_new_grid'] . '\'); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_drag_and_drop_new_look_option(\'' . $row['id'] . '\', this.value);">';
- echo '<span class="content"><select id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" name="enota" onChange="change_diferencial(\'' . $row['id'] . '\', this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_nastavitve_tabela_da_ne(\'' . $row['id'] . '\', this.value); max_diff_labels(\'' . $row['id'] . '\', this.value, \'' . $lang['srv_maxdiff_label1'] . '\',\'' . $lang['srv_maxdiff_label2'] . '\',\'' . $lang['srv_new_grid'] . '\'); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_drag_and_drop_new_look_option(\'' . $row['id'] . '\', this.value); '.$prikazi_vas_ali_slikovni_tip.'">';
-
- echo '<option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
- //te izbire niso mozne pri multicheckboxu
- if($row['tip'] == 6){
- echo '<option value="1" '.(($row['enota'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_diferencial2'].'</option>';
- echo '<option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_dropdown'].'</option>';
- echo '<option value="4" '.(($row['enota'] == 4) ? ' selected="true" ' : '').'>'.$lang['srv_one_against_another'].'</option>';
- echo '<option value="5" '.(($row['enota'] == 5) ? ' selected="true" ' : '').'>'.$lang['srv_max_diff'].'</option>';
- echo '<option value="8"' . ($row['enota'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_tabela_da_ne'].'</option>';
- //echo '<option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
- //echo '<option value="9"' . ($row['enota'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- echo '<option value="10"' . ($row['enota'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>';
- echo '<option value="11"' . ($row['enota'] == 11 ? ' selected="true"' : '') . '>'.$lang['srv_visual_analog_scale'].'</option>';
- echo '<option value="12"' . ($row['enota'] == 12 ? ' selected="true"' : '') . '>'.$lang['srv_custom-picture_radio'].'</option>';
- }
-
- # dvonji grid je na voljo samo za mgrid, dokler se ne uredi še za checkbox - CHECKBOX DELA VREDU?
- //if($row['tip'] == 6){
- echo '<option value="3" '.(($row['enota'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_double_grid'].'</option>';
- echo '<option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
- echo '<option value="9"' . ($row['enota'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- //}
- if ($admin_type == 0){
- //echo '<option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
- //echo '<option value="9"' . ($row['enota'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- if($row['tip'] == 6){
- //echo '<option value="10"' . ($row['enota'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>';
- }
- }
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_orientacija'].':</label>';
+
+ echo ' <span class="content"><select id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" name="enota"
+ onChange="changeGridAlign(\'' . $row['id'] . '\', this.value);
+ change_diferencial(\'' . $row['id'] . '\', this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');
+ show_nastavitve_tabela_da_ne(\'' . $row['id'] . '\', this.value);
+ max_diff_labels(\'' . $row['id'] . '\', this.value, \'' . $lang['srv_maxdiff_label1'] . '\',\'' . $lang['srv_maxdiff_label2'] . '\',\'' . $lang['srv_new_grid'] . '\');
+ show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');
+ show_drag_and_drop_new_look_option(\'' . $row['id'] . '\', this.value);'.$prikazi_vas_ali_slikovni_tip.'">';
+ echo ' <option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
+
+ //te izbire niso mozne pri multicheckboxu
+ if($row['tip'] == 6){
+ echo ' <option value="1" '.(($row['enota'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_diferencial2'].'</option>';
+ echo ' <option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_dropdown'].'</option>';
+ echo ' <option value="4" '.(($row['enota'] == 4) ? ' selected="true" ' : '').'>'.$lang['srv_one_against_another'].'</option>';
+ echo ' <option value="5" '.(($row['enota'] == 5) ? ' selected="true" ' : '').'>'.$lang['srv_max_diff'].'</option>';
+ echo ' <option value="8"' . ($row['enota'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_tabela_da_ne'].'</option>';
+ echo ' <option value="10"' . ($row['enota'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>';
+ echo ' <option value="11"' . ($row['enota'] == 11 ? ' selected="true"' : '') . '>'.$lang['srv_visual_analog_scale'].'</option>';
+ echo ' <option value="12"' . ($row['enota'] == 12 ? ' selected="true"' : '') . '>'.$lang['srv_custom-picture_radio'].'</option>';
+ }
+
+ # dvonji grid je na voljo samo za mgrid, dokler se ne uredi še za checkbox - CHECKBOX DELA VREDU?
+ echo ' <option value="3" '.(($row['enota'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_double_grid'].'</option>';
+ echo ' <option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
+ echo ' <option value="9"' . ($row['enota'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo ' </select>';
+ echo ' </div>';
+
+ echo '</div>';
}
+ // Prilagojen multigrid
function edit_grid_dynamic () {
global $lang;
+ global $site_url;
$row = Cache::srv_spremenljivka($this->spremenljivka);
+ $spremenljivkaParams = new enkaParameters($row['params']);
- // dinamicen multigrid
- if($row['tip'] == 6){
- echo '<p><label class="title">'.$lang['srv_dynamic_multigrid'].':</label>';
- echo '<span class="content"><input type="hidden" name="dynamic_mg" value="0" />';
+ echo '<div class="vprasanje_setting_holder">';
- echo '<select id="dynamic_mg" name="dynamic_mg" onChange="onchange_submit_show(this.value);">';
- echo '<option value="0" '.(($row['dynamic_mg'] == 0) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
- echo '<option value="1" '.(($row['dynamic_mg'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_horizontalna_3'].'</option>';
- echo '<option value="3" '.(($row['dynamic_mg'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_horizontalna_3'].'_2</option>';
- echo '<option value="5" '.(($row['dynamic_mg'] == 5) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_horizontalna_3'].'_3</option>';
- echo '<option value="2" '.(($row['dynamic_mg'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_vertikalna'].'</option>';
- echo '<option value="4" '.(($row['dynamic_mg'] == 4) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_vertikalna'].'_2</option>';
- echo '<option value="6" '.(($row['dynamic_mg'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_orientacija_vertikalna'].'_3</option>';
- echo '</select>';
-
- //echo '<input type="checkbox" id="dynamic_mg" name="dynamic_mg" value="1" '.($row['dynamic_mg'] == '1' ?' checked' : '').'></span>';
- echo '</span></p>';
- }
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+
+ echo ' <label>'.$lang['srv_table_settings_pc_table'].':</label>';
+
+ $pc_tables = $spremenljivkaParams->get('pc_tables','-1');
+
+ echo ' <span class="content">';
+ echo ' <select id="pc_tables" name="pc_tables" onChange="onchange_submit_show(this.value);">';
+ echo ' <option value="-1" '.(($pc_tables == -1) ? ' selected="true" ' : '').'>'.$lang['default'].'</option>';
+ echo ' <option value="0" '.(($pc_tables == 0) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_0'].'</option>';
+ echo ' <option value="1" '.(($pc_tables == 1) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_1'].'</option>';
+ echo ' <option value="2" '.(($pc_tables == 2) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_2'].'</option>';
+ echo ' <option value="3" '.(($pc_tables == 3) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_3'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+
+ echo ' </div>';
+
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+
+ echo ' <label>'.$lang['srv_table_settings_mobile_table'].':</label>';
+
+ $mobile_tables = $spremenljivkaParams->get('mobile_tables','-1');
+
+ echo ' <span class="content">';
+ echo ' <select id="mobile_tables" name="mobile_tables" onChange="onchange_submit_show(this.value);">';
+ echo ' <option value="-1" '.(($mobile_tables == -1) ? ' selected="true" ' : '').'>'.$lang['default'].'</option>';
+ echo ' <option value="0" '.(($mobile_tables == 0) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_0'].'</option>';
+ echo ' <option value="1" '.(($mobile_tables == 1) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_1'].'</option>';
+ echo ' <option value="2" '.(($mobile_tables == 2) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_2'].'</option>';
+ echo ' <option value="3" '.(($mobile_tables == 3) ? ' selected="true" ' : '').'>'.$lang['srv_settings_mobile_tables_3'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+
+ echo ' </div>';
+
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->anketa.'&a=table_settings">'.$lang['srv_table_settings_global'].'</a>';
+ echo ' </div>';
+
+
+ echo '</div>';
}
// nastavitev reminderja
@@ -3102,14 +3286,33 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_reminder'].':</span>';
- echo '<span class="content"><select name="reminder" id="reminder" onChange="show_alert_missing();">';
- echo '<option value="0" '.(($row['reminder'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_off'].'</option>';
- echo '<option value="1" '.(($row['reminder'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_soft'].'</option>';
- echo '<option value="2" '.(($row['reminder'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_hard'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ /* echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_reminder'].':</label>';
+ echo ' <span class="content"><select name="reminder" id="reminder" onChange="show_alert_missing();">';
+ echo ' <option value="0" '.(($row['reminder'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_off'].'</option>';
+ echo ' <option value="1" '.(($row['reminder'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_soft'].'</option>';
+ echo ' <option value="2" '.(($row['reminder'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_hard'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>'; */
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="reminder" value="0" />';
+ echo ' <input type="checkbox" id="reminder" name="reminder" value="1" '.(($row['reminder'] != 0) ? ' checked="checked" ' : '').' onClick="show_reminders(this.checked);" onChange="show_alert_missing(\''.$this->spremenljivka.'\');"/>';
+ echo ' <label for="reminder" class="title">'.$lang['srv_reminder'].Help::display('spremenljivka_reminder').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<div id="reminders" class="vprasanje_setting_holder half-half" '.($row['reminder'] > 0 ? '' : ' style="display:none;"').'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" name="reminder" id="reminder_1" value="1" '.(($row['reminder'] == 1) ? ' checked="checked" ' : '').'" /><label for="reminder_1">'.$lang['srv_reminder_soft'].'</label>';
+ echo ' <input type="radio" name="reminder" id="reminder_2" value="2" '.(($row['reminder'] == 2) ? ' checked="checked" ' : '').'" /><label for="reminder_2" style="margin-right:0px">'.$lang['srv_reminder_hard'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// Nastavitev za naknaden prikaz odgovora ne vem
@@ -3160,23 +3363,29 @@ class Vprasanje {
$show['99'] = false;
}
- echo '<div id="alert_show_missing">';
-
- // Prikaz -97 (neustrezno) ob opozorilu
- echo '<p><label for="alert_show_97" class="title"><span id="alert_show_97_text" class="'.($show['97']?'':' gray').'">'.$lang['srv_alert_show_missing_97'].':</span></label> '.Help::display('srv_alert_show_97');
- echo '<span class="content"><input type="hidden" name="alert_show_97" value="0" />';
- echo '<input type="checkbox" id="alert_show_97" name="alert_show_97" value="1" '.($row['alert_show_97']=='1'?' checked':'').' '.($show['97'] ? '' : ' disabled="disabled"').'></span>';
- echo '</p>';
+
+ echo '<div id="alert_show_missing" class="vprasanje_setting_holder">';
+
+ // Prikaz -97 (neustrezno) ob opozorilu
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="alert_show_97" value="0" />';
+ echo ' <input type="checkbox" id="alert_show_97" name="alert_show_97" value="1" '.($row['alert_show_97']=='1'?' checked':'').' '.($show['97'] ? '' : ' disabled="disabled"').'>';
+ echo ' <label for="alert_show_97" class="title"><span id="alert_show_97_text" class="'.($show['97']?'':' gray').'">'.$lang['srv_alert_show_missing_97'].'</span> '.Help::display('srv_alert_show_97').'</label>';
+ echo ' </div>';
+
// Prikaz -98 (Zavrnil) ob opozorilu
- echo '<p><label for="alert_show_98" class="title"><span id="alert_show_98_text" class="'.($show['98']?'':' gray').'">'.$lang['srv_alert_show_missing_98'].':</span></label> '.Help::display('srv_alert_show_98');
- echo '<span class="content"><input type="hidden" name="alert_show_98" value="0" />';
- echo '<input type="checkbox" id="alert_show_98" name="alert_show_98" value="1" '.($row['alert_show_98']=='1'?' checked':'').' '.($show['98'] ? '' : ' disabled="disabled"').'></span>';
- echo '</p>';
- // Prikaz -99 (ne vem) ob opozorilu
- echo '<p><label for="alert_show_99" class="title"><span id="alert_show_99_text" class="'.($show['99']?'':' gray').'">'.$lang['srv_alert_show_missing'].':</span></label> '.Help::display('srv_alert_show_99');
- echo '<span class="content"><input type="hidden" name="alert_show_99" value="0" />';
- echo '<input type="checkbox" id="alert_show_99" name="alert_show_99" value="1" '.($row['alert_show_99']=='1'?' checked':'').' '.($show['99'] ? '' : ' disabled="disabled"').'></span>';
- echo '</p>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="hidden" name="alert_show_98" value="0" />';
+ echo ' <input type="checkbox" id="alert_show_98" name="alert_show_98" value="1" '.($row['alert_show_98']=='1'?' checked':'').' '.($show['98'] ? '' : ' disabled="disabled"').'>';
+ echo ' <label for="alert_show_98" class="title"><span id="alert_show_98_text" class="'.($show['98']?'':' gray').'">'.$lang['srv_alert_show_missing_98'].'</span> '.Help::display('srv_alert_show_98').'</label>';
+ echo ' </div>';
+
+ // Prikaz -99 (ne vem) ob opozorilu
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="hidden" name="alert_show_99" value="0" />';
+ echo ' <input type="checkbox" id="alert_show_99" name="alert_show_99" value="1" '.($row['alert_show_99']=='1'?' checked':'').' '.($show['99'] ? '' : ' disabled="disabled"').'>';
+ echo ' <label for="alert_show_99" class="title"><span id="alert_show_99_text" class="'.($show['99']?'':' gray').'">'.$lang['srv_alert_show_missing_99'].'</span> '.Help::display('srv_alert_show_99').'</label>';
+ echo ' </div>';
echo '</div>';
}
@@ -3193,20 +3402,19 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
-
- if ( in_array($row['tip'], array(6, 16, 19, 20)) )
- echo '<span class="title">'.$lang['srv_sort_grid'].': </span>';
- else
- echo '<span class="title">'.$lang['srv_sort'].': </span>';
-
- echo '<span class="content"><select name="random">';
- echo '<option value="0" '.(($row['random'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_random_off2'].'</option>';
- echo '<option value="1" '.(($row['random'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_random_on2'].'</option>';
- echo '<option value="2" '.(($row['random'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_sort_asc2'].'</option>';
- echo '<option value="3" '.(($row['random'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_sort_desc2'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.(in_array($row['tip'], array(6, 16, 19, 20)) ? $lang['srv_sort_grid'] : $lang['srv_sort_answers']).': </label>';
+ echo ' <span class="content"><select name="random">';
+ echo ' <option value="0" '.(($row['random'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_random_off2'].'</option>';
+ echo ' <option value="1" '.(($row['random'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_random_on2'].'</option>';
+ echo ' <option value="2" '.(($row['random'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_sort_asc2'].'</option>';
+ echo ' <option value="3" '.(($row['random'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_sort_desc2'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev stevila stolpcev v prikazu
@@ -3221,16 +3429,20 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$stolpci = ($spremenljivkaParams->get('stolpci') ? $spremenljivkaParams->get('stolpci') : 1);
- echo '<p><span class="title">'.$lang['srv_stolpci'].': </span>';
- echo '<span class="content"><select name="stolpci">';
- echo '<option value="1" '.(($stolpci == 1) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
- echo '<option value="2" '.(($stolpci == 2) ? ' selected="true" ' : '').'>2</option>';
- echo '<option value="3" '.(($stolpci == 3) ? ' selected="true" ' : '').'>3</option>';
- echo '<option value="4" '.(($stolpci == 4) ? ' selected="true" ' : '').'>4</option>';
- echo '<option value="5" '.(($stolpci == 5) ? ' selected="true" ' : '').'>5</option>';
- echo '</select></span>';
- echo '</p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_stolpci'].': </label>';
+ echo ' <span class="content"><select name="stolpci">';
+ echo ' <option value="1" '.(($stolpci == 1) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
+ echo ' <option value="2" '.(($stolpci == 2) ? ' selected="true" ' : '').'>2</option>';
+ echo ' <option value="3" '.(($stolpci == 3) ? ' selected="true" ' : '').'>3</option>';
+ echo ' <option value="4" '.(($stolpci == 4) ? ' selected="true" ' : '').'>4</option>';
+ echo ' <option value="5" '.(($stolpci == 5) ? ' selected="true" ' : '').'>5</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev skale
@@ -3239,23 +3451,14 @@ class Vprasanje {
$value = Common::getSpremenljivkaSkala($this->spremenljivka);
$row = Cache::srv_spremenljivka($this->spremenljivka);
- # v bazi je privzeto -1
- # skala - 1 Nominalna
- # skala - 0 Ordinalna - računamo povprečja
- //$display = (($row['tip'] == 6 && $row['enota'] == 8)) ? ' style="display:none;"' : '';
-
- //echo '<fieldset '.$display.'><legend>'.$lang['srv_measurment_scale'].' '.Help::display('srv_skala_edit').'</legend>';
- echo '<fieldset><legend>'.$lang['srv_measurment_scale'].' '.Help::display('srv_skala_edit').'</legend>';
-
- echo '<p>';
- echo '<input type="radio" name="skala" id="skala_0" value="0" '.(($value == 0 || $value == -1) ? ' checked="checked" ' : '').' onClick="show_scale_text(0)" /><label for="skala_0" class="spaceRight">'.$lang['srv_skala_0'].'</label>';
- echo '<input type="radio" name="skala" id="skala_1" value="1" '.(($value == 1) ? ' checked="checked" ' : '').' onClick="show_scale_text(1)" /><label for="skala_1">'.$lang['srv_skala_1'].'</label>';
- echo '</p>';
- echo '<span id="skala_text_ord" class="spaceLeft" '.($value==0 || $value == -1 ? '' : ' style="display:none;"').'>'.$lang['srv_measurment_scale_ord'].' '.Help::display('srv_skala_text_ord').'</span>';
- echo '<span id="skala_text_nom" class="spaceLeft" '.($value==1 ? '' : ' style="display:none;"').'>'.$lang['srv_measurment_scale_nom'].' '.Help::display('srv_skala_text_nom').'</span>';
-
- echo '</fieldset>';
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="skala" value="1">';
+ echo ' <input type="checkbox" id="_skala" name="skala" value="0" '.(($value == '1') ? '' : ' checked="checked" ').'>';
+ echo ' <label for="_skala" class="title">'.$lang['srv_measurment_scale_ord2'].' '.Help::display('srv_skala_edit').'</label>';
+ echo ' </div>';
+ echo '</div>';
}
// prikaz checkboxa
@@ -3264,16 +3467,18 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<label for="checkboxhide" class="title">'.$lang['srv_checkboxhide_enabled'].':</label>';
- //echo '<input type="radio" name="checkboxhide" value="1" '.(($row['checkboxhide'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'];
- //echo '<input type="radio" name="checkboxhide" value="0" '.(($row['checkboxhide'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'];
- echo '<span class="content"><input type="hidden" name="checkboxhide" value="1" />';
- echo '<input type="checkbox" id="checkboxhide" name="checkboxhide" value="0" '.(($row['checkboxhide'] == 0) ? ' checked="checked" ' : '').' />';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="checkboxhide" value="1" />';
+ echo ' <input type="checkbox" id="checkboxhide" name="checkboxhide" value="0" '.(($row['checkboxhide'] == 0) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="checkboxhide">'.$lang['srv_checkboxhide_enabled'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
- //bivsa edit_checkbox_limit()
+ // bivsa edit_checkbox_limit()
function edit_checkbox_max_limit() {
global $lang;
@@ -3285,15 +3490,19 @@ class Vprasanje {
$sqlc = sisplet_query("SELECT COUNT(*) AS count FROM srv_vrednost WHERE spr_id='$this->spremenljivka'");
$rowc = mysqli_fetch_array($sqlc);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_checkbox_max_limit'].':</span>';
- echo '<span class="content"><select name="checkbox_limit" id="checkbox_limit_'.$this->spremenljivka.'" onChange="checkCheckboxLimits(\'' . $row['id'] . '\', $(this).val(), \'checkbox_limit\');">';
- echo '<option value="0" '.(($checkbox_limit == 0) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_checkbox_max_limit'].':</label>';
+ echo ' <span class="content"><select name="checkbox_limit" id="checkbox_limit_'.$this->spremenljivka.'" onChange="checkCheckboxLimits(\'' . $row['id'] . '\', $(this).val(), \'checkbox_limit\');">';
+ echo ' <option value="0" '.(($checkbox_limit == 0) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
for ($i=1; $i<=$rowc['count']; $i++) {
- echo '<option value="'.$i.'" '.(($checkbox_limit == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
+ echo ' <option value="'.$i.'" '.(($checkbox_limit == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
@@ -3307,18 +3516,21 @@ class Vprasanje {
$sqlc = sisplet_query("SELECT COUNT(*) AS count FROM srv_vrednost WHERE spr_id='$this->spremenljivka'");
$rowc = mysqli_fetch_array($sqlc);
- //$maxNumberOfAnswers = $rowc['count'] - 1;
$maxNumberOfAnswers = $rowc['count'];
- echo '<p>';
- echo '<span class="title">'.$lang['srv_checkbox_min_limit'].':</span>';
- echo '<span class="content"><select name="checkbox_min_limit" id="checkbox_min_limit_'.$this->spremenljivka.'" onChange="checkCheckboxLimits(\'' . $row['id'] . '\', $(this).val(), \'checkbox_min_limit\'); toggleCheckboxMinLimitReminder(\'' . $row['id'] . '\', $(this).val());">';
- echo '<option value="0" '.(($checkbox_min_limit == 0) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_checkbox_min_limit'].':</label>';
+ echo ' <span class="content"><select name="checkbox_min_limit" id="checkbox_min_limit_'.$this->spremenljivka.'" onChange="checkCheckboxLimits(\'' . $row['id'] . '\', $(this).val(), \'checkbox_min_limit\'); toggleCheckboxMinLimitReminder(\'' . $row['id'] . '\', $(this).val());">';
+ echo ' <option value="0" '.(($checkbox_min_limit == 0) ? ' selected="true" ' : '').'>'.$lang['no'].'</option>';
for ($i=1; $i<=$maxNumberOfAnswers; $i++) {
- echo '<option value="'.$i.'" '.(($checkbox_min_limit == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
+ echo ' <option value="'.$i.'" '.(($checkbox_min_limit == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
$this->edit_reminder_min_checkbox($checkbox_min_limit);
}
@@ -3331,21 +3543,20 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$checkbox_min_limit_reminder = ($spremenljivkaParams->get('checkbox_min_limit_reminder') ? $spremenljivkaParams->get('checkbox_min_limit_reminder') : 0);
- if($checkbox_min_limit){
- $displayReminder = " ";
- }else{
- $displayReminder = "none";
- }
+ $displayReminder = ($checkbox_min_limit) ? '' : 'style="display:none"';
- echo '<p id="checkboxLimitReminder_'.$row['id'].'" style="display:'.$displayReminder.'">';
- echo '<span class="title">'.$lang['srv_checkbox_min_limit_reminder'].':</span>';
- //echo '<span class="content"><select name="reminder" id="reminder" onChange="show_alert_missing();">';
- echo '<span class="content"><select name="checkbox_min_limit_reminder" id="checkbox_min_limit_reminder">';
- echo '<option value="0" '.(($checkbox_min_limit_reminder == 0) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_off2'].'</option>';
- echo '<option value="1" '.(($checkbox_min_limit_reminder == 1) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_soft2'].'</option>';
- echo '<option value="2" '.(($checkbox_min_limit_reminder == 2) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_hard2'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div id="checkboxLimitReminder_'.$row['id'].'" class="vprasanje_setting_holder" '.$displayReminder.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_checkbox_min_limit_reminder'].':</label>';
+ echo ' <span class="content"><select name="checkbox_min_limit_reminder" id="checkbox_min_limit_reminder">';
+ echo ' <option value="0" '.(($checkbox_min_limit_reminder == 0) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_off2'].'</option>';
+ echo ' <option value="1" '.(($checkbox_min_limit_reminder == 1) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_soft2'].'</option>';
+ echo ' <option value="2" '.(($checkbox_min_limit_reminder == 2) ? ' selected="true" ' : '').'>'.$lang['srv_reminder_hard2'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// editiranje radio tipa (1) - navaden, horizontalen, dropdown, semanticni diferencial
@@ -3355,22 +3566,29 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title" >'.$lang['srv_orientacija'].': </span>';
- echo '<span class="content"><select name="orientation" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="getOrientation(this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_custom_picture_radio(\''.$row['id'].'\', this.value); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
- echo '<option value="1"' . ($row['orientation'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
- echo '<option value="7"' . ($row['orientation'] == 7 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna_2'].'</option>';
- echo '<option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
- echo '<option value="2"' . ($row['orientation'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
- echo '<option value="4"' . ($row['tip'] == 3 ? ' selected="true"' : '') . '>'.$lang['srv_dropdown'].'</option>';
- echo '<option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_select-box_radio'].'</option>';
- echo '<option value="8"' . ($row['orientation'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- echo '<option value="9"' . ($row['orientation'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_custom-picture_radio'].'</option>'; // Custom picture za radio tip
- echo '<option value="10"' . ($row['orientation'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>'; //image hotspot
- echo '<option value="11"' . ($row['orientation'] == 11 ? ' selected="true"' : '') . '>'.$lang['srv_visual_analog_scale'].'</option>'; //vizualna analaogna skala - smeški
- echo '<option value="5"' . ($row['hidden_default'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_potrditev'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+
+ echo ' <label>'.$lang['srv_orientacija'].': </label>';
+
+ echo ' <span class="content"><select name="orientation" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="getOrientation(this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_custom_picture_radio(\''.$row['id'].'\', this.value); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
+ echo ' <option value="1"' . ($row['orientation'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
+ echo ' <option value="7"' . ($row['orientation'] == 7 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna_2'].'</option>';
+ echo ' <option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
+ echo ' <option value="2"' . ($row['orientation'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
+ echo ' <option value="4"' . ($row['tip'] == 3 ? ' selected="true"' : '') . '>'.$lang['srv_dropdown'].'</option>';
+ echo ' <option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_select-box_radio'].'</option>';
+ echo ' <option value="8"' . ($row['orientation'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
+ echo ' <option value="9"' . ($row['orientation'] == 9 ? ' selected="true"' : '') . '>'.$lang['srv_custom-picture_radio'].'</option>'; // Custom picture za radio tip
+ echo ' <option value="10"' . ($row['orientation'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>'; //image hotspot
+ echo ' <option value="11"' . ($row['orientation'] == 11 ? ' selected="true"' : '') . '>'.$lang['srv_visual_analog_scale'].'</option>'; //vizualna analaogna skala - smeški
+ echo ' <option value="5"' . ($row['hidden_default'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_potrditev'].'</option>';
+ echo ' </select></span>';
+
+ echo ' </div>';
+
+ echo '</div>';
}
// editiranje orientacije chackboxa
@@ -3380,24 +3598,26 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_orientacija'].':</span>';
- //echo '<span class="content"><select name="orientation" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="getOrientation(this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value);">';
- echo '<span class="content"><select name="orientation" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="getOrientation(this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
- echo '<option value="1"' . ($row['orientation'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
- echo '<option value="7"' . ($row['orientation'] == 7 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna_2'].'</option>';
- echo '<option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
- echo '<option value="2"' . ($row['orientation'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
- echo '<option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_select-box_check'].'</option>';
- echo '<option value="8"' . ($row['orientation'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
- echo '<option value="10"' . ($row['orientation'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>'; //image hotspot
- if ($admin_type == 0){
- //echo '<option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_select-box_check'].'</option>';
+ echo '<div class="vprasanje_setting_holder">';
- }
- //echo '<option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_mutliselect-box'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo ' <div class="vprasanje_setting_line right-190">';
+
+ echo ' <label>'.$lang['srv_orientacija'].':</label>';
+
+ echo ' <span class="content"><select name="orientation" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="getOrientation(this.value); show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_preset_value(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\'); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
+ echo ' <option value="1"' . ($row['orientation'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna'].'</option>';
+ echo ' <option value="7"' . ($row['orientation'] == 7 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_vertikalna_2'].'</option>';
+ echo ' <option value="0"' . ($row['orientation'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna'].'</option>';
+ echo ' <option value="2"' . ($row['orientation'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_orientacija_horizontalna_2'].'</option>';
+ echo ' <option value="6"' . ($row['orientation'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_select-box_check'].'</option>';
+ echo ' <option value="8"' . ($row['orientation'] == 8 ? ' selected="true"' : '') . '>'.$lang['srv_drag_drop'].'</option>';
+ echo ' <option value="10"' . ($row['orientation'] == 10 ? ' selected="true"' : '') . '>'.$lang['srv_hot_spot'].'</option>'; //image hotspot
+ echo ' </select>';
+ echo ' </span>';
+
+ echo ' </div>';
+
+ echo '</div>';
}
// navaden number ali slider
@@ -3406,20 +3626,18 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_number_insert'].':</span>';
- // //echo '<span class="content"><select name="ranking_k" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" class="no_submit" onchange="change_subtype_number(\''.$row['id'].'\');">';
- // echo '<span class="content"><select name="ranking_k" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" class="no_submit" onchange="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)">';
- // echo '<option value="0"' . ($row['ranking_k'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_0'].'</option>';
- // echo '<option value="1"' . ($row['ranking_k'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_1'].'</option>';
- // echo '</select>';
- //echo '<p>';
- echo '<span class="content">';
- echo '<input type="radio" name="ranking_k" id="select_num_0" value="0" '.(($row['ranking_k'] == 0) ? ' checked="checked" ' : '').' onClick="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)" /><label for="select_num_0">'.$lang['srv_number_insert_0_new'].'</label>';
- echo '<input type="radio" name="ranking_k" id="select_num_1" value="1" '.(($row['ranking_k'] == 1) ? ' checked="checked" ' : '').' onClick="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)"/><label for="select_num_1">'.$lang['srv_number_insert_1'].'</label>';
+ echo '<div class="vprasanje_setting_holder">';
- //echo '</p>';
- echo '</span></p>';
+ echo ' <div class="vprasanje_setting_line inline">';
+ echo ' <label>'.$lang['srv_number_insert'].':</label>';
+
+ echo ' <span class="content">';
+ echo ' <input type="radio" name="ranking_k" id="select_num_0" value="0" '.(($row['ranking_k'] == 0) ? ' checked="checked" ' : '').' onClick="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)" /><label for="select_num_0">'.$lang['srv_number_insert_0_new'].'</label>';
+ echo ' <input type="radio" name="ranking_k" id="select_num_1" value="1" '.(($row['ranking_k'] == 1) ? ' checked="checked" ' : '').' onClick="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)"/><label for="select_num_1">'.$lang['srv_number_insert_1'].'</label>';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// navaden number ali slider
@@ -3428,23 +3646,18 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_number_insert'].':</span>';
- // echo '<span class="content"><select name="ranking_k" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" class="no_submit" onchange="change_subtype_number(\''.$row['id'].'\');">';
- // echo '<option value="0"' . ($row['ranking_k'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_0'].'</option>';
- // echo '<option value="1"' . ($row['ranking_k'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_1'].'</option>';
- // echo '<option value="2"' . ($row['ranking_k'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_2'].'</option>';
- // echo '<option value="3"' . ($row['ranking_k'] == 3 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_3'].'</option>';
- // echo '<option value="4"' . ($row['ranking_k'] == 4 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_4'].'</option>';
- // echo '<option value="5"' . ($row['ranking_k'] == 5 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_5'].'</option>';
- // echo '<option value="6"' . ($row['ranking_k'] == 6 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_6'].'</option>';
- //echo '<option value="7"' . ($row['ranking_k'] == 7 ? ' selected="true"' : '') . '>'.$lang['srv_number_insert_7'].'</option>';
- //echo '</select>';
- //echo '</span></p>';
- echo '<input type="radio" name="ranking_k" value="0" '.(($row['ranking_k'] == 0) ? ' checked="checked" ' : '').' onChange="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)" /><label for="skala_0" class="spaceRight">'.$lang['srv_number_insert_0_new'].'</label>';
- echo '<input type="radio" name="ranking_k" value="1" '.(($row['ranking_k'] == 1) ? ' checked="checked" ' : '').' onChange="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)"/><label for="skala_1">'.$lang['srv_number_insert_1'].'</label>';
- echo '</p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_number_insert'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" name="ranking_k" id="select_num_0" value="0" '.(($row['ranking_k'] == 0) ? ' checked="checked" ' : '').' onChange="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)" /><label for="select_num_0" class="spaceRight">'.$lang['srv_number_insert_0_new'].'</label>';
+ echo ' <input type="radio" name="ranking_k" id="select_num_1" value="1" '.(($row['ranking_k'] == 1) ? ' checked="checked" ' : '').' onChange="change_subtype_number(\''.$row['id'].'\'); show_slider_prop(\''.$row['id'].'\',this.value)"/><label for="select_num_1">'.$lang['srv_number_insert_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// prikaz statistike
@@ -3453,13 +3666,15 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<label for="stat" class="title">'.$lang['srv_stat_on'].': '.Help::display('srv_statistika').'</label>';
- //echo '<span class="content"><input type="radio" name="stat" value="0" '.(($row['stat'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'];
- //echo '<input type="radio" name="stat" value="1" '.(($row['stat'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'];
- echo '<span class="content"><input type="hidden" name="stat" value="0" />';
- echo '<input type="checkbox" id="stat" name="stat" value="1" '.(($row['stat'] == 1) ? ' checked="checked" ' : '').' />';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="stat" value="0" />';
+ echo ' <input type="checkbox" id="stat" name="stat" value="1" '.(($row['stat'] == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="stat">'.$lang['srv_stat_show'].' '.Help::display('srv_statistika').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// upload pri tekstovnem polju
@@ -3474,15 +3689,18 @@ class Vprasanje {
$disabled = ($row['signature']==1 || $captcha==1 || $emailVerify==1) ? ' disabled="disabled"' : '';
- echo '<p>';
- echo '<span class="title">'.$lang['srv_vprasanje_upload_type'].':</span>';
-
- //novo, dropdown s fotografijami onChange="change_upload(\'' . $row['id'] . '\', this.value);"
- echo '<span class="content"><select name="upload" id="spremenljivka_upload_' . $row['id'] . '" spr_id="'.$row['id'].'" '.$disabled.' onChange="textSubtypeToggle(\'upload\', this.value);">';
- echo ' <option value="0" '.(($row['upload'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_no'].'</option>';
- echo ' <option value="1" '.(($row['upload'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_yes'].'</option>';
- echo ' <option value="2" '.(($row['upload'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_fotografija'].'</option></select>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_upload_type'].':</label>';
+ echo ' <span class="content"><select name="upload" id="spremenljivka_upload_' . $row['id'] . '" spr_id="'.$row['id'].'" '.$disabled.' onChange="textSubtypeToggle(\'upload\', this.value);">';
+ echo ' <option value="0" '.(($row['upload'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_no'].'</option>';
+ echo ' <option value="1" '.(($row['upload'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_yes'].'</option>';
+ echo ' <option value="2" '.(($row['upload'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_upload_fotografija'].'</option></select>';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// podpis pri tekstovnem polju
@@ -3502,16 +3720,20 @@ class Vprasanje {
$emailVerify = ($spremenljivkaParams->get('emailVerify') ? $spremenljivkaParams->get('emailVerify') : 0);
$disabled = ($row['upload']>0 || $captcha==1 || $emailVerify==1) ? ' disabled="disabled"' : '';
-
- echo '<p>';
- echo '<span class="title">'.$lang['srv_tip_standard_996'].':</span>';
-
- echo '<span class="content">';
- echo '<input type="radio" id="signature_'.$this->spremenljivka.'_0" name="signature" '.$disabled.' onclick="signatureProp('.$this->spremenljivka.'); textSubtypeToggle(\'signature\', this.value);" value="0" '.(($row['signature'] == 0) ? ' checked="checked" ' : '').' /><label for="signature_'.$this->spremenljivka.'_0">'.$lang['no1'].'</label>';
- echo '<input type="radio" id="signature_'.$this->spremenljivka.'" name="signature" '.$disabled.' onclick="signatureProp('.$this->spremenljivka.'); textSubtypeToggle(\'signature\', this.value);" value="1" '.(($row['signature'] == 1) ? ' checked="checked" ' : '').' /><label for="signature_'.$this->spremenljivka.'">'.$lang['yes'].'</label>';
- echo '</span>';
-
- echo '</p>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_tip_standard_996'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" id="signature_'.$this->spremenljivka.'_0" name="signature" '.$disabled.' onclick="signatureProp('.$this->spremenljivka.'); textSubtypeToggle(\'signature\', this.value);" value="0" '.(($row['signature'] == 0) ? ' checked="checked" ' : '').' /><label for="signature_'.$this->spremenljivka.'_0">'.$lang['no1'].'</label>';
+ echo ' <input type="radio" id="signature_'.$this->spremenljivka.'" name="signature" '.$disabled.' onclick="signatureProp('.$this->spremenljivka.'); textSubtypeToggle(\'signature\', this.value);" value="1" '.(($row['signature'] == 1) ? ' checked="checked" ' : '').' /><label for="signature_'.$this->spremenljivka.'">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev timerja
@@ -3520,15 +3742,24 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<label for="_timer" class="title">Timer:</label>';
- echo '<span class="content"><input type="hidden" name="timer" value="0" />';
- echo '<input type="checkbox" id="_timer" name="timer" value="1" '.(($row['timer'] > 0) ? ' checked="checked" ' : '').' onchange="show_timer(this.value);" />';
- echo '</span></p>';
- echo '<p id="timer" '.(($row['timer'] == 0) ? 'style="display: none;"' : '').'>';
- echo '<span class="title">&nbsp;</span><span class="content">';
- echo '<select name="timer2">';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="hidden" name="timer" value="0" />';
+ echo ' <input type="checkbox" id="_timer" name="timer" value="1" '.(($row['timer'] > 0) ? ' checked="checked" ' : '').' onchange="show_timer(this.value);" />';
+ echo ' <label for="_timer" class="title">'.$lang['srv_timer'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div id="timer" class="vprasanje_setting_holder" '.(($row['timer'] == 0) ? 'style="display: none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label></label>';
+
+ echo ' <span class="content"><select name="timer2">';
# od 1-15 mamo za vsako sekundo
for ($t = 1; $t <= 15; $t += 1){
@@ -3557,9 +3788,11 @@ class Vprasanje {
echo (bcmod($t, 60)) . $lang['srv_seconds'] . '';
echo '</option>';
}
+ echo ' </select></span>';
- echo '</select></span>';
- echo '</p>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev celih in decimalnih mest (number, multinumber, vsota)
@@ -3568,24 +3801,33 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<fieldset><legend>'.$lang['srv_num_limits'].'</legend>';
- echo '<p><span class="title">';
-
- echo $lang['srv_cela'].':</span><span class="content">';
- echo '<select name="cela">';
- for ($i = 1; $i <= 10; $i++)
- echo '<option value="' . $i . '"' . ($row['cela'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
- echo '</select></span>';
- echo '</p><p>';
- echo '<span class="title">'.$lang['srv_decimalna'].':</span><span class="content">';
- echo '<select name="decimalna">';
- for ($i = 0; $i <= 10; $i++)
- echo '<option value="' . $i . '"' . ($row['decimalna'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
- echo '</select></span>';
-
- echo '</p>';
- echo '</fieldset>';
-
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_cela'].':</label>';
+ echo ' <span class="content"><select name="cela">';
+ for ($i = 1; $i <= 10; $i++){
+ echo ' <option value="' . $i . '"' . ($row['cela'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_decimalna'].':</label>';
+ echo ' <span class="content"><select name="decimalna">';
+ for ($i = 0; $i <= 10; $i++){
+ echo ' <option value="' . $i . '"' . ($row['decimalna'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev za obliko generatorja imen
@@ -3595,15 +3837,21 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
// Design generatorja
- echo '<p><label class="title">'.$lang['srv_design'].':</label>';
- echo '<span class="content"><input type="hidden" name="sn_design" value="0" />';
- echo '<select id="spremenljivka_podtip_' . $row['id'] . '" name="sn_design" spr_id="'.$row['id'].'" onChange="show_SN_count(this.value)">';
- echo '<option value="0" '.(($row['design'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_1'].'</option>';
- echo '<option value="1" '.(($row['design'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_2'].'</option>';
- echo '<option value="2" '.(($row['design'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_3'].'</option>';
- echo '<option value="3" '.(($row['design'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_4'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_design'].':</label>';
+ echo ' <span class="content"><input type="hidden" name="sn_design" value="0" />';
+ echo ' <select id="spremenljivka_podtip_' . $row['id'] . '" name="sn_design" spr_id="'.$row['id'].'" onChange="show_SN_count(this.value)">';
+ echo ' <option value="0" '.(($row['design'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_1'].'</option>';
+ echo ' <option value="1" '.(($row['design'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_2'].'</option>';
+ echo ' <option value="2" '.(($row['design'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_3'].'</option>';
+ echo ' <option value="3" '.(($row['design'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_sn_design_4'].'</option>';
+ echo ' </select>';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitve za generator imen
@@ -3612,33 +3860,37 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
-
+
// Max odgovorov - samo pri 2. designu
- echo '<div id="SN_count" class="SN_hidable_settings" '.($row['design'] != 1 ? ' style="display:none;"' : '').'>';
-
- echo '<p><label class="title">'.$lang['srv_design_count'].':</label>';
- echo '<span class="content"><input type="hidden" name="size" value="0" />';
- echo '<select id="size" name="size">';
- for($i=1; $i<=20; $i++){
- echo '<option value="'.$i.'" '.(($row['size'] == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
- }
- echo '</select>';
- echo '</span></p>';
-
- echo '</div>';
+ echo '<div id="SN_count" class="vprasanje_setting_holder SN_hidable_settings" '.($row['design'] != 1 ? ' style="display:none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_design_count'].':</label>';
+ echo ' <span class="content"><input type="hidden" name="size" value="0" /><select id="size" name="size">';
+ for($i=1; $i<=20; $i++){
+ echo '<option value="'.$i.'" '.(($row['size'] == $i) ? ' selected="true" ' : '').'>'.$i.'</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
// Antonuccijev krog
- echo '<p><label class="title">'.$lang['srv_antonucci'].':</label>';
- echo '<span class="content"><input type="hidden" name="antonucci" value="0" />';
- echo '<select id="antonucci" name="antonucci">';
- echo '<option value="0" '.(($row['antonucci'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_none'].'</option>';
- echo '<option value="1" '.(($row['antonucci'] == 1) ? ' selected="true" ' : '').'>1.</option>';
- echo '<option value="2" '.(($row['antonucci'] == 2) ? ' selected="true" ' : '').'>2.</option>';
- echo '<option value="3" '.(($row['antonucci'] == 3) ? ' selected="true" ' : '').'>3.</option>';
- echo '</select>';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_antonucci'].':</label>';
+ echo ' <span class="content"><input type="hidden" name="antonucci" value="0" /><select id="antonucci" name="antonucci">';
+ echo ' <option value="0" '.(($row['antonucci'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_none'].'</option>';
+ echo ' <option value="1" '.(($row['antonucci'] == 1) ? ' selected="true" ' : '').'>1.</option>';
+ echo ' <option value="2" '.(($row['antonucci'] == 2) ? ' selected="true" ' : '').'>2.</option>';
+ echo ' <option value="3" '.(($row['antonucci'] == 3) ? ' selected="true" ' : '').'>3.</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
if($spremenljivkaParams->get('NG_cancelButton') == '1'){
@@ -3653,36 +3905,48 @@ class Vprasanje {
}
// Text za dodajanje nove osebe
- $addText = ($spremenljivkaParams->get('NG_addText') ? $spremenljivkaParams->get('NG_addText') : $lang['srv_NG_addText']);
- echo '<div id="SN_add_text" class="SN_hidable_settings" '.($row['design'] != 0 ? ' style="display:none;"' : '').'>';
-
- echo '<p>';
- echo $lang['srv_NG_addText_setting'] . ': <input type="text" name="NG_addText" value="' . $addText . '" size="30" />';
- echo '</p>';
+ $addText = ($spremenljivkaParams->get('NG_addText') ? $spremenljivkaParams->get('NG_addText') : $lang['srv_NG_addText']);
+
+ echo '<div id="SN_add_text" class="vprasanje_setting_holder SN_hidable_settings" '.($row['design'] != 0 ? ' style="display:none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_NG_addText_setting'].':</label>';
+ echo ' <span class="content"><input type="text" name="NG_addText" value="' . $addText . '" size="30" /></span>';
+ echo ' </div>';
echo '</div>';
// Pri vnosu stevila polj imamo opcijo za urejanje texta "Število polj za vnos"
$countText = ($spremenljivkaParams->get('NG_countText') ? $spremenljivkaParams->get('NG_countText') : $lang['srv_design_count']);
- echo '<div id="SN_count_text" class="SN_hidable_settings" '.($row['design'] != 3 ? ' style="display:none;"' : '').'>';
+
+ echo '<div id="SN_count_text" class="vprasanje_setting_holder SN_hidable_settings" '.($row['design'] != 3 ? ' style="display:none;"' : '').'>';
- echo '<p>';
- echo $lang['srv_NG_countText_setting'] . ': <input type="text" name="NG_countText" value="' . $countText . '" size="30" />';
- echo '</p>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_NG_countText_setting'] . ':</label>';
+ echo ' <span class="content"><input type="text" name="NG_countText" value="' . $countText . '" size="30" /></span>';
+ echo ' </div>';
echo '</div>';
// Gumb za preskok generatorja imen
- echo '<p>';
-
- echo $lang['srv_NG_cancelText_setting'] . ': ';
- echo '<input type="radio" '.($cancelButton == 0 ? ' checked' : '').' name="NG_cancelButton" value="0" onClick="change_NG_cancelButton(this.value);">'.$lang['no'].'</input> ';
- echo '<input type="radio" '.($cancelButton == 1 ? ' checked' : '').' name="NG_cancelButton" value="1" onClick="change_NG_cancelButton(this.value);">'.$lang['yes'].'</input> ';
+ echo '<div class="vprasanje_setting_holder">';
- echo '&nbsp;&nbsp;&nbsp;<input type="text" '.$hidden.' name="NG_cancelText" id="NG_cancelText" value="' . $cancelText . '" size="30" />';
- echo '</p>';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_NG_cancelText_setting'] . ':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="radio" '.($cancelButton == 0 ? ' checked' : '').' name="NG_cancelButton" value="0" onClick="change_NG_cancelButton(this.value);">'.$lang['no'].'</input> ';
+ echo ' <input type="radio" '.($cancelButton == 1 ? ' checked' : '').' name="NG_cancelButton" value="1" onClick="change_NG_cancelButton(this.value);">'.$lang['yes'].'</input> ';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="text" '.$hidden.' name="NG_cancelText" id="NG_cancelText" value="' . $cancelText . '" size="30" />';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev omejitve vnessenega stevila (number, vsota)
@@ -3692,156 +3956,256 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- //omejitev za number
+ // Omejitev za number
if($row['tip'] == 7 || $row['tip'] == 21){
- $onkeyup = $row['tip'] == 21 ? ' onkeyup="checkNumber(this, 4, 0, true);"' : '';
-
- echo '<fieldset><legend>'.$lang['srv_num_reminder'].'</legend>';
+
+ $onkeyup = $row['tip'] == 21 ? ' onkeyup="checkNumber(this, 4, 0, true);"' : '';
+
echo '<input type="hidden" name="edit_number_limit" value="1" />';
- echo '<p>';
- echo '<span class="clr" id="num_limit_label" '.($row['size']==2 ? '' : ' style="display:none;"').'>'.$lang['srv_num_field1'].':</span>';
- //spodnji limit
- echo '<input type="checkbox" value="1" id="num_useMin" name="num_useMin" '.($row['num_useMin']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'vsota_min\',this.checked)">';
- echo $lang['srv_num_min'] . '<input type="text" name="vsota_min" id="vsota_min"'.$onkeyup.' value="' . $row['vsota_min'] . '" size="8" '.($row['num_useMin'] == 0 ? ' disabled' : '').'></input> ';
- //zgornji limit
- echo '&nbsp;&nbsp;<input type="checkbox" value="1" id="num_useMax" name="num_useMax" '.($row['num_useMax']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'vsota_limit\',this.checked)">';
- echo $lang['srv_num_limit'] . '<input type="text" name="vsota_limit" id="vsota_limit"'.$onkeyup.' value="' . $row['vsota_limit'] . '" size="8" '.($row['num_useMax'] == 0 ? ' disabled' : '').'></input> ';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div id="num_limit_label" class="vprasanje_setting_line" '.($row['size']==2 ? '' : ' style="display:none;"').'>';
+ echo ' <span>'.$lang['srv_num_field1'].':</span>';
+ echo ' </div>';
+
+ // spodnji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'vsota_min\', \'num_useMin\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMin" name="num_useMin" '.($row['num_useMin']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMin">'.$lang['srv_num_min'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="vsota_min" id="vsota_min"'.$onkeyup.' value="' . $row['vsota_min'] . '" size="8" '.($row['num_useMin'] == 0 ? ' disabled' : '').'></input>';
+ echo ' </span>';
+ echo ' </div>';
+
+ // zgornji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'vsota_limit\', \'num_useMax\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMax" name="num_useMax" '.($row['num_useMax']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMax">'.$lang['srv_num_limit'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="vsota_limit" id="vsota_limit"'.$onkeyup.' value="' . $row['vsota_limit'] . '" size="8" '.($row['num_useMax'] == 0 ? ' disabled' : '').'></input> ';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Omejitve za 2. polje (ce ga imamo)
- echo '<div id="num_limit2" '.($row['size'] == 2 ? '' : ' style="display:none;"').'>';
- echo '<p>';
- echo '<span class="clr">'.$lang['srv_num_field2'].':</span>';
- //spodnji limit
- echo '<input type="checkbox" value="1" id="num_useMin2" name="num_useMin2" '.($row['num_useMin2']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'num_min2\',this.checked)">';
- echo $lang['srv_num_min'] . '<input type="text" name="num_min2" id="num_min2" value="' . $row['num_min2'] . '" size="8" '.($row['num_useMin2'] == 0 ? ' disabled' : '').'></input> ';
- //zgornji limit
- echo '&nbsp;&nbsp;<input type="checkbox" value="1" id="num_useMax2" name="num_useMax2" '.($row['num_useMax2']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'num_max2\',this.checked)">';
- echo $lang['srv_num_limit'] . '<input type="text" name="num_max2" id="num_max2" value="' . $row['num_max2'] . '" size="8" '.($row['num_useMax2'] == 0 ? ' disabled' : '').'></input> ';
- echo '</p>';
- echo '</div>';
+ echo '<div id="num_limit2" class="vprasanje_setting_holder"'.($row['size'] == 2 ? '' : ' style="display:none;"').'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span>'.$lang['srv_num_field2'].':</span>';
+ echo ' </div>';
+
+ // spodnji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'num_min2\', \'num_useMin2\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMin2" name="num_useMin2" '.($row['num_useMin2']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMin2">'.$lang['srv_num_min'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="num_min2" id="num_min2" value="' . $row['num_min2'] . '" size="8" '.($row['num_useMin2'] == 0 ? ' disabled' : '').'></input> ';
+ echo ' </span>';
+ echo ' </div>';
+
+ // zgornji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'num_max2\', \'num_useMax2\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMax2" name="num_useMax2" '.($row['num_useMax2']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMax2">'.$lang['srv_num_limit'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="num_max2" id="num_max2" value="' . $row['num_max2'] . '" size="8" '.($row['num_useMax2'] == 0 ? ' disabled' : '').'></input> ';
+ echo ' </span>';
+ echo ' </div>';
+
+ echo '</div>';
+
// prikaz omejitve
- echo '<p><span class="title"><label for="vsota_show">'.$lang['srv_num_limit_show'] . '</label></span><span class="content"><input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' /></span></p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' />';
+ echo ' <label for="vsota_show">'.$lang['srv_num_limit_show'].'</label>';
+ echo ' </div>';
+
// opozorilo za preseg limita (mehko, trdo)
- echo '<p><span class="title">'.$lang['srv_num_limit_reminder'].': </span>';
- echo '<span class="content"><select name="vsota_reminder">';
- echo '<option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off2'].'</option>';
- echo '<option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft2'].'</option>';
- echo '<option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard2'].'</option>';
- echo '</select></span></p>';
- echo '</fieldset>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_limit_reminder'].': </label>';
+ echo ' <span class="content"><select name="vsota_reminder">';
+ echo ' <option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off2'].'</option>';
+ echo ' <option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft2'].'</option>';
+ echo ' <option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard2'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// grid number
if ($row['tip'] == 20 && $row['ranking_k'] != 1) {
- // zaenkrat sam za slider
- //if ($row['ranking_k'] != 1) return;
-
- echo '<fieldset><legend>'.$lang['srv_num_reminder'].'</legend>';
+ // zaenkrat sam za slider
echo '<input type="hidden" name="edit_number_limit" value="1" />';
- echo '<p>';
- echo '<span class="clr" id="num_limit_label" '.($row['size']==2 ? '' : ' style="display:none;"').'>'.$lang['srv_num_field1'].':</span>';
- //spodnji limit
- echo '<input type="checkbox" value="1" id="num_useMin" name="num_useMin" '.($row['num_useMin']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'vsota_min\',this.checked)">';
- echo $lang['srv_num_min'] . '<input type="text" name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8" '.($row['num_useMin'] == 0 ? ' disabled' : '').'></input> ';
- //zgornji limit
- echo '&nbsp;&nbsp;<input type="checkbox" value="1" id="num_useMax" name="num_useMax" '.($row['num_useMax']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'vsota_limit\',this.checked)">';
- echo $lang['srv_num_limit'] . '<input type="text" name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8" '.($row['num_useMax'] == 0 ? ' disabled' : '').'></input> ';
- echo '</p>';
-
- // Omejitve za 2. polje (ce ga imamo)
- echo '<div id="num_limit2" '.($row['size'] == 2 ? '' : ' style="display:none;"').'>';
- echo '<p>';
- echo '<span class="clr">'.$lang['srv_num_field2'].':</span>';
- //spodnji limit
- echo '<input type="checkbox" value="1" id="num_useMin2" name="num_useMin2" '.($row['num_useMin2']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'num_min2\',this.checked)">';
- echo $lang['srv_num_min'] . '<input type="text" name="num_min2" id="num_min2" value="' . $row['num_min2'] . '" size="8" '.($row['num_useMin2'] == 0 ? ' disabled' : '').'></input> ';
- //zgornji limit
- echo '&nbsp;&nbsp;<input type="checkbox" value="1" id="num_useMax2" name="num_useMax2" '.($row['num_useMax2']==1 ? ' checked="checked"' : '').' onClick="num_limit(\'num_max2\',this.checked)">';
- echo $lang['srv_num_limit'] . '<input type="text" name="num_max2" id="num_max2" value="' . $row['num_max2'] . '" size="8" '.($row['num_useMax2'] == 0 ? ' disabled' : '').'></input> ';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div id="num_limit_label" class="vprasanje_setting_line" '.($row['size']==2 ? '' : ' style="display:none;"').'>';
+ echo ' <span>'.$lang['srv_num_field1'].':</span>';
+ echo ' </div>';
+
+ // spodnji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'vsota_min\', \'num_useMin\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMin" name="num_useMin" '.($row['num_useMin']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMin">'.$lang['srv_num_min'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8" '.($row['num_useMin'] == 0 ? ' disabled' : '').'></input>';
+ echo ' </span>';
+ echo ' </div>';
+
+ // zgornji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <span class="content" onClick="num_limit(\'vsota_limit\', \'num_useMax\')">';
+ echo ' <input type="checkbox" value="1" id="num_useMax" name="num_useMax" '.($row['num_useMax']==1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="num_useMax">'.$lang['srv_num_limit'].'</label>';
+ echo ' </span>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8" '.($row['num_useMax'] == 0 ? ' disabled' : '').'></input>';
+ echo ' </span>';
+ echo ' </div>';
+
echo '</div>';
+
// prikaz omejitve
- echo '<p><span class="title"><label for="vsota_show">'.$lang['srv_num_limit_show'] . '</label></span><span class="content"><input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' /></span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' />';
+ echo ' <label for="vsota_show">'.$lang['srv_num_limit_show'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// opozorilo za preseg limita (mehko, trdo)
- echo '<p><span class="title">'.$lang['srv_num_limit_reminder'].': </span>';
- echo '<span class="content"><select name="vsota_reminder">';
- echo '<option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off2'].'</option>';
- echo '<option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft2'].'</option>';
- echo '<option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard2'].'</option>';
- echo '</select></span></p>';
- echo '</fieldset>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_limit_reminder'].': </label>';
+ echo ' <span class="content"><select name="vsota_reminder">';
+ echo ' <option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off2'].'</option>';
+ echo ' <option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft2'].'</option>';
+ echo ' <option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard2'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// grid slider
if ($row['tip'] == 20 && $row['ranking_k'] == 1) {
- echo '<fieldset><legend>'.$lang['srv_num_reminder'].'</legend>';
echo '<input type="hidden" name="edit_number_limit" value="1" />';
- echo '<p>';
- //spodnji limit
- echo $lang['srv_num_min'] . '<input type="text" name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8"></input> ';
- //zgornji limit
- echo '&nbsp;&nbsp;';
- echo $lang['srv_num_limit'] . '<input type="text" name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8"></input> ';
- echo '</p>';
-
-
- echo '</fieldset>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ // spodnji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_min'].'</label>';
+ echo ' <span class="content"><input type="text" name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8"></input></span>';
+ echo ' </div>';
+ // zgornji limit
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_num_limit'].'</label>';
+ echo ' <span class="content"><input type="text" name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8"></input></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
//omejitev za vsoto
if($row['tip'] == 18){
- echo '<fieldset><legend>'.$lang['srv_vsota_reminder'].'</legend>';
+
echo '<input type="hidden" name="edit_vsota_limit" value="1" />';
- echo '<p>';
+
//nastavitev tocne vsote
if($row['vsota_min'] == $row['vsota_limit'])
$val = $row['vsota_min'];
- echo $lang['srv_vsota_exact'] . '<input type="text" '.($row['vsota_limittype'] == 1 ? ' disabled' : '').' name="vsota_exact" id="vsota_exact" value="' . $val . '" size="8"></input> ';
- echo '</p>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vsota_exact'].'</label>';
+ echo ' <span class="content"><input type="text" '.($row['vsota_limittype'] == 1 ? ' disabled' : '').' name="vsota_exact" id="vsota_exact" value="' . $val . '" size="8"></input></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
- echo '<p>';
- echo $lang['srv_vsota_both'] . '<input type="checkbox" '.($row['vsota_limittype'] == 1 ? ' checked' : '').' name="vsota_limittype" value="1" onClick="change_limittype(this.checked)"></input> ';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" '.($row['vsota_limittype'] == 1 ? ' checked' : '').' name="vsota_limittype" id="vsota_limittype" value="1" onClick="change_limittype(this.checked)"></input> ';
+ echo ' <label for="vsota_limittype">'.$lang['srv_vsota_both'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
- echo '<p>';
- //spodnji limit vsote
- echo $lang['srv_vsota_min'] . '<input type="text" '.($row['vsota_limittype'] == 0 ? ' disabled' : '').' name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8"></input> ';
- //zgornji limit vsote
- echo $lang['srv_vsota_limit'] . '<input type="text" '.($row['vsota_limittype'] == 0 ? ' disabled' : '').' name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8"></input> ';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ // spodnji limit vsote
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vsota_min'].'</label>';
+ echo ' <span class="content"><input type="text" '.($row['vsota_limittype'] == 0 ? ' disabled' : '').' name="vsota_min" id="vsota_min" value="' . $row['vsota_min'] . '" size="8"></input></span>';
+ echo ' </div>';
- // prikaz omejitve
- echo '<p>'.$lang['srv_vsota_show'] . '<input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' /></p>';
+ // zgornji limit vsote
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vsota_limit'].'</label>';
+ echo ' <span class="content"><input type="text" '.($row['vsota_limittype'] == 0 ? ' disabled' : '').' name="vsota_limit" id="vsota_limit" value="' . $row['vsota_limit'] . '" size="8"></input></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ // prikaz omejitve
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="checkbox" name="vsota_show" id="vsota_show" value="1" '.($row['vsota_show']==1?'checked':'').' />';
+ echo ' <label>'.$lang['srv_vsota_show'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// opozorilo za preseg limita (mehko, trdo)
- echo '<p>';
- echo $lang['srv_vsota_reminder'].': ';
- echo '<select name="vsota_reminder">';
- echo '<option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off'].'</option>';
- echo '<option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft'].'</option>';
- echo '<option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard'].'</option>';
- echo '</select>';
-
- echo '</p>';
- echo '</fieldset>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vsota_reminder'].':</label>';
+ echo ' <span class="content"><select name="vsota_reminder">';
+ echo ' <option value="0"' . ($row['vsota_reminder'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_off'].'</option>';
+ echo ' <option value="1"' . ($row['vsota_reminder'] == 1 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_soft'].'</option>';
+ echo ' <option value="2"' . ($row['vsota_reminder'] == 2 ? ' selected="true"' : '') . '>'.$lang['srv_reminder_hard'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
-
-
}
// nastavitev poravnave celic v gridih
@@ -3854,17 +4218,19 @@ class Vprasanje {
echo '<p '.$display.'>';
$gridAlign = ($spremenljivkaParams->get('gridAlign') ? $spremenljivkaParams->get('gridAlign') : -1);
- echo '<span class="title">'.$lang['srv_gridAlign'].'</span>';
- echo '<span class="content"><select name="gridAlign" id="gridAlign">';
-
- echo '<option value="0"' . ($gridAlign == 0 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_center'].'</option>';
- echo '<option value="1"' . ($gridAlign == 1 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_left'].'</option>';
- echo '<option value="2"' . ($gridAlign == 2 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_right'].'</option>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_gridAlign'].'</label>';
+ echo ' <span class="content"><select name="gridAlign" id="gridAlign">';
+ echo ' <option value="0"' . ($gridAlign == 0 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_center'].'</option>';
+ echo ' <option value="1"' . ($gridAlign == 1 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_left'].'</option>';
+ echo ' <option value="2"' . ($gridAlign == 2 ? ' selected="true"' : '') . '>'.$lang['srv_gridAlign_right'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
- echo '</select></span>';
-
- echo '</p>';
+ echo '</div>';
}
// nastavitev sirine text polja (besedilo*, multitext, multinumber, number)
@@ -3874,83 +4240,97 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
- echo '<p>';
-
$taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1);
$taHeight = ($spremenljivkaParams->get('taHeight') ? $spremenljivkaParams->get('taHeight') : 1);
- echo $lang['srv_textAreaWidth'].': ';
- //sirina za multitext in multinumber
+ // sirina za multitext in multinumber
if($row['tip'] == 19 || $row['tip'] == 20){
- $size = $row['grids'];
+
+ $size = $row['grids'];
$missing_count = 0;
- # če imamo missinge size povečamo za 1 + številomissingov
+
+ # če imamo missinge size povečamo za 1 + številomissingov
$sql_grid_mv = sisplet_query("SELECT * FROM srv_grid WHERE spr_id='".$this->spremenljivka."' AND other != 0");
$missing_count = mysqli_num_rows($sql_grid_mv);
- if ($missing_count > 0) {
+
+ if ($missing_count > 0)
$size += $missing_count + 1;
- }
- echo '<select name="taWidth" id="width">';
- $maxWidth = round(50 / $size);
-
- echo '<option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
+ $maxWidth = round(50 / $size);
+ $maxHeight = 10;
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaWidth'].':</label>';
+ echo ' <span class="content"><select name="taWidth" id="width">';
+ echo ' <option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
for($i=1; $i<$maxWidth; $i++){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select>';
+ echo ' </select></span>';
+ echo ' </div>';
// multitext ima tudi nastavitev visine
if ($row['tip'] == 19) {
-
- echo '<span class="content">'.$lang['srv_textAreaHeight'].': ';
- echo '<select name="taHeight" class="no-margin" id="taHeight">';
- $maxHeight = 10;
-
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaHeight'].':</label>';
+ echo ' <span class="content"><select name="taHeight" class="no-margin" id="taHeight">';
for($i=1; $i<=$maxHeight; $i++){
- echo '<option value="'.$i.'"' . ($taHeight == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taHeight == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select></span>';
+ echo ' </select></span>';
+ echo ' </div>';
}
+
+ echo '</div>';
}
//sirina za number
elseif($row['tip'] == 7){
- $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$this->spremenljivka' ORDER BY vrstni_red ASC");
- $row1 = mysqli_fetch_array($sql1);
- $id1 = $row1['id'];
- $row1 = mysqli_fetch_array($sql1);
- $id2 = $row1['id'];
-
- echo '<select name="taWidth" id="width" onchange="change_number(\'1\', \'2\');">';
- echo '<option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (10)</option>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaWidth'].':</label>';
+ echo ' <span class="content"><select name="taWidth" id="width" onchange="change_number(\'1\', \'2\');">';
+ echo ' <option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (10)</option>';
for($i=5; $i<50; $i+=5){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
for($i=50; $i<=100; $i+=10){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select>';
+ echo '</select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
//sirina za besedilo*
elseif($row['tip'] == 21){
- echo '<select name="taWidth" id="width">';
-
- echo '<option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (30)</option>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaWidth'].':</label>';
+ echo ' <span class="content"><select name="taWidth" id="width">';
+ echo ' <option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (30)</option>';
for($i=5; $i<50; $i+=5){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
for($i=50; $i<=100; $i+=10){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
$this->edit_height();
}
-
- echo '</p>';
}
// nastavitev visine text polja (besedilo*)
@@ -3959,23 +4339,26 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
-
- //echo '<p>';
-
+
$taSize = ($spremenljivkaParams->get('taSize') ? $spremenljivkaParams->get('taSize') : 1);
- echo '<span class="content">'.$lang['srv_textAreaSize'].'';
- echo '<select name="taSize" class="no-margin" id="height">';
- echo '<option value="1"' . ($taSize == 1 ? ' selected="true"' : '') . '>' . $lang['srv_textArea1line'] . '</option>';
- echo '<option value="2"' . ($taSize == 2 ? ' selected="true"' : '') . '>' . $lang['srv_textArea2line'] . '</option>';
- echo '<option value="3"' . ($taSize == 3 ? ' selected="true"' : '') . '>' . $lang['srv_textArea3line'] . '</option>';
- echo '<option value="5"' . ($taSize == 5 ? ' selected="true"' : '') . '>' . $lang['srv_textArea5line'] . '</option>';
- echo '<option value="7"' . ($taSize == 7 ? ' selected="true"' : '') . '>' . $lang['srv_textArea7line'] . '</option>';
- echo '<option value="10"' . ($taSize == 10 ? ' selected="true"' : '') . '>' . $lang['srv_textArea10line'] . '</option>';
- echo '<option value="20"' . ($taSize == 20 ? ' selected="true"' : '') . '>' . $lang['srv_textArea20line'] . '</option>';
- echo '<option value="30"' . ($taSize == 30 ? ' selected="true"' : '') . '>' . $lang['srv_textArea30line'] . '</option>';
- echo '</select></span>';
-
- //echo '</p>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaSize'].':</label>';
+ echo ' <span class="content"><select name="taSize" class="no-margin" id="height">';
+ echo ' <option value="1"' . ($taSize == 1 ? ' selected="true"' : '') . '>' . $lang['srv_textArea1line'] . '</option>';
+ echo ' <option value="2"' . ($taSize == 2 ? ' selected="true"' : '') . '>' . $lang['srv_textArea2line'] . '</option>';
+ echo ' <option value="3"' . ($taSize == 3 ? ' selected="true"' : '') . '>' . $lang['srv_textArea3line'] . '</option>';
+ echo ' <option value="5"' . ($taSize == 5 ? ' selected="true"' : '') . '>' . $lang['srv_textArea5line'] . '</option>';
+ echo ' <option value="7"' . ($taSize == 7 ? ' selected="true"' : '') . '>' . $lang['srv_textArea7line'] . '</option>';
+ echo ' <option value="10"' . ($taSize == 10 ? ' selected="true"' : '') . '>' . $lang['srv_textArea10line'] . '</option>';
+ echo ' <option value="20"' . ($taSize == 20 ? ' selected="true"' : '') . '>' . $lang['srv_textArea20line'] . '</option>';
+ echo ' <option value="30"' . ($taSize == 30 ? ' selected="true"' : '') . '>' . $lang['srv_textArea30line'] . '</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -3986,12 +4369,15 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<input type="hidden" value="" name="multiple_subtitle">';
- echo '<p><label class="title" for="multiple_subtitle">';
- echo $lang['srv_multiple_subtitle'].':</label><span class="content">';
- echo '<input id="multiple_subtitle" type="checkbox" name="multiple_subtitle" value="1" '.($row['grid_subtitle1']==1?'checked':'').'></span>';
-
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" value="" name="multiple_subtitle">';
+ echo ' <input id="multiple_subtitle" type="checkbox" name="multiple_subtitle" value="1" '.($row['grid_subtitle1']==1?'checked':'').'>';
+ echo ' <label for="multiple_subtitle">'.$lang['srv_multiple_subtitle'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
@@ -4001,21 +4387,26 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
- $display = ( ($row['tip'] == 2)) ? ' style="display:none;"' : '';
- echo '<p '.$display.'><span class="title">';
- $gridWidth = ($spremenljivkaParams->get('gridWidth') ? $spremenljivkaParams->get('gridWidth') : 1);
- echo $lang['srv_gridAreaSize'].':</span><span class="content">';
- echo '<select name="gridWidth" id="gridWidth" onChange="change_grid_width(this.value);">';
- echo '<option value="-1"' . ($gridWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (30%)</option>';
- // 0 bo podrla zdruzljivost za nazaj (0 = -1, default!!!!!!)
- echo '<option value="-2"' . ($gridWidth == -2 ? ' selected="true"' : '') . '>'.$lang['srv_gridAreaHidden'].' (0%)</option>';
- for($i=1; $i<=16; $i++){
- echo '<option value="'.$i * 5 .'"' . ($gridWidth == $i * 5 ? ' selected="true"' : '') . '>' . $i * 5 . '%</option>';
- }
- echo '</select></span>';
+ $display = ( ($row['tip'] == 2)) ? ' style="display:none;"' : '';
- echo '</p>';
+ $gridWidth = ($spremenljivkaParams->get('gridWidth') ? $spremenljivkaParams->get('gridWidth') : 1);
+
+ echo '<div class="vprasanje_setting_holder" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_gridAreaSize'].' '.Help::display('srv_grid_width').':</label>';
+ echo ' <span class="content"><select name="gridWidth" id="gridWidth" onChange="change_grid_width(this.value);">';
+ echo ' <option value="-1"' . ($gridWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].' (30%)</option>';
+ // 0 bo podrla zdruzljivost za nazaj (0 = -1, default!!!!!!)
+ echo ' <option value="-2"' . ($gridWidth == -2 ? ' selected="true"' : '') . '>'.$lang['srv_gridAreaHidden'].' (0%)</option>';
+ for($i=1; $i<=16; $i++){
+ echo ' <option value="'.$i * 5 .'"' . ($gridWidth == $i * 5 ? ' selected="true"' : '') . '>' . $i * 5 . '%</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitve za besedilo* (st. kosov in polozaj besedila)
@@ -4024,28 +4415,36 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- //stevilo kosov
- echo '<span class="title">'.$lang['srv_kosov'].': ';
- echo '<select name="text_kosov" id="kosov">';
- echo '<option value="1"' . ($row['text_kosov'] == 1 ? ' selected="true"' : '') . '>1</option>';
- echo '<option value="2"' . ($row['text_kosov'] == 2 ? ' selected="true"' : '') . '>2</option>';
- echo '<option value="3"' . ($row['text_kosov'] == 3 ? ' selected="true"' : '') . '>3</option>';
- echo '<option value="4"' . ($row['text_kosov'] == 4 ? ' selected="true"' : '') . '>4</option>';
- echo '</select></span>';
-
- //polozaj besedila
- echo '<span class="content">'.$lang['srv_polozaj'].': ';
- echo '<select name="text_orientation" class="no-margin" id="position">';
- echo '<option value="0"' . ($row['text_orientation'] == 0 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_off'] . '</option>';
- echo '<option value="1"' . ($row['text_orientation'] == 1 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_side'] . '</option>';
- echo '<option value="3"' . ($row['text_orientation'] == 3 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_above'] . '</option>';
- echo '<option value="2"' . ($row['text_orientation'] == 2 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_bottom'] . '</option>';
- echo '</select></span>';
-
- echo '</p>';
-
-
+ // stevilo kosov
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_kosov'].':</label>';
+ echo ' <span class="content"><select name="text_kosov" id="kosov">';
+ echo ' <option value="1"' . ($row['text_kosov'] == 1 ? ' selected="true"' : '') . '>1</option>';
+ echo ' <option value="2"' . ($row['text_kosov'] == 2 ? ' selected="true"' : '') . '>2</option>';
+ echo ' <option value="3"' . ($row['text_kosov'] == 3 ? ' selected="true"' : '') . '>3</option>';
+ echo ' <option value="4"' . ($row['text_kosov'] == 4 ? ' selected="true"' : '') . '>4</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // polozaj besedila
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_polozaj'].':</label>';
+ echo ' <span class="content"><select name="text_orientation" class="no-margin" id="position">';
+ echo ' <option value="0"' . ($row['text_orientation'] == 0 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_off'] . '</option>';
+ echo ' <option value="1"' . ($row['text_orientation'] == 1 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_side'] . '</option>';
+ echo ' <option value="3"' . ($row['text_orientation'] == 3 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_above'] . '</option>';
+ echo ' <option value="2"' . ($row['text_orientation'] == 2 ? ' selected="true"' : '') . '>' . $lang['srv_polozaj_bottom'] . '</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitve za number (st. polj)
@@ -4053,20 +4452,18 @@ class Vprasanje {
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
- $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$this->spremenljivka' ORDER BY vrstni_red ASC");
- $row1 = mysqli_fetch_array($sql1);
- $id1 = $row1['id'];
- $row1 = mysqli_fetch_array($sql1);
- $id2 = $row1['id'];
-
- echo '<p><span class="title">';
-
- echo $lang['srv_kategorij'].': ';
- echo '<select id="num_size" name="size" onchange="change_number(\'1\', \'2\'); toggle_num_limits(this.value);">';
- echo '<option value="1"' . ($row['size'] == 1 ? ' selected="true"' : '') . '>1</option>';
- echo '<option value="2"' . ($row['size'] == 2 ? ' selected="true"' : '') . '>2</option>';
- echo '</select></span>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_kategorij'].':</label>';
+ echo ' <span class="content"><select id="num_size" name="size" onchange="change_number(\'1\', \'2\'); toggle_num_limits(this.value);">';
+ echo ' <option value="1"' . ($row['size'] == 1 ? ' selected="true"' : '') . '>1</option>';
+ echo ' <option value="2"' . ($row['size'] == 2 ? ' selected="true"' : '') . '>2</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitve za number (enota/brez enote)
@@ -4074,24 +4471,20 @@ class Vprasanje {
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
- $sql1 = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id = '$this->spremenljivka' ORDER BY vrstni_red ASC");
- $row1 = mysqli_fetch_array($sql1);
- $id1 = $row1['id'];
- $row1 = mysqli_fetch_array($sql1);
- $id2 = $row1['id'];
-
-
-
- //polje za enoto
- echo '<span class="content">'.$lang['srv_enota'].': ';
- echo '<select id="num_enota" name="enota" class="no-margin" onchange="change_number(\'1\', \'2\');">';
- echo '<option value="0"' . ($row['enota'] == 0 ? ' selected="true"' : '') . '>' . $lang['no1'] . '</option>';
- echo '<option value="1"' . ($row['enota'] == 1 ? ' selected="true"' : '') . '>' . $lang['left'] . '</option>';
- echo '<option value="2"' . ($row['enota'] == 2 ? ' selected="true"' : '') . '>' . $lang['right'] . '</option>';
- echo '</select></span>';
-
- echo '</p>';
+
+ // polje za enoto
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_enota'].':</label>';
+ echo ' <span class="content"><select id="num_enota" name="enota" class="no-margin" onchange="change_number(\'1\', \'2\');">';
+ echo ' <option value="0"' . ($row['enota'] == 0 ? ' selected="true"' : '') . '>' . $lang['no1'] . '</option>';
+ echo ' <option value="1"' . ($row['enota'] == 1 ? ' selected="true"' : '') . '>' . $lang['left'] . '</option>';
+ echo ' <option value="2"' . ($row['enota'] == 2 ? ' selected="true"' : '') . '>' . $lang['right'] . '</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev za ranking (moznosti)
@@ -4100,15 +4493,19 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_ranking_type'].':</span>';
- echo '<span class="content"><select name="design" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" class="ranking_k" onchange="show_ranking_k(this.value); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
- echo '<option value="0" '.(($row['design'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_prestavljanje'].'</option>';
- echo '<option value="1" '.(($row['design'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_ostevilcevanje'].'</option>';
- echo '<option value="2" '.(($row['design'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_premikanje'].'</option>';
- echo '<option value="3" '.(($row['design'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_hotspot'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_ranking_type'].':</label>';
+ echo ' <span class="content"><select name="design" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" class="ranking_k" onchange="show_ranking_k(this.value); show_hot_spot_settings(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
+ echo ' <option value="0" '.(($row['design'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_prestavljanje'].'</option>';
+ echo ' <option value="1" '.(($row['design'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_ostevilcevanje'].'</option>';
+ echo ' <option value="2" '.(($row['design'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_premikanje'].'</option>';
+ echo ' <option value="3" '.(($row['design'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_ranking_hotspot'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev za ranking (moznosti)
@@ -4120,15 +4517,19 @@ class Vprasanje {
$sqls = sisplet_query("SELECT * FROM srv_vrednost WHERE spr_id='$this->spremenljivka'");
$count = mysqli_num_rows($sqls);
- echo '<div id="ranking_k" '.(($row['design'] == 2) ? 'style="display: none;"' : '').'>';
- echo '<p><span class="title">'.$lang['srv_ranking_k'].':</span>';
- echo '<span class="content"><select name="ranking_k" class="ranking_k">';
- echo '<option value="0"' . ($row['ranking_k'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_vsi'].'</option>';
- for ($i=1; $i<$count; $i++) {
- echo '<option value="' . $i . '"' . ($row['ranking_k'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
- }
- echo '</select></span>';
- echo '</p></div>';
+ echo '<div id="ranking_k" class="vprasanje_setting_holder" '.(($row['design'] == 2) ? 'style="display: none;"' : '').'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_ranking_k'].':</label>';
+ echo ' <span class="content"><select name="ranking_k" class="ranking_k">';
+ echo ' <option value="0"' . ($row['ranking_k'] == 0 ? ' selected="true"' : '') . '>'.$lang['srv_vsi'].'</option>';
+ for ($i=1; $i<$count; $i++) {
+ echo ' <option value="' . $i . '"' . ($row['ranking_k'] == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// nastavitev za nagovor - crta za vprasanjem
@@ -4139,37 +4540,30 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$nagovorLine = ($spremenljivkaParams->get('nagovorLine') ? $spremenljivkaParams->get('nagovorLine') : 0);
- echo '<p><span class="title">'.$lang['srv_nagovorLine'].':</span>';
- echo '<span class="content"><select name="nagovorLine" id="nagovorLine">';
- echo '<option value="0"' . ($nagovorLine == 0 ? ' selected="true"' : '') . '>' . $lang['srv_default'] . '</option>';
- echo '<option value="1"' . ($nagovorLine == 1 ? ' selected="true"' : '') . '>' . $lang['no1'] . '</option>';
- echo '<option value="2"' . ($nagovorLine == 2 ? ' selected="true"' : '') . '>' . $lang['yes'] . '</option>';
- echo '</select></span></p>';
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_nagovorLine'].':</label>';
+ echo ' <span class="content"><select name="nagovorLine" id="nagovorLine">';
+ echo ' <option value="0"' . ($nagovorLine == 0 ? ' selected="true"' : '') . '>' . $lang['srv_default'] . '</option>';
+ echo ' <option value="1"' . ($nagovorLine == 1 ? ' selected="true"' : '') . '>' . $lang['no1'] . '</option>';
+ echo ' <option value="2"' . ($nagovorLine == 2 ? ' selected="true"' : '') . '>' . $lang['yes'] . '</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
* prikaze gumbe
*/
- function edit_buttons () {
+ private function edit_buttons () {
global $lang;
- echo '<div id="vprasanje_buttons">';
-
- echo '<span class="buttonwrapper spaceLeft floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" href="#" onclick="vprasanje_save(); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
-
- /*echo '<span class="buttonwrapper spaceLeft floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vprasanje_cancel(); return false;"><span>'.$lang['srv_close_profile'].'</span></a>'."\n\r";
- echo '</span>';*/
-
- echo '<span class="buttonwrapper spaceLeft floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="brisi_spremenljivko(\''.$this->spremenljivka.'\', undefined, \'0\'); return false;"><span>'.$lang['srv_brisispremenljivko'].'</span></a>'."\n\r";
- echo '</span>';
-
- //echo '<div id="arrows_more_vprasanje" onclick=" $(\'#vprasanje_edit\').animate({ scrollTop: $(\'#vprasanje_edit\').attr(\'scrollHeight\') }, 2000); "><img src="img_0/bullet_arrow_down.png" /> '.$lang['srv_more'].'</div>';
-
- echo '</div>';
+ echo '<button class="small blue" onclick="vprasanje_save(); return false;">';
+ echo $lang['srv_zapri'];
+ echo '</button>';
}
/**
@@ -4195,10 +4589,15 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p><label for="inline_edit" class="title">'.$lang['srv_inline_edit'].':</label> '.Help::display('srv_dropdown_quickedit');
- echo '<span class="content"><input type="hidden" value="0" name="inline_edit" />';
- echo '<input type="checkbox" value="1" id="inline_edit" name="inline_edit" '.($row['inline_edit']==1?' checked="checked"':'').' /></span></p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" value="0" name="inline_edit" />';
+ echo ' <input type="checkbox" value="1" id="inline_edit" name="inline_edit" '.($row['inline_edit']==1?' checked="checked"':'').' />';
+ echo ' <label for="inline_edit">'.$lang['srv_inline_edit'].' '.Help::display('srv_dropdown_quickedit').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
function edit_onchange_submit() {
@@ -4206,16 +4605,20 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- // pri multigridu ga prikazemo samo ce imamo vklopljeno postopno resevanje
- echo '<div id="onchange_submit_div" '.($row['dynamic_mg']==0 && $row['tip']!=1 && $row['orientation']>2 ? ' style="display:none;"':'').'>';
-
- echo '<p><label for="onchange_submit" class="title">'.$lang['srv_onchange_submit'].':</label>';
- //echo '<span class="content"><input type="radio" value="0" name="onchange_submit" '.($row['onchange_submit']==0?' checked="checked"':'').' />'.$lang['no'];
- //echo '<input type="radio" value="1" name="onchange_submit" '.($row['onchange_submit']==1?' checked="checked"':'').' />'.$lang['yes'].'</span></p>';
- echo '<span class="content"><input type="hidden" value="0" name="onchange_submit" />';
- echo '<input type="checkbox" value="1" id="onchange_submit" name="onchange_submit" '.($row['onchange_submit']==1?' checked="checked"':'').' /></span></p>';
-
- echo '</div>';
+ // ODSTRANJENO - ostane samo tam, kjer je vklopljeno zaradi kompatibilnosti za nazaj
+ if($row['onchange_submit'] == '1'){
+
+ // pri multigridu ga prikazemo samo ce imamo vklopljeno postopno resevanje
+ echo '<div id="onchange_submit_div" class="vprasanje_setting_holder" '.($row['dynamic_mg']==0 && $row['tip']!=1 && $row['orientation']>2 ? ' style="display:none;"':'').'>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" value="0" name="onchange_submit" />';
+ echo ' <input type="checkbox" value="1" id="onchange_submit" name="onchange_submit" '.($row['onchange_submit']==1?' checked="checked"':'').' />';
+ echo ' <label for="onchange_submit" class="title">'.$lang['srv_onchange_submit'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
function edit_hidden_default() {
@@ -4223,8 +4626,18 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p><span class="title">'.$lang['srv_hidden_default'].':</span><input type="radio" value="0" name="hidden_default" '.($row['hidden_default']==0?' checked="checked"':'').' />'.$lang['no'].'<input type="radio" value="1" name="hidden_default" '.($row['hidden_default']==1?' checked="checked"':'').' />'.$lang['yes'].'</p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_hidden_default'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo' <span class="content"><input type="radio" value="0" name="hidden_default" '.($row['hidden_default']==0?' checked="checked"':'').' />'.$lang['no'].'</span>';
+ echo ' <span class="content"><input type="radio" value="1" name="hidden_default" '.($row['hidden_default']==1?' checked="checked"':'').' />'.$lang['yes'].'</span>';
+ echo ' </div>';
+
+ echo '</div>';
}
function edit_captcha () {
@@ -4238,11 +4651,22 @@ class Vprasanje {
$disabled = ($row['upload']>0 || $row['signature']==1 || $emailVerify==1) ? ' disabled="disabled"' : '';
- echo '<p><span class="title">'.$lang['srv_captcha_edit'].':</span><span class="content">';
- echo '<input type="radio" value="0" name="captcha" id="captcha_0" '.($captcha==0?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'captcha\', this.value);" /><label for="captcha_0">'.$lang['no'].'</label>';
- echo '<input type="radio" value="1" name="captcha" id="captcha_1" '.($captcha==1?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'captcha\', this.value);" /><label for="captcha_1">'.$lang['yes'].'</label>';
- echo '</span><br>'.$lang['srv_captcha_edit_note'].'</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_captcha_edit'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="radio" value="0" name="captcha" id="captcha_0" '.($captcha==0?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'captcha\', this.value);" /><label for="captcha_0">'.$lang['no'].'</label></span>';
+ echo ' <span class="content"><input type="radio" value="1" name="captcha" id="captcha_1" '.($captcha==1?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'captcha\', this.value);" /><label for="captcha_1">'.$lang['yes'].'</label></span>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content">'.$lang['srv_captcha_edit_note'].'</span>';
+ echo ' </div>';
+ echo '</div>';
}
function edit_email_verify () {
@@ -4256,20 +4680,42 @@ class Vprasanje {
$disabled = ($row['upload']>0 || $row['signature']==1 || $captcha==1) ? ' disabled="disabled"' : '';
- echo '<p><span class="title">'.$lang['srv_email_edit'].':</span><span class="content">';
- echo '<input type="radio" value="0" name="emailVerify" id="emailVerify_0" '.($emailVerify==0?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'emailVerify\', this.value);" /><label for="emailVerify_0">'.$lang['no'].'</label>';
- echo '<input type="radio" value="1" name="emailVerify" id="emailVerify_1" '.($emailVerify==1?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'emailVerify\', this.value);" /><label for="emailVerify_1">'.$lang['yes'].'</label>';
- echo '</span><br>'.$lang['srv_email_edit_note'].'</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <label>'.$lang['srv_email_edit'].':</label>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="radio" value="0" name="emailVerify" id="emailVerify_0" '.($emailVerify==0?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'emailVerify\', this.value);" /><label for="emailVerify_0">'.$lang['no'].'</label></span>';
+ echo ' <span class="content"><input type="radio" value="1" name="emailVerify" id="emailVerify_1" '.($emailVerify==1?' checked="checked"':'').' '.$disabled.' onClick="textSubtypeToggle(\'emailVerify\', this.value);" /><label for="emailVerify_1">'.$lang['yes'].'</label></span>';
+ echo ' </div>';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content">'.$lang['srv_email_edit_note'].'</span>';
+ echo ' </div>';
+
+ echo '</div>';
}
function edit_showOnAllPages () {
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p><label for="showOnAllPages" class="title">'.$lang['srv_showOnAllPages_edit'].':</label>';
- echo '<span class="content"><input type="hidden" value="0" name="showOnAllPages" />';
- echo '<input type="checkbox" value="1" id="showOnAllPages" name="showOnAllPages" '.($row['showOnAllPages']==1?' checked="checked"':'').' /></span></p>';
-
+
+ // ODSTRANJENO - ostane samo tam, kjer je vklopljeno zaradi kompatibilnosti za nazaj
+ if($row['showOnAllPages'] == '1'){
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" value="0" name="showOnAllPages" />';
+ echo ' <input type="checkbox" value="1" id="showOnAllPages" name="showOnAllPages" '.($row['showOnAllPages']==1?' checked="checked"':'').' />';
+ echo ' <label for="showOnAllPages">'.$lang['srv_showOnAllPages_edit'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
function edit_hideRadio () {
@@ -4280,10 +4726,15 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$hideRadio = ($spremenljivkaParams->get('hideRadio') ? $spremenljivkaParams->get('hideRadio') : 0);
- echo '<p><label for="hideRadio" class="title">'.$lang['srv_hideRadio_edit_'.$row['tip']].':</label>';
- echo '<span class="content"><input type="hidden" value="0" name="hideRadio" />';
- echo '<input type="checkbox" value="1" id="hideRadio" name="hideRadio" '.($hideRadio==1?' checked="checked"':'').' /></span></p>';
-
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content"><input type="hidden" value="0" name="hideRadio" />';
+ echo ' <input type="checkbox" value="1" id="hideRadio" name="hideRadio" '.($hideRadio==1?' checked="checked"':'').' />';
+ echo ' <label for="hideRadio">'.$lang['srv_hideRadio_edit_'.$row['tip']].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// Prednastavljena vrednost (pri radio ali tabela - radio)
@@ -4309,22 +4760,26 @@ class Vprasanje {
|| ($row['tip'] == 2 && in_array($row['orientation'], array(0,1,2,7)))
|| ($row['tip'] == 6 && in_array($row['enota'], array(0,1,8))))
$show = '';
- echo '<p class="presetValue" '.$show.'><label class="title">'.$lang['srv_vrednost_default'].':</label>';
-
- echo '<span class="content"><select id="presetValue" name="presetValue" style="width:120px; text-overflow:ellipsis;">';
- echo ' <option value="0">'.$lang['no'].'</option>';
+
+
+ echo '<div class="vprasanje_setting_holder presetValue" '.$show.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vrednost_default'].':</label>';
+ echo ' <span class="content"><select id="presetValue" name="presetValue" text-overflow:ellipsis;">';
+ echo ' <option value="0">'.$lang['no'].'</option>';
while($rowV = mysqli_fetch_array($sqlV)){
$naslov = (strlen($rowV['naslov']) > 20) ? substr($rowV['naslov'], 0, 20).'...' : $rowV['naslov'];
$naslov = strip_tags($naslov);
$naslov = ($naslov == '') ? '' : '('.$naslov.')';
-
- echo ' <option value="'.$rowV['id'].'" '.($presetValue == $rowV['id'] ? ' selected="selected"' : '').'>'.$rowV['variable'].' '.$naslov.'</option>';
+ echo ' <option value="'.$rowV['id'].'" '.($presetValue == $rowV['id'] ? ' selected="selected"' : '').'>'.$rowV['variable'].' '.$naslov.'</option>';
}
- echo '</select></span>';
-
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
// Urejanje velikosti polja drugo
@@ -4335,49 +4790,57 @@ class Vprasanje {
// Ce imamo kaken odgovor drugo
$sql = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id='$row[id]' AND other='1'");
- //if(mysqli_num_rows($sql) > 0){
-
- $spremenljivkaParams = new enkaParameters($row['params']);
-
- $otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1);
- $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
-
- //echo '<fieldset><legend>'.$lang['srv_other_size'].'</legend>';
- //echo '<fieldset id = '.$row['id'].'><legend>'.$lang['srv_other_size'].'</legend>';
- //echo '<fieldset id = fieldset'.$row['id'].' ><legend onclick="$(\'#fieldset'.$row['id'].'\').hide()">'.$lang['srv_other_size'].'</legend>';
- if(mysqli_num_rows($sql) > 0){ //ce je prisotna moznost Drugo,
- echo '<fieldset id = fieldset'.$row['id'].'><legend>'.$lang['srv_other_size'].'</legend>'; //pokazi fieldset
- }
- else{ //drugace
- echo '<fieldset id = fieldset'.$row['id'].' hidden><legend>'.$lang['srv_other_size'].'</legend>'; //skrij fieldset
- }
- //echo '<fieldset id = fieldset'.$row['id'].' ><legend onclick="console.log(\'Tralala\');">'.$lang['srv_other_size'].'</legend>';
-
- echo '<p>';
-
- echo $lang['srv_textAreaWidth'].': ';
- echo '<select name="otherWidth" id="width">';
- echo '<option value="-1"' . ($otherWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
- for($i=5; $i<61; $i+=5){
- echo '<option value="'.$i.'"' . ($otherWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
- }
- echo '</select>';
-
- echo '<span class="content">'.$lang['srv_textAreaSize'].'';
- echo '<select name="otherHeight" class="no-margin" id="height">';
- echo '<option value="1"' . ($otherHeight == 1 ? ' selected="true"' : '') . '>' . $lang['srv_textArea1line'] . '</option>';
- echo '<option value="3"' . ($otherHeight == 3 ? ' selected="true"' : '') . '>' . $lang['srv_textArea3line'] . '</option>';
- echo '<option value="5"' . ($otherHeight == 5 ? ' selected="true"' : '') . '>' . $lang['srv_textArea5line'] . '</option>';
- echo '<option value="7"' . ($otherHeight == 7 ? ' selected="true"' : '') . '>' . $lang['srv_textArea7line'] . '</option>';
- echo '<option value="10"' . ($otherHeight == 10 ? ' selected="true"' : '') . '>' . $lang['srv_textArea10line'] . '</option>';
- echo '<option value="20"' . ($otherHeight == 20 ? ' selected="true"' : '') . '>' . $lang['srv_textArea20line'] . '</option>';
- echo '<option value="30"' . ($otherHeight == 30 ? ' selected="true"' : '') . '>' . $lang['srv_textArea30line'] . '</option>';
- echo '</select></span>';
-
- echo '</p>';
-
- echo '</fieldset>';
- //}
+
+ $spremenljivkaParams = new enkaParameters($row['params']);
+
+ $otherWidth = ($spremenljivkaParams->get('otherWidth') ? $spremenljivkaParams->get('otherWidth') : -1);
+ $otherHeight = ($spremenljivkaParams->get('otherHeight') ? $spremenljivkaParams->get('otherHeight') : 1);
+
+
+ // ce je prisotna moznost Drugo,
+ if(mysqli_num_rows($sql) > 0){
+ echo '<fieldset id="fieldset'.$row['id'].'"><legend>'.$lang['srv_other_size'].'</legend>';
+ }
+ // drugace je to skrito
+ else{
+ echo '<fieldset id="fieldset'.$row['id'].'" style="display:none;"><legend>'.$lang['srv_other_size'].'</legend>';
+ }
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaWidth'].':</label>';
+ echo ' <span class="content"><select name="otherWidth" id="width">';
+ echo ' <option value="-1"' . ($otherWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
+ for($i=5; $i<61; $i+=5){
+ echo ' <option value="'.$i.'"' . ($otherWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ }
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_textAreaSize'].':</label>';
+ echo ' <span class="content"><select name="otherHeight" class="no-margin" id="height">';
+ echo ' <option value="1"' . ($otherHeight == 1 ? ' selected="true"' : '') . '>' . $lang['srv_textArea1line'] . '</option>';
+ echo ' <option value="3"' . ($otherHeight == 3 ? ' selected="true"' : '') . '>' . $lang['srv_textArea3line'] . '</option>';
+ echo ' <option value="5"' . ($otherHeight == 5 ? ' selected="true"' : '') . '>' . $lang['srv_textArea5line'] . '</option>';
+ echo ' <option value="7"' . ($otherHeight == 7 ? ' selected="true"' : '') . '>' . $lang['srv_textArea7line'] . '</option>';
+ echo ' <option value="10"' . ($otherHeight == 10 ? ' selected="true"' : '') . '>' . $lang['srv_textArea10line'] . '</option>';
+ echo ' <option value="20"' . ($otherHeight == 20 ? ' selected="true"' : '') . '>' . $lang['srv_textArea20line'] . '</option>';
+ echo ' <option value="30"' . ($otherHeight == 30 ? ' selected="true"' : '') . '>' . $lang['srv_textArea30line'] . '</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>';
}
/**
@@ -4394,10 +4857,19 @@ class Vprasanje {
$prvaVrstica_roleta = ($spremenljivkaParams->get('prvaVrstica_roleta') ? $spremenljivkaParams->get('prvaVrstica_roleta') : 1);
$sbSizeVse = mysqli_num_rows($sql1); //stevilo vnesenih moznih odgovorov
- echo '<span class="content"><select name="sbSizeVse" id="selectboxSizeVse'.$this->spremenljivka.'" style="display:none;">';
- echo '<option>'.$sbSizeVse.'</option>';
- echo '</select>';
-
+
+ echo '<div class="vprasanje_setting_holder" style="display:none;">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label></label>';
+ echo ' <span class="content"><select name="sbSizeVse" id="selectboxSizeVse'.$this->spremenljivka.'">';
+ echo ' <option>'.$sbSizeVse.'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
// Nastavimo prikaz nastavitve za stevilo vidnih moznosti v select box - ce imamo selectbox je ta moznost vidna, drugace ni
if (($row['tip'] == 6 || $row['tip'] == 16) && $row['enota'] != 2){
$display = (($row['tip'] == 6 || $row['tip'] == 16) && $row['enota'] != 6 && $row['enota'] != 8) ? ' style="display:none;"' : '';
@@ -4415,42 +4887,47 @@ class Vprasanje {
$sbSize = ($spremenljivkaParams->get('sbSize') ? $spremenljivkaParams->get('sbSize') : $sbSizeVse);
- echo '<div class="dropselectboxsize" '.$display.'>';
- echo '<p><span class="title" >'.$lang['srv_stevilo_odgovorov_selectbox'].':</span>';
- echo '<span class="content"><select name="sbSize" id="selectboxSize'.$this->spremenljivka.'">';
-
+
+ echo '<div class="vprasanje_setting_holder dropselectboxsize" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_stevilo_odgovorov_selectbox'].':</label>';
+ echo ' <span class="content"><select name="sbSize" id="selectboxSize'.$this->spremenljivka.'">';
for($i=2; $i<$sbSizeVse; $i++){
- echo '<option value="'.$i.'"'.($sbSize == $i ? ' selected="true"' : '') . '>'.$i.'</option>';
+ echo ' <option value="'.$i.'"'.($sbSize == $i ? ' selected="true"' : '') . '>'.$i.'</option>';
}
- echo '<option value="'.$sbSizeVse.'"'.($sbSize == $sbSizeVse ? ' selected="true"' : '') . '>'.$lang['srv_select_box_vse'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo ' <option value="'.$sbSizeVse.'"'.($sbSize == $sbSizeVse ? ' selected="true"' : '') . '>'.$lang['srv_select_box_vse'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
- echo '<div class="dropselectboxsizeprvavrstica" '.$display.'>';
- echo '<p><span class="title" >'.$lang['srv_select_box_prva_vrstica'].':</span>';
- echo '<span class="content"><select name="prvaVrstica" id="prvaVrstica'.$this->spremenljivka.'">'; //echo '<span class="content"><select name="prvaVrstica" id="prvaVrstica">';
-
- echo '<option value="1"'.($prvaVrstica == 1 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_1'].'</option>';
- echo '<option value="2"'.($prvaVrstica == 2 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_2'].'</option>';
- echo '<option value="3"'.($prvaVrstica == 3 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_3'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder dropselectboxsizeprvavrstica" '.$display.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_select_box_prva_vrstica'].':</label>';
+ echo ' <span class="content"><select name="prvaVrstica" id="prvaVrstica'.$this->spremenljivka.'">';
+ echo ' <option value="1"'.($prvaVrstica == 1 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_1'].'</option>';
+ echo ' <option value="2"'.($prvaVrstica == 2 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_2'].'</option>';
+ echo ' <option value="3"'.($prvaVrstica == 3 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_3'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
- echo '<div class="dropselectboxsizeprvavrstica_roleta" '.$displayprvavrstica_roleta.'>';
- echo '<p><span class="title" >'.$lang['srv_select_box_prva_vrstica'].':</span>';
- echo '<span class="content"><select name="prvaVrstica_roleta" id="prvaVrstica_roleta'.$this->spremenljivka.'">'; //echo '<span class="content"><select name="prvaVrstica" id="prvaVrstica">';
-
- echo '<option value="1"'.($prvaVrstica_roleta == 1 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_2'].'</option>';
-
- echo '<option value="3"'.($prvaVrstica_roleta == 3 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_3'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder dropselectboxsizeprvavrstica_roleta" '.$displayprvavrstica_roleta.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_select_box_prva_vrstica'].':</label>';
+ echo ' <span class="content"><select name="prvaVrstica_roleta" id="prvaVrstica_roleta'.$this->spremenljivka.'">';
+ echo ' <option value="1"'.($prvaVrstica_roleta == 1 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_2'].'</option>';
+ echo ' <option value="3"'.($prvaVrstica_roleta == 3 ? ' selected="true"' : '') . '>'.$lang['srv_select_box_prva_vrstica_3'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
-
}
// Nastavitev text vprasanja, da se pod njim prikazejo odgovori prejsnjih respondentov
@@ -4462,11 +4939,15 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$prevAnswers = ($spremenljivkaParams->get('prevAnswers') ? $spremenljivkaParams->get('prevAnswers') : 0);
- echo '<p>';
- echo '<label for="prevAnswers" class="title">'.$lang['srv_setting_prevAnswers'].': </label>';
- echo '<span class="content"><input type="hidden" name="prevAnswers" value="0" />';
- echo '<input type="checkbox" id="prevAnswers" name="prevAnswers" value="1" '.(($prevAnswers == 1) ? ' checked="checked" ' : '').' />';
- echo '</span></p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <input type="hidden" name="prevAnswers" value="0" />';
+ echo ' <input type="checkbox" id="prevAnswers" name="prevAnswers" value="1" '.(($prevAnswers == 1) ? ' checked="checked" ' : '').' />';
+ echo ' <label for="prevAnswers">'.$lang['srv_setting_prevAnswers'].' </label>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -4484,33 +4965,39 @@ class Vprasanje {
$customRadioNumber = ($spremenljivkaParams->get('customRadioNumber') ? $spremenljivkaParams->get('customRadioNumber') : '5');
$customRadio = $spremenljivkaParams->get('customRadio');
- echo '<div class="custom-picture-radio" '.$displayCustomRadio.'>';
- echo '<p><span class="title" >'.$lang['srv_custom-picture_radio_label'].':</span>';
- echo '<span class="content"><select name="customRadio" id="customRadioSelect'.$this->spremenljivka.'">';
- echo '<option value="star" '.($customRadio == "star" ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_star'].'</option>';
- echo '<option value="smiley" '.($customRadio == "smiley" ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_smiley'].'</option>';
- echo '<option value="thumb" '.($customRadio == 'thumb' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_thumb'].'</option>';
- echo '<option value="heart" '.($customRadio == 'heart' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_heart'].'</option>';
- echo '<option value="flag" '.($customRadio == 'flag' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_flag'].'</option>';
- echo '<option value="user" '.($customRadio == 'user' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_user'].'</option>';
- echo '</select></span>';
- echo '</p>';
-
- $preveriOdgovore = sisplet_query("SELECT spr_id FROM srv_data_vrednost" . $this->db_table. " WHERE spr_id='".$this->spremenljivka."'");
- $stOdgovorov=1;
- if(mysqli_num_rows($preveriOdgovore)){
- $stOdgovorov = $customRadioNumber;
- }
- if($row['tip'] != 6) {
- echo '<p><span class="title" >' . $lang['srv_custom-picture_number_label'] . ':</span>';
- echo '<span class="content"><select name="customRadioNumber" id="customRadioNumberSelect' . $this->spremenljivka . '">';
- for ($n = $stOdgovorov ; $n < 13; $n++) {
- echo '<option value="' . $n . '" ' . (($customRadioNumber == $n) ? 'selected="selected"' : '') . '>' . $n . '</option>';
- }
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder custom-picture-radio" '.$displayCustomRadio.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_custom-picture_radio_label'].':</label>';
+ echo ' <span class="content"><select name="customRadio" id="customRadioSelect'.$this->spremenljivka.'">';
+ echo ' <option value="star" '.($customRadio == "star" ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_star'].'</option>';
+ echo ' <option value="smiley" '.($customRadio == "smiley" ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_smiley'].'</option>';
+ echo ' <option value="thumb" '.($customRadio == 'thumb' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_thumb'].'</option>';
+ echo ' <option value="heart" '.($customRadio == 'heart' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_heart'].'</option>';
+ echo ' <option value="flag" '.($customRadio == 'flag' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_flag'].'</option>';
+ echo ' <option value="user" '.($customRadio == 'user' ? 'selected="selected"' : '').'>'.$lang['srv_custom-picture_radio_user'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ $preveriOdgovore = sisplet_query("SELECT spr_id FROM srv_data_vrednost".$this->db_table." LEFT JOIN srv_user ON srv_user.id = srv_data_vrednost".$this->db_table.".usr_id WHERE spr_id='".$this->spremenljivka."' AND deleted = '0' AND preview = '0'");
+ $stOdgovorov=1;
+ if(mysqli_num_rows($preveriOdgovore)){
+ $stOdgovorov = $customRadioNumber;
+ }
+
+ if($row['tip'] != 6) {
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_custom-picture_number_label'].':</label>';
+ echo ' <span class="content"><select '.(mysqli_num_rows($preveriOdgovore) > 0 ? "disabled" : "").' name="customRadioNumber" id="customRadioNumberSelect' . $this->spremenljivka . '">';
+ for ($n = $stOdgovorov ; $n < 13; $n++) {
+ echo '<option value="' . $n . '" ' . (($customRadioNumber == $n) ? 'selected="selected"' : '') . '>' . $n . '</option>';
}
+ echo ' </select></span>';
+ echo ' </div>';
+ }
+
echo '</div>';
}
@@ -4527,32 +5014,74 @@ class Vprasanje {
$vizualnaSkalaNumber = ($spremenljivkaParams->get('vizualnaSkalaNumber') ? $spremenljivkaParams->get('vizualnaSkalaNumber') : '5');
- echo '<div class="vizualna-analogna-skala" '.$displayAnalognoSkalo.'><p><span class="title" >'.$lang['srv_custom-picture_number_label'].':</span>';
- echo '<span class="content"><select name="vizualnaSkalaNumber" id="vizualnaSkalaNumberSelect'.$this->spremenljivka.'">';
- for($n=2; $n<8; $n++){
+ $preveriOdgovore = sisplet_query("SELECT spr_id FROM srv_data_vrednost".$this->db_table." LEFT JOIN srv_user ON srv_user.id = srv_data_vrednost".$this->db_table.".usr_id WHERE spr_id='".$this->spremenljivka."' AND deleted = '0' AND preview = '0'");
+
+ echo '<div class="vprasanje_setting_holder vizualna-analogna-skala" '.$displayAnalognoSkalo.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_custom-picture_number_label'].':</label>';
+ echo ' <span class="content"><select '.(mysqli_num_rows($preveriOdgovore) > 0 ? "disabled" : "").' name="vizualnaSkalaNumber" id="vizualnaSkalaNumberSelect'.$this->spremenljivka.'">';
+
+ $stOdgovorov=2;
+ if(mysqli_num_rows($preveriOdgovore)){
+ $stOdgovorov = $vizualnaSkalaNumber;
+ }
+
+ for($n = $stOdgovorov; $n<8; $n++){
echo '<option value="'.$n.'" '.(($vizualnaSkalaNumber == $n) ? 'selected="selected"' : '').'>'.$n.'</option>';
}
- echo '</select></span>';
- echo '</p>';
+ echo ' </select></span>';
+ echo ' </div>';
+
echo '</div>';
}
+
+ // nastavitev izgleda vizualne analogne skale
+ /**
+ * 0 = vse sivo
+ * 1 = barvno
+ */
+ function edit_visual_analog_type() {
+ global $lang;
+
+ $row = Cache::srv_spremenljivka($this->spremenljivka);
+ $spremenljivkaParams = new enkaParameters($row['params']);
+
+ $displayAnalognoSkalo = ($row['orientation'] == 11) ? '' :' style="display:none;"';
+
+ $visual_type = ($spremenljivkaParams->get('visual_type') ? $spremenljivkaParams->get('visual_type') : '0');
+
+ echo '<div class="vprasanje_setting_holder vizualna-analogna-skala" '.$displayAnalognoSkalo.'>';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_custom-picture_visual_type'].': </label>';
+ echo ' <span class="content"><select name="visual_type">';
+ echo ' <option value="0" '.(($visual_type == 0) ? ' selected="true" ' : '').'>'.$lang['srv_custom-picture_visual_type_gray'].'</option>';
+ echo ' <option value="1" '.(($visual_type == 1) ? ' selected="true" ' : '').'>'.$lang['srv_custom-picture_visual_type_colored'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
- // nastavitev za lokacijo podtip
+ // nastavitev za lokacijo podtip
function edit_subtype_map() {
global $lang;
$row = Cache::srv_spremenljivka($this->spremenljivka);
- echo '<p>';
- echo '<span class="title">'.$lang['srv_vprasanje_podtip_map'].':</span>';
- echo '<span class="content">';
- echo '<select name="podtip_lokacija" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="change_map(this.value, '.$this->spremenljivka.');">';
- echo '<option value="1" '.(($row['enota'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_mylocation'].'</option>';
- echo '<option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_multilocation'].'</option>';
- echo '<option value="3" '.(($row['enota'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_chooselocation'].'</option>';
-
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo '<div class="vprasanje_setting_line right-190">';
+ echo ' <label>'.$lang['srv_vprasanje_podtip_map'].':</label>';
+ echo ' <span class="content"><select name="podtip_lokacija" id="spremenljivka_podtip_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="change_map(this.value, '.$this->spremenljivka.');">';
+ echo ' <option value="1" '.(($row['enota'] == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_mylocation'].'</option>';
+ echo ' <option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_multilocation'].'</option>';
+ echo ' <option value="3" '.(($row['enota'] == 3) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_chooselocation'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+
+ echo '</div>';
}
/**
@@ -4567,18 +5096,18 @@ class Vprasanje {
$newParams = new enkaParameters($row['params']);
$input = $newParams->get('multi_input_type') ? $newParams->get('multi_input_type') : 'marker';
- echo '<p id="multi_input_type_map" '. ($row['enota'] == 2 ? '' : 'style="display: none;"').'>';
- echo '<span class="title" >'.$lang['srv_vprasanje_input_type_map'].': </span>';
- echo '<span class="content">';
+ echo '<div id="multi_input_type_map" class="vprasanje_setting_holder" '.($row['enota'] == 2 ? '' : 'style="display: none;"').'>';
- //roleta
- echo '<select name="multi_input_type" id="multi_input_type_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="change_input_map(this.value, '.$this->spremenljivka.');">';
- echo '<option value="marker" '.(($input == 'marker') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_marker'].'</option>';
- echo '<option value="polyline" '.(($input == 'polyline') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_line'].'</option>';
- echo '<option value="polygon" '.(($input == 'polygon') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_polygon'].'</option>';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_input_type_map'].': </label>';
+ echo ' <span class="content"><select name="multi_input_type" id="multi_input_type_' . $row['id'] . '" spr_id="'.$row['id'].'" onChange="change_input_map(this.value, '.$this->spremenljivka.');">';
+ echo ' <option value="marker" '.(($input == 'marker') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_marker'].'</option>';
+ echo ' <option value="polyline" '.(($input == 'polyline') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_line'].'</option>';
+ echo ' <option value="polygon" '.(($input == 'polygon') ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_polygon'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
- echo '</select></span>';
- echo '</p>';
+ echo '</div>';
}
/**
@@ -4587,7 +5116,7 @@ class Vprasanje {
*/
public static function change_tip ($spremenljivka, $tip, $podtip = null) {
global $lang;
-
+ $anketa = null;
if ($spremenljivka <= 0) return;
sisplet_query("UPDATE srv_spremenljivka SET tip = '$tip' WHERE id='$spremenljivka'");
@@ -4618,17 +5147,17 @@ class Vprasanje {
// checkbox ima zraven default opombo
if ($tip == 2 && $row['orientation'] != 6) {
$s = sisplet_query("UPDATE srv_spremenljivka SET info='$lang[srv_info_checkbox]' WHERE id = '$spremenljivka'");
- }
- // checkbox s selectbox ima zraven default opombo
- elseif($tip == 2 && $row['orientation'] == 6){
+ }
+ // checkbox s selectbox ima zraven default opombo
+ elseif($tip == 2 && $row['orientation'] == 6){
$s = sisplet_query("UPDATE srv_spremenljivka SET info='$lang[srv_info_selectbox]' WHERE id = '$spremenljivka'");
}
// grid s checkboxi ima zraven default opombo
elseif ($tip == 16 && $row['enota'] != 6) {
$s = sisplet_query("UPDATE srv_spremenljivka SET info='$lang[srv_info_checkbox]' WHERE id = '$spremenljivka'");
- }
- //grid s selectboxi ima zraven default opombo
- elseif($tip == 16 && $row['enota'] == 6){
+ }
+ //grid s selectboxi ima zraven default opombo
+ elseif($tip == 16 && $row['enota'] == 6){
$s = sisplet_query("UPDATE srv_spremenljivka SET info='$lang[srv_info_selectbox]' WHERE id = '$spremenljivka'");
}
else {
@@ -4641,29 +5170,36 @@ class Vprasanje {
// nastavimo nazaj na admin jezik
$file = '../../lang/'.$lang_admin.'.php';
include($file);
-
+
+
+ // checkbox je vedno nominalna - ob preklopu damo kar na default
+ if ($tip == 2) {
+ $s = sisplet_query("UPDATE srv_spremenljivka SET skala='-1' WHERE id = '$spremenljivka'");
+ }
//besedilo* - pobrisemo odvecne vrednosti
if ($tip == 21){
- sisplet_query("UPDATE srv_spremenljivka SET size=text_kosov WHERE id='$spremenljivka'");
- $row['size'] = $row['text_kosov']; // ker se spodaj bere se size
- sisplet_query("DELETE FROM srv_vrednost WHERE vrstni_red > '$row[text_kosov]' AND spr_id='$spremenljivka' AND other = 0");
- sisplet_query("UPDATE srv_vrednost SET naslov='$lang[srv_new_text]', naslov_graf='$lang[srv_new_text]' WHERE spr_id='$spremenljivka' AND other = 0");
-
- //fotografiranje ima svojo variablo
- if($podtip != null && $podtip == 7){
- $sql1 = sisplet_query("SELECT s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$anketa' AND s.tip='21' AND s.upload=2 AND s.id!='$spremenljivka'");
- if (!$sql1) echo 'err453'.mysqli_error($GLOBALS['connect_db']);
- $c = 0;
- while ($row1 = mysqli_fetch_array($sql1)) {
- $row1['variable'] = (int)str_replace('FOTO', '', $row1['variable']);
- if ($row1['variable'] > $c)
- $c = $row1['variable'];
- }
- $c++;
- $variable = 'FOTO'.$c;
- sisplet_query("UPDATE srv_spremenljivka SET variable='$variable', variable_custom='1' WHERE id = '$spremenljivka'");
- }
+
+ sisplet_query("UPDATE srv_spremenljivka SET size=text_kosov WHERE id='$spremenljivka'");
+ $row['size'] = $row['text_kosov']; // ker se spodaj bere se size
+
+ sisplet_query("DELETE FROM srv_vrednost WHERE vrstni_red > '$row[text_kosov]' AND spr_id='$spremenljivka' AND other = 0");
+ sisplet_query("UPDATE srv_vrednost SET naslov='$lang[srv_new_text]', naslov_graf='$lang[srv_new_text]' WHERE spr_id='$spremenljivka' AND other = 0");
+
+ //fotografiranje ima svojo variablo
+ if($podtip != null && $podtip == 7){
+ $sql1 = sisplet_query("SELECT s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.gru_id=g.id AND g.ank_id='$anketa' AND s.tip='21' AND s.upload=2 AND s.id!='$spremenljivka'");
+ if (!$sql1) echo 'err453'.mysqli_error($GLOBALS['connect_db']);
+ $c = 0;
+ while ($row1 = mysqli_fetch_array($sql1)) {
+ $row1['variable'] = (int)str_replace('FOTO', '', $row1['variable']);
+ if ($row1['variable'] > $c)
+ $c = $row1['variable'];
+ }
+ $c++;
+ $variable = 'FOTO'.$c;
+ sisplet_query("UPDATE srv_spremenljivka SET variable='$variable', variable_custom='1' WHERE id = '$spremenljivka'");
+ }
}
// number ima na zacetku size 1 in enoto 0
@@ -4745,11 +5281,14 @@ class Vprasanje {
$values = "";
for ($i = $rowc['count']; $i <= $row['size']; $i++) {
if ($values != "") $values .= ",";
- if ($row['tip']==21 || $row['tip']==7 || $row['tip']==22) $def_naslov = $lang['srv_new_text']; else $def_naslov = $lang['srv_new_vrednost'].' '.$i;
+ if ($row['tip']==21 || $row['tip']==7 || $row['tip']==22) $def_naslov = $lang['srv_new_text'];
+ elseif ($row['tip']==6 || $row['tip']==16 || $row['tip']==19 || $row['tip']==24 || $row['tip']==20) $def_naslov = $lang['srv_new_vrednost_grid'].' '.$i;
+ else $def_naslov = $lang['srv_new_vrednost'].' '.$i;
$values .= " ('$spremenljivka', '$i', '$def_naslov', '$i', '$def_naslov') ";
}
$sql1 = sisplet_query("INSERT INTO srv_vrednost (spr_id, variable, naslov, vrstni_red, naslov2) VALUES $values");
- } else {
+ }
+ else {
sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$spremenljivka'");
}
@@ -4764,14 +5303,16 @@ class Vprasanje {
}
$sql1 = sisplet_query("INSERT INTO srv_grid (id, spr_id, naslov, vrstni_red, variable) VALUES $values");
- } else {
+ }
+ else {
sisplet_query("DELETE FROM srv_grid WHERE spr_id = '$spremenljivka'");
}
// multiple tabela
if ($row['tip'] == 24) {
// zaenkrat nic
- } else {
+ }
+ else {
// pri brisanju multiple grid vprasanja, moramo pobrisate tudi vse child spremenljivke (ker kljuci niso nastavljeni)
$sqld = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka'");
while ($rowd = mysqli_fetch_array($sqld)) {
@@ -4781,7 +5322,6 @@ class Vprasanje {
}
Cache::clear_cache();
-
}
/**
@@ -4790,7 +5330,7 @@ class Vprasanje {
*/
function set_captcha () {
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
+ $update = '';
$newParams = new enkaParameters($row['params']);
$newParams->set('captcha', 1);
@@ -4807,7 +5347,7 @@ class Vprasanje {
*/
function set_datum () {
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
+ $update = '';
$newParams = new enkaParameters($row['params']);
$newParams->set('multigrid-datum', 1);
@@ -4824,7 +5364,7 @@ class Vprasanje {
*/
function set_email ($reminder=2) {
global $lang;
-
+ $update = '';
$row = Cache::srv_spremenljivka($this->spremenljivka);
$newParams = new enkaParameters($row['params']);
$newParams->set('emailVerify', 1);
@@ -4920,7 +5460,7 @@ class Vprasanje {
*/
function set_box () {
$row = Cache::srv_spremenljivka($this->spremenljivka);
-
+ $update = '';
$newParams = new enkaParameters($row['params']);
$newParams->set('taSize', 5);
@@ -4939,7 +5479,7 @@ class Vprasanje {
function set_map ($podtip) {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$newParams = new enkaParameters($row['params']);
-
+ $update = '';
//multi lokacija
if($podtip == 2){
$newParams->set('user_location', 0);
@@ -5018,8 +5558,8 @@ class Vprasanje {
if ($this->spremenljivka < -3) return; // -1, -2, -3 so uvod, zakljucek in statistika
- $lang_id = $_POST['lang_id'];
-
+ $lang_id = isset($_POST['lang_id']) ? $_POST['lang_id'] : 0;
+
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
@@ -5029,6 +5569,8 @@ class Vprasanje {
$spremenljivkaParams = new enkaParameters($row['params']);
$diferencial_trak = ($spremenljivkaParams->get('diferencial_trak') ? $spremenljivkaParams->get('diferencial_trak') : 0); //za checkbox
+ $other = '0';
+
// urejanje grida
if (isset($_POST['edit_grid'])) {
@@ -5050,9 +5592,9 @@ class Vprasanje {
$other = '0';
# manjkoajoče vrednosti (ne vem, zavrnil ...
- if (isset($_POST['missing_value_checkbox']) && is_array($_POST['missing_value_checkbox'])) {
+ if (isset($_POST['missing_value_checkbox_'.$row['id']]) && is_array($_POST['missing_value_checkbox_'.$row['id']])) {
- if (in_array($grid, $_POST['missing_value_checkbox'])) {
+ if (in_array($grid, $_POST['missing_value_checkbox_'.$row['id']])) {
# grid je manjkajoča vrednost
$other = $grid.'';
$id = $grid;
@@ -5186,7 +5728,7 @@ class Vprasanje {
$count = $_POST['grids_count'];
}
- $countAll = (isset($_POST['missing_value_checkbox']) && is_array($_POST['missing_value_checkbox'])) ? $count + count($_POST['missing_value_checkbox']) : $count;
+ $countAll = (isset($_POST['missing_value_checkbox_'.$row['id']]) && is_array($_POST['missing_value_checkbox_'.$row['id']])) ? $count + count($_POST['missing_value_checkbox_'.$row['id']]) : $count;
//pobrisemo gride ki so prevec
sisplet_query("DELETE FROM srv_grid WHERE spr_id='$this->spremenljivka' AND vrstni_red > '$count' AND other = '0' AND part = '1'");
@@ -5208,7 +5750,7 @@ class Vprasanje {
}
//dodamo podvojen grid pri dvojni tabeli
- if($_POST['enota'] == 3){
+ if(isset($_POST['enota']) && $_POST['enota'] == 3){
$sqlN = sisplet_query("SELECT naslov FROM srv_grid WHERE spr_id='$this->spremenljivka' AND id = '$id'");
$rowN = mysqli_fetch_array($sqlN);
@@ -5222,11 +5764,11 @@ class Vprasanje {
}
# napolnimo/pobrisemo manjkajoče vrednosti (ne vem, zavrnil ...
- if (isset($_POST['missing_value_checkbox']) && is_array($_POST['missing_value_checkbox'])) {
+ if (isset($_POST['missing_value_checkbox_'.$row['id']]) && is_array($_POST['missing_value_checkbox_'.$row['id']])) {
$vrstni_red = $count;
- foreach($_POST['missing_value_checkbox'] as $key => $missing){
+ foreach($_POST['missing_value_checkbox_'.$row['id']] as $key => $missing){
# popravimi za missing vrednosi
# katere missinge imamo na voljo
@@ -5396,20 +5938,22 @@ class Vprasanje {
$j = 0;
for ($j = 1; $j <= $kosov; $j++) {
$vrstni_red = $j;
- //$naslov = $_POST['vrednost_naslov_'.$vrstni_red];
- $naslov = $lang['srv_new_text'];
- $size = $_POST['vrednost_size_'.$vrstni_red];
-
- //$s = sisplet_query("UPDATE srv_vrednost SET naslov='".$_POST['vrednost_naslov_'.$j]."', size='".$_POST['vrednost_size_'.$j]."' WHERE vrstni_red='$j' AND other = '0' AND spr_id='$this->spremenljivka'");
- $s = sisplet_query("UPDATE srv_vrednost SET size='".$_POST['vrednost_size_'.$j]."' WHERE vrstni_red='$j' AND other = '0' AND spr_id='$this->spremenljivka'");
- $s = sisplet_query("SELECT id FROM srv_vrednost WHERE vrstni_red='$vrstni_red' AND spr_id='$this->spremenljivka' AND other = 0");
- if(mysqli_num_rows($s) == 0){
- $i = sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, size, vrstni_red) VALUES ('', '$this->spremenljivka', '$naslov', '$size', '$vrstni_red')");
- }
+ if(isset($_POST['vrednost_size_'.$j])){
- unset($_POST['vrednost_naslov_'.$j]);
- unset($_POST['vrednost_size_'.$j]);
+ $naslov = $lang['srv_new_text'];
+ $size = $_POST['vrednost_size_'.$j];
+
+ $s = sisplet_query("UPDATE srv_vrednost SET size='".$_POST['vrednost_size_'.$j]."' WHERE vrstni_red='$vrstni_red' AND other = '0' AND spr_id='$this->spremenljivka'");
+
+ $s = sisplet_query("SELECT id FROM srv_vrednost WHERE vrstni_red='$vrstni_red' AND spr_id='$this->spremenljivka' AND other = 0");
+ if(mysqli_num_rows($s) == 0){
+ $i = sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, size, vrstni_red) VALUES ('', '$this->spremenljivka', '$naslov', '$size', '$vrstni_red')");
+ }
+
+ unset($_POST['vrednost_naslov_'.$j]);
+ unset($_POST['vrednost_size_'.$j]);
+ }
}
# popravimo polja drugo, nevem...
@@ -5434,7 +5978,6 @@ class Vprasanje {
for ($j = 1; $j <= $kosov; $j++) {
$vrstni_red = $j;
- //$naslov = $_POST['vrednost_naslov_'.$vrstni_red];
$naslov = $lang['srv_new_text'];
$size = $_POST['vrednost_size_'.$vrstni_red];
@@ -5542,8 +6085,12 @@ class Vprasanje {
}
if (isset($_POST['label'])) {
- if ($_POST['label'] != $row['label'])
- $update .= ", label='$_POST[label]' ";
+ if ($_POST['label'] != $row['label']){
+
+ $label_text = strip_tags($_POST['label']);
+
+ $update .= ", label='$label_text' ";
+ }
}
// // shrani opombo
@@ -5576,11 +6123,13 @@ class Vprasanje {
// nastavitve uvoda
if ( isset($_POST['intro_opomba'])) {
+
if (isset($_POST['intro_opomba'])) {
- $intro_opomba = $_POST['intro_opomba'];
- $intro_note = $_POST['note'];
+ $intro_opomba = strip_tags($_POST['intro_opomba']);
+ $intro_note = strip_tags($_POST['note']);
$intro = " intro_opomba='".$intro_opomba."', intro_note='$intro_note'";
- } else $intro = '';
+ }
+ else $intro = '';
unset($_POST['note']); // da ne gre shranjevat v srv_spremenljivka
@@ -5645,11 +6194,11 @@ class Vprasanje {
SurveySetting::getInstance()->setSurveyMiscSetting('concl_url_status', $_POST['concl_url_status']);
SurveySetting::getInstance()->setSurveyMiscSetting('concl_url_recnum', $_POST['concl_url_recnum']);
- $concl_opomba = $_POST['concl_opomba'];
- $concl_note = $_POST['note'];
+ $concl_opomba = strip_tags($_POST['concl_opomba']);
+ $concl_note = strip_tags($_POST['note']);
- $concl_back_button = $_POST['concl_back_button'];
- $concl_end_button = $_POST['concl_end_button'];
+ $concl_back_button = strip_tags($_POST['concl_back_button']);
+ $concl_end_button = strip_tags($_POST['concl_end_button']);
// shrani prikaz povezave na zacetek ankete za naknadno urejanje
$concl_return_edit = $_POST['concl_return_edit'];
@@ -5759,8 +6308,8 @@ class Vprasanje {
$other = '0';
# manjkoajoče vrednosti (ne vem, zavrnil ...
- if (isset($_POST['missing_value_checkbox']) && is_array($_POST['missing_value_checkbox'])) {
- if (in_array($grid, $_POST['missing_value_checkbox'])) {
+ if (isset($_POST['missing_value_checkbox_'.$row['id']]) && is_array($_POST['missing_value_checkbox_'.$row['id']])) {
+ if (in_array($grid, $_POST['missing_value_checkbox_'.$row['id']])) {
# grid je manjkajoča vrednost
$other = $grid.'';
$id = $grid;
@@ -5828,17 +6377,21 @@ class Vprasanje {
$update .= ", reminder = '$_POST[reminder]' ";
}
+ // shrani nastavitev za prikaz "ostalo" ob opozorilu
+ if (isset($_POST['alert_show_96_'.$this->spremenljivka])) {
+ $update .= ", alert_show_96 = '".$_POST['alert_show_96_'.$this->spremenljivka]."' ";
+ }
// shrani nastavitev za prikaz "neustrezno" ob opozorilu
- if (isset($_POST['alert_show_97'])) {
- $update .= ", alert_show_97 = '$_POST[alert_show_97]' ";
+ if (isset($_POST['alert_show_97_'.$this->spremenljivka])) {
+ $update .= ", alert_show_97 = '".$_POST['alert_show_97_'.$this->spremenljivka]."' ";
}
// shrani nastavitev za prikaz "zavrnil" ob opozorilu
- if (isset($_POST['alert_show_98'])) {
- $update .= ", alert_show_98 = '$_POST[alert_show_98]' ";
+ if (isset($_POST['alert_show_98_'.$this->spremenljivka])) {
+ $update .= ", alert_show_98 = '".$_POST['alert_show_98_'.$this->spremenljivka]."' ";
}
// shrani nastavitev za prikaz "ne vem" ob opozorilu
- if (isset($_POST['alert_show_99'])) {
- $update .= ", alert_show_99 = '$_POST[alert_show_99]' ";
+ if (isset($_POST['alert_show_99_'.$this->spremenljivka])) {
+ $update .= ", alert_show_99 = '".$_POST['alert_show_99_'.$this->spremenljivka]."' ";
}
// shrani nastavitev za razvrstitev vrednosti spr
@@ -5877,21 +6430,32 @@ class Vprasanje {
if($_POST['vsota_limittype'] == 1){
$vsota_limittype = 1;
- $vsota_min = $_POST['vsota_min'];
- $vsota_limit = $_POST['vsota_limit'];
+ $vsota_min = isset($_POST['vsota_min']) ? $_POST['vsota_min'] : '';
+ $vsota_limit = isset($_POST['vsota_limit']) ? $_POST['vsota_limit'] : '';
}
else{
$vsota_limittype = 0;
- $vsota_min = $_POST['vsota_exact'];
- $vsota_limit = $_POST['vsota_exact'];
+ $vsota_min = isset($_POST['vsota_exact']) ? $_POST['vsota_exact'] : '';
+ $vsota_limit = isset($_POST['vsota_exact']) ? $_POST['vsota_exact'] : '';
}
$update .= ", vsota_reminder = '$_POST[vsota_reminder]', vsota_min = '$vsota_min', vsota_limit = '$vsota_limit', vsota_limittype = '$vsota_limittype', vsota_show='$_POST[vsota_show]' ";
}
// shrani nastavitve za omejitve stevila
- if (isset($_POST['edit_number_limit'])) {
- $update .= ", vsota_reminder = '$_POST[vsota_reminder]', num_useMin = '$_POST[num_useMin]', num_useMax = '$_POST[num_useMax]', vsota_min = '$_POST[vsota_min]', vsota_limit = '$_POST[vsota_limit]', vsota_show='$_POST[vsota_show]', num_useMin2 = '$_POST[num_useMin2]', num_useMax2 = '$_POST[num_useMax2]', num_min2 = '$_POST[num_min2]', num_max2 = '$_POST[num_max2]'";
+ if (isset($_POST['edit_number_limit'])) {
+ $vsota_reminder = isset($_POST['vsota_reminder']) ? $_POST['vsota_reminder'] : '';
+ $num_useMin = isset($_POST['num_useMin']) ? $_POST['num_useMin'] : '';
+ $num_useMax = isset($_POST['num_useMax']) ? $_POST['num_useMax'] : '';
+ $vsota_min = isset($_POST['vsota_min']) ? $_POST['vsota_min'] : '';
+ $vsota_limit = isset($_POST['vsota_limit']) ? $_POST['vsota_limit'] : '';
+ $vsota_show = isset($_POST['vsota_show']) ? $_POST['vsota_show'] : '';
+ $num_useMin2 = isset($_POST['num_useMin2']) ? $_POST['num_useMin2'] : '';
+ $num_useMax2 = isset($_POST['num_useMax2']) ? $_POST['num_useMax2'] : '';
+ $num_min2 = isset($_POST['num_min2']) ? $_POST['num_min2'] : '';
+ $num_max2 = isset($_POST['num_max2']) ? $_POST['num_max2'] : '';
+
+ $update .= ", vsota_reminder = '$vsota_reminder', num_useMin = '$num_useMin', num_useMax = '$num_useMax', vsota_min = '$vsota_min', vsota_limit = '$vsota_limit', vsota_show='$vsota_show', num_useMin2 = '$num_useMin2', num_useMax2 = '$num_useMax2', num_min2 = '$num_min2', num_max2 = '$num_max2'";
}
// shrani nastavitev za razvrscanje - tip
@@ -6018,6 +6582,8 @@ class Vprasanje {
|| isset($_POST['sbSizeVse'])
|| isset($_POST['prevAnswers'])
|| isset($_POST['disabled_vprasanje'])
+ || isset($_POST['mobile_tables'])
+ || isset($_POST['pc_tables'])
|| isset($_POST['slider_handle'])
|| isset($_POST['slider_MinMaxNumLabel'])
|| isset($_POST['slider_MinMaxLabel'])
@@ -6122,24 +6688,27 @@ class Vprasanje {
$newParams->set('presetValue', $_POST['presetValue']);
if (isset($_POST['sbSize']))
$newParams->set('sbSize', $_POST['sbSize']);
- if (isset($_POST['customRadio']))
- $newParams->set('customRadio', ((in_array($row['tip'], [1,6]) && ($row['enota'] == 12 || $row['orientation'] == 9)) ? $_POST['customRadio'] : ''));
+ if (isset($_POST['customRadio'])){
+ $newParams->set('customRadio', ((in_array($row['tip'], [1,6]) && ($row['enota'] == 12 || (isset($_POST['orientation']) && $_POST['orientation'] == 9) )) ? $_POST['customRadio'] : ''));
+ }
if (isset($_POST['customRadioNumber']) && $_POST['customRadioNumber'] > 0) {
- if ($_POST['tip'] == 6 && $row['enota'] == 12) {
+ if ($_POST['tip'] == 6 && $row['enota'] == 12)
$customRadioNumber = $_POST['grids_count'];
- }else{
+ else
$customRadioNumber = $_POST['customRadioNumber'];
- }
+
$newParams->set('customRadioNumber', $customRadioNumber);
}
if (isset($_POST['vizualnaSkalaNumber']) && $_POST['vizualnaSkalaNumber'] > 0) {
- if ($_POST['tip'] == 6 && $row['enota'] == 11) {
+ if ($_POST['tip'] == 6 && $row['enota'] == 11)
$vizualnaSkalaNumber = ($_POST['grids_count'] > 7 ? 7 : $_POST['grids_count']);
- }else{
+ else
$vizualnaSkalaNumber = $_POST['vizualnaSkalaNumber'];
- }
+
$newParams->set('vizualnaSkalaNumber', $vizualnaSkalaNumber);
}
+ if (isset($_POST['visual_type']))
+ $newParams->set('visual_type', $_POST['visual_type']);
if (isset($_POST['prvaVrstica']))
$newParams->set('prvaVrstica', $_POST['prvaVrstica']);
if (isset($_POST['prvaVrstica_roleta']))
@@ -6150,6 +6719,10 @@ class Vprasanje {
$newParams->set('prevAnswers', $_POST['prevAnswers']);
if (isset($_POST['disabled_vprasanje']))
$newParams->set('disabled_vprasanje', $_POST['disabled_vprasanje']);
+ if (isset($_POST['mobile_tables']))
+ $newParams->set('mobile_tables', $_POST['mobile_tables']);
+ if (isset($_POST['pc_tables']))
+ $newParams->set('pc_tables', $_POST['pc_tables']);
if ( isset($_POST['slider_handle']) )
$newParams->set('slider_handle', $_POST['slider_handle']);
if (isset($_POST['slider_MinMaxNumLabel']))
@@ -6342,12 +6915,11 @@ class Vprasanje {
}
//*******************
- if ($_POST['enota'] == 9){ //ce je postavitev drag and drop
+ if (isset($_POST['enota']) && $_POST['enota'] == 9){ //ce je postavitev drag and drop
$newParams->set('izris_droppable_grid', 0);
}
//**************************
-
-
+
$params = $newParams->getString();
$update .= ", params = '$params' ";
}
@@ -6379,12 +6951,20 @@ class Vprasanje {
$update .= ", orientation = '$_POST[orientation]', tip = '1', hidden_default = '0' "; //ce smo preklopli, ko je bilo vprasanje radio button, naj se vrne kot radio button
//v kolikor gre za slikovni tip radio buttons potem v tabelo srv_vrednost vstaviti ustrezno št. vrstic
- if($_POST['orientation'] == 9)
- $this->slikovni_tip($_POST['customRadioNumber']);
+ if($_POST['orientation'] == 9){
+ $customRadioNumber = '5';
+ if(isset($_POST['customRadioNumber'])) $customRadioNumber = $_POST['customRadioNumber'];
+ elseif($spremenljivkaParams->get('customRadioNumber') != '') $customRadioNumber = $spremenljivkaParams->get('customRadioNumber');
+ $this->slikovni_tip($customRadioNumber);
+ }
// vizualno analogno skalo buttons potem v tabelo srv_vrednost vstaviti ustrezno št. vrstic
- if($_POST['orientation'] == 11)
- $this->slikovni_tip($_POST['vizualnaSkalaNumber']);
+ if($_POST['orientation'] == 11){
+ $vizualnaSkalaNumber = '5';
+ if(isset($_POST['vizualnaSkalaNumber'])) $vizualnaSkalaNumber = $_POST['vizualnaSkalaNumber'];
+ elseif($spremenljivkaParams->get('vizualnaSkalaNumber') != '') $vizualnaSkalaNumber = $spremenljivkaParams->get('vizualnaSkalaNumber');
+ $this->slikovni_tip($vizualnaSkalaNumber);
+ }
}
}
}
@@ -6481,7 +7061,6 @@ class Vprasanje {
}
function slikovni_tip($number){
-
//pobrišemo dosedanje vrednosti
$dosedanjiVnosi = sisplet_query("SELECT id, naslov, variable, vrstni_red FROM srv_vrednost WHERE spr_id='".$this->spremenljivka."' ORDER BY vrstni_red");
$st = mysqli_num_rows($dosedanjiVnosi);
@@ -6501,11 +7080,11 @@ class Vprasanje {
}
}
elseif($st > $number) {
- $preveriOdgovore = sisplet_query("SELECT spr_id FROM srv_data_vrednost" . $this->db_table. " WHERE spr_id='".$this->spremenljivka."'");
+ //$preveriOdgovore = sisplet_query("SELECT spr_id FROM srv_data_vrednost" . $this->db_table. " WHERE spr_id='".$this->spremenljivka."'");
- if(mysqli_num_rows($preveriOdgovore) == 0){
+ //if(mysqli_num_rows($preveriOdgovore) == 0){
sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='".$this->spremenljivka."' AND vrstni_red>'".$number."'");
- }
+ //}
}
@@ -6567,6 +7146,8 @@ class Vprasanje {
Common::getInstance()->updateEditStamp();
$spremenljivka = $this->spremenljivka;
+
+ $rows = Cache::srv_spremenljivka($spremenljivka);
if($vrednost == null)
$vrednost = (int)$_POST['vrednost'];
@@ -6594,11 +7175,13 @@ class Vprasanje {
$return['output'] .= '<div class="popup_close"><a href="#" onClick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
$return['output'] .= '<p>'.$lang['spremenljivka_delete_data_vre'].'</p>';
- $return['output'] .= '<p>'.$lang['srv_brisivrednostconfirm_data'].'</p><br />';
+ $return['output'] .= '<p class="top16">'.$lang['srv_brisivrednostconfirm_data'].'</p>';
//ce se spremeni onclick, se prosim spremeni v datoteki vprasanjeInline.js v funkciji inline_vrednost_delete v else if (data.error == 2)
- $return['output'] .= '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_vrednost_delete(\''.$spremenljivka.'\', \''.$vrednost.'\', \'1\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;"><span>'.$lang['srv_brisivrednost'].'</span></a></span>';
- $return['output'] .= '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;"><span>'.$lang['srv_analiza_arhiviraj_cancle'].'</span></a></span>';
+ $return['output'] .= '<div class="button_holder">';
+ $return['output'] .= '<button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ $return['output'] .= '<button class="medium blue" onclick="inline_vrednost_delete(\''.$spremenljivka.'\', \''.$vrednost.'\', \'1\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_brisivrednost'].'</button>';
+ $return['output'] .= '</div>';
//$return['output'] .= '<p><a href="#" id="brisivrednostchecked" onclick="inline_vrednost_delete(\''.$spremenljivka.'\', \''.$vrednost.'\', \'1\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_brisivrednost'].'</a> <a href="#" onclick="$(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</a></p>';
echo json_encode($return);
@@ -6606,8 +7189,10 @@ class Vprasanje {
return;
}
}
-
- if(!$API_call && !$can_delete_last){
+
+ // ker datum (8) sam po sebi nima vrednosti (text in st imata lahko vec vrednosti/polj, se lahko pri datumu pobrise tudi zadnja vrednosti (missingi))
+ if(!$API_call && !$can_delete_last && !$rows['tip'] == 8){
+ //TODO pri datumu noce pobrisati zadnje other vrednosti (missing), tukaj vrne count 0, pri ostalimi (number, text) vrne 1
$sql = sisplet_query("SELECT COUNT(*) AS count FROM srv_vrednost WHERE spr_id='$spremenljivka' AND id != '$vrednost'");
$row = mysqli_fetch_array($sql);
if ($row['count'] == 0) return;
@@ -6617,7 +7202,7 @@ class Vprasanje {
$sql = sisplet_query("SELECT spr_id, if_id FROM srv_vrednost WHERE id = '$vrednost'");
$row = mysqli_fetch_array($sql);
-
+
$sql = sisplet_query("DELETE FROM srv_vrednost WHERE id = '$vrednost'");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
@@ -6636,7 +7221,6 @@ class Vprasanje {
sisplet_query("DELETE FROM srv_if WHERE id = '$if'");
}
- $rows = Cache::srv_spremenljivka($spremenljivka);
if ($rows['tip'] == 24) {
$this->repare_grid_multiple($spremenljivka);
}
@@ -6670,6 +7254,82 @@ class Vprasanje {
Common::repareVrednost($spremenljivka);
Common::prestevilci($spremenljivka);
}
+
+ /**
+ * pri gridih preverimo, ce lahko brisemo stolpec (oz. ce opozorimo, da se lahko izgubijo podatki)
+ */
+ function ajax_grid_delete_check () {
+ global $lang;
+
+ Common::getInstance()->Init($this->anketa);
+ Common::getInstance()->updateEditStamp();
+
+ $return = array();
+
+ // preverimo, ce obstajajo ze podatki za spremenljivko - v tem primeru damo dodaten error
+ $sql = sisplet_query("SELECT count(*) AS count FROM srv_user WHERE ank_id='$this->anketa' AND deleted='0' AND preview='0'");
+ $row = mysqli_fetch_array($sql);
+
+ if ($row['count'] > 0) {
+
+ $return['error'] = 2;
+
+ $return['output'] = '<h2>'.$lang['srv_warning'].'</h2>';
+ $return['output'] .= '<div class="popup_close"><a href="#" onClick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
+
+ $return['output'] .= '<p>'.$lang['spremenljivka_delete_data_grid'].'</p>';
+ $return['output'] .= '<p class="top16">'.$lang['srv_brisivrednostconfirm_data2'].'</p>';
+
+ //ce se spremeni onclick, se prosim spremeni v datoteki vprasanjeInline.js v funkciji inline_vrednost_delete v else if (data.error == 2)
+ $return['output'] .= '<div class="button_holder">';
+ $return['output'] .= '<button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ $return['output'] .= '<button class="medium blue" onclick="grid_plus_minus (\'0\', \'1\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_brisivrednost2'].'</button>';
+ $return['output'] .= '</div>';
+
+ echo json_encode($return);
+ }
+
+ return;
+ }
+
+ /**
+ * pri gridih preverimo, ce lahko brisemo stolpec (oz. ce opozorimo, da se lahko izgubijo podatki)
+ */
+ function ajax_grid_delete_missing_check () {
+ global $lang;
+
+ Common::getInstance()->Init($this->anketa);
+ Common::getInstance()->updateEditStamp();
+
+ $spremenljivka = $this->spremenljivka;
+
+ $return = array();
+
+ // preverimo, ce obstajajo ze podatki za spremenljivko - v tem primeru damo dodaten error
+ $sql = sisplet_query("SELECT count(*) AS count FROM srv_user WHERE ank_id='$this->anketa' AND deleted='0' AND preview='0'");
+ $row = mysqli_fetch_array($sql);
+
+ if ($row['count'] > 0) {
+
+ $return['error'] = 2;
+
+ $return['output'] = '<h2>'.$lang['srv_warning'].'</h2>';
+ $return['output'] .= '<div class="popup_close"><a href="#" onClick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
+
+ $return['output'] .= '<p>'.$lang['spremenljivka_delete_data_grid'].'</p>';
+ $return['output'] .= '<p class="top16">'.$lang['srv_brisivrednostconfirm_data2'].'</p>';
+
+ //ce se spremeni onclick, se prosim spremeni v datoteki vprasanjeInline.js v funkciji inline_vrednost_delete v else if (data.error == 2)
+ $return['output'] .= '<div class="button_holder">';
+ $return['output'] .= '<button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ $return['output'] .= '<button class="medium blue" onclick="vprasanje_save(true, \''.$spremenljivka.'\'); close_missing_menu(\''.$spremenljivka.'\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_brisivrednost2'].'</button>';
+ $return['output'] .= '</div>';
+
+ echo json_encode($return);
+ }
+
+ return;
+ }
/**
* funkcija, ki doda novo vrednost
@@ -6729,11 +7389,11 @@ class Vprasanje {
//$sql = sisplet_query("SELECT * FROM srv_vrednost WHERE spr_id = '$spremenljivka'");
$sql1 = sisplet_query("SELECT id FROM srv_user WHERE ank_id='$anketa'");
$values = '';
- while ($row1 = mysqli_fetch_assoc($sql1)) {
+ while ($row2 = mysqli_fetch_assoc($sql1)) {
//$s = sisplet_query("INSERT INTO srv_data_grid".$this->db_table." (spr_id, vre_id, usr_id, grd_id) VALUES ('$spremenljivka', '$vrednost', '$row1[id]', '-4')");
if ($values != '') $values .= ', ';
- $values .= "('$spremenljivka', '$vrednost', '$row1[id]', '-4')";
+ $values .= "('$spremenljivka', '$vrednost', '$row2[id]', '-4')";
}
$s = sisplet_query("INSERT INTO srv_data_grid".$this->db_table." (spr_id, vre_id, usr_id, grd_id) VALUES $values");
@@ -6781,10 +7441,43 @@ class Vprasanje {
}
function ajax_change_tip () {
+ global $lang;
+
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
$tip = $_POST['tip'];
+ $confirmed = (int)$_POST['confirmed'];
+
+ // preverimo, ce obstajajo ze podatki za spremenljivko - v tem primeru damo dodaten error
+ if($confirmed != '1'){
+
+ $return = array();
+
+ $sql = sisplet_query("SELECT count(*) AS count FROM srv_user WHERE ank_id='$this->anketa' AND deleted='0' AND preview='0'");
+ $row = mysqli_fetch_array($sql);
+
+ if ($row['count'] > 0) {
+
+ $return['error'] = 1;
+
+ $return['output'] = '<h2>'.$lang['srv_warning'].'</h2>';
+ $return['output'] .= '<div class="popup_close"><a href="#" onClick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">✕</a></div>';
+
+ $return['output'] .= '<p>'.$lang['spremenljivka_change_type_data'].'</p>';
+ $return['output'] .= '<p class="top16">'.$lang['srv_change_question_confirm_data'].'</p>';
+
+ //ce se spremeni onclick, se prosim spremeni v datoteki vprasanjeInline.js v funkciji inline_vrednost_delete v else if (data.error == 2)
+ $return['output'] .= '<div class="button_holder">';
+ $return['output'] .= '<button class="medium white-blue" onclick="$(\'#dropped_alert\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_analiza_arhiviraj_cancle'].'</button>';
+ $return['output'] .= '<button class="medium blue" onClick="change_tip(\''.$this->spremenljivka.'\', \''.$tip.'\', \'1\'); $(\'#dropped_alert\').html(\'\').hide(); $(\'#fade\').fadeOut(); return false;">'.$lang['srv_spremeni_tip_vprasanja'].'</button>';
+ $return['output'] .= '</div>';
+
+ echo json_encode($return);
+
+ return;
+ }
+ }
self::change_tip($this->spremenljivka, $tip);
@@ -6901,20 +7594,22 @@ class Vprasanje {
function ajax_hotspot_edit() {
-
- $vrednost = $_POST['vrednost'];
+ if(array_key_exists('vrednost', $_POST)){
+ $vrednost = $_POST['vrednost'];
+ }else{
+ $vrednost = null;
+ }
$this->hotspot_edit($vrednost);
}
function ajax_hotspot_edit_regions() {
- $vrednost = $_POST['vrednost'];
- //$src_image = $_POST['src_image'];
- //$hotspot_image_height = $_POST['hotspot_image_height'];
- //$hotspot_image_width = $_POST['hotspot_image_width'];
- //$spr_id = $_POST['spr_id'];
-
+ if(array_key_exists('vrednost', $_POST)){
+ $vrednost = $_POST['vrednost'];
+ }else{
+ $vrednost = null;
+ }
$this->hotspot_edit_regions($vrednost);
}
@@ -7051,7 +7746,7 @@ class Vprasanje {
foreach ($fastadd AS $naslov) {
if ($naslov != '') {
- $this->vrednost_new(trim($naslov), $other);
+ $this->vrednost_new(trim($naslov));
}
}
@@ -7061,7 +7756,7 @@ class Vprasanje {
function ajax_vprasanje_refresh () {
global $lang;
- if ($_GET['silentsave'] == 'true')
+ if (isset($_GET['silentsave']) && $_GET['silentsave'] == 'true')
$silentsave = true;
else
$silentsave = false;
@@ -7230,15 +7925,50 @@ class Vprasanje {
function ajax_grid_multiple_add () {
global $lang;
- echo '<p><b>'.$lang['srv_gridmultiple_choose'].'</b></p>';
-
- echo '<p><label onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'6\');"><span class="sprites radio3"></span> '.$lang['srv_vprasanje_tip_1'].'</label></p>';
- echo '<p><label onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'16\');"><span class="sprites checkbox3"></span> '.$lang['srv_vprasanje_tip_2'].'</label></p>';
- echo '<p><label onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'19\');"><span class="sprites text"></span> '.$lang['srv_vprasanje_tip_21'].'</label></p>';
- echo '<p><label onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'20\');"><span class="sprites text"></span> '.$lang['srv_vprasanje_tip_7'].'</label></p>';
- echo '<p><label onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'19\', \'1\');"><span class="sprites text"></span> '.$lang['srv_vprasanje_datum'].'</label></p>';
+ echo '<div class="popup_close"><a href="#" onClick="vrednost_cancel(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_gridmultiple_choose'].'</h2>';
- echo '<a onclick="$(\'#vrednost_edit\').html(\'\').hide(); return false;" href="#" style="position:absolute; right:10px; bottom:10px">'.$lang['srv_zapri'].'</a>';
+
+ echo '<div class="setting_holder multitable_answer_type">';
+ echo ' <div class="item" onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'6\');">';
+ echo ' <span class="faicon radio_32"></span>';
+ echo ' <span class="item_text">'.$lang['srv_vprasanje_tip_1'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder multitable_answer_type">';
+ echo ' <div class="item" onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'16\');">';
+ echo ' <span class="faicon check_32"></span>';
+ echo ' <span class="item_text">'.$lang['srv_vprasanje_tip_2'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder multitable_answer_type">';
+ echo ' <div class="item" onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'19\');">';
+ echo ' <span class="faicon abc_32"></span>';
+ echo ' <span class="item_text">'.$lang['srv_vprasanje_tip_21'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder multitable_answer_type">';
+ echo ' <div class="item" onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'20\');">';
+ echo ' <span class="faicon number_32"></span>';
+ echo ' <span class="item_text">'.$lang['srv_vprasanje_tip_7'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder multitable_answer_type">';
+ echo ' <div class="item" onclick="grid_multiple_addnew(\''.$this->spremenljivka.'\', \'19\', \'1\');">';
+ echo ' <span class="faicon calendar_icon"></span>';
+ echo ' <span class="item_text">'.$lang['srv_vprasanje_datum'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onclick="vrednost_cancel(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
}
function ajax_grid_multiple_addnew () {
@@ -7247,8 +7977,8 @@ class Vprasanje {
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
- $tip = $_POST['tip'];
- $podtip = $_POST['podtip'];
+ $tip = isset($_POST['tip']) ? $_POST['tip'] : '';
+ $podtip = isset($_POST['podtip']) ? $_POST['podtip'] : 0;
$b = new Branching($this->anketa);
$spr_id = $b->nova_spremenljivka(-2, 0, 0);
@@ -7294,59 +8024,71 @@ class Vprasanje {
$row = Cache::srv_spremenljivka($this->spremenljivka);
$spremenljivkaParams = new enkaParameters($row['params']);
- echo '<p><b>'.$lang['srv_analiza_opisne_subquestion'].'</b></p>';
+
+ echo '<div class="popup_close"><a href="#" onClick="vrednost_cancel(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_analiza_opisne_subquestion'].'</h2>';
- echo '<p><span class="title">'.$lang['srv_odgovorov'].':</span> ';
- echo '<span class="content"><select name="multi_grids_count" id="multi_grids_count" onChange="change_selectbox_size(\'' . $row['id'] . '\', $(this).val(), \'' . $lang['srv_select_box_vse'] . '\');">';
- //echo '<span class="content"><select name="multi_grids_count" id="multi_grids_count" onchange="">';
- // Vedno imamo najmanj 2 grida (drugace so stvari cudne v analizah) - namesto 1 se uporabi navaden radio tip vprasanja
+
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_odgovorov'].':</span>';
+
+ // Vedno imamo najmanj 2 grida (drugace so stvari cudne v analizah) - namesto 1 se uporabi navaden radio tip vprasanja
// Pri number sliderju se rabi 1 (mogoče še kje - npr checkbox itd.... ) analize morajo delati tudi v tem primeru :P
+ echo ' <select name="multi_grids_count" id="multi_grids_count" class="dropdown medium w200" onChange="change_selectbox_size(\'' . $row['id'] . '\', $(this).val(), \'' . $lang['srv_select_box_vse'] . '\');">';
for ($i=1; $i<=20; $i++)
echo '<option value="'.$i.'"'.($row['grids']==$i?' selected':'').'>'.$i.'</option>';
-
- echo '</select></span>';
- echo '</p>';
-
+ echo ' </select>';
+
+ echo '</div>';
+
+
if ($row['tip'] == 6) {
- echo '<p><span class="title">'.$lang['srv_orientacija'].': </span>';
- //echo '<span class="content"><select id="spremenljivka_podtip" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value);">';
- echo '<span class="content"><select id="spremenljivka_podtip" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
- //echo '<span class="content"><select id="spremenljivka_podtip" name="enota">';
- echo '<option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
- echo '<option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_dropdown'].'</option>';
- echo '<option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_orientacija'].':</span>';
+
+ echo ' <select id="spremenljivka_podtip" class="dropdown medium w200" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
+ echo ' <option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
+ echo ' <option value="2" '.(($row['enota'] == 2) ? ' selected="true" ' : '').'>'.$lang['srv_dropdown'].'</option>';
+ echo ' <option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_radio'].'</option>';
+ echo ' </select>';
+
+ echo '</div>';
$this->edit_selectbox_size ();
}
+
if ($row['tip'] == 16) {
+
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_orientacija'].':</span>';
- echo '<p><span class="title">'.$lang['srv_orientacija'].': </span>';
- //echo '<span class="content"><select id="spremenljivka_podtip" name="enota">';
- //echo '<span class="content"><select id="spremenljivka_podtip" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value);">';
- echo '<span class="content"><select id="spremenljivka_podtip" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
- echo '<option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
- echo '<option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_check'].'</option>';
- echo '</select>';
- echo '</span></p>';
+ echo ' <select id="spremenljivka_podtip" class="dropdown medium w200" name="enota" onChange="show_selectbox_size(\'' . $row['id'] . '\', this.value, \'' . $row['tip'] . '\');">';
+ echo ' <option value="0" '.(($row['enota'] == 0) ? ' selected="true" ' : '').'>'.$lang['srv_classic'].'</option>';
+ echo ' <option value="6" '.(($row['enota'] == 6) ? ' selected="true" ' : '').'>'.$lang['srv_select-box_check'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
$this->edit_selectbox_size ();
}
+
if ($row['tip'] == 19) {
- echo '<p>';
+ // Sirina polja
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_textAreaWidth'].':</span>';
$taWidth = ($spremenljivkaParams->get('taWidth') ? $spremenljivkaParams->get('taWidth') : -1);
$taHeight = ($spremenljivkaParams->get('taHeight') ? $spremenljivkaParams->get('taHeight') : 1);
-
- // Sirina polja
- echo $lang['srv_textAreaWidth'].': ';
-
$size = $row['grids'];
$missing_count = 0;
# če imamo missinge size povečamo za 1 + številomissingov
@@ -7356,91 +8098,93 @@ class Vprasanje {
$size += $missing_count + 1;
}
- echo '<select name="taWidth" id="multi_taWidth">';
- $maxWidth = round(50 / $size);
+ $maxWidth = round(50 / $size);
$maxWidth = 10;
-
- echo '<option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
+
+ echo ' <select name="taWidth" id="multi_taWidth" class="dropdown medium w200">';
+ echo ' <option value="-1"' . ($taWidth == -1 ? ' selected="true"' : '') . '>'.$lang['default'].'</option>';
for($i=1; $i<$maxWidth; $i++){
- echo '<option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taWidth == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select>';
+ echo ' </select>';
+
+ echo '</div>';
// Visina polja
- echo '<span class="spaceLeft">'.$lang['srv_textAreaHeight'].': <select name="taHeight" id="multi_taHeight">';
- $maxHeight = 10;
-
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_textAreaHeight'].':</span>';
+
+ $maxHeight = 10;
+ echo ' <select name="taHeight" id="multi_taHeight" class="dropdown medium w200">';
for($i=1; $i<=$maxHeight; $i++){
- echo '<option value="'.$i.'"' . ($taHeight == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
+ echo ' <option value="'.$i.'"' . ($taHeight == $i ? ' selected="true"' : '') . '>' . $i . '</option>';
}
- echo '</select></span>';
+ echo ' </select>';
- echo '</p>';
+ echo '</div>';
}
- if ($row['tip'] == 20) {
+ if ($row['tip'] == 20) {
+ echo '<div class="setting_holder multitable_setting">';
$this->edit_number();
+ echo '</div>';
}
+
// Prikaz podtabele glede na tip respondenta (admin, manager...)
- echo '<p>';
- echo '<span class="title">'.$lang['srv_visible_dostop'].': </span>';
- echo '<span class="content"><select name="dostop" id="spremenljivka_dostop">';
- echo '<option value="4"'.($row['dostop']==4?' selected':'').'>'.$lang['see_everybody'].'</option>';
- echo '<option value="3"'.($row['dostop']==3?' selected':'').'>'.$lang['see_registered'].'</option>';
- echo '<option value="2"'.($row['dostop']==2?' selected':'').'>'.$lang['see_member'].'</option>';
- echo '<option value="1"'.($row['dostop']==1?' selected':'').'>'.$lang['see_manager'].'</option>';
- echo '<option value="0"'.($row['dostop']==0?' selected':'').'>'.$lang['see_admin'].'</option>';
- echo '</select></span>';
- echo '</p>';
+ echo '<div class="setting_holder multitable_setting">';
+
+ echo ' <span class="setting_title">'.$lang['srv_visible_dostop'].':</span>';
+
+ echo ' <select name="dostop" id="spremenljivka_dostop" class="dropdown medium w200">';
+ echo ' <option value="4"'.($row['dostop']==4?' selected':'').'>'.$lang['see_everybody'].'</option>';
+ echo ' <option value="3"'.($row['dostop']==2 || $row['dostop']==3?' selected':'').'>'.$lang['see_registered'].'</option>';
+ echo ' <option value="1"'.($row['dostop']==1?' selected':'').'>'.$lang['see_manager'].'</option>';
+ echo ' <option value="0"'.($row['dostop']==0?' selected':'').'>'.$lang['see_admin'].'</option>';
+ echo ' </select>';
+
+ echo '</div>';
+
// Ce imamo datum
if ($row['tip'] == 19){
$is_datum = $spremenljivkaParams->get('multigrid-datum');
- if ($is_datum == 1)
+ if ($is_datum == 1){
+ echo '<div class="setting_holder multitable_setting">';
$this->edit_date_range();
+ echo '</div>';
+ }
}
+
// Sirina stolpca
- $grid_width = $spremenljivkaParams->get('gridmultiple_width');
- echo '<p>';
- echo '<span class="title">'.$lang['srv_gridmultiple_width'].': </span>';
- echo '<span class="content"><select name="gridmultiple_width" id="gridmultiple_width">';
- echo '<option value="0"'.($grid_width==0?' selected':'').'>'.$lang['default'].'</option>';
- echo '<option value="10"'.($grid_width==10?' selected':'').'>10%</option>';
- echo '<option value="20"'.($grid_width==20?' selected':'').'>20%</option>';
- echo '<option value="30"'.($grid_width==30?' selected':'').'>30%</option>';
- echo '<option value="40"'.($grid_width==40?' selected':'').'>40%</option>';
- echo '<option value="50"'.($grid_width==50?' selected':'').'>50%</option>';
- echo '<option value="60"'.($grid_width==60?' selected':'').'>60%</option>';
- echo '</select></span>';
- echo '</p>';
-
-
- echo '<br />';
+ echo '<div class="setting_holder multitable_setting">';
+ echo ' <span class="setting_title">'.$lang['srv_gridmultiple_width'].':</span>';
- echo '<span class="buttonwrapper spaceLeft floatRight">
- <a class="ovalbutton ovalbutton_orange" onclick="grid_multiple_save(\''.$this->spremenljivka.'\'); $(\'#vrednost_edit\').html(\'\').hide(); return false;" href="#">
- <span>'.$lang['srv_potrdi'].'</span>
- </a>
- </span>';
-
- echo '<span class="buttonwrapper spaceLeft floatRight">
- <a class="ovalbutton ovalbutton_gray" onclick="$(\'#fade\').fadeOut(\'slow\'); $(\'#vrednost_edit\').html(\'\').hide(); return false;" href="#">
- <span>'.$lang['srv_zapri'].'</span>
- </a>
- </span>';
-
- echo '<span class="buttonwrapper spaceLeft floatRight">
- <a class="ovalbutton ovalbutton_gray" onclick="brisi_spremenljivko(\''.$this->spremenljivka.'\', undefined, \'0\'); $(\'#fade\').fadeOut(\'slow\'); $(\'#vrednost_edit\').html(\'\').hide(); return false;" href="#">
- <span>'.$lang['srv_brisispremenljivko'].'</span>
- </a>
- </span>';
+ $grid_width = $spremenljivkaParams->get('gridmultiple_width');
+ echo ' <select name="gridmultiple_width" id="gridmultiple_width" class="dropdown medium w200">';
+ echo ' <option value="0"'.($grid_width==0?' selected':'').'>'.$lang['default'].'</option>';
+ echo ' <option value="10"'.($grid_width==10?' selected':'').'>10%</option>';
+ echo ' <option value="20"'.($grid_width==20?' selected':'').'>20%</option>';
+ echo ' <option value="30"'.($grid_width==30?' selected':'').'>30%</option>';
+ echo ' <option value="40"'.($grid_width==40?' selected':'').'>40%</option>';
+ echo ' <option value="50"'.($grid_width==50?' selected':'').'>50%</option>';
+ echo ' <option value="60"'.($grid_width==60?' selected':'').'>60%</option>';
+ echo ' </select>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="vrednost_cancel(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo ' <button class="medium white-blue" onclick="brisi_spremenljivko(\''.$this->spremenljivka.'\', undefined, \'0\'); vrednost_cancel(); return false;">'.$lang['srv_brisispremenljivko'].'</button>';
+ echo ' <button class="medium blue" onclick="grid_multiple_save(\''.$this->spremenljivka.'\'); vrednost_cancel(); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
/**
@@ -7452,32 +8196,35 @@ class Vprasanje {
Common::getInstance()->Init($this->anketa);
Common::getInstance()->updateEditStamp();
- $sql_parent = sisplet_query("SELECT naslov, naslov2, variable, variable_custom, other FROM srv_vrednost WHERE spr_id='$parent' ORDER BY vrstni_red");
+ $sql_parent = sisplet_query("SELECT naslov, naslov2, variable, variable_custom, other FROM srv_vrednost WHERE spr_id='".$parent."' ORDER BY vrstni_red");
- $sql = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE ank_id='$this->anketa' AND parent='$parent' ORDER BY vrstni_red");
+ $sql = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE ank_id='".$this->anketa."' AND parent='".$parent."' ORDER BY vrstni_red");
while ($row = mysqli_fetch_array($sql)) {
- $sql_grid = sisplet_query("SELECT id, naslov, naslov2, variable, variable_custom FROM srv_vrednost WHERE spr_id = '$row[spr_id]' ORDER BY vrstni_red");
+ $sql_grid = sisplet_query("SELECT id, naslov, naslov2, variable, variable_custom FROM srv_vrednost WHERE spr_id='".$row['spr_id']."' ORDER BY vrstni_red");
+
+ $sql_grid_cnt = mysqli_num_rows($sql_grid);
+ $sql_parent_cnt = mysqli_num_rows($sql_parent);
// dodamo manjkajoce vrstice
- if (mysqli_num_rows($sql_grid) < mysqli_num_rows($sql_parent)) {
+ if ($sql_grid_cnt < $sql_parent_cnt) {
- for ($i=mysqli_num_rows($sql_grid); $i<mysqli_num_rows($sql_parent); $i++) {
+ for ($i=$sql_grid_cnt; $i<$sql_parent_cnt; $i++) {
$this->vrednost_new('', 0, null, $row['spr_id']);
}
-
+ }
// pobrisemo odvecne vrstice
- } elseif (mysqli_num_rows($sql_grid) > mysqli_num_rows($sql_parent)) {
+ elseif ($sql_grid_cnt > $sql_parent_cnt) {
- $limit = mysqli_num_rows($sql_grid) - mysqli_num_rows($sql_parent);
- $s = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$row[spr_id]' ORDER BY vrstni_red DESC LIMIT $limit");
+ $limit = $sql_grid_cnt - $sql_parent_cnt;
+ $s = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='".$row['spr_id']."' ORDER BY vrstni_red DESC LIMIT $limit");
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
-
}
// popravimo napise
mysqli_data_seek($sql_parent, 0);
- mysqli_data_seek($sql_grid, 0);
+ //mysqli_data_seek($sql_grid, 0);
+ $sql_grid = sisplet_query("SELECT id, naslov, naslov2, variable, variable_custom FROM srv_vrednost WHERE spr_id='".$row['spr_id']."' ORDER BY vrstni_red");
while ($row_grid = mysqli_fetch_array($sql_grid) ) {
@@ -7674,7 +8421,7 @@ class Vprasanje {
if($row['enota'] == 1 || $row['enota'] == 0){
$display_trak = 'block';
if($diferencial_trak == 1){
- $display_trak_starting_num = 'block';
+ $display_trak_starting_num = 'flex';
}
else{
$display_trak_starting_num = 'none';
@@ -7685,22 +8432,37 @@ class Vprasanje {
$display_trak_starting_num = 'none';
}
- //koda za izris moznosti za vklop/izklop traku
- echo '<div class="diferencial_trak_class" style="display: '.$display_trak.'">';
- echo '<p><span class="title" ><label for="diferencial_trak_'.$this->spremenljivka.'">'.$lang['srv_diferencial_trak'].':</label></span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="diferencial_trak" '.( $diferencial_trak == 1 ? ' checked="checked"' : '') .' onChange="diferencial_trak_checkbox_prop('.$this->spremenljivka.', '.$row['grids'].');" id="diferencial_trak_'.$this->spremenljivka.'">';
- echo '<input '.$disable_diferencial_trak_hidden.' type="hidden" value="0" name="diferencial_trak" id="diferencial_trak_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div>';
+
+ // koda za izris moznosti za vklop/izklop traku
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <span class="content">';
+
+ echo ' <input type="checkbox" value="1" name="diferencial_trak" '.( $diferencial_trak == 1 ? ' checked="checked"' : '') .' onChange="diferencial_trak_checkbox_prop('.$this->spremenljivka.', '.$row['grids'].');" id="diferencial_trak_'.$this->spremenljivka.'">';
+ echo ' <label for="diferencial_trak_'.$this->spremenljivka.'">'.$lang['srv_diferencial_trak'].Help::display('srv_vprasanje_trak').'</label>';
+ echo ' <input '.$disable_diferencial_trak_hidden.' type="hidden" value="0" name="diferencial_trak" id="diferencial_trak_hidden_'.$this->spremenljivka.'">';
+
+ echo ' </span>';
+ echo ' </div>';
//koda za izris moznosti za vklop/izklop traku - konec
+
//koda za izris polja za vnos zacetne stevilke traku
- echo '<div class="diferencial_trak_starting_num_class_'.$this->spremenljivka.'" style="display: '.$display_trak_starting_num.'"><p><span class="title">' . $lang['srv_diferencial_trak_starting_num'] . ':</span> <span class="content"><input type="text" name="diferencial_trak_starting_num" id="diferencial_trak_starting_num_'.$this->spremenljivka.'" value="' . $diferencial_trak_starting_num . '" size="8" onChange="diferencial_trak_change_values('.$this->spremenljivka.', '.$row['grids'].');"></input></span></p></div>';
+ echo ' <div class="vprasanje_setting_line half-half diferencial_trak_starting_num_class_'.$this->spremenljivka.'" style="display:'.$display_trak_starting_num.'">';
+
+ echo ' <label>'.$lang['srv_diferencial_trak_starting_num'].':</label>';
+ echo ' <span class="content">';
+ echo ' <input type="text" name="diferencial_trak_starting_num" id="diferencial_trak_starting_num_'.$this->spremenljivka.'" value="' . $diferencial_trak_starting_num . '" size="8" onChange="diferencial_trak_change_values('.$this->spremenljivka.', '.$row['grids'].');">';
+ echo ' </span>';
- echo '<div class="trak_num_of_titles_class" style="display: '.$display_trak_starting_num.'">';
- echo '<p><span class="title" >'.$lang['srv_trak_num_of_titles'].':</span>';
- echo '<span class="content"><select name="trak_num_of_titles" id="trak_num_of_titles">';
+ echo ' </div>';
+
+
+ echo ' <div class="vprasanje_setting_line half-half trak_num_of_titles_class" style="display: '.$display_trak_starting_num.'">';
+
+ echo ' <label>'.$lang['srv_trak_num_of_titles'].':</label>';
+ echo ' <span class="content"><select name="trak_num_of_titles" id="trak_num_of_titles">';
$deljivaStevila = [];
$indeksDeljivihStevil = 0;
@@ -7724,12 +8486,15 @@ class Vprasanje {
echo '<option value="'.$deljivaStevila[$i].'"'.($trak_num_of_titles == $deljivaStevila[$i] ? ' selected="true"' : '') . '>'.$deljivaStevila[$i].'</option>';
}
echo '</select></span>';
- echo '</p>';
- echo '</div>';
+
+ echo ' </div>';
+
+
+ echo '</div>';
}
//posodobi skrite vrednosti odgovorov za diferencial trak
- function ajax_diferencial_trak_skrite_vrednosti($spr_id, $num_grids, $diferencial_trak_starting_num){
+ function ajax_diferencial_trak_skrite_vrednosti($spr_id=null, $num_grids=null, $diferencial_trak_starting_num=null ){
if(isset ($_POST['spr_id'])){
$spr_id = $_POST['spr_id'];
}
@@ -7780,12 +8545,14 @@ class Vprasanje {
}
// koda za dropdown za izbiro oblike okvirjev ali skatel
- echo '<div class="drag_and_drop_new_look_class" style="display: '.$display_new_look_option.'">';
- echo '<p><span class="title" >'.$lang['srv_drag_and_drop_new_look_option'].':</span>';
+ echo '<div class="vprasanje_setting_holder drag_and_drop_new_look_class" style="display: '.$display_new_look_option.'">';
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo '<label>'.$lang['srv_drag_and_drop_new_look_option'].':</label>';
echo '<span class="content"><select name="display_drag_and_drop_new_look" id="drag_and_drop_new_look_'.$this->spremenljivka.'" onChange="drag_and_drop_new_look_checkbox_prop('.$this->spremenljivka.');">';
echo '<option value="0"'.($display_drag_and_drop_new_look=='0'?' selected':'').'>'.$lang['srv_drag_and_drop_new_look_option1'].'</option>';
echo '<option value="1"'.($display_drag_and_drop_new_look=='1'?' selected':'').'>'.$lang['srv_drag_and_drop_new_look_option2'].'</option>';
- echo '</select></span></p>';
+ echo '</select></span>';
+ echo '</div>';
echo '</div>';
}
@@ -7806,17 +8573,19 @@ class Vprasanje {
$display = ( ( $row['tip'] == 6 && ($row['enota'] == 0 || $row['enota'] == 1) ) || ( $row['tip'] == 16 && ($row['enota'] == 0 || $row['enota'] == 1) ) ) && ($diferencial_trak == 0) ? '' : 'style="display:none;"';
- echo '<div class="drop_custom_column_labels" '.$display.'>';
+ echo '<div class="vprasanje_setting_holder drop_custom_column_labels" '.$display.'>';
- echo '<p><span class="title" >'.$lang['srv_custom_column_labels_presentation'].':</span>';
+ echo ' <div class="vprasanje_setting_line half-half">';
- echo '<span class="content"><select name="custom_column_label_option" id="custom_column_label_option_'.$row['id'].'" >';
- echo '<option value="1"'.($custom_column_label_option=='1'?' selected':'').'>'.$lang['srv_custom_column_labels_o1'].'</option>';
- echo '<option value="2"'.($custom_column_label_option=='2'?' selected':'').'>'.$lang['srv_custom_column_labels_o2'].'</option>';
- echo '<option value="3"'.($custom_column_label_option=='3'?' selected':'').'>'.$lang['srv_custom_column_labels_o3'].'</option>';
- echo '</select></span>';
+ echo ' <label>'.$lang['srv_custom_column_labels_presentation'].':</label>';
- echo '</p>';
+ echo ' <span class="content"><select name="custom_column_label_option" id="custom_column_label_option_'.$row['id'].'" >';
+ echo ' <option value="1"'.($custom_column_label_option=='1'?' selected':'').'>'.$lang['srv_custom_column_labels_o1'].'</option>';
+ echo ' <option value="2"'.($custom_column_label_option=='2'?' selected':'').'>'.$lang['srv_custom_column_labels_o2'].'</option>';
+ echo ' <option value="3"'.($custom_column_label_option=='3'?' selected':'').'>'.$lang['srv_custom_column_labels_o3'].'</option>';
+ echo ' </select></span>';
+
+ echo ' </div>';
echo '</div>';
}
@@ -7830,19 +8599,22 @@ class Vprasanje {
$grid_repeat_header = ($spremenljivkaParams->get('grid_repeat_header') ? $spremenljivkaParams->get('grid_repeat_header') : 0);
- echo '<div class="grid_repeat_header">';
+
+ echo '<div class="vprasanje_setting_holder grid_repeat_header">';
+
+ echo ' <div class="vprasanje_setting_line half-half">';
- echo '<p><span class="title" >'.$lang['srv_grid_repeat_header'].':</span>';
+ echo ' <label>'.$lang['srv_grid_repeat_header'].':</label>';
- echo '<span class="content"><select name="grid_repeat_header" id="grid_repeat_header_'.$row['id'].'" >';
- echo '<option value="0"'.($grid_repeat_header=='0'?' selected':'').'>'.$lang['srv_grid_repeat_header_0'].'</option>';
- echo '<option value="5"'.($grid_repeat_header=='5'?' selected':'').'>'.$lang['srv_grid_repeat_header_5'].'</option>';
- echo '<option value="10"'.($grid_repeat_header=='10'?' selected':'').'>'.$lang['srv_grid_repeat_header_10'].'</option>';
- echo '<option value="15"'.($grid_repeat_header=='15'?' selected':'').'>'.$lang['srv_grid_repeat_header_15'].'</option>';
- echo '<option value="20"'.($grid_repeat_header=='20'?' selected':'').'>'.$lang['srv_grid_repeat_header_20'].'</option>';
- echo '</select></span>';
+ echo ' <span class="content"><select name="grid_repeat_header" id="grid_repeat_header_'.$row['id'].'" >';
+ echo ' <option value="0"'.($grid_repeat_header=='0'?' selected':'').'>'.$lang['srv_grid_repeat_header_0'].'</option>';
+ echo ' <option value="5"'.($grid_repeat_header=='5'?' selected':'').'>'.$lang['srv_grid_repeat_header_5'].'</option>';
+ echo ' <option value="10"'.($grid_repeat_header=='10'?' selected':'').'>'.$lang['srv_grid_repeat_header_10'].'</option>';
+ echo ' <option value="15"'.($grid_repeat_header=='15'?' selected':'').'>'.$lang['srv_grid_repeat_header_15'].'</option>';
+ echo ' <option value="20"'.($grid_repeat_header=='20'?' selected':'').'>'.$lang['srv_grid_repeat_header_20'].'</option>';
+ echo ' </select></span>';
- echo '</p>';
+ echo ' </div>';
echo '</div>';
}
@@ -7890,16 +8662,17 @@ class Vprasanje {
$spr_id = $row['id'];
+
//preveri, ce je kaksno obmocje shranjeno v bazi
- //$sqlR = sisplet_query("SELECT * FROM srv_hotspot_regions WHERE spr_id = $spr_id");
$sqlR = sisplet_query("SELECT region_index, vre_id, region_name FROM srv_hotspot_regions WHERE spr_id = $spr_id");
- //$rowR = mysqli_fetch_array($sql);
if($row['tip'] == 1 || $row['tip'] == 2){
$enota_orientation = $row['orientation'];
- }else if($row['tip'] == 6){
+ }
+ else if($row['tip'] == 6){
$enota_orientation = $row['enota'];
}
+
?>
<script>
$(document).ready(function(){
@@ -7908,153 +8681,195 @@ class Vprasanje {
init_colorPicker(<?=$row['id']?>);
});
</script>
-
<?
- //roleta za izbiro najvecjega stevila klikov na sliko
- echo '<p><span class="title">'.$lang['srv_vprasanje_heatmap_num_clicks'].':<span id="help_hotspot_visibility" class="spaceLeft">'.Help::display('srv_hotspot_visibility').' </span></span>';
- echo '<span class="content"><select id="heatmap_num_clicks_' . $row['id'] . '" spr_id="'.$row['id'].'" name="heatmap_num_clicks" onChange="showHeatMapClickCounter($(this).val(), '.$row['id'].')">';
- echo '<option value="1" '.(($heatmap_num_clicks == 1) ? ' selected="true" ' : '').'>1</option>';
- echo '<option value="2" '.(($heatmap_num_clicks == 2) ? ' selected="true" ' : '').'>2</option>';
- echo '<option value="3" '.(($heatmap_num_clicks == 3) ? ' selected="true" ' : '').'>3</option>';
- echo '<option value="4" '.(($heatmap_num_clicks == 4) ? ' selected="true" ' : '').'>4</option>';
- echo '<option value="5" '.(($heatmap_num_clicks == 5) ? ' selected="true" ' : '').'>5</option>';
- echo '<option value="6" '.(($heatmap_num_clicks == 6) ? ' selected="true" ' : '').'>6</option>';
- echo '<option value="7" '.(($heatmap_num_clicks == 7) ? ' selected="true" ' : '').'>7</option>';
- echo '<option value="8" '.(($heatmap_num_clicks == 8) ? ' selected="true" ' : '').'>8</option>';
- echo '<option value="9" '.(($heatmap_num_clicks == 9) ? ' selected="true" ' : '').'>9</option>';
- echo '<option value="10" '.(($heatmap_num_clicks == 10) ? ' selected="true" ' : '').'>10</option>';
- echo '</select>';
- echo '</span></p>';
- //roleta za izbiro najvecjega stevila klikov na sliko - konec
-
- //checkbox za "Pokazi stevec klikov"
- echo '<label for="heatmap_show_counter_clicks_'.$this->spremenljivka.'"><div style="'.$enableHeatMapClickCounter.'" class="heatmap_show_counter_clicks_class">';
- echo '<p><span class="title" >'.$lang['srv_vprasanje_heatmap_show_counter_clicks'].':</span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="heatmap_show_counter_clicks" '.( $heatmap_show_counter_clicks == 1 ? ' checked="checked"' : '') .' onChange="heatmap_show_counter_clicks_checkbox_prop('.$this->spremenljivka.');" id="heatmap_show_counter_clicks_'.$this->spremenljivka.'">';
- echo '<input '.$disable_heatmap_show_counter_clicks_hidden.' type="hidden" value="0" name="heatmap_show_counter_clicks" id="heatmap_show_counter_clicks_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
- //checkbox za "Pokazi stevec klikov" - konec
+
+ echo '<fieldset><legend>'.$lang['srv_hot_spot_settings'].'</legend>';
+
+ // roleta za izbiro najvecjega stevila klikov na sliko
+ echo '<div class="vprasanje_setting_holder">';
- //checkbox za "Pokazi klike"
- echo '<label for="heatmap_show_clicks_'.$this->spremenljivka.'"><div class="heatmap_show_clicks_class">';
- echo '<p><span class="title" >'.$lang['srv_vprasanje_heatmap_show_clicks'].':</span>';
- echo '<span class="content">';
- echo '<input type="checkbox" value="1" name="heatmap_show_clicks" '.( $heatmap_show_clicks == 1 ? ' checked="checked"' : '') .' onChange="heatmap_show_clicks_checkbox_prop('.$this->spremenljivka.');" id="heatmap_show_clicks_'.$this->spremenljivka.'">';
- echo '<input '.$disable_heatmap_show_clicks_hidden.' type="hidden" value="0" name="heatmap_show_clicks" id="heatmap_show_clicks_hidden_'.$this->spremenljivka.'">';
- echo '</span></p>';
- echo '</div></label>';
- //checkbox za "Pokazi klike" - konec
-
- //dodatne nastavitve, ce morajo biti kliki vidni
-
- echo '<div id="heatmap_clicks_settings_'.$row['id'].'" '.$heatmap_clicks_settings_display.'>';
-
- //Izbira barve klika
- if ($heatmap_click_color == '') {
- $value = '#000000';
- echo '<div><p><span class="title">'.$lang['srv_vprasanje_heatmap_clicks_color'].': <a href="#" onclick="$(\'#color-click-'.$row['id'].'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span></p></div>';
- }else{
- $value = $heatmap_click_color;
- }
- echo '<div><p><span class="title" id="color-click-'.$row['id'].'" '.($heatmap_click_color==''?'style="display:none;"':'').'>'.$lang['srv_vprasanje_heatmap_clicks_color'].': ';
- echo '<input type="text" id="color-click'.$row['id'].'" class="colorwell auto-save" name="heatmap_click_color" value="'.$value.'" data-id="'.$row['id'].'" data-type="'.$type.'" >';
- echo '</span></p></div>';
-
- echo '<div id="picker"></div>';
- //Izbira barve klika - konec
-
- //Izbira radija/velikosti klika
- echo '<div><p><span>'.$lang['srv_vprasanje_heatmap_clicks_size'].': <input id="heatmapClickSize_'.$row['id'].'" name="heatmap_click_size" type="range" min="2" max="50" step="1" value="'.$heatmap_click_size.'" oninput="UpdateClickSizeSlider(value, '.$row['id'].')"/><output for="heatmapClickSize_'.$row['id'].'" id="heatmapClickSizeValue_'.$row['id'].'">'.$heatmap_click_size.'</output></span></p></div>';
- //Izbira radija/velikosti klika - konec
+ echo ' <div id="help_hotspot_visibility" class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_heatmap_num_clicks'].' '.Help::display('srv_hotspot_visibility').':</label>';
+
+ echo ' <span class="content"><select id="heatmap_num_clicks_' . $row['id'] . '" spr_id="'.$row['id'].'" name="heatmap_num_clicks" onChange="showHeatMapClickCounter($(this).val(), '.$row['id'].')">';
+ echo ' <option value="1" '.(($heatmap_num_clicks == 1) ? ' selected="true" ' : '').'>1</option>';
+ echo ' <option value="2" '.(($heatmap_num_clicks == 2) ? ' selected="true" ' : '').'>2</option>';
+ echo ' <option value="3" '.(($heatmap_num_clicks == 3) ? ' selected="true" ' : '').'>3</option>';
+ echo ' <option value="4" '.(($heatmap_num_clicks == 4) ? ' selected="true" ' : '').'>4</option>';
+ echo ' <option value="5" '.(($heatmap_num_clicks == 5) ? ' selected="true" ' : '').'>5</option>';
+ echo ' <option value="6" '.(($heatmap_num_clicks == 6) ? ' selected="true" ' : '').'>6</option>';
+ echo ' <option value="7" '.(($heatmap_num_clicks == 7) ? ' selected="true" ' : '').'>7</option>';
+ echo ' <option value="8" '.(($heatmap_num_clicks == 8) ? ' selected="true" ' : '').'>8</option>';
+ echo ' <option value="9" '.(($heatmap_num_clicks == 9) ? ' selected="true" ' : '').'>9</option>';
+ echo ' <option value="10" '.(($heatmap_num_clicks == 10) ? ' selected="true" ' : '').'>10</option>';
+ echo ' </select></span>';
- //Izbira oblike klika $heatmap_click_shape
- echo '<div><p><span class="title">'.$lang['srv_vprasanje_heatmap_clicks_shape'].': </span>';
- echo '<span class="content"><select id="heatmapClickShape_' . $row['id'] . '" spr_id="'.$row['id'].'" name="heatmap_click_shape" onChange="">';
- echo '<option value="1" '.(($heatmap_click_shape == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_heatmap_clicks_shape_1'].'</option>';
- echo '<option value="2" '.(($heatmap_click_shape == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_heatmap_clicks_shape_2'].'</option>';
- echo '</select>';
- echo '</span></p></div>';
- //Izbira oblike klika - konec
+ echo ' </div>';
+
+ // checkbox za "Pokazi stevec klikov"
+ echo ' <div id="help_hotspot_visibility" class="vprasanje_setting_line heatmap_show_counter_clicks_class" style="'.$enableHeatMapClickCounter.'">';
+ echo ' <span class="content">';
+ echo ' <input type="checkbox" value="1" name="heatmap_show_counter_clicks" '.( $heatmap_show_counter_clicks == 1 ? ' checked="checked"' : '') .' onChange="heatmap_show_counter_clicks_checkbox_prop('.$this->spremenljivka.');" id="heatmap_show_counter_clicks_'.$this->spremenljivka.'">';
+ echo ' <label for="heatmap_show_counter_clicks_'.$this->spremenljivka.'">'.$lang['srv_vprasanje_heatmap_show_counter_clicks'].'</label>';
+ echo ' <input '.$disable_heatmap_show_counter_clicks_hidden.' type="hidden" value="0" name="heatmap_show_counter_clicks" id="heatmap_show_counter_clicks_hidden_'.$this->spremenljivka.'">';
+ echo ' </span>';
+
+ echo ' </div>';
+
+ echo '</div>';
+ // roleta za izbiro najvecjega stevila klikov na sliko - konec
+
+ //checkbox za "Pokazi klike"
+ echo '<div class="vprasanje_setting_holder">';
+
+ echo ' <div id="help_hotspot_visibility" class="vprasanje_setting_line heatmap_show_clicks_class">';
+
+ echo ' <span class="content">';
+ echo ' <input type="checkbox" value="1" name="heatmap_show_clicks" '.( $heatmap_show_clicks == 1 ? ' checked="checked"' : '') .' onChange="heatmap_show_clicks_checkbox_prop('.$this->spremenljivka.');" id="heatmap_show_clicks_'.$this->spremenljivka.'">';
+ echo ' <label for="heatmap_show_clicks_'.$this->spremenljivka.'">'.$lang['srv_vprasanje_heatmap_show_clicks'].'</label>';
+ echo ' <input '.$disable_heatmap_show_clicks_hidden.' type="hidden" value="0" name="heatmap_show_clicks" id="heatmap_show_clicks_hidden_'.$this->spremenljivka.'">';
+ echo ' </span>';
+
+ echo ' </div>';
+
echo '</div>';
- //dodatne nastavitve, ce morajo biti kliki vidni - konec
+ //checkbox za "Pokazi klike" - konec
+
+
+ // dodatne nastavitve, ce morajo biti kliki vidni
+ echo '<div id="heatmap_clicks_settings_'.$row['id'].'" class="vprasanje_setting_holder heatmap_show_clicks_class" '.$heatmap_clicks_settings_display.'>';
+
+ //Izbira barve klika
+ if ($heatmap_click_color == '') {
+ $value = '#000000';
+ echo '<div><p><span class="title">'.$lang['srv_vprasanje_heatmap_clicks_color'].': <a href="#" onclick="$(\'#color-click-'.$row['id'].'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span></p></div>';
+ }
+ else{
+ $value = $heatmap_click_color;
+ }
+ echo '<div><p><span class="title" id="color-click-'.$row['id'].'" '.($heatmap_click_color==''?'style="display:none;"':'').'>'.$lang['srv_vprasanje_heatmap_clicks_color'].': ';
+ echo '<input type="text" id="color-click'.$row['id'].'" class="colorwell auto-save" name="heatmap_click_color" value="'.$value.'" data-id="'.$row['id'].'">';
+ echo '</span></p></div>';
+
+ echo '<div id="picker"></div>';
+ //Izbira barve klika - konec
+
+ //Izbira radija/velikosti klika
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_heatmap_clicks_size'].':</label>';
+ echo ' <input id="heatmapClickSize_'.$row['id'].'" name="heatmap_click_size" type="range" min="2" max="50" step="1" value="'.$heatmap_click_size.'" oninput="UpdateClickSizeSlider(value, '.$row['id'].')"/><output for="heatmapClickSize_'.$row['id'].'" id="heatmapClickSizeValue_'.$row['id'].'">'.$heatmap_click_size.'</output>';
+ echo ' </div>';
+ //Izbira radija/velikosti klika - konec
+
+ //Izbira oblike klika $heatmap_click_shape
+ echo ' <div class="vprasanje_setting_line half-half">';
+ echo ' <label>'.$lang['srv_vprasanje_heatmap_clicks_shape'].':</label>';
+ echo ' <span class="content"><select id="heatmapClickShape_' . $row['id'] . '" spr_id="'.$row['id'].'" name="heatmap_click_shape" onChange="">';
+ echo ' <option value="1" '.(($heatmap_click_shape == 1) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_heatmap_clicks_shape_1'].'</option>';
+ echo ' <option value="2" '.(($heatmap_click_shape == 2) ? ' selected="true" ' : '').'>'.$lang['srv_vprasanje_heatmap_clicks_shape_2'].'</option>';
+ echo ' </select></span>';
+ echo ' </div>';
+ //Izbira oblike klika - konec
+
+ echo '</div>';
+ //dodatne nastavitve, ce morajo biti kliki vidni - konec
+
+
+ echo '</fieldset>';
+
//fieldset Obmocja - zacasno skrivanje
echo '<fieldset id="hot_spot_fieldset_'.$row['id'].'"><legend>'.$lang['srv_hot_spot_regions_menu'].'</legend>';
- if (mysqli_num_rows($sqlR) != 0){
- //pokazi shranjena obmocja
- while ($rowR = mysqli_fetch_array($sqlR)) {
- echo '<div id="hotspot_region_'.$rowR['region_index'].'" class="hotspot_region"><div id="hotspot_region_name_'.$rowR['region_index'].'" vre_id="'.$rowR['vre_id'].'" region_index = "'.$rowR['region_index'].'" class="hotspot_vrednost_inline" contenteditable="true">'.$rowR['region_name'].'</div><span class="faicon edit2 inline_hotspot_edit_region"></span><span class="faicon delete_circle icon-orange_link inline_hotspot_delete_region"></span><br /></div>';
- }
- }
- //Sporocilo ob odsotnosti slike
- echo '<p id="hotspot_message"><span class="title" >'.$lang['srv_hotspot_message'].'</span></p>';
- //Sporocilo ob odsotnosti slike - konec
-
- //Dodajanje območja - gumb
- echo '<p><span class="title" ><button id="hot_spot_regions_add_button" type="button" onclick=" hotspot_edit_regions('.$row['id'].', 0)">'.$lang['srv_hot_spot_regions'].'</button></span></p>';
-
- //*************************** SKRIVANJE NASTAVITEV OBMOCJA
- $display_regions_menu = 'style="display:none;"'; //skrivanje nastavitev obmocja + v js datotekah
- //***************************
- //div za nastavitve obmocja
- echo '<div id="heatmap_region_settings_'.$row['id'].'" '.$display_regions_menu.'>';
- //Izbira barve obmocja
- if ($hotspot_region_color == '') {
- $value = '#000000';
- echo '<span class="title">'.$lang['srv_hotspot_region_color_text'].': <a href="#" onclick="$(\'#color-'.$row['id'].'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span>';
- }else{
- $value = $hotspot_region_color;
- }
-
- echo '<span class="title" id="color-'.$row['id'].'" '.($hotspot_region_color==''?'style="display:none;"':'').'>'.$lang['srv_hotspot_region_color_text'].': ';
- echo '<input type="text" id="color'.$row['id'].'" class="colorwell auto-save" name="hotspot_region_color" value="'.$value.'" data-id="'.$row['id'].'" data-type="'.$type.'" >';
- echo '</span>';
-
- echo '<div id="picker"></div>';
- //Izbira barve obmocja - konec
-
- //Regions visibility options
- echo '<p><span class="title">'.$lang['srv_hotspot_visibility_options_title'].':<span id="help_hotspot_visibility" class="spaceLeft">'.Help::display('srv_hotspot_visibility').' </span></span>';
- echo '<span class="title"><select id="hotspot_region_visibility_options_' . $row['id'] . '" spr_id="'.$row['id'].'" name="hotspot_region_visibility_option" onChange="">';
- echo '<option value="0" '.(($hotspot_region_visibility_option == 0) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_0'].'</option>';
- echo '<option value="1" '.(($hotspot_region_visibility_option == 1) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_1'].'</option>';
- echo '<option value="2" '.(($hotspot_region_visibility_option == 2) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_2'].'</option>';
- //echo '<option value="3" '.(($hotspot_region_visibility_option == 3) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_3'].'</option>';
- echo '</select>';
- echo '</span></p>';
- //Regions visibility options - konec
-
- //Tooltips options
- if($row['tip'] == 1 || $row['tip'] == 2){ //ce je radio ali checkbox
- $srv_hotspot_tooltip = 'srv_hotspot_tooltip';
- }else if($row['tip'] == 6){
- $srv_hotspot_tooltip = 'srv_hotspot_tooltip_grid';
- }
- echo '<p><span class="title">'.$lang['srv_hotspot_tooltips_options_title'].':<span id="help_hotspot_namig" class="spaceLeft">'.Help::display($srv_hotspot_tooltip).' </span></span>';
- echo '<span class="title"><select id="hotspot_tooltips_options_' . $row['id'] . '" spr_id="'.$row['id'].'" name="hotspot_tooltips_option" onChange="">';
- echo '<option value="0" '.(($hotspot_tooltips_option == 0) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_0'].'</option>';
- if($row['tip'] == 1 || $row['tip'] == 2){ //ce je radio ali checkbox
- echo '<option value="1" '.(($hotspot_tooltips_option == 1) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_1'].'</option>';
- }
- if($row['tip'] == 6){ //ce je radio grid
- echo '<option value="2" '.(($hotspot_tooltips_option == 2) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_2'].'</option>';
- }
+ if (mysqli_num_rows($sqlR) != 0){
- echo '</select>';
- echo '</span></p>';
- //Tooltips options - konec
- echo '</div>';
- //div za nastavitve obmocja - konec
+ echo '<div class="vprasanje_setting_holder">';
+
+ //pokazi shranjena obmocja
+ while ($rowR = mysqli_fetch_array($sqlR)) {
+ echo ' <div class="vprasanje_setting_line">';
+ echo ' <div id="hotspot_region_'.$rowR['region_index'].'" class="hotspot_region"><div id="hotspot_region_name_'.$rowR['region_index'].'" vre_id="'.$rowR['vre_id'].'" region_index = "'.$rowR['region_index'].'" class="hotspot_vrednost_inline" contenteditable="true">'.$rowR['region_name'].'</div><span class="faicon edit2 inline_hotspot_edit_region"></span><span class="faicon delete_circle icon-orange_link inline_hotspot_delete_region"></span><br /></div>';
+ echo ' </div>';
+ }
+
+ echo ' </div>';
+ }
+
+ //Sporocilo ob odsotnosti slike
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div id="hotspot_message" class="vprasanje_setting_line">';
+ echo ' <span class="content">'.$lang['srv_hotspot_message'].'</span>';
+ echo ' </div>';
+ echo '</div>';
+ //Sporocilo ob odsotnosti slike - konec
+
+
+ //Dodajanje območja - gumb
+ echo '<div class="vprasanje_setting_holder">';
+ echo ' <div id="hot_spot_regions_add_button" class="vprasanje_setting_line">';
+ echo ' <span class="content"><button type="button" onclick=" hotspot_edit_regions('.$row['id'].', 0)">'.$lang['srv_hot_spot_regions'].'</button></span>';
+ echo ' </div>';
+ echo '</div>';
+
+ //*************************** SKRIVANJE NASTAVITEV OBMOCJA
+ $display_regions_menu = 'style="display:none;"'; //skrivanje nastavitev obmocja + v js datotekah
+ //***************************
+ //div za nastavitve obmocja
+ echo '<div id="heatmap_region_settings_'.$row['id'].'" '.$display_regions_menu.'>';
+ //Izbira barve obmocja
+ if ($hotspot_region_color == '') {
+ $value = '#000000';
+ echo '<span class="title">'.$lang['srv_hotspot_region_color_text'].': <a href="#" onclick="$(\'#color-'.$row['id'].'\').show(); $(this).parent().hide(); return false;" title="'.$lang['edit4'].'">'.$lang['srv_te_default'].' <span class="faicon edit"></span></a></span>';
+ }else{
+ $value = $hotspot_region_color;
+ }
+
+ echo '<span class="title" id="color-'.$row['id'].'" '.($hotspot_region_color==''?'style="display:none;"':'').'>'.$lang['srv_hotspot_region_color_text'].': ';
+ echo '<input type="text" id="color'.$row['id'].'" class="colorwell auto-save" name="hotspot_region_color" value="'.$value.'" data-id="'.$row['id'].'">';
+ echo '</span>';
+
+ echo '<div id="picker"></div>';
+ //Izbira barve obmocja - konec
+
+ //Regions visibility options
+ echo '<p><span class="title">'.$lang['srv_hotspot_visibility_options_title'].':<span id="help_hotspot_visibility" class="spaceLeft">'.Help::display('srv_hotspot_visibility').' </span></span>';
+ echo '<span class="title"><select id="hotspot_region_visibility_options_' . $row['id'] . '" spr_id="'.$row['id'].'" name="hotspot_region_visibility_option" onChange="">';
+ echo '<option value="0" '.(($hotspot_region_visibility_option == 0) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_0'].'</option>';
+ echo '<option value="1" '.(($hotspot_region_visibility_option == 1) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_1'].'</option>';
+ echo '<option value="2" '.(($hotspot_region_visibility_option == 2) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_2'].'</option>';
+ //echo '<option value="3" '.(($hotspot_region_visibility_option == 3) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_visibility_options_3'].'</option>';
+ echo '</select>';
+ echo '</span></p>';
+ //Regions visibility options - konec
+
+ //Tooltips options
+ if($row['tip'] == 1 || $row['tip'] == 2){ //ce je radio ali checkbox
+ $srv_hotspot_tooltip = 'srv_hotspot_tooltip';
+ }else if($row['tip'] == 6){
+ $srv_hotspot_tooltip = 'srv_hotspot_tooltip_grid';
+ }
+
+ echo '<p><span class="title">'.$lang['srv_hotspot_tooltips_options_title'].':<span id="help_hotspot_namig" class="spaceLeft">'.Help::display($srv_hotspot_tooltip).' </span></span>';
+ echo '<span class="title"><select id="hotspot_tooltips_options_' . $row['id'] . '" spr_id="'.$row['id'].'" name="hotspot_tooltips_option" onChange="">';
+ echo '<option value="0" '.(($hotspot_tooltips_option == 0) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_0'].'</option>';
+ if($row['tip'] == 1 || $row['tip'] == 2){ //ce je radio ali checkbox
+ echo '<option value="1" '.(($hotspot_tooltips_option == 1) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_1'].'</option>';
+ }
+ if($row['tip'] == 6){ //ce je radio grid
+ echo '<option value="2" '.(($hotspot_tooltips_option == 2) ? ' selected="true" ' : '').'>'.$lang['srv_hotspot_tooltips_options_2'].'</option>';
+ }
+
+ echo '</select>';
+ echo '</span></p>';
+ //Tooltips options - konec
+ echo '</div>';
+ //div za nastavitve obmocja - konec
echo '</fieldset>';
//fieldset Obmocja - konec
-
}
}
diff --git a/admin/survey/classes/class.VprasanjeDeleted.php b/admin/survey/classes/class.VprasanjeDeleted.php
new file mode 100644
index 0000000..11c42c6
--- /dev/null
+++ b/admin/survey/classes/class.VprasanjeDeleted.php
@@ -0,0 +1,185 @@
+<?php
+
+/**
+*
+* Pobrisana vprasanja - pred brisanjem se vprasanje kopira med pobrisane - podobno kot knjiznica
+*
+*/
+
+class VprasanjeDeleted {
+
+ var $ank_id; // trenutna anketa
+
+
+ public function __construct ($anketa = 0) {
+
+ if (isset ($_GET['anketa']))
+ $this->ank_id = $_GET['anketa'];
+ elseif (isset ($_POST['anketa']))
+ $this->ank_id = $_POST['anketa'];
+ elseif ($anketa != 0)
+ $this->ank_id = $anketa;
+ }
+
+
+ // Prikazemo seznam pobrisanih vprasanj uporabnika
+ private function displayDeletedVprasanja(){
+ global $lang;
+ global $global_user_id;
+ global $admin_type;
+
+
+ // Naslov v oknu
+ echo '<h2><span class="faicon delete"></span>'.$lang['srv_deleted_vprasanja'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="popupClose();">✕</a></div>';
+
+
+ // Vsebina
+ echo '<div id="vprasanje_deleted_content" class="content">';
+
+
+ // Seznam vseh pobrisanih vprasanj
+ echo '<div class="question_list">';
+
+ // Loop po vseh pobrisanih vprasanjih v anketi
+ $sql = sisplet_query("SELECT sd.*, s.naslov
+ FROM srv_spremenljivka_deleted sd, srv_spremenljivka s
+ WHERE sd.ank_id='".$this->ank_id."' AND sd.spr_id=s.id
+ ORDER BY sd.delete_time DESC
+ ");
+
+ while($row = mysqli_fetch_array($sql)){
+
+ echo '<div id="question_item_holder_'.$row['spr_id'].'" class="question_item_holder" onClick="selectVprasanjeDeletedItem(\''.$row['spr_id'].'\');">';
+
+ echo ' <input type="checkbox" id="question_item_check_'.$row['spr_id'].'" class="question_item_check" onClick="selectVprasanjeDeletedItem(\''.$row['spr_id'].'\');"><label for="question_item_check_'.$row['spr_id'].'"></label>';
+
+ echo ' <div id="question_item_info_'.$row['spr_id'].'" item-id="'.$row['spr_id'].'" class="question_item_info">';
+
+ echo ' <div>';
+ echo ' <span class="faicon list"></span>';
+ echo ' <span class="title">'.substr(strip_tags($row['naslov']), 0, 40).'</span>';
+ echo ' <span class="date">('.date("G:i d.m.Y", strtotime($row['delete_time'])).')</span>';
+ echo ' </div>';
+
+ echo ' <span class="faicon monitor" title="'.$lang['srv_predogled_spremenljivka'].'" onClick="previewVprasanje(\''.$row['spr_id'].'\');"></span>';
+
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ // Item counter
+ echo '<div class="selected_items">'.$lang['srv_library_item_counter'].': <span id="selected_item_counter">0</span></div>';
+
+
+ // Gumbi na dnu
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onClick="popupClose();">'.$lang['edit1338'].'</button>';
+ echo ' <button id="insert_vprasanje_deleted_button" class="medium blue" disabled="disabled" onClick="insertVprasanjeDeletedItemsIntoSurvey();">'.$lang['srv_library_survey_add'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
+ }
+
+
+ // Pri brisanju najprej skopiramo vprasanje ki ga brisemo
+ public function createDeletedVprasanje($spr_id){
+ global $global_user_id;
+
+ // Skopiramo spremenljivko
+ $b = new Branching($this->ank_id);
+ $new_spr_id = $b->nova_spremenljivka(-3, 0, 0, $spr_id);
+
+ // Zabelezimo v bazi povezavo z anketo in cas brisanja
+ $sql1 = sisplet_query("INSERT INTO srv_spremenljivka_deleted (spr_id, ank_id, delete_time) VALUES ('".$new_spr_id."', '".$this->ank_id."', NOW())");
+ }
+
+ // Vrnemo stevilo pobrisanih vprasanj v anketi
+ public function countDeletedVprasanja(){
+
+ $sql = sisplet_query("SELECT COUNT(id) AS cnt FROM srv_spremenljivka_deleted WHERE ank_id='".$this->ank_id."'");
+ $row = mysqli_fetch_array($sql);
+
+ return $row['cnt'];
+ }
+
+
+ // Dokoncno brisanje vprasanja
+ public static function permanentDeleteVprasanje($spremenljivka){
+
+ if ($spremenljivka > 0) {
+
+ $rowg = Cache::srv_spremenljivka($spremenljivka);
+
+ // pri brisanju multiple grid vprasanja, moramo pobrisate tudi vse child spremenljivke (ker kljuci niso nastavljeni)
+ if ($rowg['tip'] == 24) {
+ $sqld = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$spremenljivka'");
+ while ($rowd = mysqli_fetch_array($sqld)) {
+ sisplet_query("DELETE FROM srv_spremenljivka WHERE id='$rowd[spr_id]'");
+ }
+ }
+
+ $sql = sisplet_query("DELETE FROM srv_vrednost WHERE spr_id='$spremenljivka'");
+ $sql = sisplet_query("DELETE FROM srv_grid WHERE spr_id='$spremenljivka'");
+ $sql = sisplet_query("DELETE FROM srv_spremenljivka WHERE id='$spremenljivka'");
+ }
+ }
+
+
+ /**
+ * @desc pohendla ajax klice
+ */
+ public function ajax () {
+ global $lang;
+ global $global_user_id;
+
+
+ // Odpremo popup s pobrisanimi vprasanji
+ if ($_GET['a'] == 'displayVprasanjeDeletedPopup') {
+ $this->displayDeletedVprasanja();
+
+ // Div za dodaten popup za preview
+ echo '<div id="vprasanje_preview" class="displayNone"></div>';
+ }
+
+ // Dodajanje pobrisanega vprasanja nazaj v vprasalnik
+ elseif ($_GET['a'] == 'addIntoSurvey') {
+
+ $items = $_POST['items'];
+
+ $b = new Branching($this->ank_id);
+ $ba = new BranchingAjax($this->ank_id);
+
+ foreach(array_reverse($items) as $item_id){
+
+ $last_spr = $b->find_last_spr();
+
+ // Dodamo vprasanje v anketo
+ $ba->spremenljivka_new($spremenljivka=$last_spr, $if=0, $endif=0, $copy=$item_id, $drop=0);
+ }
+
+ Common::getInstance()->Init($this->ank_id);
+ Common::getInstance()->prestevilci(0, $all=true);
+
+ $b->branching_struktura();
+ }
+
+
+ // Dokoncen izbris pobrisanega vprasanja
+ elseif ($_GET['a'] == 'deleteItem') {
+
+ $item_id = $_POST['item_id'];
+
+ if($item_id != '' && $item_id > 0){
+ sisplet_query("DELETE FROM srv_spremenljivka WHERE id='".$item_id."'AND folder!='0'");
+ }
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/admin/survey/classes/class.VprasanjeInline.php b/admin/survey/classes/class.VprasanjeInline.php
index 660a22f..e5e349d 100644
--- a/admin/survey/classes/class.VprasanjeInline.php
+++ b/admin/survey/classes/class.VprasanjeInline.php
@@ -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;
@@ -71,8 +70,8 @@ class VprasanjeInline {
$vrednost = $_POST['vrednost'];
$v = explode('_', $vrednost);
- $vrednost = $v[0];
- $vrednost2 = $v[1]; // naslov2 za diferencial
+ $vrednost = isset($v[0]) ? $v[0] : '';
+ $vrednost2 = isset($v[1]) ? $v[1] : ''; // naslov2 za diferencial
$purifier = New Purifier();
$naslov = $purifier->purify_DB($naslov);
@@ -216,7 +215,7 @@ class VprasanjeInline {
function ajax_inline_grid_variable_save () {
Common::updateEditStamp();
- $variable = $_POST['variable'];
+ $variable = strip_tags($_POST['variable']);
$grid = $_POST['grid'];
@@ -356,11 +355,20 @@ class VprasanjeInline {
$variable = $_POST['variable'];
$vre_id = $_POST['vre_id'];
- $sql = sisplet_query("SELECT variable FROM srv_vrednost WHERE id = '$vre_id'");
+ $sql = sisplet_query("SELECT variable, spr_id FROM srv_vrednost WHERE id = '".$vre_id."'");
$row = mysqli_fetch_array($sql);
if ($row['variable'] != $variable) {
- sisplet_query("UPDATE srv_vrednost SET variable='$variable', variable_custom='1' WHERE id = '$vre_id'");
+
+ // Preverimo, ce ze obstaja kaksna variabla z istim imenom - pri kvizu pa ima lahko isto ime
+ if(!SurveyInfo::getInstance()->checkSurveyModule('quiz')){
+
+ $sql2 = sisplet_query("SELECT id FROM srv_vrednost WHERE variable='".$variable."' AND spr_id='".$row['spr_id']."'");
+ if(mysqli_num_rows($sql2) > 0)
+ return false;
+ }
+
+ sisplet_query("UPDATE srv_vrednost SET variable='".$variable."', variable_custom='1' WHERE id='".$vre_id."'");
}
}
@@ -460,7 +468,6 @@ class VprasanjeInline {
if ($lang_id != 0) {
if ($naslov != ''){
$s = sisplet_query("REPLACE INTO srv_language_grid (ank_id, spr_id, grd_id, lang_id, naslov) VALUES ('$anketa', '$this->spremenljivka', '$grid', '$lang_id', '$naslov')");
- //$s = sisplet_query("INSERT INTO srv_language_grid (ank_id, spr_id, grd_id, lang_id, naslov) VALUES ('$anketa', '$this->spremenljivka', '$grid', '$lang_id', '$naslov')");
}
else{
$s = sisplet_query("DELETE FROM srv_language_grid WHERE ank_id='$anketa' AND spr_id='$this->spremenljivka' AND grd_id='$grid' AND lang_id='$lang_id'");
@@ -486,40 +493,29 @@ class VprasanjeInline {
if($TrenutnaLabela != ''){
- //echo "Update labele";
- $TipLabelepart1 = strchr($row['params'], $TipLabele."="); //iz stringa, kjer so vsi params izlusci le string od TipLabele dalje
- //print_r (explode("\n",$row['params'])); //explode(separator,string,limit)
- $newTipLabele = $TipLabele.'='.$Label; //formiraj nov tip labele z labelo
+
+ $TipLabelepart1 = strchr($row['params'], $TipLabele."="); //iz stringa, kjer so vsi params izlusci le string od TipLabele dalje
+
+ $newTipLabele = $TipLabele.'='.$Label; //formiraj nov tip labele z labelo
$explodedparams = explode("\n",$row['params']); //spremeni string v array
for($i=0; $i<=sizeof($explodedparams); $i++){ //za vse elemente array-a
- //echo 'Sem v for zanki';
+
if((strstr($explodedparams[$i], $TipLabele.'=') != '')){ //ce element array-a vsebuje besedilo z ustreznim tipom labele //strstr(string,search,before_search)
- //echo 'Smo dobili string na indeksu: '.$i;
- $indeks = $i; //zabele�i indeks
- //echo 'Indeks1: '.$indeks;
- //$explodedparams[$i] = $newTipLabele; //povozi ustrezen element array-a z novim tipom labele
- //echo 'Exploded: '.$explodedparams[$i];
+ $indeks = $i; //zabelezi indeks
}
}
- //echo 'Indeks2: '.$indeks;
$explodedparams[$indeks] = $newTipLabele; //povozi ustrezen element array-a z novim tipom labele
- //print_r ($explodedparams);
$newparams = implode("\n",$explodedparams); //zdruzi array ponovno v string
- //echo 'New params: '.$newparams;
- $s = sisplet_query("UPDATE srv_spremenljivka SET params = '$newparams' WHERE id='$this->spremenljivka'"); //posodobi params
+
+ $s = sisplet_query("UPDATE srv_spremenljivka SET params = '$newparams' WHERE id='$this->spremenljivka'"); //posodobi params
}
elseif ($TrenutnaLabela == ''){
$s = sisplet_query("UPDATE srv_spremenljivka SET params = CONCAT( srv_spremenljivka.params , '\n$TipLabele=$Label ') WHERE id='$this->spremenljivka'"); //k obstoje�im params dodaj �e naslednje
- //echo $Label;
- //print_r (explode("\n",$row['params'])); //explode(separator,string,limit)
- //echo "Trenutna labela je prazna";
}
}
-/* error_log($anketa);
- error_log($grid);
- error_log($naslov); */
+
if (!$s) echo mysqli_error($GLOBALS['connect_db']);
@@ -615,9 +611,6 @@ class VprasanjeInline {
$Label = substr($Label, 0, -4);
}
-/* error_log("Label: ".$Label);
- error_log("TipLabele: ".$TipLabele);
- error_log("spr: ".$this->spremenljivka); */
$spremenljivkaParams->set($TipLabele, $Label);
diff --git a/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php b/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php
index 2dbb023..5ef0c1b 100644
--- a/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php
+++ b/admin/survey/classes/htmlpurifier-4.3.0/library/HTMLPurifier/Encoder.php
@@ -71,7 +71,7 @@ class HTMLPurifier_Encoder
$len = strlen($str);
for($i = 0; $i < $len; $i++) {
- $in = ord($str{$i});
+ $in = ord($str[$i]);
$char .= $str[$i]; // append byte to char
if (0 == $mState) {
// When mState is zero we expect either a US-ASCII character
diff --git a/admin/survey/classes/log/class.SurveyLog.php b/admin/survey/classes/log/class.SurveyLog.php
index 3b37bb7..f962fda 100644
--- a/admin/survey/classes/log/class.SurveyLog.php
+++ b/admin/survey/classes/log/class.SurveyLog.php
@@ -27,7 +27,7 @@ class SurveyLog {
public function __construct(){
global $site_path;
- define('LOG_FOLDER', $site_path.'logs/');
+ if(!defined('LOG_FOLDER')) define('LOG_FOLDER', $site_path.'logs/');
if (!is_dir(LOG_FOLDER) OR !is_writable(LOG_FOLDER)){
throw new Exception('Directory '.LOG_FOLDER.' must be writable');
diff --git a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php
index 3193246..4c9a3cd 100644
--- a/admin/survey/classes/mobile/class.MobileSurveyAdmin.php
+++ b/admin/survey/classes/mobile/class.MobileSurveyAdmin.php
@@ -11,14 +11,21 @@ class MobileSurveyAdmin{
var $surveyAdminClass;
+ var $first_action;
+ var $second_action;
+ var $third_action;
function __construct($surveyAdminClass){
global $site_url;
$this->surveyAdminClass = $surveyAdminClass;
- }
+ $navigationArray = CrossRoad::MainNavigation($this->surveyAdminClass->anketa, true);
+ $this->first_action = $navigationArray['first_action'];
+ $this->second_action = $navigationArray['second_action'];
+ $this->third_action = $navigationArray['third_action'];
+ }
// Izris glave z menijem - znotraj ankete
public function displayHeaderMobile(){
@@ -31,16 +38,24 @@ class MobileSurveyAdmin{
// Meni
$this->displayMenu();
- // Naslov ankete
+ // Naslov ankete + slider za nastavitve
if($this->surveyAdminClass->anketa > 0){
+
+ // Naslov ankete na sredini
$this->displaySurveyTitle();
+
+ // Ikona za nastavitve
+ $this->displaySurveySettingsIcon();
+
+ // Div holder za nastavitve
+ $this->displayMenuSurveySettings();
}
// Logo - enak kot na desktopu
else{
$this->displayLogo();
}
- // Se inicializiramo zeynep jquery mobile menu
+ // Se inicializiramo zeynep jquery mobile menu in settings meni na desni
echo '<script> mobile_init(); </script>';
echo '</div>';
@@ -81,6 +96,17 @@ class MobileSurveyAdmin{
echo '</div>';
}
+ private function displaySurveySettingsIcon(){
+
+ echo '<div class="mobile_settings_icon mobile_settings_open">';
+ echo ' <span class="faicon wheel_32"></span>';
+ echo '</div>';
+
+ echo '<div class="mobile_settings_icon mobile_settings_close">';
+ echo ' <span>✕</span>';
+ echo '</div>';
+ }
+
// Izris menija
private function displayMenu(){
@@ -95,9 +121,6 @@ class MobileSurveyAdmin{
// Izris glavne navigacije v dropdownu
$this->displayMenuSurveyNavigation();
-
- // Izris akcij za anketo (kopiraj, brisi...) v dropdownu
- $this->displayMenuSurveyActions();
}
// Meni v mojih anketah
else{
@@ -108,6 +131,124 @@ class MobileSurveyAdmin{
}
+
+ // Izris menija za nastavitve v urejanju ankete
+ private function displayMenuSurveySettings(){
+ global $lang;
+ global $admin_type;
+
+ echo '<div class="mobile_settings">';
+
+ echo '<div class="mobile_settings_content">';
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ $hierarhija_type = (!empty($_SESSION['hierarhija'][$this->surveyAdminClass->anketa]['type']) ? $_SESSION['hierarhija'][$this->anketa]['type'] : null);
+
+
+ // prikaz gumbov za vklop in odklepanje ankete
+ $d = new Dostop();
+ if ($d->checkDostopAktiven()) {
+
+ # anketa je aktivna
+ if (SurveyInfo::getSurveyColumn('active') == 1) {
+
+ # V kolikor gre za hierarhijo in uporabnik ni administrator hierarhije
+ if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
+ if ($hierarhija_type == 1) {
+ echo '<a href="index.php?anketa=' . $this->surveyAdminClass->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ }
+ else{
+ echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_active'] . '" style="cursor:text !important;">';
+ }
+ }
+ else {
+ echo '<a href="#" class="srv_ico" onclick="anketa_active(\'' . $this->surveyAdminClass->anketa . '\',\'' . $row['active'] . '\'); return false;" title="' . $lang['srv_anketa_active'] . '">';
+ }
+
+ echo ' <div class="setting_icon"><div id="srv_active" class="switch_anketa anketa_on"></div></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketa_active'].'</div>';
+
+ echo '</a>';
+ }
+ else {
+ $anketa_active = " mobile_settings_close(function(){ anketa_active('" . $this->surveyAdminClass->anketa . "','" . $row['active'] . "'); }); ";
+
+ // Preden anketo aktiviramo preverimo, če gre tudi za izgradnjo hierarhije in če anketa še ni bila aktivirana
+ if (SurveyInfo::getInstance()->checkSurveyModule('hierarhija')){
+ if ($hierarhija_type == 1) {
+ echo '<a href="index.php?anketa=' . $this->surveyAdminClass->anketa . '&amp;a=' . A_HIERARHIJA_SUPERADMIN . '&amp;m=' . M_ADMIN_AKTIVACIJA . '" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ }
+ else{
+ echo '<a href="#" class="srv_ico" title="' . $lang['srv_anketa_noactive'] . '">';
+ }
+ }
+ else {
+ echo '<a href="#" class="srv_ico" onclick="' . $anketa_active . ' return false;" title="' . $lang['srv_anketa_noactive'] . '">';
+ }
+
+ echo ' <div class="setting_icon"><div id="srv_inactive" class="switch_anketa anketa_off"></div></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketa_noactive'].'</div>';
+
+ echo '</a>';
+ }
+
+ // Ce ima uporabnik prepreceno moznost odklepanja ankete, anketo ima vedno zaklenjeno če je vklopljena hierarhija
+ $prevent_unlock = 0;
+ if(SurveyInfo::getSurveyModules('hierarhija') == 2 || (!$d->checkDostopSub('lock') && $row['locked'] == 1 && $admin_type != 0 && $admin_type != 1))
+ $prevent_unlock = 1;
+
+ if ($prevent_unlock == 1) {
+
+ echo '<input type="hidden" name="prevent_unlock" id="prevent_unlock" value="1">';
+
+ echo '<a class="anketa_img_nav" title="' . $lang['srv_anketa_locked'] . '">';
+ echo ' <div class="setting_icon"><span class="faicon lock_close"></span></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketa_locked'].'</div>';
+ echo '</a>';
+ }
+ else {
+ # zaklepanje
+ if ($hierarhija_type == 10) {
+ echo '<a href="#" class="anketa_img_nav" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '" style="cursor:text !important;">';
+ }
+ else {
+ echo '<a class="anketa_img_nav" href="javascript:anketa_lock(\'' . $this->surveyAdminClass->anketa . '\', \'' . ($row['locked'] == 0 ? '1' : '0') . '\', \''.$row['mobile_created'].'\');" title="' . $lang['srv_anketa_locked_' . $row['locked']] . '">';
+ }
+ echo ' <div class="setting_icon"><span class="faicon lock' . ($row['locked'] == 0 ? '_open' : '_close') . '"></span></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketa_locked_' . $row['locked']].'</div>';
+ echo '</a>';
+ }
+
+
+ // Izris akcij za anketo (kopiraj, brisi...) v dropdownu
+ # kopiranje
+ global $global_user_id;
+ if(DomainChange::check1kaDomainChange() && DomainChange::getInstance($global_user_id)->domainChangeLimits()){
+ /*echo ' <a href="#" onclick="anketa_copy_top(\'' . $this->surveyAdminClass->anketa . '\'); return false;" title="'.$lang['srv_anketacopy'].'" class="srv_ico">';
+ echo ' <div class="setting_icon bottom"><span class="faicon anketa_copy"></span></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketacopy'].'</div>';
+ echo ' </a>';*/
+ }
+ else{
+ echo ' <a href="#" onclick="anketa_copy_top(\'' . $this->surveyAdminClass->anketa . '\'); return false;" title="'.$lang['srv_anketacopy'].'" class="srv_ico">';
+ echo ' <div class="setting_icon bottom"><span class="faicon anketa_copy"></span></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketacopy'].'</div>';
+ echo ' </a>';
+ }
+
+ # brisanje
+ echo ' <a href="#" onclick="anketa_delete(\'' . $this->surveyAdminClass->anketa . '\', \'' . $lang['srv_anketadeleteconfirm'] . '\'); return false;" title="' . $lang['srv_anketadelete'] . '" class="srv_ico">';
+ echo ' <div class="setting_icon bottom"><span class="faicon anketa_delete" title="'.$lang['srv_anketadelete'].'"></span></div>';
+ echo ' <div class="setting_text">'.$lang['srv_anketadelete'].'</div>';
+ echo ' </a>';
+ }
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+
// Izris uporabniških podatkov v dropdownu
private function displayMenuUser(){
global $lang, $global_user_id, $site_url;
@@ -148,7 +289,7 @@ class MobileSurveyAdmin{
// Odjava na nov nacin preko frontend/api
echo ' <div><form name="odjava" id="form_odjava" method="post" action="'.$site_url.'frontend/api/api.php?action=logout">';
- echo ' <span class="as_link" onClick="$(\'#form_odjava\').submit();"><span class="faicon logout"></span>' . $lang['logout'] . '</span>';
+ echo ' <span class="as_link noline" onClick="$(\'#form_odjava\').submit();"><span class="faicon logout"></span>' . $lang['logout'] . '</span>';
echo ' </form></div>';
echo ' </div>';
@@ -163,7 +304,7 @@ class MobileSurveyAdmin{
// Izris glavne navigacije v mojih anketah
private function displayMenuMySurveysNavigation(){
- global $lang, $admin_type, $app_settings;
+ global $lang, $admin_type;
# naložimo razred z seznamom anket
@@ -171,6 +312,10 @@ class MobileSurveyAdmin{
$SLCount = $SL->countSurveys();
$SLCountPhone = $SL->countPhoneSurveys();
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+ $t = isset($_GET['t']) ? $_GET['t'] : '';
+
echo '<div class="mobile_menu_navigation">';
@@ -178,12 +323,12 @@ class MobileSurveyAdmin{
// MOJE ANKETE
- $this->displayMenuItem($lang['srv_pregledovanje'], $url='index.php?a=pregledovanje');
+ $this->displayMenuItem($lang['srv_pregledovanje'], $url='index.php?a=pregledovanje', (!isset($_GET['a']) && !isset($_GET['anketa'])) || ($a == 'pregledovanje') ? 'active': '');
// TELEFONSKA ANKETA
if ($SLCountPhone > 0 && $admin_type != '0') {
- $this->displayMenuItem($lang['srv_telephone_surveys'], $url='index.php?a=phoneSurveys');
+ $this->displayMenuItem($lang['srv_telephone_surveys'], $url='index.php?a=phoneSurveys', ($a == 'phoneSurveys') ? 'active': '');
}
@@ -193,31 +338,37 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_ankete'],
- 'url' => 'index.php?a=diagnostics'
+ 'url' => 'index.php?a=diagnostics',
+ 'active' => ($a == 'diagnostics' && !isset ($_GET['t']) ? 'active' : '')
),
array(
'title' => $lang['srv_weekly_diagnostics'],
- 'url' => 'index.php?a=diagnostics&t=time_span_daily'
+ 'url' => 'index.php?a=diagnostics&t=time_span_daily',
+ 'active' => ($a == 'diagnostics' && $t == 'time_span_daily' ? 'active' : '')
),
array(
'title' => $lang['srv_monthly_diagnostics'],
- 'url' => 'index.php?a=diagnostics&t=time_span_monthly'
+ 'url' => 'index.php?a=diagnostics&t=time_span_monthly',
+ 'active' => ($a == 'diagnostics' && $t == 'time_span_monthly' ? 'active' : '')
),
array(
'title' => $lang['srv_yearly_diagnostics'],
- 'url' => 'index.php?a=diagnostics&t=time_span_yearly'
+ 'url' => 'index.php?a=diagnostics&t=time_span_yearly',
+ 'active' => ($a == 'diagnostics' && $t == 'time_span_yearly' ? 'active' : '')
),
array(
'title' => $lang['srv_all_diagnostics'],
- 'url' => 'index.php?a=diagnostics&t=time_span&uvoz=0&ustrezni=1&delnoustrezni=1&neustrezni=0'
+ 'url' => 'index.php?a=diagnostics&t=time_span&uvoz=0&ustrezni=1&delnoustrezni=1&neustrezni=0',
+ 'active' => ($a == 'diagnostics' && $t == 'time_span' ? 'active' : '')
),
array(
'title' => $lang['srv_metapodatki'],
- 'url' => 'index.php?a=diagnostics&t=paradata'
+ 'url' => 'index.php?a=diagnostics&t=paradata',
+ 'active' => ($a == 'diagnostics' && $t == 'paradata' ? 'active' : '')
)
);
- $this->displayMenuItemWithSubmenu($name='diagnostics', $lang['srv_diagnostics'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='diagnostics', $lang['srv_diagnostics'], $submenu, ($a == 'diagnostics' && $t != 'uporabniki') ? 'active' : '');
}
@@ -230,27 +381,43 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['n_users_list'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && !isset($_GET['m'])? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['n_users_list_add'],
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=add',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'add'? 'active' : '')
),
array(
'title' => $lang['n_users_list_all'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki&m=all'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=all',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'all' ? 'active' : '')
+
),
array(
'title' => $lang['n_deleted_users'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki&m=izbrisani'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=izbrisani',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'izbrisani' ? 'active' : '')
+
),
array(
'title' => $lang['n_unconfirmed_users'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki&m=nepotrjeni'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=nepotrjeni',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'nepotrjeni' ? 'active' : '')
+
),
array(
'title' => $lang['n_unsigned_users'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki&m=odjavljeni'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=odjavljeni',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'odjavljeni' ? 'active' : '')
+
),
array(
'title' => $lang['srv_hierarchy_users_access'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki&m=sa-modul'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=sa-modul',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'sa-modul' ? 'active' : '')
+
),
);
}
@@ -261,12 +428,19 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['n_users_list'],
- 'url' => 'index.php?a=diagnostics&t=uporabniki'
+ 'url' => 'index.php?a=diagnostics&t=uporabniki',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && !isset($_GET['m']) ? 'active' : '')
+
+ ),
+ array(
+ 'title' => $lang['n_users_list_add'],
+ 'url' => 'index.php?a=diagnostics&t=uporabniki&m=add',
+ 'active' => ($a == 'diagnostics' && $t == 'uporabniki' && $m == 'add'? 'active' : '')
)
);
}
- $this->displayMenuItemWithSubmenu($name='uporabniki', $lang['hour_users'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='uporabniki', $lang['hour_users'], $submenu, ($a == 'diagnostics' && $t == 'uporabniki' ? 'active' : ''));
}
@@ -274,15 +448,19 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_javna_knjiznica'],
- 'url' => 'index.php?a=knjiznica'
+ 'url' => 'index.php?a=knjiznica',
+ 'active' => ($a == 'knjiznica' && !isset($_GET['t']) ? 'active' : '')
+
),
array(
'title' => $lang['srv_moja_knjiznica'],
- 'url' => 'index.php?a=knjiznica&t=moje_ankete'
+ 'url' => 'index.php?a=knjiznica&t=moje_ankete',
+ 'active' => ($a == 'knjiznica' && $t == 'moje_ankete' ? 'active' : '')
+
)
);
- $this->displayMenuItemWithSubmenu($name='knjiznica', $lang['srv_library'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='knjiznica', $lang['srv_library'], $submenu, ($a == 'knjiznica' ? 'active' : ''));
// NASTAVITVE
@@ -290,39 +468,48 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_settingsSystem'],
- 'url' => 'index.php?a=nastavitve&m=system'
+ 'url' => 'index.php?a=nastavitve&m=system',
+ 'active' => ($a == 'nastavitve' && $m == 'system' ? 'active' : '')
),
array(
'title' => $lang['srv_testiranje_predvidenicas'],
- 'url' => 'index.php?a=nastavitve&m=predvidenicasi'
- ),
- array(
- 'title' => $lang['srv_collectData'],
- 'url' => 'index.php?a=nastavitve&m=collectData'
+ 'url' => 'index.php?a=nastavitve&m=predvidenicasi',
+ 'active' => ($a == 'nastavitve' && $m == 'predvidenicasi' ? 'active' : '')
),
array(
'title' => $lang['srv_nice_url'],
- 'url' => 'index.php?a=nastavitve&m=nice_links'
+ 'url' => 'index.php?a=nastavitve&m=nice_links',
+ 'active' => ($a == 'nastavitve' && $m == 'nice_links' ? 'active' : '')
),
array(
'title' => $lang['srv_anketa_admin'],
- 'url' => 'index.php?a=nastavitve&m=anketa_admin'
+ 'url' => 'index.php?a=nastavitve&m=anketa_admin',
+ 'active' => ($a == 'nastavitve' && $m == 'anketa_admin' ? 'active' : '')
),
array(
'title' => $lang['srv_anketa_deleted'],
- 'url' => 'index.php?a=nastavitve&m=anketa_deleted'
+ 'url' => 'index.php?a=nastavitve&m=anketa_deleted',
+ 'active' => ($a == 'nastavitve' && $m == 'anketa_deleted' ? 'active' : '')
),
array(
- 'title' => $lang['srv_data_deleted'],
- 'url' => 'index.php?a=nastavitve&m=data_deleted'
+ 'title' => $lang['help_settings'],
+ 'url' => 'index.php?a=nastavitve&m=help_settings',
+ 'active' => ($a == 'nastavitve' && $m == 'help_settings' ? 'active' : '')
),
array(
'title' => $lang['srv_user_settings'],
- 'url' => 'index.php?a=nastavitve&m=global_user_settings'
+ 'url' => 'index.php?a=nastavitve&m=global_user_settings',
+ 'active' => ($a == 'nastavitve' && $m == 'global_user_settings' ? 'active' : '')
),
array(
'title' => $lang['edit_data'],
- 'url' => 'index.php?a=nastavitve&m=global_user_myProfile'
+ 'url' => 'index.php?a=nastavitve&m=global_user_myProfile',
+ 'active' => ($a == 'nastavitve' && $m == 'global_user_myProfile' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_tracking_archive'],
+ 'url' => 'index.php?a=nastavitve&m=global_user_ChangeArchive',
+ 'active' => ($a == 'nastavitve' && $m == 'global_user_ChangeArchive' ? 'active' : '')
),
);
}
@@ -330,20 +517,23 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_user_settings'],
- 'url' => 'index.php?a=nastavitve&m=global_user_settings'
+ 'url' => 'index.php?a=nastavitve&m=global_user_settings',
+ 'active' => ($a == 'nastavitve' && $m == 'global_user_settings' ? 'active' : '')
+
),
array(
'title' => $lang['edit_data'],
- 'url' => 'index.php?a=nastavitve&m=global_user_myProfile'
+ 'url' => 'index.php?a=nastavitve&m=global_user_myProfile',
+ 'active' => ($a == 'nastavitve' && $m == 'global_user_myProfile' ? 'active' : '')
),
);
}
- $this->displayMenuItemWithSubmenu($name='nastavitve', $lang['settings'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='nastavitve', $lang['settings'], $submenu, ($a == 'nastavitve' ? 'active' : ''));
// NAROCILA
- if($app_settings['commercial_packages']){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
// placila - samo admini
if ($admin_type == '0') {
@@ -351,19 +541,23 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_narocila_my'],
- 'url' => 'index.php?a=narocila'
+ 'url' => 'index.php?a=narocila',
+ 'active' => ($a == 'narocila' && !isset($_GET['m']) ? 'active' : '')
+
),
array(
'title' => $lang['srv_placila'],
- 'url' => 'index.php?a=narocila&m=placila'
+ 'url' => 'index.php?a=narocila&m=placila',
+ 'active' => ($a == 'narocila' && $m == 'placila' ? 'active' : '')
+
)
);
- $this->displayMenuItemWithSubmenu($name='nastavitve', $lang['settings'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='narocila', $lang['srv_narocila'], $submenu, $a == 'narocila' ? 'active' : '');
}
// moja narocila
else{
- $this->displayMenuItem($lang['srv_narocila'], $url='index.php?a=narocila');
+ $this->displayMenuItem($lang['srv_narocila'], $url='index.php?a=narocila', $a == 'narocila' && !isset($_GET['m']) ? 'active' : '');
}
}
@@ -374,19 +568,27 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_gdpr_user_settings'],
- 'url' => 'index.php?a=gdpr'
+ 'url' => 'index.php?a=gdpr',
+ 'active' => ($a == 'gdpr' && !isset($_GET['m']) ? 'active' : '')
+
),
array(
'title' => $lang['srv_gdpr_survey_list'],
- 'url' => 'index.php?a=gdpr&m=placila'
+ 'url' => 'index.php?a=gdpr&m=gdpr_survey_list',
+ 'active' => ($a == 'gdpr' && $m == 'gdpr_survey_list' ? 'active' : '')
+
),
array(
'title' => $lang['srv_gdpr_dpa'],
- 'url' => 'index.php?a=gdpr'
+ 'url' => 'index.php?a=gdpr&m=gdpr_dpa',
+ 'active' => ($a == 'gdpr' && $m == 'gdpr_dpa' ? 'active' : '')
+
),
array(
'title' => $lang['srv_gdpr_requests'].' ('.$request_counter.')',
- 'url' => 'index.php?a=gdpr&m=gdpr_requests'
+ 'url' => 'index.php?a=gdpr&m=gdpr_requests',
+ 'active' => ($a == 'gdpr' && $m == 'gdpr_requests' ? 'active' : '')
+
)
);
@@ -394,11 +596,13 @@ class MobileSurveyAdmin{
if($admin_type == '0'){
$submenu[] = array(
'title' => $lang['srv_gdpr_requests_all'],
- 'url' => 'index.php?a=gdpr&m=gdpr_requests_all'
+ 'url' => 'index.php?a=gdpr&m=gdpr_requests_all',
+ 'active' => ($a == 'gdpr' && $m == 'gdpr_requests_all' ? 'active' : '')
+
);
}
- $this->displayMenuItemWithSubmenu($name='gdpr', 'GDPR', $submenu);
+ $this->displayMenuItemWithSubmenu($name='gdpr', 'GDPR', $submenu, ($a == 'gdpr' ? 'active' : ''));
echo '</ul>';
@@ -419,6 +623,9 @@ class MobileSurveyAdmin{
$modules = SurveyInfo::getSurveyModules();
$d = new Dostop();
+ $a = isset($_GET['a']) ? $_GET['a'] : '';
+ $m = isset($_GET['m']) ? $_GET['m'] : '';
+
echo '<div class="mobile_menu_navigation first" data-menu-name="first">';
@@ -441,15 +648,25 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_status_summary'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_REPORTI
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_REPORTI,
+ 'active' => ($a == A_REPORTI ? 'active' : '')
),
array(
'title' => $lang['srv_metapodatki'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_PARA_GRAPH
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_PARA_GRAPH,
+ 'active' => ($a == A_PARA_GRAPH ? 'active' : '')
)
);
- $this->displayMenuItemWithSubmenu($name='dashboard', $lang['srv_navigation_status'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='dashboard', $lang['srv_navigation_status'], $submenu, ($this->first_action == NAVI_STATUS
+ || $this->first_action == 'para_graph'
+ || $this->first_action == 'nonresponse_graph'
+ || $this->first_action == 'AAPOR'
+ || $this->first_action == 'langStatistic'
+ || $this->first_action == 'usable_resp'
+ || $this->first_action == 'speeder_index'
+ || $this->first_action == 'reminder_tracking'
+ || $this->first_action == 'status_advanced') ? 'active' : '');
}
}
@@ -460,23 +677,59 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_editirajanketo2'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . ($this->surveyAdminClass->survey_type > 1 ? '&a=' . A_BRANCHING : '')
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . ($this->surveyAdminClass->survey_type > 1 ? '&a=' . A_BRANCHING : ''),
+ 'active' => ($this->second_action == NAVI_UREJANJE_BRANCHING ? 'active' : '')
),
array(
'title' => $lang['srv_nastavitve_ankete'] ,
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_SETTINGS
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_SETTINGS,
+ 'active' => ($this->second_action == NAVI_UREJANJE_ANKETA ? 'active' : '')
),
array(
'title' => $lang['srv_themes'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TEMA
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TEMA,
+ 'active' => ($this->second_action == NAVI_UREJANJE_TEMA ? 'active' : '')
),
array(
- 'title' => $lang['srv_analiza_arhiv'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_ARHIVI
- ),
+ 'title' => $lang['srv_archive'],
+ 'name' => 'edit_submenu',
+ 'submenu' => array(
+ array(
+ 'title' => $lang['srv_archive_survey'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ARHIVI,
+ 'active' => ($a == A_ARHIVI && $m == '' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_ie_title'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ARHIVI.'&m=survey',
+ 'active' => ($a == A_ARHIVI && $m == 'survey' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_ie_data_title'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ARHIVI.'&m=survey_data',
+ 'active' => ($a == A_ARHIVI && $m == 'survey_data' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_tracking_survey'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_TRACKING,
+ 'active' => ($a == A_TRACKING && $m == '' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_tracking_data'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_TRACKING.'&m=tracking_data',
+ 'active' => ($a == A_TRACKING && $m == 'tracking_data' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_survey_archives_tracking_append'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_TRACKING.'&appendMerge=1',
+ 'active' => ($a == A_TRACKING && isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1' ? 'active' : '')
+ )
+ ),
+ 'active' => ((($a == A_ARHIVI || $a == A_TRACKING) && $m != 'data') ? 'active' : '')
+ )
);
- $this->displayMenuItemWithSubmenu($name='edit', $lang['srv_vprasalnik'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='edit', $lang['srv_vprasalnik'], $submenu, ($this->first_action == NAVI_UREJANJE && $m != 'data' ? 'active' : ''));
}
@@ -486,19 +739,22 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_testiranje_diagnostika'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TESTIRANJE . '&m=' . M_TESTIRANJE_DIAGNOSTIKA
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TESTIRANJE . '&m=' . M_TESTIRANJE_DIAGNOSTIKA,
+ 'active' => ($this->second_action == M_TESTIRANJE_DIAGNOSTIKA ? 'active' : '')
),
array(
'title' => $lang['srv_testiranje_komentarji'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_KOMENTARJI
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_KOMENTARJI,
+ 'active' => ($this->second_action == NAVI_TESTIRANJE_KOMENTARJI || $this->second_action == NAVI_TESTIRANJE_KOMENTARJI_ANKETA ? 'active' : '')
),
array(
'title' => $lang['srv_testiranje_vnosi'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TESTIRANJE . '&m=' . M_TESTIRANJE_VNOSI
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_TESTIRANJE . '&m=' . M_TESTIRANJE_VNOSI,
+ 'active' => ($this->second_action == NAVI_TESTIRANJE_VNOSI ? 'active' : '')
),
);
- $this->displayMenuItemWithSubmenu($name='test', $lang['srv_testiranje'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='test', $lang['srv_testiranje'], $submenu, ($this->first_action == NAVI_TESTIRANJE ? 'active' : ''));
}
@@ -508,19 +764,27 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_publication_base'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_VABILA . '&m=settings'
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_VABILA . '&m=settings',
+ 'active' => ($a == A_VABILA && ($m == '' || $m == 'settings') ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['srv_inv_nav_invitations'],
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_INVITATIONS . '&m=settings',
+ 'active' => ($a == A_INVITATIONS && $m != 'view_archive' ? 'active' : '')
),
array(
- 'title' => $lang['srv_publication_url'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_VABILA . '&m=url'
+ 'title' => $lang['srv_inv_nav_other_inv'],
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_OTHER_INV . '&m=settings',
+ 'active' => ($a == A_OTHER_INV && $m != 'view_archive' ? 'active' : '')
),
array(
- 'title' => $lang['srv_inv_nav_invitations'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_INVITATIONS . '&m=settings'
+ 'title' => $lang['srv_archive'],
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_INVITATIONS . '&m=view_archive',
+ 'active' => ($a == A_INVITATIONS && $m == 'view_archive' ? 'active' : '')
),
);
- $this->displayMenuItemWithSubmenu($name='publish', $lang['srv_vabila'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='publish', $lang['srv_vabila'], $submenu, ($this->first_action == NAVI_OBJAVA ? 'active' : ''));
}
@@ -530,26 +794,101 @@ class MobileSurveyAdmin{
$submenu = array(
array(
'title' => $lang['srv_link_data_browse'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_COLLECT_DATA
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_COLLECT_DATA,
+ 'active' => (($m == '' && $a == A_COLLECT_DATA) ? 'active' : '')
),
array(
'title' => $lang['srv_data_navigation_calculate'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_COLLECT_DATA . '&m=calculation'
+ 'name' => 'calculation_submenu',
+ 'submenu' => array(
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_CALC_CALCULATION'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m='.M_COLLECT_DATA_CALCULATION,
+ 'active' => ($a == A_COLLECT_DATA && $m == M_COLLECT_DATA_CALCULATION ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_CALC_CODING'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m='.M_COLLECT_DATA_CODING,
+ 'active' => ($a == A_COLLECT_DATA && $m == M_COLLECT_DATA_CODING? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_CALC_CODING_AUTO'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m='.M_COLLECT_DATA_CODING_AUTO,
+ 'active' => ($a == A_COLLECT_DATA && $m == M_COLLECT_DATA_CODING_AUTO ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_CALC_RECODING'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m='.M_COLLECT_DATA_RECODING,
+ 'active' => ($a == A_COLLECT_DATA && $m == M_COLLECT_DATA_RECODING ? 'active' : '')
+ ),
+ ),
+ 'active' => ($m == M_COLLECT_DATA_CALCULATION || $m == M_COLLECT_DATA_CODING || $m == M_COLLECT_DATA_CODING_AUTO || $m == M_COLLECT_DATA_RECODING || $m == M_COLLECT_DATA_RECODING_DASHBOARD ? 'active' : '')
),
array(
'title' => $lang['srv_data_navigation_import'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_COLLECT_DATA . '&m=append'
+ 'name' => 'import_submenu',
+ 'submenu' => array(
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_IMPORT_APPEND'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m=append',
+ 'active' => ($a == A_COLLECT_DATA && $m == 'append' ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_IMPORT_MERGE'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA.'&m=merge',
+ 'active' => ($a == A_COLLECT_DATA && $m == 'merge'? 'active' : '')
+ )
+ ),
+ 'active' => ($m == 'merge' || $m == 'append' ? 'active' : '')
)
);
if ($d->checkDostopSub('export')) {
+
$submenu[] = array(
'title' => $lang['srv_export_tab'],
- 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_COLLECT_DATA_EXPORT
+ 'name' => 'export_submenu',
+ 'submenu' => array(
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_EXPORT_EXCEL_XLS'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA_EXPORT.'&m='.M_EXPORT_EXCEL_XLS,
+ 'active' => ($a == A_COLLECT_DATA_EXPORT && $m == M_EXPORT_EXCEL_XLS ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_EXPORT_SPSS'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA_EXPORT.'&m='.M_EXPORT_SPSS,
+ 'active' => ($a == A_COLLECT_DATA_EXPORT && $m == M_EXPORT_SPSS ? 'active' : '')
+ ),
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_EXPORT_TXT'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA_EXPORT.'&m='.M_EXPORT_TXT,
+ 'active' => ($a == A_COLLECT_DATA_EXPORT && $m == M_EXPORT_TXT ? 'active' : '')
+ ),
+ /* array(
+ 'title' => $lang['navigation_NAVI_DATA_EXPORT_SAV'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA_EXPORT.'&m='.M_EXPORT_SAV,
+ 'active' => ($a == A_COLLECT_DATA_EXPORT && $m == M_EXPORT_SAV ? 'active' : '')
+ ),
+
+ array(
+ 'title' => $lang['navigation_NAVI_DATA_EXPORT_EXCEL'],
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_COLLECT_DATA_EXPORT.'&m='.M_EXPORT_EXCEL,
+ 'active' => ($a == A_COLLECT_DATA_EXPORT && $m == M_EXPORT_EXCEL ? 'active' : '')
+ ), */
+ ),
+ 'active' => ($a == A_COLLECT_DATA_EXPORT ? 'active' : '')
+ );
+ }
+
+ if ($d->checkDostopSub('edit')) {
+ $submenu[] = array(
+ 'title' => $lang['srv_archive'],
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_ARHIVI . '&m=data',
+ 'active' => ($a == A_ARHIVI && $m == 'data' ? 'active' : '')
);
}
- $this->displayMenuItemWithSubmenu($name='data', $lang['srv_results'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='data', $lang['srv_results'], $submenu, ($this->first_action == NAVI_RESULTS || ($this->first_action == NAVI_UREJANJE && $m == 'data') ? 'active' : ''));
}
@@ -569,49 +908,66 @@ class MobileSurveyAdmin{
'submenu' => array(
array(
'title' => $lang['srv_analiza_arhiviraj_type_0'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_SUMMARY
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_SUMMARY,
+ 'active' => ($m == M_ANALYSIS_SUMMARY ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_1'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_DESCRIPTOR
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_DESCRIPTOR,
+ 'active' => ($m == M_ANALYSIS_DESCRIPTOR ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_2'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_FREQUENCY
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_FREQUENCY,
+ 'active' => ($m == M_ANALYSIS_FREQUENCY ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_3'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_CROSSTAB
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_CROSSTAB,
+ 'active' => ($m == M_ANALYSIS_CROSSTAB ? 'active' : ''),
),
array(
'title' => $lang['srv_multicrosstabs'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_MULTICROSSTABS
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_MULTICROSSTABS,
+ 'active' => ($m == M_ANALYSIS_MULTICROSSTABS ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_4'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_MEANS
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_MEANS,
+ 'active' => ($m == M_ANALYSIS_MEANS ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_5'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_TTEST
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_TTEST,
+ 'active' => ($m == M_ANALYSIS_TTEST ? 'active' : '')
),
array(
'title' => $lang['srv_analiza_arhiviraj_type_6'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_BREAK
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_BREAK,
+ 'active' => ($m == M_ANALYSIS_BREAK ? 'active' : '')
)
- )
+ ),
+ 'active' => (($a == 'analysis' && $m != 'charts' && $m != 'analysis_links' && $m != 'anal_arch') ? 'active' : '')
),
+
array(
'title' => $lang['srv_analiza_charts'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_CHARTS
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_CHARTS,
+ 'active' => ($m == M_ANALYSIS_CHARTS ? 'active' : '')
),
array(
'title' => $lang['srv_reporti'],
- 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_LINKS
+ 'url' => 'index.php?anketa='.$this->surveyAdminClass->anketa.'&a='.A_ANALYSIS.'&m='.M_ANALYSIS_LINKS,
+ 'active' => ($m == M_ANALYSIS_CREPORT || $this->second_action == NAVI_ANALYSIS_LINKS ? 'active' : '')
),
+ array(
+ 'title' => $lang['srv_archive'],
+ 'url' => 'index.php?anketa=' . $this->surveyAdminClass->anketa . '&a=' . A_ANALYSIS . '&m=anal_arch',
+ 'active' => ($a == A_ANALYSIS && $m == 'anal_arch' ? 'active' : '')
+ )
);
- $this->displayMenuItemWithSubmenu($name='analyse', $lang['srv_analiza'], $submenu);
+ $this->displayMenuItemWithSubmenu($name='analyse', $lang['srv_analiza'], $submenu, ($this->first_action == NAVI_ANALYSIS ? 'active' : ''));
}
}
@@ -621,32 +977,12 @@ class MobileSurveyAdmin{
echo '</div>';
}
- // Izris akcij za anketo (kopiraj, brisi...) v dropdownu
- private function displayMenuSurveyActions(){
- global $lang;
-
- echo '<div class="mobile_menu_actions">';
-
- # kopiranje
- echo ' <a href="#" onclick="anketa_copy_top(\'' . $this->surveyAdminClass->anketa . '\'); return false;" title="'.$lang['srv_anketacopy'].'" class="srv_ico">';
- echo ' <span class="faicon anketa_copy"></span> '.$lang['srv_anketacopy'];
- echo ' </a>';
-
- # brisanje
- echo ' <a href="#" onclick="anketa_delete(\'' . $this->surveyAdminClass->anketa . '\', \'' . $lang['srv_anketadeleteconfirm'] . '\'); return false;" title="' . $lang['srv_anketadelete'] . '" class="srv_ico">';
- echo ' <span class="faicon anketa_delete" title="'.$lang['srv_anketadelete'].'"></span> '.$lang['srv_anketadelete'];
- echo ' </a>';
-
- echo '</div>';
- }
-
-
- private function displayMenuItemWithSubmenu($name, $title, $submenu){
+ private function displayMenuItemWithSubmenu($name, $title, $submenu, $active=""){
global $lang;
echo '<li class="has-submenu">';
- echo ' <a href="#" data-submenu="submenu_'.$name.'" title="'.$title.'">'.$title.'<span class="faicon arrow_back"></span></a>';
+ echo ' <a href="#" class="'.$active.'" data-submenu="submenu_'.$name.'" title="'.$title.'">'.$title.'<span class="faicon arrow_back"></span></a>';
echo '</li>';
// Podmeni
@@ -672,10 +1008,10 @@ class MobileSurveyAdmin{
// Dodaten podmeni
if(isset($submenu_item['name'])){
//$this->displaySubmenuItem($submenu_item['name'], $submenu_item['title'], $submenu_item['submenu']);
- $this->displayMenuItemWithSubmenu($submenu_item['name'], $submenu_item['title'], $submenu_item['submenu']);
+ $this->displayMenuItemWithSubmenu($submenu_item['name'], $submenu_item['title'], $submenu_item['submenu'], $submenu_item['active']);
}
else{
- $this->displayMenuItem($submenu_item['title'], $submenu_item['url']);
+ $this->displayMenuItem($submenu_item['title'], $submenu_item['url'], $submenu_item['active']);
}
}
echo '</ul>';
@@ -683,10 +1019,10 @@ class MobileSurveyAdmin{
echo '</div>';
}
- private function displayMenuItem($title, $url){
+ private function displayMenuItem($title, $url, $active=""){
echo '<li>';
- echo '<a href="'.$url.'" title="'.$title.'">'.$title.'</a>';
+ echo '<a class="'.$active.'" href="'.$url.'" title="'.$title.'">'.$title.'</a>';
echo '</li>';
}
@@ -695,11 +1031,24 @@ class MobileSurveyAdmin{
public static function displayAddQuestion($ank_id){
global $lang;
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ // Anketa je zaklenjena
+ if($row['locked'] == 1){
+ echo '<div class="mobile_add_question bottom">';
+ echo ' <button class="medium blue" onclick="return false;">';
+ echo ' <span class="faicon lock_close"></span> ';
+ echo ' </button>';
+ echo '</div>';
+
+ return;
+ }
+
echo '<div class="mobile_add_question bottom">';
- echo ' <span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mobile_add_question_popup(); return false;">';
+ echo ' <button class="medium blue" onclick="mobile_add_question_popup(); return false;">';
echo ' <span class="plus">+</span> ';
echo ' <span>'.$lang['srv_mobile_add_question'].'</span>';
- echo ' </a></span>';
+ echo ' </button>';
echo '</div>';
@@ -713,9 +1062,7 @@ class MobileSurveyAdmin{
echo ' <div class="mobile_add_question_item" onClick="mobile_add_question(\'5\');"><span class="faicon nagovor"></span> <span class="item_text">'.$lang['srv_vprasanje_tip_5'].'</span></div>';
echo ' <div class="mobile_add_question_item" onClick="mobile_add_question(\'6\');"><span class="faicon matrix_32"></span> <span class="item_text">'.$lang['srv_vprasanje_tip_6'].'</span></div>';
- echo ' <span class="buttonwrapper mobile_add_question_button">';
- echo ' <a class="ovalbutton ovalbutton_orange" href="#" onclick="mobile_add_question_popup_close(); return false;"><span>Zapri</span></a>';
- echo ' </span>';
+ echo ' <button class="blue medium mobile_add_question_button" onclick="mobile_add_question_popup_close(); return false;">Zapri</button>';
echo '</div>';
}
@@ -728,10 +1075,10 @@ class MobileSurveyAdmin{
echo '<style>.mobile_add_question.bottom{display: none;}</style>';
echo '<div class="mobile_add_question center">';
- echo ' <span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mobile_add_question_popup(); return false;">';
+ echo ' <button class="blue medium" onclick="mobile_add_question_popup(); return false;">';
echo ' <span class="plus">+</span> ';
echo ' <span>'.$lang['srv_mobile_add_question'].'</span>';
- echo ' </a></span>';
+ echo ' </button>';
echo '</div>';
}
@@ -740,7 +1087,7 @@ class MobileSurveyAdmin{
global $lang;
echo '<div class="add-variable-mobile">';
- echo ' <a href="#" onclick="vrednost_new_mobile(\''.$spr_id.'\', \''.$tip.'\'); return false;" title="'.$lang['srv_novavrednost'].'"><span class="faicon add small"></span> '.$lang['srv_novavrednost'].'</a>';
+ echo ' <a href="#" onclick="vrednost_new_mobile(\''.$spr_id.'\', \''.$tip.'\'); return false;" title="'.$lang['srv_novavrednost'].'"><span class="faicon add"></span> '.$lang['srv_novavrednost'].'</a>';
echo '</div>';
}
}
diff --git a/admin/survey/classes/objects/obj.MailAdapter.php b/admin/survey/classes/objects/obj.MailAdapter.php
index 1f13c87..e815eb1 100644
--- a/admin/survey/classes/objects/obj.MailAdapter.php
+++ b/admin/survey/classes/objects/obj.MailAdapter.php
@@ -71,8 +71,6 @@ class MailAdapter{
private function prepareSurveySettings(){
global $admin_type;
global $mysql_database_name;
- global $email_server_settings;
- global $email_server_fromSurvey;
// Polovimo nastavitve ce obstajajo v bazi
@@ -112,33 +110,34 @@ class MailAdapter{
// Pri 1ka nastavitvah lahko nastavljamo samo reply to, vse ostalo je veedno default
if($this->settings['1ka']['SMTPReplyTo'] == '')
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
- $this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
- $this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
-
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
+ $this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
+ $this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
+
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['1ka']['SMTPAuth'] = 1;
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
+ $this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// Pri google smtp je username vedno email
if($this->mailMode == 'google')
$this->settings['google']['SMTPUsername'] = $this->settings['google']['SMTPFrom'];
// ce posiljamo mail vabila in smo na www.1ka.si oz. virutalkah in smo admin - posiljamo preko sekundarnega maila (raziskave@1ka.si)
- if($this->type == 'invitation' && $admin_type == 0 && isset($email_server_settings['secondary_mail'])){
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
+ if($this->type == 'invitation' && $admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
+
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
}
// Nastavimo default delay
@@ -149,20 +148,20 @@ class MailAdapter{
else{
// Nastavimo 1ka smtp
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['SMTPReplyTo'];
- $this->settings['1ka']['SMTPHost'] = $email_server_settings['SMTPHost'];
- $this->settings['1ka']['SMTPPort'] = $email_server_settings['SMTPPort'];
-
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['1ka']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo');
+ $this->settings['1ka']['SMTPHost'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost');
+ $this->settings['1ka']['SMTPPort'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort');
+
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['1ka']['SMTPAuth'] = 1;
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['1ka']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure') !== false)
+ $this->settings['1ka']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// Nastavimo default delay
$this->settings['1ka']['SMTPDelay'] = 500000;
@@ -176,9 +175,21 @@ class MailAdapter{
// Nastavimo default delay
$this->settings['google']['SMTPDelay'] = 500000;
+
+ $this->settings['smtp']['SMTPFrom'] = '';
+ $this->settings['smtp']['SMTPFromNice'] = '';
+ $this->settings['smtp']['SMTPReplyTo'] = '';
+ $this->settings['smtp']['SMTPHost'] = '';
+ $this->settings['smtp']['SMTPPort'] = '';
+ $this->settings['smtp']['SMTPUsername'] = '';
+ $this->settings['smtp']['SMTPPassword'] = '';
+ $this->settings['smtp']['SMTPAuth'] = '';
+ $this->settings['smtp']['SMTPSecure'] = '';
+ $this->settings['smtp']['SMTPDelay'] = '';
+
// Ce imamo nastavljeno, da se za posiljanje iz ankete uporabi isti smtp streznik kot za generalno posiljanje
- if($email_server_fromSurvey){
+ if(AppSettings::getInstance()->getSetting('email_server_fromSurvey') === true){
$this->prepareGeneralSettings();
}
else{
@@ -187,13 +198,13 @@ class MailAdapter{
if($this->type == 'invitation'){
// Pri vabilih je default 1ka streznik samo na www.1ka.si in to samo za admine
- if($admin_type == 0 && isset($email_server_settings['secondary_mail'])){
+ if($admin_type == 0 && AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom') !== false){
$this->mailMode = '1ka';
- $this->settings['1ka']['SMTPFrom'] = $email_server_settings['secondary_mail']['SMTPFrom'];
- $this->settings['1ka']['SMTPFromNice'] = $email_server_settings['secondary_mail']['SMTPFromNice'];
- $this->settings['1ka']['SMTPReplyTo'] = $email_server_settings['secondary_mail']['SMTPReplyTo'];
- $this->settings['1ka']['SMTPUsername'] = $email_server_settings['secondary_mail']['SMTPUsername'];
- $this->settings['1ka']['SMTPPassword'] = $email_server_settings['secondary_mail']['SMTPPassword'];
+ $this->settings['1ka']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFrom');
+ $this->settings['1ka']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPFromNice');
+ $this->settings['1ka']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPReplyTo');
+ $this->settings['1ka']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPUsername');
+ $this->settings['1ka']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-secondary_mail-SMTPPassword');
}
// Drugace je potrebno nastaviti smtp
else{
@@ -211,37 +222,36 @@ class MailAdapter{
// Pripravimo nastavitve splosnega posiljanja v aplikaciji glede na nastavitve v settings_optional.php
private function prepareGeneralSettings(){
- global $email_server_settings;
global $mysql_database_name;
$this->mailMode = 'smtp';
$this->settings['SMTPMailMode'] = 2;
$this->settings['smtp'] = array(
- 'SMTPFrom' => $email_server_settings['SMTPFrom'],
- 'SMTPFromNice' => $email_server_settings['SMTPFromNice'],
- 'SMTPReplyTo' => $email_server_settings['SMTPReplyTo'],
+ 'SMTPFrom' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFrom'),
+ 'SMTPFromNice' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPFromNice'),
+ 'SMTPReplyTo' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPReplyTo'),
- 'SMTPHost' => $email_server_settings['SMTPHost'],
- 'SMTPPort' => $email_server_settings['SMTPPort']
+ 'SMTPHost' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPHost'),
+ 'SMTPPort' => AppSettings::getInstance()->getSetting('email_server_settings-SMTPPort')
);
- if(isset($email_server_settings['SMTPAuth']) && $email_server_settings['SMTPAuth'] == 1){
- $this->settings['smtp']['SMTPAuth'] = $email_server_settings['SMTPAuth'];
- $this->settings['smtp']['SMTPUsername'] = $email_server_settings['SMTPUsername'];
- $this->settings['smtp']['SMTPPassword'] = $email_server_settings['SMTPPassword'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPAuth') === true){
+ $this->settings['smtp']['SMTPAuth'] = 1;
+ $this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername');
+ $this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPPassword');
}
- if(isset($email_server_settings['SMTPSecure']))
- $this->settings['smtp']['SMTPSecure'] = $email_server_settings['SMTPSecure'];
+ if(AppSettings::getInstance()->getSetting('email_server_settings-SMTPUsername') !== false)
+ $this->settings['smtp']['SMTPSecure'] = AppSettings::getInstance()->getSetting('email_server_settings-SMTPSecure');
// ce posiljamo v povezavi s placili (racuni, predracuni...) - posiljamo preko tretjega maila (invoice@1ka.si)
- if($this->type == 'payments' && isset($email_server_settings['payments_mail']) && $mysql_database_name == 'real1kasi'){
- $this->settings['smtp']['SMTPFrom'] = $email_server_settings['payments_mail']['SMTPFrom'];
- $this->settings['smtp']['SMTPFromNice'] = $email_server_settings['payments_mail']['SMTPFromNice'];
- $this->settings['smtp']['SMTPReplyTo'] = $email_server_settings['payments_mail']['SMTPReplyTo'];
- $this->settings['smtp']['SMTPUsername'] = $email_server_settings['payments_mail']['SMTPUsername'];
- $this->settings['smtp']['SMTPPassword'] = $email_server_settings['payments_mail']['SMTPPassword'];
+ if($this->type == 'payments' && AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom') !== false && $mysql_database_name == 'real1kasi'){
+ $this->settings['smtp']['SMTPFrom'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFrom');
+ $this->settings['smtp']['SMTPFromNice'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPFromNice');
+ $this->settings['smtp']['SMTPReplyTo'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPReplyTo');
+ $this->settings['smtp']['SMTPUsername'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPUsername');
+ $this->settings['smtp']['SMTPPassword'] = AppSettings::getInstance()->getSetting('email_server_settings-payments_mail-SMTPPassword');
}
// Nastavimo default delay
@@ -325,31 +335,25 @@ class MailAdapter{
// Vrnemo nastavitve za dolocen mode
public function get1KASettings(){
-
- $result = $this->settings['1ka'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['1ka']) && is_array($this->settings['1ka']))
+ return $this->settings['1ka'];
else
return array();
}
public function getGoogleSettings(){
-
- $result = $this->settings['google'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['google']) && is_array($this->settings['google']))
+ return $this->settings['google'];
else
return array();
}
public function getSMTPSettings(){
-
- $result = $this->settings['smtp'];
-
- if(isset($result) && is_array($result))
- return $result;
+
+ if(isset($this->settings['smtp']) && is_array($this->settings['smtp']))
+ return $this->settings['smtp'];
else
return array();
}
@@ -491,6 +495,14 @@ class MailAdapter{
// Dobimo nastavitve iz baze
$settings = $this->getSettings($mailModeString);
+ if(!isset($settings["SMTPHost"])
+ || !isset($settings["SMTPPort"])
+ || !isset($settings["SMTPSecure"])
+ || !isset($settings["SMTPUsername"])
+ || !isset($settings["SMTPPassword"])
+ || !isset($settings["SMTPFrom"])){
+ return false;
+ }
// Nastavimo mail server
$this->phpMailerClass->Host = $settings["SMTPHost"];
@@ -709,7 +721,7 @@ class MailAdapter{
// Pripravimo design emaila
private function prepareEmailDesign($content, $heading='', $image='', $button=''){
- global $lang, $app_settings, $site_domain;
+ global $lang, $site_domain;
// V nekaterih primerih ne designeramo maila
if(!in_array($this->type, array('account', 'payments')) || !in_array($site_domain, array('localhost', 'www.1ka.si', 'test.1ka.si', 'test2.1ka.si'))){
@@ -722,7 +734,7 @@ class MailAdapter{
$content = str_replace($signature, "", $content);
// Logo
- $logo_src = ($lang['id'] == '1') ? 'https://www.1ka.si/public/img/logo/1ka_slo.png' : 'https://www.1ka.si/public/img/logo/1ka_eng.png';
+ $logo_src = ($lang['id'] == '1') ? 'https://www.1ka.si/public/img/logo/1ka_logo_slo.jpg' : 'https://www.1ka.si/public/img/logo/1ka_logo_eng.jpg';
// Naslov
//$heading = 'Naslovček';
diff --git a/admin/survey/classes/objects/obj.PopUp.php b/admin/survey/classes/objects/obj.PopUp.php
index 836cc8e..f72ad5d 100644
--- a/admin/survey/classes/objects/obj.PopUp.php
+++ b/admin/survey/classes/objects/obj.PopUp.php
@@ -85,51 +85,50 @@ class PopUp
return $this;
}
- public function display()
- {
+ public function display(){
+
$this->_displayed = true;
#začnemo osnovni div
echo '<div';
- if ($this->_id != null)
- {
+ if ($this->_id != null){
echo ' id="'.$this->_id.'"';
}
- if (count($this->_css) > 0)
- {
+ if (count($this->_css) > 0){
echo ' class="'. implode(' ',$this->_css).'"';
}
echo '>';
+
#dodamo header
- if ($this->_headerText != null)
- {
+ if ($this->_headerText != null){
echo '<div class="divPopUp_top">';
echo $this->_headerText;
echo '</div>'; #PM_top
+
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\'); return false;">✕</a></div>';
}
+
#dodamo vsebino - content
- echo '<div class="divPopUp_content">';
+ echo '<div class="popup_main">';
echo $this->_content;
- echo '</div>'; # class="divPopUp_content"
-
- # začnemo div z gumbi
- echo '<div class="divPopUp_btm">';
+ echo '</div>';
- # izrišemo gumbe
+
+ # div z gumbi
+ echo '<div class="button_holder">';
if (count($this->_buttons) > 0) {
- foreach ($this->_buttons AS $button)
- {
+ foreach ($this->_buttons AS $button){
echo $button;
}
}
+ echo '</div>';
- #zaključimo div z gumbi
- echo '</div>'; #class="inv_FS_btm clr"
-
- #zaključimo div z gumbi
+
+ #zaključimo osnovni div
echo '</div>';
+
return $this;
}
diff --git a/admin/survey/classes/objects/obj.PopUpButton.php b/admin/survey/classes/objects/obj.PopUpButton.php
index 5131c17..bb39d83 100644
--- a/admin/survey/classes/objects/obj.PopUpButton.php
+++ b/admin/survey/classes/objects/obj.PopUpButton.php
@@ -51,7 +51,7 @@ class PopUpButton
private $_float = 'floatLeft';
private $_space = 'spaceLeft';
- private $_buttonColor = 'gray';
+ private $_buttonColor = 'white-blue';
private $_actions = array();
public function __construct($caption = null)
@@ -99,11 +99,15 @@ class PopUpButton
{
switch ($buttonColor) {
case 'orange':
- $this->_buttonColor = 'orange';
+ $this->_buttonColor = 'blue';
break;
+ case 'white-black':
+ $this->_buttonColor = 'white-black';
+ break;
+
default:
- $this->_buttonColor = 'gray';
+ $this->_buttonColor = 'white-blue';
break;
}
@@ -121,13 +125,10 @@ class PopUpButton
}
public function __toString() {
- $str = '<div class="'.$this->_float.' '.$this->_space.'">';
- $str .= '<div class="buttonwrapper" title="'.$this->_title.'">';
- $str .= '<a class="ovalbutton ovalbutton_'.$this->_buttonColor.'" href="#" '.implode(' ', $this->_actions).'>';
- $str .= '<span>'.$this->_caption.'</span>';
- $str .= '</a>';
- $str .= '</div>';
- $str .= '</div>';
+ $str = '<button class="medium '.$this->_buttonColor.'" title="'.$this->_title.'" '.implode(' ', $this->_actions).'>';
+ $str .= $this->_caption;
+ $str .= '</button>';
+
return $str;
}
}
diff --git a/admin/survey/classes/objects/obj.PopUpCancelButton.php b/admin/survey/classes/objects/obj.PopUpCancelButton.php
index 6a0a27e..5777bcb 100644
--- a/admin/survey/classes/objects/obj.PopUpCancelButton.php
+++ b/admin/survey/classes/objects/obj.PopUpCancelButton.php
@@ -53,5 +53,6 @@ class PopUpCancelButton extends PopUpButton
global $lang;
parent::__construct($lang['srv_cancel']);
$this -> addAction('onClick',"$('#fade').fadeOut('slow');$('#fullscreen').fadeOut('slow').html(''); return false;");
+ $this -> setButtonColor('white-black');
}
} \ No newline at end of file
diff --git a/admin/survey/classes/objects/obj.SpremenljivkaSkala.php b/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
index da020ad..be14205 100644
--- a/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
+++ b/admin/survey/classes/objects/obj.SpremenljivkaSkala.php
@@ -133,9 +133,11 @@ class SpremenljivkaSkala {
* @return (Intiger) $this->skala
*/
function getSkala() {
- if ((int)$skala >= 0) {
+
+ if ((int)$this->skala >= 0) {
return $this->skala;
}
+
return NULL;
}
diff --git a/admin/survey/classes/phpqrcode/cache/frame_1.dat b/admin/survey/classes/phpqrcode/cache/frame_1.dat
new file mode 100644
index 0000000..be28fea
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_1.dat
@@ -0,0 +1,2 @@
+xڝ E9u`"PńC牗T!0$
+EɲQmh۾9{kI" 9Ln)Ap־>^zmnŖ;mn \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_10.dat b/admin/survey/classes/phpqrcode/cache/frame_10.dat
new file mode 100644
index 0000000..aff163f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_10.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_11.dat b/admin/survey/classes/phpqrcode/cache/frame_11.dat
new file mode 100644
index 0000000..95af68a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_11.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_12.dat b/admin/survey/classes/phpqrcode/cache/frame_12.dat
new file mode 100644
index 0000000..73228b3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_12.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_13.dat b/admin/survey/classes/phpqrcode/cache/frame_13.dat
new file mode 100644
index 0000000..2256f0e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_13.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_14.dat b/admin/survey/classes/phpqrcode/cache/frame_14.dat
new file mode 100644
index 0000000..e9ae093
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_14.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_15.dat b/admin/survey/classes/phpqrcode/cache/frame_15.dat
new file mode 100644
index 0000000..1872781
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_15.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_16.dat b/admin/survey/classes/phpqrcode/cache/frame_16.dat
new file mode 100644
index 0000000..60af678
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_16.dat
@@ -0,0 +1 @@
+xA E]sIX;n6`qW6`%A/3!!g̡1N) E|;>6⸏97$c]kkw1[mC͜cR>E,hʼnp#xFyWVWG3+˓S}Ğ#G8b^c^cpc&3YQ"vk9܇} ĿQL/ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_17.dat b/admin/survey/classes/phpqrcode/cache/frame_17.dat
new file mode 100644
index 0000000..87f0cf5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_17.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_18.dat b/admin/survey/classes/phpqrcode/cache/frame_18.dat
new file mode 100644
index 0000000..bb7138c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_18.dat
@@ -0,0 +1,2 @@
+xA
+0E]օ,2;s&͚hO1&09OIv@DD &ىKXFv<dq9<%h Ys !(ds;~||b(Yůg#`KSĶsidߍLg:әt/gmkM3{4rTQes><әt3;H#љt3Y+oghٽlnF>i^#awm;g~pgNs{6zp' \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_19.dat b/admin/survey/classes/phpqrcode/cache/frame_19.dat
new file mode 100644
index 0000000..95e26ad
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_19.dat
@@ -0,0 +1,3 @@
+xA
+ E.No7ћiiRN2W%x@ڜ'
+u6.*S;}àT zrt%,};)ZLP$qgLdJ;w.]z#[͝Og" B}};w#1Gb;w_C+w@Dfu2N9R7|pWkk \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_2.dat b/admin/survey/classes/phpqrcode/cache/frame_2.dat
new file mode 100644
index 0000000..7e42f31
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_2.dat
@@ -0,0 +1 @@
+x͒ F{v& &Y+?Z1S'y!a815&۴HٞclF1#6 f6O7C֏8gIfB\DԻ( \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_20.dat b/admin/survey/classes/phpqrcode/cache/frame_20.dat
new file mode 100644
index 0000000..d5ecc1d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_20.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_21.dat b/admin/survey/classes/phpqrcode/cache/frame_21.dat
new file mode 100644
index 0000000..1974dd9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_21.dat
@@ -0,0 +1 @@
+xA E]sIX;n6Upв]٘< i-eW)ŕ…H\jvqHL\6ЅrILܹ%@Vv(P4|Xngɝ~]Du1Us S\,2N?DKF-:eJ]p_,a0` X` w,` X]5 Y4{2vJs9)u۹,]^_7$_ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_22.dat b/admin/survey/classes/phpqrcode/cache/frame_22.dat
new file mode 100644
index 0000000..0f01802
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_22.dat
@@ -0,0 +1,3 @@
+xA
+0 E]{.]{{{ZBepwe@VERZ3"*2o4y)i#dbdF҅I"4WIu45x.ZS{8k={o.q[:帒qy
+)t#N8dCj-OOG}:/:sz!)^<eSu{ 'p '==='p 'pߣߣN89pQQ]HpzG^QI|߳u;9d;X~$tdy \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_23.dat b/admin/survey/classes/phpqrcode/cache/frame_23.dat
new file mode 100644
index 0000000..ee3b370
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_23.dat
@@ -0,0 +1,3 @@
+xA
+ Efo7ћU) %M!ΔYu(<sKT
+&I\i+Ъ(mFQhv~n1o]s_ޟ3`_w2ȹlc[;c֟ˤN4p 7pmTri_pS=77p 7pÍ>IO- 7p 7$}>ɷ7p tssrs Vmҹ}R~7&?7ԦIbh{<Mi- \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_24.dat b/admin/survey/classes/phpqrcode/cache/frame_24.dat
new file mode 100644
index 0000000..7b92e29
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_24.dat
@@ -0,0 +1 @@
+xA EMX0;nVP4HSSxU3/O LiJ4V JC%6VR&DBHjDJ??BlcDZ'UXUޏ0ywįj똳3ścj{:GqGNv;笓J <]#8#8H'GqGtr:9#8#8ؓhNt_>teS^\gQe?vuo;>*wlm \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_25.dat b/admin/survey/classes/phpqrcode/cache/frame_25.dat
new file mode 100644
index 0000000..ba12518
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_25.dat
@@ -0,0 +1,3 @@
+xA
+ s낋]rxY51mMBG
+*Sx|Ua5ƵZ-,1HPRjX5iG>WR/+uT廯 ӯ嗴u[Sa[kv5+5nJ%+VXbŊ߬u'SRtzZ++VXbŊٟٟٟ+VXb}Ŋ+VXVI+kq[toVZvoNVw}{r<ýR"R] Wr} \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_26.dat b/admin/survey/classes/phpqrcode/cache/frame_26.dat
new file mode 100644
index 0000000..d34a73f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_26.dat
@@ -0,0 +1,2 @@
+xA
+ Eօ,t77ћU E)i7*~cXEBFC6:&L,Mv.KgոYM>>mۚ?vmg?ұηdCUIkE\Msfafa>[sӈ9쬩ެ8b<k7}k30 30 3*r\7 fafafr\7 fafaY d49kyX yg)dwn̢U>]LgEo w1 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_27.dat b/admin/survey/classes/phpqrcode/cache/frame_27.dat
new file mode 100644
index 0000000..b4d9ffd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_27.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_28.dat b/admin/survey/classes/phpqrcode/cache/frame_28.dat
new file mode 100644
index 0000000..8cbaa19
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_28.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_29.dat b/admin/survey/classes/phpqrcode/cache/frame_29.dat
new file mode 100644
index 0000000..5e4a711
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_29.dat
@@ -0,0 +1,2 @@
+xA a޺ @n7+*4!?J 抮]STf)sI"Ȕb0|"Luٸ,E1\6*uQ?>aυR-rn.ꯋ\T:*)|) , ,x_}:^RUoɢu~މX`XЏЏЏЏ_`X`XЏЏЏ_`X`XЏЏЏЏwbX`PU)D"c{z3<}^?bm잃a.]
+{Q6uT,9 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_3.dat b/admin/survey/classes/phpqrcode/cache/frame_3.dat
new file mode 100644
index 0000000..188d531
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_3.dat
@@ -0,0 +1 @@
+x E{v& &Y+bk'ya:TXl޶$W+ӏv9}gR@H0YPBEm?s"bt2cn:ﺭ;YzQ7 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_30.dat b/admin/survey/classes/phpqrcode/cache/frame_30.dat
new file mode 100644
index 0000000..44cf3d3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_30.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_31.dat b/admin/survey/classes/phpqrcode/cache/frame_31.dat
new file mode 100644
index 0000000..ce429d0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_31.dat
@@ -0,0 +1 @@
+xA a޺ &r4yķ!mV3Iv!Ҝ2i\NSS4EF2+65e/Ws]!?p=S~Đ?+x6r6y}ǴeR1-WllҌXz/>V櫷:ñA8-+mTbllltM&]ll&]Ill&]y 6` 6`iuyXWi\tz>.zk t77wJϔ4w҈85 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_32.dat b/admin/survey/classes/phpqrcode/cache/frame_32.dat
new file mode 100644
index 0000000..aaa0808
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_32.dat
@@ -0,0 +1,2 @@
+x
+ ־. Dl, Mz6Ç gcJD;'.AIqމI,IrYFk%DOy|EDD(L_Y>*ߚ?aOkL_<[c>c˘uLI%#0#0#otѢ}4fv_)Eph5R881#0#0itZ#0#0#0itZ#0#0#0itZl0#09q"HܜHQ"L5}-Y׾k`>z鸳4&p!!`:5 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_33.dat b/admin/survey/classes/phpqrcode/cache/frame_33.dat
new file mode 100644
index 0000000..a261375
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_33.dat
@@ -0,0 +1,14 @@
+xA a޺@n7+*L++柮bb*LCc kHrjJ5Yi~0_TT}e>5b_w͟?\Rai+7W\wLUNL
++
++jOkc\˩|%o<kL++v
++
++Š>} 8
++
++
++ 3g
++
++
++3g@
++
++
++:RXB9I=ko/Swؘٯ`gr_ٙYVSYzIefnmQoz > \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_34.dat b/admin/survey/classes/phpqrcode/cache/frame_34.dat
new file mode 100644
index 0000000..7ceb025
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_34.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_35.dat b/admin/survey/classes/phpqrcode/cache/frame_35.dat
new file mode 100644
index 0000000..56bc3e2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_35.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_36.dat b/admin/survey/classes/phpqrcode/cache/frame_36.dat
new file mode 100644
index 0000000..282c60d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_36.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_37.dat b/admin/survey/classes/phpqrcode/cache/frame_37.dat
new file mode 100644
index 0000000..015c0f2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_37.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_38.dat b/admin/survey/classes/phpqrcode/cache/frame_38.dat
new file mode 100644
index 0000000..71cf53e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_38.dat
@@ -0,0 +1 @@
+xA0ЎuA2;Нk(gytp9$D\e^'t-aIFMSkIŤ:7|LkN8N7i}i,[WgӴ?31iN}}=OM:4)SL2eʔ)SL#$ JJM:}]L٧SQL2eʔ)SL2աPt(:)SL2eʔ)S:ECq2eʔ)SL2eʔECѡ8O2eʔ)SL2eTCѡPL2eʔ)SL2ݓsJCIKԂi93n_ +Ri4\g;% }an \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_39.dat b/admin/survey/classes/phpqrcode/cache/frame_39.dat
new file mode 100644
index 0000000..53511f7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_39.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_4.dat b/admin/survey/classes/phpqrcode/cache/frame_4.dat
new file mode 100644
index 0000000..67b30e8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_4.dat
@@ -0,0 +1 @@
+x E=u pجQCOM'ˏ$ @3eF\FNXRyؾC{a8R Ńa2@qkH1(`cj~0ܨعnXGĀ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_40.dat b/admin/survey/classes/phpqrcode/cache/frame_40.dat
new file mode 100644
index 0000000..90d36dd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_40.dat
@@ -0,0 +1,2 @@
+xA@Ь@o7`Qfe䕫PA><?jjo5WNizyW&]߅C?IrW^;8
+s<ðS{9^gE}><]߳bZn^AQ}[9^]ynajM܇K̘1cƌ3f̘1{W5}{7lMޚxI<Kαyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘1ۻٻ={αyl3f̘1cƌ3f̘SʑӒ7HK޼g\u_r'4[-]qL8ƝY1q!/(% \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_5.dat b/admin/survey/classes/phpqrcode/cache/frame_5.dat
new file mode 100644
index 0000000..d5dafe1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_5.dat
@@ -0,0 +1 @@
+x1 Eu7ЛZ|ND B0@R$l,->VKZ[<zqƎYJ&i嚂Zy:Y'YV&eR"sjr+.MƎ9zs, \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/frame_6.dat b/admin/survey/classes/phpqrcode/cache/frame_6.dat
new file mode 100644
index 0000000..0fc3d03
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_7.dat b/admin/survey/classes/phpqrcode/cache/frame_7.dat
new file mode 100644
index 0000000..4337596
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_8.dat b/admin/survey/classes/phpqrcode/cache/frame_8.dat
new file mode 100644
index 0000000..669b325
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_8.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/frame_9.dat b/admin/survey/classes/phpqrcode/cache/frame_9.dat
new file mode 100644
index 0000000..d79295e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/frame_9.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_101_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_101_0.dat
new file mode 100644
index 0000000..51deaba
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_101_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_105_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_105_0.dat
new file mode 100644
index 0000000..97e9e5d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_105_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_109_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_109_0.dat
new file mode 100644
index 0000000..eadf83a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_109_0.dat
@@ -0,0 +1,2 @@
+x=
+0 нi9'b$t^#ii?bK[AUF徝Ƶijx]m]2-ĖK~ Vw}X&Oɓ666666yR'%lllll/hlm dl3+mͫ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_113_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_113_0.dat
new file mode 100644
index 0000000..5eb7f5d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_113_0.dat
@@ -0,0 +1,2 @@
+x;
+0>I9+Es=ϤL1̄[FZU4?i<;7;P#W-[ݯ6ddddddc",;"sk摑Q&erw######L.摑Иy1^˲\3 v \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_117_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_117_0.dat
new file mode 100644
index 0000000..781c7f8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_117_0.dat
@@ -0,0 +1,2 @@
+xA
+0 }OrR,#3,o5Cq:;;wvNJZG=m} ѱ2iRkj_YYYYYYYYe_/WVVVVVVkd-Ϻ,#OZc]|{ž$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_121_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_121_0.dat
new file mode 100644
index 0000000..68810c3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_121_0.dat
@@ -0,0 +1 @@
+x1 О/w YMS8>2SFOEcW\ۼ{cpKGBКmxhfffffff/s22W|*d1*5̬RWas\xm~8߮r0wjsdm&y \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_125_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_125_0.dat
new file mode 100644
index 0000000..2c73ef1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_125_0.dat
@@ -0,0 +1,2 @@
+xA
+ н_TH`3AOL4 k(ewGW. #2} \Ygggggggggg_d>j^s;;;;;;;;;;'q;;;;;;;;;'˰qu_PYw{e=dG/ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_129_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_129_0.dat
new file mode 100644
index 0000000..812ee8a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_129_0.dat
@@ -0,0 +1,2 @@
+x1
+ /*DE'hgt-}_pV \"b=s[J=8Dho۞' 0X ۴e0`  j" 0`Wf`^P0`2Ȁ  d07(<Oo 6 S \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_133_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_133_0.dat
new file mode 100644
index 0000000..03b41d3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_133_0.dat
@@ -0,0 +1,2 @@
+x1
+0 нI9Ty)<4hNSҚ]Z?[H<uFI7R` ,XE޹˴]Wgy ,X`!Y# ,X`<"# ,X`<bg!,X`WyO 4ѷwf>Y/XLGby"pT \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_137_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_137_0.dat
new file mode 100644
index 0000000..f6d993b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_137_0.dat
@@ -0,0 +1 @@
+x1 О/+FZ?J L7Ժ*Ba%L~˻ʓCJYIWJ .K]R0a„ $INTwlLaL0a„ &Ld@PO0a„ &L0e@P?a„ &L0aDe@ &L0aMIlL&)dlgacR<$v,ɺ?U2] \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_141_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_141_0.dat
new file mode 100644
index 0000000..8c685c8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_141_0.dat
@@ -0,0 +1,2 @@
+x=
+0 нi9'EDx͘%<l[Z|ZPN NM7;mfovm 6-wޥ}yaÆ 6lذn_teivƾٰaÆ 6lȚY.fÆ 6lذa#kSldM 6lذaÆ YS֔56lذaÆ 6m$& 3dyecS&NL;&< \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_145_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_145_0.dat
new file mode 100644
index 0000000..9c9c1ae
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_145_0.dat
@@ -0,0 +1,2 @@
+x;
+0>I9+E{$m^&uS"D6ڟ]98UMbҾY[2拉Ĉ#F1bĈ%iRN潝ѳ#;#F1bĈN1i#F1bĈ#FtZ}Nk1bĈ#F1bktZ;#F1bFV-u"IoD-*7uj>bMV+ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_149_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_149_0.dat
new file mode 100644
index 0000000..d258350
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_149_0.dat
@@ -0,0 +1,3 @@
+xA
+ н_MEQXP৞.|94e{JLv#^n[ ?;
+ZIV-*w˒1*+VXbŊXgwqX}JRYbŊ+VXbeΠwfeΠ^bŊ+VXbʜAʜAbŊ+VXbŊ9ٜAbŊ+VXbŊl0*0Tj`?Ϊ;X=zZr* \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_153_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_153_0.dat
new file mode 100644
index 0000000..fc79e9e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_153_0.dat
@@ -0,0 +1 @@
+x1 Н/礑h&F`Ҽ@I;PZ^X͌mf.=5 [if-R+!wr˜g\j̘1cƌ3f̘1cfo.2?1z `ƌ3f̘1cƌzƌ3f̘1cƌ3fztf3f̘1cƌ3f̘kk030cƌ3f̘1c9;Ď`vf͚̆ZϘW9 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_157_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_157_0.dat
new file mode 100644
index 0000000..ad749f3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_157_0.dat
@@ -0,0 +1,2 @@
+xA
+ н_QRY k*q͵=j7~nN.p%ڵsi.رcǎ;vر{.-W2={mgy+رcǎ;vɳ2;yּcǎ;vرcNɳ;vرcǎ;v2<NVcǎ;vرge2vyǎ;vرc];v"ޝ]e';[{|A \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_161_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_161_0.dat
new file mode 100644
index 0000000..4bdc5fd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_161_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_165_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_165_0.dat
new file mode 100644
index 0000000..3a17a05
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_165_0.dat
@@ -0,0 +1,2 @@
+x;
+0>I9+DyI4ˠ5:Wvdqߜܴ<d2x%[U%2]&K,Ydɒ%ˡ,S՗r2yd=,k_{Xdɒ%K,Yd)0m,Ydɒ%K,Yd)0m,Ydɒ%K,Yme,e%K,Ydɒ%K,eq Ò%K,Ydɒe:<!YV,:Bd|O$*# \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_169_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_169_0.dat
new file mode 100644
index 0000000..c4787d9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_169_0.dat
@@ -0,0 +1,2 @@
+x1
+0>I9EQ=Ls I{ZtR}Sn:|R[?_*SL2eʔ)SL&ϦI O2O2eʔ)SL2e*C1PPSL2eʔ)SLP22)SL2eʔ)SLe(}2)SL2eʔ)SLe(}2)SL2eʔ)Sic7;"ޙFͦސٙvL ^2}oO'r \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_173_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_173_0.dat
new file mode 100644
index 0000000..5ef85e7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_173_0.dat
@@ -0,0 +1 @@
+x10ޯT [4v2ƽok݇;Ӳ]f֞dljlG0n+߻mG˖-[lٲe"Y}oV[lٲe˖-[lٲeհՃ[2lٲe˖-[lٲeհՃ[2lٲe˖-[lٲeհՃ[lٲe˖-[lٲeValٲe˖-[lٲef[BmаE;N-ۜT/rl?* \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_177_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_177_0.dat
new file mode 100644
index 0000000..78a26a7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_177_0.dat
@@ -0,0 +1,2 @@
+x1
+0>I9+?߁iև d̹xֈxN/է|{ظ8d0h=cFf̘1cƌ3f̘qq=w6;l4cƕ<nj3f̘1cƌ3fXһ1ֻcƌ3f̘1cƌ3fXbwnj3f̘1cƌ3f̘M'X&1cƌ3f̘1cƌ3ֻnn1cƌ3f̘1cƌÍ3U< \7+(<OƌΊnj4@ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_21_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_21_0.dat
new file mode 100644
index 0000000..368c994
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_21_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_25_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_25_0.dat
new file mode 100644
index 0000000..e4a5b6d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_25_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_29_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_29_0.dat
new file mode 100644
index 0000000..74a216b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_29_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_33_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_33_0.dat
new file mode 100644
index 0000000..2ec712a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_33_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_37_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_37_0.dat
new file mode 100644
index 0000000..1588cfc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_37_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_41_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_41_0.dat
new file mode 100644
index 0000000..e369027
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_41_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_45_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_45_0.dat
new file mode 100644
index 0000000..452f126
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_45_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_49_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_49_0.dat
new file mode 100644
index 0000000..fdd2aac
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_49_0.dat
@@ -0,0 +1,2 @@
+xK E9o#?H/6g$-,X]
+xݘ; X԰9<Ѻq2AfH7/5We{#fި?4=N > \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_53_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_53_0.dat
new file mode 100644
index 0000000..572d279
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_53_0.dat
@@ -0,0 +1,2 @@
+xK
+@!йoQϺ:(m&s-6Z{m4YX.F٭XZij=:έ֋b忑VH 8 #[Y^Xe \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_57_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_57_0.dat
new file mode 100644
index 0000000..ea81e6d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_57_0.dat
@@ -0,0 +1,4 @@
+xA
+ {^s=YL՚ (
+ouj) 
+Z7yv,ԴwVQ iGiҤDfەwo4ѤoLLȼ}4 h \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_61_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_61_0.dat
new file mode 100644
index 0000000..93d2444
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_61_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_65_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_65_0.dat
new file mode 100644
index 0000000..df29d7b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_65_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_69_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_69_0.dat
new file mode 100644
index 0000000..8a2cfbd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_69_0.dat
@@ -0,0 +1 @@
+xK =_+mBd|Q"s+1"),=Ea T"ŐnE-3 ,KYw=ZZT .,K1#<XBt<a b#x/;X. \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_73_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_73_0.dat
new file mode 100644
index 0000000..3de4606
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_73_0.dat
@@ -0,0 +1 @@
+x1 /FSM(7/JTmeӕls|)YYUS%7{i(L0mo짻'wDŽ {=Όc)2֦~Lz)vZ5O2]=? \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_77_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_77_0.dat
new file mode 100644
index 0000000..2717fd8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_77_0.dat
@@ -0,0 +1,2 @@
+xA D}Or0B/;bHp/*KE7G/_l}xMP
+[(筊ZޛlI6lضeϷO^ 6,,6l&l& ^Wc}m5uE;e \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_81_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_81_0.dat
new file mode 100644
index 0000000..2d9a052
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_81_0.dat
@@ -0,0 +1,2 @@
+x1 ὧi9'BߠEMpo#
+& a6)c~b 1߱ߧ|Y$F1Nq_.31bĈ~M`Ĉco{B807dtvf \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_85_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_85_0.dat
new file mode 100644
index 0000000..eb8197b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_85_0.dat
@@ -0,0 +1,2 @@
+x1
+ =INEZ_ m EVqy2Yh,S[gUXJkd.~>֞!Ŋ+V嬪.2XbŊ+VX.kBzwձ̀gkYZ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_89_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_89_0.dat
new file mode 100644
index 0000000..aaa4c52
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_89_0.dat
@@ -0,0 +1 @@
+x1 ὧi9'Hl?L^"&M?bq?˸,9!z]VScƌ3_c!`n3f̘1č 3f̘1/f>.Uc˻; 2;Y+7 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_93_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_93_0.dat
new file mode 100644
index 0000000..e218fa0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_93_0.dat
@@ -0,0 +1,3 @@
+xK
+ EyV,OmޠrPH0{2bc{tQ]
+{Q{{弬֒ǎ;v_ڳ}L}l߱cǎ;v̑̑̑رcǎ.Legw3qeѾ@i \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_0/mask_97_0.dat b/admin/survey/classes/phpqrcode/cache/mask_0/mask_97_0.dat
new file mode 100644
index 0000000..74ac719
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_0/mask_97_0.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_101_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_101_1.dat
new file mode 100644
index 0000000..ec939b5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_101_1.dat
@@ -0,0 +1,2 @@
+x1
+ н\QEd  1N<#Ֆ-7u.lԦeiXXXXXRZVVeIo1,,,,,v%?gaaaaY K&K=/+ۍ˱ގ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_105_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_105_1.dat
new file mode 100644
index 0000000..e1f5c99
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_105_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_Υb KB?"*#WʘtgӎJqUM9TLLvǤLLLLLLzgG01111yiߘ4m=՛n+2 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_109_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_109_1.dat
new file mode 100644
index 0000000..7e0d6d1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_109_1.dat
@@ -0,0 +1 @@
+xֱ >ӘK}:!iY'*3]fsmb[JƶŖK9}cccccc'u.6Ʀs6666R[^g{/lٷ 7͂ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_113_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_113_1.dat
new file mode 100644
index 0000000..1dd666d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_113_1.dat
@@ -0,0 +1 @@
+x1  -8fL(pBlDM9";-;?1p{\%-3:@ad4*Nadddddd########c]751xYu \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_117_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_117_1.dat
new file mode 100644
index 0000000..8921f64
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_117_1.dat
@@ -0,0 +1,2 @@
+xֻ >ӘK$^ 8YQSV'z8jzʇ^]סekXYYYYYYYjݵ#
++yeeeeeeee#WVVVVVVVV;"+yeeeeeeel'e;b&^9{/J$p \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_121_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_121_1.dat
new file mode 100644
index 0000000..64bd8ba
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_121_1.dat
@@ -0,0 +1,2 @@
+x1
+ н\CPbїE<DGdQG̪3k?3s9_z9i|3W3,Wr7Y`asd^gۚ4 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_125_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_125_1.dat
new file mode 100644
index 0000000..d5881dd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_125_1.dat
@@ -0,0 +1,2 @@
+x1
+ н\:҂>$DdƩYtڅλ0$ήꝝga7yٯ痽Y??{{D \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_129_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_129_1.dat
new file mode 100644
index 0000000..62cd1c9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_129_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_133_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_133_1.dat
new file mode 100644
index 0000000..18d68dc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_133_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_΅hh|"zۉ-*dNHQĢRÂ ,X`c9Y(na_` ,X,X,X` #:8  ,X`Bd¾` ,X|ϢY\X; 7-; ` \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_137_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_137_1.dat
new file mode 100644
index 0000000..284d7be
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_137_1.dat
@@ -0,0 +1,3 @@
+x1
+0 ӤKh]D,-t #ڌQ[T Ks7_?9|B&X^L0a„&3„M&L0a„ &2D4c0a„ &LȀЌe„ &L0abwȀf,&L0a„7&y2anoL<01O
+ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_141_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_141_1.dat
new file mode 100644
index 0000000..83220dd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_141_1.dat
@@ -0,0 +1,2 @@
+x1
+ >946)3$`s uʮ>Wd )g'M{3\d6ubذaÆ 6lؼn]Nذ9FްaÆ 6lذa3a#oذaÆ 6lذذ5e16lذaÆ ]Sbk6lذaÆ mͤ;CcfIdsG \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_145_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_145_1.dat
new file mode 100644
index 0000000..6a9950f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_145_1.dat
@@ -0,0 +1 @@
+x!0@k 4a)q2i.YCUO{35UZFn]fN>bdwtzJF}F1bĈ#F(F6r1bĈ#F1E1ilF1bĈ#FtF#F1bĈ#FtZ}##F1bĈleHGܣ@ٝ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_149_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_149_1.dat
new file mode 100644
index 0000000..02a3cdc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_149_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_΅qH_Xci#Gd̘Ք՛gLU^ݮVR>dKVXbŊ+VXeoXJ_bŊ+VXb;ݙ+}Ŋ+VXbŊ+VAVngŊ+VXbŊ}+ +VXbŊVj>hewf*`uTq \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_153_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_153_1.dat
new file mode 100644
index 0000000..2abfca2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_153_1.dat
@@ -0,0 +1,2 @@
+x1
+0\9btEc'HH9efߞmffM#.̘1cƌ3f̘1cf73f̘g̘1cƌ3f̘1co2c]?3f̘1cƌ3f5Mf3f̘1cƌ3f̘17utf3f̘1cƌ3f̘=lj3>V \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_157_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_157_1.dat
new file mode 100644
index 0000000..17344b8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_157_1.dat
@@ -0,0 +1,2 @@
+x1
+ >94Sd/51V)SkJv7eGcǎ;vرc]Zٱc'رcǎ;vر+رg;vرcǎ;}V`N+رcǎ;v:;v;vرcǎ;;}Vޱcǎ;vص'vz#;]klwoA` \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_161_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_161_1.dat
new file mode 100644
index 0000000..669ade1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_161_1.dat
@@ -0,0 +1 @@
+x10_΅Xš yi~Qbkvp7'M u=]([ 2dȐ +\' 2 2dȐ!C 2s0/3d() 2dȐ!C 241dh 2dȐ!C 2dhcȐ<dȐ!C 2dȐy!CyMaȐ!C 2d0 ^4[E2 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_165_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_165_1.dat
new file mode 100644
index 0000000..abb48f0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_165_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_ΥLK^#FYWt%ˍ4rM,QXdɒ%K,YdҼdɒ%K,Ydɒ%K%K %K,Ydɒ%Kv2$Kv,Ydɒ%K,Yʐ8K楷%K,Ydɒ%K2$K,K,Ydɒ%K,ZVK<βyy ) \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_169_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_169_1.dat
new file mode 100644
index 0000000..ba21b71
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_169_1.dat
@@ -0,0 +1 @@
+x1 н_ M,B^ 5*VKNn2NNOi6>SL2eʔ)SL2M SLSL2eʔ)SL2M}LSSL2eʔ)SLeSy)SŔ)SL2eʔ)S;ٔ)S;)SL2eʔ)Sv()Sv()SL2eʔ)SLdT6}a*3mljmzC' \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_173_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_173_1.dat
new file mode 100644
index 0000000..436918c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_173_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_Υ''@y]X1?"g:1犝fn˶˻mm.?lٲe˖-F>glٲ2lٲe˖-[lٲeO`˖e˖-[lٲe˖-[l lٲlٲe˖-[lٲeVO`˖e˖-[lٲe˖-[z0}[z0y˖-[lٲe˖-[Ee[hOVWö=t*| \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_177_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_177_1.dat
new file mode 100644
index 0000000..12e2e52
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_177_1.dat
@@ -0,0 +1 @@
+x1 Ep0X,a#r}6}nj~\8ƌ3f̘1cƌ7{3f,y3f̘1cƌ3fX_`X&3f̘1cƌ3f̘M_1cy̘1cƌ3f̘1cƌ+3f,y3f̘1cƌ3fX_bX&3f̘1cƌ3fx2dX'x[cy| 3 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_21_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_21_1.dat
new file mode 100644
index 0000000..f87e0a1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_21_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_25_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_25_1.dat
new file mode 100644
index 0000000..3a225e3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_25_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_29_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_29_1.dat
new file mode 100644
index 0000000..0a1cb3b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_29_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_33_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_33_1.dat
new file mode 100644
index 0000000..318949d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_33_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_37_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_37_1.dat
new file mode 100644
index 0000000..5bd9e3a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_37_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_41_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_41_1.dat
new file mode 100644
index 0000000..52e9e58
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_41_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_45_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_45_1.dat
new file mode 100644
index 0000000..b35c567
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_45_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_49_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_49_1.dat
new file mode 100644
index 0000000..d20d717
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_49_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_53_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_53_1.dat
new file mode 100644
index 0000000..a676d7d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_53_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_57_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_57_1.dat
new file mode 100644
index 0000000..896ed43
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_57_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_61_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_61_1.dat
new file mode 100644
index 0000000..4165a4b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_61_1.dat
@@ -0,0 +1 @@
+x30CbpPi`@&H^nadQG{n<vZGMkv=j7⠳9mn7<h \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_65_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_65_1.dat
new file mode 100644
index 0000000..db8db88
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_65_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_69_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_69_1.dat
new file mode 100644
index 0000000..03bba65
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_69_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_73_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_73_1.dat
new file mode 100644
index 0000000..a729fdf
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_73_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_77_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_77_1.dat
new file mode 100644
index 0000000..0fe0b03
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_77_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_81_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_81_1.dat
new file mode 100644
index 0000000..eacbdb1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_81_1.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_85_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_85_1.dat
new file mode 100644
index 0000000..b8a20c7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_85_1.dat
@@ -0,0 +1,2 @@
+x1
+ н\]4AA hM\QjsAkUjmun2RΚ5:k;jƲ[eo[o[kZ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_89_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_89_1.dat
new file mode 100644
index 0000000..e9d226f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_89_1.dat
@@ -0,0 +1 @@
+x1 Ӕ_΅Nh}%@ iDOH*c"<g)<mBswja.av7Affff極2淾5 uح9| \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_93_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_93_1.dat
new file mode 100644
index 0000000..f37836c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_93_1.dat
@@ -0,0 +1,2 @@
+x;
+ >_.4Iy킎`)-5*(of[sm}6YM ;;;;;G{zطz1vw}=wuL%?"=~ei \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_1/mask_97_1.dat b/admin/survey/classes/phpqrcode/cache/mask_1/mask_97_1.dat
new file mode 100644
index 0000000..24fa60f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_1/mask_97_1.dat
@@ -0,0 +1,2 @@
+x1
+0н1\tncK<Di3#Gdgt(lxVP9F7lia``````ސq/]5 vne``````x-mX^35,y-# \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_101_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_101_2.dat
new file mode 100644
index 0000000..e39fd2c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_101_2.dat
@@ -0,0 +1,3 @@
+x1
+ нC Ux!?1e)s*KۮLfBP(J֮ܨx/
+Ba(2 BP(2 EP(ʲRS(%qWRSiY \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_105_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_105_2.dat
new file mode 100644
index 0000000..7b63e31
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_105_2.dat
@@ -0,0 +1 @@
+x! @\Mip4s 6ꙑYs"7&)=; ܌"H$ҏ;|IH$Dt#}OH$DHH$IZ#HgKJt$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_109_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_109_2.dat
new file mode 100644
index 0000000..252f6d8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_109_2.dat
@@ -0,0 +1,2 @@
+x1
+0н1\@Nֈ<q##v-e~_[h46JKFjFh4E'i4Fɓ4yFhZEcS-;&j \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_113_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_113_2.dat
new file mode 100644
index 0000000..26b5d7e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_113_2.dat
@@ -0,0 +1 @@
+x10_šЪ0ځD\5*{#bH'o+vUR1PD"H$>D"H$DH$D"Q&WerH$D"*x[(?/'nd \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_117_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_117_2.dat
new file mode 100644
index 0000000..b4dcce4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_117_2.dat
@@ -0,0 +1,2 @@
+x1
+ >94!m dOs\0X,la5#E>Z[ַRT*JR?Q-*T*JR?UW*JRTݟ+JRԤ~m5;S&+ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_121_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_121_2.dat
new file mode 100644
index 0000000..a2a0097
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_121_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_125_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_125_2.dat
new file mode 100644
index 0000000..0ea40fd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_125_2.dat
@@ -0,0 +1 @@
+x! PӔ_@ U(kp@^Mڮ5-:VF_\t:NtyNqt:NtG;Nt:.8:NtzA}yNq;+n& \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_129_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_129_2.dat
new file mode 100644
index 0000000..bf04839
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_129_2.dat
@@ -0,0 +1,2 @@
+x1
+0н_KVڡ'.!w]A0X~  !࣠fK# xFy4 vey@^+  ~  L#veI \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_133_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_133_2.dat
new file mode 100644
index 0000000..9e78b6d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_133_2.dat
@@ -0,0 +1,10 @@
+x1
+ н&`LQ-g=Aqbʪ<vb+)((((((((In*<bG(((((((((
+y{AAAAAAAA!)
+
+
+
+
+
+
+'eMfv{ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_137_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_137_2.dat
new file mode 100644
index 0000000..95c3c48
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_137_2.dat
@@ -0,0 +1,2 @@
+x1
+ н\NI,/d+ʣ`/F|5*z'H.,xO[KKMBBBBBBT|?!!98$$$$$$$$$$2 hȀ$2yBBBBBBBBBB"eȀ ɟ$I%ɿۓHb_x \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_141_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_141_2.dat
new file mode 100644
index 0000000..da07da2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_141_2.dat
@@ -0,0 +1,2 @@
+x=
+ нt*-?M[hU]WB;dwSj>l fƄȚ44& )OȚYF4444444444c4~9S:3ЌטpǮ> \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_145_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_145_2.dat
new file mode 100644
index 0000000..9ff2bbf
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_145_2.dat
@@ -0,0 +1,4 @@
+x1
+ нr]
+,tQ^&C~
+щj~mɾ.FgMDDDDDDDDDDDST׈DHdZL+ɴDDDDDDDDDDD2-'"""""""":BתEYDd \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_149_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_149_2.dat
new file mode 100644
index 0000000..d52e048
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_149_2.dat
@@ -0,0 +1 @@
+x;@/gcaGBXB'-ˆouէUQdRVOmT*ǫ;;j廝Ee2PQQQQQQQQQQQ TTTTTTTTTTTTr33R &Tskz_e2P=d \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_153_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_153_2.dat
new file mode 100644
index 0000000..3b06041
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_153_2.dat
@@ -0,0 +1,2 @@
+x1
+0 Ӥ8ZP!BZu賶"bu*)]MFFFFFFFFFFFF%= #ddddddddddddr ot2yFFFFFFFFFFFF& #k5L 2222222222(Y7"d@H \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_157_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_157_2.dat
new file mode 100644
index 0000000..2baf535
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_157_2.dat
@@ -0,0 +1,3 @@
+x1
+0>s6MqUH1X&U̘f/u-'.[KGGGGGGGGGGH|NG(ttttttttttNF;::::::::::}Nz$
+>n A#^AG(t =3{ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_161_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_161_2.dat
new file mode 100644
index 0000000..d2df759
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_161_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_165_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_165_2.dat
new file mode 100644
index 0000000..2e6cd7c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_165_2.dat
@@ -0,0 +1,2 @@
+x1
+0 Ӥ?BVUG%*+_fs MIIIIIIIII2d;l4()))))))))))eqJنIDIIIIIIIIIII)۠mPRRRRRRRRRRR6l JJJJJJJJJJJJن}RaQRRRRRRRRRRNeK?R퐔͔&W3U \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_169_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_169_2.dat
new file mode 100644
index 0000000..4052062
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_169_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_173_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_173_2.dat
new file mode 100644
index 0000000..0a30ba5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_173_2.dat
@@ -0,0 +1 @@
+x+@ Pift:>y &d U߬S[]5Z;a5V۞A[Z˴VՃI0ZZZZZZZZZZZZZZ=-Lhi`VFK?ݧhioJ0}o \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_177_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_177_2.dat
new file mode 100644
index 0000000..d2c52f9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_177_2.dat
@@ -0,0 +1,2 @@
+x1
+ E>Y4V$~ ,C&U;Ook5bϙGx9%&&&&&&&&&&&n$OL|v#&&&&&&&&&&&&&bbݍXw#&l7bbbbbbbbbbbbbbM"l7bbbbbbbbbbbbbbMa!&݈3)U<WܱW/݈# n \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_21_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_21_2.dat
new file mode 100644
index 0000000..7466be4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_21_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_25_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_25_2.dat
new file mode 100644
index 0000000..0bc44c0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_25_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_29_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_29_2.dat
new file mode 100644
index 0000000..5112d11
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_29_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_33_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_33_2.dat
new file mode 100644
index 0000000..5bac0c8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_33_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_37_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_37_2.dat
new file mode 100644
index 0000000..bdfc0bd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_37_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_41_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_41_2.dat
new file mode 100644
index 0000000..c55c63e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_41_2.dat
@@ -0,0 +1 @@
+x30C JB&ùШQ*JXi@l0U>*F> \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_45_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_45_2.dat
new file mode 100644
index 0000000..ad44ff1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_45_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_49_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_49_2.dat
new file mode 100644
index 0000000..6e8edff
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_49_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_53_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_53_2.dat
new file mode 100644
index 0000000..682cae2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_53_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_57_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_57_2.dat
new file mode 100644
index 0000000..66a5c05
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_57_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_61_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_61_2.dat
new file mode 100644
index 0000000..77d3815
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_61_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_65_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_65_2.dat
new file mode 100644
index 0000000..caf184a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_65_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_69_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_69_2.dat
new file mode 100644
index 0000000..6a3801b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_69_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_73_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_73_2.dat
new file mode 100644
index 0000000..74945b7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_73_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_77_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_77_2.dat
new file mode 100644
index 0000000..903cba4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_77_2.dat
@@ -0,0 +1 @@
+x1 н_CM>Gt ѫe+FWZEm&gއFѶhF+t/FYvFj[*7a \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_81_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_81_2.dat
new file mode 100644
index 0000000..17a9ac2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_81_2.dat
@@ -0,0 +1,2 @@
+x1
+0н_KҩVi!O\"A]:xbW1uȦ&_T ΋6H$U^D~bׯb=gX \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_85_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_85_2.dat
new file mode 100644
index 0000000..72c74ff
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_85_2.dat
@@ -0,0 +1,2 @@
+x1
+0=1\B7O$A0$8Wwjguu槊RT*uS֧JRTJRRޢN浘V \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_89_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_89_2.dat
new file mode 100644
index 0000000..06c9a4f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_89_2.dat
@@ -0,0 +1 @@
+xٱ 0 >/&E*cQqŃ zf$rM<sa#d2L&?ArYd2LG"3L&{Rygw; I \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_93_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_93_2.dat
new file mode 100644
index 0000000..f520296
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_93_2.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_2/mask_97_2.dat b/admin/survey/classes/phpqrcode/cache/mask_2/mask_97_2.dat
new file mode 100644
index 0000000..38842b9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_2/mask_97_2.dat
@@ -0,0 +1,2 @@
+x1
+0н_KivH4 <q  #ʩs-TUS_Y@ kDI@ VJ aPt0C8% \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_101_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_101_3.dat
new file mode 100644
index 0000000..fa99251
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_101_3.dat
@@ -0,0 +1 @@
+xK EyWS9'D1񟾪p /9Ёu,ku9Ҥ$%ݭwALb%ClAzq۴붌b!ĤwX4`_'FWr!b&t1<FWr!bXyC 1ĆӇ)E{WٯAӅgL1]-&ƼLqn \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_105_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_105_3.dat
new file mode 100644
index 0000000..d8a28ce
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_105_3.dat
@@ -0,0 +1 @@
+x1 D~O3r6@(1'J}4gk97A=ip}wZJo8JB=Cs= =;HzT.z衇z{{{T.z衇z{{{T.z衇zoS$PThE%Կbߞr\RL$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_109_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_109_3.dat
new file mode 100644
index 0000000..48d9404
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_109_3.dat
@@ -0,0 +1 @@
+x1 D~O3r6 O(;V6sy>)_%s_d3KO1^aL,$H"$KzRPt[I&X9$H"$I$ysI$DI$ɓI$I$Dɍ%es!=LAZ5'̓IVrn/2oƅ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_113_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_113_3.dat
new file mode 100644
index 0000000..023b273
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_113_3.dat
@@ -0,0 +1,2 @@
+xA
+0 D}NrnDFj2KCt?WݲZi.qoP %Smj7ަ:*N:@:***fW9d2*j*}S@`*j৪6Jlѿ}}էTUa24hnt \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_117_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_117_3.dat
new file mode 100644
index 0000000..79cc04d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_117_3.dat
@@ -0,0 +1,4 @@
+x1
+0 ]Q.xIB$?~!<Q?#5/tIJ8owi{}S^~q猉P„ &L0J1ϻݢDK'JÄ &L0ᝅn
+0a„ &LxgaG*&L0a{
+g{2sΉ~7\]%rJ9nZ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_121_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_121_3.dat
new file mode 100644
index 0000000..aff5a7b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_121_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_125_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_125_3.dat
new file mode 100644
index 0000000..e2febdb
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_125_3.dat
@@ -0,0 +1,2 @@
+x1
+ ~N3rۄ]BБ'?</̼V۵ ҏ<0-_J[? +w^;*yɓ'O</9ɯ9<yƜ'O<yɓ'J^aț6 yɓ'O<G{icΓ'O<yP |]Z֤Iee:[~?<mJ_N: \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_129_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_129_3.dat
new file mode 100644
index 0000000..b1ce63b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_129_3.dat
@@ -0,0 +1,8 @@
+xA
+ н6!n G<q4h/G?;hsLSTOj 2#
+Dy`ܫP@
+\B4*yt$
+(P / 򂼠#Q@
+yA^t$
+(P@ / D
+(\.`ɛjoCS ;R;R.I \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_133_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_133_3.dat
new file mode 100644
index 0000000..f418150
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_133_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_137_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_137_3.dat
new file mode 100644
index 0000000..e24ac5b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_137_3.dat
@@ -0,0 +1,2 @@
+xA
+0}NrnFHS YQ|ZEfu,% $ujG:zou,:OsYďe:tIsj|+N5dltСC:t;b:MѡC:t9hH6F:tСCǽڨ{A%dC:tN$^ur dV'\wjSt;U'[,7 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_141_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_141_3.dat
new file mode 100644
index 0000000..a3f6a24
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_141_3.dat
@@ -0,0 +1,2 @@
+xA
+0}N{˹)%]jf /d!uOUc0}a4R9_T~`_ R[Tծn1ݒ"E)RH-*p~HܥJ԰g"E)RHJҧ42L?RH"E)RiR滀g"E)RH >z#E)RHZ@bl-)ݿ<ߧ*OUR"5&5*ie J]+ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_145_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_145_3.dat
new file mode 100644
index 0000000..338b7e7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_145_3.dat
@@ -0,0 +1,3 @@
+x
+@|:^ Jy̡yMj-'
+9VS֦K9e)PyUwe-m jԨQF5jԨRi٫F4_wk}0+jRBRF5jԨQeOMBJHjԨQF5jwP״˪IH I5jԨQFͳc w5jԨQF:zS*2UZ_C*e_OZ%dIȯb \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_149_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_149_3.dat
new file mode 100644
index 0000000..30bc5fa
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_149_3.dat
@@ -0,0 +1 @@
+xA0}Oܠ⦐H頯'Z2{oV|Ι%>yR{!8ÂI+JpI|#f5κ[P A $H Q})&<E JQ)J A $H s5z%H A $H4A^5A)*E $H A $ 3MHQ $H A 3ާ`Po>X{ט+Wb`I)5%d \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_153_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_153_3.dat
new file mode 100644
index 0000000..89cdec0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_153_3.dat
@@ -0,0 +1,2 @@
+xA
+0}Ns˹)7mJ,}8X=cW^GeN<v]]bIͯ_gY+Mjvˋt&M4iҤI&Mxޜu~o[~4W55I&M4iҤIS5MLi5-M4iҤI&M4oiz`z@SjZ4iҤI&M4izs(VҤI&M4iҤYzK 6ϛ:=_h67m6mM{H \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_157_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_157_3.dat
new file mode 100644
index 0000000..167e6f8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_157_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_161_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_161_3.dat
new file mode 100644
index 0000000..72a26a4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_161_3.dat
@@ -0,0 +1,3 @@
+xA
+0}NrnFTk,N Zђf7J:ƒ^`WٔUnXڤǧM-#V+ߡ+9zҖY l)SLocʱO_C?ߩ%;*KlM2eʔ)SL2Ye][bSL2eʔ)SLyVYlWG[bSL2eʔ)SL
+]g+$eʔ)SL2eʔ/qBbKlʔ)SL2eqʙ]£{A/~V9\%[P#' \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_165_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_165_3.dat
new file mode 100644
index 0000000..870af8f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_165_3.dat
@@ -0,0 +1,2 @@
+xA
+0}N3T #Z YuÏ:̛1ϱEUTT|S q)m-sG B.Cĉ'N8qğwv7['tg!.ե:qĉ'N8qv`_+.ե:qĉ'N8qv`R8qĉ'N8qΤ8"ե:qĉ'N8qĝIяہq&EKuĉ'N8q+9:}kFT?^ЏGo<0իCg/_ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_169_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_169_3.dat
new file mode 100644
index 0000000..9431095
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_169_3.dat
@@ -0,0 +1 @@
+xA0}O3rn񷾦 )}'31Eh]4P[ _]Kv<˙fp#y_l[geӧO>}o%uJV/{%O>}ӧO}K~O>}ӧO>Q=/ї>}ӧO>}u{ח>}ӧO>}u{蟪/%?}ӧO>}ׯ.N4<Ozzlzz W/_yp \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_173_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_173_3.dat
new file mode 100644
index 0000000..7466986
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_173_3.dat
@@ -0,0 +1 @@
+xA0}O3rnPkTTyM$&e/|"ֵdjuy[aiK{M S&z[BUBRIC!n5\w4B $@ $[”3cE^%xw  A:@ $@ $@ $BfID A:@ $@ $@ $p͒f%H@ $@ $@ $@BR %  $@ $@ $@ )$h4K$L  $@ $@ $@³_{Pg۴y>჏VMmRt(1| \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_177_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_177_3.dat
new file mode 100644
index 0000000..9586979
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_177_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_21_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_21_3.dat
new file mode 100644
index 0000000..bcb4eec
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_21_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_25_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_25_3.dat
new file mode 100644
index 0000000..0ffc375
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_25_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_29_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_29_3.dat
new file mode 100644
index 0000000..6150ac1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_29_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_33_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_33_3.dat
new file mode 100644
index 0000000..6053b5e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_33_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_37_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_37_3.dat
new file mode 100644
index 0000000..5dea5b9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_37_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_41_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_41_3.dat
new file mode 100644
index 0000000..ca9ddc2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_41_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_45_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_45_3.dat
new file mode 100644
index 0000000..3daad97
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_45_3.dat
@@ -0,0 +1,2 @@
+xK
+ DsFJ(&)0dЇFg![8=&iaD)d8&Aլa 1'II׳79 ex߾ I&֝CuJy \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_49_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_49_3.dat
new file mode 100644
index 0000000..7f6508d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_49_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_53_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_53_3.dat
new file mode 100644
index 0000000..8800bea
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_53_3.dat
@@ -0,0 +1,2 @@
+xK
+0Ds ! -(.Bp&|"-t&`qQ-"9_+)Be/H8D%a~}spKFN=,;;a^t4\FSN \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_57_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_57_3.dat
new file mode 100644
index 0000000..4e1e5da
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_57_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_61_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_61_3.dat
new file mode 100644
index 0000000..bf1a3cc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_61_3.dat
@@ -0,0 +1,2 @@
+xA
+0fz4-%*dp!yZܫu(~=&ۓ)R2"/"<9FΊ=rb"/rw"2B#3-0-KW \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_65_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_65_3.dat
new file mode 100644
index 0000000..8589208
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_65_3.dat
@@ -0,0 +1,2 @@
+xQ
+ D4\?R ,!O-Nv1:cZu "UMÕF ~jK-la[^q^Q\=o-laZpUB @IKJzɢ|1Í  \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_69_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_69_3.dat
new file mode 100644
index 0000000..55318a8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_69_3.dat
@@ -0,0 +1,2 @@
+x
+0 {&2'd l=,Fy;$쇤WE-R:%T,O2g"",Ȣ/DyĈɧ{O䮳",:NvEWN#(&,,]x؅ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_73_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_73_3.dat
new file mode 100644
index 0000000..15be77f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_73_3.dat
@@ -0,0 +1,2 @@
+xQ
+0 C{g;JJ?dԬK=RasJhTJ6exka\$nIE,-/XB*х=wee4t̒tLщtt߫b gFf qoddn-? \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_77_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_77_3.dat
new file mode 100644
index 0000000..ec78280
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_77_3.dat
@@ -0,0 +1,2 @@
+xA
+0 &BiRaK"t`I@|fXyilE:Sza18GifK*?:YC1쌞졘(ቷJ*jl*TRIKR^ؙks)c)c)JZa \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_81_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_81_3.dat
new file mode 100644
index 0000000..47bc0f7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_81_3.dat
@@ -0,0 +1,2 @@
+x1
+ F=\,JGAġhj>#3X:kԹ\FM Jhu3>TZ{PSgP'kVjժU_ۯUV=P oO:Wҝj[Wxm 5 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_85_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_85_3.dat
new file mode 100644
index 0000000..02c4f8c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_85_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_89_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_89_3.dat
new file mode 100644
index 0000000..2b4cb59
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_89_3.dat
@@ -0,0 +1,2 @@
+x1 ὧ) *.@U |eŵ6ۢw5*) oiK4nk>1}d>@ 4XYCo ۡ1<AhFt
+ 4@51Wr>7G}}x7|NgN \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_93_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_93_3.dat
new file mode 100644
index 0000000..b4cc8a9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_93_3.dat
@@ -0,0 +1,2 @@
+xA
+0 D}NrnJɪQ~B06na<<ׇe6MRCP L̓i9M 2 LkŮdDv*"aXjBdAddZTdAdqY0exqeN&WVQvc \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_3/mask_97_3.dat b/admin/survey/classes/phpqrcode/cache/mask_3/mask_97_3.dat
new file mode 100644
index 0000000..7adc9eb
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_3/mask_97_3.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_101_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_101_4.dat
new file mode 100644
index 0000000..1c97dc0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_101_4.dat
@@ -0,0 +1,2 @@
+xA Fs^1bИ]4m+8+Ve^HR]\c
+oWN#X+l HEcp \^.9qW9":.BB \0aPǨcp \ONqjpG}}$.˅ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_105_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_105_4.dat
new file mode 100644
index 0000000..0211cdb
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_105_4.dat
@@ -0,0 +1,2 @@
+xK
+0 D=Mr˹A TeEFL2 #鹢_I!딤Ѻ-իkmO]sS T6*'8 N$'NZ^<JvNsNp''8 1{p?N¿nJBυ^[i'iHI-m+W \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_109_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_109_4.dat
new file mode 100644
index 0000000..2cc0c81
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_109_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_113_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_113_4.dat
new file mode 100644
index 0000000..99bd73f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_113_4.dat
@@ -0,0 +1,2 @@
+xA
+ н_Jb)t&BBK_ֳ6C+5/q_ghfCbH+p;WK?Gt *G9r|c`c9FKHq49rȑ#DžUG*G9r>}rU*G9r|c[cN[_=׫5^J 1*qv \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_117_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_117_4.dat
new file mode 100644
index 0000000..3867259
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_117_4.dat
@@ -0,0 +1,2 @@
+x
+ н_s]4Dgn2Jj}ҾRsSWGRɧ)5Em#ܯk_"z3\rʕ+r Lk|/{;'<W:̕+W\rU=l3|sʕ+W\;woZrʕ+\sKzeSהz83u#Wubjd $ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_121_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_121_4.dat
new file mode 100644
index 0000000..84957eb
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_121_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_125_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_125_4.dat
new file mode 100644
index 0000000..b98dc81
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_125_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_129_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_129_4.dat
new file mode 100644
index 0000000..8ecfa25
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_129_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_133_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_133_4.dat
new file mode 100644
index 0000000..69f83ac
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_133_4.dat
@@ -0,0 +1,3 @@
+xA
+ н_ҚBB2f{
+cfgKq=)ڮWlK2޿8:oCRd\p\p@+$EQ.\p\#>/#\p\p># \p\p#>qp\p.$Iq dGR_4  \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_137_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_137_4.dat
new file mode 100644
index 0000000..0c09c48
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_137_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_141_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_141_4.dat
new file mode 100644
index 0000000..62b03f2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_141_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_145_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_145_4.dat
new file mode 100644
index 0000000..33fb211
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_145_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_149_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_149_4.dat
new file mode 100644
index 0000000..de99310
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_149_4.dat
@@ -0,0 +1,2 @@
+x
+!н_sm +XӋ9=.=Zka]ޒ> Kjo |SSWKZm׌j\Ъ2 W\qW\q"~ jvtv_\qW\qW\q%g3 }+++ r9ArW\qW\qŕA g3WA W\qW\qW]V~v{D3Ȝ!\W^<r/ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_153_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_153_4.dat
new file mode 100644
index 0000000..e827dd1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_153_4.dat
@@ -0,0 +1,2 @@
+x10ޯsi,')p!4.;WUmj=.NO>Tڍ[S7vۜgq?
+{peo383838{YXz,_OYfe3s38383\C!Ms38383r \C?37938383\C!07M8383q,mMrskWv3~W WB \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_157_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_157_4.dat
new file mode 100644
index 0000000..ad5fcf6
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_157_4.dat
@@ -0,0 +1 @@
+x10ޯs4"FP=iRX¢X0멪u 4ftl}m➭S|юS P5<]rwqwq^QN6ÏZsߙ,wqwqǝ>Μ5g;;Y}Vgw,wqwqw>9wqwq>3gY;[ww?P3Ƙggt퐮;].3w4A \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_161_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_161_4.dat
new file mode 100644
index 0000000..7604c45
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_161_4.dat
@@ -0,0 +1 @@
+xA@ fs!AL_|,4l)iml׉0' +E ]N\x#2/_{7g9쏼ٷ}2r!?}-#<Zχj"P>Te9C9C9~6Sʇ겺!r!r!ۘse9C9C94_Ɯ|.r!r!s/s0 2r!r8}DwrDXΡ|x|!2 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_165_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_165_4.dat
new file mode 100644
index 0000000..d83d631
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_165_4.dat
@@ -0,0 +1,3 @@
+xA
+1 }Or."*?fPLHIkΫZQ8
+Gyqk-n5+?|֎kKnEŹK.K.?2.|EJ{2<:.Ku\K.K.ǝmu)_8\r%\r%\Џ;'2!_8\r%\r%\Џ;'2!_\r%\r%\rinC?nn9 RK.K.;.HqY'ݽNF?K㕢,R| My*3 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_169_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_169_4.dat
new file mode 100644
index 0000000..4aac95c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_169_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_173_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_173_4.dat
new file mode 100644
index 0000000..9df4d86
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_173_4.dat
@@ -0,0 +1,2 @@
+xK
+1}Nrna ~ZY!Jt^5(/jkz[pj_?~v:|jwՖ_mXzo6?n<j$p-r-_p[z=VQ3TVo r-r-r-r09Lߚ r-r-r-r09Lߚ r-r-r-r09Lߚ r-r-r-r09Lߚ r-r-rv6?,e`=*K6ڭ~6 * \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_177_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_177_4.dat
new file mode 100644
index 0000000..6437d25
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_177_4.dat
@@ -0,0 +1,2 @@
+xA
+!.1BMy![ c\cZV\q7EOzg~k˿j;pgu[*7׽Tp1s1sq!㠊w/r8X~lc9c9c9nr7~l0Wp1s1s1nr7~l0Wp1s1s1nr7~+8c9c9cnr7M+8c9c9toEǙNXy[R+cqN\,4J \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_21_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_21_4.dat
new file mode 100644
index 0000000..e006b67
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_21_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_25_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_25_4.dat
new file mode 100644
index 0000000..0c7c44b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_25_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_29_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_29_4.dat
new file mode 100644
index 0000000..c28dc20
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_29_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_33_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_33_4.dat
new file mode 100644
index 0000000..5834b6f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_33_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_37_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_37_4.dat
new file mode 100644
index 0000000..4bf2e26
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_37_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_41_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_41_4.dat
new file mode 100644
index 0000000..b75b7d0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_41_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_45_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_45_4.dat
new file mode 100644
index 0000000..1b921f3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_45_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_49_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_49_4.dat
new file mode 100644
index 0000000..e417f94
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_49_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_53_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_53_4.dat
new file mode 100644
index 0000000..7e88826
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_53_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_57_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_57_4.dat
new file mode 100644
index 0000000..84669c7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_57_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_61_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_61_4.dat
new file mode 100644
index 0000000..d127c3b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_61_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_65_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_65_4.dat
new file mode 100644
index 0000000..c24343d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_65_4.dat
@@ -0,0 +1,2 @@
+xK DtXЙ.4E1^hvOxW0 JHŻz[^܈[v
+yyZk=`vcǃ<ȃ<C/)zܑ C"" \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_69_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_69_4.dat
new file mode 100644
index 0000000..a73b114
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_69_4.dat
@@ -0,0 +1 @@
+x;0CwN\~;C$3$<)/meΥT2 :]^VV%zAnpvs"yyy)zdu6Gȋi^/<trrr)9ͤlr. \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_73_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_73_4.dat
new file mode 100644
index 0000000..72f8922
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_73_4.dat
@@ -0,0 +1,3 @@
+xA
+0 yM顴)1-lE3=}(9TdE/eO ZOŻKY;pS5+NI|
+"ev+DݓNs'OWkI̞Fri9& ]?A \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_77_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_77_4.dat
new file mode 100644
index 0000000..993c486
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_77_4.dat
@@ -0,0 +1,2 @@
+x
+0E?jFe80 uN0lB6:h<Ce\, ܗ~& rd0 Sz7z+oVu:7zWo S)mo3 Oy;:*h>aCe \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_81_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_81_4.dat
new file mode 100644
index 0000000..dd65216
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_81_4.dat
@@ -0,0 +1,3 @@
+xA
+0 yMyXE m7"892ѸQ1ݳ+xx;t35DIY1x\:u}e/ #Th<
+UBz<5G<5{G<5<饫>]Urxu \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_85_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_85_4.dat
new file mode 100644
index 0000000..c8d5123
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_85_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_89_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_89_4.dat
new file mode 100644
index 0000000..5b9bd7e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_89_4.dat
@@ -0,0 +1,2 @@
+x1
+0 ὧI9%  Vڀfr0}z=#9ҕ:~s1BՁg&4pgq.p.&gT05rgsgqrg捯u38k.Egmb*&7? : \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_93_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_93_4.dat
new file mode 100644
index 0000000..be7f5e5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_93_4.dat
@@ -0,0 +1,2 @@
+xK
+ ὧIn$}PŌB]N@%sfkҫ}CzoA}aʽ2|~D&l=Ywq}q\EYjK_ywqwz$==;_݋>+pH9Di \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_4/mask_97_4.dat b/admin/survey/classes/phpqrcode/cache/mask_4/mask_97_4.dat
new file mode 100644
index 0000000..5d848ca
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_4/mask_97_4.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_101_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_101_5.dat
new file mode 100644
index 0000000..c21869e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_101_5.dat
@@ -0,0 +1,2 @@
+x
+ E+%=M3Cbv ѬNkûgqkqq{%Oo,iKee3[|iVh]` ` 0ʕz˴T0Gu/q8F13:W>#ȕ0c0Q8E=F#+a X͞+cV%9W>Q]TkY-gLqD艋 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_105_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_105_5.dat
new file mode 100644
index 0000000..bc8798c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_105_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_109_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_109_5.dat
new file mode 100644
index 0000000..25a3944
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_109_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_113_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_113_5.dat
new file mode 100644
index 0000000..25f42b8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_113_5.dat
@@ -0,0 +1,9 @@
+x
+0D^6I63[[EDqc+jy81\c
+7c?u}DK4},kkg--3[UƂyUXUXSV:ϫ՝,|кS⫰
+
+
+Vɫ*X[*
+
+
+zU*NV*JUXUXSXijTi4fZkU^_~Ux }ծZ/r \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_117_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_117_5.dat
new file mode 100644
index 0000000..f236940
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_117_5.dat
@@ -0,0 +1 @@
+x D|Mn/*{M+pI_&m-ѾC32u?o-kgB7wc=U%yoRhӯșDo:ֶyRJkQ^aaaqOgiJ ;qOg)ӊ0 0 0 [vö>=>0 0 0 Ofz3=>0 0 0.3Z$׷8\pw4:Zp:qX 7 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_121_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_121_5.dat
new file mode 100644
index 0000000..9bb5c41
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_121_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_125_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_125_5.dat
new file mode 100644
index 0000000..2161c50
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_125_5.dat
@@ -0,0 +1,2 @@
+xA
+ E&fc;S$?؏Q4YahûyJ}9g==li.;nh_wz.qCWȧy uPk;<<<|*q, mkWqNl% yyyy^2䰅sX|aaaa3ϙ9lH<<<<̿웁[n`Tq8^vy \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_129_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_129_5.dat
new file mode 100644
index 0000000..f0c1d65
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_129_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_133_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_133_5.dat
new file mode 100644
index 0000000..46be8b0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_133_5.dat
@@ -0,0 +1,2 @@
+xA
+0 DѽOcr]4%1mCTxΜ[Dv={FEϏq?ݿ9keѭ}'2^c4G:3=JK-F0`#Hw'#<{~Z4 :BG舻F0`G~:`#?#tw-`#?##t#F0r}Q}eR;<CV}їY-H \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_137_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_137_5.dat
new file mode 100644
index 0000000..064e7f2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_137_5.dat
@@ -0,0 +1,3 @@
+x
+0 >M/k1mX=hsH"k M:3qOW}9ԖIH1G;- sڶ?[%M
+ v#;zg^3d}69Ψޙ@7҄#gv`;׳ީ\$wlv`v;ލ}7wߑa;vkA#gv`=N2wxgWӤ@n?c}SQ:Zd?+9vz)P \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_141_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_141_5.dat
new file mode 100644
index 0000000..60c1a8e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_141_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_145_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_145_5.dat
new file mode 100644
index 0000000..9303c07
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_145_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_149_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_149_5.dat
new file mode 100644
index 0000000..4256cef
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_149_5.dat
@@ -0,0 +1,3 @@
+x[
+0&c}-s+'^;Ax=Q_gUݏﵪxGTȺV¹UUE_IǴ;T1̠
+]W 2 2 |o5uꆬuI:(WKU躒rPAdAdA; vo_zNO{2rPA9 2 29}^O挞rwQdAdAnMA9(dAdA^W Z.+G^K`׵}`_Fk \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_153_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_153_5.dat
new file mode 100644
index 0000000..deea09d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_153_5.dat
@@ -0,0 +1,2 @@
+x
+@wfЬ`D"Ie<:au,7Of۳uP6~szs,jլcVZvߨm s^uHYu&l&l&_9 ;]^jsO;ܔrSn&l&l9yכzA rSnM6dM6dM6ރ@/$7ܔl&l&lzŽzACrSnM6dM6dOl7ᰚUuN֛FcPPS,l;HO \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_157_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_157_5.dat
new file mode 100644
index 0000000..176e2a6
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_157_5.dat
@@ -0,0 +1 @@
+x10Dާri( r* \~>C*vs]Ŝ_{W!zﶬ/)˙v V6V޻,f1Yb n^o>\O],,b,f1YyVgYYYb,f1+ʳ<˳<˳1YbŬ<+ʳ,,b,f1YyVgYYYb,fukys77}vmb=wsw)tW: \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_161_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_161_5.dat
new file mode 100644
index 0000000..70d5fb0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_161_5.dat
@@ -0,0 +1,2 @@
+xI
+@нDp@ o|m rHk㨤~co^Jzװ#5l¦S_92 [}ZÊ=T2ƀP2[cV衆CYf'-X9>v~usK5`e,2,2,2-///o_q}K\reYfeYf峖o+/,\feYfeYfٳexB.e2,2,̲g+l\r16,2,<v.r륆޼rO5s_ZɔuI_* \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_165_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_165_5.dat
new file mode 100644
index 0000000..94af813
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_165_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_169_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_169_5.dat
new file mode 100644
index 0000000..921a770
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_169_5.dat
@@ -0,0 +1 @@
+xj0|/niK'.r:T-m&Zx9yq3rOgvOO_zׯu`]ȷitاtiloc13j9%_g|ԧ)>>ϰ=te&_4=tU}/>>>Or5/u>/g}g}gOsvO}/g}g}ٷGo-w{r_{g}g}g_n<r_}>=n]4Nkβ_M8m?SF< \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_173_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_173_5.dat
new file mode 100644
index 0000000..f9a6741
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_173_5.dat
@@ -0,0 +1,4 @@
+x[
+0&G1gD)[CzeDѷц=RN6FJm JqP}x s_}GFy;
+[;]ek[QbTmy&0 L`̄Y?رw؛ fcVN9&0 L`ׄZ}0=F=F9ANL`&0 L`BzYfI=F9AN&0 L`&0 fIsr ' L`&0 L`<i͒"9AN&0 L`VaBX",Um>
+=wZgBΜP !8 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_177_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_177_5.dat
new file mode 100644
index 0000000..b07c636
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_177_5.dat
@@ -0,0 +1,11 @@
+xъ0~ܾح uO,"% :$Xui=ѶՃgƸ?Ώq.So~z׉W:=h1cq]Ƕi!r8Ɓ`+X
+V jj;8ƁX+
+oV`+X
+V?[1^h-ֳ5Z;rmS+
+oV`+X
+V;Z,YMB+
+V`+X
+VZeڦ}r\!W`+X
+V`+3Km>SB+
+V`+X
+Vc㊛{g;^Qq5ZUݮQL0+*&YDq*6 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_21_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_21_5.dat
new file mode 100644
index 0000000..04f97ea
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_21_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_25_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_25_5.dat
new file mode 100644
index 0000000..c20b59b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_25_5.dat
@@ -0,0 +1,2 @@
+xڝa
+@!4 ޳ʢ ?,""j?n<Oa w, l}rGM;Ϧ9[ _x|=l4lKv \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_29_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_29_5.dat
new file mode 100644
index 0000000..217ec1b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_29_5.dat
@@ -0,0 +1,2 @@
+xՒ]
+ =M_n0W .=-4myB+ R􈋆$ƃ.=s/,+B7󳝍qz~q>=GZy:DR \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_33_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_33_5.dat
new file mode 100644
index 0000000..726d7fd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_33_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_37_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_37_5.dat
new file mode 100644
index 0000000..6d32ca6
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_37_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_41_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_41_5.dat
new file mode 100644
index 0000000..e07c617
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_41_5.dat
@@ -0,0 +1,2 @@
+xTA
+ 5?7XMtxҴx ?@7@~"N$Sɰ{+CA'r\Pp<ޏ- ͺ:S3sԉۻީz#qw > \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_45_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_45_5.dat
new file mode 100644
index 0000000..5168a17
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_45_5.dat
@@ -0,0 +1 @@
+xUA 5?U:N&Z":;4P1=bNvSGM1˛n<v`q{Mg4=G-T?='kuۭ>'(κ J{Eѵs] ,sq \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_49_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_49_5.dat
new file mode 100644
index 0000000..9f3f3cd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_49_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_53_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_53_5.dat
new file mode 100644
index 0000000..449807b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_53_5.dat
@@ -0,0 +1 @@
+xVA " zYf5ƐJC A;l\,dR. \(e_ еaNi5\żaLP(;2שjN6O u+l{y6od^ C[%  \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_57_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_57_5.dat
new file mode 100644
index 0000000..c7dd81f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_57_5.dat
@@ -0,0 +1,2 @@
+xVA
+ 5?NlZHAbBZ0a Md`1z'"<Ր19nvͨ. )bݻ~;<Kھx_Eu 3][/[ToJϵU羁4v HPn|Im!wL1/8,g \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_61_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_61_5.dat
new file mode 100644
index 0000000..dee749f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_61_5.dat
@@ -0,0 +1 @@
+xQ CwC ՖB .ݛwpKvg;|3:}ؓc0þɴjj7(lwe^WJɾSwt_eΫTMOs9ubs=?~~>9Z#tB~ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_65_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_65_5.dat
new file mode 100644
index 0000000..ecd9380
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_65_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_69_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_69_5.dat
new file mode 100644
index 0000000..ead4edc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_69_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_73_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_73_5.dat
new file mode 100644
index 0000000..0000117
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_73_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_77_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_77_5.dat
new file mode 100644
index 0000000..1652cdc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_77_5.dat
@@ -0,0 +1 @@
+xQ Cw#&C`T6ƹB(9 'ֆڢzk"hv.` cXB5[(F>71/34Ϊz^'[FyglgM>OTL4ϔ{&3Wy*ʧb*`<3;Vo0/s6n0ya[mcE \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_81_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_81_5.dat
new file mode 100644
index 0000000..71215e9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_81_5.dat
@@ -0,0 +1,3 @@
+x
+ C~M?tzU4" }tMX2|.ɋ˙F\~m4Xu
+ٔ, w:EƄ>X̯=_]g>>zמ/)5ךkkkZsXXY{ܮ}~mt:S#&;U#) \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_85_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_85_5.dat
new file mode 100644
index 0000000..09cf0e2
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_85_5.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_89_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_89_5.dat
new file mode 100644
index 0000000..5fff530
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_89_5.dat
@@ -0,0 +1,2 @@
+x
+ 45enpQ Gcfl^^;;b5;`kU͹߮j`NsO=\[a6~nLD? !6uF%w*Ȭkf77SĆbÆXodw_—mbClNۙ ck&YVoܡ׷BעبAl6 Jjx \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_93_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_93_5.dat
new file mode 100644
index 0000000..ec4240b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_93_5.dat
@@ -0,0 +1,2 @@
+xK
+0 D>&&  fP^8BY5s(imҮ=f3/wۧEyYQwf[} [90303ef̙3'3=<K{nSg3`f`f`dޝoiPg7 ܇GjkG]}?V/ kWi72Jsv|*"f^ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_5/mask_97_5.dat b/admin/survey/classes/phpqrcode/cache/mask_5/mask_97_5.dat
new file mode 100644
index 0000000..509d117
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_5/mask_97_5.dat
@@ -0,0 +1 @@
+xA Ef!3bf5ƼB|#f=<3l6<_+xj) ݩy J yXiܻ5IzsٞcueQ KKKd)>,ͼwxDַ.,;s%g,,,=Rὓ7uKKTD<(n lYhV۹sޕyPE<q \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_101_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_101_6.dat
new file mode 100644
index 0000000..13f97a0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_101_6.dat
@@ -0,0 +1,2 @@
+xk
+0 4/n_.2#SH6_PZf˳_,7؞+%Wd–n}_&Ok;Pf>tyY]ns ;ss,!LkԅcbL12cX91Z#XEn#;svT~L~LR11vs.1111J1&؍Ń111J1&ƞg KLƪjlk{gڞ5K1/ǐ~,ac$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_105_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_105_6.dat
new file mode 100644
index 0000000..a58fec7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_105_6.dat
@@ -0,0 +1,3 @@
+xQ
+@ DskBZ#o)Sd}Gܷl쯯^)G]S4S?#BZ:+{sHKNiI!me1
+RWe9!``Uyˀu:檞U=w-oԺwB}cMK蹰{{=y蹰{{=y蹰{wScaoi'fyO=CyO=Cy[{S޻=;|v4}ϯ20 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_109_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_109_6.dat
new file mode 100644
index 0000000..be7b474
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_109_6.dat
@@ -0,0 +1 @@
+xA0 ~ρDBHCHV20nuol쯯˻=ۢs9[l'?7R" &2:7QqX_n ]$՚EIY*Lq0 0 0{LJз(s\ɳwX-7^ItIII$~?N0 0 0O'Itg7L$L-Iuzrfr M^'}(O~R]1YLĞu9Qӕ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_113_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_113_6.dat
new file mode 100644
index 0000000..397f527
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_113_6.dat
@@ -0,0 +1,3 @@
+x E5NՉbF6on,m>gS9RWcǕ9&%1_cx= GR^w-z?dzv=,}ԥ?ǹژ:9m==@U䲉UXUXVe~by4Wi:e=<SZmAWUtVaVaVaZV5~V****^*~wk
+
+ZϪbayTfjֺʯjZ~t_@UnѾYWsV [|H \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_117_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_117_6.dat
new file mode 100644
index 0000000..99108be
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_117_6.dat
@@ -0,0 +1 @@
+xa F4/#Ev3nŸ/mYTwm<~?ljGCqS/6ftݟoӔf^l'7`ZC ?heiXq4[ـԉaaa9]PYM<6a[g:0 0 0 ×gx8:Yz;7Cataaa Ʊ,CataaO U6 8=gxx\ƑXQt2JZ:g C+\ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_121_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_121_6.dat
new file mode 100644
index 0000000..f3c3299
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_121_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_125_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_125_6.dat
new file mode 100644
index 0000000..ff64d44
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_125_6.dat
@@ -0,0 +1 @@
+xA0Er3&H yb+Slh0Ͳ6LwEѿfǮIv;&vw,o]ud]|k棘9ԊC}s19Jw9ˡZb=PK&aaaa>ɼÆ$<>Ov'Cytaaaa~|'9liΣ<<<<Iæ<:<<<ٕWDzy:.z= ݓʯ sVöE=ll_k0_#vίmj \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_129_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_129_6.dat
new file mode 100644
index 0000000..b4695c3
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_129_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_133_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_133_6.dat
new file mode 100644
index 0000000..40911dc
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_133_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_137_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_137_6.dat
new file mode 100644
index 0000000..43ccb68
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_137_6.dat
@@ -0,0 +1,2 @@
+x E5?e^4fHp[1-e)UQV]UWN5o*8|۩W6bk?{f|>s֪r666rҟ=vڲWy -'
+Ο;q tQE>U϶f곭xN]Tc(s❮7tAw`v`v`v`kvwfwt;];;;;;!ޙ;ao];l;;;÷| ʷ(3}l.?"މr};\}S-Aw<9;EV'ם \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_141_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_141_6.dat
new file mode 100644
index 0000000..0340409
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_141_6.dat
@@ -0,0 +1,10 @@
+xa F4/c]زȐ[=[E럓sm,fn/|kj\j?g[q(NOZc5SGGP[oMVָfvL<<e
++Ěa*XG6)))cLS6tjM]oW8D~OD`?׆NSk?)))*U)? SI=
+t
+BXLLLT5OqQS:`
+`
+`
+3_E)t
+`
+`
+`Lyb*?2T5i?U!K*xT7ioIEIREuJ+M7 ' \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_145_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_145_6.dat
new file mode 100644
index 0000000..6c14215
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_145_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_149_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_149_6.dat
new file mode 100644
index 0000000..69e9883
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_149_6.dat
@@ -0,0 +1,2 @@
+x
+0 E5f478UD62zmpߞk8}GӕN}?}W:guWAˌ7 ~;)Ø{̪ǿ+WPOۢrE\jwG)y˖wAAAAM%2`2dl|p}eqP : e j想=lT5ɠ : G{ddAtDaaaaa&أ&w : 1-MRb0Wf uz5&YiIѺNрAPQSL}4 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_153_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_153_6.dat
new file mode 100644
index 0000000..3ab6130
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_153_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_157_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_157_6.dat
new file mode 100644
index 0000000..b45c0ce
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_157_6.dat
@@ -0,0 +1 @@
+xA@D}fDN%nç,֖SVV>WóCaz6U~һ{`nݻdvVy~rZ"qk{>g$XKU}m\bjaGx,f1Yb]z̞^.5[?嬜r,f1YY>grVb,f1Y>g,rVmYb,f,|VY9Yb,f,|VY9+g1Ybً ̦M7>2{9z϶hm3l|9xټ#f#x6 -v%N' \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_161_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_161_6.dat
new file mode 100644
index 0000000..ecec68b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_161_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_165_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_165_6.dat
new file mode 100644
index 0000000..d641dfa
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_165_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_169_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_169_6.dat
new file mode 100644
index 0000000..ae68972
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_169_6.dat
@@ -0,0 +1 @@
+xJ0i9[Jɘk{1b!gnhHkS뉭-V?KIׁ1큏1ƣݎ/`/z)*=3ڏg6^k65CY<KkM[y@G&_=~>>㵾+'{է_Vˊx-J<ӛܗr_>>i;rO}/g}g}ٿ}}xO}/g}g}ٷGo/{{r_>>o/z^#}g}ٿd'ʳ|QRNS3YڳZ'msEǷj5 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_173_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_173_6.dat
new file mode 100644
index 0000000..95fa97c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_173_6.dat
@@ -0,0 +1 @@
+xa09MrM S*:a_-5hh_)uZ֭[loےsmKN{H?x`l#f9>ڟ[eЄώߓ ?^m*/Kmhy%v-nKlkKL`&& g5(gwxYܞa¬pVcZ[#O=SN9&0 L`DŽ 'tjj]QN9&0 L`sYRc@QN9 L`&0 L`"YRc\ ' r&0 L`EH9AN&0 L`& 7p6`|hms R5Ƙȉ k\X/ )g9 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_177_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_177_6.dat
new file mode 100644
index 0000000..e9f0476
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_177_6.dat
@@ -0,0 +1,14 @@
+xn {ڤ*4v۴u1{<LGiK GU]m/6j?mZmzy/ξgj\Փ<`_>f{_,,K9o 4ǵ7lniJiggir<-MG
+
+
+
+xuV+zRCr9+Gq6QWb"Qe"WL+
+ XXXXX/|~j,nmuMۤ+
+ XXXXXYa,X;M+
+ XXXXXe)o<S+
+
+
+
+
+
+0X,ަyt]AWXXXXX;VH92me3WdQbeQؽ]>Әf|5H늚7/D \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_21_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_21_6.dat
new file mode 100644
index 0000000..6bd505b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_21_6.dat
@@ -0,0 +1 @@
+xڝQ C9M{i]X1- C!D7 W ٜ&rD)~]<M 3(>{A aS \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_25_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_25_6.dat
new file mode 100644
index 0000000..d45083a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_25_6.dat
@@ -0,0 +1 @@
+xڝQA 52)e+(XmZt*(ڹ;tJ<峂_ڤ3oڴ"̢azh}&qvSG֙,-J4}oS[}w \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_29_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_29_6.dat
new file mode 100644
index 0000000..0408e22
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_29_6.dat
@@ -0,0 +1,3 @@
+xRA
+0 XcL(4EԈB
+8Cܾ޳nM+lǝՆO1]&ڍ4UD-6-$:6dZ?ylf? 8?߲<l}gg* \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_33_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_33_6.dat
new file mode 100644
index 0000000..8de4ba5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_33_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_37_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_37_6.dat
new file mode 100644
index 0000000..b37ff0a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_37_6.dat
@@ -0,0 +1 @@
+xA &T `j<P0jB#&,YofUj*UՏY[oY5 ~5 T7bnb,]˘-qF:stDch \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_41_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_41_6.dat
new file mode 100644
index 0000000..c1535f7
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_41_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_45_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_45_6.dat
new file mode 100644
index 0000000..a7da7ee
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_45_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_49_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_49_6.dat
new file mode 100644
index 0000000..64ded70
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_49_6.dat
@@ -0,0 +1,2 @@
+xVQ i{K&YX؁0̦!=tn&fpWL
+`/<ϓKVrU\1bGp@ӑ&fN/+ƽq`AWSRGp_5||zxν:J+WEm4h43tܭ.Ag`\ʤ*F \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_53_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_53_6.dat
new file mode 100644
index 0000000..9139e32
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_53_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_57_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_57_6.dat
new file mode 100644
index 0000000..61e7e24
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_57_6.dat
@@ -0,0 +1,2 @@
+xW |kKQ-^@c"Wr^UYM³>_ݏ`8G1`B`;+}&s]<JQF=mb3 UF'6ƖE 5JawZ60
+[99{S\ݞ8`k&os}{[R[+wOd^jW \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_61_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_61_6.dat
new file mode 100644
index 0000000..f2d3f10
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_61_6.dat
@@ -0,0 +1,2 @@
+xK DsڤE~݂ih'
+N'oVWjspCzοag!#WD%~˃Y?JfREKoͼǘ|Ƀˎ*OP7n뼽7s`sdDs~><iK'l'9%.7 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_65_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_65_6.dat
new file mode 100644
index 0000000..550fc8f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_65_6.dat
@@ -0,0 +1 @@
+xWQ i{KNLk?e$Qik41{`+!ڮM ? 1b8 .^wsnFj5EaQX|=w@2v<ŋŞ|4w\UXBQz+TTcBz/48,5`ȱ OV$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_69_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_69_6.dat
new file mode 100644
index 0000000..a3e4fa0
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_69_6.dat
@@ -0,0 +1 @@
+xK @dTh hLSSEq eY@<+*|窮 %>z*7e6QS`.>sE '%@[6@P0h aFxtpl2 Q-g1Nfeo^0FdT>N_OwG3ug {3<[Ժ b?'6^ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_73_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_73_6.dat
new file mode 100644
index 0000000..ab71b70
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_73_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_77_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_77_6.dat
new file mode 100644
index 0000000..ad5a660
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_77_6.dat
@@ -0,0 +1 @@
+x E۲iVa.FpSTY4q~z=:͒ 6m8:#0PضiDy:2Š'Zs&}滜\r0\ŚXw;iPȔL)Seԕ{hDu9LbJSS))gZ{e)qJdLw+#3-V0շljڠS-S 9=ݯ5PPq1M?g \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_81_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_81_6.dat
new file mode 100644
index 0000000..28a6d07
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_81_6.dat
@@ -0,0 +1,3 @@
+xQ0D9 rRLvk`0 ;i6\|_cc1huio#2}x*.Yt&
+ְq/K;3ve̢ȊAH?`]5Kw!}{Zû߲W
+yⷾ^_ykk^Kתb-bYSڸ'֜Nu#MfHSQ?|]IAiMyyuW \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_85_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_85_6.dat
new file mode 100644
index 0000000..d5403e4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_85_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_89_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_89_6.dat
new file mode 100644
index 0000000..eeeb5d1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_89_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_93_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_93_6.dat
new file mode 100644
index 0000000..6ff38db
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_93_6.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_6/mask_97_6.dat b/admin/survey/classes/phpqrcode/cache/mask_6/mask_97_6.dat
new file mode 100644
index 0000000..3a2072e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_6/mask_97_6.dat
@@ -0,0 +1,2 @@
+xa0sdFx[=4Hoj34&s}* a Vc&35arW^aLClzq,1x SQN]/Giu`&w%,%DY"Kt+HE'|R2(v1vqiqd,%D~%ػJj}ͺĺgY"Kd,+K
+]Wt+sF/)].zN'`>1='#`+bl]Z \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_101_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_101_7.dat
new file mode 100644
index 0000000..1f6bc51
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_101_7.dat
@@ -0,0 +1 @@
+xQ C}rm`fjT#54'tfaЇo$c<Hݠh8lo=ĄŧHv;z!|/FЍ3cf̌Sʅ㍂ 8K)49Q11J3fS+wck3cf캌zyy̵Ҍ1{bLXS+.to{>mOJ23c<6Xn0F ) \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_105_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_105_7.dat
new file mode 100644
index 0000000..6b0cacf
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_105_7.dat
@@ -0,0 +1,2 @@
+xA
+0EFaMҙNPx)pQ_~|ñ(bF$.aoWGNPUǖM%{oHQUlִL^>+m#{{eo&Y2soM)gncO9sZ3wo+{=f.zޣ{{=zGcskCQϞp^&{^NʷU e5}EwGn+o \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_109_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_109_7.dat
new file mode 100644
index 0000000..9875cbe
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_109_7.dat
@@ -0,0 +1,2 @@
+xA
+0 D9Mr}* _x-d:"NJ-k"⨚d{ջגɬ|<b2+U %Z}.q%Gih QA9IIG&ɞ< o:,ub2}mބ_ D'IIIO'$: 0 0 I$~D'w$L䇙TOvLVOO^<ObOOOʛt\3<Gͫ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_113_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_113_7.dat
new file mode 100644
index 0000000..b6e2159
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_113_7.dat
@@ -0,0 +1,11 @@
+xQ D4p˵MPeQ6d?Ը>'rQ5+ s)c7-1nn햺qɔJtg^ʉw̘Ň-?*&Mm@ee5^
+c
+
+,b\13j4TZfŢo*
+
+
+:Ut*
+
+
+Xů0<BWUtVaVaVYl
+ްkf5_ kW5{5pnCZ: bv \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_117_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_117_7.dat
new file mode 100644
index 0000000..cde78c1
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_117_7.dat
@@ -0,0 +1,2 @@
+xY D4pUI>"%6ed 8rS NsUnk5XejުuVXg,l`u!hXZ\VlM|[ͬ0 0 0 #hF'c]i>Hataaa~<ÆzyqkO0 0 0 㪞Faaa)2˰fÒ%z8tO=3=3:cw
+V$ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_121_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_121_7.dat
new file mode 100644
index 0000000..d5d577f
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_121_7.dat
@@ -0,0 +1,2 @@
+x[
+ Edi;^az,#6ƞ^rh&^amY9_غ5Cr6t^^WlEز~ɿ|MmmS}( ۰ ۰ ۰}mQ]ZVq]vѲ"M1fG, qBmtaaazeF3cxIDmtaaamný$n۰ ۰ ۰ ۏa[}`[yޖ޻)n<4K/Oslnlm/G \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_125_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_125_7.dat
new file mode 100644
index 0000000..f9ec088
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_125_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_129_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_129_7.dat
new file mode 100644
index 0000000..9bf51d5
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_129_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_133_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_133_7.dat
new file mode 100644
index 0000000..b643ffe
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_133_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_137_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_137_7.dat
new file mode 100644
index 0000000..11d212b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_137_7.dat
@@ -0,0 +1,5 @@
+x
+ F4/ c_ǂ+{SK<EӐ%umĔOcPNsu+ ʺQS,E)ֵ^fa_HkoKr6DZQ F><o[l
+Ο
+07։Vl;b7fMS;1LC<Q[+@wt v`v`v`v&! 7X+@wt v`v`v`v8 YP΂;C;;;saG{;ڻ>vR|KMH
+#Н(Sqd \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_141_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_141_7.dat
new file mode 100644
index 0000000..98dffab
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_141_7.dat
@@ -0,0 +1 @@
+xA E= rITY@Ä0!|1tbG0ԗѤs2Z/oa\qzOnҋMntX"KmeM}CpPL^S0S0S0SL )ǔژY߾%b,Sl?zC)tLLLLI2zRXh@)tLLLLI1zbϷB)~0S0S0S07)|B)))3ՖL% tfwM*:~hZsnc$1UTtJg8OYE \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_145_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_145_7.dat
new file mode 100644
index 0000000..4aa2bac
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_145_7.dat
@@ -0,0 +1,2 @@
+x
+ E5?W6Z-^2qbGX6(Ɖu"LbbGuμGk:HwA[jmHݞ3OkQ{l|TEm JfL?2"&)kRfc̉F,z=5X5X5X7F\pUs#5X5X5XFdYk!a ` ` `o8ct ]CC gM5[N%khZp?Iܣϲ^n$Y7AZP[ fȓ0 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_149_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_149_7.dat
new file mode 100644
index 0000000..809f005
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_149_7.dat
@@ -0,0 +1 @@
+xn {? uچ2G$ncFKb3֪tPc ̥7[?9:['9'*Ӗ Gah_/z+6XB>2qYJ0黏Bfa 1 9c7G Ol,^꽓3A:H  1A b0X4%٫#d>&C  1A b<A{oG&LMA:H1A b 1 {j2tb 1A &1X`_ 9`BG_l5:g5ajMLI <|r. \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_153_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_153_7.dat
new file mode 100644
index 0000000..c1ab276
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_153_7.dat
@@ -0,0 +1,2 @@
+xQ0= 匉B5
+ю惤/ͲIi^-Zkm|YDh9 \{K{y3v̻E]u`Rr"}Y e2{VV8][.n:+2_B&6Mlb&6`3i9YΌ諡yU}ԟ82f-vږ6nMI7Mlb&6l7 tnMlb&6Ml2^/nMI7Mlb&6;gxACtnOMlb&6yyfP[64̫k`v^+9 ʬO۱}攨+ZX=:iWE \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_157_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_157_7.dat
new file mode 100644
index 0000000..2db27f6
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_157_7.dat
@@ -0,0 +1,2 @@
+xM
+0E[M͕s_  }FQks{%Wq.]8evVbvV}_E̻n3W^K\`V캽Zl,f1Y;afkިizz?urVY9Yb,f,|VY9+g1Yb,|Y9+g7,f1Yb|Y>+g嬜,f1Yb|Y>+g嬜,f1Ylio.\Ɲo<l;9:g[϶lm^I>=gϙ-yk_TA \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_161_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_161_7.dat
new file mode 100644
index 0000000..35ba8ff
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_161_7.dat
@@ -0,0 +1 @@
+xю y/皨E)Ʈ1~493,˵+ZT=ZeC.<sv>~iߏ&>,6e~,lW] 2\;׵2j"e,rXݵV(c쵵ZӖ18ީ/,'t.ee,cX2߱,_|yt|]t.cX2e,cy/ɗys.eLe,cX2lo|Z{+2]bl,cX2e{+֊[A2]X2e,c9CX</owsPy]y}Vd氹d9JӇ)1 jI2 \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_165_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_165_7.dat
new file mode 100644
index 0000000..e27fb8e
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_165_7.dat
@@ -0,0 +1 @@
+xQ0M&A,N̨!x0&XZׇZ-Kث[ejx,.g}`;+k{~1}+k{إSGWg}ݬ@?_8퐾o+k][hW8~uMgqg|j<*q=<ۓRwƓq9.83838IUG?~snr\q98383xq㮁y979.gqgqg=)q'Eq9.gqgqwOz50Ir\838_Vvd}ax˯5)&9)fx3YH]S^*/ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_169_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_169_7.dat
new file mode 100644
index 0000000..ef1a181
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_169_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_173_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_173_7.dat
new file mode 100644
index 0000000..3b51371
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_173_7.dat
@@ -0,0 +1 @@
+xj0 {=M/ RbHrj\=,mcoZ8;mm0b_ߚt$~Wu5ǚNn'?df2(oG,L6_{z? 9wq9 S!ƌ9o2 L`pOEnv8Lv8L UY"d} Kr ' L`&0 L`B'f:O8TcTc\kr ' L`&0 L`BYgIkr ' L`&0 L`"YRc\ ' r&0 L`EڳH9AN&0 L`&'!;q+Yl*ܳ=؀9j[2 Ms¤Ԅ* \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_177_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_177_7.dat
new file mode 100644
index 0000000..068477c
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_177_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_21_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_21_7.dat
new file mode 100644
index 0000000..4f9f138
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_21_7.dat
@@ -0,0 +1,4 @@
+xڝQ
+0 B=r]-?]Rl2nc
+[nA".j+i
+~x3<aX{HC1x)S \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_25_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_25_7.dat
new file mode 100644
index 0000000..cefe1b9
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_25_7.dat
@@ -0,0 +1 @@
+xڝQA 5[F@aZ̲ >;QIQH8R҈G"z,&;'o97%P8%6oǽ;]NWn[f7v \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_29_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_29_7.dat
new file mode 100644
index 0000000..e3d7391
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_29_7.dat
@@ -0,0 +1,2 @@
+xR9 QpX$lŲf!I2pgSMZj<K.ط
+Ǘ^D/_y/gcxV0Bf#]BϽʳh9޹^ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_33_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_33_7.dat
new file mode 100644
index 0000000..1763f42
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_33_7.dat
@@ -0,0 +1 @@
+xSA@k6ǒ80 7-nZbE0"t]3Ztq>"te0#ԛ`_1-cha~/Eh4"~ \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_37_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_37_7.dat
new file mode 100644
index 0000000..87d9a1a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_37_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_41_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_41_7.dat
new file mode 100644
index 0000000..8acec04
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_41_7.dat
@@ -0,0 +1 @@
+xTA 5[fDY(O^bR3/~t/L"7SQQ5j\Sib#Նȏ+ǣw#zx?㽧A-wu曑Y7$b.%A;wRoxG}? \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_45_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_45_7.dat
new file mode 100644
index 0000000..dbba31d
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_45_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_49_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_49_7.dat
new file mode 100644
index 0000000..be5dce8
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_49_7.dat
@@ -0,0 +1 @@
+xV0khC-X.<h6̋ 3,B Ԕ,@ϐd5$K"T|p%9"yp,=<mԉ!?DW"(A-\- J\{0plWW]4?4h= Z_d+g(**+붵( \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_53_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_53_7.dat
new file mode 100644
index 0000000..7028ef6
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_53_7.dat
@@ -0,0 +1 @@
+xK Ds&Rki&,H)tDj =QaP"ds1ZyC|hey CvaH7+OuQsZtb7 vhV ~1#~[ffHkZJtmZ6s wr&C߶f \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_57_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_57_7.dat
new file mode 100644
index 0000000..ee3107a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_57_7.dat
@@ -0,0 +1 @@
+xA03&H)Kb&q֞[-֌ 9rYs .iӾ`~G{ciՂ\Y<.|2۟2 QQ[[^N88l[}[Pl?g+o*ϖ4W1 33[\Gosbkmmm^h \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_61_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_61_7.dat
new file mode 100644
index 0000000..76f8d72
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_61_7.dat
@@ -0,0 +1,2 @@
+xK
+ Ds+-*5mcaT19Y쌧L9 糶s//i\bī-"^DH-i;bnA7fet7ٷỵE:r<46(uy{K3o"|ao?ᜟ竟p9j~NƛsTY u \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_65_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_65_7.dat
new file mode 100644
index 0000000..d8b9206
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_65_7.dat
@@ -0,0 +1 @@
+xA I*6^L!酰 i)mTT]VW\9e@4Ku^#N%:,mYJN9ඩvA2ϜH"Y +?`BXDBX̽{.wd,~΂k,^bQ~.\w ^ρOYEJmX"% \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_69_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_69_7.dat
new file mode 100644
index 0000000..c2db020
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_69_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_73_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_73_7.dat
new file mode 100644
index 0000000..f414e4a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_73_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_77_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_77_7.dat
new file mode 100644
index 0000000..3e52bfd
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_77_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_81_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_81_7.dat
new file mode 100644
index 0000000..78e08df
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_81_7.dat
@@ -0,0 +1 @@
+x D5?l"͊ݕu4a>ukv o40T%96U5*sI{`_>S?}(:yTl{G&E\6}"AX XϬ<mwxfG<krUeεεXXZ~s;\Z3|y /wp˯U[~}Oo`msݑ)~, \ No newline at end of file
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_85_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_85_7.dat
new file mode 100644
index 0000000..a53824a
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_85_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_89_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_89_7.dat
new file mode 100644
index 0000000..32934a4
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_89_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_93_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_93_7.dat
new file mode 100644
index 0000000..1955f6b
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_93_7.dat
Binary files differ
diff --git a/admin/survey/classes/phpqrcode/cache/mask_7/mask_97_7.dat b/admin/survey/classes/phpqrcode/cache/mask_7/mask_97_7.dat
new file mode 100644
index 0000000..b277368
--- /dev/null
+++ b/admin/survey/classes/phpqrcode/cache/mask_7/mask_97_7.dat
@@ -0,0 +1,2 @@
+x0ܲD[V.KI`'sxy$xx"= O^&pbYʬ$Kݣ8K eÌ 3:$bI,%$Yb襶
+M)T %q綦EX}jlTTKbI,%,_e[%V]R];N,%$%V@`%pam(}_%%۸4='u)ai.;M> \ No newline at end of file
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php
index 16e8eea..870e4a9 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysis.php
@@ -9,24 +9,27 @@
* " -> \x22
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
+ if (!defined('EXPORT_FOLDER')) define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define('DATE_FORMAT', 'Y-m-d');
-define("ALLOW_HIDE_ZERRO_REGULAR", false); # omogočimo delovanje prikazovanja/skrivanja ničelnih vrednosti za navadne odgovore
-define("ALLOW_HIDE_ZERRO_MISSING", true); # omogočimo delovanje prikazovanja/skrivanja ničelnih vrednosti za missinge
-define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
+ if(!defined("DATE_FORMAT")) define('DATE_FORMAT', 'Y-m-d');
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR")) define("ALLOW_HIDE_ZERRO_REGULAR", false); # omogočimo delovanje prikazovanja/skrivanja ničelnih vrednosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING")) define("ALLOW_HIDE_ZERRO_MISSING", true); # omogočimo delovanje prikazovanja/skrivanja ničelnih vrednosti za missinge
+ if(!defined("AUTO_HIDE_ZERRO_VALUE")) define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
# mejne vrednosti za barvanje residualov
-define("RESIDUAL_COLOR_LIMIT1", 1.00);
-define("RESIDUAL_COLOR_LIMIT2", 2.00);
-define("RESIDUAL_COLOR_LIMIT3", 3.00);
-
-
-DEFINE (STR_DLMT, '|');
-DEFINE (NEW_LINE, "\n");
-DEFINE (TMP_EXT, '.tmp');
-DEFINE (DAT_EXT, '.dat');
+if(!defined("RESIDUAL_COLOR_LIMIT1")) define("RESIDUAL_COLOR_LIMIT1", 1.00);
+if(!defined("RESIDUAL_COLOR_LIMIT2")) define("RESIDUAL_COLOR_LIMIT2", 2.00);
+if(!defined("RESIDUAL_COLOR_LIMIT3")) define("RESIDUAL_COLOR_LIMIT3", 3.00);
+
+if (!defined('STR_DLMT'))
+ define(STR_DLMT, '|');
+if (!defined('NEW_LINE'))
+ define (NEW_LINE, "\n");
+if (!defined('TMP_EXT'))
+ define (TMP_EXT, '.tmp');
+if (!defined('DAT_EXT'))
+ define (DAT_EXT, '.dat');
class SurveyAnalysis {
@@ -187,7 +190,6 @@ class SurveyAnalysis {
if ( self::$dataFileStatus == FILE_STATUS_NO_DATA || self::$dataFileStatus == FILE_STATUS_SRV_DELETED) {
if (self::$podstran != M_ANALYSIS_ARCHIVE)
Common::noDataAlert();
-
return false;
}
@@ -196,9 +198,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();
@@ -267,13 +267,14 @@ class SurveyAnalysis {
$_zoom_condition = SurveyZoom::generateAwkCondition();
# ali imamo filter na testne podatke
- #$filter_testdata = isset($_SESSION['testData'][self::$sid]['includeTestData']) && $_SESSION['testData'][self::$sid]['includeTestData'] == 'false';
+ $filter_testdata = '';
if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
$test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
$filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
}
# ali imamo filter na uporabnost
+ $filter_usability = '';
if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
$usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
$filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
@@ -283,8 +284,9 @@ class SurveyAnalysis {
|| ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
|| ($_time_profile_awk != "" && $_time_profile_awk != null)
|| ($_zoom_condition != "" && $_zoom_condition != null)
- || ($filter_testdata != null)
- || ($filter_usability != null)) {
+ || ($filter_testdata != '')
+ || ($filter_usability != '')) {
+
self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
@@ -305,12 +307,6 @@ class SurveyAnalysis {
if ($filter_testdata != null ) {
self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
- /*
- $test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
- if ((int)$test_data_sequence > 0) {
- self::$_CURRENT_STATUS_FILTER .= '&&($'.$filter_testdata.')';
- }
- */
}
if ($filter_usability != null ) {
@@ -446,19 +442,18 @@ class SurveyAnalysis {
}
- if (self::$dataFileStatus == FILE_STATUS_OLD && self::$podstran != M_ANALYSIS_ARCHIVE) {
- echo "Posodobljeno: ".date("d.m.Y, H:i:s", strtotime(self::$dataFileUpdated));
- }
-
# krostabe naredimo
if(self::$podstran == M_ANALYSIS_CROSSTAB ) {
self::$crossTabClass->Display();
- } else {
+ }
+ else {
# polovimo nastavtve missing profila
self::$missingProfileData = SurveyMissingProfiles::getProfile(self::$currentMissingProfile);
+
if (self::$podstran != M_ANALYSIS_ARCHIVE) {
self::$_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
}
+
if (!is_countable(self::$_LOOPS) || count(self::$_LOOPS) == 0) {
# če nimamo zank
@@ -480,18 +475,21 @@ class SurveyAnalysis {
self::$podstran = M_ANALYSIS_SUMMARY;
self::Display();
break;
+ }
}
- } else {
+ else {
$loop_cnt = 0;
+
# če mamo zanke
- foreach ( self::$_LOOPS AS $loop)
- {
+ foreach ( self::$_LOOPS AS $loop){
+
$loop_cnt++;
$loop['cnt'] = $loop_cnt;
self::$_CURRENT_LOOP = $loop;
- echo '<h2 data-loopId="'.self::$_CURRENT_LOOP['cnt'].'">'.$lang['srv_zanka_note'].$loop['text'].'</h2>';
- switch (self::$podstran)
- {
+
+ echo '<h2 class="filter_box" data-loopId="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'">'.$lang['srv_zanka_note'].$loop['text'].'</h2>';
+
+ switch (self::$podstran){
case M_ANALYSIS_SUMMARY :
self::displaySums();
break;
@@ -508,8 +506,7 @@ class SurveyAnalysis {
self::$podstran = M_ANALYSIS_SUMMARY;
self::Display();
break;
- }
-
+ }
}
}
@@ -536,107 +533,122 @@ class SurveyAnalysis {
#preberemo HEADERS iz datoteke
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
- # odstranimo sistemske variable tipa email, ime, priimek, geslo
- self::removeSystemVariables();
+ # odstranimo sistemske variable tipa email, ime, priimek, geslo
+ self::removeSystemVariables();
- # polovimo frekvence
- self::getDescriptives();
+ # polovimo frekvence
+ self::getDescriptives();
- # izpišemo opisne statistike
- $vars_count = count(self::$_FILTRED_VARIABLES);
- $line_break = '';
+ # izpišemo opisne statistike
+ $vars_count = count(self::$_FILTRED_VARIABLES);
+ $line_break = '';
- # dodamo še kontrolo če kličemo iz displaySingleVar
- if (isset($_spid) && $_spid !== null) {
- self::$_HEADERS = array($_spid => self::$_HEADERS[$_spid]);
- }
-
- # ali prikazujemo spremenljivke brez veljavnih odgovorov
- $show_spid = array();
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- # preverjamo ali je meta
- if ($spremenljivka['tip'] != 'm'
- && ( count(self::$_FILTRED_VARIABLES) == 0 || (count(self::$_FILTRED_VARIABLES) > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ))
- && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES) ){
- $only_valid = 0;
+ # dodamo še kontrolo če kličemo iz displaySingleVar
+ if (isset(self::$_HEADERS[$_spid]) && isset($_spid) && $_spid !== null) {
+ self::$_HEADERS = array($_spid => self::$_HEADERS[$_spid]);
+ }
+
+ # ali prikazujemo spremenljivke brez veljavnih odgovorov
+ $show_spid = array();
+ foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+ # preverjamo ali je meta
+ if (isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
+ && ( count(self::$_FILTRED_VARIABLES) == 0 || (count(self::$_FILTRED_VARIABLES) > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ))
+ && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES) ){
+ $only_valid = 0;
+
+ $show_enota = false;
+ # preverimo ali imamo samo eno variablo in če iammo enoto
+ if (isset($spremenljivka['enota']) && (int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
+ $show_enota = true;
+ }
- $show_enota = false;
- # preverimo ali imamo samo eno variablo in če iammo enoto
- if ((int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
- $show_enota = true;
- }
+ # izpišemo glavno vrstico z podatki
+ $_sequence = null;
+ # za enodimenzijske tipe izpišemo podatke kar v osnovni vrstici
+ if (!$show_enota) {
+ $variable = $spremenljivka['grids'][0]['variables'][0];
+ $_sequence = $variable['sequence']; # id kolone z podatki
+ $only_valid += (int)(isset(self::$_DESCRIPTIVES[$_sequence]['validCnt'])?self::$_DESCRIPTIVES[$_sequence]['validCnt']:0);
+ } else {
+ if ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) {
+ $variable = $spremenljivka['grids'][0]['variables'][0];
+ $_sequence = $variable['sequence']; # id kolone z podatki
+ $show_enota = false;
+ }
+ #zloopamo skozi variable
+ $_sequence = null;
+ $grd_cnt=0;
+ if (count($spremenljivka['grids']) > 0)
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+
+ # dodamo dodatne vrstice z albelami grida
+ if (count ($grid['variables']) > 0)
+ foreach ($grid['variables'] AS $vid => $variable ){
+ # dodamo ostale vrstice
+ $do_show = ($variable['other'] !=1 && ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3 || $spremenljivka['tip'] == 5 || $spremenljivka['tip'] == 8 ))
+ ? false
+ : true;
+ if ($do_show) {
+ $only_valid += (int)(isset(self::$_DESCRIPTIVES[$variable['sequence']]['validCnt'])?self::$_DESCRIPTIVES[$variable['sequence']]['validCnt']:0);
+ }
+ }
+ }
+ } //else: if (!$show_enota)
+
+ if (SurveyDataSettingProfiles :: getSetting('hideEmpty') == 1 && $only_valid == 0 && self::$_forceShowEmpty == false) {
+ $show_spid[$spid] = false;
+ } else {
+ $show_spid[$spid] = true;
+ }
- # izpišemo glavno vrstico z podatki
- $_sequence = null;
- # za enodimenzijske tipe izpišemo podatke kar v osnovni vrstici
- if (!$show_enota) {
- $variable = $spremenljivka['grids'][0]['variables'][0];
- $_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_DESCRIPTIVES[$_sequence]['validCnt'];
- } else {
- if ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) {
- $variable = $spremenljivka['grids'][0]['variables'][0];
- $_sequence = $variable['sequence']; # id kolone z podatki
- $show_enota = false;
- }
- #zloopamo skozi variable
- $_sequence = null;
- $grd_cnt=0;
- if (count($spremenljivka['grids']) > 0)
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
-
- # dodamo dodatne vrstice z albelami grida
- if (count ($grid['variables']) > 0)
- foreach ($grid['variables'] AS $vid => $variable ){
- # dodamo ostale vrstice
- $do_show = ($variable['other'] !=1 && ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3 || $spremenljivka['tip'] == 5 || $spremenljivka['tip'] == 8 ))
- ? false
- : true;
- if ($do_show) {
- $only_valid += (int)self::$_DESCRIPTIVES[$variable['sequence']]['validCnt'];
- }
- }
- }
- } //else: if (!$show_enota)
+ }
+ }
- if (SurveyDataSettingProfiles :: getSetting('hideEmpty') == 1 && $only_valid == 0 && self::$_forceShowEmpty == false) {
- $show_spid[$spid] = false;
- } else {
- $show_spid[$spid] = true;
- }
+ if (self :: $show_spid_div == true) {
+ echo '<div id="desc_'.$_spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_desc_variable div_analiza_holder">';
+
+ // Ce kličemo iz displaySingleVar za samo eno spremenljivko
+ if (isset($_spid) && $_spid !== null) {
+ self::displaySpremenljivkaIcons($_spid);
+ }
}
- }
- echo '<table class="anl_tbl anl_ba" >';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb anl_w90">&nbsp;<span>'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb anl_w110">' . $lang['srv_analiza_opisne_variable'] .'<span>'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_variable_text'] .'<span>'.'</span></td>';
+
+ echo '<table class="table_desc" >';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_icons"></td>';
+ echo '<td class="cell_var">' . $lang['srv_analiza_opisne_variable'] .'<span>'.'</span></td>';
+ echo '<td class="cell_question">' . $lang['srv_analiza_opisne_variable_text'] .'<span>'.'</span></td>';
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_variable_type'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_variable_expression'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_variable_skala'] .'<span >'.'</span></td>';
- }
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_m'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_num_units'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_povprecje_odstotek'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb">' . $lang['srv_analiza_opisne_odklon'] .'<span >'.'</span></td>';
- echo '<td class="anl_br anl_ac anl_bck anl_variabla_line anl_bb" >' . $lang['srv_analiza_opisne_min'] .'<span >'.'</span></td>';
- echo '<td class=" anl_ac anl_bck anl_variabla_line anl_bb" >' . $lang['srv_analiza_opisne_max'] .'<span >'.'</span></td>';
+ echo '<td class="cell_info">' . $lang['srv_analiza_opisne_variable_type'] .'<span >'.'</span></td>';
+ echo '<td class="cell_info">' . $lang['srv_analiza_opisne_variable_expression'] .'<span >'.'</span></td>';
+ echo '<td class="cell_info">' . $lang['srv_analiza_opisne_variable_skala'] .'<span >'.'</span></td>';
+ }
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_m'] .'<span >'.'</span></td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_num_units'] .'<span >'.'</span></td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_povprecje_odstotek'] .'<span >'.'</span></td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_odklon'] .'<span >'.'</span></td>';
+ echo '<td class="cell_value" >' . $lang['srv_analiza_opisne_min'] .'<span >'.'</span></td>';
+ echo '<td class="cell_value" >' . $lang['srv_analiza_opisne_max'] .'<span >'.'</span></td>';
+
echo '</tr>';
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
# dajemo v bufer, da da ne prikazujemo vprašanj brez veljavnih odgovorov če imamo tako nastavljeno
# preverjamo ali je meta
- if ($show_spid[$spid] && $spremenljivka['tip'] != 'm'
+ if (isset($show_spid[$spid]) && $spremenljivka['tip'] != 'm'
&& ( count(self::$_FILTRED_VARIABLES) == 0 || (count(self::$_FILTRED_VARIABLES) > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ))
&& in_array($spremenljivka['tip'], self::$_FILTRED_TYPES) ){
$show_enota = false;
# preverimo ali imamo samo eno variablo in če iammo enoto
- if ((int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
+ if (isset($spremenljivka['enota']) && (int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
$show_enota = true;
}
@@ -677,7 +689,7 @@ class SurveyAnalysis {
: true;
if ($do_show) {
$variable['var_cnt'] = $var_cnt;
- self::displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,$_css);
+ self::displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,null);
}
$grid['new_grid'] = false;
@@ -687,10 +699,16 @@ class SurveyAnalysis {
} //else: if (!$show_enota)
} // end if $spremenljivka['tip'] != 'm'
} // end foreach self::$_HEADERS
+
echo '</table >';
+
+ if (self :: $show_spid_div == true) {
+ echo '</div>'; // id="sum_'.$keyGrupe.'">';
+ }
+
// Izrisemo ikone na dnu
- if ( (!isset($_spid) || $_spid == null) && (count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
+ if ( (!isset($_spid) || $_spid == null) && (!is_countable(self::$_LOOPS) || count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
self::displayBottomSettings('desc');
} // end if else ($_headFileName == null)
@@ -707,8 +725,10 @@ class SurveyAnalysis {
$cssBack = $variable['other'] != 1 ? ' anl_bck_desc_2' : ' anl_bck_desc_3';
$cssMove = $variable['other'] != 1 ? ' anl_tin' : ' anl_tin1';
- $cssBack .= (int)$grid['new_grid'] == 1 ? ' anl_bt ' : ' anl_bt_dot ';
+ $cssBack .= (isset($grid['new_grid']) && (int)$grid['new_grid'] == 1) ? ' anl_bt ' : ' anl_bt_dot ';
+
$_sequence = $variable['sequence']; # id kolone z podatki
+
if ($_sequence != null) {
$_desc = self::$_DESCRIPTIVES[$_sequence];
}
@@ -716,43 +736,38 @@ class SurveyAnalysis {
# pokličemo objekt SpremenljivkaSkala
$objectSkala = new SpremenljivkaSkala($spremenljivka['spr_id']);
+
# če smo na začetku grida dodamo podatke podvprašanja
if ($variable['var_cnt'] == 0 && in_array($spremenljivka['tip'],array(16,19,20) ) ) {
- echo '<tr>';
- echo '<td class="anl_bck anl_ac anl_br link_no_decoration">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_variabla_sub anl_double_bt anl_bb">';
+ echo '<tr class="row_grid">';
+
+ echo '<td class="cell_icons"></td>';
+
+ echo '<td class="cell_var">';
echo $grid['variable'];
echo '</td>';
- echo '<td class="anl_al anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb" colspan="'.(self::$_SHOW_LEGENDA ? '10' : '7').'">';
+
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? '10' : '7').'">';
echo $grid['naslov'];
echo '</td>';
- /*
- if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- }
- echo '<td class="anl_ac ss=anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td cla"anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- echo '<td class="anl_ac anl_br link_no_decoration anl_bck_desc_1 anl_double_bt anl_bb">&nbsp;</td>';
- */
+
echo '</tr>';
}
- echo '<tr>';
- echo '<td class="anl_bck anl_ac anl_br link_no_decoration">';
- echo '&nbsp;';
- echo '</td>';
- echo '<td class="'.$cssBack.' anl_ac anl_br link_no_decoration anl_variabla_sub">';
+
+
+ echo '<tr class="row_var">';
+
+ echo '<td class="cell_icons"></td>';
+
+ echo '<td class="'.$cssBack.' cell_var">';
echo $variable['variable'];
echo '</td>';
- echo '<td class="' . $cssBack . $cssMove . ' anl_br">';
- //echo $grid['naslov'] . ' - ' .$variable['naslov'];
+
+ echo '<td class="' . $cssBack . $cssMove . ' cell_question">';
echo $variable['naslov'];
- echo ($spremenljivka['enota'] == 1) ? ' - '.$variable['naslov2'] : '';
+ echo (isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1) ? ' - '.(isset($variable['naslov2'])?$variable['naslov2']:'') : '';
echo '</td>';
+
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -761,35 +776,40 @@ class SurveyAnalysis {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="' . $cssBack . ' anl_ac anl_br" title="'.$_tip.'">'.'&nbsp;'.'</td>';
- echo '<td class="' . $cssBack . ' anl_ac anl_br" title="'.$_tip.'">'.$_tip.'</td>';
- echo '<td class="' . $cssBack . ' anl_ac anl_br" title="'.$_oblika.'">' .$_oblika. '</td>';
+
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_tip.'">'.'&nbsp;'.'</td>';
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_tip.'">'.$_tip.'</td>';
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_oblika.'">' .$_oblika. '</td>';
}
+
#veljavno
- echo '<td class="' . $cssBack . ' anl_br anl_ac">'.(int)$_desc['validCnt'].'</td>';
+ echo '<td class="' . $cssBack . ' cell_value">'.(int)(isset($_desc['validCnt'])?$_desc['validCnt']:0).'</td>';
#ustrezno
- echo '<td class="' . $cssBack . ' anl_br anl_ac">'.(int)$_desc['allCnt'].'</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac">';
-
-
+ echo '<td class="' . $cssBack . ' cell_value">'.(int)(isset($_desc['allCnt'])?$_desc['allCnt']:0).'</td>';
+
+ echo '<td class="' . $cssBack . ' cell_value">';
if ( isset($_desc['avg']) && (int)$objectSkala->getSkala() !== 1 ) {
echo self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
} else if (isset($_desc['avg']) && $spremenljivka['tip'] == 2 && (int)$objectSkala->getSkala() == 1 ) {
- echo self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%');
+ echo self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ //echo self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%');
}
echo '</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac">';
+
+ echo '<td class="' . $cssBack . ' cell_value">';
if (isset($_desc['div']) && (int)$objectSkala->getSkala() !== 1) {
echo self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
}
echo '</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['min'] : '').'</td>';
- echo '<td class="' . $cssBack . ' anl_ac">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['max'] : '').'</td>';
- echo '</tr>';
+ echo '<td class="' . $cssBack . ' cell_value">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['min'] : '').'</td>';
+ echo '<td class="' . $cssBack . ' cell_value">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['max'] : '').'</td>';
+
+ echo '</tr>';
}
+
/** Izriše vrstico z opisnimi
*
* @param unknown_type $spremenljivka
@@ -797,129 +817,155 @@ class SurveyAnalysis {
*/
static function displayDescriptivesSpremenljivkaRow($spid,$spremenljivka,$show_enota,$_sequence = null) {
global $lang;
+
$cssBack = " anl_bck_desc_1";
+
+ $_desc=array();
if ($_sequence != null) {
$_desc = self::$_DESCRIPTIVES[$_sequence];
}
# pokličemo objekt SpremenljivkaSkala
$objectSkala = new SpremenljivkaSkala($spremenljivka['spr_id']);
+
- echo '<tr>';
- echo '<td class="anl_bck anl_ac anl_br anl_bt link_no_decoration">';
- self::showIcons($spid,$spremenljivka,'desc');
+
+ echo '<tr class="row_question">';
+
+
+ echo '<td class="cell_icons cell_icons'.$spid.'" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')"> </span>';
+ echo ' <div class="options" id="options'.$spid.'">';
+ self::showIcons($spid, $spremenljivka, 'desc');
+ echo ' </div>';
echo '</td>';
- echo '<td class="'.$cssBack.' anl_ac anl_br anl_bt">';
+
+
+ echo '<td class="'.$cssBack.' cell_var">';
self::showVariable($spid,$spremenljivka['variable']);
echo '</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_bt">';
+
+ echo '<td class="' . $cssBack . ' cell_question">';
echo ($spremenljivka['naslov']) . '</td>';
+
if (self::$_SHOW_LEGENDA) {
- if ($variable['other'] != '1' && $variable['text'] != '1') {
+ if ((isset($variable['other'])?$variable['other']:null) != '1' && (isset($variable['text'])?$variable['text']:null) != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
} else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="' . $cssBack . ' anl_ac anl_br anl_bt" title="'.$_tip.'">'.
- self::getSpremenljivkaLegenda($spremenljivka,'tip')
- .'</td>';
- echo '<td class="' . $cssBack . ' anl_ac anl_br anl_bt" title="'.$_tip.'">'.(!$show_enota ? $_tip : '&nbsp').'</td>';
- echo '<td class="' . $cssBack . ' anl_ac anl_br anl_bt" title="'.$_oblika.'">'.(!$show_enota ? $_oblika : '&nbsp;'). '</td>';
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_tip.'">'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</td>';
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_tip.'">'.(!$show_enota ? $_tip : '&nbsp').'</td>';
+ echo '<td class="' . $cssBack . ' cell_info" title="'.$_oblika.'">'.(!$show_enota ? $_oblika : '&nbsp;'). '</td>';
}
+
#veljavno
- echo '<td class="' . $cssBack . ' anl_br anl_ac anl_bt">'.(!$show_enota ? (int)$_desc['validCnt'] : '&nbsp;') .'</td>';
+ echo '<td class="' . $cssBack . ' cell_value">'.(!$show_enota ? (int)(isset($_desc['validCnt'])?$_desc['validCnt']:0) : '&nbsp;') .'</td>';
+
#ustrezno
- echo '<td class="' . $cssBack . ' anl_br anl_ac anl_bt">'.(!$show_enota ? (int)$_desc['allCnt'] : '&nbsp;').'</td>';
+ echo '<td class="' . $cssBack . ' cell_value">'.(!$show_enota ? (int)(isset($_desc['allCnt'])?$_desc['allCnt']:0) : '&nbsp;').'</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac anl_bt">';
+ echo '<td class="' . $cssBack . ' cell_value">';
if (isset($_desc['avg']) && (int)$objectSkala->getSkala() !== 1) {
echo self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
}
echo '</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac anl_bt">';
+
+ echo '<td class="' . $cssBack . ' cell_value">';
if (isset($_desc['div']) && (int)$objectSkala->getSkala() !== 1) {
echo self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
}
echo '</td>';
- echo '<td class="' . $cssBack . ' anl_br anl_ac anl_bt">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['min'] : '').'</td>';
- echo '<td class="' . $cssBack . ' anl_ac anl_bt">'.((int)$objectSkala->getSkala() !== 1 ? $_desc['max'] : '').'</td>';
- echo '</tr>';
+ echo '<td class="' . $cssBack . ' cell_value">'.((isset($_desc['min'])&&(int)$objectSkala->getSkala() !== 1) ? $_desc['min'] : '').'</td>';
+
+ echo '<td class="' . $cssBack . ' cell_value">'.((isset($_desc['max'])&&(int)$objectSkala->getSkala() !== 1) ? $_desc['max'] : '').'</td>';
+ echo '</tr>';
}
+
/** Izrišemo fekvence
*
*/
static function displayFrequency($_spid = null) {
global $site_path, $lang;
+
# preberemo header
if (self::$headFileName !== null ) {
+
#preberemo HEADERS iz datoteke
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
- # odstranimo sistemske variable tipa email, ime, priimek, geslo
- self::removeSystemVariables();
-
- # polovimo frekvence
- self::getFrequencys();
- $vars_count = count(self::$_FILTRED_VARIABLES);
- $line_break = '';
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- # preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
- && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES ))
- && (!isset($_spid) || (isset($_spid) && $_spid == $spid))) {
- # ali imamo sfiltrirano spremenljivko
- if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) ) {
- # prikazujemo v odvisnosti od kategorije spremenljivke
- switch ($spremenljivka['tip']) {
- case 1: # radio - prikjaže navpično
- case 2: #checkbox če je dihotomna:
- case 3: # dropdown - prikjaže navpično
- case 6: # multigrid
- case 4: # text
- case 7:# variabla tipa »število«
- case 8: # datum
- case 16: #multicheckbox če je dihotomna:
- case 17: #razvrščanje če je ordinalna
- case 18: # vsota
- case 19: # multitext
- case 20: # multi number
- case 21: # besedilo*
- case 22: # kalkulacija
- case 25: # kvota
- case 26: # lokacija
- self::frequencyVertical($spid);
- break;
- case 5:
- # nagovor
- self::sumNagovor($spid,'freq');
- break;
-
- }
+ # odstranimo sistemske variable tipa email, ime, priimek, geslo
+ self::removeSystemVariables();
+
+ # polovimo frekvence
+ self::getFrequencys();
- }
+ $vars_count = count(self::$_FILTRED_VARIABLES);
+ $line_break = '';
+
+ foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- } // end if $spremenljivka['tip'] != 'm'
- } // end foreach self::$_HEADERS
+ # preverjamo ali je meta
+ if ((isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
+ && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES ))
+ && (!isset($_spid) || (isset($_spid) && $_spid == $spid))) {
- // Izrisemo ikone na dnu
- if ( (!isset($_spid) || $_spid == null) && (count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
- self::displayBottomSettings('freq');
+ # ali imamo sfiltrirano spremenljivko
+ if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) ) {
+
+ # prikazujemo v odvisnosti od kategorije spremenljivke
+ switch ($spremenljivka['tip']) {
+
+ case 1: # radio - prikjaže navpično
+ case 2: #checkbox če je dihotomna:
+ case 3: # dropdown - prikjaže navpično
+ case 6: # multigrid
+ case 4: # text
+ case 7:# variabla tipa »število«
+ case 8: # datum
+ case 16: #multicheckbox če je dihotomna:
+ case 17: #razvrščanje če je ordinalna
+ case 18: # vsota
+ case 19: # multitext
+ case 20: # multi number
+ case 21: # besedilo*
+ case 22: # kalkulacija
+ case 25: # kvota
+ case 26: # lokacija
+ self::frequencyVertical($spid);
+ break;
+
+ case 5:
+ # nagovor
+ self::sumNagovor($spid,'freq');
+ break;
+ }
+ }
+
+ } // end if $spremenljivka['tip'] != 'm'
+
+ } // end foreach self::$_HEADERS
+
+ // Izrisemo ikone na dnu
+ if ( (!isset($_spid) || $_spid == null) && (count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
+ self::displayBottomSettings('freq');
} // end if else ($_headFileName == null)
}
- /** Izriše frekvence v vertikalni obliki
- *
- * @param unknown_type $spid
- */
+ /** Izriše frekvence v vertikalni obliki
+ *
+ * @param unknown_type $spid
+ */
static function frequencyVertical($spid) {
global $lang;
$spremenljivka = self::$_HEADERS[$spid];
+ $gidsCanShow = array();
# preverimo ali prikazujemo spremenljivko, glede na veljavne odgovore in nastavitev
$only_valid = 0;
@@ -929,7 +975,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -956,7 +1004,7 @@ class SurveyAnalysis {
}
}
}
- if (self::$hideEmptyValue == true || (is_countable(self::$_FREQUENCYS[$_sequence]['valid']) && count(self::$_FREQUENCYS[$_sequence]['valid']) > AUTO_HIDE_ZERRO_VALUE)) {
+ if (self::$hideEmptyValue == true || (isset(self::$_FREQUENCYS[$_sequence]['valid']) && is_countable(self::$_FREQUENCYS[$_sequence]['valid']) && count(self::$_FREQUENCYS[$_sequence]['valid']) > AUTO_HIDE_ZERRO_VALUE)) {
foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $key => $valid) {
if ((int)$valid['cnt'] == 0) {
unset (self::$_FREQUENCYS[$_sequence]['valid'][$key]);
@@ -973,19 +1021,24 @@ class SurveyAnalysis {
# koliko zapisov prikažemo naenkrat
$num_show_records = self::getNumRecords();
- echo '<div id="freq_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_analiza_holder">';
- self::displaySpremenljivkaIcons($spid);
+ echo '<div id="freq_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt'])?self::$_CURRENT_LOOP['cnt']:'').'" class="div_analiza_holder">';
+
+ self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
+ echo '<table class="table_freq">';
+
# naslovna vrstica
- echo '<tr>';
+ echo '<tr class="row1">';
+
#variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<td class="cell_var">';
self::showVariable($spid,$spremenljivka['variable']);
echo '</td>';
+
#odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? 7 : 5).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 7 : 5).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if($spremenljivka['tip'] == 2){
echo ' <span class="anl_variabla_info">('.$lang['srv_info_checkbox'].')</span>';
}
@@ -1004,137 +1057,178 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo'</td>';
+
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row2">';
+
#variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
+ echo '<td class="cell_icons cell_icons'.$spid.'" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,'freq');
+ echo ' </div>';
echo '</td>';
+
+
#odgovori
+ echo '<td class="cell_question">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
+
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+
echo '</tr>';
// konec naslovne vrstice
+
+
// zeleno vrstico prikažemo samo skupaj z legendo
- if (self::$_SHOW_LEGENDA && $inline_legenda && in_array($spremenljivka['tip'],array(1,4,8)) ) {
- $css_bck = 'anl_bck_0_0 ';
- echo '<tr >';
- echo '<td class="anl_bl anl_bb anl_br anl_al '.$css_bck.'link_no_decoration">&nbsp;</td>';
- echo '<td class="anl_bb anl_br anl_al '.$css_bck.'">&nbsp;</td>';
-
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq anl_w90">'.$_tip.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq anl_w90">'.$_oblika.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+ if (self::$_SHOW_LEGENDA && $inline_legenda && in_array($spremenljivka['tip'], array(1,4,8)) ) {
+
+ echo '<tr class="row3">';
+
+ echo '<td>&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
+
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
+
+ echo '<td>&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
}
- echo '<td class="anl_bb '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
+
echo '</tr>';
}
+
+
$_answersOther = array();
# dodamo opcijo kje izrisujemo legendo
- $options=array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
+ $options = array(
+ 'inline_legenda' => $inline_legenda,
+ 'isTextAnswer' => false,
+ 'isOtherAnswer' => false,
+ 'num_show_records' => $num_show_records
+ );
# izpišemo vlejavne odgovore
$_current_grid = null;
- if (count($spremenljivka['grids']) > 0)
+ if (count($spremenljivka['grids']) > 0){
+
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_variables_count = count($grid['variables']);
-
- # indikator da smo na prvi variabli
- $first_variable = true;
-
- # dodamo še kontrolo za prikaz mgridov in mcheckov za več kot 20 vrednosti
- if ((!is_array($gidsCanShow) && !isset($gidsCanShow[$gid]))
- || (is_array($gidsCanShow) && isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true))
- # dodamo dodatne vrstice z albelami grida
- if ($_variables_count > 0 )
- foreach ($grid['variables'] AS $vid => $variable ){
- $_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
-
- if (($variable['text'] != true && $variable['other'] != true)
- || (in_array($spremenljivka['tip'],array(4,8,21,22,25,26,27)))){
- # dodamo ime podvariable
- //if ($_variables_count > 1 && in_array($spremenljivka['tip'],array(2,6,7,16,17,18,19,20,21))) {
- if ($inline_legenda) {
- # ali rišemo dvojno črto med grupami
- if ( $_current_grid != $gid && $_current_grid !== null && $spremenljivka['tip'] != 6&& $spremenljivka['tip'] != 16) {
- $options['doubleTop'] = true;
- } else {
- $options['doubleTop'] = false;
- }
- if ($first_variable == true && $spremenljivka['tip'] == 16) {
- if ($_current_grid !== null) {
- $options['doubleTop'] = true;
- }
- self::outputSubGridVertical($spremenljivka,$variable,$grid,$spid,$options);
- $options['doubleTop'] = false;
- }
- $_current_grid = $gid;
- self::outputSubVariablaVertical($spremenljivka,$variable,$grid,$spid,$options);
- }
- $counter = 0;
- $_kumulativa = 0;
-
-
- #po potrebi posortiramo podatke
- if ($spremenljivka['tip'] == 7 && is_array(self::$_FREQUENCYS[$_sequence]['valid'])) {
- ksort(self::$_FREQUENCYS[$_sequence]['valid']);
- }
- //self::$_FREQUENCYS[$_sequence]
- if (count(self::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
- # tekstovne odgovore posortiramo kronološko
- if ($spremenljivka['tip'] == 21 || $spremenljivka['tip'] == 4) {
- $_valid_answers = self :: sortTextValidAnswers($spid,$variable,self::$_FREQUENCYS[$_sequence]['valid']);
- } else {
- $_valid_answers = self::$_FREQUENCYS[$_sequence]['valid'];
- }
- foreach ($_valid_answers AS $vkey => $vAnswer) {
- if ($counter < $num_show_records) {
- if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0
- if (in_array($spremenljivka['tip'],array(4,7,8,19,20,21,26,27))) { // text, number, datum, mtext, mnumber, text*, lokacija,heatmap
- $options['isTextAnswer'] = true;
- } else {
- $options['isTextAnswer'] = false;
- }
- $counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);
- }
- }
- }
- # izpišemo sumo veljavnih
- $counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
- }
- if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
- if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
- $counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
- }
- }
- # izpišemo sumo veljavnih
- $counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
- }
- #izpišemo še skupno sumo
- $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);
- } else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
- }
- $first_variable = false;
- }
- }
+ $_variables_count = count($grid['variables']);
+
+ # indikator da smo na prvi variabli
+ $first_variable = true;
+
+ # dodamo še kontrolo za prikaz mgridov in mcheckov za več kot 20 vrednosti
+ if (!isset($gidsCanShow[$gid]) || (is_array($gidsCanShow) && isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true)){
+
+ # dodamo dodatne vrstice z albelami grida
+ if ($_variables_count > 0 ){
+ foreach ($grid['variables'] AS $vid => $variable ){
+
+ $_sequence = $variable['sequence']; # id kolone z podatki
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if (($variable['text'] != true && $variable['other'] != true)
+ || (in_array($spremenljivka['tip'],array(4,8,21,22,25,26,27)))){
+
+ # dodamo ime podvariable
+ if ($inline_legenda) {
+
+ # ali rišemo dvojno črto med grupami
+ if ( $_current_grid != $gid && $_current_grid !== null && $spremenljivka['tip'] != 6&& $spremenljivka['tip'] != 16) {
+ $options['doubleTop'] = true;
+ }
+ else {
+ $options['doubleTop'] = false;
+ }
+
+ if ($first_variable == true && $spremenljivka['tip'] == 16) {
+ if ($_current_grid !== null) {
+ $options['doubleTop'] = true;
+ }
+
+ self::outputSubGridVertical($spremenljivka,$variable,$grid,$spid,$options);
+ $options['doubleTop'] = false;
+ }
+
+ $_current_grid = $gid;
+ self::outputSubVariablaVertical($spremenljivka,$variable,$grid,$spid,$options);
+ }
+
+ $counter = 0;
+ $_kumulativa = 0;
+
+
+ # po potrebi posortiramo podatke
+ if ($spremenljivka['tip'] == 7 && is_array(self::$_FREQUENCYS[$_sequence]['valid'])) {
+ ksort(self::$_FREQUENCYS[$_sequence]['valid']);
+ }
+
+ if (is_countable(isset(self::$_FREQUENCYS[$_sequence]['valid'])?self::$_FREQUENCYS[$_sequence]['valid']:0) && count(isset(self::$_FREQUENCYS[$_sequence]['valid'])?self::$_FREQUENCYS[$_sequence]['valid']:0)> 0 ) {
+ # tekstovne odgovore posortiramo kronološko
+ if ($spremenljivka['tip'] == 21 || $spremenljivka['tip'] == 4) {
+ $_valid_answers = self :: sortTextValidAnswers($spid,$variable,self::$_FREQUENCYS[$_sequence]['valid']);
+ }
+ else {
+ $_valid_answers = self::$_FREQUENCYS[$_sequence]['valid'];
+ }
+
+ foreach ($_valid_answers AS $vkey => $vAnswer) {
+ if ($counter < $num_show_records) {
+ if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0
+ if (in_array($spremenljivka['tip'],array(4,7,8,19,20,21,26,27))) { // text, number, datum, mtext, mnumber, text*, lokacija,heatmap
+ $options['isTextAnswer'] = true;
+ } else {
+ $options['isTextAnswer'] = false;
+ }
+ $counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);
+ }
+ }
+ }
+
+ # izpišemo sumo veljavnih
+ $counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
+ }
+ if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
+ if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
+ $counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
+ }
+ }
+ # izpišemo sumo veljavnih
+ $counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
+ }
+ #izpišemo še skupno sumo
+ $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);
+ }
+ else {
+ $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ }
+
+ $first_variable = false;
+ }
+ }
+ }
+ }
+ }
echo '</table>';
@@ -1147,73 +1241,85 @@ class SurveyAnalysis {
}
}
echo '</div>';
- echo '<br />';
}
static function outputSubGridVertical($spremenljivka,$variable,$grid,$spid,$_options = array()) {
global $lang;
+
# opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'doubleTop' =>false, # ali imamo novo grupa in nardimo dvojni rob
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- $css_bck = 'anl_bck_freq_2 ';
- echo '<tr'.($options['doubleTop'] ? ' class="anl_double_bt"' : '').'>';
- echo '<td class="anl_bl anl_bb anl_br anl_ac '.$css_bck.'anl_variabla_sub">';
+ echo '<tr class="row_grid">';
+
+ echo '<td class="cell_var">';
echo $grid['variable'];
- #echo $variable['variable'];
echo '</td>';
- echo '<td class="anl_bb anl_br anl_al '.$css_bck.'">';
- // echo $grid['naslov'] . ' - ' .$variable['naslov'];
+
+ echo '<td class="cell_question">';
echo $grid['naslov'];
- #echo $variable['naslov'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
- if ($variable['other'] != '1' && $variable['text'] != '1') {
+
+ if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq">'.$_tip.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq">'.$_oblika.'</td>';
+
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+
+ echo '<td>&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
}
- echo '<td class="anl_bb '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
+
echo '</tr>';
}
+
static function outputSubVariablaVertical($spremenljivka,$variable,$grid,$spid,$_options = array()) {
global $lang;
+
# opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
'doubleTop' =>false, # ali imamo novo grupa in nardimo dvojni rob
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- $css_bck = 'anl_bck_freq_2 ';
- echo '<tr'.($options['doubleTop'] ? ' class="anl_double_bt"' : '').'>';
- echo '<td class="anl_bl anl_bb anl_br anl_ac '.$css_bck.'anl_variabla_sub">';
+
+ echo '<tr class="row_question">';
+
+ echo '<td class="cell_var">';
echo $variable['variable'];
echo '</td>';
- echo '<td class="anl_bb anl_br anl_al '.$css_bck.'">';
- // echo $grid['naslov'] . ' - ' .$variable['naslov'];
+
+ echo '<td class="cell_question">';
echo $variable['naslov'];
- echo ($spremenljivka['enota'] == 1) ? ' - '.$variable['naslov2'] : '';
+ echo (isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1) ? ' - '.$variable['naslov2'] : '';
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -1222,15 +1328,17 @@ class SurveyAnalysis {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq">'.$_tip.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+
+ echo '<td>&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
}
- echo '<td class="anl_bb '.$css_bck.' anl_w70">&nbsp;</td>';
+ echo '<td>&nbsp;</td>';
+
echo '</tr>';
}
@@ -1268,21 +1376,22 @@ class SurveyAnalysis {
*/
static function displaySums($_spid = null) {
global $site_path;
- # preberemo header
+
+ # preberemo header
if (self::$headFileName === null ) {
// die ('<div>NAPAKA!!! Manjkajo datoteke s podatki. <a href="#" onClick="createCollectData();return false;">Kreiraj datoteke s podatki!</a></div>');
- } else {
+ }
+ else {
#preberemo HEADERS iz datoteke
if (self::$headFileName == null) {
echo "<br><b>Napaka</b>";
die();
}
+
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
# odstranimo sistemske variable tipa email, ime, priimek, geslo
self::removeSystemVariables();
- #print_r("<pre>");
- #print_r(self::$_HEADERS);
- #print_r("</pre>");
+
# polovimo frekvence
self::getFrequencys();
$vars_count = count(self::$_FILTRED_VARIABLES);
@@ -1292,121 +1401,118 @@ class SurveyAnalysis {
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
# preverjamo ali je meta
if (
- ($spremenljivka['tip'] != 'm'
+ (isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], self::$_FILTRED_TYPES )
)
&& (!isset($_spid) || (isset($_spid) && $_spid == $spid))
)
{
# ali imamo sfiltrirano spremenljivko
- if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) )
- {
+ if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) ){
echo $line_break;
- #print_r($spremenljivka['tip']);
- # prikazujemo v odvisnosti od kategorije spremenljivke
-
- switch ($spremenljivka['tip']) {
- case 1:
- # radio - prikjaže navpično
- self::sumVertical($spid,'sums');
-
- break;
- case 2:
- #checkbox če je dihotomna:
- //self::sumHorizontalCheckbox($spid);
- self::sumVerticalCheckbox($spid,'sums');
- break;
- case 3:
- # dropdown - prikjaže navpično
- self::sumVertical($spid,'sums');
- break;
-
- case 6:
-
- if ($spremenljivka['enota'] != 3) {
- # multigrid
- self::sumHorizontal($spid,'sums');
- } else {
- #imamo dvojni mgrid
- self::sumDoubleHorizontal($spid,'sums*');
- }
- break;
- case 16:
- #multicheckbox če je dihotomna:
- self::sumMultiHorizontalCheckbox($spid,'sums');
- break;
- case 17:
-
- #razvrščanje če je ordinalna
- self::sumHorizontal($spid,'sums');
- break;
- case 4: # text
- case 8: # datum
- # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
- self::sumTextVertical($spid,'sums');
- break;
- case 21: # besedilo*
- # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
- if ($spremenljivka['cnt_all'] == 1) {
- // če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- self::sumTextVertical($spid,'sums');
- } else {
- self::sumMultiText($spid,'sums');
- }
- break;
- case 19: # multitext
- self::sumMultiText($spid,'sums');
- break;
- case 7:
- case 18:
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumNumberVertical($spid,'sums');
- break;
- case 20:
- # Če je v gridu le ene variabla naj bo default prikazan f* in ne SUMA
- if ($spremenljivka['grids'][0]['cnt_vars'] == 1 ) {
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumMultiNumberVertical($spid,'sums');
+ # prikazujemo v odvisnosti od kategorije spremenljivke
+ switch ($spremenljivka['tip']) {
+ case 1:
+ # radio - prikjaže navpično
+ self::sumVertical($spid,'sums');
+
+ break;
+ case 2:
+ #checkbox če je dihotomna:
+ //self::sumHorizontalCheckbox($spid);
+ self::sumVerticalCheckbox($spid,'sums');
+ break;
+ case 3:
+ # dropdown - prikjaže navpično
+ self::sumVertical($spid,'sums');
+ break;
+
+ case 6:
- } else {
+ if (!isset($spremenljivka['enota']) || $spremenljivka['enota'] != 3) {
+ # multigrid
+ self::sumHorizontal($spid,'sums');
+ } else {
+ #imamo dvojni mgrid
+ self::sumDoubleHorizontal($spid,'sums*');
+ }
+ break;
+ case 16:
+ #multicheckbox če je dihotomna:
+ self::sumMultiHorizontalCheckbox($spid,'sums');
+ break;
+ case 17:
+
+ #razvrščanje če je ordinalna
+ self::sumHorizontal($spid,'sums');
+ break;
+ case 4: # text
+ case 8: # datum
+ # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
+ self::sumTextVertical($spid,'sums');
+ break;
+ case 21: # besedilo*
+ # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
+ if ($spremenljivka['cnt_all'] == 1) {
+ // če je enodimenzionalna prikažemo kot frekvence
+ // predvsem zaradi vprašanj tipa: language, email...
+ self::sumTextVertical($spid,'sums');
+ } else {
+ self::sumMultiText($spid,'sums');
+ }
+ break;
+ case 19: # multitext
+ self::sumMultiText($spid,'sums');
+ break;
+ case 7:
+ case 18:
+ # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
+ self::sumNumberVertical($spid,'sums');
+ break;
+ case 20:
+
+ # Če je v gridu le ene variabla naj bo default prikazan f* in ne SUMA
+ if ($spremenljivka['grids'][0]['cnt_vars'] == 1 ) {
+ # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
+ self::sumMultiNumberVertical($spid,'sums');
+
+ } else {
+
+ # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
+ self::sumMultiNumber($spid,'sums');
+ }
+ break;
+ case 22:
+ case 25:
+ # kalkulacija
+ self::sumNumberVertical($spid,'sums');
+ break;
+ case 26:
+ # lokacija
+ self::sumMultiText($spid,'sums');
+ break;
+ case 27:
+ # heatmap
+ self::sumMultiTextHeatMap($spid,'sums',true, true);
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumMultiNumber($spid,'sums');
+ break;
+ case 5:
+ # nagovor
+ self::sumNagovor($spid,'sums');
+ break;
+ default:
+ print_r("TODO: Sums for type:".$spremenljivka['tip']);
+ break;
}
- break;
- case 22:
- case 25:
- # kalkulacija
- self::sumNumberVertical($spid,'sums');
- break;
- case 26:
- # lokacija
- self::sumMultiText($spid,'sums');
- break;
- case 27:
- # heatmap
- self::sumMultiTextHeatMap($spid,'sums',true, true);
-
- break;
- case 5:
- # nagovor
- self::sumNagovor($spid,'sums');
- break;
- default:
- print_r("TODO: Sums for type:".$spremenljivka['tip']);
- break;
- }
-
- }
+ }
- } // end if $spremenljivka['tip'] != 'm'
- } // end foreach self::$_HEADERS
-
- // Izrisemo ikone na dnu
- if ( (!isset($_spid) || $_spid == null) && (!is_countable(self::$_LOOPS) || count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
- self::displayBottomSettings('sums');
+ } // end if $spremenljivka['tip'] != 'm'
+ } // end foreach self::$_HEADERS
+
+ // Izrisemo ikone na dnu
+ if ( (!isset($_spid) || $_spid == null) && (!is_countable(self::$_LOOPS) || count(self::$_LOOPS) == 0 || self::$_CURRENT_LOOP['cnt'] == count(self::$_LOOPS)) && ($_GET['m'] != 'analysis_creport') )
+ self::displayBottomSettings('sums');
} // end if else ($_headFileName == null)
}
@@ -1416,10 +1522,12 @@ class SurveyAnalysis {
*/
static function displaySumsNew($_spid = null) {
global $site_path;
+
# preberemo header
if (self::$headFileName === null ) {
// die ('<div>NAPAKA!!! Manjkajo datoteke s podatki. <a href="#" onClick="createCollectData();return false;">Kreiraj datoteke s podatki!</a></div>');
- } else {
+ }
+ else {
#preberemo HEADERS iz datoteke
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
@@ -1432,103 +1540,81 @@ class SurveyAnalysis {
$vars_count = count(self::$_FILTRED_VARIABLES);
$line_break = '';
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- # preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
- && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES ))
- && (!isset($_spid) || (isset($_spid) && $_spid == $spid))) {
- # ali imamo sfiltrirano spremenljivko
- if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) ) {
- echo $line_break;
- if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
- }
-
- self::displaySpremenljivkaIcons($spid);
-
- # prikazujemo v odvisnosti od kategorije spremenljivke
- switch ($spremenljivka['tip']) {
- case 1:
- # radio - prikjaže navpično
- self::sumHorizontal($spid,'sums*');
- break;
- case 2:
- #checkbox če je dihotomna:
- #self::sumVerticalCheckbox($spid,'sums*');
- self::sumHorizontalCheckbox($spid,'sums*');
- break;
- case 3:
- # dropdown - prikjaže navpično
- self::sumVertical($spid,'sums*');
- break;
- case 6:
- # multigrid
- self::sumHorizontal($spid,'sums');
- /*
- if ($spremenljivka['enota'] != 3) {
- # multigrid
- self::sumHorizontal($spid,'sums');
- } else {
- #imamo dvojni mgrid
- self::sumDoubleHorizontal($spid,'sums*');
- }
- */
- break;
- case 16:
- #multicheckbox če je dihotomna:
- self::sumVerticalCheckbox($spid,'sums*');
- break;
- case 17:
- #razvrščanje če je ordinalna
- self::sumHorizontal($spid,'sums*');
- break;
- case 4: # text
- case 8: # datum
- case 19: # multitext
- case 21: # besedilo*
- # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
- self::sumTextVertical($spid,'sums*');
- break;
- case 7:
- case 18:
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumNumberVertical($spid,'sums*');
- break;
- case 20:
- self::sumMultiNumberVertical($spid,'sums*');
- /*
- # Če je v gridu le ene variabla naj bo default prikazan f* in ne SUMA
- if ($spremenljivka['grids'][0]['cnt_vars'] == 1) {
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumMultiNumberVertical($spid,'sums');
-
- } else {
- # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
- self::sumMultiNumber($spid,'sums');
- }
- */
- break;
- case 26:
- # lokacija
- self::sumMultiText($spid,'sums');
- break;
- case 27:
- # heatmap
- self::sumMultiTextHeatMap($spid,'sums',true, true);
- break;
- case 5:
- # nagovor
- self::sumNagovor($spid,'sums*');
- break;
-
- }
- if (self :: $show_spid_div == true) {
- echo '</div>'; // id="sum_'.$keyGrupe.'">';
- }
- $line_break = "<br/>";
- }
+ # preverjamo ali je meta
+ if (($spremenljivka['tip'] != 'm' && in_array($spremenljivka['tip'], self::$_FILTRED_TYPES )) && (!isset($_spid) || (isset($_spid) && $_spid == $spid))) {
+
+ # ali imamo sfiltrirano spremenljivko
+ if ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) ) {
- } // end if $spremenljivka['tip'] != 'm'
+ echo $line_break;
+
+ if (self :: $show_spid_div == true) {
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
+ }
+
+ # prikazujemo v odvisnosti od kategorije spremenljivke
+ switch ($spremenljivka['tip']) {
+ case 1:
+ # radio - prikjaže navpično
+ self::sumHorizontal($spid,'sums*');
+ break;
+ case 2:
+ #checkbox če je dihotomna:
+ self::sumHorizontalCheckbox($spid,'sums*');
+ break;
+ case 3:
+ # dropdown - prikjaže navpično
+ self::sumVertical($spid,'sums*');
+ break;
+ case 6:
+ # multigrid
+ self::sumHorizontal($spid,'sums');
+ break;
+ case 16:
+ #multicheckbox če je dihotomna:
+ self::sumVerticalCheckbox($spid,'sums*');
+ break;
+ case 17:
+ #razvrščanje če je ordinalna
+ self::sumHorizontal($spid,'sums*');
+ break;
+ case 4: # text
+ case 8: # datum
+ case 19: # multitext
+ case 21: # besedilo*
+ # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
+ self::sumTextVertical($spid,'sums*');
+ break;
+ case 7:
+ case 18:
+ # variabla tipa »število« je v sumarniku identična kot v DESCRIPTIVES.
+ self::sumNumberVertical($spid,'sums*');
+ break;
+ case 20:
+ self::sumMultiNumberVertical($spid,'sums*');
+ break;
+ case 26:
+ # lokacija
+ self::sumMultiText($spid,'sums');
+ break;
+ case 27:
+ # heatmap
+ self::sumMultiTextHeatMap($spid,'sums',true, true);
+ break;
+ case 5:
+ # nagovor
+ self::sumNagovor($spid,'sums*');
+ break;
+
+ }
+ if (self :: $show_spid_div == true) {
+ echo '</div>'; // id="sum_'.$keyGrupe.'">';
+ }
+
+ $line_break = "<br/>";
+ }
+ } // end if $spremenljivka['tip'] != 'm'
} // end foreach self::$_HEADERS
} // end if else ($_headFileName == null)
}
@@ -1550,7 +1636,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -1567,7 +1655,7 @@ class SurveyAnalysis {
$options=array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
@@ -1582,16 +1670,20 @@ class SurveyAnalysis {
}
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
+ // echo '<script src="https://kit.fontawesome.com/c5e58c7f60.js" crossorigin="anonymous"></script>';
+ echo '<table class="table_sums sums_vertical">';
+
# naslovna vrstica
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<tr class="row1">';
+
+ # variabla
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
+
#odgovori
$show_valid_percent = (self::$_HEADERS[$spid]['show_valid_percent'] == true) ? 1 : 0;
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? (4+((int)$inline_legenda * 2)+$show_valid_percent) : (4+$show_valid_percent)).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? (4+((int)$inline_legenda * 2)+$show_valid_percent) : (4+$show_valid_percent)).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
@@ -1607,109 +1699,105 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
+
+ echo '<tr class="row2">';
+
+ # variabla - en odgovor
+ echo '<td class="cell_icons cell_icons'.$spid.' en_odgovor" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
- #odgovori
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
+ # odgovori
+ echo '<td class="cell_question">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+
echo '</tr>';
// konec naslovne vrstice
- // zeleno vrstico prikažemo samo skupaj z legendo
- if (self::$_SHOW_LEGENDA && false) {
- $css_bck = 'anl_bck_0_0 ';
- echo '<tr >';
- echo '<td class="anl_bl anl_bb anl_br anl_al '.$css_bck.'link_no_decoration">&nbsp;</td>';
- echo '<td class="anl_bb anl_br anl_al '.$css_bck.'">&nbsp;</td>';
- if ($variable['other'] != '1' && $variable['text'] != '1') {
- $_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
- $_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
- $_tip = $lang['srv_analiza_vrsta_bese'];
- $_oblika = $lang['srv_analiza_oblika_nomi'];
- }
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq anl_w90">'.$_tip.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_ac anl_legend anl_legenda_freq anl_w90">'.$_oblika.'</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_bb anl_br '.$css_bck.' anl_w70">&nbsp;</td>';
- }
- echo '<td class="anl_bb '.$css_bck.' anl_w70">&nbsp;</td>';
- echo '</tr>';
- }
$_answersOther = array();
$sum_xi_fi=0;
$N = 0;
-
+
$_tmp_for_div = array();
+
# izpišemo vlejavne odgovore
- if (count($spremenljivka['grids']) > 0)
+ if (count($spremenljivka['grids']) > 0){
+
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- # dodamo dodatne vrstice z albelami grida
- if (count($grid['variables']) > 0 )
- foreach ($grid['variables'] AS $vid => $variable ){
- $_sequence = $variable['sequence']; # id kolone z podatki
- if ($variable['text'] != true && $variable['other'] != true) {
- $counter = 0;
- $_kumulativa = 0;
- //self::$_FREQUENCYS[$_sequence]
- if (count(self::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
- // za povprečje
- $xi = (int)$vkey;
- $fi = (int)$vAnswer['cnt'];
+
+ # dodamo dodatne vrstice z albelami grida
+ if (count($grid['variables']) > 0 ){
- $sum_xi_fi += $xi * $fi;
- $N += $fi;
-
- if ($counter < $num_show_records) {
- if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0
- $counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);
- }
- }
- # za poznejše računannje odklona
- $_tmp_for_div[] = array('xi'=>$xi, 'fi'=>$fi, 'sequence'=>$_sequence);
- }
- # izpišemo sumo veljavnih
- $counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
+ foreach ($grid['variables'] AS $vid => $variable ){
- }
- if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
- if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
- $counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
- }
- }
- # izpišemo sumo veljavnih
- $counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
- }
- #izpišemo še skupno sumo
- $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);
- } else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
- }
- }
- }
+ $_sequence = $variable['sequence']; # id kolone z podatki
+
+ if ($variable['text'] != true && $variable['other'] != true) {
+ $counter = 0;
+ $_kumulativa = 0;
+
+ if (count(self::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
+ // za povprečje
+ $xi = (int)$vkey;
+ $fi = (int)$vAnswer['cnt'];
+
+ $sum_xi_fi += $xi * $fi;
+ $N += $fi;
+
+ if ($counter < $num_show_records) {
+ if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0
+ $counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);
+ }
+ }
+ # za poznejše računannje odklona
+ $_tmp_for_div[] = array('xi'=>$xi, 'fi'=>$fi, 'sequence'=>$_sequence);
+ }
+ # izpišemo sumo veljavnih
+ $counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
+
+ }
+
+ if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
+ if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
+ $counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
+ }
+ }
+ # izpišemo sumo veljavnih
+ $counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
+ }
+
+ #izpišemo še skupno sumo
+ $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);
+ }
+ else {
+ $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ }
+ }
+ }
+ }
+ }
# odklon
$avg = ($N > 0) ? $sum_xi_fi / $N : 0;
+
#standardna diviacija
$div = 0;
$sum_pow_xi_fi_avg = 0;
@@ -1719,23 +1807,30 @@ class SurveyAnalysis {
$sum_pow_xi_fi_avg += pow(($xi - $avg),2) * $fi;
}
+
$div = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
# izpišemo še odklon in povprečje
if ($show_valid_percent == 1 && self::$_HEADERS[$spid]['skala'] != 1) {
- $css_bck = 'anl_bck';
- echo '<tr >';
- echo '<td class="cll_clps" style="font-size: 1px; height:2px; line-height:3px; border-right: 1px solid white;" colspan="'.(self::$_SHOW_LEGENDA ? 6+((int)$inline_legenda*2) : 6+((int)$inline_legenda*2)).'">&nbsp;</td>';
- echo '</tr>';
- echo '<tr >';
- echo '<td class="anl_br" colspan="'.(self::$_SHOW_LEGENDA ? 2+((int)$inline_legenda*2) : 2+((int)$inline_legenda*2)).'">&nbsp;</td>';
- echo '<td class="anl_bb anl_bt anl_br anl_p5 anl_ac anl_variabla_line '.$css_bck.'">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
- echo '<td class="anl_bb anl_bt anl_br anl_ac '.$css_bck.'">'. self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'').'</td>';
- echo '<td class="anl_bb anl_bt anl_br anl_p5 anl_ac anl_variabla_line '.$css_bck.'">'.$lang['srv_analiza_opisne_odklon'].'</td>';
- echo '<td class="anl_bb anl_bt anl_ac '.$css_bck.'">'.self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'').'</td>';
+
+ echo '<tr>';
+ echo '<td class="cell_space" colspan="'.(self::$_SHOW_LEGENDA ? 6+((int)$inline_legenda*2) : 6+((int)$inline_legenda*2)).'">&nbsp;</td>';
echo '</tr>';
+
+ echo '<tr class="row_bottom">';
+
+ echo '<td class="cell_empty" colspan="'.(self::$_SHOW_LEGENDA ? 2+((int)$inline_legenda*2) : 2+((int)$inline_legenda*2)).'"></td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
+ echo '<td class="cell_value">'. self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'').'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_odklon'].'</td>';
+ echo '<td class="cell_value">'.self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'').'</td>';
+
+ echo '</tr>';
}
+
echo '</table>';
+
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
@@ -1746,7 +1841,6 @@ class SurveyAnalysis {
}
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -1792,104 +1886,137 @@ class SurveyAnalysis {
# ugotovimo koliko imamo kolon
$gid=0;
- $_clmn_cnt = self::$_HEADERS[$spid]['grids'][$gid]['cnt_vars']-self::$_HEADERS[$spid]['grids'][$gid]['cnt_other'];
+
+ if(isset(self::$_HEADERS[$spid]['grids'][$gid]['cnt_other']))
+ $_clmn_cnt = self::$_HEADERS[$spid]['grids'][$gid]['cnt_vars'] - self::$_HEADERS[$spid]['grids'][$gid]['cnt_other'];
+ else
+ $_clmn_cnt = self::$_HEADERS[$spid]['grids'][$gid]['cnt_vars'];
+
# tekst vprašanja
$css_hide_enote = isset($_POST['navedbe']) && $_POST['navedbe'] == '1' ? ' displayNone' : '';
$css_hide_navedbe = isset($_POST['navedbe']) && $_POST['navedbe'] == '1' ? '' : ' displayNone';
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
# odgovori
echo '<div id="div_navedbe_1_'.$spid.'" class="'.$css_hide_enote.'">';
- echo '<table class="anl_tbl anl_ba tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_bck_desc_1">';
+
+ echo '<table class="table_sums sums_hor_checkbox navedbe1">';
+
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_al anl_bck anl_bb anl_bck_desc_1" colspan="'. ($_clmn_cnt+(self::$_SHOW_LEGENDA ? 5 : 3)) .'">';
+
+ echo '<td class="cell_question" colspan="'. ($_clmn_cnt+(self::$_SHOW_LEGENDA ? 5 : 3)) .'">';
echo '<span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type">&nbsp;&nbsp;<span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
- // echo '<span name="span_show_navedbe_1_'.$spid.'" class="span_navedbe"><a href="javascript:show_navedbe(\''.$spid.'\',\'3\');">&nbsp;(<span class="blue">'.$lang['srv_analiza_opisne_answers'].'&nbsp;</span>/<span class="blue">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_2_'.$spid.'" class="span_navedbe'.$css_hide_enote.'"><a href="javascript:show_navedbe(\''.$spid.'\',\'2\');">&nbsp;(<span class="blue" title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_3_'.$spid.'" class="span_navedbe'.$css_hide_navedbe.'"><a href="javascript:show_navedbe(\''.$spid.'\',\'1\');">&nbsp;(<span title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span class="blue" title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '</td>';
+
+ // Preklop navedbe/enote
+ self::showEnoteNavedbe($spid, $status='1');
+
+ echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb">';
+
+
+ echo '<tr class="row2">';
+
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.'" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>false));
+ echo ' </div>';
echo '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line">';
+
+ echo '<td class="cell_subquestion">';
echo $lang['srv_analiza_opisne_subquestion'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
- }
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" colspan="'.($_clmn_cnt).'">';
- echo $lang['srv_analiza_opisne_answers'].'&nbsp;';
- echo '<span id="img_analysis_f_p_1_'.$spid.'" class="img_analysis_f_p"><a href="javascript:show_single_percent(\''.$spid.'\',\'2\');">&nbsp;(<span class="blue">f&nbsp;</span>/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '<span id="img_analysis_f_1_'.$spid.'" class="img_analysis_f displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'1\');">&nbsp;(<span class="blue">f&nbsp;</span>/&nbsp;%)</a></span>';
- echo '<span id="img_analysis_p_1_'.$spid.'" class="img_analysis_p displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'0\');">&nbsp;(f&nbsp;/<span class="blue">&nbsp;%</span>)</a></span>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ }
+
+ echo '<td class="cell_grid freq-p_cell" colspan="'.($_clmn_cnt).'">';
+ echo $lang['srv_analiza_opisne_answers'];
+ self::showFreqPercent($spid);
echo '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_valid'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_num_units'].'</td>';
+
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_num_units'].'</td>';
+
echo '</tr>';
- $bck_css = ' anl_bck_0_0';
+
$_variables = self::$_HEADERS[$spid]['grids'][$gid]['variables'];
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb'.$bck_css .'">&nbsp;</td>';
- echo '<td class="anl_bl anl_br anl_bb'.$bck_css .'">&nbsp;</td>';
- if (self::$_SHOW_LEGENDA) {
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+
+ echo '<td class="cell_subquestion"></td>';
+
+ if (self::$_SHOW_LEGENDA) {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">&nbsp;</td>'; //'.$_tip.'
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">&nbsp;</td>'; // '.$_oblika.'
+ echo '<td class="cell_info"></td>'; //'.$_tip.'
+ echo '<td class="cell_info"></td>'; // '.$_oblika.'
}
+
if (count($_variables) > 0) {
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
- echo '<td class="anl_bb anl_ac anl_dash_br'.$bck_css.'">' . $variable['naslov'].' ('.$variable['gr_id']. ') </td>';
+ echo '<td class="cell_grid">' . $variable['naslov'].' ('.$variable['gr_id']. ') </td>';
}
}
}
- //echo '<td class="anl_bb anl_ac anl_br red'.$bck_css.'">' . $lang['srv_anl_suma1'] . '</td>';
- echo '<td class="anl_bb anl_br anl_bl anl_ac'.$bck_css.'">'. $_valid_cnt .'</td>';
- echo '<td class="anl_bb anl_bl anl_br anl_ac'.$bck_css.'">'.$_approp_cnt. '</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
+
+
+ # vodoravna vrstice s podatki
foreach (self::$_HEADERS[$spid]['grids'] AS $gid => $grids) {
if ($gidsCanShow[$gid]) {
$_cnt = 0;
- # vodoravna vrstice s podatki
- $css_back = ' anl_bck_desc_2';
- echo '<tr>';
- echo '<td class="anl_br anl_bt anl_ac anl_variabla_sub'.$css_back.'">'.$grids['variable'].'</td>';
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$grids['naslov'].'</td>';
- if (self::$_SHOW_LEGENDA) {
+
+
+ echo '<tr class="row_var">';
+
+ echo '<td class="cell_var">'.$grids['variable'].'</td>';
+ echo '<td class="cell_subquestion">'.$grids['naslov'].'</td>';
+
+ if (self::$_SHOW_LEGENDA) {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$_tip.'</td>';
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
$_arguments = 0;
$_max_appropriate = 0;
$_max_cnt = 0;
+
// prikaz frekvenc
if (count($grids['variables']) > 0)
foreach ($grids['variables'] AS $vkey => $variable) {
$_sequence = $variable['sequence'];
- $_valid = self::$_FREQUENCYS[$_sequence]['validCnt'];
+ $_valid = isset(self::$_FREQUENCYS[$_sequence]['validCnt']) ? self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
$_cnt = self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$_arguments += $_cnt;
@@ -1901,110 +2028,138 @@ class SurveyAnalysis {
}
if ($variable['other'] != true) {
- echo '<td class="anl_bb anl_dash_br anl_ac cll_clps '.$css_back.'">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr id="'.$spid.'_'.$_sequence.'" name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac' . (self::$enableInspect == true && (int)$_cnt > 0 ? ' mc_inspect' : '').'"'
- . (self::$enableInspect == true && (int)$_cnt > 0 ? ' vkey="1"' : '')
- .'" style="padding:5px 0px;">'.$_cnt.'</td>';
- echo '</tr>';
- echo '<tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
-
- $_percent = ($_valid > 0 ) ? $_cnt * 100 / $_valid : 0;
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr id="'.$spid.'_'.$_sequence.'" name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td>'.$_cnt.'</td>';
+ echo ' </tr>';
+
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>';
+ $_percent = ($_valid > 0 ) ? $_cnt * 100 / $_valid : 0;
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo ' </td>';
+ echo ' </tr>';
+ echo ' </table>';
echo '</td>';
}
}
+
# veljavno
- echo '<td class="anl_bt anl_ac anl_br anl_bl red'.$css_back.'">'.$_max_cnt.'</td>';
- #ustrezno
- echo '<td class="anl_bt anl_ac anl_br'.$css_back.'">'.$_max_appropriate.'</td>';
+ echo '<td class="cell_value">'.$_max_cnt.'</td>';
+
+ # ustrezno
+ echo '<td class="cell_value">'.$_max_appropriate.'</td>';
echo '</tr>';
}
}
+
echo '</table>';
+
echo '</div>';
+
# navedbe
echo '<div id="div_navedbe_2_'.$spid.'" class="div_navedbe'.$css_hide_navedbe.'">';
- echo '<table class="anl_tbl anl_ba tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_bck_desc_1">';
+
+ echo '<table class="table_sums sums_hor_checkbox navedbe2">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_al anl_bck anl_bb anl_bck_desc_1" colspan="'. ( $_clmn_cnt +(self::$_SHOW_LEGENDA ? 4 : 2)) .'">';
+
+ echo '<td class="cell_question" colspan="'. ( $_clmn_cnt +(self::$_SHOW_LEGENDA ? 4 : 2)) .'">';
echo '<span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type">&nbsp;&nbsp;<span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
- // echo '<span name="span_show_navedbe_1_'.$spid.'" class="span_navedbe"><a href="javascript:show_navedbe(\''.$spid.'\',\'3\');">&nbsp;(<span class="blue">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span class="blue">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_2_'.$spid.'" class="span_navedbe'.$css_hide_enote.'"><a href="javascript:show_navedbe(\''.$spid.'\',\'2\');">&nbsp;(<span class="blue" title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_3_'.$spid.'" class="span_navedbe'.$css_hide_navedbe.'"><a href="javascript:show_navedbe(\''.$spid.'\',\'1\');">&nbsp;(<span title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span class="blue" title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '</td>';
+
+ // Preklop navedbe/enote
+ self::showEnoteNavedbe($spid, $status='2');
+
+ echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb">';
- self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>true));
+
+
+ echo '<tr class="row2">';
+
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ // self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>true));
+ echo '<span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'_2\')" > </span>';
+ echo '<div class= "options displayNone" id="options'.$spid.'_2">';
+ self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>true));
+ echo '</div>'; //options
echo '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line">';
+
+
+ echo '<td class="cell_subquestion">';
echo $lang['srv_analiza_opisne_subquestion'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" colspan="'.($_clmn_cnt+1).'">';
- echo $lang['srv_analiza_opisne_arguments'].'&nbsp;';
- echo '<span id="img_analysis_f_p_2_'.$spid.'" class="img_analysis_f_p "><a href="javascript:show_single_percent(\''.$spid.'\',\'2\');">&nbsp(<span class="blue">f&nbsp;</span>/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '<span id="img_analysis_f_2_'.$spid.'" class="img_analysis_f displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'1\');">&nbsp(<span class="blue">f&nbsp;</span>/&nbsp;%)</a></span>';
- echo '<span id="img_analysis_p_2_'.$spid.'" class="img_analysis_p displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'0\');">&nbsp(f&nbsp;/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '</td>';
+ echo '<td class="cell_grid freq-p_cell" colspan="'.($_clmn_cnt+1).'">';
+ echo $lang['srv_analiza_opisne_arguments'];
+ self::showFreqPercent($spid);
+ echo '</td>';
+
echo '</tr>';
- $bck_css = ' anl_bck_0_0';
+
+
$_variables = self::$_HEADERS[$spid]['grids'][$gid]['variables'];
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb'.$bck_css .'">&nbsp;</td>';
- echo '<td class="anl_bl anl_br anl_bb'.$bck_css .'">&nbsp;</td>';
- if (self::$_SHOW_LEGENDA) {
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+ echo '<td class="cell_subquestion"></td>';
+ if (self::$_SHOW_LEGENDA) {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">&nbsp;</td>'; //'.$_tip.'
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">&nbsp;</td>'; // '.$_oblika.'
+ echo '<td class="cell_info"></td>'; //'.$_tip.'
+ echo '<td class="cell_info"></td>'; // '.$_oblika.'
}
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
- echo '<td class="anl_bb anl_ac anl_dash_br'.$bck_css.'">' . $variable['naslov'].' ('.$variable['gr_id']. ') </td>';
+ echo '<td class="cell_grid">' . $variable['naslov'].' ('.$variable['gr_id']. ') </td>';
}
}
- echo '<td class="anl_bb anl_ac anl_dash_br red'.$bck_css.'">' . $lang['srv_anl_suma1'] . '</td>';
+ echo '<td class="cell_grid">' . $lang['srv_anl_suma1'] . '</td>';
+
echo '</tr>';
+
+
+ # vodoravna vrstice s podatki
foreach (self::$_HEADERS[$spid]['grids'] AS $gid => $grids) {
$_cnt = 0;
- # vodoravna vrstice s podatki
- $css_back = ' anl_bck_desc_2';
+
echo '<tr>';
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$grids['variable'].'</td>';
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$grids['naslov'].'</td>';
+ echo '<td class="cell_var">'.$grids['variable'].'</td>';
+ echo '<td class="cell_subquestion">'.$grids['naslov'].'</td>';
if (self::$_SHOW_LEGENDA) {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$_tip.'</td>';
- echo '<td class="anl_br anl_bt'.$css_back.'">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
$_arguments = 0;
$_max_appropriate = 0;
$_max_cnt = 0;
+
// prikaz frekvenc
foreach ($grids['variables'] AS $vkey => $variable) {
$_sequence = $variable['sequence'];
@@ -2023,46 +2178,58 @@ class SurveyAnalysis {
$_percent = ($_valid > 0 ) ? $_cnt * 100 / $_valid : 0;
}
}
+
foreach ($grids['variables'] AS $vkey => $variable) {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
$_cnt = self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
- echo '<td class="anl_bb anl_dash_br anl_ac cll_clps '.$css_back.'">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr id="'.$spid.'_'.$_sequence.'" name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac' . (self::$enableInspect == true && (int)$_cnt > 0 ? ' mc_inspect' : '').'"'
- . (self::$enableInspect == true && (int)$_cnt > 0 ? ' vkey="1"' : '')
- .' style="padding:5px 0px;">'.$_cnt.'</td>';
- echo '</tr>';
- echo '<tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo '<table class="cell_table freq_row percent_row">';
+ echo ' <tr id="'.$spid.'_'.$_sequence.'" name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td class="' . (self::$enableInspect == true && (int)$_cnt > 0 ? ' mc_inspect' : '').'"'
+ . (self::$enableInspect == true && (int)$_cnt > 0 ? ' vkey="1"' : '')
+ .'>'.$_cnt.'</td>';
+ echo ' </tr>';
+
$_percent = ($_arguments > 0 ) ? $_cnt * 100 / $_arguments : 0;
+
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>';
echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
+ echo ' </td>';
+ echo ' </tr>';
+ echo '</table>';
echo '</td>';
}
}
- echo '<td class="anl_bb anl_ac anl_dash_br cll_clps '.$css_back.'">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac" style="padding:5px 0px;">'.$_arguments.'</td>';
- echo '</tr>';
- echo '<tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
+
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo '<table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td>'.$_arguments.'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>';
$_percent = ($_arguments > 0 ) ? $_arguments * 100 / $_arguments : 0;
- echo self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
+ echo self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo ' </td>';
+ echo ' </tr>';
+ echo '</table>';
+
echo '</td>';
+
echo '</tr>';
}
+
echo '</table>';
echo '</div>';
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
@@ -2073,7 +2240,6 @@ class SurveyAnalysis {
}
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -2083,6 +2249,7 @@ class SurveyAnalysis {
*/
static function sumHorizontalCheckbox($spid,$_from) {
global $lang;
+
$spremenljivka = self::$_HEADERS[$spid];
# preverimo ali prikazujemo spremenljivko, glede na veljavne odgovore in nastavitev
@@ -2093,7 +2260,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -2110,115 +2279,144 @@ class SurveyAnalysis {
foreach (self::$_HEADERS[$spid]['grids'][$gid]['variables'] AS $vid => $variable) {
$_sequence = $variable['sequence'];
- $_valid_cnt = max($_valid_cnt, self::$_FREQUENCYS[$_sequence]['validCnt']);
- $_approp_cnt = max($_approp_cnt, self::$_FREQUENCYS[$_sequence]['allCnt']);
+ $_valid_cnt = max(isset($_valid_cnt)?$_valid_cnt:0, self::$_FREQUENCYS[$_sequence]['validCnt']);
+ $_approp_cnt = max(isset($_approp_cnt)?$_approp_cnt:0, self::$_FREQUENCYS[$_sequence]['allCnt']);
if ($variable['other'] == true) {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
}
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_bl tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_bck_desc_1">';
+ echo '<table class="table_sums sums_hor_checkbox">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_al anl_bck anl_bb anl_bck_desc_1" colspan="'. ($_clmn_cnt+(self::$_SHOW_LEGENDA ? 4 : 2)) .'">';
+
+ echo '<td class="cell_question" colspan="'. ($_clmn_cnt+(self::$_SHOW_LEGENDA ? 4 : 2)) .'">';
echo '<span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb">';
+
+
+ echo '<tr class="row2">';
+
+
+ echo '<td class="cell_icons cell_icons'.$spid.'" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
- echo '</td>';
+ echo ' </div>';
+ echo '</td>';
+
+
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" colspan="'.$_clmn_cnt.'">'.$lang['srv_analiza_opisne_answers'];
- echo '<span id="img_analysis_f_p_1_'.$spid.'" class="img_analysis_f_p"><a href="javascript:show_single_percent(\''.$spid.'\',\'2\');">&nbsp(<span class="blue">f&nbsp;</span>/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '<span id="img_analysis_f_1_'.$spid.'" class="img_analysis_f displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'1\');">&nbsp(<span class="blue">f&nbsp;</span>/&nbsp;%)</a></span>';
- echo '<span id="img_analysis_p_1_'.$spid.'" class="img_analysis_p displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'0\');">&nbsp(f&nbsp;/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_valid'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_num_units'].'</td>';
- echo '</tr>';
+ echo '<td class="cell_value freq-p_cell" colspan="'.$_clmn_cnt.'">';
+ echo $lang['srv_analiza_opisne_answers'];
+ self::showFreqPercent($spid);
+ echo '</td>';
+
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_num_units'].'</td>';
+
+ echo '</tr>';
+
- $bck_css = ' anl_bck_desc_2';
$_variables = self::$_HEADERS[$spid]['grids'][$gid]['variables'];
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb'.$bck_css .'">&nbsp;</td>';
- if (self::$_SHOW_LEGENDA) {
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+
+ if (self::$_SHOW_LEGENDA) {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">'.$_tip.'</td>';
- echo '<td class="anl_bb anl_br anl_ac anl_legend anl_legenda_freq'.$bck_css.'">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
- echo '<td class="anl_bb anl_ac anl_dash_br'.$bck_css.'">' . $variable['naslov'] . '</td>';
+ echo '<td class="cell_value">' . $variable['naslov'] . '</td>';
}
}
- echo '<td class="anl_bb anl_bl anl_br anl_ac'.$bck_css.'">&nbsp;</td>';
- echo '<td class="anl_bb anl_br anl_ac'.$bck_css.'">&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
+
+
# vodoravna vrstice s podatki
echo '<tr name="single_sums_percent_cnt_'.$spid.'">';
- echo '<td class="anl_br anl_bt anl_ar anl_ita gray anl_dash_bb" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</td>';
- // prikaz frekvenc
+
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</td>';
+
+ // prikaz frekvenc
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
$cnt = self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
- echo '<td class="anl_p5 anl_bt anl_ac anl_dash_br anl_dash_bb">'.$cnt.'</td>';
+ echo '<td class="cell_value">'.$cnt.'</td>';
}
}
- echo '<td class="anl_bt anl_bl anl_ac anl_bb">'.$_valid_cnt.'</td>';
- echo '<td class="anl_bt anl_bl anl_ac anl_bb anl_br">'.$_approp_cnt.'</td>';
+ echo '<td class="cell_value">'.$_valid_cnt.'</td>';
+ echo '<td class="cell_value">'.$_approp_cnt.'</td>';
+
echo '</tr>';
+
// dodamo še veljavne procente
echo '<tr name="single_sums_percent_'.$spid.'" >';
- echo '<td class="anl_br anl_dash_bb anl_ar anl_ita gray" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleOdstotekVeljavni'].'</td>';
- foreach ($_variables AS $vkey => $variable) {
+
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleOdstotekVeljavni'].'</td>';
+
+ foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
$cnt = self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$percent = ( $_valid_cnt > 0) ? 100*$cnt / $_valid_cnt : 0;
- echo '<td class="anl_p5 anl_ac anl_dash_br anl_dash_bb">'.self::formatNumber($percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+ echo '<td class="cell_value">'.self::formatNumber($percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
}
}
- echo '<td class="anl_bl">&nbsp;</td>';
- echo '<td>&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
// dodamo še procente
- echo '<tr name="single_sums_percent_'.$spid.'" >';
- echo '<td class="anl_br anl_ar anl_ita gray anl_bb" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleOdstotekEnote'].'</td>';
+ echo '<tr name="single_sums_percent_'.$spid.'">';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 3 : 1).'">'.$lang['srv_analiza_frekvence_titleOdstotekEnote'].'</td>';
foreach ($_variables AS $vkey => $variable) {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
$cnt = self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$percent = ( $_approp_cnt > 0) ? 100*$cnt / $_approp_cnt : 0;
- echo '<td class="anl_p5 anl_ac anl_dash_br anl_bb">'.self::formatNumber($percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+ echo '<td class="cell_value">'.self::formatNumber($percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
}
}
- echo '<td class="anl_bl">&nbsp;</td>';
- echo '<td>&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
echo '</table>';
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
@@ -2227,9 +2425,9 @@ class SurveyAnalysis {
echo '</div>';
}
}
+
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -2238,6 +2436,10 @@ class SurveyAnalysis {
$spremenljivka = self::$_HEADERS[$spid];
+ $_valid_cnt = array();
+ $_approp_cnt = array();
+ $_navedbe = array();
+
# preverimo ali prikazujemo spremenljivko, glede na veljavne odgovore in nastavitev
$all_categories_cnt = 0;
$only_valid = 0;
@@ -2248,7 +2450,9 @@ class SurveyAnalysis {
foreach ($grid['variables'] AS $vid => $variable ){
$all_categories_cnt++;
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -2270,17 +2474,17 @@ class SurveyAnalysis {
# ugotovimo koliko imamo kolon
if (count($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
+ $_clmn_cnt[$gid] = $grid['cnt_vars']-(isset($grid['cnt_other']) ? $grid['cnt_other'] : 0);
if (count ($grid['variables']) > 0)
foreach ($grid['variables'] AS $vid => $variable) {
$_sequence = $variable['sequence'];
- $_valid_cnt[$gid] = max($_valid_cnt[$gid], self::$_FREQUENCYS[$_sequence]['validCnt']);
- $_approp_cnt[$gid] = max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']);
+ $_valid_cnt[$gid] = isset($_valid_cnt[$gid]) ? max($_valid_cnt[$gid], self::$_FREQUENCYS[$_sequence]['validCnt']) : self::$_FREQUENCYS[$_sequence]['validCnt'];
+ $_approp_cnt[$gid] = isset($_approp_cnt[$gid]) ? max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']) : self::$_FREQUENCYS[$_sequence]['allCnt'];
if ($variable['other'] == true) {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
$_valid[$gid][$vid] = self::$_FREQUENCYS[$_sequence]['valid'];
- $_navedbe[$gid] += self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
+ $_navedbe[$gid] = isset($_navedbe[$gid]) ? $_navedbe[$gid] += self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] : self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
}
}
$veljavni_percent = ($spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 16) ? true : false;
@@ -2288,224 +2492,277 @@ class SurveyAnalysis {
$css_txt = 'anl_variabla_line';
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
echo '<div id="div_navedbe_1_'.$spid.'">';
- echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+
+ echo '<table class="table_sums sums_ver_checkbox navedbe1">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 7+(int)$veljavni_percent : 5+(int)$veljavni_percent).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span> <span class="anl_variabla_info">('.$lang['srv_info_checkbox'].')</span>';
+
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 7+(int)$veljavni_percent : 5+(int)$veljavni_percent).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span> <span class="anl_variabla_info">('.$lang['srv_info_checkbox'].')</span>';
if (self::$_SHOW_LEGENDA && !$inline_legenda) {
echo '<div class="floatRight"><span>&nbsp;('.$_tip.')</span>'.'</div>';
}
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type">&nbsp;&nbsp;<span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
- echo '<span name="span_show_navedbe_2_'.$spid.'" class="span_navedbe"><a href="javascript:show_navedbe(\''.$spid.'\',\'2\');">&nbsp;(<span class="blue" title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_3_'.$spid.'" class="span_navedbe displayNone"><a href="javascript:show_navedbe(\''.$spid.'\',\'1\');">&nbsp;(<span title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span class="blue" title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '</td>';
+
+ // Preklop navedbe/enote
+ self::showEnoteNavedbe($spid, $status='1');
+
+ echo '</td>';
+
echo '</tr>';
- $css_txt = 'anl_variabla_line';
- echo '<tr>';
- echo '<td class="anl_p5 anl_bl anl_br anl_ac anl_bck anl_bb anl_w110 '.$css_txt.'">';
+
+ echo '<tr class="row2">';
+
+
+ # variabla - več odgovorov
+ echo '<td class="cell_icons cell_icons'.$spid.' vec_odgovorov sum" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>false));
+ echo ' </div>';
echo '</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb '.$css_txt.'" style="width:280px">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
- if (self::$_SHOW_LEGENDA && $inline_legenda) {
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w110 '.$css_txt.'">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
- }
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">'.$lang['srv_analiza_opisne_frequency'].'</td>';
- echo '<td class="anl_p5 anl_ac anl_dash_br anl_bck anl_bb anl_w70 '.$css_txt.'">'.$lang['srv_analiza_opisne_valid'].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">% - '.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_question">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
- echo '<td class="anl_p5 anl_'.($veljavni_percent?'dash_':'').'br anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">'.$lang['srv_analiza_num_units_valid'].'</td>';
+ if (self::$_SHOW_LEGENDA && $inline_legenda) {
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ }
+
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_frequency'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_value">% - '.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_num_units_valid'].'</td>';
if ($veljavni_percent) {
- echo '<td class="anl_p5 anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">% - '.$lang['srv_analiza_num_units_valid'].'</td>';
+ echo '<td class="cell_value">% - '.$lang['srv_analiza_num_units_valid'].'</td>';
}
+
echo '</tr>';
- $cssBack = "anl_bck anl_variabla_line ";
-
+
$_max_valid = 0;
$_max_appropriate = 0;
- if (count ($spremenljivka['grids']) > 0)
+ if (count ($spremenljivka['grids']) > 0){
+
foreach ($spremenljivka['grids'] as $gid => $grid) {
- $_max_valid = 0;
- $_max_appropriate = 0;
- if (count ($grid['variables']) > 0)
- foreach ($grid['variables'] AS $vid => $variable) {
- $_sequence = $variable['sequence'];
- #po potrebi prikažemo samo tiste ki imajo vrednosti
- if (($all_categories_cnt <= AUTO_HIDE_ZERRO_VALUE) || (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] > 0 )
- if ($variable['other'] != 1) {
-
-
- # dodamo labele podvprašanja
- if ($spremenljivka['tip'] == 16 && (($vid == 0 && $gid != 0) || ($vid == 0 && $gid == 0))) {
- $cssBack = "anl_bck_desc_2 ".($vid == 0 && $gid != 0 ? 'anl_double_bt ' : '');
- echo '<tr>';
- echo '<td class="'.$cssBack.'anl_bl anl_br anl_bb anl_ac anl_variabla_sub">'.$grid['variable'].'</td>';
- echo '<td class="'.$cssBack.'anl_br anl_bb" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 7+(int)$veljavni_percent : 5+(int)$veljavni_percent ).'">'.$grid['naslov'].'</td>';
- echo '</tr>';
- }
- $cssBack = "anl_bck_desc_2 ";
- echo '<tr id="'.$spid.'_'.$_sequence.'" name="valid_row_'.$_sequence.'" vkey="1">';
- echo '<td class="anl_p5 anl_tin1 '.$cssBack.'anl_bl anl_br anl_bb anl_ac anl_variabla_sub">'.$variable['variable'].'</td>';
- echo '<td class="anl_p5 anl_tin1 '.$cssBack.'anl_br anl_bb">'.$variable['naslov'].'</td>';
- if (self::$_SHOW_LEGENDA && $inline_legenda) {
- echo '<td class="anl_p5 '.$cssBack.'anl_br anl_bb anl_ac">'.$_tip.'</td>';
- echo '<td class="anl_p5 '.$cssBack.'anl_br anl_bb anl_ac">'.$_oblika.'</td>';
- }
- echo '<td class="anl_p5 anl_bb anl_ac anl_br '.$cssBack.( self::$enableInspect == true ? ' fr_inspect' : '').'" >';
- echo (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
- echo '</td>';
-
- $_max_appropriate = max($_max_appropriate, (int)self::$_FREQUENCYS[$_sequence]['allCnt']);
- $_max_valid = max ($_max_valid, ((int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt'])));
-
- # veljavno
- echo '<td class="anl_p5 anl_dash_br anl_ac anl_bb '.$cssBack.'">';
- echo (int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']);
- echo '</td>';
- echo '<td class="anl_p5 anl_bb anl_br anl_ac '.$cssBack.'" >';
- $_percent = (self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- #ustrezno
- echo '<td class="anl_p5 anl_'.($veljavni_percent?'dash_':'').'br anl_ac anl_bb '.$cssBack.'">';
- echo (int)self::$_FREQUENCYS[$_sequence]['allCnt'];
- echo '</td>';
- # veljavno %
- if ($veljavni_percent) {
+ $_max_valid = 0;
+ $_max_appropriate = 0;
- $valid = (int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']);
- $valid = (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
- $_percent = ($_max_appropriate > 0 ) ? 100*$valid / $_max_appropriate : 0;
-
- echo '<td class="anl_p5 anl_br anl_ac anl_bb '.$cssBack.'">';
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- }
- echo '</tr>';
+ if (count ($grid['variables']) > 0){
- } else {
- # drugo
- }
- }
- $cssBack = " anl_bck_2 red";
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb anl_al anl_ita'.$cssBack.'" >&nbsp;</td>';
- echo '<td class="anl_p5 anl_tin1 anl_br anl_bl anl_bb anl_al anl_ita'.$cssBack.'" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 3 : 1).'">'.$lang['srv_anl_suma_valid'].'</td>';
- echo '<td class="anl_bb anl_ac anl_br anl_ita'.$cssBack.'" >&nbsp;</td>'; //.$_approp_cnt[$gid].
- echo '<td class="anl_p5 anl_ac anl_dash_br anl_bb anl_ita'.$cssBack.'">'.$_max_valid.'</td>';
- echo '<td class="anl_bb anl_br'.$cssBack.'">&nbsp;</td>'; //.self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%')
+ foreach ($grid['variables'] AS $vid => $variable) {
+ $_sequence = $variable['sequence'];
-
- echo '<td class="anl_p5 anl_'.($veljavni_percent?'dash_':'').'br anl_ac anl_bb anl_ita'.$cssBack.'">'.$_max_appropriate.'</td>'; //$lang['srv_anl_suma_entries']
- if ($veljavni_percent) {
- $_percent = ($_max_appropriate > 0 ) ? 100*$_max_valid / $_max_appropriate : 0;
- echo '<td class="anl_p5 anl_br anl_ac anl_bb anl_ita'.$cssBack.'">';
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- }
- echo '</tr>';
-
+ #po potrebi prikažemo samo tiste ki imajo vrednosti
+ if (($all_categories_cnt <= AUTO_HIDE_ZERRO_VALUE) || (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] > 0 ){
+ if ($variable['other'] != 1) {
+
+ # dodamo labele podvprašanja
+ if ($spremenljivka['tip'] == 16 && (($vid == 0 && $gid != 0) || ($vid == 0 && $gid == 0))) {
+ echo '<tr class="row3">';
+ echo '<td class="cell_var">'.$grid['variable'].'</td>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 7+(int)$veljavni_percent : 5+(int)$veljavni_percent ).'">'.$grid['naslov'].'</td>';
+ echo '</tr>';
+ }
+
+ echo '<tr id="'.$spid.'_'.$_sequence.'" name="valid_row_'.$_sequence.'" vkey="1">';
+ echo '<td class="cell_var">'.$variable['variable'].'</td>';
+ echo '<td class="cell_question">'.$variable['naslov'].'</td>';
+ if (self::$_SHOW_LEGENDA && $inline_legenda) {
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
+ }
+ echo '<td class="cell_value">';
+ echo (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
+ echo '</td>';
+
+ $_max_appropriate = max($_max_appropriate, (int)self::$_FREQUENCYS[$_sequence]['allCnt']);
+ $_max_valid = max ($_max_valid, ((int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt'])));
+
+ # veljavno
+ echo '<td class="cell_value">';
+ echo (int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']);
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ $_percent = (self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo '</td>';
+
+ # ustrezno
+ echo '<td class="cell_value">';
+ echo (int)self::$_FREQUENCYS[$_sequence]['allCnt'];
+ echo '</td>';
+
+ # veljavno %
+ if ($veljavni_percent) {
+
+ $valid = (int)(self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)self::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']);
+ $valid = (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
+ $_percent = ($_max_appropriate > 0 ) ? 100*$valid / $_max_appropriate : 0;
+
+ echo '<td class="cell_value">';
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo '</td>';
+ }
+ echo '</tr>';
+
+ }
+ }
+ else {
+ # drugo
+ }
+ }
+ }
+
+
+ echo '<tr class="row_var">';
+
+ echo '<td class="cell_var"></td>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 3 : 1).'">'.$lang['srv_anl_suma_valid'].'</td>';
+ echo '<td class="cell_value">/</td>';
+ echo '<td class="cell_value">'.$_max_valid.'</td>';
+ echo '<td class="cell_value">/</td>';
+
+ echo '<td class="cell_value">'.$_max_appropriate.'</td>';
+ if ($veljavni_percent) {
+ $_percent = ($_max_appropriate > 0 ) ? 100*$_max_valid / $_max_appropriate : 0;
+ echo '<td class="cell_value">';
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo '</td>';
+ }
+ echo '</tr>';
+ }
}
echo '</table>';
echo '</div>'; // div_navedbe_1_'.$spid.'
+
# še navedbe
echo '<div id="div_navedbe_2_'.$spid.'" class="div_navedbe displayNone">';
- echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+
+ echo '<table class="table_sums sums_ver_checkbox navedbe2">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda? 5 : 3).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda? 5 : 3).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA && !$inline_legenda) {
echo '<div class="floatRight"><span>&nbsp;('.$_tip.')</span>'.'</div>';
}
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type">&nbsp;&nbsp;<span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
- echo '<span name="span_show_navedbe_2_'.$spid.'" class="span_navedbe"><a href="javascript:show_navedbe(\''.$spid.'\',\'2\');">&nbsp;(<span class="blue" title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '<span name="span_show_navedbe_3_'.$spid.'" class="span_navedbe displayNone"><a href="javascript:show_navedbe(\''.$spid.'\',\'1\');">&nbsp;(<span title="'.$lang['srv_enote_navedbe_1'].'">'.$lang['srv_analiza_opisne_units'].'&nbsp;</span>/<span class="blue" title="'.$lang['srv_enote_navedbe_2'].'">&nbsp;'.$lang['srv_analiza_opisne_arguments'].'</span>)</a></span>';
- echo '</td>';
+
+ // Preklop navedbe/enote
+ self::showEnoteNavedbe($spid, $status='2');
+
+ echo '</td>';
+
echo '</tr>';
- $css_txt = 'anl_variabla_line';
- echo '<tr>';
- echo '<td class="anl_p5 anl_bl anl_br anl_ac anl_bck anl_bb anl_w110 '.$css_txt.'">';
+
+
+ echo '<tr class="row2">';
+
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'_2\')" > </span>';
+ echo ' <div class= "options " id="options'.$spid.'_2">';
self::showIcons($spid,$spremenljivka,$_from, array('navedbe'=>true));
+ echo ' </div>';
echo '</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb '.$css_txt.'" style="width:280px">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
+
+ echo '<td class="cell_question">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
if (self::$_SHOW_LEGENDA && $inline_legenda) {
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w70 '.$css_txt.'">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb anl_w110 '.$css_txt.'">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_p5 anl_dash_br anl_ac anl_bck anl_bb '.$css_txt.'">'.$lang['srv_analiza_opisne_frequency'].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb '.$css_txt.'">%</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_frequency'].'</td>';
+ echo '<td class="cell_value">%</td>';
echo '</td>';
+
echo '</tr>';
- $cssBack = "anl_bck anl_variabla_line ";
-
- if (count ($spremenljivka['grids']) > 0)
+
+ if (count ($spremenljivka['grids']) > 0){
+
foreach ($spremenljivka['grids'] as $gid => $grid) {
- if (count ($grid['variables']) > 0)
- foreach ($grid['variables'] AS $vid => $variable) {
- $_sequence = $variable['sequence'];
- #po potrebi prikažemo samo tiste ki imajo vrednosti
- if (($all_categories_cnt <= AUTO_HIDE_ZERRO_VALUE) || (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] > 0 )
- if ($variable['other'] != 1) {
-
- # dodamo labele podvprašanja
- if ($spremenljivka['tip'] == 16 && (($vid == 0 && $gid != 0) || ($vid == 0 && $gid == 0))) {
- $cssBack = 'anl_bck_desc_2'.($vid == 0 && $gid != 0 ? ' anl_double_bt ' : '');
- echo '<tr>';
- echo '<td class="anl_p5 '.$cssBack.' anl_bl anl_br anl_bb anl_ac anl_variabla_sub">'.$grid['variable'].'</td>';
- echo '<td class="anl_p5 '.$cssBack.' anl_br anl_bb"'.(self::$_SHOW_LEGENDA && $inline_legenda ? ' colspan="5"' : ' colspan="3"' ).'>'.$grid['naslov'].'</td>';
- echo '</tr>';
- }
- $cssBack = "anl_bck_desc_2 ";
- echo '<tr>';
- echo '<td class="anl_p5 anl_tin1 '.$cssBack.'anl_bl anl_br anl_bb anl_ac anl_variabla_sub">'.$variable['variable'].'</td>';
- echo '<td class="anl_p5 anl_tin1 '.$cssBack.'anl_br anl_bb">'.$variable['naslov'].'</td>';
- if (self::$_SHOW_LEGENDA && $inline_legenda) {
- echo '<td class="anl_p5 '.$cssBack.'anl_br anl_bb anl_ac">'.$_tip.'</td>';
- echo '<td class="anl_p5 '.$cssBack.'anl_br anl_bb anl_ac">'.$_oblika.'</td>';
- }
-
- echo '<td class="anl_p5 anl_dash_br anl_ac anl_bb '.$cssBack.'">'. self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bb '.$cssBack.'">';
- $_percent = ($_navedbe[$gid] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / $_navedbe[$gid] : 0;
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr>';
- } else {
- # drugo
- }
+ if (count ($grid['variables']) > 0){
+
+ foreach ($grid['variables'] AS $vid => $variable) {
+
+ $_sequence = $variable['sequence'];
+
+ #po potrebi prikažemo samo tiste ki imajo vrednosti
+ if (($all_categories_cnt <= AUTO_HIDE_ZERRO_VALUE) || (int)self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] > 0 ){
+ if ($variable['other'] != 1) {
+
+ # dodamo labele podvprašanja
+ if ($spremenljivka['tip'] == 16 && (($vid == 0 && $gid != 0) || ($vid == 0 && $gid == 0))) {
+ echo '<tr>';
+ echo '<td class="cell_var">'.$grid['variable'].'</td>';
+ echo '<td class="cell_question"'.(self::$_SHOW_LEGENDA && $inline_legenda ? ' colspan="5"' : ' colspan="3"' ).'>'.$grid['naslov'].'</td>';
+ echo '</tr>';
+ }
+
+ echo '<tr>';
+
+ echo '<td class="cell_var">'.$variable['variable'].'</td>';
+ echo '<td class="cell_question">'.$variable['naslov'].'</td>';
+
+ if (self::$_SHOW_LEGENDA && $inline_legenda) {
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
+ }
+
+ echo '<td class="cell_value">'. self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'].'</td>';
+ echo '<td class="cell_value">';
+ $_percent = ($_navedbe[$gid] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / $_navedbe[$gid] : 0;
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ }
+ else {
+ # drugo
+ }
+ }
+ }
}
- $cssBack = " anl_bck_2 red";
+
echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb anl_al anl_ita'.$cssBack.'" >&nbsp;</td>';
- echo '<td class="anl_p5 anl_tin1 anl_bl anl_br anl_bb anl_al anl_ita'.$cssBack.'" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 3 : 1).'">'.$lang['srv_anl_suma_valid'].'</td>';
- echo '<td class="anl_p5 anl_dash_br anl_ac anl_bb anl_ita'.$cssBack.'">'.$_navedbe[$gid].'</td>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bb anl_ita'.$cssBack.'">'.self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
- echo '</tr>';
-
+
+ echo '<td class="cell_var"></td>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA && $inline_legenda ? 3 : 1).'">'.$lang['srv_anl_suma_valid'].'</td>';
+ echo '<td class="cell_value">'.$_navedbe[$gid].'</td>';
+ echo '<td class="cell_value">'.self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+
+ echo '</tr>';
}
+
echo '</table>';
+
echo '</div>'; // Konec div_navedbe_2_$spid
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
@@ -2514,9 +2771,9 @@ class SurveyAnalysis {
echo '</div>';
}
}
+
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -2538,7 +2795,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -2546,9 +2805,7 @@ class SurveyAnalysis {
return;
}
- #$_invalidAnswers = self :: getInvalidAnswers (MISSING_TYPE_FREQUENCY);
$_invalidAnswers = self :: getInvalidAnswers (MISSING_TYPE_DESCRIPTOR);
- #$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
# opcije nareedimo posebej, da po potrebi zajamemo tudi misinge
$str_qry = "SELECT id, spr_id, REPLACE(REPLACE(REPLACE(naslov,'\n',' '),'\r','<br>'),'|',' ') as naslov, variable, other, part, REPLACE(REPLACE(REPLACE(naslov_graf,'\n',' '),'\r','<br>'),'|',' ') as naslov_graf, vrstni_red FROM srv_grid WHERE spr_id='".$spid."' ORDER BY vrstni_red";
@@ -2579,56 +2836,75 @@ class SurveyAnalysis {
}
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
- echo '<table class="anl_tbl anl_ba tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_bck_desc_1">';
+
+ echo '<table class="table_sums sums_hor">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_al anl_bck anl_bb anl_bck_desc_1" colspan="'. ($_clmn_cnt+$add_fld+(self::$_SHOW_LEGENDA ? 5+$_sub_question_col : 3+$_sub_question_col)) .'">';
+
+ echo '<td class="cell_question" colspan="'. ($_clmn_cnt+$add_fld+(self::$_SHOW_LEGENDA ? 5+$_sub_question_col : 3+$_sub_question_col)) .'">';
echo '<span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- $css_txt = 'anl_variabla_line';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb">';
+
+ echo '<tr class="row2">';
+
+
+ # variabla - tabela en odgovor
+ echo '<td class="cell_icons cell_icons'.$spid.' tabela_en_odgovor" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
+
if ($_sub_question_col) {
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb '.$css_txt.'" style="width:280px">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
+ echo '<td class="cell_subquestion" style="width:280px">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
}
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" colspan="'.($_clmn_cnt+1).'">'.$lang['srv_analiza_opisne_answers'];
- echo '<span id="img_analysis_f_p_1_'.$spid.'" class="img_analysis_f_p"><a href="javascript:show_single_percent(\''.$spid.'\',\'2\');">&nbsp(<span class="blue">f&nbsp;</span>/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '<span id="img_analysis_f_1_'.$spid.'" class="img_analysis_f displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'1\');">&nbsp(<span class="blue">f&nbsp;</span>/&nbsp;%)</a></span>';
- echo '<span id="img_analysis_p_1_'.$spid.'" class="img_analysis_p displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'0\');">&nbsp(f&nbsp;/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_valid'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_num_units'].'</td>';
+
+ echo '<td class="cell_grid freq-p_cell" colspan="'.($_clmn_cnt+1).'">';
+ echo $lang['srv_analiza_opisne_answers'];
+ self::showFreqPercent($spid);
+ echo '</td>';
+
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_valid'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_num_units'].'</td>';
if ($additional_field) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_odklon'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_odklon'].'</td>';
}
+
echo '</tr>';
- $cssBack = "anl_bck_0_0 ";
+
$_variables = $grid['variables'];
- echo '<tr>';
- echo '<td class="anl_tin ' . $cssBack . 'anl_bl anl_br anl_bb">&nbsp;</td>';
+
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+
if ( $_sub_question_col ) {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
+ echo '<td class="cell_subquestion"></td>';
}
+
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -2637,8 +2913,8 @@ class SurveyAnalysis {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; //$_tip
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; // $_oblika
+ echo '<td class="cell_info"></td>'; //$_tip
+ echo '<td class="cell_info"></td>'; // $_oblika
}
//nastavitve iz baze za ureditev pravilnega izrisa analize za tabelo s trakom
@@ -2646,150 +2922,193 @@ class SurveyAnalysis {
$spremenljivkaParams = new enkaParameters($row['params']);
$diferencial_trak = ($spremenljivkaParams->get('diferencial_trak') ? $spremenljivkaParams->get('diferencial_trak') : 0);
$diferencial_trak_starting_num = ($spremenljivkaParams->get('diferencial_trak_starting_num') ? $spremenljivkaParams->get('diferencial_trak_starting_num') : 0);
- //nastavitve iz baze za ureditev pravilnega izrisa analize za tabelo s trakom
if (count($spremenljivka['options']) > 0) {
foreach ( $spremenljivka['options'] as $key => $kategorija) {
- if($diferencial_trak){ //ce je trak, je potrebno naslove stolpcev spremeniti v vrednosti na traku
+
+ if($diferencial_trak){ //ce je trak, je potrebno naslove stolpcev spremeniti v vrednosti na traku
$_label = $diferencial_trak_starting_num;
$diferencial_trak_starting_num++;
- }else{
+ }
+ else{
// misinge imamo zdruzene
$_label = $kategorija;
}
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_dash_br ">'.$_label.'</td>';
+ echo '<td class="cell_grid">'.$_label.'</td>';
}
}
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac red anl_w70">'.$lang['srv_anl_suma1'].'</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
- if ($additional_field) {
+ echo '<td class="cell_grid">'.$lang['srv_anl_suma1'].'</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+ if ($additional_field) {
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
}
+
echo '</tr>';
$part=null;
- #zlopamo skozi gride
- if (count($spremenljivka['grids']) > 0)
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
-
- # za dvojne gride
- if ((int)$grid['part'] > 0) {
- if ($part == null || $part == $grid['part'] ) {
- $part_css = '';
- } else {
- $part_css = ' anl_double_bt ';
- }
- $part = $grid['part'];
- }
- else {
- $part_css = '';
- }
-
- $cssBack = "anl_bck_desc_2 ";
- # zloopamo skozi variable
- if (count($grid['variables']) > 0)
- foreach ($grid['variables'] AS $vid => $variable ) {
- $_sequence = $variable['sequence'];
- #popotrebi izpisujemo samo veljavne
- if ((count($spremenljivka['grids']) <= AUTO_HIDE_ZERRO_VALUE ||
- (self::$_FREQUENCYS[$_sequence]['allCnt'] - self::$_FREQUENCYS[$_sequence]['invalidCnt']) > 0))
- if ($variable['other'] != true) {
- echo '<tr id="'.$spid.'_'.$_sequence.'"'.($part_css != '' ? ' class="'.$part_css.'"' : '').'>';
- if ($_sub_question_col) {
- echo '<td class="anl_tin1 ' . $cssBack . 'anl_bl anl_br anl_bb anl_ac anl_variabla_sub">';
-
- echo $variable['variable'];
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">';
- echo $variable['naslov'];
+ # zlopamo skozi gride
+ if (count($spremenljivka['grids']) > 0){
- // dodatek desne strani sem. diferenciala
- echo ($spremenljivka['enota'] == 1) ? ' - '.$variable['naslov2'] : '';
- echo '</td>';
- } else {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
- }
- if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">'.$_tip.'</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">'.$_oblika.'</td>';
- }
- # za odklon in povprečje
- $sum_xi_fi=0;
- $N = 0;
- $div=0;
- if (count($spremenljivka['options']) > 0) {
- foreach ( $spremenljivka['options'] as $key => $kategorija) {
- if ($additional_field) { # za odklon in povprečje
- $xi = $key;
- $fi = self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'];
- $sum_xi_fi += $xi * $fi ;
- $N += $fi;
- }
- echo '<td class="anl_bb anl_dash_br anl_ac cll_clps ' . $cssBack . '">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac'.(self::$enableInspect == true && (int)self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] > 0 ? ' mg_inspect' : '').'"'
- .(self::$enableInspect == true && (int)self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] > 0 ? ' vkey="'.$key.'"' : '')
- .' style="padding:5px 0px;">'.self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'].'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
- $_percent = (self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] * 100 / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
- echo '</td>';
-
-
- }
- }
- // suma
- echo '<td class="anl_bb anl_br anl_ac cll_clps ' . $cssBack . '">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac red" style="padding:5px 0px;">'.((int)self::$_FREQUENCYS[$_sequence]['validCnt']).'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td class="red" style="padding:5px 0px;">'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
- echo '</tr></table>';
- echo '</td>';
- // zamenjano veljavni ustrezni
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac" >';
- echo (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
- echo '</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac" >'.(int)self::$_FREQUENCYS[$_sequence]['allCnt'].'</td>';
- if ($additional_field) { # za odklon in povprečje
- # povprečje
- $avg = ($N > 0) ? $sum_xi_fi / $N : 0;
- #standardna diviacija
- $div = 0;
- $sum_pow_xi_fi_avg = 0;
- if (count($spremenljivka['options']) > 0) {
- foreach ( $spremenljivka['options'] as $xi => $kategorija) {
- $fi = self::$_FREQUENCYS[$_sequence]['valid'][$xi]['cnt'];
- $sum_pow_xi_fi_avg += pow(($xi - $avg),2) * $fi;
- }
- }
- $div = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac" >';
- echo self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac" >';
- echo self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
- echo '</td>';
- }
- echo '</tr>';
-
- } else {
- # immamo polje drugo
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
- }
- }
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+
+ # za dvojne gride
+ if (isset($grid['part']) && (int)$grid['part'] > 0) {
+ if ($part == null || $part == $grid['part'] ) {
+ $part_css = '';
+ } else {
+ $part_css = ' anl_double_bt ';
+ }
+ $part = $grid['part'];
+ }
+ else {
+ $part_css = '';
+ }
+
+
+ # zloopamo skozi variable
+ if (count($grid['variables']) > 0){
+
+ foreach ($grid['variables'] AS $vid => $variable ) {
+
+ $_sequence = $variable['sequence'];
+
+ $invalid_count = isset(self::$_FREQUENCYS[$_sequence]['invalidCnt']) ? self::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
+ $all_count = isset(self::$_FREQUENCYS[$_sequence]['allCnt']) ? self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+
+
+ #popotrebi izpisujemo samo veljavne
+ if (count($spremenljivka['grids']) <= AUTO_HIDE_ZERRO_VALUE || ($all_count-$invalid_count) > 0){
+
+ if ($variable['other'] != true) {
+ echo '<tr id="'.$spid.'_'.$_sequence.'"'.($part_css != '' ? ' class="'.$part_css.'"' : '').'>';
+
+ if ($_sub_question_col) {
+ echo '<td class="cell_var">';
+ echo $variable['variable'];
+ echo '</td>';
+
+ echo '<td class="cell_subquestion">';
+ echo $variable['naslov'];
+
+ // dodatek desne strani sem. diferenciala
+ echo (isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1) ? ' - '.$variable['naslov2'] : '';
+ echo '</td>';
+ }
+ else {
+ echo '<td class="cell_subquestion"></td>';
+ }
+
+ if (self::$_SHOW_LEGENDA) {
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
+ }
+
+ # za odklon in povprečje
+ $sum_xi_fi=0;
+ $N = 0;
+ $div=0;
+ if (count($spremenljivka['options']) > 0) {
+
+ foreach ( $spremenljivka['options'] as $key => $kategorija) {
+ if ($additional_field) { # za odklon in povprečje
+ $xi = $key;
+ $fi = self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'];
+ $sum_xi_fi += $xi * $fi ;
+ $N += $fi;
+ }
+
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td class="'.(self::$enableInspect == true && (int)self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] > 0 ? ' mg_inspect' : '').'"'
+ .(self::$enableInspect == true && (int)self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] > 0 ? ' vkey="'.$key.'"' : '')
+ .'>'.self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'].'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+
+ echo ' <td>';
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']) && self::$_FREQUENCYS[$_sequence]['validCnt'] > 0)
+ $_percent = self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] * 100 / self::$_FREQUENCYS[$_sequence]['validCnt'];
+ else
+ $_percent = 0;
+ echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo ' </td>';
+
+ echo ' </tr>';
+ echo ' </table>';
+
+ echo '</td>';
+ }
+ }
+
+ // suma
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td>'.(isset(self::$_FREQUENCYS[$_sequence]['validCnt']) ? (int)self::$_FREQUENCYS[$_sequence]['validCnt'] : 0).'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+ echo ' </tr>';
+ echo ' </table>';
+
+ echo '</td>';
+
+ // zamenjano veljavni ustrezni
+ echo '<td class="cell_value">';
+ echo (isset(self::$_FREQUENCYS[$_sequence]['validCnt']) ? (int)self::$_FREQUENCYS[$_sequence]['validCnt'] : '0');
+ echo '</td>';
+
+ echo '<td class="cell_value">'.(int)self::$_FREQUENCYS[$_sequence]['allCnt'].'</td>';
+
+ if ($additional_field) { # za odklon in povprečje
+
+ # povprečje
+ $avg = ($N > 0) ? $sum_xi_fi / $N : 0;
+
+ #standardna diviacija
+ $div = 0;
+ $sum_pow_xi_fi_avg = 0;
+
+ if (count($spremenljivka['options']) > 0) {
+ foreach ( $spremenljivka['options'] as $xi => $kategorija) {
+ $fi = self::$_FREQUENCYS[$_sequence]['valid'][$xi]['cnt'];
+ $sum_pow_xi_fi_avg += pow(($xi - $avg),2) * $fi;
+ }
+ }
+
+ $div = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
+
+ echo '<td class="cell_value">';
+ echo self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
+ echo '</td>';
+ }
+
+ echo '</tr>';
+ }
+ }
+ else {
+ # immamo polje drugo
+ $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ }
+ }
+ }
+ }
}
+
echo '</table>';
# izpišemo še tekstovne odgovore za polja drugo
@@ -2803,7 +3122,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -2824,7 +3142,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -2839,116 +3159,146 @@ class SurveyAnalysis {
$_sub_question_col = 6;
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
- echo '<table class="anl_tbl anl_ba tbl_clps">';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_bck_desc_1">';
+ echo '<table class="table_sums sums_double_hor">';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_br anl_al anl_bck anl_bb anl_bck_desc_1" colspan="'. ($_clmn_cnt+2+$_sub_question_col+(self::$_SHOW_LEGENDA ? 2 : 0)) .'">';
+
+ echo '<td class="cell_question" colspan="'. ($_clmn_cnt+2+$_sub_question_col+(self::$_SHOW_LEGENDA ? 2 : 0)) .'">';
echo '<span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- $css_txt = 'anl_variabla_line';
- echo '<tr>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb">';
+
+ echo '<tr class="row2">';
+
+
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
+
if ($_sub_question_col) {
- echo '<td class="anl_p5 anl_br anl_ac anl_bck anl_bb '.$css_txt.'" style="width:280px">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
+ echo '<td class="cell_subquestion">'.$lang['srv_analiza_opisne_subquestion'].'</td>';
}
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w110 anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" colspan="'.($_clmn_cnt+6).'">'.$lang['srv_analiza_opisne_answers'];
- echo '<span id="img_analysis_f_p_1_'.$spid.'" class="img_analysis_f_p"><a href="javascript:show_single_percent(\''.$spid.'\',\'2\');">&nbsp(<span class="blue">f&nbsp;</span>/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '<span id="img_analysis_f_1_'.$spid.'" class="img_analysis_f displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'1\');">&nbsp(<span class="blue">f&nbsp;</span>/&nbsp;%)</a></span>';
- echo '<span id="img_analysis_p_1_'.$spid.'" class="img_analysis_p displayNone"><a href="javascript:show_single_percent(\''.$spid.'\',\'0\');">&nbsp(f&nbsp;/<span class="blue">&nbsp;%</span>)</a></span>';
- echo '</td>';
- #št. enot
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_variabla_line" >&nbsp;</td>';
+
+ echo '<td class="cell_grid freq-p_cell" colspan="'.($_clmn_cnt+6).'">';
+ echo $lang['srv_analiza_opisne_answers'];
+ self::showFreqPercent($spid);
+ echo '</td>';
+
+ # št. enot
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
- #naslovi podskupin
- $cssBack = "anl_bck_0_0 ";
+
+
+ # naslovi podskupin
$_variables = $grid['variables'];
- echo '<tr>';
- echo '<td class="anl_tin ' . $cssBack . 'anl_bl anl_br anl_bb">&nbsp;</td>';
+
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+
if ( $_sub_question_col ) {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
+ echo '<td class="cell_subquestion"></td>';
}
+
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; //$_tip
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; // $_oblika
+
+ echo '<td class="cell_info"></td>'; //$_tip
+ echo '<td class="cell_info"></td>'; // $_oblika
}
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_br" colspan="'.(count($spremenljivka['options'])+3).'">'.($spremenljivka['double'][1]['subtitle'] == '' ? $lang['srv_grid_subtitle_def'].' 1' : $spremenljivka['double'][1]['subtitle']).'</td>';
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_br" colspan="'.(count($spremenljivka['options'])+3).'">'.($spremenljivka['double'][2]['subtitle'] == '' ? $lang['srv_grid_subtitle_def'].' 2' : $spremenljivka['double'][2]['subtitle']).'</td>';
- #št. enot
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_br" >&nbsp;</td>';
+
+ echo '<td class="cell_grid" colspan="'.(count($spremenljivka['options'])+3).'">'.($spremenljivka['double'][1]['subtitle'] == '' ? $lang['srv_grid_subtitle_def'].' 1' : $spremenljivka['double'][1]['subtitle']).'</td>';
+ echo '<td class="cell_grid" colspan="'.(count($spremenljivka['options'])+3).'">'.($spremenljivka['double'][2]['subtitle'] == '' ? $lang['srv_grid_subtitle_def'].' 2' : $spremenljivka['double'][2]['subtitle']).'</td>';
+
+ #št. enot
+ echo '<td class="cell_value"></td>';
echo '</tr>';
+
# naslovi variabel
- $cssBack = "anl_bck_0_0 ";
$_variables = $grid['variables'];
- echo '<tr>';
- echo '<td class="anl_tin ' . $cssBack . 'anl_bl anl_br anl_bb">&nbsp;</td>';
+
+ echo '<tr class="row4">';
+
+ echo '<td class="cell_var"></td>';
+
if ( $_sub_question_col ) {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
+ echo '<td class="subquestion"></td>';
}
+
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; //$_tip
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">&nbsp;</td>'; // $_oblika
+
+ echo '<td class="cell_info"></td>'; //$_tip
+ echo '<td class="cell_info"></td>'; // $_oblika
}
+
if (count($spremenljivka['options']) > 0) {
foreach ( $spremenljivka['options'] as $key => $kategorija) {
// misinge imamo zdruzene
$_label = $kategorija;
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_dash_br ">'.$_label.'</td>';
+ echo '<td class="cell_grid">'.$_label.'</td>';
}
}
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac red anl_w70">'.$lang['srv_anl_suma1'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_odklon'].'</td>';
-
+ echo '<td class="cell_value">'.$lang['srv_anl_suma1'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_odklon'].'</td>';
if (count($spremenljivka['options']) > 0) {
foreach ( $spremenljivka['options'] as $key => $kategorija) {
// misinge imamo zdruzene
$_label = $kategorija;
- echo '<td class="' . $cssBack . ' anl_bb anl_ac anl_dash_br ">'.$_label.'</td>';
+ echo '<td class="cell_value">'.$_label.'</td>';
}
}
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac red anl_w70">'.$lang['srv_anl_suma1'].'</td>';
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac anl_w70 anl_variabla_line">'.$lang['srv_analiza_opisne_odklon'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_anl_suma1'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_povprecje'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_opisne_odklon'].'</td>';
# št enot
- echo '<td class="' . $cssBack . ' anl_bb anl_br anl_ac anl_w70 anl_variabla_line">'.$lang['srv_analiza_num_units'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_analiza_num_units'].'</td>';
echo '</tr>';
+
+
#zloopamo skozi gride in nardimo
$_tmp_table = array();
$_part = 1;
@@ -2982,7 +3332,7 @@ class SurveyAnalysis {
$_tmp_table[$grid['part']][$cnt]['variables'][] = array('key'=>$key, 'freq'=>self::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'],'percent'=>$_percent);
}
}
- $_tmp_table[$grid['part']][$cnt]['seq'] = $variable['seq'];
+ $_tmp_table[$grid['part']][$cnt]['seq'] = (isset($variable['seq']) ? $variable['seq'] : null);
$_tmp_table[$grid['part']][$cnt]['vr_id'] = $variable['vr_id'];
$_tmp_table[$grid['part']][$cnt]['variable'] = substr($variable['variable'], 0, strrpos($variable['variable'], "_"));
$_tmp_table[$grid['part']][$cnt]['naslov'] = $variable['naslov'];
@@ -3015,52 +3365,66 @@ class SurveyAnalysis {
#zlopamo skozi gride
if (count($_tmp_table[1]) > 0) {
foreach ($_tmp_table[1] AS $tkey => $grid) {
- $cssBack = "anl_bck_desc_2 ";
+
echo '<tr id="'.$spid.'_'.$grid['vr_id'].'">';
+
if ($_sub_question_col) {
- echo '<td class="anl_tin1 ' . $cssBack . 'anl_bl anl_br anl_bb anl_ac anl_variabla_sub">'.$grid['variable'].'</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">'.$grid['naslov'].'</td>';
- } else {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb">&nbsp;</td>';
+ echo '<td class="cell_var">'.$grid['variable'].'</td>';
+ echo '<td class="cell_subquestion">'.$grid['naslov'].'</td>';
+ }
+ else {
+ echo '<td class="cell_var"></td>';
}
+
if (self::$_SHOW_LEGENDA) {
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">'.$_tip.'</td>';
- echo '<td class="anl_p5 ' . $cssBack . 'anl_br anl_bb anl_ac">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
# zloopamo skozi variable
if (count($grid['variables']) > 0) {
+
foreach ($grid['variables'] AS $vid => $variable ) {
#mg_inspectž
- echo '<td class="anl_bb anl_dash_br anl_ac cll_clps '.$cssBack.'">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' dmg_inspect' : '').'" style="padding:5px 0px;"'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' gid="'.$variable['key'].'_1"' : '').'>'.$variable['freq'].'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
- echo self::formatNumber($variable['percent'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td class="'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' dmg_inspect' : '').'" '.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' gid="'.$variable['key'].'_1"' : '').'>'.$variable['freq'].'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>';
+ echo self::formatNumber($variable['percent'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo ' </td>';
+ echo ' </tr>';
+ echo ' </table>';
+
echo '</td>';
} // end foreach variables
} // end if (count($grid['variables']) > 0)
+
+
// suma
- echo '<td class="anl_bb anl_br anl_ac cll_clps ' . $cssBack . '">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac red" style="padding:5px 0px;">'.(int)$grid['suma'].'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td class="red" style="padding:5px 0px;">'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
- echo '</tr></table>';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td>'.(int)$grid['suma'].'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+ echo ' </tr>';
+ echo ' </table>';
+
echo '</td>';
- // povpreje
- echo '<td class="anl_bb anl_br anl_ac ' . $cssBack . '" >';
+ // povprecje
+ echo '<td class="cell_value">';
echo self::formatNumber($grid['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
// odklon
- echo '<td class="anl_bb anl_br anl_ac ' . $cssBack . '" >';
+ echo '<td class="cell_value">';
echo self::formatNumber($grid['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
@@ -3068,43 +3432,54 @@ class SurveyAnalysis {
$_right_grid = $_tmp_table[2][$tkey];
if (count($_right_grid['variables']) > 0) {
foreach ($_right_grid['variables'] AS $vid => $variable ) {
- echo '<td class="anl_bb anl_dash_br anl_ac cll_clps '.$cssBack.'">';
+
+ echo '<td class="cell_value cell_noPadding">';
+
#mg_inspect
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' dmg_inspect' : '').'" style="padding:5px 0px;"'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' gid="'.$variable['key'].'_2"' : '').'>'.$variable['freq'].'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td style="padding:5px 0px;">';
- echo self::formatNumber($variable['percent'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '</td>';
- echo '</tr></table>';
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td class="anl_ac'.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' dmg_inspect' : '').'" '.(self::$enableInspect == true && (int)$variable['freq'] > 0 ? ' gid="'.$variable['key'].'_2"' : '').'>'.$variable['freq'].'</td>';
+ echo ' </tr>';
+ echo ' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>';
+ echo self::formatNumber($variable['percent'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
+ echo ' </td>';
+ echo ' </tr>';
+ echo ' </table>';
+
echo '</td>';
} // end foreach variables
} // end if (count($grid['variables']) > 0)
+
// suma
- echo '<td class="anl_bb anl_br anl_ac cll_clps '.$cssBack.'">';
- echo '<table class="fullWidth anl_ac tbl_clps">';
- echo '<tr name="single_sums_percent_cnt_'.$spid.'" class="anl_dash_bb">';
- echo '<td class="anl_ac red" style="padding:5px 0px;">'.(int)$_right_grid['suma'].'</td>';
- echo '</tr><tr name="single_sums_percent_'.$spid.'">';
- echo '<td class="red" style="padding:5px 0px;">'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
- echo '</tr></table>';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo ' <table class="cell_table freq_row percent_row">';
+ echo ' <tr name="single_sums_percent_cnt_'.$spid.'">';
+ echo ' <td>'.(int)$_right_grid['suma'].'</td>';
+ echo ' </tr>';
+ echo' <tr name="single_sums_percent_'.$spid.'">';
+ echo ' <td>'.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').'</td>';
+ echo ' </tr>';
+ echo ' </table>';
+
echo '</td>';
// povpreje
- echo '<td class="anl_bb anl_br anl_ac ' . $cssBack . '" >';
+ echo '<td class="cell_value">';
echo self::formatNumber($_right_grid['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
# odklon
- echo '<td class="anl_bb anl_br anl_ac ' . $cssBack . '" >';
+ echo '<td class="cell_value">';
echo self::formatNumber($_right_grid['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
# št enot
- echo '<td class="anl_bb anl_br anl_ac ' . $cssBack . '" >';
+ echo '<td class="cell_value">';
echo $grid['allCnt'];
echo '</td>';
+
echo '</tr>';
} // end foreach ($_tmp_table[1] AS $tkey => $grid)
}
@@ -3121,9 +3496,7 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
-
}
/** Izriše multi number odgovore. izpiše samo povprečja
@@ -3143,7 +3516,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -3157,21 +3532,24 @@ class SurveyAnalysis {
$_cols = $spremenljivka['cnt_all'] / $spremenljivka['cnt_grids'];
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_bb tbl_clps">';
+ echo '<table class="table_sums sums_multinumber">';
+
# naslovna vrstica
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<tr class="row1">';
+
+ # variabla
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- #odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? 3+$_cols : 1+$_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+
+ # odgovori
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 3+$_cols : 1+$_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -3183,66 +3561,83 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
+
+
+ echo '<tr class="row2">';
+
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>'; //options
echo '</td>';
- #odgovori
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
+ #odgovori
+ echo '<td class="cell_subquestion">'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line" colspan="'.($_cols).'">'. $lang['srv_analiza_sums_average'] .'</td>';
+
+ echo '<td class="cell_grid" colspan="'.($_cols).'">'. $lang['srv_analiza_sums_average'] .'</td>';
echo '</tr>';
// konec naslovne vrstice
+
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
if ($_grids_count > 0) {
+
# naslovna vrstica
$_row = $spremenljivka['grids'][0];
- echo '<tr>';
- echo '<td class="anl_bl anl_bb anl_bck">&nbsp;</td>';
- echo '<td class="anl_bl anl_br anl_bb anl_bck">&nbsp;</td>';
+
+ echo '<tr class="row3">';
+
+ echo '<td class="cell_var"></td>';
+ echo '<td class="cell_subquestion"></td>';
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br anl_bb anl_bck">&nbsp;</td>';
- echo '<td class="anl_br anl_bb anl_bck">&nbsp;</td>';
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
}
if (count($_row['variables']) > 0 )
foreach ($_row['variables'] AS $rid => $_col ){
$_sequence = $_col['sequence']; # id kolone z podatki
if ($_col['other'] != true) {
- echo '<td class="anl_br anl_bb anl_bck anl_ac">';
- // echo $_col['variable'];
+ echo '<td class="cell_grid">';
echo $_col['naslov'];
echo '</td>';
- } else {
+ }
+ else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
}
echo '</tr>';
- $_css_bck = 'anl_bck_desc_2 anl_ac anl_bt_dot ';
+
+
$last = 0;
- //anl_bck_desc_2 anl_bl anl_br anl_variabla_sub
+
foreach ($spremenljivka['grids'] AS $gid => $grid) {
$_variables_count = count($grid['variables']);
- echo '<tr class="'.$_css_bck.'">';
- echo '<td class="anl_bl anl_br anl_variabla_sub">';
+
+ echo '<tr>';
+
+ echo '<td class="cell_var">';
echo $grid['variable'];
echo '</td>';
- echo '<td class="anl_br anl_al">';
+
+ echo '<td class="cell_subquestion">';
echo $grid['naslov'];
echo '</td>';
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br">'.$_tip.'</td>';
- echo '<td class="anl_br">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
if ($_variables_count > 0) {
@@ -3251,14 +3646,14 @@ class SurveyAnalysis {
if ($variable['other'] != true) {
# tabela z navedbami
- echo '<td class="anl_at anl_br">';
- echo self::formatNumber(self::$_FREQUENCYS[$_sequence]['average'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '</td>';
-
+ echo '<td class="cell_value">';
+ echo self::formatNumber(isset(self::$_FREQUENCYS[$_sequence]['average'])?self::$_FREQUENCYS[$_sequence]['average']:0,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '</td>';
}
}
}
+
echo '</tr>';
}
}
@@ -3266,7 +3661,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -3287,7 +3681,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -3302,87 +3698,104 @@ class SurveyAnalysis {
# ali izpisujemo enoto:
$show_enota = true;
- if ((int)$spremenljivka['enota'] == 0 && self::$_HEADERS[$spid]['cnt_all'] == 1) {
+ if (!isset($spremenljivka['enota']) || ((int)$spremenljivka['enota'] == 0 && self::$_HEADERS[$spid]['cnt_all'] == 1)) {
$show_enota = false;
}
# ugotovimo koliko imamo kolon
- if (count($spremenljivka['grids']) > 0)
+ if (count($spremenljivka['grids']) > 0){
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
- if (count($grid['variables']) > 0)
- foreach ($grid['variables'] AS $vid => $variable) {
- $_sequence = $variable['sequence'];
- $_approp_cnt[$gid] = max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']);
- # za povprečje
- $sum_xi_fi=0;
- $N = 0;
- $div=0;
- $min = null;
- $max = null;
+ if(isset($grid['cnt_other']))
+ $_clmn_cnt[$gid] = $grid['cnt_vars'] - $grid['cnt_other'];
+ else
+ $_clmn_cnt[$gid] = $grid['cnt_vars'];
+
+ if (is_countable($grid['variables']) && count($grid['variables']) > 0){
- if (count(self::$_FREQUENCYS[$_sequence]['valid']) > 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $xi => $_validFreq) {
+ foreach ($grid['variables'] AS $vid => $variable) {
+ $_sequence = $variable['sequence'];
- # popravimo morebitne . in -
- $fnkey = (float)$xi;
+ if(isset($_approp_cnt[$gid]))
+ $_approp_cnt[$gid] = max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']);
+ else
+ $_approp_cnt[$gid] = self::$_FREQUENCYS[$_sequence]['allCnt'];
- if (is_numeric($xi) && is_numeric($fnkey) && trim($fnkey) != '') {
- $fi = $_validFreq['cnt'];
- $sum_xi_fi += $xi * $fi ;
- $N += $fi;
-
- $min = $min != null ? min($min,$fnkey) : $fnkey;
- $max = $max != null ? max($max,$fnkey) : $fnkey;
+ # za povprečje
+ $sum_xi_fi=0;
+ $N = 0;
+ $div=0;
+ $min = null;
+ $max = null;
+
+ if (count(self::$_FREQUENCYS[$_sequence]['valid']) > 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $xi => $_validFreq) {
+
+ # popravimo morebitne . in -
+ $fnkey = (float)$xi;
+
+ if (is_numeric($xi) && is_numeric($fnkey) && trim($fnkey) != '') {
+ $fi = $_validFreq['cnt'];
+ $sum_xi_fi += $xi * $fi ;
+ $N += $fi;
+
+ $min = $min != null ? min($min,$fnkey) : $fnkey;
+ $max = $max != null ? max($max,$fnkey) : $fnkey;
+ }
+ }
}
- }
- }
- # povprešje
- $avg = ($N > 0) ? $sum_xi_fi / $N : 0;
+ # povprešje
+ $avg = ($N > 0) ? $sum_xi_fi / $N : 0;
- self::$_FREQUENCYS[$_sequence]['validAvg'] = $avg;
- self::$_FREQUENCYS[$_sequence]['validMin'] = $min;
- self::$_FREQUENCYS[$_sequence]['validMax'] = $max;
+ self::$_FREQUENCYS[$_sequence]['validAvg'] = $avg;
+ self::$_FREQUENCYS[$_sequence]['validMin'] = $min;
+ self::$_FREQUENCYS[$_sequence]['validMax'] = $max;
- #standardna diviacija
- $div = 0;
- $sum_pow_xi_fi_avg = 0;
- if (count(self::$_FREQUENCYS[$_sequence]['valid']) > 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $xi => $_validFreq) {
- $fi = $_validFreq['cnt'];
- $sum_pow_xi_fi_avg += pow(($xi - $avg),2) * $fi;
- }
- }
- self::$_FREQUENCYS[$_sequence]['validDiv'] = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
+ #standardna diviacija
+ $div = 0;
+ $sum_pow_xi_fi_avg = 0;
+ if (count(self::$_FREQUENCYS[$_sequence]['valid']) > 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['valid'] AS $xi => $_validFreq) {
+ $fi = $_validFreq['cnt'];
+ $sum_pow_xi_fi_avg += pow(($xi - $avg),2) * $fi;
+ }
+ }
+ self::$_FREQUENCYS[$_sequence]['validDiv'] = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
- #določimo še polja drugo za kasnejši prikaz
- if ($variable['other'] == true) {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ #določimo še polja drugo za kasnejši prikaz
+ if ($variable['other'] == true) {
+ $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ }
+ }
}
}
}
+
$isSingleGrid = ($spremenljivka['cnt_all'] == $spremenljivka['cnt_grids']) ? true : false;
# če je cnt_all == cnt_grids pomeni da imamo samo 1 grid
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br anl_bb tbl_clps">';
+ echo '<table class="table_sums sums_multinumber_ver">';
+
# naslovna vrstica
- echo '<tr>';
+ echo '<tr class="row1">';
+
#variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
+
#odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? 7+(int)$inline_legenda*2 : 7).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 7+(int)$inline_legenda*2 : 7).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -3399,42 +3812,52 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck">';
+ echo '<tr class="row2">';
+
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
-
if ($show_enota) {
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">';
+ echo '<td class="cell_subquestion">';
if ($spremenljivka['tip'] == 20 || $spremenljivka['tip'] == 7) {
echo $lang['srv_analiza_opisne_subquestion'];
- } else {
+ }
+ else {
echo $lang['srv_analiza_opisne_variable_text'];
}
echo'</td>';
- } else { # če mamo number brez labele izrisujemo drugače
- echo '<td class="anl_br">';
- echo '&nbsp;';
+ }
+ else { # če mamo number brez labele izrisujemo drugače
+ echo '<td class="cell_subquestion">';
+ echo '';
echo'</td>';
}
if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line" >'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line" >'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
- }
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_m'] . '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_num_units'] . '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_povprecje'] . '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_odklon'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_min'] . '</td>';
- echo '<td class="anl_bck anl_ac anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_max'] . '</td>';
+ echo '<td class="cell_info" >'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info" >'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ }
+
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_m'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_num_units'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_povprecje'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_odklon'].'</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_min'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_max'] . '</td>';
+
echo '</tr>';
+
$_answersOther = array();
$_grupa_cnt = 0;
if (count($spremenljivka['grids']) > 0)
@@ -3450,71 +3873,72 @@ class SurveyAnalysis {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
- $cssBrdr = (int)$grid['new_grid'] == 1 && $isSingleGrid == false? ' anl_double_bt' : ' anl_bt_dot';
-
echo '<tr>';
- if (!$show_enota && $spremenljivka['tip'] == 7) {
- echo '<td style="border-bottom:1px solid white;">' ;
- } else {
- echo '<td class="anl_bck_desc_2 anl_ac anl_bl anl_br anl_variabla_sub'.$cssBrdr.'">' ;
- }
- echo $_css_double_line;
+
+ echo '<td class="cell_var">' ;
# za number (7) ne prikazujemo variable
if ($spremenljivka['tip'] != 7 ) {
echo $variable['variable'];
}
echo '</td>' ;
- if (!$show_enota && $spremenljivka['tip'] == 7) {
- echo '<td style="border-bottom:1px solid white;">' ;
- } else {
- echo '<td class="anl_bck_desc_2 anl_al anl_br'.$cssBrdr.'">' ;
- }
+ echo '<td class="cell_subquestion">' ;
if ($show_enota) {
# če ni enojni grid
if ($isSingleGrid == false) {
- echo (count($grid['variables']) > 1 && $spremenljivka['tip'] == 20 ? $grid['naslov'] . ' - ' : '' ).$variable['naslov'];
- } else {
- # če je enojni, izpišemo labele variable
- echo $grid['naslov'];
- }
- } else {
- echo '&nbsp;';
- }
+ echo (count($grid['variables']) > 1 && $spremenljivka['tip'] == 20 ? $grid['naslov'] . ' - ' : '' ).$variable['naslov'];
+ }
+ else {
+ # če je enojni, izpišemo labele variable
+ echo $grid['naslov'];
+ }
+ }
+
echo '</td>' ;
+
if (self::$_SHOW_LEGENDA && $inline_legenda) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'" title="'.$_tip.'">'.$_tip.'</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'" title="'.$_oblika.'">' .$_oblika. '</td>';
+ echo '<td class="cell_info" title="'.$_tip.'">'.$_tip.'</td>';
+ echo '<td class="cell_info" title="'.$_oblika.'">' .$_oblika. '</td>';
}
- echo '<td class="anl_bck_desc_2 anl_ac anl_br anl_bl'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)$_approp_cnt[$gid];
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber(self::$_FREQUENCYS[$_sequence]['validAvg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber(self::$_FREQUENCYS[$_sequence]['validDiv'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validMin'];
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+ echo '</td>';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validMax'];;
echo '</td>';
echo '</tr>';
- } else {
+ }
+ else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
+
$grid['new_grid'] = false;
}
@@ -3533,17 +3957,17 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
+
/** Izriše number odgovore v vertikalni obliki
*
* @param unknown_type $spid
*/
static function sumNumberVertical($spid,$_from) {
global $lang;
- $spremenljivka = self::$_HEADERS[$spid];
+ $spremenljivka = self::$_HEADERS[$spid];
# preverimo ali prikazujemo spremenljivko, glede na veljavne odgovore in nastavitev
$only_valid = 0;
@@ -3553,7 +3977,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -3568,18 +3994,27 @@ class SurveyAnalysis {
# ali izpisujemo enoto:
$show_enota = true;
- if (((int)$spremenljivka['enota'] == 0 && self::$_HEADERS[$spid]['cnt_all'] == 1) || $spremenljivka['tip'] == 22 || $spremenljivka['tip'] == 25) {
+ if (((!isset($spremenljivka['enota']) || (int)$spremenljivka['enota'] == 0) && self::$_HEADERS[$spid]['cnt_all'] == 1) || $spremenljivka['tip'] == 22 || $spremenljivka['tip'] == 25) {
$show_enota = false;
}
$sum_avg = 0;
# ugotovimo koliko imamo kolon
if (count($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
+
+ if(isset($grid['cnt_other']))
+ $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
+ else
+ $_clmn_cnt[$gid] = $grid['cnt_vars'];
+
if (count($grid['variables']) > 0)
foreach ($grid['variables'] AS $vid => $variable) {
$_sequence = $variable['sequence'];
- $_approp_cnt[$gid] = max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']);
+
+ if(isset($_approp_cnt[$gid]))
+ $_approp_cnt[$gid] = max($_approp_cnt[$gid], self::$_FREQUENCYS[$_sequence]['allCnt']);
+ else
+ $_approp_cnt[$gid] = self::$_FREQUENCYS[$_sequence]['allCnt'];
# za povprečje
$sum_xi_fi=0;
@@ -3630,22 +4065,27 @@ class SurveyAnalysis {
}
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br anl_bb tbl_clps">';
+ echo '<table class="table_sums sums_number_ver">';
+
# naslovna vrstica
- echo '<tr>';
+ echo '<tr class="row1">';
+
#variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
+
$num_cols = 7 + ($spremenljivka['tip'] == 18 ? 1 : 0);
+
#odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? $num_cols+(int)$inline_legenda*2 : $num_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? $num_cols+(int)$inline_legenda*2 : $num_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -3662,44 +4102,49 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck">';
+
+ echo '<tr class="row2">';
+
+ # variabla - število
+ echo '<td class="cell_icons cell_icons'.$spid.' stevilo" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
-
+ echo '<td class="cell_question">';
if ($show_enota == true) {
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">';
if ($spremenljivka['tip'] == 20 || $spremenljivka['tip'] == 7) {
echo $lang['srv_analiza_opisne_subquestion'];
- } else {
+ }
+ else {
echo $lang['srv_analiza_opisne_variable_text'];
}
- echo'</td>';
- } else { # če mamo number brez labele izrisujemo drugače
- echo '<td class="anl_br">';
- echo '&nbsp;';
- echo'</td>';
- }
+ }
+ echo'</td>';
if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line" >'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line" >'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_m'] . '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_num_units'] . '</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_povprecje'] . '</td>';
+
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_m'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_num_units'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_povprecje'] . '</td>';
if ($spremenljivka['tip'] == 18) {
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">%</td>';
+ echo '<td class="cell_value">%</td>';
}
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_odklon'].'</td>';
- echo '<td class="anl_br anl_ac anl_bck anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_min'] . '</td>';
- echo '<td class="anl_bck anl_ac anl_bb anl_w70 anl_legend anl_variabla_line">' . $lang['srv_analiza_opisne_max'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_odklon'].'</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_min'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_opisne_max'] . '</td>';
+
echo '</tr>';
+
$_answersOther = array();
$_grupa_cnt = 0;
if (count($spremenljivka['grids']) > 0)
@@ -3715,35 +4160,26 @@ class SurveyAnalysis {
if ($variable['other'] != true) {
$_sequence = $variable['sequence'];
- $cssBrdr = (int)$grid['new_grid'] == 1 ? ' anl_double_bt' : ' anl_bt_dot';
-
echo '<tr>';
- if (!$show_enota && $spremenljivka['tip'] == 7) {
- echo '<td style="border-bottom:1px solid white;">' ;
- } else {
- echo '<td class="anl_bck_desc_2 anl_ac anl_bl anl_br anl_variabla_sub'.$cssBrdr.'">' ;
- }
- echo $_css_double_line;
+
+ echo '<td class="cell_var">' ;
# za number (7) ne prikazujemo variable
if ($spremenljivka['tip'] != 7 || ($show_enota == true && $spremenljivka['tip'] == 7 )) {
if ($variable['variable'] == $spremenljivka['variable']) {
echo $variable['variable'].'_1';
- } else {
+ }
+ else {
echo $variable['variable'];
}
}
echo '</td>' ;
- if ((!$show_enota && $spremenljivka['tip'] == 7 ) || $spremenljivka['tip'] == 22 || $spremenljivka['tip'] == 25) {
- echo '<td style="border-bottom:1px solid white;">' ;
- } else {
- echo '<td class="anl_bck_desc_2 anl_al anl_br'.$cssBrdr.'">' ;
- }
+
+ echo '<td class="cell_question">' ;
if ($show_enota) {
echo (count($grid['variables']) > 1 && $spremenljivka['tip'] == 20 ? $grid['naslov'] . ' - ' : '' ).$variable['naslov'];
- } else {
- echo '&nbsp;';
- }
+ }
echo '</td>' ;
+
if (self::$_SHOW_LEGENDA && $inline_legenda) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -3752,68 +4188,85 @@ class SurveyAnalysis {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'" title="'.$_tip.'">'.$_tip.'</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'" title="'.$_oblika.'">' .$_oblika. '</td>';
+ echo '<td class="cell_info" title="'.$_tip.'">'.$_tip.'</td>';
+ echo '<td class="cell_info" title="'.$_oblika.'">' .$_oblika. '</td>';
}
- echo '<td class="anl_bck_desc_2 anl_ac anl_br anl_bl'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)$_approp_cnt[$gid];
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber(self::$_FREQUENCYS[$_sequence]['validAvg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
echo '</td>';
+
if ($spremenljivka['tip'] == 18) {
$_percent = ($sum_avg > 0 ) ? 100 * self::$_FREQUENCYS[$_sequence]['validAvg'] / $sum_avg : 0;
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+ echo '<td class="cell_value">';
echo self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'%');
echo '</td>';
}
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber(self::$_FREQUENCYS[$_sequence]['validDiv'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
echo '</td>';
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validMin'];
- echo '<td class="anl_bck_desc_2 anl_ac anl_br'.$cssBrdr.'">';
+ echo '</td>';
+
+ echo '<td class="cell_value">';
echo (int)self::$_FREQUENCYS[$_sequence]['validMax'];;
echo '</td>';
echo '</tr>';
- } else {
+ }
+ else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
+
$grid['new_grid'] = false;
}
}
}
if ($spremenljivka['tip'] == 18) {
- $css_back = 'anl_bck_text_1 anl_bt';
- echo '<tr>';
- echo '<td class="'.$css_back.' anl_bl red">';
+ echo '<tr class="row_sum">';
+
+ echo '<td class="cell_var">';
echo $lang['srv_anl_suma1'];
echo '</td>';
- echo '<td class="'.$css_back.'">&nbsp;</td>';
-
- if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- }
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '<td class="'.$css_back.' anl_ac anl_bl anl_br" >';
- echo self::formatNumber($sum_avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
- echo '</td>';
- # skupna suma
- echo '<td class="'.$css_back.' anl_br anl_ac" >100%</td>';
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '<td class="'.$css_back.'" >&nbsp;</td>';
- echo '</tr>';
+
+ echo '<td class="cell_question"></td>';
+
+ if (self::$_SHOW_LEGENDA && $inline_legenda){
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
+ }
+
+ echo '<td class="cell_value">/</td>';
+ echo '<td class="cell_value">/</td>';
+
+ echo '<td class="cell_value">';
+ echo self::formatNumber($sum_avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),'');
+ echo '</td>';
+
+ # skupna suma
+ echo '<td class="cell_value">100%</td>';
+ echo '<td class="cell_value">/</td>';
+ echo '<td class="cell_value">/</td>';
+ echo '<td class="cell_value">/</td>';
+
+ echo '</tr>';
}
+
echo '</table>';
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
@@ -3825,7 +4278,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -3834,33 +4286,38 @@ class SurveyAnalysis {
*/
static function sumNagovor($spid,$_from) {
global $lang;
+
$spremenljivka = self::$_HEADERS[$spid];
+
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- $cssBack = "anl_bck_freq_1 ";
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
- echo '<table class="anl_tbl_inner anl_ba" >';
- echo '<tr>';
- echo '<td class="anl_p5 anl_br anl_ac anl_bck_desc_1 anl_bb anl_w110">';
+ echo '<table class="table_sums sums_nagovor" >';
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- echo '<td class="anl_p5 anl_br anl_al anl_bck_desc_1 anl_bb"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+
+ echo '<td class="cell_question"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
+
echo '</table>';
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -3873,12 +4330,12 @@ class SurveyAnalysis {
global $lang;
$spremenljivka = self::$_HEADERS[$spid];
- $lokacija=false;
- $heatmap=false;
- if($spremenljivka['tip'] == 26)
- $lokacija=true;
- else if ($spremenljivka['tip'] == 27)
- $heatmap=true;
+ $lokacija=false;
+ $heatmap=false;
+ if($spremenljivka['tip'] == 26)
+ $lokacija=true;
+ else if ($spremenljivka['tip'] == 27)
+ $heatmap=true;
$anketa = self::$sid;
@@ -3890,7 +4347,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -3906,143 +4365,172 @@ class SurveyAnalysis {
# koliko zapisov prikažemo naenkrat
$num_show_records = self::getNumRecords();
- // $num_show_records = $_max_answers_cnt <= (int)$num_show_records ? $_max_answers_cnt : $num_show_records;
-
- //za tip lokacija (ne enota 3) se rabi user_id, ker se kasneje delajo linki
- $need_user_id = !($spremenljivka['tip'] != 26 || ($spremenljivka['tip'] == 26 && $spremenljivka['enota'] == 3));
+ //za tip lokacija (ne enota 3) se rabi user_id, ker se kasneje delajo linki
+ $need_user_id = !($spremenljivka['tip'] != 26 || ($spremenljivka['tip'] == 26 && $spremenljivka['enota'] == 3));
$_answers = self::getAnswers($spremenljivka, $num_show_records, $need_user_id);
$_all_valid_answers_cnt = $_answers['validCnt'];
$_valid_answers = $_answers['valid'];
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_bb tbl_clps">';
+ echo '<table class="table_sums sums_multitext">';
+
+
# naslovna vrstica
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<tr class="row1">';
+
+ # variabla
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
- #odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(!$lokacija ? (self::$_SHOW_LEGENDA ? 3+$_cols : 1+$_cols) : 3+$_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+
+ # odgovori
+ echo '<td class="cell_question" colspan="'.(!$lokacija ? (self::$_SHOW_LEGENDA ? 3+$_cols : 1+$_cols) : 3+$_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
+
+
+ echo '<tr class="row2">';
+
+ # variabla
+ echo '<td class="cell_icons cell_icons'.$spid.' test" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
- #odgovori
- if(!$lokacija)
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
+ #odgovori
+ if(!$lokacija)
+ echo '<td class="cell_subquestion">'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
+
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- if(!$lokacija){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line" colspan="'.(!$lokacija ? $_cols : 3+$_cols).'">'. $lang['srv_analiza_opisne_arguments'] .'</td>';
- echo '</tr>';
- }
+
+ if(!$lokacija){
+ echo '<td class="cell_grid" colspan="'.(!$lokacija ? $_cols : 3+$_cols).'">'. $lang['srv_analiza_opisne_arguments'] .'</td>';
+ }
+
+ echo '</tr>';
// konec naslovne vrstice
+
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
if ($_grids_count > 0) {
+
# naslovna vrstica
$_row = $spremenljivka['grids'][0];
- if(!$lokacija){
- echo '<tr>';
- echo '<td class="anl_bl anl_bb anl_bck">&nbsp;</td>';
- echo '<td class="anl_bl anl_br anl_bb anl_bck">&nbsp;</td>';
- }
+
+ echo '<tr class="row3">';
+
+ if(!$lokacija){
+ echo '<td class="cell_var"></td>';
+ echo '<td class="cell_subquestion"></td>';
+ }
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br anl_bb anl_bck">&nbsp;</td>';
- echo '<td class="anl_br anl_bb anl_bck">&nbsp;</td>';
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
}
- if (count($_row['variables'])>0)
+
+ if (count($_row['variables'])>0){
foreach ($_row['variables'] AS $rid => $_col ){
- $_sequence = $_col['sequence']; # id kolone z podatki
- if ($_col['other'] != true) {
- echo '<td class="anl_br anl_bb anl_bck anl_ac">';
- // echo $_col['variable'];
- echo $_col['naslov'];
- echo '</td>';
- } else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
- }
+ $_sequence = $_col['sequence']; # id kolone z podatki
+ if ($_col['other'] != true) {
+ echo '<td class="cell_grid">';
+ echo $_col['naslov'];
+ echo '</td>';
+ }
+ else {
+ $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ }
+ }
}
+
echo '</tr>';
- $_css_bck = 'anl_bck_desc_2 anl_ac anl_bt_dot ';
+
+
+
$last = 0;
- //anl_bck_desc_2 anl_bl anl_br anl_variabla_sub
+
foreach ($spremenljivka['grids'] AS $gid => $grid) {
$_variables_count = count($grid['variables']);
- echo '<tr class="'.$_css_bck.'">';
- echo '<td class="anl_bl anl_br anl_variabla_sub">';
- if(!$lokacija)
- echo $grid['variable'];
- //else{
- else if ($lokacija && $heatmap == false){
- //echo $grid['naslov'].'<br>';//ni potrebno, ker je ze v glavi?
- $sprid = explode('_',$spid);
- $loopid = $sprid[1];
- $sprid = $sprid[0];
-
- self::displayMapDataAll($spid);
- }
- elseif($heatmap){
- //echo $grid['naslov'].'<br>';//ni potrebno, ker je ze v glavi?
- $sprid = explode('_',$spid);
- $loopid = $sprid[1];
- $sprid = $sprid[0];
- SurveyUserSession::Init($anketa);
-
- $heatmapId = 'heatmap'.$sprid;
- //echo $heatmapId;
- //SurveyChart::displayExportIcons($sprid);
- echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
-
- echo 'Heatmap';
- echo '</a>';
- }
+
+ echo '<tr>';
+
+ echo '<td class="cell_var">';
+ if(!$lokacija){
+ $sprid = $spid;
+
+ echo isset($grid['variable'])?$grid['variable']:'';
+ }
+ else if ($lokacija && $heatmap == false){
+ $sprid = explode('_',is_string($spid)?$spid:'');
+ $loopid = $sprid[1];
+ $sprid = $sprid[0];
+
+ self::displayMapDataAll($spid);
+ }
+ elseif($heatmap){
+
+ $sprid = explode('_',is_string($spid)?$spid:'');
+ $loopid = $sprid[1];
+ $sprid = $sprid[0];
+
+ SurveyUserSession::Init($anketa);
+
+ $heatmapId = 'heatmap'.$sprid;
+
+ echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
+
+ echo 'Heatmap';
+ echo '</a>';
+ }
echo '</td>';
- if(!$lokacija){
- echo '<td class="anl_br anl_al">';
- echo $grid['naslov'];
- echo '</td>';
- }
+
+ if(!$lokacija){
+ echo '<td class="cell_subquestion">';
+ echo $grid['naslov'];
+ echo '</td>';
+ }
+
if (self::$_SHOW_LEGENDA){
- echo '<td class="anl_br">'.$_tip.'</td>';
- echo '<td class="anl_br">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
if ($_variables_count > 0) {
+
# preštejemo max vrstic na grupo
$_max_i = 0;
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,self::$_FREQUENCYS[$_sequence]['validCnt']));
+ $_max_i = max($_max_i,min($num_show_records,(isset(self::$_FREQUENCYS[$_sequence]['validCnt'])?self::$_FREQUENCYS[$_sequence]['validCnt']:0)));
}
# za barvanje
@@ -4053,113 +4541,84 @@ class SurveyAnalysis {
$_sequence = $variable['sequence']; # id kolone z podatki
if ($variable['other'] != true) {
+
# tabela z navedbami
- echo '<td class=" anl_at cll_clps">';
- echo '<table id="'.$spid.'_'.$_sequence.'" class="fullWidth anl_ac tbl_clps" style="vertical-align:top;">';
- #$_valid_cnt = count(self::$_FREQUENCYS[$_sequence]['valid']);
- $index=0;
- if (count($_valid_answers) > 0) {
- foreach ($_valid_answers AS $key => $answer) {
- $index++;
- $cssBck = ' '.self::$cssColors['0_' . ($index & 1)];
- $_ans = $answer[$_sequence];
-
- if($index <= $moreBound){
- //if($index < $moreBound){
- echo '<tr class="notmore">';
- echo '<td class="'.$cssBck.' anl_br anl_user_text'
- .($_ans != null && $_ans != '' && self::$enableInspect == true ? ' mt_inspect' : '')
- .'"'
- .($index == 1 && $_ans != null && $_ans != '' && self::$enableInspect == true ? ' vkey="'.$_ans.'"' : '').'>';
- # narišemo printereček za izpis posameznih textovnih odgovorov
- if ($index == 1) {
- //echo '<span class="anl_single_ans_ico as_link" onclick="showSpremenljivkaTextAnswersPopup(\''.$spid.'\',\''.$_sequence.'\'); return false;">';
-
- //TODO! zakomentiral, ker nima funkcije, ikona pa pokvarjena
- /*echo '<span class="anl_single_ans_ico as_link">';
- echo '&nbsp;';
- echo '</span>';*/
- }
- if ($_ans != null && $_ans != '') {
- if(!($need_user_id && $lokacija))
- echo $_ans;
- else
- echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passMapData('.$sprid.', '
- .$key.', '.$loopid.', '.$anketa.');">'.$_ans.'</a>';
- } else {
- echo '&nbsp;';
- }
+ echo '<td class="cell_value cell_noPadding">';
- if($index == $moreBound){
- #more - več
- echo '<br />';
- echo '&nbsp;';
- echo '<div class="srv_heatmap_info_more_'.$sprid.' as_link" onclick="$(\'.more_'.$sprid.', .srv_heatmap_info_more_'.$sprid.', .srv_objava_info_more2_'.$sprid.'\').toggle();">'.$lang['srv_more'].'</div>';
- #more - več - konec
- }
- echo '</td>';
- echo '</tr>';
- }
- else {
- echo '<tr class="more_'.$sprid.' displayNone" >';
- echo '<td class="'.$cssBck.' anl_br anl_user_text'
- .($_ans != null && $_ans != '' && self::$enableInspect == true ? ' mt_inspect' : '')
- .'"'
- .($index == 1 && $_ans != null && $_ans != '' && self::$enableInspect == true ? ' vkey="'.$_ans.'"' : '').'>';
- # narišemo printereček za izpis posameznih textovnih odgovorov
- if ($index == 1) {
- //echo '<span class="anl_single_ans_ico as_link" onclick="showSpremenljivkaTextAnswersPopup(\''.$spid.'\',\''.$_sequence.'\'); return false;">';
-
- //TODO! zakomentiral, ker nima funkcije, ikona pa pokvarjena
- /*echo '<span class="anl_single_ans_ico as_link">';
- echo '&nbsp;';
- echo '</span>';*/
- }
- if ($_ans != null && $_ans != '') {
- if(!($need_user_id && $lokacija))
- echo $_ans;
- else
- echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passMapData('.$sprid.', '
- .$key.', '.$loopid.', '.$anketa.');">'.$_ans.'</a>';
- } else {
- echo '&nbsp;';
- }
+ echo '<table id="'.$spid.'_'.$_sequence.'" class="cell_table">';
+
+ $index=0;
+ if (count($_valid_answers) > 0) {
+ foreach ($_valid_answers AS $key => $answer) {
+ $index++;
+ $cssBck = ' '.self::$cssColors['0_' . ($index & 1)];
+ $_ans = $answer[$_sequence];
+
+ if($index <= $moreBound){
+
+ echo '<tr class="notmore">';
+
+ echo '<td '
+ .($_ans != null && $_ans != '' && self::$enableInspect == true ? ' mt_inspect' : '')
+ .'"'
+ .($index == 1 && $_ans != null && $_ans != '' && self::$enableInspect == true ? ' vkey="'.$_ans.'"' : '').'>';
+
+ if ($_ans != null && $_ans != '') {
+
+ if(!($need_user_id && $lokacija))
+ echo $_ans;
+ else
+ echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passMapData('.$sprid.', '
+ .$key.', '.$loopid.', '.$anketa.');">'.$_ans.'</a>';
+ }
+
+ #more - več
+ if($index == $moreBound){
+ echo '<div class="srv_heatmap_info_more_'.$sprid.' as_link multigrid_more" onclick="$(\'.more_'.$sprid.', .srv_heatmap_info_more_'.$sprid.', .srv_heatmap_info_more2_'.$sprid.'\').toggleClass(\'displayNone\');">'.$lang['srv_more'].'</div>';
+ #more - več - konec
+ }
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ else {
+ echo '<tr class="more_'.$sprid.' displayNone">';
+
+ echo '<td '
+ .($_ans != null && $_ans != '' && self::$enableInspect == true ? ' mt_inspect' : '')
+ .'"'
+ .($index == 1 && $_ans != null && $_ans != '' && self::$enableInspect == true ? ' vkey="'.$_ans.'"' : '').'>';
- if($index == $_max_i){
- #less - manj
- echo '<br />';
- echo '&nbsp;';
- echo '<div class="srv_heatmap_info_more2_'.$sprid.' as_link" onclick="$(\'.more_'.$sprid.', .srv_heatmap_info_more_'.$sprid.', .srv_heatmap_info_more2_'.$sprid.' \').toggle();">'.$lang['srv_less'].'</div>';
- }
- echo '</td>';
- echo '</tr>';
- }
- }
- }
-
- if ($_all_valid_answers_cnt > $index) {
- $index++;
- $cssBck = ' '.self::$cssColors['0_' . ($index & 1)];
- echo '<tr>';
- echo '<td class="'.$cssBck.' anl_br anl_user_text">';
- // Pri javni povezavi drugace izpisemo
- if(self::$printPreview == false)
- echo '<div id="valid_row_togle_more_'.$vid.'" class="floatRight blue pointer anl_more" onclick="showHidenTextTable(\''.$spid.'\', \''.$num_show_records.'\', \''.self::$_CURRENT_LOOP['cnt'].'\');return false;">'.$lang['srv_anl_more'].'</div>';
- else
- echo '<div id="valid_row_togle_more_'.$vid.'" class="floatRight anl_more">'.$lang['srv_anl_more'].'</div>';
- echo '</td>';
- echo '</tr>';
- }
- echo '</table>';
+ if ($_ans != null && $_ans != '') {
+ if(!($need_user_id && $lokacija))
+ echo $_ans;
+ else
+ echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passMapData('.$sprid.', '
+ .$key.', '.$loopid.', '.$anketa.');">'.$_ans.'</a>';
+ }
+
+ #less - manj
+ if($index == $_max_i){
+ echo '<div class="srv_heatmap_info_more2_'.$sprid.' as_link multigrid_more displayNone" onclick="$(\'.more_'.$sprid.', .srv_heatmap_info_more_'.$sprid.', .srv_heatmap_info_more2_'.$sprid.' \').toggleClass(\'displayNone\');">'.$lang['srv_less'].'</div>';
+ }
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ }
+ }
+
+ echo '</table>';
- echo '</td>';
+ echo '</td>';
}
}
+
$last = $_max_i;
-
}
+
echo '</tr>';
}
}
@@ -4176,41 +4635,39 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
- /**
- *
- * @global type $lang
- * @param string $spid - [spremenljivka_id]_[loop_id]
- */
- private static function displayMapDataAll($spid){
- global $lang;
-
- $sprid = explode('_',$spid);
- $loopid = $sprid[1];
- $sprid = $sprid[0];
-
- $spremenljivka = Cache::srv_spremenljivka($sprid);
- $enota = $spremenljivka["enota"];
-
- //za choose location naredi isto, kot za vsak userja posebej - dobi direkt iz baze ne glede na filterje
- if($enota == 3){
- echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passMapData('.$sprid.', -1, '.$loopid.', '.self::$sid.', \'mapData\');">';
- echo '<img src="img_0/Google_Maps_Icon.png" height="24" width="24" />';
- echo '</a>';
- }
- //prikaz glede na filterje
- else{
- echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passMapData('.$sprid.', -1, '.$loopid.', '.self::$sid.', \'mapDataAll\');">';
- echo '<img src="img_0/Google_Maps_Icon.png" height="24" width="24" />';
- echo '</a>';
- }
- }
+ /**
+ *
+ * @global type $lang
+ * @param string $spid - [spremenljivka_id]_[loop_id]
+ */
+ private static function displayMapDataAll($spid){
+ global $lang;
+ $sprid = explode('_',$spid);
+ $loopid = $sprid[1];
+ $sprid = $sprid[0];
+
+ $spremenljivka = Cache::srv_spremenljivka($sprid);
+ $enota = $spremenljivka["enota"];
+
+ //za choose location naredi isto, kot za vsak userja posebej - dobi direkt iz baze ne glede na filterje
+ if($enota == 3){
+ echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passMapData('.$sprid.', -1, '.$loopid.', '.self::$sid.', \'mapData\');">';
+ echo '<img src="img_0/Google_Maps_Icon.png" height="24" width="24" />';
+ echo '</a>';
+ }
+ //prikaz glede na filterje
+ else{
+ echo '<a class="fMap" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passMapData('.$sprid.', -1, '.$loopid.', '.self::$sid.', \'mapDataAll\');">';
+ echo '<img src="img_0/Google_Maps_Icon.png" height="24" width="24" />';
+ echo '</a>';
+ }
+ }
/** Izriše tekstovne odgovore v vertikalni obliki
*
@@ -4218,6 +4675,7 @@ class SurveyAnalysis {
*/
static function sumTextVertical($spid,$_from) {
global $lang;
+
# dajemo v bufer, da da ne prikazujemo vprašanj brez veljavnih odgovorov če imamo tako nastavljeno
$spremenljivka = self::$_HEADERS[$spid];
@@ -4229,7 +4687,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -4247,21 +4707,25 @@ class SurveyAnalysis {
$options=array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
+ echo '<table class="table_sums sums_text_ver">';
+
# naslovna vrstica
- echo '<tr>';
+ echo '<tr class="row1">';
+
#variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo '<td class="cell_var">';
echo self::showVariable($spid, $spremenljivka['variable']);
echo '</td>';
+
#odgovori
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(self::$_SHOW_LEGENDA ? 5+(int)$inline_legenda*2 : 5).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<td class="cell_question" colspan="'.(self::$_SHOW_LEGENDA ? 5+(int)$inline_legenda*2 : 5).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
if (self::$_SHOW_LEGENDA) {
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
@@ -4278,26 +4742,38 @@ class SurveyAnalysis {
echo '<div class="anl_variable_type"><span>'.$lang['srv_analiza_opisne_variable_type'].': </span>'.self::getSpremenljivkaLegenda($spremenljivka,'tip').'</div>';
}
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
+
+
+ echo '<tr class="row2">';
+
+ # variabla - besedilo
+ echo '<td class="cell_icons cell_icons'.$spid.' besedilo" id="cell_icons'.$spid.'">';
+ echo ' <span class="faicon dots" onclick="show_settings_survey_analysis(\''.$spid.'\')" > </span>';
+ echo ' <div class= "options" id="options'.$spid.'">';
self::showIcons($spid,$spremenljivka,$_from);
+ echo ' </div>';
echo '</td>';
- #odgovori
+
+ # odgovori
+ echo '<td class="cell_question">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_variabla_line">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
if (self::$_SHOW_LEGENDA && $inline_legenda){
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_legend anl_variabla_line">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_expression'].'</td>';
+ echo '<td class="cell_info">'.$lang['srv_analiza_opisne_variable_skala'].'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
+
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleOdstotek'] .'</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleVeljavni'] .'</td>';
}
- echo '<td class="anl_br anl_bb anl_ac anl_bck anl_w70 anl_variabla_line">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+ echo '<td class="cell_value">'. $lang['srv_analiza_frekvence_titleKumulativa'] .'</td>';
+
echo '</tr>';
+
+
// konec naslovne vrstice
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
@@ -4329,9 +4805,9 @@ class SurveyAnalysis {
}
}
# izpišemo sumo veljavnih
- $counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
+ //$counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
}
- if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
+ /*if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
$counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
@@ -4341,8 +4817,10 @@ class SurveyAnalysis {
$counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
}
#izpišemo še skupno sumo
- $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);
- } else {
+ $counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);*/
+
+ }
+ else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
}
@@ -4360,7 +4838,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -4372,45 +4849,55 @@ class SurveyAnalysis {
* @param $_options
*/
static function outputGridLabelVertical($gid,$grid,$vid,$variable,$spid,$_options=array()) {
- echo '<tr id="'.$spid.'_'.$counter.'">';
- echo '<td class="anl_bck_freq_2 anl_bl anl_bb anl_br anl_ac anl_variabla_sub">';
+
+ echo '<tr id="'.$spid.'_'.$counter.'" class="row_grid">';
+
+ echo '<td class="cell_var">';
echo $variable['variable'];
echo '</td>';
- echo '<td class="anl_bck_freq_2 anl_al anl_bb anl_br">';
- //echo ($grid['naslov'] != '' ? $grid['naslov']. '&nbsp;-&nbsp;' : '').$variable['naslov'];
+
+ echo '<td class="cell_question">';
echo $variable['naslov'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA) {
$spremenljivka = self::$_HEADERS[$spid];
+
if ($variable['other'] != '1' && $variable['text'] != '1') {
$_tip = self::getSpremenljivkaLegenda($spremenljivka,'izrazanje');
$_oblika = self::getSpremenljivkaLegenda($spremenljivka,'skala');
- } else {
+ }
+ else {
global $lang;
+
$_tip = $lang['srv_analiza_vrsta_bese'];
$_oblika = $lang['srv_analiza_oblika_nomi'];
}
- echo '<td class="anl_bck_freq_2 anl_ac anl_bb anl_br ">'.$_tip.'</td>';
- echo '<td class="anl_bck_freq_2 anl_ac anl_bb anl_br ">'.$_oblika.'</td>';
+ echo '<td class="cell_info">'.$_tip.'</td>';
+ echo '<td class="cell_info">'.$_oblika.'</td>';
}
- echo '<td class="anl_bck_freq_2 anl_bb anl_br">&nbsp;</td>';
+
+ echo '<td class="cell_value"></td>';
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_bck_freq_2 anl_bb anl_br">&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
}
- echo '<td class="anl_bck_freq_2 anl_bb anl_br">&nbsp;</td>';
- echo '<td class="anl_bck_freq_2 anl_bb anl_br">&nbsp;</td>';
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
+
$counter++;
+
return $counter;
}
static function outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,&$_kumulativa,$_options=array()) {
global $lang;
- # opcije
-
+
+ # opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
'isOtherAnswer' => false, # ali je odgovor Drugo
'inline_legenda' => true, # ali je legenda inline ali v headerju
@@ -4419,111 +4906,127 @@ class SurveyAnalysis {
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- $cssBck = ' '.self::$cssColors['0_' . ($counter & 1)];
- $_valid = (self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- $_percent = (self::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+ $_valid = (isset(self::$_FREQUENCYS[$_sequence]['validCnt']) && self::$_FREQUENCYS[$_sequence]['validCnt'] > 0) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ $_percent = (isset(self::$_FREQUENCYS[$_sequence]['allCnt']) && self::$_FREQUENCYS[$_sequence]['allCnt'] > 0) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_kumulativa += $_valid;
# če smo v arhivih dodamovse odgovore vendar so nekateri skriti
+ $cssHide = '';
if ($counter >= $options['num_show_records'] && self::$isArchive) {
- $cssHide=' class="displayNone"';
+ $cssHide = 'displayNone';
}
- echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'"'.(self::$enableInspect == true && (int)$vAnswer['cnt'] > 0 ? ' vkey="'.$vkey.'"' : '').$cssHide.'>';
- echo '<td class="anl_bl anl_ac anl_br gray">&nbsp;</td>';
- echo '<td class="anl_br'.$cssBck.'">';
- echo '<div class="anl_user_text_more">'.$vkey.'</div>';
- echo (($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' ('.$vAnswer['text'] .')' : '');
+
+
+ echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'"'.(self::$enableInspect == true && (int)$vAnswer['cnt'] > 0 ? ' vkey="'.$vkey.'"' : ''). 'class="row_var '.$cssHide.'">';
+
+ echo '<td class="cell_noVerBorder"></td>';
+
+ echo '<td class="cell_question">';
+ echo ' <span class="anl_user_text_more">'.$vkey.'</div>';
+ echo (($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' ('.$vAnswer['text'] .')' : '');
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true ) {
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
}
- echo '<td class="anl_ac anl_br'.$cssBck.(self::$enableInspect == true && $options['isOtherAnswer']== false && (int)$vAnswer['cnt'] > 0 ? ' fr_inspect' : '').'">';
+ echo '<td class="cell_value '.(self::$enableInspect == true && $options['isOtherAnswer']== false && (int)$vAnswer['cnt'] > 0 ? ' fr_inspect' : '').'">';
echo (int)$vAnswer['cnt'];
echo '</td>';
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
+
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">';
+ echo '<td class="cell_value">';
echo self::formatNumber($_valid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
- echo '<td class="anl_ar'.$cssBck.' anl_pr10">';
- echo self::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '<td class="cell_value">';
+ echo self::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
+
echo '</tr>';
+
# če mamo več
if ( $counter+1 == $options['num_show_records'] && $options['num_show_records'] < count(self::$_FREQUENCYS[$_sequence]['valid'])) {
+
if (self::$isArchive == false ) {
- echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'" >';
- echo '<td class="anl_bl anl_ac anl_br gray">&nbsp;</td>';
- echo '<td class="anl_br'.$cssBck.'">';
- // Pri javni povezavi drugace izpisemo
- if(self::$printPreview == false){
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatLeft blue pointer anl_more" onclick="showHidenTextTable(\''.$spid.'\', \''.$options['num_show_records'].'\', \''.self::$_CURRENT_LOOP['cnt'].'\');return false;">'.$lang['srv_anl_more'].'</div>';
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatRight blue pointer anl_more" onclick="showHidenTextTable(\''.$spid.'\', \''.$options['num_show_records'].'\', \''.self::$_CURRENT_LOOP['cnt'].'\');return false;">'.$lang['srv_anl_more'].'</div>';
- }
- else{
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatLeft anl_more">'.$lang['srv_anl_more'].'</div>';
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatRight anl_more">'.$lang['srv_anl_more'].'</div>';
- }
+
+ echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'" class="row_var">';
+
+ echo '<td class="cell_noVerBorder"></td>';
+
+ echo '<td class="cell_question">';
+ echo ' <div id="valid_row_togle_more_'.$_sequence.'" class="floatLeft blue pointer anl_more" onclick="showHidenTextTable(\''.$spid.'\', \''.$options['num_show_records'].'\', \''.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'\');return false;">'.$lang['srv_anl_more'].'</div>';
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true ) {
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
}
- echo '<td class="anl_ac anl_br'.$cssBck.'">'.'</td>';
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">'.'</td>';
+
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">'.'</td>';
+ echo '<td class="cell_value"></td>';
}
- echo '<td class="anl_ar'.$cssBck.' anl_pr10">'.'</td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
- } else {
- #v arhivie dodamo vse odgovore vendar so skriti
- echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'" >';
- echo '<td class="anl_bl anl_ac anl_br gray">&nbsp;</td>';
- echo '<td class="anl_br'.$cssBck.'">';
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatLeft blue pointer" onclick="$(this).parent().parent().parent().find(\'tr.displayNone\').removeClass(\'displayNone\');$(this).parent().parent().addClass(\'displayNone\');return false;">'.$lang['srv_anl_all'].'</div>';
- echo '<div id="valid_row_togle_more_'.$_sequence.'" class="floatRight blue pointer" onclick="$(this).parent().parent().parent().find(\'tr.displayNone\').removeClass(\'displayNone\');$(this).parent().parent().addClass(\'displayNone\');return false;">'.$lang['srv_anl_all'].'</div>';
+ }
+ else {
+
+ # v arhivie dodamo vse odgovore vendar so skriti
+ echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'" class="row_var row_more">';
+
+ echo '<td class="cell_noVerBorder"></td>';
+
+ echo '<td class="cell_more">';
+ echo ' <div id="valid_row_togle_more_'.$_sequence.'" class="floatLeft blue pointer" onclick="$(this).parent().parent().parent().find(\'tr.displayNone\').removeClass(\'displayNone\');$(this).parent().parent().addClass(\'displayNone\');return false;">'.$lang['srv_anl_all'].'</div>';
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true ) {
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
- echo '<td class="anl_ac anl_br'.$cssBck.'">&nbsp;</td>';
+ echo '<td class="cell_info"></td>';
+ echo '<td class="cell_info"></td>';
}
- echo '<td class="anl_ac anl_br'.$cssBck.'">'.'</td>';
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">'.'</td>';
+
+ echo '<td class="cell_value"></td>';
+ echo '<td class="cell_value"></td>';
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br'.$cssBck.' anl_pr10">'.'</td>';
+ echo '<td class="cell_value"></td>';
}
- echo '<td class="anl_ar'.$cssBck.' anl_pr10">'.'</td>';
+ echo '<td class="cell_value"></td>';
+
echo '</tr>';
}
}
$counter++;
+
return $counter;
}
+ // Zadnja osnovna vrstica - suma z razipranjem missingov
static function outputSumaValidAnswerVertical($counter,$_sequence,$spid,$_options=array()) {
global $lang;
+
# opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
- 'isOtherAnswer' => false, # ali je odgovor Drugo
- 'inline_legenda' => true, # ali je legenda inline ali v headerju
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
+ 'isOtherAnswer' => false, # ali je odgovor Drugo
+ 'inline_legenda' => true, # ali je legenda inline ali v headerju
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- // $cssBck = ' '.self::$cssColors['0_' . ($counter & 1)]; $_percent = (self::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['validCnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
- $cssBck = ' '.self::$cssColors['text_1'];
-
$_brez_MV = ((int)self::$missingProfileData['display_mv_type'] === 0 ) ? TRUE : FALSE;
$_hide_minus = ((int)self::$missingProfileData['display_mv_type'] === 2 ) ? TRUE : FALSE;
$value =((int)self::$missingProfileData['display_mv_type'] === 0 ) ? 0 : 1;
@@ -4535,203 +5038,218 @@ class SurveyAnalysis {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
- echo '<tr id="anl_click_missing_tr_'.$_sequence.$_sufix.'" class="'.($_brez_MV ? 'anl_bb' : 'anl_dash_red_bb').'">';
- echo '<td class="anl_bl anl_br anl_al gray anl_ti_20'.$cssBck.'">'.$lang['srv_anl_valid'];
+ echo '<tr id="anl_click_missing_tr_'.$_sequence.$_sufix.'" class="row_var row_sum '.($_brez_MV ? 'anl_bb' : 'anl_dash_red_bb').'">';
- echo '<span id="click_missing_'.$_sequence.$_sufix.'" class="anl_click_missing gray'.($_brez_MV ? '' : ' displayNone').'" value="'.$value.'">&nbsp;&nbsp;<span class="faicon plus_orange icon-orange_hover_red folder_plusminus"></span></span>';
- echo '<span id="single_missing_title_'.$_sequence.$_sufix.'" class="anl_click_missing_hide gray'.($_brez_MV || $_hide_minus? ' displayNone' : '').'">&nbsp;&nbsp;<span class="faicon minus_orange icon-orange_hover_red folder_plusminus"></span></span>';
+ echo '<td class="cell_missing">';
+ echo ' <span id="click_missing_'.$_sequence.$_sufix.'" class="anl_click_missing '.($_brez_MV ? '' : ' displayNone').'" value="'.$value.'"><span class="faicon arrow2_d"></span>'.$lang['srv_anl_valid'].'</span>';
echo '</td>';
- echo '<td class="anl_br anl_al anl_ita red'.$cssBck.'" >'.$lang['srv_anl_suma1'].'</td>';
+ echo '<td class="cell_question">'.$lang['srv_anl_suma1'].'</td>';
-
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
- echo '<th class="anl_ita red anl_br anl_ac'.$cssBck.'">&nbsp;</th>';
- echo '<th class="anl_ita red anl_br anl_ac'.$cssBck.'">&nbsp;</th>';
+ echo '<td class="cell_info">/</td>';
+ echo '<td class="cell_info">/</td>';
}
- echo '<td class="anl_ita red anl_br anl_ac'.$cssBck.'" >';
- echo self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ? self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ echo '<td class="cell_value">';
+ echo (isset(self::$_FREQUENCYS[$_sequence]['validCnt'])?self::$_FREQUENCYS[$_sequence]['validCnt']:0) > 0 ? self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
echo '</td>';
+
$_percent = self::$_FREQUENCYS[$_sequence]['allCnt'] > 0
- ? 100 * self::$_FREQUENCYS[$_sequence]['validCnt'] / self::$_FREQUENCYS[$_sequence]['allCnt']
- : 0;
- echo '<td class="anl_ita red anl_br anl_ar'.$cssBck.' anl_pr10">' . self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
+ ? 100 * (isset(self::$_FREQUENCYS[$_sequence]['validCnt'])?self::$_FREQUENCYS[$_sequence]['validCnt']:0) / self::$_FREQUENCYS[$_sequence]['allCnt']
+ : 0;
+ echo '<td class="cell_value">' . self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_ita red anl_br anl_ar'.$cssBck.' anl_pr10">' . self::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
+ echo '<td class="cell_value">' . self::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
}
- echo '<td class="anl_ita red anl_ac'.$cssBck.'">&nbsp;</td>';
+ echo '<td class="cell_value">/</td>';
+
echo '</tr>';
- // $counter++;
- return $counter;
+ return $counter;
}
+ // Vrstica s posamezno missing vrednostjo
static function outputInvalidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_options=array()) {
global $lang;
+
# opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
- 'isOtherAnswer' => false, # ali je odgovor Drugo
- 'inline_legenda' => true, # ali je legenda inline ali v headerju
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
+ 'isOtherAnswer' => false, # ali je odgovor Drugo
+ 'inline_legenda' => true, # ali je legenda inline ali v headerju
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- //$cssBck = ' '.self::$cssColors['text_' . ($counter & 1)];
- $cssBck = ' '.self::$cssColors['0_' . ($counter & 1)];
$_percent = (self::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_invalid = (self::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ) ? 100*$vAnswer['cnt'] / self::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
$_sufix = (self::$podstran == M_ANALYSIS_SUMMARY_NEW ? '_NEW' : '');
- # da deluje razpiranje manjkajočih tudi kadar imamo skupine
+
+ # da deluje razpiranje manjkajočih tudi kadar imamo skupine
if (isset(self::$_CURRENT_LOOP['cnt'])) {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
$_Z_MV = ((int)self::$missingProfileData['display_mv_type'] === 2) ? TRUE : FALSE;
- echo '<tr name="missing_detail_'.$_sequence.$_sufix.'"'.($_Z_MV ? '': ' class="displayNone"').'>';
- echo '<td class="anl_bl anl_br anl_ac gray" style="width:10px">&nbsp;</td>';
- echo '<td class="anl_br'.$cssBck.'">';
- echo '<div class="floatLeft"><div class="anl_tin2">'.'<span class="anl_user_text">' . $vkey . '</span>' . ' (' . $vAnswer['text'].')'.'</div></div>';
- echo '<div class="floatRight anl_detail_percent anl_w50 anl_ac anl_dash_bl">'.self::formatNumber($_invalid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%').'</div>';
- echo '<div class="floatRight anl_detail_percent anl_w30 anl_ac">'.$vAnswer['cnt'].'</div>';
+
+ echo '<tr name="missing_detail_'.$_sequence.$_sufix.'" class="row_var row_missing '.($_Z_MV ? '': 'displayNone').'">';
+
+ echo '<td class="cell_noVerBorder"></td>';
+
+ echo '<td class="row_question">';
+ echo ' <div class="floatLeft"><div class="anl_tin2">'.'<span class="anl_user_text">' . $vkey . '</span>' . ' (' . $vAnswer['text'].')'.'</div></div>';
+ //echo ' <div class="floatRight anl_detail_percent anl_w50 anl_ac anl_dash_bl">'.self::formatNumber($_invalid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%').'</div>';
+ //echo ' <div class="floatRight anl_detail_percent anl_w30 anl_ac">'.$vAnswer['cnt'].'</div>';
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
- echo '<th class="anl_ac anl_br'.$cssBck.'">&nbsp;</th>';
- echo '<th class="anl_ac anl_br'.$cssBck.'">&nbsp;</th>';
+ echo '<td class="cell_info">/</td>';
+ echo '<td class="cell_info">/</td>';
}
- echo '<td class="anl_ac anl_br'.$cssBck.'">';
+
+ echo '<td class="cell_value">';
echo (int)$vAnswer['cnt'];
echo '</td>';
- echo '<td class="anl_ar anl_br'.$cssBck.'">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
+
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br anl_detail_percent anl_ita'.$cssBck.'">';
- echo '&nbsp;';
- echo '</td>';
+ echo '<td class="cell_value">/</td>';
}
- echo '<td class="'.$cssBck.'" >';
- echo '&nbsp;';
- echo '</td>';
+
+ echo '<td class="cell_value">/</td>';
+
echo '</tr>';
+
$counter++;
+
return $counter;
}
+ // Zadnja vrstica manjkajocih vrednosti - suma manjkajocih
static function outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$_options = array()) {
global $lang;
+
# opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
- 'isOtherAnswer' => false, # ali je odgovor Drugo
- 'inline_legenda' => true, # ali je legenda inline ali v headerju
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
+ 'isOtherAnswer' => false, # ali je odgovor Drugo
+ 'inline_legenda' => true, # ali je legenda inline ali v headerju
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- //$cssBck = ' '.self::$cssColors['text_' . ($counter & 1)];
- $cssBck = ' '.self::$cssColors['text_1'];
- $_percent = (self::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*self::$_FREQUENCYS[$_sequence]['invalidCnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['allCnt']) && self::$_FREQUENCYS[$_sequence]['allCnt'] > 0 && isset(self::$_FREQUENCYS[$_sequence]['invalidCnt']))
+ $_percent = 100*self::$_FREQUENCYS[$_sequence]['invalidCnt'] / self::$_FREQUENCYS[$_sequence]['allCnt'];
+ else
+ $_percent = 0;
$_brez_MV = ((int)self::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
$_hide_minus = ((int)self::$missingProfileData['display_mv_type'] === 1 || (int)self::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
$_sufix = (self::$podstran == M_ANALYSIS_SUMMARY_NEW ? '_NEW' : '');
- # da deluje razpiranje manjkajočih tudi kadar imamo skupine
+
+ # da deluje razpiranje manjkajočih tudi kadar imamo skupine
if (isset(self::$_CURRENT_LOOP['cnt'])) {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
- echo '<tr id="click_missing_1_'.$_sequence.$_sufix.'" class="anl_dash_red_bb'.($_brez_MV ?' displayNone' : '').'">';
- echo '<td class="anl_bl anl_al anl_br gray anl_ti_20'.$cssBck.'">';
+ echo '<tr id="click_missing_1_'.$_sequence.$_sufix.'" name="missing_detail_'.$_sequence.'" class="row_var row_missing row_sum '.($_brez_MV ? 'displayNone' : '').'">';
+
+ echo '<td class="cell_var cell_noVerBorder">';
echo $lang['srv_anl_missing'];
echo '</td>';
- echo '<td class="anl_br anl_ita red'.$cssBck.'" >';
- echo $lang['srv_analiza_manjkajocevrednosti'];
- // podrobno za missinge
- echo '<span id="single_missing_0'.$_sequence.$_sufix.'" class="printHide anl_ita anl_detail_percent'.($_hide_minus ? '' : ' displayNone').'">&nbsp;&nbsp;';
- echo '<a href="#single_missing_'.$_sequence.$_sufix.'" onclick="show_single_missing(\''.$_sequence.$_sufix.'\', 0);return false;" > ' ;
- //echo $lang['srv_analiza_missingSpremenljivke'] ;
- echo ' <span class="faicon plus_orange icon-orange_hover_red folder_plusminus"></span> </a>';
- echo '</span>';
- echo '<span id="single_missing_1'.$_sequence.$_sufix.'" class="printHide anl_ita anl_detail_percent'.($_hide_minus ? ' displayNone' : '').'">&nbsp;&nbsp;';
- echo '<a href="#single_missing_'.$_sequence.$_sufix.'" onclick="show_single_missing(\''.$_sequence.$_sufix.'\', 1);return false;" > ' ;
- // echo $lang['srv_analiza_missingSpremenljivke'] ;
- echo ' <span class="faicon minus_orange icon-orange_hover_red folder_plusminus"></span> </a>';
- echo '</span>';
- echo '<div id="single_missing_suma_'.$_sequence.$_sufix.'" class="floatRight anl_w50 anl_dash_bl anl_dash_bt anl_ac anl_detail_percent displayNone">100.0%</div>';
- echo '<div id="single_missing_suma_freq_'.$_sequence.$_sufix.'" class="floatRight anl_w30 anl_dash_bt anl_ac anl_detail_percent displayNone">'.self::$_FREQUENCYS[$_sequence]['invalidCnt'].'</div>';
+ echo '<td class="cell_question">';
+ echo $lang['srv_analiza_manjkajocevrednosti'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
- echo '<th class="anl_ac anl_br anl_ita red'.$cssBck.'">&nbsp;</th>';
- echo '<th class="anl_ac anl_br anl_ita red'.$cssBck.'">&nbsp;</th>';
+ echo '<td class="cell_info">&nbsp;</td>';
+ echo '<td class="cell_info">&nbsp;</td>';
}
- echo '<td class="anl_ac anl_br anl_detail_cnt anl_ita red'.$cssBck.'">';
- $answer['cnt'] = self::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ? self::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
+ echo '<td class="cell_value">';
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['invalidCnt']) && self::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0)
+ $answer['cnt'] = self::$_FREQUENCYS[$_sequence]['invalidCnt'];
+ else
+ $answer['cnt'] = 0;
+
echo (int)$answer['cnt'];
echo '</td>';
- echo '<td class="anl_ar anl_br anl_ita red'.$cssBck.' anl_pr10">';
+
+ echo '<td class="cell_value">';
echo self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
+
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br anl_ita red'.$cssBck.' anl_pr10">';
- echo '<span id="single_missing_percent_'.$_sequence.$_sufix.'" class="'.($detail ? 'displayNone' : '' ).'">&nbsp;</span>';
- echo '</td>';
+ echo '<td class="cell_value">/</td>';
}
- echo '<td class="anl_ar anl_ita red'.$cssBck.' anl_pr10">&nbsp;</td>';
+ echo '<td class="cell_value">/</td>';
+
echo '</tr>';
+
$counter++;
+
return $counter;
}
+ // Cisto zadnja vrstica - suma vseh (manjkajoce + navadne)
static function outputSumaVertical($counter,$_sequence,$spid, $_options = array()) {
global $lang;
- # opcije
- $options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
- 'isOtherAnswer' => false, # ali je odgovor Drugo
- 'inline_legenda' => true, # ali je legenda inline ali v headerju
+ # opcije
+ $options = array(
+ 'isTextAnswer' => false, # ali je tekstovni odgovor
+ 'isOtherAnswer' => false, # ali je odgovor Drugo
+ 'inline_legenda' => true, # ali je legenda inline ali v headerju
);
+
foreach ($_options as $_oKey => $_option) {
$options[$_oKey] = $_option;
}
- // $cssBck = ' '.self::$cssColors['0_' .($counter & 1)];
- $cssBck = ' anl_bck_text_0';
$_brez_MV = ((int)self::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
$_sufix = (self::$podstran == M_ANALYSIS_SUMMARY_NEW ? '_NEW' : '');
+
# da deluje razpiranje manjkajočih tudi kadar imamo skupine
if (isset(self::$_CURRENT_LOOP['cnt'])) {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
- echo '<tr id="click_missing_suma_'.$_sequence.$_sufix.'" class="'.($_brez_MV ? 'displayNone' : '').'">';
- //echo '<td class="anl_bl anl_ac anl_dash_bt anl_br anl_bb gray">&nbsp;</td>'; // $lang['srv_anl_appropriate']
- //echo '<td class="anl_al anl_dash_bt anl_br anl_bb red anl_ita'.$cssBck.'">'.$lang['srv_anl_suma2'].'</td>';
- echo '<td class="anl_bl anl_ac anl_dash_bt anl_bb red anl_ita'.$cssBck.'">'.$lang['srv_anl_suma2'].'</td>';
- echo '<td class="anl_dash_bt anl_br anl_bb'.$cssBck.'">&nbsp;</td>';
+ echo '<tr id="click_missing_suma_'.$_sequence.$_sufix.'" name="missing_detail_'.$_sequence.'" class="row_sum_all '.($_brez_MV ? 'displayNone' : '').'">';
+
+ echo '<td class="cell_var">'.$lang['srv_anl_suma2'].'</td>';
+
+ echo '<td class="cell_question"></td>';
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
- echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita'.$cssBck.'" >&nbsp;</td>';
- echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita'.$cssBck.'" >&nbsp;</td>';
+ echo '<td class="cell_info">/</td>';
+ echo '<td class="cell_info">/</td>';
}
- echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.'" >' . (self::$_FREQUENCYS[$_sequence]['allCnt'] ? self::$_FREQUENCYS[$_sequence]['allCnt'] : 0) . '</td>';
- echo '<td class="anl_ar anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.' anl_pr10">' . self::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
+
+ echo '<td class="cell_value">' . (self::$_FREQUENCYS[$_sequence]['allCnt'] ? self::$_FREQUENCYS[$_sequence]['allCnt'] : 0) . '</td>';
+ echo '<td class="cell_value">' . self::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.' anl_pr10">&nbsp;</td>';
+ echo '<td class="cell_value">/</td>';
}
- echo '<td class="anl_ac anl_dash_bt anl_bb anl_ita red'.$cssBck.'">&nbsp;</td>';
- echo '</tr>';
+ echo '<td class="cell_value">/</td>';
+ echo '</tr>';
}
-
- static function outputSumaValidAnswerHeatmap($counter,$_sequence,$spid,$_options=array(), $validHeatmapRegion) {
+ static function outputSumaValidAnswerHeatmap($counter,$_sequence,$spid=0,$_options=array(), $validHeatmapRegion=null) {
global $lang;
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
@@ -4769,28 +5287,16 @@ class SurveyAnalysis {
echo '<th class="anl_ita red anl_br anl_ac'.$cssBck.'">&nbsp;</th>';
}
- //Veljavni - Skupaj
+ // Veljavni - Skupaj
echo '<td class="anl_ita red anl_br anl_ac'.$cssBck.'" >';
echo $validHeatmapRegion;
- //echo self::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ? self::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
echo '</td>';
-
-/* $_percent = self::$_FREQUENCYS[$_sequence]['allCnt'] > 0
- ? 100 * self::$_FREQUENCYS[$_sequence]['validCnt'] / self::$_FREQUENCYS[$_sequence]['allCnt']
- : 0;
- echo '<td class="anl_ita red anl_br anl_ar'.$cssBck.' anl_pr10">' . self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
- if (self::$_HEADERS[$spid]['show_valid_percent'] == true) {
- echo '<td class="anl_ita red anl_br anl_ar'.$cssBck.' anl_pr10">' . self::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
- }
- echo '<td class="anl_ita red anl_ac'.$cssBck.'">&nbsp;</td>'; */
- echo '</tr>';
- // $counter++;
return $counter;
}
- static function outputInvalidAnswerHeatmap($counter,$vkey,$vAnswer,$_sequence,$spid,$_options=array(), $manjkajoci) {
+ static function outputInvalidAnswerHeatmap($counter,$vkey,$vAnswer,$_sequence,$spid,$_options=array(), $manjkajoci=null) {
global $lang;
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
@@ -4843,7 +5349,7 @@ class SurveyAnalysis {
return $counter;
}
- static function outputSumaInvalidAnswerHeatmap($counter,$_sequence,$spid,$_options = array(), $manjkajoci) {
+ static function outputSumaInvalidAnswerHeatmap($counter,$_sequence,$spid,$_options = array(), $manjkajoci=null) {
global $lang;
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
@@ -4866,54 +5372,25 @@ class SurveyAnalysis {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
- echo '<tr id="click_missing_1_'.$_sequence.$_sufix.'" class="anl_dash_red_bb'.($_brez_MV ?' displayNone' : '').'">';
+ echo '<tr id="click_missing_1_'.$_sequence.$_sufix.'" name="missing_detail_'.$_sequence.'" class="anl_dash_red_bb'.($_brez_MV ?' displayNone' : '').'">';
echo '<td class="anl_bl anl_al anl_br gray anl_ti_20'.$cssBck.'">';
echo $lang['srv_anl_missing'];
echo '</td>';
echo '<td class="anl_br anl_ita red'.$cssBck.'" >';
- echo $lang['srv_analiza_manjkajocevrednosti'];
-
- // podrobno za missinge
- echo '<span id="single_missing_0'.$_sequence.$_sufix.'" class="printHide anl_ita anl_detail_percent'.($_hide_minus ? '' : ' displayNone').'">&nbsp;&nbsp;';
- echo '<a href="#single_missing_'.$_sequence.$_sufix.'" onclick="show_single_missing(\''.$_sequence.$_sufix.'\', 0);return false;" > ' ;
- //echo $lang['srv_analiza_missingSpremenljivke'] ;
- echo ' <span class="faicon plus_orange icon-orange_hover_red folder_plusminus"></span> </a>';
- echo '</span>';
- echo '<span id="single_missing_1'.$_sequence.$_sufix.'" class="printHide anl_ita anl_detail_percent'.($_hide_minus ? ' displayNone' : '').'">&nbsp;&nbsp;';
- echo '<a href="#single_missing_'.$_sequence.$_sufix.'" onclick="show_single_missing(\''.$_sequence.$_sufix.'\', 1);return false;" > ' ;
- // echo $lang['srv_analiza_missingSpremenljivke'] ;
- echo ' <span class="faicon minus_orange icon-orange_hover_red folder_plusminus"></span> </a>';
- echo '</span>';
-
- echo '<div id="single_missing_suma_'.$_sequence.$_sufix.'" class="floatRight anl_w50 anl_dash_bl anl_dash_bt anl_ac anl_detail_percent displayNone">100.0%</div>';
- //echo '<div id="single_missing_suma_freq_'.$_sequence.$_sufix.'" class="floatRight anl_w30 anl_dash_bt anl_ac anl_detail_percent displayNone">'.self::$_FREQUENCYS[$_sequence]['invalidCnt'].'</div>';
- echo '<div id="single_missing_suma_freq_'.$_sequence.$_sufix.'" class="floatRight anl_w30 anl_dash_bt anl_ac anl_detail_percent displayNone">'.$manjkajoci.'</div>';
+ echo $lang['srv_analiza_manjkajocevrednosti'];
echo '</td>';
+
if (self::$_SHOW_LEGENDA && $options['isOtherAnswer'] == false && $options['inline_legenda'] == true) {
echo '<th class="anl_ac anl_br anl_ita red'.$cssBck.'">&nbsp;</th>';
echo '<th class="anl_ac anl_br anl_ita red'.$cssBck.'">&nbsp;</th>';
}
- //Mankajoci - Skupaj
+ // Mankajoci - Skupaj
echo '<td class="anl_ac anl_br anl_detail_cnt anl_ita red'.$cssBck.'">';
- echo $manjkajoci;
- //$answer['cnt'] = self::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ? self::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
- //echo (int)$answer['cnt'];
- echo '</td>';
-
- //stolpec "Veljavni kliki"
-/* echo '<td class="anl_ar anl_br anl_ita red'.$cssBck.' anl_pr10">';
- echo self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo $manjkajoci;
echo '</td>';
- */
-
-/* if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_br anl_ita red'.$cssBck.' anl_pr10">';
- echo '<span id="single_missing_percent_'.$_sequence.$_sufix.'" class="'.($detail ? 'displayNone' : '' ).'">&nbsp;</span>';
- echo '</td>';
- } */
echo '<td class="anl_ar anl_ita red'.$cssBck.' anl_pr10">&nbsp;</td>';
echo '</tr>';
@@ -4921,7 +5398,7 @@ class SurveyAnalysis {
return $counter;
}
- static function outputSumaHeatmap($counter,$_sequence,$spid, $_options = array(), $ustrezniHeatmapRegion) {
+ static function outputSumaHeatmap($counter,$_sequence,$spid, $_options = array(), $ustrezniHeatmapRegion=null) {
global $lang;
# opcije
@@ -4943,9 +5420,7 @@ class SurveyAnalysis {
$_sufix = '_loop'.self::$_CURRENT_LOOP['cnt'].$_sufix;
}
- echo '<tr id="click_missing_suma_'.$_sequence.$_sufix.'" class="'.($_brez_MV ? 'displayNone' : '').'">';
- //echo '<td class="anl_bl anl_ac anl_dash_bt anl_br anl_bb gray">&nbsp;</td>'; // $lang['srv_anl_appropriate']
- //echo '<td class="anl_al anl_dash_bt anl_br anl_bb red anl_ita'.$cssBck.'">'.$lang['srv_anl_suma2'].'</td>';
+ echo '<tr id="click_missing_suma_'.$_sequence.$_sufix.'" name="missing_detail_'.$_sequence.'" class="'.($_brez_MV ? 'displayNone' : '').'">';
echo '<td class="anl_bl anl_ac anl_dash_bt anl_bb red anl_ita'.$cssBck.'">'.$lang['srv_anl_suma2'].'</td>';
echo '<td class="anl_dash_bt anl_br anl_bb'.$cssBck.'">&nbsp;</td>';
@@ -4954,18 +5429,10 @@ class SurveyAnalysis {
echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita'.$cssBck.'" >&nbsp;</td>';
}
- //SKUPAJ
+ // SKUPAJ
echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.'" >' .$ustrezniHeatmapRegion. '</td>';
-
- //echo '<td class="anl_ac anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.'" >' . (self::$_FREQUENCYS[$_sequence]['allCnt'] ? self::$_FREQUENCYS[$_sequence]['allCnt'] : 0) . '</td>';
-
- //echo '<td class="anl_ar anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.' anl_pr10">' . self::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%') . '</td>';
- /*if (self::$_HEADERS[$spid]['show_valid_percent']) {
- echo '<td class="anl_ar anl_dash_bt anl_br anl_bb anl_ita red'.$cssBck.' anl_pr10">&nbsp;</td>';
- } */
- //echo '<td class="anl_ac anl_dash_bt anl_bb anl_ita red'.$cssBck.'">&nbsp;</td>';
- echo '</tr>';
+ echo '</tr>';
}
/** izpišemo tabelo z tekstovnimi odgovori drugo
@@ -5094,413 +5561,305 @@ class SurveyAnalysis {
}
- static public function showIcons($spid, $spremenljivka, $_from = 'freq', $additional=array()) {
+ // Ikone s povezavami na posamezno tabelo analize (popup)
+ static public function showIcons($spid, $spremenljivka, $_from='freq', $additional=array(), $onlyicons = false) {
global $lang;
-
- $sccFloat = 'taCenter ';
- #kateri skin
- $skin = 0;
- $options = array('sums'=>true,'sums*'=>true,'desc'=>true,'freq'=>true,'sums_spec'=>false);
+
+ // Javna povezava nima teh ikon
+ if (self::$printPreview != false)
+ return;
+
$from_navedbe = (isset($additional['navedbe']) && $additional['navedbe'] == true) ? true : false;
$showReport = (isset($additional['noReport']) && $additional['noReport'] == true) ? false: true;
$showChart = (isset($additional['showChart']) && $additional['showChart'] == false) ? false: true;
$printIcon = (isset($additional['printIcon']) && $additional['printIcon'] == true) ? true: false;
- if ($_from == 'para') {
- $showReport = false;
- }
-
- switch ($_from) {
- case 'freq':
- case 'para':
- case 'charts':
- switch ($spremenljivka['tip']) {
- case 1: # radio - prikjaže navpično
- if ($spremenljivka['show_valid_percent'] == true && $spremenljivka['skala'] != 1) {
- # če za ordinalno prikazujemo povprečje in st. oddklon
- $options['sums'] = true;
- $options['sums*'] = true;
- } else {
- # za nominalno ne prikazujemo povprečje in st. oddklon, zato je F == F*
- $options['sums'] = false;
- $options['sums*'] = false;
- }
- break;
- case 2: #checkbox če je dihotomna:
- break;
- case 3: # dropdown - prikjaže navpično
- break;
- case 6: # multigrid
- $options['sums*'] = false;
- if ( $spremenljivka['enota'] == 3 ) {
- $options['sums_spec'] = true;
- }
- break;
- case 7: # variabla tipa »število«
- $options['sums*'] = false;
- break;
- case 8: # datum
- $options['sums'] = false;
- $options['sums*'] = false;
- break;
- case 16: #multicheckbox če je dihotomna:
- break;
- case 17: #razvrščanje če je ordinalna
- $options['sums'] = false;
- break;
- case 18: # vsota
- $options['sums*'] = false;
- break;
- case 19: # multitext
- $options['sums*'] = false;
- break;
- case 20: # multi number
+ $options = array();
+
+ // Texti z ikono
+ $texts = $onlyicons ? array(
+ 'freq' => '<span class="faicon an_freq right8" title="'.$lang['srv_frequency'].'"></span>',
+ 'freq*' => '<span class="faicon an_freqx right8" title="'.$lang['srv_frequency*'].'"></span>',
+ 'desc' => '<span class="faicon an_desc right8" title="'.$lang['srv_descriptor'].'"></span>',
+ 'table' => '<span class="faicon an_sigma right8" title="'.$lang['srv_table'].'"></span>',
+ 'table*' => '<span class="faicon an_sigmax right8" title="'.$lang['srv_table*'].'"></span>',
+ 'table_ver' => '<span class="faicon an_sigma_ver right8" title="'.$lang['srv_table_ver'].'"></span>',
+ 'text' => '<span class="faicon an_text right8" title="'.$lang['srv_text_only'].'"></span>',
+ 'chart' => '<span class="faicon an_chart right8" title="'.$lang['srv_chart'].'"></span>',
+ ) :
+ array(
+ 'freq' => '<span class="faicon an_freq"></span> <span class="text">'.$lang['srv_frequency'].'</span>',
+ 'freq*' => '<span class="faicon an_freqx"></span> <span class="text">'.$lang['srv_frequency*'].'</span>',
+ 'desc' => '<span class="faicon an_desc"></span> <span class="text">'.$lang['srv_descriptor'].'</span>',
+ 'table' => '<span class="faicon an_sigma"></span> <span class="text">'.$lang['srv_table'].'</span>',
+ 'table*' => '<span class="faicon an_sigmax"></span> <span class="text">'.$lang['srv_table*'].'</span>',
+ 'table_ver' => '<span class="faicon an_sigma_ver"></span> <span class="text">'.$lang['srv_table_ver'].'</span>',
+ 'text' => '<span class="faicon an_text"></span> <span class="text">'.$lang['srv_text_only'].'</span>',
+ 'chart' => '<span class="faicon an_chart"></span> <span class="text">'.$lang['srv_chart'].'</span>',
+ );
- break;
- case 4: # text
- case 21: # besedilo*
- if ($spremenljivka['cnt_all'] == 1) {
- // če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 26: # lokacija
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 27: # heatmap
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 22: # kalkulacija
- case 25: # kvota
- $options['sums*'] = false;
- break; # kalkulacija
+ // Parameter za odpiranje pravega popupa
+ $links = array(
+ 'freq' => M_ANALYSIS_FREQUENCY,
+ 'freq*' => M_ANALYSIS_SUMMARY,
+ 'desc' => M_ANALYSIS_DESCRIPTOR,
+ 'table' => M_ANALYSIS_SUMMARY_NEW,
+ 'table*' => M_ANALYSIS_SUMMARY_NEW,
+ 'table_ver' => M_ANALYSIS_SUMMARY_NEW,
+ 'text' => 'text',
+ 'chart' => M_ANALYSIS_CHARTS,
+ );
+
+
+ // Nastavimo katere opcije imamo glede na tip vprasanja
+ switch ($spremenljivka['tip']) {
+
+ // radio in dropdown
+ case 1:
+ case 3:
+ // ordinalna
+ if ($spremenljivka['skala'] != 1) {
+ $options['base'] = 'freq';
+ $options['additional'][0] = 'desc';
+ $options['additional'][1] = 'chart';
+ }
+ // nominalna
+ else {
+ $options['base'] = 'freq';
+ $options['additional'][1] = 'chart';
}
- $export = ($_from == 'charts') ? 'charts' : 'frequency';
break;
- case 'desc':
- switch ($spremenljivka['tip']) {
- case 1: # radio - prikjaže navpično
- if ($spremenljivka['skala'] == 1) {
- $options['sums'] = false;
- $options['sums*'] = false;
- }
- break;
- case 2: #checkbox če je dihotomna:
- break;
- case 3: # dropdown - prikjaže navpično
- break;
- case 6: # multigrid
- $options['sums*'] = false;
- if ( $spremenljivka['enota'] == 3 ) {
- $options['sums_spec'] = true;
- }
- break;
- case 7: # variabla tipa »število«
- $options['sums*'] = false;
- break;
- case 8: # datum
- $options['sums'] = false;
- $options['sums*'] = false;
- break;
- case 16: #multicheckbox če je dihotomna:
- break;
- case 17: #razvrščanje če je ordinalna
- $options['sums'] = false;
- break;
- case 18: # vsota
- $options['sums*'] = false;
- break;
- case 19: # multitext
- $options['sums*'] = false;
- break;
- case 20: # multi number
- break;
- case 4: # text
- case 21: # besedilo*
- if ($spremenljivka['cnt_all'] == 1) {
- // če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 26: # Lokacija
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 27: # heatmap
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- break;
- case 22: # kalkulacija
- case 25: # kvota
- $options['sums*'] = false;
- break; # kalkulacija
+
+ // checkbox
+ case 2:
+ $options['base'] = 'freq*';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ $options['additional'][2] = 'table';
+ $options['additional'][3] = 'chart';
+ break;
+
+ // multigrid
+ case 6:
+ // ordinalna
+ if ($spremenljivka['skala'] != 1) {
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ $options['additional'][2] = 'chart';
+
+ // Dvojna tabela
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 3){
+ $options['additional'][2] = 'table_ver';
+ $options['additional'][3] = 'chart';
+
+ $links['table'] = M_ANALYSIS_SUMMARY;
+ }
+ }
+ // nominalna
+ else {
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'chart';
+
+ // Dvojna tabela
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 3){
+ $options['additional'][1] = 'table_ver';
+ $options['additional'][2] = 'chart';
+
+ $links['table'] = M_ANALYSIS_SUMMARY;
+ }
}
- $export = 'statistics';
break;
- case 'sums':
- switch ($spremenljivka['tip']) {
- case 1: # radio - prikjaže navpično
- if ($spremenljivka['skala'] == 1) {
- $options['sums'] = false;
- $options['sums*'] = false;
- $_from = 'freq';
- } else {
- $_from = 'sums*';
- }
- break;
- case 2: #checkbox če je dihotomna
- $_from = 'sums*';
- break;
- case 3: # dropdown - prikjaže navpično
- break;
- case 6: # multigrid
- $options['sums*'] = false;
- if ( $spremenljivka['enota'] == 3 ) {
- $options['sums_spec'] = true;
- $_from = 'sums*';
- }
- break;
- case 7: # variabla tipa »število«
- $options['sums*'] = false;
- break;
- case 8: # datum
- $options['sums'] = false;
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 16: #multicheckbox če je dihotomna
- break;
- case 17: #razvrščanje če je ordinalna
- $options['sums'] = false;
- $_from = 'sums*';
- break;
- case 18: # vsota
- $options['sums*'] = false;
- break;
- case 19: # multitext
- $options['sums*'] = false;
- break;
- case 20: # multi number
- break;
- case 21: # besedilo*
- $_from = 'sums';
- if ($spremenljivka['cnt_all'] == 1) {
- // če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- $options['sums'] = false;
- $_from = 'freq';
- }
+ // number
+ case 7:
+ $options['base'] = 'desc';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'chart';
+ break;
- $options['sums*'] = false;
- break;
- case 26: # lokacija
- $_from = 'sums';
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- $_from = 'freq';
- }
+ // datum
+ case 8:
+ $options['base'] = 'freq';
+ $options['additional'][0] = 'desc';
+ break;
- $options['sums*'] = false;
- break;
- case 27: # heatmap
- $_from = 'sums';
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- $_from = 'freq';
- }
+ // multicheckbox
+ case 16:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ $options['additional'][2] = 'freq*';
+ $options['additional'][3] = 'chart';
+
+ $links['table'] = M_ANALYSIS_SUMMARY;
+ $links['freq*'] = M_ANALYSIS_SUMMARY_NEW;
- $options['sums*'] = false;
- break;
- case 4: # text
- $options['sums'] = false;
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 22: # kalkulacija
- case 25: # kvota
- $options['sums*'] = false;
- break; # kalkulacija
- }
- $export = 'sums';
break;
- case 'sums*':
- switch ($spremenljivka['tip']) {
- case 1: # radio - prikjaže navpično
- if ($spremenljivka['skala'] == 1) {
- $options['sums'] = false;
- $options['sums*'] = false;
- $_from = 'freq';
- } else {
- $_from = 'sums';
- }
- break;
- case 2: #checkbox če je dihotomna:
- $_from = 'sums';
- break;
- case 3: # dropdown - prikjaže navpično
- break;
- case 6: # multigrid
- $options['sums*'] = false;
- if ( $spremenljivka['enota'] == 3 ) {
- $options['sums_spec'] = true;
- $_from = 'sums';
- }
- break;
- case 7: # variabla tipa »število«
- $options['sums*'] = false;
- $_from = 'sums';
- break;
- case 8: # datum
- $options['sums'] = false;
- $options['sums*'] = false;
- break;
-
- case 16: #multicheckbox če je dihotomna:
- break;
- case 17: #razvrščanje če je ordinalna
- $options['sums'] = false;
- break;
- case 18: # vsota
- $options['sums*'] = false;
- $_from = 'sums';
- break;
- case 19: # multitext
- $options['sums*'] = false;
- break;
- case 20: # multi number
- break;
- case 4: # text
- $options['sums'] = false;
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 21: # besedilo*
- if ($spremenljivka['cnt_all'] == 1) {
- // če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 26: # lokacija
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 27: # heatmap
- if ($spremenljivka['cnt_all'] == 1) {
- $options['sums'] = false;
- }
- $options['sums*'] = false;
- $_from = 'freq';
- break;
- case 22: # kalkulacija
- case 25: # kvota
- $options['sums*'] = false;
- $_from = 'sums';
- break; # kalkulacija
- }
- $export = 'sums';
+
+ // ranking
+ case 17:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ break;
+
+ // vsota
+ case 18:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ break;
+
+ // multitext
+ case 19:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+
+ $links['table'] = M_ANALYSIS_SUMMARY;
+
+ break;
+
+ // multinumber
+ case 20:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ $options['additional'][2] = 'chart';
+
+ $links['table'] = M_ANALYSIS_SUMMARY;
+
+ break;
+
+ // text
+ case 4:
+ case 21:
+ $options['base'] = 'freq';
+ $options['additional'][0] = 'text';
+ break;
+
+ // lokacija
+ case 26:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ break;
+
+ // heatmap
+ case 27:
+ $options['base'] = 'table';
+ $options['additional'][0] = 'freq';
+ $options['additional'][1] = 'desc';
+ break;
+
+ // kalkulacija
+ case 22:
+ $options['base'] = 'desc';
+ $options['additional'][0] = 'freq';
+
+ $links['desc'] = M_ANALYSIS_SUMMARY;
+ break;
+
+ // kvota
+ case 25:
+ $options['base'] = 'desc';
+ $options['additional'][0] = 'freq';
break;
- case 'none':
+
+ default:
break;
}
-
- // Javna povezava nima teh ikon
- if ($printIcon == false && self::$printPreview == false) {
+
+
+ if(!$onlyicons){
+ // Izrisemo vse ikone za vprasanje
+ echo '<div class="analysis_icons_holder">';
+
+ // Prva vrstica z linkom na osnovni prikaz
+ echo '<div class="icon_line icon_top_line">';
+ echo $lang['srv_analysis_icon_show'].': ';
+ echo ' <a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\', \''.$links[$options['base']].'\', \''.$from_navedbe.'\', \''.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : null).'\', this); return false;">';
+ echo $texts[$options['base']];
+ echo ' </a>';
+ echo '</div>';
- echo '<span class="'.$sccFloat.'printHide iconHide">';
+ echo '<div class="icon_line icon_other_line">';
+ echo $lang['srv_analysis_icon_show_other'];
+ echo '</div>';
- if ($options['sums'] == true) {
- if ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 3 ) {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_SUMMARY_NEW.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- } else {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_SUMMARY.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- }
+ // Ostale vrstice - loop
+ foreach($options['additional'] as $line){
+
+ // Text ima drugo js funkcijo
+ if($links[$line] == 'text')
+ echo ' <div class="icon_line icon_line_standard" onclick="showSpremenljivkaTextAnswersPopup(\''.$spid.'\'); return false;">';
+ else
+ echo ' <div class="icon_line icon_line_standard" onclick="showAnalizaSingleVarPopup(\''.$spid.'\', \''.$links[$line].'\', \''.$from_navedbe.'\', \''.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : null).'\', this); return false;">';
+
+ echo '<div class="icon_line_left">'.$texts[$line].'</div>';
- echo '<span class="faicon an_sigma large '.($_from == 'sums' ? '' : 'icon-blue_soft_link').'" title="' . $lang['srv_analysis_icon_sumary'] . '"></span> ';
- echo '</a>';
- }
+ echo '<div class="icon_line_right"><span class="faicon open_icon"></span></div>';
- if ($options['sums_spec'] == true) {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_SUMMARY_NEW.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- echo '<span class="faicon an_sigmax large '.($_from == 'sums*' ? '' : 'icon-blue_soft_link').'" title="' . $lang['srv_analysis_icon_frequency*'] . '"></span> ';
- echo '</a>';
+ echo '</div>';
}
- if ($options['sums*'] == true) {
- if ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 3) {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_SUMMARY.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- }else {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_SUMMARY_NEW.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- }
- echo '<span class="faicon an_freqx large '.($_from == 'sums*' ? '' : 'icon-blue_soft_link').'" title="' . $lang['srv_analysis_icon_frequency*'] . '"></span> ';
- echo '</a>';
- }
- if ($options['desc'] == true) {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_DESCRIPTOR.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- echo '<span class="faicon an_stat large '.($_from == 'desc' ? '' : 'icon-blue_soft_link').'" title="' . $lang['srv_analysis_icon_descriptor'] . '"></span> ';
- echo '</a>';
- }
- if ($options['freq'] == true) {
- echo '<a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\',\''.M_ANALYSIS_FREQUENCY.'\',\''.$from_navedbe.'\',\''.self::$_CURRENT_LOOP['cnt'].'\'); return false;">';
- echo '<span class="faicon an_freq large '.($_from == 'freq' ? '' : 'icon-blue_soft_link').'" title="' . $lang['srv_analysis_icon_frequency'] . '"></span> ';
- echo '</a>';
- }
+ echo '</div>';
+ }
+ else{
+ // Izrisemo vse ikone za vprasanje
+ echo '<div class="analysis_icons_holder">';
+
+ // Prva vrstica z linkom na osnovni prikaz
+ echo ' <a href="#" onclick="showAnalizaSingleVarPopup(\''.$spid.'\', \''.$links[$options['base']].'\', \''.$from_navedbe.'\', \''.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : null).'\', this); return false;">';
+ echo $texts[$options['base']];
+ echo ' </a>';
+
+ // Ostale vrstice - loop
+ foreach($options['additional'] as $line){
+
+ // Text ima drugo js funkcijo
+ if($links[$line] == 'text')
+ echo ' <a class="icon_line icon_line_standard" onclick="showSpremenljivkaTextAnswersPopup(\''.$spid.'\'); return false;">';
+ else
+ echo ' <a class="icon_line icon_line_standard" onclick="showAnalizaSingleVarPopup(\''.$spid.'\', \''.$links[$line].'\', \''.$from_navedbe.'\', \''.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : null).'\', this); return false;">';
+
+ echo $texts[$line];
- // Ikona za prikaz grafa
- if($showChart == true && in_array($spremenljivka['tip'],array(1,2,3,6,7,8,16,17,18,20,22)) && $_from != 'charts'){
- echo '<a href="#" onclick="showAnalizaSingleChartPopup(\''.$spid.'\',\''.M_ANALYSIS_CHARTS.'\'); return false;">';
- echo '<span class="faicon an_chart_bar icon-blue_soft_link" title="' . $lang['6'] . '"></span> ';
echo '</a>';
}
- // Ikona za vkljucitev v porocilo
- switch ($_from) {
- case 'sums':
- case 'sums*':
- $type=1;
- break;
- case 'freq':
- $type=2;
- break;
- case 'desc':
- $type=3;
- break;
- case 'charts':
- $type=4;
- break;
- }
- if ($showReport == true) {
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type, $sub_type=0, $spid);
- }
-
-
- echo '</span>';
- } else {
-
+ echo '</div>';
}
+
+ return;
}
+ // Preklop enote navedbe
+ static private function showEnoteNavedbe($spid, $status){
+ global $lang;
+
+ echo '<div class="enote-navedbe_holder">';
+
+ echo '<button class="small '.($status=='1' ? 'active' : '').'" title="'.$lang['srv_enote_navedbe_1'].'" onClick="show_navedbe(\''.$spid.'\',\'1\');">'.$lang['srv_analiza_opisne_units'].'</button>';
+ echo '<button class="small '.($status=='2' ? 'active' : '').'" title="'.$lang['srv_enote_navedbe_2'].'" onClick="show_navedbe(\''.$spid.'\',\'2\');">'.$lang['srv_analiza_opisne_arguments'].'</button>';
+
+ echo'</div>';
+ }
+
+ // Preklop frekvence odstotki
+ static private function showFreqPercent($spid){
+ global $lang;
+
+ echo '<div class="freq-p_holder">';
+
+ echo '<button id="freq-p_button_1_'.$spid.'" class="small left active" title="'.$lang['srv_frequency'].'" onClick="show_single_percent(\''.$spid.'\', \'1\');">'.$lang['srv_frequency'].'</button>';
+ echo '<button id="freq-p_button_2_'.$spid.'" class="small right active" title="'.$lang['srv_chart_percent'].'" onClick="show_single_percent(\''.$spid.'\', \'2\');">'.$lang['srv_chart_percent'].'</button>';
+
+ echo'</div>';
+ }
+
/** polovi opisne za vse spremenljivke
*
@@ -5571,7 +5930,7 @@ class SurveyAnalysis {
unlink($tmp_files['frequency']);
}
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
print_r("<pre>");
print_r("cl:".$command);
print_r("<br>Out".$out);
@@ -5591,7 +5950,7 @@ class SurveyAnalysis {
# preverjamo da ni meta variabla
$vars_count = count(self::$_FILTRED_VARIABLES);
# frekvence delamo samo za izbrane variable
- if ($spremenljivka['tip'] != 'm'
+ if (isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
# filter po id spremenljivki
&& ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) )
# filter po tipu (kategorije, besedila, number, drugo)
@@ -5613,8 +5972,10 @@ class SurveyAnalysis {
#najprej odstranimo neveljavne, vse kaj ostane je veljavno
foreach ($_invalidAnswers AS $ikey =>$iAnswer) {
if (isset($_freq[$ikey])) {
- self::$_DESCRIPTIVES[$_sequence]['invalidCnt'] += $_freq[$ikey];
- self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $_freq[$ikey];
+ self::$_DESCRIPTIVES[$_sequence]['invalidCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['invalidCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['invalidCnt']+= $_freq[$ikey] : $_freq[$ikey]);
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['allCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['allCnt']+= $_freq[$ikey] : $_freq[$ikey]);
unset($_freq[$ikey]);
@@ -5624,34 +5985,55 @@ class SurveyAnalysis {
# opcijske odgovore dodamo samo vprašanjem ki niso tipa other in text
# zloopamo skozi vse opcije in jih dodamo k veljavnim
- if ($variable['text'] != true && $variable['other'] != true && count($spremenljivka['options']) > 0) {
+ if ($variable['text'] != true && $variable['other'] != true && isset($spremenljivka['options']) && count($spremenljivka['options']) > 0) {
if (count($_freq) > 0) {
foreach($_freq AS $fKey => $fCnt) {
$flKey = (float)$fKey;
- if (is_numeric($flKey) && trim($flkey) != '' ) {
+ if (is_numeric($flKey) && trim($flKey) != '' ) {
+
+ if(isset(self::$_DESCRIPTIVES[$_sequence]['validCnt']))
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $fCnt;
+ else
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] = $fCnt;
- self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $fCnt;
- self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $fCnt;
+ if(isset(self::$_DESCRIPTIVES[$_sequence]['allCnt']))
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $fCnt;
+ else
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] = $fCnt;
$min = $min === null ? $flKey : min($min,$flKey) ;
$max = $max === null ? $flKey : max($max,$flKey) ;
+
self::$_DESCRIPTIVES[$_sequence]['sum_xi_fi'] += $flKey * $fCnt;
+
#vrednosti si shranimo za računanje divergence
$_tmp_div[$flKey] = $fCnt;
+
unset($_freq[$fKey]);
- } else if (is_numeric($fKey) ) {
- self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $fCnt;
- self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $fCnt;
+ }
+ else if (is_numeric($fKey) ) {
+
+ if(isset(self::$_DESCRIPTIVES[$_sequence]['validCnt']))
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $fCnt;
+ else
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] = $fCnt;
+
+ if(isset(self::$_DESCRIPTIVES[$_sequence]['allCnt']))
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $fCnt;
+ else
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] = $fCnt;
$min = $min === null ? $fKey : min($min,$fKey) ;
$max = $max === null ? $fKey : max($max,$fKey) ;
+
self::$_DESCRIPTIVES[$_sequence]['sum_xi_fi'] += $fKey * $fCnt;
+
#vrednosti si shranimo za računanje divergence
$_tmp_div[$fKey] = $fCnt;
+
unset($_freq[$fKey]);
-
}
}
}
@@ -5663,10 +6045,13 @@ class SurveyAnalysis {
if (count($_freq) > 0) {
foreach ($_freq AS $nkey => $nCnt) {
$fnkey = (float)$nkey; # popravimo morebitne .
-
+
if (is_numeric($nkey) && is_numeric($fnkey) && trim($fnkey) != '') {
- self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $nCnt;
- self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $nCnt;
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['validCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['validCnt']+= $nCnt : $nCnt);
+
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['allCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $nCnt : $nCnt);
$min = $min != null ? min($min,$fnkey) : $fnkey;
$max = $max != null ? max($max,$fnkey) : $fnkey;
@@ -5692,8 +6077,13 @@ class SurveyAnalysis {
self::$_DESCRIPTIVES[$_sequence]['valid'][$tkey] = array('text'=>$text,'cnt'=>$tCnt);
# samo prištejemo veljavne
- self::$_DESCRIPTIVES[$_sequence]['validCnt'] += $tCnt;
- self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $tCnt;
+ self::$_DESCRIPTIVES[$_sequence]['validCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['validCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['validCnt']+= $tCnt : $tCnt);
+
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] = (isset(self::$_DESCRIPTIVES[$_sequence]['allCnt']) ?
+ self::$_DESCRIPTIVES[$_sequence]['allCnt'] += $tCnt : $tCnt);
+
+
unset($_freq[$tkey]);
}
}
@@ -5762,15 +6152,14 @@ class SurveyAnalysis {
{
foreach (self::$_HEADERS AS $skey => $spremenljivka)
{
- $tip = $spremenljivka['tip'];
- if (is_numeric($tip)) {
+ if (isset($spremenljivka['tip']) && is_numeric($spremenljivka['tip'])) {
if (count($spremenljivka['grids'] ) > 0) {
foreach ($spremenljivka['grids'] as $gid => $grid ){
- if (is_countable($grid['variables']) && count($grid['variables']) > 0) {
+ if (isset($grid['variables']) && count($grid['variables']) > 0) {
foreach ($grid['variables'] as $vid => $variable ){
$end_sequence = max($end_sequence, (int)$variable['sequence']);
@@ -5836,7 +6225,7 @@ class SurveyAnalysis {
# preverjamo da ni meta variabla
$vars_count = count(self::$_FILTRED_VARIABLES);
# frekvence delamo samo za izbrane variable
- if ($spremenljivka['tip'] != 'm'
+ if (isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
# filter po id spremenljivki
&& ($vars_count == 0 || ($vars_count > 0 && isset(self::$_FILTRED_VARIABLES[$spid]) ) )
# filter po tipu (kategorije, besedila, number, drugo)
@@ -5846,6 +6235,7 @@ class SurveyAnalysis {
if ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) {
self::$_HEADERS[$spid]['show_valid_percent'] = true;
}
+
if (count ($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0)
@@ -5861,8 +6251,16 @@ class SurveyAnalysis {
if (isset($_freq[$ikey])) {
if (self::$frequencyAddInvalid) {
self::$_FREQUENCYS[$_sequence]['invalid'][$ikey]['cnt'] = $_freq[$ikey];
- self::$_FREQUENCYS[$_sequence]['invalidCnt'] += $_freq[$ikey];
- self::$_FREQUENCYS[$_sequence]['allCnt'] += $_freq[$ikey];
+
+ if (isset(self::$_FREQUENCYS[$_sequence]['invalidCnt']))
+ self::$_FREQUENCYS[$_sequence]['invalidCnt'] += $_freq[$ikey];
+ else
+ self::$_FREQUENCYS[$_sequence]['invalidCnt'] = $_freq[$ikey];
+
+ if (isset(self::$_FREQUENCYS[$_sequence]['allCnt']))
+ self::$_FREQUENCYS[$_sequence]['allCnt'] += $_freq[$ikey];
+ else
+ self::$_FREQUENCYS[$_sequence]['allCnt'] = $_freq[$ikey];
}
unset($_freq[$ikey]);
@@ -5872,17 +6270,25 @@ class SurveyAnalysis {
}
# opcijske odgovore dodamo samo vprašanjem ki niso tipa other in text
# zloopamo skozi vse opcije in jih dodamo k veljavnim
- if ($variable['text'] != true && $variable['other'] != true && is_countable($spremenljivka['options']) && count($spremenljivka['options']) > 0) {
+ if ($variable['text'] != true && $variable['other'] != true && isset($spremenljivka['options']) && is_countable($spremenljivka['options']) && count($spremenljivka['options']) > 0) {
foreach ($spremenljivka['options'] AS $okey => $oAnswer) {
self::$_FREQUENCYS[$_sequence]['valid'][$okey]['text'] = $oAnswer;
- self::$_FREQUENCYS[$_sequence]['valid'][$okey]['text_graf'] = $spremenljivka['options_graf'][$okey];
+ self::$_FREQUENCYS[$_sequence]['valid'][$okey]['text_graf'] = isset($spremenljivka['options_graf'][$okey]) ? isset($spremenljivka['options_graf'][$okey]) : '';
self::$_FREQUENCYS[$_sequence]['valid'][$okey]['cnt'] = 0;
if (isset($_freq[$okey])) {
self::$_FREQUENCYS[$_sequence]['valid'][$okey]['cnt'] = $_freq[$okey];
- self::$_FREQUENCYS[$_sequence]['validCnt'] += $_freq[$okey];
- self::$_FREQUENCYS[$_sequence]['allCnt'] += $_freq[$okey];
+
+ if (isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ self::$_FREQUENCYS[$_sequence]['validCnt'] += $_freq[$okey];
+ else
+ self::$_FREQUENCYS[$_sequence]['validCnt'] = $_freq[$okey];
+
+ if (isset(self::$_FREQUENCYS[$_sequence]['allCnt']))
+ self::$_FREQUENCYS[$_sequence]['allCnt'] += $_freq[$okey];
+ else
+ self::$_FREQUENCYS[$_sequence]['allCnt'] = $_freq[$okey];
unset($_freq[$okey]);
}
@@ -5893,17 +6299,26 @@ class SurveyAnalysis {
# vse kaj ostane so textovni ali numerični odgovori
if (is_countable($_freq) && count($_freq) > 0) {
$_ifreq = array();
+
# nardimo case-insensitive
foreach ($_freq AS $tkey => $tCnt) {
- //if($spremenljivka['tip'] != 26)
- if($spremenljivka['tip'] != 26 && $spremenljivka['tip'] != 27)
- $tkey = mb_strtolower($tkey,'UTF-8');
- $_ifreq[$tkey] += $tCnt;
+
+ //if($spremenljivka['tip'] != 26)
+ if($spremenljivka['tip'] != 26 && $spremenljivka['tip'] != 27)
+ $tkey = mb_strtolower($tkey,'UTF-8');
+
+ if(isset($_ifreq[$tkey]))
+ $_ifreq[$tkey] += $tCnt;
+ else
+ $_ifreq[$tkey] = $tCnt;
}
- $_average = array();
+ $_average = array(
+ 'cnt' => 0,
+ 'product' => 0
+ );
- if(is_countable($spremenljivka['options']))
+ if(isset($spremenljivka['options']) && is_countable($spremenljivka['options']))
$i = count($spremenljivka['options']) + 1;
else
$i = 0;
@@ -5918,12 +6333,24 @@ class SurveyAnalysis {
$text = $tkey;
}
- self::$_FREQUENCYS[$_sequence]['valid'][$tkey] = array('text'=>$text,'cnt'=>$tCnt,'text_graf'=>$spremenljivka['options_graf'][$i]);
- self::$_FREQUENCYS[$_sequence]['validCnt'] += $tCnt;
- self::$_FREQUENCYS[$_sequence]['allCnt'] += $tCnt;
- //Uros dodal, ker se drugace pri radio ne ve, kaksen je text opcije drugo
- if($variable['other'])
- self::$_FREQUENCYS[$_sequence]['valid'][$tkey]['other'] = $variable['naslov'];
+ self::$_FREQUENCYS[$_sequence]['valid'][$tkey] = array('text'=>$text,'cnt'=>$tCnt);
+
+ if(isset($spremenljivka['options_graf'][$i]))
+ self::$_FREQUENCYS[$_sequence]['valid'][$tkey]['text_graf'] = $spremenljivka['options_graf'][$i];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ self::$_FREQUENCYS[$_sequence]['validCnt'] += $tCnt;
+ else
+ self::$_FREQUENCYS[$_sequence]['validCnt'] = $tCnt;
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['allCnt']))
+ self::$_FREQUENCYS[$_sequence]['allCnt'] += $tCnt;
+ else
+ self::$_FREQUENCYS[$_sequence]['allCnt'] = $tCnt;
+
+ //Uros dodal, ker se drugace pri radio ne ve, kaksen je text opcije drugo
+ if($variable['other'])
+ self::$_FREQUENCYS[$_sequence]['valid'][$tkey]['other'] = $variable['naslov'];
# povprečje
if (is_numeric($tkey)) {
@@ -5942,7 +6369,6 @@ class SurveyAnalysis {
} // end if tip != m
}
unset($frequency);
-
return self::$_FREQUENCYS;
}
@@ -6044,10 +6470,11 @@ class SurveyAnalysis {
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
$_result_answers = array();
$_result_answers['validCnt'] = 0;
+ $_result_answers['allCnt'] = 0;
+ $_result_answers['invalidCnt'] = 0;
if (count($answers) > 0) {
foreach ($answers AS $akey => $answer) {
- $cnt++;
$all_invalid = true; # ali je vse neveljavno
foreach ($answer AS $seq => $value) {
# preverimo ali je kateri odgovor od userja vlejaven
@@ -6081,6 +6508,7 @@ class SurveyAnalysis {
public static function showspremenljivkaSingleVarPopup($id) {
global $lang;
+ global $site_url;
self::$_forceShowEmpty = true;
header('Cache-Control: no-cache');
@@ -6098,20 +6526,23 @@ class SurveyAnalysis {
$lang_admin = $row['value'];
}
+ $zaPodstran = $_POST['zaPodstran'];
+ $id = $_POST['id'];
+ $spremenljivka = self::$_HEADERS[$id];
+ $_tip = self::getSpremenljivkaLegenda($spremenljivka,'tip');
+
#izpišemo HTML
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
echo '<head>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- echo '<script type="text/javascript" src="minify/g=jsnew"></script>';
- echo '<link type="text/css" href="minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -6120,10 +6551,8 @@ class SurveyAnalysis {
echo '<!--[if IE 8]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<script>';
+
+ echo '<script>';
echo 'function chkstate(){';
echo ' if(document.readyState=="complete"){';
echo ' window.close()';
@@ -6146,13 +6575,10 @@ class SurveyAnalysis {
echo "</script>";
echo '</head>';
- echo '<body onBlur="window.close()" style="margin:5px; padding:5px;">';
+ echo '<body onBlur="window.close()" class="analysis_popup single_var">';
+
echo '<input type="hidden" name="podstran" id="srv_meta_podstran" value="' . $zaPodstran . '" />';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
- $id = $_POST['id'];
- $spremenljivka = self::$_HEADERS[$id];
- $_tip = self::getSpremenljivkaLegenda($spremenljivka,'tip');
- $zaPodstran = $_POST['zaPodstran'];
$legend = Cache::spremenljivkaLegenda($id);
@@ -6168,281 +6594,213 @@ class SurveyAnalysis {
echo '<div id="div_analiza_single_var" class="container"> ';
self:: showPreviewSpremenljivka($id);
echo '</div>';
+
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
+
echo '</body>';
echo '</html>';
}
- public static function showSpremenljivkaTextAnswersPopup($id,$seq) {
+ public static function showSpremenljivkaTextAnswersPopup($id) {
global $lang;
+ global $site_url;
+
self::$_forceShowEmpty = true;
- header('Cache-Control: no-cache');
- header('Pragma: no-cache');
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$anketa = $_REQUEST['anketa'];
- #izpišemo HTML
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
- echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
- echo '<head>';
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
- echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- echo '<script type="text/javascript" src="minify/g=jsnew"></script>';
- echo '<link type="text/css" href="minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<!--[if IE 7]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie7hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<!--[if IE 8]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<script>';
- echo 'function chkstate(){';
- echo ' if(document.readyState=="complete"){';
- echo ' window.close()';
- echo ' }';
- echo ' else{';
- echo ' setTimeout("chkstate()",2000)';
- echo ' }';
- echo '}';
- echo 'function print_win(){';
- echo ' window.print();';
- echo ' chkstate();';
- echo '}';
- echo 'function close_win(){';
- echo ' window.close();';
- echo '}';
- echo '</script>';
- echo '</head>';
-
- echo '<body onBlur="window.close()" style="margin:5px; padding:5px;">';
-
- echo '<input type="hidden" name="podstran" id="srv_meta_podstran" value="' . $zaPodstran . '" />';
- echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
- echo '<div id="div_analiza_single_var" class="container">';
$id = $_POST['id'];
- $seq = $_POST['seq'];
$zaPodstran = $_POST['zaPodstran'];
$spremenljivka = self::$_HEADERS[$id];
+
# koliko zapisov prikažemo naenkrat
- $num_show_records = self::getNumRecords();
-
+ //$num_show_records = self::getNumRecords();
$num_show_records = 9999999;
+
# poiščemo navedbe textovne spremenljivke tako kot v grafih
- $_answers = self::getAnswers($spremenljivka,$num_show_records);
- if (count($_answers['valid']) > 0) {
- echo '<table class="anl_tbl anl_bl anl_bt tbl_clps">';
- foreach ($_answers['valid'] AS $vkey => $valid) {
- $_valid = $valid[$seq];
+ $_answers = self::getAnswers($spremenljivka, $num_show_records);
+
+
+ // Naslovna vrstica
+ echo '<div class="popup_close"><a href="#" onclick="closeAnalizaPopup(); return false;">✕</a></div>';
+ echo '<h2>'.$spremenljivka['variable'].' - '.$lang['srv_text_only'].'</h2>';
+
+
+ echo '<div id="div_analiza_single_var" class="container">';
+
+ echo '<table>';
+
+ $_answersOther = array();
+
+ # dodamo opcijo kje izrisujemo legendo
+ $options=array('inline_legenda' => isset($inline_legenda)?$inline_legenda:null, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
+
+ # izpišemo vlejavne odgovore
+ $_current_grid = null;
+ if (count($spremenljivka['grids']) > 0)
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ $_variables_count = count($grid['variables']);
+
+ # dodamo dodatne vrstice z albelami grida
+ if ($_variables_count > 0 )
+ foreach ($grid['variables'] AS $vid => $variable){
+
+ $_sequence = $variable['sequence']; # id kolone z podatki
+
+ // Naslovna vrstica - lahko jih je vec, ce je text z vec polji
+ echo '<tr class="row_question">';
+
+ echo '<td class="cell_var">';
+ echo $variable['variable'];
+ echo '</td>';
+ echo '<td class="cell_question">';
+ echo $variable['naslov'];
+ echo '</td>';
+
+ echo '</tr>';
+
- echo '<tr><td class="anl_bck_0_1 anl_br anl_bb anl_user_text">';
- echo $_valid;
- echo '</td></tr>';
+ // Vrstice z responsi
+ foreach ($_answers['valid'] AS $vkey => $valid) {
+ $_valid = $valid[$_sequence];
+
+ echo '<tr>';
+ echo ' <td></td>';
+ echo ' <td colspan="2" class="anl_user_text">'.$_valid.'</td>';
+ echo '</tr>';
+ }
}
- echo '</table>';
- echo '<br />';
}
+
+ echo '</table>';
+
echo '</div>';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<div class="clr"></div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onclick="closeAnalizaPopup(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
- echo '</body>';
- echo '</html>';
}
/** Prikaže opsine, frekvence, sumarnik, za samo eno variablo
*
* @param unknown_type $id
*/
- public static function DisplaySingleVarPopup ($id,$zaPodstran)
- {
+ public static function DisplaySingleVarPopup ($id, $zaPodstran){
global $site_url, $lang;
+
self::$_forceShowEmpty = true;
- header('Cache-Control: no-cache');
- header('Pragma: no-cache');
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
$anketa = $_REQUEST['anketa'];
- if ($anketa > 0) {
- $sql = sisplet_query("SELECT lang_admin FROM srv_anketa WHERE id = '$anketa'");
- $row = mysqli_fetch_assoc($sql);
- $lang_admin = $row['lang_admin'];
- } else {
- $sql = sisplet_query("SELECT value FROM misc WHERE what = 'SurveyLang_admin'");
- $row = mysqli_fetch_assoc($sql);
- $lang_admin = $row['value'];
- }
-
- #izpišemo HTML
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
- echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
- echo '<head>';
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
- echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- echo '<script type="text/javascript" src="minify/g=jsnew"></script>';
- echo '<link type="text/css" href="minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;} .chart_settings {display: none;} .chart_holder{width: 800px;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<!--[if IE 7]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie7hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<!--[if IE 8]>';
- echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
- echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<script>';
- echo 'function chkstate(){';
- echo ' if(document.readyState=="complete"){';
- echo ' window.close()';
- echo ' }';
- echo ' else{';
- echo ' setTimeout("chkstate()",2000)';
- echo ' }';
- echo '}';
- echo 'function print_win(){';
- echo ' window.print();';
- echo ' chkstate();';
- echo '}';
- echo 'function close_win(){';
- echo ' window.close();';
- echo '}';
- echo '</script>';
- echo '</head>';
-
- #echo '<body onBlur="window.close()" style="margin:5px; padding:5px;">';
- echo '<body style="margin:5px; padding:5px;">';
- echo '<input type="hidden" name="podstran" id="srv_meta_podstran" value="' . $zaPodstran . '" />';
- echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
-
- echo '<div id="div_analiza_single_var" class="container">';
$id = $_POST['id'];
$zaPodstran = $_POST['zaPodstran'];
+ $title = urldecode($_POST['title']);
+
+ $spremenljivka = self::$_HEADERS[$id];
# polovimo nastavtve missing profila
self::$missingProfileData = SurveyMissingProfiles::getProfile(self::$currentMissingProfile);
- if (self::$podstran != M_ANALYSIS_ARCHIVE)
- {
+ if (self::$podstran != M_ANALYSIS_ARCHIVE){
self::$_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
}
- if (!is_array(self::$_LOOPS))
- {
+
+ if (!is_array(self::$_LOOPS)){
self::$_LOOPS[] = array('filter'=>null,'text'=>null);
}
$loop_cnt = 0;
- # ce mamo zanke
- foreach ( self::$_LOOPS AS $loop)
- {
- if ($loop['filter'] != null)
- {
- $loop_cnt++;
- $loop['cnt'] = $loop_cnt;
- self::$_CURRENT_LOOP = $loop;
- if ((int)$loop_cnt == (int)$_POST['loop'])
- {
- echo '<h2 data-loopId="'.self::$_CURRENT_LOOP['cnt'].'">'.$lang['srv_zanka_note'].$loop['text'].'</h2>';
+
+ // Naslovna vrstica
+ echo '<div class="popup_close"><a href="#" onclick="closeAnalizaPopup(); return false;">✕</a></div>';
+ echo '<h2>';
+ echo '<div class="var">'.$spremenljivka['variable'].'</div>';
+ echo '<div class="prikaz">'.$lang['srv_analysis_icon_show'].': '.$title.'</div>';
+ echo '</h2>';
+
+ echo '<div id="div_analiza_single_var" class="container">';
+
+ # ce mamo zanke
+ if(count(self::$_LOOPS) > 0){
+ foreach ( self::$_LOOPS AS $loop){
+
+ if ($loop['filter'] != null){
+
+ $loop_cnt++;
+ $loop['cnt'] = $loop_cnt;
+ self::$_CURRENT_LOOP = $loop;
+
+ if ((int)$loop_cnt == (int)$_POST['loop']){
+ echo '<h2 class="filter_box" data-loopId="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'">'.$lang['srv_zanka_note'].$loop['text'].'</h2>';
+ }
}
- }
- if ((int)$loop_cnt == (int)$_POST['loop'])
- {
- switch ($zaPodstran)
- {
- case M_ANALYSIS_SUMMARY_NEW :
- self::displaySumsNew($id);
- $export = 'sums';
- break;
- case M_ANALYSIS_SUMMARY :
- self::displaySums($id);
- $export = 'sums';
- break;
- case M_ANALYSIS_DESCRIPTOR :
- self::displayDescriptives($id);
- $export = 'statistics';
- break;
- case M_ANALYSIS_FREQUENCY :
- self::displayFrequency($id);
- $export = 'frequency';
- break;
- case M_ANALYSIS_CHARTS :
- $chartClass = new SurveyChart();
- $chartClass->Init($anketa);
- $chartClass->displaySingle($id);
- $export = 'charts';
- break;
+
+ if ((int)$loop_cnt == (int)$_POST['loop']){
+
+ switch ($zaPodstran){
+ case M_ANALYSIS_SUMMARY_NEW :
+ self::displaySumsNew($id);
+ $export = 'sums';
+ break;
+ case M_ANALYSIS_SUMMARY :
+ self::displaySums($id);
+ $export = 'sums';
+ break;
+ case M_ANALYSIS_DESCRIPTOR :
+ self::displayDescriptives($id);
+ $export = 'statistics';
+ break;
+ case M_ANALYSIS_FREQUENCY :
+ self::displayFrequency($id);
+ $export = 'frequency';
+ break;
+ case M_ANALYSIS_CHARTS :
+ $chartClass = new SurveyChart();
+ $chartClass->Init($anketa);
+ $chartClass->displaySingle($id);
+ $export = 'charts';
+ break;
+ }
}
- //Izvoz v PDF/RTF
- $loop_exp = (isset(self::$_CURRENT_LOOP)) ? self::$_CURRENT_LOOP['cnt'] : 'undefined';
- $_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
- serialize(
- array( 'b'=>'export',
- 'm'=>$export,
- 'anketa'=>$anketa,
- 'sprID'=>$id,
- 'loop'=>$loop_exp)));
- $_url2 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
- serialize(
- array( 'b'=>'export',
- 'm'=>$export.'_rtf',
- 'anketa'=>$anketa,
- 'sprID'=>$id,
- 'loop'=>$loop_exp)));
- $_url3 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
- serialize(
- array( 'b'=>'export',
- 'm'=>$export.'_xls',
- 'anketa'=>$anketa,
- 'sprID'=>$id,
- 'loop'=>$loop_exp)));
- echo '<div id="single_export" class="printHide">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf"></span></a>';
- echo '&nbsp;&nbsp;<a href="'.$_url2.'" target="_blank"><span class="faicon rtf"></span>&nbsp;</a>';
- //if($export == 'frequency')
- if($zaPodstran != M_ANALYSIS_CHARTS )
- {
- echo '&nbsp;&nbsp;<a href="'.$_url3.'" target="_blank"><span class="faicon xls"></span>&nbsp;</a>';
- }
}
-
+ }
+ else{
+ switch ($zaPodstran){
+ case M_ANALYSIS_SUMMARY_NEW :
+ self::displaySumsNew($id);
+ $export = 'sums';
+ break;
+ case M_ANALYSIS_SUMMARY :
+ self::displaySums($id);
+ $export = 'sums';
+ break;
+ case M_ANALYSIS_DESCRIPTOR :
+ self::displayDescriptives($id);
+ $export = 'statistics';
+ break;
+ case M_ANALYSIS_FREQUENCY :
+ self::displayFrequency($id);
+ $export = 'frequency';
+ break;
+ case M_ANALYSIS_CHARTS :
+ $chartClass = new SurveyChart();
+ $chartClass->Init($anketa);
+ $chartClass->displaySingle($id);
+ $export = 'charts';
+ break;
+ }
}
echo '</div>';
- echo '<div class="clr"></div>';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<div class="clr"></div>';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium blue" onclick="closeAnalizaPopup(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
- echo '</body>';
- echo '</html>';
}
/** Sestavi array nepravilnih odgovorov
@@ -6520,13 +6878,13 @@ class SurveyAnalysis {
self :: Display();
break;
case 'showAnalizaSingleVarPopup' :
- self :: DisplaySingleVarPopup($_POST['id'],$_POST['zaPodstran']);
+ self :: DisplaySingleVarPopup($_POST['id'], $_POST['zaPodstran']);
break;
case 'showspremenljivkaSingleVarPopup' :
self :: showspremenljivkaSingleVarPopup($_POST['id']);
break;
case 'showSpremenljivkaTextAnswersPopup' :
- self :: showSpremenljivkaTextAnswersPopup($_POST['id'],$_POST['seq']);
+ self :: showSpremenljivkaTextAnswersPopup($_POST['id'], $_POST['seq']);
break;
case 'show_crostabs_dropdowns' :
self :: displayDropdowns($corssVar1, $corssVar2, $corssZanka);
@@ -6578,89 +6936,94 @@ class SurveyAnalysis {
echo '<div id="custom_report_switch"><a href="index.php?anketa='.self::$sid.'&a=analysis&m=analysis_creport"><span>'.$lang['srv_custom_report'].'</span></a></div>';
*/
- echo '<table class="analysis_reports"><tr>';
+ echo '<div class="reports_holder">';
// ANALIZE
- echo '<td>';
echo '<fieldset>';
echo '<legend>'.$lang['srv_analiza'].'</legend>';
+ echo '<ul>';
+
# linki - analize sumarnik
- echo '<span class="subtitle">' . $lang['srv_sumarnik'] . '</span>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums&anketa='.self::$sid).'" target="_blank">' .
- '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_rtf&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_xls&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a>';
+ echo '<li class="title">' . $lang['srv_sumarnik'] . '</li>';
+
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums&anketa='.self::$sid).'" target="_blank">' .
+ '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_rtf&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_xls&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a></li>';
# linki - analize opisne statistike
- echo '<span class="subtitle">' . $lang['srv_descriptor'] . '</span>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_rtf&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_xls&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a>';
+ echo '<li class="title">' . $lang['srv_descriptor'] . '</li>';
+
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_rtf&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_xls&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a></li>';
# linki - analize frekvence
- echo '<span class="subtitle">' . $lang['srv_frequency'] . '</span>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_rtf&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_xls&anketa=' . self::$sid).'" target="_blank">' .
- '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a>';
+ echo '<li class="title">' . $lang['srv_frequency'] . '</li>';
+
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_rtf&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_xls&anketa=' . self::$sid).'" target="_blank">' .
+ '<span class="faicon xls" title="' . $lang['srv_reporti'] . '"></span>&nbsp;XLS - (Microsoft Excel)</a></li>';
+
+ echo '</ul>';
echo '</fieldset>';
// VPRASALNIK
- echo '</td><td>';
- echo '<fieldset style="padding-top: 10px;">';
+ echo '<fieldset>';
echo '<legend>'.$lang['srv_analysis_links_survey'].'</legend>';
+ echo '<ul>';
+
# linki - vprašalnik
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=' . A_REPORT_VPRASALNIK_PDF . '&anketa=' . self::$sid) . '" target="_blank">' .
- '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=' . A_REPORT_VPRASALNIK_RTF . '&anketa=' . self::$sid) . '" target="_blank">' .
- '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?a=' . A_REPORT_VPRASALNIK_PDF . '&anketa=' . self::$sid) . '" target="_blank">' .
+ '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?a=' . A_REPORT_VPRASALNIK_RTF . '&anketa=' . self::$sid) . '" target="_blank">' .
+ '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a></li>';
+
+ echo '</ul>';
echo '</fieldset>';
// IZPIS
- echo '</td><td>';
echo '<fieldset>';
echo '<legend>'.$lang['srv_statistic'].'</legend>';
+ echo '<ul>';
+
# linki - vpogled
- echo '<span class="subtitle">' . $lang['srv_analysis_links_vpogled'] . '</span>';
- echo '<a href="index.php?anketa='.self::$sid.'&a=data&m=quick_edit&quick_view=1" >' .
- '<span title="' . $lang['srv_link_data_view'] . '"></span>' . $lang['srv_link_data_view'] . '</a>';
+ echo '<li class="title">' . $lang['srv_analysis_links_vpogled'] . '</li>';
+ echo '<li><a class="hasline" href="index.php?anketa='.self::$sid.'&a=data&m=quick_edit&quick_view=1" >' .
+ '<span title="' . $lang['srv_link_data_view'] . '"></span>' . $lang['srv_link_data_view'] . '</a></li>';
# linki - izpis vseh odgovorov
- echo '<span class="subtitle">' . $lang['srv_analysis_links_allAnswers'] . '</span>';
- echo '<span class="clr">' . $lang['srv_analysis_links_allAnswers_note'] . '</span><br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_results&anketa=' . self::$sid) . '" target="_blank">' .
- '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a>';
- echo '<br/>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_results&anketa=' . self::$sid) . '" target="_blank">' .
- '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a>';
+ echo '<li class="title">' . $lang['srv_analysis_links_allAnswers'] . '</li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?a=pdf_results&anketa=' . self::$sid) . '" target="_blank">' .
+ '<span class="faicon pdf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;PDF - (Adobe Acrobat)</a></li>';
+ echo '<li><a href="'.makeEncodedIzvozUrlString('izvoz.php?a=rtf_results&anketa=' . self::$sid) . '" target="_blank">' .
+ '<span class="faicon rtf" title="' . $lang['srv_reporti'] . '"></span>&nbsp;DOC - (Microsoft Word)</a></li>';
+ echo '<li>' . $lang['srv_analysis_links_allAnswers_note'] . '</li>';
+
+ echo '</ul>';
+
echo '</fieldset>';
- echo '</td>';
- echo '</tr></table>';
+ echo '</div>';
}
private static function printAnalizaSingleVar() {
global $lang;
+ global $site_url;
header('Cache-Control: no-cache');
header('Pragma: no-cache');
@@ -6682,14 +7045,12 @@ class SurveyAnalysis {
echo '<head>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- echo '<script type="text/javascript" src="minify/g=jsnew"></script>';
- echo '<link type="text/css" href="minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -6717,8 +7078,10 @@ class SurveyAnalysis {
echo '</script>';
echo '</head>';
- echo '<body onBlur="window.close()" style="margin:5px; padding:5px;">';
+ echo '<body onBlur="window.close()" class="analysis_popup print_single_var">';
+
echo '<div class="container"> ';
+
$id = $_POST['id'];
$zaPodstran = $_POST['zaPodstran'];
switch ($zaPodstran) {
@@ -6735,12 +7098,13 @@ class SurveyAnalysis {
self::displayFrequency($id);
break;
}
+
echo '</div>';
+
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="print_win(); return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<br class="clr"/>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
+
echo '</body>';
echo '</html>';
@@ -6808,6 +7172,8 @@ class SurveyAnalysis {
function printPreviewSpremenljivka($spremenljivka) {
global $lang;
+ global $site_url;
+
header('Cache-Control: no-cache');
header('Pragma: no-cache');
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
@@ -6829,14 +7195,12 @@ class SurveyAnalysis {
echo '<head>';
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
- echo '<script type="text/javascript" src="minify/g=jsnew"></script>';
- echo '<link type="text/css" href="minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -6863,7 +7227,7 @@ class SurveyAnalysis {
echo '}';
echo '</script>';
echo '</head>';
- echo '<body onBlur="window.close()" style="margin:5px; padding:5px;" >';
+ echo '<body onBlur="window.close()" class="analysis_popup print_preview">';
global $lang, $site_path;
@@ -6916,28 +7280,33 @@ class SurveyAnalysis {
}
echo '</div>';// id="spremenljivka_preview"
+
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="print_win(); return false;"><span><img src="icons/icons/printer.png" alt="'.$lang['hour_print2'].'" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<br class="clr"/>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</div>';
+
echo '</body>';
echo '</html>';
}
static function show_sum_more_table() {
+
self :: $show_spid_div = false;
self::$_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
- if (count(self::$_LOOPS) == 0 ) {
+
+ if (count(self::$_LOOPS) == 0 ) {
if ($_POST['podstran'] == M_ANALYSIS_SUMMARY) {
self :: displaySums($_POST['spid']);
- } else if ($_POST['podstran'] == M_ANALYSIS_SUMMARY_NEW) {
+ }
+ else if ($_POST['podstran'] == M_ANALYSIS_SUMMARY_NEW) {
self :: displaySumsNew($_POST['spid']);
- } else if ($_POST['podstran'] == M_ANALYSIS_FREQUENCY) {
+ }
+ else if ($_POST['podstran'] == M_ANALYSIS_FREQUENCY) {
self :: displayFrequency($_POST['spid']);
}
- } else {
+ }
+ else {
# če mamo zanke
$loop_cnt = 0;
foreach ( self::$_LOOPS AS $loop) {
@@ -7002,13 +7371,14 @@ class SurveyAnalysis {
* # odstranimo sistemske variable tipa email, ime, priimek, geslo oz. ce imamo vklopljeno nastavitev da skrivamo vse sistemske skrijemo vse sistem == 1
*/
static function removeSystemVariables() {
- if (!empty(self::$_HEADERS))
- {
+
+ if (!empty(self::$_HEADERS)){
+
foreach (self::$_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system']) && (int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
unset(self::$_HEADERS[$skey]);
}
- else if ((int)$spremenljivka['sistem'] == 1 && SurveyDataSettingProfiles :: getSetting('hideAllSystem') == 1) {
+ else if (isset($spremenljivka['sistem']) && (int)$spremenljivka['sistem'] == 1 && SurveyDataSettingProfiles :: getSetting('hideAllSystem') == 1) {
unset(self::$_HEADERS[$skey]);
}
}
@@ -7093,7 +7463,7 @@ class SurveyAnalysis {
}
static function addCustomReportElement($type, $sub_type, $spr1, $spr2=''){
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type, $sub_type=0, $spid);
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type, $sub_type=0, $spr1);
}
// Nastavitve na dnu
@@ -7111,58 +7481,73 @@ class SurveyAnalysis {
$lan_xls = ' title="'.$lang['XLS_Izpis'].'"';
echo '<div class="analysis_bottom_settings printHide">';
+
+
+ // Klik izven treh pikic/settingsov pri vprasanju - zapremo okno
+ echo '<script>
+ $(document).mouseup(function(e){
+ var container = $(".cell_icons, .options");
+
+ if (!container.is(e.target) && container.has(e.target).length === 0){
+ $(".options").hide();
+ }
+ });
+ </script>';
+
// Pri javni povezavi nimamo tega
if(self::$printPreview == false){
+
// Nastavitve na dnu pri sumarniku
if($page == 'sums'){
-
- echo '<a href="#" onClick="addCustomReportAllElementsAlert(1);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport" style="margin-right: 40px;"><span class="spaceRight faicon comments_creport" ></span><span class="bold">'.$lang['srv_custom_report_comments_add'].'</span></a>';
-
- echo '<a href="#" onClick="printAnaliza(\'Sumarnik\'); return false;"'.$lan_print.' class="srv_ico"><span class="faicon print icon-grey_dark_link"></span></a>';
-
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls black very_large"></span></a>';
+
+ echo '<div class="comment_holder">';
+ echo ' <a href="#" class="comment" onClick="addCustomReportAllElementsAlert(1);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="faicon comments" ></span><span>'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '</div>';
+
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=sums&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf"></span></a>';
- echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail"></span></a>';
}
// Nastavitve na dnu pri frekvencah
elseif($page == 'freq'){
- echo '<a href="#" onClick="addCustomReportAllElementsAlert(2);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport" style="margin-right: 40px;"><span class="spaceRight faicon comments_creport" ></span><span class="bold">'.$lang['srv_custom_report_comments_add'].'</span></a>';
-
- echo '<a href="#" onClick="printAnaliza(\'Frekvence\'); return false;"'.$lan_print.' class="srv_ico"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls black very_large"></span></a>';
+ echo '<div class="comment_holder">';
+ echo ' <a href="#" class="comment" onClick="addCustomReportAllElementsAlert(2);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="spaceRight faicon comments" ></span><span>'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '</div>';
+
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=frequency&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf"></span></a>';
- echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail"></span></a>';
}
// Nastavitve na dnu pri opisnih statistikah
else{
- echo '<a href="#" onClick="addCustomReportAllElementsAlert(3);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport" style="margin-right: 40px;"><span class="spaceRight faicon comments_creport" ></span><span class="bold">'.$lang['srv_custom_report_comments_add'].'</span></a>';
-
- echo '<a href="#" onClick="printAnaliza(\'Opisne statistike\'); return false;"'.$lan_print.' class="srv_ico"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls black very_large"></span></a>';
+ echo '<div class="comment_holder">';
+ echo ' <a href="#" class="comment" onClick="addCustomReportAllElementsAlert(3);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="spaceRight faicon comments" ></span><span>'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '</div>';
+
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_xls&anketa=' . self::$sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics_rtf&anketa=' . self::$sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=statistics&anketa=' . self::$sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf"></span></a>';
- echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail"></span></a>';
}
}
echo '</div>';
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<script> userAccessExport(); </script>';
}
}
@@ -7171,6 +7556,9 @@ class SurveyAnalysis {
global $site_url;
global $global_user_id;
+ // Patrik - Izvoz posameznih analiz je začasno ugasnjen dokler se ne popravi
+ //return;
+
$return = '<span class="" style="">';
$anketa = self::$sid;
switch (self::$podstran) {
@@ -7221,7 +7609,8 @@ class SurveyAnalysis {
'sprID'=>$id,
'loop'=>$loop)));
- $return = '<span class="faicon print_small icon-grey_dark_link" onclick="printCurrentAnalysis(\''.$id.'\');"></span>&nbsp;&nbsp';
+
+ $return = '';
$userAccess = UserAccess::getInstance($global_user_id);
if($userAccess->checkUserAccess($what='data_export')){
@@ -7268,54 +7657,40 @@ class SurveyAnalysis {
static function displaySpremenljivkaIcons($spid) {
if (self::$isArchive == false){
- echo '<div class="div_analiza_icons">'.self::displayQuickIcons($spid).'</div>';
-
+
+ echo '<div class="analiza_table_top_settings">';
+
+ echo ' <div class="div_analiza_icons">'.self::displayQuickIcons($spid).'</div>';
+
// Javna povezava nima js preklopov
- if(self::$printPreview == false)
+ if(self::$printPreview == false && self::$podstran != M_ANALYSIS_DESCRIPTOR && self::$podstran != M_ANALYSIS_CHARTS){
self::displayQuickScale($spid);
+ }
+
+ echo '</div>';
}
}
static function displayQuickScale($spid) {
global $lang;
- $spr_id = self::$_HEADERS[$spid]['spr_id'];
+ $spr_id = isset(self::$_HEADERS[$spid]['spr_id'])?self::$_HEADERS[$spid]['spr_id']:null;
# pokličemo objekt SpremenljivkaSkala
$objectSkala = new SpremenljivkaSkala($spr_id);
+ echo '<div class="div_analiza_scale">';
+
if ($objectSkala->canChangeSkala()) {
- echo '<div class="div_analiza_scale">';
- if ($objectSkala->is(SpremenljivkaSkala::ORD)) {
- echo '<a href="#" onclick="changeSpremenljivkaLestvica(\''.$spid.'\',\''.SpremenljivkaSkala::NOM.'\'); return false;">';
- echo '<span class="strong" title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::ORD].'">';
- echo $lang['srv_skala_'.SpremenljivkaSkala::ORD];
- echo '</span>';
- echo ' / ';
- echo '<span title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::NOM].'">';
- echo $lang['srv_skala_'.SpremenljivkaSkala::NOM];
- echo '</span>';
- echo '</a>';
- }
- if ($objectSkala->is(SpremenljivkaSkala::NOM)) {
- echo '<a href="#" onclick="changeSpremenljivkaLestvica(\''.$spid.'\',\''.SpremenljivkaSkala::ORD.'\'); return false;">';
- echo '<span title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::ORD].'">';
- echo $lang['srv_skala_'.SpremenljivkaSkala::ORD];
- echo '</span>';
- echo ' / ';
- echo '<span class="strong" title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::NOM].'">';
- echo $lang['srv_skala_'.SpremenljivkaSkala::NOM];
- echo '</span>';
- echo '</a>';
- }
- echo '</div>';
- } else {
- echo '<div class="div_analiza_scale">';
- echo '<span title="'.$lang['srv_skala_long_'.$objectSkala->getSkala()].'">';
- echo $lang['srv_skala_'.$objectSkala->getSkala()];
- echo '</span>';
- echo '</div>';
+ echo '<button class="small '.($objectSkala->is(SpremenljivkaSkala::ORD) ? 'active' : '').'" title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::ORD].'" onclick="changeSpremenljivkaLestvica(\''.$spid.'\',\''.SpremenljivkaSkala::ORD.'\'); return false;">'.$lang['srv_skala_'.SpremenljivkaSkala::ORD].'</button>';
+ echo '<button class="small '.($objectSkala->is(SpremenljivkaSkala::NOM) ? 'active' : '').'" title="'.$lang['srv_skala_long_'.SpremenljivkaSkala::NOM].'" onclick="changeSpremenljivkaLestvica(\''.$spid.'\',\''.SpremenljivkaSkala::NOM.'\'); return false;">'.$lang['srv_skala_'.SpremenljivkaSkala::NOM].'</button>';
+ }
+ else {
+ echo '<button class="small single active" title="'.(isset($lang['srv_skala_long_'.$objectSkala->getSkala()])?$lang['srv_skala_long_'.$objectSkala->getSkala()]:'').
+ '">'.(isset($lang['srv_skala_'.$objectSkala->getSkala()])?$lang['srv_skala_'.$objectSkala->getSkala()]:'').'</button>';
}
+
+ echo '</div>';
}
static function displayPublicAnalysis($properties = array()) {
@@ -7348,10 +7723,8 @@ class SurveyAnalysis {
echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -7360,10 +7733,8 @@ class SurveyAnalysis {
echo '<!--[if IE 8]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<script>';
+
+ echo '<script>';
echo 'function chkstate(){';
echo ' if(document.readyState=="complete"){';
echo ' window.close()';
@@ -7382,10 +7753,15 @@ class SurveyAnalysis {
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+
+ echo '<body class="public_link analysis" style="margin:5px; padding:5px;">';
+
echo '<h2>'.$lang['srv_publc_analysis_title_for'].self::$survey['naslov'].'</h2>';
+ echo '<input type="hidden" name="podstran" id="srv_meta_podstran" value="' . self::$podstran . '" />';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
+ echo '<input type="hidden" name="srv_site_url" id="srv_site_url" value="' . $site_url . '" />';
+
echo '<div id="analiza_data">';
if (isset($properties['profile_id_variable']))
@@ -7408,18 +7784,6 @@ class SurveyAnalysis {
# ponastavimo nastavitve- filter
self::Display();
echo '</div>';
-
- echo '<div id="navigationBottom" class="printHide">';
-
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="'.$site_url.'admin/survey/icons/icons/printer.png" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls"></span></a>';
- echo '</span>';
-
- echo '<br class="clr" />';
- echo '</div>';
echo '</body>';
echo '</html>';
@@ -7439,7 +7803,9 @@ class SurveyAnalysis {
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -7463,63 +7829,63 @@ class SurveyAnalysis {
$_valid_answers = $_answers['valid'];
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
- //self::displaySpremenljivkaIcons($spid);
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
- //echo '<div class="heatmapGrapshContainer" style=" width: 800px; text-align:center; margin-left:auto; margin-right:auto;">';
- echo '<div class="heatmapGrapshContainer" style=" width: 600px; text-align:center; margin-left:auto; margin-right:auto;">';
- # tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_bb tbl_clps">';
- # naslovna vrstica
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
- //echo self::showVariable($spid, $spremenljivka['variable']);
- echo $spremenljivka['variable'].' - '.$spremenljivka['naslov'];
- echo '</td>';
-
- echo '</tr>';
- echo '<tr>';
- #variabla
-
- // konec naslovne vrstice
-
- $_answersOther = array();
- $_grids_count = count($spremenljivka['grids']);
- if ($_grids_count > 0) {
-
- $_css_bck = 'anl_bck_desc_2 anl_ac anl_bt_dot ';
- $last = 0;
- //anl_bck_desc_2 anl_bl anl_br anl_variabla_sub
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_variables_count = count($grid['variables']);
- echo '<tr class="'.$_css_bck.'">';
- echo '<td class="anl_bl anl_br anl_variabla_sub">';
- if($heatmap){
- //echo $grid['naslov'].'<br>';//ni potrebno, ker je ze v glavi?
- $sprid = explode('_',$spid);
- $loopid = $sprid[1];
- $sprid = $sprid[0];
- SurveyUserSession::Init($anketa);
-
- $heatmapId = 'heatmap'.$sprid;
- //echo $heatmapId;
-
- echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_on_map'].
- '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
- //echo '<img src="img_0/Google_Maps_Icon.png" alt="Smiley face" height="24" width="24" />';
- echo 'Heatmap';
- echo '</a>';
- }
- echo '</td>';
+ echo '<div class="heatmapGrapshContainer" style=" width: 600px; text-align:center; margin-left:auto; margin-right:auto;">';
+
+ # tekst vprašanja
+ echo '<table class="anl_tbl anl_bt anl_bb tbl_clps">';
+
+ # naslovna vrstica
+ echo '<tr>';
+
+ #variabla
+ echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
+ echo $spremenljivka['variable'].' - '.$spremenljivka['naslov'];
+ echo '</td>';
+
+ echo '</tr>';
+ // konec naslovne vrstice
+
+
+ echo '<tr>';
+ #variabla
+
+ $_answersOther = array();
+ $_grids_count = count($spremenljivka['grids']);
+ if ($_grids_count > 0) {
+
+ $_css_bck = 'anl_bck_desc_2 anl_ac anl_bt_dot ';
+ $last = 0;
+ //anl_bck_desc_2 anl_bl anl_br anl_variabla_sub
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+
+ $_variables_count = count($grid['variables']);
+ echo '<tr class="'.$_css_bck.'">';
+ echo '<td class="anl_bl anl_br anl_variabla_sub">';
+ if($heatmap){
+ //echo $grid['naslov'].'<br>';//ni potrebno, ker je ze v glavi?
+ $sprid = explode('_',$spid);
+ $loopid = $sprid[1];
+ $sprid = $sprid[0];
+ SurveyUserSession::Init($anketa);
+
+ $heatmapId = 'heatmap'.$sprid;
+
+ echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_on_map'].
+ '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
+ echo 'Heatmap';
+ echo '</a>';
+ }
+ echo '</td>';
- echo '</tr>';
- }
- }
- echo '</table>';
+ echo '</tr>';
+ }
+ }
+ echo '</table>';
echo '</div>';
# izpišemo še tekstovne odgovore za polja drugo
@@ -7533,7 +7899,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -7582,8 +7947,10 @@ class SurveyAnalysis {
# dodamo dodatne vrstice z albelami grida
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
- $_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
+ $_sequence = $variable['sequence']; # id kolone z podatki
+
+ if(isset(self::$_FREQUENCYS[$_sequence]['validCnt']))
+ $only_valid += (int)self::$_FREQUENCYS[$_sequence]['validCnt'];
}
}
}
@@ -7607,169 +7974,177 @@ class SurveyAnalysis {
$_valid_answers = $_answers['valid'];
if (self :: $show_spid_div == true) {
- echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
+ echo '<div id="sum_'.$spid.'" loop="'.(isset(self::$_CURRENT_LOOP['cnt']) ? self::$_CURRENT_LOOP['cnt'] : '').'" class="div_sum_variable div_analiza_holder">';
}
self::displaySpremenljivkaIcons($spid);
+
# tekst vprašanja
echo '<table class="anl_tbl anl_bt anl_bb tbl_clps">'; //zacetek tabele
+
# 1. vrstica - naslovna vrstica
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck_freq_1 anl_w110">';
- echo self::showVariable($spid, $spremenljivka['variable']);
- echo '</td>';
- #odgovori
- //echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="'.(!$lokacija ? (self::$_SHOW_LEGENDA ? 3+$_cols : 1+$_cols) : 3+$_cols).'"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
- echo '<td class="anl_br anl_bb anl_al anl_bck_freq_1" colspan="6"><span class="anl_variabla_label">'.$spremenljivka['naslov'].'</span>';
+ echo '<tr class="row1">';
+
+ #variabla
+ echo '<td class="cell_var">';
+ echo self::showVariable($spid, $spremenljivka['variable']);
+ echo '</td>';
+
+ #odgovori
+ echo '<td class="cell_question" colspan="6">'.$spremenljivka['naslov'].'</span>';
+
+ echo '</td>';
- echo '</td>';
echo '</tr>';
//konec 1. vrstice
+
//2. vrstica - prikazovanje povezave do heatmap
- echo '<tr>';
- #variabla
- echo '<td class="anl_bl anl_br anl_bb anl_ac anl_bck anl_w110">';
- //self::showIcons($spid,$spremenljivka,$_from); //za enkrat skrijem ikone za izvoze in druge moznosti
- echo '</td>';
- echo '<td class="anl_br anl_bb anl_ac" colspan="6">';
- //echo $grid['naslov'].'<br>';//ni potrebno, ker je ze v glavi?
- $sprid = explode('_',$spid);
- $loopid = $sprid[1];
- $sprid = $sprid[0];
- SurveyUserSession::Init($anketa);
-
- $heatmapId = 'heatmap'.$sprid;
- //echo $heatmapId;
- //SurveyChart::displayExportIcons($sprid);
- echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_heatmap'].
- '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
- //echo '<img src="img_0/Google_Maps_Icon.png" alt="Smiley face" height="24" width="24" />';
- echo 'Heatmap ';
- echo '</a>';
+ echo '<tr class="row2">';
+
+ #variabla
+ echo '<td>';
+ //self::showIcons($spid,$spremenljivka,$_from); //za enkrat skrijem ikone za izvoze in druge moznosti
+ echo '</td>';
+
+ echo '<td class="cell_subquestion" colspan="6">';
+ $sprid = explode('_',(is_string($spid)?$spid:''));
+ $loopid = $sprid[1];
+ $sprid = $sprid[0];
+ SurveyUserSession::Init($anketa);
+
+ $heatmapId = 'heatmap'.$sprid;
- echo '</td>';
+ echo '<a class="fHeatMap" id="heatmap_'.$sprid.'" title="'.$lang['srv_view_data_heatmap'].
+ '" href="javascript:void(0);" onclick="passHeatMapData('.$sprid.', -1, '.$loopid.', '.$anketa.');">';
+ echo 'Heatmap ';
+ echo '</a>';
+
+ echo '</td>';
echo '</tr>';
//konec - 2. vrstice
+
//Koordinate
//naslovna vrstica za koordinate
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bck anl_bb anl_ac" colspan="7">';
- echo '<b>'.$lang['srv_analiza_heatmap_clicked_coords'].'</b>';
- echo '</td>';
+ echo '<tr class="row1">';
+ echo '<td class="cell_question" colspan="7">';
+ echo $lang['srv_analiza_heatmap_clicked_coords'];
+ echo '</td>';
echo '</tr>';
//naslovna vrstica za koordinate - konec
+
+
//vrstica s podnaslovi celic
- echo '<tr>';
- echo '<td class="anl_variabla_line anl_bl anl_br anl_bb anl_bck anl_ac">';
- echo $lang['coordinates'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_bl anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_analiza_opisne_valid_heatmap'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_analiza_num_units_valid_heatmap'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_means_label'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_analiza_opisne_odklon'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_analiza_opisne_min'];
- echo '</td>';
-
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac anl_w70">';
- echo $lang['srv_analiza_opisne_max'];
- echo '</td>';
+ echo '<tr class="row2">';
+ echo '<td class="cell_value">';
+ echo $lang['coordinates'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_analiza_opisne_valid_heatmap'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_analiza_num_units_valid_heatmap'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_means_label'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_analiza_opisne_odklon'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_analiza_opisne_min'];
+ echo '</td>';
+
+ echo '<td class="cell_value">';
+ echo $lang['srv_analiza_opisne_max'];
+ echo '</td>';
echo '</tr>';
//vrstica s podnaslovi celic - konec
+
//vrstica za x
echo '<tr>';
- //1. stolpcev z imenom koordinate
- echo '<td class="anl_bl anl_br anl_bb anl_ac">';
- echo 'x';
- echo '</td>';
- //1. stolpcev z imenom koordinate - konec
-
- //2. stolpec - Veljavni
- $validHeatmapRegion = self::validHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers);
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$validHeatmapRegion.'</td>';
- //2. stolpec - Veljavni - konec
-
- //3. stolpec - Ustrezni
- $ustrezniHeatmapRegion = self::ustrezniHeatmapRegion($spid, $_valid_answers, $_sequence); //vsi mozni kliki
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$ustrezniHeatmapRegion.'</td>';
- //3. stolpec - Ustrezni - konec
-
- //4. stolpec - Povprecje
- $povprecjeHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'povprecje'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$povprecjeHeatmapClicksX.'</td>';
- //4. stolpec - Povprecje - konec
-
- //5. stolpec - Standardni odklon
- $stdevHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'stdev'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$stdevHeatmapClicksX.'</td>';
- //5. stolpec - Standardni odklon - konec
-
- //6. stolpec - Minimum
- $minHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'min'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$minHeatmapClicksX.'</td>';
- //6. stolpec - Minimum - konec
-
- //7. stolpec - Max
- $maxHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'max'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$maxHeatmapClicksX.'</td>';
- //7. stolpec - Max - konec
+ //1. stolpcev z imenom koordinate
+ echo '<td class="cell_value">';
+ echo 'x';
+ echo '</td>';
+ //1. stolpcev z imenom koordinate - konec
+
+ //2. stolpec - Veljavni
+ $validHeatmapRegion = self::validHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers);
+ echo '<td class="cell_value">'.$validHeatmapRegion.'</td>';
+ //2. stolpec - Veljavni - konec
+
+ //3. stolpec - Ustrezni
+ $ustrezniHeatmapRegion = self::ustrezniHeatmapRegion($spid, $_valid_answers, $_sequence); //vsi mozni kliki
+ echo '<td class="cell_value">'.$ustrezniHeatmapRegion.'</td>';
+ //3. stolpec - Ustrezni - konec
+
+ //4. stolpec - Povprecje
+ $povprecjeHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'povprecje'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$povprecjeHeatmapClicksX.'</td>';
+ //4. stolpec - Povprecje - konec
+
+ //5. stolpec - Standardni odklon
+ $stdevHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'stdev'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$stdevHeatmapClicksX.'</td>';
+ //5. stolpec - Standardni odklon - konec
+
+ //6. stolpec - Minimum
+ $minHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'min'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$minHeatmapClicksX.'</td>';
+ //6. stolpec - Minimum - konec
+
+ //7. stolpec - Max
+ $maxHeatmapClicksX = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'x', $validHeatmapRegion, 'max'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$maxHeatmapClicksX.'</td>';
+ //7. stolpec - Max - konec
echo '</tr>';
//vrstica za x - konec
//vrstica za y
echo '<tr>';
- //1. stolpcev z imenom koordinate
- echo '<td class="anl_bl anl_br anl_bb anl_ac">';
- echo 'y';
- echo '</td>';
- //1. stolpcev z imenom koordinate - konec
-
- //2. stolpec - Veljavni
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$validHeatmapRegion.'</td>';
- //2. stolpec - Veljavni - konec
-
- //3. stolpec - Ustrezni
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$ustrezniHeatmapRegion.'</td>';
- //3. stolpec - Ustrezni - konec
-
- //4. stolpec - Povprecje
- $povprecjeHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'povprecje'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$povprecjeHeatmapClicksY.'</td>';
- //4. stolpec - Povprecje - konec
-
- //5. stolpec - Standardni odklon
- $stdevHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'stdev'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$stdevHeatmapClicksY.'</td>';
- //5. stolpec - Standardni odklon - konec
-
- //6. stolpec - Minimum
- $minHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'min'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$minHeatmapClicksY.'</td>';
- //6. stolpec - Minimum - konec
-
- //7. stolpec - Max
- $maxHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'max'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$maxHeatmapClicksY.'</td>';
- //7. stolpec - Max - konec
+ //1. stolpcev z imenom koordinate
+ echo '<td class="cell_value">';
+ echo 'y';
+ echo '</td>';
+ //1. stolpcev z imenom koordinate - konec
+
+ //2. stolpec - Veljavni
+ echo '<td class="cell_value">'.$validHeatmapRegion.'</td>';
+ //2. stolpec - Veljavni - konec
+
+ //3. stolpec - Ustrezni
+ echo '<td class="cell_value">'.$ustrezniHeatmapRegion.'</td>';
+ //3. stolpec - Ustrezni - konec
+
+ //4. stolpec - Povprecje
+ $povprecjeHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'povprecje'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$povprecjeHeatmapClicksY.'</td>';
+ //4. stolpec - Povprecje - konec
+
+ //5. stolpec - Standardni odklon
+ $stdevHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'stdev'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$stdevHeatmapClicksY.'</td>';
+ //5. stolpec - Standardni odklon - konec
+
+ //6. stolpec - Minimum
+ $minHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'min'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$minHeatmapClicksY.'</td>';
+ //6. stolpec - Minimum - konec
+
+ //7. stolpec - Max
+ $maxHeatmapClicksY = self::formatNumber(self::heatmapClicksCalc($spremenljivka['grids'], $spid, $_valid_answers, 'y', $validHeatmapRegion, 'max'),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">'.$maxHeatmapClicksY.'</td>';
+ //7. stolpec - Max - konec
echo '</tr>';
//vrstica za y - konec
@@ -7780,89 +8155,95 @@ class SurveyAnalysis {
$RegionPresent = self::HeatmapRegionPresence($spremenljivka['grids'], $spid, $_valid_answers);
//preveri, ali je prisotno kaksno obmocje, nadaljuj izris tabele - konec
- if($RegionPresent){ //ce imamo obmocja
+ //ce imamo obmocja
+ if($RegionPresent){
+
//3. vrstica - naslovna za obmocja
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bck anl_bb anl_ac" colspan="7">';
- echo '<b>'.$lang['srv_analiza_heatmap_clicked_regions'].'</b>';
- echo '</td>';
+ echo '<tr class="row1">';
+ echo '<td class="cell_question" colspan="7">';
+ echo '<b>'.$lang['srv_analiza_heatmap_clicked_regions'].'</b>';
+ echo '</td>';
echo '</tr>';
//konec - 3. vrstice
+
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
- $_css_bck = 'anl_bck_desc_2 anl_ac anl_bt_dot ';
$last = 0;
if ($_grids_count > 0) {
$_row = $spremenljivka['grids'][0];
$indeks = 0;
- //$veljavnaSkupnaFreq = 0;
+
if (count($_row['variables'])>0)
foreach ($_row['variables'] AS $rid => $_col ){
$_sequence = $_col['sequence']; # id kolone z podatki
if ($_col['other'] != true) {
- echo '<tr>';
- if($indeks == 0) //4. vrstica, naslovna vrstica
- {
- echo '<td class="anl_variabla_line anl_bl anl_br anl_bb anl_bck anl_ac" colspan="2">';
+
+ //4. vrstica, naslovna vrstica
+ echo '<tr class="row2">';
+
+ if($indeks == 0){
+ echo '<td class="cell_value" colspan="2">';
echo $lang['srv_hot_spot_regions_menu'];
echo '</td>';
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac">';
+ echo '<td class="cell_value">';
echo $lang['srv_analiza_opisne_frequency_heatmap'];
echo '</td>';
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac">';
+ echo '<td class="cell_value">';
echo $lang['srv_analiza_opisne_valid_heatmap'];
echo '</td>';
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac">';
+ echo '<td class="cell_value">';
echo '% - '.$lang['srv_analiza_opisne_valid_heatmap'];
echo '</td>';
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac">';
+ echo '<td class="cell_value">';
echo $lang['srv_analiza_num_units_valid_heatmap'];
echo '</td>';
- echo '<td class="anl_variabla_line anl_br anl_bb anl_bck anl_ac">';
+ echo '<td class="cell_value">';
echo '% - '.$lang['srv_analiza_num_units_valid_heatmap'];
echo '</td>';
- }else //od 5. vrstice dalje, kjer so po vrsticah obmocja in njihovi podatki
- {
+ }
+ //od 5. vrstice dalje, kjer so po vrsticah obmocja in njihovi podatki
+ else{
+
//1. stolpcev z imenom obmocja
- echo '<td class="anl_bl anl_br anl_bb anl_ac" colspan="2">';
+ echo '<td class="cell_value" colspan="2">';
echo $_col['naslov'];
echo '</td>';
//1. stolpcev z imenom obmocja - konec
//2. stolpec - Frekvenca
$freqHeatmapRegion = self::freqHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers, $indeks);
- $veljavnaSkupnaFreq = $veljavnaSkupnaFreq + $freqHeatmapRegion;
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$freqHeatmapRegion.'</td>';
+
+ echo '<td class="cell_value">'.$freqHeatmapRegion.'</td>';
//2. stolpec - Frekvenca - konec
//3. stolpec - Veljavni
//$validHeatmapRegion = self::validHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers);
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$validHeatmapRegion.'</td>';
+ echo '<td class="cell_value">'.$validHeatmapRegion.'</td>';
//3. stolpec - Veljavni - konec
//4. stolpec - % Veljavni
$_procentValidHeatmapRegion = ($validHeatmapRegion > 0 ) ? 100*$freqHeatmapRegion / $validHeatmapRegion : 0;
$_procentValidHeatmapRegion = self::formatNumber($_procentValidHeatmapRegion, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$_procentValidHeatmapRegion.'</td>';
+ echo '<td class="cell_value">'.$_procentValidHeatmapRegion.'</td>';
//4. stolpec - % Veljavni - konec
//5. stolpec - Ustrezni
$ustrezniHeatmapRegion = self::ustrezniHeatmapRegion($spid, $_valid_answers, $_sequence); //vsi mozni kliki
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$ustrezniHeatmapRegion.'</td>';
+ echo '<td class="cell_value">'.$ustrezniHeatmapRegion.'</td>';
//5. stolpec - Ustrezni - konec
//6. stolpec - % Ustrezni
$_procentUstrezniHeatmapRegion = ($ustrezniHeatmapRegion > 0 ) ? 100*$freqHeatmapRegion / $ustrezniHeatmapRegion : 0;
$_procentUstrezniHeatmapRegion = self::formatNumber($_procentUstrezniHeatmapRegion, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$_procentUstrezniHeatmapRegion.'</td>';
+ echo '<td class="cell_value">'.$_procentUstrezniHeatmapRegion.'</td>';
//6. stolpec - % Ustrezni - konec
}
@@ -7870,27 +8251,29 @@ class SurveyAnalysis {
echo '</tr>';
//*********** Izris veljavnih in manjkajocih vrednosti
- if($indeks != 0) //ce ni naslovna vrsticam je potrebno dodati se dodatne poglede veljavnih in manjkajocih vrednosti
- {
+ //ce ni naslovna vrsticam je potrebno dodati se dodatne poglede veljavnih in manjkajocih vrednosti
+ if($indeks != 0){
+
echo '<tr>';
- $counter = 0;
- $options['isTextAnswer'] = false;
- $manjkajoci = $ustrezniHeatmapRegion - $validHeatmapRegion;
- $counter = self::outputSumaValidAnswerHeatmap($counter,$_sequence,$spid,$options, $validHeatmapRegion);
-
- if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
- foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
- if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki niso 0
- $counter = self::outputInvalidAnswerHeatmap($counter,$ikey,$iAnswer,$_sequence,$spid,$options, $manjkajoci);
- }
- }
- # izpišemo sumo veljavnih
- $counter = self::outputSumaInvalidAnswerHeatmap($counter,$_sequence,$spid,$options, $manjkajoci);
+
+ $counter = 0;
+ $options['isTextAnswer'] = false;
+ $manjkajoci = $ustrezniHeatmapRegion - $validHeatmapRegion;
+ $counter = self::outputSumaValidAnswerHeatmap($counter,$_sequence,$spid,$options, $validHeatmapRegion);
+
+ if (count(self::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
+ foreach (self::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
+ if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki niso 0
+ $counter = self::outputInvalidAnswerHeatmap($counter,$ikey,$iAnswer,$_sequence,$spid,$options, $manjkajoci);
+ }
}
- #izpišemo še skupno sumo
- $counter = self::outputSumaHeatmap($counter,$_sequence,$spid,$options, $ustrezniHeatmapRegion);
+ # izpišemo sumo veljavnih
+ $counter = self::outputSumaInvalidAnswerHeatmap($counter,$_sequence,$spid,$options, $manjkajoci);
+ }
+ #izpišemo še skupno sumo
+ $counter = self::outputSumaHeatmap($counter,$_sequence,$spid,$options, $ustrezniHeatmapRegion);
+
echo '</tr>';
- $veljavnaSkupnaFreq = 0;
}
//*********** Izris veljavnih in manjkajocih vrednosti - konec
@@ -7904,7 +8287,7 @@ class SurveyAnalysis {
echo '</table>';
# izpišemo še tekstovne odgovore za polja drugo
- if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
+ if (is_countable($_answersOther) && count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
echo '<div class="div_other_text">';
self::outputOtherAnswers($oAnswers);
@@ -7914,7 +8297,6 @@ class SurveyAnalysis {
if (self :: $show_spid_div == true) {
echo '</div>';
- echo '<br/>';
}
}
@@ -7925,17 +8307,7 @@ class SurveyAnalysis {
{
$_variables_count = count($grid['variables']);
if ($_variables_count > 0)
- {
- # preštejemo max vrstic na grupo
- $_max_i = 0;
- //$numObmocij = 0;
- foreach ($grid['variables'] AS $vid => $variable )
- {
- $_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,self::$_FREQUENCYS[$_sequence]['validCnt']));
- //$numObmocij++;
- }
-
+ {
$indeksZaObmocja = 0;
foreach ($grid['variables'] AS $vid => $variable )
{
@@ -8023,28 +8395,20 @@ class SurveyAnalysis {
}
static function HeatmapRegionPresence($spremenljivkaGrids, $spid, $_valid_answers){
+
$HeatmapRegionPresence = false;
- foreach ($spremenljivkaGrids AS $gid => $grid)
- {
+
+ foreach ($spremenljivkaGrids AS $gid => $grid){
+
$_variables_count = count($grid['variables']);
- if ($_variables_count > 0)
- {
- # preštejemo max vrstic na grupo
- $_max_i = 0;
- //$numObmocij = 0;
- foreach ($grid['variables'] AS $vid => $variable )
- {
- $_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,self::$_FREQUENCYS[$_sequence]['validCnt']));
- //$numObmocij++;
- }
-
+
+ if ($_variables_count > 0){
+
$indeksZaObmocja = 0;
- foreach ($grid['variables'] AS $vid => $variable )
- {
+ foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- if ($variable['other'] != true)
- {
+
+ if ($variable['other'] != true){
if (count($_valid_answers) > 0) {
foreach ($_valid_answers AS $answer) {
@@ -8057,11 +8421,10 @@ class SurveyAnalysis {
}
}
}
-
- }
-
+ }
}
}
+
return $HeatmapRegionPresence;
}
@@ -8070,48 +8433,39 @@ class SurveyAnalysis {
$stdevCoordsArray = array();
$minCoords = 0;
$maxCoords = 0;
- foreach ($spremenljivkaGrids AS $gid => $grid)
- {
+
+ foreach ($spremenljivkaGrids AS $gid => $grid){
+
$_variables_count = count($grid['variables']);
- if ($_variables_count > 0)
- {
- # preštejemo max vrstic na grupo
- $_max_i = 0;
- //$numObmocij = 0;
- foreach ($grid['variables'] AS $vid => $variable )
- {
- $_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,self::$_FREQUENCYS[$_sequence]['validCnt']));
- //$numObmocij++;
- }
+
+ if ($_variables_count > 0){
$indeksZaObmocja = 0;
- foreach ($grid['variables'] AS $vid => $variable )
- {
+
+ foreach ($grid['variables'] AS $vid => $variable ){
+
$_sequence = $variable['sequence']; # id kolone z podatki
- if ($variable['other'] != true)
- {
- #$_valid_cnt = count(self::$_FREQUENCYS[$_sequence]['valid']);
+
+ if ($variable['other'] != true){
if (count($_valid_answers) > 0) {
foreach ($_valid_answers AS $answer) {
$_ans = $answer[$_sequence];
- if ($_ans != null && $_ans != '' && $_ans >= 0 && $indeksZaObmocja < count($_valid_answers))
- {
- //$validHeatmapRegion = $validHeatmapRegion + $_ans;
- //echo '<td>'.$_ans.'</td>';
+
+ if ($_ans != null && $_ans != '' && $_ans >= 0 && $indeksZaObmocja < count($_valid_answers)){
+
$_ans = substr($_ans, 4); //odstrani <br> iz zacetka koordinat
$coordinates = explode('<br>',$_ans);
+
foreach($coordinates AS $key => $coordinate){
$coordinate = explode(',',$coordinate);
foreach($coordinate AS $coordskey => $subcoords)
{
- if($coords == 'x' && ($coordskey == 0 || $coordskey%2 == 0) )
- {
+ if($coords == 'x' && ($coordskey == 0 || $coordskey%2 == 0) ){
array_push($stdevCoordsArray, $subcoords);
- }else if($coords == 'y' && ($coordskey != 0 || $coordskey%2 != 0) )
- {
+ }
+ else if($coords == 'y' && ($coordskey != 0 || $coordskey%2 != 0) ){
array_push($stdevCoordsArray, $subcoords);
}
}
@@ -8122,6 +8476,7 @@ class SurveyAnalysis {
echo '&nbsp;';
}
}
+
$indeksZaObmocja++;
}
}
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 ':&nbsp;<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();"/>&nbsp;'.$lang['srv_analiza_archive_access_all'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="1" onchange="toggleAnalysisArchiveAccessPassword();"/>&nbsp;'.$lang['srv_analiza_archive_access_admins'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="2" onchange="toggleAnalysisArchiveAccessPassword();"/>&nbsp;'.$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" >&nbsp;</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'].'&nbsp;<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 ':&nbsp;<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();"/>&nbsp;'.$lang['srv_analiza_archive_access_all'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="1"'.((int)$row['access'] == 1 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/>&nbsp;'.$lang['srv_analiza_archive_access_admins'];
- echo '<br/><input type="radio" name="newAnalysisArchiveAccess" value="2"'.((int)$row['access'] == 2 ? ' checked="true"' : '').' onchange="toggleAnalysisArchiveAccessPassword();"/>&nbsp;'.$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" >&nbsp;</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)';
}
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php
index 5c0a562..9e944a7 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyAnalysisHelper.php
@@ -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();
}
}
@@ -38,7 +37,7 @@ class SurveyAnalysisHelper {
global $lang;
global $global_user_id;
- if($_GET['m'] != 'analysis_creport' && $_GET['t'] != 'custom_report'){
+ if((!isset($_GET['m']) || $_GET['m'] != 'analysis_creport') && $_GET['t'] != 'custom_report'){
$creportProfile = SurveyUserSetting :: getInstance()->getSettings('default_creport_profile');
$creportProfile = isset($creportProfile) ? $creportProfile : 0;
@@ -48,15 +47,17 @@ class SurveyAnalysisHelper {
$sql = sisplet_query("SELECT id FROM srv_custom_report WHERE ank_id='".self::$anketa."' AND usr_id='".$creportAuthor."' AND type='$type' AND sub_type='$sub_type' AND spr1='$spr1' AND spr2='$spr2' AND profile='$creportProfile'");
$insert = (mysqli_num_rows($sql)) ? 0 : 1;
$id = $type.'-'.$sub_type.'-'.$spr1.'-'.$spr2;
+
// Samo zvezdica (sums, grafi, freq...)
if($type < 5)
- echo '<a href="#" title="'.($insert == 0 ? $lang['srv_custom_report_inserted_title'] : $lang['srv_custom_report_insert_title']).'" onClick="addCustomReportElement(\''.$type.'\', \''.$sub_type.'\', \''.$spr1.'\', \''.$spr2.'\', 0); return false;"><span style="margin-left: 3px;" id="'.$id.'" class="faicon pointer '.($insert == 0 ? ' star_on' : ' star_off').'"></span></a>';
+ echo '<a href="#" title="'.($insert == 0 ? $lang['srv_custom_report_inserted_title'] : $lang['srv_custom_report_insert_title']).'" onClick="addCustomReportElement(\''.$type.'\', \''.$sub_type.'\', \''.$spr1.'\', \''.$spr2.'\', 0); return false;"><span id="'.$id.'" class="faicon pointer '.($insert == 0 ? ' star_on' : ' star_off').'"></span> <div class= "icon_text star_icon">'.$lang['srv_custom_report_insert_title'].'</div></a>';
+
// Zvezdica s textom
else{
echo '<div class="custom_report_include">';
echo '<a href="#" title="'.($insert == 0 ? $lang['srv_custom_report_inserted_title'] : $lang['srv_custom_report_insert_title']).'" onClick="addCustomReportElement(\''.$type.'\', \''.$sub_type.'\', \''.$spr1.'\', \''.$spr2.'\', 1); return false;">';
- echo '<span id="'.$id.'" class="faicon pointer '.($insert == 0 ? ' star_on' : ' star_off').'"></span>';
+ echo '<span id="'.$id.'" class="faicon pointer '.($insert == 0 ? ' star_on' : ' star_off').'"> </span>';
echo '<span id="'.$id.'_insert" '.($insert == 0 ? ' style="display:none;" ' : '').'> '.$lang['srv_custom_report_insert'].'</span>';
echo '<span id="'.$id.'_inserted" '.($insert == 0 ? '' : ' style="display:none;" ').'> '.$lang['srv_custom_report_inserted'].'</span>';
echo '</a>';
@@ -69,58 +70,67 @@ class SurveyAnalysisHelper {
function displayMissingLegend(){
global $lang;
- echo '<div id="bottom_data_legend" class="floatLeft">';
- echo '<div>';
- echo '<div id="bdld1" class="as_link strong" onclick="$(\'#bottom_data_legend_detail, #bdld1, #bdld2\').toggle();"><span class="faicon plus"></span></div>';
- echo '<div id="bdld2" class="as_link strong" style="display:none" onclick="$(\'#bottom_data_legend_detail, #bdld1, #bdld2\').toggle();"><span class="faicon minus"></span></div> '.$lang['srv_bottom_data_legend_note'];
+ echo '<div id="bottom_data_legend_missing" class="legend_box">';
+
+ echo '<div class="legend_title" onclick="$(\'#bottom_data_legend_detail_missing\').toggle(\'fast\');">';
+ echo '<span class="faicon arrow2_r"></span>'.$lang['srv_bottom_data_legend_note'];
echo '</div>';
- echo '<div id="bottom_data_legend_detail" style="display:none">';
- echo '<ul>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li1'].'</li>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li2'].'</li>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li3'].'</li>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li4'].'</li>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li5'].'</li>';
- echo '<li>'.$lang['srv_bottom_data_legend_note_li0'].'</li>';
- echo '</ul>';
+
+ echo '<div id="bottom_data_legend_detail_missing" class="legend_details">';
+ echo ' <ul>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li1'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li2'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li3'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li4'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li5'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li99'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li98'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li97'].'</li>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li0'].'</li>';
+ echo ' </ul>';
echo '</div>';
+
echo '</div>';
}
function displayStatusLegend(){
global $lang;
-
- echo '<div id="bottom_data_legend" class="floatLeft bg_blue">';
- echo '<div>';
- echo '<div id="bdlds1" class="as_link strong" onclick="$(\'#bottom_data_legend_detail_status, #bdlds1, #bdlds2\').toggle();"><span class="faicon plus"></span></div>';
- echo '<div id="bdlds2" class="as_link strong" style="display:none" onclick="$(\'#bottom_data_legend_detail_status, #bdlds1, #bdlds2\').toggle();"><span class="faicon minus"></span></div> '.$lang['srv_bottom_data_legend_status_note'];
+
+ echo '<div id="bottom_data_legend_status" class="legend_box">';
+
+ echo '<div class="legend_title">';
+ echo ' <span onclick="$(\'#bottom_data_legend_detail_status\').toggle(\'fast\');"><span class="faicon arrow2_r"></span>'.$lang['srv_bottom_data_legend_status_note'].'</span>';
echo '</div>';
- echo '<div id="bottom_data_legend_detail_status" style="display:none">';
- echo '<ul>';
+
+ echo '<div id="bottom_data_legend_detail_status" class="legend_details">';
+ echo ' <ul>';
for ($i = 0; $i <= 6; $i++) {
- echo '<li>'.$i.' - '.$lang['srv_userstatus_'.$i].'</li>';
+ echo ' <li>'.$i.' - '.$lang['srv_userstatus_'.$i].'</li>';
}
- echo '<li>'.$lang['srv_bottom_data_legend_note_li0'].'</li>';
- echo '</ul>';
+ echo ' <li>'.$lang['srv_bottom_data_legend_note_li0'].'</li>';
+ echo ' </ul>';
echo '</div>';
+
echo '</div>';
}
function displayTestLegend(){
global $lang;
- echo '<div id="bottom_data_legend" class="floatLeft test">';
- echo '<div>';
- echo '<div id="bdldt1" class="as_link strong" onclick="$(\'#bottom_data_legend_detail_test, #bdldt1, #bdldt2\').toggle();"><span class="faicon plus"></span></div>';
- echo '<div id="bdldt2" class="as_link strong" style="display:none" onclick="$(\'#bottom_data_legend_detail_test, #bdldt1, #bdldt2\').toggle();"><span class="faicon minus"></span></div> '.$lang['srv_bottom_data_legend_test_note'];
+ echo '<div id="bottom_data_legend_test" class="legend_box">';
+
+ echo '<div class="legend_title">';
+ echo ' <span onclick="$(\'#bottom_data_legend_detail_test\').toggle(\'fast\');"><span class="faicon arrow2_r"></span>'.$lang['srv_bottom_data_legend_test_note'].'</span>';
echo '</div>';
- echo '<div id="bottom_data_legend_detail_test" style="display:none">';
- echo '<ul>';
- echo '<li>0 - '.$lang['srv_bottom_data_legend_test_note_li0'].'</li>';
- echo '<li>1 - '.$lang['srv_bottom_data_legend_test_note_li1'].'</li>';
- echo '<li>2 - '.$lang['srv_bottom_data_legend_test_note_li2'].'</li>';
- echo '</ul>';
+
+ echo '<div id="bottom_data_legend_detail_test" class="legend_details">';
+ echo ' <ul>';
+ echo ' <li>0 - '.$lang['srv_bottom_data_legend_test_note_li0'].'</li>';
+ echo ' <li>1 - '.$lang['srv_bottom_data_legend_test_note_li1'].'</li>';
+ echo ' <li>2 - '.$lang['srv_bottom_data_legend_test_note_li2'].'</li>';
+ echo ' </ul>';
echo '</div>';
+
echo '</div>';
}
} \ No newline at end of file
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php b/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php
index aa2a829..e510b2a 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyBreak.php
@@ -8,8 +8,8 @@
*
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define("BREAK_OPTION_LIMIT", 15);
+if(!defined("EXPORT_FOLDER"))define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("BREAK_OPTION_LIMIT"))define("BREAK_OPTION_LIMIT", 15);
class SurveyBreak
{
@@ -42,17 +42,24 @@ class SurveyBreak
private $num_digit_percent = NUM_DIGIT_PERCENT;
function __construct($sid) {
+ global $global_user_id;
+
if ((int)$sid > 0) {
+
$this->sid = $sid;
SurveyAnalysisHelper::getInstance()->Init($this->sid);
# 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/';
+
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
#inicializiramo class za datoteke
$this->SDF = SurveyDataFile::get_instance();
@@ -204,16 +211,9 @@ class SurveyBreak
$SSH -> displayTestDataBar(true);
}
- /*echo '<div id="dataOnlyValid">';
- SurveyStatusProfiles::displayOnlyValidCheckbox();
- echo '</div>';*/
-
# ali prikazujemo tabele ali grafe
$this->break_charts = (isset($this->sessionData['break']['break_show_charts']) && (int)$this->sessionData['break']['break_show_charts'] == 1) ? 1 : 0;
- //$this->DisplayLinks();
- //$this->DisplayFilters();
-
echo '<div id="div_break_data">';
$this->displayData();
echo '</div>'; #id="div_break_data"
@@ -256,43 +256,58 @@ class SurveyBreak
function displayData() {
global $lang;
- echo '<div id="break_variables">';
+
$variables = $this->getVariableList(2);
-
- echo '<span id="breakSpremenljivkaSpan" class="floatLeft spaceRight">';
- echo $lang['srv_break_label1'];
- echo '<br />';
- echo '<select id="breakSpremenljivka" name="breakSpremenljivka" onchange="breakSpremenljivkaChange();" autocomplete="off">';
+
+ echo '<div id="break_variables">';
+
+ // Dropdown
+ echo '<div id="breakSpremenljivkaSpan" class="breakDropdownHolder">';
+
+ echo '<span class="title">'.$lang['srv_break_label1'].':</span>';
+
+ echo '<select id="breakSpremenljivka" name="breakSpremenljivka" class="dropdown large" onchange="breakSpremenljivkaChange();" autocomplete="off">';
echo '<option value="0" selected="selected" >'. $lang['srv_break_select1_option'] . '</option>';
if (count($variables)) {
foreach ($variables as $variable) {
- echo '<option value="'.$variable['spr_id'].'"'
- . ( isset($variable['sequence']) ? ' seq="'.$variable['sequence'].'" ' : '')
+ echo '<option value="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'"'
+ . ( isset($variable['sequence']) ? ' seq="'.(isset($variable['spr_id'])?$variable['sequence']:'').'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- .($this->sessionData['break']['seq'] == $variable['sequence'] && (int)$variable['canChoose'] == 1 ? ' selected="selected"':'')
+ .(isset($this->sessionData['break']['seq'])&&isset($variable['sequence'])&&isset($variable['canChoose'])&&$this->sessionData['break']['seq'] == $variable['sequence'] && (int)$variable['canChoose'] == 1 ? ' selected="selected"':'')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'] . '</option>';
}
}
- echo '</select>'; # name="breakSpremenljivka"
- echo '</span>';
+ echo '</select>';
- echo '<span id="div_crossCheck" class="floatLeft spaceLeft" style="margin-top:14px;">' ;
+ echo '</div>';
+
+ // Dodatne nastavitve
+ echo '<div id="div_crossCheck" class="breakSubSetting">' ;
+
+ echo '<span class="title">'.$lang['settings'].':</span>';
+
+ echo '<span class="setting_line">';
$this->displayLinePercent();
- $this->displayLineCharts(); // V DELU...
- echo '</span>';
+ echo '</span>';
+
+ echo '<span class="setting_line">';
+ $this->displayLineCharts();
+ echo '</span>';
+
+ echo '</div>';
- echo '<br class="clr" />';
- echo '</div>'; # id="break_variables"
+ echo '</div>';
+
+
+ echo '<div id="breakResults">';
if (isset($this->sessionData['break']['spr']) && (int)$this->sessionData['break']['spr'] > 0
&& isset($this->sessionData['break']['seq']) && (int)$this->sessionData['break']['seq'] > 0) {
- echo '<div id="breakResults" >';
+
$this->doBreakForSpremenljivka();
- echo '</div>'; # id="breakResults"
- } else {
- echo '<div id="breakResults" />';
- }
+ }
+ echo '</div>'; # id="breakResults"
}
/** funkcija vrne seznam primern variabel za crostabe
@@ -304,7 +319,7 @@ class SurveyBreak
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
{
#drugi dropdown
# tekstovnih in numeričnih tipov ne dodajamo
@@ -410,7 +425,7 @@ class SurveyBreak
if (count($spremenljivka['grids']) == 1 ) {
# če imamo samo en grid ( lahko je več variabel zaradi polja drugo.
$grid = $spremenljivka['grids'][0];
- if (count ($grid['variables']) > 0) {
+ if (isset($grid['variables'])&&count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
if ($variable['other'] != 1) {
$this->variablesList[] = array(
@@ -428,7 +443,7 @@ class SurveyBreak
# imamo multicheckbox
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[] = array(
'tip'=>$tip,
@@ -444,7 +459,7 @@ class SurveyBreak
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[] = array(
'tip'=>$tip,
@@ -525,10 +540,10 @@ class SurveyBreak
}
}
}
+
$this->displayBreak($spr,$frequencys);
-
- } else {
- echo '<br class="clr">';
+ }
+ else {
echo '<p class="red strong">'.$lang['srv_break_error_note_1'].'</p>';
}
}
@@ -574,11 +589,8 @@ class SurveyBreak
}
function displayBreak($forSpr, $frequencys) {
-
-
+
ob_start(); // outer buffer
- # če imamo filter spremenljivk ga izpišemo
- echo '<br/>';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
SurveyTimeProfiles :: printIsDefaultProfile(false);
@@ -592,13 +604,16 @@ class SurveyBreak
# filtriranje po spremenljivkah
$_FILTRED_VARIABLES = SurveyVariablesProfiles::getProfileVariables(SurveyVariablesProfiles::checkDefaultProfile(), true);
+
+
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system'])&&(int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
continue;
}
+
$spremenljivka['id'] = $skey;
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
if ( is_numeric($tip)
&& $tip != 4 #text
&& $tip != 5 #label
@@ -610,7 +625,8 @@ class SurveyBreak
) {
$this->displayBreakSpremenljivka($forSpr,$frequencys,$spremenljivka);
- } else if ( is_numeric($tip)
+ }
+ else if ( is_numeric($tip)
&& (
$tip == 4 #text
|| $tip == 19 #multitext
@@ -618,6 +634,7 @@ class SurveyBreak
|| $tip == 20 #multi numer*
) && ( count($_FILTRED_VARIABLES) == 0 || (count($_FILTRED_VARIABLES) > 0 && isset($_FILTRED_VARIABLES[$skey]) ) )
) {
+
$this->displayBreakSpremenljivka($forSpr,$frequencys,$spremenljivka);
}
@@ -654,9 +671,10 @@ class SurveyBreak
# checkbox
case 2:
- $this->displayCrosstabTable($forSpr,$frequencys,$spremenljivka);
- break;
- #number
+ $this->displayCrosstabTable($forSpr,$frequencys,$spremenljivka);
+ break;
+
+ #number
case 7:
#ranking
case 17:
@@ -666,10 +684,11 @@ class SurveyBreak
case 20:
$this->displayBreakTableNumber($forSpr,$frequencys,$spremenljivka);
break ;
-
+
case 19:
$this->displayBreakTableText($forSpr,$frequencys,$spremenljivka);
break ;
+
#multicheck
case 16:
$this->displayCrosstabTable($forSpr,$frequencys,$spremenljivka);
@@ -679,8 +698,6 @@ class SurveyBreak
case 21:
# po novem besedilo izpisujemo v klasični tabeli
$this->displayBreakTableText($forSpr,$frequencys,$spremenljivka);
-
- #$this->displayCrosstabTable($forSpr,$frequencys,$spremenljivka);
break;
default:
@@ -727,38 +744,53 @@ class SurveyBreak
# ce imamo vec kot 20 kategorij,izpisujemo samo tiste ki imajo vrednosti
$displayAll = (count($options) > 20) ? false : true;
- echo '<div id="'.$spremenljivka['id'].'" class="breakTableDiv">';
- if (isset($spremenljivka['double']) && $spremenljivka['double'] > 1) {
+ if (isset($spremenljivka['double']) && $spremenljivka['double'] > 1) {
$doubleGridParts = $spremenljivka['double'];
$multiply = 1;
$isDoubleGrid = true;
- } else {
+ }
+ else {
$doubleGridParts[1]['subtitle'] = '';
$multiply = 2;
$isDoubleGrid = false;
}
-
-
+
# če imamo dvojno tabelo
-
$rowspan = ' rowspan="3"';
$colspan = ' colspan="'.($multiply*count($sequences)).'"';
+
foreach ($doubleGridParts AS $part => $doubleGridTitle) {
- echo '<br/>';
+
+ echo '<div id="'.$spremenljivka['id'].'" class="table_holder">';
+
+
+ // Zvezdica za vkljucitev v porocilo
+ echo '<div class="top_line">';
+
+ $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
+ $spr2 = $spremenljivka['grids'][0]['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
+
+ echo '</div>';
+
+
# če ni multicheck in multi grid
- echo '<table>';
- echo '<tr>';
- echo '<th'.$rowspan.'>';
+ echo '<table class="table_break">';
+
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_question" '.$rowspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $forSpr . '\'); return false;">';
echo $forSpremenljivka['naslov'];
echo '('.$forSpremenljivka['variable'].')';
echo '</a>';
echo '</span>';
-
- echo '</th>';
- echo '<th'.$colspan.'>';
+ echo '</td>';
+
+ echo '<td class="cell_question" '.$colspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $spremenljivka['id'] . '\'); return false;">';
echo $spremenljivka['naslov'];
@@ -768,60 +800,71 @@ class SurveyBreak
echo ' - '.$doubleGridTitle['subtitle'];
}
echo '</span>';
- echo '</th>';
+ echo '</td>';
+
echo '</tr>';
- echo '<tr>';
+
+ echo '<tr class="row2">';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
if ($isDoubleGrid == false || ($isDoubleGrid == true && $grid['part'] == $part)) {
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub" colspan="2">';
+ echo '<td class="cell_grid" colspan="2">';
echo $variable['naslov'];
echo '('.$variable['variable'].')';
- echo '</th>';
+ echo '</td>';
}
}
}
+
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row3">';
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
if ($isDoubleGrid == false || ($isDoubleGrid == true && $grid['part'] == $part)) {
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub">Povprečje'.$lang[''];
- echo '</th>';
- echo '<th class="sub red">Št. enot'.$lang[''];
- echo '</th>';
+ echo '<td class="cell_value">Povprečje</td>';
+ echo '<td class="cell_value">Št. enot</td>';
}
}
}
echo '</tr>';
+
+
$cnt=0;
foreach ($frequencys AS $fkey => $fkeyFrequency) {
$cbxLabel = $forSpremenljivka['grids'][0]['variables'][$cnt]['naslov'];
$cnt++;
foreach ($options AS $oKey => $option) {
if ($means[$fkey][$oKey] != null || $displayAll) {
- echo '<tr>';
- echo '<td'.$break_percentRowSpan.' class="rsdl_bck_variable1">';
+
+ echo '<tr>';
+
+ echo '<td class="cell_value">';
if ($forSpremenljivka['tip'] == 2) {
echo $cbxLabel;
- } else {
+ }
+ else {
echo $forSpremenljivka['options'][$oKey];
}
echo '</td>';
- $css = '';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
if ($isDoubleGrid == false || ($isDoubleGrid == true && $grid['part'] == $part)) {
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if ($variable['other'] != 1) {
+
#povprečja
- echo '<td'.$css.$break_percentRowSpan.'>';
+ echo '<td class="cell_value">';
echo $this->formatNumber($means[$fkey][$oKey][$sequence],$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
echo (int)$frequencys[$fkey][$oKey][$sequence]['validCnt'];
echo '</td>';
$totalMeans[$sequence] += ($means[$fkey][$oKey][$sequence]*(int)$frequencys[$fkey][$oKey][$sequence]['validCnt']);
@@ -831,44 +874,48 @@ class SurveyBreak
}
}
}
+
echo '</tr>';
}
}
}
+
+
#dodamo še skupno sumo in povprečje
echo '<tr>';
- echo '<td class="rsdl_bck_variable1 red">';
+
+ echo '<td class="cell_value">';
echo 'Skupaj';
echo '</td>';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
if ($isDoubleGrid == false || ($isDoubleGrid == true && $grid['part'] == $part)) {
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if ($variable['other'] != 1) {
+
#povprečja
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
$totalMean = $totalFreq[$sequence] > 0 ? $totalMeans[$sequence] / $totalFreq[$sequence] : 0;
echo $this->formatNumber($totalMean ,$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
echo (int)$totalFreq[$sequence];
echo '</td>';
}
-
}
}
}
+
echo '</tr>';
- echo '</table>';//$forSpremenljivka['grids'][0]['variables']
-
+
+ echo '</table>';
+
+ echo '</div>';
}
- // Zvezdica za vkljucitev v porocilo
- $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
- $spr2 = $spremenljivka['grids'][0]['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
- echo '</div>';
}
}
@@ -877,7 +924,8 @@ class SurveyBreak
#ranking - 17:
#vsota - 18:
#multinumber - 20:
-
+ global $lang;
+
$keysCount = count($frequencys);
$sequences = explode('_',$spremenljivka['sequences']);
$forSpremenljivka = $this->_HEADERS[$forSpr];
@@ -939,11 +987,10 @@ class SurveyBreak
}
// Ce izrisujemo tabelo
else{
-
- echo '<div id="'.$spremenljivka['id'].'" class="breakTableDiv">';
- echo '<br/>';
+
# za multi number naredimo po skupinah
if ($tip != 20 ) {
+
$rowspan = ' rowspan="3"';
$colspan = ' colspan="'.(2*count($sequences)).'"';
@@ -951,90 +998,126 @@ class SurveyBreak
if ((int)$this->break_percent > 0) {
$break_percentRowSpan = ' rowspan="2"';
}
+
+ echo '<div id="'.$spremenljivka['id'].'" class="table_holder">';
+
+
+ // Zvezdica za vkljucitev v porocilo
+ echo '<div class="top_line">';
+
+ $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
+ $spr2 = $spremenljivka['grids'][0]['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
+
+ echo '</div>';
+
+
# če ni multicheck in multi grid
- echo '<table>';
- echo '<tr>';
- echo '<th'.$rowspan.'>';
+ echo '<table class="table_break">';
+
+
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_question" '.$rowspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $forSpr . '\'); return false;">';
echo $forSpremenljivka['naslov'];
echo '('.$forSpremenljivka['variable'].')';
echo '</a>';
echo '</span>';
-
- echo '</th>';
- echo '<th'.$colspan.'>';
+ echo '</td>';
+
+ echo '<td class="cell_question" '.$colspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $spremenljivka['id'] . '\'); return false;">';
echo $spremenljivka['naslov'];
echo '('.$spremenljivka['variable'].')';
echo '</a>';
echo '</span>';
- echo '</th>';
+ echo '</td>';
+
echo '</tr>';
+
- echo '<tr>';
+ echo '<tr class="row2">';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub" colspan="2">';
+ echo '<td class="cell_grid" colspan="2">';
echo $variable['naslov'];
echo '('.$variable['variable'].')';
- echo '</th>';
+ echo '</td>';
}
}
+
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row3">';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub">Povprečje'.$lang[''];
- echo '</th>';
- echo '<th class="sub red">Št. enot'.$lang[''];
- echo '</th>';
+ echo '<td class="cell_value">Povprečje</td>';
+ echo '<td class="cell_value">Št. enot</td>';
}
}
+
echo '</tr>';
+
foreach ($frequencys AS $fkey => $fkeyFrequency) {
foreach ($options AS $oKey => $option) {
if ($displayAll || $means[$fkey][$oKey] != null) {
+
echo '<tr>';
- echo '<td'.$break_percentRowSpan.' class="rsdl_bck_variable1">';
+
+ echo '<td class="cell_var">';
echo $forSpremenljivka['options'][$oKey];
echo '</td>';
- $css = '';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if ($variable['other'] != 1) {
+
+ $means1 = isset($means[$fkey][$oKey][$sequence])?$means[$fkey][$oKey][$sequence]:0;
+ $validCnt1 = isset($frequencys[$fkey][$oKey][$sequence]['validCnt'])?$frequencys[$fkey][$oKey][$sequence]['validCnt']:0;
+
#povprečja
- echo '<td'.$css.$break_percentRowSpan.'>';
- echo $this->formatNumber($means[$fkey][$oKey][$sequence],$this->num_digit_average,'');
- #echo $this->formatNumber($means[$fkey][$sequence],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ echo '<td class="cell_value">';
+ echo $this->formatNumber($means1,$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
- echo (int)$frequencys[$fkey][$oKey][$sequence]['validCnt'];
- #echo (int)$frequencys[$fkey][$sequence]['validCnt'];
+ echo '<td class="cell_value">';
+ echo (int)$validCnt1;
echo '</td>';
- #$totalMeans[$sequence] += ($this->getMeansFromKey($fkeyFrequency[$sequence])*(int)$frequencys[$fkey][$sequence]['validCnt']);
- #$totalFreq[$sequence]+= (int)$frequencys[$fkey][$sequence]['validCnt'];
- $totalMeans[$sequence] += ($means[$fkey][$oKey][$sequence]*(int)$frequencys[$fkey][$oKey][$sequence]['validCnt']);
- $totalFreq[$sequence]+= (int)$frequencys[$fkey][$oKey][$sequence]['validCnt'];
+
+ $totalMeans[$sequence] = (isset($totalMeans[$sequence])?
+ $totalMeans[$sequence] += ($means1*(int)$validCnt1): $means1*(int)$validCnt1);
+ $totalFreq[$sequence] = (isset($totalFreq[$sequence])?
+ $totalFreq[$sequence] += ((int)$validCnt1): (int)$validCnt1);
}
}
}
+
echo '</tr>';
+
+
if ((int)$this->break_percent) {
+
echo '<tr>';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
if ($variable['other'] != 1) {
+
$sequence = $variable['sequence'];
- echo '<td class="">';
- #echo (int)$frequencys[$fkey][$sequence]['validCnt'];
+
+ echo '<td class="cell_value">';
$percent = 0;
if ($frequencys[$fkey][$sequence]['validCnt'] > 0 ) {
$percent = 100;
@@ -1045,81 +1128,103 @@ class SurveyBreak
}
}
+
echo '</tr>';
}
}
}
}
+
+
#dodamo še skupno sumo in povprečje
echo '<tr>';
- echo '<td class="rsdl_bck_variable1">';
- echo $lang[''].'Skupaj';
+
+ echo '<td class="cell_value">';
+ echo 'Skupaj';
echo '</td>';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if ($variable['other'] != 1) {
+
#povprečja
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
$totalMean = $totalFreq[$sequence] > 0 ? $totalMeans[$sequence] / $totalFreq[$sequence] : 0;
echo $this->formatNumber($totalMean ,$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
echo (int)$totalFreq[$sequence];
echo '</td>';
}
}
-
}
+
echo '</tr>';
+
echo '</table>';
-
- // Zvezdica za vkljucitev v porocilo
- $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
- $spr2 = $spremenljivka['grids'][0]['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
-
- #xxxxx
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
-
-
- } else if ($tip == 20){
+ echo '</div>';
+ }
+ else if ($tip == 20){
+
# za multi number razdelimo na grupe - skupine
$rowspan = ' rowspan="3"';
$colspan = ' colspan="'.(2*count($spremenljivka['grids'][0]['variables'])).'"';
+
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
// Ce smo v porocilu po meri in ni prava tabela jo preskocimo
if(isset($spremenljivka['break_sub_table']['key']) && $spremenljivka['break_sub_table']['key'] != $gkey){
continue;
}
+
+ echo '<div id="'.$spremenljivka['id'].'" class="table_holder">';
+
+ echo '<div class="top_line">';
+
// Ce smo v porocilu po meri in je prava tabelo jo izpisemo brez naslova
if(!isset($spremenljivka['break_sub_table']['sequence'])){
- echo '<br/><b>'.$lang['srv_break_table_for'];
+ echo '<div class="table_title">';
+
+ echo $lang['srv_break_table_for'];
echo $spremenljivka['naslov'].' (';
echo $spremenljivka['variable'].') = ';
echo $grid['naslov'];
echo ' ('.$grid['variable'].')';
- echo '</b>';
+
+ echo '</div>';
}
+
+ // Zvezdica za vkljucitev v porocilo
+ $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
+ $spr2 = $grid['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
+
+ echo '</div>';
+
- echo '<table>';
+ echo '<table class="table_break">';
+
+
#labele
- echo '<tr>';
- echo '<th'.$rowspan.'>';
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_question" '.$rowspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $forSpr . '\'); return false;">';
echo $forSpremenljivka['naslov'];
echo '('.$forSpremenljivka['variable'].')';
echo '</a>';
echo '</span>';
- echo '</th>';
+ echo '</td>';
- echo '<th'.$colspan.'>';
+ echo '<td class="cell_question" '.$colspan.'>';
echo '<span class="anl_variabla">';
echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $spremenljivka['id'] . '\'); return false;">';
echo $spremenljivka['naslov']. ' - ';
@@ -1127,53 +1232,69 @@ class SurveyBreak
echo '('.$grid['variable'].')';
echo '</a>';
echo '</span>';
- echo '</th>';
+ echo '</td>';
+
echo'</tr>';
+
+
#labele
- echo '<tr>';
+ echo '<tr class="row2">';
+
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub" colspan="2">';
+ echo '<td class="cell_grid" colspan="2">';
echo $variable['naslov'];
echo '('.$variable['variable'].')';
- echo '</th>';
+ echo '</td>';
}
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row3">';
+
foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub">Povprečje'.$lang[''];
- echo '</th>';
- echo '<th class="sub red">Št. enot'.$lang[''];
- echo '</th>';
+ echo '<td class="cell_value">Povprečje</td>';
+ echo '<td class="cell_value">Št. enot</td>';
}
+
echo '</tr>';
+
+
$cnt=0;
foreach ($frequencys AS $fkey => $fkeyFrequency) {
$cbxLabel = $forSpremenljivka['grids'][0]['variables'][$cnt]['naslov'];
$cnt++;
+
foreach ($forSpremenljivka['options'] AS $oKey => $option) {
if ($displayAll || $means[$fkey][$oKey] != null) {
+
# če je osnova checkbox vzamemo samo tam ko je 1
if(($forSpremenljivka['tip'] == 2 && $option == 1) || $forSpremenljivka['tip'] != 2 ) {
- echo '<tr>';
- echo '<td'.$break_percentRowSpan.' class="rsdl_bck_variable1">';
+
+ echo '<tr>';
+
+ echo '<td class="cell_value">';
if ($forSpremenljivka['tip'] == 2) {
echo $cbxLabel;
- } else {
+ }
+ else {
echo $forSpremenljivka['options'][$oKey];
}
- #echo ' ('.$oKey.')';
echo '</td>';
+
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
+
#povprečje
- echo '<td>';
+ echo '<td class="cell_value">';
echo $this->formatNumber($means[$fkey][$oKey][$sequence],$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
echo (int)$frequencys[$fkey][$oKey][$sequence]['validCnt'];
echo '</td>';
+
$totalMeans[$sequence] += ($means[$fkey][$oKey][$sequence]*(int)$frequencys[$fkey][$oKey][$sequence]['validCnt']);
$totalFreq[$sequence]+= (int)$frequencys[$fkey][$oKey][$sequence]['validCnt'];
@@ -1183,46 +1304,46 @@ class SurveyBreak
}
}
}
+
+
#dodamo še skupno sumo in povprečje
echo '<tr>';
- echo '<td class="rsdl_bck_variable1">';
+
+ echo '<td class="cell_value">';
echo 'Skupaj';
echo '</td>';
+
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if ($variable['other'] != 1) {
+
#povprečja
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
$totalMean = $totalFreq[$sequence] > 0 ? $totalMeans[$sequence] / $totalFreq[$sequence] : 0;
echo $this->formatNumber($totalMean ,$this->num_digit_average,'');
echo '</td>';
+
# enote
- echo '<td class="red strong">';
+ echo '<td class="cell_value">';
echo (int)$totalFreq[$sequence];
echo '</td>';
}
}
+
echo '</tr>';
+
echo '</table>';
-
-
- // Zvezdica za vkljucitev v porocilo
- $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
- $spr2 = $grid['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
-
- echo '<br/>';
+
+ echo '</div>';
}
-
- }
- echo '</div>';
- }
-
+ }
+ }
}
+ #text - 21:
+ #multi text - 19:
function displayBreakTableText($forSpr,$frequencys,$spremenljivka){
- #text - 21:
- #multi text - 19:
+ global $lang;
$keysCount = count($frequencys);
$sequences = explode('_',$spremenljivka['sequences']);
$forSpremenljivka = $this->_HEADERS[$forSpr];
@@ -1234,11 +1355,12 @@ class SurveyBreak
$totalFreq = array();
$forSequences = array();
$cnt = array();
+
foreach ($frequencys AS $fkey => $fkeyFrequency) {
$forSequences[] = $fkey;
foreach ($forSpremenljivka['options'] AS $oKey => $option) {
foreach ($sequences AS $sequence) {
- $txt = $this->getTextFromKey($fkeyFrequency[$oKey][$sequence]);
+ $txt = isset($fkeyFrequency[$oKey][$sequence])?$this->getTextFromKey($fkeyFrequency[$oKey][$sequence]):array();
if ($txt) {
$cnt[$fkey]++;
$texts[$fkey][$oKey][$sequence] = $txt;
@@ -1248,123 +1370,143 @@ class SurveyBreak
}
# če imamo več kot 20 kategorij,izpisujemo samo tiste ki imajo vrednosti
- $displayAll = (count($forSpremenljivka['options']) > 20) ? false : true;
-
- echo '<div id="'.$spremenljivka['id'].'" class="breakTableDiv">';
- echo '<br/>';
- # za multi text razdelimo na grupe - skupine
- $rowspan = ' rowspan="2"';
- $colspan = ' colspan="'.(count($spremenljivka['grids'][0]['variables'])).'"';
- foreach ($spremenljivka['grids'] AS $gkey => $grid) {
-
- // Ce smo v porocilu po meri in ni prava tabela jo preskocimo
- if(isset($spremenljivka['break_sub_table']['sequence']) && $spremenljivka['break_sub_table']['key'] != $gkey){
- continue;
- }
-
- // Ce smo v porocilu po meri in je prava tabelo jo izpisemo brez naslova
- if(!isset($spremenljivka['break_sub_table']['sequence'])){
- echo '<br/>';
- if($tip != '21'){
- echo '<b>';
- echo $lang['srv_break_table_for'];
- echo $spremenljivka['naslov'].' (';
- echo $spremenljivka['variable'].') = ';
- echo $grid['naslov'];
- echo ' ('.$grid['variable'].')';
- echo '</b>';
- }
- }
-
- echo '<table>';
- #labele
- echo '<tr>';
- echo '<th'.$rowspan.'>';
- echo '<span class="anl_variabla">';
- echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $forSpr . '\'); return false;">';
- echo $forSpremenljivka['naslov'];
- echo '('.$forSpremenljivka['variable'].')';
- echo '</a>';
- echo '</span>';
- echo '</th>';
-
- echo '<th'.$colspan.'>';
- echo '<span class="anl_variabla">';
- echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $spremenljivka['id'] . '\'); return false;">';
- echo $spremenljivka['naslov']. ' - ';
- echo $grid['naslov'];
- echo '('.$grid['variable'].')';
- echo '</a>';
- echo '</span>';
- echo '</th>';
- echo'</tr>';
- #labele
- echo '<tr>';
- foreach ($grid['variables'] AS $vkey => $variable) {
- echo '<th class="sub" >';
- echo $variable['naslov'];
- echo '('.$variable['variable'].')';
- echo '('.$variable['sequence'].')';
- echo '</th>';
- }
- echo '</tr>';
- $cntCbx= 0;
- foreach ($forSequences AS $fKey => $forSequence) {
- $cbxLabel = $forSpremenljivka['grids'][0]['variables'][$cntCbx]['naslov'];
- $cntCbx++;
- foreach ($forSpremenljivka['options'] AS $oKey => $option) {
- if ($displayAll || $texts[$forSequence][$oKey] != null) {
- if(($forSpremenljivka['tip'] == 2 && $option == 1) || $forSpremenljivka['tip'] != 2 ) {
- echo '<tr>';
- echo '<td'.$break_percentRowSpan.' class="rsdl_bck_variable1">';
- if ($forSpremenljivka['tip'] == 2) {
- echo $cbxLabel;
- } else {
- echo $forSpremenljivka['options'][$oKey];
- }
- echo '</td>';
- foreach ($grid['variables'] AS $vkey => $variable) {
- $sequence = $variable['sequence'];
- #povprečje
- echo '<td class="anl_at cll_clps" style="vertical-align:top;">';
- if (count($texts[$forSequence][$oKey][$sequence]) > 0) {
- $cnt=1;
- $count = count($texts[$forSequence][$oKey][$sequence]);
- foreach ($texts[$forSequence][$oKey][$sequence] AS $ky => $units) {
- echo '<div class="'.($cnt<=$count && $cnt>1?'anl_bt_dot ':'').('').'"style="line-height: 150%; padding:3px;">';
- echo $units['text'];
- echo '</div>';
- $cnt++;
- }
- }
-
-
- #echo $this->formatNumber($texts[$oKey][$sequence],$this->num_digit_average,'');
- echo '</td>';
-
- }
- echo '</tr>';
- }
- }
- }
- }
- echo '</table>';
-
-
- // Zvezdica za vkljucitev v porocilo
- $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
- $spr2 = $grid['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
-
- echo '<br/>';
- }
+ $displayAll = (count($forSpremenljivka['options']) > 20) ? false : true;
+
+ # za multi text razdelimo na grupe - skupine
+ $rowspan = ' rowspan="2"';
+ $colspan = ' colspan="'.(count($spremenljivka['grids'][0]['variables'])).'"';
+
+
+ foreach ($spremenljivka['grids'] AS $gkey => $grid) {
+
+ // Ce smo v porocilu po meri in ni prava tabela jo preskocimo
+ if(isset($spremenljivka['break_sub_table']['sequence']) && $spremenljivka['break_sub_table']['key'] != $gkey){
+ continue;
+ }
+
+ echo '<div id="'.$spremenljivka['id'].'" class="table_holder">';
+
+
+ echo '<div class="top_line">';
+
+ // Ce smo v porocilu po meri in je prava tabelo jo izpisemo brez naslova
+ if(!isset($spremenljivka['break_sub_table']['sequence'])){
- echo '</div>';
-
+ if($tip != '21'){
+ echo '<div class="table_title">';
+
+ echo $lang['srv_break_table_for'];
+ echo $spremenljivka['naslov'].' (';
+ echo $spremenljivka['variable'].') = ';
+ echo $grid['naslov'];
+ echo ' ('.$grid['variable'].')';
+
+ echo '</div>';
+ }
+ }
+
+ // Zvezdica za vkljucitev v porocilo
+ $spr1 = $this->sessionData['break']['seq'].'-'. $this->sessionData['break']['spr'].'-undefined';
+ $spr2 = $grid['variables'][0]['sequence'].'-'.$spremenljivka['id'].'-undefined';
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=9, $sub_type=0, $spr1, $spr2);
+
+ echo '</div>';
+
+
+ echo '<table class="table_break">';
+
+
+ #labele
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_question" '.$rowspan.'>';
+ echo '<span class="anl_variabla">';
+ echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $forSpr . '\'); return false;">';
+ echo $forSpremenljivka['naslov'];
+ echo '('.$forSpremenljivka['variable'].')';
+ echo '</a>';
+ echo '</span>';
+ echo '</td>';
+
+ echo '<td class="cell_question" '.$colspan.'>';
+ echo '<span class="anl_variabla">';
+ echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $spremenljivka['id'] . '\'); return false;">';
+ echo $spremenljivka['naslov']. ' - ';
+ echo $grid['naslov'];
+ echo isset($grid['variable'])?'('.$grid['variable'].')':'';
+ echo '</a>';
+ echo '</span>';
+ echo '</td>';
+
+ echo'</tr>';
+
+
+ #labele
+ echo '<tr class="row2">';
+
+ foreach ($grid['variables'] AS $vkey => $variable) {
+ echo '<td class="cell_grid">';
+ echo $variable['naslov'];
+ echo '('.$variable['variable'].')';
+ echo '('.$variable['sequence'].')';
+ echo '</td>';
+ }
+
+ echo '</tr>';
+
+
+ $cntCbx= 0;
+ foreach ($forSequences AS $fKey => $forSequence) {
+ $cbxLabel = $forSpremenljivka['grids'][0]['variables'][$cntCbx]['naslov'];
+ $cntCbx++;
+
+ foreach ($forSpremenljivka['options'] AS $oKey => $option) {
+ if ($displayAll || $texts[$forSequence][$oKey] != null) {
+ if(($forSpremenljivka['tip'] == 2 && $option == 1) || $forSpremenljivka['tip'] != 2 ) {
+
+ echo '<tr>';
+
+ echo '<td class="cell_value">';
+ if ($forSpremenljivka['tip'] == 2) {
+ echo $cbxLabel;
+ }
+ else {
+ echo $forSpremenljivka['options'][$oKey];
+ }
+ echo '</td>';
+
+ foreach ($grid['variables'] AS $vkey => $variable) {
+ $sequence = $variable['sequence'];
+ #povprečje
+ echo '<td class="cell_value">';
+ if (isset($texts[$forSequence][$oKey][$sequence])&&count($texts[$forSequence][$oKey][$sequence]) > 0) {
+ $cnt=1;
+ $count = count($texts[$forSequence][$oKey][$sequence]);
+ foreach ($texts[$forSequence][$oKey][$sequence] AS $ky => $units) {
+ echo '<div class="'.($cnt<=$count && $cnt>1?'anl_bt_dot ':'').('').'"style="line-height: 150%; padding:3px;">';
+ echo $units['text'];
+ echo '</div>';
+ $cnt++;
+ }
+ }
+
+ echo '</td>';
+ }
+
+ echo '</tr>';
+ }
+ }
+ }
+ }
+
+ echo '</table>';
+
+ echo '</div>';
+ }
}
function displayCrosstabTable($forSpr,$frequencys,$spremenljivka){
-
+ global $lang;
#polovimo sekvence in spremenljivke
// Ce smo v creportu imamo nastavljeno prvo spremenljivko posebej (ne v sessionu)
if(isset($spremenljivka['break_sub_table']['sequence'])){
@@ -1406,14 +1548,18 @@ class SurveyBreak
// Ce smo v porocilu po meri in je prava tabelo jo izpisemo brez naslova
if(!isset($spremenljivka['break_sub_table']['sequence']) && ($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 6) && $this->break_charts != 1){
- echo '<br/><b>'.$lang['srv_break_table_for'];
+
+ echo '<div class="table_title">';
+
+ echo $lang['srv_break_table_for'];
echo $spremenljivka['naslov'].' (';
echo $spremenljivka['variable'].') = ';
echo $grid['naslov'];
if ($spremenljivka['tip'] != 6) {
echo ' ('.$grid['variable'].')';
}
- echo '</b>';
+
+ echo '</div>';
}
$seq2 = $grid['variables'][0]['sequence'];
@@ -1435,26 +1581,24 @@ class SurveyBreak
$this->SurveyCrosstab->setVariables($seq1,$spr1,$grd1,$seq2,$spr2,$grd2);
$this->SurveyCrosstab->displayCrosstabsTable();
}
-
- echo '<br/>';
}
-
}
+
function getMeansFromKey($frequencys) {
$sum = 0;
- if (count($frequencys['valid']) > 0) {
+ if (isset($frequencys['valid'])&&count($frequencys['valid']) > 0) {
foreach ($frequencys['valid'] AS $fkey => $tmp) {
$sum += (int)$fkey * (int)$tmp['cnt'];
}
}
- $mean = (int)$frequencys['validCnt'] > 0 ? (int)$sum / (int)$frequencys['validCnt'] : 0;
+ $mean = isset($frequencys['validCnt'])&&(int)$frequencys['validCnt'] > 0 ? (int)$sum / (int)$frequencys['validCnt'] : 0;
return $mean;
}
function getTextFromKey($frequencys) {
$texts = array();
- if (count($frequencys['valid']) > 0) {
+ if (isset($frequencys['valid'])&&count($frequencys['valid']) > 0) {
foreach ($frequencys['valid'] AS $fkey => $tmp) {
$texts[] = $tmp;
}
@@ -1514,21 +1658,21 @@ class SurveyBreak
echo '<div class="analysis_bottom_settings printHide">';
- echo '<a href="#" onClick="addCustomReportAllElementsAlert(9);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport" style="margin-right: 40px;"><span class="spaceRight faicon comments_creport" ></span><span class="bold">'.$lang['srv_custom_report_comments_add'].'</span></a>';
-
- echo '<a href="#" onClick="printAnaliza(\'Break\'); return false;"'.$lan_print.' class="srv_ico"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis&anketa=' . $this->sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis_rtf&anketa=' . $this->sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis_xls&anketa=' . $this->sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls black very_large"></span></a>';
+ echo '<div class="comment_holder">';
+ echo ' <a href="#" class="comment" onClick="addCustomReportAllElementsAlert(9);" title="'.$lang['srv_custom_report_comments_add_hover'].'" class="'.(!$userAccess->checkUserAccess('analysis_analysis_creport') ? 'user_access_locked' : '').'" user-access="analysis_analysis_creport"><span class="faicon comments" ></span><span>'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '</div>';
+
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis_xls&anketa=' . $this->sid) . '" target="_blank"'.$lan_xls.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon xls"></span></a>';
+ //echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis_rtf&anketa=' . $this->sid) . '" target="_blank"'.$lan_rtf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon rtf"></span></a>';
+ //echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?b=export&m=break_izpis&anketa=' . $this->sid) . '" target="_blank"'.$lan_pdf.' class="srv_ico '.(!$userAccess->checkUserAccess('analysis_export') ? 'user_access_locked' : '').'" user-access="analysis_export"><span class="faicon pdf"></span></a>';
echo '<a href="#" onclick="doArchiveBreak();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveBreakBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<a href="#" onclick="createArchiveBreakBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '" class="'.(!$userAccess->checkUserAccess('archive') ? 'user_access_locked' : '').'" user-access="archive"><span class="faicon arhiv_mail"></span></a>';
echo '</div>';
// Javascript s katerim povozimo urlje za izvoze, ki niso na voljo v paketu
- global $app_settings;
- if($app_settings['commercial_packages'] == true){
+ if(AppSettings::getInstance()->getSetting('app_settings-commercial_packages') === true){
echo '<script> userAccessExport(); </script>';
}
}
@@ -1561,18 +1705,19 @@ class SurveyBreak
function displayLinePercent() {
global $lang;
- echo '<label><input id="break_percent" name="break_percent" onchange="change_break_percent();" type="checkbox" ' . ((int)$this->break_percent == 1 ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo $lang['srv_analiza_crosstab_odstotek_vrstice_short'].'</label>';
+
+ echo '<input id="break_percent" name="break_percent" onchange="change_break_percent();" type="checkbox" ' . ((int)$this->break_percent == 1 ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo '<label for="break_percent">'.$lang['srv_analiza_crosstab_odstotek_vrstice_short'].'</label>';
}
function displayLineCharts() {
global $lang;
- echo '<span class="spaceLeft">';
-
- echo ' <label for="break_charts_0"><input type="radio" value="0" name="break_charts" id="break_charts_0" '.((int)$this->break_charts == 0 ? ' checked="checked" ' : '').' onClick="change_break_charts(this.value)" />'.$lang['srv_tables'].'</label>';
- echo ' <label for="break_charts_1"><input type="radio" value="1" name="break_charts" id="break_charts_1" '.((int)$this->break_charts == 1 ? ' checked="checked" ' : '').' onClick="change_break_charts(this.value)" />'.$lang['srv_charts'].'</label>';
-
- echo '</span>';
+ echo '<input type="radio" value="0" name="break_charts" id="break_charts_0" '.((int)$this->break_charts == 0 ? ' checked="checked" ' : '').' onClick="change_break_charts(this.value)" />';
+ echo '<label for="break_charts_0">'.$lang['srv_tables'].'</label>';
+
+ echo '<input type="radio" value="1" name="break_charts" id="break_charts_1" '.((int)$this->break_charts == 1 ? ' checked="checked" ' : '').' onClick="change_break_charts(this.value)" />';
+ echo '<label for="break_charts_1">'.$lang['srv_charts'].'</label>';
}
+
} \ No newline at end of file
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyChart.php b/admin/survey/classes/surveyAnalysis/class.SurveyChart.php
index 461468f..521b1f4 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyChart.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyChart.php
@@ -4,7 +4,7 @@
* @date Februar 2011
*/
-define("SAA_FOLDER", "AnalysisArchive");
+if(!defined("SAA_FOLDER")) define("SAA_FOLDER", "AnalysisArchive");
class SurveyChart {
@@ -149,29 +149,27 @@ class SurveyChart {
}
// Pobrisemo stare (starejse od $expire_time v dnevih) slike grafov iz cache folderja
- static function clearCache($expire_time = 14){
+ static function clearCache($expire_time_days = 14){
$folderPath = dirname(__FILE__).'/../../pChart/Cache/';
$fileTypes = '*';
-
- // Pobrisemo file starejse od
- $expire_time = $expire_time * 24 * 60 * 60;
-
- foreach (glob($folderPath . $fileTypes) as $Filename) {
+
+ foreach (glob($folderPath . $fileTypes) as $file_name) {
// preberemo cas dostopa do fila
- //$FileCreationTime = fileatime($Filename);
- // preberemo cas ustvarjanja fila
- $FileCreationTime = filemtime($Filename);
+ $file_creation_time = filemtime($file_name);
- // starost v dnevih
- $FileAge = round( (time() - $FileCreationTime) / $expire_time );
+ // starost fila
+ $file_age = time() - $file_creation_time;
+
+ // Starost fila v dnevih
+ $file_age_days = floor($file_age / (60 * 60 * 24));
- if ($FileAge >= ($expire_time)){
+ if ($file_age_days >= ($expire_time_days)){
// brisemo stare file
- //echo 'Datoteka '.$Filename.' je starejša od '.$expire_time.' min in je bila zbrisana.<br />';
- unlink($Filename);
+ //echo 'Datoteka '.$file_name.' je starejša od '.$expire_time_days.' dni in je bila zbrisana.<br />';
+ unlink($file_name);
}
}
}
@@ -313,7 +311,6 @@ class SurveyChart {
// prikazemo nastavitve
if (self::$isArchive != true && self::$publicChart != true) {
self::displayGlobalSettings();
- echo "<br/>\n";
}
# preberemo header
@@ -348,8 +345,17 @@ class SurveyChart {
echo '</div>';
+ if (self::$dataFileStatus == FILE_STATUS_NO_DATA
+ || self::$dataFileStatus == FILE_STATUS_NO_FILE
+ || self::$dataFileStatus == FILE_STATUS_SRV_DELETED){
+
+ $noDataAlert ="noDataAlert";
+ } else {
+ $noDataAlert ="";
+ }
+
if (self::$isArchive != true && self::$publicChart != true) {
- self::displayBottomSettings();
+ self::displayBottomSettings($noDataAlert);
}
@@ -380,7 +386,7 @@ class SurveyChart {
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
# preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
+ if (isset($spremenljivka['tip']) && ($spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
&& (!isset($_spid) || (isset($_spid) && $_spid == $spid))
&& $spremenljivka['tip'] != 5) {
@@ -405,13 +411,13 @@ class SurveyChart {
}
else{
// Ce imamo radio tip in manj kot 5 variabel in numeric oz 2 variabli - po defaultu prikazemo piechart
- $vars = (is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
+ $vars = (isset($spremenljivka['options']) && is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
if( ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) && (($vars < 5 && $spremenljivka['skala'] == 1) || $vars < 3) ){
self::$settings['type'] = 2;
}
// Ce imamo radio tip in vec kot 20 variabel -> po defaultu ne prikazujemo praznih
- $vars = (is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
+ $vars = (isset($spremenljivka['options']) && is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
if( ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) && $vars > 20 ){
self::$settings['hideEmptyVar'] = 1;
}
@@ -436,8 +442,8 @@ class SurveyChart {
}
// Ce imamo semanticni diferencial po defaultu prikazemo vertikalno crto
- $vars = (is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
- if($spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 1){
+ $vars = (isset($spremenljivka['options']) && is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
+ if($spremenljivka['tip'] == 6 && isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
self::$settings['type'] = 6;
}
// Ce imamo mg tip in manj kot 4 gridov po defaultu prikazemo strukturne stolpce
@@ -515,7 +521,7 @@ class SurveyChart {
case 6: # multigrid
// dvojna tabela
- if($spremenljivka['enota'] == 3)
+ if(isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 3)
self::displayDoubleMultigridChart($spid, self::$settings);
else
self::displayMultigridChart($spid, self::$settings);
@@ -610,13 +616,15 @@ class SurveyChart {
echo '<div id="div_analiza_data" class="charts">';
+ self::displayExportIcons($spid, $hide_button=true);
+
$vars_count = count(SurveyAnalysis::$_FILTRED_VARIABLES);
- $spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
+ $spremenljivka = isset(SurveyAnalysis::$_HEADERS[$spid])?SurveyAnalysis::$_HEADERS[$spid]:array();
SurveyAnalysis::getFrequencys();
# preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
+ if ((isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
&& (!isset($_spid) || (isset($_spid) && $_spid == $spid))
&& $spremenljivka['tip'] != 5) {
@@ -648,7 +656,7 @@ class SurveyChart {
self::$settings['type'] = 2;
}*/
// Ce imamo semanticni diferencial po defaultu prikazemo vertikalno crto
- if($spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 1){
+ if($spremenljivka['tip'] == 6 && isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
self::$settings['type'] = 6;
}
// Ce imamo mg tip in manj kot 5 gridov po defaultu prikazemo strukturne stolpce
@@ -700,7 +708,7 @@ class SurveyChart {
break;
case 6: # multigrid
// dvojna tabela
- if($spremenljivka['enota'] == 3)
+ if(isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 3)
self::displayDoubleMultigridChart($spid, self::$settings);
else
self::displayMultigridChart($spid, self::$settings);
@@ -742,7 +750,7 @@ class SurveyChart {
self::sumMultiText($spid);
break;
case 21: # besedilo*
- if ($spremenljivka['cnt_all'] == 1) {
+ if (isset($spremenljivka['cnt_all'])&&$spremenljivka['cnt_all'] == 1) {
// če je enodimenzionalna prikažemo kot frekvence
// predvsem zaradi vprašanj tipa: language, email...
//SurveyAnalysis::sumTextVertical($spid,'sums');
@@ -765,7 +773,7 @@ class SurveyChart {
} // end if $spremenljivka['tip'] != 'm'
echo '</div>';
-
+
//self::displayBottomSettings();
} // end if else ($_headFileName == null)
@@ -800,7 +808,7 @@ class SurveyChart {
}
}
else{
- if((self::$sessionData[$spid]['type'] != 2 && $settings['type'] == 2) || (self::$sessionData[$spid]['type'] != 8 && $settings['type'] == 8)){
+ if(!isset(self::$sessionData[$spid]['type']) || (self::$sessionData[$spid]['type'] != 2 && $settings['type'] == 2) || (self::$sessionData[$spid]['type'] != 8 && $settings['type'] == 8)){
$settings['sort'] = 1;
self::$settings['sort'] = 1;
}
@@ -837,7 +845,7 @@ class SurveyChart {
}
// Popravimo pri preklopu na povprecje - prikazujemo notranje vrednosti in izklopimo prikaz povprecja
- if(self::$sessionData[$spid]['type'] != 9 && $settings['type'] == 9){
+ if((!isset(self::$sessionData[$spid]['type']) || self::$sessionData[$spid]['type'] != 9) && $settings['type'] == 9){
$settings['barLabel'] = 1;
self::$settings['barLabel'] = 1;
@@ -1203,19 +1211,19 @@ class SurveyChart {
}
else{
// Ce smo ravnokar preklopili na linijski - po skupinah imamo default vse intervale
- if(self::$sessionData[$spid]['type'] != 2 && $settings['type'] == 2){
+ if((!isset(self::$sessionData[$spid]['type']) || self::$sessionData[$spid]['type'] != 2) && $settings['type'] == 2){
$settings['interval'] = -1;
self::$settings['interval'] = -1;
}
// Ce smo ravnokar preklopili na navaden - po skupinah imamo default 10 intervalov
- if(self::$sessionData[$spid]['type'] >= 2 && $settings['type'] < 2){
+ if(isset(self::$sessionData[$spid]['type']) && self::$sessionData[$spid]['type'] >= 2 && $settings['type'] < 2){
$settings['interval'] = 10;
self::$settings['interval'] = 10;
}
}
// Popravimo pri preklopu na povprecje - prikazujemo notranje vrednosti in izklopimo prikaz povprecja
- if(self::$sessionData[$spid]['type'] != 9 && $settings['type'] == 9){
+ if((!isset(self::$sessionData[$spid]['type']) || self::$sessionData[$spid]['type'] != 9) && $settings['type'] == 9){
$settings['barLabel'] = 1;
self::$settings['barLabel'] = 1;
@@ -2346,6 +2354,7 @@ class SurveyChart {
$ID = self::$anketa.'_chart_'.$spid.'_mv_'.SurveyAnalysis::$missingProfileData['display_mv_type'];
foreach ($settings AS $key => $val) {
+
if($key == 'colors'){
$ID .= '_colors';
@@ -2356,7 +2365,7 @@ class SurveyChart {
}
elseif($key != 'name')
- $ID .= '_'.$key.'_'.$val;
+ $ID = !is_array($val) ? $ID .= '_'.$key.'_'.$val : $ID .= '_'.$key.'_';
}
$ID .= '_skin_'.self::$skin;
@@ -3089,9 +3098,9 @@ class SurveyChart {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
if ($vAnswer['cnt'] > 0 || true) { # izpisujemo samo tiste ki nisno 0
-
- $_valid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+
+ $_valid = (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']) && SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ $_percent = (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']) && SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$tempArray = array();
@@ -3101,7 +3110,7 @@ class SurveyChart {
if($vAnswer['cnt'] > 0)
$emptyData = false;
- $N = ($settings['value_type'] == 0) ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'];
+ $N = ($settings['value_type'] == 0 && isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])) ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'];
$tempArray['percent'] = $_percent;
$tempArray['valid'] = $_valid;
@@ -3112,17 +3121,19 @@ class SurveyChart {
$tempArray['variable'] = $text;
$fullPercent += $tempArray['percent'];
-
+
// ce imamo vklopljeno da izpuscamo 0 in prikazujemo pie chart spustimo nicelne vrednosti
- if($_valid != 0 || SurveyDataSettingProfiles :: getSetting('chartPieZeros') == 1 || ($settings['type'] != 2 && $settings['type'] != 8))
+ if($_valid != 0 || SurveyDataSettingProfiles :: getSetting('chartPieZeros') == 1 || ($settings['type'] != 2 && $settings['type'] != 8)){
$dataArray[] = $tempArray;
+ }
+
// Ce je ordinalen racunamo povprecje
if($spremenljivka['skala'] != 1){
$xi = (int)$vkey;
$fi = (int)$vAnswer['cnt'];
- $sum_xi_fi += $xi * $fi;
+ $sum_xi_fi = isset($sum_xi_fi) ? $sum_xi_fi += $xi * $fi : $xi * $fi;
$N_average += $fi;
}
}
@@ -3134,7 +3145,7 @@ class SurveyChart {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
}
-
+
$displayMV = ((int)SurveyAnalysis::$missingProfileData['display_mv_type'] === 2) ? TRUE : FALSE;
if ( (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0) && $displayMV) {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
@@ -3166,7 +3177,7 @@ class SurveyChart {
$i++;
}
-
+
// zascita pred praznimi vprasanji (brez variabel)
if($_variables_count == 0)
return -1;
@@ -3494,7 +3505,7 @@ class SurveyChart {
}
// napolnimo podatke za DVOJNI MULTIGRID
- elseif($spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 3){
+ elseif(isset($spremenljivka['enota']) && $spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 3){
$DataSet = new pData;
$dataArray = array();
$fullPercent = array();
@@ -3747,7 +3758,7 @@ class SurveyChart {
$_variables_count = count($stolpci);
-
+ $gidsCanShow=array();
# odstranimo še možne nepotrebne zapise za multigride
if($settings['hideEmptyVar'] == 1){
$allGrids = count($spremenljivka['grids']);
@@ -3781,8 +3792,7 @@ class SurveyChart {
$legendTitle = '';
// Kontrola ce ne prikazujemo praznih variabel
- if ((!is_array($gidsCanShow) && !isset($gidsCanShow[$gid]))
- || (is_array($gidsCanShow) && isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true)){
+ if (!isset($gidsCanShow[$gid]) || (isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true)){
# dodamo dodatne vrstice z albelami grida
foreach ($grid['variables'] AS $vid => $variable ){
@@ -3825,7 +3835,7 @@ class SurveyChart {
$tempArray['variable'] = $text;
// dodamo vrednosti na desni ce imamo vklopljen diferencial
- if($spremenljivka['enota'] == 1){
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
$sqlV = sisplet_query("SELECT naslov2 FROM srv_vrednost WHERE spr_id='$spid' AND id='$variable[vr_id]'");
$rowV = mysqli_fetch_array($sqlV);
$tempArray['variable2'] = strip_tags($rowV['naslov2']);
@@ -3941,7 +3951,7 @@ class SurveyChart {
$tempArray['grid'] = $textGrid;
// dodamo vrednosti na desni ce imamo vklopljen diferencial
- if($spremenljivka['enota'] == 1){
+ if(isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 1){
$sqlV = sisplet_query("SELECT naslov2 FROM srv_vrednost WHERE spr_id='$spid' AND id='$variable[vr_id]'");
$rowV = mysqli_fetch_array($sqlV);
$tempArray['variable2'] = strip_tags($rowV['naslov2']);
@@ -3949,7 +3959,7 @@ class SurveyChart {
$dataArray[] = $tempArray;
- $fullPercent[$gridCount] += $tempArray['percent'];
+ $fullPercent[$gridCount] = isset($fullPercent[$gridCount]) ? $fullPercent[$gridCount] += $tempArray['percent'] : $tempArray['percent'];
}
}
}
@@ -3982,7 +3992,7 @@ class SurveyChart {
$dataArray[] = $tempArray;
- $fullPercent[$gridCount] += $tempArray['percent'];
+ $fullPercent[$gridCount] = isset($fullPercent[$gridCount]) ? $fullPercent[$gridCount] += $tempArray['percent'] : $tempArray['percent'];
}
}
}
@@ -4029,7 +4039,7 @@ class SurveyChart {
$vrednostiVariable[] = $dataArray[$i]['variable'];
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1)
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1)
$vrednostiVariable2[] = $dataArray[$i]['variable2'];
}
@@ -4059,7 +4069,7 @@ class SurveyChart {
//$DataSet->AddPoint($vrednostiKey,"Variable");
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1){
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
$DataSet->AddPoint($vrednostiVariable2,"Variable2");
$DataSet->SetRightLabelSerie("Variable2");
}
@@ -4156,7 +4166,7 @@ class SurveyChart {
$vrednostiGrid[] = $dataArray[$offset]['grid'];
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1)
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1)
$vrednostiVariable2[] = $dataArray[$offset]['variable2'];
}
@@ -4185,7 +4195,7 @@ class SurveyChart {
$DataSet->AddPoint($vrednostiGrid,"Variable");
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1){
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
$DataSet->AddPoint($vrednostiVariable2,"Variable2");
$DataSet->SetRightLabelSerie("Variable2");
}
@@ -4263,7 +4273,7 @@ class SurveyChart {
$vrednostiVariable[] = $dataArray[$offset]['variable'];
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1)
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1)
$vrednostiVariable2[] = $dataArray[$offset]['variable2'];
}
@@ -4295,7 +4305,7 @@ class SurveyChart {
$DataSet->AddPoint($vrednostiVariable,"Variable");
// se vrednosti na desni pri sem. diferencialu
- if($spremenljivka['enota'] == 1){
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1){
$DataSet->AddPoint($vrednostiVariable2,"Variable2");
$DataSet->SetRightLabelSerie("Variable2");
}
@@ -4342,7 +4352,7 @@ class SurveyChart {
$_sequence = $variable['sequence']; # id kolone z podatki
if ($spremenljivka['tip'] == 22 || (($variable['text'] != true && $variable['other'] != true) || (in_array($spremenljivka['tip'],array(4,8,21))))){
- if (is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
+ if (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
if($field == 0)
$N = SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
@@ -4475,8 +4485,8 @@ class SurveyChart {
array_multisort($tmp, SORT_NUMERIC, SORT_ASC, $dataArray);
}
- $max = (double)$dataArray[count($dataArray,0)-1]['variable'];
- $min = (double)$dataArray[0]['variable'];
+ $max = isset($dataArray[count($dataArray,0)-1]['variable']) ? (double)$dataArray[count($dataArray,0)-1]['variable'] : 0;
+ $min = isset($dataArray[0]['variable']) ? (double)$dataArray[0]['variable'] : 0;
$stIntervalov = ((int)$settings['interval'] == 0 ? 10 : (int)$settings['interval']);
@@ -5084,10 +5094,13 @@ class SurveyChart {
// napolnimo podatke za MULTICHECKBOX
elseif($spremenljivka['tip'] == 16){
+
$DataSet = new pData;
$dataArray = array();
$fullPercent = array();
+ $gidsCanShow = array();
+ $vrednostiGrid = array();
# odstranimo še možne nepotrebne zapise
if($settings['hideEmptyVar'] == 1){
@@ -5107,7 +5120,8 @@ class SurveyChart {
# preverjamo ali lahko prikazujemo podkategorije
if((int)$cntValidInGrid > 0) {
$gidsCanShow[$gid] = true;
- } else {
+ }
+ else {
$gidsCanShow[$gid] = false;
}
}
@@ -5116,20 +5130,23 @@ class SurveyChart {
$gridCount=0;
+ $_variables_count=0;
$nValid = array();
$nAll = 0;
$nNavedbe = array();
+
if (count($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
$legendTitle = '';
// Kontrola ce ne prikazujemo praznih variabel
- if ((!is_array($gidsCanShow) && !isset($gidsCanShow[$gid]))
- || (is_array($gidsCanShow) && isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true)){
+ if (!isset($gidsCanShow[$gid]) || (isset($gidsCanShow[$gid]) && $gidsCanShow[$gid]== true)){
+
- # dodamo dodatne vrstice z albelami grida
$_variables_count=0;
+
+ # dodamo dodatne vrstice z albelami grida
foreach ($grid['variables'] AS $vid => $variable ){
if ($variable['text'] != true && $variable['other'] != true){
@@ -5140,12 +5157,12 @@ class SurveyChart {
$legendTitle = substr($variable['variable'],0,strpos($variable['variable'],'_'));
$vAnswer = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'][1]['cnt'];
- $_valid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+ $_valid = ( isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']) && SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ $_percent = ( isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']) && SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$tempArray = array();
- $nValid[] = SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
+ $nValid[] = isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']) ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
$nAll = SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'];
$nNavedbe[$gid] += SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'][1]['cnt'];
@@ -5167,8 +5184,15 @@ class SurveyChart {
$dataArray[] = $tempArray;
- $fullPercent[$gridCount] += $tempArray['percent'];
- $fullPercentReverse[$_variables_count] += $tempArray['percent'];
+ if(isset($fullPercent[$gridCount]))
+ $fullPercent[$gridCount] += $tempArray['percent'];
+ else
+ $fullPercent[$gridCount] = $tempArray['percent'];
+
+ if(isset($fullPercentReverse[$_variables_count]))
+ $fullPercentReverse[$_variables_count] += $tempArray['percent'];
+ else
+ $fullPercentReverse[$_variables_count] = $tempArray['percent'];
$_variables_count++;
}
@@ -5216,7 +5240,7 @@ class SurveyChart {
// Normalno obrnjen graf - gridi v stolpcih, variable v legendi (deli stolpcev)
if($settings['rotate'] != 1){
-
+
// Sortiramo podaatke ce je potrebno
if($settings['sort'] == 1){
@@ -5491,7 +5515,7 @@ class SurveyChart {
$_sequence = $variable['sequence']; # id kolone z podatki
if (($variable['text'] != true && $variable['other'] != true) || (in_array($spremenljivka['tip'],array(4,8,21)))){
- if (is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
+ if (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
# za povprečje
$sum_xi_fi=0;
@@ -5828,7 +5852,7 @@ class SurveyChart {
$_sequence = $variable['sequence']; # id kolone z podatki
if (($variable['text'] != true && $variable['other'] != true) || (in_array($spremenljivka['tip'],array(4,8,21)))){
- if (is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
+ if (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && is_countable(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > 0) {
# za povprečje
$sum_xi_fi=0;
@@ -6119,7 +6143,7 @@ class SurveyChart {
//$DataSet->SetYAxisName($lang['srv_analiza_sums_average']);
}
-
+
// Nastavimo other vrednosti
$DataSet->SetOther($_answersOther);
@@ -6176,7 +6200,7 @@ class SurveyChart {
$Test->setGraphArea(self::$quality*100,self::$quality*40,self::$quality*650,self::$quality*220);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*(243+$addHeight),5,255,255,255);
//$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
+ //self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
// Pri checkboxu lahko naredimo fiksno skalo
@@ -6318,7 +6342,7 @@ class SurveyChart {
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*(243+$addHeight+$addLegendSpace),5,255,255,255);
//$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight+$addLegendSpace),200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight+$addLegendSpace),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
// Pri ordinalnih multigridih prikazemo skalo od 1 do stevila variabel (ce prikazujemo povprecja)
@@ -6480,7 +6504,7 @@ class SurveyChart {
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*(243+$addHeight),5,255,255,255);
//$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,$angle,0,TRUE,1,FALSE,$roundText);
$Test->drawGrid(4,TRUE,230,230,230,50);
@@ -6543,7 +6567,7 @@ class SurveyChart {
$addHeight = $countGrids > 5 ? ($countGrids-5)*30 : 0;
// Imamo semanticni dif. - izpisujemo labele na desni
- $rightScale = ($spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 1 && self::$settings['scale_limit'] == 1) ? true : false;
+ $rightScale = ($spremenljivka['tip'] == 6 && isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1 && self::$settings['scale_limit'] == 1) ? true : false;
// Initialise the graph
$Test = new MyHorBar(self::$quality*800,self::$quality*(250+$addHeight+50));
@@ -6572,8 +6596,7 @@ class SurveyChart {
if($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 3){
$Test->setGraphArea(self::$quality*200,self::$quality*50,self::$quality*630,self::$quality*220);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*243,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*295,200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*295,200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,0,0,TRUE);
$Test->drawHorGrid(4,TRUE,230,230,230,50);
@@ -6582,8 +6605,7 @@ class SurveyChart {
elseif($rightScale){
$Test->setGraphArea(self::$quality*270,self::$quality*50,self::$quality*530,self::$quality*(220+$addHeight));
$Test->drawFilledRoundedRectangle(7,7,793,243+$addHeight,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(295+$addHeight),200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(295+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0/*SCALE_START0*/,0,0,0,TRUE,0,0,TRUE,1,$rightScale,$roundText=40);
@@ -6592,8 +6614,7 @@ class SurveyChart {
else{
$Test->setGraphArea(self::$quality*$startX,self::$quality*50,self::$quality*650,self::$quality*(220+$addHeight));
$Test->drawFilledRoundedRectangle(7,7,793,243+$addHeight,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(295+$addHeight),200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(295+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,0,0,TRUE,1,FALSE,$roundText);
$Test->drawHorGrid(4,TRUE,230,230,230,50);
@@ -6667,12 +6688,8 @@ class SurveyChart {
$Test->setLineStyle(self::$quality,$DotSize=0);
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',self::$quality*self::$fontSize);
- //$Test->setGraphArea(50,40,685,220);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
- //$Test->createColorGradientPalette(195,204,56,223,110,41,3);
- //$Test->createColorGradientPalette(168,188,56,248,255,136,5);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
// Pri vsoti ne izpisujemo procentov
@@ -6743,13 +6760,8 @@ class SurveyChart {
$Test->setLineStyle(self::$quality,$DotSize=0);
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',self::$quality*self::$fontSize);
- //$Test->setGraphArea(50,40,685,220);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
- //$Test->createColorGradientPalette(195,204,56,223,110,41,3);
- //$Test->createColorGradientPalette(168,188,56,248,255,136,5);
-
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
// Pri vsoti ne izpisujemo procentov
if($spremenljivka['tip'] == 18 || ($spremenljivka['tip'] == 1 && self::$settings['type'] == 2 && self::$settings['value_type'] == 1))
@@ -6838,8 +6850,7 @@ class SurveyChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',self::$quality*self::$fontSize);
$Test->setGraphArea(self::$quality*100,self::$quality*40,self::$quality*650,self::$quality*220);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*275,200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
// Pri checkboxu lahko naredimo fiksno skalo
@@ -6909,7 +6920,7 @@ class SurveyChart {
$addHeight = $countGrids > 5 ? ($countGrids-5)*30 : 0;
// Imamo semanticni dif. - izpisujemo labele na desni
- $rightScale = ($spremenljivka['enota'] == 1 && self::$settings['scale_limit'] == 1) ? true : false;
+ $rightScale = (isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1 && self::$settings['scale_limit'] == 1) ? true : false;
// Initialise the graph
$Test = new MyHorBar(self::$quality*800,self::$quality*(250+$addHeight));
@@ -6931,8 +6942,7 @@ class SurveyChart {
$Test->setGraphArea(self::$quality*270,self::$quality*50,self::$quality*530,self::$quality*(220+$addHeight));
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*(243+$addHeight),5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,0,0,0,TRUE,0,0,TRUE,1,$rightScale,$roundText=40);
@@ -6996,11 +7006,7 @@ class SurveyChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',self::$quality*self::$fontSize);
$Test->setGraphArea(self::$quality*100,self::$quality*40,self::$quality*650,self::$quality*320);
$Test->drawFilledRoundedRectangle(self::$quality*7,self::$quality*7,self::$quality*793,self::$quality*343,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*345,200,200,200);
- //$Test->drawGraphArea(255,255,255,TRUE);
- //$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,20,20,20,TRUE,$angle,0,TRUE,1,FALSE,$roundText);
- //$Test->drawGrid(4,TRUE,230,230,230,50);
+ //$Test->drawRectangle(self::$quality*5,self::$quality*5,self::$quality*795,self::$quality*345,200,200,200);
// Draw the 0 line
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',self::$quality*self::$fontSize);
@@ -7072,7 +7078,7 @@ class SurveyChart {
//moznost osvezevanja grafov - ne uporabljamo zaenkrat
if($admin_type < 2 && false)
- echo '<a href="'.$site_url.'?anketa='.self::$anketa.'&a=analysis&m=charts&refresh=1"><img src="img_0/random_off.png" title="Osveži grafe" /></a>';
+ echo '<a href="'.$site_url.'?anketa='.self::$anketa.'&a=analysis&m=charts&refresh=1" title="Osveži grafe"><span class="faicon refresh"></span></a>';
// Izrisemo ostale filtre
SurveyAnalysis::DisplayFilters(self::$quality);
@@ -7098,7 +7104,7 @@ class SurveyChart {
$SR = new SurveyRecoding(self::$anketa);
$SR -> getProfileString();
- SurveyDataSettingProfiles :: getVariableTypeNote($doNewLine);
+ SurveyDataSettingProfiles :: getVariableTypeNote();
echo '</div>';
}
@@ -7109,8 +7115,8 @@ class SurveyChart {
echo '<ul>';
echo '<li>';
- echo $lang['srv_chart_hq'].': ';
- echo '<input type="checkbox" name="chart_hq" id="chart_hq" onClick="changeChartHq(this)" '.(self::$quality == 3 ? ' checked="checked"' : '').'>';
+ echo ' <input type="checkbox" name="chart_hq" id="chart_hq" onClick="changeChartHq(this)" '.(self::$quality == 3 ? ' checked="checked"' : '').'>';
+ echo ' <label for="chart_hq">'.$lang['srv_chart_hq'].'</label>';
echo '</li>';
# nastavitev skina grafov
@@ -7123,21 +7129,23 @@ class SurveyChart {
}
// Nastavitve na dnu
- static function displayBottomSettings(){
+
+ static function displayBottomSettings($noDataAlert = ""){
global $site_path;
global $lang;
- echo '<div class="chart_bottom_settings">';
-
- echo '<a href="#" onClick="addCustomReportAllElementsAlert(4);" title="'.$lang['srv_custom_report_comments_add_hover'].'" style="margin-right: 40px;"><span class="spaceRight faicon comments_creport" ></span><span class="bold">'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '<div class="analysis_bottom_settings printHide '.$noDataAlert.'">';
- echo '<a href="#" onClick="printAnaliza(\'Grafi\'); return false;" title="'.$lang['hour_print2'].'" class="srv_ico"><span class="faicon print icon-grey_dark_link"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf black very_large" ></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_rtf&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf black very_large"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_ppt&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['PPT_Izpis'].'"><span class="faicon ppt black very_large"></span></a>';
+ echo '<div class="comment_holder">';
+ echo ' <a href="#" class="comment" onClick="addCustomReportAllElementsAlert(4);" title="'.$lang['srv_custom_report_comments_add_hover'].'"><span class="faicon comments" ></span><span>'.$lang['srv_custom_report_comments_add'].'</span></a>';
+ echo '</div>';
+
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_rtf&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_ppt&anketa=' . self::$anketa) . '" target="_blank" title="'.$lang['PPT_Izpis'].'"><span class="faicon ppt"></span></a>';
- echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv black very_large"></span></a>';
- echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail black very_large"></span></a>';
+ echo '<a href="#" onclick="doArchiveAnaliza();" title="'.$lang['srv_analiza_arhiviraj_ttl'].'"><span class="faicon arhiv"></span></a>';
+ echo '<a href="#" onclick="createArchiveBeforeEmail();" title="'.$lang['srv_analiza_arhiviraj_email_ttl'] . '"><span class="faicon arhiv_mail"></span></a>';
echo '</div>';
}
@@ -7172,25 +7180,29 @@ class SurveyChart {
static function displaySingleSettings($spid, $settings=0){
global $site_path;
global $lang;
+
if (self::$publicChart == true) {
return false;
}
+
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
// Ikone izvoza na vrhu posameznih nastavitev
self::displayExportIcons($spid);
- echo '<div id="switch_left_'.$spid.'_loop_'.self::$current_loop.'" class="switch_left '.(self::$settings_mode == 1 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$spid.'\', \'0\', \''.self::$current_loop.'\')">'.$lang['srv_chart_settings_basic'].'</div>';
- //echo '<span id="switch_middle_'.$spid.'_loop_'.self::$current_loop.'" class="'.(self::$settings_mode == 1 ? 'rightHighlight' : 'leftHighlight').'"></span>';
- echo '<div id="switch_right_'.$spid.'_loop_'.self::$current_loop.'" class="switch_right '.(self::$settings_mode == 0 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$spid.'\', \'1\', \''.self::$current_loop.'\')">'.$lang['srv_chart_settings_advanced'].'</div>';
+ echo '<div class="chart_settings_content">';
+
+
+ echo '<div class="tab_holder">';
+ echo ' <div id="switch_left_'.$spid.'_loop_'.self::$current_loop.'" class="tab switch_left '.(self::$settings_mode == 1 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$spid.'\', \'0\', \''.self::$current_loop.'\')">'.$lang['srv_chart_settings_basic'].'</div>';
+ echo ' <div id="switch_right_'.$spid.'_loop_'.self::$current_loop.'" class="tab switch_right '.(self::$settings_mode == 0 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$spid.'\', \'1\', \''.self::$current_loop.'\')">'.$lang['srv_chart_settings_advanced'].'</div>';
+ echo '</div>';
// OSNOVNE NASTAVITVE
echo '<div class="chart_settings_inner" id="chart_settings_basic_'.$spid.'_loop_'.self::$current_loop.'" '.(self::$settings_mode == 1 ? ' style="display:none;"' : '').'>';
- //echo '<span class="title">'.$lang['srv_chart_settings'].'</span>';
-
switch($spremenljivka['tip']){
case 1:
case 3:
@@ -7202,7 +7214,7 @@ class SurveyChart {
break;
case 6:
- if($spremenljivka['enota'] == 3)
+ if(isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 3)
self::displayDoubleMultigridSettings($spid, $settings);
else
self::displayMultigridSettings($spid, $settings);
@@ -7232,34 +7244,17 @@ class SurveyChart {
case 20:
self::displayMultinumberSettings($spid, $settings);
break;
-
- case 21:
- case 4:
- self::displayTableSettings($spid);
- break;
-
- case 19:
- self::displayMultitextSettings($spid, $settings);
- break;
-
+
default:
break;
}
// Preview vprasanja
- //SurveyAnalysis::showVariable($spid, $spremenljivka['variable']);
- echo '<div class="chart_setting" style="text-align: center; margin-top: 20px;">';
- echo '<span style="margin-right: 6px; line-height: 6px; font-weight: 600; font-size: 11px;">';
- //echo $lang['srv_vprasanje'].': ';
- echo $spremenljivka['variable'];
- echo '</span>';
- //echo '<a href="/" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="preview_spremenljivka_analiza(\'' . $spid . '\'); return false;"><span class="sprites preview"></span></a>';
- echo '<a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\''.$spid.'\'); return false;"><span class="faicon preview"></span></a> ';
- //echo '</div>';
-
- //echo '<div class="chart_setting" style="text-align: center;">';
+ echo '<div class="chart_setting_icons">';
+ echo ' <span class="variable">'.$spremenljivka['variable'].'</span>';
+ echo ' <a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\''.$spid.'\'); return false;"><span class="faicon monitor"></span></a> ';
SurveyAnalysis::showIcons($spid,$spremenljivka,$_from='charts');
- echo '</div>';
+ echo '</div>';
echo '</div>';
@@ -7278,7 +7273,7 @@ class SurveyChart {
break;
case 6:
- if($spremenljivka['enota'] == 3)
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 3)
self::displayAdvancedDoubleMultigridSettings($spid, $settings);
else
self::displayAdvancedMultigridSettings($spid, $settings);
@@ -7311,58 +7306,86 @@ class SurveyChart {
default:
break;
- }
+ }
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ // Nastavitve posamezne tabele (odprti odgovori)
+ static function displaySingleSettingsTable($spid, $settings=0){
+ global $site_path;
+ global $lang;
+
+ if (self::$publicChart == true) {
+ return false;
+ }
+
+ $spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
- // Link na urejanje label
- echo '<span class="edit" style="margin-top:15px;" onclick="chartAdvancedSettings(\''.$spid.'\', 1, \''.self::$current_loop.'\');">'.$lang['srv_chart_advancedLink_labels'].'</span>';
- // Vprasajcek za pomoc
- echo Help :: display('displaychart_settings_labels');
+ // Ikone izvoza na vrhu posameznih nastavitev
+ self::displayExportIcons($spid, $hide_button=true);
- // Link na urejanje barv
- echo '<span class="edit" onclick="chartAdvancedSettings(\''.$spid.'\', \'2\', \''.self::$current_loop.'\');">'.$lang['srv_chart_advancedLink_colors'].'</span>';
- // Vprasajcek za pomoc
- echo Help :: display('displaychart_settings_colors');
- // Link na rekodiranje
- echo '<span class="edit" onclick="chartAdvancedSettings(\''.$spid.'\', \'3\', \''.self::$current_loop.'\');">'.$lang['srv_chart_advancedLink_recoding'].'</span>';
- // Vprasajcek za pomoc
- echo Help :: display('displaychart_settings_recoding');
+ echo '<div class="chart_settings_content">';
+
+
+ echo '<div class="tab_holder"><div class="tab">'.$lang['srv_chart_open_answers_settings'].'</div></div>';
+
+ // OSNOVNE NASTAVITVE
+ echo '<div class="chart_settings_inner" id="chart_settings_basic_'.$spid.'_loop_'.self::$current_loop.'">';
- // Link na napredne number (radio dropdown numeric, number, date) nastavitve
- if(($spremenljivka['tip'] == 3 && self::checkDropdownNumeric($spid)) || $spremenljivka['tip'] == 7 || $spremenljivka['tip'] == 8 || $spremenljivka['tip'] == 22){
- echo '<span class="edit" onclick="chartAdvancedSettings(\''.$spid.'\', \'4\', \''.self::$current_loop.'\');">'.$lang['srv_chart_advancedLink_limits'].'</span>';
- // Vprasajcek za pomoc
- //echo Help :: display('displaychart_settings_number');
+ switch($spremenljivka['tip']){
+ case 21:
+ case 4:
+ self::displayTableSettings($spid);
+ break;
+
+ case 19:
+ self::displayMultitextSettings($spid, $settings);
+ break;
+
+ default:
+ break;
}
-
-
+
+ // Preview vprasanja
+ echo '<div class="chart_setting_icons">';
+ echo ' <span class="variable">'.$spremenljivka['variable'].'</span>';
+ echo ' <a href="#" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\''.$spid.'\'); return false;"><span class="faicon monitor"></span></a> ';
+ SurveyAnalysis::showIcons($spid,$spremenljivka,$_from='charts');
+ echo '</div>';
+
+ echo '</div>';
+
+
echo '</div>';
}
// ikone na vrhu posameznih nastavitev (izvozi)
- static function displayExportIcons($spid){
+ static function displayExportIcons($spid, $hide_button=false){
global $site_path;
global $lang;
- $spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
+ $spremenljivka = isset(SurveyAnalysis::$_HEADERS[$spid])?SurveyAnalysis::$_HEADERS[$spid]:array();
$loop = (isset(SurveyAnalysis::$_CURRENT_LOOP)) ? SurveyAnalysis::$_CURRENT_LOOP['cnt'] : 'undefined';
// linki
echo '<div class="chart_setting_exportLinks">';
- // Ikona za print
- echo '<a href="#" onclick="showAnalizaSingleChartPopup(\''.$spid.'\',\''.M_ANALYSIS_CHARTS.'\'); return false;">';
- echo '<span class="faicon print_small icon-grey_dark_link" title="' . $lang['PRN_Izpis'] . '"></span>';
- echo '</a>';
+ // Izvoz posameznega grafa v PDF/RTF/PPT
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span></a>';
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_rtf&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span></a>';
+ // V PPT zaenkrat ne izvazamo tabel
+ if(isset($spremenljivka['tip'])&&$spremenljivka['tip'] != 4 && $spremenljivka['tip'] != 19 && $spremenljivka['tip'] != 21)
+ echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_ppt&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['PPT_Izpis'].'"><span class="faicon ppt"></span></a>';
+
+ // Gumb za nastavitve
+ if(!$hide_button)
+ echo '<button class="small white-blue" onClick="chartAdvancedSettings(\''.$spid.'\', 1, \''.self::$current_loop.'\');"><span class="faicon wheel_32"></span>'.$lang['settings'].'</button>';
- // Izvoz posameznega grafa v PDF/RTF/PPT
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span></a>';
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_rtf&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span></a>';
- // V PPT zaenkrat ne izvazamo tabel
- if($spremenljivka['tip'] != 4 && $spremenljivka['tip'] != 19 && $spremenljivka['tip'] != 21)
- echo '<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_ppt&anketa='.self::$anketa.'&sprID='.$spid.'&loop='.$loop).'" target="_blank" title="'.$lang['PPT_Izpis'].'"><span class="faicon ppt"></span></a>';
-
echo '</div>';
}
@@ -7371,13 +7394,13 @@ class SurveyChart {
global $site_path;
global $lang;
- $spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
+ $spremenljivka = isset(SurveyAnalysis::$_HEADERS[$spid])?SurveyAnalysis::$_HEADERS[$spid]:array();
// Nastavitve numeric dropdowna - obravnavamo kot number
- if($spremenljivka['tip'] == 3 && self::checkDropdownNumeric($spid)){
+ if(isset($spremenljivka['tip'])&&$spremenljivka['tip'] == 3 && self::checkDropdownNumeric($spid)){
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 1, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].':<br /> <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 1, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="5" '.($settings['type']=='5'?' selected="selected"':'').'>'.$lang['srv_chart_group_horizontal'].'</option>';
echo ' <option value="6" '.($settings['type']=='6'?' selected="selected"':'').'>'.$lang['srv_chart_group_vertical'].'</option>';
@@ -7390,7 +7413,7 @@ class SurveyChart {
// tip izpisa vrednosti
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 1, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 1, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_percent'].'</option>';
@@ -7403,7 +7426,7 @@ class SurveyChart {
if($settings['type'] < 5){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 1, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 1, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -7417,7 +7440,7 @@ class SurveyChart {
// stevilo intervalov
if($settings['type'] > 4){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_interval'].': <select id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 1, \'interval\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_interval'].': <select class="dropdown small" id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 1, \'interval\', \''.self::$current_loop.'\');">';
for($i=3; $i<=10; $i++){
echo ' <option value="'.$i.'" '.($settings['interval']==$i ?' selected="selected"':'').'>'.$i.'</option>';
@@ -7435,8 +7458,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1 || $settings['type'] == 3 || $settings['type'] == 4){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -7446,7 +7469,7 @@ class SurveyChart {
else{
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 1, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].':<br /> <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 1, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_horizontal'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_vertical'].'</option>';
@@ -7464,7 +7487,7 @@ class SurveyChart {
if($settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 1, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 1, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -7478,7 +7501,7 @@ class SurveyChart {
// tip izpisa vrednosti
if($settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 1, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 1, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_valid'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
@@ -7493,8 +7516,8 @@ class SurveyChart {
if($settings['type'] == 2 || $settings['type'] == 8){
echo '<div class="chart_setting">';
- echo $lang['srv_analiza_legenda'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.($settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_analiza_legenda'].'</label>';
echo '</div>';
}
@@ -7503,8 +7526,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1 || $settings['type'] == 3 || $settings['type'] == 4 || $settings['type'] == 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -7523,8 +7546,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 1, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -7535,8 +7558,8 @@ class SurveyChart {
$vars = count($spremenljivka['options']);
$checked = ($settings['show_avg']=='1' || ($settings['show_avg']=='-1' && $vars == 5 && SurveyDataSettingProfiles :: getSetting('chartAvgText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showAvg'].': ';
echo '<input type="checkbox" id="chart_show_avg_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_avg" '.$checked.' onchange="changeChart(\''.$spid.'\', 1, \'show_avg\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_avg_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showAvg'].'</label>';
echo '</div>';
}
@@ -7545,7 +7568,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 1, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 1, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -7555,23 +7578,13 @@ class SurveyChart {
echo '</div>';
}
-
- // 3D strukturni krog
- /*if($settings['type'] == 2){
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_3d_pie'].': ';
- echo '<input type="checkbox" id="chart_3d_pie_'.$spid.'_loop_'.self::$current_loop.'" name="chart_3d_pie" '.($settings['3d_pie']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'3d_pie\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
- }*/
-
+
// Izpusti variable brez odgovora
if(($spremenljivka['tip'] != 3 || !self::checkDropdownNumeric($spid)) && $settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hideEmtyVar'].': ';
echo '<input type="checkbox" id="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'" name="chart_hideEmptyVar" '.($settings['hideEmptyVar']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'hideEmptyVar\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_hideEmtyVar'].'</label>';
echo '</div>';
}
@@ -7580,8 +7593,8 @@ class SurveyChart {
if($settings['barLabel'] == 1 && ($settings['type'] == 0 || $settings['type'] == 1)){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 1, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
@@ -7592,15 +7605,13 @@ class SurveyChart {
$lestvica = SurveyAnalysis::getSpremenljivkaLegenda($spremenljivka,'skalaAsValue');
- echo $lang['srv_skala'].': ';
- // Vprasajcek za pomoc
- echo Help :: display('srv_skala_edit');
+ echo '<label>'.$lang['srv_skala'].' '.Help :: display('srv_skala_edit').':</label>';
- echo '<span class="spaceLeft"></span>';
- echo '<a onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'0\', \''.self::$current_loop.'\'); return false;" href="#" title="'.$lang['srv_skala_long_0'].'"><span '.($lestvica == 0 ? ' class="strong"' : '').'>'.$lang['srv_skala_short_0'].'</span></a>';
- echo '<span class="blue"> / </span>';
- echo '<a onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'1\', \''.self::$current_loop.'\'); return false;" href="#" title="'.$lang['srv_skala_long_1'].'"><span '.($lestvica == 1 ? ' class="strong"' : '').'>'.$lang['srv_skala_short_1'].'</span></a>';
-
+ echo '<div class="scale_ordnom">';
+ echo '<button class="small '.($lestvica == 0 ? 'active' : '').'" onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'0\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_skala_short_0'].'</button>';
+ echo '<button class="small '.($lestvica == 1 ? 'active' : '').'" onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'1\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_skala_short_1'].'</button>';
+ echo '</div>';
+
echo '</div>';
}
}
@@ -7612,7 +7623,7 @@ class SurveyChart {
// omejitev skale
echo '<div class="chart_setting">';
- echo $lang['srv_chart_base'].': <select id="chart_base_'.$spid.'_loop_'.self::$current_loop.'" name="chart_base" onchange="changeChart(\''.$spid.'\', 2, \'base\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_base'].': <select class="dropdown small" id="chart_base_'.$spid.'_loop_'.self::$current_loop.'" name="chart_base" onchange="changeChart(\''.$spid.'\', 2, \'base\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['base']=='0'?' selected="selected"':'').'>'.$lang['srv_analiza_opisne_units'].'</option>';
echo ' <option value="1" '.($settings['base']=='1'?' selected="selected"':'').'>'.$lang['srv_analiza_opisne_arguments'].'</option>';
@@ -7622,7 +7633,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 2, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].':<br /> <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 2, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_horizontal'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_vertical'].'</option>';
@@ -7643,7 +7654,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == '5'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 2, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 2, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -7655,7 +7666,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == '5'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 2, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 2, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -7666,7 +7677,7 @@ class SurveyChart {
// tip izpisa vrednosti
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 2, \'value_type\', \''.self::$current_loop.'\');" '.($settings['type'] == 2 ? 'disabled="disabled"' : '').'>';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 2, \'value_type\', \''.self::$current_loop.'\');" '.($settings['type'] == 2 ? 'disabled="disabled"' : '').'>';
if($settings['base'] != '1')
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_valid'].'</option>';
@@ -7680,7 +7691,7 @@ class SurveyChart {
if($settings['type'] != 5){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 2, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 2, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -7695,8 +7706,8 @@ class SurveyChart {
if($settings['type'] == 2 || $settings['type'] == 7){
echo '<div class="chart_setting">';
- echo $lang['srv_analiza_legenda'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.($settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_analiza_legenda'].'</label>';
echo '</div>';
}
@@ -7705,8 +7716,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1 || $settings['type'] == 3 || $settings['type'] == 4){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -7722,8 +7733,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 2, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -7731,7 +7742,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 2, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 2, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -7745,8 +7756,8 @@ class SurveyChart {
// Izpusti variable brez odgovora
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hideEmtyVar'].': ';
echo '<input type="checkbox" id="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'" name="chart_hideEmptyVar" '.($settings['hideEmptyVar']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'hideEmptyVar\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_hideEmtyVar'].'</label>';
echo '</div>';
@@ -7754,8 +7765,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1 || $settings['type'] == 6){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_settings_fullScale'].': ';
echo '<input type="checkbox" id="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_noFixedScale" '.($settings['noFixedScale']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'noFixedScale\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_settings_fullScale'].'</label>';
echo '</div>';
}
@@ -7764,21 +7775,11 @@ class SurveyChart {
if($settings['barLabel'] == 1 && ($settings['type'] == 0 || $settings['type'] == 1)){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
-
- // 3D strukturni krog
- /*if($settings['type'] == 2){
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_3d_pie'].': ';
- echo '<input type="checkbox" id="chart_3d_pie_'.$spid.'_loop_'.self::$current_loop.'" name="chart_3d_pie" '.($settings['3d_pie']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 2, \'3d_pie\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
- }*/
}
// Nastavitve za number grafe (tip 7)
@@ -7788,7 +7789,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 7, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].':<br /> <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 7, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_group_horizontal'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_group_vertical'].'</option>';
@@ -7803,7 +7804,7 @@ class SurveyChart {
// tip izpisa vrednosti
if($settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 7, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 7, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_percent'].'</option>';
@@ -7817,7 +7818,7 @@ class SurveyChart {
if($settings['type'] > 2 && $settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 7, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 7, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -7831,14 +7832,12 @@ class SurveyChart {
// stevilo intervalov
if($settings['type'] < 3){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_interval'].': <select id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 7, \'interval\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_interval'].': <select class="dropdown small" id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 7, \'interval\', \''.self::$current_loop.'\');">';
for($i=3; $i<=10; $i++){
echo ' <option value="'.$i.'" '.($settings['interval']==$i ?' selected="selected"':'').'>'.$i.'</option>';
}
echo ' <option value="20" '.($settings['interval']=='20'?' selected="selected"':'').'>20</option>';
- //echo ' <option value="50" '.($settings['interval']=='50'?' selected="selected"':'').'>50</option>';
- //echo ' <option value="100" '.($settings['interval']=='100'?' selected="selected"':'').'>100</option>';
echo ' <option value="-1" '.($settings['interval']=='-1'?' selected="selected"':'').'>Vsi</option>';
echo '</select>';
@@ -7848,47 +7847,10 @@ class SurveyChart {
// prikaz legende
echo '<div class="chart_setting">';
- echo $lang['srv_analiza_legenda'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.($settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 7, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_analiza_legenda'].'</label>';
echo '</div>';
-
- // div z nastavitvami za zgornjo in spodnjo mejo
- /*echo '<fieldset class="chart_num_limits"><legend>'.$lang['srv_chart_num_limit'].'</legend>';
-
- // min
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_min'].': ';
- echo '<input type="text" id="chart_min_'.$spid.'_loop_'.self::$current_loop.'" name="chart_min" value="'.$settings['min'].'" onBlur="changeChart(\''.$spid.'\', 7, \'min\', \''.self::$current_loop.'\');" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 6, 0);" />';
-
- echo '</div>';
-
- // polodprt interval navzdol
- echo '<div class="chart_setting" style="text-align:right;">';
-
- echo $lang['srv_chart_open_down'].': ';
- echo '<input type="checkbox" id="chart_open_down_'.$spid.'_loop_'.self::$current_loop.'" name="chart_open_down" '.($settings['open_down']=='1'?' checked="checked"':'').' '.($settings['min']==''?' disabled="disabled"':'').' onchange="changeChart(\''.$spid.'\', 7, \'open_down\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
-
- // max
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_max'].': ';
- echo '<input type="text" id="chart_max_'.$spid.'_loop_'.self::$current_loop.'" name="chart_max" value="'.$settings['max'].'" onBlur="changeChart(\''.$spid.'\', 7, \'max\', \''.self::$current_loop.'\');" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 6, 0);" />';
-
- echo '</div>';
-
- // polodprt interval navzgor
- echo '<div class="chart_setting" style="text-align:right;">';
-
- echo $lang['srv_chart_open_up'].': ';
- echo '<input type="checkbox" id="chart_open_up_'.$spid.'_loop_'.self::$current_loop.'" name="chart_open_up" '.($settings['open_up']=='1'?' checked="checked"':'').' '.($settings['max']==''?' disabled="disabled"':'').' onchange="changeChart(\''.$spid.'\', 7, \'open_up\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
-
- echo '</fieldset>';*/
}
// Nastavitve za number grafe (tip 7)
@@ -7901,8 +7863,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 7, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -7912,8 +7874,8 @@ class SurveyChart {
$checked = ($settings['show_avg']=='1' || ($settings['show_avg']=='-1' && SurveyDataSettingProfiles :: getSetting('chartAvgText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showAvg'].': ';
echo '<input type="checkbox" id="chart_show_avg_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_avg" '.$checked.' onchange="changeChart(\''.$spid.'\', 7, \'show_avg\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_avg_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showAvg'].'</label>';
echo '</div>';
}
@@ -7922,8 +7884,8 @@ class SurveyChart {
if($settings['type'] != 2){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 7, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -7932,8 +7894,8 @@ class SurveyChart {
if($settings['barLabel'] == 1 && $settings['type'] != 2 && $settings['type'] != 9){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 7, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
@@ -7942,7 +7904,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 7, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 7, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -7961,7 +7923,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 8, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].':<br /> <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 8, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_group_horizontal'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_group_vertical'].'</option>';
@@ -7975,7 +7937,7 @@ class SurveyChart {
// tip izpisa vrednosti
if($settings['type'] < 3){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 8, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 8, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_day'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_month'].'</option>';
@@ -7989,7 +7951,7 @@ class SurveyChart {
if($settings['type'] > 2){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 8, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 8, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -8003,56 +7965,17 @@ class SurveyChart {
// stevilo intervalov
if($settings['type'] < 3){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_interval'].': <select id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 8, \'interval\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_interval'].': <select class="dropdown small" id="chart_interval_'.$spid.'_loop_'.self::$current_loop.'" name="chart_interval" onchange="changeChart(\''.$spid.'\', 8, \'interval\', \''.self::$current_loop.'\');">';
for($i=3; $i<=10; $i++){
echo ' <option value="'.$i.'" '.($settings['interval']==$i ?' selected="selected"':'').'>'.$i.'</option>';
}
echo ' <option value="20" '.($settings['interval']=='20'?' selected="selected"':'').'>20</option>';
- //echo ' <option value="50" '.($settings['interval']=='50'?' selected="selected"':'').'>50</option>';
- //echo ' <option value="100" '.($settings['interval']=='100'?' selected="selected"':'').'>100</option>';
echo ' <option value="-1" '.($settings['interval']=='-1'?' selected="selected"':'').'>Vsi</option>';
echo '</select>';
echo '</div>';
}
-
- // div z nastavitvami za zgornjo in spodnjo mejo
- /*echo '<fieldset class="chart_num_limits"><legend>'.$lang['srv_chart_num_limit'].'</legend>';
-
- // min
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_min'].': ';
- echo '<input type="text" id="chart_min_'.$spid.'_loop_'.self::$current_loop.'" name="chart_min" value="'.$settings['min'].'" onBlur="changeChart(\''.$spid.'\', 8, \'min\', \''.self::$current_loop.'\');" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 6, 0);" />';
-
- echo '</div>';
-
- // polodprt interval navdol
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_open_down'].': ';
- echo '<input type="checkbox" id="chart_open_down_'.$spid.'_loop_'.self::$current_loop.'" name="chart_open_down" '.($settings['open_down']=='1'?' checked="checked"':'').' '.($settings['min']==''?' disabled="disabled"':'').' onchange="changeChart(\''.$spid.'\', 8, \'open_down\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
-
- // max
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_max'].': ';
- echo '<input type="text" id="chart_max_'.$spid.'_loop_'.self::$current_loop.'" name="chart_max" value="'.$settings['max'].'" onBlur="changeChart(\''.$spid.'\', 8, \'max\', \''.self::$current_loop.'\');" onkeypress="checkNumber(this, 6, 0);" onkeyup="checkNumber(this, 6, 0);" />';
-
- echo '</div>';
-
- // polodprt interval navgor
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_open_up'].': ';
- echo '<input type="checkbox" id="chart_open_up_'.$spid.'_loop_'.self::$current_loop.'" name="chart_open_up" '.($settings['open_up']=='1'?' checked="checked"':'').' '.($settings['max']==''?' disabled="disabled"':'').' onchange="changeChart(\''.$spid.'\', 8, \'open_up\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
-
- echo '</fieldset>';*/
}
// Nastavitve za datum grafe (tip 8)
@@ -8065,8 +7988,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 8, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8074,7 +7997,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 8, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 8, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8095,7 +8018,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 6, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 6, \'type\', \''.self::$current_loop.'\');">';
// Pri nominalnih ne prikazujemo povprecij
if($spremenljivka['skala'] != 1 && $spremenljivka['cnt_all'] != 1){
@@ -8120,15 +8043,13 @@ class SurveyChart {
echo '<div class="chart_setting">';
if($settings['rotate']=='1'){
echo $lang['srv_chart_rotate_grids'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 6, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 6, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="0">';
echo ' '.$lang['srv_chart_rotate_vars'].' ';
}
else{
echo $lang['srv_chart_rotate_vars'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 6, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 6, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="1">';
echo ' '.$lang['srv_chart_rotate_grids'];
}
@@ -8139,7 +8060,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 5 || $settings['type'] == 6){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 6, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 6, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -8153,7 +8074,7 @@ class SurveyChart {
else{
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 6, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 6, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_category'].'</option>';
@@ -8169,7 +8090,7 @@ class SurveyChart {
// tip izpisa vrednosti
if(($settings['type'] > 0 && $settings['type'] < 5) || $settings['type'] == 7){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 6, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 6, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_valid'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
@@ -8182,7 +8103,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == 5 || $settings['type'] == 7){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 6, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 6, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -8194,7 +8115,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == 5 || $settings['type'] == 7){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 6, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 6, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -8204,11 +8125,11 @@ class SurveyChart {
}
// prikaz desne skale pri sem. diferencialu (ver. linijski graf ali hor. strukturni stolpci)
- if($spremenljivka['enota'] == 1 && ($settings['type'] == 2 || $settings['type'] == 6)){
+ if(isset($spremenljivka['enota']) && $spremenljivka['enota'] == 1 && ($settings['type'] == 2 || $settings['type'] == 6)){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_right_scale'].': ';
echo '<input type="checkbox" id="chart_scale_limit_'.$spid.'_loop_'.self::$current_loop.'" name="chart_scale_limit" '.($settings['scale_limit']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'scale_limit\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_scale_limit_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_right_scale'].'</label>';
echo '</div>';
}
@@ -8217,8 +8138,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 5 || $settings['type'] == 6){
echo '<div class="chart_setting">';
- echo $lang['srv_analiza_legenda'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.($settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_analiza_legenda'].'</label>';
echo '</div>';
}
@@ -8227,8 +8148,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1 || $settings['type'] == 2){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -8246,8 +8167,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 6, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8255,7 +8176,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 2 || $settings['type'] == 4){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 6, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 6, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8269,8 +8190,8 @@ class SurveyChart {
// Izpusti variable brez odgovora
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hideEmtyVar'].': ';
echo '<input type="checkbox" id="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'" name="chart_hideEmptyVar" '.($settings['hideEmptyVar']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'hideEmptyVar\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_hideEmtyVar'].'</label>';
echo '</div>';
@@ -8278,8 +8199,8 @@ class SurveyChart {
if($settings['barLabel'] == 1 && $settings['type'] == 0){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
@@ -8288,27 +8209,25 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 5 || $settings['type'] == 6){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_noFixedScale'].': ';
echo '<input type="checkbox" id="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_noFixedScale" '.($settings['noFixedScale']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 6, \'noFixedScale\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_noFixedScale'].'</label>';
echo '</div>';
}
// Preklop med ordinalno in nominalno spremenljivko
- echo '<div class="chart_setting">';
-
- $lestvica = SurveyAnalysis::getSpremenljivkaLegenda($spremenljivka,'skalaAsValue');
+ echo '<div class="chart_setting">';
- echo $lang['srv_skala'].': ';
- // Vprasajcek za pomoc
- echo Help :: display('srv_skala_edit');
-
- echo '<span class="spaceLeft"></span>';
- echo '<a onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'0\', \''.self::$current_loop.'\'); return false;" href="#" title="'.$lang['srv_skala_long_0'].'"><span '.($lestvica == 0 ? ' class="strong"' : '').'>'.$lang['srv_skala_short_0'].'</span></a>';
- echo '<span class="blue"> / </span>';
- echo '<a onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'1\', \''.self::$current_loop.'\'); return false;" href="#" title="'.$lang['srv_skala_long_1'].'"><span '.($lestvica == 1 ? ' class="strong"' : '').'>'.$lang['srv_skala_short_1'].'</span></a>';
+ $lestvica = SurveyAnalysis::getSpremenljivkaLegenda($spremenljivka,'skalaAsValue');
+
+ echo '<label>'.$lang['srv_skala'].' '.Help :: display('srv_skala_edit').':</label>';
+
+ echo '<div class="scale_ordnom">';
+ echo '<button class="small '.($lestvica == 0 ? 'active' : '').'" onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'0\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_skala_short_0'].'</button>';
+ echo '<button class="small '.($lestvica == 1 ? 'active' : '').'" onclick="chartAdvancedSettingsSkala(\''.$spid.'\', \'1\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_skala_short_1'].'</button>';
+ echo '</div>';
- echo '</div>';
+ echo '</div>';
}
// Nastavitve za dvojne multigrid grafe (tip 6, enota 3)
@@ -8320,7 +8239,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 62, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 62, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_horizontal'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_vertical'].'</option>';
@@ -8335,7 +8254,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 62, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 62, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -8347,7 +8266,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 62, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 62, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -8360,8 +8279,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 62, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -8379,8 +8298,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 62, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8388,7 +8307,7 @@ class SurveyChart {
if($settings['type'] == 0){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 62, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 62, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8402,8 +8321,8 @@ class SurveyChart {
// zacni skalo z 0
echo '<div class="chart_setting">';
- echo $lang['srv_chart_noFixedScale'].': ';
echo '<input type="checkbox" id="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_noFixedScale" '.($settings['noFixedScale']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 62, \'noFixedScale\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_noFixedScale'].'</label>';
echo '</div>';
}
@@ -8415,7 +8334,7 @@ class SurveyChart {
// omejitev skale
echo '<div class="chart_setting">';
- echo $lang['srv_chart_base'].': <select id="chart_base_'.$spid.'_loop_'.self::$current_loop.'" name="chart_base" onchange="changeChart(\''.$spid.'\', 16, \'base\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_base'].': <select class="dropdown small" id="chart_base_'.$spid.'_loop_'.self::$current_loop.'" name="chart_base" onchange="changeChart(\''.$spid.'\', 16, \'base\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['base']=='0'?' selected="selected"':'').'>'.$lang['srv_analiza_opisne_units'].'</option>';
echo ' <option value="1" '.($settings['base']=='1'?' selected="selected"':'').'>'.$lang['srv_analiza_opisne_arguments'].'</option>';
@@ -8425,7 +8344,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 16, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 16, \'type\', \''.self::$current_loop.'\');">';
if($settings['base'] == '1'){
echo ' <option value="2" '.($settings['type']=='2'?' selected="selected"':'').'>'.$lang['srv_chart_structure_ver'].'</option>';
@@ -8443,7 +8362,7 @@ class SurveyChart {
// sortiranje
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 16, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 16, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_category'].'</option>';
@@ -8458,15 +8377,13 @@ class SurveyChart {
if($settings['rotate']=='1'){
echo $lang['srv_chart_rotate_grids'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 16, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 16, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="0">';
echo ' '.$lang['srv_chart_rotate_vars'].' ';
}
else{
echo $lang['srv_chart_rotate_vars'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 16, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 16, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="1">';
echo ' '.$lang['srv_chart_rotate_grids'];
}
@@ -8475,7 +8392,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 16, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 16, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -8487,7 +8404,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 16, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 16, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -8498,7 +8415,7 @@ class SurveyChart {
// tip izpisa vrednosti
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 16, \'value_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 16, \'value_type\', \''.self::$current_loop.'\');">';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_percent'].'</option>';
echo ' <option value="2" '.($settings['value_type']=='2'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
@@ -8512,8 +8429,8 @@ class SurveyChart {
if($settings['type'] == 2 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 16, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -8529,8 +8446,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 16, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8538,7 +8455,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 16, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 16, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8552,8 +8469,8 @@ class SurveyChart {
// Izpusti variable brez odgovora
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hideEmtyVar'].': ';
echo '<input type="checkbox" id="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'" name="chart_hideEmptyVar" '.($settings['hideEmptyVar']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 16, \'hideEmptyVar\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_hideEmptyVar_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_hideEmtyVar'].'</label>';
echo '</div>';
}
@@ -8565,7 +8482,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 18, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 18, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_pie'].'</option>';
echo ' <option value="5" '.($settings['type']=='5'?' selected="selected"':'').'>'.$lang['srv_chart_3Dpie'].'</option>';
@@ -8580,7 +8497,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 18, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 18, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -8592,7 +8509,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 18, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 18, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -8605,7 +8522,7 @@ class SurveyChart {
if($settings['type'] != '4'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 18, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 18, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -8620,8 +8537,8 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 5){
echo '<div class="chart_setting">';
- echo $lang['srv_analiza_legenda'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.($settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 18, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_analiza_legenda'].'</label>';
echo '</div>';
}
@@ -8630,8 +8547,8 @@ class SurveyChart {
if($settings['type'] == 2 || $settings['type'] == 3){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 18, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -8647,8 +8564,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 18, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8656,7 +8573,7 @@ class SurveyChart {
if($settings['type'] == 2){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 18, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 18, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8671,21 +8588,11 @@ class SurveyChart {
if($settings['barLabel'] == 1 && ($settings['type'] == 2 || $settings['type'] == 3)){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 18, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
-
- // 3D strukturni krog
- /*if($settings['type'] == 0){
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_3d_pie'].': ';
- echo '<input type="checkbox" id="chart_3d_pie_'.$spid.'_loop_'.self::$current_loop.'" name="chart_3d_pie" '.($settings['3d_pie']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 18, \'3d_pie\', \''.self::$current_loop.'\');">';
-
- echo '</div>';
- }*/
}
// Nastavitve za ranking grafe (tip 17)
@@ -8695,12 +8602,11 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 17, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 17, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_avg'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_structure_hor'].'</option>';
echo ' <option value="2" '.($settings['type']=='2'?' selected="selected"':'').'>'.$lang['srv_chart_structure_ver'].'</option>';
- //echo ' <option value="3" '.($settings['type']=='3'?' selected="selected"':'').'>'.$lang['srv_chart_structure'].'</option>';
echo '</select>';
echo '</div>';
@@ -8708,7 +8614,7 @@ class SurveyChart {
// sortiranje
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 17, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 17, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_desc'].'</option>';
@@ -8720,11 +8626,10 @@ class SurveyChart {
// tip izpisa vrednosti
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 17, \'value_type\', \''.self::$current_loop.'\');" '.($settings['type'] == 0 ? 'disabled="disabled"' : '').'>';
+ echo $lang['srv_chart_valtype'].': <select class="dropdown small" id="chart_value_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_value_type" onchange="changeChart(\''.$spid.'\', 17, \'value_type\', \''.self::$current_loop.'\');" '.($settings['type'] == 0 ? 'disabled="disabled"' : '').'>';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_percent'].'</option>';
- //echo ' <option value="2" '.($settings['value_type']=='2'?' selected="selected"':'').'>'.$lang['srv_chart_valid'].'</option>';
echo '</select>';
echo '</div>';
@@ -8732,8 +8637,8 @@ class SurveyChart {
// prikaz label v stolpcih
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabel'].': ';
echo '<input type="checkbox" id="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 17, \'barLabel\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabel_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabel'].'</label>';
echo '</div>';
}
@@ -8748,8 +8653,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 17, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8757,7 +8662,7 @@ class SurveyChart {
if($settings['type'] == 0 || $settings['type'] == 1){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 17, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 17, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8772,8 +8677,8 @@ class SurveyChart {
if($settings['barLabel'] == 1 && $settings['type'] == 0){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_barLabelSmall'].': ';
echo '<input type="checkbox" id="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'" name="chart_barLabelSmall" '.($settings['barLabelSmall']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 17, \'barLabelSmall\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_barLabelSmall_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_barLabelSmall'].'</label>';
echo '</div>';
}
@@ -8782,8 +8687,8 @@ class SurveyChart {
if($settings['type'] == 0){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_noFixedScale'].': ';
echo '<input type="checkbox" id="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_noFixedScale" '.($settings['noFixedScale']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 17, \'noFixedScale\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_noFixedScale_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_noFixedScale'].'</label>';
echo '</div>';
}
@@ -8796,7 +8701,7 @@ class SurveyChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 20, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 20, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_vertical'].'</option>';
@@ -8809,7 +8714,7 @@ class SurveyChart {
// sortiranje
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 20, \'sort\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="chart_sort_'.$spid.'_loop_'.self::$current_loop.'" name="chart_sort" onchange="changeChart(\''.$spid.'\', 20, \'sort\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
echo ' <option value="1" '.($settings['sort']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_sort_category'].'</option>';
@@ -8824,15 +8729,13 @@ class SurveyChart {
if($settings['rotate']=='1'){
echo $lang['srv_chart_rotate_grids'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="0">';
echo ' '.$lang['srv_chart_rotate_vars'].' ';
}
else{
echo $lang['srv_chart_rotate_vars'].' ';
- //echo '<input type="checkbox" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" '.($settings['rotate']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');">';
- echo '<span onclick="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeChart(\''.$spid.'\', 20, \'rotate\', \''.self::$current_loop.'\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="chart_rotate_'.$spid.'_loop_'.self::$current_loop.'" name="chart_rotate" value="1">';
echo ' '.$lang['srv_chart_rotate_grids'];
}
@@ -8841,7 +8744,7 @@ class SurveyChart {
// Tip radarja
if($settings['type'] == '0'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 20, \'radar_type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="chart_radar_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_type" onchange="changeChart(\''.$spid.'\', 20, \'radar_type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -8853,7 +8756,7 @@ class SurveyChart {
// Postavitev skale pri radarju
if($settings['type'] == '0'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 20, \'radar_scale\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="chart_radar_scale_'.$spid.'_loop_'.self::$current_loop.'" name="chart_radar_scale" onchange="changeChart(\''.$spid.'\', 20, \'radar_scale\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -8873,8 +8776,8 @@ class SurveyChart {
$checked = ($settings['show_numerus']=='1' || ($settings['show_numerus']=='-1' && SurveyDataSettingProfiles :: getSetting('chartNumerusText') == 1)) ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_numerus" '.$checked.' onchange="changeChart(\''.$spid.'\', 20, \'show_numerus\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_numerus_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
@@ -8882,7 +8785,7 @@ class SurveyChart {
if($settings['type'] == 2){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 20, \'labelWidth\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="chart_labelWidth_'.$spid.'_loop_'.self::$current_loop.'" name="chart_labelWidth" onchange="changeChart(\''.$spid.'\', 20, \'labelWidth\', \''.self::$current_loop.'\');">';
echo ' <option value="75" '.($settings['labelWidth']=='75'?' selected="selected"':'').'>75%</option>';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
@@ -8901,19 +8804,19 @@ class SurveyChart {
// Tip tabele
echo '<div class="chart_setting">';
- echo $lang['srv_chart_table_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 21, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_table_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 21, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.(self::$settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_table_type_0'].'</option>';
echo ' <option value="1" '.(self::$settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_table_type_1'].'</option>';
echo '</select>';
echo '</div>';
-
- //Poravnava texta
+
+ // Poravnava texta
echo '<div class="chart_setting">';
- echo $lang['srv_chart_table_align'].': ';
echo '<input type="checkbox" id="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'" name="chart_show_legend" '.(self::$settings['show_legend']=='1'?' checked="checked"':'').' onchange="changeChart(\''.$spid.'\', 21, \'show_legend\', \''.self::$current_loop.'\');">';
+ echo '<label for="chart_show_legend_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_table_align'].'</label>';
echo '</div>';
}
@@ -8925,7 +8828,7 @@ class SurveyChart {
// Tip tabele
echo '<div class="chart_setting">';
- echo $lang['srv_chart_table_type'].':<br /> <select style="width:140px;" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 19, \'type\', \''.self::$current_loop.'\');">';
+ echo $lang['srv_chart_table_type'].': <select class="dropdown small" id="chart_type_'.$spid.'_loop_'.self::$current_loop.'" name="chart_type" onchange="changeChart(\''.$spid.'\', 19, \'type\', \''.self::$current_loop.'\');">';
echo ' <option value="0" '.(self::$settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_table_type_0'].'</option>';
echo ' <option value="1" '.(self::$settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_table_type_1'].'</option>';
@@ -8939,26 +8842,29 @@ class SurveyChart {
global $site_path;
global $lang;
+ echo '<div class="chart_settings_content">';
+
+ echo '<div class="tab_holder"><div class="tab">'.$lang['srv_chart_open_answers_settings'].'</div></div>';
+
+
echo '<div class="chart_settings_inner">';
- echo '<span class="title">'.$lang['srv_chart_settings'].'</span>';
- //Poravnava texta
+ // Poravnava texta
echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_table_align'].': ';
- echo '<input type="checkbox" id="chart_other_otherType_'.$spid.'_loop_'.self::$current_loop.'" name="chart_other_otherType" '.(self::$settings['otherType']=='1'?' checked="checked"':'').' onchange="changeOther(\''.$spid.'\', \'otherType\', \''.self::$current_loop.'\');">';
-
+ echo ' <input type="checkbox" id="chart_other_otherType_'.$spid.'_loop_'.self::$current_loop.'" name="chart_other_otherType" '.(self::$settings['otherType']=='1'?' checked="checked"':'').' onchange="changeOther(\''.$spid.'\', \'otherType\', \''.self::$current_loop.'\');">';
+ echo ' <label for="chart_other_otherType_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_table_align'].'</label>';
echo '</div>';
- //Prikaz frekvenc
+ // Prikaz frekvenc
echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_table_freq'].': ';
- echo '<input type="checkbox" id="chart_other_otherFreq_'.$spid.'_loop_'.self::$current_loop.'" name="chart_other_otherFreq" '.(self::$settings['otherFreq']=='1'?' checked="checked"':'').' onchange="changeOther(\''.$spid.'\', \'otherFreq\', \''.self::$current_loop.'\');">';
-
+ echo ' <input type="checkbox" id="chart_other_otherFreq_'.$spid.'_loop_'.self::$current_loop.'" name="chart_other_otherFreq" '.(self::$settings['otherFreq']=='1'?' checked="checked"':'').' onchange="changeOther(\''.$spid.'\', \'otherFreq\', \''.self::$current_loop.'\');">';
+ echo ' <label for="chart_other_otherFreq_'.$spid.'_loop_'.self::$current_loop.'">'.$lang['srv_chart_table_freq'].'</label>';
echo '</div>';
echo '</div>';
+
+
+ echo '</div>';
}
@@ -8972,9 +8878,33 @@ class SurveyChart {
echo '<h2>'.$spremenljivka['variable'].' - '.$spremenljivka['naslov'].'</h2>';
echo '<div class="popup_close"><a href="#" onClick="chartCloseAdvancedSettings(); return false;">✕</a></div>';
-
+
echo '<form method="post" name="chart_advanced_settings" onsubmit="chartSaveAdvancedSettings(\''.$spid.'\', \''.self::$current_loop.'\'); return false;">';
+ echo '<div class="chart_settings_wrap">';
+
+ /* ZAVIHKI NA DESNI */
+ echo '<div id="chartTabs" class="chartSettingsTabs">';
+
+ echo '<ul>';
+ echo '<li id="chartTab1" class="chartTab active" onClick="chartTabAdvancedSettings(\'1\');">';
+ echo $lang['srv_chart_advanced_labels'];
+ echo '</li>';
+ echo '<li id="chartTab2" class="chartTab" onClick="chartTabAdvancedSettings(\'2\');">';
+ echo $lang['srv_chart_advanced_colors'];
+ echo '</li>';
+ echo '<li id="chartTab3" class="chartTab" onClick="chartTabAdvancedSettings(\'3\');">';
+ echo $lang['srv_chart_advanced_recoding'];
+ echo '</li>';
+ // Tab za meje numericov
+ if(($spremenljivka['tip'] == 3 && self::checkDropdownNumeric($spid)) || $spremenljivka['tip'] == 7 || $spremenljivka['tip'] == 8 || $spremenljivka['tip'] == 22){
+ echo '<li id="chartTab4" class="chartTab" onClick="chartTabAdvancedSettings(\'4\');">';
+ echo $lang['srv_chart_advanced_limits'];
+ echo '</li>';
+ }
+ echo '</ul>';
+ echo '</div>';
+
echo '<input type="hidden" name="anketa" value="'.self::$anketa.'" />';
echo '<input type="hidden" name="spid" value="'.$spid.'" />';
echo '<input type="hidden" name="loop" value="'.self::$current_loop.'" />';
@@ -8986,7 +8916,7 @@ class SurveyChart {
echo '</div>';
// urejanje barv
- echo '<div id="chartSettingsArea2" class="chartSettingsArea" style="visibility: hidden;">';
+ echo '<div id="chartSettingsArea2" class="chartSettingsArea displayNone">';
self::displayAdvancedSettingsColors($spid);
echo '</div>';
@@ -8998,7 +8928,7 @@ class SurveyChart {
}
/* REKODIRANJE */
- echo '<div id="chartSettingsArea3" class="chartSettingsArea" style="visibility: hidden;">';
+ echo '<div id="chartSettingsArea3" class="chartSettingsArea displayNone">';
$spr_id=explode('_',$spid);
$vmv = new RecodeValues(self::$anketa,$spr_id[0]);
@@ -9007,43 +8937,14 @@ class SurveyChart {
echo '</form>';
-
- /* ZAVIHKI NA DESNI */
- echo '<div id="chartTabs" class="chartSettingsTabs">';
-
- echo '<ul>';
- echo '<li id="chartTab1" class="chartTab active" onClick="chartTabAdvancedSettings(\'1\');">';
- echo $lang['srv_chart_advanced_labels'];
- echo '</li>';
- echo '<li id="chartTab2" class="chartTab" onClick="chartTabAdvancedSettings(\'2\');">';
- echo $lang['srv_chart_advanced_colors'];
- echo '</li>';
- echo '<li id="chartTab3" class="chartTab" onClick="chartTabAdvancedSettings(\'3\');">';
- echo $lang['srv_chart_advanced_recoding'];
- echo '</li>';
- // Tab za meje numericov
- if(($spremenljivka['tip'] == 3 && self::checkDropdownNumeric($spid)) || $spremenljivka['tip'] == 7 || $spremenljivka['tip'] == 8 || $spremenljivka['tip'] == 22){
- echo '<li id="chartTab4" class="chartTab" onClick="chartTabAdvancedSettings(\'4\');">';
- echo $lang['srv_chart_advanced_limits'];
- echo '</li>';
- }
- echo '</ul>';
-
- echo '</div>';
+ echo '</div>'; #wrap
/* GUMBI NA DNU */
- echo '<div id="chartSettingsButtons" class="buttons_holder">';
-
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" onclick="chartCloseAdvancedSettings(); return false;"><span>'.$lang['srv_zapri'].'</span></a>';
- echo '</span>';
-
- echo '<span class="buttonwrapper floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" onclick="chartSaveAdvancedSettings(\''.$spid.'\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_potrdi'].'</a>';
- echo '</span>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="chartCloseAdvancedSettings(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="chartSaveAdvancedSettings(\''.$spid.'\', \''.self::$current_loop.'\'); return false;">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
// Urejanje barv posameznega grafa
@@ -9076,17 +8977,18 @@ class SurveyChart {
for($i=0; $i<7; $i++){
$name = 'color'.($i+1);
- $value = (self::$settings['colors'][$i] != '') ? self::$settings['colors'][$i] : $default_colors[$i];
+ $value = (isset(self::$settings['colors'][$i]) && self::$settings['colors'][$i] != '') ? self::$settings['colors'][$i] : $default_colors[$i];
echo ' <div class="form-item"><label for="'.$name.'">'.$lang['srv_color'].' '.($i+1).': </label><input type="text" id="'.$name.'" name="'.$name.'" class="colorwell" value="'.$value.'" /></div>';
}
// reset na default barvo
- echo '<br /><span class="as_link clr" onClick="chartAdvancedSettingsSetColor(\''.(is_numeric(self::$skin) ? implode("_",$default_colors) : self::$skin).'\')">'.$lang['srv_chart_advanced_default_color'].'</span>';
+ echo '<p class="as_link top16 bottom16" onClick="chartAdvancedSettingsSetColor(\''.(is_numeric(self::$skin) ? implode("_",$default_colors) : self::$skin).'\')">'.$lang['srv_chart_advanced_default_color2'].'</p>';
// nastavitev ene od palet
- echo '<br /><span class="clr">'.$lang['srv_chart_advanced_skin'].': ';
- echo '<select name="chart_advanced_color" id="chart_advanced_color" onChange="chartAdvancedSettingsSetColor(this.value)">';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_chart_advanced_skin'].': ';
+ echo '<select class="dropdown large" name="chart_advanced_color" id="chart_advanced_color" onChange="chartAdvancedSettingsSetColor(this.value)">';
echo ' <option' . (self::$skin == '1ka' ? ' selected="selected"' : '') . ' value="1ka">'.$lang['srv_chart_skin_1ka'].'</option>';
echo ' <option' . (self::$skin == 'lively' ? ' selected="selected"' : '') . ' value="lively">'.$lang['srv_chart_skin_0'].'</option>';
echo ' <option' . (self::$skin == 'mild' ? ' selected="selected"' : '') . ' value="mild">'.$lang['srv_chart_skin_1'].'</option>';
@@ -9103,7 +9005,7 @@ class SurveyChart {
}
- echo '</select></span>';
+ echo '</select></p></div>';
}
@@ -9114,18 +9016,24 @@ class SurveyChart {
$row = Cache::srv_spremenljivka($spid);
$disabled = ($row['edit_graf'] == 0) ? ' disabled="disabled"' : '';
+ $gray = ($row['edit_graf'] == 0) ? ' gray' : '';
- echo '<div><p>';
- echo $lang['srv_chart_advanced_useLabels'].':';
- echo '<label for="edit_graf_0"><input type="radio" value="0" name="edit_graf" id="edit_graf_0" '.(($row['edit_graf'] == 0) ? ' checked="checked" ' : '').' onClick="edit_labels(\'0\');" />';
+ echo '<div class="new_labels"><p>';
+ echo $lang['srv_chart_advanced_useLabels'].':</p>';
+ echo '<input type="radio" value="0" name="edit_graf" id="edit_graf_0" '.(($row['edit_graf'] == 0) ? ' checked="checked" ' : '').' onClick="edit_labels(\'0\');" />';
+ echo '<label for="edit_graf_0">';
echo $lang['no'].'</label>';
- echo ' <label for="edit_graf_1"><input type="radio" value="1" name="edit_graf" id="edit_graf_1" '.(($row['edit_graf'] == 1) ? ' checked="checked" ' : '').' onClick="edit_labels(\'1\');" />';
+
+ echo '<input type="radio" value="1" name="edit_graf" id="edit_graf_1" '.(($row['edit_graf'] == 1) ? ' checked="checked" ' : '').' onClick="edit_labels(\'1\');" />';
+ echo ' <label for="edit_graf_1">';
echo $lang['yes'].'</label>';
echo '</p></div>';
+ echo '<div class="chart_editing">';
+
+ echo '<p id="title_edit" class="top16'.$gray.'">'.$lang['srv_notifications_send_title'].':</p>';
- echo '<div class="chart_editing">';
// Urejanje naslova spremenljivke
$text = $row['naslov_graf'] == '<p></p>' ? $row['naslov'] : $row['naslov_graf'];
@@ -9133,9 +9041,7 @@ class SurveyChart {
$text = substr($text, 3);
$text = substr($text, 0, -4);
}
- echo '<p>';
- echo '<textarea style="width:99%; height:50px;" name="naslov_graf" id="naslov_graf" class="chart_label" '.$disabled.'>'.$text.'</textarea>';
- echo '</p>';
+ echo '<textarea class="textarea" name="naslov_graf" id="naslov_graf" class="chart_label" '.$disabled.'>'.$text.'</textarea>';
// Urejanje label za gride
@@ -9152,7 +9058,7 @@ class SurveyChart {
}
//dodatne vrednosti (ne vem, zavrnil...)
- if (count($already_set_mv) > 0 ) {
+ /* if (count($already_set_mv) > 0 ) {
echo '<td></td>';
if (count($missing_values) > 0) {
foreach ($missing_values AS $mv_key => $mv_text) {
@@ -9161,7 +9067,7 @@ class SurveyChart {
}
}
}
- }
+ } */
echo '</tr>';
echo '<tr>';
@@ -9169,20 +9075,20 @@ class SurveyChart {
$sql1 = sisplet_query("SELECT naslov, naslov_graf FROM srv_grid WHERE id='$i' AND spr_id='$spid'");
$row1 = mysqli_fetch_array($sql1);
$text = $row1['naslov_graf'] == '' ? $row1['naslov'] : $row1['naslov_graf'];
- echo '<td><input type="text" maxlength="30" name="grid_graf_'.$i.'" id="grid_naslov_'.$i.'_graf" class="chart_label" value="'.$text.'" '.$disabled.' /></td>';
+ echo '<td><input type="text" class="text medium wauto" maxlength="30" name="grid_graf_'.$i.'" id="grid_naslov_'.$i.'_graf" class="chart_label" value="'.$text.'" '.$disabled.' /></td>';
}
//dodatne vrednosti (ne vem, zavrnil...)
- if (count($already_set_mv) > 0 ) {
+ /* if (count($already_set_mv) > 0 ) {
echo '<td></td>';
if (count($missing_values) > 0) {
foreach ($missing_values AS $mv_key => $mv_text) {
if (isset($already_set_mv[$mv_key])) {
- echo '<td><input type="text" maxlength="30" name="grid_'.$mv_key.'_graf" class="chart_label" value="'.$already_set_mv[$mv_key].'" '.$disabled.' /></td>';
+ echo '<td><input type="text" class="text medium wauto" maxlength="30" name="grid_'.$mv_key.'_graf" class="chart_label" value="'.$already_set_mv[$mv_key].'" '.$disabled.' /></td>';
}
}
}
- }
+ } */
echo '</tr>';
echo '</table>';
@@ -9201,9 +9107,9 @@ class SurveyChart {
$text = $row1['naslov_graf'] == '' ? $row1['naslov'] : $row1['naslov_graf'];
- echo '<li id="vrednost_'.$vrednost.'" '.($row1['other'] == 1 ? 'class="li_other"' : '').'>';
+ echo '<li id="vrednost_'./* $vrednost. */'" '.($row1['other'] == 1 ? 'class="li_other"' : '').'>';
- echo '<textarea maxlength="30" name="vrednost_graf_'.$row1['id'].'" id="'.$row1['variable'].'_graf" class="vrednost_textarea chart_label" style="width:60%; height:15px;" '.$disabled.'>'.$text.'</textarea> ';
+ echo '<textarea maxlength="30" name="vrednost_graf_'.$row1['id'].'" id="'.$row1['variable'].'_graf" class="vrednost_textarea chart_label" '.$disabled.'>'.$text.'</textarea> ';
echo '['.$row1['variable'].']</span>';
if ($row1['other'] == 1) echo ' <input type="text" disabled style="width:40px" />';
@@ -9348,9 +9254,9 @@ class SurveyChart {
global $lang;
if(!is_countable(SurveyAnalysis::$_LOOPS) || count(SurveyAnalysis::$_LOOPS) == 0)
- self::$sessionData[$spid] = $settings;
+ self::$sessionData[$spid] = self::$settings;
else
- self::$sessionData[$spid][SurveyAnalysis::$_CURRENT_LOOP['cnt']] = $settings;
+ self::$sessionData[$spid][SurveyAnalysis::$_CURRENT_LOOP['cnt']] = self::$settings;
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
# če je besedilo * in je samo ena kategorija je inline legenda false
@@ -9374,7 +9280,7 @@ class SurveyChart {
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- if(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0)
+ if(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])&&SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0)
$emptyData = false;
}
}
@@ -9397,16 +9303,16 @@ class SurveyChart {
echo '<div class="chart_title">'.$stevilcenje . $title.'</div>';
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_br anl_bb" style="font-size: '.(self::$fontSize+3).'px !important; padding:0px; margin-top:5px !important; border-collapse: collapse; width: 800px;">';
+ echo '<table>';
if(self::$settings['type']==1){
- echo '<tr>';
+ echo '<tr class="row1">';
+
#odgovori
echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$lang['srv_analiza_frekvence_titleAnswers'] . '</td>';
echo '<td class="anl_br anl_bb anl_ac anl_w70">'. $lang['srv_analiza_frekvence_titleFrekvenca'] .'</td>';
echo '</tr>';
- // konec naslovne vrstice
}
$_answersOther = array();
@@ -9492,8 +9398,8 @@ class SurveyChart {
echo '</div>';
// Izpisemo nastavitve za tabele
- echo '<div class="chart_settings printHide iconHide" style="margin-top: 5px;">';
- self::displaySingleSettings($spid);
+ echo '<div class="chart_settings table_settings printHide iconHide">';
+ self::displaySingleSettingsTable($spid);
echo '</div>';
# izpišemo še tekstovne odgovore za polja drugo
@@ -9789,7 +9695,7 @@ class SurveyChart {
echo '<div class="chart_title">'.$stevilcenje . $title.'</div>';
- echo '<table class="anl_tbl anl_bt anl_br anl_bb" style="font-size: '.(self::$fontSize+3).'px !important; padding:0px; margin:0px; border-collapse: collapse;">' . NEW_LINE;
+ echo '<table style="font-size: '.(self::$fontSize+3).'px !important; padding:0px; margin:0px; border-collapse: collapse;">' . NEW_LINE;
$counter = 0;
$_kumulativa = 0;
@@ -9827,9 +9733,9 @@ class SurveyChart {
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
if(!is_countable(SurveyAnalysis::$_LOOPS) || count(SurveyAnalysis::$_LOOPS) == 0)
- self::$sessionData[$spid] = $settings;
+ self::$sessionData[$spid] = self::$settings;
else
- self::$sessionData[$spid][SurveyAnalysis::$_CURRENT_LOOP['cnt']] = $settings;
+ self::$sessionData[$spid][SurveyAnalysis::$_CURRENT_LOOP['cnt']] = self::$settings;
# koliko zapisov prikažemo naenkrat
$num_show_records = (self::$num_records == 0) ? 10 : self::$num_records;
@@ -9843,6 +9749,7 @@ class SurveyChart {
return;
}
+
echo '<div class="chart_holder" id="chart_'.$spid.'_loop_'.self::$current_loop.'">';
//div za pozicijo popupa
echo '<div id="'.$spid.'"></div>';
@@ -9862,16 +9769,17 @@ class SurveyChart {
$_all_valid_answers_cnt = $_answers['validCnt'];
$_valid_answers = $_answers['valid'];
+
# tekst vprašanja
- echo '<table class="anl_tbl anl_bt anl_bb" style="font-size: '.(self::$fontSize+3).'px !important; padding:0px; margin:0px; border-collapse: collapse;">' . NEW_LINE;
+ echo '<table>' . NEW_LINE;
# naslovna vrstica
if(self::$settings['type']==1){
- echo '<tr>';
- #odgovori
- echo '<td class="anl_br anl_bl anl_bb anl_ac">'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
+ echo '<tr class="row1">';
- echo '<td class="anl_br anl_bb anl_ac" colspan="'.($_cols).'">'. $lang['srv_analiza_opisne_arguments'] .'</td>';
+ #odgovori
+ echo '<td>'.$lang['srv_analiza_opisne_subquestion'] . '</td>';
+ echo '<td colspan="'.($_cols).'">'. $lang['srv_analiza_opisne_arguments'] .'</td>';
echo '</tr>';
}
@@ -9880,17 +9788,19 @@ class SurveyChart {
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
if ($_grids_count > 0) {
+
# naslovna vrstica
$_row = $spremenljivka['grids'][0];
- echo '<tr>';
- echo '<td class="anl_bl anl_br anl_bb">&nbsp;</td>';
+
+ echo '<tr class="row2">';
+
+ echo '<td>&nbsp;</td>';
if (count($_row['variables'])>0)
foreach ($_row['variables'] AS $rid => $_col ){
$_sequence = $_col['sequence']; # id kolone z podatki
if ($_col['other'] != true) {
- echo '<td class="anl_br anl_bb anl_ac anl_str">';
- // echo $_col['variable'];
+ echo '<td>';
echo $_col['naslov'];
echo '</td>';
} else {
@@ -9912,7 +9822,7 @@ class SurveyChart {
$_max_i = 0;
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']));
+ $_max_i = max($_max_i,min($num_show_records,(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0)));
}
# za barvanje
@@ -9925,8 +9835,9 @@ class SurveyChart {
if ($variable['other'] != true) {
# tabela z navedbami
- echo '<td class=" anl_at" style="padding: 0pt; margin: 0pt; border-collapse: collapse; vertical-align:top;" >';
- echo '<table class="fullWidth anl_ac" style="padding:0; margin:0; border-collapse: collapse; vertical-align:top;">';
+ echo '<td class="cell_value cell_noPadding">';
+
+ echo '<table class="cell_table">';
$index=0;
if (count($_valid_answers) > 0) {
@@ -9970,8 +9881,8 @@ class SurveyChart {
echo '</div>';
// Izpisemo nastavitve za tabele
- echo '<div class="chart_settings printHide iconHide" style="margin-top: 5px;">';
- self::displaySingleSettings($spid);
+ echo '<div class="chart_settings table_settings printHide iconHide">';
+ self::displaySingleSettingsTable($spid);
echo '</div>';
echo '</div>';
@@ -10028,12 +9939,12 @@ class SurveyChart {
- if (isset ($_POST['what']))
- $what = $_POST['what'];
if (isset ($_POST['value']))
$value = $_POST['value'];
-
- self::$settings[$what] = $value;
+ if (isset ($_POST['what'])){
+ $what = $_POST['what'];
+ self::$settings[$what] = $value;
+ }
if (isset ($_POST['num_records'])){
@@ -10327,8 +10238,8 @@ class SurveyChart {
$other = '0';
# manjkoajoče vrednosti (ne vem, zavrnil ...
- if (isset($_POST['missing_value_checkbox']) && is_array($_POST['missing_value_checkbox'])) {
- if (in_array($grid, $_POST['missing_value_checkbox'])) {
+ if (isset($_POST['missing_value_checkbox_'.$spid]) && is_array($_POST['missing_value_checkbox_'.$spid])) {
+ if (in_array($grid, $_POST['missing_value_checkbox_'.$spid])) {
# grid je manjkajoča vrednost
$other = $grid.'';
$id = $grid;
@@ -10536,16 +10447,15 @@ class SurveyChart {
global $lang;
- echo '<h2 style="margin-bottom:5px;">'.$lang['srv_chart_skin_long'].'</h2>';
- echo '<span style="font-size: 12px; font-style: italic;">'.$lang['srv_chart_skin_info'].'</span><br/><br/>';
-
- // Opozorilo na vrhu
+ echo '<h2>'.$lang['srv_chart_skin_long'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="close_chartColor(); return false;">✕</a></div>';
+
+ // Opozorilo - privzetih ne morejo spreminjati
if(!is_numeric($skin)){
echo '<div id="chart_skin_note">';
echo $lang['srv_chart_skin_warning'];
echo '</div>';
- echo '<br class="clr" />'."\n";
- }
+ }
echo '<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
@@ -10566,12 +10476,13 @@ class SurveyChart {
</script>';
+ echo '<div id="chart_settings_profiles_wrap">';
echo '<div id="chart_settings_profiles_left">';
-
+
// Prednastavljeni skini
- echo '<span class="bold">'.$lang['srv_chart_skin_default'].':</span>';
- echo '<span class="chart_profiles_holder" style="margin-bottom: 10px; height: 144px;">';
- echo '<span id="chart_profiles" class="chart_profiles select">';
+ echo '<p>'.$lang['srv_chart_skin_default'].':</p>';
+ echo '<div class="chart_profiles_holder">';
+ echo '<div id="chart_profiles" class="chart_profiles select">';
echo '<div class="option'.($skin == '1ka' ? ' active' : '').'" id="chart_profile_skin_1ka" value="1ka">'.$lang['srv_chart_skin_1ka'].'</div>';
echo '<div class="option'.($skin == 'lively' ? ' active' : '').'" id="chart_profile_skin_0" value="lively">'.$lang['srv_chart_skin_0'].'</div>';
@@ -10583,34 +10494,39 @@ class SurveyChart {
echo '<div class="option'.($skin == 'red' ? ' active' : '').'" id="chart_profile_skin_4" value="red">'.$lang['srv_chart_skin_4'].'</div>';
echo '<div class="option'.($skin == 'multi' ? ' active' : '').'" id="chart_profile_skin_5" value="multi">'.$lang['srv_chart_skin_5'].'</div>';
- echo '</span>';
- echo '</span>';
+ echo '</div>';
+ echo '</div>';
// Custom kreirani skini
$custom_skins = self::getCustomSkins();
- echo '<span class="bold">'.$lang['srv_chart_skin_custom'].':</span>';
- echo '<span class="chart_profiles_holder">';
- echo '<span id="chart_profiles_custom" class="chart_profiles select">';
+ echo '<p>'.$lang['srv_chart_skin_custom'].':</p>';
+ echo '<div class="chart_profiles_holder">';
+ echo '<div id="chart_profiles_custom" class="chart_profiles select">';
foreach ($custom_skins as $custom_skin ){
echo '<div class="option'.($skin == $custom_skin['id'] ? ' active' : '').'" id="chart_profile_skin_'.$custom_skin['id'].'" value="'.$custom_skin['id'].'">'.$custom_skin['name'].'</div>';
}
- echo '</span>';
- echo '</span>';
+ echo '</div>';
+ echo '</div>';
// Ce je izbran custom skin imamo na dnu gumba brisi in preimenuj
if(is_numeric($skin)){
- echo '<a href="#" onclick="chart_skin_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</a><br/>'."\n";
- echo '<a href="#" onclick="chart_skin_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</a>'."\n";
+
+ echo '<div class="button_holder">';
+ echo '<button class="small white-blue" onClick="chart_skin_action(\'show_rename\'); return false;">'.$lang['srv_rename_profile'].'</button>';
+ echo '<button class="small blue" onclick="chart_skin_action(\'show_delete\'); return false;">'.$lang['srv_delete_profile'].'</button>';
+ echo '</div>';
}
- echo '</div>';
+ echo '</div>'; #left
- echo '<div id="chart_settings_profiles_right">';
+ echo '<div id="chart_settings_profiles_middle">';
+
+ echo '<p class="bottom8">'.$lang['srv_chart_skin_long2'].':</p>';
// ce je numeric je custom skin
if(is_numeric($skin)){
@@ -10623,70 +10539,101 @@ class SurveyChart {
else{
// preview za default skine
echo '<div id="div_chart_skin_previews">';
- echo $lang['srv_chart_skin_preview'].':';
+ echo '<h2>'.$lang['srv_chart_skin_preview'].'</h2>';
self::displayChartSkinPreview($skin);
echo '</div>';
$default_colors = self::getDefaultColors($skin);
}
-
- // Izbira custom skina
- echo '<div id="chart_custom_skin">';
-
- echo ' <div id="picker" style="float: right;"></div>';
-
for($i=0; $i<7; $i++){
$name = 'color'.($i+1);
//$value = (self::$settings['colors'][$i] != '') ? self::$settings['colors'][$i] : $default_colors[$i];
$value = $default_colors[$i];
- echo ' <div class="form-item"><label for="'.$name.'">'.$lang['srv_color'].' '.($i+1).': </label><input type="text" id="'.$name.'" name="'.$name.'" class="colorwell" value="'.$value.'" /></div>';
+ echo ' <div class="form-item"><label for="'.$name.'">'.$lang['srv_color'].' '.($i+1).': </label><input onfocus="toggleGrafiColorWheel();" type="text" id="'.$name.'" name="'.$name.'" class="colorwell" value="'.$value.'" /></div>';
}
// reset na default barvo
- echo '<br /><span class="as_link clr" onClick="chartAdvancedSettingsSetColor(\''.(is_numeric($skin) ? implode("_",$colors) : $skin).'\')">'.$lang['srv_chart_advanced_default_color'].'</span>';
-
- echo '</div>';
+ echo '<p class="as_link top8" onClick="chartAdvancedSettingsSetColor(\''.(is_numeric($skin) ? implode("_",$colors) : $skin).'\')">'.$lang['srv_chart_advanced_default_color2'].'</p>';
- echo '</div>';
+ echo '</div>'; #middle
+ echo '<div id="chart_settings_profiles_right">';
+
+ // Izbira custom skina
+ echo '<div id="chart_custom_skin_cover">';
+ echo '<div id="chart_custom_skin">';
+
+ echo '<div id="picker"></div>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>'; #right
+ echo '</div>'; #wrap
+
// cover Div
- echo '<div id="dsp_cover_div"></div>'."\n";
+ echo '<div id="dsp_cover_div"></div>';
// div za kreacijo novega
- echo '<div id="newChartSkin">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="newChartSkinName" name="newChartSkinName" type="text" value="" size="50" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="chart_skin_action(\'new\'); return false;"><span>'.$lang['srv_analiza_arhiviraj_save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="chart_skin_action(\'cancel_new\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="newChartSkin">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="newChartSkinName" name="newChartSkinName" type="text" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="chart_skin_action(\'cancel_new\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="chart_skin_action(\'new\'); return false;">'.$lang['srv_analiza_arhiviraj_save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameChartSkin">'.$lang['srv_missing_profile_name'].': '."\n";
- echo '<input id="renameChartSkinName" name="renameChartSkinName" type="text" value="' . $custom_skin['name'] . '" size="50" />'."\n";
- echo '<input id="renameChartSkinId" type="hidden" value="' . $custom_skin['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="chart_skin_action(\'rename\'); return false;"><span>'.$lang['srv_rename_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="chart_skin_action(\'cancel_rename\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameChartSkin">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_missing_profile_name'].':</label>';
+ echo '<input id="renameChartSkinName" name="renameChartSkinName" type="text" value="' . $custom_skin['name'] . '" class="text large" value=""/>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="chart_skin_action(\'cancel_rename\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="chart_skin_action(\'rename\'); return false;">'.$lang['srv_rename_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteChartSkin">'.$lang['srv_missing_profile_delete_confirm'].': <b>' . $custom_skin['name'] . '</b>?'."\n";
+ echo '<div id="deleteChartSkin">';
+
+
+ echo $lang['srv_missing_profile_delete_confirm'].': <span class="semi-bold">' . $custom_skin['name'] . '</span>?';
echo '<input id="deleteChartSkinId" type="hidden" value="' . $custom_skin['id'] . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="chart_skin_action(\'delete\'); return false;"><span>'.$lang['srv_delete_profile_yes'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="chart_skin_action(\'cancel_delete\'); return false;"><span>'.$lang['srv_close_profile'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
-
-
- echo '<span class="clr"></span>';
- echo '<div style="position:absolute; bottom:20px; right:20px;">';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="chart_skin_action(\'cancel_delete\'); return false;">'.$lang['srv_close_profile'].'</button>';
+ echo '<button class="medium blue" onclick="chart_skin_action(\'delete\'); return false;">'.$lang['srv_delete_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onClick="close_chartColor(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onClick="chart_skin_action(\'show_new\'); return false;">'.$lang['srv_save_new_selection'].'</button>';
+ echo '<button class="medium blue" onclick="save_chartColor(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="save_chartColor(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_save_new_profile'].'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="chart_skin_action(\'show_new\'); return false;"><span>'.$lang['srv_save_new_profile'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="close_chartColor(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
-
- echo '</div>';
}
static function displayChartSkinPreview ($skin) {
@@ -10806,7 +10753,7 @@ class SurveyChart {
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link charts" style="margin:5px; padding:5px;" >';
echo '<h2>'.$lang['srv_publc_chart_title_for'] . self::$survey['naslov'].'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php b/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php
index e0f4e85..532fc5c 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyCrosstabs.php
@@ -5,12 +5,12 @@
*
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("EXPORT_FOLDER")) define("EXPORT_FOLDER", "admin/survey/SurveyData");
# mejne vrednosti za barvanje residualov
-define("RESIDUAL_COLOR_LIMIT1", 1.00);
-define("RESIDUAL_COLOR_LIMIT2", 2.00);
-define("RESIDUAL_COLOR_LIMIT3", 3.00);
-define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
+if(!defined("RESIDUAL_COLOR_LIMIT1")) define("RESIDUAL_COLOR_LIMIT1", 1.00);
+if(!defined("RESIDUAL_COLOR_LIMIT2")) define("RESIDUAL_COLOR_LIMIT2", 2.00);
+if(!defined("RESIDUAL_COLOR_LIMIT3")) define("RESIDUAL_COLOR_LIMIT3", 3.00);
+if(!defined("AUTO_HIDE_ZERRO_VALUE")) define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
@session_start();
@@ -104,9 +104,13 @@ 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();
+
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
+
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
# Inicializiramo in polovimo nastavitve missing profila
@@ -198,11 +202,11 @@ class SurveyCrosstabs {
$this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system']) && (int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
continue;
}
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : null;
if (is_numeric($tip)
# tekstovnih tipov ne dodajamo
@@ -299,7 +303,7 @@ class SurveyCrosstabs {
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable']) && $grid['variable'] != '') {
$sub++;
$this->variablesList[] = array(
'tip'=>$tip,
@@ -367,76 +371,105 @@ class SurveyCrosstabs {
*
*/
function Display() {
+ global $lang;
+
# preberemo prednastavljene variable iz seje, če obstajajo
$this->presetVariables();
if ($this->dataFileStatus == FILE_STATUS_NO_DATA
- || $this->dataFileStatus == FILE_STATUS_NO_FILE
- || $this->dataFileStatus == FILE_STATUS_SRV_DELETED){
+ || $this->dataFileStatus == FILE_STATUS_NO_FILE
+ || $this->dataFileStatus == FILE_STATUS_SRV_DELETED){
+
return false;
}
- global $lang;
- # polovimo nastavtve missing profila
- //$this->missingProfileData = SurveyMissingProfiles::getProfile($this->currentMissingProfile);
+ echo '<div class="crosstab_top_holder">';
+ // Izbira spremenljivk
echo '<div id="crosstab_drobdowns">';
$resultIsCheckbox = $this->DisplayDropdows();
echo '</div>';
- echo '<div id="div_crossCheck" class="floatLeft spaceLeft">' ;
+
+
+ // Nastavitve
+ echo '<div id="crosstab_settings" class="crosstab_settings">';
+
+ echo ' <div class="setting_line">';
+ echo $lang['srv_analiza_crosstab_table_settings'].':';
+ echo ' </div>';
+
$this->displayLinePercent();
$this->displayResidual();
$this->displayShowChart();
+
+ echo '</div>';
+
+
+ // Nastavitve 2
if ( $resultIsCheckbox['is_check']) {
- echo '<div id="crossNavedbeVsENote">';
- echo '<input type="radio" name="crossNavVsEno" id="crossNavVsEno0" vlaue="0" '.($this->crossNavVsEno == 0 ? ' checked="checked" ' : '' ).' onchange="change_crosstab(); return false;" autocomplete="off">'.
- '<label for="crossNavVsEno0">'.$lang['srv_analiza_crosstab_navedbe'].'</label>';
- echo '<input type="radio" name="crossNavVsEno" id="crossNavVsEno1" vlaue="1" '.($this->crossNavVsEno == 1? ' checked="checked" ' : '' ).' onchange="change_crosstab(); return false;" autocomplete="off">'.
- '<label for="crossNavVsEno1">'.$lang['srv_analiza_crosstab_enote'].'</label>';
- echo '</div>';
+
+ echo '<div id="crosstab_settings_2" class="crosstab_settings">';
+
+ echo ' <div class="setting_line">';
+ echo $lang['srv_analiza_crosstab_answer_settings'].':';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <input type="radio" name="crossNavVsEno" id="crossNavVsEno0" vlaue="0" '.($this->crossNavVsEno == 0 ? ' checked="checked" ' : '' ).' onchange="change_crosstab(); return false;" autocomplete="off">';
+ echo ' <label for="crossNavVsEno0">'.$lang['srv_analiza_crosstab_navedbe'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_line">';
+ echo ' <input type="radio" name="crossNavVsEno" id="crossNavVsEno1" vlaue="1" '.($this->crossNavVsEno == 1? ' checked="checked" ' : '' ).' onchange="change_crosstab(); return false;" autocomplete="off">';
+ echo ' <label for="crossNavVsEno1">'.$lang['srv_analiza_crosstab_enote'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
- echo '</div>';
-
+
+ echo '</div>';
- $this->displayExport();
- $this->displayCrosstabCheckboxes();
- echo '<div id="crosstab_table">';
+
+ // Tabele
+ echo '<div id="crosstab_tables">';
$this->displayCrosstabsTables();
echo '</div>';
}
function DisplayDropdows() {
global $lang;
+
$variables = $this->getVariableList();
$multiple = true;
- echo '<div id="crossLeftHolder" >';
+
+ echo '<div id="crossLeftHolder">';
# iz header datoteke preberemo spremenljivke
#js: $("#crosstab_variable_1, #crosstab_variable_2").live('click', function() {})
if (count($this->variabla1) > 0) {
- $br=null;
- echo $lang['srv_crosstab_label1'].'<br/>';
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer" id="crosstab_add_new" onclick="add_new_variable(\'1\');"><span class="faicon add small icon-as_link" title=""></span></span>';
- }
+
+ echo '<div class="title">'.$lang['srv_crosstab_label1'].'</div>';
+
+ echo '<div id="crossLeftDropdowns">';
+
foreach($this->variabla1 AS $_key => $variabla1) {
- echo $_br;
- echo '<span id="v1_'.$_key.'">';
+
+ echo '<div id="v1_'.$_key.'" class="variabla_line">';
- echo '<select name="crosstab_variable_1" id="crosstab_variable_1" onchange="change_crosstab(); return false;" autocomplete="off">';
+ echo '<select name="crosstab_variable_1" id="crosstab_variable_1" class="dropdown large" onchange="change_crosstab(); return false;" autocomplete="off">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $variabla1['seq'] == null || $variabla1['seq'] == 0 ) {
echo '<option value="0" selected="selected" >'. $lang['srv_analiza_crosstab_izberi_prvo'] . '</option>';
}
foreach ($variables as $variable) {
- echo '<option value="' . $variable['sequence'] . '" spr_id="'.$variable['spr_id'].'" '
+ echo '<option value="' . (isset($variable['sequence']) ? $variable['sequence'] : '') . '" spr_id="'.(isset($variable['spr_id']) ? $variable['spr_id'] : '').'" '
. ( isset($variable['grd_id']) ? ' grd_id="'.$variable['grd_id'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($variabla1['seq'] > 0 &&$variabla1['seq'] == $variable['sequence']) ? ' selected="selected" ' : '')
+ . ( ($variabla1['seq'] > 0 && isset($variable['sequence']) && $variabla1['seq'] == $variable['sequence']) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'] . '</option>';
@@ -444,41 +477,54 @@ class SurveyCrosstabs {
}
echo '</select>';
+
+ // Gumb odstrani
+ echo '<div class="crosstab_remove_holder">';
if (count($this->variabla1) > 1) {
- echo '<span class="pointer" id="crosstab_remove" onclick="crs_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
- } else {
- #echo '<span class="space_crosstab_new">&nbsp;</span>';
- }
+ echo '<span class="faicon delete_circle" id="crosstab_remove" onclick="crs_remove_variable(this);"></span>';
+ }
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
- $_br = '<br/><span class="space_crosstab_new">&nbsp;</span>';
- echo '</span>';
+ if ((int)$this->variabla1['0']['seq'] > 0) {
+ echo '<button class="blue small" id="crosstab_add_new" onclick="add_new_variable(\'1\');">'.$lang['srv_multicrosstabs_add'].'</button>';
}
- $_br = null;
}
echo '</div>';
+
+
echo '<div id="crossImgHolder">';
- echo '<br/>';
+
if ($this->isSelectedBothVariables()) {
- echo '<span class="faicon replace icon-as_link" title="'.$lang['srv_replace'].'" onclick="change_crosstab(\'rotate\');return false;" />';
- } else {
- echo '<span class="faicon replace icon-grey_normal" title="'.$lang['srv_replace'].'" />';
+ echo '<span class="faicon replace" title="'.$lang['srv_replace'].'" onclick="change_crosstab(\'rotate\');return false;" />';
+ }
+ else {
+ echo '<span class="faicon replace gray" title="'.$lang['srv_replace'].'" />';
}
+
echo '</div>';
+
echo '<div id="crossRightHolder">';
- echo $lang['srv_crosstab_label2'].'<br/>';
+
+ echo '<div class="title">'.$lang['srv_crosstab_label2'].'</div>';
+
# za vsako novo spremenljivko 2 nardimo svoj select
if (count($this->variabla2) > 0) {
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer" id="crosstab_add_new" onclick="add_new_variable(\'2\');"><span class="faicon add small icon-as_link" title="'.'"></span></span>';
- }
-
+
+ echo '<div id="crossRightDropdowns">';
+
foreach($this->variabla2 AS $_key => $variabla2) {
- echo $_br;
- echo '<span id="v2_'.$_key.'">';
+
+ echo '<div id="v2_'.$_key.'" class="variabla_line">';
- echo '<select name="crosstab_variable_2" id="crosstab_variable_2" onchange="change_crosstab(); return false;" autocomplete="off"'
+ echo '<select name="crosstab_variable_2" id="crosstab_variable_2" class="dropdown large" onchange="change_crosstab(); return false;" autocomplete="off"'
. ((int)$this->variabla1['0']['seq'] > 0 ? '' : ' disabled="disabled" ')
.'>';
@@ -493,33 +539,44 @@ class SurveyCrosstabs {
}
foreach ($variables as $variable) {
- echo '<option value="' . $variable['sequence'] . '" spr_id="'.$variable['spr_id'].'" '
+ echo '<option value="' . (isset($variable['sequence'])?$variable['sequence']:'') . '" spr_id="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'" '
. ( isset($variable['grd_id']) ? ' grd_id="'.$variable['grd_id'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variabla2['seq'] > 0 && $variabla2['seq'] == $variable['sequence'] ? ' selected="selected" ' : '')
+ . ( $variabla2['seq'] > 0 && isset($variable['sequence']) && $variabla2['seq'] == $variable['sequence'] ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'] .'</option>';
}
+
echo '</select>';
+
+ // Gumb odstrani
+ echo '<div class="crosstab_remove_holder">';
if (count($this->variabla2) > 1) {
- echo '<span class="pointer" id="crosstab_remove" onclick="crs_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
- } else {
- echo '<span class="space_crosstab_new">&nbsp;</span>';
- }
+ echo '<span class="faicon delete_circle" id="crosstab_remove" onclick="crs_remove_variable(this);"></span>';
+ }
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
- $_br = '<br/><span class="space_crosstab_new">&nbsp;</span>';
- echo '</span>';
+
+ if ((int)$this->variabla1['0']['seq'] > 0) {
+ echo '<button class="blue small" id="crosstab_add_new" onclick="add_new_variable(\'2\');">'.$lang['srv_multicrosstabs_add'].'</button>';
}
}
+
echo '</div>';
+
# če je katera od variabel checkbox, ponudimo možnodt izbire ali po enotah ali po navedbah
$is_check = false;
if (count($this->variabla2) > 0) {
foreach ($this->variabla2 AS $key => $var) {
- $spr_tip = $this->_HEADERS[$var['spr']]['tip'];
+ $spr_tip = isset($this->_HEADERS[$var['spr']]['tip']) ? $this->_HEADERS[$var['spr']]['tip'] : null;
if ( $spr_tip == 2 || $spr_tip == 16 ) {
$is_check = true;
}
@@ -527,7 +584,7 @@ class SurveyCrosstabs {
}
if (count($this->variabla1) > 0 && $is_check == false ) { # če še ni bil checkbox
foreach ($this->variabla1 AS $key => $var) {
- $spr_tip = $this->_HEADERS[$var['spr']]['tip'];
+ $spr_tip = isset($this->_HEADERS[$var['spr']]['tip']) ? $this->_HEADERS[$var['spr']]['tip'] : null;
if ( $spr_tip == 2 || $spr_tip == 16 ) {
$is_check = true;
}
@@ -546,10 +603,12 @@ class SurveyCrosstabs {
if ($which == '1') {
- echo '<br/>';
- echo '<span class="space_crosstab_new">&nbsp;</span>';
- echo '<select name="crosstab_variable_1" id="crosstab_variable_1" onchange="change_crosstab(); return false;" autocomplete="off">';
- # ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
+
+ echo '<div class="variabla_line">';
+
+ echo '<select name="crosstab_variable_1" id="crosstab_variable_1" class="dropdown large" onchange="change_crosstab(); return false;" autocomplete="off">';
+
+ # ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $variabla1['seq'] == null || $variabla1['seq'] == 0 ) {
echo '<option value="0" selected="selected" >'. $lang['srv_analiza_crosstab_izberi_more'] . '</option>';
}
@@ -564,18 +623,25 @@ class SurveyCrosstabs {
}
echo '</select>';
- echo '<span class="pointer" id="crosstab_remove" onclick="crs_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
-
- } else {
- echo '<br/>';
- echo '<span class="space_crosstab_new">&nbsp;</span>';
- echo '<select name="crosstab_variable_'.$which.'" id="crosstab_variable_'.$which.'" onchange="change_crosstab(); return false;" autocomplete="off"'
- .'>';
+
+ // Gumb odstrani
+ echo '<div class="crosstab_remove_holder">';
+ echo ' <span class="faicon delete_circle" id="crosstab_remove" onclick="crs_remove_variable(this);"></span>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+ else {
+
+ echo '<div class="variabla_line">';
+
+ echo '<select name="crosstab_variable_'.$which.'" id="crosstab_variable_'.$which.'" class="dropdown large" onchange="change_crosstab(); return false;" autocomplete="off">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ((int)$this->variabla1['0']['seq'] > 0) {
echo '<option value="0" selected="selected" >'. $lang['srv_analiza_crosstab_najprej_prvo'] . '</option>';
- } else {
+ }
+ else {
# če druga variabla ni izbrana dodamo tekst za izbiro druge variable
echo '<option value="0" selected="selected">'. $lang['srv_analiza_crosstab_izberi_more'] . '</option>';
}
@@ -589,8 +655,15 @@ class SurveyCrosstabs {
. $variable['variableNaslov'] .$variable['sequence']. '</option>';
}
+
echo '</select>';
- echo '<span class="pointer" id="crosstab_remove" onclick="crs_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
+
+ // Gumb odstrani
+ echo '<div class="crosstab_remove_holder">';
+ echo ' <span class="faicon delete_circle" id="crosstab_remove" onclick="crs_remove_variable(this);"></span>';
+ echo '</div>';
+
+ echo '</div>';
}
}
/**
@@ -599,83 +672,56 @@ class SurveyCrosstabs {
function displayCrosstabCheckboxes () {
global $lang;
- echo '<div id="div_color_residual_legend" '.($this->isSelectedBothVariables() && $this->doColor ? '' : ' class="hidden"').'>' ;
+ echo '<div id="crosstab_legend" '.($this->isSelectedBothVariables() && $this->doColor ? '' : ' class="hidden"').'>' ;
- echo '<span id="span_color_residual_legend" class="floatLeft">';
- echo '<span id="span_color_residual_legend1" class="floatLeft">';
- echo '<span class="floatLeft">';
- echo '<label>'.$lang['srv_analiza_crosstab_adjs_residual_short'].'</label>';
- echo '</span>';
- echo '<span class="floatLeft">';
- echo '<table id="tbl_color_residual_legend" >';
- echo '<tr>';
- echo '<td style="width:15px !important; text-align: center !important; font-weight: bold !important;">-</td>';
- echo '<td class="rsdl_bck6" title="'.$lang['srv_crosstab_residual_1'].'">&nbsp;</td>';
- echo '<td class="rsdl_bck5" title="'.$lang['srv_crosstab_residual_2'].'">&nbsp;</td>';
- echo '<td class="rsdl_bck4" title="'.$lang['srv_crosstab_residual_3'].'">&nbsp;</td>';
- echo '<td class="rsdl_bck1" title="'.$lang['srv_crosstab_residual_4'].'">&nbsp;</td>';
- echo '<td class="rsdl_bck2" title="'.$lang['srv_crosstab_residual_5'].'">&nbsp;</td>';
- echo '<td class="rsdl_bck3" title="'.$lang['srv_crosstab_residual_6'].'">&nbsp;</td>';
- echo '<td style="width:15px !important; text-align: center !important; font-weight: bold !important;">+</td>';
- //echo '<td style="width:40px !important; text-align: center !important;"><span id="span_rsdl_legend_togle" class="as_link">'.$lang['srv_more'].'</span></td>';
- echo '</tr>';
- echo '</table>';
- echo '</span>';
- echo '<span class="floatLeft" style="padding-top:2px;">';
- echo Help :: display('srv_crosstab_residual');
- echo '</span>';
+
+ echo '<div id="span_color_residual_legend1" class="crosstab_legend_line">';
+
+ echo '<span class="title">'.$lang['srv_analiza_crosstab_adjs_residual_short'].' '.Help :: display('srv_crosstab_residual').':</span>';
+
+ echo '<div class="trak">';
+ echo ' <div class="minus">-</div>';
+ echo ' <div class="rsdl_bck6" title="'.$lang['srv_crosstab_residual_1'].'"></div>';
+ echo ' <div class="rsdl_bck5" title="'.$lang['srv_crosstab_residual_2'].'"></div>';
+ echo ' <div class="rsdl_bck4" title="'.$lang['srv_crosstab_residual_3'].'"></div>';
+ echo ' <div class="rsdl_bck1" title="'.$lang['srv_crosstab_residual_4'].'"></div>';
+ echo ' <div class="rsdl_bck2" title="'.$lang['srv_crosstab_residual_5'].'"></div>';
+ echo ' <div class="rsdl_bck3" title="'.$lang['srv_crosstab_residual_6'].'"></div>';
+ echo ' <div class="plus">+</div>';
+ echo '</div>';
- echo '</span>';
+ echo '</div>';
+
- echo '<span id="span_color_residual_legend2" class="floatLeft displayNone">';
- echo '<span class="floatLeft">';
- echo '<label></label>';
- echo '</span>';
- echo '<span class="floatLeft">';
+ /*echo '<div id="span_color_residual_legend2" class="crosstab_legend_line displayNone">';
+
+ echo '<span class="title">'.Help :: display('srv_crosstab_residual').'</span>';
+
echo '<table id="tbl_color_residual" class="residual">';
- echo '<tr><td>'.$lang['srv_analiza_crosstab_adjs_residual_long'].':&nbsp;&nbsp;&nbsp;&nbsp;</td><th>+</th><th>-</th></tr>';
- echo '<tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_3_0'].'</td><td class="rsdl_bck1 anl_dash_ba" title="'.$lang['srv_crosstab_residual_4'].'">&nbsp;</td><td class="rsdl_bck4 anl_dash_bt anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_3'].'">&nbsp;</td></tr>';
- echo '<tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_2_0'].'</td><td class="rsdl_bck2 anl_dash_bl anl_dash_bb" title="'.$lang['srv_crosstab_residual_5'].'">&nbsp;</td><td class="rsdl_bck5 anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_2'].'">&nbsp;</td></tr>';
- echo '<tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_1_0'].'</td><td class="rsdl_bck3 anl_dash_bl anl_dash_bb" title="'.$lang['srv_crosstab_residual_6'].'">&nbsp;</td><td class="rsdl_bck6 anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_1'].'">&nbsp;</td></tr>';
+ echo ' <tr><td>'.$lang['srv_analiza_crosstab_adjs_residual_long'].':&nbsp;&nbsp;&nbsp;&nbsp;</td><th>+</th><th>-</th></tr>';
+ echo ' <tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_3_0'].'</td><td class="rsdl_bck1 anl_dash_ba" title="'.$lang['srv_crosstab_residual_4'].'">&nbsp;</td><td class="rsdl_bck4 anl_dash_bt anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_3'].'">&nbsp;</td></tr>';
+ echo ' <tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_2_0'].'</td><td class="rsdl_bck2 anl_dash_bl anl_dash_bb" title="'.$lang['srv_crosstab_residual_5'].'">&nbsp;</td><td class="rsdl_bck5 anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_2'].'">&nbsp;</td></tr>';
+ echo ' <tr><td class="anl_al">&nbsp;&nbsp;'.$lang['srv_crosstab_residual_1_0'].'</td><td class="rsdl_bck3 anl_dash_bl anl_dash_bb" title="'.$lang['srv_crosstab_residual_6'].'">&nbsp;</td><td class="rsdl_bck6 anl_dash_br anl_dash_bb" title="'.$lang['srv_crosstab_residual_1'].'">&nbsp;</td></tr>';
echo '</table>';
- //echo '<span class="residual_link"><a href="http://www.1ka.si/db/19/308/Pogosta%20vprasanja/Kaj_pomenijo_residuali/?&p1=226&p2=735&p3=789&p4=0&p5=0&id=789&from1ka=1" target="_blank">'.$lang['srv_residual_link_faq'].'</a></span>';
- echo '</span>';
- echo '<span id="span_rsdl_legend_togle" class="floatLeft spaceLeft as_link">'.$lang['srv_less'].'</span>';
- echo '<span class="floatLeft spaceLeft" style="padding-top:0px;">';
- echo Help :: display('srv_crosstab_residual');
- echo '</span>';
-
- echo '</span>';
+
+ echo '</div>';*/
+
+ echo '<div id="span_color_residual_legend3" class="crosstab_legend_line '.($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR == 4 ? '' : ' displayNone').'">';
- echo '<br />';
- echo '<span id="span_color_residual_legend3" class="floatLeft '.($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR == 4 ? '' : ' displayNone"').'" style="margin-top:10px; padding-left:18px;">';
- echo '<span class="floatLeft">';
- echo '<label>'.$lang['srv_analiza_crosstab_residuals'].'</label>';
- echo '</span>';
- echo '<span class="floatLeft">';
- echo '<table id="tbl_color_residual_legend" >';
- echo '<tr>';
- echo '<td style="width:10px !important; text-align: center !important; font-weight: bold !important;"></td>';
- echo '<td class="crossCheck_EC" title="'.$lang['srv_analiza_crosstab_expected_count'].'">&nbsp;</td>';
- echo '<td class="crossCheck_RE" title="'.$lang['srv_analiza_crosstab_residual'].'">&nbsp;</td>';
- echo '<td class="crossCheck_SR" title="'.$lang['srv_analiza_crosstab_stnd_residual'].'">&nbsp;</td>';
- echo '<td class="crossCheck_AR" title="'.$lang['srv_analiza_crosstab_adjs_residual'].'">&nbsp;</td>';
- echo '<td style="width:10px !important; text-align: center !important; font-weight: bold !important;"></td>';
- echo '</tr>';
- echo '</table>';
- echo '</span>';
- echo '<span class="floatLeft" style="padding-top:2px;">';
- echo Help :: display('srv_crosstab_residual2');
- echo '</span>';
+ echo '<span class="title">'.$lang['srv_analiza_crosstab_residuals'].' '.Help::display('srv_crosstab_residual2').':</span>';
+
+ echo '<div class="trak">';
+ echo ' <div class="crossCheck_EC" title="'.$lang['srv_analiza_crosstab_expected_count'].'"></div>';
+ echo ' <div class="crossCheck_RE" title="'.$lang['srv_analiza_crosstab_residual'].'"></div>';
+ echo ' <div class="crossCheck_SR" title="'.$lang['srv_analiza_crosstab_stnd_residual'].'"></div>';
+ echo ' <div class="crossCheck_AR" title="'.$lang['srv_analiza_crosstab_adjs_residual'].'"></div>';
+ echo '</div>';
- echo '</span>';
+ echo '</div>';
- echo '</span>';
-
echo '</div>';
- echo '<br class="clr"/>';
}
public function displayCrosstabsTables() {
@@ -694,26 +740,26 @@ class SurveyCrosstabs {
$SR -> getProfileString();
# preverimo ali imamo izbrano tretjo variablo
- if ( $this->variabla_third == null || (int)$this->variabla_third == 0) {
+ /*if ( $this->variabla_third == null || (int)$this->variabla_third == 0) {
# tretja variabla ni izbrana, nardimo navadne loope če obstajajo
$this->_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
} else {
# tretja variabla je izbrana, zamenjamo loope z tretjo variablo
$this->_LOOPS = SurveyZankaProfiles::setLoopsForCrostabs($this->variabla_third);
- }
+ } */
- if (count($this->_LOOPS) > 0) {
+ /* if (count($this->_LOOPS) > 0) {
# če mamo zanke
foreach ( $this->_LOOPS AS $loop) {
$this->_CURRENT_LOOP = $loop;
echo '<h2>'.$lang['srv_zanka_note'].$loop['text'].'</h2>';
$this->displayCrosstabsTable();
- echo '<br/>';
}
- } else {
+ }
+ else { */
$this->displayCrosstabsTable();
- }
+ //}
}
public function displayCrosstabsTable() {
@@ -721,9 +767,11 @@ class SurveyCrosstabs {
global $admin_type;
if ($this->getSelectedVariables(1) !== null && $this->getSelectedVariables(2) !== null) {
+
$variables1 = $this->getSelectedVariables(2);
$variables2 = $this->getSelectedVariables(1);
$counter = 0;
+
foreach ($variables1 AS $v_first) {
foreach ($variables2 AS $v_second) {
@@ -738,8 +786,8 @@ class SurveyCrosstabs {
$spr1 = $this->_HEADERS[$v_first['spr']];
$spr2 = $this->_HEADERS[$v_second['spr']];
- $grid1 = $spr1['grids'][$v_first['grd']];
- $grid2 = $spr2['grids'][$v_second['grd']];
+ $grid1 = isset($spr1['grids'][$v_first['grd']])?$spr1['grids'][$v_first['grd']]:array();
+ $grid2 = isset($spr2['grids'][$v_second['grd']])?$spr2['grids'][$v_second['grd']]:array();
#število vratic in število kolon
$cols = count($crosstabs['options1']);
@@ -755,19 +803,22 @@ class SurveyCrosstabs {
$numColumnPercent = $this->crossChk1 + $this->crossChk2 + $this->crossChk3;
$numColumnResidual = $this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR;
$tblColumn = max($numColumnPercent,$numColumnResidual);
- } else if ($this->crossChk1 || $this->crossChk2 || $this->crossChk3) {
+ }
+ else if ($this->crossChk1 || $this->crossChk2 || $this->crossChk3) {
# imamo samo procente
$rowSpan = 2;
$numColumnPercent = $this->crossChk1 + $this->crossChk2 + $this->crossChk3;
$numColumnResidual = 1;
$tblColumn = $numColumnPercent;
- } else if ($this->crossChkEC || $this->crossChkRE || $this->crossChkSR || $this->crossChkAR) {
+ }
+ else if ($this->crossChkEC || $this->crossChkRE || $this->crossChkSR || $this->crossChkAR) {
# imamo samo residuale
$rowSpan = 2;
$numColumnPercent = 1;
$numColumnResidual = $this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR;
$tblColumn = $numColumnResidual;
- } else {
+ }
+ else {
#prikazujemo samo podatke
$rowSpan = 1;
$numColumnPercent = 1;
@@ -782,20 +833,24 @@ class SurveyCrosstabs {
foreach ($spr1['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_first['seq']) {
- $sub_q1 = '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q1 = '<span class="anl_variabla">';
$sub_q1 .= '<a href="/" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $v_first['spr'] . '\'); return false;">';
$sub_q1 .= strip_tags($spr1['naslov']);
+
if ($show_variables_values == true ) {
- $sub_q1 .= '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q1 .= '<span class="anl_variabla">';
$sub_q1 .= '&nbsp;('.strip_tags($spr1['variable']).')';
$sub_q1 .= '</span>';
}
+
if ($spr1['tip'] == '16') {
$sub_q1 .= '<br/>' . strip_tags($grid1['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($grid1['variable']) . ')' : '');
- } else {
- $sub_q1 .= '<br/>' . strip_tags($variable['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($variable['variable']) . ')' : '');
+ }
+ else {
+ if(strip_tags($variable['naslov']) != $lang['srv_new_text'] && strip_tags($variable['naslov']) != $lang['srv_new_vprasanje'])
+ $sub_q1 .= '<br/>' . strip_tags($variable['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($variable['variable']) . ')' : '');
}
$sub_q1 .= '</a>';
$sub_q1 .= '</span>' . NEW_LINE;
@@ -804,7 +859,7 @@ class SurveyCrosstabs {
}
}
if ($sub_q1 == null) {
- $sub_q1 = '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q1 = '<span class="anl_variabla">';
$sub_q1 .= '<a href="/" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $v_first['spr'] . '\'); return false;">';
$sub_q1 .= strip_tags($spr1['naslov']);
$sub_q1 .= ($show_variables_values == true ? '&nbsp;('.strip_tags($spr1['variable']).')' : '');
@@ -815,11 +870,11 @@ class SurveyCrosstabs {
foreach ($spr2['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_second['seq']) {
- $sub_q2 = '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q2 = '<span class="anl_variabla">';
$sub_q2 .= '<a href="/" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopupiza(\'' . $v_second['spr'] . '\'); return false;">';
$sub_q2 .= strip_tags($spr2['naslov']);
if ($show_variables_values == true) {
- $sub_q2 .= '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q2 .= '<span class="anl_variabla">';
$sub_q2 .= '&nbsp;('.strip_tags($spr2['variable']).')';
@@ -827,8 +882,10 @@ class SurveyCrosstabs {
}
if ($spr2['tip'] == '16') {
$sub_q2.= '<br/>' . strip_tags($grid2['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($grid2['variable']) . ')' : '');
- } else {
- $sub_q2.= '<br/>' . strip_tags($variable['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($variable['variable']) . ')' : '');
+ }
+ else {
+ if(strip_tags($variable['naslov']) != $lang['srv_new_text'] && strip_tags($variable['naslov']) != $lang['srv_new_vprasanje'])
+ $sub_q2.= '<br/>' . strip_tags($variable['naslov']) . ($show_variables_values == true ? '&nbsp;(' . strip_tags($variable['variable']) . ')' : '');
}
$sub_q2 .= '</a>';
$sub_q2 .= '</span>' . NEW_LINE;
@@ -837,123 +894,119 @@ class SurveyCrosstabs {
}
}
if ($sub_q2 == null) {
- $sub_q2 = '<span class="anl_variabla'.$sccFloat.'">';
+ $sub_q2 = '<span class="anl_variabla">';
$sub_q2 .= '<a href="/" title="' . $lang['srv_predogled_spremenljivka'] . '" onclick="showspremenljivkaSingleVarPopup(\'' . $v_second['spr'] . '\'); return false;">';
$sub_q2 .= strip_tags($spr2['naslov']);
$sub_q2 .= ($show_variables_values == true ? '&nbsp;('.strip_tags($spr2['variable']).')' : '');
$sub_q2 .= '</a>';
$sub_q2 .= '</span>' . NEW_LINE;
}
+
+
# izrišemo tabelo
- # najprej izrišemo naslovne vrstice
- #echo '<table class="anl_tbl_crosstab fullWidth fullHeight">';
- echo $_br.'<br/>';
-# $_br = '<br/>';
-# echo '<div class="floatLeft">'.$sub_q1. '</div><div class="floatLeft spaceLeft spaceRight"> ==&gt; </div><div class="floatLeft">'. $sub_q2.'</div><br class="clr" />';
+ echo '<div class="table_holder">';
+
+ // Zgornja vrstca
+ echo '<div class="top_line">';
+
+ // hi2
+ echo '<div class="hi2">';
+ if ($this->displayHi2 == true) {
+ echo '&#x3A7;<sup>2</sup> = ';
+ echo $this->formatNumber($crosstabs['hi2'], 3, '');
+ }
+ echo '</div>';
+
+ // Zvezdica za vkljucitev v porocilo
+ $spr2 = $v_first['seq'].'-'.$v_first['spr'].'-'.$v_first['grd'];
+ $spr1 = $v_second['seq'].'-'.$v_second['spr'].'-'.$v_second['grd'];
+
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=5, $sub_type=0, $spr1, $spr2);
+
+ echo '</div>';
+
+
+ # najprej izrišemo naslovne vrstice
#Zadnja kolona: Če imamo vodoravno checkboxe in gledamo enote, potem kolono s summo malo razmaknemo
if ( $crosstabs['isCheckbox']['spr1'] == true && $this->crossNavVsEno == true) {
$addVerticalSpace = 1;
- } else {
+ }
+ else {
$addVerticalSpace = 0;
}
-
- # hi2
- if ($this->displayHi2 == true) {
- echo '&#x3A7;<sup>2</sup> = ';
- echo $this->formatNumber($crosstabs['hi2'], 3, '');
- }
- echo '<table class="anl_tbl_crosstab" style="padding:0px; margin:0px; margin-top:10px;"'
- . ' sq1="'.$v_first['seq'].'" sp1="'.$v_first['spr'].'" gd1="'.$v_first['grd'].'" sq2="'.$v_second['seq'].'" sp2="'.$v_second['spr'].'" gd2="'.$v_second['grd'].'" >';
+ echo '<div class="table_crosstab_div">';
+ echo '<table class="table_crosstab" sq1="'.$v_first['seq'].'" sp1="'.$v_first['spr'].'" gd1="'.$v_first['grd'].'" sq2="'.$v_second['seq'].'" sp2="'.$v_second['spr'].'" gd2="'.$v_second['grd'].'">';
- if ($this->fromBreak == false) {
- echo '<colgroup>';
- #echo '<col style="width:auto; min-width:150px;" />';
- echo '<col style="width:auto; min-width:100px;" />';
- if (count($crosstabs['options1']) > 0 ) {
- $_width_percent = round(100 / count($crosstabs['options1'],2));
- foreach ($crosstabs['options1'] as $ckey1 =>$crossVariabla) {
- echo '<col style="width:'.$_width_percent.'%;" />';
- }
- }
- if ($addVerticalSpace == 1) {
- echo '<col style="width:10px;" />';
- }
- echo '<col style="width:auto;" />';
- echo '</colgroup>';
- }
- echo '<tr>';
- echo '<td class="anl_bt anl_bl anl_ac rsdl_bck_title ctbCll" rowspan="2" >';
- #if ($cntY == 1) {
- # ime variable
- #echo '<td rowspan="' . $rows . '">';
+ echo '<tr class="row1">';
+
+ echo '<td class="cell_var" rowspan="2">';
echo $sub_q2;
- #echo '</td>';
- #}
echo '</td>';
- echo '<td class="anl_bt anl_bl anl_ac rsdl_bck_title ctbCll" colspan="' . $cols . '" >';
+
+ echo '<td class="cell_question" colspan="'.($cols+1).'">';
echo $sub_q1;
echo '</td>';
- echo '<td class="anl_bl">&nbsp;</td>';
if ($this->fromBreak == true && $this->showAverage == true) {
# če smo v break-u dodamo še povprečja
- echo '<td class="">&nbsp;</td>';
+ echo '<td class="cell_space">&nbsp;</td>';
}
+
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row3">';
+
$col_cnt=0;
if (count($crosstabs['options1']) > 0 ) {
foreach ($crosstabs['options1'] as $ckey1 =>$crossVariabla) {
$col_cnt++;
+
#ime variable
- //$css_backX = 'rsdl_bck_variable'.($col_cnt & 1);
- $css_backX = ' rsdl_bck_variable1';
- echo '<td class="anl_bt anl_bl anl_ac'.$css_backX.' ctbCll" >';
+ echo '<td class="cell_grid">';
+
echo $crossVariabla['naslov'];
+
# če ni tekstovni odgovor dodamo key
if ($crossVariabla['type'] != 't' && $show_variables_values == true) {
- if ($crossVariabla['vr_id'] == null ) {
+ if (!isset($crossVariabla['vr_id'])||$crossVariabla['vr_id'] == null ) {
echo '<br/> ( '.$ckey1.' )';
- } else {
+ }
+ else {
echo '<br/> ( '.$crossVariabla['vr_id'].' )';
}
}
+
echo '</td>';
}
}
$col_cnt++;
- //$css_backX = 'rsdl_bck_variable'.($col_cnt & 1);
- if ($addVerticalSpace == 1) {
- echo '<td class="anl_bl">&nbsp;</td>';
- }
- $css_backX = ' rsdl_bck_variable1';
-
- echo '<td class="anl_bl anl_bt anl_br anl_ac red anl_ita anl_bck_text_0'.$css_backX.' ctbCll">' . $lang['srv_analiza_crosstab_skupaj'] . '</td>';
+
+ echo '<td class="cell_value">' . $lang['srv_analiza_crosstab_skupaj'] . '</td>';
if ($this->fromBreak == true && $this->showAverage == true) {
# če smo v break-u dodamo še povprečja
- echo '<td class="anl_bl anl_bt anl_br anl_ac anl_ita anl_bck_text_0'.$css_backX.' ctbCll">' . $lang['srv_analiza_crosstab_average'] . '</td>';
+ echo '<td class="cell_value">' . $lang['srv_analiza_crosstab_average'] . '</td>';
}
+
echo '</tr>';
+
$cntY = 0;
if (count($crosstabs['options2']) > 0) {
foreach ($crosstabs['options2'] as $ckey2 =>$crossVariabla2) {
$cntY++;
- echo '<tr>';
-
-
- //$css_backY = 'rsdl_bck_variable'.($cntY & 1);
- $css_backY = ' rsdl_bck_variable1';
+
+ echo '<tr class="row_var">';
- echo '<td class="anl_bt anl_bl anl_ac'.$css_backY.' ctbCll">';
+ echo '<td class="cell_var">';
echo $crossVariabla2['naslov'];
# če ni tekstovni odgovor dodamo key
if ($crossVariabla2['type'] !== 't' && $show_variables_values == true ) {
- if ($crossVariabla2['vr_id'] == null) {
+ if (!isset($crossVariabla2['vr_id']) || $crossVariabla2['vr_id'] == null) {
echo '<br/> ( '.$ckey2.' )';
} else {
echo '<br/> ( '.$crossVariabla2['vr_id'].' )';
@@ -963,150 +1016,147 @@ class SurveyCrosstabs {
echo '</td>';
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
- echo '<td class="ct_in_cell'.($this->enableInspect && ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? ' ct_inspect' : '').'" k1="'.$ckey1.'" k2="'.$ckey2.'" n1="'.$crossVariabla1['naslov'].'" n2="'.$crossVariabla2['naslov'].'" v1="'.$crossVariabla1['vr_id'].'" v2="'.$crossVariabla2['vr_id'].'">';
- # celica z vebino
- {
- # prikazujemo eno ali več od: frekvenc, odstotkov, residualov
- echo '<table class="ct_in_tbl">';
- if ($this->crossChk0) {
- # izpišemo frekvence crostabov
- echo '<tr>';
- echo '<td class="anl_ac '.($crosstabs['color'][$ckey1][$ckey2]).' ctbCll">';
- echo ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
- # .$crossTab[$crossVariabla1[cell_id]][$ckey2]
- #
-
- echo '</td>';
- echo '</tr>';
- }
-
- if ($this->crossChk1 || $this->crossChk2 || $this->crossChk3) {
- # sirina celice v %
- if ( ($this->crossChk1 + $this->crossChk2 + $this->crossChk3) == 3 )
- $css_width = ' ctb_w33p';
- elseif (($this->crossChk1 + $this->crossChk2 + $this->crossChk3) == 2 )
- $css_width = ' ctb_w50p';
- else
- $css_width = '';
- $css_bt = ( $this->crossChk0 ) ? 'anl_dash_bt' : '';
- # izpisemo procente
- echo '<tr>';
- echo '<td class="'.$css_bt.'">';
-
- echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
- echo '<tr>';
- $col=0;
-
- if ($this->crossChk1) {
- #procent vrstica
- $col++;
-
- $css_color = ($this->doColor == 'true') ? 'ctbChck_sp1' : 'ctbChck_sp0';
- $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
- echo $this->formatNumber($this->getCrossTabPercentage($crosstabs['sumaVrstica'][$ckey2], $crosstabs_value[$ckey1][$ckey2]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- echo '</td>';
- }
- if ($this->crossChk2) {
- #procent stolpec
- $col++;
- $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'ctbChck_sp2' : 'ctbChck_sp0';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
-
- echo $this->formatNumber($this->getCrossTabPercentage($crosstabs['sumaStolpec'][$ckey1], $crosstabs_value[$ckey1][$ckey2]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- echo '</td>';
- }
- if ($this->crossChk3) {
- #procent skupni
- $col++;
- $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'ctbChck_sp3' : 'ctbChck_sp0';
- echo '<td'.$css_br.$css_width.' class="'.$css_color.$css_br.' ctbCll">';
-
- echo $this->formatNumber($this->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs_value[$ckey1][$ckey2]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- echo '</td>';
- }
- echo '</tr>';
- echo '</table>';
+
+ # celica z vebino
+ echo '<td class="cell_noPadding '.($this->enableInspect && ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? ' ct_inspect' : '').'" k1="'.$ckey1.'" k2="'.$ckey2.'" n1="'.$crossVariabla1['naslov'].'" n2="'.$crossVariabla2['naslov'].'" v1="'.(isset($crossVariabla1['vr_id'])?$crossVariabla1['vr_id']:'').'" v2="'.(isset($crossVariabla2['vr_id'])?$crossVariabla2['vr_id']:'').'">';
+
+ # prikazujemo eno ali več od: frekvenc, odstotkov, residualov
+ echo '<table class="cell_table">';
+
+ if ($this->crossChk0) {
+ # izpišemo frekvence crostabov
+ echo '<tr>';
+
+ echo '<td class="cell_value '.(isset($crosstabs['color'][$ckey1][$ckey2])?$crosstabs['color'][$ckey1][$ckey2]:'').'">';
+ echo (isset($crosstabs_value[$ckey1][$ckey2])&&(int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ echo '</td>';
+
+ echo '</tr>';
+ }
+
+ if ($this->crossChk1 || $this->crossChk2 || $this->crossChk3) {
+ # sirina celice v %
+ if ( ($this->crossChk1 + $this->crossChk2 + $this->crossChk3) == 3 )
+ $css_width = ' ctb_w33p';
+ elseif (($this->crossChk1 + $this->crossChk2 + $this->crossChk3) == 2 )
+ $css_width = ' ctb_w50p';
+ else
+ $css_width = '';
+ $css_bt = ( $this->crossChk0 ) ? 'anl_dash_bt' : '';
+ # izpisemo procente
+ echo '<tr>';
+ echo '<td class="cell_noPadding '.$css_bt.'">';
+
+ echo '<table class="cell_table">';
+ echo '<tr>';
+ $col=0;
+
+ if ($this->crossChk1) {
+ #procent vrstica
+ $col++;
+
+ $css_color = ($this->doColor == 'true') ? 'ctbChck_sp1' : 'ctbChck_sp0';
+ $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
+ echo '<td class="cell_value '.$css_color.$css_br.$css_width.' ctbCll">';
+ echo $this->formatNumber($this->getCrossTabPercentage((isset($crosstabs['sumaVrstica'][$ckey2])?$crosstabs['sumaVrstica'][$ckey2]:0), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:0)), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '</td>';
+ }
+ if ($this->crossChk2) {
+ #procent stolpec
+ $col++;
+ $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'ctbChck_sp2' : 'ctbChck_sp0';
+ echo '<td class=" cell_value'.$css_color.$css_br.$css_width.' ctbCll">';
+
+ echo $this->formatNumber($this->getCrossTabPercentage((isset($crosstabs['sumaStolpec'][$ckey1])?$crosstabs['sumaStolpec'][$ckey1]:0), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:0)), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '</td>';
+ }
+ if ($this->crossChk3) {
+ #procent skupni
+ $col++;
+ $css_br = $numColumnPercent > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'ctbChck_sp3' : 'ctbChck_sp0';
+ echo '<td'.$css_br.$css_width.' class="cell_value '.$css_color.$css_br.' ctbCll">';
+
+ echo $this->formatNumber($this->getCrossTabPercentage((isset($crosstabs['sumaSkupna'])?$crosstabs['sumaSkupna']:0), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:0)), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '</td>';
+ }
+ echo '</tr>';
+ echo '</table>';
+
+ echo '</td>';
+ echo '</tr>';
+ }
+ # izpisemo residuale
+ if ($this->crossChkEC || $this->crossChkRE || $this->crossChkSR || $this->crossChkAR) {
+ # sirina celice v %
+ if ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 4 )
+ $css_width = ' ctb_w25p';
+ elseif ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 3 )
+ $css_width = ' ctb_w33p';
+ elseif ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 2 )
+ $css_width = ' ctb_w50p';
+ else
+ $css_width = '';
+ $css_bt = ( $this->crossChk0 || ($this->crossChk1 && $this->crossChk2 && $this->crossChk3)) ? 'anl_dash_bt' : '';
+ echo '<tr>';
+
+ echo '<td class="cell_noPadding '.$css_bt.'">';
+ echo '<table class="cell_table">';
+ echo '<tr>';
+ $col=0;
+
+ if ($this->crossChkEC) {
+ $col++;
+ $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'crossCheck_EC' : 'ctbChck_sp0';
+ echo '<td class="cell_value '.$css_color.$css_br.$css_width.' ctbCll">';
+ echo $this->formatNumber((isset($crosstabs['exC'][$ckey1][$ckey2])?$crosstabs['exC'][$ckey1][$ckey2]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
+ echo '</td>';
+ }
+ if ($this->crossChkRE) {
+ $col++;
+ $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'crossCheck_RE' : 'ctbChck_sp0';
+ echo '<td class="cell_value '.$css_color.$css_br.$css_width.' ctbCll">';
+ echo $this->formatNumber((isset($crosstabs['res'][$ckey1][$ckey2])?$crosstabs['res'][$ckey1][$ckey2]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
+ echo '</td>';
+ }
+ if ($this->crossChkSR) {
+ $col++;
+ $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'crossCheck_SR' : 'ctbChck_sp0';
+ echo '<td class="cell_value '.$css_color.$css_br.$css_width.' ctbCll">';
+ echo $this->formatNumber((isset($crosstabs['stR'][$ckey1][$ckey2])?$crosstabs['stR'][$ckey1][$ckey2]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
+ echo '</td>';
+ }
+ if ($this->crossChkAR) {
+ $col++;
+ $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
+ $css_color = ($this->doColor == 'true') ? 'crossCheck_AR' : 'ctbChck_sp0';
+ echo '<td class="cell_value '.$css_color.$css_br.$css_width.' ctbCll">';
+ echo $this->formatNumber((isset($crosstabs['adR'][$ckey1][$ckey2])?$crosstabs['adR'][$ckey1][$ckey2]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
+ echo '</td>';
+ }
+ echo '</tr>';
+ echo '</table>';
+ echo '</td>';
+ echo '</tr>';
+ }
+ echo '</table>';
- echo '</td>';
- echo '</tr>';
- }
- # izpisemo residuale
- if ($this->crossChkEC || $this->crossChkRE || $this->crossChkSR || $this->crossChkAR) {
- # sirina celice v %
- if ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 4 )
- $css_width = ' ctb_w25p';
- elseif ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 3 )
- $css_width = ' ctb_w33p';
- elseif ( ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR) == 2 )
- $css_width = ' ctb_w50p';
- else
- $css_width = '';
- $css_bt = ( $this->crossChk0 || ($this->crossChk1 && $this->crossChk2 && $this->crossChk3)) ? 'anl_dash_bt' : '';
- echo '<tr>';
-
- echo '<td class="'.$css_bt.'" style="padding:0px 0px;">';
- echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
- echo '<tr>';
- $col=0;
-
- if ($this->crossChkEC) {
- $col++;
- $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'crossCheck_EC' : 'ctbChck_sp0';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
- echo $this->formatNumber($crosstabs['exC'][$ckey1][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
- echo '</td>';
- }
- if ($this->crossChkRE) {
- $col++;
- $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'crossCheck_RE' : 'ctbChck_sp0';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
- echo $this->formatNumber($crosstabs['res'][$ckey1][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
- echo '</td>';
- }
- if ($this->crossChkSR) {
- $col++;
- $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'crossCheck_SR' : 'ctbChck_sp0';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
- echo $this->formatNumber($crosstabs['stR'][$ckey1][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
- echo '</td>';
- }
- if ($this->crossChkAR) {
- $col++;
- $css_br = $numColumnResidual > $col ? ' anl_dash_br' : '';
- $css_color = ($this->doColor == 'true') ? 'crossCheck_AR' : 'ctbChck_sp0';
- echo '<td class="'.$css_color.$css_br.$css_width.' ctbCll">';
- echo $this->formatNumber($crosstabs['adR'][$ckey1][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'), '');
- echo '</td>';
- }
- echo '</tr>';
- echo '</table>';
- echo '</td>';
- echo '</tr>';
- }
- echo '</table>';
- }
# konec celice z vsebino
echo '</td>';
}
- # če mamo checkboxe in sumo malo razmaknemo
- if ($addVerticalSpace == 1) {
- echo '<td class="anl_bl">&nbsp;</td>';
- }
// vedno rišemo zadnji stolpec.
- echo '<td class="anl_ac anl_bl anl_bt anl_br rsdl_bck0 anl_bb" >';
- echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
+ echo '<td class="cell_noPadding">';
+ echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
- echo '<td class="anl_ac ctbCll crostabSuma" colspan="' . ( $this->crossChk1 + $this->crossChk2 + $this->crossChk3 ).'">';
+ echo '<td class="cell_value ctbCll crostabSuma" colspan="' . ( $this->crossChk1 + $this->crossChk2 + $this->crossChk3 ).'">';
# suma po vrsticah
- echo (int)$crosstabs['sumaVrstica'][$ckey2];
+ echo (isset($crosstabs['sumaVrstica'][$ckey2])?(int)$crosstabs['sumaVrstica'][$ckey2]:0);
echo '</td>';
echo '</tr>';
}
@@ -1123,21 +1173,21 @@ class SurveyCrosstabs {
echo '<tr>';
if ($this->crossChk1) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp1' : 'ctbChck_sp0';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.$css_width.'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.$css_width.'">';
echo $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk2) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp2' : 'ctbChck_sp0';
$css_border = ($this->crossChk1 ? ' anl_dash_bl ' : '');
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.$css_border.$css_width.'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.$css_border.$css_width.'">';
echo $this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk3) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp3' : 'ctbChck_sp0';
$css_border = ($this->crossChk1 || $this->crossChk2 ? ' anl_dash_bl ' : '');
- echo '<td class="anl_ac'.$css_color.$css_bt.$css_border.$css_width.' ctbCll">';
+ echo '<td class="cell_value '.$css_color.$css_bt.$css_border.$css_width.' ctbCll">';
echo $this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
@@ -1149,45 +1199,34 @@ class SurveyCrosstabs {
echo '</td>';
if ($this->fromBreak == true && $this->showAverage == true) {
# če smo v break dodamo še povprečja
- echo '<td class="anl_ac anl_bl anl_bt anl_br anl_bb rsdl_bck_variable1" >';
+ echo '<td class="cell_value">';
echo $this->formatNumber( $crosstabs['avgVrstica'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'), '');
echo '</td>';
}
echo '</tr>';
}
}
- #Zadnja vrstica. Če imamo navpično checkboxe in gledamo enote, potem vrstico z summo malo razmaknemo
- $cssBT = 'anl_bt';
- if ( $crosstabs['isCheckbox']['spr2'] == true && $this->crossNavVsEno == true) {
- echo '<tr>';
- echo '<td class="'.$cssBT.'">&nbsp;</th>';
- echo '<td class="'.$cssBT.'">&nbsp;</th>';
- echo '<td class="'.$cssBT.'" colspan="'.count($crosstabs['options1']).'">&nbsp;</th>';
- if ($addVerticalSpace == 1) {
- echo '<td class="">&nbsp;</td>';
- }
-
- echo '<td class="'.$cssBT.'">&nbsp;</th>';
- echo '</tr>';
- $cssBT = '';
- }
+
$cntY++;
+
echo '<tr>';
+
$css_backY = ' rsdl_bck_variable1';
echo '<td class="anl_bb anl_bt anl_bl anl_ac red anl_ita anl_bck_text_0'.$css_backY.' ctbCll">' . $lang['srv_analiza_crosstab_skupaj'] . '</td>';
- // skupni sestevki po stolpcih
+
+ // skupni sestevki po stolpcih
if (count($crosstabs['options1']) > 0)
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
- echo '<td class="anl_ac anl_bb anl_bt anl_bl rsdl_bck0" >';
+ echo '<td class="cell_noPadding">';
{
# prikazujemo eno od treh možnosti
- echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
+ echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
- echo '<td class="anl_ac ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
+ echo '<td class="cell_value ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
# suma po stolpcih
- echo (int)$crosstabs['sumaStolpec'][$ckey1];
+ echo isset($crosstabs['sumaStolpec'][$ckey1])?(int)$crosstabs['sumaStolpec'][$ckey1]:0;
echo '</td>';
echo '</tr>';
}
@@ -1197,21 +1236,21 @@ class SurveyCrosstabs {
echo '<tr>';
if ($this->crossChk1) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp1' : 'ctbChck_sp0';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.'">';
- echo $this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.'">';
+ echo $this->formatNumber( (isset($crosstabs['sumaStolpec'][$ckey1])&&$crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk2) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp2' : 'ctbChck_sp0';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.($this->crossChk1 ? ' anl_dash_bl' : '').'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.($this->crossChk1 ? ' anl_dash_bl' : '').'">';
echo $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk3)
{
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp3' : 'ctbChck_sp0';
- echo '<td class="anl_ac'.$css_color.$css_bt.($this->crossChk2 ? ' anl_dash_bl' : '').' ctbCll">';
- echo $this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
+ echo '<td class="cell_value '.$css_color.$css_bt.($this->crossChk2 ? ' anl_dash_bl' : '').' ctbCll">';
+ echo $this->formatNumber( (isset($crosstabs['sumaStolpec'][$ckey1])&&$crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
echo '</tr>';
@@ -1220,18 +1259,14 @@ class SurveyCrosstabs {
}
echo '</td>';
}
- # če mamo checkboxe in sumo malo razmaknemo
- if ($addVerticalSpace == 1) {
- echo '<td class="anl_bl">&nbsp;</td>';
- }
# zadnja celica z skupno sumo
- echo '<td class="anl_ac anl_bt anl_bl anl_br anl_bb rsdl_bck0">';
+ echo '<td class="cell_noPadding">';
{
- echo '<table class="anl_tbl_crosstab fullWidth fullHeight" style="padding:0px; margin:0px;">';
+ echo '<table class="cell_table">';
if ($this->crossChk0) {
echo '<tr>';
- echo '<td class="anl_ac ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
+ echo '<td class="cell_value ctbCll crostabSuma" colspan="'.($this->crossChk1 + $this->crossChk2 + $this->crossChk3).'">';
# skupna suma
echo (int)$crosstabs['sumaSkupna'];
echo '</td>';
@@ -1244,20 +1279,20 @@ class SurveyCrosstabs {
if ($this->crossChk1) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp1' : 'ctbChck_sp0';
$css_border = ($this->crossChk2 || $this->crossChk3) ? ' anl_dash_br' : '';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.$css_border.'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.$css_border.'">';
echo $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk2) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp2' : 'ctbChck_sp0';
$css_border = ($this->crossChk3) ? ' anl_dash_br' : '';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.$css_border.'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.$css_border.'">';
echo $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
if ($this->crossChk3) {
$css_color = ($this->doColor == 'true') ? ' ctbChck_sp3' : 'ctbChck_sp0';
- echo '<td class="anl_ac ctbCll'.$css_color.$css_bt.'">';
+ echo '<td class="cell_value ctbCll'.$css_color.$css_bt.'">';
echo $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
echo '</td>';
}
@@ -1282,15 +1317,11 @@ class SurveyCrosstabs {
// skupni sestevki po stolpcih
if (count($crosstabs['options1']) > 0) {
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
- echo '<td class="anl_ac anl_bb anl_bt anl_br rsdl_bck_variable1" >';
- echo $this->formatNumber( $crosstabs['avgStolpec'][$ckey1], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'), '');
+ echo '<td class="cell_value anl_bb anl_bt anl_br rsdl_bck_variable1" >';
+ echo $this->formatNumber( (isset($crosstabs['avgStolpec'][$ckey1])?$crosstabs['avgStolpec'][$ckey1]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'), '');
echo '</td>';
}
}
- # če mamo checkboxe in sumo malo razmaknemo
- if ($addVerticalSpace == 1) {
- echo '<td>&nbsp;</td>';
- }
# zadnja celica z skupno sumo
echo '<td>&nbsp;</td>';
@@ -1298,37 +1329,43 @@ class SurveyCrosstabs {
# če smo v break dodamo še povprečja
echo '<td>&nbsp;</td>';
}
+
echo '</tr>';
}
+
echo '</table>';
+ echo '</div>';
+
+
+ $this->displayExport();
+
+ // Izrisemo legendo
+ $this->displayCrosstabCheckboxes();
+
- // Zvezdica za vkljucitev v porocilo
- $spr2 = $v_first['seq'].'-'.$v_first['spr'].'-'.$v_first['grd'];
- $spr1 = $v_second['seq'].'-'.$v_second['spr'].'-'.$v_second['grd'];
-
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=5, $sub_type=0, $spr1, $spr2);
- #SurveyAnalysis::addCustomReportElement($type=5, $sub_type=0, $spr1, $spr2);
-
// Izrisemo graf za tabelo
if($this->showChart && !$this->fromBreak){
$tableChart = new SurveyTableChart($this->sid, $this, 'crosstab', $counter);
$tableChart->display();
}
+
+ echo '</div>';
$counter++;
}
}
- } else {
+ }
+ else {
# crostab variables not set
echo $lang['srv_crosstab_note0'];
- #print_r("Crosstab variables not set!");
}
}
- /**
+ /**
* @desc prikaze izvoz za PDF/RTF
*/
function displayExport () {
+
# z javascriptom prikažemo ikonce za arhiviranje, emaijlanje arhivov, pdf, rtf, excel...
if ($this->isSelectedBothVariables()) {
$data1 = '';
@@ -1348,18 +1385,20 @@ class SurveyCrosstabs {
$href_pdf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=crosstabs_izpis&anketa=' . $this->sid . '&data1='.$data1.'&data2='.$data2);
$href_rtf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=crosstabs_izpis_rtf&anketa=' . $this->sid . '&data1='.$data1.'&data2='.$data2);
$href_xls = makeEncodedIzvozUrlString('izvoz.php?b=export&m=crosstabs_izpis_xls&anketa=' . $this->sid . '&data1='.$data1.'&data2='.$data2);
- echo '<script>';
- # nastavimopravilne linke
+
+ echo '<script>';
+
+ # nastavimopravilne linke
echo '$("#secondNavigation_links a#crosstabDoPdf").attr("href", "'.$href_pdf.'");';
echo '$("#secondNavigation_links a#crosstabDoRtf").attr("href", "'.$href_rtf.'");';
echo '$("#secondNavigation_links a#crosstabDoXls").attr("href", "'.$href_xls.'");';
- # prikažemo linke
+
+ # prikažemo linke
echo '$("#hover_export_icon").removeClass("hidden");';
echo '$("#secondNavigation_links a").removeClass("hidden");';
- echo '</script>';
-
- }
-
+
+ echo '</script>';
+ }
}
/** kadar kličemo iz Break, ali pri radio grupi dodamo še povprečje po stolpcih
@@ -1393,8 +1432,8 @@ class SurveyCrosstabs {
$spr1 = $this->_HEADERS[$v_first['spr']];
$spr2 = $this->_HEADERS[$v_second['spr']];
- $grid1 = $spr1['grids'][$v_first['grd']];
- $grid2 = $spr2['grids'][$v_second['grd']];
+ $grid1 = isset($spr1['grids'][$v_first['grd']]) ? $spr1['grids'][$v_first['grd']] : array();
+ $grid2 = isset($spr2['grids'][$v_second['grd']]) ? $spr2['grids'][$v_second['grd']] : array();
$sequence1 = $v_first['seq'];
$sequence2 = $v_second['seq'];
@@ -1463,9 +1502,9 @@ class SurveyCrosstabs {
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ } */
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -1474,7 +1513,7 @@ class SurveyCrosstabs {
# polovimo obe sequenci
$tmp_file = $folder . 'tmp_crosstab_'.$this->sid.'.TMP';
$file_handler = fopen($tmp_file,"w");
- fwrite($file_handler,"<?php\n");
+ fwrite($file_handler,"<?php\n\$crosstab=array();\n");
fclose($file_handler);
if (count($sekvences1)>0)
foreach ($sekvences1 AS $sequence1) {
@@ -1512,11 +1551,14 @@ class SurveyCrosstabs {
}
if (IS_WINDOWS) {
- #$command = 'awk -F"|" "BEGIN {{OFS=\"\"} {ORS=\"\n\"}} '.$_status_filter.' { print \"$crosstab[\x27\",$'.$sequence1.',\"\x27][\x27\",$'.$sequence2.',\"\x27]++; $options1[\x27\",$'.$sequence1.',\"\x27]++; $options2[\x27\",$'.$sequence2.',\"\x27]++;\"}" '.$this->dataFileName.' >> '.$tmp_file;
$command = 'awk -F"|" "BEGIN {{OFS=\"\"} {ORS=\"\n\"}} '.$status_filter.$additional_filter.' { print \"$crosstab[\x27\",'.$_seq_1_text.',\"\x27][\x27\",'.$_seq_2_text.',\"\x27]++;\"}" '.$this->dataFileName.' >> '.$tmp_file;
} else {
- #$command = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} '.$_status_filter.' { print "$crosstab[\x27",$'.$sequence1.',"\x27][\x27",$'.$sequence2.',"\x27]++; $options1[\x27",$'.$sequence1.',"\x27]++; $options2[\x27",$'.$sequence2.',"\x27]++;"}\' '.$this->dataFileName.' >> '.$tmp_file;
$command = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} '.$status_filter.$additional_filter.' { print "$crosstab[\x27",'.$_seq_1_text.',"\x27][\x27",'.$_seq_2_text.',"\x27]++;"}\' '.$this->dataFileName.' >> '.$tmp_file;
+
+ //$command = 'awk -F"|" \'BEGIN {{OFS=""} {ORS="\n"}} '.$status_filter.$additional_filter.' { print "if( array_key_exists('.$_seq_1_text.', $crosstab) ){ $crosstab[\x27",'.$_seq_1_text.',"\x27][\x27",'.$_seq_2_text.',"\x27]++;"}}\' '.$this->dataFileName.' >> '.$tmp_file;
+ //$command = 'awk -F"|" \'BEGIN {OFS=""; ORS="\n"} ' . $status_filter . $additional_filter . ' { print "if( !isset(crosstab) ){ $crosstab[\x27",' . $_seq_1_text . ',"\x27][\x27",' . $_seq_2_text . ',"\x27]++;"} }\' ' . $this->dataFileName . ' >> ' . $tmp_file;
+ //echo $command;
+
}
$out = shell_exec($command);
@@ -1532,23 +1574,25 @@ class SurveyCrosstabs {
unlink($tmp_file);
}
+ //print_r($crosstab);
+
#ker z awk ne gre nardit tolower zaradi šumnikov, nardimo ročno v loopu
$caseInsensitiveCrosstab = array();
- if (count($crosstab) > 0) {
+ if (is_countable($crosstab) && count($crosstab) > 0) {
foreach ($crosstab as $fkey => $fvalue) {
$fkey = mb_strtolower($fkey,'UTF-8');
if (count($fvalue) > 0) {
foreach ($fvalue as $skey => $svalue) {
$skey = mb_strtolower($skey,'UTF-8');
- $caseInsensitiveCrosstab[$fkey][$skey] += $svalue;
+ $caseInsensitiveCrosstab[$fkey][$skey] = (isset($caseInsensitiveCrosstab[$fkey][$skey])? $caseInsensitiveCrosstab[$fkey][$skey] += $svalue : $svalue);
}
}
}
}
$crosstab = $caseInsensitiveCrosstab;
# poiščemo pripadajočo spremenljivko
- $var_options1 = $this->_HEADERS[$v_first['spr']]['options'];
- $var_options2 = $this->_HEADERS[$v_second['spr']]['options'];
+ $var_options1 = isset($this->_HEADERS[$v_first['spr']]['options'])?$this->_HEADERS[$v_first['spr']]['options']:array();
+ $var_options2 = isset($this->_HEADERS[$v_second['spr']]['options'])?$this->_HEADERS[$v_second['spr']]['options']:array();
# inicializacija
$_all_options1 = array();
@@ -1560,12 +1604,12 @@ class SurveyCrosstabs {
# najprej poiščemo (združimo) vse opcije ki so definirane kot opcije spremenljivke in vse ki so v crosstabih
if (count($var_options1) > 0 && $spr_1_checkbox !== true ) {
foreach ($var_options1 as $okey => $opt) {
- $_all_options1[$okey] = array('naslov'=>$opt, 'cnt'=>$options1[$okey], 'type'=>'o');
+ $_all_options1[$okey] = array('naslov'=>$opt, 'cnt'=>/* $options1[$okey] */0, 'type'=>'o');
}
}
if (count($var_options2) > 0 && $spr_2_checkbox !== true) {
foreach ($var_options2 as $okey => $opt) {
- $_all_options2[$okey] = array('naslov'=>$opt, 'cnt'=>$options2[$okey], 'type'=>'o');
+ $_all_options2[$okey] = array('naslov'=>$opt, 'cnt'=>/* $options2[$okey] */0, 'type'=>'o');
}
}
# za checkboxe dodamo posebej vse opcije
@@ -1598,18 +1642,19 @@ class SurveyCrosstabs {
foreach ($crosstab AS $_kvar1=>$_var1) {
# missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red
if (!isset($_allMissing_answers[$_kvar1]) && !isset($_all_options1[$_kvar1])) {
- $_all_options1[$_kvar1] = array('naslov'=>$_kvar1, 'cnt'=>($_all_options1[$_kvar1]['cnt']+1), 'type'=>'t');
+ $_all_options1[$_kvar1] = array('naslov'=>$_kvar1, 'cnt'=>(isset($_all_options1[$_kvar1]['cnt'])?$_all_options1[$_kvar1]['cnt']+1:1), 'type'=>'t');
}
foreach ($_var1 AS $_kvar2=>$_var2) {
if (!isset($_allMissing_answers[$_kvar1]) || (isset($_allMissing_answers[$_kvar1]) && isset($_pageMissing_answers[$_kvar1]))) {
- $sumaStolpec[$_kvar1] += $_var2;
+ $sumaStolpec[$_kvar1] = (isset($sumaStolpec[$_kvar1]) ? $sumaStolpec[$_kvar1] += $_var2 : $_var2);
}
if (!isset($_allMissing_answers[$_kvar2]) || (isset($_allMissing_answers[$_kvar2]) && isset($_pageMissing_answers[$_kvar2]))) {
- $sumaVrstica[$_kvar2] += $_var2;
+ $sumaVrstica[$_kvar2] = (isset($sumaVrstica[$_kvar2]) ? $sumaVrstica[$_kvar2] += $_var2 : $_var2);
}
# missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red
- if (!isset($_allMissing_answers[$_kvar2]) && !isset($_all_options2[$_kvar2])) {
+ //if (!isset($_allMissing_answers[$_kvar2]) && !isset($_all_options2[$_kvar2])) {
+ if (array_key_exists($_kvar2, $_allMissing_answers) && array_key_exists($_kvar2, $_all_options2)) {
$_all_options2[$_kvar2] = array('naslov'=>$_kvar2, 'cnt'=>($_all_options1[$_kvar2]['cnt']+1), 'type'=>'t');
}
@@ -1633,10 +1678,10 @@ class SurveyCrosstabs {
foreach ($_allMissing_answers AS $miskey => $_missing) {
if (!isset($_pageMissing_answers[$miskey])) {
if ( $spr_1_checkbox !== true) {
- $_all_options1[$miskey] = array('naslov'=>$_missing, 'cnt'=>(int)$options1[$miskey], 'type'=>'m');
+ $_all_options1[$miskey] = array('naslov'=>$_missing, 'cnt'=>/* (int)$options1[$miskey] */null, 'type'=>'m');
}
if ( $spr_2_checkbox !== true ) {
- $_all_options2[$miskey] = array('naslov'=>$_missing, 'cnt'=>(int)$options2[$miskey], 'type'=>'m');
+ $_all_options2[$miskey] = array('naslov'=>$_missing, 'cnt'=>/* (int)$options2[$miskey] */null, 'type'=>'m');
}
}
}
@@ -1784,22 +1829,24 @@ class SurveyCrosstabs {
# gremo skozi vsako celico
if ($cnt1 > 0 && $cnt2) {
foreach ($_all_options1 as $ckey1 => $crossVariabla1) {
- if($sumaStolpec[$ckey1]!=null) {
+ if(isset($sumaStolpec[$ckey1])&&$sumaStolpec[$ckey1]!=null) {
foreach ($_all_options2 as $ckey2 => $crossVariabla2) {
- if($sumaVrstica[$ckey2]!=null) {
+ if(isset($sumaVrstica[$ckey2]) && $sumaVrstica[$ckey2]!=null) {
# skupna suma
$_w = $sumaSkupna;
#frekvenca celice
- $_fij = $crosstab[$ckey1][$ckey2];
+ $_fij = isset($crosstab[$ckey1][$ckey2]) ? $crosstab[$ckey1][$ckey2] : 0;
#suma vrstice
$_ri = $sumaVrstica[$ckey2];
#suma stolpca
$_cj = $sumaStolpec[$ckey1];
# povprečje vrstice
+ if(!isset($sum_avgi[$ckey2])) $sum_avgi[$ckey2] = 0;
$sum_avgi[$ckey2] += ((int)$_ri != 0) ? ((int)$_fij * (int)$ckey1 / (int)$_ri) : 0;
# povprečje stolpcev
+ if(!isset($sum_avgj[$ckey1])) $sum_avgj[$ckey1] = 0;
$sum_avgj[$ckey1] += ((int)$_cj != 0) ? ((int)$_fij * (int)$ckey2 / (int)$_cj) : 0;
# exC - expected count (pricakovana vrednost
@@ -1850,8 +1897,8 @@ class SurveyCrosstabs {
if ($cnt1 > 0 && $cnt2)
foreach ($_all_options1 as $ckey1 => $crossVariabla1) {
foreach ($_all_options2 as $ckey2 => $crossVariabla2) {
- $fr = (float)$crosstab[$ckey1][$ckey2];
- $exp = (float)$exC[$ckey1][$ckey2];
+ $fr = isset($crosstab[$ckey1][$ckey2])?(float)$crosstab[$ckey1][$ckey2]:0;
+ $exp = isset($exC[$ckey1][$ckey2])?(float)$exC[$ckey1][$ckey2]:0;
if ($exp != 0) {
$hi2 += pow(($fr - $exp),2) / $exp;
}
@@ -1883,7 +1930,6 @@ class SurveyCrosstabs {
}
-
/** Sestavi array nepravilnih odgovorov
*
*/
@@ -2105,7 +2151,7 @@ class SurveyCrosstabs {
}
# če smo radio enableInspect
- if ($sdsp['enableInspect'] == '1' || (isset($_SESSION['enableInspect']) && $_SESSION['enableInspect'] == true)) {
+ if (isset($sdsp['enableInspect']) && $sdsp['enableInspect'] == '1' || (isset($_SESSION['enableInspect']) && $_SESSION['enableInspect'] == true)) {
$this->enableInspect = true;
} else {
# če ne preberemo iz profila
@@ -2561,8 +2607,10 @@ class SurveyCrosstabs {
$this->displaySessionInspectCheckbox();
}
+
function displaySessionInspectCheckbox() {
global $lang;
+
echo '<input type="checkbox" id="session_inspect" '.($this->enableInspect == true ? ' checked="checekd"' : '').' onClick="changeSessionInspect();">'.$lang['srv_inspect_setting'];
echo Help :: display('srv_crosstab_inspect');
}
@@ -2571,10 +2619,15 @@ class SurveyCrosstabs {
function displayLinePercent() {
global $lang;
- echo '<input id="crossCheck1" name="crossCheck1" onchange="change_crosstab_percent();" type="checkbox" ' . ($this->crossChk1 == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo '<label for="crossCheck1" id="spn_residual_sp1" class="ctbChck_sp1">' . $lang['srv_analiza_crosstab_odstotek_vrstice_short'].'</label>';
- echo '<input id="crossDoColor" name="crossDoColor" onchange="change_crosstab_color();" type="checkbox" ' . ($this->doColor == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo '<label for="crossDoColor" id="spn_residual_sp1" class="ctbChck_sp1">' . $lang['srv_analiza_crosstab_color'].'</label>';
+ echo '<div class="setting_line">';
+ echo ' <input id="crossCheck1" name="crossCheck1" onchange="change_crosstab_percent();" type="checkbox" ' . ($this->crossChk1 == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossCheck1" id="spn_residual_sp1">' . $lang['srv_analiza_crosstab_odstotek_vrstice_short'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <input id="crossDoColor" name="crossDoColor" onchange="change_crosstab_color();" type="checkbox" ' . ($this->doColor == true ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossDoColor" id="spn_residual_sp1">' . $lang['srv_analiza_crosstab_color'].'</label>';
+ echo '</div>';
}
function displayResidual(){
@@ -2582,15 +2635,19 @@ class SurveyCrosstabs {
$selected = ($this->crossChkEC + $this->crossChkRE + $this->crossChkSR + $this->crossChkAR == 4) ? true : false;
- echo '<input id="crossResiduals" name="crossResiduals" onchange="saveResidualProfileSetting(\''.SurveyDataSettingProfiles::getCurentProfileId().'\', this.checked); return false;" type="checkbox" ' . ($selected ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
- echo '<label for="crossResiduals" id="crossResiduals" class="show_residual">' . $lang['srv_analiza_crosstab_residuals'].'</label>';
+ echo '<div class="setting_line">';
+ echo ' <input id="crossResiduals" name="crossResiduals" onchange="saveResidualProfileSetting(\''.SurveyDataSettingProfiles::getCurentProfileId().'\', this.checked); return false;" type="checkbox" ' . ($selected ? ' checked="checked" ' : '') . ' autocomplete="off"/>';
+ echo ' <label for="crossResiduals" id="crossResiduals">' . $lang['srv_analiza_crosstab_residuals'].'</label>';
+ echo '</div>';
}
function displayShowChart() {
global $lang;
- echo '<input id="showChart" name="showChart" onchange="showTableChart(\'crosstab\');" type="checkbox" ' . ($this->showChart == true ? ' checked="checked" ' : '') . ' />';
- echo '<label for="showChart" id="showChart" class="showChart">'.$lang['srv_show_charts'].'</label>';
+ echo '<div class="setting_line">';
+ echo ' <input id="showChart" name="showChart" onchange="showTableChart(\'crosstab\');" type="checkbox" ' . ($this->showChart == true ? ' checked="checked" ' : '') . ' />';
+ echo ' <label for="showChart" id="showChart">'.$lang['srv_show_charts'].'</label>';
+ echo '</div>';
}
function presetVariables() {
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php b/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php
index b1b7b5f..b7f4bf9 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyEditsAnalysis.php
@@ -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();
+ }
}
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php b/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php
index f2155cf..9e3230d 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyMeans.php
@@ -8,7 +8,7 @@
*
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("EXPORT_FOLDER"))define("EXPORT_FOLDER", "admin/survey/SurveyData");
class SurveyMeans{
@@ -32,19 +32,29 @@ class SurveyMeans{
public $doValues = true; # checkbox Prikaži vrednosti
- private $sessionData; # podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze...
+ private $sessionData = null; # podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze...
+ protected $crossNavVsEno = null;
+
+ protected $currentMissingProfile = null;
+
+ protected $setUpJSAnaliza = null;
public function __construct($sid) {
+ global $global_user_id;
+
if ((int)$sid > 0) {
$this->sid = $sid;
# 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();
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
+
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->sid);
SurveyUserSetting::getInstance()->Init($this->sid, $global_user_id);
@@ -169,6 +179,7 @@ class SurveyMeans{
# izrišemo desne linke do posameznih nastavitev
+ $SSH = new SurveyStaticHtml($this->sid);
$SSH -> displayAnalizaRightOptions(M_ANALYSIS_MEANS);
}
@@ -234,38 +245,36 @@ class SurveyMeans{
function displayDropdowns() {
global $lang;
+
$variables1 = $this->getVariableList(1);
$variables2 = $this->getVariableList(2);
- echo '<div id="meansLeftDropdowns" >';
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer space_means_new" >&nbsp;</span>';
- }
- echo $lang['srv_means_label1'];
- echo '<br />';
+
+ echo '<div id="meansLeftHolder">';
+
+ echo '<span class="title">'.$lang['srv_means_label1'].'</span>';
+
# iz header datoteke preberemo spremenljivke
#js: $("#means_variable_1, #means_variable_2").live('click', function() {})
if (count($this->variabla1) > 0) {
- $br=null;
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer" id="means_add_new" onclick="means_add_new_variable(\'1\');"><span class="faicon add small icon-as_link" title=""></span></span>';
- }
-
+
+ echo '<div id="meansLeftDropdowns">';
+
foreach($this->variabla1 AS $_key => $variabla1) {
- echo $_br;
- echo '<span id="v1_'.$_key.'">';
- echo '<select name="means_variable_1" id="means_variable_1" onchange="change_means(); return false;" autocomplete="off">';
+ echo '<div id="v1_'.$_key.'" class="variabla_line">';
+
+ echo '<select name="means_variable_1" id="means_variable_1" class="dropdown large" onchange="change_means(); return false;" autocomplete="off">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ( $variabla1['seq'] == null || $variabla1['seq'] == 0 ) {
echo '<option value="0" selected="selected" >'. $lang['srv_means_izberi_prvo'].'</option>';
}
foreach ($variables1 as $variable) {
- echo '<option value="'.$variable['sequence'].'" spr_id="'.$variable['spr_id'].'" '
+ echo '<option value="'.(isset($variable['sequence'])?$variable['sequence']:'').'" spr_id="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'" '
. ( isset($variable['grd_id']) ? ' grd_id="'.$variable['grd_id'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( ($variabla1['seq'] > 0 &&$variabla1['seq'] == $variable['sequence']) ? ' selected="selected" ' : '')
+ . ( ($variabla1['seq'] > 0 &&isset($variable['sequence'])&&$variabla1['seq'] == $variable['sequence']) ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'].'</option>';
@@ -273,38 +282,39 @@ class SurveyMeans{
}
echo '</select>';
+
if (count($this->variabla1) > 1) {
- echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
- } else {
- #echo '<span class="space_means_new">&nbsp;</span>';
- }
+ echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle" title=""></span></span>';
+ }
+
+ echo '</div>';
+ }
- $_br = '<br/><span class="space_means_new">&nbsp;</span>';
- echo '</span>';
+ echo '</div>';
+
+ // Gumb za dodajanje spremenljivke
+ if ((int)$this->variabla1['0']['seq'] > 0) {
+ echo '<button class="blue small" id="means_add_new" onclick="means_add_new_variable(\'1\');">'.$lang['srv_multicrosstabs_add'].'</span>';
}
- $_br = null;
}
echo '</div>';
- echo '<div id="meansRightDropdowns">';
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer space_means_new" >&nbsp;</span>';
- }
- echo $lang['srv_means_label2'];
- echo '<br />';
-
+
+ echo '<div id="meansRightHolder">';
+
+ echo '<span class="title">'.$lang['srv_means_label2'].'</span>';
# za vsako novo spremenljivko 2 nardimo svoj select
if (count($this->variabla2) > 0) {
- if ((int)$this->variabla1['0']['seq'] > 0) {
- echo '<span class="pointer" id="means_add_new" onclick="means_add_new_variable(\'2\');"><span class="faicon add small icon-as_link" title="'.'"></span></span>';
- }
-
+
+ echo '<div id="meansRightDropdowns">';
+
foreach($this->variabla2 AS $_key => $variabla2) {
- echo $_br;
- echo '<span id="v2_'.$_key.'">';
- echo '<select name="means_variable_2" id="means_variable_2" onchange="change_means(); return false;" autocomplete="off"'
+
+ echo '<div id="v2_'.$_key.'" class="variabla_line">';
+
+ echo '<select name="means_variable_2" id="means_variable_2" class="dropdown large" onchange="change_means(); return false;" autocomplete="off"'
. ((int)$this->variabla1['0']['seq'] > 0 ? '' : ' disabled="disabled" ')
.'>';
@@ -319,39 +329,55 @@ class SurveyMeans{
}
foreach ($variables2 as $variable) {
- echo '<option value="'.$variable['sequence'].'" spr_id="'.$variable['spr_id'].'" '
+ echo '<option value="'.(isset($variable['sequence'])?$variable['sequence']:'').'" spr_id="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'" '
. ( isset($variable['grd_id']) ? ' grd_id="'.$variable['grd_id'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variabla2['seq'] > 0 && $variabla2['seq'] == $variable['sequence'] ? ' selected="selected" ' : '')
+ . ( $variabla2['seq'] > 0 && isset($variable['sequence']) && $variabla2['seq'] == $variable['sequence'] ? ' selected="selected" ' : '')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'] .'</option>';
}
echo '</select>';
+
if (count($this->variabla2) > 1) {
echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
- } else {
- echo '<span class="space_means_new">&nbsp;</span>';
- }
+ }
+
+ echo '</div>';
+ }
+
+ echo '</div>';
- $_br = '<br/><span class="space_means_new">&nbsp;</span>';
- echo '</span>';
+ // Gumb za dodajanje spremenljivke
+ if ((int)$this->variabla1['0']['seq'] > 0) {
+ echo '<button class="blue small" id="means_add_new" onclick="means_add_new_variable(\'2\');">'.$lang['srv_multicrosstabs_add'].'</button>';
}
}
echo '</div>';
- echo '<span id="meansSubSetting" class="floatLeft spaceLeft">';
- if (count($this->variabla2) > 1) {
- echo '<label><input id="chkMeansSeperate" type="checkbox" onchange="changeMeansSubSetting();" '.($this->sessionData['means']['meansSeperateTables']==true?' checked="checked"':'' ).'> '.$lang['srv_means_setting_1'].'</label>';
-
- echo '<br /><span id="spanMeansJoinPercentage"'.($this->sessionData['means']['meansSeperateTables']!=true?'':' class="displayNone"').'><label><input id="chkMeansJoinPercentage" type="checkbox" onchange="changeMeansSubSetting();" '.($this->sessionData['means']['meansJoinPercentage']==true?' checked="checked"':'' ).'> '.$lang['srv_means_setting_2'].'</label></span>';
- }
- echo '<br /><label><input id="showChart" type="checkbox" onchange="showTableChart(\'mean\');" '.($this->sessionData['mean_charts']['showChart']==true?' checked="checked"':'' ).'> '.$lang['srv_show_charts'].'</label>';
- echo '</span>';
+
+ echo '<div id="meansSubSetting">';
- echo '<br class="clr"/>';
+ echo '<span class="title">'.$lang['settings'].':</span>';
+
+ if (count($this->variabla2) > 1) {
+
+ echo '<div class="setting_line">';
+ echo ' <input id="chkMeansSeperate" type="checkbox" onchange="changeMeansSubSetting();" '.($this->sessionData['means']['meansSeperateTables']==true?' checked="checked"':'' ).'><label for="chkMeansSeperate">'.$lang['srv_means_setting_1'].'</label>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <span id="spanMeansJoinPercentage"'.($this->sessionData['means']['meansSeperateTables']!=true?'':' class="displayNone"').'><input id="chkMeansJoinPercentage" type="checkbox" onchange="changeMeansSubSetting();" '.($this->sessionData['means']['meansJoinPercentage']==true?' checked="checked"':'' ).'><label for="chkMeansJoinPercentage">'.$lang['srv_means_setting_2'].'</label></span>';
+ echo '</div>';
+ }
+
+ echo '<div class="setting_line">';
+ echo ' <input id="showChart" type="checkbox" onchange="showTableChart(\'mean\');" '.((isset($this->sessionData['mean_charts']['showChart'])&&$this->sessionData['mean_charts']['showChart']==true)?' checked="checked"':'' ).'><label for="showChart">'.$lang['srv_show_charts'].'</label>';
+ echo '</div>';
+ echo '</div>';
+
// Ikone za izvoz (so tukaj da se refreshajo ob ajax klicu)
$this->displayExport();
}
@@ -360,7 +386,6 @@ class SurveyMeans{
global $lang;
global $admin_type;
- $br='';
$means = array();
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
@@ -370,12 +395,13 @@ class SurveyMeans{
SurveyConditionProfiles:: getConditionString();
# če imamo filter spremenljivk ga izpišemo
- SurveyVariablesProfiles:: getProfileString($doNewLine , true);
+ SurveyVariablesProfiles:: getProfileString();
# če imamo rekodiranje
$SR = new SurveyRecoding($this->sid);
$SR -> getProfileString();
+
if ($this->getSelectedVariables(1) !== null && $this->getSelectedVariables(2) !== null) {
$variables1 = $this->getSelectedVariables(2);
$variables2 = $this->getSelectedVariables(1);
@@ -383,7 +409,7 @@ class SurveyMeans{
$c2=0;
# odvisno ok checkboxa prikazujemo druge variable v isti tabeli ali v svoji
- if ($this->sessionData['means']['meansSeperateTables'] == true ) {
+ if (isset($this->sessionData['means']['meansSeperateTables'])&&$this->sessionData['means']['meansSeperateTables'] == true ) {
#prikazujemo ločeno
if (is_array($variables2) && count($variables2) > 0) {
foreach ($variables2 AS $v_second) {
@@ -420,21 +446,25 @@ class SurveyMeans{
if (is_array($means) && count($means) > 0) {
$counter=0;
foreach ($means AS $mean_sub_grup) {
- echo($br);
- $this->displayMeansTable($mean_sub_grup);
- $br='<br />';
- // Zvezdica za vkljucitev v porocilo
+ echo '<div class="means_table_holder">';
+
+ // Zvezdica za vkljucitev v porocilo
$spr2 = $mean_sub_grup[0]['v1']['seq'].'-'.$mean_sub_grup[0]['v1']['spr'].'-'.$mean_sub_grup[0]['v1']['grd'];
$spr1 = $mean_sub_grup[0]['v2']['seq'].'-'.$mean_sub_grup[0]['v2']['spr'].'-'.$mean_sub_grup[0]['v2']['grd'];
SurveyAnalysis::Init($this->sid);
SurveyAnalysis::addCustomReportElement($type=6, $sub_type=0, $spr1, $spr2);
-
+
+ // Izris tabele
+ $this->displayMeansTable($mean_sub_grup);
+
// Izrisemo graf za tabelo - zaenkrat samo admin
- if($this->sessionData['mean_charts']['showChart'] && $_GET['m'] != 'analysis_creport'){
- $tableChart = new SurveyTableChart($this->sid, $this, 'mean', $counter);
+ if(isset($this->sessionData['mean_charts']['showChart']) && $this->sessionData['mean_charts']['showChart'] && (!isset($_GET['m'])||$_GET['m'] != 'analysis_creport')){
+ $tableChart = new SurveyTableChart($this->sid, $this, 'mean', $counter);
$tableChart->display();
}
+
+ echo '</div>';
$counter++;
}
@@ -469,14 +499,19 @@ class SurveyMeans{
$href_pdf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=mean_izpis&anketa=' . $this->sid);
$href_rtf = makeEncodedIzvozUrlString('izvoz.php?b=export&m=mean_izpis_rtf&anketa=' . $this->sid);
$href_xls = makeEncodedIzvozUrlString('izvoz.php?b=export&m=mean_izpis_xls&anketa=' . $this->sid);
- echo '<script>';
+
+
+ echo '<script>';
+
# nastavimopravilne linke
echo '$("#secondNavigation_links a#meansDoPdf").attr("href", "'.$href_pdf.'");';
echo '$("#secondNavigation_links a#meansDoRtf").attr("href", "'.$href_rtf.'");';
echo '$("#secondNavigation_links a#meansDoXls").attr("href", "'.$href_xls.'");';
+
# prikažemo linke
echo '$("#hover_export_icon").removeClass("hidden");';
echo '$("#secondNavigation_links a").removeClass("hidden");';
+
echo '</script>';
}
}
@@ -563,14 +598,14 @@ class SurveyMeans{
$this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system'])&&(int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
continue;
}
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
- $skala = (int)$spremenljivka['skala'];
+ $skala = isset($spremenljivka['skala'])?(int)$spremenljivka['skala']:0;
# pri drugi, analizirani variabli morajo biti numerične ali ordinalne, v ostalem pa nič)
# skala - 0 Ordinalna
# skala - 1 Nominalna
@@ -669,7 +704,7 @@ class SurveyMeans{
# imamo multicheckbox
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[$dropdown][] = array(
'tip'=>$tip,
@@ -685,7 +720,7 @@ class SurveyMeans{
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[$dropdown][] = array(
'tip'=>$tip,
@@ -770,11 +805,11 @@ class SurveyMeans{
if ($this->dataFileName != '' && file_exists($this->dataFileName)) {
- $spr1 = $this->_HEADERS[$v_first['spr']];
- $spr2 = $this->_HEADERS[$v_second['spr']];
+ $spr1 = isset($this->_HEADERS[$v_first['spr']])?$this->_HEADERS[$v_first['spr']]:null;
+ $spr2 = isset($this->_HEADERS[$v_second['spr']])?$this->_HEADERS[$v_second['spr']]:null;
- $grid1 = $spr1['grids'][$v_first['grd']];
- $grid2 = $spr2['grids'][$v_second['grd']];
+ $grid1 = isset($spr1['grids'][$v_first['grd']])?$spr1['grids'][$v_first['grd']]:array();
+ $grid2 = isset($spr2['grids'][$v_second['grd']])?$spr2['grids'][$v_second['grd']]:array();
$sequence1 = $v_first['seq'];
$sequence2 = $v_second['seq'];
@@ -785,7 +820,7 @@ class SurveyMeans{
$spr_1_checkbox = false;
$spr_2_checkbox = false;
- if ($spr1['tip'] == 2 || $spr1['tip'] == 16) {
+ if (isset($spr1['tip']) && ($spr1['tip'] == 2 || $spr1['tip'] == 16)) {
$spr_1_checkbox = true;
if ($spr1['tip'] == 2) {
$sekvences1 = explode('_',$spr1['sequences']);
@@ -800,10 +835,10 @@ class SurveyMeans{
$sekvences1[] = $sequence1;
}
- if ($spr2['tip'] == 2 || $spr2['tip'] == 16) {
+ if (isset($spr1['tip']) && ($spr2['tip'] == 2 || $spr2['tip'] == 16)) {
$spr_2_checkbox = true;
if ($spr2['tip'] == 2 ) {
- $sekvences2 = explode('_',$this->_HEADERS[$v_second['spr']]['sequences']);
+ if(isset($this->_HEADERS[$v_second['spr']]['sequences'])) $sekvences2 = explode('_',$this->_HEADERS[$v_second['spr']]['sequences']);
}
if ($spr2['tip'] == 16) {
foreach ($grid2['variables'] AS $_variables) {
@@ -817,17 +852,17 @@ class SurveyMeans{
# pogoji so že dodani v _CURRENT_STATUS_FILTER
# dodamo filter za loop-e
- if (isset($this->_CURRENT_LOOP['filter']) && $this->_CURRENT_LOOP['filter'] != '') {
+ /* if (isset($this->_CURRENT_LOOP['filter']) && $this->_CURRENT_LOOP['filter'] != '') {
$status_filter = $this->_CURRENT_STATUS_FILTER.' && '.$this->_CURRENT_LOOP['filter'];
- } else {
+ } else { */
$status_filter = $this->_CURRENT_STATUS_FILTER;
- }
+ //}
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ }*/
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -836,7 +871,7 @@ class SurveyMeans{
$tmp_file = $folder.'tmp_means_'.$this->sid.'.tmp';
$file_handler = fopen($tmp_file,"w");
- fwrite($file_handler,"<?php\n");
+ fwrite($file_handler,"<?php\n\$meansArray=array();\n");
fclose($file_handler);
if (count($sekvences1)>0)
foreach ($sekvences1 AS $sequence1) {
@@ -917,6 +952,7 @@ class SurveyMeans{
}
}
}
+
# inicializacija
$_all_options = array();
$sumaVrstica = array();
@@ -924,7 +960,7 @@ class SurveyMeans{
$sumaMeans = 0;
# poiščemo pripadajočo spremenljivko
- $var_options = $this->_HEADERS[$v_second['spr']]['options'];
+ $var_options = isset($this->_HEADERS[$v_second['spr']]['options'])?$this->_HEADERS[$v_second['spr']]['options']:array();
# najprej poiščemo (združimo) vse opcije ki so definirane kot opcije spremenljivke in vse ki so v meansih
@@ -953,7 +989,7 @@ class SurveyMeans{
# missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red
foreach ($_var1 AS $_kvar2=>$_var2) {
if (!isset($_allMissing_answers[$_kvar1]) || (isset($_allMissing_answers[$_kvar1]) && isset($_pageMissing_answers[$_kvar1]))) {
- $sumaVrstica[$_kvar1] += $_var2;
+ $sumaVrstica[$_kvar1] = isset($sumaVrstica[$_kvar1])?$sumaVrstica[$_kvar1] += $_var2 : $_var2;
}
}
# missingov ne dodajamo še zdaj, da ohranimo pravilen vrstni red
@@ -1042,7 +1078,6 @@ class SurveyMeans{
}
}
-
$meansArr['v1'] = $v_first; # prva variabla
$meansArr['v2'] = $v_second; # druga variabla
@@ -1066,75 +1101,72 @@ class SurveyMeans{
# ali prikazujemo vrednosti variable pri spremenljivkah
$show_variables_values = $this->doValues;
- $showSingleUnits = $this->sessionData['means']['meansJoinPercentage']==true && $this->sessionData['means']['meansSeperateTables'] == false;
+ $showSingleUnits = isset($this->sessionData['means']['meansJoinPercentage'])&&$this->sessionData['means']['meansJoinPercentage']==true && $this->sessionData['means']['meansSeperateTables'] == false;
+
# izrišemo tabelo
- echo '<table class="anl_tbl_crosstab fullWidth" style="margin-top:10px;">';
- echo '<colgroup>';
- echo '<col style="width:auto; min-width:30px;" />';
- echo '<col style="width:auto; min-width:30px; " />';
- for ($i = 0; $i < $cols; $i++) {
- echo '<col style="width:auto; min-width:30px;" />';
- if ($showSingleUnits == false) {
- echo '<col style="width:auto; min-width:30px;" />';
- }
- }
- if ($showSingleUnits == true) {
- echo '<col style="width:auto; min-width:30px;" />';
- }
- echo '</colgroup>';
+ echo '<table class="table_means">';
+
+
+ echo '<tr class="row1">';
- echo '<tr>';
- #echo '<td>xx&nbsp;</td>';
# ime variable
# teksti labele:
$label2 = $this->getSpremenljivkaTitle($_means[0]['v2']);
if ($showSingleUnits == false) {
$span = ' colspan="2"';
}
- echo '<td class="anl_bt anl_bl anl_ac rsdl_bck_title ctbCll" rowspan="2">';
+ echo '<td class="cell_question" rowspan="2">';
echo $label2;
echo '</td>';
for ($i = 0; $i < $cols; $i++) {
- echo '<td class="anl_bt anl_bl anl_br anl_ac rsdl_bck_title ctbCll"'.$span.'>';
+ echo '<td class="cell_question" '.$span.'>';
$label1 = $this->getSpremenljivkaTitle($_means[$i]['v1']);
echo $label1;
echo '</td>';
}
if ($showSingleUnits == true) {
- echo '<td class="anl_bl ">&nbsp;</td>';
+ echo '<td class="anl_bl">&nbsp;</td>';
}
echo '</tr>';
- echo '<tr>';
+
+
+ echo '<tr class="row2">';
for ($i = 0; $i < $cols; $i++) {
+
#Povprečje
- echo '<td class="anl_bt anl_bl anl_br anl_ac rsdl_bck_variable1 ctbCll" >';
+ echo '<td class="cell_value">';
echo $lang['srv_means_label'];
echo '</td>';
+
#enote
if ($showSingleUnits == false) {
- echo '<td class="anl_bl anl_bt anl_br anl_ac red anl_ita anl_bck_text_0 rsdl_bck_variable1 ctbCll">'.$lang['srv_means_label4'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_means_label4'].'</td>';
}
}
+
if ($showSingleUnits == true) {
- echo '<td class="anl_bl anl_bt anl_br anl_ac red anl_ita anl_bck_text_0 rsdl_bck_variable1 ctbCll">'.$lang['srv_means_label4'].'</td>';
+ echo '<td class="cell_value">'.$lang['srv_means_label4'].'</td>';
}
echo '</tr>';
+
if (count($_means[0]['options']) > 0) {
-
+ $max_units=0;
foreach ($_means[0]['options'] as $ckey2 =>$crossVariabla2) {
$units_per_row = 0;
+
echo '<tr>';
- echo '<td class="anl_bt anl_bl anl_ac rsdl_bck_variable1 ctbCll">';
+
+ echo '<td class="cell_question">';
echo $crossVariabla2['naslov'];
# če ni tekstovni odgovor dodamo key
if ($crossVariabla2['type'] !== 't' ) {
if ($show_variables_values == true) {
- if ($crossVariabla2['vr_id'] == null) {
+ if (!isset($crossVariabla2['vr_id'])||$crossVariabla2['vr_id'] == null) {
echo '&nbsp;( '.$ckey2.' )';
} else {
echo '&nbsp;( '.$crossVariabla2['vr_id'].' )';
@@ -1142,48 +1174,61 @@ class SurveyMeans{
}
}
echo '</td>';
+
# celice z vsebino
for ($i = 0; $i < $cols; $i++) {
- echo '<td class="ct_in_cell anl_br'.'" k1="'.$ckey1.'" k2="'.$ckey2.'" n1="'.$crossVariabla1['naslov'].'" n2="'.$crossVariabla2['naslov'].'" v1="'.$crossVariabla1['vr_id'].'" v2="'.$crossVariabla2['vr_id'].'">';
- echo $this->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'));
+ echo '<td class="cell_value" k1="'./* $ckey1. */'" k2="'.$ckey2.'" n1="'./* $crossVariabla1['naslov']. */'" n2="'.$crossVariabla2['naslov'].'" v1="'./* $crossVariabla1['vr_id']. */'" v2="'.(isset($crossVariabla2['vr_id'])?$crossVariabla2['vr_id']:'').'">';
+ echo $this->formatNumber(isset($_means[$i]['result'][$ckey2])?$_means[$i]['result'][$ckey2]:null, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'));
echo '</td>';
+
if ($showSingleUnits == false) {
- echo '<td class="anl_ac anl_bl anl_bt anl_br rsdl_bck0 crostabSuma">';
- echo (int)$_means[$i]['sumaVrstica'][$ckey2];
+ echo '<td class="cell_value">';
+ echo (isset($_means[$i]['sumaVrstica'][$ckey2])?(int)$_means[$i]['sumaVrstica'][$ckey2]:0);
echo '</td>';
- } else {
- $units_per_row = max($units_per_row,(int)$_means[$i]['sumaVrstica'][$ckey2]);
+ }
+ else {
+ $units_per_row = max($units_per_row,(isset($_means[$i]['sumaVrstica'][$ckey2])?(int)$_means[$i]['sumaVrstica'][$ckey2]:0));
}
}
+
if ($showSingleUnits == true) {
- echo '<td class="anl_ac anl_bl anl_bt anl_br rsdl_bck0 crostabSuma">';
+ echo '<td class="cell_value">';
echo $units_per_row;
echo '</tr>';
}
+
echo '</tr>';
+
$max_units += $units_per_row;
}
}
+
+
echo '<tr>';
- echo '<td class="anl_bb anl_bt anl_bl anl_ac red anl_ita anl_bck_text_0 rsdl_bck_variable1 ctbCll">'.$lang['srv_means_label3'].'</td>';
+
+ echo '<td class="cell_value">'.$lang['srv_means_label3'].'</td>';
+
for ($i = 0; $i < $cols; $i++) {
- echo '<td class="anl_ac anl_bt anl_bl anl_br anl_bb rsdl_bck0 crostabSuma">';
+ echo '<td class="cell_value">';
echo $this->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'));
echo '</td>';
+
if ($showSingleUnits == false) {
- echo '<td class="anl_ac anl_bt anl_bl anl_br anl_bb rsdl_bck0 crostabSuma">';
+ echo '<td class="cell_value">';
echo (int)$_means[$i]['sumaSkupna'];
echo '</td>';
}
}
+
if ($showSingleUnits == true) {
- echo '<td class="anl_ac anl_bt anl_bl anl_br anl_bb rsdl_bck0 crostabSuma">';
+ echo '<td class="cell_value">';
echo $max_units;
- echo '</tr>';
+ echo '</td>';
}
echo '</tr>';
+
echo '</table>';
}
@@ -1230,20 +1275,20 @@ class SurveyMeans{
$which = $_POST['which'];
$variables = $this->getVariableList($which);
$multiple = true;
-
-
+
+
if ($which == '1') {
- echo '<br/>';
- echo '<span class="space_means_new">&nbsp;</span>';
- echo '<select name="means_variable_'.$which.'" id="means_variable_'.$which.'" onchange="change_means(); return false;" autocomplete="off"'
- .'>';
- # ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
- if ( $variabla1['seq'] == null || $variabla1['seq'] == 0 ) {
+ echo '<div class="variabla_line">';
+
+ echo '<select name="means_variable_'.$which.'" id="means_variable_'.$which.'" class="dropdown large" onchange="change_means(); return false;" autocomplete="off">';
+
+ # ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
+ if ( !isset($this->variabla1['seq'])||$this->variabla1['seq'] == null || $this->variabla1['seq'] == 0 ) {
echo '<option value="0" selected="selected" >'. $lang['srv_analiza_crosstab_izberi_more'].'</option>';
}
foreach ($variables as $variable) {
- echo '<option value="'.$variable['sequence'].'" spr_id="'.$variable['spr_id'].'" '
+ echo '<option value="'.(isset($variable['sequence'])?$variable['sequence']:'').'" spr_id="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'" '
. ( isset($variable['grd_id']) ? ' grd_id="'.$variable['grd_id'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
. '> '
@@ -1251,20 +1296,23 @@ class SurveyMeans{
. $variable['variableNaslov'] . '</option>';
}
+
echo '</select>';
- echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
-
- } else {
- # which = 2
- echo '<br/>';
- echo '<span class="space_means_new">&nbsp;</span>';
- echo '<select name="means_variable_'.$which.'" id="means_variable_'.$which.'" onchange="change_means(); return false;" autocomplete="off"'
- .'>';
+
+ echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle" title=""></span></span>';
+
+ echo '</div>';
+ }
+ else {
+ echo '<div class="variabla_line">';
+
+ echo '<select name="means_variable_'.$which.'" id="means_variable_'.$which.'" class="dropdown large" onchange="change_means(); return false;" autocomplete="off">';
# ce prva variabla ni izbrana, dodamo tekst za izbiro prve variable
if ((int)$this->variabla1['0']['seq'] > 0) {
echo '<option value="0" selected="selected" >'. $lang['srv_analiza_crosstab_najprej_prvo'].'</option>';
- } else {
+ }
+ else {
# če druga variabla ni izbrana dodamo tekst za izbiro druge variable
echo '<option value="0" selected="selected">'. $lang['srv_analiza_crosstab_izberi_more'].'</option>';
}
@@ -1279,7 +1327,10 @@ class SurveyMeans{
}
echo '</select>';
- echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle icon-orange_link" title=""></span></span>';
+
+ echo '<span class="pointer" id="means_remove" onclick="means_remove_variable(this);"><span class="faicon delete_circle" title=""></span></span>';
+
+ echo '</div>';
}
}
@@ -1291,7 +1342,7 @@ class SurveyMeans{
$sekvenca = $v_first['seq'];
$spremenljivka = $this->_HEADERS[$spremenljivka_id];
- $grid = $spremenljivka['grids'][$grid_id];
+ $grid = isset($spremenljivka['grids'][$grid_id])?$spremenljivka['grids'][$grid_id]:array();
# za multicheckboxe popravimo naslov, na podtip
@@ -1303,9 +1354,9 @@ class SurveyMeans{
$labela .= '<span class="anl_variabla">';
$labela .= '<a href="/" title="'.$lang['srv_predogled_spremenljivka'].'" onclick="showspremenljivkaSingleVarPopup(\''.$spremenljivka_id.'\'); return false;">';
$labela .= strip_tags($spremenljivka['naslov']);
- if ($show_variables_values == true) {
+ /* if ($show_variables_values == true) {
$labela .= '&nbsp;('.strip_tags($spremenljivka['variable']).')';
- }
+ } */
$labela .= '</a>';
$labela .= '</span>';
@@ -1313,14 +1364,17 @@ class SurveyMeans{
if (strip_tags($grid['naslov']) != $lang['srv_new_text']) {
$labela .= '<br/>'.strip_tags($grid['naslov']);
}
+
$labela .= '&nbsp;('.strip_tags($grid['variable']).')' ;
- } else {
- if (strip_tags($variable['naslov']) != $lang['srv_new_text']) {
+ }
+ else {
+ if (strip_tags($variable['naslov']) != $lang['srv_new_text'] && strip_tags($variable['naslov']) != $lang['srv_new_vprasanje']) {
$labela .= '<br/>'.strip_tags($variable['naslov']);
}
- if ($show_variables_values == true) {
+
+ /* if ($show_variables_values == true) {
$labela .= '&nbsp;('.strip_tags($variable['variable']).')';
- }
+ } */
}
}
@@ -1331,9 +1385,9 @@ class SurveyMeans{
$labela = '<span class="anl_variabla">';
$labela .= '<a href="/" title="'.$lang['srv_predogled_spremenljivka'].'" onclick="showspremenljivkaSingleVarPopup(\''.$spremenljivka_id.'\'); return false;">';
$labela .= strip_tags($spremenljivka['naslov']);
- if ($show_variables_values == true) {
+ /* if ($show_variables_values == true) {
$labela .= '&nbsp;('.strip_tags($spremenljivka['variable']).')';
- }
+ } */
$labela .= '</a>';
$labela .= '</span>'.NEW_LINE;
}
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php b/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php
index 67664da..98c2f59 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyMultiCrosstabs.php
@@ -1,8 +1,8 @@
<?php
-define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define("R_FOLDER", "admin/survey/R");
+if(!defined("AUTO_HIDE_ZERRO_VALUE")) define("AUTO_HIDE_ZERRO_VALUE", 20); # nad koliko kategorij skrivamo ničelne vrednosti
+if(!defined("EXPORT_FOLDER")) define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("R_FOLDER")) define("R_FOLDER", "admin/survey/R");
class SurveyMultiCrosstabs {
@@ -74,9 +74,12 @@ 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();
+
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
$this->_CURRENT_STATUS_FILTER = STATUS_FIELD.' ~ /6|5/';
@@ -216,7 +219,7 @@ class SurveyMultiCrosstabs {
if($spr['canChoose'] && in_array($spr['tip'], array(1,3,6))){
echo '<li class="draggable mc_draggable" id="'.$spr['spr_id'].'-'.$spr['sequence'].'">';
- echo '<span class="strong">'.$spr['variable'].'</span> - '.$this->snippet($spr['naslov'], 25);
+ echo ' <span class="strong"><span class="faicon grip"></span>'.$spr['variable'].'</span> - '.$this->snippet($spr['naslov'], 25);
echo '</li>';
}
}
@@ -227,7 +230,7 @@ class SurveyMultiCrosstabs {
$this->displayMCTablesPopups();
// Izris diva za nastavitve tabele
- echo '<div id="mc_table_settings" class="mc_table_settings">';
+ echo '<div id="mc_table_settings" class="mc_table_settings divPopUp PopUpNarrow">';
$this->displayTableSettings();
echo '</div>';
@@ -252,9 +255,19 @@ class SurveyMultiCrosstabs {
// Napolnimo variable ki so ze izbrane
$this->getSelectedVars();
+ // Zvezdica za creport - ce smo v custom reportu tega ne izpisemo
+ /*if($_GET['m'] != 'analysis_creport'){
+
+ echo '<div class="mc_table_top_settings">';
+
+ // Zvezdica za vkljucitev v porocilo
+ SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=10, $sub_type=0, $spr1=$this->table_id);
+
+ echo '</div>';
+ }*/
+
echo '<table id="'.$this->table_id.'" cellspacing="0" cellpadding="0" class="mc_table">';
-
// Imamo 2 nivoja
if($this->colLevel2){
@@ -264,8 +277,10 @@ class SurveyMultiCrosstabs {
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
@@ -276,23 +291,27 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
}
// Izrisemo se zadnjo prazno navpicno celico vrstico
echo '<td id="undefined" class="spr vertical droppable empty" rowspan="4">'.$lang['srv_multicrosstabs_add'].'</td>';
- echo '</tr>';
+ echo '</tr>';
+
+
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
@@ -311,16 +330,18 @@ class SurveyMultiCrosstabs {
}
}
echo '</tr>';
+
// Izris vrstic za 2. nivo - 3. in 4. vrstica
-
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $parentVar){
@@ -335,7 +356,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -352,15 +373,19 @@ class SurveyMultiCrosstabs {
}
}
}
+
echo '</tr>';
+
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
+
if(count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $parentVar){
@@ -375,7 +400,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($suboption, 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -384,10 +409,12 @@ class SurveyMultiCrosstabs {
}
}
}
+
echo '</tr>';
}
// Imamo samo 1 nivo
else{
+
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
@@ -395,8 +422,10 @@ class SurveyMultiCrosstabs {
$colspan = ' colspan="2"';
else
$colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
- if(count($this->selectedVars['ver'])){
+
+ if(isset($this->selectedVars['ver'])&&count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
$colspan = ' colspan="'.($this->table_settings[$this->table_id]['sums'] == 1 && !$this->rowLevel2 ? $var['span']+1 : $var['span']).'"';
@@ -405,7 +434,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -416,18 +445,22 @@ class SurveyMultiCrosstabs {
}
// Izrisemo se zadnjo prazno navpicno celico vrstico
- echo '<td id="undefined" class="spr vertical droppable empty" rowspan="2">'.$lang['srv_multicrosstabs_add'].'</td>';
+ echo '<td id="undefined" class="spr vertical droppable empty" rowspan="2">'.$lang['srv_multicrosstabs_add'].'</td>';
+
echo '</tr>';
+
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
if($this->rowSpan == 0)
$colspan = ' colspan="1"';
elseif(!$this->rowLevel2)
$colspan = ' colspan="2"';
else
- $colspan = ' colspan="4"';
+ $colspan = ' colspan="4"';
+
echo '<tr><td class="borderless" '.$colspan.'></td>';
- if(count($this->selectedVars['ver'])){
+
+ if(isset($this->selectedVars['ver'])&&count($this->selectedVars['ver'])){
foreach($this->selectedVars['ver'] as $var){
// Loop cez variable spremenljivke
@@ -449,13 +482,14 @@ class SurveyMultiCrosstabs {
}
}
}
+
echo '</tr>';
}
// Izrisemo HORIZONTALNO izbrane variable
- if(count($this->selectedVars['hor'])){
+ if(isset($this->selectedVars['hor'])&&count($this->selectedVars['hor'])){
// Imamo 2 nivoja vrstic
if($this->rowLevel2){
@@ -486,7 +520,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$parentVar['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -507,7 +541,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -535,7 +569,7 @@ class SurveyMultiCrosstabs {
echo '<tr>';
- echo '<td class="var sums">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
+ echo '<td class="var sums horizontal">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
$crosstabs = $this->crosstabData[$parentVar['spr'].'-'.$var['spr']];
@@ -561,7 +595,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$parentVar['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -599,7 +633,7 @@ class SurveyMultiCrosstabs {
echo $this->snippet($this->variablesList[$var['spr']]['naslov'], 25);
// Gumb za brisanje
- echo '<div class="delete_var" onclick="deleteVariable(this);"></div>';
+ echo '<div class="delete_var" onclick="deleteVariable(this);"><span class="faicon remove"></span></div>';
echo '</td>';
}
@@ -622,7 +656,7 @@ class SurveyMultiCrosstabs {
// Vrstica za sumo (ce jo imamo vklopljeno)
if($this->table_settings[$this->table_id]['sums'] == 1 && count($this->selectedVars['ver']) > 0 && !$this->colLevel2){
echo '<tr>';
- echo '<td class="var sums">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
+ echo '<td class="var sums horizontal">'.$lang['srv_analiza_crosstab_skupaj'].'</td>';
// Loop cez vse stolpce
foreach($this->selectedVars['ver'] as $spr2){
@@ -683,37 +717,26 @@ class SurveyMultiCrosstabs {
echo '</tr>';
-
echo '</table>';
-
- echo '<div class="mc_table_bottom_settings">';
-
// Izrisemo legendo
+ echo '<div class="mc_table_bottom_settings">';
$this->displayLegend();
-
-
- // Ce smo v custom reportu tega ne izpisemo
- if($_GET['m'] != 'analysis_creport'){
-
- // Zvezdica za vkljucitev v porocilo
- SurveyAnalysisHelper::getInstance()->addCustomReportElement($type=10, $sub_type=0, $spr1=$this->table_id);
-
-
- echo '<script type="text/javascript">';
-
- // Nastavimo droppable (drugace po ajaxu ne dela)
- echo '$(function(){createDroppable();});';
-
- // Nastavimo gumb za brisanje spremenljivke
- echo '$(".mc_table tr td.spr").mouseover(function(){$(this).find(".delete_var").show();});';
- echo '$(".mc_table tr td.spr").mouseout(function(){$(this).find(".delete_var").hide();});';
-
- echo '</script>';
- }
-
echo '</div>';
+
+
+ // JS
+ echo '<script type="text/javascript">';
+
+ // Nastavimo droppable (drugace po ajaxu ne dela)
+ echo '$(function(){createDroppable();});';
+
+ // Nastavimo gumb za brisanje spremenljivke
+ echo '$(".mc_table tr td.spr").mouseover(function(){$(this).find(".delete_var").show();});';
+ echo '$(".mc_table tr td.spr").mouseout(function(){$(this).find(".delete_var").hide();});';
+
+ echo '</script>';
}
// Izpis celic v vrstici s podatki
@@ -1108,7 +1131,7 @@ class SurveyMultiCrosstabs {
// Numerus
if($this->table_settings[$this->table_id]['numerus'] == 1){
echo '<tr><td class="bold white">';
- echo $crosstabs['sumaSkupna'];
+ echo ($crosstabs['sumaSkupna'] != '') ? $crosstabs['sumaSkupna'] : '0';
echo '</td></tr>';
}
@@ -1390,91 +1413,84 @@ class SurveyMultiCrosstabs {
echo '<input type="hidden" name="table_id" value="'.$this->table_id.'" />';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_val'].'</legend>';
-
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_val'].'</h3>';
+
+ echo '<div class="setting_holder">';
+
// Prikaz numerusa
- echo '<span class="clr"><input type="checkbox" id="numerus_'.$this->table_id.'" name="numerus" '.($this->table_settings[$this->table_id]['numerus'] == 1 ? ' checked="checked"':'').' value="1" /><label for="numerus_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_numerus'].'</label></span>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="numerus_'.$this->table_id.'" name="numerus" '.($this->table_settings[$this->table_id]['numerus'] == 1 ? ' checked="checked"':'').' value="1" /><label for="numerus_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_numerus'].'</label>';
+ echo '</div>';
// Prikaz procentov
- echo '<span class="clr"><input type="checkbox" id="percent_'.$this->table_id.'" name="percent" '.($this->table_settings[$this->table_id]['percent'] == 1 ? ' checked="checked"':'').' value="1" /><label for="percent_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_percent'].'</label></span>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="percent_'.$this->table_id.'" name="percent" '.($this->table_settings[$this->table_id]['percent'] == 1 ? ' checked="checked"':'').' value="1" /><label for="percent_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_percent'].'</label>';
+ echo '</div>';
// Prikaz vsot
- echo '<span class="clr"><input type="checkbox" id="sums_'.$this->table_id.'" name="sums" '.($this->table_settings[$this->table_id]['sums'] == 1 ? ' checked="checked"':'').' value="1" /><label for="sums_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_sum'].'</label></span>';
-
- // Navedbe / enote
- /*if($this->isCheckbox){
- echo '<span class="clr" style="line-height: 20px;">';
- echo '<label for="navVsEno0_'.$this->table_id.'"><input type="radio" id="navVsEno0_'.$this->table_id.'" name="navVsEno" '.($this->table_settings[$this->table_id]['navVsEno'] == 0 ? ' checked="checked"':'').' value="0" />'.$lang['srv_analiza_crosstab_navedbe'].'</label>';
- echo ' <label for="navVsEno1_'.$this->table_id.'"><input type="radio" id="navVsEno1_'.$this->table_id.'" name="navVsEno" '.($this->table_settings[$this->table_id]['navVsEno'] == 1 ? ' checked="checked"':'').' value="1" />'.$lang['srv_analiza_crosstab_enote'].'</label>';
- echo '</span>';
- }*/
-
- echo '</fieldset>';
-
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="sums_'.$this->table_id.'" name="sums" '.($this->table_settings[$this->table_id]['sums'] == 1 ? ' checked="checked"':'').' value="1" /><label for="sums_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_sum'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_avg'].'</legend>';
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_avg'].'</h3>';
// Variabla za racunanje povprecja - numeric in ordinal (radio, dropdown, mg)
$checked = $this->table_settings[$this->table_id]['avgVar'] == '' ? false : true;
- echo '<span class="clr"><input type="checkbox" id="avgSetting_'.$this->table_id.'" name="avgSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'avgVar\');" /><label for="avgSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_avg'].'</label>';
- echo '<span id="avgVar" class="spaceLeft" '.($checked ? '' : ' style="display: none;"').'><select id="avgVar_'.$this->table_id.'" name="avgVar">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="avgSetting_'.$this->table_id.'" name="avgSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'avgVar\');" /><label for="avgSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_avg'].'</label>';
+ echo '</div>';
+ echo '<div id="avgVar" class="setting_item" '.($checked ? '' : ' style="display: none;"').'>';
+ echo '<select class="dropdown medium" id="avgVar_'.$this->table_id.'" name="avgVar">';
echo '<option value="">'.$lang['srv_select_spr'].'...</option>';
foreach($this->variablesList AS $spr){
- if( $spr['canChoose'] && ($spr['tip'] == 7 || (in_array($spr['tip'], array(1,3,6)) && $spr['skala'] == 0)) ){
+ if( $spr['canChoose'] && ($spr['tip'] == 7 || (in_array($spr['tip'], array(1,3,6)) && (!isset($spr['skala'])||$spr['skala'] == 0))) ){
echo '<option value="'.$spr['spr_id'].'-'.$spr['sequence'].'" '.($this->table_settings[$this->table_id]['avgVar'] == $spr['spr_id'].'-'.$spr['sequence'] ? ' selected="selected"' : '').'>('.$spr['variable'].') '.$this->snippet($spr['naslov'], 25).'</option>';
}
}
- echo '</select></span>';
- echo '</span>';
-
- echo '</fieldset>';
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_multicrosstabs_settings_del'].'</legend>';
+ echo '<h3>'.$lang['srv_multicrosstabs_settings_del'].'</h3>';
// Variabla za racunanje deleza - ordinal in nominal (radio, dropdown, mg, po novem tudi checkbox, multicheckbox)
$checked = $this->table_settings[$this->table_id]['delezVar'] == '' ? false : true;
- echo '<span class="clr"><input type="checkbox" id="delezSetting_'.$this->table_id.'" name="delezSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'delezVar\');" /><label for="delezSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_delez'].'</label>';
-
- echo '<span id="delezVar" class="spaceLeft" '.($checked ? '' : ' style="display: none;"').'><select id="delezVar_'.$this->table_id.'" name="delezVar" onChange="setDelez(this.value);">';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
+ echo '<input type="checkbox" id="delezSetting_'.$this->table_id.'" name="delezSetting" '.($checked ? ' checked="checked"':'').' onClick="toggleMCSetting(\'delezVar\');" /><label for="delezSetting_'.$this->table_id.'"> '.$lang['srv_multicrosstabs_delez'].'</label>';
+ echo '</div>';
+ echo '<div id="delezVar" class="setting_item" '.($checked ? '' : ' style="display: none;"').'>';
+ echo '<select class="dropdown medium" id="delezVar_'.$this->table_id.'" name="delezVar" onChange="setDelez(this.value);">';
echo '<option value="">'.$lang['srv_select_spr'].'...</option>';
foreach($this->variablesList AS $spr){
if($spr['canChoose'] && in_array($spr['tip'], array(1,3,6,2,16))){
echo '<option value="'.$spr['spr_id'].'-'.$spr['sequence'].'" '.($this->table_settings[$this->table_id]['delezVar'] == $spr['spr_id'].'-'.$spr['sequence'] ? ' selected="selected"' : '').'>('.$spr['variable'].') '.$this->snippet($spr['naslov'], 25).'</option>';
}
}
- echo '</select></span>';
- echo '</span>';
+ echo '</select>';
+ echo '</div>';
+
+ echo '</div>';
echo '<div id="delez" '.($checked ? '' : ' style="display: none;"').'>';
$this->displayDelez($this->table_settings[$this->table_id]['delezVar']);
echo '</div>';
- echo '</fieldset>';
-
echo '</form>';
-
// Gumbi na dnu
- echo '<div id="mcSettingsButtons">';
-
- echo '<span class="buttonwrapper spaceRight floatLeft">';
- echo '<a class="ovalbutton ovalbutton_gray" onclick="closeMCSettings(\''.$this->table_id.'\');">';
- echo '<span>'.$lang['srv_zapri'].'</span>';
- echo '</a>';
- echo '</span>';
-
- echo '<span class="buttonwrapper spaceRight spaceLeft floatLeft">';
- echo '<a class="ovalbutton ovalbutton_orange" onclick="saveMCSettings(\''.$this->table_id.'\');">';
- echo '<span>'.$lang['srv_potrdi'].'</span>';
- echo '</a>';
- echo '</span>';
-
- echo '</div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="closeMCSettings(\''.$this->table_id.'\');">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="saveMCSettings(\''.$this->table_id.'\');">'.$lang['srv_potrdi'].'</button>';
+ echo '</div>';
}
// Prikazemo opcije variable (checkboxe) za delez
@@ -1492,9 +1508,13 @@ class SurveyMultiCrosstabs {
else
$val = 0;
- echo '<span class="clr">';
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_item">';
echo '<input type="checkbox" id="delez_'.$cnt.'" name="delez_'.$cnt.'" value="1" '.($val == 1 ? ' checked="checked"' : '').' /><label for="delez_'.$cnt.'"> '.$option.'</label>';
- echo '</span>';
+ echo '</div>';
+
+ echo '</div>';
$cnt++;
}
@@ -1530,10 +1550,12 @@ class SurveyMultiCrosstabs {
$href_xls = makeEncodedIzvozUrlString('izvoz.php?b=export&m=multicrosstabs_izpis_xls&anketa='.$this->ank_id);
echo '<script>';
+
# nastavimopravilne linke
echo '$("#secondNavigation_links a#multicrosstabDoPdf").attr("href", "'.$href_pdf.'");';
echo '$("#secondNavigation_links a#multicrosstabDoRtf").attr("href", "'.$href_rtf.'");';
echo '$("#secondNavigation_links a#multicrosstabDoXls").attr("href", "'.$href_xls.'");';
+
# prikažemo linke
echo '$("#hover_export_icon a").removeClass("hidden");';
echo '$("#secondNavigation_links a").removeClass("hidden");';
@@ -1583,11 +1605,11 @@ class SurveyMultiCrosstabs {
$this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- if ((int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
+ if (isset($spremenljivka['hide_system'])&&(int)$spremenljivka['hide_system'] == 1 && in_array($spremenljivka['variable'],array('email','ime','priimek','telefon','naziv','drugo'))) {
continue;
}
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
if (is_numeric($tip)
# tekstovnih tipov ne dodajamo
@@ -1731,7 +1753,7 @@ class SurveyMultiCrosstabs {
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[$skey] = array(
'tip'=>$tip,
@@ -1830,7 +1852,7 @@ class SurveyMultiCrosstabs {
else{
$this->selectedVars['ver'][$row['vrstni_red']] = $row;
-
+ $fullColSpan = 0;
$sql2 = sisplet_query("SELECT * FROM srv_mc_element WHERE table_id='$this->table_id' AND parent='$row[vrstni_red]' AND position='1'");
// Ce ni 2.nivoja
if(mysqli_num_rows($sql2) == 0){
@@ -1889,7 +1911,7 @@ class SurveyMultiCrosstabs {
foreach($variables as $key => $variable){
$spr[$key] = $this->_HEADERS[$variables[$key]['spr']];
- $grid[$key] = $spr[$key]['grids'][$variables[$key]['grd']];
+ $grid[$key] = isset($spr[$key]['grids'][$variables[$key]['grd']])?$spr[$key]['grids'][$variables[$key]['grd']]:null;
$sekvenca = $variables[$key]['seq'];
$spr_checkbox = false;
@@ -1910,7 +1932,7 @@ class SurveyMultiCrosstabs {
$sekvence[$key] = explode('_',$spr[$key]['sequences']);
}
}
- if ($spr1['tip'] == 16) {
+ if ($spr[$key]['tip'] == 16) {
foreach ($grid[$key]['variables'] AS $_variables) {
@@ -1946,7 +1968,7 @@ class SurveyMultiCrosstabs {
}
}
-
+ $crosstabVars = '';
// Nastavimo string s katerim filtriramo datoteko za prave stolpce
foreach($sekvence as $sekvenca){
if(count($sekvenca) > 1){
@@ -1968,6 +1990,7 @@ class SurveyMultiCrosstabs {
$avgVar = 1;
}
+ $delez=array();
// Ce imamo racunanje deleza
if($this->table_settings[$this->table_id]['delezVar'] != ''){
@@ -2046,9 +2069,9 @@ class SurveyMultiCrosstabs {
$status_filter = $this->_CURRENT_STATUS_FILTER;
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ } */
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -2144,7 +2167,8 @@ class SurveyMultiCrosstabs {
$sql = sisplet_query("SELECT * FROM srv_mc_table WHERE id='$this->table_id' AND ank_id='$this->ank_id' AND usr_id='$global_user_id'");
$current_table = mysqli_fetch_array($sql);
- echo '<h2>'.$lang['srv_multicrosstabs_tables'].'</h2>';
+ echo '<h2>'.$lang['srv_multicrosstabs_tables'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="close_mc_tables(); return false;">✕</a></div>';
echo '<div id="mc_tables_left">';
@@ -2158,68 +2182,85 @@ class SurveyMultiCrosstabs {
}
echo '</span>';
+
+ /*/ Cas kreiranja tabele
+ echo '<div id="table_create_time">';
+ $time_created = strtotime($current_table['time_created']);
+ echo $lang['srv_multicrosstabs_tables_time'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span>';
+ echo '</div>';*/
- // Na dnu imamo gumba brisi in preimenuj
- echo '<div style="float:left;">';
- echo '<a href="#" onclick="mc_table_action(\'show_rename\'); return false;">'.$lang['srv_multicrosstabs_tables_rename'].'</a><br/>'."\n";
- echo '<a href="#" onclick="mc_table_action(\'show_delete\'); return false;">'.$lang['srv_multicrosstabs_tables_delete'].'</a>'."\n";
- echo '</div>';
+ // Na dnu imamo linka brisi in preimenuj
+ echo '<p class="blue pointer bottom8 top16" onClick="mc_table_action(\'show_rename\'); return false;">'.$lang['srv_multicrosstabs_tables_rename'].'</p>';
+ echo '<p class="blue pointer" onclick="mc_table_action(\'show_delete\'); return false;">'.$lang['srv_multicrosstabs_tables_delete'].'</p>';
- // Cas kreirranja tabele
- echo '<div style="float:right; text-align:right;">';
- $time_created = strtotime($current_table['time_created']);
- echo $lang['srv_multicrosstabs_tables_time'].': <span class="bold">'.date("d.m.Y H:i", $time_created).'</span><br />';
- echo '</div>';
-
echo '</div>';
// cover Div
- echo '<div id="dsp_cover_div"></div>'."\n";
+ echo '<div id="dsp_cover_div"></div>';
- echo '<span class="clr"></span>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onclick="close_mc_tables(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'show_new\'); return false;">'.$lang['srv_multicrosstabs_tables_add'].'</button>';
+ echo '<button class="medium blue" onClick="use_mc_table(); return false;">'.$lang['srv_multicrosstabs_tables_use'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
- echo '<div style="position:absolute; bottom:15px; right:15px;">';
-
- //echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="save_creport_profile(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="use_mc_table(); return false;"><span>'.$lang['srv_multicrosstabs_tables_use'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight" title="'.$lang['srv_multicrosstabs_tables_add'].'"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="mc_table_action(\'show_new\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_add'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton" href="#" onclick="close_mc_tables(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
-
- echo '</div>';
}
function displayMCTablesPopups(){
global $lang;
// div za kreacijo novega
- echo '<div id="newMCTable">';
+ echo '<div id="newMCTable" class="divPopUp PopUpNarrow">';
echo '<h2>'.$lang['srv_new_table'].'</h2>';
-
- echo '<div style="float:left; width:400px; text-align:right;">'.$lang['srv_multicrosstabs_tables_name'].': '."\n";
- echo '<input id="newMCTableName" name="newMCTableName" type="text" value="" size="50" /></div>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'new\'); return false;"><span>'.$lang['save'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_new\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '<div class="floatRight clr" style="padding: 15px 5px 15px 0;"><a href="#" onClick="mc_table_action(\'goto_archive\');">'.$lang['srv_analiza_arhiv'].'</a></div>';
- echo '</div>'."\n";
+
+ echo '<div class="setting_holder">';
+ echo '<label>'.$lang['srv_multicrosstabs_tables_name'].':</label>';
+ echo '<input id="newMCTableName" class="text large" name="newMCTableName" type="text" value="" />';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-black" onclick="mc_table_action(\'goto_archive\');">'.$lang['srv_analiza_arhiv'].'</button>';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_new\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onClick="mc_table_action(\'new\'); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za preimenovanje
- echo '<div id="renameMCTable">'.$lang['srv_multicrosstabs_tables_name'].': '."\n";
- echo '<input id="renameMCTableName" name="renameMCTableName" type="text" size="45" />'."\n";
- echo '<input id="renameMCTableId" type="hidden" value="' . $this->table_id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'rename\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_rename_short'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_rename\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="renameMCTable" class="divPopUp PopUpNarrow">';
+
+ echo '<div class="setting_holder">';
+ echo '<div class="setting_item">';
+ echo '<label>'.$lang['srv_multicrosstabs_tables_name'].':</label>';
+ echo '<input id="renameMCTableName" name="renameMCTableName" class="text large" type="text" value="' . $this->table_id . '" />';
+ echo '</div>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_rename\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="mc_table_action(\'rename\');">'.$lang['srv_multicrosstabs_tables_rename_short'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
// div za brisanje
- echo '<div id="deleteMCTable">'.$lang['srv_multicrosstabs_tables_delete_confirm'].': <span id="deleteMCTableName" style="font-weight:bold;"></span>?'."\n";
- echo '<input id="deleteMCTableId" type="hidden" value="' . $this->table_id . '" />'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="mc_table_action(\'delete\'); return false;"><span>'.$lang['srv_multicrosstabs_tables_delete_short'].'</span></a></span></span>'."\n";
- echo '<span class="floatRight spaceLeft" ><span class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="mc_table_action(\'cancel_delete\'); return false;"><span>'.$lang['srv_zapri'].'</span></a></span></span>'."\n";
- echo '</div>'."\n";
+ echo '<div id="deleteMCTable" class="divPopUp PopUpNarrow">';
+
+ echo $lang['srv_multicrosstabs_tables_delete_confirm'].': <span id="deleteMCTableName" class="semi-bold"></span>?';
+ echo '<input id="deleteMCTableId" type="hidden" value="' . $this->table_id . '" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="mc_table_action(\'cancel_delete\'); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="mc_table_action(\'delete\');">'.$lang['srv_multicrosstabs_tables_delete_short'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
}
// Vrnemo vse tabele uporabnika
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php b/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php
index 34819a1..de3a5c2 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyTTest.php
@@ -8,9 +8,9 @@
*
*/
-define("EXPORT_FOLDER", "admin/survey/SurveyData");
-define("BC_PRECISION", 20);
-define("R_FOLDER", "admin/survey/R");
+if(!defined("EXPORT_FOLDER"))define("EXPORT_FOLDER", "admin/survey/SurveyData");
+if(!defined("BC_PRECISION"))define("BC_PRECISION", 20);
+if(!defined("R_FOLDER"))define("R_FOLDER", "admin/survey/R");
class SurveyTTest
{
@@ -28,19 +28,28 @@ class SurveyTTest
public $showChart = false; # ali prikazujemo graf pod tabelo
private $sessionData; # podatki ki so bili prej v sessionu - za nastavitve, ki se prenasajo v izvoze...
-
+
+ protected $currentMissingProfile = null;
+ protected $_HAS_TEST_DATA = null;
+ protected $_CURRENT_STATUS_FILTER = null;
+ protected $_CURRENT_LOOP = null;
+ protected $isArchive = null;
function __construct($sid) {
+ global $global_user_id;
if ((int)$sid > 0) {
+
$this->sid = $sid;
# 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();
+ // Pri glasovanju tega ne pustimo
+ if(SurveyInfo::getInstance()->getSurveyColumn("survey_type") == 0){
+ die();
+ }
# Inicializiramo in polovimo nastavitve missing profila
SurveyStatusProfiles::Init($this->sid);
@@ -142,16 +151,18 @@ class SurveyTTest
// Shranimo spremenjene nastavitve v bazo
SurveyUserSession::saveData($this->sessionData);
+ if(isset($_GET['a'])){
# izvedemo akcijo
switch ($_GET['a']) {
- case 'spremenljivkaChange':
- $this->spremenljivkaChange();
- break;
- case 'variableChange':
- $this->variableChange();
- break;
- default:
- break;
+ case 'spremenljivkaChange':
+ $this->spremenljivkaChange();
+ break;
+ case 'variableChange':
+ $this->variableChange();
+ break;
+ default:
+ break;
+ }
}
// Shranimo spremenjene nastavitve v bazo
SurveyUserSession::saveData($this->sessionData);
@@ -162,20 +173,14 @@ class SurveyTTest
# ali imamo testne podatke
if ($this->_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
- $SSH -> displayTestDataBar(true);
$SSH = new SurveyStaticHtml($this->sid);
+ $SSH -> displayTestDataBar(true);
}
-
- /*echo '<div id="dataOnlyValid">';
- SurveyStatusProfiles::displayOnlyValidCheckbox();
- echo '</div>';*/
-
- //$this->DisplayLinks();
-
+
echo '<div id="ttest_variables">';
$this->DisplayVariables();
echo '</div>'; # id="ttest_variables"
- echo '<br class="clr">';
+
echo '<div id="ttestResults">';
$this->variableChange();
echo '</div>'; # id="ttestResults"
@@ -270,44 +275,48 @@ class SurveyTTest
$variables = $this->getVariableList(2);
- echo '<span id="ttestSpremenljivkaSpan" class="floatLeft">';
- echo $lang['srv_ttest_label1'];
- echo '<br />';
- echo '<select id="ttestSpremenljivka" name="ttestSpremenljivka" onchange="ttestSpremenljivkaChange();" autocomplete="off">';
+ echo '<div id="ttestSpremenljivkaSpan" class="ttestLeftHolder">';
+
+ echo '<span class="title">'.$lang['srv_ttest_label1'].':</span>';
+
+ echo '<select id="ttestSpremenljivka" name="ttestSpremenljivka" class="dropdown large" onchange="ttestSpremenljivkaChange();" autocomplete="off">';
echo '<option value="0" selected="selected" >'. $lang['srv_ttest_select1_option'] . '</option>';
if (count($variables)) {
foreach ($variables as $variable) {
- echo '<option value="'.$variable['spr_id'].'"'
+ echo '<option value="'.(isset($variable['spr_id'])?$variable['spr_id']:'').'"'
. ( isset($variable['grd_id']) ? ' grid="'.$variable['grd_id'].'" ' : '')
. ( isset($variable['vr_id']) ? ' vred="'.$variable['vr_id'].'" ' : '')
. ( isset($variable['sequence']) ? ' seq2="'.$variable['sequence'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variable['spr_id'] != '' && $variable['spr_id'] == $this->sessionData['ttest']['spr2'] && $variable['sequence'] == $this->sessionData['ttest']['seq2'] ? ' selected="selected"':'')
+ . ( isset($variable['spr_id'])&&$variable['spr_id'] != '' && isset($this->sessionData['ttest']['spr2'] )&& $variable['spr_id'] == $this->sessionData['ttest']['spr2'] && $variable['sequence'] == $this->sessionData['ttest']['seq2'] ? ' selected="selected"':'')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
.$variable['variableNaslov'] . '</option>';
}
}
- echo '</select>'; # name="ttestSpremenljivka"
- echo '<br class="clr"/><br/>';
+ echo '</select>';
+
#.(count($this->sessionData['ttest']['sub_conditions']) == 2?'':'class="active"').
$_active = $this->checkSubConditionsActive();
- if ($this->sessionData['ttest']['spr2'] > 0) {
+ if (isset($this->sessionData['ttest']['spr2'])&&$this->sessionData['ttest']['spr2'] > 0) {
echo '<div id="ttestVariablesSpan"'.($_active < 2 ? ' class="active"' : '').'>';
$this->spremenljivkaChange();
echo '</div>';
} else {
echo '<div id="ttestVariablesSpan" style="display:none" '.($_active < 2 ? ' class="active"' : '').'></div>';
}
- echo '</span>';
+
+ echo '</div>';
+
$cntSubConditionsActive = $this->checkSubConditionsActive();
- echo '<span class="floatLeft spaceRight">&nbsp;</span>';
- echo '<span id="ttestNumerusSpan" class="floatLeft'.($cntSubConditionsActive == 2 ? '' : ' gray').'">'; #gray
- echo $lang['srv_ttest_label2'];
- echo '<br />';
- echo '<select id="ttestNumerus" name="ttestNumerus" onchange="ttestVariableChange();" autocomplete="off" '.($cntSubConditionsActive == 2 ? '' : ' disabled="disabled"').'>'; #
+
+ echo '<div id="ttestNumerusSpan" class="ttestRightHolder '.($cntSubConditionsActive == 2 ? '' : ' gray').'">';
+
+ echo '<span class="title">'.$lang['srv_ttest_label2'].':</span>';
+
+ echo '<select id="ttestNumerus" name="ttestNumerus" class="dropdown large" onchange="ttestVariableChange();" autocomplete="off" '.($cntSubConditionsActive == 2 ? '' : ' disabled="disabled"').'>'; #
echo '<option value="0" selected="selected" >'. $lang['srv_ttest_select2_option'] . '</option>';
if (count($numerus)) {
foreach ($numerus as $variable) {
@@ -316,22 +325,33 @@ class SurveyTTest
. ( isset($variable['vr_id']) ? ' vrd="'.$variable['vr_id'].'" ' : '')
. ( isset($variable['sequence']) ? ' seq="'.$variable['sequence'].'" ' : '')
. (( (int)$variable['canChoose'] == 1) ? '' : ' disabled="disabled" ')
- . ( $variable['spr_id'] != '' && $variable['spr_id'] == $selectedVar[0]['spr'] && $variable['sequence'] == $selectedVar[0]['seq']?' selected="selected"':'')
+ . ( isset($selectedVar[0]['spr'])&&$variable['spr_id'] != '' && $variable['spr_id'] == $selectedVar[0]['spr'] && $variable['sequence'] == $selectedVar[0]['seq']?' selected="selected"':'')
. '> '
. ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' ))
. $variable['variableNaslov'] . '</option>';
}
}
- echo '</select>'; # name="ttestSpremenljivka"
- echo '</span>';
+ echo '</select>';
+
+ echo '</div>';
+
- echo '<br /><span style="margin-left: 30px;">';
- echo '<label><input id="showChart" type="checkbox" onchange="showTableChart(\'ttest\');" '.($this->sessionData['ttest_charts']['showChart']==true?' checked="checked"':'' ).'>'.$lang['srv_show_chart'].'</label>';
+ echo '<div class="ttestSubSetting">';
+
+ echo '<span class="title">'.$lang['settings'].':</span>';
+
+ echo '<span class="setting_line">';
+ echo ' <input id="showChart" type="checkbox" onchange="showTableChart(\'ttest\');" '.(isset($this->sessionData['ttest_charts']['showChart'])&&$this->sessionData['ttest_charts']['showChart']==true?' checked="checked"':'' ).'><label for="showChart">'.$lang['srv_show_chart'].'</label>';
echo '</span>';
- echo '<span style="margin-left: 30px;"><a href="https://www.1ka.si/d/sl/pomoc/prirocniki/ttest?from1ka=1" target="_blank">';
- echo $lang['srv_ttest_interpretacija_note'];
- echo '</a></span>';
+
+ /*echo '<span class="setting_line">';
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/prirocniki/ttest?from1ka=1" target="_blank">';
+ echo $lang['srv_ttest_interpretacija_note'];
+ echo ' </a>';
echo Help::display('srv_ttest_interpretation');
+ echo '</span>';*/
+
+ echo '</div>';
// Shranimo spremenjene nastavitve v bazo
@@ -346,7 +366,7 @@ class SurveyTTest
$this->variablesList = array();
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($this->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
if ($witch == 1) {
# prvi drop down, morajo biti numerične ali ordinalne
# skala - 0 Ordinalna
@@ -497,7 +517,7 @@ class SurveyTTest
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable'])&&$grid['variable'] != '') {
$sub++;
$this->variablesList[] = array(
'tip'=>$tip,
@@ -536,16 +556,17 @@ class SurveyTTest
if (isset($this->sessionData['ttest']['spr2']) && $this->sessionData['ttest']['spr2'] != 0){
$_spr = explode('_',$this->sessionData['ttest']['spr2']);
- #$spr = $_spr[0];
$spr = $this->sessionData['ttest']['spr2'];
if (isset($this->sessionData['ttest']['grid2'])){
$grid = $this->sessionData['ttest']['grid2'];
}
+
# poiščemo pripadajoče variable
$_spr_data = $this->_HEADERS[$this->sessionData['ttest']['spr2']];
- echo $lang['srv_ttest_kategories_note'].' ('.$_spr_data['variable'].') '.$_spr_data['naslov'];
- echo '<br/>';
+
+ echo '<span class="title">'.$lang['srv_ttest_kategories_note'].' ('.$_spr_data['variable'].') '.$_spr_data['naslov'].'</span>';
+
switch ($_spr_data['tip']) {
case 1: #radio
case 3: #dropdown
@@ -553,31 +574,42 @@ class SurveyTTest
#nardimo inpute za vse opcije
$sekvenca = $_spr_data['sequences'];
foreach ($_spr_data['options'] as $value => $option) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>('.$value.') - '.$option.'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'">('.$value.') - '.$option.'</label>';
+ echo '</span>';
}
break;
- case 2: #checkbox
+ case 2: #checkbox
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][0]['variables'] as $vid => $variable) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option. '" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'">('.$variable['variable'].') - '.$variable['naslov'].'</label>';
+ echo '</span>';
}
break;
- case 6: #mgrid
+ case 6: #mgrid
#nardimo inpute za vse opcije
$sekvenca = $this->sessionData['ttest']['seq2'];
foreach ($_spr_data['options'] as $value => $option) {
- //$sekvenca = $_spr_data['grids'][$value]['variables'][0]['sequence'];
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>('.$value.') - '.$option.'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'" type="checkbox" value="'.$spr.'_'.$sekvenca.'_'.$value.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$sekvenca.'_'.$value).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$sekvenca.'_'.$value.'">('.$value.') - '.$option.'</label>';
+ echo '</span>';
}
break;
- case 16: #mcheck
+ case 16: #mcheck
#nardimo inpute za vse opcije
# poiščemo pripadajočo sekvenco
#nardimo inpute za vse opcije
$option = '1';
foreach ($_spr_data['grids'][$grid]['variables'] as $vid => $variable) {
- echo '<label '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'class="gray"' : '').'><input name="subTtest" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>('.$variable['variable'].') - '.$variable['naslov'].'</label><br/>';
+ echo '<span class="setting_line '.($this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option) == ' disabled="disabled"' ? 'gray' : '').'">';
+ echo ' <input name="subTtest" id="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'" type="checkbox" value="'.$spr.'_'.$variable['sequence'].'_'.$option.'" onchange="ttestVariableChange();"'.$this->checkboxSubCondition($spr.'_'.$variable['sequence'].'_'.$option).'/>';
+ echo ' <label for="subTtest_'.$spr.'_'.$variable['sequence'].'_'.$option.'">('.$variable['variable'].') - '.$variable['naslov'].'</label>';
+ echo '</span>';
}
break;
@@ -602,20 +634,16 @@ class SurveyTTest
function variableChange() {
global $admin_type;
- if (count($this->sessionData['ttest']['sub_conditions']) > 1 ) {
+ if (isset($this->sessionData['ttest']['sub_conditions'])&&count($this->sessionData['ttest']['sub_conditions']) > 1 ) {
$variables1 = $this->getSelectedVariables();
- if (count($variables1) > 0) {
+ if (isset($variables1)&&count($variables1) > 0) {
+
// ikone za izvoz
$this->displayExport();
+
foreach ($variables1 AS $v_first) {
- $ttest = null;
- /*$ttest = $this->createTTestOld($v_first, $this->sessionData['ttest']['sub_conditions']);
- $this->displayTtestTable($ttest);*/
- $ttest = $this->createTTest($v_first, $this->sessionData['ttest']['sub_conditions']);
- $this->displayTtestTable($ttest);
-
- // Zvezdica za vkljucitev v porocilo
+ // Zvezdica za vkljucitev v porocilo
$spid1 = $this->sessionData['ttest']['variabla'][0]['spr'];
$seq1 = $this->sessionData['ttest']['variabla'][0]['seq'];
$grid1 = $this->sessionData['ttest']['variabla'][0]['grd'];
@@ -629,6 +657,11 @@ class SurveyTTest
$spr1 = $seq2.'-'.$spid2.'-'.$grid2.'-'.$sub1.'-'.$sub2;
$spr2 = $seq1.'-'.$spid1.'-'.$grid1;
SurveyAnalysis::addCustomReportElement($type=7, $sub_type=0, $spr1, $spr2);
+
+ // Tabela
+ $ttest = null;
+ $ttest = $this->createTTest($v_first, $this->sessionData['ttest']['sub_conditions']);
+ $this->displayTtestTable($ttest);
// Izrisemo graf za tabelo
if(isset($this->sessionData['ttest_charts']['showChart']) && $this->sessionData['ttest_charts']['showChart'] == true){
@@ -646,7 +679,7 @@ class SurveyTTest
function getSelectedVariables() {
$selected = array();
- if (count($this->sessionData['ttest']['variabla']) > 0 ) {
+ if (isset($this->sessionData['ttest']['variabla'])&&count($this->sessionData['ttest']['variabla']) > 0 ) {
foreach ($this->sessionData['ttest']['variabla'] AS $var1) {
if ((int)$var1['seq'] > 0) {
$selected[] = $var1;
@@ -760,7 +793,7 @@ class SurveyTTest
}
}
-
+ $additional_status_filter = null;
# dodamo status filter za vse sekvence checkbox-a da so == 1
if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
@@ -931,9 +964,9 @@ class SurveyTTest
}
# dodamo status filter za vse sekvence checkbox-a da so == 1
- if ($additional_status_filter != null) {
+ /* if ($additional_status_filter != null) {
$status_filter .= $additional_status_filter;
- }
+ } */
# odstranimo vse zapise, kjer katerakoli od variabel vsebuje missing
$_allMissing_answers = SurveyMissingValues::GetMissingValuesForSurvey(array(1,2,3));
@@ -992,22 +1025,28 @@ class SurveyTTest
$grid1 = $this->sessionData['ttest']['variabla'][0]['grd'];
if (is_array($ttest) && count($ttest) > 0 && (int)$seq1 > 0) {
+
if ($this->isArchive == false) {
+
echo '<div id="displayFilterNotes">';
+
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
SurveyTimeProfiles :: printIsDefaultProfile();
- # če imamo filter ifov ga izpišemo
- SurveyConditionProfiles:: getConditionString($doNewLine );
- # če imamo filter spremenljivk ga izpišemo
- SurveyVariablesProfiles:: getProfileString($doNewLine, true);
- SurveyDataSettingProfiles :: getVariableTypeNote($doNewLine );
- # če rekodiranje
+
+ # če imamo filter ifov ga izpišemo
+ SurveyConditionProfiles:: getConditionString();
+
+ # če imamo filter spremenljivk ga izpišemo
+ SurveyVariablesProfiles:: getProfileString();
+ SurveyDataSettingProfiles :: getVariableTypeNote();
+
+ # če rekodiranje
$SR = new SurveyRecoding($this->sid);
$SR -> getProfileString();
+
echo '</div>';
-
- echo '<br class="clr" />';
}
+
$spr_data_1 = $this->_HEADERS[$spid1];
if ($grid1 == 'undefined') {
@@ -1022,7 +1061,8 @@ class SurveyTTest
}
}
}
- } else {
+ }
+ else {
# imamo subgrid
$sprLabel1 = '('.$spr_data_1['grids'][$grid1]['variable'].') '. $spr_data_1['grids'][$grid1]['naslov'];
}
@@ -1032,84 +1072,101 @@ class SurveyTTest
$sprLabel2 = trim($this->sessionData['ttest']['label2']);
$label1 = $this->getVariableLabels($this->sessionData['ttest']['sub_conditions'][0]);
$label2 = $this->getVariableLabels($this->sessionData['ttest']['sub_conditions'][1]);
- echo '<table border="0" class="ttestTable">';
- echo '<tr>';
+
+
+ echo '<table class="table_ttest">';
+
+
+ echo '<tr class="row1">';
+
#labele
- echo '<td class="lightGreen" rowspan="2" >';
- echo '<span class="anl_variabla">';
- echo '<a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid2.'\'); return false;">';
- echo $sprLabel2.'</a>';
- echo '</span>';
+ echo '<td class="cell_question" rowspan="2" >';
+ echo ' <span class="anl_variabla">';
+ echo ' <a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid2.'\'); return false;">';
+ echo $sprLabel2;
+ echo ' </a>';
+ echo ' </span>';
echo '</td>';
- echo '<td class="lightGreen" colspan="9">';
- echo '<span class="anl_variabla">';
- echo '<a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid1.'\'); return false;">';
- echo $sprLabel1.'</a>';
- echo '</span>';
+ echo '<td class="cell_question" colspan="9">';
+ echo ' <span class="anl_variabla">';
+ echo ' <a href="#" onclick="showspremenljivkaSingleVarPopup(\''.$spid1.'\'); return false;">';
+ echo $sprLabel1;
+ echo ' </a>';
+ echo ' </span>';
echo '</td>';
+
echo '</tr>';
- echo '<tr>';
- #echo '<th colspan="2">&nbsp;</th>';
+
+
+ echo '<tr class="row2">';
+
#frekvenca
- echo '<th >n</th>';
+ echo '<td class="cell_value">n</td>';
#povprečje
- echo '<th><span class="avg">x</span></th>';
+ echo '<td class="cell_value"><span class="avg">x</span></td>';
#varianca
- echo '<th>s&#178;</th>';
+ echo '<td class="cell_value">s&#178;</td>';
#standardna napaka
- echo '<th>se(<span class="avg">x</span>)</th>';
+ echo '<td class="cell_value">se(<span class="avg">x</span>)</td>';
#margini
- echo '<th>&#177;1,96&#215;se(<span class="avg">x</span>)</th>';
+ echo '<td class="cell_value">&#177;1,96&#215;se(<span class="avg">x</span>)</td>';
#d
- echo '<th>d</th>';
+ echo '<td class="cell_value">d</td>';
#sed
- echo '<th>se(d)</th>';
+ echo '<td class="cell_value">se(d)</td>';
#signifikanca
- echo '<th>Sig.</th>';
+ echo '<td class="cell_value">Sig.</td>';
#ttest
- echo '<th>t</th>';
+ echo '<td class="cell_value">t</td>';
+
echo '</tr>';
+
echo '<tr>';
- #labele
-
- echo '<td class="lightGreen">'.$label1.'</td>';
+ #labele
+ echo '<td class="cell_question">'.$label1.'</td>';
#frekvenca
- echo '<td>'.$this->formatNumber($ttest[1]['n'],0).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['n'],0).'</td>';
#povprečje
- echo '<td>'.$this->formatNumber($ttest[1]['x'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['x'],3).'</td>';
#varianca
- echo '<td>'.$this->formatNumber($ttest[1]['s2'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['s2'],3).'</td>';
#standardna napaka
- echo '<td>'.$this->formatNumber($ttest[1]['se'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['se'],3).'</td>';
#margini
- echo '<td>'.$this->formatNumber($ttest[1]['margin'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[1]['margin'],3).'</td>';
#d
- echo '<td rowspan="2">'.$this->formatNumber($ttest['d'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['d'],3).'</td>';
#sed
- echo '<td rowspan="2">'.$this->formatNumber($ttest['sed'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['sed'],3).'</td>';
#sig
- echo '<td rowspan="2">'.$this->formatNumber($ttest['sig'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['sig'],3).'</td>';
#ttest
- echo '<td rowspan="2">'.$this->formatNumber($ttest['t'],3).'</td>';
+ echo '<td class="cell_value" rowspan="2">'.$this->formatNumber($ttest['t'],3).'</td>';
+
echo '</tr>';
+
echo '<tr>';
+
#labele
- echo '<td class="lightGreen">'.$label2.'</td>';
+ echo '<td class="cell_question">'.$label2.'</td>';
#frekvenca
- echo '<td>'.$this->formatNumber($ttest[2]['n'],0).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['n'],0).'</td>';
#povprečje
- echo '<td>'.$this->formatNumber($ttest[2]['x'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['x'],3).'</td>';
#varianca
- echo '<td>'.$this->formatNumber($ttest[2]['s2'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['s2'],3).'</td>';
#standardna napaka
- echo '<td>'.$this->formatNumber($ttest[2]['se'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['se'],3).'</td>';
#margini
- echo '<td>'.$this->formatNumber($ttest[2]['margin'],3).'</td>';
+ echo '<td class="cell_value">'.$this->formatNumber($ttest[2]['margin'],3).'</td>';
+
echo '</tr>';
+
+
echo '</table>';
}
@@ -1171,7 +1228,7 @@ class SurveyTTest
function checkboxSubCondition($checkCondition) {
$cnt = $this->checkSubConditionsActive();
- $sub_Conditions = $this->sessionData['ttest']['sub_conditions'];
+ $sub_Conditions = isset($this->sessionData['ttest']['sub_conditions'])?$this->sessionData['ttest']['sub_conditions']:array();
if (is_array($sub_Conditions) && count($sub_Conditions) > 0) {
foreach ($sub_Conditions AS $sub_condition) {
if ($sub_condition == $checkCondition) {
@@ -1190,9 +1247,9 @@ class SurveyTTest
$cnt = 0;
- $needle = $this->sessionData['ttest']['spr2'];
+ $needle = isset($this->sessionData['ttest']['spr2'])?$this->sessionData['ttest']['spr2']:"";
$length = strlen($needle);
- $sub_Conditions = $this->sessionData['ttest']['sub_conditions'];
+ $sub_Conditions = isset($this->sessionData['ttest']['sub_conditions'])?$this->sessionData['ttest']['sub_conditions']:array();
if (is_array($sub_Conditions) && count($sub_Conditions) > 0) {
foreach ($sub_Conditions AS $haystack) {
$cnt += (int)(substr($haystack, 0, $length) === $needle);
diff --git a/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php b/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php
index 8b51105..70cb499 100644
--- a/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php
+++ b/admin/survey/classes/surveyAnalysis/class.SurveyTableChart.php
@@ -4,7 +4,7 @@
* @date April 2012
*/
-define("SAA_FOLDER", "AnalysisArchive");
+if(!defined("SAA_FOLDER"))define("SAA_FOLDER", "AnalysisArchive");
class SurveyTableChart {
@@ -166,7 +166,7 @@ class SurveyTableChart {
}
}
}
- if (count($this->classInstance->variabla1) > 0 && $is_check == false ) { # če še ni bil checkbox
+ if (count($this->classInstance->variabla1) > 0) { # če še ni bil checkbox
foreach ($this->classInstance->variabla1 AS $key => $var) {
$spr_tip = $this->classInstance->_HEADERS[$var['spr']]['tip'];
if ( $spr_tip == 2 || $spr_tip == 16 ) {
@@ -321,10 +321,10 @@ class SurveyTableChart {
// Cache
$Cache = new pCache(dirname(__FILE__).'/../../pChart/Cache/');
- $ID = $this->generateChartId($chartID, $this->settings, $DataSet->GetNumerus());
+ $ID = $this->generateChartId($chartID, $this->settings, ($DataSet!==null?$DataSet->GetNumerus():0));
// Ce se nimamo zgeneriranega grafa
- if( !$Cache->isInCache($ID, $DataSet->GetData()) ){
+ if( !$Cache->isInCache($ID, ($DataSet!==null?$DataSet->GetData():array())) ){
switch($this->settings['type']){
@@ -335,11 +335,11 @@ class SurveyTableChart {
}
// Shranimo v cache
- $Cache->WriteToCache($ID,$DataSet->GetData(),$Test);
+ $Cache->WriteToCache($ID,($DataSet!==null?$DataSet->GetData():array()),$Test);
}
// dobimo ime slike c cache-u
- $imgName = $Cache->GetHash($ID,$DataSet->GetData());
+ $imgName = $Cache->GetHash($ID,($DataSet!==null?$DataSet->GetData():array()));
if ($this->isArchive == false) {
$imgPath = 'pChart/Cache/'.$imgName;
@@ -356,7 +356,7 @@ class SurveyTableChart {
echo '<div class="chart_title">';
$title = $lang['srv_chart_ttest_title'].':<br />';
$title .= '<table><tr>';
- $title .= '<td style="width:380px; text-align: right;">'.$this->crosstabVars[0] . '</td><td style="width:40px;"> / </td><td style="width:380px; text-align: left;">' . $this->crosstabVars[1].'</td>';
+ $title .= '<td style="width:380px; text-align: right;">'.(isset($this->crosstabVars[0])?$this->crosstabVars[0]:'') . '</td><td style="width:40px;"> / </td><td style="width:380px; text-align: left;">' . (isset($this->crosstabVars[1])?$this->crosstabVars[1]:'') .'</td>';
$title .= '</tr></table>';
echo $title;
echo '</div>';
@@ -408,6 +408,7 @@ class SurveyTableChart {
// Napolnimo podatke za graf
$DataSet = $this->getTTestDataSet($chartID, $this->settings);
+ $DataSet = $DataSet!==null?$DataSet:new pData();
// Cache
$Cache = new pCache(dirname(__FILE__).'/../../pChart/Cache/');
@@ -520,8 +521,8 @@ class SurveyTableChart {
global $site_path;
global $lang;
- $tip = $this->break_spremenljivka['tip'];
- $skala = $this->break_spremenljivka['skala'];
+ $tip = isset($this->break_spremenljivka['tip'])?$this->break_spremenljivka['tip']:null;
+ $skala = isset($this->break_spremenljivka['tip'])?$this->break_spremenljivka['skala']:null;
// Izrisemo poseben break graf (multigrid, multicheckbox, multitext, multinumber)
if( in_array($tip, array(7,17,18,20,)) || ($tip == 6 && $skala == 0) ){
@@ -694,8 +695,8 @@ class SurveyTableChart {
$spr1 = $this->classInstance->_HEADERS[$v_first['spr']];
$spr2 = $this->classInstance->_HEADERS[$v_second['spr']];
- $grid1 = $spr1['grids'][$v_first['grd']];
- $grid2 = $spr2['grids'][$v_second['grd']];
+ $grid1 = isset($spr1['grids'][$v_first['grd']])?$spr1['grids'][$v_first['grd']]:array();
+ $grid2 = isset($spr2['grids'][$v_second['grd']])?$spr2['grids'][$v_second['grd']]:array();
#število vratic in število kolon
$cols = count($crosstabs['options1']);
@@ -804,8 +805,9 @@ class SurveyTableChart {
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
$cnt++;
- $dataArray[$cnt][] = ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
- $dataPercentArray[$cnt][] = $this->classInstance->getCrossTabPercentage($crosstabs['sumaVrstica'][$ckey2], $crosstabs_value[$ckey1][$ckey2]);
+ $dataArray[$cnt][] = (isset($crosstabs_value[$ckey1][$ckey2])&&(int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ $dataPercentArray[$cnt][] = $this->classInstance->getCrossTabPercentage((isset($crosstabs['sumaVrstica'][$ckey2])?$crosstabs['sumaVrstica'][$ckey2]:0)
+ , (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:0));
/*
# celica z vebino
@@ -886,11 +888,11 @@ class SurveyTableChart {
global $lang;
$DataSet = null;
-
+ $ttest = null;
$variables1 = $this->classInstance->getSelectedVariables();
foreach ($variables1 AS $v_first) {
- if($this->counter == $counter){
+ if($this->counter == null){
$ttest = null;
$ttest = $this->classInstance->createTTest($v_first, $this->sessionData['ttest']['sub_conditions']);
@@ -966,6 +968,7 @@ class SurveyTableChart {
if (is_array($variables2) && count($variables2) > 0) {
foreach ($variables2 AS $v_second) {
if (is_array($variables1) && count($variables1) > 0) {
+ $c1=0;
foreach ($variables1 AS $v_first) {
$_means = $this->classInstance->createMeans($v_first, $v_second);
if ($_means != null) {
@@ -994,20 +997,20 @@ class SurveyTableChart {
#število vratic in število kolon
- $cols = count($_means);
+ //$cols = count($_means);
# preberemo kr iz prvega loopa
- $rows = count($_means[0]['options']);
+ //$rows = count($_means[0]['options']);
// loop po vrsticah
- if (count($_means[0]['options']) > 0) {
+ if (isset($_means[0]['options'])&&count($_means[0]['options']) > 0) {
foreach ($_means[0]['options'] as $ckey2 =>$crossVariabla2) {
// IME VARIABLE
$variableArray[] = $crossVariabla2['naslov'];
// VREDNOST VARIABLE
- $dataArray[] = $this->classInstance->formatNumber($_means[0]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'));
+ $dataArray[] = $this->classInstance->formatNumber((isset($_means[0]['result'][$ckey2])?$_means[0]['result'][$ckey2]:null), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'));
}
}
@@ -1090,7 +1093,7 @@ class SurveyTableChart {
#povprečja
$avg = $this->classInstance->formatNumber($means[$fkey][$oKey][$sequence],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
# enote
- $enote = (int)$this->break_frequencys[$fkey][$oKey][$sequence]['validCnt'];
+ $enote = isset($this->break_frequencys[$fkey][$oKey][$sequence]['validCnt'])? (int)$this->break_frequencys[$fkey][$oKey][$sequence]['validCnt']:0;
$tempArray = array();
@@ -1101,8 +1104,8 @@ class SurveyTableChart {
$dataArray[] = $tempArray;
- $totalMeans[$sequence] += ($means[$fkey][$oKey][$sequence]*(int)$this->break_frequencys[$fkey][$oKey][$sequence]['validCnt']);
- $totalFreq[$sequence]+= (int)$this->break_frequencys[$fkey][$oKey][$sequence]['validCnt'];
+ $totalMeans[$sequence] = (isset($totalMeans[$sequence])? $totalMeans[$sequence] += ($means[$fkey][$oKey][$sequence]*$enote): $means[$fkey][$oKey][$sequence]*$enote);
+ $totalFreq[$sequence] = (isset($totalFreq[$sequence])?$totalFreq[$sequence]+= $enote:$enote);
}
}
@@ -1493,7 +1496,7 @@ class SurveyTableChart {
else
$legend = '';
- $ID = $this->anketa.'_chart_'.$chartID.'_counter_'.$counter.'_mv_'.SurveyAnalysis::$missingProfileData['display_mv_type'];
+ $ID = $this->anketa.'_chart_'.$chartID.'_counter_'./* $counter .*/'_mv_'.SurveyAnalysis::$missingProfileData['display_mv_type'];
foreach ($settings AS $key => $val) {
if($key == 'colors'){
@@ -1506,7 +1509,7 @@ class SurveyTableChart {
}
elseif($key != 'name')
- $ID .= '_'.$key.'_'.$val;
+ $ID .= '_'.$key.'_'.json_encode($val);
}
$ID .= '_skin_'.$this->skin;
@@ -1705,8 +1708,7 @@ class SurveyTableChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
$Test->setGraphArea($this->settings['hq']*100,$this->settings['hq']*40,$this->settings['hq']*650,$this->settings['hq']*220);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*(243+$addHeight),5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,0,0,0,TRUE,$angle,0,TRUE,1,FALSE,$roundText);
$Test->drawGrid(4,TRUE,230,230,230,50);
@@ -1744,7 +1746,7 @@ class SurveyTableChart {
global $lang;
// Nastavimo visino grafa (ce imamo vec kot 7 variabel/gridov)
- $Data = $DataSet->GetData();
+ $Data = ($DataSet!==null?$DataSet->GetData():array());
$countGrids = count($Data);
$addHeight = $countGrids > 5 ? ($countGrids-5)*30 : 0;
@@ -1764,15 +1766,14 @@ class SurveyTableChart {
$Test->setGraphArea($this->settings['hq']*$startX,$this->settings['hq']*70,$this->settings['hq']*650,$this->settings['hq']*(220+$addHeight));
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*(243+$addHeight),5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
// Če gre za hierarhijo, potem je fiksna skala
if(SurveyInfo::checkSurveyModule('hierarhija', $this->anketa))
$Test->setFixedScale(1,5,4);
- $Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,0,0,0,TRUE,0,0,TRUE,1,FALSE,$roundText);
+ $Test->drawHorScale($Data,($DataSet!==null?$DataSet->GetDataDescription():array()),SCALE_START0,0,0,0,TRUE,0,0,TRUE,1,FALSE,$roundText);
$Test->drawHorGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
@@ -1782,11 +1783,11 @@ class SurveyTableChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
// Draw the bar graph
- $Test->drawHorBarGraph($DataSet->GetData(),$DataSet->GetDataDescription(), $this->settings['barLabel']);
+ $Test->drawHorBarGraph($Data,($DataSet!==null?$DataSet->GetDataDescription():array()), $this->settings['barLabel']);
// Finish the graph
if($show_legend == 1)
- $Test->drawLegend($this->settings['hq']*680,$this->settings['hq']*60,$DataSet->GetDataDescription(),255,255,255);
+ $Test->drawLegend($this->settings['hq']*680,$this->settings['hq']*60,($DataSet!==null?$DataSet->GetDataDescription():array()),255,255,255);
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
@@ -1810,7 +1811,7 @@ class SurveyTableChart {
// Prikaz t vrednosti pri ttest grafu
if($this->podstran == 'ttest' && $this->settings['show_numerus'] == '1'){
- $t = 't = '.$DataSet->GetNumerus();
+ $t = 't = '.($DataSet!==null?$DataSet->GetNumerus():0);
$Test->drawTextBox($this->settings['hq']*680,$this->settings['hq']*210,$this->settings['hq']*795,$this->settings['hq']*220,$t,$Angle=0,$R=0,$G=0,$B=0,$Align=ALIGN_LEFT,$Shadow=FALSE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=0);
}
@@ -1849,8 +1850,7 @@ class SurveyTableChart {
$Test->setGraphArea($this->settings['hq']*100,$this->settings['hq']*40,$this->settings['hq']*650,$this->settings['hq']*220);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*(243+$addHeight),5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,$angle,0,TRUE,1,FALSE,$roundText);
$Test->drawGrid(4,TRUE,230,230,230,50);
@@ -1905,24 +1905,12 @@ class SurveyTableChart {
$roundText = ($this->settings['labelWidth'] == 20) ? 35 : 65;
// Pri navadnem radio in checkbox vprasanju imamo samo en stolpec - zato so dimenzije drugacne
- /*if($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 2 || $spremenljivka['tip'] == 3){
- $Test->setGraphArea($this->settings['hq']*200,$this->settings['hq']*50,$this->settings['hq']*630,$this->settings['hq']*220);
- $Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*243,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*295,200,200,200);
- $Test->drawGraphArea(255,255,255,TRUE);
- $Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,0,0,TRUE);
- $Test->drawHorGrid(4,TRUE,230,230,230,50);
- }
- else{*/
- $Test->setGraphArea($this->settings['hq']*$startX,$this->settings['hq']*70,$this->settings['hq']*650,$this->settings['hq']*(220+$addHeight));
- $Test->drawFilledRoundedRectangle(7,7,793,243+$addHeight,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(295+$addHeight),200,200,200);
- $Test->drawGraphArea(255,255,255,TRUE);
- $Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,0,0,TRUE,1,FALSE,$roundText);
- $Test->drawHorGrid(4,TRUE,230,230,230,50);
- //}
+ $Test->setGraphArea($this->settings['hq']*$startX,$this->settings['hq']*70,$this->settings['hq']*650,$this->settings['hq']*(220+$addHeight));
+ $Test->drawFilledRoundedRectangle(7,7,793,243+$addHeight,5,255,255,255);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(295+$addHeight),200,200,200);
+ $Test->drawGraphArea(255,255,255,TRUE);
+ $Test->drawHorScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_ADDALLSTART0,0,0,0,TRUE,0,0,TRUE,1,FALSE,$roundText);
+ $Test->drawHorGrid(4,TRUE,230,230,230,50);
// Draw the 0 line
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*6);
@@ -1951,7 +1939,7 @@ class SurveyTableChart {
$strings = explode('<br />',$this->crosstabVars[1]);
$substr1 = (strlen($strings[0]) > 50) ? substr($strings[0], 0, 47).'...' : $strings[0];
- $substr2 = (strlen($strings[1]) > 50) ? substr($strings[1], 0, 47).'...' : $strings[1];
+ $substr2 = isset($strings[1]) ? ((strlen($strings[1]) > 50) ? substr($strings[1], 0, 47).'...' : $strings[1]):'';
$Test->drawTextBox($this->settings['hq']*50,$this->settings['hq']*20,$this->settings['hq']*280,$this->settings['hq']*30,$substr1,$Angle=0,$R=0,$G=0,$B=0,$Align=ALIGN_CENTER,$Shadow=FALSE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=0);
$Test->drawTextBox($this->settings['hq']*50,$this->settings['hq']*38,$this->settings['hq']*280,$this->settings['hq']*43,$substr2,$Angle=0,$R=0,$G=0,$B=0,$Align=ALIGN_CENTER,$Shadow=FALSE,$BgR=-1,$BgG=-1,$BgB=-1,$Alpha=0);
@@ -1975,12 +1963,8 @@ class SurveyTableChart {
$Test->setLineStyle($this->settings['hq'],$DotSize=0);
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
- //$Test->setGraphArea(50,40,685,220);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
- //$Test->createColorGradientPalette(195,204,56,223,110,41,3);
- //$Test->createColorGradientPalette(168,188,56,248,255,136,5);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
// Draw the pie graph
$labels = ($this->settings['sort'] == 1) ? 'custom_percent_sort' : 'custom_percent';
@@ -2018,12 +2002,8 @@ class SurveyTableChart {
$Test->setLineStyle($this->settings['hq'],$DotSize=0);
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
- //$Test->setGraphArea(50,40,685,220);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
- //$Test->createColorGradientPalette(195,204,56,223,110,41,3);
- //$Test->createColorGradientPalette(168,188,56,248,255,136,5);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
// Draw the pie graph
$labels = ($this->settings['sort'] == 1) ? 'custom_percent_sort' : 'custom_percent';
@@ -2067,8 +2047,7 @@ class SurveyTableChart {
$Test->setGraphArea($this->settings['hq']*270,$this->settings['hq']*50,$this->settings['hq']*530,$this->settings['hq']*(220+$addHeight));
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*(243+$addHeight),5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*(245+$addHeight),200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
@@ -2122,11 +2101,7 @@ class SurveyTableChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
$Test->setGraphArea($this->settings['hq']*100,$this->settings['hq']*40,$this->settings['hq']*650,$this->settings['hq']*320);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*343,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*345,200,200,200);
- //$Test->drawGraphArea(255,255,255,TRUE);
- //$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,20,20,20,TRUE,$angle,0,TRUE,1,FALSE,$roundText);
- //$Test->drawGrid(4,TRUE,230,230,230,50);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*345,200,200,200);
// Draw the 0 line
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
@@ -2179,8 +2154,7 @@ class SurveyTableChart {
$Test->setFontProperties(dirname(__FILE__).'/../../pChart/Fonts/verdana.ttf',$this->settings['hq']*$this->fontSize);
$Test->setGraphArea($this->settings['hq']*100,$this->settings['hq']*40,$this->settings['hq']*650,$this->settings['hq']*220);
$Test->drawFilledRoundedRectangle($this->settings['hq']*7,$this->settings['hq']*7,$this->settings['hq']*793,$this->settings['hq']*273,5,255,255,255);
- //$Test->drawRoundedRectangle(5,5,795,245,5,128,128,128);
- $Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
+ //$Test->drawRectangle($this->settings['hq']*5,$this->settings['hq']*5,$this->settings['hq']*795,$this->settings['hq']*275,200,200,200);
$Test->drawGraphArea(255,255,255,TRUE);
$Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_START0,0,0,0,TRUE,$angle,0,TRUE);
if($count <= 20)
@@ -2213,13 +2187,16 @@ class SurveyTableChart {
global $lang;
// Ikone izvoza na vrhu posameznih nastavitev
- //$this->displayExportIcons($chartID);
-
-
- echo '<div id="switch_left_'.$chartID.'_loop_0" class="switch_left '.($this->settings_mode == 1 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$chartID.'\', \'0\', \'0\')">'.$lang['srv_chart_settings_basic'].'</div>';
- //echo '<span id="switch_middle_'.$chartID.'_loop_0" class="'.($this->settings_mode == 1 ? 'rightHighlight' : 'leftHighlight').'"></span>';
- echo '<div id="switch_right_'.$chartID.'_loop_0" class="switch_right '.($this->settings_mode == 0 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$chartID.'\', \'1\', \'0\')">'.$lang['srv_chart_settings_advanced'].'</div>';
+ $this->displayExportIcons($chartID);
+
+ echo '<div class="chart_settings_content">';
+
+
+ echo '<div class="tab_holder">';
+ echo ' <div id="switch_left_'.$chartID.'_loop_0" class="tab switch_left '.($this->settings_mode == 1 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$chartID.'\', \'0\', \'0\')">'.$lang['srv_chart_settings_basic'].'</div>';
+ echo ' <div id="switch_right_'.$chartID.'_loop_0" class="tab switch_right '.($this->settings_mode == 0 ? ' non-active' : '').'" onClick="chartSwitchSettings(\''.$chartID.'\', \'1\', \'0\')">'.$lang['srv_chart_settings_advanced'].'</div>';
+ echo '</div>';
// OSNOVNE NASTAVITVE
echo '<div class="chart_settings_inner" id="chart_settings_basic_'.$chartID.'_loop_0" '.($this->settings_mode == 1 ? ' style="display:none;"' : '').'>';
@@ -2261,8 +2238,8 @@ class SurveyTableChart {
// visoka locljivost grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hq'].': ';
echo '<input type="checkbox" id="tablechart_hq_'.$chartID.'" name="tablechart_hq" '.($settings['hq']=='3'?' checked="checked"':'').' onchange="changeTableChart(\''.$chartID.'\', \''.$this->podstran.'\', \'hq\');">';
+ echo '<label for="tablechart_hq_'.$chartID.'">'.$lang['srv_chart_hq'].'</label>';
echo '</div>';
break;
@@ -2273,33 +2250,18 @@ class SurveyTableChart {
$checked = ($settings['show_numerus']=='1') ? ' checked="checked"': '';
- echo $lang['srv_chart_showNumerus'].': ';
echo '<input type="checkbox" id="tablechart_show_numerus_'.$chartID.'" name="tablechart_show_numerus" '.$checked.' onchange="changeTableChart(\''.$chartID.'\', \'ttest\', \'show_numerus\');">';
+ echo '<label for="tablechart_show_numerus_'.$chartID.'">'.$lang['srv_chart_showNumerus'].'</label>';
echo '</div>';
default:
break;
- }
-
-
- // Link na urejanje label
- //echo '<span class="edit" style="margin-top:15px;" onclick="chartAdvancedSettings(\''.$this->counter.'\');">'.$lang['srv_chart_advancedLink_labels'].'</span>';
- // Vprasajcek za pomoc
- //echo Help :: display('displaychart_settings_labels');
-
- // Link na urejanje barv
- echo '<span class="edit" onclick="tableChartAdvancedSettings(\''.$chartID.'\', \''.$this->podstran.'\')">'.$lang['srv_chart_advancedLink_colors'].'</span>';
- // Vprasajcek za pomoc
- echo Help :: display('displaychart_settings_colors');
-
- // Link na rekodiranje
- //echo '<span class="edit" onclick="chartAdvancedSettings(\''.$this->counter.'\', \'3\');">'.$lang['srv_chart_advancedLink_recoding'].'</span>';
- // Vprasajcek za pomoc
- //echo Help :: display('displaychart_settings_recoding');
-
+ }
echo '</div>';
+
+ echo '</div>';
}
// ikone na vrhu posameznih nastavitev (izvozi)
@@ -2310,16 +2272,9 @@ class SurveyTableChart {
// linki
echo '<div class="chart_setting_exportLinks">';
- // Ikona za print
- echo '<a href="#" onclick="showAnalizaSingleChartPopup(\''.$chartID.'\',\''.M_ANALYSIS_CHARTS.'\'); return false;">';
- echo '<span class="faicon print_small icon-grey_dark_link" title="' . $lang['PRN_Izpis'] . '"></span>';
- echo '</a>';
+ // Gumb za nastavitve
+ echo '<button class="small white-blue" onClick="tableChartAdvancedSettings(\''.$chartID.'\', \''.$this->podstran.'\');"><span class="faicon wheel_32"></span>'.$lang['settings'].'</button>';
- // Izvoz posameznega grafa v PDF/RTF/PPT
- echo '&nbsp;<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts&anketa='.$this->anketa.'&sprID='.$chartID).'" target="_blank" title="'.$lang['PDF_Izpis'].'"><span class="faicon pdf"></span>&nbsp;</a>';
- echo '&nbsp;<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_rtf&anketa='.$this->anketa.'&sprID='.$chartID).'" target="_blank" title="'.$lang['RTF_Izpis'].'"><span class="faicon rtf"></span>&nbsp;</a>';
- echo '&nbsp;<a href="'.makeEncodedIzvozUrlString('izvoz.php?m=charts_ppt&anketa='.$this->anketa.'&sprID='.$chartID).'" target="_blank" title="'.$lang['PPT_Izpis'].'"><span class="faicon ppt"></span>&nbsp;</a>';
-
echo '</div>';
}
@@ -2331,7 +2286,7 @@ class SurveyTableChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'type\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'type\');">';
if($this->crossCheck){
// navedbe
@@ -2364,7 +2319,7 @@ class SurveyTableChart {
// tip izpisa vrednosti
echo '<div class="chart_setting">';
- echo $lang['srv_chart_valtype'].': <select id="tablechart_value_type_'.$chartID.'" name="tablechart_value_type" onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'value_type\');">';
+ echo $lang['srv_chart_valtype'].': <select id="tablechart_value_type_'.$chartID.'" name="tablechart_value_type" class="dropdown small" onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'value_type\');">';
echo ' <option value="0" '.($settings['value_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_percent'].'</option>';
echo ' <option value="1" '.($settings['value_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_freq'].'</option>';
@@ -2374,29 +2329,12 @@ class SurveyTableChart {
// prikaz label v stolpcih
- //if($settings['type'] == 0 || $settings['type'] == 1){
- echo '<div class="chart_setting">';
-
- echo $lang['srv_chart_barLabel'].': ';
- echo '<input type="checkbox" id="tablechart_barLabel_'.$chartID.'" name="tablechart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'barLabel\');">';
+ echo '<div class="chart_setting">';
+
+ echo '<input type="checkbox" id="tablechart_barLabel_'.$chartID.'" name="tablechart_barLabel" '.($settings['barLabel']=='1'?' checked="checked"':'').' onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'barLabel\');">';
+ echo '<label for="tablechart_barLabel_'.$chartID.'">'.$lang['srv_chart_barLabel'].'</label>';
- echo '</div>';
- //}
-
-
- // sirina label
- /*if($settings['type'] == 0 || $settings['type'] == 3){
- echo '<div class="chart_setting">';
-
- echo $lang['srv_wide_chart'].': <select id="tablechart_labelWidth_'.$chartID.'" name="tablechart_labelWidth" onchange="changeTableChart(\''.$chartID.'\', \'crosstab\', \'labelWidth\');">';
-
- echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
- echo ' <option value="20" '.($settings['labelWidth']=='20'?' selected="selected"':'').'>20%</option>';
-
- echo '</select>';
-
- echo '</div>';
- }*/
+ echo '</div>';
}
// Nastavitve za ttest graf
@@ -2407,7 +2345,7 @@ class SurveyTableChart {
// sirina label
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="tablechart_labelWidth_'.$chartID.'" name="tablechart_labelWidth" onchange="changeTableChart(\''.$chartID.'\', \'ttest\', \'labelWidth\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="tablechart_labelWidth_'.$chartID.'" name="tablechart_labelWidth" onchange="changeTableChart(\''.$chartID.'\', \'ttest\', \'labelWidth\');">';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
echo ' <option value="20" '.($settings['labelWidth']=='20'?' selected="selected"':'').'>20%</option>';
@@ -2420,8 +2358,8 @@ class SurveyTableChart {
// visoka locljivost grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_hq'].': ';
echo '<input type="checkbox" id="tablechart_hq_'.$chartID.'" name="tablechart_hq" '.($settings['hq']=='3'?' checked="checked"':'').' onchange="changeTableChart(\''.$chartID.'\', \'ttest\', \'hq\');">';
+ echo '<label for="tablechart_hq_'.$chartID.'">'.$lang['srv_chart_hq'].'</label>';
echo '</div>';
}
@@ -2433,7 +2371,7 @@ class SurveyTableChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'type\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'type\');">';
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_avg_hor'].'</option>';
echo ' <option value="1" '.($settings['type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_avg_radar'].'</option>';
@@ -2446,8 +2384,8 @@ class SurveyTableChart {
// sortiranje
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': ';
echo '<input type="checkbox" id="tablechart_sort_'.$chartID.'" name="tablechart_sort" '.($settings['sort']=='1'?' checked="checked"':'').' onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'sort\');">';
+ echo '<label for="tablechart_sort_'.$chartID.'">'.$lang['srv_chart_sort'].'</label>';
echo '</div>';
@@ -2456,7 +2394,7 @@ class SurveyTableChart {
if($settings['type'] == 0){
echo '<div class="chart_setting">';
- echo $lang['srv_wide_chart'].': <select id="tablechart_labelWidth_'.$chartID.'" name="tablechart_labelWidth" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'labelWidth\');">';
+ echo $lang['srv_wide_chart'].': <select class="dropdown small" id="tablechart_labelWidth_'.$chartID.'" name="tablechart_labelWidth" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'labelWidth\');">';
echo ' <option value="50" '.($settings['labelWidth']=='50'?' selected="selected"':'').'>50%</option>';
echo ' <option value="20" '.($settings['labelWidth']=='20'?' selected="selected"':'').'>20%</option>';
@@ -2470,7 +2408,7 @@ class SurveyTableChart {
// Tip radarja
if($settings['type'] == 1){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="tablechart_radar_type_'.$chartID.'" name="tablechart_radar_type" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'radar_type\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="tablechart_radar_type_'.$chartID.'" name="tablechart_radar_type" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'radar_type\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -2482,7 +2420,7 @@ class SurveyTableChart {
// Postavitev skale pri radarju
if($settings['type'] == 1){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="tablechart_radar_scale_'.$chartID.'" name="tablechart_radar_scale" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'radar_scale\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="tablechart_radar_scale_'.$chartID.'" name="tablechart_radar_scale" onchange="changeTableChart(\''.$chartID.'\', \'mean\', \'radar_scale\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -2501,7 +2439,7 @@ class SurveyTableChart {
// Tip grafa
echo '<div class="chart_setting">';
- echo $lang['srv_chart_type'].':<br /> <select style="width:140px;" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'type\');">';
+ echo $lang['srv_chart_type'].': <select class="dropdown small" id="tablechart_type_'.$chartID.'" name="tablechart_type" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'type\');">';
if($tip != 7)
echo ' <option value="0" '.($settings['type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar'].'</option>';
@@ -2515,7 +2453,7 @@ class SurveyTableChart {
// sortiranje
echo '<div class="chart_setting">';
- echo $lang['srv_chart_sort'].': <select id="tablechart_sort_'.$chartID.'" name="tablechart_sort" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'sort\');">';
+ echo $lang['srv_chart_sort'].': <select class="dropdown small" id="tablechart_sort_'.$chartID.'" name="tablechart_sort" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'sort\');">';
echo ' <option value="0" '.($settings['sort']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_sort_no'].'</option>';
if($tip != 7)
@@ -2531,13 +2469,13 @@ class SurveyTableChart {
if($settings['rotate']=='1'){
echo $lang['srv_chart_rotate_grids'].' ';
- echo '<span onclick="changeTableChart(\''.$chartID.'\', \'break\', \'rotate\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeTableChart(\''.$chartID.'\', \'break\', \'rotate\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="tablechart_rotate_'.$chartID.'" name="tablechart_rotate" value="0">';
echo ' '.$lang['srv_chart_rotate_vars'].' ';
}
else{
echo $lang['srv_chart_rotate_vars'].' ';
- echo '<span onclick="changeTableChart(\''.$chartID.'\', \'break\', \'rotate\');" style="cursor: pointer;"><img src="img_0/random_off.png" title="Obrni grafe/variable" /></span>';
+ echo '<span class="faicon refresh" onclick="changeTableChart(\''.$chartID.'\', \'break\', \'rotate\');" style="cursor: pointer;" title="Obrni grafe/variable"></span>';
echo '<input type="hidden" id="tablechart_rotate_'.$chartID.'" name="tablechart_rotate" value="1">';
echo ' '.$lang['srv_chart_rotate_grids'];
}
@@ -2546,7 +2484,7 @@ class SurveyTableChart {
// Tip radarja
if($settings['type'] == '0'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_type'].': <select id="tablechart_radar_type_'.$chartID.'" name="tablechart_radar_type" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'radar_type\');">';
+ echo $lang['srv_chart_radar_type'].': <select class="dropdown small" id="tablechart_radar_type_'.$chartID.'" name="tablechart_radar_type" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'radar_type\');">';
echo ' <option value="0" '.($settings['radar_type']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type0'].'</option>';
echo ' <option value="1" '.($settings['radar_type']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_type1'].'</option>';
@@ -2558,7 +2496,7 @@ class SurveyTableChart {
// Postavitev skale pri radarju
if($settings['type'] == '0'){
echo '<div class="chart_setting">';
- echo $lang['srv_chart_radar_scale'].': <select id="tablechart_radar_scale_'.$chartID.'" name="tablechart_radar_scale" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'radar_scale\');">';
+ echo $lang['srv_chart_radar_scale'].': <select class="dropdown small" id="tablechart_radar_scale_'.$chartID.'" name="tablechart_radar_scale" onchange="changeTableChart(\''.$chartID.'\', \'break\', \'radar_scale\');">';
echo ' <option value="0" '.($settings['radar_scale']=='0'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale0'].'</option>';
echo ' <option value="1" '.($settings['radar_scale']=='1'?' selected="selected"':'').'>'.$lang['srv_chart_radar_scale1'].'</option>';
@@ -2590,7 +2528,6 @@ class SurveyTableChart {
// urejanje label
echo '<div id="chartSettingsArea2" class="chartSettingsArea" style="visibility: hidden;">';
- //$this->displayAdvancedSettingsLabels($chartID);
echo '</div>';
echo '</form>';
diff --git a/admin/survey/classes/surveyData/class.SurveyDataCollect.php b/admin/survey/classes/surveyData/class.SurveyDataCollect.php
index 75cdd06..6014ca0 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataCollect.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataCollect.php
@@ -36,6 +36,8 @@ class SurveyDataCollect{
private $header_file_name = null; // Ime header datoteke
private $data_file_name = null; // Ime data datoteke
private $data_file_time = null; // datum zadnjega userja v data datoteki
+
+ private $new_line_seperator = null;
private $max_anketa_time = null; // datum zadnje spremembe v anketi
private $max_usr_time = null; // datum zadnje spremembe v tabelu userjev
@@ -189,11 +191,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'];
@@ -315,7 +316,7 @@ class SurveyDataCollect{
$_tmpCnt = 0;
// v loopu dodamo podatke v data file
- if ($this->noErrors && count($this->_str_users) > 0) {
+ if ($this->noErrors && is_countable($this->_str_users) && count($this->_str_users) > 0) {
foreach ($this->_str_users AS $c => $string_user) {
@@ -388,7 +389,7 @@ class SurveyDataCollect{
fclose($file_handler_new);
// Pobrisemo staro datoteko
- unlink($file_handler_old);
+ unlink($this->data_file_name);
// Preimenujemo novo datoteko
rename($data_file_name_new, $this->data_file_name);
@@ -475,6 +476,22 @@ class SurveyDataCollect{
$_HEADER['uid']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
+
+ // status uporabnika
+ $_HEADER['status']= array ('tip'=>'m', 'variable'=>'status', 'naslov' =>$lang['srv_data_status'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'status', 'naslov'=>$lang['srv_data_status'],'spss'=>'F3.0','sequence'=>$sequence))
+ ,'naslov'=>$lang['srv_data_status'],'cnt_vars' => 1)));
+ $_HEADER['status']['sequences'] = $sequence;
+ $sequence++;
+ $_data_sequence++;
+
+ // EMAIL VABILO - invitation
+ $_HEADER['invitation']= array ('tip'=>'m', 'variable'=>'invitation', 'naslov' =>$lang['srv_data_invitation'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'invitation', 'naslov'=>$lang['srv_data_invitation'],'spss'=>'F3.0','sequence'=>$sequence))
+ ,'naslov'=>$lang['srv_data_invitation'],'cnt_vars' => 1)));
+ $_HEADER['invitation']['sequences'] = $sequence;
+ $sequence++;
+ $_data_sequence++;
// ustreznost uporabnika
$_HEADER['relevance']= array ('tip'=>'m', 'variable'=>'relevance', 'naslov' =>$lang['srv_data_relevance'],
@@ -483,22 +500,6 @@ class SurveyDataCollect{
$_HEADER['relevance']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
-
- // EMAIL VABILO - invitation
- $_HEADER['invitation']= array ('tip'=>'m', 'variable'=>'invitation', 'naslov' =>$lang['srv_data_invitation'],
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'invitation', 'naslov'=>$lang['srv_data_invitation'],'spss'=>'F3.0','sequence'=>$sequence))
- ,'naslov'=>$lang['srv_data_invitation'],'cnt_vars' => 1)));
- $_HEADER['invitation']['sequences'] = $sequence;
- $sequence++;
- $_data_sequence++;
-
- // status uporabnika
- $_HEADER['status']= array ('tip'=>'m', 'variable'=>'status', 'naslov' =>$lang['srv_data_status'],
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'status', 'naslov'=>$lang['srv_data_status'],'spss'=>'F3.0','sequence'=>$sequence))
- ,'naslov'=>$lang['srv_data_status'],'cnt_vars' => 1)));
- $_HEADER['status']['sequences'] = $sequence;
- $sequence++;
- $_data_sequence++;
// ali je uporabnik lurker
$_HEADER['lurker']= array ('tip'=>'m', 'variable'=>'lurker', 'naslov' =>$lang['srv_data_lurker'],
@@ -517,23 +518,23 @@ class SurveyDataCollect{
$_data_sequence++;
// Recnum
- $_HEADER['recnum'] = array('tip'=>'m', 'variable'=>'recnum', 'naslov' =>'Record number',
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'recnum','naslov'=>'Record number','spss'=>'F5.0','sortType'=>'number','sequence'=>$sequence)),
+ $_HEADER['recnum'] = array('tip'=>'m', 'variable'=>'recnum', 'naslov' =>$lang['srv_recnum'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'recnum','naslov'=>$lang['srv_recnum'],'spss'=>'F5.0','sortType'=>'number','sequence'=>$sequence)),
'naslov'=>'recnum','cnt_vars' => 1)));
$_HEADER['recnum']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
-
+
// Dodamo geslo - code
if ($this->force_show_hiden_system == true) {
- $_HEADER['code'] = array('tip'=>'m', 'variable'=>'code', 'naslov' =>'Geslo',
- 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'code','naslov'=>'Geslo','spss'=>'A6','sequence'=>$sequence)),
- 'naslov'=>'Geslo','cnt_vars' => 1)));
+ $_HEADER['code'] = array('tip'=>'m', 'variable'=>'code', 'naslov' =>$lang['password'],
+ 'grids' => array(0 => Array('variables'=>array(0 => Array ('variable'=>'code','naslov'=>$lang['password'],'spss'=>'A6','sequence'=>$sequence)),
+ 'naslov'=>$lang['password'],'cnt_vars' => 1)));
$_HEADER['code']['sequences'] = $sequence;
$sequence++;
$_data_sequence++;
}
-
+
// Ce vsebuje testne podatke dodamo tudi to polje
if ($this->has_test_data) {
$_HEADER['testdata']= array ('tip'=>'m', 'variable'=>'testdata', 'naslov' =>$lang['srv_data_test'],
@@ -563,8 +564,6 @@ class SurveyDataCollect{
$_array_vrednosti = $this->get_vrednosti(); // za vrednosti ankete
$_array_gridi = $this->get_gridi(); // za vrednosti ankete
-
- $cntHs = 0;
// Stejemo loope za numeric vprasanje
$num_loop_cnt = array();
@@ -574,22 +573,28 @@ class SurveyDataCollect{
foreach ($this->AllQuestionsOrder AS $_vprasanje_array) {
- $cntHs++;
+ // Ce vrpasanje ni nastavljeno preskocimo
+ if(!isset($this->AllQuestionsData[$_vprasanje_array['id']]))
+ continue;
# dodelimo vrednosti loopa
$rowVprasanje = $this->AllQuestionsData[$_vprasanje_array['id']];
- // nastavimo vrstni red ce loopamo po numericu
- $num_loop_cnt[$_vprasanje_array['id']]++;
+ // nastavimo vrstni red ce loopamo po numericu
+ if(!isset($num_loop_cnt[$_vprasanje_array['id']]))
+ $num_loop_cnt[$_vprasanje_array['id']] = 1;
+ else
+ $num_loop_cnt[$_vprasanje_array['id']]++;
# spremenljivki dodamo loop_id da je konsistentno z podatki
$rowVprasanje['spr_id'] = $rowVprasanje['spr_id'].'_'.$_vprasanje_array['loop_id'];
- $_vrednosti = $this->get_vrednosti($this->_array_loop_on_spr[$rowVprasanje['if_id']]);
- $_loop_vrednost = $this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']];
+ $loop_vre = isset($this->_array_loop_on_spr[$rowVprasanje['if_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
+ $_vrednosti = $this->get_vrednosti($loop_vre);
+ $_loop_vrednost = isset($this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
$spr_id = $rowVprasanje['spr_id'];
$vrednostLoopSufix = '';
-
+
# popravimo ime variable če smo v loopu
if(isset($this->_array_vre_on_loop[$rowVprasanje['if_id']][$_vprasanje_array['loop_id']])) {
@@ -599,23 +604,28 @@ class SurveyDataCollect{
}
else{
# id spremenljivke po kateri loopamo
- $_loop_on_spr_id = $this->_array_loop_on_spr[$rowVprasanje['if_id']];
+ $_loop_on_spr_id = isset($this->_array_loop_on_spr[$rowVprasanje['if_id']]) ? $this->_array_loop_on_spr[$rowVprasanje['if_id']] : null;
#variabla spremenljivke po kateri loopamo
$_loop_on_spr_variable = $this->AllQuestionsData[$_loop_on_spr_id]['variable'];
+
+ if(isset($_vrednosti[$_loop_vrednost])){
+
+ # id variable po kateri loopamo (v okviru $_loop_on_spr_id)
+ $_loop_on_variable_id = $_vrednosti[$_loop_vrednost];
+
+ # naslov variable po keteri loopamo (v okviru $_loop_on_spr_id)
+ $_vrednost_naslov = $_array_vrednosti[$_loop_on_spr_id][$_loop_on_variable_id['id']]['naslov'];
+ $rowVprasanje['variable'] = strip_tags($rowVprasanje['variable'])."_".$_vrednosti[$_loop_vrednost]['variable'];
+ $vrednostLoopSufix = "_".$_vrednosti[$_loop_vrednost]['variable'];
+
+ if ($_vrednost_naslov != '' && $_loop_on_spr_variable != '' && $rowVprasanje['naslov'] != '') {
+ # zamenjamo ime spremenljivke med #q1# (#q1# z naslovom trenutne variable)
+ $rowVprasanje['naslov'] = str_replace("#$_loop_on_spr_variable#", "$_vrednost_naslov", $rowVprasanje['naslov']);
+ }
+ }
- # id variable po kateri loopamo (v okviru $_loop_on_spr_id)
- $_loop_on_variable_id = $_vrednosti[$_loop_vrednost];
-
- # naslov variable po keteri loopamo (v okviru $_loop_on_spr_id)
- $_vrednost_naslov = $_array_vrednosti[$_loop_on_spr_id][$_loop_on_variable_id['id']]['naslov'];
- $rowVprasanje['variable'] = strip_tags($rowVprasanje['variable'])."_".$_vrednosti[$_loop_vrednost]['variable'];
- $vrednostLoopSufix = "_".$_vrednosti[$_loop_vrednost]['variable'];
-
- if ($_vrednost_naslov != '' && $_loop_on_spr_variable != '' && $rowVprasanje['naslov'] != '') {
- # zamenjamo ime spremenljivke med #q1# (#q1# z naslovom trenutne variable)
- $rowVprasanje['naslov'] = str_replace("#$_loop_on_spr_variable#", "$_vrednost_naslov", $rowVprasanje['naslov']);
- }
+
}
}
@@ -648,8 +658,8 @@ class SurveyDataCollect{
# TODO $spss_lngth mora biti enak za vse in sicer je enak največjemu možnemu številu znakov
# TODO zato je potrebno zdužit vse ($spss_lngth, $spss_lngth2, $spss_lngth3)
- $spss_lngth = $this->_array_SPSS[$spr_id]['text'];
- $spss_lngth2 = $this->_array_SPSS[$spr_id]['text2'];
+ $spss_lngth = isset($this->_array_SPSS[$spr_id]['text']) ? $this->_array_SPSS[$spr_id]['text'] : '';
+ $spss_lngth2 = isset($this->_array_SPSS[$spr_id]['text2']) ? $this->_array_SPSS[$spr_id]['text2'] : '';
$spss_lngth3 = isset($this->_array_SPSS[$spr_id]['vrednost']) && $this->_array_SPSS[$spr_id]['vrednost'] != '' ? $this->_array_SPSS[$spr_id]['vrednost'] : 0;
$_HEADER[$spr_data_id] = array('spr_id'=>$spr_id, 'tip'=>$tip, 'variable'=>$spr_variable, 'naslov'=>$spr_naslov, 'sistem'=>$spr_sistem, 'skala'=>$spr_skala, 'naslov_graf'=>$spr_naslov_graf, 'edit_graf'=>$spr_edit_graf, 'wide_graf'=>$spr_wide_graf);
@@ -718,9 +728,9 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $arrayVrednost = $_array_vrednosti[$spr_id];
+ $arrayVrednost = isset($_array_vrednosti[$spr_id]) ? $_array_vrednosti[$spr_id] : null;
- if (count($arrayVrednost)>0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost)>0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
# dodamo še eno polje za tekstovne odgovore drugo
if ($vrednost['other'] == 1) {
@@ -730,13 +740,21 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[0]['cnt_other'] += 1;
+
+ if(isset($_GRIDS[0]['cnt_other']))
+ $_GRIDS[0]['cnt_other'] += 1;
+ else
+ $_GRIDS[0]['cnt_other'] = 1;
} // end if
#dodamo opcije (za spss)
if ($vrednost['other'] == 0 || $vrednost['other'] == 1) {
$_HEADER[$spr_data_id]['options'][$vrednost['variable']] = ($vrednost['naslov'] != null) ? $vrednost['naslov'] : $vrednost['variable'];
$_HEADER[$spr_data_id]['options_graf'][$vrednost['variable']] = ($vrednost['naslov_graf'] != null) ? $vrednost['naslov_graf'] : $_HEADER[$spr_data_id]['options'][$vrednost['variable']];
}
+ //dodamo missing values
+ else if($vrednost['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$vrednost['other']] = $vrednost['naslov'];
+ }
} // end foreach
} // end if
@@ -755,7 +773,7 @@ class SurveyDataCollect{
case 2:
$arrayVrednost = $_array_vrednosti[$spr_id];
$cnt=0;
- if (count($arrayVrednost)>0) {
+ if (isset($arrayVrednost) && count($arrayVrednost)>0) {
foreach ($arrayVrednost as $vrednost) {
# dodamo header variable samo za ne -missing variable
@@ -773,9 +791,17 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[0]['cnt_other'] += 1;
+
+ if(isset($_GRIDS[0]['cnt_other']))
+ $_GRIDS[0]['cnt_other'] += 1;
+ else
+ $_GRIDS[0]['cnt_other'] = 1;
} // end if
}
+ //dodamo missing values
+ else if($vrednost['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$vrednost['other']] = $vrednost['naslov'];
+ }
} // end foreach
} // end if
@@ -817,7 +843,9 @@ class SurveyDataCollect{
# Pri multigridu je logika obratna. variable predstavljajo podvprašanja, srv_grid pa odgovore
$cntGrid = 0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost)>0) {
+
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
+
# če imamo dvojni grid gremo 2_skozi
for ($i=1; $i<=$double+1;$i++) {
// for $double
@@ -839,7 +867,7 @@ class SurveyDataCollect{
# dodamo header samo za nemissing variable
if ($vrednost['other'] == 0 || $vrednost['other'] == 1) {
- $cnt = 0;
+ $cnt = 0;
$_GRIDS[$cntGrid]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],
'naslov'=>$vrednost['naslov'],
'naslov2'=>$vrednost['naslov2'],
@@ -858,12 +886,13 @@ class SurveyDataCollect{
$_seq_prefix = '_';
$sequence++;
$cnt++;
- $_GRIDS[$cntGrid]['cnt_other'] += 1;
+ $_GRIDS[$cntGrid]['cnt_other'] = (isset($_GRIDS[$cntGrid]['cnt_other']) ? $_GRIDS[$cntGrid]['cnt_other'] += 1 : 1);
} // end if
$_GRIDS[$cntGrid]['cnt_vars'] = $cnt;
- $_GRIDS[$cntGrid]['naslov'] = $vrednost['variable'].$var_appendix;
+ $_GRIDS[$cntGrid]['naslov'] = $vrednost['variable'].$var_appendix.$vrednostLoopSufix;
$_GRIDS[$cntGrid]['part'] = $i;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$cntGrid++;
}
} // end foreach
@@ -873,13 +902,17 @@ class SurveyDataCollect{
#dodamo opcije (za spss)
$arrayGrids = $_array_gridi[$spr_id];
- if (count($arrayGrids) > 0) {
+ if (is_countable($arrayGrids) && count($arrayGrids) > 0) {
foreach ($arrayGrids AS $kid => $grid) {
if ($grid['other'] == 0 || $grid['other'] == 1) {
$_HEADER[$spr_data_id]['options'][$grid['variable']] = ($grid['naslov'] != null) ? $grid['naslov'] : $grid['variable'];
// Opcije za dodaten naslov grida pri grafu
$_HEADER[$spr_data_id]['options_graf'][$grid['variable']] = ($grid['naslov_graf'] != null) ? $grid['naslov_graf'] : $_HEADER[$spr_data_id]['options'][$grid['variable']];
}
+ //dodamo missing values
+ else if($grid['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$grid['other']] = $grid['naslov'];
+ }
}
}
@@ -898,7 +931,7 @@ class SurveyDataCollect{
# pri number lahko imamo dve variabli grida, če je size 2
$cnt_v = 0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
$cnt=0;
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -930,7 +963,8 @@ class SurveyDataCollect{
} // end if
$_GRIDS[0]['enota'] = $spr_variable;
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt_v;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt_v;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt_v;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -950,7 +984,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -976,7 +1011,8 @@ class SurveyDataCollect{
$arrayGrids = $_array_gridi[$spr_id];
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
// Za kombinirane tabele popravimo ime variable
@@ -990,9 +1026,9 @@ class SurveyDataCollect{
if (count($arrayGrids) > 0) {
foreach ($arrayGrids AS $kid => $grid) {
if ($grid['other'] == 0 || $grid['other'] == 1) {
- $_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'], 'gr_id'=>$grid['id'], 'naslov'=>$grid['naslov'], 'variable'=>$vrednost['variable'].'_'.$grid['variable'].$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$grid['naslov_graf']);
+ $_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'], 'gr_id'=>$grid['id'], 'naslov'=>$grid['naslov'].($grid['part'] == '2' ? '_'.$grid['part'] : ''), 'variable'=>$vrednost['variable'].'_'.$grid['variable'].($grid['part'] == '2' ? '_'.$grid['part'] : '').$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$grid['naslov_graf']);
- if((int)$is_datum === 1) {
+ if((int)$is_datum === 1) {
$_GRIDS[$grid_id]['variables'][$cnt]['sortType'] ='date';
}
$_sequences .= $_seq_prefix.$sequence;
@@ -1000,6 +1036,10 @@ class SurveyDataCollect{
$sequence++;
$cnt++;
}
+ //dodamo missing values
+ else if($grid['naslov'] != null){
+ $_HEADER[$spr_data_id]['missing_values'][$grid['other']] = $grid['naslov'];
+ }
} // end foreach
if ($vrednost['other'] == 1) {
$_GRIDS[$grid_id]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],'naslov'=>$vrednost['naslov'], 'variable'=>$vrednost['variable'].$vrednostLoopSufix.STR_OTHER_TEXT, 'other'=>true,'text'=>true,'spss'=>'A'.$spss_lngth,'sequence'=>$sequence,'naslov_graf'=>$vrednost['naslov_graf']);
@@ -1016,7 +1056,12 @@ class SurveyDataCollect{
$_GRIDS[$grid_id]['naslov'] = $vrednost['naslov'];
$_GRIDS[$grid_id]['variable'] = $vrednost['variable'];
$_GRIDS[$grid_id]['naslov_graf'] = $vrednost['naslov_graf'];
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+
+ if(!isset($_HEADER[$spr_data_id]['cnt_all']))
+ $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else
+ $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+
$grid_id++;
} // end foreach
} // end if
@@ -1042,7 +1087,7 @@ class SurveyDataCollect{
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
$_GRIDS[0]['variables'][$cnt] = array('vr_id'=>$vrednost['id'],'naslov'=>$vrednost['naslov'], 'variable'=>$vrednost['variable'].$vrednostLoopSufix, 'other'=>false, 'text'=>false,'spss'=>$_spss,'sequence'=>$sequence,'naslov_graf'=>$vrednost['naslov_graf']);
$_sequences .= $_seq_prefix.$sequence;
@@ -1057,7 +1102,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0][ 'cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1066,7 +1112,7 @@ class SurveyDataCollect{
case 21:
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -1085,7 +1131,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1102,7 +1149,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1119,7 +1167,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1127,8 +1176,8 @@ class SurveyDataCollect{
# SN - IMENA
case 9:
$cnt=0;
- $arrayVrednost = $this->SNVariablesForSpr[$_vprasanje_array['id']];
- if (count($arrayVrednost) > 0) {
+ $arrayVrednost = isset($this->SNVariablesForSpr[$_vprasanje_array['id']]) ? $this->SNVariablesForSpr[$_vprasanje_array['id']] : array();
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
$_GRIDS[0]['variables'][$cnt] = array('vr_id'=>$vrednost,'naslov'=>($spr_variable.'_'.($cnt+1)), 'variable'=>($spr_variable.'_'.($cnt+1)), 'other'=>false, 'text'=>true,'spss'=>'A'.$spss_lngth,'sequence'=>$sequence);
$_sequences .= $_seq_prefix.$sequence;
@@ -1140,7 +1189,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
break;
@@ -1152,7 +1202,7 @@ class SurveyDataCollect{
if($row['enota'] == 3){
$cnt=0;
$arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost) > 0) {
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $kid=> $vrednost) {
if ($vrednost['other'] == 0) {
@@ -1170,7 +1220,8 @@ class SurveyDataCollect{
$_HEADER[$spr_data_id]['cnt_grids'] = 1;
$_GRIDS[0]['cnt_vars'] = $cnt;
$_GRIDS[0]['naslov'] = $spr_variable;
- $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
+ if(!isset($_HEADER[$spr_data_id]['cnt_all'])) $_HEADER[$spr_data_id]['cnt_all'] = $cnt;
+ else $_HEADER[$spr_data_id]['cnt_all'] += $cnt;
$_HEADER[$spr_data_id]['sequences'] = $_sequences;
}
else{
@@ -1223,8 +1274,8 @@ class SurveyDataCollect{
$cnt++;
}
//checkbox vrednosti za imena obmocij
- $arrayVrednost = $_array_vrednosti[$spr_id];
- if (count($arrayVrednost)>0) {
+ $arrayVrednost = isset($_array_vrednosti[$spr_id]) ? $_array_vrednosti[$spr_id] : null;
+ if (is_countable($arrayVrednost) && count($arrayVrednost) > 0) {
foreach ($arrayVrednost as $vrednost) {
# dodamo header variable samo za ne -missing variable
@@ -1262,14 +1313,14 @@ class SurveyDataCollect{
// s katero sekvenco se začnejo meta podatki
$_HEADER['_settings']['metaSequence'] = $sequence;
- $_HEADER['meta'] = array('tip'=>'sm', 'variable'=>'smeta', 'naslov' =>$lang['srv_displaydata_meta'],'cnt_all'=>2);
+ $_HEADER['meta'] = array('tip'=>'sm', 'variable'=>'smeta', 'naslov' =>$lang['srv_displaydata_meta2'],'cnt_all'=>2);
// Datum insert, datum edit, datume in čase za posamezno stran
$_g_cnt = 0;
$_tmp_seq = $sequence;
// Na zacetku prikazemo randomizacijo ce je prisotna pri kaksnem vprasanju ali bloku
- foreach ($this->_array_random as $random_parent) {
+ foreach ($this->_array_random as $parent_id => $random_parent) {
if($random_parent['type'] == 'spr'){
$_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>'Random '.$random_parent['variable']);
@@ -1321,16 +1372,24 @@ class SurveyDataCollect{
$page = 1;
foreach ($this->_array_groups as $gid => $grupa) {
- $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['page'].' '.$page);
+ // Uvod
+ if($gid == '0'){
+ $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['intro']);
- # date on page
- $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_'.$page,'naslov'=>'datum_'.$page,'spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
- $sequence++;
+ # date on page
+ $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_0','naslov'=>'datum_0','spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
+ }
+ else{
+ $_HEADER['meta']['grids'][$_g_cnt] = Array('naslov'=>$lang['page'].' '.$page);
+ # date on page
+ $_HEADER['meta']['grids'][$_g_cnt]['variables'][0] = Array ('variable'=>'date_'.$page,'naslov'=>'datum_'.$page,'spss'=>'DATETIMEw','sortType'=>'date','sequence'=>$sequence);
+
+ $page++;
+ }
+
$_HEADER['meta']['grids'][$_g_cnt]['cnt_vars'] = 1;
-
- $page++;
- $_g_cnt++;
+ $sequence++; $_g_cnt++;
}
// IP
@@ -1403,7 +1462,7 @@ class SurveyDataCollect{
$_tmpCnt = $c * MAX_USER_PER_LOOP;
- $_dataLine = "";
+ $_dataLine = '';
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
@@ -1413,7 +1472,7 @@ class SurveyDataCollect{
$jeziki[$lang['id']] = $lang['language'];
if ($this->noErrors) {
-
+
while ($rowUser = mysqli_fetch_assoc($this->_qry_users[$c])) {
#sleep(1);
@@ -1422,9 +1481,9 @@ class SurveyDataCollect{
$uid = $rowUser['usr_id'];
# dodamo usr id k podatkom
$_dataLine .= $rowUser['usr_id'];
-
- # dodamo ustreznost k podatkom - relevance
- $_dataLine .= STR_DLMT. (($rowUser['status'] == 5 || $rowUser['status'] == 6) && $rowUser['lurker'] == 0 ? '1' : '0');
+
+ # dodamo status k podatkom
+ $_dataLine .= STR_DLMT.$rowUser['status'];
# dodamo email (invitation)k podatkom - če je bilo poslano z emailom ali je uporabnik ročno vnesel email
$_dataLine .= STR_DLMT. ((int)$rowUser['inv_res_id'] > 0 || (int)$rowUser['inv_res_id'] == -1
@@ -1436,9 +1495,9 @@ class SurveyDataCollect{
: '2')
# uporabnik ni bil dodan z email vabilom
: '0');
-
- # dodamo status k podatkom
- $_dataLine .= STR_DLMT.$rowUser['status'];
+
+ # dodamo ustreznost k podatkom - relevance
+ $_dataLine .= STR_DLMT. (($rowUser['status'] == 5 || $rowUser['status'] == 6) && $rowUser['lurker'] == 0 ? '1' : '0');
# dodamo lurkerje
$_dataLine .= STR_DLMT.$rowUser['lurker'];
@@ -1474,6 +1533,10 @@ class SurveyDataCollect{
if ($this->noErrors && count($this->AllQuestionsOrder) > 0) {
foreach ($this->AllQuestionsOrder AS $_vprasanje_array) {
+ // Ce vrpasanje ni nastavljeno preskocimo
+ if(!isset($this->AllQuestionsData[$_vprasanje_array['id']]))
+ continue;
+
$rowVprasanje = $this->AllQuestionsData[$_vprasanje_array['id']];
# spremenljivki dodamo loop_id da je konsistentno z podatki
@@ -1614,7 +1677,7 @@ class SurveyDataCollect{
$userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
// poiščemo polja drugo
- if (count($spr_vrednosti) > 0){
+ if (isset($spr_vrednosti) && is_countable($spr_vrednosti) && count($spr_vrednosti) > 0){
foreach ($spr_vrednosti AS $vid => $vrednost) {
@@ -1732,7 +1795,7 @@ class SurveyDataCollect{
#ce smo meli checkboc obkljukan
if (isset($_tmp_answers[$vid])) {
- $answerOther = ($spr_data_text[$vid]['text'] == "" || $spr_data_text[$vid]['text'] == null) ? $VALUE_FOR_MISSING : $spr_data_text[$vid]['text'];
+ $answerOther = (!isset($spr_data_text[$vid]['text']) || $spr_data_text[$vid]['text'] == "" || $spr_data_text[$vid]['text'] == null) ? $VALUE_FOR_MISSING : $spr_data_text[$vid]['text'];
} else if ($missing_answers !== null) {
// Ce je bil 0 texta ni mogel vnesti in mora bit -2
if($VALUE_FOR_MISSING == -1)
@@ -2293,28 +2356,27 @@ class SurveyDataCollect{
case 9:
# zloopamo skozi podvprašanja in nastavimo izbrane odgovore
- $arrayVrednost = $this->SNVariablesForSpr[$_vprasanje_array['id']];
- if (!is_array($arrayVrednost)) {
- $arrayVrednost = array();
- }
- if(count($spr_vrednosti) > 0)
- foreach ($spr_vrednosti AS $vid => $vrednost) {
- if (in_array($vid,$arrayVrednost)) {
- $answer = null;
- if (isset($spr_data_text[$vid]['text'])) {
- # imamo normalno text vprašanje
- $answer = $spr_data_text[$vid]['text'];
-
- } else if (is_array($spr_data_vred) && count($spr_data_vred) > 0 ) {
- $answer = end($spr_data_vred);
- }
-
- if ($answer == "" || $answer == null) {
- $answer = $VALUE_FOR_MISSING;
- } // end if
- $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
-
- }
+ $arrayVrednost = isset($this->SNVariablesForSpr[$_vprasanje_array['id']]) ? $this->SNVariablesForSpr[$_vprasanje_array['id']] : array();
+
+ if(count($spr_vrednosti) > 0){
+ foreach ($spr_vrednosti AS $vid => $vrednost) {
+ if (in_array($vid,$arrayVrednost)) {
+ $answer = null;
+ if (isset($spr_data_text[$vid]['text'])) {
+ # imamo normalno text vprašanje
+ $answer = $spr_data_text[$vid]['text'];
+
+ } else if (is_array($spr_data_vred) && count($spr_data_vred) > 0 ) {
+ $answer = end($spr_data_vred);
+ }
+
+ if ($answer == "" || $answer == null) {
+ $answer = $VALUE_FOR_MISSING;
+ } // end if
+ $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answer,$uid);
+
+ }
+ }
}
break;
@@ -2376,7 +2438,7 @@ class SurveyDataCollect{
# ce imamo odgovor
if (isset ($spr_data_map)) {
$missing_value_temp = (is_array($spr_data_vred) && count($spr_data_vred) == 1 ) ? end($spr_data_vred) : $VALUE_FOR_MISSING;
- $answerArr = (is_countable($spr_data_map['izpis']) && count($spr_data_map['izpis']) > 0) ? $spr_data_map['izpis'] : $missing_value_temp;
+ $answerArr = (isset($spr_data_map['izpis']) && is_countable($spr_data_map['izpis']) && count($spr_data_map['izpis']) > 0) ? $spr_data_map['izpis'] : $missing_value_temp;
}
else if (is_array($spr_data_map)) {
$key = key($spr_data_map);
@@ -2442,8 +2504,8 @@ class SurveyDataCollect{
$newParams = new enkaParameters($row['params']);
// ce imamo odgovor
- if (isset ($spr_data_heatmap)) {
- $answerArr = (is_countable($spr_data_heatmap['izpis']) && count($spr_data_heatmap['izpis']) > 0) ? $spr_data_heatmap['izpis'] : $VALUE_FOR_MISSING;
+ if (isset ($spr_data_heatmap['izpis'])) {
+ $answerArr = (is_countable($spr_data_heatmap['izpis']) && count($spr_data_heatmap['izpis']) > 0) ? $spr_data_heatmap['izpis'] : $VALUE_FOR_MISSING;
}
else if (is_array($spr_data_heatmap)) {
$key = key($spr_data_heatmap);
@@ -2489,37 +2551,38 @@ class SurveyDataCollect{
$numberOfPointsInside=array();
if (count($spr_vrednosti) > 0) {
- $i=0;
- foreach ($this->_array_data_heatmap_regions[(int)$spr_id] AS $regions){
- $answerReg = null;
- $numberOfPointsInside[$regions['region_name']] = 0; // Belezi stevilo tock znotraj trenutnega obmocja
-
- // Pretvori polje s tockami obmocja v ustrezno obliko
- $poly = $this->convertPolyString($regions['region_coords']);
-
- // preveri, ali je posamezna tocka znotraj trenutnega obmocja
- for ($z=0; $z<sizeof($pointx); $z++){
- $inside = $this->insidePoly($poly, $pointx[$z]["x"], $pointy[$z]["y"]);
- if ($inside == true){
- $numberOfPointsInside[$regions['region_name']]++;
- }
- }
-
- // Priprava odgovora za preglednico s podatki
- // Ce je missing
- if($answerKoo < 0){
- $answerReg = $answerKoo;
+ $i=0;
+ if(isset($this->_array_data_heatmap_regions[(int)$spr_id]))
+ foreach ($this->_array_data_heatmap_regions[(int)$spr_id] AS $regions){
+ $answerReg = null;
+ $numberOfPointsInside[$regions['region_name']] = 0; // Belezi stevilo tock znotraj trenutnega obmocja
+
+ // Pretvori polje s tockami obmocja v ustrezno obliko
+ $poly = $this->convertPolyString($regions['region_coords']);
+
+ // preveri, ali je posamezna tocka znotraj trenutnega obmocja
+ for ($z=0; $z<sizeof($pointx); $z++){
+ $inside = $this->insidePoly($poly, $pointx[$z]["x"], $pointy[$z]["y"]);
+ if ($inside == true){
+ $numberOfPointsInside[$regions['region_name']]++;
+ }
+ }
+
+ // Priprava odgovora za preglednico s podatki
+ // Ce je missing
+ if($answerKoo < 0){
+ $answerReg = $answerKoo;
+ }
+ else{
+ $answerReg = $numberOfPointsInside[$regions['region_name']];
+ }
+
+ $i++;
+
+ // dodamo odgovor s stevilom tock znotraj obmocja
+ $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answerReg,$uid);
+
}
- else{
- $answerReg = $numberOfPointsInside[$regions['region_name']];
- }
-
- $i++;
-
- // dodamo odgovor s stevilom tock znotraj obmocja
- $userAnswerLine .= STR_DLMT.$this->recode_answer($spr_id,$answerReg,$uid);
-
- }
}
}
//za območja - konec
@@ -2577,7 +2640,7 @@ class SurveyDataCollect{
// Random vrstni redi
- foreach ($this->_array_random as $random_parent) {
+ foreach ($this->_array_random as $parent_id => $random_parent) {
$type = ($random_parent['type'] == 'spr') ? 'spr' : 'block';
$random_data = $this->get_array_data_random($uid, $random_parent['id'], $type);
@@ -2601,9 +2664,10 @@ class SurveyDataCollect{
# strani in časi
foreach ($this->_array_groups AS $gid => $grupa) {
- if ($this->_array_user_grupa[$uid][$gid] != '') {
+ if (isset($this->_array_user_grupa[$uid][$gid]) && $this->_array_user_grupa[$uid][$gid] != '') {
$_dataLine .= STR_DLMT.datetime($this->_array_user_grupa[$uid][$gid]);
- } else {
+ }
+ else {
$_dataLine .= STR_DLMT.'';
}
}
@@ -2643,8 +2707,8 @@ class SurveyDataCollect{
$this->noErrors = false;
}
- $_dataLine = null;
unset($_dataLine);
+ $_dataLine = '';
}
else {
# dodamo v log napako
@@ -2765,6 +2829,13 @@ class SurveyDataCollect{
$cnt = 0;
if ($this->_cnt_groups > 0) {
$this->_array_groups = array();
+
+ // Uvod - ce je prikazan v anketi
+ if($this->survey['show_intro'] == '1'){
+ $this->_array_groups['0'] = '0';
+ $str .= '0,';
+ }
+
$prefix ='';
while ($row = mysqli_fetch_assoc($qry_groups)) {
@@ -2880,7 +2951,7 @@ class SurveyDataCollect{
$rowVprasanja = array();
- if (!is_countable($sgmMap[$rowMainVprasanje['id']]) || count($sgmMap[$rowMainVprasanje['id']]) == 0) {
+ if (!isset($sgmMap[$rowMainVprasanje['id']]) || count($sgmMap[$rowMainVprasanje['id']]) == 0) {
$rowVprasanja[] = $rowMainVprasanje;
}
else {
@@ -2913,12 +2984,12 @@ class SurveyDataCollect{
$this->AllQuestionsData[$rowVprasanje['id']] = array(
'id' => $rowVprasanje['id'],
'spr_id' => $spr_id,
- 'sgm_parrent' => $rowVprasanje['sgm_parrent'],
+ 'sgm_parrent' => isset($rowVprasanje['sgm_parrent']) ? $rowVprasanje['sgm_parrent'] : '',
'tip' => $rowVprasanje['tip'],
'gru_id' => $rowVprasanje['gru_id'],
'variable' => strip_tags($rowVprasanje['variable']),
'naslov' => strip_tags($rowVprasanje['naslov']),
- 'label' => strip_tags($rowVprasanje['label']),
+ 'label' => (isset($rowVprasanje['label']) ? strip_tags($rowVprasanje['label']) : ''),
'size' => $rowVprasanje['size'],
'cela' => $rowVprasanje['cela'],
'grid_subtitle1' => $rowVprasanje['grid_subtitle1'],
@@ -3034,6 +3105,8 @@ class SurveyDataCollect{
$this->_array_loop_on_spr = array();
$this->_array_loop_parent = array();
+ $_cnt_loop = 0;
+
$qryLoop_spr_select = sisplet_query("SELECT l.if_id, l.spr_id
FROM srv_branching AS b, srv_loop AS l
WHERE b.ank_id = '".$this->sid."' AND b.element_if = l.if_id");
@@ -3084,6 +3157,22 @@ class SurveyDataCollect{
foreach ($spr_ids AS $spr_id) {
$this->_array_spr_in_loop[$spr_id] = $lkey;
$this->_array_loop_has_spr[$lkey][] = $spr_id;
+
+ // Pri kombinirani tabeli dodamo v array se podtabele
+ $row = Cache::srv_spremenljivka($spr_id);
+ if($row['tip'] == 24){
+
+ $sqlMT = sisplet_query("SELECT s.id
+ FROM srv_spremenljivka s, srv_grid_multiple mt
+ WHERE mt.ank_id='".$this->sid."' AND mt.parent='".$spr_id."' AND mt.spr_id=s.id
+ ORDER BY mt.vrstni_red ASC
+ ");
+ while ($rowMT = mysqli_fetch_array($sqlMT)) {
+ $this->_array_spr_in_loop[$rowMT['id']] = $lkey;
+ $this->_array_loop_has_spr[$lkey][] = $rowMT['id'];
+ }
+ }
+
}
}
}
@@ -3240,12 +3329,12 @@ class SurveyDataCollect{
}
$this->_array_random = array();
-
+ $i=0;
// Preberemo vsa VPRASANJA ki imajo vklopljeno randomizacijo
$_qry_random_spr = sisplet_query("SELECT s.id, s.variable FROM srv_spremenljivka s, srv_grupa g
WHERE g.ank_id='".$this->sid."' AND s.gru_id=g.id AND s.random='1'
- ORDER BY s.vrstni_red");
+ ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
if (!$_qry_random_spr) {
$this->trigerError('get_random', mysqli_error($GLOBALS['connect_db']));
}
@@ -3255,11 +3344,14 @@ class SurveyDataCollect{
// Napolnimo array z randomiziranimi vprasanji
if ($cnt_rows > 0) {
+
+
while ($row = mysqli_fetch_array($_qry_random_spr)) {
-
- $this->_array_random[$row['id']]['id'] = $row['id'];
+ $this->_array_random[$row['id']]['id'] = $row['id'];
$this->_array_random[$row['id']]['variable'] = $row['variable'];
$this->_array_random[$row['id']]['type'] = 'spr';
+
+ $i++;
}
}
@@ -3297,7 +3389,9 @@ class SurveyDataCollect{
// Blok ima randomizirana vprasanja
else{
$this->_array_random[$row['id']]['type'] = 'blok_spr';
- }
+ }
+
+ $i++;
}
}
}
@@ -3662,7 +3756,7 @@ class SurveyDataCollect{
if($text == '' || $text == null) $text = '-1';
// Addslashes je potreben za analize
- if($this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id]){
+ if(isset($this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id])){
$this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id]['izpis'][$i] = array(
'address'=>addslashes(strip_tags($address)),
'vrednost'=>addslashes(strip_tags($text)),
@@ -3670,11 +3764,15 @@ class SurveyDataCollect{
}
else{
$this->_array_data_map[(int)$usr_id][$spr_id.'_'.$loop_id] = array(
- 'izpis'=>array(array(
- 'address'=>addslashes(strip_tags($address)),
- 'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=>$lat . ', ' . $lng)),
- 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id);
+ 'izpis'=>array(
+ array(
+ 'address'=>addslashes(strip_tags($address)),
+ 'vrednost'=>addslashes(strip_tags($text)),
+ 'koordinate'=>$lat . ', ' . $lng
+ )
+ ),
+ 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id
+ );
}
$i++;
@@ -3715,19 +3813,24 @@ class SurveyDataCollect{
if($text == '' || $text == null) $text = '-1';
// adslashes je potreben za analize
- if($this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id]){
+ if(isset($this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id])){
$this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id]['izpis'][$i] = array(
'address'=>addslashes(strip_tags($address)),
'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=> $lat . ', ' . $lng);
+ 'koordinate'=> $lat . ', ' . $lng
+ );
}
else{
$this->_array_data_heatmap[(int)$usr_id][$spr_id.'_'.$loop_id] = array(
- 'izpis'=>array(array(
- 'address'=>addslashes(strip_tags($address)),
- 'vrednost'=>addslashes(strip_tags($text)),
- 'koordinate'=>$lat . ', ' . $lng)),
- 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id);
+ 'izpis'=>array(
+ array(
+ 'address'=>addslashes(strip_tags($address)),
+ 'vrednost'=>addslashes(strip_tags($text)),
+ 'koordinate'=>$lat . ', ' . $lng
+ )
+ ),
+ 'spr_id' => $spr_id, 'usr_id' => $usr_id, 'loop_id' => $loop_id
+ );
}
$i++;
@@ -3860,7 +3963,7 @@ class SurveyDataCollect{
if (mysqli_num_rows($_qry_data_random) > 0) {
while($row2 = mysqli_fetch_array($_qry_data_random)){
-
+
// Zgradimo string z labelami vprasanj za prikaz v podatkih
$vrstni_red_string = '';
@@ -4054,7 +4157,7 @@ class SurveyDataCollect{
// Pripravimo missing vrednosti za anketo
private function setSurveyMissingValues() {
- $smv = new SurveyMissingValues($sid);
+ $smv = new SurveyMissingValues($this->sid);
$smv -> Init();
$_sys_missings = $smv->GetSurveyMissingValues();
@@ -4093,7 +4196,7 @@ class SurveyDataCollect{
return $result;
}
- if ($this->_user_spr_answer_count['last_seen'] == $this->_user_spr_answer_count['cnt']) {
+ if (isset($this->_user_spr_answer_count['last_seen']) && $this->_user_spr_answer_count['last_seen'] == $this->_user_spr_answer_count['cnt']) {
return $result;
}
@@ -4101,12 +4204,12 @@ class SurveyDataCollect{
return $result;
}
- foreach ($this->_user_spr_answer_count['spremenljivke'] AS $cnt) {
-
- if ($this->_user_spr_answer_count['last_seen'] > $result) {
- $result += $cnt;
- }
- }
+ if (isset($this->_user_spr_answer_count['last_seen']))
+ foreach ($this->_user_spr_answer_count['spremenljivke'] AS $cnt) {
+ if ($this->_user_spr_answer_count['last_seen'] > $result) {
+ $result += $cnt;
+ }
+ }
return $this->_user_spr_answer_count['cnt'] - $result;
}
@@ -4189,7 +4292,7 @@ class SurveyDataCollect{
// Pogledamo se ce je respondent videl vprasanje (tudi ce je -1, ker ga potem ne smemo spremenit v -3)
if ($answer == -1 || $answer === '-2d') {
- if (is_array($this->_array_user_grupa[$uid]) && array_key_exists($this->AllQuestionsData[$spr]['gru_id'], $this->_array_user_grupa[$uid])) {
+ if (isset($this->_array_user_grupa[$uid]) && is_array($this->_array_user_grupa[$uid]) && array_key_exists($this->AllQuestionsData[$spr]['gru_id'], $this->_array_user_grupa[$uid])) {
$this->_user_spr_answer_count['last_seen'] = $this->_user_spr_answer_count['cnt'] - 1;
}
}
@@ -4290,7 +4393,8 @@ class SurveyDataCollect{
$coordsWithComma = explode('<br>',$answerKoo);
$pointx = array();
$pointy = array();
-
+ $coords = array();
+
for($i = 1; $i<sizeof($coordsWithComma); $i++){
// Vecdimenzionalno polje
diff --git a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
index bc50f46..982aa68 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataDisplay.php
@@ -30,6 +30,7 @@ define('VAR_SORT_SEQ', 'sort_seq');
define('VAR_SORT_TYPE', 'sort_type');
define('VAR_PDF_TYPE', 'type');
define('VAR_RELEVANCE', 'view_relevance');
+define('VAR_STATUS', 'view_status');
define('VAR_SHOW_DATE', 'view_date', false);
define('VAR_SHOW_NO', 'view_no', false);
define('VAR_EMAIL', 'email');
@@ -90,10 +91,14 @@ class SurveyDataDisplay{
'dataIcons_write'=>false); #ali prikazujemo ikone za urejanje
static private $displayEditIconsSettings = false; # ali prikazujemo okno s checkboxi za nastavitve tabele s podatki
+
+ static private $displayDataFullscreen = false; # ali prikazujemo podatke v fullscreen pogledu
static private $printPreview = false; # ali prikazujemo podatke kot print preview;
static private $canDisplayRelevance = true; # ali prikazujemo ustreznost - relevance;
+
+ static private $canDisplayStatus = true; # ali prikazujemo status;
static private $quickEdit_recnum = array(); # array z prejsnjim in naslednjim recnumom (za vpogled - puscici naprej,nazaj)
@@ -114,7 +119,9 @@ class SurveyDataDisplay{
VAR_PDF_TYPE => 0, # tip izpisa pdf (0 -> kratek, 1 -> dolg, 2 -> zelo kratek)
VAR_SORT_SEQ => '', # po kateri sekvenci sortiramo
VAR_SORT_TYPE => '', # način sortiranja (naraščajoče, padajoče)
- VAR_RELEVANCE => 1, # ali prikazujemo ustreznost
+ // VAR_RELEVANCE je po novem podrobnosti stausa (leva stran)
+ VAR_RELEVANCE => 0, # ali prikazujemo ustreznost
+ VAR_STATUS => 1, # ali prikazujemo status (in vabila)
VAR_EMAIL => 1, # ali prikazujemo email status
VAR_CIRCLES => 0, # ali prikazujemo kroge antonučija
VAR_SHOW_DATE => 0, # ali prikazujemo kroge antonučija
@@ -165,8 +172,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;
@@ -177,8 +183,7 @@ class SurveyDataDisplay{
}
# ali prikazujemo datum na začetku ankete (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_DATE] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showItime') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ if ( self::$_VARS[VAR_SHOW_DATE] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showItime = true;
}
else {
@@ -186,8 +191,7 @@ class SurveyDataDisplay{
}
# ali prikazujemo zaporedno številko. (Če smo v identifikatorjih ne smemo zaradi povezovanja)
- if ( (self::$_VARS[VAR_SHOW_NO] == true || (int)SurveyInfo :: getInstance()->getSurveyColumn('showLineNumber') == 1) && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- //if (self::$_VARS[VAR_SHOW_NO] == true) {
+ if ( self::$_VARS[VAR_SHOW_NO] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
self::$showLineNumber = true;
}
else {
@@ -216,10 +220,13 @@ class SurveyDataDisplay{
if(isset($_SESSION['sid_'.self::$sid]['dataIcons_settings']))
self::$displayEditIconsSettings = ($_SESSION['sid_'.self::$sid]['dataIcons_settings']);
+
+ if(isset($_SESSION['sid_'.self::$sid]['data_fullscreen']))
+ self::$displayDataFullscreen = ($_SESSION['sid_'.self::$sid]['data_fullscreen']);
# ali filtriramo cms usejreve datotekoe
session_start();
- self::$doCMSUserFilter = $_SESSION['sid_'.$sid]['doCMSUserFilter'];
+ self::$doCMSUserFilter = isset($_SESSION['sid_'.$sid]['doCMSUserFilter']) ? $_SESSION['sid_'.$sid]['doCMSUserFilter'] : false;
session_commit();
@@ -230,7 +237,7 @@ class SurveyDataDisplay{
// Ce imamo urlhash gre za javno povezavo in nikoli ne prikazemo loading okna
$show_loading = (isset($_GET['urlhash'])) ? false : true;
- self::$SDF->prepareFiles($show_loading);
+ self::$SDF->prepareFiles();
self::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
@@ -296,13 +303,13 @@ class SurveyDataDisplay{
$awk_cnt_str = 'awk -F"'.STR_DLMT.'" \''.EMAIL_FIELD.'~/1/'.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
}
- $emailCount = shell_exec($awk_cnt_str);
-
+ //$emailCount = shell_exec($awk_cnt_str);
+
#self::$_VARS[VAR_EMAIL] = self::$_VARS[VAR_RELEVANCE] && ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1);
- if (((int)self::$survey['email'] == 0 && (int)self::$survey['user_base'] == 0) ) {
+ if (!SurveyInfo::getInstance()->checkSurveyModule('email') || !isset(self::$survey['user_base']) || (int)self::$survey['user_base'] == 0 ) {
self::$_VARS[VAR_EMAIL] = 0;
}
-
+
# nastavimo način sortiranja
self::setUpSort();
@@ -506,299 +513,314 @@ class SurveyDataDisplay{
static public function setUpFilter() {
# nastavimo filter po statusih
-
if (self::$headFileName != null && self::$headFileName != '' && file_exists(self::$headFileName)) {
- # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
- if (self::$_VARS[VAR_SHOW_SYSTEM]){
- self::$_VARS[VAR_DATA] = true;
- self::$_VARS[VAR_META] = true;
- self::$_VARS[VAR_METAFULL] = false;
- self::$_VARS[VAR_SHOW_DATE] = false;
- }
- # filtriranje po statusih
- self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
-
- if (self::$dataFileStatus >= 0) {
- self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
-
- # ali imamo filter na testne podatke
- if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
- $test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
- $filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
- }
- # filtriranje po časih
- $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
-
- # ali imamo filter na uporabnost
- if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
- $usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
- $filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
- }
-
- # če nismo v indikatorjih (sistemske)
- if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- # dodamo še ife
- SurveyConditionProfiles :: setHeader(self::$_HEADERS);
- $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
-
- # dodamo še ife za inspect
- $SI = new SurveyInspect(self::$sid);
- $_inspect_condition_awk = $SI->generateAwkCondition();
- }
-
- # dodamo pogoj za filter prepoznave uporabnika iz cms
- # vklopljeno more bit prepoznava userja iz cms
- if (self::$doCMSUserFilter == true) {
- $CMSUserCondition = self::createCMSUserFilter();
- }
+ # kadar zbiramo sistemske, moramo obvezno zbirati tudi podatke, ne smemo pa full meta
+ if (self::$_VARS[VAR_SHOW_SYSTEM]){
+ self::$_VARS[VAR_DATA] = true;
+ self::$_VARS[VAR_META] = true;
+ self::$_VARS[VAR_METAFULL] = false;
+ self::$_VARS[VAR_SHOW_DATE] = false;
+ self::$_VARS[VAR_RELEVANCE] = false;
+ self::$_VARS[VAR_STATUS] = false;
+ }
- if (($_condition_profile_AWK != "" && $_condition_profile_AWK != null )
- || ($_inspect_condition_awk != "" && $_inspect_condition_awk != null)
- || ($_time_profile_awk != "" && $_time_profile_awk != null)
- || ($CMSUserCondition != "" && $CMSUserCondition != null)
- || ($filter_testdata != null)
- || ($filter_usability != null)) {
- self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
- if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
- }
- if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
- self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
- }
- if ($_time_profile_awk != "" && $_time_profile_awk != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
- }
- if ($CMSUserCondition != "" && $CMSUserCondition != null) {
- self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
- }
- if ($filter_testdata != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
- }
- if ($filter_usability != null ) {
- self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
- }
- self::$_CURRENT_STATUS_FILTER .= ')';
- }
-
- # preštejemo vse zapise ki ustrezajo filtru po statusu
- if (IS_WINDOWS) {
- $awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
- $recCount = shell_exec($awk_string);
- if ($_GET['debug'] == 1) {
- print_r('<br>'.$awk_string);
- }
-
- } else {
- $awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
- $recCount = shell_exec($awk_string);
- if ($_GET['debug'] == 1) {
- print_r('<br>'.$awk_string);
- }
- }
- if ((int)$recCount > 0 ) {
- self::$_RECORD_COUNT = (int)$recCount;
- }
+ # filtriranje po statusih
+ self::$_CURRENT_STATUS_FILTER = SurveyStatusProfiles :: getStatusAsAWKString();
+
+ if (self::$dataFileStatus >= 0) {
+ self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
+ $filter_testdata = null;
+
+ # ali imamo filter na testne podatke
+ if (isset(self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence']) && (int)self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'] > 0) {
+ $test_data_sequence = self::$_HEADERS['testdata']['grids'][0]['variables'][0]['sequence'];
+ $filter_testdata = SurveyStatusProfiles :: getStatusTestAsAWKString($test_data_sequence);
+ }
+ # filtriranje po časih
+ $_time_profile_awk = SurveyTimeProfiles :: getFilterForAWK(self::$_HEADERS['unx_ins_date']['grids']['0']['variables']['0']['sequence']);
+
+ # ali imamo filter na uporabnost
+ $filter_usability = null;
+ if (isset(self::$_HEADERS['usability']['variables'][0]['sequence']) && (int)self::$_HEADERS['usability']['variables'][0]['sequence'] > 0) {
+ $usability_data_sequence = self::$_HEADERS['usability']['variables'][0]['sequence'];
+ $filter_usability = SurveyStatusProfiles :: getStatusUsableAsAWKString($usability_data_sequence);
+ }
+
+ # če nismo v indikatorjih (sistemske)
+ if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ # dodamo še ife
+ SurveyConditionProfiles :: setHeader(self::$_HEADERS);
+ $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString();
+
+ # dodamo še ife za inspect
+ $SI = new SurveyInspect(self::$sid);
+ $_inspect_condition_awk = $SI->generateAwkCondition();
+ }
-
- if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
- self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
-
- if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
- self::$_TOTAL_PAGES += 1;
- if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
- } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
- self::$_VARS[VAR_CUR_REC_PAGE] = 1;
- }
-
- # nastavimo limit za datoteko
-
- $up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
- $low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
-
- self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
- } else {
- # nastavimo limit za datoteko
- self::$_REC_LIMIT = '';
- }
- }
- if (self::$_VARS[VAR_DATA]) {
- $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
-
- # če je $svp_pv = null potem prikazujemo vse variable
- # oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
- if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
-
- $_sv = self::$SDF->getSurveyVariables();
- if (count($_sv) > 0) {
- foreach ( $_sv as $vid => $variable) {
- $tmp_svp_pv[$vid] = $vid;
- }
- }
- }
- }
- self::$lineoffset=1;
- # če prikazujemo sistemske ne prikazujemo recnumber
- if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL]) {
- $svp_pv['recnum'] = 'recnum';
- #$svp_pv['code'] = 'code';
- self::$lineoffset++;
- # za code ni ofseta
- #self::$lineoffset++;
- }
-
- if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
- foreach ($tmp_svp_pv AS $_svp_pv) {
-
- # če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
- # potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
- $_sistemski = false;
- if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
- # prikazujemo samo nesistemske (nezaščitene)
- unset(self::$_HEADERS[$_svp_pv]);
- } else if (self::$_VARS[VAR_SHOW_SYSTEM] && self::$_HEADERS[$_svp_pv]['hide_system'] !== '1') {
- # prikazujemo samo sistemske (zaščitene) podatke
- unset(self::$_HEADERS[$_svp_pv]);
- } else {
- # če ne dodamo
- $svp_pv[$_svp_pv] = $_svp_pv;
- }
- }
- }
+ # dodamo pogoj za filter prepoznave uporabnika iz cms
+ # vklopljeno more bit prepoznava userja iz cms
+ $CMSUserCondition = null;
+ if (self::$doCMSUserFilter == true) {
+ $CMSUserCondition = self::createCMSUserFilter();
+ }
- #status - če smo v meta ali imamo profil vse enote
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
- || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
- $svp_pv['status'] = 'status';
- self::$lineoffset++;
- }
-
- #lurker
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
- || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 )) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['lurker'] = 'lurker';
- self::$lineoffset++;
- }
- # ustreznost
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['relevance'] = 'relevance';
- self::$lineoffset++;
- }
-
- # email tion
- #email prikazujemo skupaj z ustreznostjo
- if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- // dodamo v array da se prikazujejo tudi ti stolpci
- $svp_pv['invitation'] = 'invitation';
- self::$lineoffset++;
- }
+ if ((isset($_condition_profile_AWK) && $_condition_profile_AWK != "" && $_condition_profile_AWK != null )
+ || (isset($_inspect_condition_awk) && $_inspect_condition_awk != "" && $_inspect_condition_awk != null)
+ || (isset($_time_profile_awk) && $_time_profile_awk != "" && $_time_profile_awk != null)
+ || (isset($CMSUserCondition) && $CMSUserCondition != "" && $CMSUserCondition != null)
+ || (isset($filter_testdata) && $filter_testdata != null)
+ || (isset($filter_usability) && $filter_usability != null)) {
+ self::$_CURRENT_STATUS_FILTER = '('.self::$_CURRENT_STATUS_FILTER;
+ if ($_condition_profile_AWK != "" && $_condition_profile_AWK != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_condition_profile_AWK;
+ }
+ if ($_inspect_condition_awk != "" && $_inspect_condition_awk != null ) {
+ self::$_CURRENT_STATUS_FILTER .= ' && '.$_inspect_condition_awk;
+ }
+ if ($_time_profile_awk != "" && $_time_profile_awk != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$_time_profile_awk;
+ }
+ if ($CMSUserCondition != "" && $CMSUserCondition != null) {
+ self::$_CURRENT_STATUS_FILTER .= '&&'.$CMSUserCondition;
+ }
+ if ($filter_testdata != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_testdata.')';
+ }
+ if ($filter_usability != null ) {
+ self::$_CURRENT_STATUS_FILTER .= '&&('.$filter_usability.')';
+ }
+ self::$_CURRENT_STATUS_FILTER .= ')';
+ }
+
+ # preštejemo vse zapise ki ustrezajo filtru po statusu
+ if (IS_WINDOWS) {
+ $awk_string = 'awk -F"'.STR_DLMT.'" "'.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}" '.self::$dataFileName;
+ $recCount = shell_exec($awk_string);
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$awk_string);
+ }
+
+ } else {
+ $awk_string = 'awk -F"'.STR_DLMT.'" \''.self::$_CURRENT_STATUS_FILTER.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
+ $recCount = shell_exec($awk_string);
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
+ print_r('<br>'.$awk_string);
+ }
+ }
+ if ((int)$recCount > 0 ) {
+ self::$_RECORD_COUNT = (int)$recCount;
+ }
- if (isset(self::$_HEADERS['testdata'])) {
- self::$_HAS_TEST_DATA = true;
- $svp_pv['testdata'] = 'testdata';
- self::$lineoffset++;
- }
- # $svp_pv['unx_ins_date'] = 'unx_ins_date';
+
+ if (self::$_VARS[VAR_REC_ON_PAGE] != 'all') {
+ self::$_TOTAL_PAGES = bcdiv(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]);
+
+ if (bcmod(self::$_RECORD_COUNT, self::$_VARS[VAR_REC_ON_PAGE]) > 0)
+ self::$_TOTAL_PAGES += 1;
+ if (self::$_VARS[VAR_CUR_REC_PAGE] > self::$_TOTAL_PAGES ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = self::$_TOTAL_PAGES;
+ } elseif (self::$_VARS[VAR_CUR_REC_PAGE] < 1 ) {
+ self::$_VARS[VAR_CUR_REC_PAGE] = 1;
+ }
+
+ # nastavimo limit za datoteko
+
+ $up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
+ $low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
+
+ self::$_REC_LIMIT = ' NR=='.$low.',NR=='.$up.'';
+ } else {
+ # nastavimo limit za datoteko
+ self::$_REC_LIMIT = '';
+ }
+ }
- if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
- # dodamo tudi special meta
- $svp_pv['meta'] = 'meta';
- }
-
- if (self::$showItime == true) {
- $svp_pv['itime'] = 'itime';
- self::$lineoffset++;
- }
-
- // ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
- if(self::$_VARS[VAR_SHOW_SYSTEM]){
-
- $hasEmail = false;
-
- // Poiscemo sekvenco sistemske spremenljivke
- foreach (self::$_HEADERS AS $spr => $spremenljivka) {
- if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
- $sequence = $spremenljivka['sequences'];
- $hasEmail = true;
- }
- }
-
- if($hasEmail){
- # sortiramo
- self::$do_sort = true;
-
- # nastavimo po kateri sekvenci / stolpcu sortiramo
- self::$sort_seq = $sequence;
-
- self::$sort_type = 'sort_asc';
- }
- }
-
- self::getQuestionCount();
- if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
- self::$_VARS[VAR_SPR_LIMIT] = 'all';
- }
-
- $spr_cont = 0; // za paginacijo spremenljivk
-
- if(self::$_VARS['spr_limit'] == 'all'){
- $_spr_on_pages_start = 0;
- $_spr_on_pages_stop = self::$_VARS['spr_page'];
- }
- else{
- $_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
- $_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
- }
+ $tmp_svp_pv = array();
+ $svp_pv = array();
+ if (self::$_VARS[VAR_DATA]) {
+ $tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables(self::$_PROFILE_ID_VARIABLE );
+
+ # če je $svp_pv = null potem prikazujemo vse variable
+ # oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
+ if (count($tmp_svp_pv) == 0 || self::$_VARS[VAR_SHOW_SYSTEM] == true ) {
+
+ $_sv = self::$SDF->getSurveyVariables();
+ if (count($_sv) > 0) {
+ foreach ( $_sv as $vid => $variable) {
+ $tmp_svp_pv[$vid] = $vid;
+ }
+ }
+ }
+ }
- # skreiramo filter variabel za podatke
- if (count(self::$_HEADERS) > 0) {
- // zloopamo skozi spremenljivke in sestavimo filter po stolpcih
- $_tmp_filter = '';
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset($svp_pv[$spid])) {
- // paginacija spremenljivk
- if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- if (count($spremenljivka['grids']) > 0 ) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- $_tmp_filter .= $_prfx.$variable['sequence'];
- $_prfx = ',';
- }
- }
- }
- }
- } // end: paginacija spremenljivk
- $spr_cont++;
- } else
- # če prikazujemo samo sistemske
- if ( self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
- if (count($spremenljivka['grids']) > 0 ) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- $_tmp_filter .= $_prfx.$variable['sequence'];
- $_prfx = ',';
- }
- }
- }
+ self::$lineoffset=1;
+
+ # če prikazujemo sistemske ne prikazujemo recnumber
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && self::$_VARS[VAR_RELEVANCE] /* self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL] */) {
+ $svp_pv['recnum'] = 'recnum';
+ self::$lineoffset++;
+ }
+
+ if (self::$_VARS[VAR_DATA] && count($tmp_svp_pv) > 0) {
+
+ foreach ($tmp_svp_pv AS $_svp_pv) {
+
+ # če imamo sistemski email ali telefon, ime, priimek (v header je nastavljno "hide_system" = 1)
+ # potem v odvisnosti od nastavitve prikazujemo samo navadne podatke ali pa samo te sistemske, zaradizaščite podatkov
+ $_sistemski = false;
+ if (!self::$_VARS[VAR_SHOW_SYSTEM] && isset(self::$_HEADERS[$_svp_pv]['hide_system']) && self::$_HEADERS[$_svp_pv]['hide_system'] == '1') {
+ # prikazujemo samo nesistemske (nezaščitene)
+ unset(self::$_HEADERS[$_svp_pv]);
+ } else if (self::$_VARS[VAR_SHOW_SYSTEM] && (!isset(self::$_HEADERS[$_svp_pv]['hide_system']) || self::$_HEADERS[$_svp_pv]['hide_system'] !== '1')) {
+ # prikazujemo samo sistemske (zaščitene) podatke
+ unset(self::$_HEADERS[$_svp_pv]);
+ } else {
+ # če ne dodamo
+ $svp_pv[$_svp_pv] = $_svp_pv;
+ }
+ }
+ }
+
+ #status - če smo v meta ali imamo profil vse enote
+ if ( self::$_VARS[VAR_STATUS] /* || ( $ssp_pid = SurveyStatusProfiles::getCurentProfileId() == 1 ) */ ) {
+ $svp_pv['status'] = 'status';
+ self::$lineoffset++;
+
+ # email tion
+ if ( self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['invitation'] = 'invitation';
+ self::$lineoffset++;
}
- $svp_pv[$spid] = $spid;
- }
- }
- }
+ }
- # prilagodimo array profilov variabel
- self::$_SVP_PV = $svp_pv;
- if ($_tmp_filter != '')
- {
+ #geslo vabil
+ if ( self::$_VARS[VAR_EMAIL] && (self::$_VARS[VAR_SHOW_SYSTEM] == true || self::$survey['show_email'] == '1') ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['code'] = 'code';
+ self::$lineoffset++;
+ }
+ #lurker
+ if ( self::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['lurker'] = 'lurker';
+ self::$lineoffset++;
+ }
+ # ustreznost
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ // dodamo v array da se prikazujejo tudi ti stolpci
+ $svp_pv['relevance'] = 'relevance';
+ self::$lineoffset++;
+ }
+
+ if (isset(self::$_HEADERS['testdata'])) {
+ self::$_HAS_TEST_DATA = true;
+
+ if(self::$_VARS[VAR_RELEVANCE]){
+ $svp_pv['testdata'] = 'testdata';
+ self::$lineoffset++;
+ }
+ }
+ # $svp_pv['unx_ins_date'] = 'unx_ins_date';
+
+ if (self::$_VARS[VAR_METAFULL] && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
+ # dodamo tudi special meta
+ $svp_pv['meta'] = 'meta';
+ }
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ $svp_pv['itime'] = 'itime';
+ self::$lineoffset++;
+ }
+
+ // ce imamo vklopljene sistemske ne smemo povezovat podatkov in zato urejamo po abecedi
+ if(self::$_VARS[VAR_SHOW_SYSTEM]){
+
+ $hasEmail = false;
+
+ // Poiscemo sekvenco sistemske spremenljivke
+ foreach (self::$_HEADERS AS $spr => $spremenljivka) {
+ if (isset($spremenljivka['sistem']) && $spremenljivka['sistem'] == 1 && $spremenljivka['variable'] == 'email') {
+ $sequence = $spremenljivka['sequences'];
+ $hasEmail = true;
+ }
+ }
+
+ if($hasEmail){
+ # sortiramo
+ self::$do_sort = true;
+
+ # nastavimo po kateri sekvenci / stolpcu sortiramo
+ self::$sort_seq = $sequence;
+
+ self::$sort_type = 'sort_asc';
+ }
+ }
+
+ self::getQuestionCount();
+ if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
+ self::$_VARS[VAR_SPR_LIMIT] = 'all';
+ }
+
+ $spr_cont = 0; // za paginacijo spremenljivk
+
+ if(self::$_VARS['spr_limit'] == 'all'){
+ $_spr_on_pages_start = 0;
+ $_spr_on_pages_stop = self::$_VARS['spr_page'];
+ }
+ else{
+ $_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
+ $_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
+ }
+
+ # skreiramo filter variabel za podatke
+ if (count(self::$_HEADERS) > 0) {
+ // zloopamo skozi spremenljivke in sestavimo filter po stolpcih
+ $_tmp_filter = '';
+ $_prfx = '';
+ foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+ if (isset($svp_pv[$spid])) {
+ // paginacija spremenljivk
+ if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
+ if (count($spremenljivka['grids']) > 0 ) {
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ if (isset($grid['variables']) && count($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ } // end: paginacija spremenljivk
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
+ } else
+ # če prikazujemo samo sistemske
+ if ( isset($spremenljivka['variable']) && self::$_VARS[VAR_SHOW_SYSTEM] && in_array($spremenljivka['variable'], array('email','ime','priimek','telefon','naziv','drugo','odnos'))) {
+ if (count($spremenljivka['grids']) > 0 ) {
+ foreach ($spremenljivka['grids'] AS $gid => $grid) {
+ if (count ($grid['variables']) > 0) {
+ foreach ($grid['variables'] AS $vid => $variable ){
+ $_tmp_filter .= $_prfx.$variable['sequence'];
+ $_prfx = ',';
+ }
+ }
+ }
+ }
+ $svp_pv[$spid] = $spid;
+ }
+ }
+ }
+
+ # prilagodimo array profilov variabel
+ self::$_SVP_PV = $svp_pv;
+ if ($_tmp_filter != ''){
self::$_VARIABLE_FILTER = $_tmp_filter;
}
}
-
}
/** Prikaže filtre za število podatkov....
@@ -815,99 +837,7 @@ class SurveyDataDisplay{
}
# če imamo podatke
- if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
-
- echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
-
- echo '<div id="toggleDataCheckboxes2" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon close icon-orange" style="padding-bottom:2px;"></span> '.$lang['srv_data_settings_checkboxes2'].'</div>';
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
- echo '<div id="dataSetingsLinks" class="data noBorder">';
- self::displayLeftFilters();
- echo '</div>'; // konec diva za paginacijo
- }
-
- if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
-
- echo '<div class="clr" id="dataIconSetingsLinks" >'.$lang['srv_dataIcons_note'].'&nbsp;&nbsp;';
-
- if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
- echo '<input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo '&nbsp;&nbsp;';
- /*echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
- echo '&nbsp;&nbsp;';*/
- echo '<input type="checkbox" id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- } else {
- echo '<input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
- echo '&nbsp;&nbsp;';
- /*echo '<input type="checkbox" id="dataIcons_edit" disabled="disabled" /><label for="dataIcons_edit" class="gray">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
- }
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_write" disabled="disabled" /><label for="dataIcons_write" class="gray">'.$lang['srv_dataIcons_write'].'</label>';
- echo '&nbsp;&nbsp;';*/
- echo '<input type="checkbox" id="dataIcons_labels" disabled="disabled" /><label for="dataIcons_labels" class="gray">'.$lang['srv_dataIcons_labels'].'</label>';
-
- if ( self::showMultiple() ) {
- echo '&nbsp;&nbsp;';
- echo '<input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
- }
- }
-
- # preverimo koliko anket je dejansko uporbaniških
- # za potrebne statuse
- $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
-
- $lurkers = false;
- if (is_array($statuses) && count($statuses) > 0) {
- # najprej preverimo ali filtriramo lurkereje
- if (isset($statuses['lurker'])) {
- $lurkers = true;
- unset($statuses['lurker']);
- }
-
- if (count($statuses) > 0) {
- $sstring = ' AND last_status IN (';
- foreach ($statuses AS $skey => $status) {
- if (is_numeric($skey)) {
- $sstring.=$prefix.$skey;
- } else if($skey == 'null') {
- $sstring.=$prefix.'-1';
- }
- $prefix = ',';
- }
- $sstring .=')';
-
- }
- }
-
- $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
- list($cnt) = mysqli_fetch_row($q);
-
- if ($cnt > 0) {
- echo '<span class="spaceLeft">';
- self::displayOnlyCMS();
- echo '</span>';
- }
-
- echo '</div>';
- echo '<div class="clr"></div>';
- }
-
- echo '</div>';
-
-
+ if (self::$dataFileStatus != FILE_STATUS_SRV_DELETED) {
# ali imamo testne podatke
if (self::$_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
@@ -936,7 +866,7 @@ class SurveyDataDisplay{
//$_tmp_limit = array(10,50,100,250,500,1000,2500,5000,10000);
$_tmp_limit = array(10,50,100,250,500);
- $_select_records = '<select id="rec_on_page'.$position.'" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
+ $_select_records = '<select id="rec_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_REC_ON_PAGE.'\',$(\'select#rec_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_on_page'].'">';
foreach ($_tmp_limit AS $limit) {
if ($limit < self::$_RECORD_COUNT) {
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == $limit ? ' selected="selected"' : '').' value="'.$limit.'">';
@@ -947,7 +877,7 @@ class SurveyDataDisplay{
// Opcija "vsi" - ni na voljo ce je vec kot 1000 responsov (drugace lahko vse zasteka)
if(self::$_RECORD_COUNT <= 1000){
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_select_records .= $lang['srv_vsi'];
+ $_select_records .= $lang['all2'];
$_select_records .= '</option>';
}
@@ -960,7 +890,7 @@ class SurveyDataDisplay{
if (self::$_VARS[VAR_REC_ON_PAGE] != 'all' && self::$_TOTAL_PAGES > 1) {
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -968,7 +898,7 @@ class SurveyDataDisplay{
echo '<a title="'.$lang['previous_page'].'" href="#" onclick="setDataView(\''.VAR_CUR_REC_PAGE.'\',\''.(self::$_VARS[VAR_CUR_REC_PAGE]-1).'\');"><span class="faicon arrow2_l"></span></a>';
}
- $_records_page = '<select id="cur_rec_page'.$position.'" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
+ $_records_page = '<select id="cur_rec_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_CUR_REC_PAGE.'\',$(\'select#cur_rec_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_rec_current_page'].'">';
for ($i=1; $i<=self::$_TOTAL_PAGES; $i++) {
$_records_page .= '<option'.(self::$_VARS[VAR_CUR_REC_PAGE]==$i ? ' selected="selected"' : '' )
. ' value="'.$i.'" >';
@@ -999,7 +929,7 @@ class SurveyDataDisplay{
//$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50',100=>'100','all'=>$lang['hour_all2']);
$_spr_limit = array(5=>'5',10=>'10',20=>'20',30=>'30',50=>'50');
- $_spr_on_page = '<select id="spr_on_page'.$position.'" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
+ $_spr_on_page = '<select id="spr_on_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_LIMIT.'\',$(\'select#spr_on_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_on_page'].'">';
foreach ($_spr_limit AS $key => $label) {
if ($key < self::$_ALL_QUESTION_COUNT) {
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == $key ? ' selected="selected"' : '').' value="'.$key.'">';
@@ -1010,7 +940,7 @@ class SurveyDataDisplay{
// Opcija "vsi" - ni na voljo ce je vec kot 50 vprasanj (drugace lahko vse zasteka)
if(self::$_ALL_QUESTION_COUNT <= 50){
$_spr_on_page .= '<option '.(self::$_VARS[VAR_SPR_LIMIT] == 'all' ? ' selected="selected"' : '').' value="all">';
- $_spr_on_page .= $lang['hour_all2'];
+ $_spr_on_page .= $lang['srv_block_random_all'];
$_spr_on_page .= '</option>';
}
@@ -1021,7 +951,7 @@ class SurveyDataDisplay{
# KATERA STRAN
// prestejemo stevilo vprasanj
- $questions = count(self::$_SVP_PV);
+ $questions = (self::$_SVP_PV !== null) ? count(self::$_SVP_PV) : 0;
if (self::$_VARS[VAR_SPR_LIMIT] != 'all') {
$spr_pages = bcdiv($questions, self::$_VARS[VAR_SPR_LIMIT]);
@@ -1031,9 +961,9 @@ class SurveyDataDisplay{
if ($spr_pages > 1) {
- $_spr_page = '<select id="cur_spr_page'.$position.'" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
+ $_spr_page = '<select id="cur_spr_page'.$position.'" class="dropdown" onchange="setDataView(\''.VAR_SPR_PAGE.'\',$(\'select#cur_spr_page'.$position.' option:selected\').val());" title="'.$lang['srv_data_pagination_spr_current_page'].'">';
echo '<label>';
- echo $lang['page'];
+ echo $lang['page'].':';
echo '</label>';
// puscica levo
@@ -1064,82 +994,100 @@ class SurveyDataDisplay{
public static function displayLeftFilters() {
global $lang, $site_url;
-
- // število zapisov na stran
- echo '<ul class="">';
-
- echo '<li>'.$lang['srv_show'].':</li>';
-
+
// ustreznost
- if (self::$canDisplayRelevance) {
+ /* if (self::$canDisplayRelevance) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
- echo '<label for="var_relevance"><input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_relevance'].'</label>';
}
else {
- echo '<label for="var_relevance" class="gray"><input type="checkbox" disabled="disabled" />'.$lang['srv_displaydata_relevance'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_relevance'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_STATUS.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_STATUS] ? ' checked="checked"' : '').' id="var_status" /><label for="var_status">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_status" class="gray">'.$lang['srv_displaydata_status'].'</label>';
+ }
+ echo '</div>';
+
+ // podrobnosti statusa (novo - po starem levi parapodatki + datum + ustreznost)
+ echo '<div class="setting_line">';
+ if (self::$_VARS[VAR_SHOW_SYSTEM] != true) {
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_RELEVANCE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_RELEVANCE] ? ' checked="checked"' : '').' id="var_relevance" /><label for="var_relevance">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ else {
+ echo '<input type="checkbox" disabled="disabled" /><label for="var_relevance" class="gray">'.$lang['srv_displaydata_status_details'].'</label>';
+ }
+ echo '</div>';
- // email prikazujemo skupaj z ustreznost
- if ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1) {
+ // email prikazujemo skupaj z status
+ /* if (SurveyInfo::getInstance()->checkSurveyModule('email') && isset(self::$survey['user_base']) && (int)self::$survey['user_base'] == 1) {
- echo '<li>';
+ echo '<div class="setting_line">';
if (self::$_VARS[VAR_SHOW_SYSTEM] != true ) {
- echo '<label for="var_email"><input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" onchange="setDataView(\''. VAR_EMAIL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_EMAIL] ? ' checked="checked"' : '').' id="var_email" /><label for="var_email">'.$lang['srv_displaydata_invitation'].'</label>';
}
else {
- echo '<label for="var_email" class="gray"><input type="checkbox" disabled="disabled" id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
+ echo '<input type="checkbox" disabled="disabled" id="var_email" /><label for="var_email" class="gray">'.$lang['srv_displaydata_invitation'].'</label>';
}
- echo '</li>';
- }
+ echo '</div>';
+ } */
// podatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_DATA] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_DATA.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="data" /><label for="data" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_data'].'</label>';
+ echo '</div>';
+
+ // Labela
+ if(self::$_VARS[VAR_DATA]){
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' disabled').' id="dataIcons_labels" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_labels'] == true ? ' checked="checekd"' : '').'/><label '.((self::$_VARS[VAR_DATA] && !self::$_VARS[VAR_SHOW_SYSTEM])?'':' class="gray"').' for="dataIcons_labels">'.$lang['srv_dataIcons_labels'].'</label>';
+ echo '</div>';
+ }
// Preverimo ce je vklopljen modul za volitve - potem nimamo identifikatorjev
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// Parapodatki
- echo '<li>';
- echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta'].'</label>';
- echo '</li>';
-
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_METAFULL.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_METAFULL] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="fullmeta" /><label for="fullmeta" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_displaydata_meta2'].'</label>';
+ echo '</div>';
+
// če imamo sistemske podatke katere moramo prikazovati ločeno - IDENTIFIKATORJI
if(!isset(self::$_HEADERS['_settings']['count_system_data_variables']) || (isset(self::$_HEADERS['_settings']['count_system_data_variables']) && (int)self::$_HEADERS['_settings']['count_system_data_variables'] > 0)) {
- echo '<li>';
- echo ' <label><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_SYSTEM.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_SYSTEM] ? ' checked="checked"' : '').' id="showsystem" /><label for="showsystem">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
}
// Po novem vedno prikazemo checkbox identifikatorji - samo je odkljukan in disablan
- else{
- echo '<li>';
- echo ' <label class="gray"><input type="checkbox" checked="checked" disabled="disabled" id="showsystem" />'.$lang['srv_displaydata_system_data'].'</label>';
- echo '</li>';
- }
+ /* else{
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" checked="checked" disabled="disabled" id="showsystem" /><label for="showsystem" class="gray">'.$lang['srv_displaydata_system_data'].'</label>';
+ echo '</div>';
+ } */
// datum
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" />'.$lang['srv_data_date'].'</label>';
- echo '</li>';
+ /* echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_DATE.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_DATE] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showdate" /><label for="showdate" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_data_date2'].'</label>';
+ echo '</div>'; */
}
// zaporedna številka
- echo '<li>';
- echo '<label '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'><input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( self::$_VARS[VAR_SHOW_NO] ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" />'.$lang['srv_recnum'].'</label>';
- echo '</li>';
-
- // pomoč - ?
- echo '<li>'.Help :: display('displaydata_checkboxes').'</li>';
- echo '</ul>';
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" onclick="setDataView(\''.VAR_SHOW_NO.'\',$(this).is(\':checked\'))" '.( (self::$_VARS[VAR_SHOW_NO] && !self::$_VARS[VAR_SHOW_SYSTEM]) ? ' checked="checked"' : '').(self::$_VARS[VAR_SHOW_SYSTEM] ? ' disabled' : '').' id="showno" /><label for="showno" '.(self::$_VARS[VAR_SHOW_SYSTEM] ? ' class="gray"' : '').'>'.$lang['srv_recnum_long'].'</label>';
+ echo '</div>';
}
// Search po tabeli s podatki
@@ -1148,13 +1096,24 @@ class SurveyDataDisplay{
$search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
- echo '<div id="data_search_filter">';
-
- echo '<label>'.$lang['srv_find'].':</label> <input id="data_search_value" type="text" onchange="data_search_filter(); return false;" value="'.$search.'">';
- if($search != ''){
- echo '<span class="bold red spaceLeft">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
- }
+ echo '<div class="data_search_holder">';
+ echo '<div id="data_search_filter" class="setting_box '.($search != '' ? 'active':'').'">';
+
+ echo '<a '.($search != '' ? '':'onclick="showDataTableSearch();"').'><span class="faicon search pointer"></span></a> ';
+ echo '<input id="data_search_value" style="display:'.($search != '' ? "inline-block":"none").';" type="text" onchange="data_search_filter(); return false;" value="'.$search.'" placeholder="'.$lang['search'].'">';
+ echo '<input type="button" style="display: none;" value="' . $lang['s_search'] . '" />';
+
+ //X za pocisti search
+ if($search != '')
+ echo '<a onclick="clearDataTableSearch();"><span class="faicon xmark pointer"></span></a> ';
+
+ echo '</div>';
+
+ /* if($search != ''){
+ echo '<span class="search_filtered">'.$lang['srv_displayData_search'].' "'.$search.'"!</span>';
+ } */
+
echo '</div>';
}
@@ -1163,7 +1122,8 @@ class SurveyDataDisplay{
session_start();
- $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+ $search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
+
if($search != ''){
$_SESSION['sid_'.self::$sid]['data_search_filter'] = $search;
}
@@ -1181,17 +1141,17 @@ class SurveyDataDisplay{
}
- // Prikazemo editiranje na dnu (brisanje vecih hkrati...)
- public static function displayBottomEdit(){
+ // Prikazemo brisanje vecih hkrati
+ public static function displayMassDelete(){
global $lang;
+
if ((int)self::$_RECORD_COUNT > 0){
- echo '<div id="bottom_edit" class="floatLeft'.( self::$displayEditIcons['dataIcons_quick_view'] == true ? '' : ' shifted').'">';
+ echo '<div class="mass_delete">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="switch_on"><a href="javascript:selectAll(1);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="switch_off" style="display:none;"><a href="javascript:selectAll(0);">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onClick="deleteMultipleData();"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_delete_data_multirow'].'"/></span>&nbsp;'.$lang['srv_delete_selected'].'</a>';
- echo '<p>'.$lang['srv_delete_infotext'].' '.Help::display('srv_delete_infotext').'</p>';
+ echo '<span id="switch_on" class="faicon checkbox-empty" onClick="selectAll(1);" title="'.$lang['srv_select_all'].'"></span>';
+ echo '<span id="switch_off" class="faicon minus_square" onClick="selectAll(0);" title="'.$lang['srv_deselect_all'].'" style="display:none;"></span>';
+
+ echo '<button id="mass_delete_button" class="white-black small" onClick="deleteMultipleData();" style="display:none;"><span class="faicon delete" title="'.$lang['srv_delete_data_multirow'].'"/></span>'.$lang['srv_delete_selected'].'</button>';
echo '</div>';
}
@@ -1203,41 +1163,171 @@ class SurveyDataDisplay{
public static function displayVnosiHTML() {
global $lang;
global $site_path;
+ global $site_url;
global $global_user_id;
+
// na vrhu in na dnu izrisemo paginacijo
if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$_RECORD_COUNT > 0) {
- echo '<div id="vnosi_paginacija" class="top_paginacija">';
- self::displayPaginacija($position='_top');
- echo '</div>';
- // Izrisemo search
- if(!self::$_VARS[VAR_CODING])
- self::displayDataSearch();
-
+ // Zgornje nastavitve nad tabelo
+ echo '<div class="data_table_top_holder">';
+
+
+ // SN preklop - ego alter (ce je vklopljen modul)
+ if(self::$is_social_network){
+ echo '<div class="dataFullscreen">';
+
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"><button id="data_fullscreen_0" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==0 ? 'active' : '').'">'.$lang['srv_lnk_ego'].'</button></a>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"><button id="data_fullscreen_1" class="small white-blue '.((int)self::$_VARS[VAR_CIRCLES]==1 ? 'active' : '').'">'.$lang['srv_lnk_alter'].'</button></a>';
+
+ echo '</div>';
+ }
+
+
+ // Navaden pogled / fullscreen
+ echo '<div class="dataFullscreen">';
+
+ echo ' <button id="data_fullscreen_0" class="small white-blue '.(!self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'0\');">'.$lang['srv_displaydata_fullscreen_0'].'</button>';
+ echo ' <button id="data_fullscreen_1" class="small white-blue '.(self::$displayDataFullscreen ? 'active' : '').'" onClick="data_fullscreen(\'1\');">'.$lang['srv_displaydata_fullscreen_1'].'</button>';
+
+ echo '</div>';
+
// Checkboxa za urejanje in izpise podatkov ter razpiranje dodatnih nastavitev
- echo '<div class="dataSettingsBasic">';
+ echo '<div class="dataSettingsBasic">';
+ echo ' <button id="toggleDataCheckboxes" class="small white-blue '.(self::$displayEditIconsSettings ? 'active' : '').'" onClick="toggleDataCheckboxes(\'data\');"><span class="faicon plus"></span>'.$lang['srv_displaydata_columns'].'</button>';
+ echo '</div>';
- echo '<input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
- if (self::$displayEditIcons['dataIcons_edit'] == true) {
- echo ' '.Help::display('srv_podatki_urejanje_inline');
+
+ // Search
+ if(!self::$_VARS[VAR_CODING])
+ self::displayDataSearch();
+
+ //icons and export checkbox
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_edit" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_edit'] == true ? ' checked="checekd"' : '').'/>';
+ echo ' <label for="dataIcons_edit">'.$lang['srv_dataIcons_edit'].'</label>';
+ echo '</div>';
+
+ // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
+ $userAccess = UserAccess::getInstance($global_user_id);
+ if(!$userAccess->checkUserAccess($what='data_export')) {
+
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onclick="popupUserAccess(\'data_export\'); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;" '.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').'>';
+ echo ' <label for="dataIcons_write">'.$lang['srv_dataIcons_write'].'</label>';
+ echo '</div>';
+ }
}
- echo '&nbsp;&nbsp;';
-
- // Preverimo, ce je funkcionalnost v paketu, ki ga ima uporabnik
- $userAccess = UserAccess::getInstance($global_user_id);
- echo '<input type="checkbox" id="dataIcons_write" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_write'] == true ? ' checked="checked"' : '').' '.(!$userAccess->checkUserAccess($what='data_export') ? 'disabled="disabled"' : '').' /><label for="dataIcons_write" '.(!$userAccess->checkUserAccess($what='data_export') ? 'class="user_access_locked"' : '').'>'.$lang['srv_dataIcons_write'].'</label>';
- $arrow = (isset($_SESSION['sid_' . self::$sid]['dataIcons_settings'])) ? $_SESSION['sid_' . self::$sid]['dataIcons_settings'] : 0;
- echo '<div id="toggleDataCheckboxes" ' . $borderLeft . ' onClick="toggleDataCheckboxes(\'data\');"><span class="faicon ' . ($arrow == 1 ? ' dropup_blue' : 'dropdown_blue') . '"></span> ' . $lang['srv_extra_settings'] . '</div>';
+ // Paginacija
+ echo '<div id="vnosi_paginacija" class="top_paginacija">';
+ self::displayPaginacija($position='_top');
echo '</div>';
+
+
+ // Dodatne nastavitve, ki se razprejo
+ echo '<div id="dataSettingsCheckboxes" '.(self::$displayEditIconsSettings ? '' : ' style="display:none;"').'>';
+ echo ' <div class="dataSettingsCheckboxes_holder">';
+
+ if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_show'];
+ echo '</div>';
+
+ self::displayLeftFilters();
+ }
+
+ if (self :: $is_social_network == false || self::$_VARS[VAR_CIRCLES] == 0) {
+
+ echo '<div class="setting_line title">';
+ echo $lang['srv_dataTable_settings_shortcuts'];
+ echo '</div>';
+
+ if (self::$_VARS[VAR_SHOW_SYSTEM] == false ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_quick_view'] == true ? ' checked="checekd"' : '').'/><label for="dataIcons_quick_view">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" onchange="changeDataIcons(); return false;"'.(self::$displayEditIcons['dataIcons_multiple'] == true ? ' checked="checekd"' : '').' /><label for="dataIcons_multiple">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+ else {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_quick_view" disabled="disabled" /><label for="dataIcons_quick_view" class="gray">'.$lang['srv_dataIcons_quick_view'].'</label>';
+ echo '</div>';
+
+ if ( self::showMultiple() ) {
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="dataIcons_multiple" disabled="disabled" /><label for="dataIcons_multiple" class="gray">'.$lang['srv_dataIcons_multiple'].'</label>';
+ echo '</div>';
+ }
+ }
+
+ # preverimo koliko anket je dejansko uporbaniških
+ # za potrebne statuse
+ $statuses = SurveyStatusProfiles :: getStatusAsArrayString();
+
+ $lurkers = false;
+ if (is_array($statuses) && count($statuses) > 0) {
+ # najprej preverimo ali filtriramo lurkereje
+ if (isset($statuses['lurker'])) {
+ $lurkers = true;
+ unset($statuses['lurker']);
+ }
+
+ if (count($statuses) > 0) {
+ $prefix = '';
+ $sstring = ' AND last_status IN (';
+ foreach ($statuses AS $skey => $status) {
+ if (is_numeric($skey)) {
+ $sstring.=$prefix.$skey;
+ } else if($skey == 'null') {
+ $sstring.=$prefix.'-1';
+ }
+ $prefix = ',';
+ }
+ $sstring .=')';
+ }
+ }
+
+ $q = sisplet_query("SELECT count(*) FROM srv_user WHERE ank_id = '".self::$sid."' AND user_id > 0 AND deleted='0' ".$sstring);
+ list($cnt) = mysqli_fetch_row($q);
+
+ if ($cnt > 0) {
+ echo '<span class="spaceLeft">';
+ self::displayOnlyCMS();
+ echo '</span>';
+ }
+ }
+
+ // Gumb zapri dodatne nastavitve
+ echo '<div class="button_holder">';
+ echo ' <button class="small blue" onClick="toggleDataCheckboxes(\'data\');">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+
+ echo ' </div>';
+ echo '</div>';
+
+
+ echo '</div>';
}
- echo '<br class="clr" />';
-
+ // Vklopljeni filtri
echo '<div id="displayFilterNotes">';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
@@ -1265,12 +1355,7 @@ class SurveyDataDisplay{
echo '</div>';
-
-
-
-
- $folder = $site_path . EXPORT_FOLDER.'/';
-
+ // Div s tabelo
echo '<div id="div_vnosi_data">';
if ((self::$dataFileStatus == 1 || self::$dataFileStatus == 0) && self::$dataFileName !== null) {
@@ -1289,8 +1374,7 @@ class SurveyDataDisplay{
else {
# imamo SN omrežje
if (self::$_VARS[VAR_CIRCLES] == 0) {
- self::DisplaySnLinks();
- self::DisplayDataTable();
+ self::DisplayDataTable();
}
}
}
@@ -1300,35 +1384,37 @@ class SurveyDataDisplay{
}
}
else {
- echo '<br /><div style="margin: 0 0 40px 0;">Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)</div>';
+ echo 'Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)';
}
}
if (self :: $is_social_network ) {
if (self::$SSNDF != null && self::$_VARS[VAR_CIRCLES] == 1) {
- self::DisplaySnLinks();
self::$SSNDF->outputSNDataFile();
}
}
echo '</div>'; // id="div_vnosi_data">';
-
+
+ // Spodnje nastavitve pod tabelo
+ echo '<div class="data_table_bottom_holder">';
+
#izrišemo legendo statusov
self::displayStatusLegend();
self::displayMetaStatusLegend();
self::displayTestLegend();
-
// na vrhu in na dnu izrisemo paginacijo
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
+ /*if(self::$dataFileStatus != FILE_STATUS_NO_DATA){
echo '<div id="vnosi_paginacija" class="bottom_paginacija">';
self::displayPaginacija($position='_bottom');
echo '</div>';
-
- echo '<div class="clr"></div>';
- }
+ }*/
+ echo '</div>';
+
+
// osvetlimo stolpec s spremenljivko
if (isset($_GET['highlight_spr'])) {
?><script>
@@ -1379,16 +1465,13 @@ class SurveyDataDisplay{
//self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
- #izpišemo tabelo
- echo '<div style="padding-top:0px; height:5px;" class="clr">&nbsp;</div>';
-
+ #izpišemo tabelo
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="faicon arrow_large2_l icon-as_link pointer" onclick="dataTableScroll(\'left\');return false;"></span>';
- echo '&nbsp;&nbsp;&nbsp;&nbsp;';
- echo '<span class="faicon arrow_large2_r icon-as_link pointer" onclick="dataTableScroll(\'right\');return false;"></span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -1419,48 +1502,14 @@ class SurveyDataDisplay{
# ali smo v edit načinu ali monitoringu
$cssEdit = (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]?' editData':'');
- echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
-
- // Nastavimo colgroup, da na njega vezemo vse sirine v tabeli, zaradi resizinga stolpcev
- echo '<colgroup>';
- # colspan za ikonce
- if ($stolpci > 0) {
- echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
- }
- $spr_cont = 0;
- foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
- // paginacija spremenljivk
- if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
- foreach ($grid['variables'] AS $vid => $variable ){
- echo '<col seq="'.$variable['sequence'].'"';
-
- if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
- echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
- } else {
- echo ' spr_id="'.$spid.'"';
- }
-
- echo '>';
- }
- }
- }
- }
- $spr_cont++;
- }
-
- }
- echo '</colgroup>';
+
+ echo '<table id="dataTable" class="scrollTable no_wrap_td'.$cssEdit.'" '.(self::$_VARS[VAR_EDIT]?' title="'.$lang['srv_edit_data_title'].'"':'').'>';
+
echo '<thead class="fixedHeader">';
- echo '<tr>';
+
+ echo '<tr class="row1">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1468,29 +1517,120 @@ class SurveyDataDisplay{
}
# dodamo skrit stolpec uid
- echo '<th class="data_uid">&nbsp;</th>';
+ echo '<th class="data_uid"></th>';
+
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'">';
+ echo ' <div class="headerCell">'. $lang['srv_line_number'] .'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
+ //stej info_cols
+ $info_cnt = 0;
+ //ce je info_cols true, jih samo stej in jih na koncu izrisi
+ $info_cols = false;
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (isset(self::$_SVP_PV[$spid])) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+ $spremenljivka['variable'] = isset($spremenljivka['variable']) ? $spremenljivka['variable'] : '';
+
+ if($spremenljivka['tip'] == 'm'){
+ $class = 'cell_info';
+ $info_cols = true;
+
+ if (isset(self::$_SVP_PV[$spid])){
+ //$spr_cont++;
+
+ if($spid != 'status' && $spid != 'invitation')
+ $info_cnt++;
}
+ }
+ elseif($spremenljivka['tip'] == 'sm'){
+ $class = 'cell_paradata';
+ $info_cols = false;
+ }
+ else{
+ $class = 'cell_data';
+ $info_cols = false;
+ }
+
+ $cnt_all = $spremenljivka['cnt_all'] ?? 1;
+
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$spremenljivka['variable'].') ' : '';
+
+ //v stolpcih, kjer je druga vrstica glave prazna, omogoci sortiranje v prvi
+ $sortable = (in_array($spremenljivka['tip'], array('1','3','7','8','21')) || $spid == 'status' || $spid == 'invitation') ? 'sortable' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if (self::$sort_seq != null && isset($spremenljivka['grids'][0]['variables'][0]['sequence']) && $spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ if (isset(self::$_SVP_PV[$spid])) {
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
- echo '<th colspan="'.$spremenljivka['cnt_all'].'" title="'.$spremenljivka['naslov'].'">';
- echo '<div class="headerCell">'.$spremenljivka['naslov'].'</div>';
- echo '</th>';
+
+ // status in vabila so posebej na zacetku
+ if(isset(self::$_SVP_PV[$spid]) && ($spid == 'status' || $spid == 'invitation')){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span>'.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
+
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ if($info_cols == false && $info_cnt > 0 && (self::$_VARS['spr_limit'] == 'all' || self::$_VARS['spr_page'] == 1)){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+
+ //reset stevec za info col
+ $info_cnt = 0;
+ }
+
+ //ce trenutno ni info col in jih tudi ne steje, potem normalno izrisi stolpec
+ if(($info_cols == false && $info_cnt == 0) || self::$_VARS['spr_page'] > 1){
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" colspan="'.$cnt_all.'" title="'.$var_code.''.$spremenljivka['naslov'].'"
+ seq="'.$spremenljivka["grids"][0]["variables"][0]["sequence"].'">';
+ echo ' <div class="headerCell">';
+ if ($spremenljivka['grids'][0]['variables'][0]['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
+ $img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
+ echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
+ }
+ echo '<span style="font-weight:400">'.$var_code.'</span><span> '.$spremenljivka['naslov'].'</span></div>';
+ echo '</th>';
+ }
}
- $spr_cont++;
-
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
- echo '</tr><tr>';
+ //ce od podrobnosti statusa naprej ni vec celic, zakljuzi celico
+ //razpotegnjena prazna celica za vse info stolpce (ce trenutno ni vec info col, ampak prestelo pa jih je prej)
+ //prikazi podrobnosti statusa samo na prvi strani
+ if($info_cnt > 0 && self::$_VARS[VAR_SPR_PAGE] == 1){
+ echo '<th class="cell_info" colspan="'.$info_cnt.'" title="'.$lang['srv_displaydata_status_details'].'">';
+ echo ' <div class="headerCell">'.$lang['srv_displaydata_status_details'].'</div>';
+ echo '</th>';
+ }
+
+ echo '</tr>';
+
+
+ /* po novem izkljucimo drugo vrstico v headerju
+ echo '<tr class="row2">';
# colspan za ikonce
if ($stolpci > 0) {
@@ -1502,10 +1642,18 @@ class SurveyDataDisplay{
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<th class="'.$class.'" title="'.$lang['srv_line_number'].'" >';
echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
echo '</th>';
}
@@ -1515,70 +1663,130 @@ class SurveyDataDisplay{
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20){
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
- echo '<div class="headerCell">'.$grid['variable'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['variable'].'">';
+ echo ' <div class="headerCell">'.$grid['variable'].'</div>';
echo '</th>';
}
else{
- echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
- echo '<div class="headerCell">'.$grid['naslov'].'</div>';
+ echo '<th class="'.$class.'" colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
+ echo ' <div class="headerCell">'.$grid['naslov'].'</div>';
echo '</th>';
}
}
}
$spr_cont++;
}
-
}
- echo '</tr><tr>';
+ echo '</tr>'; */
+
+
+ echo '<tr class="row3">';
# colspan za ikonce
if ($stolpci > 0) {
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</td>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ // vedno na prvo mesto prikazi line number, ce je vklucen
+ if(self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th class="cell_info" title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
+ echo ' <div class="dataCell">'./* $lang['srv_line_number']. */'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
$system_columns = array();
+
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
+
+ $spremenljivka['tip'] = isset($spremenljivka['tip']) ? $spremenljivka['tip'] : '';
+
+ if($spremenljivka['tip'] == 'm')
+ $class = 'cell_info';
+ elseif($spremenljivka['tip'] == 'sm')
+ $class = 'cell_paradata';
+ else
+ $class = 'cell_data';
+
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" spr_id="lineNo">';
- echo '<div class="dataCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- if (count ($grid['variables']) > 0) {
+ if (isset($grid['variables']) && count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
+
+ //koda, ki se bo prikazala v oklepaju pred naslovom
+ $var_code = ($spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 19 || $spremenljivka['tip'] == 20) ?
+ $grid['variable'] : $variable['variable'];
+
+ //text naslova po novem
+ $title_text = $variable['naslov'];
+ //za posebne tipe info in parapodatke prilagodi text naslova
+ if($spremenljivka['tip'] == 'm' || $spremenljivka['tip'] == 'sm'){
+ //status se prikaze v zgornjem header
+ if($var_code == 'status' || $var_code == 'invitation')
+ $title_text = '';
+ if($var_code == 'recnum')
+ $title_text = $variable['naslov'].' ('.$grid['naslov'].')';
+ //datum zacetek in konec
+ if($var_code == 't_insert' || $var_code == 't_edit')
+ $title_text = $grid['naslov'].' '.$variable['naslov'];
+ //datum glede na stran
+ if(substr($var_code, 0, 5) === "date_")
+ $title_text = $grid['naslov'].' ('.$variable['naslov'].')';
+ }
+
+ //za info in parapodatke ne prikazi kode
+ $var_code = ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') ? '('.$var_code.') ' : '';
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ //v stolpcih, kjer je druga vrstica glave prazna, onemogoci sortiranje (sortira se v prvi glavi)
+ $sortable = (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) && $spid != 'status' && $spid != 'invitation') ? 'sortable' : '';
+
+ echo '<th class="'.$class.' '.$sortable.' '.$class_sorting.'" title="'.$var_code.''.$title_text.(isset($variable['other']) && $variable['other'] == '1' ? '&nbsp;(text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
-
+
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
echo ' spr_id="'.substr($spid, 0, strpos($spid, '_')).'"';
} else {
echo ' spr_id="'.$spid.'"';
}
- echo ($spremenljivka['inline_edit']?' inline_edit=1':'')
+ echo (isset($spremenljivka['inline_edit']) && $spremenljivka['inline_edit'] == '1' ? ' inline_edit=1' : '')
// .' inline_edit='.($spremenljivka['inline_edit']?$spremenljivka['inline_edit']:'0')
.($variable['sequence'] == self::$sort_seq && self::$sort_seq != null ? ' class="hover '.self::$sort_type.'"': '')
.'>';
+
+ // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
+ if(isset($spremenljivka['is_system']) && $spremenljivka['is_system'] == 1)
+ $system_columns[] = $spremenljivka['sequences'];
- if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ echo '<div class="dataCell">';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null && $sortable !== '') {
$img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
echo '<span class="sort_holder"><span class="faicon '.$img_src.'" title=""></span></span>';
}
+ echo '<span style="font-weight:400">'.(!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $var_code : '').'</span>'.
+ (!in_array($spremenljivka['tip'], array(1,3,7,8,21)) ? $title_text : '');
- // Zabelezimo sekvenco sistemskih identifikatorjev da jih pobarvamo
- if($spremenljivka['is_system'] == 1)
- $system_columns[] = $spremenljivka['sequences'];
-
- echo '<div class="dataCell">'.$variable['naslov'];
- if ($variable['other'] == 1) {
+ if (isset($variable['other']) && $variable['other'] == 1) {
echo '&nbsp;(text)';
}
@@ -1594,11 +1802,15 @@ class SurveyDataDisplay{
}
}
}
- $spr_cont++;
+
+ if($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm')
+ $spr_cont++;
}
}
+
echo'</tr>';
+
echo '</thead>';
@@ -1619,20 +1831,20 @@ class SurveyDataDisplay{
//$sort_numeric = '-n ';
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
- if (count($spremenljivka['grids']) > 0 ) {
+ if (isset($spremenljivka['grids']) && count($spremenljivka['grids']) > 0 ) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
if (self::$sort_seq == $variable['sequence']) {
// za datumska polja je potrebno malo potelovadit
- if ($variable['spss'] == 'DATETIMEw' || $variable['sortType'] == 'date') {
+ if (isset($variable['spss']) && $variable['spss'] == 'DATETIMEw' || isset($variable['sortType']) && $variable['sortType'] == 'date') {
#12.09.2011
$sortString = '-k '.self::$sort_seq.'.7,'.self::$sort_seq.'.10 -k'.self::$sort_seq.'.4,'.self::$sort_seq.'.5 -k'.self::$sort_seq.'.1,'.self::$sort_seq.'.2';
}
// za numericne spremenljivke in recnum uporabimo parameter -n da ne sortira po stringu
- if ($variable['sortType'] == 'number') {
+ if (isset($variable['sortType']) && $variable['sortType'] == 'number') {
$sort_numeric = '-n ';
}
}
@@ -1655,82 +1867,65 @@ class SurveyDataDisplay{
}
// polovimo vrstice z statusom 5,6 in jih damo v začasno datoteko
if (IS_WINDOWS) {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
- # če smo predhodno sortirali
- if (self::$do_sort == true)
- {
+
+ if (self::$do_sort == true){
$_command .= ' | gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" ';
#$_command = 'awk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
- else
- {
+ else{
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
+ }
+ else {
- } else {
- #$cmdLn1 = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName.' > '.$tmp_files['filtred_status'];
- #$out1 = shell_exec($cmdLn1);
# če smo predhodno sortirali
- if (self::$do_sort)
- {
+ if (self::$do_sort){
$_command .= ' | awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' ';
}
- else
- {
+ else{
$_command = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName;
}
-
}
// pobrisemo vrstice ki ne vsebujejo iskalnega stringa (ce searchamo) in rdece boldamo rezultat
$search = isset($_SESSION['sid_'.self::$sid]['data_search_filter']) ? $_SESSION['sid_'.self::$sid]['data_search_filter'] : '';
if($search != ''){
if (IS_WINDOWS) {
- $_command .= ' | sed "/'.$search.'/!d"';
- $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g"';
- } else {
- $_command .= ' | sed \'/'.$search.'/!d\'';
- $_command .= ' | sed \'s*'.$search.'*<span class=\"highlighted\">'.$search.'</strong>*g\'';
+ $_command .= ' | sed "/'.$search.'/I!d"';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
+ }
+ else {
+ $_command .= ' | sed \'/'.$search.'/I!d\'';
+ $_command .= ' | sed "s*'.$search.'*<span class=\"highlighted\">&</span>*Ig"';
+
}
}
-
+
// paginacija po stolpcih (spremenljivkah)
if (IS_WINDOWS) {
- #$cmdLn1_1 = 'cut -d "|" -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
$_command .= ' | cut -d "|" -f 1,'.self::$_VARIABLE_FILTER;
- } else {
- #$cmdLn1_1 = 'cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER.' '.$tmp_files['filtred_status'].' > '.$tmp_files['filtred_spr_pagination'];
- #$out1 = shell_exec($cmdLn1_1);
+ }
+ else {
$_command .= ' | cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER;
}
if (self::$_REC_LIMIT != '') {
- #paginating
+
+ #paginating
if (IS_WINDOWS) {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- } else {
- #$cmdLn2 = 'awk '.self::$_REC_LIMIT.' '.$tmp_files['filtred_spr_pagination'].' > '.$tmp_files['filtred_pagination'];
- #$out2 = shell_exec($cmdLn2);
- $_command .= ' | awk '.self::$_REC_LIMIT;
- }
- #$file_sufix = 'filtred_pagination';
- } else {
- #$file_sufix = 'filtred_spr_pagination';
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
+ else {
+ $_command .= ' | awk '.self::$_REC_LIMIT;
+ }
}
// zamenjamo | z </td><td>
if (IS_WINDOWS) {
- #$cmdLn3 = 'sed "s*'.STR_DLMT.'*</td><td>*g" '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
$_command .= ' | sed "s*'.STR_DLMT.'*'.STR_LESS_THEN.'/td'.STR_GREATER_THEN.STR_LESS_THEN.'td'.STR_GREATER_THEN.'*g" >> '.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
-
- } else {
- #$cmdLn3 = 'sed \'s*'.STR_DLMT.'*</td><td>*g\' '.$tmp_files[$file_sufix].' > '.$tmp_files['filtred_sed'];
- #$out3 = shell_exec($cmdLn3);
+ }
+ else {
$_command .= ' | sed \'s*'.STR_DLMT.'*</td><td>*g\' >> '
.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
@@ -1742,12 +1937,14 @@ class SurveyDataDisplay{
fclose($file_handler);
$out_command = shell_exec($folder.'cmd_'.self::$sid.'_to_run.bat');
unlink($folder.'cmd_'.self::$sid.'_to_run.bat');
- } else {
+ }
+ else {
$out_command = shell_exec($_command);
}
+
echo '<tbody class="scrollContent'.(self::$_VARS[VAR_CODING]?' coding':'').'">';
- #$f = fopen ($tmp_files['filtred_sed'], 'r');
+
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
if(self::$_VARS[VAR_REC_ON_PAGE] == 'all'){
@@ -1763,22 +1960,26 @@ class SurveyDataDisplay{
$f = fopen ($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT, 'r');
while ($line = fgets ($f)) {
- echo '<tr>';
+ echo '<tr class="row_data">';
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor blue"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
// Evoli ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('evoli')) {
@@ -1818,14 +2019,18 @@ class SurveyDataDisplay{
echo '</tr>';
$cntLines++;
}
- } else {
+ }
+ else {
echo 'File does not exist (err.No.1)! :'.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
- #echo $folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
+
echo '</tbody>';
+
echo '</table>';
+
echo '</div>'; // end div tableContainer
+
/**
* kliki na ikonice za urejanje in izpis so definirane v script_analiza.js, analiza_init();
*/
@@ -1833,74 +2038,71 @@ class SurveyDataDisplay{
// JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
<script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
-
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddTitles();\n";
- echo "postProcessAddMetaTitles();\n";
-
- // Pobarvamo sistemske identifikatorje
- if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
- echo "postProcessAddSystem(".json_encode($system_columns).");\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
-
- ?>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ }
+ ?>
+
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+
+ if (self::$_VARS[VAR_RELEVANCE]) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ if(self::$canDisplayRelevance) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddTitles();\n";
+ echo "postProcessAddMetaTitles();\n";
+
+ // Pobarvamo sistemske identifikatorje
+ if(self::$_HEADERS['_settings']['force_show_hiden_system'] == '1')
+ echo "postProcessAddSystem(".json_encode($system_columns).");\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+
+ ?>
</script>
<?php
+
if ($f) {
fclose($f);
}
if (file_exists($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT)) {
unlink($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT);
}
- if ($_GET['debug'] == 1) {
+ if (isset($_GET['debug']) && $_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
-
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
static public function DisplayDataMultipleTable() {
@@ -1936,8 +2138,7 @@ class SurveyDataDisplay{
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if ( isset(self::$_SVP_PV[$spid]) && is_numeric($spremenljivka['tip']) ) {
-
- //$spr_id = explode('_', $spid)[0]; // PHP 5.4
+
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
@@ -1957,23 +2158,18 @@ class SurveyDataDisplay{
$sequences[$spr] = explode('_', $multiple[$spr]['sequences'] ); // vsi stolpci trenutne spremenljivke (4 - 12)
$subseq[$spr] = count($multiple[$spr]['grids']); // stevilo vrstic v vprasanju (4 - 4) (to je za vsa vprasanja enako)
$cols[$spr] = round(count($sequences[$spr])/$subseq[$spr], 0); // koliko stolpcev zasede enkratna ponovitev vprasanja (1 - 3)
-
- #echo "\n\r vars: ".count($sequences[$spr]).' '.$subseq[$spr].' '.$cols[$spr].' '.$dataoffset."\n\r";
-
}
-
$_svp_pv['uid'] = 'uid';
- //self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
+
+
#izpišemo tabelo
- echo '<br/>';
echo '<div id="tableContainer" class="tableContainer">';
# div v katerem po potrebi prikazujemo gumbe za skrolanje levo in desno
echo '<div id="dataTableScroller">';
- echo '<span class="pointer halfCircleLeft" onclick="dataTableScroll(\'left\');return false;">&lt;</span>';
- echo '&nbsp;';
- echo '<span class="pointer halfCircleRight" onclick="dataTableScroll(\'right\');return false;">&gt;</span>';
+ echo ' <div class="dataTable_arrow left" onclick="dataTableScroll(\'left\'); return false;"><span class="faicon arrow_large2_l"></span></div>';
+ echo ' <div class="dataTable_arrow right" onclick="dataTableScroll(\'right\'); return false;"><span class="faicon arrow_large2_r"></span></div>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
@@ -2002,6 +2198,10 @@ class SurveyDataDisplay{
echo '<col class="data_edit"'.($stolpci > 1 ? (' span="'.$stolpci.'"') : '').'>';
}
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<col>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2013,11 +2213,7 @@ class SurveyDataDisplay{
$repeat = false;
else
$repeat = true;
-
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<col>';
- }
-
+
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
@@ -2054,6 +2250,12 @@ class SurveyDataDisplay{
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+
+ if (self::$showLineNumber/* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
@@ -2069,11 +2271,6 @@ class SurveyDataDisplay{
$colspan = $spremenljivka['cnt_all'];
}
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
echo '<th colspan="'.$colspan.'" title="'.$spremenljivka['naslov'].'">';
@@ -2095,6 +2292,12 @@ class SurveyDataDisplay{
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ if(self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
@@ -2107,12 +2310,6 @@ class SurveyDataDisplay{
else
$repeat = true;
- if(self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
@@ -2132,14 +2329,28 @@ class SurveyDataDisplay{
# colspan za ikonce
if ($stolpci > 0) {
- //for ($i=0; $i<$stolpci; $i++)
- // echo '<th class="data_edit">&nbsp;</th>';
- echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'>&nbsp;</th>';
+
+ $show_mass_delete = (self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1) ? true : false;
+
+ echo '<th class="data_edit" '.($stolpci > 1 ? ('colspan="'.$stolpci.'"') : '').' '/* .($show_mass_delete ? 'style="min-width:190px"' : '') */.'>';
+
+ // Editiranje na dnu - brisanje vec userjev hkrati...
+ if($show_mass_delete){
+ self::displayMassDelete();
+ }
+
+ echo '</th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid">&nbsp;</th>';
+ if (self::$showLineNumber /* && $spr_cont+1 == self::$lineoffset */) {
+ echo '<th title="'.$lang['srv_line_number'].'" >';
+ echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
+ echo '</th>';
+ }
+
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
@@ -2152,18 +2363,19 @@ class SurveyDataDisplay{
else
$repeat = true;
- if (self::$showLineNumber && $spr_cont+1 == self::$lineoffset) {
- echo '<th title="'.$lang['srv_line_number'].'" >';
- echo '<div class="headerCell">'.$lang['srv_line_number'].'</div>';
- echo '</th>';
- }
-
// paginacija spremenljivk
if (self::$_VARS['spr_limit'] == 'all' || ($spr_cont >= $_spr_on_pages_start && $spr_cont < $_spr_on_pages_stop)) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
if (count ($grid['variables']) > 0) {
foreach ($grid['variables'] AS $vid => $variable ){
- echo '<th title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
+
+ //za delovanje sortinga
+ $class_sorting = '';
+ if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
+ $class_sorting = self::$sort_type !== null ? self::$sort_type : '' ;
+ }
+
+ echo '<th class="'.$class_sorting.'" title="'.$variable['naslov'].($variable['other'] ? '&nbsp;(text)' : '').'"'
.' seq="'.$variable['sequence'].'"';
if ($spremenljivka['tip'] != 'm' && $spremenljivka['tip'] != 'sm') {
@@ -2435,21 +2647,24 @@ class SurveyDataDisplay{
echo '<tr>';
-
+ if ($stolpci > 0 ) {
+ if (self::$displayEditIcons['dataIcons_edit'] == true) {
+ // checkbox za brisanje vecih vrstic hkrati
+ echo '<td class="data_edit delete_checkbox" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" id="delete_data_row_'.$cntLines.'" class="delete_data_row" /><label for="delete_data_row_'.$cntLines.'"></label></td>';
+ }
+ }
if ((int)$display1kaIcon == 1) {
- echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon quick_view icon-as_link"></span></td>';
+ echo '<td class="enkaIcon" title="'.$lang['srv_view_data_row_quick'].'"><span class="faicon monitor"></span></td>';
}
if ($stolpci > 0 ) {
if (self::$displayEditIcons['dataIcons_edit'] == true) {
- // checkbox za brisanje vecih vrstic hkrati
- echo '<td class="data_edit" title="'.$lang['srv_view_data_row_select'].'"><input type="checkbox" class="delete_data_row" /></td>';
- echo '<td class="data_edit"><span class="faicon delete_circle icon-orange_link" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
- echo '<td class="data_edit"><span class="faicon edit_square icon-as_link" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
- echo '<td class="data_edit"><span class="faicon edit smaller icon-as_link" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon edit" title="'.$lang['srv_edit_data_row_quick'].'" /></span></td>';
+ echo '<td class="data_edit"><span class="faicon delete" title="'.$lang['srv_delete_data_row'].'"/></span></td>';
}
if (self::$displayEditIcons['dataIcons_write'] == true) {
- echo '<td class="data_edit"><span class="faicon pdf icon-as_link" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
- echo '<td class="data_edit"><span class="faicon rtf icon-as_link" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon pdf" title="'.$lang['srv_view_data_row_pdf'].'"></span></td>';
+ echo '<td class="data_edit"><span class="faicon rtf" title="'.$lang['srv_view_data_row_word'].'"></span></td>';
}
}
@@ -2481,51 +2696,62 @@ class SurveyDataDisplay{
// JS za urejanje vnosov (click in hover) (funkciji sta definirani v postProcess.js)
?>
- <script>
- $('#dataTableScroller').followTo($("#dataTable").position().top - $("#dataTableScroller").height()-25);
- dataTableResize(<?=self::$sid?>);
- $('#dataTable').bind('contextmenu', function (event) { data_preview_content(event); return false; } );
- <?php
- if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING])
- {
- ?>
- $('#dataTable td').click( function (event) { edit_data(event); } );
- $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
- edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- } elseif (self::$_VARS[VAR_CODING]) {
- ?>
- $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
- <?php
- } else {
- ?>
- $('#dataTable tr:nth-child(3) th').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
- $('#dataTable tr:nth-child(3) th').live('click', function(event) { data_header_click(event); } );
- <?php
- }
-
- ?>
- $('#dataTable td.enkaIcon span.quick_view').click( function (event) { showSurveyAnswers(event); } );
- var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
- <?php
- if (self::$_VARS[VAR_META]) {
- echo "postProcessAddLurkerTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? (4+(int)self::$_VARS[VAR_EMAIL]) : (3+(int)self::$_VARS[VAR_EMAIL])).");\n";
- }
-
- # pobarvamo celice in dodamo title za statuse
- echo "postProcessAddMetaTitles();\n";
-
- if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
- echo "postProcessAddRelevanceTitles();\n";
- }
- if (self::$_VARS[VAR_EMAIL]) {
- echo "postProcessAddEmailTitles(".(self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance ? 3 : 2).");\n";
- }
- ?>
+ <script>
+
+ <?php
+ if (self::$_VARS[VAR_EDIT] || self::$_VARS[VAR_MONITORING]){
+ ?>
+ $('#dataTable td').click( function (event) { edit_data(event); } );
+ $('#dataTable td').hover( function (event) { edit_data_hover(event) }, function (event) { edit_data_hoverout(event) } );
+ edit_data_inline_edit(); // manj utripne, ce takoj za tabelo poklicemo brez cakanja na dom ready
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ } elseif (self::$_VARS[VAR_CODING]) {
+ ?>
+ $('#dataTable tbody tr td').click( function (event) { coding_click( $(this), event ) } );
+ <?php
+ } else {
+ ?>
+ $('#dataTable tr th.sortable').hover( function (event) { data_header_hover(event) }, function (event) { data_header_hoverout(event) } );
+ $('#dataTable tr th.sortable').on('click', function(event) { data_header_click(event); } );
+ $('#dataTable tr th.sortable div span').on('click', function(event) { event.stopPropagation(); $(this).closest('th').click() } );
+
+ <?php
+ }
+
+ ?>
+ $('#dataTable td.enkaIcon span.monitor').click( function (event) { showSurveyAnswers(event); } );
+ var sort_action_url = '<?php echo 'index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVarsNoSort();?>'
+ <?php
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 2;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddLurkerTitles(".$column.");\n";
+ }
+
+ # pobarvamo celice in dodamo title za statuse
+ echo "postProcessAddMetaTitles();\n";
+
+ if (self::$_VARS[VAR_RELEVANCE] && self::$canDisplayRelevance) {
+ $column = 1;
+ if(self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) $column ++;
+ if(self::$showLineNumber) $column ++;
+ echo "postProcessAddRelevanceTitles(".$column.");\n";
+ }
+ if (self::$_VARS[VAR_EMAIL] && self::$_VARS[VAR_STATUS] && self::$canDisplayStatus) {
+ echo "postProcessAddEmailTitles(".(self::$showLineNumber ? 3 : 2).");\n";
+ }
+ ?>
</script>
- <?php
+ <?php
+
+
if ($f) {
fclose($f);
}
@@ -2535,11 +2761,6 @@ class SurveyDataDisplay{
if ($_GET['debug'] == 1) {
print_r("<pre>".$_command."</pre>");
}
-
- // Editiranje na dnu - brisanje vec userjev hkrati...
- if(self::$dataFileStatus != FILE_STATUS_NO_DATA && (int)self::$displayEditIcons['dataIcons_edit'] == 1){
- self::displayBottomEdit();
- }
}
public static function url_to_link($text) {
@@ -2562,6 +2783,9 @@ class SurveyDataDisplay{
return false;
}
+ // Shranimo jezik vmesnika
+ $lang_old = $lang;
+
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
save('usr_id', self::$usr_id);
@@ -2571,7 +2795,7 @@ class SurveyDataDisplay{
} else {
$quick_view = true;
}
-
+
$rowa = SurveyInfo::getInstance()->getSurveyRow();
if ($quick_view) {
@@ -2592,22 +2816,11 @@ class SurveyDataDisplay{
echo "<script>function submitForm(){}</script>"."\n";
}
+
echo '<div id="edit_survey_data">';
- echo '<div class="inner quick_edit">';
- // title
- echo '<div class="quick_edit_title">';
-
- //echo $rowa['naslov'];
- if (self::$quickEdit_recnum[3]['hasPrev'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[0].'\'" title="'.$lang['srv_prev_resp'].'"><span class="faicon arrow2_l pointer"></span></a>';
- }
- echo 'Recnum '.self::$quickEdit_recnum[2];
- if (self::$quickEdit_recnum[3]['hasNext'] == true) {
- echo '<a href="#" onClick="location.href=\''.self::$quickEdit_recnum[1].'\'" title="'.$lang['srv_next_resp'].'"><span class="faicon arrow2_r pointer"></span></a>';
- }
-
- echo '</div>';
+
+ echo '<div class="quick_edit_inner">';
if ($quick_view == false) {
echo '<form name="vnos" id="vnos" method="post" action="../survey/index.php?anketa='.$_GET['anketa'].'&a=data&m=quick_edit&usr_id='.$_GET['usr_id'].'&quick_view=0&post=1" enctype="multipart/form-data">'."\n";
@@ -2693,6 +2906,7 @@ class SurveyDataDisplay{
# V VPOGLEDU NE FILTRIRAMO SPREMENLJIVK (v.v.: 27.11.2011)
#$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables($_currentVariableProfile);
+ $tmp_svp_pv = array();
# če je $svp_pv = null potem prikazujemo vse variable
# oziroma če je sistemski dodamo tudi vse, ker drugače lahko filter skrije telefon in email
@@ -2726,33 +2940,38 @@ class SurveyDataDisplay{
while (get('grupa') != \App\Controllers\FindController::getInstance()->findNextGrupa() &&
(\App\Controllers\FindController::getInstance()->findNextGrupa() > 0 || (get('loop_id') != null && \App\Controllers\FindController::getInstance()->findNextLoopId() != null)));
}
- if ($quick_view == false) {
- //echo '<input type="submit" value="Shrani" /> ';<a href="#" onclick="document.forms['myFormName'].submit(); return false;">...</a>
- echo '<span class="floatRight spaceLeft" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="document.forms[\'vnos\'].submit(); return false;"><span>' . $lang['save'] . '</span></a></div></span>';
- echo '<span class="floatRight spaceRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><span>Nazaj na podatke</span></a></div></span>';
- #echo '</form>'."\n";
- }
- else{
+ if ($quick_view == false) {
echo '</form>'."\n";
}
- echo '</div>'; # inner
+ // restavriramo jezik vmesnika ce je slucajno drugacen od ankete
+ $lang = $lang_old;
- echo '<div id="quick_edit_title">';
+ echo '<div class="quick_edit_bottom_line">';
self::displayVnosIcons();
- echo '</div>';
-
- echo '<br /><br /><br /><br />';
-
+
+ if ($quick_view == false) {
+ echo '<div class="button_holder">';
+ echo ' <a href="../survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'"><button class="medium white-blue">'.$lang['srv_back_to_data'].'</button></a>';
+ echo ' <button class="medium blue" onclick="document.forms[\'vnos\'].submit(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+ }
+
echo '</div>';
+ echo '</div>'; # inner
+
+ // Div na desni z metapodatki
+ echo '<div class="quick_edit_meta_holder">';
+ echo ' <div id="quick_edit_meta">';
+ self::displayQuickEditMeta();
+ echo ' </div>';
+ echo '</div>';
- // Div na desni z metapodatki
- echo '<div id="quick_edit_meta">';
- self::displayQuickEditMeta();
echo '</div>';
+
// Preverimo ce gre za prvo urejanje - potem avtomatsko ustvarimo arhiv podatkov
if ($quick_view == false && isset($_GET['post']) && $_GET['post'] == '1') {
ob_flush();
@@ -2766,18 +2985,19 @@ class SurveyDataDisplay{
global $lang;
global $site_path;
- //echo '<h2>'.$lang['srv_data_title_quick_view'].'</h2>';
-
if (self::$dataFileStatus == FILE_STATUS_NO_DATA
|| self::$dataFileStatus == FILE_STATUS_NO_FILE
|| self::$dataFileStatus == FILE_STATUS_SRV_DELETED){
return false;
}
-
+
+ // Paginacija
self::displayQuickEditPagination();
- echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
+
+ // Filtri - ?? todo ??
+ /*echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
echo '<ul>';
# div za filtre statusov
SurveyStatusProfiles::DisplayLink(false);
@@ -2809,11 +3029,18 @@ class SurveyDataDisplay{
if ($doNewLine) {
echo '<br/>';
- }
+ }*/
+
- echo '<div id="quick_edit_title">';
+ // Zgrnja vrstica z ikonami in naslovom
+ echo '<div id="quick_edit_top_line">';
self::displayVnosIcons();
+
+ // title
+ echo '<div class="quick_edit_title">';
+ echo $lang['srv_recnum_long'].': '.self::$quickEdit_recnum[2];
+ echo '</div>';
echo '</div>';
}
@@ -2870,27 +3097,19 @@ class SurveyDataDisplay{
$current = count($uids)-1;
}
- echo '<div id="pagination" class="floatLeft">';
+ echo '<div class="pagination_holder">';
+ echo ' <div class="pagination">';
- # povezava -10
- /*if ($all > 10) {
- if ($current - 10 >= 0) {
- echo('<div><a href="'.$baseUrl.$uids[$current - 10].'">-10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">-10</div>');
- }
- }*/
-
$controls=array('hasPrev'=>true,'hasNext'=>true);
# povezava na prejšnjo stran
- $prev_page = $uids[$current - 1] ? $uids[$current - 1] :$uids[$current];
+ $prev_page = ($current > 0 && $uids[$current - 1]) ? $uids[$current - 1] :$uids[$current];
if( ($current - 1) >= 0) {
- echo('<div><a href="'.$baseUrl.$prev_page.'"><span class="faicon pagination_left icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_left icon-blue_soft"></span></div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
$controls['hasPrev'] = false;
}
@@ -2907,38 +3126,32 @@ class SurveyDataDisplay{
}
if($a == $current) {
# brez href povezave
- echo('<div class="currentPage">'.($a+1).'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$uids[$a].'">'.($a+1).'</a></div>');
+ echo '<div class="page_number currentPage">'.($a+1).'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$uids[$a].'"><div class="page_number">'.($a+1).'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
# povezava na naslednjo stran
- $next_page = ($uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
+ $next_page = (isset($uids[$current + 1]) && $uids[$current + 1]) ? $uids[$current + 1] : $uids[$current];
if(($current + 1) < $all) {
- echo('<div><a href="'.$baseUrl.$next_page.'"><span class="faicon pagination_right icon-blue"></span></a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage"><span class="faicon pagination_right icon-blue_soft"></span></div>');
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
$controls['hasNext'] = false;
}
- /*if ($all > 10) {
- if ($current + 10 < $all) {
- echo('<div><a href="'.$baseUrl.$uids[$current + 10].'">+10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">+10</div>');
- }
- }*/
-
+ echo ' </div>';
echo '</div>';
// vrnemo link na prejsnega, link na naslednjega in recnum trenutnega
- //return array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
self::$quickEdit_recnum = array($baseUrl.$prev_page, $baseUrl.$next_page, $uid_rec[self::$usr_id], $controls);
}
else {
@@ -3003,14 +3216,14 @@ class SurveyDataDisplay{
// jezik
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
- $jeziki = $lang_all_global['ime'];
+ $jeziki = isset($lang_all_global['ime']) ? $lang_all_global['ime'] : "";
$jeziki['0'] = $lang['language'];
echo '<tr><td class="left">'.$lang['lang'].':</td>';
- echo '<td class="right">'.$jeziki[$rowu['language']].'</td></tr>';
+ echo '<td class="right">'.isset($jeziki[$rowu['language']]) ? $jeziki[$rowu['language']] : "".'</td></tr>';
}
// status
- echo '<tr><td class="left">'.$lang['status'].':</td>';
+ echo '<tr><td class="left">'.$lang['status'].'</td>';
echo '<td class="right">'.($rowu['last_status'] ? $rowu['last_status'] : '&nbsp;').'</td></tr>';
// lurker
@@ -3042,21 +3255,19 @@ class SurveyDataDisplay{
echo '<td class="right">'.$text.'</td></tr>';
// preberemo popravljanje po straneh
- $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
+ $sqlG = sisplet_query("SELECT ug.time_edit, g.naslov, g.vrstni_red FROM srv_user_grupa".self::$db_table." ug, srv_grupa g WHERE g.ank_id = '".self::$sid."' AND ug.usr_id = '".self::$usr_id."' AND g.id = ug.gru_id ORDER BY g.vrstni_red ASC");
while($rowG = mysqli_fetch_array($sqlG)){
$datetime = strtotime($rowG['time_edit']);
$text = date("d.m.Y, H:i:s", $datetime);
- echo '<tr><td class="left">'.$rowG['naslov'].':</td>';
+ echo '<tr><td class="left">'.$lang['srv_stran'].' '.$rowG['vrstni_red'].':</td>';
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>';
}
}
@@ -3172,7 +3383,7 @@ class SurveyDataDisplay{
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
+ echo '.container {margin-bottom:45px;} #dataTableScroller {display:none;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
echo '</style>';
echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
@@ -3205,7 +3416,7 @@ class SurveyDataDisplay{
echo '</script>';
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" >';
+ echo '<body class="public_link data" style="margin:5px; padding:5px;" >';
echo '<h2>'.$lang['srv_publc_data_title_for'].self::$survey['naslov'].'</h2>';
echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $anketa . '" />';
@@ -3228,9 +3439,6 @@ class SurveyDataDisplay{
'a'=>'list_xls',
'anketa'=>$anketa)));
echo '<div class="printHide" style="margin-top:6px; margin-bottom:60px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
if (isset($properties['profile_id_status']))
{
@@ -3272,19 +3480,7 @@ class SurveyDataDisplay{
</script><?php
echo '</div>';
-
- echo '<div id="navigationBottom" class="printHide">';
-
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span><img src="'.$site_url.'admin/survey/icons/icons/printer.png" vartical-align="middle" /> '.$lang['hour_print2'].'</span></a></div></span>';
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
- echo '</span>';
-
- echo '<br class="clr" />';
- echo '</div>';
-
+
echo '</body>';
echo '</html>';
}
@@ -3306,20 +3502,26 @@ class SurveyDataDisplay{
$lang_admin = $row['value'];
}
+ $sqlVersion = sisplet_query("SELECT value FROM misc WHERE what = 'version'");
+ $rowVersion = mysqli_fetch_assoc($sqlVersion);
+
#izpišemo HTML
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
- echo '<head>';
- echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
+
+
+ echo '<head>';
+
+ echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
echo '<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />';
- echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
+
+ echo '<script type="text/javascript" src="'.$site_url.'admin/survey/script/js-lang.php?lang='.($lang_admin==1?'si':'en').'"></script>';
echo '<script type="text/javascript" src="'.$site_url.'admin/survey/minify/g=jsnew"></script>';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css" media="screen" rel="stylesheet" />';
- echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint" media="print" rel="stylesheet" />';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
- echo '<!--[if lt IE 7]>';
+
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=css?v='.$rowVersion['value'].'" media="screen" rel="stylesheet" />';
+ echo '<link type="text/css" href="'.$site_url.'admin/survey/minify/g=cssPrint?v='.$rowVersion['value'].'" media="print" rel="stylesheet" />';
+
+ echo '<!--[if lt IE 7]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie6hacks.css" type="text/css" />';
echo '<![endif]-->';
echo '<!--[if IE 7]>';
@@ -3328,9 +3530,7 @@ class SurveyDataDisplay{
echo '<!--[if IE 8]>';
echo '<link rel="stylesheet" href="<?=$site_url?>admin/survey/css/ie8hacks.css" type="text/css" />';
echo '<![endif]-->';
- echo '<style>';
- echo '.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}';
- echo '</style>';
+
echo '<script>';
echo 'function chkstate(){';
echo ' if(document.readyState=="complete"){';
@@ -3348,12 +3548,17 @@ class SurveyDataDisplay{
echo ' window.close();';
echo '}';
echo '</script>';
+
echo '</head>';
- echo '<body style="margin:5px; padding:5px;" onBlur="window.close();">';
- echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
- #echo '<div id="div_analiza_single_var" class="container">';
+
+ echo '<body class="quick_list_data" onBlur="window.close();">';
+
+ echo '<input type="hidden" name="anketa_id" id="srv_meta_anketa_id" value="' . $_REQUEST['anketa'] . '" />';
+
+
echo '<div id="analiza_data">';
+
//Izvoz v PDF / RTF / XLS
$_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
@@ -3370,14 +3575,18 @@ class SurveyDataDisplay{
array( 'b'=>'export',
'a'=>'list_xls',
'anketa'=>$anketa)));
- echo '<div class=" printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
+
+
+ echo '<div class="printHide">';
+
+ /*echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';*/
- echo '<br class="clr"/>';
echo $lang['srv_data_print_preview'];
+
echo '</div>';
+
self::$printPreview = true;
self::$_VARS[VAR_DATA] = 1;
@@ -3385,6 +3594,7 @@ class SurveyDataDisplay{
self::$_VARS[VAR_META] = 0;
self::$_VARS[VAR_EMAIL] = 0;
self::$_VARS[VAR_RELEVANCE] = 0;
+ self::$_VARS[VAR_STATUS] = 0;
self::$_VARS[VAR_EDIT] = 0;
self::$_VARS[VAR_PRINT] = 0;
self::$_VARS[VAR_MONITORING] = 0;
@@ -3392,27 +3602,23 @@ class SurveyDataDisplay{
unset(self::$_SVP_PV['invitation']);
}
-
- # ponastavimo nastavitve- filter
+
+ # ponastavimo nastavitve- filter
self::setUpFilter();
self::DisplayDataTable();
+
echo '</div>';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="close_win(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="window.print();return false;"><span class="faicon print_small icon-grey_dark_link"></span> '.$lang['hour_print2'].'</a></div></span>';
-
- echo '<span class="spaceRight floatRight printHide" style="margin-top:6px;">';
- echo '<a href="'.$_url1.'" target="_blank"><span class="faicon pdf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a>&nbsp;&nbsp;';
- echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="medium white-blue" onclick="window.print(); return false;">'.$lang['hour_print2'].'</button>';
+ echo ' <button class="medium blue" onclick="close_win(); return false;">'.$lang['srv_zapri'].'</button>';
echo '</span>';
-
- echo '<br class="clr" />';
+
echo '</div>';
echo '</body>';
+
echo '</html>';
}
@@ -3423,33 +3629,35 @@ class SurveyDataDisplay{
$userAccess = UserAccess::getInstance($global_user_id);
// gumbi na levi (delete, edit, izvozi...)
- echo '<div id="left_options">';
+ echo '<div class="quick_edit_icons">';
- echo '<span class="faicon delete_circle large icon-orange_link" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon edit_square large icon-grey_dark_link" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon print_small large icon-grey_dark_link" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+ echo '<span class="faicon edit_square" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');"></span>';
- // Ce imamo izvoze v paketu
- if($userAccess->checkUserAccess($what='data_export')){
- echo '<span class="faicon pdf large icon-grey_dark_link" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
- }
- else{
- echo '<span class="faicon pdf large icon-grey_dark_link user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- echo '<span class="faicon rtf large icon-grey_dark_link user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
- }
-
- echo '<span class="faicon copy large icon-grey_dark_link" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
-
- // omogocimo/onemogocimo popravljanje vnosa
+ // omogocimo/onemogocimo popravljanje vnosa
if(isset($_GET['quick_view']) && $_GET['quick_view'] == 0){
- echo '<span class="faicon edit large icon-grey_dark_link_reverse" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit" title="'.$lang['srv_quick_view_off'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="0">';
}
else{
- echo '<span class="faicon edit large icon-grey_dark_link" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon edit gray" title="'.$lang['srv_quick_view_on'].'" onClick="quickEditAction(\'quick_view\', \''.self::$usr_id.'\');"></span>';
echo '<input type="hidden" id="quick_view" value="1">';
}
+
+ echo '<span class="faicon copy" title="'.$lang['srv_copy_data'].'" onClick="quickEditAction(\'copy\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon delete" title="'.$lang['srv_delete_data_row'].'" onClick="quickEditAction(\'delete\', \''.self::$usr_id.'\');"></span>';
+
+ // Ce imamo izvoze v paketu
+ if($userAccess->checkUserAccess($what='data_export')){
+ echo '<span class="faicon pdf" title="'.$lang['PDF_Izpis'].'" onClick="quickEditAction(\'pdf\', \''.self::$usr_id.'\');"></span>';
+ echo '<span class="faicon rtf" title="'.$lang['RTF_Izpis'].'" onClick="quickEditAction(\'rtf\', \''.self::$usr_id.'\');"></span>';
+ }
+ else{
+ echo '<span class="faicon pdf user_access_locked" title="'.$lang['PDF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ echo '<span class="faicon rtf user_access_locked" title="'.$lang['RTF_Izpis'].'" onClick="popupUserAccess(\'data_export\');"></span>';
+ }
+
+ echo '<span class="faicon print" title="'.$lang['PRN_Izpis'].'" onClick="printAnaliza(\'Vpogled\'); return false;"></span>';
+
echo '</div>';
}
@@ -3457,7 +3665,7 @@ class SurveyDataDisplay{
if (self::$dataFileStatus >= 0) {
#status - če smo v meta ali imamo profil vse enote
- if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
+ if (true|| (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|| ( SurveyStatusProfiles::getCurentProfileId() == 1 )) {
SurveyAnalysisHelper::getInstance()->displayStatusLegend();
}
@@ -3467,7 +3675,7 @@ class SurveyDataDisplay{
if (self::$dataFileStatus >= 0) {
#testni vnosi - samo ce imamo testne
- if (self::$_HAS_TEST_DATA) {
+ if (self::$_HAS_TEST_DATA && self::$_VARS[VAR_RELEVANCE]) {
SurveyAnalysisHelper::getInstance()->displayTestLegend();
}
}
@@ -3478,25 +3686,7 @@ class SurveyDataDisplay{
SurveyAnalysisHelper::getInstance()->displayMissingLegend();
}
}
-
- static function DisplaySnLinks() {
- global $lang, $site_url;
-
- echo '<div id="data_sn_buttons">';
- // Gumb za preklop na EGO
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '0').'"'.((int)self::$_VARS[VAR_CIRCLES]==0?' class="red"':'').'>'.$lang['srv_lnk_ego'].'</a>';
- echo '</span>';
-
- // Gumb za preklop na ALTER
- echo '<span>';
- echo '<a href="'.$site_url.'admin/survey/index.php?anketa='.self::$sid.'&a='.A_COLLECT_DATA.'&m='.self::$subAction.self::getVars(VAR_CIRCLES, '1').'"'.((int)self::$_VARS[VAR_CIRCLES]==1?' class="red"':'').'>'.$lang['srv_lnk_alter'].'</a>';
- echo '</span>';
-
- echo '</div>';
- }
-
static function setSnDisplayFullTableCheckbox() {
session_start();
@@ -3510,14 +3700,18 @@ class SurveyDataDisplay{
$offset = 0;
- // Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+ // OLD - Ce nismo na prvi strani spremenljivk je offset drugacen in prikazemo stevilko na zacetku
+
if(self::$_VARS[VAR_SPR_PAGE] > 1){
$offset = strpos($line, '</td><td>');
}
elseif (self::$lineoffset > 0 ) {
- for ($i = 0; $i < self::$lineoffset; $i++) {
+ /* for ($i = 0; $i < self::$lineoffset; $i++) {
$offset = strpos($line,'</td><td>',$offset+1);
- }
+ } */
+
+ // NEW - vedno prikazemo st vrstice na prvem mestu (na prvi strani na drugem, zaradi uid)
+ $offset = strpos($line,'</td><td>',$offset+1);
}
return $offset;
diff --git a/admin/survey/classes/surveyData/class.SurveyDataFile.php b/admin/survey/classes/surveyData/class.SurveyDataFile.php
index 29482d7..6cb591a 100644
--- a/admin/survey/classes/surveyData/class.SurveyDataFile.php
+++ b/admin/survey/classes/surveyData/class.SurveyDataFile.php
@@ -134,9 +134,9 @@ class SurveyDataFile {
foreach ($this->HEADER AS $_vkey => $variable) {
# dodamo samo tiste variable, ki imajo numerični tip (navadne spremenljvke)
- if (is_numeric($variable['tip'] )
+ if ( (isset($variable['tip']) && is_numeric($variable['tip']))
# ne dodamo sistemskih email, telefon, ime, priimek, naziv
- && !( (int)$variable['hide_system'] == 1
+ && !( (isset($variable['hide_system']) && (int)$variable['hide_system'] == 1)
&& in_array($variable['variable'],unserialize (SYSTEM_VARIABLES)) )# unserialize (SYSTEM_VARIABLES) -> definition.php = array('email','telefon','ime','priimek','naziv','drugo')
) {
# če filter ni setiran dodamo vse variable
@@ -319,7 +319,8 @@ class SurveyDataFile {
// Preverimo ce prej nismo imeli testnih podatkov
$settings = $this->getHeaderVariable('_settings');
- if($settings['hasTestData'] != 1 && $this->has_test_data > 0){
+
+ if((!isset($settings['hasTestData']) || $settings['hasTestData'] != 1) && $this->has_test_data > 0){
return true;
}
diff --git a/admin/survey/classes/surveyData/class.SurveySNDataFile.php b/admin/survey/classes/surveyData/class.SurveySNDataFile.php
index aba152b..57796b9 100644
--- a/admin/survey/classes/surveyData/class.SurveySNDataFile.php
+++ b/admin/survey/classes/surveyData/class.SurveySNDataFile.php
@@ -17,9 +17,11 @@
* zato je na začetek dodana funkcija ki prešteje loope
*/
+
#KONSTANTE
-define(EXPORT_FOLDER, "admin/survey/SurveyData");
-DEFINE (STR_DLMT, "|");
+if(!defined(EXPORT_FOLDER)) define(EXPORT_FOLDER, "admin/survey/SurveyData");
+if(!defined(STR_DLMT)) define(STR_DLMT, "|");
+
class SurveySNDataFile {
@@ -56,7 +58,8 @@ class SurveySNDataFile {
session_start();
- $this->snCreateFullTable = $_SESSION['sid_'.$sid]['snCreateFullTable'];
+ $this->snCreateFullTable = isset($_SESSION['sid_'.$sid]['snCreateFullTable']) ? $_SESSION['sid_'.$sid]['snCreateFullTable'] : $this->snCreateFullTable;
+
if ( $this->dataFileStatus == FILE_STATUS_NO_DATA
|| $this->dataFileStatus == FILE_STATUS_SRV_DELETED) {
Common::noDataAlert();
@@ -338,8 +341,10 @@ class SurveySNDataFile {
function displayFullTableCheckbox() {
global $lang;
+
session_start();
- echo '<label><input id="snCreateFullTable" name="snCreateFullTable" onclick="setSnDisplayFullTableCheckbox();" type="checkbox"'.($this->snCreateFullTable==true?' checked="checked"':'').'>Prikaži razširjeno tabelo</label>';
+
+ echo '<input id="snCreateFullTable" name="snCreateFullTable" onclick="setSnDisplayFullTableCheckbox();" type="checkbox"'.($this->snCreateFullTable==true?' checked="checked"':'').'><label for="snCreateFullTable">Prikaži razširjeno tabelo</label>';
}
@@ -387,7 +392,7 @@ class SurveySNDataFile {
$SN_HEADER = unserialize(file_get_contents($_SN_head_file_name));
echo '<div id="tableContainer" class="tableContainer">';
- echo '<h3>'.$lang['srv_loop_for_variable'].' <b>['. $this->sn_loop_data[$lpid]['variable']. '] - '. $this->sn_loop_data[$lpid]['naslov']. '</b> ('.$lang['srv_loop_antonucci_circle'].' '.$this->sn_loop_data[$lpid]['antonucci'].')</h3>';
+ echo '<h3 class="sn_title">'.$lang['srv_loop_for_variable'].' <span class="semi-bold">['. $this->sn_loop_data[$lpid]['variable']. '] - '. $this->sn_loop_data[$lpid]['naslov']. '</span> ('.$lang['srv_loop_antonucci_circle'].' '.$this->sn_loop_data[$lpid]['antonucci'].')</h3>';
// TABELA
@@ -603,6 +608,11 @@ class SurveySNDataFile {
$add_data = true;
}
break;
+ case 'status':
+ if ($this->_VARS[VAR_STATUS] && $this->canDisplayStatus) {
+ $add_data = true;
+ }
+ break;
case 'invitation':
if ($this->_VARS[VAR_EMAIL]) {
$add_data = true;
diff --git a/admin/survey/classes/surveyEmails/class.SurveyAlert.php b/admin/survey/classes/surveyEmails/class.SurveyAlert.php
index d36e884..4c49ce6 100644
--- a/admin/survey/classes/surveyEmails/class.SurveyAlert.php
+++ b/admin/survey/classes/surveyEmails/class.SurveyAlert.php
@@ -18,7 +18,7 @@ class SurveyAlert
// konstrutor
protected function __construct() {}
// kloniranje
- final private function __clone() {}
+ private function __clone() {}
/** Poskrbimo za samo eno instanco razreda
*
@@ -62,7 +62,9 @@ class SurveyAlert
$ostala_sinhronizirana_polja = array('finish_respondent', 'finish_respondent_cms', 'finish_author', 'finish_other', 'finish_other_emails', 'finish_text', 'finish_subject', 'expire_days', 'expire_author', 'expire_other', 'expire_other_emails', 'expire_text', 'expire_subject', 'delete_author', 'delete_other', 'delete_other_emails', 'delete_text', 'delete_subject', 'active_author', 'active_other', 'active_other_emails', 'active_text0', 'active_subject0', 'active_text1', 'active_subject1');
foreach ($ostala_sinhronizirana_polja as $polje) {
- $result[$polje] = $rowA[$polje];
+
+ if(isset($rowA[$polje]))
+ $result[$polje] = $rowA[$polje];
}
// dodamo še podatke iz dostopa
@@ -75,11 +77,11 @@ class SurveyAlert
$sqlS = sisplet_query("SELECT active, naslov, insert_uid, expire ".$catch_expire_date." FROM srv_anketa WHERE id = '".self::getSurveyId()."'");
$rowS = mysqli_fetch_assoc($sqlS);
- $result['expire'] = $rowS['expire'];
- $result['survey_naslov'] = $rowS['naslov'];
- $result['survey_active'] = $rowS['active'];
- $result['author_uid'] = $rowS['insert_uid'];
- $result['alert_date'] = $rowS['alert_date'];
+ $result['expire'] = $rowS['expire'] ?? '';
+ $result['survey_naslov'] = $rowS['naslov'] ?? '';
+ $result['survey_active'] = $rowS['active'] ?? '';
+ $result['author_uid'] = $rowS['insert_uid'] ?? '';
+ $result['alert_date'] = $rowS['alert_date'] ?? '';
self::$data = array();
self::$data = $result;
@@ -93,7 +95,7 @@ class SurveyAlert
* se s pomočjo crontaba zaganja vsak dan samodejno.
*/
static function prepareSendExpireAlerts() {
- global $site_url, $lang, $mysql_database_name, $app_settings;
+ global $site_url, $lang, $mysql_database_name;
// napolnimo tabelo srv_alert v bazi surveycrontab
$sqlSurvey = sisplet_query("SELECT active FROM srv_anketa WHERE id='".self::getSurveyId()."'");
@@ -163,7 +165,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -185,7 +187,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -245,7 +247,7 @@ class SurveyAlert
* Funkcija pošlje emaile ob spremembi aktivnosti ankete
*/
static function sendMailActive() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
// poiščemo vse email naslove
// poiscemo e-maile od avtorja in userjev v dostopu
@@ -306,7 +308,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -325,7 +327,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -368,7 +370,7 @@ class SurveyAlert
* Funkcija pošlje emaile ob izbrisu ankete
*/
static function sendMailDelete() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
// poiščemo vse email naslove
// poiscemo e-maile od avtorja in userjev v dostopu
@@ -426,7 +428,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -445,7 +447,7 @@ class SurveyAlert
array(
self::$data['survey_naslov'],
date('r'),
- $site_url.'main/survey/index.php?anketa='.self::getSurveyId(),
+ $site_url.'main/survey/index.php?anketa='.SurveyInfo::getInstance()->getSurveyHash(),
self::$data['expire_days'],
'<a href="'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'">'.$site_url.'admin/survey/index.php?anketa='.self::getSurveyId().'</a>',
'<a href="'.$pdf_url.'">'.$pdf_url.'</a>',
@@ -484,7 +486,7 @@ class SurveyAlert
}
static function setDefaultAlertBeforeExpire() {
- global $lang, $site_url, $site_path, $app_settings;
+ global $lang, $site_url, $site_path;
$turn_on_alert = false;
@@ -522,7 +524,9 @@ class SurveyAlert
#osvežimo podatke
self::loadDataFromDB();
- self::prepareSendExpireAlerts();
+
+ // Ostanek, kjer se uporablja baza surveycrontab za posiljanje obvestil o poteku
+ //self::prepareSendExpireAlerts();
$sqlAlert = sisplet_query("SELECT * FROM srv_alert WHERE ank_id = '".self::getSurveyId()."'");
@@ -535,7 +539,6 @@ class SurveyAlert
static function setDefaultAlertActivation() {
global $lang;
global $global_user_id;
- global $app_settings;
$anketa = self::getSurveyId();
@@ -549,6 +552,8 @@ class SurveyAlert
$alert_active_text0 = nl2br($lang['srv_alert_active_text0'].$signature);
$alert_active_subject1 = $lang['srv_alert_active_subject1'];
$alert_active_text1 = nl2br($lang['srv_alert_active_text1'].$signature);
+ $alert_active_other_emails = '';
+ $alert_active_other_emails = '';
$mySqlInsert = sisplet_query("INSERT INTO srv_alert (ank_id, active_author, active_other, active_other_emails, active_subject0, active_text0, active_subject1, active_text1) VALUES " .
"('$anketa', '$alert_active_author', '$alert_active_other', '$alert_active_other_emails', '$alert_active_subject0', '$alert_active_text0', '$alert_active_subject1', '$alert_active_text1') " .
diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
index 00ec13f..b186c9e 100644
--- a/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
+++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsNew.php
@@ -1,11 +1,8 @@
<?php
# mysql_real_unescape_string
/** Class ki skrbi za različna vabila
- * Julij 2011
- *
- *
- * Enter description here ...
- * @author Gorazd_Veselic
+ * Januar 2024
+ * @author Uroš Podkrižnik
*
*/
@@ -17,13 +14,13 @@ define('NOTIFY_INFO1KA', 5); # Nad koliko emaili obveščamo info@1ka.si
set_time_limit(2400); # 30 minut
class SurveyInvitationsNew {
+
+
private $sid;
private $count_all = 0; # koliko prejemnikov je v bazi
private $surveySettings; # zakeširamo nastavitve ankete
private $rec_send_page_limit = 20; # Koliko zapisov imamo za paginacijo
- private $newTracking = false; # Ali imamo podroben tracking za anketo
-
private $inv_variables = array('email','password','ime','priimek','naziv','telefon','drugo','odnos');
private $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');
private $inv_variables_excel = 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'
@@ -34,18 +31,19 @@ class SurveyInvitationsNew {
#private $inv_sys_db_map = array('email'=>'email','password'=>'geslo','firstname'=>'ime','lastname'=>'priimek','salutation'=>'naziv','phone'=>'telefon','custom'=>'drugo');
private $invitationAdvancedConditionId = 0;
+ private $invitationAdvancedConditionProfileId = 0;
private $user_inv_ids = array();
private $db_table = '';
+
function __construct($sid) {
$this->sid = $sid;
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();
@@ -53,22 +51,22 @@ class SurveyInvitationsNew {
$sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
$sql_row_all = mysqli_fetch_row($sql_query_all);
$this->count_all = (int)$sql_row_all[0];
-
- # preverimo ali prikazujemo nov ali star način odvisno od nastavitve v misc
- $sql_query = sisplet_query("SELECT count(*) FROM srv_anketa AS a WHERE id ='".$this->sid."' AND insert_time > (SELECT value FROM misc WHERE what = 'invitationTrackingStarted' LIMIT 1)");
- list($newTracking) = mysqli_fetch_row($sql_query);
- $this->newTracking = (int)$newTracking > 0 ? true : false;
-
+
SurveyDataSettingProfiles :: Init($this->sid);
if (isset($_SESSION['rec_on_send_page']) && (int)$_SESSION['rec_on_send_page'] > 0) {
$this->rec_send_page_limit = (int)$_SESSION['rec_on_send_page'];
- } else {
+ }
+ else {
$this->rec_send_page_limit = REC_ON_SEND_PAGE;
}
+ $this->invitationAdvancedConditionProfileId = SurveyUserSetting :: getInstance()->getSettings('default_condition_profile');
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
SurveySession::sessionStart($this->sid);
- $this->invitationAdvancedConditionId = (int)SurveySession::get('invitationAdvancedConditionId');
}
function ajax() {
@@ -93,10 +91,9 @@ class SurveyInvitationsNew {
function action($action) {
global $lang;
global $site_url;
- global $app_settings;
global $global_user_id;
- $NoNavi = $_POST['noNavi'];
+ $NoNavi = isset($_POST['noNavi']) ? $_POST['noNavi'] : '';
if ($action == 'inv_lists') {
#$NoNavi = true;
@@ -106,9 +103,7 @@ class SurveyInvitationsNew {
}
if ($NoNavi == false) {
- echo '<div id="inv_top_navi">';
$this->displayNavigation();
- echo '</div>';
}
// Warning za nastavitev streznika
@@ -133,10 +128,12 @@ class SurveyInvitationsNew {
// Pri ajax klicih nikoli tega ne izpišemo, ravno tako ne izpisujemo, ce imamo vklopljeno posiljanje brez emaila (navadna posta, sms)
$noEmailing = SurveySession::get('inv_noEmailing');
if($NoNavi == false && $noEmailing != 1){
- echo '<div id="email_server_warning">';
- echo '<span class="faicon warning icon-orange"></span> '.$lang['srv_invitation_server_warning'].'!';
- if($action != 'inv_server')
+ echo '<div id="email_server_warning" class="top_note">';
+
+ echo '<div class="title"><span class="faicon warning icon-orange"></span> '.$lang['srv_invitation_server_warning'].'</div>';
+ //if($action != 'inv_settings')
echo '<span class="spaceLeft"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a></span>';
+
echo '</div>';
}
}
@@ -156,13 +153,16 @@ class SurveyInvitationsNew {
$this->viewRecipients();
}
else if ($action == 'view_message') {
- $this->viewMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->viewMessage($mid);
}
else if ($action == 'make_default') {
- $this->makeDefaultMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultMessage($mid);
}
else if ($action == 'make_default_from_preview') {
- $this->makeDefaultFromPreview($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultFromPreview($mid);
}
else if ($action == 'save_message_simple') {
$this->save_message_simple();
@@ -171,10 +171,11 @@ class SurveyInvitationsNew {
$this->save_message_simple_noEmail();
}
else if ($action == 'send_message') {
- $this->sendMessage($_POST['mid']);
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->sendMessage($mid);
}
else if ($action == 'view_archive') {
- $this->viewAarchive($_POST['mid']);
+ $this->viewAarchive();
}
else if ($action == 'view_send_recipients') {
if(isset($_POST['noMailing']) && $_POST['noMailing'] == '1')
@@ -223,6 +224,9 @@ class SurveyInvitationsNew {
else if ($action == 'export_recipients_all') {
$this->exportRecipients_all();
}
+ else if ($action == 'export_recipients_qr_codes') {
+ $this->exportRecipients_qr_codes();
+ }
else if ($action == 'use_recipients_list') {
$this->useRecipientsList();
}
@@ -329,7 +333,7 @@ class SurveyInvitationsNew {
}
else if ($action == 'editRecList') {
- $doEdit = $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true' ? true : false;
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
if ($doEdit) {
$this->showEditRecList();
@@ -375,7 +379,7 @@ class SurveyInvitationsNew {
$this->showAdvancedConditions();
}
else if ($action == 'setAdvancedCondition') {
- $this->setAdvancedCondition();
+ $this->setAdvancedConditionProfile($_POST['pid']);
}
else if ($action == 'inv_server') {
$this->viewServerSettings();
@@ -513,15 +517,16 @@ class SurveyInvitationsNew {
function addRecipientsView( $fields = array(), $recipients_list=null) {
global $lang;
global $site_url;
-
- //echo '<h2>'.$lang['srv_inv_add_recipients_heading'].'</h2>';
+
$noEmailing = SurveySession::get('inv_noEmailing');
$row = $this->surveySettings;
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+
+ echo '<div class="invitations_top_settings">';
+
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
@@ -557,17 +562,18 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
-
- echo '<div id="srv_invitation_note">';
+ echo '<div id="srv_invitation_note">';
echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
echo '</div>';
+
+ echo '</div>';
- echo '<div id="inv_import">';
+
+ echo '<div id="inv_import" class="invitations_holder left-menu invitations_add">';
$this->displayAddRecipientsView($fields, $recipients_list);
echo '</div>'; # id="inv_import"
}
@@ -630,44 +636,99 @@ class SurveyInvitationsNew {
session_start();
$checked = (isset($_SESSION['inv_rec_only_this_survey']) && (int)$_SESSION['inv_rec_only_this_survey'] == 1) ? '1' : '0';
+
# profili respondentov
- echo '<div id="inv_recipients_profiles_holder">';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="0" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '0' ? ' checked="checked"':'').' autocomplete="off">'.$lang['srv_inv_list_edit_from_this_survey'].'</label><br/>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="1" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '1' ? ' checked="checked"':'').' autocomplete="off">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label><br/>';
-
- echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span><br/>';
+ echo '<fieldset id="inv_recipients_profiles_holder" class="left_holder">';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="0" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '0' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' </div>';
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="1" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '1' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span>';
$this->listRecipientsProfiles();
- echo '</div>'; # id=inv_recipients_profiles_holder
- echo '<div id="inv_import_list_container">';
+ # podatki o profilu
+ $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
+
+ echo '<div class="info">';
+
+ if ((int)$ppid > 0) {
+ # polovimo podatke profila
+ $sql_string = "SELECT rp.*, u.name, u.surname FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.pid = '".(int)$ppid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_inv_recipiens_list_created_by'].implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_inv_recipiens_list_created_day'].date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ echo '<div title="'.$sql_row['comment'].'" style="max-width:202px;">'.$lang['srv_inv_recipiens_list_comment'].trim (strip_tags($sql_row['comment'])).'</div>';
+
+ }
+ else {
+ echo '<div>'.$lang['srv_inv_recipiens_temporary_list'].'</div>';
+ }
+
+ echo '</div>';
+ echo '</fieldset>'; # id=inv_recipients_profiles_holder
+
+
+ echo '<fieldset id="inv_import_list_container" class="right_holder">';
+
+ $sysUserToAdd = 0;
$sqlSysMapping = sisplet_query("SELECT * FROM srv_invitations_mapping WHERE sid = '$this->sid'");
if (mysqli_num_rows($sqlSysMapping) > 0) {
$sysUserToAddQuery = sisplet_query("SELECT count(*) FROM srv_user where ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0'");
list($sysUserToAdd) = mysqli_fetch_row($sysUserToAddQuery);
}
- echo '<span><input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label></span>';
- echo '<span><input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label></span>';
- echo '<span><input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system']
- .($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label></span>';
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_title">'.$lang['srv_inv_recipiens_from'].' '.Help::display('inv_recipiens_from_system').':</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system'].($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label>';
+ echo '</div>';
+
+ echo '</div>';
- echo Help::display('inv_recipiens_from_system');
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
if ($import_type == 3) {
- $this->createSystemVariablesMapping();
+ $this->createSystemVariablesMapping();
}
else {
-
-
- # sporočilo za personalizirana e-vabila in respondente iz baze
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_field_note'].'</span>';
-
- echo '<br >';
+
+ # sporočilo za personalizirana e-vabila in respondente iz baze
+ echo '<div class="setting_holder">';
+ echo '<span>'.$lang['srv_inv_recipiens_field_note'].'</span>';
+ echo '</div>';
+
echo '<div id="inv_field_container">';
@@ -687,7 +748,7 @@ class SurveyInvitationsNew {
echo '<br />';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
@@ -698,145 +759,119 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize:'true', tolerance:'pointer', placeholder:'inv_field_placeholder', cancel:'#inv_field_relation'});";
- echo '</script>';
-
- # iz seznama
- echo '<div id="inv_import_list"'.($import_type != 1 ? '' : ' class="hidden"').'>' ;
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_email_note'];
- echo '<br class="clr" /><span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '</span>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_0">';
- echo implode(',',$field_lang);
- echo '</span>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
+
+ # IZ SEZNAMA
+ echo '<div id="inv_import_list" '.($import_type != 1 ? '' : 'class="displayNone"').'>' ;
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_email_note'].'</div>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo '<div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo '<div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="semi-bold inv_type_0">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
// Opozorilo za limit znakov pri passwordu (20)
- echo '<span id="inv_field_list_warning" class="red" style="display:none;">';
- echo '<br class="clr" /><br class="clr" />';
+ echo '<div id="inv_field_list_warning" class="setting_line red" style="display:none;">';
echo $lang['srv_inv_recipiens_pass_warning'];
- echo '</span>';
-
- echo '<br class="clr" /><br class="clr" />';
-
+ echo '</div>';
+
// delimiter
- echo $lang['srv_inv_recipient_list_delimiter']
- .'<label for="recipientsDelimiter1"><input id="recipientsDelimiter1" type="radio" ' .(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'') .' value="," name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_comma'] .' (,)</label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter4"><input id="recipientsDelimiter4" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'') .' value="|~|" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_1KA'] .' (|~|)</label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter2"><input id="recipientsDelimiter2" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'') .' value=";" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_semicolon'] .' (;) </label>&nbsp;&nbsp;&nbsp;'
- .'<label for="recipientsDelimiter3"><input id="recipientsDelimiter3" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'') .' value="|" name="recipientsDelimiter">' .$lang['srv_inv_recipient_delimiter_pipe'] .' (|)</label>&nbsp;&nbsp;&nbsp;';
-
- echo '</span>';
-
- echo '<br class="clr" /><br class="clr" />';
-
- echo '<textarea id="inv_recipients_list" cols="50" rows="9" name="inv_recipients_list">';
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_list_delimiter'].'</label>';
+ echo ' <input id="recipientsDelimiter1" type="radio" ' .(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'') .' value="," name="recipientsDelimiter"><label for="recipientsDelimiter1">' .$lang['srv_inv_recipient_delimiter_comma'] .' (,)</label>';
+ echo ' <input id="recipientsDelimiter2" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'') .' value=";" name="recipientsDelimiter"><label for="recipientsDelimiter2">' .$lang['srv_inv_recipient_delimiter_semicolon'] .' (;) </label>';
+ echo ' <input id="recipientsDelimiter3" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'') .' value="|" name="recipientsDelimiter"><label for="recipientsDelimiter3">' .$lang['srv_inv_recipient_delimiter_pipe'] .' (|)</label>';
+ echo ' <input id="recipientsDelimiter4" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'') .' value="|~|" name="recipientsDelimiter"><label for="recipientsDelimiter4">' .$lang['srv_inv_recipient_delimiter_1KA'] .' (|~|)</label>';
+ echo '</div>';
+
+ // Vnosno polje
+ echo '<div class="setting_line">';
+ echo ' <label for="inv_recipients_list">'.$lang['srv_inv_recipiens_insert'].':</label>';
+ echo ' <textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($recipients_list) && count($recipients_list) > 0 ) {
echo implode("\n",$recipients_list);
}
- echo '</textarea>';
-
- echo '<br class="clr"/>';
-
-
- #podatki o profilu
- echo '<br class="clr"/>';
- $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
-
- echo '<span class="floatLeft" style="min-width:200px;">';
- if ((int)$ppid > 0) {
- # polovimo podatke profila
- $sql_string = "SELECT rp.*, u.name, u.surname FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.pid = '".(int)$ppid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
-
- $avtor = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_inv_recipiens_list_created_by'].implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_inv_recipiens_list_created_day'].date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- echo '<div class="gray" title="'.$sql_row['comment'].'" style="max-width:202px;">'.$lang['srv_inv_recipiens_list_comment'].trim (strip_tags($sql_row['comment'])).'</div>';
-
- } else {
- echo '<div class="gray">'.$lang['srv_inv_recipiens_temporary_list'].'</div>';
- }
- echo '</span>';
-
- echo '<div class="floatLeft spaceLeft">';
-
- echo '<div>';
- echo '<label class="spaceRight"><input type="checkbox" id="inv_recipients_add" value="1" checked="checked">'.$lang['srv_invitation_recipients_add_type4'].'</label>';
- /*echo '<label class="spaceRight"><input type="checkbox" id="inv_recipients_rename_profile" onchange="invRenameRecipientsChange();">'.$lang['srv_inv_recipients_rename_list'].'</label>';
- echo Help::display('srv_invitation_rename_profile');*/
- #echo '&nbsp;';
- #echo '<label class="spaceLeft"><input type="checkbox" id="inv_recipients_add_type2" value="2" >'.$lang['srv_invitation_recipients_add_type5'].'</label>';
+ echo ' </textarea>';
+ echo '</div>';
+
+
+ // Checkbox dodaj seznam v anketo
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="inv_recipients_add" value="1" checked="checked"><label for="inv_recipients_add">'.$lang['srv_invitation_recipients_add_type4'].'</label>';
echo '</div>';
- echo '<div id="div_inv_recipients_rename_list_type" class="displayNone">';
+
+ echo '<div id="div_inv_recipients_rename_list_type" class="displayNone setting_line">';
$this->saveRecipientListName();
echo '</div>';
- echo '</div>';
-
- echo '<br />';
# če že imamo prejemnike v bazi ponudimo gumb naprej
- echo '<span class="buttonwrapper floatRight spaceLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="invRecipientsForward(); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<br /><br />';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="blue medium" onclick="invRecipientsForward(); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
echo '</div>'; # id=inv_import_list
- # iz datoteke
- echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' class="hidden"').'>' ;
+
+ # IZ DATOTEKE
+ echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' class="displayNone"').'>' ;
+
echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=upload_recipients" autocomplete="off">';
echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
echo '<input type="hidden" name="posted" value="1" />';
- echo '<span class="inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</span>';
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</div>';
- echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_1">';
- echo implode(',',$field_lang);
- echo '</span>';
- echo '<br class="clr" />';
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'];
+ echo ' <span id="inv_field_list" class="inv_type_1">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
echo $lang['srv_mailing_upload_list'];
- echo '<input type="file" name="recipientsFile" id="recipientsFile" size="42" >';
- if (count($errors) > 0) {
+ echo '<br><input type="file" name="recipientsFile" id="recipientsFile" size="42">';
+ /* if (count($errors) > 0) {
echo '<br class="clr" />';
echo '<span class="inv_error_note">';
foreach($errors as $error) {
echo '* '.$error.'<br />';
}
echo '</span>';
- }
- echo '<br/><br/><label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label> <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1" value="," checked><label for="recipientsDelimiter1">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2" value=";"><label for="recipientsDelimiter2">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter3" value="|"><label for="recipientsDelimiter3">'.$lang['srv_inv_recipient_delimiter_pipe'].' (|)</label>';
- echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter4" value="|~|"><label for="recipientsDelimiter4">'.$lang['srv_inv_recipient_delimiter_1KA'].' (|~|)</label>';
- echo '</form>';
- echo '<br class="clr" /><span class="inv_sample" >';
- echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
- echo $lang['srv_inv_recipiens_sample1'];
- echo '</span>';
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- echo '<span id="inv_upload_recipients" class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_btn_add_recipients_add'].'</span></a></span>';
- echo '</div>'; # id=inv_import_file
+ } */
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1_import" value="," '.(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'').'><label for="recipientsDelimiter1_import">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2_import" value=";" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'').'><label for="recipientsDelimiter2_import">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter3_import" value="|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'').'><label for="recipientsDelimiter3_import">'.$lang['srv_inv_recipient_delimiter_pipe'].' (|)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter4_import" value="|~|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'').'><label for="recipientsDelimiter4_import">'.$lang['srv_inv_recipient_delimiter_1KA'].' (|~|)</label>';
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo ' <div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo ' <div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button id="inv_upload_recipients" class="blue medium">'.$lang['srv_inv_btn_add_recipients_add'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id=inv_import_file
}
- echo '</div>'; # id=inv_import_list_container
- echo '<br class="clr"/>';
+ echo '</fieldset>'; # id=inv_import_list_container
}
@@ -852,259 +887,273 @@ class SurveyInvitationsNew {
# vabila z e-maili naredimo tukaj, brez e-mailov pa s podebno funkcijo
if (in_array('inv_field_email',$fields)) {
# vabila z emaili
- $inv_iid = $this->inv_iid;
- # povezava imena polji iz forem, z imeni polji v bazi
- $db_vs_form_array = array(
- 'inv_field_email' => 'email',
- 'inv_field_firstname' => 'firstname',
- 'inv_field_lastname' => 'lastname',
- 'inv_field_password' => 'password',
- 'inv_field_cookie' => 'cookie',
- 'inv_field_salutation' => 'salutation',
- 'inv_field_phone' => 'phone',
- 'inv_field_custom' => 'custom',
- 'inv_field_relation' => 'relation',
- );
-
- #dodamo potrebna sistemska polja
- $this->addSystemVariables($fields);
-
- # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
- $_recipients = str_replace("\n\r", "\n", $_recipients);
- $recipients_list = explode("\n",$_recipients);
- $num_recipients_list = count($recipients_list);
-
- # katero polje je za e-mail
- if (in_array('inv_field_email',$fields)) {
- $user_email = true;
- } else {
- #za tip 0 - Personalizirano e-poštno vabilo kjer je polje e-mail obvezno
- # dodamo polje email
- $user_email = true;
- $fields[] = 'inv_field_email';
- }
- # polje cookie mora bit zraven
- if (!in_array('inv_field_cookie',$fields)) {
- $fields[] = 'inv_field_cookie';
- }
+ # povezava imena polji iz forem, z imeni polji v bazi
+ $db_vs_form_array = array(
+ 'inv_field_email' => 'email',
+ 'inv_field_firstname' => 'firstname',
+ 'inv_field_lastname' => 'lastname',
+ 'inv_field_password' => 'password',
+ 'inv_field_cookie' => 'cookie',
+ 'inv_field_salutation' => 'salutation',
+ 'inv_field_phone' => 'phone',
+ 'inv_field_custom' => 'custom',
+ 'inv_field_relation' => 'relation',
+ );
- /* brez preverjanja unikatnosti
- # polovimo že dodane prejemnike iz baze
- $email_in_db = array();
- $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
- $sql_query = sisplet_query($sql_string);
+ #dodamo potrebna sistemska polja
+ $this->addSystemVariables($fields);
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $email_in_db[] = strtolower($sql_row['email']);
- }
- }
- */
-
- # katero polje je za password
- if (in_array('inv_field_password',$fields)) {
- $user_password = true;
- } else {
- $user_password = false;
- # dodamo polje password
- $fields[] = 'inv_field_password';
- }
+ # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
+ $_recipients = str_replace("\n\r", "\n", $_recipients);
+ $recipients_list = explode("\n",$_recipients);
+ $num_recipients_list = count($recipients_list);
- # polja za bazo
- $db_fields = '';
- foreach ($fields as $field) {
- $db_fields .= ', '.$db_vs_form_array[$field];
- }
+ # katero polje je za e-mail
+ if (in_array('inv_field_email',$fields)) {
+ $user_email = true;
+ }
+ else {
+ #za tip 0 - Personalizirano e-poštno vabilo kjer je polje e-mail obvezno
+ # dodamo polje email
+ $user_email = true;
+ $fields[] = 'inv_field_email';
+ }
- # katera gesla (code) že imamo v bazi za to anketo
- $password_in_db = array();
- $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
- $sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $password_in_db[$sql_row['password']] = $sql_row['password'];
- }
+ # polje cookie mora bit zraven
+ if (!in_array('inv_field_cookie',$fields)) {
+ $fields[] = 'inv_field_cookie';
+ }
- $unsubscribed = array();
- #polovimo prejemnike ki ne želijo prejemati obvestil
- $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND unsubscribed = '1'";
- $sql_query = sisplet_query($sql_string);
- $unsubscribed = array();
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $unsubscribed[] = $sql_row['email'];
- }
- }
+ /* brez preverjanja unikatnosti
+ # polovimo že dodane prejemnike iz baze
+ $email_in_db = array();
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
+ $sql_query = sisplet_query($sql_string);
- #polovimo prejemnike ki ne želijo prejemati obvestil i datoteje srv_survey_unsubscribed
- $condition = (count($unsubscribed) > 0 ) ? " AND email NOT IN('".implode('\',\'',$unsubscribed)."')" : '';
- $sql_string = "SELECT email FROM srv_survey_unsubscribe WHERE ank_id = '".$this->sid."'".$condition;
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0 ) {
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $unsubscribed[] = $sql_row['email'];
- }
- }
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $email_in_db[] = strtolower($sql_row['email']);
+ }
+ }
+ */
- #array z veljavnimi zapisi
- $valid_recipiens_array = array();
- # array z zapisi kjer so napake v geslih
- $invalid_password_array = array();
- #array z zapisi kjer so neveljavna gesla
- $invalid_email_array = array();
- #array z podvojenimi zapisi
- $duplicate_email_array = array();
- #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
- $unsubscribed_recipiens_array = array();
- if ( $num_recipients_list > 0 ) {
- foreach ($recipients_list AS $recipient_line) {
- $recipient_line = trim($recipient_line);
- if ($recipient_line != null && $recipient_line != '') {
-
-
- // interni delimiter in ne vejicaa!!!!
- $line_array = explode('|~|',$recipient_line);
-
- //$line_array = explode(',',$recipient_line);
- # predpostavljamo da je vrstica vredu
- $invalid_line = false;
-
- #prilagodimo izbrana polja
- $recipent_array = array();
- $i = 0;
- foreach ($fields AS $field) {
- $recipent_array[$field] = $line_array[$i];
- $i++;
- }
-
- # izvedemo validacijo posameznih polij
-
- # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
- if ( $invalid_line == false ) {
- # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
- if ($user_password == false) {
- # gesla določamo avtomatsko, (ne bo problemov :] )
-
- # Izberemo random hash, ki se ni v bazi
- do {
- list($code,$cookie) = $this->generateCode();
- #} while (in_array($code,$password_in_db) && !is_numeric($code));
- } while (in_array($code,$password_in_db)); # je bil problem kadar so same številke
- # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
- $recipent_array['inv_field_password'] = $code;
- $recipent_array['inv_field_cookie'] = $cookie;
-
- # če je vse ok, geslo dodamo v seznam že uporabljenih
- $password_in_db[$code] = $code;
- } else {
- # gesla je določil uporabnik, (dajmo ga malo preverit)
- $user_password = trim($recipent_array['inv_field_password']);
-
- # preverimo ali je geslo že v bazi
- if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
- $invalid_password_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # če je vse ok, geslo dodamo v seznam že uporabljenih
- if ($invalid_line == false) {
- $password_in_db[$user_password] = $user_password;
- #dodamo še piškotek
- list($code,$cookie) = $this->generateCode();
- $recipent_array['inv_field_cookie'] = $cookie;
- }
- }
- }
-
- # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
- if ($user_email == true && $invalid_line == false) {
- # preberemo uporabniški email
- $email_field = trim($recipent_array['inv_field_email']);
-
- #ali je email veljaven
- if (!$this->validEmail($email_field) && $invalid_line == false) {
- $invalid_email_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # ali je email podvojen
- /* brez preverjanja unikatnosti
- if (in_array(strtolower($email_field),$email_in_db) && $invalid_line == false) {
- $duplicate_email_array[] = strtolower($recipient_line);
- $invalid_line = true;
- }
- */
-
- # ali uporabnik ne želi prejemati sporočil (opted out)
- if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
- $unsubscribed_recipiens_array[] = $recipient_line;
- $invalid_line = true;
- }
-
- # če je vse ok, email dodamo v seznam že uporabljenih
- if ( $invalid_line == false) {
- $email_in_db[] = strtolower($email_field);
- }
- }
- # če je vse ok dodamo userja k veljavnim
- if ( $invalid_line == false) {
- $valid_recipiens_array[] = $recipent_array;
- }
- }
- }
- }
+ # katero polje je za password
+ if (in_array('inv_field_password',$fields)) {
+ $user_password = true;
+ }
+ else {
+ $user_password = false;
+ # dodamo polje password
+ $fields[] = 'inv_field_password';
+ }
- if ($new_profile_id == null) {
- $list_id = (int)$_POST['pid'];
- } else {
- $list_id = $new_profile_id;
- }
+ # polja za bazo
+ $db_fields = '';
+ foreach ($fields as $field) {
+ $db_fields .= ', '.$db_vs_form_array[$field];
+ }
- # pripravimo sql stavek za vstavljanje
- if (count($valid_recipiens_array ) > 0) {
- $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
- $count = 0;
-
- $sql_insert_array = array();
- $cnt = 0;
- $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
- $array_loop = 0;
- foreach ( $valid_recipiens_array AS $recipent_fields) {
- $cnt++;
- $sql_insert = "('".$this->sid."'";
- foreach ($recipent_fields as $field) {
- $sql_insert .= ", '" .str_replace (array('\\', "'"), array('', '&#39;'), $field) ."'";
- }
- $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
- $sql_insert_array[$array_loop][] = $sql_insert;
- if ($cnt >= $max_in_array) {
- $array_loop++;
- $cnt = 0;
- }
- }
- $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+ # katera gesla (code) že imamo v bazi za to anketo
+ $password_in_db = array();
+ $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $password_in_db[$sql_row['password']] = $sql_row['password'];
+ }
+
+ $unsubscribed = array();
+ #polovimo prejemnike ki ne želijo prejemati obvestil
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND unsubscribed = '1'";
+ $sql_query = sisplet_query($sql_string);
+ $unsubscribed = array();
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
- # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
- if (count($sql_insert_array) > 0) {
+ #polovimo prejemnike ki ne želijo prejemati obvestil i datoteje srv_survey_unsubscribed
+ $condition = (count($unsubscribed) > 0 ) ? " AND email NOT IN('".implode('\',\'',$unsubscribed)."')" : '';
+ $sql_string = "SELECT email FROM srv_survey_unsubscribe WHERE ank_id = '".$this->sid."'".$condition;
+ $sql_query = sisplet_query($sql_string);
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
- foreach ($sql_insert_array AS $sub_insert_array) {
- $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
- $sqlQuery = sisplet_query($query_insert);
- $rows = mysqli_affected_rows($GLOBALS['connect_db']);
- if (!$sqlQuery) {
- $error = mysqli_error($GLOBALS['connect_db']);
- }
- }
- sisplet_query("COMMIT");
+ #array z veljavnimi zapisi
+ $valid_recipiens_array = array();
+ # array z zapisi kjer so napake v geslih
+ $invalid_password_array = array();
+ #array z zapisi kjer so neveljavna gesla
+ $invalid_email_array = array();
+ #array z podvojenimi zapisi
+ $duplicate_email_array = array();
+ #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
+ $unsubscribed_recipiens_array = array();
- }
- }
- return array( 'valid_recipiens' => $valid_recipiens_array,
- 'invalid_password' => $invalid_password_array,
- 'invalid_email' => $invalid_email_array,
- 'duplicate_email' => $duplicate_email_array,
- 'unsubscribed' => $unsubscribed_recipiens_array);
- } else {
+ if ( $num_recipients_list > 0 ) {
+
+ foreach ($recipients_list AS $recipient_line) {
+ $recipient_line = trim($recipient_line);
+
+ if ($recipient_line != null && $recipient_line != '') {
+
+ // interni delimiter in ne vejicaa!!!!
+ $line_array = explode('|~|',$recipient_line);
+
+ //$line_array = explode(',',$recipient_line);
+ # predpostavljamo da je vrstica vredu
+ $invalid_line = false;
+
+ #prilagodimo izbrana polja
+ $recipent_array = array();
+ $i = 0;
+ foreach ($fields AS $field) {
+ $recipent_array[$field] = isset($line_array[$i]) ? $line_array[$i] : '';
+
+ $i++;
+ }
+
+ # izvedemo validacijo posameznih polij
+
+ # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
+ if ( $invalid_line == false ) {
+
+ # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
+ if ($user_password == false) {
+ # gesla določamo avtomatsko, (ne bo problemov :] )
+
+ # Izberemo random hash, ki se ni v bazi
+ do {
+ list($code,$cookie) = $this->generateCode();
+ #} while (in_array($code,$password_in_db) && !is_numeric($code));
+ }
+ while (in_array($code,$password_in_db)); # je bil problem kadar so same številke
+
+ # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
+ $recipent_array['inv_field_password'] = $code;
+ $recipent_array['inv_field_cookie'] = $cookie;
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ $password_in_db[$code] = $code;
+ }
+ else {
+ # gesla je določil uporabnik, (dajmo ga malo preverit)
+ $user_password = trim($recipent_array['inv_field_password']);
+
+ # preverimo ali je geslo že v bazi
+ if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
+ $invalid_password_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ if ($invalid_line == false) {
+ $password_in_db[$user_password] = $user_password;
+ #dodamo še piškotek
+ list($code,$cookie) = $this->generateCode();
+ $recipent_array['inv_field_cookie'] = $cookie;
+ }
+ }
+ }
+
+ # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
+ if ($user_email == true && $invalid_line == false) {
+ # preberemo uporabniški email
+ $email_field = trim($recipent_array['inv_field_email']);
+
+ #ali je email veljaven
+ if (!$this->validEmail($email_field) && $invalid_line == false) {
+ $invalid_email_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # ali je email podvojen
+ /* brez preverjanja unikatnosti
+ if (in_array(strtolower($email_field),$email_in_db) && $invalid_line == false) {
+ $duplicate_email_array[] = strtolower($recipient_line);
+ $invalid_line = true;
+ }
+ */
+
+ # ali uporabnik ne želi prejemati sporočil (opted out)
+ if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
+ $unsubscribed_recipiens_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, email dodamo v seznam že uporabljenih
+ if ( $invalid_line == false) {
+ $email_in_db[] = strtolower($email_field);
+ }
+ }
+
+ # če je vse ok dodamo userja k veljavnim
+ if ( $invalid_line == false) {
+ $valid_recipiens_array[] = $recipent_array;
+ }
+ }
+ }
+ }
+
+ if ($new_profile_id == null) {
+ $list_id = (int)$_POST['pid'];
+ }
+ else {
+ $list_id = $new_profile_id;
+ }
+
+ # pripravimo sql stavek za vstavljanje
+ if (count($valid_recipiens_array ) > 0) {
+ $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
+ $count = 0;
+
+ $sql_insert_array = array();
+ $cnt = 0;
+ $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
+ $array_loop = 0;
+ foreach ( $valid_recipiens_array AS $recipent_fields) {
+ $cnt++;
+ $sql_insert = "('".$this->sid."'";
+
+ foreach ($recipent_fields as $field) {
+ $sql_insert .= ", '" .str_replace (array('\\', "'"), array('', '&#39;'), $field) ."'";
+ }
+
+ $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
+ $sql_insert_array[$array_loop][] = $sql_insert;
+
+ if ($cnt >= $max_in_array) {
+ $array_loop++;
+ $cnt = 0;
+ }
+ }
+ $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+
+ # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
+ if (count($sql_insert_array) > 0) {
+
+ foreach ($sql_insert_array AS $sub_insert_array) {
+ $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
+ $sqlQuery = sisplet_query($query_insert);
+ $rows = mysqli_affected_rows($GLOBALS['connect_db']);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ sisplet_query("COMMIT");
+ }
+ }
+ return array( 'valid_recipiens' => $valid_recipiens_array,
+ 'invalid_password' => $invalid_password_array,
+ 'invalid_email' => $invalid_email_array,
+ 'duplicate_email' => $duplicate_email_array,
+ 'unsubscribed' => $unsubscribed_recipiens_array);
+ }
+ else {
# vabila brez emailov
return $this->addMassRecipientsWithoutEmail($_recipients, $fields, $new_profile_id);
}
@@ -1114,8 +1163,6 @@ class SurveyInvitationsNew {
function addMassRecipientsWithoutEmail($_recipients='', $fields=array(), $new_profile_id=null) {
global $global_user_id;
- $inv_iid = $this->inv_iid;
-
# povezava imena polji iz forem, z imeni polji v bazi
$db_vs_form_array = array(
'inv_field_email' => 'email',
@@ -1375,15 +1422,16 @@ class SurveyInvitationsNew {
#preglej prejemnike
function viewRecipients($errors = array(), $msgs = array()) {
- global $lang, $site_url, $admin_type;
+ global $lang, $site_url, $admin_type, $site_domain;
$noEmailing = SurveySession::get('inv_noEmailing');
$row = $this->surveySettings;
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+ echo '<div class="invitations_top_settings">';
+
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
@@ -1419,17 +1467,19 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
+
+ echo '</div>';
+
#polovimo prejemnike ki ne želijo prejemati obvestil
-
+ $mysql_filter = '';
# nastavimo filter
session_start();
- $filter_duplicated = $_SESSION['inv_filter']['duplicated'];
- $filter = $_SESSION['inv_filter']['value'];
+ $filter_duplicated = isset($_SESSION['inv_filter']['duplicated']) ? $_SESSION['inv_filter']['duplicated'] : false;
+ $filter = isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value'] : '';
if ($filter != '') {
$mysql_filter = " AND ("
. "i.email LIKE '%".$filter."%'"
@@ -1504,7 +1554,7 @@ class SurveyInvitationsNew {
// Volitve nimajo nekaterih polj
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- $default_fields['responded'] = 1;
+ //$default_fields['responded'] = 1;
$default_fields['unsubscribed'] = 1;
$default_fields['password'] = 1;
}
@@ -1516,10 +1566,11 @@ class SurveyInvitationsNew {
# pogledamo katera polja dejansko prikazujemo
$sql_select_fields = array();
+ $fields = array();
while ($sql_row = mysqli_fetch_assoc($sql_query_filterd_all)) {
foreach ($default_fields AS $key => $value) {
# če polje še ni dodano in če ni prazno, ga dodamo
- if ($fields[$key] == 0 && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
+ if ((!isset($fields[$key]) || $fields[$key] == 0) && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
$fields[$key] = 1;
$sql_select_fields[] = 'i.'.$key;
}
@@ -1642,157 +1693,174 @@ class SurveyInvitationsNew {
echo '</span>';
}
- if ($count_all > 0 ) {
- # dodamo filtriranje
+ # dodamo filtriranje
+ if ($count_all > 0 ) {
echo '<div id="inv_rec_filter">';
- echo '<label>'.$lang['srv_invitation_recipients_filter'].'</label> <input id="inv_rec_filter_value" type="text" onchange="inv_filter_recipients(); return false;" value="'.$_SESSION['inv_filter']['value'].'">';
- echo '&nbsp;&nbsp;&nbsp;<label><input id="inv_rec_filter_on" type="checkbox" onchange="inv_filter_recipients(); return false;"'.(isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ? ' checked="true"' : '').'>';
- echo $lang['srv_invitation_recipients_filter_advanced'].'</label>';
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_value">'.$lang['srv_invitation_recipients_filter'].'</label><input id="inv_rec_filter_value" class="small" type="text" onchange="inv_filter_recipients(); return false;" value="'.(isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value']:'').'">';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <input id="inv_rec_filter_on" type="checkbox" onchange="inv_filter_recipients(); return false;"'.(isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ? ' checked="true"' : '').'>';
+ echo ' <label for="inv_rec_filter_on">'.$lang['srv_invitation_recipients_filter_advanced'].'</label>';
+ echo '</div>';
if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
- echo '&nbsp;';
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_sent'];
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_send">'.$lang['srv_invitation_recipients_filter_sent'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['send']) ? (int)$_SESSION['inv_filter']['send'] : 0);
- echo ' <select id="inv_rec_filter_send" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_answered'];
+ echo ' <select id="inv_rec_filter_send" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_respondet">'.$lang['srv_invitation_recipients_filter_answered'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['respondet']) ? (int)$_SESSION['inv_filter']['respondet'] : 0);
- echo ' <select id="inv_rec_filter_respondet" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_unsubscribed'];
+ echo ' <select id="inv_rec_filter_respondet" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_unsubscribed">'.$lang['srv_invitation_recipients_filter_unsubscribed'].'</label>';
$selected = (int)(isset($_SESSION['inv_filter']['unsubscribed']) ? (int)$_SESSION['inv_filter']['unsubscribed'] : 0);
- echo ' <select id="inv_rec_filter_unsubscribed" onchange="inv_filter_recipients();">';
- echo '<option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
- echo '<option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
- echo '<option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
- echo '</select></label>';
-
+ echo ' <select id="inv_rec_filter_unsubscribed" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
$this->listCondition();
$this->advancedCondition();
}
-
echo '</div>';
echo '<form id="frm_inv_rec_export" name="resp_uploader" method="post" autocomplete="off">';
+
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
echo '<input type="hidden" name="noNavi" id="noNavi" value="true">';
- echo '<br class="clr"/>';
if ($filter != '') {
- echo '<span class="red strong">';
- printf($lang['srv_inv_list_no_recipients_filter'],$filter);
- #Podatki so filtrirani: "'.$filter.'"<br/>';
- echo '</span>';
+ echo '<div class="filter_note">';
+ printf($lang['srv_inv_list_no_recipients_filter'], $filter);
+ echo '</div>';
}
+
+ echo '<div id="srv_invitation_note">';
+
if ($count_all > 0 && mysqli_num_rows($sql_query_filterd) != $count_all ) {
- echo '<div id="srv_invitation_note" class="floatLeft spaceRight">';
- echo $lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd);
- echo '</div>';
- } else {
- echo '<div id="srv_invitation_note" class="floatLeft spaceRight">';
- echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
- echo '</div>';
+ echo '<span>'.$lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd).'</span>';
+ }
+ else {
+ echo '<span>'.$lang['srv_invitation_num_respondents'].(int)$this->count_all.'</span>';
}
+ # duplicated
+ echo '<input type="checkbox" id="inv_rec_filter_duplicates" onchange="inv_filter_recipients(); return false" '. ($filter_duplicated ?' checked="checked"':'') .'><label for="inv_rec_filter_duplicates">'.$lang['srv_inv_recipient_show_only_duplicates'] .'</label>';
+
+ echo '</div>';
-
- # duplicated
- echo '<label><input type="checkbox" id="inv_rec_filter_duplicates" onchange="inv_filter_recipients(); return false" '. ($filter_duplicated ?' checked="checked"':'') .'>' . $lang['srv_inv_recipient_show_only_duplicates'] .'</label><br class="clr"/>';
if (mysqli_num_rows($sql_query_filterd) > 0 && $count_all > 0) {
-
- echo '<br class="clr"/>';
-
+
$this->displayPagination($filtred_all);
-
- echo '<br class="clr"/>';
-
-
- echo '<div style="display:inline-block; margin-right: 20px;">';
-
- # če že imamo prejemnike v bazi več kot 20 ponudimo gumb naprej tudi zgoraj
- if ($this->count_all > 20) {
- echo '<span class="buttonwrapper floatRight spaceLeft" style="margin-bottom:10px;"><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_message').'"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- }
-
+
// Izvoz vseh v excel
- echo '<span class="floatLeft" style="line-height:45px; padding-left:10px;">';
- echo '<a onclick="inv_recipients_form_action(\'export_all\');" href="#">';
- echo '<span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_all'].'" style="height:14px; width:16px;"></span>';
- echo ' '.$lang['srv_invitation_recipients_export_all'];
- echo '</a>';
- echo '</span>';
+ echo '<div class="excel_export">';
+ echo ' <a href="#" class="noline" title="'.$lang['srv_invitation_recipients_export_all'].'" onclick="inv_recipients_form_action(\'export_all\');">';
+ echo ' <span class="faicon xls"></span>'.$lang['srv_invitation_recipients_export_all'];
+ echo ' </a>';
+ echo '</div>';
+
+ // Izvoz QR kod za NIJZ
+ if($site_domain == 'anketa.nijz.si'){
+ echo '<div class="excel_export" style="margin: 16px 0;">';
+ echo ' <a href="#" class="noline" onclick="inv_recipients_form_action(\'export_qr_codes\');" >';
+ echo $lang['srv_invitation_recipients_export_qr'];
+ echo ' </a>';
+ echo '</div>';
+ }
+ echo '<div class="table_holder">';
+
echo '<table id="tbl_recipients_list">';
echo '<tr>';
+
# checkbox
- echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email']==1?'4':'3').'" >&nbsp;</th>';
+ echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email'] == 1 ? '4' : '3').'">';
+ echo ' <input type="checkbox" id="inv_switch" onClick="inv_selectAll(this);"><label for="inv_switch"></label>';
+ echo '</th>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
- if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed' ) {
- #echo '<th class="anl_ac tbl_icon_'.$fkey.' inv_'.$fkey.'_1" title="'.$lang['srv_inv_recipients_'.$fkey].'">&nbsp;</th>';
+
+ if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed' ) {
echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer tbl_icon_'.$fkey.'" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
- } else if ($fkey == 'last_status' ) {
+ }
+ else if ($fkey == 'last_status' ) {
echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
- } else {
+ }
+ else {
echo '<th'.$this->addSortField($fkey).' class="pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
}
}
}
echo '</tr>';
+
while ($sql_row = mysqli_fetch_assoc($sql_query_filterd)) {
echo '<tr>';
- # checkbox
-
- echo '<td><input type="checkbox" name="inv_rids[]" value="'.$sql_row['id'].'"></td>';
- #izbriši
- #echo '<td class="tbl_inv_left"><span class="as_link rec_delete_confirm" inv_rid="'.$sql_row['id'].'">'.$lang['srv_inv_list_profiles_delete'].'</span></td>';
- echo '<td class="tbl_inv_left"><span class="faicon delete_circle icon-orange_link" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span></td>';
- #uredi
- #echo '<td class="tbl_inv_left"><span class="as_link rec_edit" inv_rid="'.$sql_row['id'].'">'.$lang['srv_inv_list_profiles_edit'].'</span></td>';
- echo '<td class="tbl_inv_left"><span class="faicon edit smaller icon-as_link" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span></td>';
+
+
+ echo '<td colspan="3">';
+
+ # checkbox
+ echo '<input type="checkbox" id="inv_rids'.$sql_row['id'].'" name="inv_rids[]" value="'.$sql_row['id'].'"><label for="inv_rids'.$sql_row['id'].'"></label>';
+
+ #izbriši
+ echo '<span class="faicon delete" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+ #uredi
+ echo '<span class="faicon edit" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span>';
+
+ echo '</td>';
+
+
// Skoci na urejanje odgovorov - ce imamo identifikatorje povezane s podatki
if($this->surveySettings['show_email'] == 1)
- echo '<td class="tbl_inv_left"><span class="icon-grey_dark_link" onclick="window.open(\''.$site_url.'/main/survey/edit_anketa.php?anketa='.$this->sid.'&usr_id='.$sql_row['id'].'&code='.$sql_row['password'].'\', \'blank\')" title="'.$lang['srv_edit_data_row'].'"></span></td>';
+ echo '<td class="tbl_inv_left"><span class="icon-grey_dark_link" onclick="window.open(\''.$site_url.'/main/survey/edit_anketa.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&usr_id='.$sql_row['id'].'&code='.$sql_row['password'].'\', \'blank\')" title="'.$lang['srv_edit_data_row'].'"></span></td>';
foreach ($fields AS $fkey =>$field) {
if ($field == 1) {
switch ($fkey) {
case 'sent':
- echo '<td class="anl_ac pointer" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
- echo '<span class="faicon '.((int)$sql_row['sent'] == 1 ? ('inv_sent_1') : 'inv_sent_0').' icon-as_link" title="'.((int)$sql_row['sent'] == 1 ? $lang['sent'] : $lang['not_sent']).'"></span>';
+ echo '<td class="pointer" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
+ echo ((int)$sql_row['sent'] == 1 ? $lang['sent'] : $lang['not_sent']);
echo '</td>';
break;
case 'responded':
- echo '<td class="anl_ac">';
+ echo '<td class="">';
echo '<span class="faicon '.((int)$sql_row['responded'] == 1 ? ('inv_responded_1') : 'inv_responded_0').' icon-orange"></span>';
echo '</td>';
break;
case 'unsubscribed':
- echo '<td class="anl_ac ">';
- echo '<span class="faicon '.((int)$sql_row['unsubscribed'] == 1 ? ('inv_unsubscribed_1') : 'inv_unsubscribed_0').'"></span>';
+ echo '<td class="">';
+ echo ((int)$sql_row['unsubscribed'] == 1 ? $lang['unsubscribed'] : $lang['not_unsubscribed']);
echo '</td>';
break;
case 'last_status':
@@ -1837,37 +1905,48 @@ class SurveyInvitationsNew {
}
}
+
echo '</tr>';
+
@ob_flush();
}
+
echo '</table>';
+
+ echo '</div>';
+
echo '<div id="inv_bottom_edit">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="inv_switch_on"><a href="javascript:inv_selectAll(true);">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="inv_switch_off" style="display:none;"><a href="javascript:inv_selectAll(false);">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_invitation_recipients_delete_selected'].'"></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls delete" style="height:14px; width:16px;" title="'.$lang['srv_invitation_recipients_export_selected'].'"></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
- echo '&nbsp;&nbsp;<a href="#" onClick="inv_recipients_form_action(\'add\');">&nbsp;'.$lang['srv_invitation_recipients_activate3'].'</a>';
+
+ echo '<div class="bottom_actions">';
+ echo ' <a href="#" class="noline" class="noline" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete" title="'.$lang['srv_invitation_recipients_delete_selected'].'"></span>'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_selected'].'"></span>'.$lang['srv_invitation_recipients_export_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'add\');">'.$lang['srv_invitation_recipients_activate3'].'</a>';
+ echo '</div>';
// Aktivira vse v seznamu (jih doda v podatke, kot da so poslani)
- echo '<br /><span style="line-height:40px;"><a href="#" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate2'].'</a></span>';
+ echo '<div class="bottom_activate">';
+ echo ' <a href="#" class="noline" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate2'].'</a>';
+ echo '</div>';
echo '</div>';
+
# če že imamo prejemnike v bazi ponudimo gumb naprej
if ($count_all > 0) {
- echo '<div class="buttonwrapper floatRight spaceLeft" style="margin-top:-30px;"><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_message').'"><span>'.$lang['srv_invitation_forward'].'</span></a></div>';
- echo '<br class="clr"/><br>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <a href="'.$this->addUrl('view_message').'"><button type="button" class="medium blue">'.$lang['srv_invitation_forward'].'</div></a>';
+ echo '</div>';
}
- echo '</div>';
-
- } else {
- echo $lang['srv_inv_list_no_recipients_filtred'].'<br class="clr">';
}
+ else {
+ echo '<span class="search_count">'.$lang['srv_inv_list_no_recipients_filtred'].'</span>';
+ }
+
echo '</form>';
- } else {
- echo $lang['srv_inv_list_no_recipients'].'<br class="clr">';
+ }
+ else {
+ echo '<span>'.$lang['srv_inv_list_no_recipients'].'</span>';
}
}
@@ -1876,28 +1955,28 @@ class SurveyInvitationsNew {
$row = $this->surveySettings;
-
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+
+ echo '<div class="invitations_top_settings">';
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span class="semi-bold">'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
}
$settings_text .= ' - ';
$noEmailing = SurveySession::get('inv_noEmailing');
if($noEmailing == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
}
$settings_text .= ' - ';
@@ -1917,25 +1996,23 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
echo $settings_text;
+
+ echo '</div>';
- //echo '<span style="padding-left:15px; padding-right:15px;"><input type="radio" name="inv_messages_noEmailing" id="inv_messages_noEmailing_1" '.($noEmailing == 0 ? ' checked="checked"' : '').' style="margin-bottom:4px;" onClick="noEmailingToggle(\'0\');" /> <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_0'].'</label></span>';
- //echo '<span><input type="radio" name="inv_messages_noEmailing" id="inv_messages_noEmailing_2" '.($noEmailing == 1 ? ' checked="checked"' : '').' style="margin-bottom:4px;" onClick="noEmailingToggle(\'1\');" /> <label for="inv_messages_noEmailing_2">'.$lang['srv_inv_message_noemailing_1'].'</label></span>';
-
- echo '</h2>';
-
-
+
// Ce posiljamo preko emaila
if($noEmailing != 1){
- echo '<div id="inv_messages_holder">';
+ echo '<div id="inv_messages_holder" class="invitations_holder three-part invitations_message">';
if ($this->checkDefaultMessage() == false) {
echo '<span class="inv_error_note">';
echo $lang['srv_invitation_note6'];
echo '</span>';
- } else {
+ }
+ else {
$sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
$sql_query = sisplet_query($sql_string);
$array_messages = array();
@@ -1950,135 +2027,173 @@ class SurveyInvitationsNew {
}
$preview_message = $array_messages[$mid];
- echo '<div id="inv_messages_profiles_holder" class="floatLeft">';
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
- echo '<div id="invitation_messages" >';
+
+
+ echo '<div id="invitation_messages" >';
+
echo '<ol>';
foreach ($array_messages AS $_m => $message) {
- echo '<li mid="'.$message['id'].'" class="'
- .($message['id'] == $mid ? ' active' : '')
- .'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
echo '</li>';
}
echo '</ol>';
+
echo '</div>'; #invitation_messages
- echo '<br class="clr" />';
- if (count($array_messages) > 1) {
- echo '<span class="as_link" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'">'.$lang['srv_inv_message_delete_profile'].'</span><br/>';
- }
- echo '<span class="as_link" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'">'.$lang['srv_inv_message_rename_profile'].'</span>';
- {
- # polovimo podatke profila
- $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
+
+
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
- $avtor = array();
- $edit = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- if (trim($sql_row['ename'])) {
- $edit[] = trim ($sql_row['ename']);
- }
- if (trim($sql_row['esurname'])) {
- $edit[] = trim ($sql_row['esurname']);
- }
+ echo '<div class="info">';
- if ( count($edit) > 0 && $edit != $avtor) {
- echo '<div class="gray">'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
- }
- if ($sql_row['insert_time'] != $sql_row['edit_time']) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
-
- echo '<div class="gray" style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
- }
-
- echo '</div>'; #inv_messages_profiles_holder
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
$MA = new MailAdapter($this->sid, $type='invitation');
+
# zlistamo seznam vseh sporočil
# izpišemo primer besedila
- echo '<div id="inv_msg_preview_hld" class="floatLeft">';
- echo '<span class="h2 spaceRight floatLeft">'.$lang['srv_inv_message_draft_content_heading'].'</span> '.Help::display('srv_inv_message_title');
+ echo '<fieldset id="inv_msg_preview_hld" class="middle">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
+
- //echo '<span class="spaceRight floatRight"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_server&show_back=true">'.$lang['srv_inv_message_draft_settings'].'</a></span>';
- echo '<br class="clr"/>';
- echo '<div id="inv_error_note" class="hidden"></div>';
echo '<div id="inv_msg_preview">';
- echo '<table>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_from'].':</th>';
- echo '<td class="inv_bt">';
+
+
+ echo '<div class="setting_row">';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_from'].':</label>';
if($MA->getMailFrom() == '')
- echo '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a>';
+ echo ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a>';
else
echo $MA->getMailFrom();
- echo '<input type="hidden" id="inv_message_replyto" value="'.$MA->getMailFrom().'" autocomplete="off" readonly>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_reply'].':</th>';
- echo '<td class="inv_bt">';
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailFrom().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_reply'].':</label>';
echo $MA->getMailReplyTo();
- echo '<input type="hidden" id="inv_message_replyto" value="'.$MA->getMailReplyTo().'" autocomplete="off" readonly>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<input type="text" id="inv_message_subject" value="'.$preview_message['subject_text'].'" autocomplete="off">';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td ><div class="msgBody">';
- echo '<textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailReplyTo().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
?>
- <script type="text/javascript">
- create_inv_editor('inv_message_body', false);
- </script><?php
- echo '</td></tr>';
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
$urls = $this->getUrlLists();
-
if (count($urls) > 0) {
- echo '<tr><th>'.$lang['srv_inv_message_draft_url'].'</th>';
- echo '<td>';
- echo '<select id="inv_message_url">';
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
foreach ($urls AS $url) {
- $selected = '';
+ $selected = '';
if ($preview_message['url'] == '') {
- if ($preview_message['dc'] == true) {
- $selected = ' selected="selected"';
+ if (isset($preview_message['dc']) && $preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
}
} else if ($preview_message['url'] == $url['url']) {
- $selected = ' selected="selected"';
+ $selected = ' selected="selected"';
}
echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
}
echo '</select>';
- echo '</td>';
- echo '</tr>';
+
+ echo '</div>';
}
- echo '</table>';
+
echo '</div>';
- echo '<br class="clr"/>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton" href="#" onclick="inv_message_save_forward(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="if(inv_message_save_simple(\''.$mid.'\')) { window.location.reload() }; return false;"><span>'.$lang['srv_inv_message_save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_message_saveNew'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_message_saveNew'].'</span></a></span>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
- echo '</div>';
+ echo '</fieldset>';
+
- echo '<div id="invitation_profile_notes"><p>';
+ echo '<fieldset id="invitation_profile_notes" class="right_holder">';
+ echo '<p class="semi-bold caps">'.$lang['srv_inv_message_help_title'].'</p>';
+
$_indicators = $this->getAvailableIndicators();
$_sysVars = $this->getAvailableSysVars();
@@ -2090,7 +2205,11 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_message_help_identifikators'];
foreach ($_indicators AS $_identifikator) {
- echo $prefix.'<br/>#'.strtoupper($_identifikator).'#'.$lang['srv_inv_message_help_system_'.strtolower($_identifikator)];
+ echo $prefix.'<br/>#'.strtoupper($_identifikator).'#';
+
+ if(isset($lang['srv_inv_message_help_system_'.strtolower($_identifikator)]))
+ echo $lang['srv_inv_message_help_system_'.strtolower($_identifikator)];
+
$prefix = ', ';
}
@@ -2109,46 +2228,27 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_note12'];
}
- echo '</p></div>';
+ echo '</fieldset>';
}
echo '</div>';
}
// Ce samo dokumentiramo - navadna posta, SMS...
else{
- echo '<div id="inv_messages_holder_noEmailing">';
-
- echo $lang['srv_inv_message_noemailing_text'];
-
- // Izbira nacina posiljanja (navadna posta, sms...) - prestavljeno pod nastavitve
- /*echo '<div id="inv_select_noMail_type">';
-
- $noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<span class="bold">'.$lang['srv_inv_message_noemailing_type'].':</span>';
-
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType1" value="0" type="radio" '.($noEmailingType == 0 ? ' checked="checked"' : '').' onClick="noEmailingType(\'0\');"><label for="noMailType1">' . $lang['srv_inv_message_noemailing_type1'] . '</label></span>';
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType2" value="1" type="radio" '.($noEmailingType == 1 ? ' checked="checked"' : '').' onClick="noEmailingType(\'1\');"><label for="noMailType2">' . $lang['srv_inv_message_noemailing_type2'] . '</label></span>';
- echo '<span class="inv_send_span spaceLeft"><input name="noMailType" id="noMailType3" value="2" type="radio" '.($noEmailingType == 2 ? ' checked="checked"' : '').' onClick="noEmailingType(\'2\');"><label for="noMailType3">' . $lang['srv_inv_message_noemailing_type3'] . '</label></span>';
-
- echo '</div>';*/
- // Gumb naprej
- /*echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'">';
- echo '<a class="ovalbutton ovalbutton_orange" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_message&noemailing=1"><span>'.$lang['srv_invitation_forward'];
- echo '</span></a></span>';
-
- echo '<br class="clr"/>';*/
-
+ echo '<div id="inv_messages_holder_noEmailing">';
+ echo $lang['srv_inv_message_noemailing_text'];
echo '</div>';
-
-
- echo '<div id="inv_messages_holder">';
+
+
+ echo '<div id="inv_messages_holder" class="invitations_holder left-menu invitations_message">';
if ($this->checkDefaultMessage() == false) {
echo '<span class="inv_error_note">';
echo $lang['srv_invitation_note6'];
echo '</span>';
- } else {
+ }
+ else {
$sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
$sql_query = sisplet_query($sql_string);
$array_messages = array();
@@ -2163,124 +2263,153 @@ class SurveyInvitationsNew {
}
$preview_message = $array_messages[$mid];
- echo '<div id="inv_messages_profiles_holder" class="floatLeft">';
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
- echo '<div id="invitation_messages" >';
+
+
+ echo '<div id="invitation_messages">';
+
echo '<ol>';
foreach ($array_messages AS $_m => $message) {
- echo '<li mid="'.$message['id'].'" class="'
- .($message['id'] == $mid ? ' active' : '')
- .'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
echo '</li>';
}
echo '</ol>';
+
echo '</div>'; #invitation_messages
- echo '<br class="clr" />';
- if (count($array_messages) > 1) {
- echo '<span class="as_link" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'">'.$lang['srv_inv_message_delete_profile'].'</span><br/>';
- }
- echo '<span class="as_link" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'">'.$lang['srv_inv_message_rename_profile'].'</span>';
- {
- # polovimo podatke profila
- $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
- $sql_query = sisplet_query($sql_string);
- $sql_row = mysqli_fetch_assoc($sql_query);
- $avtor = array();
- $edit = array();
- if (trim($sql_row['name'])) {
- $avtor[] = trim ($sql_row['name']);
- }
- if (trim($sql_row['surname'])) {
- $avtor[] = trim ($sql_row['surname']);
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray">'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
- }
- if ( count($avtor) > 0 ) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
- if (trim($sql_row['ename'])) {
- $edit[] = trim ($sql_row['ename']);
- }
- if (trim($sql_row['esurname'])) {
- $edit[] = trim ($sql_row['esurname']);
- }
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+
+
+ echo '<div class="info">';
+
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
- if ( count($edit) > 0 && $edit != $avtor) {
- echo '<div class="gray">'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
- }
- if ($sql_row['insert_time'] != $sql_row['edit_time']) {
- echo '<div class="gray" title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
- }
-
- echo '<div class="gray" style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
- }
- echo '</div>'; #inv_messages_profiles_holder
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
$MA = new MailAdapter($this->sid, $type='invitation');
+
# zlistamo seznam vseh sporočil
# izpišemo primer besedila
- echo '<div id="inv_msg_preview_hld" class="floatLeft">';
- echo '<span class="h2 spaceRight floatLeft">'.$lang['srv_inv_message_draft_content_heading'].'</span> '.Help::display('srv_inv_message_title_noEmail');
+ echo '<fieldset id="inv_msg_preview_hld" class="right_holder">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title_noEmail').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
- //echo '<span class="spaceRight floatRight"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_server&show_back=true">'.$lang['srv_inv_message_draft_settings'].'</a></span>';
- echo '<br class="clr"/>';
- echo '<div id="inv_error_note" class="hidden"></div>';
+
echo '<div id="inv_msg_preview">';
- echo '<table>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<input type="text" id="inv_message_subject" value="'.$preview_message['subject_text'].'" autocomplete="off">';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td ><div class="msgBody">';
- echo '<textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
- echo '</div>';
- ?>
- <script type="text/javascript">
- create_inv_editor('inv_message_body', false);
- </script><?php
- echo '</td></tr>';
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
+
+ ?>
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
+ $urls = $this->getUrlLists();
if (count($urls) > 0) {
- echo '<tr><th>'.$lang['srv_inv_message_draft_url'].'</th>';
- echo '<td>';
- echo '<select id="inv_message_url">';
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
foreach ($urls AS $url) {
- $selected = '';
+ $selected = '';
if ($preview_message['url'] == '') {
- if ($preview_message['dc'] == true) {
- $selected = ' selected="selected"';
+ if ($preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
}
} else if ($preview_message['url'] == $url['url']) {
- $selected = ' selected="selected"';
+ $selected = ' selected="selected"';
}
echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
}
echo '</select>';
- echo '</td>';
- echo '</tr>';
+
+ echo '</div>';
}
- echo '</table>';
- echo '</div>';
-
- echo '<br class="clr"/>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton" href="#" onclick="inv_message_save_forward_noEmail(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_forward'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="if(inv_message_save_simple_noEmail(\''.$mid.'\')) { window.location.reload() }; return false;"><span>'.$lang['srv_inv_message_save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_invitation_message_saveNew'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;"><span>'.$lang['srv_invitation_message_saveNew'].'</span></a></span>';
-
echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple_noEmail(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward_noEmail(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
+
+
+ echo '</fieldset>';
}
echo '</div>';
}
-
- echo '<br class="clr"/>';
}
function checkDefaultMessage() {
@@ -2403,6 +2532,10 @@ class SurveyInvitationsNew {
$return['inv_message_body'] = '1';
$newline= '<br/>';
}
+
+
+ $sql_string = '';
+
# če ni napak shranim:
if ( $return['error'] == '0') {
@@ -2423,8 +2556,11 @@ class SurveyInvitationsNew {
}
sisplet_query("COMMIT");
}
- $return['msg'].=' '.$sql_string.$sql_insert;
+
+ $return['msg'] .= ' '.$sql_string;
+
echo json_encode($return);
+
exit;
}
@@ -2476,7 +2612,7 @@ class SurveyInvitationsNew {
}
sisplet_query("COMMIT");
}
- $return['msg'].=' '.$sql_string.$sql_insert;
+ $return['msg'].=' '.$sql_string;
echo json_encode($return);
exit;
}
@@ -2485,14 +2621,15 @@ class SurveyInvitationsNew {
global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
- $mid = (int)$POST['mid'];
-
#če so kakšne napake jih prikažemo v float oknu
$subject = trim($_POST['subject']);
$replyto = trim($_POST['replyto']);
$body = trim($_POST['body']);
$url = trim($_POST['url']);
+ $sql_string = '';
+ $sql_insert = '';
+
$newline = '';
if ($replyto == null || $replyto == '' ) {
$return['error'] = '1';
@@ -2533,7 +2670,7 @@ class SurveyInvitationsNew {
# shranjujemo v novo sporočilo
$naslov = $this->generateMessageName();
$sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, reply_to, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
- "VALUES ('$this->sid', '$naslov', '$subject', '$body', '$replyto', '1', '$global_user_id', NOW(), '$comment', '$global_user_id', NOW(), '$url')";
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '$replyto', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
$sqlQuery = sisplet_query($sql_insert);
$newID = mysqli_insert_id($GLOBALS['connect_db']);
@@ -2562,8 +2699,6 @@ class SurveyInvitationsNew {
global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
- $mid = (int)$POST['mid'];
-
#če so kakšne napake jih prikažemo v float oknu
$subject = trim($_POST['subject']);
$body = trim($_POST['body']);
@@ -2597,7 +2732,7 @@ class SurveyInvitationsNew {
# shranjujemo v novo sporočilo
$naslov = $this->generateMessageName();
$sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
- "VALUES ('$this->sid', '$naslov', '$subject', '$body', '1', '$global_user_id', NOW(), '$comment', '$global_user_id', NOW(), '$url')";
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
$sqlQuery = sisplet_query($sql_insert);
$newID = mysqli_insert_id($GLOBALS['connect_db']);
@@ -2661,10 +2796,10 @@ class SurveyInvitationsNew {
$text = '';
$text .= mb_strtolower($fields['inv_field_email']);
- if (trim($fields['inv_field_firstname']) != '') {
+ if (isset($fields['inv_field_firstname']) && trim($fields['inv_field_firstname']) != '') {
$text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_firstname'], 'UTF-8'));
}
- if (trim($fields['inv_field_lastname']) != '') {
+ if (isset($fields['inv_field_lastname']) && trim($fields['inv_field_lastname']) != '') {
$text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_lastname'], 'UTF-8'));
}
@@ -2789,7 +2924,7 @@ class SurveyInvitationsNew {
}
function displayNavigation() {
- global $lang, $admin_type, $global_user_id, $app_settings;
+ global $lang, $admin_type, $global_user_id;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -2803,7 +2938,7 @@ class SurveyInvitationsNew {
}
if (!isset($_POST['noNavi']) || (isset($_POST['noNavi']) && $_POST['noNavi'] != 'true')) {
- $_sub_action = $_GET['m'];
+ $_sub_action = isset($_GET['m']) ? $_GET['m'] : null;
if ($_sub_action == null && $_GET['t'] == 'invitations') {
if ($_GET['a'] == 'use_recipients_list') {
@@ -2835,7 +2970,7 @@ class SurveyInvitationsNew {
$_sub_action = 'send_message';
}
- $active_step[] = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'');
+ $active_step = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'');
switch ($_sub_action) {
case 'inv_settings':
$active_step['1'] = ' active';
@@ -2877,111 +3012,115 @@ class SurveyInvitationsNew {
$active_step['1'] = ' active';
break;
}
+
if (SurveyInfo::getInstance()->checkSurveyModule('email') || SurveyInfo::getInstance()->checkSurveyModule('phone')) {
$disabled = false;
$css_disabled = '';
- } else {
+ }
+ else {
$disabled = true;
- $css_disabled = '_disabled';
+ $css_disabled = 'disabled';
}
if($isEmail) {
- #$spaceChar = '&#187;';
- $spaceChar = '&nbsp;';
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[1].'">';
- echo '<a href="'.$this->addUrl('inv_settings').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_settings'].'</span>';
- echo '</a>';
- echo '</div>';
+
+ echo '<div id="inv_top_navi">';
+
+
+ // Step 1 - nastavitve
+ echo '<div class="inv_step '.$active_step[1].'">';
+ echo ' <a href="'.$this->addUrl('inv_settings').'" class="noline">';
+ echo ' <span class="number">1</span>'.$lang['srv_inv_nav_email_settings'];
+ echo ' </a>';
echo '</div>';
- #space
- echo '<div class="inv_space">&nbsp;</div>';
- echo '<div id="inv_step_nav" class="yellow">';
-
- $class_yellow = ' yellow';
+
+ // Space
+ echo '<div class="inv_space"></div>';
- #navigacija
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[2].'">';
+
+ // Step 2 - dodaj
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[2].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('add_recipients_view').'">';
+ echo ' <a href="'.$this->addUrl('add_recipients_view').'" class="noline">';
}
- echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_add_recipients'].'</span>';
+ echo ' <span class="number">2</span>'.$lang['srv_inv_nav_add_recipients'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[3].'">';
+
+ // Step 3 - preglej
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[3].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('view_recipients').'">';
+ echo ' <a href="'.$this->addUrl('view_recipients').'" class="noline">';
}
- echo '<span class="circle">2</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_edit_recipiens'].'</span>';
+ echo ' <span class="number">3</span>'.$lang['srv_inv_nav_edit_recipiens'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- if ($disabled == false) {
- echo '<a href="'.$this->addUrl('view_message').'">';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 4 - sporocilo
+
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[4].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('view_message').'" class="noline">';
}
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[4].'">';
- echo '<span class="circle">3</span>';
- echo '<span class="label" >'.$lang['srv_inv_nav_edit_message'].'</span>';
+ echo ' <span class="number">4</span>'.$lang['srv_inv_nav_edit_message'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '<div class="inv_step_space'.$class_yellow.$css_disabled.'">'.$spaceChar.'</div>';
- echo '<div class="inv_step'.$class_yellow.$css_disabled.$active_step[5].'">';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 5 - poslji
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[5].'">';
if ($disabled == false) {
- echo '<a href="'.$this->addUrl('send_message').'">';
+ echo ' <a href="'.$this->addUrl('send_message').'" class="noline">';
}
- echo '<span class="circle">4</span>';
- echo '<span class="label" >'.$lang['srv_inv_nav_send_message'].'</span>';
+ echo ' <span class="number">5</span>'.$lang['srv_inv_nav_send_message'];
if ($disabled == false) {
- echo '</a>';
+ echo ' </a>';
}
echo '</div>';
- echo '</div>';
-
-
- // Pregled
- #space
- echo '<div class="inv_space">&nbsp;</div>';
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[9].'">';
- echo '<a href="'.$this->addUrl('inv_status').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_review'].'</span>';
- echo '</a>';
- echo '</div>';
+ // Nastavitve zgoraj desno
+ echo '<div class="inv_nav_settings">';
+
+ // Pregled
+ echo '<div class="inv_step '.$active_step[9].'">';
+ echo ' <a href="'.$this->addUrl('inv_status').'" class="noline">';
+ echo ' <span class="faicon chart"></span>'.$lang['srv_inv_nav_email_review'];
+ echo ' </a>';
echo '</div>';
-
- // Seznami
- #space
- echo '<div class="inv_space">&nbsp;</div>';
-
- echo '<div id="inv_step_nav">';
- echo '<div class="inv_step'.$active_step[7].'">';
- echo '<a href="'.$this->addUrl('inv_lists').'">';
- //echo '<span class="circle">1</span>';
- echo '<span class="label">'.$lang['srv_inv_nav_email_lists'].'</span>';
- echo '</a>';
- echo '</div>';
+ // Seznami
+ echo '<div class="inv_step '.$active_step[7].'">';
+ echo ' <a href="'.$this->addUrl('inv_lists').'" class="noline">';
+ echo ' <span class="faicon phonebook"></span>'.$lang['srv_inv_nav_email_lists'];
+ echo ' </a>';
echo '</div>';
-
- echo '<br class="clr" />';
- echo '<br class="clr" />';
+ echo '</div>';
+
+
+ echo '</div>';
}
}
@@ -2996,37 +3135,38 @@ class SurveyInvitationsNew {
$row = $this->surveySettings;
+
# Pripravimo izbor komu lahko pošiljamo
- echo '<h2 style="margin-left: 15px; color:#333 !important;">';
+ echo '<div class="invitations_top_settings">';
// Text s podatki o nastavitvah posiljanja
- $settings_text = '<span class="bold spaceRight">'.$lang['srv_inv_message_type'].':</span>';
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
$individual = (int)$this->surveySettings['individual_invitation'];
if($individual == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
}
$settings_text .= ' - ';
if($noEmailing == 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
}
$settings_text .= ' - ';
if($row['usercode_required'] == 0 && $individual != 0){
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_0'];
$settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
}
else{
- $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_1'];
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_1'];
if($row['usercode_skip'] == 1 || $individual == 0){
$settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
@@ -3036,49 +3176,51 @@ class SurveyInvitationsNew {
}
}
- $settings_text .= '<span class="spaceLeft"> <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['edit4'].'</a></span>';
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings" title="'.$lang['edit4'].'"><span class="faicon edit"></span></a>';
echo $settings_text;
- echo '</h2>';
+
+ echo '</div>';
if ($this->checkDefaultMessage() == false) {
- echo '<span class="inv_error_note">';
+ echo '<div class="inv_error_note">';
echo $lang['srv_invitation_note6'];
- echo '</span>';
+ echo '</div>';
+
exit();
}
- echo '<div id="inv_send_mail">';
+ echo '<div id="inv_send_mail" class="invitations_holder half-half invitations_send">';
# damo v tabelo zaradi prilagajanja oblike levo/desno
- echo '<table><tr>';
+ echo '<div class="left_holder">';
// Pri volitvah vedno posiljamo samo tistim, katerim se nismo poslali
if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<td>';
+ echo '<fieldset><legend>'.$lang['srv_notifications_send_reciever2'].'</legend>';
- echo '<div>';
+ echo '<div class="setting_item ver">';
- echo $lang['srv_inv_send_who_database'].'<br/>';
- echo '<span class="floatLeft">';
- echo '<label><input type="radio" name="mailsource" value="0" onclick="mailToSourceChange();" checked="checked">'.$lang['srv_inv_send_who_all_units'].'</label>';
- echo '</span>';
-
+ echo ' <span>'.$lang['srv_inv_send_who_database'].'</span>';
+
+ echo '<div class="flex_row">';
+ echo ' <input type="radio" name="mailsource" id="mailsource_0" value="0" onclick="mailToSourceChange();" checked="checked"><label for="mailsource_0">'.$lang['srv_inv_send_who_all_units'].'</label>';
$this->advancedCondition();
- echo '<br class="clr"/>';
+ echo '</div>';
- echo '<label><input type="radio" name="mailsource" value="1" onclick="mailToSourceChange();">'.$lang['srv_inv_send_who_archive'].'</label>';
- echo '<br/><label><input type="radio" name="mailsource" value="2" onclick="mailToSourceChange();">'.$lang['srv_inv_send_who_lists'].'</label>';
- echo '<br/>';
+ echo ' <input type="radio" name="mailsource" id="mailsource_1" value="1" onclick="mailToSourceChange();"><label for="mailsource_1">'.$lang['srv_inv_send_who_archive'].'</label>';
+ echo ' <input type="radio" name="mailsource" id="mailsource_2" value="2" onclick="mailToSourceChange();"><label for="mailsource_2">'.$lang['srv_inv_send_who_lists'].'</label>';
+
+ echo '</div>';
+
echo '<div id="inv_select_mail_to_source_lists">';
- $this->displayMailToSourceLists((int)$_POST['source_type']);
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $this->displayMailToSourceLists($source_type);
echo '</div>'; #id="inv_select_mail_to_source_lists"
- echo '</div>';
-
# polovimo sporočilo in prejemnike
$sql_query_m = sisplet_query("SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
if (mysqli_num_rows($sql_query_m) > 0 ) {
@@ -3093,37 +3235,42 @@ class SurveyInvitationsNew {
exit();
}
- echo '</td>';
+ echo '</fieldset>';
}
- echo '<td>';
-
+ echo '</div>';
+
+
+ // Desna stran
+ echo '<div class="right_holder">';
+
// Ce posiljamo preko navadne poste ali smsov, nimamo sporocila
if($noEmailing == 0){
- echo '<input type="hidden" name="noMailing" value="0" />';
- echo '<div id="inv_select_mail_preview">';
+ echo '<fieldset id="inv_select_mail_preview"><legend>'.$lang['message'].'</legend>';
+ echo '<input type="hidden" name="noMailing" value="0" />';
$this->displayMessagePreview();
- echo '</div>'; // inv_select_mail_preview
- echo '<br class="clr"/>';
-
- echo '<div id="inv_select_mail_to_respondents">';
+ echo '</fieldset>';
+
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
$this->selectSendTo();
- echo '</div>'; // inv_select_mail_to_respondents
+ echo '</fieldset>';
}
else{
- echo '<input type="hidden" name="noMailing" value="1" />';
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
+
+ echo '<input type="hidden" name="noMailing" value="1" />';
+
$noEmailingType = SurveySession::get('inv_noEmailing_type');
echo '<input type="hidden" name="noMailingType" value="'.$noEmailingType.'" />';
-
- echo '<div id="inv_select_mail_to_respondents">';
+
$this->selectSendToNoEmailing();
- echo '</div>'; // inv_select_mail_to_respondents
+
+ echo '</fieldset>';
}
-
- echo '</td>';
- echo '</tr></table>';
+ echo '</div>';
+
echo '</div>'; //inv_send_mail
}
@@ -3133,9 +3280,13 @@ class SurveyInvitationsNew {
$canShowSubOption = false;
- echo '<p style="margin-left:25px;">';
- echo $lang['srv_inv_send_who_create1'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_lists">'.$lang['srv_inv_send_who_create2'].'</a><br/>';
-
+ echo '<div class="setting_item ver">';
+ echo ' <span>'.$lang['srv_inv_send_who_create1'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_lists" class="noline">'.$lang['srv_inv_send_who_create2'].'</a></span>';
+ echo '</div>';
+
+
+ echo '<div class="setting_item ver">';
+
if ((int)$source_type == 0) {
# vsi respondenti v bazi
echo $lang['srv_inv_send_who_database_note'];
@@ -3154,20 +3305,27 @@ class SurveyInvitationsNew {
$canShowSubOption = true;
echo $lang['srv_inv_send_who_archive_note'];
+
echo '<table id="tbl_recipients_source_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon">&nbsp;</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_address'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_address'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
echo '</tr>';
while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
echo '<tr>';
- echo '<td class="tbl_icon"><input type="checkbox" name="mailsource_lists[]" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"></td>';
- echo '<td>'.$row_arc['naslov'].'</td>';
- echo '<td class="anl_ac">'.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).'</td>';
- echo '<td>'.$row_arc['ds'].'</td>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$row_arc['naslov'].'</td>';
+
+ echo ' <td class="anl_ac">'.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
echo '</tr>';
}
@@ -3196,12 +3354,14 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_send_who_all_units_note'];
echo '<table id="tbl_recipients_source_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon">&nbsp;</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_list_name'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
- echo '<th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_list_name'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
echo '</tr>';
+
while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
if ($row_arc['id'] > 0 && $row_arc['naslov'] == '') {
@@ -3224,10 +3384,15 @@ class SurveyInvitationsNew {
}
echo '<tr>';
- echo '<td class="tbl_icon"><input type="checkbox" name="mailsource_lists[]" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"></td>';
- echo '<td>'.$_naslov.'</td>';
- echo '<td class="anl_ac">'.$row_arc['cnt_succsess'].'</td>';
- echo '<td>'.$row_arc['ds'].'</td>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$_naslov.'</td>';
+
+ echo ' <td class="anl_ac">'.$row_arc['cnt_succsess'].'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
echo '</tr>';
}
}
@@ -3237,35 +3402,41 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_send_who_no_lists'];
}
}
- echo '</p>';
+
+ echo '</div>';
+
if ($canShowSubOption == true) {
- echo '<span id="inv_select_mail_to">';
- echo '<span class="bold">'.$lang['srv_inv_send_note'].'</span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto0" value="0" type="radio" checked="checked" onclick="mailToRadioChange();"><label for="mailto0">' . $lang['srv_inv_send_recipients0'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto1" value="1" type="radio" onclick="mailToRadioChange();"><label for="mailto1">' . $lang['srv_inv_send_recipients1'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto2" value="2" type="radio" onclick="mailToRadioChange();"><label for="mailto2">' . $lang['srv_inv_send_recipients2'] . '</label></span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto3" value="3 " type="radio" onclick="mailToRadioChange();"><label for="mailto3">' . $lang['srv_inv_send_recipients3'] . '</label></span><br/>';
-
- echo '<span class="inv_send_span">'.$lang['srv_invitation_send_advanced'].'</span><br/>';
- echo '<span class="inv_send_span"><input name="mailto" id="mailto4" value="4 " type="radio" onclick="mailToRadioChange();"><label for="mailto4">' . $lang['srv_inv_send_recipients4'] . '</label></span><br/>';
- echo '<div id="inv_send_advanced_div" >';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="0" type="checkbox" id="mailto_status_0" onclick="mailTocheCheckboxChange();" disabled="disabled">0 - ' . $lang['srv_userstatus_0'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="1" type="checkbox" id="mailto_status_1" onclick="mailTocheCheckboxChange();" disabled="disabled">1 - ' . $lang['srv_userstatus_1'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="2" type="checkbox" id="mailto_status_2" onclick="mailTocheCheckboxChange();" disabled="disabled">2 - ' . $lang['srv_userstatus_2'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="3" type="checkbox" id="mailto_status_3" onclick="mailTocheCheckboxChange();" disabled="disabled">3 - ' . $lang['srv_userstatus_3'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="4" type="checkbox" id="mailto_status_4" onclick="mailTocheCheckboxChange();" disabled="disabled">4 - ' . $lang['srv_userstatus_4'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="5" type="checkbox" id="mailto_status_5" onclick="mailTocheCheckboxChange();" disabled="disabled">5 - ' . $lang['srv_userstatus_5'] . '</label></span><br/>';
- echo '<span class="inv_send_span shift gray"><label><input name="mailto_status[]" value="6" type="checkbox" id="mailto_status_6" onclick="mailTocheCheckboxChange();" disabled="disabled">6 - ' . $lang['srv_userstatus_6'] . '</label></span><br/>';
+ echo '<div id="inv_select_mail_to" class="setting_item ver">';
+
+ echo '<span class="semi-bold">'.$lang['srv_inv_send_note'].'</span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto0" value="0" type="radio" checked="checked" onclick="mailToRadioChange();"><label for="mailto0">' . $lang['srv_inv_send_recipients0'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto1" value="1" type="radio" onclick="mailToRadioChange();"><label for="mailto1">' . $lang['srv_inv_send_recipients1'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto2" value="2" type="radio" onclick="mailToRadioChange();"><label for="mailto2">' . $lang['srv_inv_send_recipients2'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto3" value="3 " type="radio" onclick="mailToRadioChange();"><label for="mailto3">' . $lang['srv_inv_send_recipients3'] . '</label></span>';
+
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto4" value="4 " type="radio" onclick="mailToRadioChange();"><label for="mailto4">' . $lang['srv_inv_send_recipients4'] . '</label></span>';
+
+ echo '<div id="inv_send_advanced_div" class="setting_item ver">';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="0" type="checkbox" id="mailto_status_0" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_0">0 - ' . $lang['srv_userstatus_0'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="1" type="checkbox" id="mailto_status_1" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_1">1 - ' . $lang['srv_userstatus_1'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="2" type="checkbox" id="mailto_status_2" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_2">2 - ' . $lang['srv_userstatus_2'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="3" type="checkbox" id="mailto_status_3" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_3">3 - ' . $lang['srv_userstatus_3'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="4" type="checkbox" id="mailto_status_4" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_4">4 - ' . $lang['srv_userstatus_4'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="5" type="checkbox" id="mailto_status_5" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_5">5 - ' . $lang['srv_userstatus_5'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="6" type="checkbox" id="mailto_status_6" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_6">6 - ' . $lang['srv_userstatus_6'] . '</label></span>';
echo '</div>';
- echo '</span>'; // inv_select_mail_to
+
+ echo '</div>';
}
}
function selectSendTo($send_type = 0, $checkboxes = array()) {
global $lang, $site_url, $global_user_id;
+ $_msg = '';
+ $cnt = 0;
if ((int)$this->surveySettings['active'] !== 1) {
$activity = SurveyInfo:: getSurveyActivity();
@@ -3303,8 +3474,8 @@ class SurveyInvitationsNew {
$checkboxes = explode(',',$_POST['checkboxes']);
}
- $source_type = (int)$_POST['source_type'];
- $source_lists = trim($_POST['source_lists']);
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $source_lists = isset($_POST['source_lists']) ? trim($_POST['source_lists']) : '';
$respondents = $this->getRespondents2Send($send_type, $checkboxes, $source_type, $source_lists);
#koliko strani imamp
@@ -3312,53 +3483,56 @@ class SurveyInvitationsNew {
$pages = ceil($numRespondents / $this->rec_send_page_limit);
if (count($respondents) > 0) {
- echo '<div class="inv_send_mail_send_type">';
+ echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail" method="post">';
+
+ echo '<div class="inv_send_mail_send_type">';
// Način pošiljanja
- echo '<span class="bold">';
- echo $lang['srv_inv_message_type'].': ';
- echo $lang['email'];
- echo '</span><br /><br />';
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type'].': '.$lang['email'].'</span>';
+ echo '</div>';
- echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail" method="post">';
// Komentar pri posiljanju
- echo '<label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').': ';
- echo '<input type="text" name="comment" id="msg_comment" value="'.$comment.'">';
- echo '</label><br class="clr"><br />';
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
// Pobrisi podvojene maile
- echo '<label><input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">'.$lang['srv_inv_send_remove_duplicates'].'</label></span> '.Help::display('srv_inv_sending_double').'<br />';
-
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
+ echo '</div>';
+
// Gumb Poslji
- echo '<br /><div id="inv_send_mail_btn"><span class="buttonwrapper floatLeft"><a href="#" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();" class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_send'].'</span></a></span>';
- echo '<br class="clr"/><br /></div>';
+ echo '<div id="inv_send_mail_btn" class="setting_item ver">';
+ echo ' <button class="blue medium" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_send'].'</button>';
+ echo '</div>';
- // Komentiram kot workaround (če ni zakomentiran, ob ajaxu tu vrine konec forme) - MISLIM DA JE TA POPRAVEK ŠE VEDNO POTREBEN (v kombinaciji z Robertovim)
- //echo '</div>';
-
+
// Seznam mailov na katere bomo poslali
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- //if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
- {
- echo '<span class="floatLeft">';
- $scp = new SurveyCondition($this->sid);
- $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
- echo $note;
- #$scp -> displayConditionNote($this->invitationAdvancedConditionId );
- echo '</span>';
- echo '<br/>';
- }
+ if ((int)$this->invitationAdvancedConditionId > 0){
+ echo '<div class="setting_item ver">';
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+ echo '</div>';
}
+
# izpišemo seznam e-mailov in dodamo checkboxe
- echo '<div class="strong">'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></div>';
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
# izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
$text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
- echo '<div id="inv_send_mail_limit" class="red strong'.(count($respondents) > 4999?'':' hidden').'">'.$text.'</div>';
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
# da preprečimo večkratno pošiljanje
session_start();
list($short,$long) = $this->generateCode();
@@ -3380,33 +3554,47 @@ class SurveyInvitationsNew {
$lists['-1'] = $lang['srv_invitation_new_templist'];
$lists['0'] = $lang['srv_invitation_new_templist_author'];
-
- echo '<div id="inv_send_note">Pošiljam . . . Prosimo počakajte.</div>';
- echo '<br/><table id="tbl_recipients_send_list">';
+
+ echo '<table id="tbl_recipients_send_list">';
+
echo '<tr>';
- echo '<th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
- echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
+ echo ' <th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
echo '</tr>';
+
$cnt=1;
foreach ($respondents as $pass => $respondent) {
echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
- echo '<td><input type="checkbox" name="rids[]" value="'.$respondent['id'].'" checked="checekd"></td>';
- echo '<td>'.$respondent['email'].'</td>';
- echo '<td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
- if ($lists[$respondent['list_id']] != '') {
- echo '<td>'.$lists[$respondent['list_id']].'</td>';
- } else {
- echo '<td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
}
+
echo '</tr>';
+
$cnt++;
}
echo '</table>';
- echo '</form>';
+
+
echo '</div>';
+
+ echo '</form>';
}
}
if ($cnt == 0) {
@@ -3464,54 +3652,64 @@ class SurveyInvitationsNew {
// Način pošiljanja
$noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<span class="bold">';
- echo $lang['srv_inv_message_type_external'].': </span>';
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type_external'].': ';
if($noEmailingType == 1)
- echo $lang['srv_inv_message_noemailing_type2'];
+ echo $lang['srv_inv_message_noemailing_type2'];
elseif($noEmailingType == 2)
- echo $lang['srv_inv_message_noemailing_type3'];
+ echo $lang['srv_inv_message_noemailing_type3'];
else
- echo $lang['srv_inv_message_noemailing_type1'];
- echo '<br /><br />';
+ echo $lang['srv_inv_message_noemailing_type1'];
+ echo ' </span>';
+
+ echo '</div>';
+
echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail&noemailing=1" method="post">';
- // Komentar pri posiljanju
- echo '<label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').': ';
- echo '<input type="text" name="comment" id="msg_comment" value="'.$comment.'">';
- echo '</label><br class="clr"><br />';
+ // Komentar pri posiljanju
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
// Pobrisi podvojene maile
- echo '<label><input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">'.$lang['srv_inv_send_remove_duplicates'].'</label></span> '.Help::display('srv_inv_sending_double').'<br />';
-
- // Gumb poslji
- echo '<br /><div id="inv_send_mail_btn"><span class="buttonwrapper floatLeft"><a href="#" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();" class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_inv_nav_send_noEmailing'].'</span></a></span>';
- echo '<br class="clr"/><br /></div>';
-
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
echo '</div>';
+
+ // Gumb Poslji
+ echo '<div id="inv_send_mail_btn" class="setting_item hor">';
+ echo ' <button class="blue medium" style="width:auto;" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_nav_send_noEmailing'].'</button>';
+ echo '</div>';
+
// Seznam mailov na katere bomo poslali
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- #if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
- {
- echo '<span class="floatLeft">';
- $scp = new SurveyCondition($this->sid);
- $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
- echo $note;
- #$scp -> displayConditionNote($this->invitationAdvancedConditionId );
- echo '</span>';
- echo '<br/>';
- }
+ if ((int)$this->invitationAdvancedConditionId > 0){
+
+ echo '<div class="setting_item ver">';
+
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+
+ echo '</div>';
}
+
# izpišemo seznam e-mailov in dodamo checkboxe
- echo '<div class="strong">'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></div>';
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
# izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
- $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
- echo '<div id="inv_send_mail_limit" class="red strong'.(count($respondents) > 4999?'':' hidden').'">'.$text.'</div>';
+ $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
# da preprečimo večkratno pošiljanje
session_start();
list($short,$long) = $this->generateCode();
@@ -3534,9 +3732,8 @@ class SurveyInvitationsNew {
$lists['-1'] = $lang['srv_invitation_new_templist'];
$lists['0'] = $lang['srv_invitation_new_templist_author'];
- echo '<div id="inv_send_note">Pošiljam . . . Prosimo počakajte.</div>';
- echo '<br/><table id="tbl_recipients_send_list">';
+ echo '<table id="tbl_recipients_send_list">';
echo '<tr>';
echo '<th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
echo '<th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
@@ -3546,20 +3743,34 @@ class SurveyInvitationsNew {
echo '</tr>';
$cnt=1;
foreach ($respondents as $pass => $respondent) {
- echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
- echo '<td><input type="checkbox" name="rids[]" value="'.$respondent['id'].'" checked="checekd"></td>';
- echo '<td>'.$respondent['email'].'</td>';
- echo '<td>'.$respondent['firstname'].'</td>';
- echo '<td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
- if ($lists[$respondent['list_id']] != '') {
- echo '<td>'.$lists[$respondent['list_id']].'</td>';
- } else {
- echo '<td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+
+ echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$respondent['firstname'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
}
+
echo '</tr>';
+
$cnt++;
}
+
echo '</table>';
+
echo '</form>';
}
}
@@ -3590,69 +3801,58 @@ class SurveyInvitationsNew {
$SSMI = new SurveySimpleMailInvitation($this->sid);
$simple_recipents = $SSMI -> getRecipients();
+
+ echo '<fieldset><legend>'.$lang['srv_archive_invitation'].'</legend>';
+
if (mysqli_num_rows($sql_query) > 0 || count($simple_recipents) > 0) {
- echo '<h2>'.$lang['srv_archive_invitation'].'</h2>';
+ echo '<p class="bottom16">'.$lang['srv_archive_invitation_text'].'</p>';
+
+ echo '<p class="bold">'.$lang['srv_archive_invitation_text2'].'</p>';
+
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tbl_archive_list">';
echo '<tr>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_hour_send'].'">'.$lang['srv_inv_archive_hour_send'].'</th>';
+ echo '<th class="lead_column" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_naslov'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_subject_text'].'</th>';
- #echo '<th title="'.$lang['srv_inv_archive_body_text'].'">'.$lang['srv_inv_archive_body_text'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_message_type'].'">'.$lang['srv_inv_message_type'].'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_cnt_succsess'].'">'.$lang['srv_inv_archive_cnt_succsess'].' '.Help::display('srv_inv_archive_sent').'</th>';
- echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_cnt_error'].'">'.$lang['srv_inv_archive_cnt_error'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_succsess'].'">'.$lang['srv_inv_archive_cnt_succsess'].' '.Help::display('srv_inv_archive_sent').'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_error'].'">'.$lang['srv_inv_archive_cnt_error'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_sender'].'">'.$lang['srv_inv_archive_sender'].'</th>';
echo '<th title="'.$lang['srv_inv_archive_comment'].'">'.$lang['srv_inv_archive_comment'].'</th>';
- #echo '<th >&nbsp;</th>';
echo '</tr>';
+
while ($row = mysqli_fetch_assoc($sql_query)) {
echo '<tr>';
- // Datum
- echo '<td class="tbl_inv_center">'.$row['ds'].'</td>';
-
- // Ura
- echo '<td class="tbl_inv_center">'.$row['hs'].'</td>';
+ // Datum in ura
+ echo '<td class="lead_column">'.$row['ds'].' '.$row['hs'].'</td>';
// Email sporocilo
- echo '<td class="tbl_inv_lef inv_arch_subject" title="'.$row['naslov'].'">';
+ echo '<td title="'.$row['naslov'].'">';
echo '<a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['naslov'].'</a>';
echo '</td>';
// Subject
- echo '<td class="tbl_inv_lef inv_arch_subject" title="'.$row['naslov'].'">';
+ echo '<td title="'.$row['naslov'].'">';
echo $row['subject_text'];
echo '</td>';
- #echo '<td class="tbl_inv_left inv_arch_text" title="'.$row['body_text'].'">'.$row['body_text'].'</td>';
-
- // Nacin posiljanja (email, posta, sms...)
- echo '<td class="tbl_inv_center">';
- if ($row['tip'] == '0')
- echo '<span>'.$lang['srv_inv_message_noemailing_type1'].'</span>';
- elseif($row['tip'] == '1')
- echo '<span>'.$lang['srv_inv_message_noemailing_type2'].'</span>';
- elseif($row['tip'] == '2')
- echo '<span>'.$lang['srv_inv_message_noemailing_type3'].'</span>';
- else
- echo '<span>'.$lang['email'].'</span>';
- echo '</td>';
# uspešno poslani
- echo '<td class="tbl_inv_center">';
+ echo '<td class="right">';
if ((int)$row['cnt_succsess'] > 0 ) {
- echo '<span class="as_link as_view strong" id="inv_arch_1_'.$row['id'].'" data-archtype="succ">'.$row['cnt_succsess'].'</span>';
+ echo '<span class="as_link as_view" id="inv_arch_1_'.$row['id'].'" data-archtype="succ">'.$row['cnt_succsess'].'</span>';
} else {
echo '<span>'.$row['cnt_succsess'].'</span>';
}
echo '</td>';
# neuspešno poslani
- echo '<td class="tbl_inv_center">';
+ echo '<td class="right">';
if ((int)$row['cnt_error'] > 0 ) {
- echo '<span class="as_link as_view strong" id="inv_arch_0_'.$row['id'].'" data-archtype="err">'.$row['cnt_error'].'</span>';
+ echo '<span class="as_link as_view" id="inv_arch_0_'.$row['id'].'" data-archtype="err">'.$row['cnt_error'].'</span>';
} else {
echo '<span>'.$row['cnt_error'].'</span>';
}
@@ -3673,13 +3873,16 @@ class SurveyInvitationsNew {
# komentar
echo '<td>';
- echo '<a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['comment'];
+ echo (($row['comment'] == "") ? '/' : $row['comment']);
echo '</td>';
echo '</tr>';
}
echo '</tr>';
echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
# dodamo simpl pošiljanje
if ( count($simple_recipents) > 0 ) {
@@ -3719,26 +3922,21 @@ class SurveyInvitationsNew {
echo '</table>';
}
- } else {
- echo '<fieldset>';
- echo '<legend>'.$lang['srv_archive_invitation'].'</legend>';
-
- echo $lang['srv_invitation_note4'].'';
-
- echo '</fieldset>';
+ }
+ //Če ni še nobenih poslanih vabil
+ else {
+ echo '<p>'.ucfirst($lang['srv_survey_archives_tracking_survey_text1b']).' <a href="index.php?anketa=' . $this->sid . '&a=invitations">\'<span class="caps">'.$lang['navigation_NAVI_OBJAVA'].'</span>\' - \''.$lang['navigation_invitations'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1e'].'.</p>';
}
-
+ echo '</fieldset>';
echo '</div>'; # id="div_archive_content">';
- echo '<br class="clr">';
-
}
// Glavno posiljanje mail vabil
function sendMail() {
- global $lang, $site_path, $site_url, $global_user_id, $lastna_instalacija;
+ global $lang, $site_path, $site_url, $global_user_id;
Common::getInstance()->Init($this->sid);
@@ -3756,17 +3954,14 @@ class SurveyInvitationsNew {
unset($_SESSION['snd_inv_token'][$this->sid]);
session_commit();
-
- $dont_send_duplicated = false;
- if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
- $dont_send_duplicated = true;
- }
$rids = $_POST['rids'];
+ $comment = '';
+
$return = array();
$return['error'] = '0';
- $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note5'].'</div>';
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note5'].'</div><br>';
// Shranimo komentar h posiljanju
if(isset($_POST['comment']) && $_POST['comment'] != ''){
@@ -3824,7 +4019,7 @@ class SurveyInvitationsNew {
$numRows = mysqli_num_rows($sql_query);
# če pošiljamo na večje število reposndentov obvestimo info@1ka.si
- if ($numRows > NOTIFY_INFO1KA && (!isset($lastna_instalacija) || $lastna_instalacija == false)) {
+ if ($numRows > NOTIFY_INFO1KA && !isLastnaInstalacija()) {
// Gorenje tega nima
if (!Common::checkModule('gorenje')){
@@ -3834,9 +4029,11 @@ class SurveyInvitationsNew {
list($infoEmail,$infoName,$infoSurname) = mysqli_fetch_row($sqlinfo_query);
$infourl = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'">anketi</a>';
+ $preview_url = '<a href="'.SurveyInfo::getSurveyLink().'?preview=on">'.$lang['srv_poglejanketo'].'</a>';
+
$format = $lang['srv_inv_send_finish_note'];
- $info1ka_mass_email_note = sprintf($format, $infoName, $infoSurname, $infoEmail, $infourl, $numRows);
+ $info1ka_mass_email_note = sprintf($format, $infoName, $infoSurname, $infoEmail, $infourl, $numRows, $preview_url);
try{
$MA = new MailAdapter($this->sid, $type='admin');
@@ -3969,7 +4166,7 @@ class SurveyInvitationsNew {
$return['error'] = '0';
// Uspesno poslano sporocilo
- $return['msg'] = '<br /><span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8a'].'</span><br />';
+ //$return['msg'] = '<br /><span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8a'].'</span><br />';
$return['msg'] .= '<div class="inv_send_message">';
$return['msg'] .= '<table id="inv_send_mail_preview">';
$return['msg'] .= '<tr><th><span>'.$lang['srv_inv_message_draft_content_subject'].':</span></th>';
@@ -3984,14 +4181,15 @@ class SurveyInvitationsNew {
$return['msg'] .= '</div>';
// Je uporabnik poslal na ...
- $return['msg'] .= sprintf($lang['srv_invitation_note8b'], $who, date("d.m.y", time()));
- $return['msg'] .= '<span class="bold" style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok)).'</span><br />';
+ /* $return['msg'] .= sprintf($lang['srv_invitation_note8b'], $who, date("d.m.y", time()));
+ $return['msg'] .= '<span class="bold" style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok)).'</span><br />'; */
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok), $who, date("d.m.y", time())).'</span><br />';
// Arhivi
- $return['msg'] .= '<span class="bold" style="line-height:20px;">'.sprintf($lang['srv_invitation_note8c'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'</span><br />';
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8c'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'</span><br />';
// Seznam emailov...
- $return['msg'] .= '<span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8d'].'</span><br />';
+ $return['msg'] .= '<span style="line-height:30px;">'.$lang['srv_invitation_note8d'].'</span><br />';
// Seznam mailov na katere je bilo uspesno poslano
if (count($send_ok) > 0) {
@@ -4019,8 +4217,14 @@ class SurveyInvitationsNew {
$return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note14'].'</div>';
}
+
+ // Preverimo ce smo presegli limit za posiljanje vabil
+ $check = new SurveyCheck($this->sid);
+ $check->checkLimitVabila();
+
+
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init($this->sid);
Common::getInstance()->updateEditStamp();
#$this->viewAarchive($return['msg']);
@@ -4031,6 +4235,7 @@ class SurveyInvitationsNew {
private function sendMailToUsers($sql_recipients_query, $sending_data){
global $global_user_id;
global $site_url;
+ global $lang;
// Preverimo ce je vklopljen modul za volitve
@@ -4052,6 +4257,11 @@ class SurveyInvitationsNew {
}
}
+ $dont_send_duplicated = false;
+ if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
+ $dont_send_duplicated = true;
+ }
+
$duplicated = array();
# array za rezultate
@@ -4088,7 +4298,7 @@ class SurveyInvitationsNew {
$url = $nice_url . ($individual == 1 ? '&code='.$password : '');
}
- $url .= '&ai='.(int)$sending_data['$arch_id'];
+ $url .= '&ai='.(int)$sending_data['arch_id'];
// odjava
$unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this->sid . '&code='.$password;
@@ -4234,7 +4444,7 @@ class SurveyInvitationsNew {
$_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($_user_data[$_user_variable]) != '' && $_user_data[$_user_variable] != null) {
+ if ($_user_variable !== null && trim($_user_data[$_user_variable]) != '' && $_user_data[$_user_variable] != null) {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($_user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -4569,7 +4779,7 @@ class SurveyInvitationsNew {
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
$this->viewSendMailFinish($return['msg']);
@@ -4630,21 +4840,18 @@ class SurveyInvitationsNew {
# če so napake jih prikažemo če ne obdelamo datoteko
if (count($errors) > 0) {
-
- echo '<br class="clr" />';
- echo '<span class="inv_message_errors">'.$lang['srv_inv_recipiens_upload_error'].'</span>';
-
- echo '<br class="clr" />';
- echo '<br class="clr" />';
-
- echo '<span class="inv_error_note">';
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
foreach($errors as $error) {
- echo '* '.$error.'<br />';
+ echo '<span class="inv_error_note">* '.$error.'</span>';
}
- echo '</span>';
+
+ echo '</div>';
- $this->addRecipientsView($fields, $invalid_recipiens_array);
+ $this->addRecipientsView($fields);
}
else {
@@ -4679,101 +4886,9 @@ class SurveyInvitationsNew {
$_arch_id = $data[3];
$archType = $_POST['archType'];
- # za novejše ankete prikažemo nov način
- if ($this->newTracking) {
- $this->showArchiveRecipients($_arch_id, $archType);
- return;
- }
- global $lang,$site_url,$global_user_id;
- echo '<div id="inv_view_arch_recipients">';
- # polovimo sezname
- $lists = array();
- $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
- $sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- $lists[$sql_row['pid']] = $sql_row['name'];
- }
-
- $lists['-1'] = $lang['srv_invitation_new_templist'];
- $lists['0'] = $lang['srv_invitation_new_templist_author'];
-
-
- $data = explode('_',$_POST['arch_to_view']);
- $_success = (int)$data[2];
- $_arch_id = $data[3];
- $sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '$_arch_id'";
- $sql_query = sisplet_query($sql_string);
- $sql_a_row = mysqli_fetch_assoc($sql_query);
-
- $sql_string = "SELECT email,firstname,lastname, password,salutation,phone,custom,relation,sent,responded,unsubscribed,deleted,last_status,list_id FROM srv_invitations_archive_recipients AS siar LEFT JOIN srv_invitations_recipients AS sir on siar.rec_id = sir.id WHERE arch_id = '$_arch_id' AND success = '$_success'";
- $sql_query = sisplet_query($sql_string);
-
-
- echo '<div class="inv_FS_content">';
+ $this->showArchiveRecipients($_arch_id, $archType);
- echo '<table id="tbl_recipients_list">';
-
- echo '<tr>';
-
- // Pri volitvah ne prikazemo nekaterih stolpcev
- if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
- echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
- }
- else{
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_responded'].'">'.$lang['srv_inv_recipients_responded'].'</th>';
- echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_unsubscribed'].'">'.$lang['srv_inv_recipients_unsubscribed'].'</th>';
- echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_password'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
- echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
- }
-
- echo '</tr>';
-
- while ($sql_row = mysqli_fetch_assoc($sql_query)) {
- echo '<tr>';
-
- // Pri volitvah ne prikazemo nekaterih stolpcev
- if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
- echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
- echo '<td>'.$sql_row['firstname'].'</td>';
- echo '<td>'.$sql_row['lastname'].'</td>';
- echo '<td>'.$lists[$sql_row['list_id']].'</td>';
- }
- else{
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></td>';
- echo '<td><img src="'.$site_url.'admin/survey/icons/icons/'.((int)$sql_row['responded'] == 1 ? 'star_on.png' : 'star_off.png').'"></td>';
- echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['unsubscribed'] == 1 ? 'opdedout_on.png' : 'opdedout_off.png').'"></td>';
- echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
- echo '<td>'.$sql_row['password'].'</td>';
- echo '<td>'.$sql_row['firstname'].'</td>';
- echo '<td>'.$sql_row['lastname'].'</td>';
- echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
- echo '<td>'.$lists[$sql_row['list_id']].'</td>';
- }
-
-
- echo '</tr>';
- }
-
- echo '</table>';
-
- echo '</div>'; // id="arc_content"
- echo '<div class="inv_FS_btm">';
- echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
- echo '</div>';
-
- echo '</div>';
+ return;
}
function editArchiveComment() {
@@ -4797,9 +4912,11 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -4810,20 +4927,22 @@ class SurveyInvitationsNew {
global $lang;
if (isset($_POST['inv_rid']) && trim($_POST['inv_rid']) != '') {
+
$rid = $_POST['inv_rid'];
- echo '<div id="inv_delete_rec_confirm">';
+ echo '<div id="inv_delete_rec_confirm" class="divPopUp">';
- echo '<span class="h2">Ali ste prepričani da želite izbrisati respondenta:</span>';
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
+ echo '<h2>'.$lang['srv_inv_recipient_delete'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ echo '<p class="bottom16">'.$lang['srv_inv_recipient_delete_text'].'</p>';
# polovimo podatke respondenta
$sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
$sql_query = sisplet_query($sql_string);
$sql_row = mysqli_fetch_assoc($sql_query);
- echo '<div id="inv_error_note" class="hidden"/>';
+ echo '<div id="inv_error_note" class="displayNone"/>';
echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
echo '<table id="inv_edit_recipient">';
@@ -4878,13 +4997,11 @@ class SurveyInvitationsNew {
}
}
echo '</table>';
-
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
- echo '<span id="inv_delete_recipent" class="buttonwrapper floatRight" title="'.$lang['srv_inv_list_profiles_delete'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_delete_recipient();return false;" ><span>'.$lang['srv_inv_list_profiles_delete'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr"/>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_inv_list_profiles_delete'].'" onclick="inv_delete_recipient(); return false;">'.$lang['srv_inv_list_profiles_delete'].'</button>';
+ echo '</div>';
echo '</div>'; # id="inv_delete_rec_confirm"
}
@@ -5079,34 +5196,37 @@ class SurveyInvitationsNew {
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
}
+
+
echo '<div id="inv_import_list_profiles">';
echo '<ol>';
foreach ($array_profiles AS $_pid => $profile) {
- echo '<li pid="'.$_pid.'" class="'
- # .($_pid['isdefault'] == 1 ? ' strong' : '')
- .($ppid === $_pid ? ' active' : '')
- .'">';
- echo $profile['name'];
+ echo '<li pid="'.$_pid.'" class="'.($ppid === $_pid ? ' active' : '').'">';
+
+ echo '<span>'.$profile['name'].'</span>';
+
+ if ((int)$ppid > 0 && $ppid === $_pid) {
+ # polovimo še ostale porfile
+ $sql_query = sisplet_query("SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ");
+
+ if (mysqli_num_rows($sql_query) > 0) {
+
+ echo '<div class="icons">';
+
+ # če je iz iste ankete, potem lahko urejamo
+ echo '<a href="#" onclick="inv_del_rec_profile();" title="'.$lang['srv_inv_recipients_delete_profile'].'"><span class="faicon delete_circle"></span></a>';
+ echo '<a href="#" onclick="inv_edit_rec_profile();" title="'.$lang['srv_inv_recipients_edit_profile'].'"><span class="faicon edit"></span></a>';
+
+ echo '</div>';
+ }
+ }
+
echo '</li>';
}
echo '</ol>';
- echo '</div>';
- echo '<br class="clr" />';
- if ((int)$ppid > 0) {
- # polovimo še ostale porfile
- $sql_string = "SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- # če je iz iste ankete, potem lahko urejamo
- echo '<a href="#" onclick="inv_del_rec_profile();" title="'.$lang['srv_inv_recipients_delete_profile'].'">'.$lang['srv_inv_recipients_delete_profile'].'</a><br/>';
- echo '<a href="#" onclick="inv_edit_rec_profile();" title="'.$lang['srv_inv_recipients_edit_profile'].'">'.$lang['srv_inv_recipients_edit_profile'].'</a><br/>';
- echo '<br class="clr"/>';
- }
- }
-
- echo '<br class="clr" />';
+ echo '</div>';
}
function getRecipientsProfile($pid) {
@@ -5415,29 +5535,22 @@ class SurveyInvitationsNew {
echo '<div id="inv_recipients_profile_name">';
- echo '<div id="inv_error_note" class="hidden"></div>';
+ echo '<div id="inv_error_note" class="displayNone"></div>';
- echo '<table>';
- echo '<tr><td class="bold">'.$lang['srv_inv_recipient_list_name'].'</td>';
- echo '<td>';
- echo '<input type="text" id="rec_profile_name" value="'.$sqlRow['name'].'" autofocus="autofocus" style="width: 200px;">';
- echo '</td></tr>';
- echo '</table>';
-
+ echo '<p>'.$lang['srv_inv_recipient_list_name'].'</p>';
+ echo '<input type="text" id="rec_profile_name" class="text large" value="'.$sqlRow['name'].'" autofocus="autofocus">';
echo '<input type="hidden" id="rec_profile_pid" value="'.$pid.'" >';
- echo '<br class="clr" />';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_update_rec_profile(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<br class="clr" />';
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_update_rec_profile(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>'; # id="inv_view_arch_recipients"
sisplet_query("COMMIT");
}
- echo json_encode($return);
-
exit;
}
@@ -5485,29 +5598,35 @@ class SurveyInvitationsNew {
$mid = (int)$_POST['mid'];
echo '<div id="inv_recipients_profile_name">';
- echo $lang['srv_inv_message_rename_new_name'].'&nbsp;';
+
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
# polovimo vsa sporočila
$sql_string = "SELECT naslov, comment FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id = '$mid'";
list($naslov, $comment) = mysqli_fetch_row(sisplet_query($sql_string));
- echo '<input type="text" id="inv_message_profile_name" value="'.$naslov.'" tabindex="1" autofocus="autofocus">';
- echo '<br/><br/>';
- echo $lang['srv_inv_message_draft_list_comment'];
- echo '<textarea id="inv_message_comment" tabindex="3" rows="2" style="width:200px;">'.($comment).'</textarea>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
+ echo '<input type="text" class="text medium" id="inv_message_profile_name" value="'.$naslov.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
-
- echo '<br class="clr" /><br class="clr" />';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="invMessageRename(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo '<textarea id="inv_message_comment" tabindex="3">'.($comment).'</textarea>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="invMessageRename(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
- echo '<br class="clr" />';
echo '</div>';
}
function messageRename() {
- global $lang;
+ global $lang, $global_user_id;
$return = array('msg'=>'', 'error'=>'0');
@@ -5528,13 +5647,13 @@ class SurveyInvitationsNew {
if ( $sqlQuery != 1) {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
} else {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
echo json_encode($return);
@@ -5546,63 +5665,66 @@ class SurveyInvitationsNew {
echo '<div id="inv_recipient_edit">';
- echo '<h2>Urejanje respondenta</h2>';
-
+ echo '<h2>'.$lang['srv_inv_recipient_edit'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ $button_check = 0;
+
if ((int)$_POST['inv_rid'] > 0) {
# polovimo podatke respondenta
$sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
$sql_query = sisplet_query($sql_string);
$sql_row = mysqli_fetch_assoc($sql_query);
- echo '<div id="inv_error_note" class="hidden"/>';
+ echo '<div id="inv_error_note" class="displayNone"/>';
echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
echo '<table id="inv_edit_recipient">';
#email
echo '<tr><th>'.$lang['srv_inv_field_email'].'</th><td>';
- echo '<input type="text" id="rec_email" value="'.$sql_row['email'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_email" value="'.$sql_row['email'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
#geslo
echo '<tr><th>'.$lang['srv_inv_field_password'].'</th><td>';
- echo '<input type="text" id="rec_password" value="'.$sql_row['password'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_password" value="'.$sql_row['password'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#ime
echo '<tr><th>'.$lang['srv_inv_field_firstname'].'</th><td>';
- echo '<input type="text" id="rec_firstname" value="'.$sql_row['firstname'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_firstname" value="'.$sql_row['firstname'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#priimek
echo '<tr><th>'.$lang['srv_inv_field_lastname'].'</th><td>';
- echo '<input type="text" id="rec_lastname" value="'.$sql_row['lastname'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_lastname" value="'.$sql_row['lastname'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#naziv
echo '<tr><th>'.$lang['srv_inv_field_salutation'].'</th><td>';
- echo '<input type="text" id="rec_salutation" value="'.$sql_row['salutation'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_salutation" value="'.$sql_row['salutation'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#telefon
echo '<tr><th>'.$lang['srv_inv_field_phone'].'</th><td>';
- echo '<input type="text" id="rec_phone" value="'.$sql_row['phone'].'" autocomplete="off" maxlength="45">';
+ echo '<input type="text" class="text medium" id="rec_phone" value="'.$sql_row['phone'].'" autocomplete="off" maxlength="45">';
echo '</td></tr>';
#drugo
echo '<tr><th>'.$lang['srv_inv_field_custom'].'</th><td>';
- echo '<input type="text" id="rec_custom" value="'.$sql_row['custom'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_custom" value="'.$sql_row['custom'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
#odnos
if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
echo '<tr><th>'.$lang['srv_inv_field_relation'].'</th><td>';
- echo '<input type="text" id="rec_relation" value="'.$sql_row['relation'].'" autocomplete="off" maxlength="100">';
+ echo '<input type="text" class="text medium" id="rec_relation" value="'.$sql_row['relation'].'" autocomplete="off" maxlength="100">';
echo '</td></tr>';
}
echo '</table>';
-
- echo '<br class="clr"/>';
- echo '<br class="clr"/>';
- echo '<span id="save_recipients" class="buttonwrapper floatRight" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_save_recipient();return false;" ><span>'.$lang['srv_inv_recipient_save'].'</span></a></span>';
+ $button_check = 1;
}
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr"/>';
- echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ if($button_check)
+ echo '<button class="medium blue" onclick="inv_save_recipient(); return false;">'.$lang['srv_inv_recipient_save'].'</button>';
+ echo '</div>';
}
function saveRecipient() {
@@ -5948,6 +6070,14 @@ class SurveyInvitationsNew {
ob_flush();
}
+
+ // Izvozimo paket qr kod - NIJZ
+ private function exportRecipients_qr_codes(){
+ global $lang;
+
+ $qr = new SurveyNIJZQR($this->sid);
+ $qr->getQRCodes();
+ }
function onlyThisSurvey() {
session_start();
@@ -5977,6 +6107,7 @@ class SurveyInvitationsNew {
// Dodamo vse userje v bazo podatkov kot respondente
function add_users_to_database() {
+ global $lang, $global_user_id;
// Preverimo ce je vklopljen modul za volitve
$voting = SurveyInfo::getInstance()->checkSurveyModule('voting');
@@ -6035,6 +6166,10 @@ class SurveyInvitationsNew {
$strInsertDataText = array();
$strInsertUserbase = array();
$strInsertUserstatus = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
+ $strInsertDataVrednost = array();
+ $strInsertDataText = array();
foreach ($send_users_data AS $user_data) {
// Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
@@ -6074,8 +6209,8 @@ class SurveyInvitationsNew {
# dodamo še podatke za posameznega userja za sistemske spremenljivke
foreach ($sys_vars AS $sid => $spremenljivka) {
- $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -6103,13 +6238,13 @@ class SurveyInvitationsNew {
if(!$voting){
# vstavimo v srv_data_text
- if (count($strInsertDataText) > 0) {
+ if (is_countable($strInsertDataText) && count($strInsertDataText) > 0) {
$strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
$strInsert .= implode(',',$strInsertDataText);
sisplet_query($strInsert);
}
# vstavimo v srv_data_vrednost
- if (count($strInsertDataVrednost) > 0) {
+ if (is_countable($strInsertDataVrednost) && count($strInsertDataVrednost) > 0) {
$strInsert = "INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES ";
$strInsert .= implode(',',$strInsertDataVrednost);
sisplet_query($strInsert);
@@ -6143,7 +6278,7 @@ class SurveyInvitationsNew {
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
$this->viewRecipients(/*array(),$msg*/);
@@ -6151,7 +6286,7 @@ class SurveyInvitationsNew {
// Dodamo samo izbrane userje v bazo podatkov kot respondente
function add_checked_users_to_database() {
- global $site_url;
+ global $lang, $site_url, $global_user_id;
// Prejemniki, ki jih ročno dodajamo med respondente
$inv_rids = $_POST['inv_rids'];
@@ -6170,14 +6305,17 @@ class SurveyInvitationsNew {
$sys_vars_ids[] =$row['id'];
}
$sqlVrednost = sisplet_query("SELECT spr_id, id AS vre_id, vrstni_red, variable FROM srv_vrednost WHERE spr_id IN(".implode(',',$sys_vars_ids).") ORDER BY vrstni_red ASC ");
- while ($row = mysqli_fetch_assoc($sqlVrednost)) {
- // Ce gre za odnos imamo radio
- if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
- if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
- $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
- }
- elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
- $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+
+ if($sqlVrednost !== false){
+ while ($row = mysqli_fetch_assoc($sqlVrednost)) {
+ // Ce gre za odnos imamo radio
+ if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
+ if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
+ $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
+ }
+ elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
+ $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+ }
}
}
@@ -6196,6 +6334,9 @@ class SurveyInvitationsNew {
$strInsertDataText = array();
$strInsertUserbase = array();
$strInsertUserstatus = array();
+ $strInsertDataVrednost = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
foreach ($send_users_data AS $user_data) {
$strInsert = "INSERT INTO srv_user (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id) VALUES ('".$this->sid."', '".$user_data['email']."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', NOW(), '".$user_data['id']."') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status), inv_res_id=VALUES(inv_res_id)";
@@ -6213,8 +6354,8 @@ class SurveyInvitationsNew {
# dodamo še podatke za posameznega userja za sistemske spremenljivke
foreach ($sys_vars AS $sid => $spremenljivka) {
- $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
- if (trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && $user_data[$_user_variable] != null && trim($user_data[$_user_variable]) != '') {
if($spremenljivka['variable'] == 'odnos')
$strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
else
@@ -6277,7 +6418,7 @@ class SurveyInvitationsNew {
print_r("</pre>");
}
# popravimo timestamp za regeneracijo dashboarda
- Common::getInstance()->Init($anketa);
+ Common::getInstance()->Init();
Common::getInstance()->updateEditStamp();
header('location: ' . $site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients');
@@ -6289,6 +6430,9 @@ class SurveyInvitationsNew {
# če imamo dodatne omejitve source_type > 0 (arhivi, seznami) dodamo dodatno kontrolo na id-je respondentov
$advancedConditionJoin = '';
$advancedCondition = '';
+ $sql_sub_condition = '';
+ $sub_query = '';
+
if ($source_type == 0)
{
$this->user_inv_ids = array();
@@ -6453,75 +6597,65 @@ class SurveyInvitationsNew {
#trenutna stran
$page = isset($_GET['page']) ? $_GET['page'] : '1';
- $current = is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
+ $current = isset($_GET['page']) && is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
$all = ceil($all_records / REC_ON_PAGE);
# current nastavimo na zadnji element
if ( $all > 1) {
+ echo '<div class="pagination_holder">';
+
echo '<div id="pagination">';
- $baseUrl = $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients&page=';
- # povezava -10
- if ($all > 10) {
- if ($current - 10 >= 0) {
- echo('<div><a href="'.$baseUrl.($current - 10).'">-10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">-10</div>');
- }
- }
+ $baseUrl = $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients&page=';
# povezava na prejšnjo stran
$prev_page = $current - 1 ? $current - 1 :$current;
if( ($current - 1) >= 1) {
- echo('<div><a href="'.$baseUrl.$prev_page.'">'.$lang['previous_page_short'].'</a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$prev_page.'" title="'.$lang['previous_page_short'].'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage">'.$lang['previous_page_short'].'</div>');
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
}
# povezave za vmesne strani
$middle = $all / 2;
$skipped = false;
for($a = 1; $a <= $all; $a++) {
- if ($all < ((GROUP_PAGINATE+1) * 2) || $a <= GROUP_PAGINATE || $a > ($all-GROUP_PAGINATE)
-
- || ( abs($a-$current) < GROUP_PAGINATE)) {
+
+ if ($all < ((GROUP_PAGINATE+1) * 2) || $a <= GROUP_PAGINATE || $a > ($all-GROUP_PAGINATE) || ( abs($a-$current) < GROUP_PAGINATE)){
if ($skipped == true) {
- echo '<div class="spacePage">.&nbsp;.&nbsp;.</div>';
+ echo '<div class="page_space">...</div>';
$skipped = false;
}
+
if($a == $current) {
# brez href povezave
- echo('<div class="currentPage">'.($a).'</div>');
- } else {
- echo('<div><a href="'.$baseUrl.$a.'">'.($a).'</a></div>');
+ echo '<div class="page_number currentPage">'.$a.'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$a.'"><div class="page_number">'.$a.'</div></a>';
}
- } else {
+ }
+ else {
$skipped = true;
}
}
+
# povezava na naslednjo stran
$next_page = ($current + 1) ? ($current + 1) : $current;
if(($current ) < $all) {
- echo('<div><a href="'.$baseUrl.$next_page.'">'.$lang['next_page_short'].'</a></div>');
- } else {
+ echo '<a href="'.$baseUrl.$next_page.'" title="'.$lang['next_page_short'].'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
# brez href povezave
- echo('<div class="disabledPage">'.$lang['next_page_short'].'</div>');
- }
- if ($all > 10) {
- if ($current + 10 < $all) {
- echo('<div><a href="'.$baseUrl.($current + 10).'">+10</a></div>');
- } else {
- # brez href povezave
- echo('<div class="disabledPage">+10</div>');
- }
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
}
- $rec_on_page = $all != $current ? REC_ON_PAGE : ( $all_records - ($all-1)*REC_ON_PAGE);
- echo '<div class="justtext">'.$lang['srv_inv_pagination_shown'].$rec_on_page.$lang['srv_inv_pagination_shown_records'].'</div>';
+ echo '</div>';
+
echo '</div>';
}
}
@@ -6561,39 +6695,49 @@ class SurveyInvitationsNew {
global $lang;
echo '<div id="inv_recipients_profile_name">';
- echo $lang['srv_inv_message_draft_new_save'].':&nbsp;';
- # polovimo vsa sporočila
- $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
- $sql_query = sisplet_query($sql_string);
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
- echo '<select onchange="inv_new_message_list_change(this);" autofocus="autofocus" tabindex="2">';
- echo '<option value="0" selected="selected" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
- $messages = array();
- while ( $row = mysqli_fetch_assoc($sql_query) ) {
- $messages[$row['id']] = $row;
- #'.((int)$_POST['mid'] == $row['id'] ? ' selected="selected"' : '').'
- echo '<option value="'.$row['id'].'" comment="'.$row['comment'].'">'.$row['naslov'].'</option>';
- }
- echo '</select>';
- #'.((int)$_POST['mid'] > 0 ? ' class="displayNone"' : '').'
- echo '<span id="new_message_list_span">';
- echo '<br><br/>';
- echo '<label>'.$lang['srv_inv_message_rename_new_name'];
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_new_save'].':</span>';
+
+ # polovimo vsa sporočila
+ $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+
+ echo ' <select onchange="inv_new_message_list_change(this);" class="dropdown medium" autofocus="autofocus" tabindex="2">';
+ echo ' <option value="0" selected="selected" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
+ $messages = array();
+ while ( $row = mysqli_fetch_assoc($sql_query) ) {
+ $messages[$row['id']] = $row;
+ echo ' <option value="'.$row['id'].'" comment="'.$row['comment'].'">'.$row['naslov'].'</option>';
+ }
+ echo ' </select>';
+ echo '</div>';
+
+
+ echo '<div id="new_message_list_span" class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
$newName = $this->generateMessageName();
+ echo ' <input type="text" id="rec_profile_name" class="text medium" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
- echo '<input type="text" id="rec_profile_name" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
- echo '</label>';
- echo '</span>';
- echo '<br/><br/>';
- echo $lang['srv_inv_message_draft_list_comment'];
- #.((int)$_POST['mid'] > 0 ? $messages[(int)$_POST['mid']]['comment'] : '').
- echo '<textarea id="inv_message_comment" tabindex="3" rows="2" style="width:200px;"></textarea>';
- echo '<br class="clr" /><br class="clr" />';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_message_save_details(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr" />';
- echo '</div>'; # id="inv_view_arch_recipients"
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo ' <textarea id="inv_message_comment" tabindex="3" rows="2"></textarea>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_message_save_details(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
}
@@ -6619,7 +6763,7 @@ class SurveyInvitationsNew {
if ( $sqlQuery != 1) {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
@@ -6638,7 +6782,7 @@ class SurveyInvitationsNew {
$sqlQuery = sisplet_query($sql_string);
} else {
$return['error'] = '1';
- $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ $return['msg'] .= $lang['srv_inv_msg_4'];
}
sisplet_query("COMMIT");
}
@@ -6806,9 +6950,9 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -6816,7 +6960,9 @@ class SurveyInvitationsNew {
}
function showArchiveRecipients($_arch_id = null, $archType = 'all') {
global $lang,$site_url,$global_user_id;
- echo '<div id="inv_view_arch_recipients" class="fromArchive">';
+
+ echo '<div id="inv_view_arch_recipients" class="fromArchive" style="max-height:90vh;overflow:scroll;">';
+
if ($_arch_id == null) {
$_arch_id = $_POST['aid'];
}
@@ -6984,9 +7130,9 @@ class SurveyInvitationsNew {
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -7029,9 +7175,10 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- echo '<span class="floatRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
echo '</div>';
echo '</div>';
@@ -7070,21 +7217,20 @@ class SurveyInvitationsNew {
echo '</div>'; // id="arc_content"
echo '<div class="inv_FS_btm">';
echo '<div id="navigationBottom" class="printHide">';
- #echo '<span class="floatRight spaceLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_arch_save_comment(); return false;"><span>'.$lang['save'].'</span></a></div></span>';
- echo '<span class="floatRight spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_arch_recipients_close(); return false;"><span>'.$lang['srv_zapri'].'</span></a></div></span>';
- echo '<div class="clr" />';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
echo '</div>';
-
echo '</div>';
}
function showInvitationStatus() {
- global $admin_type, $app_settings, $global_user_id;
+ global $admin_type, $global_user_id;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
$d = new Dostop();
- echo '<table style="width:50%"><tr>';
+ echo '<div class="invitations_holder half-half invitations_status">';
// Pri volitvah prikazemo samo osnovne stevilke - zaradi anonimizacije ni trackinga
if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
@@ -7093,354 +7239,25 @@ class SurveyInvitationsNew {
// Ce so izklopljena ne prikazemo leve strani
if((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')){
- echo '<td style="padding-right:10px;vertical-align: top;">';
$this->displayInvitationStatusVoting();
- echo '</td>';
}
}
- // Nov način z trackingom
- elseif($this->newTracking == true) {
+ else{
$userAccess = UserAccess::getInstance($global_user_id);
// Ce so izklopljena ne prikazemo leve strani
if((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')){
- echo '<td style="padding-right:10px;vertical-align: top;">';
$this->displayInvitationStatusNew();
- echo '</td>';
}
}
- # star način brez trackinga
- else {
- echo '<td style="padding-right:10px;vertical-align: top;">';
- $this->displayInvitationStatusOld();
- echo '</td>';
- }
- echo '</tr></table>';
- }
-
- function displayInvitationStatusOld() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path;
-
- $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
-
- # polovimo lurkerje
- echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
- echo '<div class="inv_filedset_inline_div">';
- echo '<p>';
- if ((int)$isEmail > 0) {
-
- # preštejemo respondente po statusu
- $recipients_by_status = array();
- $sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' GROUP BY last_status";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- while($row = mysqli_fetch_assoc($sql_query)) {
- $recipients_by_status['all'] += (int)$row['cnt'];
- switch ((int)$row['last_status']) {
- # 0 - E-pošta - ni poslana
- case 0:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- break;
- # 1 - E-pošta - neodgovor
- case 1:
- $recipients_by_status['send'] += (int)$row['cnt'];
- break;
- # 2 - E-pošta - napaka
- case 2:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- $recipients_by_status['error'] += (int)$row['cnt'];
- break;
- # 3 - klik na nagovor
- case 3:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 4 - klik na anketo
- case 4:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 5 - delno prazna
- case 5:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 6 - končana
- case 6:
- $recipients_by_status['send'] += (int)$row['cnt'];
- #$recipients_by_status['clicked'] += (int)$row['cnt'];
- $recipients_by_status['finished'] += (int)$row['cnt'];
- break;
- # null - neznan
- default:
- $recipients_by_status['unknown'] += (int)$row['cnt'];
- break;
- }
- }
- $all_rec_in_survey = (int)$recipients_by_status['all'];
-
- echo '<table class="inv_dashboard_table">';
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>-</th>';
- echo '<th>100%</th>';
- echo '</tr>';
- #popslano enotam
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
- echo '<th>'.(int)$recipients_by_status['send'].'</th>';
- echo '<th>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
- echo '<th>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
- echo '</tr>';
-
- #neodgovori
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
- $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
- echo '<td>'.$unanswered.'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
- echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
-
- #če se slučajno pojavijo kaki neznani statusi
- if ((int)$recipients_by_status['unknown'] > 0) {
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
- echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- }
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
- echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
- echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
- echo '</tr>';
- echo '</table>';
- echo '<br>';
- # zloopamo še po posameznih pošiljanjih
- $sql_string_arc = "SELECT sia.*, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' AND cnt_succsess > 0 ORDER BY sia.date_send ASC;";
- $sql_query_arc = sisplet_query($sql_string_arc);
-
- if (mysqli_num_rows($sql_query_arc) > 1) {
- $cnt=0;
- while($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
- $cnt++;
- # preštejemo respondente po statusu
- $recipients_by_status = array();
- $sql_string = "SELECT count(*) as cnt, last_status FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' AND id IN (select rec_id from srv_invitations_archive_recipients where arch_id = ".$row_arc['id']." AND success !='0') GROUP BY last_status";
- $sql_query = sisplet_query($sql_string);
- if (mysqli_num_rows($sql_query) > 0) {
- while($row = mysqli_fetch_assoc($sql_query)) {
- $recipients_by_status['all'] += (int)$row['cnt'];
- switch ((int)$row['last_status']) {
- # 0 - E-pošta - ni poslana
- case 0:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- break;
- # 1 - E-pošta - neodgovor
- case 1:
- $recipients_by_status['send'] += (int)$row['cnt'];
- break;
- # 2 - E-pošta - napaka
- case 2:
- $recipients_by_status['not_send'] += (int)$row['cnt'];
- $recipients_by_status['error'] += (int)$row['cnt'];
- break;
- # 3 - klik na nagovor
- case 3:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 4 - klik na anketo
- case 4:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 5 - delno prazna
- case 5:
- $recipients_by_status['send'] += (int)$row['cnt'];
- $recipients_by_status['clicked'] += (int)$row['cnt'];
- break;
- # 6 - končana
- case 6:
- $recipients_by_status['send'] += (int)$row['cnt'];
- #$recipients_by_status['clicked'] += (int)$row['cnt'];
- $recipients_by_status['finished'] += (int)$row['cnt'];
- break;
- # null - neznan
- default:
- $recipients_by_status['unknown'] += (int)$row['cnt'];
- break;
- }
- }
- $avtor_email = iconv("iso-8859-2", "utf-8",trim ($row_arc['email']));
- $avtor = array();
- if (trim($row_arc['name'])) {
- $avtor[] = trim ($row_arc['name']);
- }
- if (trim($row_arc['surname'])) {
- $avtor[] = trim ($row_arc['surname']);
- }
- if ( count($avtor) > 0 ) {
- $avtor_name = implode(' ',$avtor);
- } else {
- $avtor_name = $avtor_email;
- }
-
- echo '<span class="pointer span_list_archive" onClick="$(this).next().next().next().toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle(); $(this).next(\'.link_archive\').toggle();">';
- echo '<span class="inv_dashboard_sub_title as_link">';
- echo '<span class="plus" style="color: inherit;">+ </span>';
- echo '<span class="minus displayNone" style="color: inherit;">- </span>';
- echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
- echo '</span>';
- echo '<span class="inv_dashboard_sub_detail" title="'.$avtor_email.'">'.$avtor_name.'</span>';
- echo ', ';
- echo '<span class="inv_dashboard_sub_detail" >'.$row_arc['ds'].'</span>';
- echo '</span>';
- echo '<span class="link_archive as_link displayNone" ><a href="#" onclick="inv_arch_show_details(\''.$row_arc['id'].'\'); return false;"> arhiv </a></span>';
- echo '<br/>';
-
- echo '<table class="inv_dashboard_table sub displayNone">';
- echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
-
- echo '<th>'.(int)$all_rec_in_survey.'</th>';
- #echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>&nbsp;</th>';
- echo '<th>100%</th>';
- echo '</tr>';
- #popslano enotam
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
- echo '<td>'.(int)$recipients_by_status['send'].'</td>';
- echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
-
-
- #neodgovori
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
- $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
- echo '<td>'.$unanswered.'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
- echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
-
- #če se slučajno pojavijo kaki neznani statusi
- if ((int)$recipients_by_status['unknown'] > 0) {
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
- echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- }
- echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
- echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
- echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
- echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
- echo '</tr>';
- echo '</table>';
- }
-
- }
-
- }
- } else {
- #Vabil še nismo pošiljali
- echo $lang['srv_inv_dashboard_empty'].' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_link'].'</a>';
- }
-
- } else {
- echo $lang['srv_inv_dashboard_not_enabled'];
- }
- echo '</p>';
echo '</div>';
- echo '</fieldset>';
-
- #pošiljanje po enotah
- $cnt_by_sendings = array();
- $all_units_count = 0;
- # najprej koliko enotam še ni bilo poslano
- $sel = "select count(*) FROM srv_invitations_recipients WHERE ank_id='$this->sid' AND sent = '0'";
- $query = sisplet_query($sel);
- list($count) = mysqli_fetch_row($query);
- if ($count > 0) {
- $cnt_by_sendings[0] = (int)$count;
- }
- $all_units_count = (int)$count;
- $sel1 = "select count(*) as cnt, rec_id FROM srv_invitations_archive_recipients WHERE arch_id in (select id from srv_invitations_archive where ank_id = '".$this->sid."') AND success !='0' group by rec_id ORDER BY cnt ASC;";
- $query1 = sisplet_query($sel1);
-
- while (list($count, $rec_id) = mysqli_fetch_row($query1)) {
- $cnt_by_sendings[(int)$count] ++;
- $all_units_count++;
- }
- if (count($cnt_by_sendings) > 0) {
- echo '<fieldset class="inv_fieldset">';
- echo '<legend >';
- echo '<span class="pointer legend" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
- echo '<span class="plus red strong">+ </span>';
- echo '<span class="minus red strong displayNone">- </span>';
- echo $lang['srv_inv_nav_email_sending_status'];
- echo '</span>';
- echo Help::display('srv_inv_cnt_by_sending');
- echo '</legend>';
- echo '<br/>';
- echo '<div class="inv_filedset_inline_div displayNone">';
- echo '<table style="border-spacing: 0px;padding: 0px;margin: 0px;">';
- echo '<colgrup>';
- echo '<col style="min-width:150px;"/>';
- echo '<col style="min-width:150px;"/>';
- echo '<col style="min-width:150px;"/>';
- echo '</colgrup>';
- echo '<tr>';
- echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_cnt'].'</th>';
- echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_units'].'</th>';
- echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_percentage'].'</th>';
- echo '</tr>';
- foreach ($cnt_by_sendings AS $cnt => $units) {
- echo '<tr>';
- echo '<td>'.$cnt.'</td>';
- echo '<td>'.$units.'</td>';
- $percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0;
- echo '<td>'.Common::formatNumber ($percent,0,null,'%').'</td>';
- echo '</tr>';
- }
- echo '<tr>';
- echo '<td class="anl_bt_dot red">'.$lang['srv_inv_sending_overview_sum'].'</td>';
- echo '<td class="anl_bt_dot red">'.$all_units_count.'</td>';
- $percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0;
- echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
- echo '</tr>';
- echo '</table>';
- echo '</div>';
- echo '</fieldset>';
- }
}
// Prikaz statusov posiljanj
private function displayInvitationStatusNew() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -7449,9 +7266,9 @@ class SurveyInvitationsNew {
// Email vabila so omogocena
if ((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')) {
- echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
- echo '<div class="inv_filedset_inline_div">';
- echo '<p>';
+ echo '<fieldset class="left_holder inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+
+ echo '<div class="inv_filedset_inline_div">';
#koliko je vseh uporabnikov v bazi
$sql_query = sisplet_query("SELECT count(*) as cnt FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0'");
@@ -7566,31 +7383,43 @@ class SurveyInvitationsNew {
break;
}
}
- echo '<table class="inv_dashboard_table">';
+
+
+ echo '<table class="inv_dashboard_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>-</th>';
- echo '<th>100%</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['all'].'</th>';
+ echo '<td>-</th>';
+ echo '<td>100%</th>';
echo '</tr>';
+
#popslano enotam
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
- echo '<th>'.(int)$recipients_by_status['send'].'</th>';
- echo '<th>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
- echo '<th>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['send'].'</th>';
+ echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
echo '</tr>';
#neodgovori
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
$unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
echo '<td>'.$unanswered.'</td>';
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
+
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
@@ -7599,20 +7428,21 @@ class SurveyInvitationsNew {
#če se slučajno pojavijo kaki neznani statusi
if ((int)$recipients_by_status['unknown'] > 0) {
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
}
+
echo '<tr>';
- echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
echo '</tr>';
+
echo '</table>';
- echo '<br>';
# POSAMEZNA pošiljanja
@@ -7622,9 +7452,11 @@ class SurveyInvitationsNew {
foreach ($archive_data AS $uid => $status) {
if ((int)$status == 6 && $user_lurker[$uid] == 1) {
$user_by_status_for_archive[$archive_id]['6l']++;
- } else if ((int)$status == 5 && $user_lurker[$uid] == 1) {
+ }
+ elseif ((int)$status == 5 && $user_lurker[$uid] == 1) {
$user_by_status_for_archive[$archive_id]['5l']++;
- } else {
+ }
+ else {
$user_by_status_for_archive[$archive_id][$status]++;
}
@@ -7637,8 +7469,10 @@ class SurveyInvitationsNew {
foreach ($user_by_status_for_archive AS $arch_id => $archive_data) {
$cnt++;
if (count($archive_data ) > 0) {
+
$recipients_by_status = array();
$recipients_by_status['all']=(int)$array_archive_subdata[$arch_id]['rec_in_db'];
+
foreach ($archive_data AS $status => $cntUsers) {
# 0 - E-pošta - ni poslana
if( $status == '0') {
@@ -7696,24 +7530,21 @@ class SurveyInvitationsNew {
}
$all_rec_in_survey = (int)$recipients_by_status['all'];
- echo '<span class="pointer span_list_archive" onClick="$(this).next().next().next().toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle(); $(this).next(\'.link_archive\').toggle();">';
-
- echo '<span class="inv_dashboard_sub_title as_link">';
- echo '<span class="plus" style="color: inherit;">+ </span>';
- echo '<span class="minus displayNone" style="color: inherit;">- </span>';
- echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
- echo '</span>';
-
- // avtor
- echo '<span style="font-size: 13px;" title="'.$avtor_email.'">'.$avtor_name.'</span>';
+
+ echo '<div class="arhiv_holder">';
+
+
+ echo '<div class="arhiv_info_holder" >';
- // datum
- echo ', ';
- echo '<span style="font-size: 13px;">'.$array_archive_subdata[$arch_id]['ds'].'</span>';
+ echo '<span class="inv_dashboard_sub_title as_link" onClick="$(this).parent().next().toggleClass(\'displayNone\'); $(this).find(\'.plus\').toggleClass(\'displayNone\'); $(this).find(\'.minus\').toggleClass(\'displayNone\');">';
+ echo ' <span class="plus">+ </span>';
+ echo ' <span class="minus displayNone">- </span>';
+ echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
+ echo '</span> ';
+ echo $lang['sent_by2'].': '.$avtor_name.', '.$array_archive_subdata[$arch_id]['ds'].', ';
+
// nacin posiljanja
- echo ', ';
- echo '<span style="font-size: 13px;">';
if ($array_archive_subdata[$arch_id]['tip'] == '0')
echo '<span>'.$lang['srv_inv_message_noemailing_type1'].'</span>';
elseif($array_archive_subdata[$arch_id]['tip'] == '1')
@@ -7722,23 +7553,30 @@ class SurveyInvitationsNew {
echo '<span>'.$lang['srv_inv_message_noemailing_type3'].'</span>';
else
echo '<span>'.$lang['email'].'</span>';
- echo '</span>';
-
- echo '</span>';
+
+ echo '</div>';
+
+ // Skriti spodnji del (arhiv link + tabela)
+ echo '<div class="arhiv_sub_holder displayNone">';
+
// arhiv
- echo '<span class="link_archive as_link displayNone" style="margin-left:10px;"><a href="#" onclick="inv_arch_show_recipients(\''.$array_archive_subdata[$arch_id]['id'].'\'); return false;"> arhiv </a></span>';
- echo '<br/>';
+ echo '<a href="#" class="noline" onclick="inv_arch_show_recipients(\''.$array_archive_subdata[$arch_id]['id'].'\'); return false;">'.$lang['srv_archive'].'</a>';
-
- echo '<table class="inv_dashboard_table sub displayNone">';
+ echo '<table class="inv_dashboard_table sub">';
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
echo '<tr>';
- echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
- echo '<th>'.(int)$all_rec_in_survey.'</th>';
- #echo '<th>'.(int)$recipients_by_status['all'].'</th>';
- echo '<th>&nbsp;</th>';
- echo '<th>100%</th>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$all_rec_in_survey.'</th>';
+ echo '<td>&nbsp;</th>';
+ echo '<td>100%</th>';
echo '</tr>';
# poslano enotam
@@ -7792,41 +7630,39 @@ class SurveyInvitationsNew {
}
echo '</table>';
-
+
+ echo '</div>';
+
+ echo '</div>';
}
}
}
- } else {
+ }
+ else {
// Imamo sezname, ni pa poslanih vabil
if ((int)$cnt_all_in_db > 0){
echo $lang['srv_inv_dashboard_has_list2'];
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_list'].'</a></p>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_message">'.$lang['srv_inv_message_draft_send'].'</a></div>';
- echo '<br />';
-
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=view_recipients">'.$lang['srv_inv_dashboard_view_list'].'</a></p>';
}
// Ni seznamov in ni poslanih vabil
else{
echo $lang['srv_inv_dashboard_empty'];
- //echo '<p class="spaceLeft bold"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m=add_recipients_view">'.$lang['srv_inv_dashboard_add_list'].'</a></p>';
echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
- echo '<br /><br />';
}
}
-
- echo '</p>';
+
echo '</div>';
+
echo '</fieldset>';
}
// Email vabila niso omogocena
else {
- echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+ echo '<fieldset class="left_holder inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+
echo '<div class="inv_filedset_inline_div">';
- echo '<p>';
echo $lang['srv_inv_dashboard_not_enabled'];
@@ -7838,9 +7674,9 @@ class SurveyInvitationsNew {
else {
echo '&nbsp;<a href="#" onclick="enableEmailInvitation(this);">'.$lang['srv_omogoci'].'</a>';
}
-
- echo '</p>';
+
echo '</div>';
+
echo '</fieldset>';
}
@@ -7850,14 +7686,13 @@ class SurveyInvitationsNew {
$all_units_count = count($cnt_by_user);
if ($all_units_count > 0) {
+
foreach ($cnt_by_user AS $uid => $ucnt) {
$cnt_by_sendings[$ucnt]++;
}
-
- echo '<br/>';
-
+
#pregled po pošiljanjih
- echo '<fieldset class="inv_fieldset">';
+ echo '<fieldset class="right_holder inv_fieldset">';
echo '<legend>';
echo '<span class="pointer" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
@@ -7868,9 +7703,9 @@ class SurveyInvitationsNew {
echo Help::display('srv_inv_cnt_by_sending');
echo '</legend>';
- echo '<br/>';
echo '<div class="inv_filedset_inline_div">';
+
echo '<table style="border-spacing:0px; padding:0px; margin:0 0 20px 15px;">';
echo '<colgrup>';
echo '<col style="min-width:150px;"/>';
@@ -7899,14 +7734,16 @@ class SurveyInvitationsNew {
echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
echo '</tr>';
echo '</table>';
+
echo '</div>';
+
echo '</fieldset>';
}
}
// Prikaz statusov posiljanj pri volitvah
private function displayInvitationStatusVoting() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
@@ -8046,19 +7883,11 @@ class SurveyInvitationsNew {
function showInvitationSettings() {
- global $lang, $admin_type, $global_user_id, $site_url, $site_path, $app_settings;
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
$row = $this->surveySettings;
$_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
- $sqlu = sisplet_query("SELECT email FROM users WHERE id='".$global_user_id."'");
- $rowu = mysqli_fetch_array($sqlu);
- if ($rowu['email'] == '') {
- $sqlm = sisplet_query("SELECT * FROM misc WHERE what = 'AlertFrom'");
- $rowm = mysqli_fetch_array($sqlm);
- $rowu['email'] = $rowm['value'];
- }
-
$userAccess = UserAccess::getInstance($global_user_id);
$noEmailing = SurveySession::get('inv_noEmailing');
@@ -8069,7 +7898,9 @@ class SurveyInvitationsNew {
// Vklop vabil
if ($_email == 0) {
- echo '<fieldset class="inv_fieldset" style="max-width:800px; padding-bottom:15px;"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
@@ -8089,32 +7920,35 @@ class SurveyInvitationsNew {
echo $text3;
echo '</p>';
+
// Gumb OMOGOCI VABILA
+ echo '<div class="button_holder below">';
+
$text_button = (Common::checkModule('gorenje')) ? str_replace('1KA', 'ESurvey', $lang['srv_invitation_nonActivated_button_activate']) : $lang['srv_invitation_nonActivated_button_activate'];
- echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="enableEmailInvitation(\'1\');">'.$text_button.'</a></span>';
- //echo '<span class="spaceLeft bold" style="line-height:25px;"><a href="https://www.1ka.si/c/804/Email_vabila/?preid=793&from1ka=1">'.$lang['srv_invitation_nonActivated_more'].'</a></span>';
- echo '<br />';
+ echo '<button class="blue medium" onclick="enableEmailInvitation(\'1\');">'.$text_button.'</button>';
+
+ echo '</div>';
+
echo '</div>';
echo '</fieldset>';
+
+ echo '</div>';
}
// Vabila so vklopljena - NASTAVITVE
else{
if($noEmailing == 1){
- echo '<table class="invitations_settings" style="width:50%;">';
+ echo '<div class="invitations_holder fullwidth invitations_settings">';
}
else{
- echo '<table class="invitations_settings" style="width:100%;">';
- echo '<colgroup style="width:48%;"></colgroup>';
- echo '<colgroup style="width:48%;"></colgroup>';
+ echo '<div class="invitations_holder half-half invitations_settings">';
}
- echo '<tr>';
-
-
+
// Leva stran - navadne nastavitve
- echo '<td style="padding-right:20px;vertical-align: top;">';
+ echo '<div class="left_holder">';
+
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_invitations_settings_general'].' '.Help::display('srv_inv_general_settings').'</legend>';
echo '<div class="inv_filedset_inline_div">';
@@ -8126,120 +7960,209 @@ class SurveyInvitationsNew {
$voting_disabled = ' disabled';
// Warning za volitve
- echo '<p class="red bold">'.$lang['srv_voting_warning'].'</p>';
+ echo '<div class="setting_holder red bold">'.$lang['srv_voting_warning'].'</div>';
}
+
$individual = (int)$this->surveySettings['individual_invitation'];
// Individualizirana vabila - GLAVNA NASTAVITEV
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_individual_invitaition'];
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_user_base_individual_invitaition'];
if($individual == 0)
echo ' '.Help::display('srv_user_base_individual_invitaition_note2').' </label>';
else
echo ' '.Help::display('srv_user_base_individual_invitaition_note').' </label>';
- echo '<label><input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['no1'].'</label>';
- echo '<label><input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>'.$lang['yes'].'</label>';
- echo '</p>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_0">'.$lang['no1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_1">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Ce niso indvidualizirana imamo samo nacin posiljanja
if ($individual == 0) {
// Nacin posiljanja (email, posta, sms...)
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</label>';
- echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
- echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0" '.($noEmailing == 0 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1" '.($noEmailing == 1 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Nacin dokumentiranja (posta, sms, drugo)
if($noEmailing == 1){
$noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type_external'].':</label>';
- echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
- echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
- echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
- echo '</p>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
}
# Normalna vabila z unikatinim URL
else {
// Nacin posiljanja (email, posta, sms...)
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</label>';
- echo '<label><input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_1"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');"/>'.$lang['srv_inv_message_noemailing_0'].'</label>';
- echo '<label><input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');"/>'.$lang['srv_inv_message_noemailing_1'].'</label>';
- echo '</p>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
// Nacin dokumentiranja (posta, sms, drugo)
if($noEmailing == 1){
$noEmailingType = SurveySession::get('inv_noEmailing_type');
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_inv_message_type_external'].':</label>';
- echo '<label><input type="radio" name="noMailType" value="0" id="noMailType1"'.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />'.$lang['srv_inv_message_noemailing_type1'].'</label>';
- echo '<label><input type="radio" name="noMailType" value="1" id="noMailType2"'.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />'.$lang['srv_inv_message_noemailing_type2'].'</label>';
- echo '<label><input type="radio" name="noMailType" value="2" id="noMailType3"'.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />'.$lang['srv_inv_message_noemailing_type3'].'</label>';
- echo '</p>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
// Vnos kode - samo ce je email (drugace itak vedno rocni vnos)
if($noEmailing != 1){
- echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['usercode_required1'].':'.Help::display('usercode_required').'</label>';
- echo '<label><input type="radio" name="usercode_required" value="0" id="usercode_required_0"'.($row['usercode_required'] == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required2'].'</label>';
- echo '<label><input type="radio" name="usercode_required" value="1" id="usercode_required_1"'.($row['usercode_required'] == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);"/>'.$lang['usercode_required3'].'</label>';
- echo '</p>';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['usercode_required1'].':'.Help::display('usercode_required').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_required" value="0" id="usercode_required_0"'.($row['usercode_required'] == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);">';
+ echo ' <label for="usercode_required_0">'.$lang['usercode_required2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_required" value="1" id="usercode_required_1"'.($row['usercode_required'] == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);">';
+ echo ' <label for="usercode_required_1">'.$lang['usercode_required3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
}
if ($row['usercode_required'] != 0) {
- echo '<p>';
+
+ echo '<div class="setting_holder">';
+
if($noEmailing == 1)
- echo '<label class="lbl_email_setting">'.$lang['usercode_text2'].': </label><br />';
+ echo '<label>'.$lang['usercode_text2'].':</label>';
else
- echo '<label class="lbl_email_setting">'.$lang['usercode_text'].': </label><br />';
+ echo '<label>'.$lang['usercode_text'].':</label>';
+
$nagovorText = ($row['usercode_text'] && $row['usercode_text'] != null && $row['usercode_text'] != "") ? $row['usercode_text'] : $lang['srv_basecode'];
- echo '<textarea style="width:430px; margin-left:15px; margin-top:5px;" name="usercode_text" onblur="surveyBaseSettingText(\'usercode_text\',false);return false;">'.$nagovorText.'</textarea>';
- echo '</p>';
+ echo ' <textarea style="width:100%; height:65px;" name="usercode_text" onblur="surveyBaseSettingText(\'usercode_text\',false);return false;">'.$nagovorText.'</textarea>';
+
+ echo '</div>';
}
+
// Dostop brez kode
-
-
- echo '<p><label for="usercode_skip_0" class="lbl_email_setting">';
- echo $lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code');
- echo '<input type="checkbox" name="usercode_skip_checkbox" value="0" id="usercode_skip_0"'.($row['usercode_skip'] != 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);" />';
- echo '</label></p>';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="checkbox" name="usercode_skip_checkbox" value="0" id="usercode_skip_0"'.($row['usercode_skip'] != 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);" />';
+ echo ' <label for="usercode_skip_0" class="lbl_email_setting">'.$lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code');
+ echo ' </div>';
+
+ echo '</div>';
+
if($row['usercode_skip'] > 0){
- echo '<div style="float: left; margin: -10px 0 0 15px;">';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </label>';
- echo '<label><input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_vsi'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_setting_onlyAuthor'].'</label>';
- echo '</div>';
- }
+
+ echo '<div class="setting_holder">';
- /*echo '<p>';
- echo '<label class="lbl_email_setting">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </label>';
- echo '<label><input type="radio" name="usercode_skip" value="0" id="usercode_skip_0"'.($row['usercode_skip'] == 0 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['no1'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['yes'].'</label>';
- echo '<label><input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);"/>'.$lang['srv_setting_onlyAuthor'].'</label>';
- echo '<br/><i class="small">* '.$lang['srv_user_base_access_alert_'.$row['usercode_skip'].''].'</i>';
- echo '</p>';*/
+ echo ' <div class="setting_title">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_1">'.$lang['srv_vsi'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_2">'.$lang['srv_setting_onlyAuthor'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
}
- echo '<br />';
-
// Gumb shrani - samo provizorično
- echo '<div class="buttonwrapper"><a class="ovalbutton floatRight" href="#" title="'.$lang['save'].'">'.$lang['save'].'</a></div>';
- echo '<div class="buttonwrapper"><a class="ovalbutton floatRight spaceRight" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['save'].'">'.$lang['save'].'</button>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view"><button class="blue medium">'.$lang['next1'].'</button></a>';
+ echo '</div>';
echo '</div>';
- echo '</div>';
+ echo '</div>';
+
echo '</fieldset>';
- echo '</td>';
+
+ echo '</div>';
// desna stran - nastavitve streznika - samo ce imamo posiljanje preko emaila
@@ -8248,7 +8171,8 @@ class SurveyInvitationsNew {
// Gorenje tega nima
if (!Common::checkModule('gorenje')){
- echo '<td style="padding-right:10px;vertical-align: top;">';
+ echo '<div class="right_holder">';
+
echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_email_setting_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
@@ -8256,19 +8180,23 @@ class SurveyInvitationsNew {
$this->viewServerSettings();
echo '</div>';
- echo '</div>';
+ echo '</div>';
echo '</fieldset>';
- echo '</td>';
+
+ echo '</div>';
}
}
- echo '</tr></table>';
+ echo '</div>';
}
}
# navadni uporabniki, ki nimajo dostopa - text kako lahko pridobijo dostop
else {
- echo '<fieldset class="inv_fieldset" style="max-width:800px; padding-bottom: 15px;"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
echo '<div class="inv_filedset_inline_div">';
echo '<p>';
@@ -8287,13 +8215,19 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_nonActivated_text3'];
echo '</p>';
+
// Gumb ZAPROSI ZA DOSTOP DO VABIL
- echo '<span class="buttonwrapper floatLeft spaceRight"><a class="ovalbutton ovalbutton_orange" href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/objava/1ka-vabila/?from1ka=1">'.$lang['srv_invitation_nonActivated_button_details'].'</a></span>';
- //echo '<span class="spaceLeft bold" style="line-height:25px;"><a href="https://www.1ka.si/c/804/Email_vabila/?preid=793&from1ka=1">'.$lang['srv_invitation_nonActivated_more'].'</a></span>';
- echo '<br />';
+ echo '<div class="button_holder below">';
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/objava/1ka-vabila/?from1ka=1" target="_blank">';
+ echo ' <button class="blue medium">'.$lang['srv_invitation_nonActivated_button_details'].'</button>';
+ echo ' </a>';
+ echo '</div>';
+
echo '</div>';
echo '</fieldset>';
+
+ echo '</div>';
}
}
@@ -8316,31 +8250,39 @@ class SurveyInvitationsNew {
function showInvitationLists($profile_id=null) {
global $lang,$global_user_id;
- echo '<h2>'.$lang['srv_inv_list_edit_header'].'</h2>';
+ echo '<div class="invitations_holder half-half invitation_lists">';
+
+
+ echo '<div class="left_holder">';
+ echo ' <div class="top_settings">';
+ echo ' <label>'.$lang['srv_inv_list_edit_list'].':</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="1" onclick="showInvitationListsNames();" checked="checked" autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="0" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type3" type="radio" value="2" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type3">'.$lang['srv_inv_list_edit_from_archive'].'</label>';
+ echo ' </div>';
- echo '<table>';
- echo '<tr>';
- echo '<td style="vertical-align:top;min-height:500px; min-width:550px;">';
- echo '<div style="height:25px; width:100%; ">';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="1" onclick="showInvitationListsNames();" checked="checked" autocomplete="off">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="0" onclick="showInvitationListsNames();" autocomplete="off">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
- echo '<label><input name="inv_show_list_type" id="inv_show_list_type3" type="radio" value="2" onclick="showInvitationListsNames();" autocomplete="off">'.$lang['srv_inv_list_edit_from_archive'].'</label>';
- echo '<label class="as_link spaceLeft" onclick="inv_upload_list();">'.$lang['srv_inv_list_upload_file'].'</label>';
- echo '</div>';
- echo '<div id="inv_edit_rec_list">';
+ echo ' <div class="setting_item">';
+ echo ' <a href="#" onclick="inv_upload_list();" class="noline">'.$lang['srv_inv_list_upload_file'].'</a>';
+ echo ' </div>';
+
+ echo ' <div id="inv_edit_rec_list">';
$this->showInvitationListsNames($profile_id);
+ echo ' </div>';
echo '</div>';
- echo '</td><td style="padding-left:20px; vertical-align:top;">';
- echo '<div id="inv_selected_rec_list">';
- $doEdit = $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true' ? true : false;
+
+
+ echo '<div id="inv_selected_rec_list" class="right_holder">';
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
if ($doEdit) {
$this->showEditRecList($profile_id);
- } else {
+ }
+ else {
$this->showNoEditRecList($profile_id);
}
echo '</div>';
- echo '</td></tr>';
- echo '</table>';
+
+
+ echo '</div>';
}
function showInvitationListsNames($profile_id=null) {
@@ -8348,7 +8290,7 @@ class SurveyInvitationsNew {
$onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 1;
if ($profile_id == null) {
- $pids = explode(',',$_POST['pids']);
+ $pids = explode(',',$this->invitationAdvancedConditionId);
} else {
$pids = explode(',',$profile_id);
}
@@ -8358,6 +8300,7 @@ class SurveyInvitationsNew {
$accPid = '';
$accStr = "SELECT DISTINCT pid FROM srv_invitations_recipients_profiles_access where uid = '$global_user_id'";
$accQry = sisplet_query($accStr);
+ $prefix = '';
while (list($pid) = mysqli_fetch_row($accQry)) {
$accPid .= $prefix ."'".$pid."'";
$prefix = ',';
@@ -8376,14 +8319,22 @@ class SurveyInvitationsNew {
$sql_query = sisplet_query($sql_string);
}
- if (mysqli_num_rows($sql_query)>0) {
+ if (mysqli_num_rows($sql_query) > 0) {
echo '<table class="inv_edit_rec_list">';
+
echo '<tr>';
- echo '<th>&nbsp;</th>';
- if ($onlyThisSurvey != 2) {
- echo '<th>&nbsp;</th>';
- echo '<th>&nbsp;</th>';
+
+ if ($onlyThisSurvey != 2) {
+ echo '<th class="edit">';
+ echo ' <input type="checkbox" id="inv_list_chck_all" onclick="inv_list_selectAll(this.checked);">';
+ echo ' <label for="inv_list_chck_all"></label>';
+ echo ' <a href="#" title="'.$lang['srv_invitation_recipients_delete_selected'].'" onclick="inv_recipients_list_action(\'delete\');"><span class="faicon delete"></span></a>';
+ echo '</th>';
}
+ else{
+ echo '<th></th>';
+ }
+
echo '<th>';
echo $lang['srv_inv_list_table_name'];
echo '</th>';
@@ -8400,24 +8351,34 @@ class SurveyInvitationsNew {
echo $lang['srv_inv_list_table_author'];
echo '</th>';
echo '</tr>';
+
while ($sql_row = mysqli_fetch_assoc($sql_query)) {
echo '<tr>';
- echo '<td>';
- echo '<input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'],$pids) ? ' checked="checked"' : '').'autocomplete="off">';
- echo '</td>';
- if ($onlyThisSurvey != 2) {
- echo '<td>';
- echo '<span class="faicon delete_circle icon-orange_link" onclick="deleteRecipientsList_confirm(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
- echo '</td>';
- echo '<td>';
- echo '<span class="faicon quick_edit user smaller icon-as_link" onclick="inv_list_edit(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit_access'].'"></span>';
+
+ if ($onlyThisSurvey != 2) {
+
+ echo '<td class="edit">';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+
+ echo ' <span class="faicon delete" onclick="deleteRecipientsList_confirm(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+
+ echo ' <span class="faicon quick_edit users" onclick="inv_list_edit(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit_access'].'"></span>';
echo '</td>';
}
+ else{
+ echo '<td>';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+ echo '</td>';
+ }
+
echo '<td>';
echo '<label for="inv_list_chck_'.$sql_row['pid'].'">';
echo $sql_row['name'];
echo '</label>';
echo '</td>';
+
echo '<td>';
if (isset($sql_row['respondents'])) {
$_recipients = str_replace("\n\r", "\n", $sql_row['respondents']);
@@ -8427,107 +8388,114 @@ class SurveyInvitationsNew {
echo (int)$sql_row['cnt_succsess']+(int)$sql_row['cnt_error'];
}
echo '</td>';
- #echo '<td>';
- #$_fields = explode(",",$sql_row['fields']);
- #$_fields_lang = array();
- #foreach ($_fields as $_field) {
- # $_fields_lang[] = $lang['srv_inv_field_'.$_field];
- #}
- #echo implode(',',$_fields_lang);
- #echo '</td>';
+
echo '<td>';
echo $sql_row['comment'];
echo '</td>';
+
echo '<td>';
echo $sql_row['ds'];
echo '</td>';
+
echo '<td title="'.$sql_row['email'].'">';
echo $sql_row['firstname'];
- echo ' '.$sql_row['surname'];
+ echo ' '.(isset($sql_row['surname']) ? $sql_row['surname'] : '');
echo '</td>';
+
echo '</tr>';
}
+
echo '</table>';
- /*
- * Osznačevanje vseh seznamov in brisanje le teh*/
- echo '<div id="inv_bottom_edit">';
- echo '<span class="faicon arrow_up"></span> ';
- echo '<span id="inv_switch_on"><a href="#" onClick="inv_list_selectAll(true)">'.$lang['srv_select_all'].'</a></span>';
- echo '<span id="inv_switch_off" style="display:none;"><a href="#" onClick="inv_list_selectAll(false)">'.$lang['srv_deselect_all'].'</a></span>';
- echo '&nbsp;&nbsp;<a href="#" onclick="inv_recipients_list_action(\'delete\');"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_invitation_recipients_delete_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
- //echo '&nbsp;&nbsp;<a href="#" onclick="inv_recipients_form_action(\'export\');"><span class="sprites xls delete" style="height:14px; width:16px;" title="'.$lang['srv_invitation_recipients_export_selected'].'"/></span>&nbsp;'.$lang['srv_invitation_recipients_export_selected'].'</a>';
- echo '</div>';
- } else {
+ }
+ else {
echo $lang['srv_inv_list_no_lists'];
}
+
return (int)mysqli_num_rows($sql_query);
}
function showNoEditRecList($profile_id = null) {
global $lang;
+
$pids=array();
- $onlyThisSurvey = (int)$_POST['onlyThisSurvey'];
- if ($profile_id == null)
- {
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
+ if($profile_id == null){
+
# preberemo id-je profilov in respondente
- if ($_POST['pids'] != '')
- {
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
$pids = explode(',',$_POST['pids']);
}
- } else
- {
+ }
+ else{
# preberemo id-je profilov in respondente
- if ($profile_id != '')
- {
+ if ($profile_id != ''){
$pids = explode(',',$profile_id);
}
}
- if (empty($pids))
- {
+ if (is_array($pids) && count($pids) == 0) {
echo $lang['srv_inv_list_choose_left'].'<br>';
}
session_start();
$infoBox = null;
- if (is_array($pids) && count($pids) > 0)
- {
- echo '<div style="width:100%; height:25px;"><label><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" autocomplete="off">'.$lang['srv_inv_list_edit'].'</label></div>';
- $respondents = array();
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
$fields = array();
+
# info box prikazujemo samo ko imamo izbran 1 seznam
- if ($onlyThisSurvey <= 1)
- {
+ if ($onlyThisSurvey <= 1){
# če imamo normalne sezname
if (is_array($pids) && count($pids) == 1) {
$sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
- } else {
+ }
+ else {
$sql_string = "SELECT rp.respondents, fields FROM srv_invitations_recipients_profiles AS rp WHERE rp.pid IN(".(implode(',',$pids)).")";
}
-
+
$sql_query = sisplet_query($sql_string);
- while ($sql_row = mysqli_fetch_assoc($sql_query))
- {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)){
+
# info box prikazujemo samo ko imamo izbran 1 seznam
- if (is_array($pids) && count($pids) == 1)
- {
- $infoBox .= '<span class="gray" style="display:inline-block; margin:10px;5px;">';
- $infoBox .= $lang['srv_inv_list_edit_added'];
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox .= '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
$infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
+ $infoBox .= '</span>';
+
if ($sql_row['fitime'] != $sql_row['fetime']) {
- $infoBox .= '<br/>'.$lang['srv_inv_list_edit_changed'];
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
$infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
}
-
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_name'].$sql_row['name'].'</label>';
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_comment'].$sql_row['comment'].'</label>';
-
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_name'].$sql_row['name'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_comment'].$sql_row['comment'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '</div>';
}
- #$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
$respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
$respondents_list = explode("\n",$respondents_list);
@@ -8542,8 +8510,7 @@ class SurveyInvitationsNew {
}
} # end-while
}
- else
- {
+ else{
# imamo arhive
$fields = array();
$_recipients = array();
@@ -8572,7 +8539,7 @@ class SurveyInvitationsNew {
}
}
-
+
# pohandlamo polja
$field_list = array();
$default_fields = array(
@@ -8600,30 +8567,33 @@ class SurveyInvitationsNew {
}
}
- if (count($default_fields) > 0)
- {
+ if (count($default_fields) > 0){
foreach ($default_fields as $key =>$field) {
$field_list[$key] = $field;
unset($default_fields[$key]);
}
}
$respondents = array_unique($respondents);
+
+
echo '<table class="inv_edit_rec_list">';
+
echo '<tr>';
$fields_cnt = 0;
- foreach ($field_list AS $field => $checked)
- {
+ foreach ($field_list AS $field => $checked){
if ($checked == 1) {
$fields_cnt++;
- echo '<th title="'.$lang['srv_inv_recipients_'.$field].'">'.$lang['srv_'.$field].'</th>';
+ echo '<th title="'.$lang['srv_'.$field].'">'.$lang['srv_'.$field].'</th>';
}
}
echo '</tr>';
- if (is_array($respondents) && count($respondents) > 0 )
- {
- foreach ($respondents AS $respondent_data) {
+
+ if (is_array($respondents) && count($respondents) > 0 ){
+ foreach ($respondents AS $respondent_data){
$row_cnt = 0;
+
echo '<tr>';
+
$respondent_data_array = explode('|~|',$respondent_data);
if (count($respondent_data_array) > 0) {
foreach ($respondent_data_array AS $tekst) {
@@ -8633,42 +8603,56 @@ class SurveyInvitationsNew {
}
}
}
+
echo '</tr>';
}
}
+
echo '</table>';
}
+
echo $infoBox;
}
- function showEditRecList($profile_id = null)
- {
+ function showEditRecList($profile_id = null){
global $lang;
+
$pids=array();
- $onlyThisSurvey = (int)$_POST['onlyThisSurvey'];
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
if ($profile_id == null) {
+
# preberemo id-je profilov in respondente
- if ($_POST['pids'] != '') {
- $pids = explode(',',$_POST['pids']);
- }
- } else {
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
+ $pids = explode(',',$_POST['pids']);
+ }
+ }
+ else {
# preberemo id-je profilov in respondente
if ($profile_id != '') {
- $pids = explode(',',$profile_id);
- }
+ $pids = explode(',',$profile_id);
+ }
}
+
if (is_array($pids) && count($pids) == 0) {
echo $lang['srv_inv_list_choose_left'].'<br>';
}
+
session_start();
- if (is_array($pids) && !empty($pids))
- {
- echo '<div style="height:25px;width:100%;"><label><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" checked="checked" autocomplete="off">'.$lang['srv_inv_list_edit'].'</label></div>';
- $respondents = array();
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" checked="checked"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
$fields = array();
$infoBox = null;
- if ($onlyThisSurvey <= 1)
- {
+ if ($onlyThisSurvey <= 1){
+
# če imamo normalne sezname
if (is_array($pids) && count($pids) == 1) {
$sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
@@ -8681,22 +8665,44 @@ class SurveyInvitationsNew {
while ($sql_row = mysqli_fetch_assoc($sql_query))
{
# info box prikazujemo samo ko imamo izbran 1 seznam
- if (is_array($pids) && count($pids) == 1)
- {
- $infoBox = '<span class="gray" style="display:inline-block; margin:10px;5px;">';
- $infoBox .= $lang['srv_inv_list_edit_added'];
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox = '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
$infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
- if ($sql_row['fitime'] != $sql_row['fetime'])
- {
- $infoBox .= '<br/>'.$lang['srv_inv_list_edit_changed'];
+ $infoBox .= '</span>';
+
+ if ($sql_row['fitime'] != $sql_row['fetime']){
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
$infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
$infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
}
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_name'].'<input type="text" id="rec_profile_name" value="'.$sql_row['name'].'" tabindex="1" ></label>';
- $infoBox .= '<br/><label>'.$lang['srv_inv_list_edit_comment'].'<input type="text" id="rec_profile_comment" value="'.$sql_row['comment'].'" tabindex="2"></label>';
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_name'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium" id="rec_profile_name" value="'.$sql_row['name'].'" tabindex="1">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_comment'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium w400" id="rec_profile_comment" value="'.$sql_row['comment'].'" tabindex="2">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '</div>';
}
- #$array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
$respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
$respondents_list = explode("\n",$respondents_list);
@@ -8791,7 +8797,7 @@ class SurveyInvitationsNew {
# ali labela sproži klik checkboxa
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
}
@@ -8801,10 +8807,10 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
echo '<div>';
echo '<textarea id="inv_recipients_list" name="inv_recipients_list">';
if (is_array($respondents) && count($respondents) > 0 ) {
@@ -8814,14 +8820,15 @@ class SurveyInvitationsNew {
echo '</div>';
echo $infoBox;
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- if (count($pids) <= 1 ) {
- echo '<span class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inv_list_save_old(\''.implode('',$pids).'\'); return false;"><span>'.$lang['srv_inv_list_save_old'].'</span></a></span>';
- }
- echo '<span class="buttonwrapper floatLeft spaceLeft"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_get_name(\'true\'); return false;"><span>'.$lang['srv_inv_list_save_new'].'</span></a></span>';
- echo '<br class="clr" />';
+
+ echo '<div class="button_holder below">';
+
+ if (count($pids) <= 1 )
+ echo '<button class="medium white-black" onclick="inv_list_save_old(\''.implode('',$pids).'\'); return false;">'.$lang['srv_inv_list_save_old'].'</button>';
+ echo '<button class="medium white-blue" onclick="inv_list_get_name(\'true\'); return false;">'.$lang['srv_inv_list_save_new'].'</button>';
+
+ echo '</div>';
}
}
@@ -8829,44 +8836,35 @@ class SurveyInvitationsNew {
function invListEdit() {
global $lang,$site_url, $global_user_id;
+ echo '<h2>'.$lang['access'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
# polovimo podatke profila
$sql_string = "SELECT pid, name, comment, uid FROM srv_invitations_recipients_profiles WHERE pid='".$_POST['pid']."'";
$sql_query = sisplet_query($sql_string);
list($pid, $name, $comment, $uid) = mysqli_fetch_row($sql_query);
echo '<div id="inv_recipients_profile_name" class="access">';
echo '<form id="inv_list_edit_form" name="inv_list_edit_form" autocomplete="off">';
- /*
- echo '<span id="new_recipients_list_span" >';
- echo '<label>'.$lang['srv_inv_recipient_list_name'];
- echo '<input type="text" id="rec_profile_name" name="rec_profile_name" value="'.$name.'" tabindex="1" autofocus="autofocus">';
- echo '</label>';
- echo '</span>';
-
- echo '<br/><br/>';
- echo $lang['srv_inv_recipient_list_comment'];
- echo '<textarea id="rec_profile_comment" name="rec_profile_comment" tabindex="3" rows="5" >'.$comment.'</textarea>';
- echo '<br/>';
- */
$this->displayListAccess($pid);
+
# skrita polja za respondente in polja
echo '<input id="profile_id" name="profile_id" type="hidden" value="'.($_POST['pid']).'" >';
- echo '<br class="clr" /><br/>';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_edit_save(); return false;"><span>'.$lang['save'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
- echo '<br class="clr" />';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="inv_list_edit_save(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
echo '</form>';
echo '</div>'; # id="inv_view_arch_recipients"
- /* echo '<script type="text/javascript">';
- echo "$('#rec_profile_name').focus();";
- echo '</script>';
- */
}
function listGetName() {
global $lang,$site_url, $global_user_id;
$saveNew = $_POST['saveNew'] == 'true' ? true : false;
+ $pid = isset($_POST['pid']) ? isset($_POST['pid']) : '';
$array_profiles = array();
#ne vem če je fino da lahko dodaja kar na vse sezname
@@ -8905,7 +8903,7 @@ class SurveyInvitationsNew {
} else {
echo '<span id="new_recipients_list_span" >';
echo '<label>'.$lang['srv_inv_recipient_list_name'];
- echo '<input type="text" id="rec_profile_name" value="'.$array_profiles[$_POST['pid']]['name'].'" tabindex="1" autofocus="autofocus">';
+ echo '<input type="text" id="rec_profile_name" value="'.isset($array_profiles[$pid]['name']) ? $array_profiles[$pid]['name'] : ''.'" tabindex="1" autofocus="autofocus">';
echo '</label>';
echo '</span>';
}
@@ -8913,13 +8911,13 @@ class SurveyInvitationsNew {
echo '<br/><br/>';
echo $lang['srv_inv_recipient_list_comment'];
- echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >'.$array_profiles[$_POST['pid']]['comment'].'</textarea>';
+ echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >'.isset($array_profiles[$pid]['comment']) ? $array_profiles[$pid]['comment'] : ''.'</textarea>';
# skrita polja za respondente in polja
$_fields = str_replace('inv_field_','',implode(',',$_POST['fields']));
echo '<input id="inv_prof_field_list" type="hidden" value="'.$_fields.'" >';
echo '<input id="inv_prof_recipients_list" type="hidden" value="'.$this->getCleanString($_POST['recipients_list']).'" >';
echo '<input id="saveNew" type="hidden" value="'.($saveNew == true ? 'true' : 'false').'" >';
- echo '<input id="profile_id" type="hidden" value="'.($_POST['pid']).'" >';
+ echo '<input id="profile_id" type="hidden" value="'.($pid).'" >';
echo '<br class="clr" /><br/>';
echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_save(); return false;"><span>'.$lang['save'].'</span></a></span>';
@@ -9074,7 +9072,7 @@ class SurveyInvitationsNew {
function deleteRecipientsListMulti() {
$return = array('success'=>'0');
- global $global_user_id;
+ global $global_user_id, $lang;
$ids = $_POST['ids'];
@@ -9148,13 +9146,12 @@ class SurveyInvitationsNew {
while ($row1 = mysqli_fetch_assoc($sqlQuery)) {
- $checked = ( in_array($row1[id],$accessArray) ||$uid == $row1['id']) ? ' checked="checked"' : '';
+ $checked = ( in_array($row1['id'],$accessArray) ||$uid == $row1['id']) ? ' checked="checked"' : '';
$_css_hidden = ($checked != '' ? '' : ' displayNone');
echo '<div id="div_for_uid_' . $row1['id'] . '" name="listAccess" class="floatLeft listAccess_uid'.$_css_hidden.'">';
- echo '<label nowrap title="' . $row1['email'] . '"'.($uid == $row1['id']?' class="gray"':'').'>';
echo '<input type="checkbox" name="uid[]" value="' . $row1['id'] . '" id="uid_' . $row1['id'] . '"' . $checked .($uid == $row1['id'] ? ' disabled="disabled"' : ''). ' autocomplete="off"/>';
- echo $row1['name'] . ($uid == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>';
+ echo '<label nowrap title="' . $row1['email'] . '"'.($uid == $row1['id']?' class="gray"':'').'>'.$row1['name'] . ($uid == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>';
echo '</div>';
}
@@ -9201,7 +9198,7 @@ class SurveyInvitationsNew {
}
}
- $link1 = $site_url.'a/'.Common::encryptAnketaID($this->sid);
+ $link1 = $site_url.'a/'.SurveyInfo::getInstance()->getSurveyHash();
# normalen link
$result[$cnt] = array('url'=>$link1, 'name'=>$link1.(count($lang_array) > 0 ? ' - '.$lang['language'] : ''));
if ($default_checked == false) {
@@ -9296,7 +9293,7 @@ class SurveyInvitationsNew {
$label_for = ' for="'.$field.'_chk"';
echo '<li id="'.$field.'"'.$css.'>';
- echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox' . $hidden_checkbox . '"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
echo '</li>';
if ($is_selected == 1) {
@@ -9306,10 +9303,8 @@ class SurveyInvitationsNew {
}
echo '</ul>';
echo '</div>';
- echo '<br class="clr" />';
- echo '<script type="text/javascript">';
- echo "$('ul.connectedSortable').sortable({update : function () { refreshFieldsList(); }, forcePlaceholderSize: 'true',tolerance: 'pointer',placeholder: 'inv_field_placeholder',});";
- echo '</script>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_upload_list" autocomplete="off">';
echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
@@ -9322,14 +9317,14 @@ class SurveyInvitationsNew {
echo '<br class="clr" />';
echo $lang['srv_mailing_upload_list'];
echo '<input type="file" name="invListFile" id="invListFile" size="42" >';
- if (count($errors) > 0) {
+ /* if (count($errors) > 0) {
echo '<br class="clr" />';
echo '<span class="inv_error_note">';
foreach($errors as $error) {
echo '* '.$error.'<br />';
}
echo '</span>';
- }
+ } */
echo '<br/><br/><label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label> <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1" value="," checked><label for="recipientsDelimiter1">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2" value=";"><label for="recipientsDelimiter2">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
echo '</form>';
@@ -9394,17 +9389,19 @@ class SurveyInvitationsNew {
# če so napake jih prikažemo če ne obdelamo datoteko
if (count($errors) > 0) {
- echo '<br class="clr" />';
- echo '<span class="inv_message_errors">'.$lang['srv_inv_recipiens_upload_error'].'</span>';
- echo '<br class="clr" />';
- echo '<br class="clr" />';
- echo '<span class="inv_error_note">';
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
foreach($errors as $error) {
- echo '* '.$error.'<br />';
+ echo '<span class="inv_error_note">* '.$error.'</span>';
}
- echo '</span>';
+
+ echo '</div>';
+
#$this->addRecipientsView($fields, $invalid_recipiens_array);
- } else {
+ }
+ else {
$fh = @fopen($file_tmp, "rb");
if ($fh) {
@@ -9447,20 +9444,7 @@ class SurveyInvitationsNew {
$this->showInvitationLists();
}
- /*
- function strpos_index($haystack = '',$needle = '',$offset = 0,$limit = 99,$return = null)
- {
- $length = strlen($needle);
- $occurances = array();
- while((($count = count($occurances)) < $limit) && (false !== ($offset = strpos($haystack,$needle,$offset))))
- {
- $occurances[$count]['length'] = $length;
- $occurances[$count]['start'] = $offset;
- $occurances[$count]['end'] = $offset = $offset + $length;
- }
- return $return === null ? $occurances : $occurances[$return];
- }
- */
+
/**
* Find position of Nth $occurrence of $needle in $haystack
* Starts from the beginning of the string
@@ -9494,37 +9478,37 @@ class SurveyInvitationsNew {
function displayMessagePreview() {
global $lang;
- $sql_string_m = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
-
- $sql_query_m = sisplet_query($sql_string_m);
+ $sql_query_m = sisplet_query("SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
$preview_message = mysqli_fetch_assoc($sql_query_m);
- # polovimo imena vseh sporocil
- $sql_string_m = "SELECT id, naslov FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
- echo '<table id="inv_send_mail_preview">';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_name'].':</th>';
- echo '<td class="inv_bt">';
- echo '<span>';
- $sql_query_m = sisplet_query($sql_string_m);
+ # polovimo imena vseh sporocil
+
+ echo '<div id="inv_send_mail_preview">';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_name'].':</label>';
+ $sql_query_m = sisplet_query("SELECT id, naslov FROM srv_invitations_messages WHERE ank_id = '$this->sid'");
if (mysqli_num_rows($sql_query_m) > 0 ) {
- echo '<select onchange="mailSourceMesageChange(this);">';
+ echo ' <select class="dropdown medium" onchange="mailSourceMesageChange(this);">';
while ($row = mysqli_fetch_assoc($sql_query_m)) {
- echo '<option value="'.$row['id'].'"'.($row['id'] ==$preview_message['id']?' selected="selected"':'' ).'>'.$row['naslov'].'</option>';
+ echo ' <option value="'.$row['id'].'"'.($row['id'] ==$preview_message['id']?' selected="selected"':'' ).'>'.$row['naslov'].'</option>';
}
- echo '</select>';
+ echo ' </select>';
}
- #.$preview_message['naslov'];
- echo '</span>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_subject'].':</th>';
- echo '<td class="inv_bt">';
- echo '<span>'.$preview_message['subject_text'].'</span>';
- echo '</td></tr>';
- echo '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
- echo '<td >';
- echo '<span class="nl2br">'.($preview_message['body_text']).'</span>';
- echo '</td></tr>';
- echo '</table>';
+ echo '</div>';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <span>'.$preview_message['subject_text'].'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_item hor align-top">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <span>'.$preview_message['body_text'].'</span>';
+ echo '</div>';
+
+ echo '</div>';
+
// Opozorilo ce manjka #URL# v besedilu maila in imamo individualizirano vabilo
if(strpos($preview_message['body_text'], '#URL#') == false && $this->surveySettings['usercode_required'] == 0 && $this->surveySettings['individual_invitation'] != 0)
@@ -9535,13 +9519,13 @@ class SurveyInvitationsNew {
echo '<span class="red">'.$lang['srv_inv_message_draft_url_warning'].'</span><br />';
// Popravi sporocilo
- echo '<a href="'.$this->addUrl('view_message').'">'.$lang['srv_invitation_reedit_message'].'</a>';
+ echo '<a href="'.$this->addUrl('view_message').'" class="noline">'.$lang['srv_invitation_reedit_message'].'</a>';
}
function addSortField($field){
$type = 'ASC';
session_start();
- if ($_SESSION['rec_sort_field'] == $field) {
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
if ($_SESSION['rec_sort_type'] == 'DESC') {
$type = 'ASC';
} else {
@@ -9554,7 +9538,7 @@ class SurveyInvitationsNew {
}
function addSortIcon($field){
session_start();
- if ($_SESSION['rec_sort_field'] == $field) {
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
if ($_SESSION['rec_sort_type'] == 'DESC') {
return ' <span class="faicon sort_descending icon-blue"></span>';
@@ -9650,29 +9634,34 @@ class SurveyInvitationsNew {
$sqlSpremenlivka = sisplet_query($qryString);
if (mysqli_num_rows($sqlSpremenlivka) > 0) {
+
echo '<form id="inv_ValidateSysVarsMappingFrm" name="inv_ValidateSysVarsMappingFrm">';
+
echo $lang['srv_invitation_system_email_choose'];
- echo '<table>';
+
+ echo '<div class="setting_holder">';
while ($row = mysqli_fetch_assoc($sqlSpremenlivka)) {
- $system_variables[$row['id']] = $row;
- echo '<tr>';
- echo '<td>';
+ $system_variables[$row['id']] = $row;
+
+ echo '<div class="setting_item">';
+
$checked = (isset($mappingArray[$row['id']]) && $mappingArray[$row['id']] == 'email' )?' checked="checked"':'';
+
echo '<input type="radio" name="sysVarMap" id="sysVarMap_'.$row['id'].'" value="'.$row['id'].'"'.$checked.'>';
- echo '</td>';
- echo '<td><label for="sysVarMap_'.$row['id'].'"><span style="color: #78a971;">'.$row['variable'].'</span></label></td>';
- echo '<td><label for="sysVarMap_'.$row['id'].'">'.$row['naslov'].'</label></td>';
-
- echo '</tr>';
+ echo '<label for="sysVarMap_'.$row['id'].'"><span>'.$row['variable'].'</span>'.$row['naslov'].'</label>';
+
+ echo '</div>';
}
- echo '</table>';
- echo '<form/>';
- echo '<br/>';
- echo '<div id="inv_ValidateSysVarsMappingDiv">';
- echo '<span onclick="inv_ValidateSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_invitation_system_validate'].'</span></a></span>';
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div id="inv_ValidateSysVarsMappingDiv" class="button_holder below">';
+ echo ' <button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
echo '</div>';
- } else {
+ }
+ else {
echo '<span>'.$lang['srv_invitation_system_error3'].'</span>';
}
}
@@ -9718,7 +9707,8 @@ class SurveyInvitationsNew {
} else {
$errors[] = $lang['srv_invitation_system_error2'];
}
- } else {
+ }
+ else {
if ((int)$cntSistemske == 0) {
# ni sistemskih spremenljivk
@@ -9728,18 +9718,25 @@ class SurveyInvitationsNew {
$errors[] = $lang['srv_invitation_system_error4'];
}
}
- echo '<span onclick="inv_ValidateSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft spaceRight" ><a class="ovalbutton ovalbutton_gray" ><span>'.$lang['srv_invitation_system_validate'].'</span></a></span>';
- if (count($emailsToAdd)) {
- echo '<span onclick="inv_addSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft spaceRight" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_invitation_system_validateAndAdd'].'</span></a></span>';
+
+
+ echo '<button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
+
+ if (count($emailsToAdd)) {
+ echo '<button class="medium white-blue" onclick="inv_addSysVarsMapping();">'.$lang['srv_invitation_system_validateAndAdd'].'</button>';
}
- if (mysqli_num_rows($queryUser) > 0)
- { # če je kaj novih zapisov v bazi
-
- # če že imamo prejemnike v bazi ponudimo gumb naprej
- echo '<span class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" href="'.$this->addUrl('view_recipients').'"><span>'.$lang['srv_invitation_forward'].'</span></a></span>';
+
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ if (mysqli_num_rows($queryUser) > 0){
+ echo '<a href="'.$this->addUrl('view_recipients').'"><button class="medium blue">'.$lang['srv_invitation_forward'].'</button></a>';
+ }
+
+
+ echo '<div class="setting_holder">';
+
+ # če je kaj novih zapisov v bazi
+ if (mysqli_num_rows($queryUser) > 0){
- echo '<br class="clr"/>';
- echo '<br/>';
echo '<span class="strong">';
printf($lang['srv_invitation_system_found'],mysqli_num_rows($queryUser));
echo '</span>';
@@ -9757,12 +9754,13 @@ class SurveyInvitationsNew {
echo $lang['srv_invitation_system_from_this_invalid'].(int)count($invalidEmails);
}
}
- else
- {
+ else{
echo '<br class="clr"/>';
echo '<br/>';
echo $lang['srv_invitation_system_not_found'];
}
+
+ echo '</div>';
}
function addSysVarsMapping() {
global $lang,$global_user_id;
@@ -9803,7 +9801,7 @@ class SurveyInvitationsNew {
#dodamo respondenra in naredimo povezav
$sql_insert = "INSERT IGNORE INTO srv_invitations_recipients (ank_id,email,password,cookie,sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id,last_status) VALUES ";
$sql_insert .= "('".$this->sid."','$email','$pass','".$row['cookie']."'";
- $sql_insert .= ",'0','0','".(int)$row['unsubscribed']."','0',NOW(),'".$global_user_id."','".$list_id."','".$row['last_status']."')";
+ $sql_insert .= ",'0','0','".(int)$row['unsubscribed']."','0',NOW(),'".$global_user_id."','','".$row['last_status']."')";
$sqlQuery = sisplet_query($sql_insert);
if (!$sqlQuery) {
$error = mysqli_error($GLOBALS['connect_db']);
@@ -9911,22 +9909,22 @@ class SurveyInvitationsNew {
# echo '</span>';
echo $lang['srv_invitation_recipients_list_add'].':&nbsp;';
echo '<select id="sel_inv_list_type" onchange="inv_new_recipients_list_change(this);" autofocus="autofocus">';
- echo '<option value="0" class="gray bold"'.((int)$_POST['pid'] > 0 ? '' : ' selected="selected"' ).'>'.$lang['srv_invitation_new_list'].'</option>';
+ echo '<option value="0" class="gray bold"'.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? '' : ' selected="selected"' ).'>'.$lang['srv_invitation_new_list'].'</option>';
echo '<option value="-1" class="gray bold">'.$lang['srv_invitation_new_templist'].'</option>';
if (count($array_profiles) > 0){
foreach($array_profiles AS $key => $profile) {
- echo '<option value="'.$key.'" comment="'.$profile['comment'].'"'.($_POST['pid'] == $key ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
+ echo '<option value="'.$key.'" comment="'.$profile['comment'].'"'.(isset($_POST['pid']) && $_POST['pid'] == $key ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
}
}
echo '</select>';
- echo '<span id="new_recipients_list_span_note" '.((int)$_POST['pid'] < 1 ? ' class="displayNone"' : '' ).'>';
+ echo '<span id="new_recipients_list_span_note" '.(isset($_POST['pid']) && (int)$_POST['pid'] < 1 ? ' class="displayNone"' : '' ).'>';
echo '<br>';
echo '<br>';
- echo $lang[''].'Uporabniki bodo dodani v seznam: ';
- echo $array_profiles[$_POST['pid']]['name'];
+ echo 'Uporabniki bodo dodani v seznam: ';
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['name']) ? $array_profiles[$_POST['pid']]['name'] : '');
echo '<span id="new_recipients_list_span_note_name"></span>';
echo '</span>';
- echo '<span id="new_recipients_list_span" '.((int)$_POST['pid'] > 0 ? ' class="displayNone"' : '' ).'>';
+ echo '<span id="new_recipients_list_span" '.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? ' class="displayNone"' : '' ).'>';
echo '<br>';
echo '<br>';
@@ -9953,7 +9951,7 @@ class SurveyInvitationsNew {
echo '<br/><br/>';
echo $lang['srv_inv_recipient_list_comment'];
echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >';
- echo $array_profiles[$_POST['pid']]['comment'];
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['comment']) ? $array_profiles[$_POST['pid']]['comment'] : '');
echo '</textarea>';
echo '</div>';
@@ -10033,7 +10031,7 @@ class SurveyInvitationsNew {
#zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
$profileName = $lang['srv_inv_recipient_list_new'];
$names = array();
- $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%%' AND uid='$global_user_id'";
$q = sisplet_query($s);
while ($r = mysqli_fetch_assoc($q))
{
@@ -10134,12 +10132,13 @@ class SurveyInvitationsNew {
}
- function setAdvancedCondition()
+ public function setAdvancedConditionProfile($pid)
{
- global $lang;
- SurveySession::sessionStart($this->sid);
- SurveySession::set('invitationAdvancedConditionId', (int)$_POST['cid']);
- $this->invitationAdvancedConditionId = (int)$_POST['cid'];
+ $this->invitationAdvancedConditionProfileId = (int)$pid;
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
$this->viewRecipients();
}
@@ -10188,7 +10187,7 @@ class SurveyInvitationsNew {
unlink($dataFileName.'.tmp');
}
- if (is_array($invUsrId) && count($invUsrId) > 0){
+ if (isset($invUsrId) && is_array($invUsrId) && count($invUsrId) > 0){
return $invUsrId;
}
}
@@ -10200,17 +10199,20 @@ class SurveyInvitationsNew {
return array();
}
- function advancedCondition()
- {
+ function advancedCondition(){
global $lang;
- echo '<span id="conditionProfileNote" class="simple">';
+
+ echo '<div class="condition_holder" class="setting">';
+
+ echo '<div id="conditionProfileNote">';
+
echo $lang['srv_inv_condition_filter'].' ';
-
- if ((int)$this->invitationAdvancedConditionId > 0)
- {
- $scp = new SurveyCondition($this->sid);
- echo ' <strong>'.$scp->getConditionName((int)$this->invitationAdvancedConditionId).'</strong> ';
- $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
+
+ if ($this->invitationAdvancedConditionProfileId > 0){
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ echo '&nbsp;<strong>'.$scp->getCurentProfile()['name'].'</strong>&nbsp;';
+ /* $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
$note = $scp -> getConditionString($this->invitationAdvancedConditionId );
echo $note;
if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
@@ -10219,32 +10221,40 @@ class SurveyInvitationsNew {
else
{
}
- echo '<span class="as_link spaceLeft" onclick="showInvitationAdvancedConditions(\''.(int)$this->invitationAdvancedConditionId.'\'); return false;">'.$lang['srv_profile_edit'].'</span>';
- echo '<span class="as_link spaceLeft" onclick="invitationSetCondition(\'0\'); return false;">'.$lang['srv_profile_remove'].'</span>';
+ echo '<span onclick="showInvitationAdvancedConditions(\''.(int)$this->invitationAdvancedConditionId.'\'); return false;" title=""'.$lang['srv_profile_edit'].'"><span class="faicon edit"></span></span>';
+ echo '<span onclick="invitationSetCondition(\'0\'); return false;" title="'.$lang['srv_profile_remove'].'"><span class="faicon delete"></span></span></span>';
+ */
}
- else
- {
- echo '<strong>'.$lang['srv_inv_condition_no_filter'].'</strong>';
- echo '<a href="#" class="faicon if_add" onclick="showInvitationAdvancedConditions(); return false;" data-cid="'.(int)$this->invitationAdvancedConditionId.'">&nbsp;</a>';
+ else{
+ echo '<span>'.$lang['srv_inv_condition_no_filter'].'</span>';
}
- echo '</span>';
+
+ echo '<a href="#" class="faicon if_add" onclick="conditionProfileAction(\'showProfiles\');" data-cid="'.(int)$this->invitationAdvancedConditionId.'"></a>';
+
+
+ echo '</div>';
+
+ echo '</div>';
}
- function listCondition()
- {
+ function listCondition(){
global $lang;
+
# get all lists
$lists = $this->getSurveyInvitationLists(true);
$selected = (int)(isset($_SESSION['inv_filter']['list']) ? (int)$_SESSION['inv_filter']['list'] : -2);
- echo '&nbsp;';
- echo '<label>'.$lang['srv_invitation_recipients_filter_list'];
- echo '<select id="inv_rec_filter_list" onchange="inv_filter_recipients();">';
- foreach ($lists AS $list_id => $list)
- {
+
+ echo '<div class="setting">';
+
+ echo '<label>'.$lang['srv_invitation_recipients_filter_list'].'</label>';
+ echo '<select id="inv_rec_filter_list" class="dropdown small" onchange="inv_filter_recipients();">';
+ foreach ($lists AS $list_id => $list){
echo '<option value="'.$list_id.'"'.((int)$selected == $list_id ? ' selected="selected"' : '').'>'.$list['name'].'</option>';
}
- echo '</select></label>';
+ echo '</select>';
+
+ echo '</div>';
}
function getSurveyInvitationLists($add_all = false)
@@ -10268,7 +10278,7 @@ class SurveyInvitationsNew {
}
- function viewServerSettings(){
+ private function viewServerSettings(){
global $lang;
global $site_url;
global $site_url;
@@ -10276,7 +10286,6 @@ class SurveyInvitationsNew {
global $admin_type;
global $global_user_id;
global $mysql_database_name;
- global $aai_instalacija;
$row = SurveyInfo::getInstance()->getSurveyRow();
@@ -10301,15 +10310,17 @@ class SurveyInvitationsNew {
if($squalo->getSqualoEnabled()){
// Vklop squalo
- echo '<div class="squalo_switch"><p>';
+ echo '<div class="setting_holder squalo_switch">';
- echo '<span class="bold">'.$lang['srv_squalo'].':</span>&nbsp;';
+ echo ' <div class="setting_title">'.$lang['srv_squalo'].':</div>';
- echo '<input type="hidden" name="squalo_mode" value="0">';
- echo '<label><input type="checkbox" name="squalo_mode" id="squalo_mode" value="1" '.($squalo->getSqualoActive() ? 'checked ="checked" ' : '').' style="vertical-align:-2px;" onclick="squaloSwitch();">';
- echo $lang['srv_squalo_sending'].' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="hidden" name="squalo_mode" value="0">';
+ echo ' <input type="checkbox" name="squalo_mode" id="squalo_mode" value="1" '.($squalo->getSqualoActive() ? 'checked ="checked" ' : '').' onclick="squaloSwitch();">';
+ echo ' <label for="squalo_mode">'.$lang['srv_squalo_sending'].'</label>';
+ echo ' </div>';
- echo '</p></div>';
+ echo '</div>';
// Squalo nastavitve...
@@ -10325,55 +10336,78 @@ class SurveyInvitationsNew {
echo '<div class="mail_mode_switch '.($squalo->getSqualoActive() ? ' displayNone' : '').'">';
// Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
- echo '<p class="red bold">'.$lang['srv_email_server_settings_warning'].'</p>';
+
+ echo '<div class="setting_holder red">'.$lang['srv_email_server_settings_warning'].'</div>';
+
// Izbira SMTP streznika
- echo '<span class="bold">'.$lang['srv_email_setting_select_server'].'</span>&nbsp;';
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_email_setting_select_server'].'</div>';
// AAI ima Arnesov smtp
- if($aai_instalacija){
- echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
- echo $lang['srv_email_setting_adapter0_aai']. ' </label>';
+ if(isAAI()){
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0_aai'].'</label>';
+ echo ' </div>';
}
else{
- echo '<label><input type="radio" name="SMTPMailMode" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').hide();$(\'#send_mail_mode0\').show();">';
- echo $lang['srv_email_setting_adapter0']. ' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2, #send_mail_mode_test\').addClass(\'displayNone\'); $(\'#send_mail_mode0\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0'].'</label>';
+ echo ' </div>';
}
-
+
// Google smtp je viden samo starim, kjer je ze vklopljen
if($MA->isGoogle()){
- echo '<label><input type="radio" name="SMTPMailMode" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').hide(); $(\'#send_mail_mode1\').show();">';
- echo $lang['srv_email_setting_adapter1'].' </label>';
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_1" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').addClass(\'displayNone\'); $(\'#send_mail_mode1\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_1">'.$lang['srv_email_setting_adapter1'].'</label>';
+ echo ' </div>';
}
// Lastni smtp
- echo '<label><input type="radio" name="SMTPMailMode" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').hide(); $(\'#send_mail_mode2\').show();">';
- echo $lang['srv_email_setting_adapter2'].' </label>';
-
- echo Help :: display('srv_mail_mode');
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_2" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').addClass(\'displayNone\'); $(\'#send_mail_mode2, #send_mail_mode_test\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_2">'.$lang['srv_email_setting_adapter2'].' '.Help::display('srv_mail_mode').'</label>';
+ echo ' </div>';
echo '</div>';
#1KA
$enkaSettings = $MA->get1KASettings($raziskave=true);
+
echo '<div id="send_mail_mode0" '.(!$MA->is1KA() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
- echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span>';
- echo '<br />';
+
+ echo ' <div class="setting_holder semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<span>'.$enkaSettings['SMTPFrom'].'</span><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" disabled="disabled" value="'.$enkaSettings['SMTPFrom'].'"><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#delay
- echo '<p><label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').': <select name="SMTPDelay0">'
- /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
- . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
- . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
- . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
- . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
- . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay0">'
. '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
. '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
. '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
@@ -10382,80 +10416,168 @@ class SurveyInvitationsNew {
. '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
. '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
. '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
- . '</select></label>';
- echo '</p>';
+ . '</select>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
echo '</div>';
+
#GMAIL - Google
$enkaSettings = $MA->getGoogleSettings();
+
echo '<div id="send_mail_mode1" '.(!$MA->isGoogle() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
- echo '<br /><span class="italic">'.$lang['srv_email_setting_adapter1_note'].'</span><br />';
- echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span><br />';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="setting_item italic">'.$lang['srv_email_setting_adapter1_note'].'</div>';
+ echo ' <div class="setting_item semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom1" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" name="SMTPFrom1" value="'.(isset($enkaSettings['SMTPFrom'])?$enkaSettings['SMTPFrom']:'').'">';
+ echo ' </div>';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo1" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" name="SMTPReplyTo1" value="'.(isset($enkaSettings['SMTPReplyTo'])?$enkaSettings['SMTPReplyTo']:'').'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#Password
- echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
echo '</div>';
+
#SMTP
$enkaSettings = $MA->getSMTPSettings();
+
echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
- echo '<br /><span class="italic">'.$lang['srv_email_setting_adapter2_note'].'</span><br />';
- echo '<br /><span class="bold">'.$lang['srv_email_setting_settings'].'</span><br />';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="italic">'.$lang['srv_email_setting_adapter2_note'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# from - NICE
- echo '<p><label>'.$lang['srv_email_setting_from_nice'].'<input type="text" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from_nice'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'">';
+ echo ' </div>';
+
# from
- echo '<p><label>'.$lang['srv_email_setting_from'].'<input type="text" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
# replyTo
- echo '<p><label>'.$lang['srv_email_setting_reply'].'<input type="text" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#Username
- echo '<p><label>'.$lang['srv_email_setting_username'].'<input type="text" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_username'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'">';
+ echo ' </div>';
+
#Password
- echo '<p><label>'.$lang['srv_email_setting_password'].'<input type="password" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'"></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" class="medium" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#autentikacija
- echo '<p>';
- echo $lang['srv_email_setting_autentication'];
- echo '<label><input type="radio" name="SMTPAuth2" value="0" '.((int)$enkaSettings['SMTPAuth'] != 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_no'].'</label>';
- echo '<label><input type="radio" name="SMTPAuth2" value="1" '.((int)$enkaSettings['SMTPAuth'] == 1 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_yes'].'</label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_autentication'].':</label>';
+ echo ' <select class="dropdown medium" name="SMTPAuth2">'
+ . '<option value="0" '.((int)$enkaSettings['SMTPAuth']!="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_no'].'</option>'
+ . '<option value="1" '.((int)$enkaSettings['SMTPAuth']=="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_yes'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
#Varnost SMTPSecure
- echo '<p>';
- echo $lang['srv_email_setting_encryption'];
- echo '<label><input type="radio" name="SMTPSecure2" value="0" '.((int)$enkaSettings['SMTPSecure'] == 0 ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_none'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="ssl" '.($enkaSettings['SMTPSecure'] == 'ssl' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_ssl'].'</label>';
- echo '<label><input type="radio" name="SMTPSecure2" value="tls" '.($enkaSettings['SMTPSecure'] == 'tls' ? 'checked ="checked" ' : '').'>';
- echo $lang['srv_email_setting_encryption_tls'].'</label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_encryption'].'</label>';
+ echo ' <select class="dropdown medium" name="SMTPSecure2">'
+ . '<option value="0" '.($enkaSettings['SMTPSecure']=="0" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_none'].'</option>'
+ . '<option value="ssl" '.($enkaSettings['SMTPSecure']=="ssl" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_ssl'].'</option>'
+ . '<option value="tls" '.($enkaSettings['SMTPSecure']=="tls" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_tls'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
#port
- echo '<p><label>'.$lang['srv_email_setting_port'].'<input type="number" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'" style="width:80px;"></label>';
- echo ' '.$lang['srv_email_setting_port_note'];
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_port'].$lang['srv_email_setting_port_note'].':</label>';
+ echo ' <input type="number" class="medium" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'">';
+ echo ' </div>';
+
#host
- echo '<p><label>'.$lang['srv_email_setting_host'].'<input type="text" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'" ></label>';
- echo '</p>';
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_host'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<div class="setting_holder half-half">';
+
#delay
- echo '<p><label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').': <select name="SMTPDelay2">'
- /*. '<option value="0" '.($enkaSettings['SMTPDelay']=="0"?'selected="selected"':'') .'>0 </option>'
- . '<option value="10000" '.($enkaSettings['SMTPDelay']=="10000"?'selected="selected"':'') .'>0.01 sec (max 100 / sec)</option>'
- . '<option value="20000" '.($enkaSettings['SMTPDelay']=="20000"?'selected="selected"':'') .'>0.02 sec (max 50 / sec)</option>'
- . '<option value="50000" '.($enkaSettings['SMTPDelay']=="50000"?'selected="selected"':'') .'>0.05 sec (max 20 / sec)</option>'
- . '<option value="100000" '.($enkaSettings['SMTPDelay']=="100000"?'selected="selected"':'') .'>0.1 sec (max 10 / sec)</option>'
- . '<option value="200000" '.($enkaSettings['SMTPDelay']=="200000"?'selected="selected"':'') .'>0.2 sec (max 5 / sec)</option>'*/
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay2">'
. '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
. '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
. '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
@@ -10464,27 +10586,33 @@ class SurveyInvitationsNew {
. '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
. '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
. '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
- . '</select></label>';
- echo '</p>';
+ . '</select>';
+
+ echo ' </div>';
echo '</div>';
-
+
+ echo '</div>';
+
+
+ echo '</div>';
+
echo '</form>';
-
- echo '<br class="clr" />';
+
+
+ echo '<div class="button_holder below float-right">';
// Gumb shrani
- echo '<span class="floatRight" ><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="document.settingsanketa_' . $row['id'] . '.submit(); return false;">';
- echo $lang['srv_email_setting_btn_save'] . '</a></div></span>';
+ echo '<button class="white-black medium" onclick="document.settingsanketa_'.$row['id'].'.submit(); return false;">'.$lang['srv_email_setting_btn_save'].'</button>';
// Gumb preveri nastavitve
- echo '<span id="send_mail_mode_test" class="floatRight spaceRight '.($squalo->getSqualoActive() ? ' displayNone' : '').'"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_green" href="#" onclick="showTestSurveySMTP(); return false;">';
- echo $lang['srv_email_setting_btn_test'].'</a></div></span>';
+ echo '<button id="send_mail_mode_test" class="white-blue medium '.($squalo->getSqualoActive() || $MA->is1KA() ? ' displayNone' : '').'" onclick="showTestSurveySMTP(); return false;">'.$lang['srv_email_setting_btn_test'].'</button>';
+
+ echo '</div>';
- if ($_GET['s'] == '1') {
- echo '<div id="success_save" style="float:left; display:inline; margin: -2px 0 0 0;"></div>';
- echo '<script type="text/javascript">$(document).ready(function() {show_success_save();});</script>';
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
}
}
@@ -10515,20 +10643,27 @@ class SurveyInvitationsNew {
private function showAAISmtpPopup(){
global $lang;
- echo '<div class="popup_close"><a href="#" onClick="quick_title_edit_cancel(); return false;">✕</a></div>';
+ echo '<div class="popup_close"><a href="#" onClick="smtpAAIPopupClose(); return false;">✕</a></div>';
echo '<h2>'.$lang['srv_email_setting_adapter0_aai_title'].'</h2>';
echo '<div class="popup_content">';
- echo $lang['srv_email_setting_adapter0_aai_popup'];
- echo '<br /><br />';
- echo '<input type="checkbox" id="aai_smtp_checkbox" name="aai_smtp_checkbox" class="pointer" onClick="smtpAAIAccept();">';
- echo ' <label for="aai_smtp_checkbox"><b>'.$lang['srv_email_setting_adapter0_aai_popup2'].'</b></label>';
+ echo '<p class="bottom16">'.$lang['srv_email_setting_adapter0_aai_popup'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="aai_smtp_checkbox" name="aai_smtp_checkbox" class="pointer" onClick="smtpAAIAccept();">';
+ echo '<label for="aai_smtp_checkbox" class="semi-bold">'.$lang['srv_email_setting_adapter0_aai_popup2'].'</label>';
+ echo '</div>';
+
echo '</div>';
echo '<div class="buttons_holder">';
- echo '<span class="buttonwrapper floatRight spaceLeft" id="aai_smtp_button" style="display:none;" title="'.$lang['srv_save_profile_yes'].'"><a class="ovalbutton ovalbutton_orange" href="#" onClick="smtpAAISet(); return false;"><span>'.$lang['srv_save_profile_yes'].'</span></a></span>';
- echo '<span class="buttonwrapper floatRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="smtpAAIPopupClose(); return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="smtpAAIPopupClose(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" id="aai_smtp_button" style="display:none;" title="'.$lang['srv_save_profile_yes'].'" onclick="smtpAAISet(); return false;">'.$lang['srv_save_profile_yes'].'</button>';
+ echo '</div>';
+
echo '</div>';
}
}
diff --git a/admin/survey/classes/surveyEmails/class.SurveyInvitationsOld.php b/admin/survey/classes/surveyEmails/class.SurveyInvitationsOld.php
new file mode 100644
index 0000000..4159629
--- /dev/null
+++ b/admin/survey/classes/surveyEmails/class.SurveyInvitationsOld.php
@@ -0,0 +1,10670 @@
+<?php
+# mysql_real_unescape_string
+/** Class ki skrbi za različna vabila
+ * Julij 2011
+ *
+ *
+ * Enter description here ...
+ * @author Gorazd_Veselic
+ *
+ */
+
+define('GROUP_PAGINATE', 4); # po kolko strani grupira pri paginaciji
+define('REC_ON_PAGE', 10); # kolko zapisov na stran pri urejanju respondentov
+define('REC_ON_SEND_PAGE', 20); # kolko zapisov na stran pri pošiljanju
+define('NOTIFY_INFO1KA', 5); # Nad koliko emaili obveščamo info@1ka.si
+
+set_time_limit(2400); # 30 minut
+
+class SurveyInvitationsOld {
+
+
+ private $sid;
+ private $count_all = 0; # koliko prejemnikov je v bazi
+ private $surveySettings; # zakeširamo nastavitve ankete
+ private $rec_send_page_limit = 20; # Koliko zapisov imamo za paginacijo
+
+ private $inv_variables = array('email','password','ime','priimek','naziv','telefon','drugo','odnos');
+ private $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');
+ private $inv_variables_excel = 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'
+ ,'date_inserted'=>'date_inserted','date_sent'=>'date_sent','date_responded'=>'date_responded','date_unsubscribed'=>'date_unsubscribed','list_name'=>'list_name');
+ private $inv_variables_tel_excel = array('status'=>'status','email'=>'email','geslo'=>'password','ime'=>'firstname','priimek'=>'lastname','naziv'=>'salutation','telefon'=>'phone','drugo'=>'custom','odnos'=>'relation','call_time'=>'call_time','last_status'=>'last_status'
+ ,'comment'=>'comment','date_inserted'=>'date_inserted','list_name'=>'list_name');
+
+ #private $inv_sys_db_map = array('email'=>'email','password'=>'geslo','firstname'=>'ime','lastname'=>'priimek','salutation'=>'naziv','phone'=>'telefon','custom'=>'drugo');
+
+ private $invitationAdvancedConditionId = 0;
+ private $invitationAdvancedConditionProfileId = 0;
+ private $user_inv_ids = array();
+
+ private $db_table = '';
+
+
+ function __construct($sid) {
+
+ $this->sid = $sid;
+
+ SurveyInfo::SurveyInit($this->sid);
+
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+
+ $this->surveySettings = SurveyInfo::getInstance()->getSurveyRow();
+
+ # koliko respondentov je že v bazi
+ $sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
+ $sql_row_all = mysqli_fetch_row($sql_query_all);
+ $this->count_all = (int)$sql_row_all[0];
+
+ SurveyDataSettingProfiles :: Init($this->sid);
+
+ if (isset($_SESSION['rec_on_send_page']) && (int)$_SESSION['rec_on_send_page'] > 0) {
+ $this->rec_send_page_limit = (int)$_SESSION['rec_on_send_page'];
+ }
+ else {
+ $this->rec_send_page_limit = REC_ON_SEND_PAGE;
+ }
+
+ $this->invitationAdvancedConditionProfileId = SurveyUserSetting :: getInstance()->getSettings('default_condition_profile');
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
+ SurveySession::sessionStart($this->sid);
+ }
+
+ function ajax() {
+
+ if (isset($_REQUEST['a']) && trim($_REQUEST['a']) != '') {
+ if (isset($_POST['recipients_list']) && $_POST['recipients_list'] != null) {
+ $_POST['recipients_list'] = mysql_real_unescape_string($_POST['recipients_list']);
+ }
+
+ if (isset($_POST['fields']) && $_POST['fields'] != null) {
+ $_POST['fields'] = mysql_real_unescape_string($_POST['fields']);
+ }
+
+ $this->action($_REQUEST['a']);
+ }
+ else {
+ echo 'Ajax error!';
+ return 'Ajax error!';
+ }
+ }
+
+ function action($action) {
+ global $lang;
+ global $site_url;
+ global $global_user_id;
+
+ $NoNavi = isset($_POST['noNavi']) ? $_POST['noNavi'] : '';
+
+ if ($action == 'inv_lists') {
+ #$NoNavi = true;
+ }
+ if ($action == 'view_archive') {
+ $NoNavi = true;
+ }
+
+ if ($NoNavi == false) {
+ $this->displayNavigation();
+ }
+
+ // Warning za nastavitev streznika
+ $MA = new MailAdapter($this->sid, $type='invitation');
+ if(!$MA->is1KA()){
+
+ if($MA->isGoogle())
+ $mail_settings = $MA->getGoogleSettings();
+ else
+ $mail_settings = $MA->getSMTPSettings();
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+ if( (empty($mail_settings) || $mail_settings['SMTPFrom'] == '' || $mail_settings['SMTPUsername'] == '')
+ && $userAccess->checkUserAccess($what='invitations')
+ && $isEmail ){
+
+ // Gorenje tega nima
+ if (!Common::checkModule('gorenje')){
+
+ // Pri ajax klicih nikoli tega ne izpišemo, ravno tako ne izpisujemo, ce imamo vklopljeno posiljanje brez emaila (navadna posta, sms)
+ $noEmailing = SurveySession::get('inv_noEmailing');
+ if($NoNavi == false && $noEmailing != 1){
+ echo '<div id="email_server_warning" class="top_note">';
+
+ echo '<div class="title"><span class="faicon warning icon-orange"></span> '.$lang['srv_invitation_server_warning'].'</div>';
+ //if($action != 'inv_settings')
+ echo '<span class="spaceLeft"><a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a></span>';
+
+ echo '</div>';
+ }
+ }
+ }
+ }
+
+ if ($action == M_INVITATIONS) {
+ $this->useRecipientsList();
+ }
+ else if ($action == 'add_recipients_view') {
+ $this->useRecipientsList();
+ }
+ else if ($action == 'add_recipients') {
+ $this->addRecipients();
+ }
+ else if ($action == 'view_recipients') {
+ $this->viewRecipients();
+ }
+ else if ($action == 'view_message') {
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->viewMessage($mid);
+ }
+ else if ($action == 'make_default') {
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultMessage($mid);
+ }
+ else if ($action == 'make_default_from_preview') {
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->makeDefaultFromPreview($mid);
+ }
+ else if ($action == 'save_message_simple') {
+ $this->save_message_simple();
+ }
+ else if ($action == 'save_message_simple_noEmail') {
+ $this->save_message_simple_noEmail();
+ }
+ else if ($action == 'send_message') {
+ $mid = isset($_POST['mid']) ? $_POST['mid'] : null;
+ $this->sendMessage($mid);
+ }
+ else if ($action == 'view_archive') {
+ $this->viewAarchive();
+ }
+ else if ($action == 'view_send_recipients') {
+ if(isset($_POST['noMailing']) && $_POST['noMailing'] == '1')
+ $this->selectSendToNoEmailing();
+ else
+ $this->selectSendTo();
+ }
+ else if ($action == 'mailToSourceChange') {
+ $this->mailToSourceChange();
+ }
+ else if ($action == 'send_mail') {
+
+ // Posiljanje brez emailov (samo aktivacija prejemnikov)
+ if(isset($_GET['noemailing']) && $_GET['noemailing'] == '1'){
+ $this->sendMailNoEmailing();
+ }
+ // Klasicno posiljanje preko smtp-ja
+ else{
+ $this->sendMail();
+ }
+ }
+ else if ($action == 'upload_recipients') {
+ $this->uploadRecipients();
+ }
+ else if ($action == 'view_archive_recipients') {
+ $this->viewArchiveRecipients();
+ }
+ else if ($action == 'edit_archive_comment') {
+ $this->editArchiveComment();
+ }
+ else if ($action == 'delete_recipient_confirm') {
+ $this->deleteRecipientConfirm();
+ }
+ else if ($action == 'delete_recipient') {
+ $this->deleteRecipient();
+ }
+ else if ($action == 'delete_recipient_single') {
+ $this->deleteRecipientSingle();
+ }
+ else if ($action == 'delete_recipient_all') {
+ $this->deleteRecipientAll();
+ }
+ else if ($action == 'export_recipients') {
+ $this->exportRecipients();
+ }
+ else if ($action == 'export_recipients_all') {
+ $this->exportRecipients_all();
+ }
+ else if ($action == 'export_recipients_qr_codes') {
+ $this->exportRecipients_qr_codes();
+ }
+ else if ($action == 'use_recipients_list') {
+ $this->useRecipientsList();
+ }
+ else if ($action == 'change_import_type') {
+ $this->changeImportType();
+ }
+ else if ($action == 'save_recipient_list') {
+ $this->saveRecipientList();
+ }
+ else if ($action == 'get_profile_name') {
+ echo "DEPRECATED!";
+ die();
+ $this->getProfileName();
+ }
+ else if ($action == 'list_get_name') {
+ $this->listGetName();
+ }
+ else if ($action == 'invListEdit') {
+ $this->invListEdit();
+ }
+ else if ($action == 'save_rec_profile') {
+ $this->saveRecProfile();
+ }
+ else if ($action == 'delete_rec_profile') {
+ $this->deleteRecProfile();
+ }
+ else if ($action == 'edit_rec_profile') {
+ $this->editRecProfile();
+ }
+ else if ($action == 'update_rec_profile') {
+ $this->updateRecProfile();
+ }
+ else if ($action == 'delete_msg_profile') {
+ $this->deleteMsgProfile();
+ }
+ else if ($action == 'message_rename') {
+ $this->messageRename();
+ }
+ else if ($action == 'show_message_rename') {
+ $this->showMessageRename();
+ }
+ else if ($action == 'edit_recipient') {
+ $this->editRecipient();
+ }
+ else if ($action == 'save_recipient') {
+ $this->saveRecipient();
+ }
+ else if ($action == 'set_recipient_filter') {
+ $this->setRecipientFilter();
+ }
+ else if ($action == 'only_this_survey') {
+ $this->onlyThisSurvey();
+ }
+ else if ($action == 'add_users_to_database') {
+ $this->add_users_to_database();
+ }
+ else if ($action == 'add_checked_users_to_database') {
+ $this->add_checked_users_to_database();
+ }
+ else if ($action == 'arch_save_comment') {
+ $this->saveArchiveComment();
+ }
+ else if ($action == 'edit_message_details') {
+ $this->editMessageDetails();
+ }
+ else if ($action == 'message_save_details') {
+ $this->messageSaveDetails();
+ }
+ else if ($action == 'message_save_forward') {
+ $this->messageSaveforward();
+ }
+ else if ($action == 'message_save_forward_noEmail') {
+ $this->messageSaveforwardNoEmail();
+ }
+ else if ($action == 'prepare_save_message') {
+ $this->prepareSaveMessage();
+ }
+ else if ($action == 'showRecipientTracking') {
+ $this->showRecipientTracking();
+ }
+ else if ($action == 'arch_show_recipients') {
+ $this->showArchiveRecipients();
+ }
+ else if ($action == 'arch_show_details') {
+ $this->showArchiveDetails();
+ }
+ else if ($action == 'arch_edit_details') {
+ $this->editArchiveDetails();
+ }
+ else if ($action == 'inv_status') {
+ $this->showInvitationStatus();
+ }
+ else if ($action == 'inv_lists') {
+ $this->showInvitationLists();
+ }
+ else if ($action == 'inv_list_save') {
+ $this->listSave();
+ }
+ else if ($action == 'invListSaveOld') {
+ $this->invListSaveOld();
+ }
+ else if ($action == 'invListEditSave') {
+ $this->invListEditSave();
+ }
+ else if ($action == 'editRecList') {
+
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
+
+ if ($doEdit) {
+ $this->showEditRecList();
+ }
+ else {
+ $this->showNoEditRecList();
+ }
+ }
+ else if ($action == 'deleteRecipientsList') {
+ $this->deleteRecipientsList();
+ }
+ else if($action == 'deleteRecipientsListMulti'){
+ $this->deleteRecipientsListMulti();
+ }
+ else if ($action == 'showInvitationListsNames') {
+ $this->showInvitationListsNames();
+ }
+ else if ($action == 'changeInvRecListEdit') {
+ $this->changeInvRecListEdit();
+ }
+ else if ($action == 'upload_list') {
+ $this->upload_list();
+ }
+ else if ($action == 'send_upload_list') {
+ $this->send_upload_list();
+ }
+ else if ($action == 'changePaginationLimit') {
+ $this->changePaginationLimit();
+ }
+ else if ($action == 'setSortField') {
+ $this->setSortField();
+ }
+ else if ($action == 'validateSysVarsMapping') {
+ $this->validateSysVarsMapping();
+ }
+ else if ($action == 'addSysVarsMapping') {
+ $this->addSysVarsMapping();
+ }
+ else if ($action == 'recipientsAddForward') {
+ $this->recipientsAddForward();
+ }
+ else if ($action == 'showAdvancedConditions') {
+ $this->showAdvancedConditions();
+ }
+ else if ($action == 'setAdvancedCondition') {
+ $this->setAdvancedConditionProfile($_POST['pid']);
+ }
+ else if ($action == 'inv_server') {
+ $this->viewServerSettings();
+ }
+ else if ($action == 'inv_settings') {
+ $this->showInvitationSettings();
+ }
+ else if ($action == 'set_noEmailing') {
+ $this->setNoEmailing();
+ }
+ else if ($action == 'set_noEmailing_type') {
+ $this->setNoEmailingType();
+ }
+ else if ($action == 'showAAISmtpPopup') {
+ $this->showAAISmtpPopup();
+ }
+ else {
+ $sql = sisplet_query("SELECT EXISTS (SELECT 1 FROM srv_invitations_archive WHERE ank_id='".$this->sid."')");
+ $row = mysqli_fetch_array($sql);
+
+ // Ce imamo ze posiljanje je default stran "Pregled"
+ if($row[0] == 1)
+ $this->showInvitationStatus();
+ // Ce se nimamo nobenega posiljanja je default stran "Nastavitve"
+ else
+ $this->showInvitationSettings();
+ }
+ }
+
+ function addRecipients() {
+ global $lang,$global_user_id;
+ # dodamo uporabnike
+ $fields = $_POST['fields'];
+ $recipients_list = $this->getCleanString($_POST['recipients_list']);
+
+ $new_profile_id = (int)$_POST['pid'];
+
+ # če so bile spremembe v profilu ga shranimo kot novega
+ list($old_recipients_list,$old_fields) = $this->getRecipientsProfile((int)$_POST['pid']);
+ $old_recipients_list = $old_recipients_list != '' ? implode("\n", $old_recipients_list) : $old_recipients_list;
+ $new_recipients_list = str_replace("\n\r", "\n", $recipients_list);
+ $old_fields = implode(",", $old_fields);
+ $new_fields = implode(",", $fields);
+
+ if ($_POST['save_profile'] == 'true' && ($old_recipients_list !== $new_recipients_list || $old_fields !== $new_fields)) {
+
+ # shranjujemo v nov profil
+ $post_fields = str_replace('inv_field_','',implode(',',$_POST['fields']));
+ $post_recipients = $this->getCleanString($_POST['recipients_list']);
+
+ #zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
+ $new_name = $lang['srv_inv_recipient_list_new'];
+ $names = array();
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $q = sisplet_query($s);
+ while ($r = mysqli_fetch_assoc($q)) {
+ $names[] = $r['name'];
+ }
+ if (count($names) > 0) {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_recipient_list_new'].$cnt, $names)) {
+ $cnt++;
+ }
+ $new_name = $lang['srv_inv_recipient_list_new'].$cnt;
+ }
+
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles".
+ " (name,uid,fields,respondents,insert_time,comment, from_survey) ".
+ " VALUES ('$new_name', '$global_user_id', '$post_fields', '$post_recipients', NOW(), '', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ echo 'Napaka!';
+ } else {
+ $new_profile_id = mysqli_insert_id($GLOBALS['connect_db']);
+ }
+ sisplet_query("COMMIT");
+ }
+
+ #dodamo polja
+
+ $result = $this->addMassRecipients($recipients_list, $fields, $new_profile_id);
+
+
+ /*
+ # ni sprememb shranimo v sejo
+ $this->saveSessionRecipients($recipients_list, $fields, $profile_comment);
+ */
+ # prikažemo napake
+ $invalid_recipiens_array = $this->displayRecipentsErrors($result);
+
+ # po novem gremo na respondente
+ $this->viewRecipients();
+
+ return ;
+ }
+
+ function saveSessionRecipients($recipients_list, $fields, $profile_comment=null ) {
+ global $lang;
+ # polja
+ $field_list = (isset($_POST['field_list']) && trim($_POST['field_list']) != '') ? trim($_POST['field_list']) : 'email';
+
+
+ # shranimo v začasni profil
+ $new_recipients = str_replace("\n\r", "\n", $recipients_list);
+ $new_recipients = explode("\n",$new_recipients);
+
+ session_start();
+ if (is_array($_SESSION['inv_rec_profile'][$this->sid]['respondents'])) {
+ $old_recipients = str_replace("\n\r", "\n", $_SESSION['inv_rec_profile'][$this->sid]['respondents']);
+ $old_recipients = explode("\n",$old_recipients);
+ $new_recipients = array_unique(array_merge($old_recipients, $new_recipients));
+ }
+
+ if (is_array($new_recipients)) {
+ $recipients_list = implode("\n",$new_recipients);
+ } else {
+ $recipients_list = '';
+ }
+ $_SESSION['inv_rec_profile'][$this->sid] = array(
+ 'pid'=>-1,
+ 'name'=>$lang['srv_invitation_new_templist'],
+ 'fields'=>$field_list,
+ 'respondents'=>$recipients_list,
+ 'comment'=>$profile_comment
+ );
+ }
+
+ function changeImportType() {
+ $this->displayAddRecipientsView();
+ }
+
+ #prikažemo vmesnik za dodajanje respondentov
+ function addRecipientsView( $fields = array(), $recipients_list=null) {
+ global $lang;
+ global $site_url;
+
+ $noEmailing = SurveySession::get('inv_noEmailing');
+
+ $row = $this->surveySettings;
+
+
+ echo '<div class="invitations_top_settings">';
+
+ // Text s podatki o nastavitvah posiljanja
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+ if($individual == 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($noEmailing == 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($row['usercode_required'] == 0 && $individual != 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_1'];
+
+ if($row['usercode_skip'] == 1 || $individual == 0){
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
+ }
+ else{
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_1'].')</span>';
+ }
+ }
+
+ $settings_text .= ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
+
+ echo $settings_text;
+
+ echo '<div id="srv_invitation_note">';
+ echo $lang['srv_invitation_num_respondents'].(int)$this->count_all;
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '<div id="inv_import" class="invitations_holder left-menu invitations_add">';
+ $this->displayAddRecipientsView($fields, $recipients_list);
+ echo '</div>'; # id="inv_import"
+ }
+
+ function displayAddRecipientsView( $fields = array(), $recipients_list=null) {
+ global $lang, $site_path, $site_url;
+
+ $field_list = array();
+
+ # odvisno od tipa sporočil prikažemo različna polja
+ # Personalizirano e-poštno vabilo
+
+ // Ce ne posiljamo z emailom sta default polja ime in priimek
+ $noEmailing = SurveySession::get('inv_noEmailing');
+ if($noEmailing == 1){
+ $default_fields = array(
+ 'inv_field_email' => 0,
+ 'inv_field_firstname' => 1,
+ 'inv_field_lastname' => 1,
+ 'inv_field_password' => 0,
+ 'inv_field_salutation' => 0,
+ 'inv_field_phone' => 0,
+ 'inv_field_custom' => 0,
+ );
+ }
+ else{
+ $default_fields = array(
+ 'inv_field_email' => count($fields) == 0 ? 1 : 0,
+ 'inv_field_firstname' => 0,
+ 'inv_field_lastname' => 0,
+ 'inv_field_password' => 0,
+ 'inv_field_salutation' => 0,
+ 'inv_field_phone' => 0,
+ 'inv_field_custom' => 0,
+ );
+ }
+
+ // Ce imamo modul 360 imamo tudi odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ $default_fields['inv_field_relation'] = 0;
+ }
+
+ # skreiramo nov vrstni red polj
+ if (count($fields) > 0) {
+ foreach ($fields as $key=>$field) {
+ $field_list[$field] = 1;
+ if (isset($default_fields[$field])) {
+ unset($default_fields[$field]);
+ }
+ }
+ }
+
+ if (count($default_fields) > 0) {
+ foreach ($default_fields as $key =>$field) {
+ $field_list[$key] = $field;
+ unset($default_fields[$key]);
+ }
+ }
+ $import_type = isset($_POST['import_type']) ? (int)$_POST['import_type'] : 2;
+ session_start();
+ $checked = (isset($_SESSION['inv_rec_only_this_survey']) && (int)$_SESSION['inv_rec_only_this_survey'] == 1) ? '1' : '0';
+
+
+ # profili respondentov
+ echo '<fieldset id="inv_recipients_profiles_holder" class="left_holder">';
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="0" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '0' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' </div>';
+ echo ' <div class="setting_item">';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="1" onclick="recipientsProfileOnlyThisSurvey();"'.($checked == '1' ? ' checked="checked"':'').' autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '<span>'.$lang['srv_inv_recipient_select_list'].'</span>';
+
+ $this->listRecipientsProfiles();
+
+ # podatki o profilu
+ $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
+
+ echo '<div class="info">';
+
+ if ((int)$ppid > 0) {
+ # polovimo podatke profila
+ $sql_string = "SELECT rp.*, u.name, u.surname FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.pid = '".(int)$ppid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_inv_recipiens_list_created_by'].implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_inv_recipiens_list_created_day'].date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ echo '<div title="'.$sql_row['comment'].'" style="max-width:202px;">'.$lang['srv_inv_recipiens_list_comment'].trim (strip_tags($sql_row['comment'])).'</div>';
+
+ }
+ else {
+ echo '<div>'.$lang['srv_inv_recipiens_temporary_list'].'</div>';
+ }
+
+ echo '</div>';
+
+ echo '</fieldset>'; # id=inv_recipients_profiles_holder
+
+
+ echo '<fieldset id="inv_import_list_container" class="right_holder">';
+
+ $sysUserToAdd = 0;
+ $sqlSysMapping = sisplet_query("SELECT * FROM srv_invitations_mapping WHERE sid = '$this->sid'");
+ if (mysqli_num_rows($sqlSysMapping) > 0) {
+ $sysUserToAddQuery = sisplet_query("SELECT count(*) FROM srv_user where ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0'");
+ list($sysUserToAdd) = mysqli_fetch_row($sysUserToAddQuery);
+ }
+
+
+ echo '<div class="setting_holder">';
+
+ echo '<div class="setting_title">'.$lang['srv_inv_recipiens_from'].' '.Help::display('inv_recipiens_from_system').':</div>';
+
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type2" type="radio" value="2" onclick="inv_change_import_type();"'.($import_type == 2 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type2">'.$lang['srv_inv_recipiens_from_list'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type1" type="radio" value="1" onclick="inv_change_import_type();"'.($import_type == 1 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type1">'.$lang['srv_inv_recipiens_from_file'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo ' <input name="inv_import_type" id="inv_import_type3" type="radio" value="3" onclick="inv_change_import_type();"'.($import_type == 3 ? ' checked="checked"' : '').' autocomplete="off"><label for="inv_import_type3">'.$lang['srv_inv_recipiens_from_system'].($sysUserToAdd > 0 ? ' ('.$sysUserToAdd.')' : '').'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+
+ if ($import_type == 3) {
+ $this->createSystemVariablesMapping();
+ }
+ else {
+
+ # sporočilo za personalizirana e-vabila in respondente iz baze
+ echo '<div class="setting_holder">';
+ echo '<span>'.$lang['srv_inv_recipiens_field_note'].'</span>';
+ echo '</div>';
+
+
+ echo '<div id="inv_field_container">';
+
+ echo '<ul class="connectedSortable">';
+ $field_lang = array();
+ if (count($field_list ) > 0) {
+ foreach ($field_list AS $field => $checked) {
+
+ $is_selected = ($checked == 1 ) ? true : false;
+
+ # če je polje obkljukano
+ $css = $is_selected ? ' class="inv_field_enabled"' : '';
+
+ $label_for = ' for="'.$field.'_chk"';
+
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj') && $field == 'inv_field_relation')
+ echo '<br />';
+
+ echo '<li id="'.$field.'"'.$css.'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
+ echo '</li>';
+
+ if ($is_selected == 1) {
+ $field_lang[] = $lang['srv_'.$field];
+ }
+ }
+ }
+ echo '</ul>';
+ echo '</div>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
+
+ # IZ SEZNAMA
+ echo '<div id="inv_import_list" '.($import_type != 1 ? '' : 'class="displayNone"').'>' ;
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_email_note'].'</div>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo '<div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo '<div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="semi-bold inv_type_0">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
+
+ // Opozorilo za limit znakov pri passwordu (20)
+ echo '<div id="inv_field_list_warning" class="setting_line red" style="display:none;">';
+ echo $lang['srv_inv_recipiens_pass_warning'];
+ echo '</div>';
+
+ // delimiter
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_list_delimiter'].'</label>';
+ echo ' <input id="recipientsDelimiter1" type="radio" ' .(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'') .' value="," name="recipientsDelimiter"><label for="recipientsDelimiter1">' .$lang['srv_inv_recipient_delimiter_comma'] .' (,)</label>';
+ echo ' <input id="recipientsDelimiter2" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'') .' value=";" name="recipientsDelimiter"><label for="recipientsDelimiter2">' .$lang['srv_inv_recipient_delimiter_semicolon'] .' (;) </label>';
+ echo ' <input id="recipientsDelimiter3" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'') .' value="|" name="recipientsDelimiter"><label for="recipientsDelimiter3">' .$lang['srv_inv_recipient_delimiter_pipe'] .' (|)</label>';
+ echo ' <input id="recipientsDelimiter4" type="radio" ' .(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'') .' value="|~|" name="recipientsDelimiter"><label for="recipientsDelimiter4">' .$lang['srv_inv_recipient_delimiter_1KA'] .' (|~|)</label>';
+ echo '</div>';
+
+ // Vnosno polje
+ echo '<div class="setting_line">';
+ echo ' <label for="inv_recipients_list">'.$lang['srv_inv_recipiens_insert'].':</label>';
+ echo ' <textarea id="inv_recipients_list" name="inv_recipients_list">';
+ if (is_array($recipients_list) && count($recipients_list) > 0 ) {
+ echo implode("\n",$recipients_list);
+ }
+ echo ' </textarea>';
+ echo '</div>';
+
+
+ // Checkbox dodaj seznam v anketo
+ echo '<div class="setting_line">';
+ echo ' <input type="checkbox" id="inv_recipients_add" value="1" checked="checked"><label for="inv_recipients_add">'.$lang['srv_invitation_recipients_add_type4'].'</label>';
+ echo '</div>';
+
+
+ echo '<div id="div_inv_recipients_rename_list_type" class="displayNone setting_line">';
+ $this->saveRecipientListName();
+ echo '</div>';
+
+
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="blue medium" onclick="invRecipientsForward(); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id=inv_import_list
+
+
+ # IZ DATOTEKE
+ echo '<div id="inv_import_file"'.($import_type == 1 ? '' : ' class="displayNone"').'>' ;
+
+ echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=upload_recipients" autocomplete="off">';
+ echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
+ echo '<input type="hidden" name="posted" value="1" />';
+
+ echo '<div class="setting_line inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</div>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_inv_recipiens_fields'];
+ echo ' <span id="inv_field_list" class="inv_type_1">'.implode(',',$field_lang).'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo $lang['srv_mailing_upload_list'];
+ echo '<br><input type="file" name="recipientsFile" id="recipientsFile" size="42">';
+ /* if (count($errors) > 0) {
+ echo '<br class="clr" />';
+ echo '<span class="inv_error_note">';
+ foreach($errors as $error) {
+ echo '* '.$error.'<br />';
+ }
+ echo '</span>';
+ } */
+ echo '</div>';
+
+ echo '<div class="setting_line">';
+ echo ' <label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1_import" value="," '.(!isset ($_POST['recipientsDelimiter']) || $_POST['recipientsDelimiter']==","?'checked="checked"':'').'><label for="recipientsDelimiter1_import">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2_import" value=";" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']==";"?'checked="checked"':'').'><label for="recipientsDelimiter2_import">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter3_import" value="|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|"?'checked="checked"':'').'><label for="recipientsDelimiter3_import">'.$lang['srv_inv_recipient_delimiter_pipe'].' (|)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter4_import" value="|~|" '.(isset ($_POST['recipientsDelimiter']) && $_POST['recipientsDelimiter']=="|~|"?'checked="checked"':'').'><label for="recipientsDelimiter4_import">'.$lang['srv_inv_recipient_delimiter_1KA'].' (|~|)</label>';
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div class="setting_line inv_sample">';
+ echo ' <div class="semi-bold">'.$lang['srv_inv_recipiens_sample'].'</div>';
+ echo ' <div class="italic">'.$lang['srv_inv_recipiens_sample1'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button id="inv_upload_recipients" class="blue medium">'.$lang['srv_inv_btn_add_recipients_add'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id=inv_import_file
+ }
+
+ echo '</fieldset>'; # id=inv_import_list_container
+ }
+
+
+ /**
+ *
+ * Enter description here ...
+ * @param $_recipients - prejemniki vsak v svoji vrstici, ločeni z vejico
+ * @param $fields - array polij ki jih dodajamo
+ */
+ function addMassRecipients($_recipients = '', $fields = array(), $new_profile_id = null) {
+ global $global_user_id;
+
+ # vabila z e-maili naredimo tukaj, brez e-mailov pa s podebno funkcijo
+ if (in_array('inv_field_email',$fields)) {
+ # vabila z emaili
+
+ # povezava imena polji iz forem, z imeni polji v bazi
+ $db_vs_form_array = array(
+ 'inv_field_email' => 'email',
+ 'inv_field_firstname' => 'firstname',
+ 'inv_field_lastname' => 'lastname',
+ 'inv_field_password' => 'password',
+ 'inv_field_cookie' => 'cookie',
+ 'inv_field_salutation' => 'salutation',
+ 'inv_field_phone' => 'phone',
+ 'inv_field_custom' => 'custom',
+ 'inv_field_relation' => 'relation',
+ );
+
+ #dodamo potrebna sistemska polja
+ $this->addSystemVariables($fields);
+
+ # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
+ $_recipients = str_replace("\n\r", "\n", $_recipients);
+ $recipients_list = explode("\n",$_recipients);
+ $num_recipients_list = count($recipients_list);
+
+ # katero polje je za e-mail
+ if (in_array('inv_field_email',$fields)) {
+ $user_email = true;
+ }
+ else {
+ #za tip 0 - Personalizirano e-poštno vabilo kjer je polje e-mail obvezno
+ # dodamo polje email
+ $user_email = true;
+ $fields[] = 'inv_field_email';
+ }
+
+ # polje cookie mora bit zraven
+ if (!in_array('inv_field_cookie',$fields)) {
+ $fields[] = 'inv_field_cookie';
+ }
+
+ /* brez preverjanja unikatnosti
+ # polovimo že dodane prejemnike iz baze
+ $email_in_db = array();
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
+ $sql_query = sisplet_query($sql_string);
+
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $email_in_db[] = strtolower($sql_row['email']);
+ }
+ }
+ */
+
+ # katero polje je za password
+ if (in_array('inv_field_password',$fields)) {
+ $user_password = true;
+ }
+ else {
+ $user_password = false;
+ # dodamo polje password
+ $fields[] = 'inv_field_password';
+ }
+
+ # polja za bazo
+ $db_fields = '';
+ foreach ($fields as $field) {
+ $db_fields .= ', '.$db_vs_form_array[$field];
+ }
+
+ # katera gesla (code) že imamo v bazi za to anketo
+ $password_in_db = array();
+ $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $password_in_db[$sql_row['password']] = $sql_row['password'];
+ }
+
+ $unsubscribed = array();
+ #polovimo prejemnike ki ne želijo prejemati obvestil
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND unsubscribed = '1'";
+ $sql_query = sisplet_query($sql_string);
+ $unsubscribed = array();
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
+
+ #polovimo prejemnike ki ne želijo prejemati obvestil i datoteje srv_survey_unsubscribed
+ $condition = (count($unsubscribed) > 0 ) ? " AND email NOT IN('".implode('\',\'',$unsubscribed)."')" : '';
+ $sql_string = "SELECT email FROM srv_survey_unsubscribe WHERE ank_id = '".$this->sid."'".$condition;
+ $sql_query = sisplet_query($sql_string);
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $unsubscribed[] = $sql_row['email'];
+ }
+ }
+
+ #array z veljavnimi zapisi
+ $valid_recipiens_array = array();
+ # array z zapisi kjer so napake v geslih
+ $invalid_password_array = array();
+ #array z zapisi kjer so neveljavna gesla
+ $invalid_email_array = array();
+ #array z podvojenimi zapisi
+ $duplicate_email_array = array();
+ #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
+ $unsubscribed_recipiens_array = array();
+
+ if ( $num_recipients_list > 0 ) {
+
+ foreach ($recipients_list AS $recipient_line) {
+ $recipient_line = trim($recipient_line);
+
+ if ($recipient_line != null && $recipient_line != '') {
+
+ // interni delimiter in ne vejicaa!!!!
+ $line_array = explode('|~|',$recipient_line);
+
+ //$line_array = explode(',',$recipient_line);
+ # predpostavljamo da je vrstica vredu
+ $invalid_line = false;
+
+ #prilagodimo izbrana polja
+ $recipent_array = array();
+ $i = 0;
+ foreach ($fields AS $field) {
+ $recipent_array[$field] = isset($line_array[$i]) ? $line_array[$i] : '';
+
+ $i++;
+ }
+
+ # izvedemo validacijo posameznih polij
+
+ # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
+ if ( $invalid_line == false ) {
+
+ # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
+ if ($user_password == false) {
+ # gesla določamo avtomatsko, (ne bo problemov :] )
+
+ # Izberemo random hash, ki se ni v bazi
+ do {
+ list($code,$cookie) = $this->generateCode();
+ #} while (in_array($code,$password_in_db) && !is_numeric($code));
+ }
+ while (in_array($code,$password_in_db)); # je bil problem kadar so same številke
+
+ # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
+ $recipent_array['inv_field_password'] = $code;
+ $recipent_array['inv_field_cookie'] = $cookie;
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ $password_in_db[$code] = $code;
+ }
+ else {
+ # gesla je določil uporabnik, (dajmo ga malo preverit)
+ $user_password = trim($recipent_array['inv_field_password']);
+
+ # preverimo ali je geslo že v bazi
+ if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
+ $invalid_password_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ if ($invalid_line == false) {
+ $password_in_db[$user_password] = $user_password;
+ #dodamo še piškotek
+ list($code,$cookie) = $this->generateCode();
+ $recipent_array['inv_field_cookie'] = $cookie;
+ }
+ }
+ }
+
+ # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
+ if ($user_email == true && $invalid_line == false) {
+ # preberemo uporabniški email
+ $email_field = trim($recipent_array['inv_field_email']);
+
+ #ali je email veljaven
+ if (!$this->validEmail($email_field) && $invalid_line == false) {
+ $invalid_email_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # ali je email podvojen
+ /* brez preverjanja unikatnosti
+ if (in_array(strtolower($email_field),$email_in_db) && $invalid_line == false) {
+ $duplicate_email_array[] = strtolower($recipient_line);
+ $invalid_line = true;
+ }
+ */
+
+ # ali uporabnik ne želi prejemati sporočil (opted out)
+ if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
+ $unsubscribed_recipiens_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, email dodamo v seznam že uporabljenih
+ if ( $invalid_line == false) {
+ $email_in_db[] = strtolower($email_field);
+ }
+ }
+
+ # če je vse ok dodamo userja k veljavnim
+ if ( $invalid_line == false) {
+ $valid_recipiens_array[] = $recipent_array;
+ }
+ }
+ }
+ }
+
+ if ($new_profile_id == null) {
+ $list_id = (int)$_POST['pid'];
+ }
+ else {
+ $list_id = $new_profile_id;
+ }
+
+ # pripravimo sql stavek za vstavljanje
+ if (count($valid_recipiens_array ) > 0) {
+ $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
+ $count = 0;
+
+ $sql_insert_array = array();
+ $cnt = 0;
+ $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
+ $array_loop = 0;
+ foreach ( $valid_recipiens_array AS $recipent_fields) {
+ $cnt++;
+ $sql_insert = "('".$this->sid."'";
+
+ foreach ($recipent_fields as $field) {
+ $sql_insert .= ", '" .str_replace (array('\\', "'"), array('', '&#39;'), $field) ."'";
+ }
+
+ $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
+ $sql_insert_array[$array_loop][] = $sql_insert;
+
+ if ($cnt >= $max_in_array) {
+ $array_loop++;
+ $cnt = 0;
+ }
+ }
+ $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+
+ # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
+ if (count($sql_insert_array) > 0) {
+
+ foreach ($sql_insert_array AS $sub_insert_array) {
+ $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
+ $sqlQuery = sisplet_query($query_insert);
+ $rows = mysqli_affected_rows($GLOBALS['connect_db']);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ sisplet_query("COMMIT");
+ }
+ }
+ return array( 'valid_recipiens' => $valid_recipiens_array,
+ 'invalid_password' => $invalid_password_array,
+ 'invalid_email' => $invalid_email_array,
+ 'duplicate_email' => $duplicate_email_array,
+ 'unsubscribed' => $unsubscribed_recipiens_array);
+ }
+ else {
+ # vabila brez emailov
+ return $this->addMassRecipientsWithoutEmail($_recipients, $fields, $new_profile_id);
+ }
+ }
+
+
+ function addMassRecipientsWithoutEmail($_recipients='', $fields=array(), $new_profile_id=null) {
+ global $global_user_id;
+
+ # povezava imena polji iz forem, z imeni polji v bazi
+ $db_vs_form_array = array(
+ 'inv_field_email' => 'email',
+ 'inv_field_firstname' => 'firstname',
+ 'inv_field_lastname' => 'lastname',
+ 'inv_field_password' => 'password',
+ 'inv_field_cookie' => 'cookie',
+ 'inv_field_salutation' => 'salutation',
+ 'inv_field_phone' => 'phone',
+ 'inv_field_custom' => 'custom',
+ 'inv_field_relation' => 'relation',
+ );
+
+ #dodamo potrebna sistemska polja
+ $this->addSystemVariables($fields);
+
+ # dodamo ustrezne uporabnike, neustrezne izpišemo še enkrat da se lahko popravijo
+ $_recipients = str_replace("\n\r", "\n", $_recipients);
+ $recipients_list = explode("\n",$_recipients);
+ $num_recipients_list = count($recipients_list);
+
+ # katero polje je za e-mail
+ if (in_array('inv_field_email',$fields)) {
+ $user_email = true;
+ } else {
+ }
+
+ # polje cookie mora bit zraven
+ if (!in_array('inv_field_cookie',$fields)) {
+ $fields[] = 'inv_field_cookie';
+ }
+
+ # polovimo že dodane prejemnike iz baze
+ $user_in_db = array();
+ $sql_string = "SELECT firstname,lastname,salutation,phone,custom,relation,password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
+ $sql_query = sisplet_query($sql_string);
+
+ if (mysqli_num_rows($sql_query) > 0 ) {
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $user_in_db[] = $sql_row['firstname'].$sql_row['lastname'].$sql_row['salutation'].$sql_row['phone'].$sql_row['custom'].$sql_row['relation'].$sql_row['password'];
+ }
+ }
+ # katero polje je za password
+ if (in_array('inv_field_password',$fields)) {
+ $user_password = true;
+ } else {
+ $user_password = false;
+ # dodamo polje password
+ $fields[] = 'inv_field_password';
+ }
+
+ # polja za bazo
+ $db_fields = '';
+ foreach ($fields as $field) {
+ $db_fields .= ', '.$db_vs_form_array[$field];
+ }
+
+ # katera gesla (code) že imamo v bazi za to anketo
+ $password_in_db = array();
+ $sql_string = "SELECT password FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0'";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $password_in_db[$sql_row['password']] = $sql_row['password'];
+ }
+
+ $unsubscribed = array();
+ #polovimo prejemnike ki ne želijo prejemati obvestil
+ #
+ # $sql_string = "SELECT email FROM srv_invitations_recipients WHERE unsubscribed = '1'";
+ # $sql_query = sisplet_query($sql_string);
+ # $unsubscribed = array();
+ // if (mysqli_num_rows($sql_query) > 0 ) {
+ # while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ # $unsubscribed[] = $sql_row['email'];
+ # }
+ # }
+
+ #array z veljavnimi zapisi
+ $valid_recipiens_array = array();
+ # array z zapisi kjer so napake v geslih
+ $invalid_password_array = array();
+ #array z zapisi kjer so neveljavna gesla
+ $invalid_email_array = array();
+ #array z podvojenimi zapisi
+ $duplicate_email_array = array();
+ #aray z zapisi kjer so uporabniki izbrali da ne želijo prejemat e-mailov
+ $unsubscribed_recipiens_array = array();
+
+ if ( $num_recipients_list > 0 ) {
+ foreach ($recipients_list AS $recipient_line) {
+ $recipient_line = trim($recipient_line);
+ if ($recipient_line != null && $recipient_line != '') {
+
+ $line_array = explode('|~|',$recipient_line);
+ # predpostavljamo da je vrstica vredu
+ $invalid_line = false;
+
+ #prilagodimo izbrana polja
+ $recipent_array = array();
+ $i = 0;
+ foreach ($fields AS $field) {
+ $recipent_array[$field] = $line_array[$i];
+ $i++;
+ }
+
+ # izvedemo validacijo posameznih polij
+
+ # najprej preverimo gesla, če niso uporabniško določena, jih dodelimo sami
+ if ( $invalid_line == false ) {
+ # če še ni bilo napake ( da ne podvajamo zapisov pri katerih je več napak)
+ if ($user_password == false) {
+ # gesla določamo avtomatsko, (ne bo problemov :] )
+
+ # Izberemo random hash, ki se ni v bazi
+ do {
+ list($code,$cookie) = $this->generateCode();
+ } while (in_array($code,$password_in_db));
+ # polje za geslo je na zadnjem mestu (smo ga dodali zgoraj)
+ $recipent_array['inv_field_password'] = $code;
+ $recipent_array['inv_field_cookie'] = $cookie;
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ $password_in_db[$code] = $code;
+
+ } else {
+ # gesla je določil uporabnik, (dajmo ga malo preverit)
+ $user_password = trim($recipent_array['inv_field_password']);
+
+ # preverimo ali je geslo že v bazi
+ if ($user_password == null || $user_password == '' || in_array($user_password,$password_in_db)) {
+ $invalid_password_array[] = $recipient_line;
+ $invalid_line = true;
+ }
+
+ # če je vse ok, geslo dodamo v seznam že uporabljenih
+ if ($invalid_line == false) {
+ $password_in_db[$user_password] = $user_password;
+ #dodamo še piškotek
+ list($code,$cookie) = $this->generateCode();
+ $recipent_array['inv_field_cookie'] = $cookie;
+ }
+ }
+ }
+ # če imamo emaile naredimo validacijo, preverimo zavrnitve.. itd
+ // if ($user_email == true && $invalid_line == false) {
+ if ($invalid_line == false) {
+ # # preberemo uporabniški email
+ $email_field = trim($recipent_array['inv_field_firstname'])
+ . trim($recipent_array['inv_field_lastname'])
+ . trim($recipent_array['inv_field_salutation'])
+ . trim($recipent_array['inv_field_phone'])
+ . trim($recipent_array['inv_field_custom'])
+ . trim($recipent_array['inv_field_relation'])
+ . trim($recipent_array['inv_field_password']);
+
+ #
+ # #ali je email veljaven
+ // if (!$this->validEmail($email_field) && $invalid_line == false) {
+ # $invalid_email_array[] = $recipient_line;
+ # $invalid_line = true;
+ # }
+
+ # ali je email podvojen
+ if (in_array(strtolower($email_field),$user_in_db) && $invalid_line == false) {
+ $duplicate_email_array[] = strtolower($recipient_line);
+ $invalid_line = true;
+ }
+
+ # ali uporabnik ne želi prejemati sporočil (opted out)
+ // if (in_array($email_field,$unsubscribed) && $invalid_line == false) {
+ # $unsubscribed_recipiens_array[] = $recipient_line;
+ # $invalid_line = true;
+ # }
+
+ # če je vse ok, email dodamo v seznam že uporabljenih
+ if ( $invalid_line == false) {
+ $user_in_db[] = $email_field;
+ }
+ }
+ # če je vse ok dodamo userja k veljavnim
+ if ( $invalid_line == false) {
+ $valid_recipiens_array[] = $recipent_array;
+ }
+
+ }
+ }
+ }
+
+ # pripravimo sql stavek za vstavljanje
+ if ($new_profile_id == null) {
+ $list_id = (int)$_POST['pid'];
+ }
+ else {
+ $list_id = $new_profile_id;
+ }
+
+ if (count($valid_recipiens_array ) > 0) {
+ $sql_insert_start = "INSERT INTO srv_invitations_recipients (ank_id".$db_fields.",sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id) VALUES ";
+ $count = 0;
+
+ $sql_insert_array = array();
+ $cnt = 0;
+ $max_in_array = 1000; # po koliko respondentov dodajamo naenkeat
+ $array_loop = 0;
+ foreach ( $valid_recipiens_array AS $recipent_fields) {
+ $cnt++;
+ $sql_insert = "('".$this->sid."'";
+ foreach ($recipent_fields as $field) {
+ $sql_insert .= ", '$field'";
+ }
+ $sql_insert .= ",'0','0','0','0',NOW(),'".$global_user_id."','".$list_id."')";
+ $sql_insert_array[$array_loop][] = $sql_insert;
+ if ($cnt >= $max_in_array) {
+ $array_loop++;
+ $cnt = 0;
+ }
+ }
+ $sql_insert_end = " ON DUPLICATE KEY UPDATE firstname=VALUES(firstname), lastname=VALUES(lastname), salutation=VALUES(salutation), phone=VALUES(phone), custom=VALUES(custom), relation=VALUES(relation), deleted='0', date_inserted=NOW()";
+
+ # v loopu dodamo posamezne respondente po skupinah (ker kadar je respondentov veliko mysql crkne)
+ if (count($sql_insert_array) > 0) {
+ foreach ($sql_insert_array AS $sub_insert_array) {
+ $query_insert = $sql_insert_start. implode(',',$sub_insert_array) .$sql_insert_end;
+ $sqlQuery = sisplet_query($query_insert);
+ $rows = mysqli_affected_rows($GLOBALS['connect_db']);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ sisplet_query("COMMIT");
+
+ }
+ }
+
+ return array( 'valid_recipiens' => $valid_recipiens_array,
+ 'invalid_password' => $invalid_password_array,
+ 'invalid_email' => $invalid_email_array,
+ 'duplicate_email' => $duplicate_email_array,
+ 'unsubscribed' => $unsubscribed_recipiens_array);
+ }
+
+ function generateCode() {
+
+ // Zgeneriramo cookie
+ $cookie = md5(mt_rand(1, mt_getrandmax()) . '@' . $_SERVER['REMOTE_ADDR']);
+
+ // Ce je prvi znak stevilka jo spremenimo v crko ker drugace vcasih izvoz v excel ne dela ok
+ $letters = array('a', 'b', 'c', 'd', 'e', 'f');
+ if(is_numeric(substr($cookie, 0, 1)))
+ $cookie = $letters[array_rand($letters)].substr($cookie, 1);
+
+ // Koda je prvi del cookija
+ $code = substr($cookie, 0, 6);
+
+ return array($code, $cookie);
+ }
+
+ #preglej prejemnike
+ function viewRecipients($errors = array(), $msgs = array()) {
+ global $lang, $site_url, $admin_type, $site_domain;
+
+ $noEmailing = SurveySession::get('inv_noEmailing');
+
+ $row = $this->surveySettings;
+
+ echo '<div class="invitations_top_settings">';
+
+ // Text s podatki o nastavitvah posiljanja
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+ if($individual == 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_individual_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($noEmailing == 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($row['usercode_required'] == 0 && $individual != 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_1'];
+
+ if($row['usercode_skip'] == 1 || $individual == 0){
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
+ }
+ else{
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_1'].')</span>';
+ }
+ }
+
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
+
+ echo $settings_text;
+
+ echo '</div>';
+
+
+ #polovimo prejemnike ki ne želijo prejemati obvestil
+ $mysql_filter = '';
+ # nastavimo filter
+ session_start();
+ $filter_duplicated = isset($_SESSION['inv_filter']['duplicated']) ? $_SESSION['inv_filter']['duplicated'] : false;
+ $filter = isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value'] : '';
+ if ($filter != '') {
+ $mysql_filter = " AND ("
+ . "i.email LIKE '%".$filter."%'"
+ . "OR i.firstname LIKE '%".$filter."%'"
+ . "OR i.lastname LIKE '%".$filter."%'"
+ . "OR i.password LIKE '%".$filter."%'"
+ . "OR i.salutation LIKE '%".$filter."%'"
+ . "OR i.phone LIKE '%".$filter."%'"
+ . "OR i.custom LIKE '%".$filter."%'"
+ . "OR i.relation LIKE '%".$filter."%'"
+ . ")";
+ }
+
+
+ if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
+
+ if (!isset($_SESSION['inv_filter']['send']) || (int)$_SESSION['inv_filter']['send'] == 0) {
+ $mysql_filter .= "";
+ } else if ($_SESSION['inv_filter']['send'] == 2) {
+ $mysql_filter .= " AND i.sent='1'";
+ } else if ($_SESSION['inv_filter']['send'] == 1) {
+ $mysql_filter .= " AND i.sent='0'";
+ }
+ if (!isset($_SESSION['inv_filter']['respondet']) || (int)$_SESSION['inv_filter']['respondet'] == 0) {
+ $mysql_filter .= "";
+ } else if ($_SESSION['inv_filter']['respondet'] == 2) {
+ $mysql_filter .= " AND i.responded='1'";
+ } else if ($_SESSION['inv_filter']['respondet'] == 1) {
+ $mysql_filter .= " AND i.responded='0'";
+ }
+ if (!isset($_SESSION['inv_filter']['unsubscribed']) || (int)$_SESSION['inv_filter']['unsubscribed'] == 0) {
+ $mysql_filter .= "";
+ } else if ($_SESSION['inv_filter']['unsubscribed'] == 2) {
+ $mysql_filter .= " AND i.unsubscribed='1'";
+ } else if ($_SESSION['inv_filter']['unsubscribed'] == 1) {
+ $mysql_filter .= " AND i.unsubscribed='0'";
+ }
+
+ if (!isset($_SESSION['inv_filter']['list']) || (int)$_SESSION['inv_filter']['list'] == -2) {
+ $mysql_filter .= "";
+ } else {
+ $mysql_filter .= " AND i.list_id='".(int)$_SESSION['inv_filter']['list']."'";
+ }
+
+ }
+ # preštejemo koliko imamo vseh respondentov in koliko jih je brez e-maila
+ $sql_query_all = sisplet_query("SELECT id FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
+ $count_all = mysqli_num_rows($sql_query_all);
+
+ $sql_string_withot_email = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0' AND email IS NULL AND sent='0'";
+ $sql_query_without_email = sisplet_query($sql_string_withot_email);
+ $sql_row_without_email = mysqli_fetch_row($sql_query_without_email);
+ $count_without_email = $sql_row_without_email[0];
+
+
+ #koliko zapisov bi morali prikazovati
+ $sql_string_filterd_all = "SELECT i.* FROM srv_invitations_recipients AS i WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0'".$mysql_filter." ORDER BY i.id";
+ $sql_query_filterd_all = sisplet_query($sql_string_filterd_all);
+ $filtred_all = mysqli_num_rows($sql_query_filterd_all);
+
+
+ # Katera polja prikazujemo v seznamu prejemnikov
+ $default_fields = array(
+ 'sent' => 1,
+ 'email' => 1,
+ 'firstname' => 0,
+ 'lastname' => 0,
+ 'salutation' => 0,
+ 'phone' => 0,
+ 'custom' => 0,
+ );
+
+ // Volitve nimajo nekaterih polj
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ //$default_fields['responded'] = 1;
+ $default_fields['unsubscribed'] = 1;
+ $default_fields['password'] = 1;
+ }
+
+ // Ce imamo modul 360 imamo tudi odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ $default_fields['relation'] = 0;
+ }
+
+ # pogledamo katera polja dejansko prikazujemo
+ $sql_select_fields = array();
+ $fields = array();
+ while ($sql_row = mysqli_fetch_assoc($sql_query_filterd_all)) {
+ foreach ($default_fields AS $key => $value) {
+ # če polje še ni dodano in če ni prazno, ga dodamo
+ if ((!isset($fields[$key]) || $fields[$key] == 0) && isset($sql_row[$key]) && trim($sql_row[$key]) != '') {
+ $fields[$key] = 1;
+ $sql_select_fields[] = 'i.'.$key;
+ }
+ }
+ }
+
+ // Dodamo še ostala polja
+ // Volitve nimajo nekaterih polj
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ $fields['last_status'] = 1;
+ $fields['date(date_expired)'] = 1;
+ }
+
+ $sql_select_fields[] = 'i.last_status';
+ $fields['date_inserted'] = 1;
+
+ $fields['inserted_uid'] = 1;
+ $sql_select_fields[] = 'i.inserted_uid';
+ $sql_select_fields[] = 'i.date_inserted';
+ $sql_select_fields[] = 'date(date_expired)';
+ $fields['list_id'] = 1;
+ $sql_select_fields[] = 'i.list_id';
+
+
+ #dodamo paginacijo in poiščemo zapise
+ $page = isset($_GET['page']) ? $_GET['page'] : '1';
+ $limit_start = ($page*REC_ON_PAGE)-REC_ON_PAGE;
+
+ $sort_string = $this->getSortString();
+ $sql_string_duplicated = null;
+ if ($filter_duplicated == true)
+ {
+ $sql_string_duplicated = " JOIN(
+ SELECT email, COUNT( email ) AS email_duplicated
+ FROM srv_invitations_recipients
+ WHERE ank_id='".$this->sid."' AND deleted = '0'
+ GROUP BY email
+ HAVING email_duplicated >1
+ ) AS dup ON dup.email = i.email ";
+ }
+
+ $sql_string_filterd = "SELECT i.id,
+ ".implode(',',$sql_select_fields)."
+ FROM srv_invitations_recipients AS i
+ ".$sql_string_duplicated."
+ WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0'
+ ".$mysql_filter."
+ ".$sort_string."
+ LIMIT $limit_start,".REC_ON_PAGE;
+
+ #koliko zapisov bi morali prikazovati
+ # po potrebi upoštevamo filter pogojev
+ $this->user_inv_ids = array();
+ if ((int)$this->invitationAdvancedConditionId > 0) {
+ $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
+ if (isset($this->user_inv_ids) && is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0 )
+ {
+
+ $sql_string_filterd = "SELECT i.id, ".implode(',',$sql_select_fields)." FROM srv_invitations_recipients AS i "
+ . $sql_string_duplicated
+ . " INNER JOIN srv_user AS su ON i.id = su.inv_res_id"
+ ." WHERE su.ank_id = '$this->sid' AND su.inv_res_id IS NOT NULL AND su.deleted = '0' AND su.id IN ('".(implode('\',\'',$this->user_inv_ids))."')"
+ ." AND i.ank_id = '".$this->sid."' AND i.deleted = '0'".$mysql_filter.' '.$sort_string." LIMIT $limit_start,".REC_ON_PAGE;
+ }
+ }
+
+ $sql_query_filterd = sisplet_query($sql_string_filterd);
+ # polovimo userje
+ $uids = array();
+ $sql_string_users = "SELECT DISTINCT i.inserted_uid FROM srv_invitations_recipients AS i WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0'".$mysql_filter." GROUP BY i.inserted_uid ORDER BY i.id";
+ $sql_query_users = sisplet_query($sql_string_users);
+ while ($row_users = mysqli_fetch_assoc($sql_query_users)) {
+ $uids[] = $row_users['inserted_uid'];
+ }
+
+
+ $users = array();
+ if (count($uids) > 0) {
+ $sql_string_users = "SELECT id, email FROM users WHERE id IN(".implode(',',$uids).")";
+ $sql_query_users = sisplet_query($sql_string_users);
+ while ($row_users = mysqli_fetch_assoc($sql_query_users)) {
+ $users[$row_users['id']] = array('email'=>$row_users['email']);
+ }
+ }
+
+ # polovimo sezname
+ $lids = array();
+ $sql_string_users = "SELECT i.list_id FROM srv_invitations_recipients AS i WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0'".$mysql_filter." GROUP BY i.list_id ORDER BY i.id";
+ $sql_query_users = sisplet_query($sql_string_users);
+ while ($row_users = mysqli_fetch_assoc($sql_query_users)) {
+ $lids[] = $row_users['list_id'];
+ }
+
+ #seznami
+ $lists = array();
+ $lists['-1'] = array('name'=>$lang['srv_invitation_new_templist']);
+ $lists['0'] = array('name'=>$lang['srv_invitation_new_templist_author']);
+
+ if (count($lids) > 0 ) {
+ $sql_string_lists = "SELECT * from srv_invitations_recipients_profiles WHERE pid IN(".implode(',',$lids).") ";
+ $sql_query_lists = sisplet_query($sql_string_lists);
+ while ($row_lists = mysqli_fetch_assoc($sql_query_lists)) {
+ $lists[$row_lists['pid']] = array('name'=>$row_lists['name']);
+ }
+ }
+
+ if (count($msgs) > 0) {
+ echo '<span class="inv_msg_note">';
+ foreach($msgs as $msg) {
+ echo '* '.$msg.'<br />';
+ }
+ echo '</span>';
+ }
+
+ if (count($errors) > 0) {
+ echo '<span class="inv_error_note">';
+ foreach($errors as $error) {
+ echo '* '.$error.'<br />';
+ }
+ echo '</span>';
+ }
+
+
+ # dodamo filtriranje
+ if ($count_all > 0 ) {
+
+ echo '<div id="inv_rec_filter">';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_value">'.$lang['srv_invitation_recipients_filter'].'</label><input id="inv_rec_filter_value" class="small" type="text" onchange="inv_filter_recipients(); return false;" value="'.(isset($_SESSION['inv_filter']['value']) ? $_SESSION['inv_filter']['value']:'').'">';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <input id="inv_rec_filter_on" type="checkbox" onchange="inv_filter_recipients(); return false;"'.(isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ? ' checked="true"' : '').'>';
+ echo ' <label for="inv_rec_filter_on">'.$lang['srv_invitation_recipients_filter_advanced'].'</label>';
+ echo '</div>';
+
+ if (isset($_SESSION['inv_filter_on']) && $_SESSION['inv_filter_on'] == true ) {
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_send">'.$lang['srv_invitation_recipients_filter_sent'].'</label>';
+ $selected = (int)(isset($_SESSION['inv_filter']['send']) ? (int)$_SESSION['inv_filter']['send'] : 0);
+ echo ' <select id="inv_rec_filter_send" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_respondet">'.$lang['srv_invitation_recipients_filter_answered'].'</label>';
+ $selected = (int)(isset($_SESSION['inv_filter']['respondet']) ? (int)$_SESSION['inv_filter']['respondet'] : 0);
+ echo ' <select id="inv_rec_filter_respondet" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ echo '<div class="setting">';
+ echo ' <label for="inv_rec_filter_unsubscribed">'.$lang['srv_invitation_recipients_filter_unsubscribed'].'</label>';
+ $selected = (int)(isset($_SESSION['inv_filter']['unsubscribed']) ? (int)$_SESSION['inv_filter']['unsubscribed'] : 0);
+ echo ' <select id="inv_rec_filter_unsubscribed" class="dropdown small" onchange="inv_filter_recipients();">';
+ echo ' <option value="0"'.((int)$selected == 0 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter0'].'</option>';
+ echo ' <option value="1"'.((int)$selected == 1 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter1'].'</option>';
+ echo ' <option value="2"'.((int)$selected == 2 ? ' selected="selected"' : '').'>'.$lang['srv_invitation_filter2'].'</option>';
+ echo ' </select>';
+ echo '</div>';
+
+ $this->listCondition();
+
+ $this->advancedCondition();
+ }
+
+ echo '</div>';
+
+
+ echo '<form id="frm_inv_rec_export" name="resp_uploader" method="post" autocomplete="off">';
+
+ echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+ echo '<input type="hidden" name="noNavi" id="noNavi" value="true">';
+
+ if ($filter != '') {
+ echo '<div class="filter_note">';
+ printf($lang['srv_inv_list_no_recipients_filter'], $filter);
+ echo '</div>';
+ }
+
+
+ echo '<div id="srv_invitation_note">';
+
+ if ($count_all > 0 && mysqli_num_rows($sql_query_filterd) != $count_all ) {
+ echo '<span>'.$lang['srv_invitation_num_respondents_filtred'].(int)mysqli_num_rows($sql_query_filterd).'</span>';
+ }
+ else {
+ echo '<span>'.$lang['srv_invitation_num_respondents'].(int)$this->count_all.'</span>';
+ }
+ # duplicated
+ echo '<input type="checkbox" id="inv_rec_filter_duplicates" onchange="inv_filter_recipients(); return false" '. ($filter_duplicated ?' checked="checked"':'') .'><label for="inv_rec_filter_duplicates">'.$lang['srv_inv_recipient_show_only_duplicates'] .'</label>';
+
+ echo '</div>';
+
+
+ if (mysqli_num_rows($sql_query_filterd) > 0 && $count_all > 0) {
+
+ $this->displayPagination($filtred_all);
+
+ // Izvoz vseh v excel
+ echo '<div class="excel_export">';
+ echo ' <a href="#" class="noline" title="'.$lang['srv_invitation_recipients_export_all'].'" onclick="inv_recipients_form_action(\'export_all\');">';
+ echo ' <span class="faicon xls"></span>'.$lang['srv_invitation_recipients_export_all'];
+ echo ' </a>';
+ echo '</div>';
+
+ // Izvoz QR kod za NIJZ
+ if($site_domain == 'anketa.nijz.si'){
+ echo '<div class="excel_export" style="margin: 16px 0;">';
+ echo ' <a href="#" class="noline" onclick="inv_recipients_form_action(\'export_qr_codes\');" >';
+ echo $lang['srv_invitation_recipients_export_qr'];
+ echo ' </a>';
+ echo '</div>';
+ }
+
+
+ echo '<div class="table_holder">';
+
+ echo '<table id="tbl_recipients_list">';
+
+ echo '<tr>';
+
+ # checkbox
+ echo '<th class="tbl_icon" colspan="'.($this->surveySettings['show_email'] == 1 ? '4' : '3').'">';
+ echo ' <input type="checkbox" id="inv_switch" onClick="inv_selectAll(this);"><label for="inv_switch"></label>';
+ echo '</th>';
+
+ foreach ($fields AS $fkey =>$field) {
+ if ($field == 1) {
+
+ if ($fkey == 'sent' || $fkey == 'responded' || $fkey == 'unsubscribed' ) {
+ echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer tbl_icon_'.$fkey.'" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
+ }
+ else if ($fkey == 'last_status' ) {
+ echo '<th'.$this->addSortField($fkey).' class="anl_ac pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
+ }
+ else {
+ echo '<th'.$this->addSortField($fkey).' class="pointer" title="'.$lang['srv_inv_recipients_'.$fkey].'">'.$lang['srv_inv_recipients_'.$fkey].$this->addSortIcon($fkey).'</th>';
+ }
+ }
+ }
+ echo '</tr>';
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query_filterd)) {
+
+ echo '<tr>';
+
+
+ echo '<td colspan="3">';
+
+ # checkbox
+ echo '<input type="checkbox" id="inv_rids'.$sql_row['id'].'" name="inv_rids[]" value="'.$sql_row['id'].'"><label for="inv_rids'.$sql_row['id'].'"></label>';
+
+ #izbriši
+ echo '<span class="faicon delete" onclick="deleteRecipient_confirm(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+
+ #uredi
+ echo '<span class="faicon edit" onclick="editRecipient(\''.$sql_row['id'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit'].'"></span>';
+
+ echo '</td>';
+
+
+ // Skoci na urejanje odgovorov - ce imamo identifikatorje povezane s podatki
+ if($this->surveySettings['show_email'] == 1)
+ echo '<td class="tbl_inv_left"><span class="icon-grey_dark_link" onclick="window.open(\''.$site_url.'/main/survey/edit_anketa.php?anketa='.SurveyInfo::getInstance()->getSurveyHash().'&usr_id='.$sql_row['id'].'&code='.$sql_row['password'].'\', \'blank\')" title="'.$lang['srv_edit_data_row'].'"></span></td>';
+
+ foreach ($fields AS $fkey =>$field) {
+ if ($field == 1) {
+ switch ($fkey) {
+ case 'sent':
+ echo '<td class="pointer" onclick="showRecipientTracking(\''.$sql_row['id'].'\'); return false;">';
+ echo ((int)$sql_row['sent'] == 1 ? $lang['sent'] : $lang['not_sent']);
+ echo '</td>';
+ break;
+ case 'responded':
+ echo '<td class="">';
+ echo '<span class="faicon '.((int)$sql_row['responded'] == 1 ? ('inv_responded_1') : 'inv_responded_0').' icon-orange"></span>';
+ echo '</td>';
+ break;
+ case 'unsubscribed':
+ echo '<td class="">';
+ echo ((int)$sql_row['unsubscribed'] == 1 ? $lang['unsubscribed'] : $lang['not_unsubscribed']);
+ echo '</td>';
+ break;
+ case 'last_status':
+ echo '<td>('.$sql_row[$fkey].') - '.$lang['srv_userstatus_'.$sql_row[$fkey]].'</td>';
+ break;
+ case 'inserted_uid':
+ echo '<td>'.$users[$sql_row[$fkey]]['email'].'</td>';
+ break;
+ case 'email':
+ echo '<td>';
+ if ($filter != '') {
+ echo $this->hightlight($sql_row[$fkey],$filter);
+ } else {
+ echo $sql_row[$fkey];
+ }
+ echo '</td>';
+ break;
+ case 'list_id':
+ echo '<td>';
+ if ((int)$sql_row[$fkey] > 0) {
+ if ($lists[$sql_row[$fkey]]['name'] != '') {
+ echo '<a href="#" onclick="$(\'#anketa_edit\').load(\'ajax.php?t=invitations&a=use_recipients_list\', {anketa:srv_meta_anketa_id, pid:'.(int)$sql_row[$fkey].' });">'.$lists[$sql_row[$fkey]]['name'].'</a>';
+ } else {
+ echo $lang['srv_inv_recipient_list_deleted'];
+ }
+ } else {
+ echo $lists[$sql_row[$fkey]]['name'];
+ }
+ echo '</td>';
+ break;
+ default:
+ echo '<td class="tbl_inv_left">';
+ if ($filter != '') {
+ echo $this->hightlight($sql_row[$fkey],$filter);
+ } else {
+ echo $sql_row[$fkey];
+ }
+
+ echo '</td>';
+ break;
+ }
+
+ }
+ }
+
+ echo '</tr>';
+
+ @ob_flush();
+ }
+
+ echo '</table>';
+
+ echo '</div>';
+
+
+ echo '<div id="inv_bottom_edit">';
+
+ echo '<div class="bottom_actions">';
+ echo ' <a href="#" class="noline" class="noline" onClick="inv_recipients_form_action(\'delete\');"><span class="faicon delete" title="'.$lang['srv_invitation_recipients_delete_selected'].'"></span>'.$lang['srv_invitation_recipients_delete_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'export\');"><span class="faicon xls" title="'.$lang['srv_invitation_recipients_export_selected'].'"></span>'.$lang['srv_invitation_recipients_export_selected'].'</a>';
+ echo ' <a href="#" class="noline" onClick="inv_recipients_form_action(\'add\');">'.$lang['srv_invitation_recipients_activate3'].'</a>';
+ echo '</div>';
+
+ // Aktivira vse v seznamu (jih doda v podatke, kot da so poslani)
+ echo '<div class="bottom_activate">';
+ echo ' <a href="#" class="noline" onclick="inv_add_rec_to_db(); return false;" target="_blank">'.$lang['srv_invitation_recipients_activate2'].'</a>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ if ($count_all > 0) {
+ echo '<div class="button_holder below float-right">';
+ echo ' <a href="'.$this->addUrl('view_message').'"><button type="button" class="medium blue">'.$lang['srv_invitation_forward'].'</div></a>';
+ echo '</div>';
+ }
+ }
+ else {
+ echo '<span class="search_count">'.$lang['srv_inv_list_no_recipients_filtred'].'</span>';
+ }
+
+ echo '</form>';
+ }
+ else {
+ echo '<span>'.$lang['srv_inv_list_no_recipients'].'</span>';
+ }
+ }
+
+ function viewMessage($mid = null) {
+ global $lang, $global_user_id, $site_url;
+
+ $row = $this->surveySettings;
+
+
+ echo '<div class="invitations_top_settings">';
+
+ // Text s podatki o nastavitvah posiljanja
+ $settings_text = '<span class="semi-bold">'.$lang['srv_inv_message_type'].': </span>';
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+ if($individual == 0){
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ $noEmailing = SurveySession::get('inv_noEmailing');
+ if($noEmailing == 0){
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($row['usercode_required'] == 0 && $individual != 0){
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
+ }
+ else{
+ $settings_text .= '<span class="spaceLeft spaceRight">'.$lang['srv_inv_settings_URL_1'];
+
+ if($row['usercode_skip'] == 1 || $individual == 0){
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
+ }
+ else{
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_1'].')</span>';
+ }
+ }
+
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings"><span class="faicon edit"></span></a>';
+
+ echo $settings_text;
+
+ echo '</div>';
+
+
+ // Ce posiljamo preko emaila
+ if($noEmailing != 1){
+ echo '<div id="inv_messages_holder" class="invitations_holder three-part invitations_message">';
+
+ if ($this->checkDefaultMessage() == false) {
+ echo '<span class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</span>';
+ }
+ else {
+ $sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+ $array_messages = array();
+ while ( list($id, $naslov, $subject_text, $body_text, $reply_to ,$isdefault, $comment, $url) = mysqli_fetch_row($sql_query) ) {
+ $array_messages[$id] = array('id'=>$id, 'naslov' => $naslov, 'subject_text'=>$subject_text, 'body_text'=>$body_text, 'reply_to'=>$reply_to ,'isdefault'=>$isdefault, 'comment'=>$comment, 'url'=>$url);
+ if ($isdefault == '1') {
+ # če izbiramo profile in nismo postali še nobenga
+ if ( $mid == null ) {
+ $mid = $id;
+ }
+ }
+ }
+ $preview_message = $array_messages[$mid];
+
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
+ echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
+
+
+ echo '<div id="invitation_messages" >';
+
+ echo '<ol>';
+ foreach ($array_messages AS $_m => $message) {
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
+ echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
+ echo '</li>';
+ }
+ echo '</ol>';
+
+ echo '</div>'; #invitation_messages
+
+
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+
+
+ echo '<div class="info">';
+
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
+
+ $MA = new MailAdapter($this->sid, $type='invitation');
+
+ # zlistamo seznam vseh sporočil
+ # izpišemo primer besedila
+ echo '<fieldset id="inv_msg_preview_hld" class="middle">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
+
+
+ echo '<div id="inv_msg_preview">';
+
+
+ echo '<div class="setting_row">';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_from'].':</label>';
+ if($MA->getMailFrom() == '')
+ echo ' <a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings">'.$lang['srv_usermailing_setting'].'</a>';
+ else
+ echo $MA->getMailFrom();
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailFrom().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_reply'].':</label>';
+ echo $MA->getMailReplyTo();
+ echo ' <input type="hidden" id="inv_message_replyto" value="'.$MA->getMailReplyTo().'" autocomplete="off" readonly>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
+ ?>
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
+ $urls = $this->getUrlLists();
+ if (count($urls) > 0) {
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
+ foreach ($urls AS $url) {
+ $selected = '';
+ if ($preview_message['url'] == '') {
+ if (isset($preview_message['dc']) && $preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
+ }
+ } else if ($preview_message['url'] == $url['url']) {
+ $selected = ' selected="selected"';
+ }
+ echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
+ }
+ echo '</select>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+
+ echo '<fieldset id="invitation_profile_notes" class="right_holder">';
+
+ echo '<p class="semi-bold caps">'.$lang['srv_inv_message_help_title'].'</p>';
+
+ $_indicators = $this->getAvailableIndicators();
+
+ $_sysVars = $this->getAvailableSysVars();
+
+ echo $lang['srv_inv_message_help'];
+ // Poiščemo še sistemske spremenljivke iz ankete
+ $prefix='';
+ if (count($_indicators ) > 0) {
+ echo $lang['srv_inv_message_help_identifikators'];
+
+ foreach ($_indicators AS $_identifikator) {
+ echo $prefix.'<br/>#'.strtoupper($_identifikator).'#';
+
+ if(isset($lang['srv_inv_message_help_system_'.strtolower($_identifikator)]))
+ echo $lang['srv_inv_message_help_system_'.strtolower($_identifikator)];
+
+ $prefix = ', ';
+ }
+
+ # preverimo ali imamo nastavljen mapping
+ $prefix = '';
+ $sqlSysMapping = sisplet_query("SELECT * FROM srv_invitations_mapping WHERE sid = '$this->sid'");
+ if (count($_sysVars ) > 0 && mysqli_num_rows($sqlSysMapping) > 0) {
+ echo '<br/><br/>'.$lang['srv_inv_message_help_systemvars'];
+ foreach ($_sysVars AS $_sys_var => $_sysLabel) {
+ echo $prefix.'<br/>#'.strtoupper($_sys_var).'#'.$lang['srv_inv_message_help_system_'.strtolower($_sys_var)];
+ $prefix = ', ';
+ }
+
+ }
+ } else {
+ echo $lang['srv_invitation_note12'];
+ }
+
+ echo '</fieldset>';
+ }
+
+ echo '</div>';
+ }
+ // Ce samo dokumentiramo - navadna posta, SMS...
+ else{
+
+ echo '<div id="inv_messages_holder_noEmailing">';
+ echo $lang['srv_inv_message_noemailing_text'];
+ echo '</div>';
+
+
+ echo '<div id="inv_messages_holder" class="invitations_holder left-menu invitations_message">';
+
+ if ($this->checkDefaultMessage() == false) {
+ echo '<span class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</span>';
+ }
+ else {
+ $sql_string = "SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+ $array_messages = array();
+ while ( list($id, $naslov, $subject_text, $body_text, $reply_to ,$isdefault, $comment, $url) = mysqli_fetch_row($sql_query) ) {
+ $array_messages[$id] = array('id'=>$id, 'naslov' => $naslov, 'subject_text'=>$subject_text, 'body_text'=>$body_text, 'reply_to'=>$reply_to ,'isdefault'=>$isdefault, 'comment'=>$comment, 'url'=>$url);
+ if ($isdefault == '1') {
+ # če izbiramo profile in nismo postali še nobenga
+ if ( $mid == null ) {
+ $mid = $id;
+ }
+ }
+ }
+ $preview_message = $array_messages[$mid];
+
+
+ echo '<fieldset id="inv_messages_profiles_holder" class="left_holder">';
+
+ echo '<span>'.$lang['srv_invitation_message_choose'].':</span><br/>';
+
+
+ echo '<div id="invitation_messages">';
+
+ echo '<ol>';
+ foreach ($array_messages AS $_m => $message) {
+
+ echo '<li mid="'.$message['id'].'" class="'.($message['id'] == $mid ? ' active' : '').'" onclick="invChangeMessage(\''.$message['id'].'\')">';
+
+ echo $message['naslov'];
+
+ if($message['id'] == $mid){
+
+ echo '<div class="icons">';
+
+ if (count($array_messages) > 1)
+ echo '<span class="faicon delete_circle" id="inv_del_msg_profile" onclick="invMessageDelete();" title="'.$lang['srv_inv_message_delete_profile'].'"></span>';
+
+ echo '<span class="faicon edit" id="inv_ren_msg_profile" onclick="invShowMessageRename();" title="'.$lang['srv_inv_message_rename_profile'].'"></span>';
+
+ echo '</div>';
+ }
+
+ echo '</li>';
+ }
+ echo '</ol>';
+
+ echo '</div>'; #invitation_messages
+
+
+ # polovimo podatke profila
+ $sql_string = "SELECT sim.*, u.name, u.surname, e.name as ename, e.surname as esurname FROM srv_invitations_messages AS sim LEFT JOIN users AS u ON sim.uid = u.id LEFT JOIN users AS e ON sim.edit_uid = e.id WHERE sim.id = '".(int)$mid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ $edit = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+
+
+ echo '<div class="info">';
+
+ if ( count($avtor) > 0 ) {
+ echo '<div>'.$lang['srv_invitation_author'].' '.implode(' ',$avtor).'</div>';
+ }
+ if ( count($avtor) > 0 ) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['insert_time'])).'">'.$lang['srv_invitation_author_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+ if (trim($sql_row['ename'])) {
+ $edit[] = trim ($sql_row['ename']);
+ }
+ if (trim($sql_row['esurname'])) {
+ $edit[] = trim ($sql_row['esurname']);
+ }
+
+ if ( count($edit) > 0 && $edit != $avtor) {
+ echo '<div>'.$lang['srv_invitation_changed'].' '.implode(' ',$edit).'</div>';
+ }
+ if ($sql_row['insert_time'] != $sql_row['edit_time']) {
+ echo '<div title="'.date("d.m.Y H:i:s",strtotime($sql_row['edit_time'])).'">'.$lang['srv_invitation_changed_day'].' '.date("d.m.Y",strtotime($sql_row['insert_time'])).'</div>';
+ }
+
+ echo '<div style="max-width:202px">'.$lang['srv_invitation_comment'].' '. trim ($sql_row['comment']).'</div>';
+
+ echo '</div>';
+
+
+ echo '</fieldset>'; #inv_messages_profiles_holder
+
+
+ $MA = new MailAdapter($this->sid, $type='invitation');
+
+ # zlistamo seznam vseh sporočil
+ # izpišemo primer besedila
+ echo '<fieldset id="inv_msg_preview_hld" class="right_holder">';
+
+ echo '<legend>'.$lang['message'].' '.Help::display('srv_inv_message_title_noEmail').'</legend>';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
+
+
+ echo '<div id="inv_msg_preview">';
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <input type="text" id="inv_message_subject" class="medium" value="'.$preview_message['subject_text'].'" autocomplete="off">';
+ echo '</div>';
+
+
+ echo '<div class="setting_item">';
+ echo ' <label>'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <textarea id="inv_message_body" name="inv_message_body" autocomplete="off">'.($preview_message['body_text']).'</textarea>';
+ echo '</div>';
+
+
+ ?>
+ <script type="text/javascript"> create_editor('inv_message_body', false); </script>
+ <?php
+
+ $urls = $this->getUrlLists();
+ if (count($urls) > 0) {
+
+ echo '<div class="setting_item">';
+
+ echo '<label>'.$lang['srv_inv_message_draft_url'].'</label>';
+
+ echo '<select id="inv_message_url" class="dropdown medium">';
+ foreach ($urls AS $url) {
+ $selected = '';
+ if ($preview_message['url'] == '') {
+ if ($preview_message['dc'] == true) {
+ $selected = ' selected="selected"';
+ }
+ } else if ($preview_message['url'] == $url['url']) {
+ $selected = ' selected="selected"';
+ }
+ echo '<option value="'.$url['url'].'"'.$selected.'>'.$url['name'].'</option>';
+ }
+ echo '</select>';
+
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['srv_invitation_message_saveNew'].'" onclick="inv_message_save_advanced(\''.$mid.'\'); return false;">'.$lang['srv_invitation_message_saveNew'].'</button>';
+ echo ' <button class="white-blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="if(inv_message_save_simple_noEmail(\''.$mid.'\')) { window.location.reload() }; return false;">'.$lang['srv_inv_message_save'].'</button>';
+ echo ' <button class="blue medium" title="'.$lang['srv_invitation_forward'].'" onclick="inv_message_save_forward_noEmail(\''.$mid.'\'); return false;">'.$lang['srv_invitation_forward'].'</button>';
+ echo '</div>';
+
+
+ echo '</fieldset>';
+ }
+
+ echo '</div>';
+ }
+ }
+
+ function checkDefaultMessage() {
+ global $lang, $global_user_id;
+
+ $sql_query = sisplet_query("SELECT id FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
+
+ $row = $this->surveySettings;
+
+ # če privzeto sporočilo ne obstaja ga skreiramo
+ if (mysqli_num_rows($sql_query) == 0 ) {
+
+ Common::getInstance()->Init($this->sid);
+
+ $reply_to = Common::getInstance()->getReplyToEmail();
+
+ # poiščemo ime seznama za sporočila
+ $naslov = $this->generateMessageName();
+
+ $body_text = ($row['usercode_required'] == 1) ? $lang['srv_inv_message_body_text'].$lang['srv_inv_message_body_text_pass'] : $lang['srv_inv_message_body_text'];
+
+ # skreiramo osnovno sporočilo
+ $sqlQuery = sisplet_query("INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, reply_to, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) VALUES ('$this->sid', '".$naslov."', '".$lang['srv_inv_message_subject_text']."', '".$body_text."', '".$reply_to."', '1', '".$global_user_id."', NOW(), '', '".$global_user_id."', NOW(), '')");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ $new_msg_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ if ((int)$new_msg_id > 0) {
+ return true;
+ }
+ else {
+ # insert ni uspel, in privzetega sporočila nimamo
+ return false;
+ }
+ }
+ else {
+ # če smo tu, imamo privzeto sporočilo
+ return true;
+ }
+ }
+
+ function makeDefaultMessage($mid = null) {
+ # preverimo kater message je trenutno privzet
+ $sql_string = "SELECT id FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sql_query = sisplet_query($sql_string);
+ list($def_id) = mysqli_fetch_row($sql_query);
+ if ((int)$def_id > 0 && (int)$mid > 0 && (int)$def_id != (int)$mid) {
+ # odstranimo privzet id in ga nastavimo na novo
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '0' WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ # nastavimo na nov id
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '1' WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ sisplet_query("COMMIT");
+ }
+ $this->viewMessage($mid);
+ }
+
+ function makeDefaultFromPreview($mid = null) {
+ # preverimo kater message je trenutno privzet
+ $sql_string = "SELECT id FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sql_query = sisplet_query($sql_string);
+ list($def_id) = mysqli_fetch_row($sql_query);
+ if ((int)$def_id > 0 && (int)$mid > 0 && (int)$def_id != (int)$mid) {
+ # odstranimo privzet id in ga nastavimo na novo
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '0' WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ # nastavimo na nov id
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '1' WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ sisplet_query("COMMIT");
+ }
+ $this->displayMessagePreview();
+ }
+
+ /**
+ * shranimo v obstoječ profil
+ */
+ function save_message_simple() {
+ global $lang, $global_user_id;
+ $return = array('msg'=>'', 'error'=>'0');
+
+ # shranimo vsebino
+ #če so kakšne napake jih prikažemo v float oknu
+ $mid = (int)$_POST['mid'];
+ $subject = trim($_POST['subject']);
+ $replyto = trim($_POST['replyto']);
+ $body = trim($_POST['body']);
+ $url = trim($_POST['url']);
+
+ $newline = '';
+ if ($replyto == null || $replyto == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_from'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_replyto'] = '1';
+ $newline= '<br/>';
+ } else {
+ if (!$this->validEmail($replyto)) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_from'].'"'.$lang['srv_inv_msg_3_not_valid_email'];
+ $return['inv_message_replyto'] = '1';
+ $newline= '<br/>';
+ }
+
+ }
+ if ($subject == null || $subject == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_subject'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_subject'] = '1';
+ $newline= '<br/>';
+ }
+
+ if ($body == null || $body == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_body'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_body'] = '1';
+ $newline= '<br/>';
+ }
+
+
+ $sql_string = '';
+
+ # če ni napak shranim:
+ if ( $return['error'] == '0') {
+
+ if ((int)$mid > 0) {
+ # shranjujemo v obstoječ msg
+ $sql_string = "UPDATE srv_invitations_messages SET subject_text = '$subject', body_text = '$body', reply_to = '$replyto', edit_uid = '".$global_user_id."', edit_time = NOW(), url='".$url."' WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ $return['mid'] = $mid;
+
+ if ( $sqlQuery != 1) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ }
+ } else {
+ # mid manjka
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4']; $newline= '<br/>';
+ }
+ sisplet_query("COMMIT");
+ }
+
+ $return['msg'] .= ' '.$sql_string;
+
+ echo json_encode($return);
+
+ exit;
+ }
+
+ /**
+ * shranimo v obstoječ profil
+ */
+ function save_message_simple_noEmail() {
+ global $lang, $global_user_id;
+ $return = array('msg'=>'', 'error'=>'0');
+
+ # shranimo vsebino
+ #če so kakšne napake jih prikažemo v float oknu
+ $mid = (int)$_POST['mid'];
+ $subject = trim($_POST['subject']);
+ $body = trim($_POST['body']);
+ $url = trim($_POST['url']);
+
+ $newline = '';
+ if ($subject == null || $subject == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_subject'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_subject'] = '1';
+ $newline= '<br/>';
+ }
+
+ if ($body == null || $body == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_body'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_body'] = '1';
+ $newline= '<br/>';
+ }
+ # če ni napak shranim:
+ if ( $return['error'] == '0') {
+
+ if ((int)$mid > 0) {
+ # shranjujemo v obstoječ msg
+ $sql_string = "UPDATE srv_invitations_messages SET subject_text = '$subject', body_text = '$body', edit_uid = '".$global_user_id."', edit_time = NOW(), url='".$url."' WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ $return['mid'] = $mid;
+
+ if ( $sqlQuery != 1) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ }
+ } else {
+ # mid manjka
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4']; $newline= '<br/>';
+ }
+ sisplet_query("COMMIT");
+ }
+ $return['msg'].=' '.$sql_string;
+ echo json_encode($return);
+ exit;
+ }
+
+ function messageSaveforward() {
+ global $lang, $global_user_id;
+ $return = array('msg'=>'', 'error'=>'0');
+
+ #če so kakšne napake jih prikažemo v float oknu
+ $subject = trim($_POST['subject']);
+ $replyto = trim($_POST['replyto']);
+ $body = trim($_POST['body']);
+ $url = trim($_POST['url']);
+
+ $sql_string = '';
+ $sql_insert = '';
+
+ $newline = '';
+ if ($replyto == null || $replyto == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_from'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_replyto'] = '1';
+ $newline= '<br/>';
+ } else {
+ if (!$this->validEmail($replyto)) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_from'].'"'.$lang['srv_inv_msg_3_not_valid_email'];
+ $return['inv_message_replyto'] = '1';
+ $newline= '<br/>';
+ }
+ }
+ if ($subject == null || $subject == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_subject'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_subject'] = '1';
+ $newline= '<br/>';
+ }
+
+ if ($body == null || $body == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_body'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_body'] = '1';
+ $newline= '<br/>';
+ }
+ # če ni napak shranim:
+ if ( $return['error'] == '0') {
+
+ # preverimo ali je kakšna sprememba, če je sprememba shranimo v nov profil
+ $sql_string = "SELECT subject_text, body_text, reply_to, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id='".(int)$_POST['mid']."'";
+ $sql_query = sisplet_query($sql_string);
+ list($old_subject, $old_body_text, $old_reply_to, $old_url) = mysqli_fetch_row($sql_query);
+
+ if ($old_subject != $subject || $old_body_text != $body || $old_reply_to != $replyto || $old_url != $url) {
+
+ # shranjujemo v novo sporočilo
+ $naslov = $this->generateMessageName();
+ $sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, reply_to, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '$replyto', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ $newID = mysqli_insert_id($GLOBALS['connect_db']);
+ if ($newID > 0) {
+
+ $return['mid'] = $newID;
+
+ # popravmo še isdefault pri starem zapisz
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '0' WHERE ank_id = '$this->sid' AND id != '$newID'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ } else {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ }
+
+ }
+ sisplet_query("COMMIT");
+ }
+ $return['msg'].=' '.$sql_string.$sql_insert;
+ echo json_encode($return);
+ exit;
+ }
+
+ function messageSaveforwardNoEmail() {
+ global $lang, $global_user_id;
+ $return = array('msg'=>'', 'error'=>'0');
+
+ #če so kakšne napake jih prikažemo v float oknu
+ $subject = trim($_POST['subject']);
+ $body = trim($_POST['body']);
+ $url = trim($_POST['url']);
+
+ $newline = '';
+
+ if ($subject == null || $subject == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_subject'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_subject'] = '1';
+ $newline= '<br/>';
+ }
+
+ if ($body == null || $body == '' ) {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_field'].'"'.$lang['srv_inv_message_draft_content_body'].'"'.$lang['srv_inv_msg_3_not_empty'];
+ $return['inv_message_body'] = '1';
+ $newline= '<br/>';
+ }
+ # če ni napak shranim:
+ if ( $return['error'] == '0') {
+
+ # preverimo ali je kakšna sprememba, če je sprememba shranimo v nov profil
+ $sql_string = "SELECT subject_text, body_text, reply_to, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id='".(int)$_POST['mid']."'";
+ $sql_query = sisplet_query($sql_string);
+ list($old_subject, $old_body_text, $old_reply_to, $old_url) = mysqli_fetch_row($sql_query);
+
+ if ($old_subject != $subject || $old_body_text != $body || $old_url != $url) {
+
+ # shranjujemo v novo sporočilo
+ $naslov = $this->generateMessageName();
+ $sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, subject_text, body_text, isdefault, uid, insert_time, comment, edit_uid, edit_time, url ) ".
+ "VALUES ('$this->sid', '$naslov', '$subject', '$body', '1', '$global_user_id', NOW(), '', '$global_user_id', NOW(), '$url')";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ $newID = mysqli_insert_id($GLOBALS['connect_db']);
+ if ($newID > 0) {
+
+ $return['mid'] = $newID;
+
+ # popravmo še isdefault pri starem zapisz
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '0' WHERE ank_id = '$this->sid' AND id != '$newID'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ } else {
+ $return['error'] = '1';
+ $return['msg'] .= $newline.$lang['srv_inv_msg_4'];
+ }
+
+ }
+ sisplet_query("COMMIT");
+ }
+ $return['msg'].=' '.$sql_string.$sql_insert;
+ echo json_encode($return);
+ exit;
+ }
+
+ function addUrl($what) {
+ global $site_url;
+
+ if ($what == null || trim($what) == '') {
+ $what = 'add_recipients_view';
+ }
+ $url = $site_url . 'admin/survey/index.php?anketa='.$this->sid.'&amp;a='.A_INVITATIONS.'&amp;m='.$what;
+
+ return $url;
+ }
+
+ /**
+ Validate an email address.
+ */
+ function validEmail($email = null) {
+ return Common::getInstance()->validEmail($email);
+ }
+
+ function displayRecipentsErrors($result) {
+ global $lang;
+ $valid_recipiens = is_array($result['valid_recipiens']) ? $result['valid_recipiens'] : array();
+ $invalid_password = is_array($result['invalid_password']) ? $result['invalid_password'] : array();
+ $invalid_email = is_array($result['invalid_email']) ? $result['invalid_email'] :array();
+ $duplicate_email = is_array($result['duplicate_email']) ? $result['duplicate_email'] : array();
+ $unsubscribed = is_array($result['unsubscribed']) ? $result['unsubscribed'] : array();
+
+ # dodani so bili nekateri uporabniki
+ if (count($valid_recipiens) > 0) {
+ echo '<div id="inv_recipiens_added">';
+ echo $lang['srv_inv_recipiens_add_success_cnt'].'<span class="inv_count"><span class="as_link" onclick="$(\'#invRecipiensList1\').toggle();">'. count($valid_recipiens).'</span></span>';
+ echo '<br />';
+ echo '<div id="invRecipiensList1" class="displayNone"><br/>';
+
+ foreach ($valid_recipiens AS $fields) {
+ if (is_array($fields)) {
+
+ $text = '';
+ $text .= mb_strtolower($fields['inv_field_email']);
+
+ if (isset($fields['inv_field_firstname']) && trim($fields['inv_field_firstname']) != '') {
+ $text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_firstname'], 'UTF-8'));
+ }
+ if (isset($fields['inv_field_lastname']) && trim($fields['inv_field_lastname']) != '') {
+ $text .= ', '.str_replace("|~|", ",", mb_strtolower($fields['inv_field_lastname'], 'UTF-8'));
+ }
+
+ echo $text;
+ }
+ else {
+ echo mb_strtolower($fields, 'UTF-8');
+ }
+ echo '<br/>';
+ }
+
+ echo '</div>';
+ echo '</div>';
+ }
+
+ if ( (count($invalid_password) + count($invalid_email) + count($duplicate_email) + count($unsubscribed)) > 0 ) {
+ echo '<div id="inv_recipiens_rejected">';
+
+ # ni veljavnih uporabnikov
+ if (count($valid_recipiens) == 0 ) {
+ echo '<span class="red bold">'.$lang['srv_inv_recipiens_add_error'].'</span><br/>';
+ }
+ # zavrnjeni uporabniki
+ if (count($unsubscribed)> 0) {
+ echo $lang['srv_inv_recipiens_add_optedout_cnt'].'<span class="inv_count"><span class="as_link" onclick="$(\'#invRecipiensList2\').toggle();">'.count($unsubscribed).'</span></span>';
+ echo '<br />';
+ echo '<div id="invRecipiensList2" class="displayNone">';
+ foreach ($unsubscribed AS $fields) {
+ if (is_array($fields)) {
+ echo strtolower($fields['inv_field_email']);
+ if (trim($fields['inv_field_firstname']) != '') {
+ echo ', '.$fields['inv_field_firstname'];
+ }
+ if (trim($fields['inv_field_lastname']) != '') {
+ echo ', '.$fields['inv_field_lastname'];
+ }
+ } else {
+ echo $fields;
+ }
+ echo '<br/>';
+ }
+ echo '</div>';
+
+ }
+
+ # podvojeni uporabniki
+ if (count($duplicate_email)> 0) {
+ echo $lang['srv_inv_recipiens_add_exist_cnt'].'<span class="inv_count"><span class="as_link" onclick="$(\'#invRecipiensList3\').toggle();">'.count($duplicate_email).'</span></span>';
+ echo '<br />';
+ echo '<div id="invRecipiensList3" class="displayNone">';
+ foreach ($duplicate_email AS $fields) {
+ if (is_array($fields)) {
+ echo strtolower($fields['inv_field_email']);
+ if (trim($fields['inv_field_firstname']) != '') {
+ echo ', '.$fields['inv_field_firstname'];
+ }
+ if (trim($fields['inv_field_lastname']) != '') {
+ echo ', '.$fields['inv_field_lastname'];
+ }
+ } else {
+ echo strtolower($fields);
+ }
+ echo '<br/>';
+ }
+ echo '</div>';
+ }
+
+ # neveljaven e-mail
+ if (count($invalid_email) > 0) {
+ echo $lang['srv_inv_recipiens_add_invalid_cnt'].'<span class="inv_count"><span class="as_link" onclick="$(\'#invRecipiensList4\').toggle();">'.count($invalid_email).'!</span></span>';
+ echo '<br />';
+ echo '<div id="invRecipiensList4" class="displayNone">';
+ foreach ($invalid_email AS $fields) {
+ if (is_array($fields)) {
+ echo str_replace("|~|", ",", mb_strtolower($fields['inv_field_email'], 'UTF-8'));
+ if (trim($fields['inv_field_firstname']) != '') {
+ echo ', '.str_replace("|~|", ",", $fields['inv_field_firstname']);
+ }
+ if (trim($fields['inv_field_lastname']) != '') {
+ echo ', '.str_replace("|~|", ",", $fields['inv_field_lastname']);
+ }
+ } else {
+ echo str_replace("|~|", ",", mb_strtolower($fields, 'UTF-8'));
+ }
+ echo '<br/>';
+ }
+ echo '</div>';
+ }
+
+ # neveljavena gesla
+ if (count($invalid_password) > 0) {
+ echo $lang['srv_inv_recipiens_add_invalid_password_cnt'].'<span class="inv_count"><span class="as_link" onclick="$(\'#invRecipiensList5\').toggle();">'.count($invalid_password).'!</span></span>';
+ echo '<br />';
+ echo '<div id="invRecipiensList5" class="displayNone">';
+ foreach ($invalid_password AS $fields) {
+ if (is_array($fields)) {
+ echo strtolower($fields['inv_field_email']);
+ if (trim($fields['inv_field_firstname']) != '') {
+ echo ', '.$fields['inv_field_firstname'];
+ }
+ if (trim($fields['inv_field_lastname']) != '') {
+ echo ', '.$fields['inv_field_lastname'];
+ }
+ } else {
+ echo strtolower($fields);
+ }
+ echo '<br/>';
+ }
+ echo '</div>';
+ }
+
+ if (count($invalid_email) > 0 || count($invalid_password) > 0) {
+ //echo ''.$lang['srv_inv_recipiens_add_invalid_note'];
+ echo '<br /><span class="red">'.$lang['srv_inv_recipiens_add_invalid_note2'].'!</span>';
+ echo Help::display('srv_inv_recipiens_add_invalid_note');
+ }
+ echo '</div>';
+
+ return array_merge($unsubscribed, $duplicate_email, $invalid_email, $invalid_password) ;
+ }
+ return array();
+ }
+
+ function displayNavigation() {
+ global $lang, $admin_type, $global_user_id;
+
+ $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ #če ni dostopa mu ne prikažemo linkov
+ if ((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')) {
+ }
+ else {
+ return false;
+ }
+
+ if (!isset($_POST['noNavi']) || (isset($_POST['noNavi']) && $_POST['noNavi'] != 'true')) {
+ $_sub_action = isset($_GET['m']) ? $_GET['m'] : null;
+
+ if ($_sub_action == null && $_GET['t'] == 'invitations') {
+ if ($_GET['a'] == 'use_recipients_list') {
+ $_sub_action = 'add_recipients_view';
+ }
+ if ($_GET['a'] == 'view_message'
+ || $_GET['a'] == 'make_default'
+ || $_GET['a'] == 'delete_msg_profile' ) {
+ $_sub_action = 'view_message';
+ }
+ if ($_GET['a'] == 'delete_recipient'
+ || $_GET['a'] == 'add_recipients'
+ || $_GET['a'] == 'view_recipients'
+ || $_GET['a'] == 'export_recipients'
+ || $_GET['a'] == 'add_checked_users_to_database'
+ || $_GET['a'] == 'setAdvancedCondition'
+ || $_GET['a'] == 'recipientsAddForward') {
+ $_sub_action = 'view_recipients';
+ }
+ if ($_GET['a'] == 'view_archive' ) {
+ $_sub_action = 'view_archive';
+ }
+ if ($_GET['a'] == 'send_mail') {
+ $_sub_action = 'send_message';
+ #$_sub_action = 'view_archive';
+ }
+ } else if( $_sub_action == 'send_mail') {
+ #$_sub_action = 'view_archive';
+ $_sub_action = 'send_message';
+ }
+
+ $active_step = array(1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>'',8=>'',9=>'');
+ switch ($_sub_action) {
+ case 'inv_settings':
+ $active_step['1'] = ' active';
+ break;
+ case 'add_recipients_view':
+ $active_step['2'] = ' active';
+ break;
+ case 'view_recipients':
+ $active_step['3'] = ' active';
+ break;
+ case 'view_message':
+ $active_step['4'] = ' active';
+ break;
+ case 'send_message':
+ $active_step['5'] = ' active';
+ break;
+ case 'view_archive':
+ $active_step['6'] = ' active';
+ break;
+ case 'inv_lists':
+ $active_step['7'] = ' active';
+ break;
+ case 'inv_server':
+ $active_step['8'] = ' active';
+ break;
+ case 'inv_status':
+ $active_step['9'] = ' active';
+ break;
+
+ default:
+ $sql = sisplet_query("SELECT EXISTS (SELECT 1 FROM srv_invitations_archive WHERE ank_id='".$this->sid."')");
+ $row = mysqli_fetch_array($sql);
+
+ // Ce imamo ze posiljanje je default stran "Pregled"
+ if($row[0] == 1)
+ $active_step['9'] = ' active';
+ // Drugace je default stran "Nastavitve"
+ else
+ $active_step['1'] = ' active';
+ break;
+ }
+
+ if (SurveyInfo::getInstance()->checkSurveyModule('email') || SurveyInfo::getInstance()->checkSurveyModule('phone')) {
+ $disabled = false;
+ $css_disabled = '';
+ }
+ else {
+ $disabled = true;
+ $css_disabled = 'disabled';
+ }
+
+ if($isEmail) {
+
+ echo '<div id="inv_top_navi">';
+
+
+ // Step 1 - nastavitve
+ echo '<div class="inv_step '.$active_step[1].'">';
+ echo ' <a href="'.$this->addUrl('inv_settings').'" class="noline">';
+ echo ' <span class="number">1</span>'.$lang['srv_inv_nav_email_settings'];
+ echo ' </a>';
+ echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 2 - dodaj
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[2].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('add_recipients_view').'" class="noline">';
+ }
+ echo ' <span class="number">2</span>'.$lang['srv_inv_nav_add_recipients'];
+ if ($disabled == false) {
+ echo ' </a>';
+ }
+ echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 3 - preglej
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[3].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('view_recipients').'" class="noline">';
+ }
+ echo ' <span class="number">3</span>'.$lang['srv_inv_nav_edit_recipiens'];
+ if ($disabled == false) {
+ echo ' </a>';
+ }
+ echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 4 - sporocilo
+
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[4].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('view_message').'" class="noline">';
+ }
+ echo ' <span class="number">4</span>'.$lang['srv_inv_nav_edit_message'];
+ if ($disabled == false) {
+ echo ' </a>';
+ }
+ echo '</div>';
+
+
+ // Space
+ echo '<div class="inv_space"></div>';
+
+
+ // Step 5 - poslji
+ echo '<div class="inv_step '.$css_disabled.' '.$active_step[5].'">';
+ if ($disabled == false) {
+ echo ' <a href="'.$this->addUrl('send_message').'" class="noline">';
+ }
+ echo ' <span class="number">5</span>'.$lang['srv_inv_nav_send_message'];
+ if ($disabled == false) {
+ echo ' </a>';
+ }
+ echo '</div>';
+
+
+ // Nastavitve zgoraj desno
+ echo '<div class="inv_nav_settings">';
+
+ // Pregled
+ echo '<div class="inv_step '.$active_step[9].'">';
+ echo ' <a href="'.$this->addUrl('inv_status').'" class="noline">';
+ echo ' <span class="faicon chart"></span>'.$lang['srv_inv_nav_email_review'];
+ echo ' </a>';
+ echo '</div>';
+
+ // Seznami
+ echo '<div class="inv_step '.$active_step[7].'">';
+ echo ' <a href="'.$this->addUrl('inv_lists').'" class="noline">';
+ echo ' <span class="faicon phonebook"></span>'.$lang['srv_inv_nav_email_lists'];
+ echo ' </a>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '</div>';
+ }
+
+ }
+ echo '<input type="hidden" id="surveyConditionPage" value="invitations">';
+ }
+
+ function sendMessage() {
+ global $lang, $site_url;
+
+ // Ali posiljamo maile ali ne
+ $noEmailing = SurveySession::get('inv_noEmailing');
+
+ $row = $this->surveySettings;
+
+
+ # Pripravimo izbor komu lahko pošiljamo
+ echo '<div class="invitations_top_settings">';
+
+ // Text s podatki o nastavitvah posiljanja
+ $settings_text = '<span>'.$lang['srv_inv_message_type'].': </span>';
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+ if($individual == 0){
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span>'.$lang['srv_inv_settings_individual_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($noEmailing == 0){
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_0'].'</span>';
+ }
+ else{
+ $settings_text .= '<span>'.$lang['srv_inv_settings_noEmail_1'].'</span>';
+ }
+
+ $settings_text .= ' - ';
+
+ if($row['usercode_required'] == 0 && $individual != 0){
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_0'];
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_0'].')</span>';
+ }
+ else{
+ $settings_text .= '<span>'.$lang['srv_inv_settings_URL_1'];
+
+ if($row['usercode_skip'] == 1 || $individual == 0){
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_2'].')</span>';
+ }
+ else{
+ $settings_text .= ' ('.$lang['srv_inv_settings_code_1'].')</span>';
+ }
+ }
+
+ $settings_text .= '<a href="'.$site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_settings" title="'.$lang['edit4'].'"><span class="faicon edit"></span></a>';
+
+ echo $settings_text;
+
+ echo '</div>';
+
+
+ if ($this->checkDefaultMessage() == false) {
+ echo '<div class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</div>';
+
+ exit();
+ }
+
+ echo '<div id="inv_send_mail" class="invitations_holder half-half invitations_send">';
+
+ # damo v tabelo zaradi prilagajanja oblike levo/desno
+ echo '<div class="left_holder">';
+
+ // Pri volitvah vedno posiljamo samo tistim, katerim se nismo poslali
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
+
+ echo '<fieldset><legend>'.$lang['srv_notifications_send_reciever2'].'</legend>';
+
+ echo '<div class="setting_item ver">';
+
+ echo ' <span>'.$lang['srv_inv_send_who_database'].'</span>';
+
+ echo '<div class="flex_row">';
+ echo ' <input type="radio" name="mailsource" id="mailsource_0" value="0" onclick="mailToSourceChange();" checked="checked"><label for="mailsource_0">'.$lang['srv_inv_send_who_all_units'].'</label>';
+ $this->advancedCondition();
+ echo '</div>';
+
+ echo ' <input type="radio" name="mailsource" id="mailsource_1" value="1" onclick="mailToSourceChange();"><label for="mailsource_1">'.$lang['srv_inv_send_who_archive'].'</label>';
+ echo ' <input type="radio" name="mailsource" id="mailsource_2" value="2" onclick="mailToSourceChange();"><label for="mailsource_2">'.$lang['srv_inv_send_who_lists'].'</label>';
+
+ echo '</div>';
+
+
+ echo '<div id="inv_select_mail_to_source_lists">';
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $this->displayMailToSourceLists($source_type);
+ echo '</div>'; #id="inv_select_mail_to_source_lists"
+
+ # polovimo sporočilo in prejemnike
+ $sql_query_m = sisplet_query("SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
+ if (mysqli_num_rows($sql_query_m) > 0 ) {
+ $preview_message = mysqli_fetch_assoc($sql_query_m);
+ }
+ else {
+ #nimamo še vsebine sporočila skreiramo privzeto.
+ echo '<span class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</span>';
+
+ exit();
+ }
+
+ echo '</fieldset>';
+ }
+
+ echo '</div>';
+
+
+ // Desna stran
+ echo '<div class="right_holder">';
+
+ // Ce posiljamo preko navadne poste ali smsov, nimamo sporocila
+ if($noEmailing == 0){
+
+ echo '<fieldset id="inv_select_mail_preview"><legend>'.$lang['message'].'</legend>';
+ echo '<input type="hidden" name="noMailing" value="0" />';
+ $this->displayMessagePreview();
+ echo '</fieldset>';
+
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
+ $this->selectSendTo();
+ echo '</fieldset>';
+ }
+ else{
+ echo '<fieldset id="inv_select_mail_to_respondents"><legend>'.$lang['srv_inv_nav_email_invitations'].'</legend>';
+
+ echo '<input type="hidden" name="noMailing" value="1" />';
+
+ $noEmailingType = SurveySession::get('inv_noEmailing_type');
+ echo '<input type="hidden" name="noMailingType" value="'.$noEmailingType.'" />';
+
+ $this->selectSendToNoEmailing();
+
+ echo '</fieldset>';
+ }
+
+ echo '</div>';
+
+
+ echo '</div>'; //inv_send_mail
+ }
+
+ function displayMailToSourceLists($source_type) {
+ global $lang, $site_url;
+
+ $canShowSubOption = false;
+
+ echo '<div class="setting_item ver">';
+ echo ' <span>'.$lang['srv_inv_send_who_create1'].'<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a=invitations&m=inv_lists" class="noline">'.$lang['srv_inv_send_who_create2'].'</a></span>';
+ echo '</div>';
+
+
+ echo '<div class="setting_item ver">';
+
+ if ((int)$source_type == 0) {
+ # vsi respondenti v bazi
+ echo $lang['srv_inv_send_who_database_note'];
+ $canShowSubOption = true;
+ }
+ elseif ((int)$source_type == 1) {
+ # Arhivi pošiljanja
+
+ # poiščemo arhiv mailingov
+ # zloopamo še po posameznih pošiljanjih
+ $sql_string_arc = "SELECT sia.*, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' ORDER BY sia.date_send ASC;";
+ $sql_query_arc = sisplet_query($sql_string_arc);
+
+ if (mysqli_num_rows($sql_query_arc) > 0) {
+
+ $canShowSubOption = true;
+
+ echo $lang['srv_inv_send_who_archive_note'];
+
+ echo '<table id="tbl_recipients_source_list">';
+
+ echo '<tr>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_address'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo '</tr>';
+
+ while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
+ echo '<tr>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$row_arc['naslov'].'</td>';
+
+ echo ' <td class="anl_ac">'.((int)$row_arc['cnt_succsess']+(int)$row_arc['cnt_error']).'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
+ echo '</tr>';
+ }
+
+ echo '</table>';
+ }
+ else{
+ echo $lang['srv_inv_send_who_archive_no_archive'];
+ }
+ }
+ elseif ((int)$source_type == 2) {
+ # seznami respondentov
+
+ # zloopamo skozi posamezne sezname respondentov
+ $sql_string_arc ="";
+ $sql_query_arc = sisplet_query("SELECT list_id as id, COUNT(*) as cnt_succsess, list_id, sirp.name as naslov, DATE_FORMAT(sirp.insert_time,'%d.%m.%Y, %T') AS ds
+ FROM srv_invitations_recipients AS sir
+ LEFT JOIN srv_invitations_recipients_profiles AS sirp
+ ON sir.list_id = sirp.pid
+ WHERE ank_id ='".$this->sid."' AND sir.deleted ='0' group BY list_id
+ ");
+
+ if (mysqli_num_rows($sql_query_arc) > 0) {
+
+ $canShowSubOption = true;
+
+ echo $lang['srv_inv_send_who_all_units_note'];
+
+ echo '<table id="tbl_recipients_source_list">';
+
+ echo '<tr>';
+ echo ' <th class="tbl_icon">&nbsp;</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_list_name'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_respondents'].'</th>';
+ echo ' <th>'.$lang['srv_inv_send_who_table_date_create'].'</th>';
+ echo '</tr>';
+
+ while ($row_arc = mysqli_fetch_assoc($sql_query_arc)) {
+
+ if ($row_arc['id'] > 0 && $row_arc['naslov'] == '') {
+ # če ni imena in je id < 0 je bil izbrisan
+ }
+ else {
+ if ($row_arc['id'] > 0) {
+ if ($row_arc['naslov'] != '') {
+ $_naslov = $row_arc['naslov'];
+ }
+ else {
+ $_naslov = $lang['srv_inv_send_who_table_list_deleted'];
+ }
+ }
+ else if ($row_arc['id'] == 0) {
+ $_naslov = $lang['srv_inv_send_who_table_list_temporary'];
+ }
+ else if ($row_arc['id'] < 0) {
+ $_naslov = $lang['srv_inv_send_who_table_list_noname'];
+ }
+
+ echo '<tr>';
+ echo ' <td class="tbl_icon">';
+ echo ' <input type="checkbox" name="mailsource_lists[]" id="mailsource_lists_'.$row_arc['id'].'" onchange="mailToSourceCheckboxChange();" value="'.$row_arc['id'].'"><label for="mailsource_lists_'.$row_arc['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$_naslov.'</td>';
+
+ echo ' <td class="anl_ac">'.$row_arc['cnt_succsess'].'</td>';
+
+ echo ' <td>'.$row_arc['ds'].'</td>';
+ echo '</tr>';
+ }
+ }
+ echo '</table>';
+ }
+ else{
+ echo $lang['srv_inv_send_who_no_lists'];
+ }
+ }
+
+ echo '</div>';
+
+
+ if ($canShowSubOption == true) {
+
+ echo '<div id="inv_select_mail_to" class="setting_item ver">';
+
+ echo '<span class="semi-bold">'.$lang['srv_inv_send_note'].'</span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto0" value="0" type="radio" checked="checked" onclick="mailToRadioChange();"><label for="mailto0">' . $lang['srv_inv_send_recipients0'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto1" value="1" type="radio" onclick="mailToRadioChange();"><label for="mailto1">' . $lang['srv_inv_send_recipients1'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto2" value="2" type="radio" onclick="mailToRadioChange();"><label for="mailto2">' . $lang['srv_inv_send_recipients2'] . '</label></span>';
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto3" value="3 " type="radio" onclick="mailToRadioChange();"><label for="mailto3">' . $lang['srv_inv_send_recipients3'] . '</label></span>';
+
+ echo '<span class="inv_send_span"><input name="mailto" id="mailto4" value="4 " type="radio" onclick="mailToRadioChange();"><label for="mailto4">' . $lang['srv_inv_send_recipients4'] . '</label></span>';
+
+ echo '<div id="inv_send_advanced_div" class="setting_item ver">';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="0" type="checkbox" id="mailto_status_0" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_0">0 - ' . $lang['srv_userstatus_0'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="1" type="checkbox" id="mailto_status_1" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_1">1 - ' . $lang['srv_userstatus_1'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="2" type="checkbox" id="mailto_status_2" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_2">2 - ' . $lang['srv_userstatus_2'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="3" type="checkbox" id="mailto_status_3" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_3">3 - ' . $lang['srv_userstatus_3'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="4" type="checkbox" id="mailto_status_4" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_4">4 - ' . $lang['srv_userstatus_4'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="5" type="checkbox" id="mailto_status_5" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_5">5 - ' . $lang['srv_userstatus_5'] . '</label></span>';
+ echo ' <span class="inv_send_span shift gray"><input name="mailto_status[]" value="6" type="checkbox" id="mailto_status_6" onclick="mailTocheCheckboxChange();" disabled="disabled"><label for="mailto_status_6">6 - ' . $lang['srv_userstatus_6'] . '</label></span>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+
+ function selectSendTo($send_type = 0, $checkboxes = array()) {
+ global $lang, $site_url, $global_user_id;
+
+ $_msg = '';
+ $cnt = 0;
+ if ((int)$this->surveySettings['active'] !== 1) {
+
+ $activity = SurveyInfo:: getSurveyActivity();
+ $_last_active = end($activity);
+
+ echo $lang['srv_inv_error9'];
+ echo '<a href="#" onclick="anketa_active(\'' . $this->sid . '\',\'' . (int)$this->surveySettings['active'] . '\'); return false;" title="' . $lang['srv_anketa_noactive'] . '">';
+ if ((int)$_last_active > 0 ) {
+ # anketa je zaključena
+ echo ' <span id="srv_inactive">'.$lang['srv_inv_activate_survey_here'].'</span>';
+ } else {
+ # anketa je neaktivna
+ echo ' <span id="srv_inactive">'.$lang['srv_inv_activate_survey_here'].'</span>';
+ }
+ echo '</a>';
+ }
+ # anketa je aktivna lahko pošiljamo
+ else {
+
+ // Preverimo ce je vklopljen modul za volitve - obvestilo, da ni naknadnega posiljanja
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ echo '<p class="bold red">'.$lang['srv_voting_no_duplicates'].'</p>';
+ }
+
+ $sql_string = "SELECT comment FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sql_query = sisplet_query($sql_string);
+ list($comment) = mysqli_fetch_row($sql_query);
+
+ $_msg = '<span>'.$lang['srv_invitation_note3'].'</span>';
+ if (isset($_POST['send_type'])) {
+ $send_type = (int)$_POST['send_type'];
+ }
+ $checkboxes = array();
+ if (isset($_POST['checkboxes']) && trim($_POST['checkboxes']) != '') {
+ $checkboxes = explode(',',$_POST['checkboxes']);
+ }
+
+ $source_type = isset($_POST['source_type']) ? (int)$_POST['source_type'] : 0;
+ $source_lists = isset($_POST['source_lists']) ? trim($_POST['source_lists']) : '';
+
+ $respondents = $this->getRespondents2Send($send_type, $checkboxes, $source_type, $source_lists);
+ #koliko strani imamp
+ $numRespondents = count($respondents);
+ $pages = ceil($numRespondents / $this->rec_send_page_limit);
+ if (count($respondents) > 0) {
+
+ echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail" method="post">';
+
+ echo '<div class="inv_send_mail_send_type">';
+
+ // Način pošiljanja
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type'].': '.$lang['email'].'</span>';
+ echo '</div>';
+
+
+ // Komentar pri posiljanju
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
+
+ // Pobrisi podvojene maile
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
+ echo '</div>';
+
+ // Gumb Poslji
+ echo '<div id="inv_send_mail_btn" class="setting_item ver">';
+ echo ' <button class="blue medium" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_send'].'</button>';
+ echo '</div>';
+
+
+ // Seznam mailov na katere bomo poslali
+ if ((int)$this->invitationAdvancedConditionId > 0){
+ echo '<div class="setting_item ver">';
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+ echo '</div>';
+ }
+
+ # izpišemo seznam e-mailov in dodamo checkboxe
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
+
+ # izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
+ $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
+
+ echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
+ # da preprečimo večkratno pošiljanje
+ session_start();
+ list($short,$long) = $this->generateCode();
+ $_SESSION['snd_inv_token'][$this->sid] = $long;
+ echo '<input type="hidden" name="_token" id="_token" value="'.$long.'">';
+ if ($pages > 1 || $numRespondents > REC_ON_SEND_PAGE) {
+ echo '<div id="inv_pagination_content">';
+ $this->displaySendPagination($numRespondents);
+ echo '</div>';
+ }
+
+ # polovimo sezname
+ $lists = array();
+ $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $lists[$sql_row['pid']] = $sql_row['name'];
+ }
+
+ $lists['-1'] = $lang['srv_invitation_new_templist'];
+ $lists['0'] = $lang['srv_invitation_new_templist_author'];
+
+
+ echo '<table id="tbl_recipients_send_list">';
+
+ echo '<tr>';
+ echo ' <th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
+ echo ' <th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
+ echo '</tr>';
+
+ $cnt=1;
+ foreach ($respondents as $pass => $respondent) {
+ echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+ }
+
+ echo '</tr>';
+
+ $cnt++;
+ }
+ echo '</table>';
+
+
+ echo '</div>';
+
+ echo '</form>';
+ }
+ }
+ if ($cnt == 0) {
+ # ni respondentov
+ echo $_msg;
+ }
+ }
+
+ function selectSendToNoEmailing($send_type = 0, $checkboxes = array()) {
+ global $lang, $site_url, $global_user_id;
+
+ if ((int)$this->surveySettings['active'] !== 1) {
+ #anketa ni aktivna, ne pustimo pošiljanja
+ # aktivnost
+
+ $activity = SurveyInfo:: getSurveyActivity();
+ $_last_active = end($activity);
+
+ echo $lang['srv_inv_error9'];
+ echo '<a href="#" onclick="anketa_active(\'' . $this->sid . '\',\'' . (int)$this->surveySettings['active'] . '\'); return false;" title="' . $lang['srv_anketa_noactive'] . '">';
+ if ((int)$_last_active > 0 ) {
+ # anketa je zaključena
+ echo ' <span id="srv_inactive">'.$lang['srv_inv_activate_survey_here'].'</span>';
+ } else {
+ # anketa je neaktivna
+ echo ' <span id="srv_inactive">'.$lang['srv_inv_activate_survey_here'].'</span>';
+ }
+ echo '</a>';
+ } else {
+ # anketa je aktivna lahko pošiljamo
+
+ $sql_string = "SELECT comment FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'";
+ $sql_query = sisplet_query($sql_string);
+ list($comment) = mysqli_fetch_row($sql_query);
+
+ $_msg = '<span>'.$lang['srv_invitation_note3'].'</span>';
+ if (isset($_POST['send_type'])) {
+ $send_type = (int)$_POST['send_type'];
+ }
+ $checkboxes = array();
+ if (isset($_POST['checkboxes']) && trim($_POST['checkboxes']) != '') {
+ $checkboxes = explode(',',$_POST['checkboxes']);
+ }
+
+ $source_type = (int)$_POST['source_type'];
+ $source_lists = trim($_POST['source_lists']);
+
+ $respondents = $this->getRespondents2Send($send_type, $checkboxes, $source_type, $source_lists, $noEmailing=1);
+ #koliko strani imamp
+ $numRespondents = count($respondents);
+ $pages = ceil($numRespondents / $this->rec_send_page_limit);
+ if (count($respondents) > 0) {
+
+ echo '<div class="inv_send_mail_send_type">';
+
+ // Način pošiljanja
+ $noEmailingType = SurveySession::get('inv_noEmailing_type');
+ echo '<div class="setting_item ver">';
+ echo ' <span class="semi-bold">'.$lang['srv_inv_message_type_external'].': ';
+ if($noEmailingType == 1)
+ echo $lang['srv_inv_message_noemailing_type2'];
+ elseif($noEmailingType == 2)
+ echo $lang['srv_inv_message_noemailing_type3'];
+ else
+ echo $lang['srv_inv_message_noemailing_type1'];
+ echo ' </span>';
+
+ echo '</div>';
+
+
+ echo '<form id="frm_do_send" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_mail&noemailing=1" method="post">';
+
+ // Komentar pri posiljanju
+ echo '<div class="setting_item ver">';
+ echo ' <label>'.$lang['srv_inv_send_comment'].' '.Help::display('srv_inv_sending_comment').':</label>';
+ echo ' <input type="text" class="medium" name="comment" id="msg_comment" value="'.$comment.'">';
+ echo '</div>';
+
+ // Pobrisi podvojene maile
+ echo '<div class="setting_item ver">';
+ echo ' <input type="checkbox" id="dont_send_duplicated" name="dont_send_duplicated" checked="checked">';
+ echo ' <label for="dont_send_duplicated">'.$lang['srv_inv_send_remove_duplicates'].' '.Help::display('srv_inv_sending_double').'</label>';
+ echo '</div>';
+
+ // Gumb Poslji
+ echo '<div id="inv_send_mail_btn" class="setting_item hor">';
+ echo ' <button class="blue medium" style="width:auto;" onclick="$(\'#fade\').fadeTo(\'slow\', 1); $(\'#inv_send_note\').fadeTo(\'slow\',1); $(\'#frm_do_send\').submit();">'.$lang['srv_inv_nav_send_noEmailing'].'</button>';
+ echo '</div>';
+
+
+ // Seznam mailov na katere bomo poslali
+ if ((int)$this->invitationAdvancedConditionId > 0){
+
+ echo '<div class="setting_item ver">';
+
+ $scp = new SurveyCondition($this->sid);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+
+ echo '</div>';
+ }
+
+ # izpišemo seznam e-mailov in dodamo checkboxe
+ echo '<div class="setting_item ver">';
+ echo '<span>'.$lang['srv_inv_potencial_respondents'].'&nbsp;<span id="inv_num_recipients">'.count($respondents).'</span></span>';
+ echo '</div>';
+
+ # izpišemo opozorilo kadar pošiljamo na več kakor 5000 naslovov
+ $text = (Common::checkModule('gorenje')) ? $lang['srv_inv_potencial_respondents_limit_gorenje'] : $lang['srv_inv_potencial_respondents_limit'];
+ echo '<div id="inv_send_mail_limit" class="setting_item ver red semi-bold '.(count($respondents) > 4999?'':' displayNone').'">';
+ echo $text;
+ echo '</div>';
+
+ echo '<input type="hidden" name="anketa" id="anketa" value="'.$this->sid.'">';
+
+ # da preprečimo večkratno pošiljanje
+ session_start();
+ list($short,$long) = $this->generateCode();
+ $_SESSION['snd_inv_token'][$this->sid] = $long;
+ echo '<input type="hidden" name="_token" id="_token" value="'.$long.'">';
+ if ($pages > 1 || $numRespondents > REC_ON_SEND_PAGE) {
+ echo '<div id="inv_pagination_content">';
+ $this->displaySendPagination($numRespondents);
+ echo '</div>';
+ }
+
+ # polovimo sezname
+ $lists = array();
+ $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $lists[$sql_row['pid']] = $sql_row['name'];
+ }
+
+ $lists['-1'] = $lang['srv_invitation_new_templist'];
+ $lists['0'] = $lang['srv_invitation_new_templist_author'];
+
+
+ echo '<table id="tbl_recipients_send_list">';
+ echo '<tr>';
+ echo '<th class="tbl_icon"><input type="checkbox" checked="checked" onclick="invTogleSend(this);">'.'</th>';
+ echo '<th title="'.$lang['srv_inv_recipients_email'].'">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo '<th title="'.$lang['srv_inv_recipients_firstname'].'">'.$lang['srv_inv_recipients_firstname'].'</th>';
+ echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_last_status'].'</th>';
+ echo '<th title="'.$lang['srv_inv_recipients_last_status'].'">'.$lang['srv_inv_recipients_list_id'].'</th>';
+ echo '</tr>';
+ $cnt=1;
+ foreach ($respondents as $pass => $respondent) {
+
+ echo '<tr'.($cnt > $this->rec_send_page_limit ? ' class="displayNone"' : '').'>';
+
+ echo ' <td>';
+ echo ' <input type="checkbox" name="rids[]" id="rids_'.$respondent['id'].'" value="'.$respondent['id'].'" checked="checekd">';
+ echo ' <label for="rids_'.$respondent['id'].'"></label>';
+ echo ' </td>';
+
+ echo ' <td>'.$respondent['email'].'</td>';
+
+ echo ' <td>'.$respondent['firstname'].'</td>';
+
+ echo ' <td>'.$lang['srv_userstatus_'.$respondent['status']].' ('.$respondent['status'].')'.'</td>';
+
+ if ($lists[$respondent['list_id']] != '') {
+ echo ' <td>'.$lists[$respondent['list_id']].'</td>';
+ }
+ else {
+ echo ' <td>'.$lang['srv_inv_send_who_table_list_deleted'].'</td>';
+ }
+
+ echo '</tr>';
+
+ $cnt++;
+ }
+
+ echo '</table>';
+
+ echo '</form>';
+ }
+ }
+ if ($cnt == 0) {
+ # ni respondentov
+ echo $_msg;
+ }
+ }
+
+ function mailToSourceChange() {
+ $this->displayMailToSourceLists((int)$_POST['source_type']);
+ }
+
+ function viewAarchive() {
+ global $lang;
+
+ echo '<div id="div_archive_content">';
+
+ #preglej prejemnike
+ #echo '<h2>'.$lang['srv_inv_heading_step5'].$lang['srv_inv_archive_heading'].'</h2>';
+ //echo '<h2>'.$lang['srv_inv_archive_heading'].'</h2>';
+
+ # normalno pošiljanje
+ $sql_string = "SELECT sia.*, u.name, u.surname, u.email, DATE_FORMAT(sia.date_send,'%d.%m.%Y') AS ds, DATE_FORMAT(sia.date_send,'%T') AS hs FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' ORDER BY sia.date_send DESC;";
+ $sql_query = sisplet_query($sql_string);
+
+ # enostavno pošiljanje na posamezne maile
+ $SSMI = new SurveySimpleMailInvitation($this->sid);
+ $simple_recipents = $SSMI -> getRecipients();
+
+
+ echo '<fieldset><legend>'.$lang['srv_archive_invitation'].'</legend>';
+
+ if (mysqli_num_rows($sql_query) > 0 || count($simple_recipents) > 0) {
+
+ echo '<p class="bottom16">'.$lang['srv_archive_invitation_text'].'</p>';
+
+ echo '<p class="bold">'.$lang['srv_archive_invitation_text2'].'</p>';
+
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
+
+ echo '<table id="tbl_archive_list">';
+ echo '<tr>';
+ echo '<th class="lead_column" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_naslov'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_subject_text'].'">'.$lang['srv_inv_archive_subject_text'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_succsess'].'">'.$lang['srv_inv_archive_cnt_succsess'].' '.Help::display('srv_inv_archive_sent').'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_cnt_error'].'">'.$lang['srv_inv_archive_cnt_error'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_sender'].'">'.$lang['srv_inv_archive_sender'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_comment'].'">'.$lang['srv_inv_archive_comment'].'</th>';
+ echo '</tr>';
+
+ while ($row = mysqli_fetch_assoc($sql_query)) {
+ echo '<tr>';
+
+ // Datum in ura
+ echo '<td class="lead_column">'.$row['ds'].' '.$row['hs'].'</td>';
+
+ // Email sporocilo
+ echo '<td title="'.$row['naslov'].'">';
+ echo '<a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['naslov'].'</a>';
+ echo '</td>';
+
+ // Subject
+ echo '<td title="'.$row['naslov'].'">';
+ echo $row['subject_text'];
+ echo '</td>';
+
+ # uspešno poslani
+ echo '<td class="right">';
+ if ((int)$row['cnt_succsess'] > 0 ) {
+ echo '<span class="as_link as_view" id="inv_arch_1_'.$row['id'].'" data-archtype="succ">'.$row['cnt_succsess'].'</span>';
+ } else {
+ echo '<span>'.$row['cnt_succsess'].'</span>';
+ }
+ echo '</td>';
+
+ # neuspešno poslani
+ echo '<td class="right">';
+ if ((int)$row['cnt_error'] > 0 ) {
+ echo '<span class="as_link as_view" id="inv_arch_0_'.$row['id'].'" data-archtype="err">'.$row['cnt_error'].'</span>';
+ } else {
+ echo '<span>'.$row['cnt_error'].'</span>';
+ }
+ echo '</td>';
+
+ # poslal
+ $avtor = array();
+ if (trim($row['name'])) {
+ $avtor[] = trim ($row['name']);
+ }
+ if (trim($row['surname'])) {
+ $avtor[] = trim ($row['surname']);
+ }
+
+ echo '<td>';
+ echo '<span title="'.(isset($row['email']) ? $row['email'] : implode(' ',$avtor)).'">'.implode(' ',$avtor).'</span>';
+ echo '</td>';
+
+ # komentar
+ echo '<td>';
+ echo (($row['comment'] == "") ? '/' : $row['comment']);
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ echo '</tr>';
+ echo '</table>';
+
+ echo '</div>';
+ echo '</div>';
+
+ # dodamo simpl pošiljanje
+ if ( count($simple_recipents) > 0 ) {
+ if (mysqli_num_rows($sql_query) > 0) {
+ echo '<br>';
+ echo '<br>';
+ }
+ echo '<b>Prejemniki enostavnih email vabil:</b>';
+ echo '<br>';
+ echo '<br>';
+ echo '<table id="tbl_archive_list">';
+ echo '<tr>';
+ echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_date_send'].'">'.$lang['srv_inv_archive_date_send'].'</th>';
+ echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_email_address'].'">'.$lang['srv_inv_archive_email_address'].'</th>';
+ echo '<th class="tbl_inv_center" title="'.$lang['srv_inv_archive_status'].'">'.$lang['srv_inv_archive_status'].'</th>';
+ echo '<th title="'.$lang['srv_inv_archive_sender'].'">'.$lang['srv_inv_archive_sender'].'</th>';
+ echo '</tr>';
+ foreach ($simple_recipents as $row) {
+ echo '<tr>';
+ echo '<td>'.$row['send_time'].'</td>';
+ echo '<td>'.$row['email'].'</td>';
+ echo '<td class="tbl_inv_center">'.$row['state'].'</td>';
+ # poslal
+ $avtor = array();
+ if (trim($row['name'])) {
+ $avtor[] = trim ($row['name']);
+ }
+ if (trim($row['surname'])) {
+ $avtor[] = trim ($row['surname']);
+ }
+ echo '<td>';
+ echo '<span title="'.(isset($row['adminmail']) ? $row['adminmail'] : implode(' ',$avtor)).'">'.implode(' ',$avtor).'</span>';
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ echo '</table>';
+ }
+
+ }
+ //Če ni še nobenih poslanih vabil
+ else {
+ echo '<p>'.ucfirst($lang['srv_survey_archives_tracking_survey_text1b']).' <a href="index.php?anketa=' . $this->sid . '&a=invitations">\'<span class="caps">'.$lang['navigation_NAVI_OBJAVA'].'</span>\' - \''.$lang['navigation_invitations'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1e'].'.</p>';
+ }
+
+ echo '</fieldset>';
+
+ echo '</div>'; # id="div_archive_content">';
+ }
+
+
+ // Glavno posiljanje mail vabil
+ function sendMail() {
+ global $lang, $site_path, $site_url, $global_user_id;
+
+ Common::getInstance()->Init($this->sid);
+
+ if (isset($_POST['rids'])) {
+
+ session_start();
+
+ # preverimo token, da ne pošiljamo večkrat
+ if (isset($_SESSION['snd_inv_token'][$this->sid])
+ && isset($_POST['_token'])
+ && $_SESSION['snd_inv_token'][$this->sid] != null
+ && $_SESSION['snd_inv_token'][$this->sid] == isset($_POST['_token'])){
+
+ // na send smo kliknili samo 1x
+ unset($_SESSION['snd_inv_token'][$this->sid]);
+
+ session_commit();
+
+ $rids = $_POST['rids'];
+
+ $comment = '';
+
+ $return = array();
+ $return['error'] = '0';
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note5'].'</div><br>';
+
+ // Shranimo komentar h posiljanju
+ if(isset($_POST['comment']) && $_POST['comment'] != ''){
+ $comment = $_POST['comment'];
+ $sqlC = sisplet_query("UPDATE srv_invitations_messages SET comment='$comment' WHERE ank_id='$this->sid' AND isdefault='1'");
+ }
+
+ if ($this->checkDefaultMessage() == false) {
+ echo '<span class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</span>';
+
+ exit();
+ }
+ else {
+ // polovimo sporočilo in prejemnike
+ $sql_query_m = sisplet_query("SELECT id, subject_text, body_text, reply_to, isdefault, comment, naslov, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
+
+ if (mysqli_num_rows($sql_query_m) > 0 ) {
+ $sql_row_m = mysqli_fetch_assoc($sql_query_m);
+ }
+ else {
+ #nimamo še vsebine sporočila skreiramo privzeto.
+ echo '<span class="inv_error_note">';
+ echo $lang['srv_invitation_note6'];
+ echo '</span>';
+
+ exit();
+ }
+ }
+
+ $subject_text = $sql_row_m['subject_text'];
+ $body_text = $sql_row_m['body_text'];
+ $msg_url = $sql_row_m['url'];
+
+ // naslov za odgovor je avtor ankete
+ if ($this->validEmail($sql_row_m['reply_to'])) {
+ $reply_to = $sql_row_m['reply_to'];
+ }
+ else {
+ $reply_to = Common::getInstance()->getReplyToEmail();
+ }
+
+
+ // prejeminki besedila
+ $sql_query = sisplet_query("SELECT id, firstname, lastname, email, password, password, cookie, phone, salutation, custom, relation
+ FROM srv_invitations_recipients
+ WHERE ank_id = '".$this->sid."' AND deleted='0' AND id IN (".implode(',',$rids).")
+ ORDER BY id
+ ");
+
+ # zloopamo skozi prejemnike in personaliziramo sporočila in jih pošljemo
+ $date_sent = date ("Y-m-d H:i:s");
+
+ $numRows = mysqli_num_rows($sql_query);
+
+ # če pošiljamo na večje število reposndentov obvestimo info@1ka.si
+ if ($numRows > NOTIFY_INFO1KA && !isLastnaInstalacija()) {
+
+ // Gorenje tega nima
+ if (!Common::checkModule('gorenje')){
+ global $site_url, $global_user_id;
+
+ $sqlinfo_query = sisplet_query("SELECT email, name, surname FROM users WHERE id = '".$global_user_id."'");
+ list($infoEmail,$infoName,$infoSurname) = mysqli_fetch_row($sqlinfo_query);
+
+ $infourl = '<a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'">anketi</a>';
+ $preview_url = '<a href="'.SurveyInfo::getSurveyLink().'?preview=on">'.$lang['srv_poglejanketo'].'</a>';
+
+ $format = $lang['srv_inv_send_finish_note'];
+
+ $info1ka_mass_email_note = sprintf($format, $infoName, $infoSurname, $infoEmail, $infourl, $numRows, $preview_url);
+
+ try{
+ $MA = new MailAdapter($this->sid, $type='admin');
+ $MA->addRecipients('info@1ka.si');
+ $resultX = $MA->sendMail($info1ka_mass_email_note, 'Masovno pošiljanje vabil (poslanih več kot '.NOTIFY_INFO1KA.')');
+ }
+ catch (Exception $e){
+ }
+ }
+ }
+
+ // Pripravimo arhiv pošiljanj, da dobimo arch_id
+ $sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
+ list($count_all) = mysqli_fetch_row($sql_query_all);
+
+ $archive_naslov = 'mailing_'.date("d.m.Y").', '.date("H:i:s");
+ $sqlQuery = sisplet_query("INSERT INTO srv_invitations_archive
+ (id, ank_id, date_send, subject_text, body_text, uid, comment, naslov, rec_in_db)
+ VALUES
+ (NULL , '$this->sid', '$date_sent', '".addslashes($subject_text)."', '".addslashes($body_text)."', '$global_user_id','$comment','$archive_naslov','$count_all')
+ ");
+
+ $arch_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ // Podatki posiljatelja
+ list($name, $surname, $email) = mysqli_fetch_row(sisplet_query("SELECT name, surname, email FROM users WHERE id='$global_user_id'"));
+
+ // Podatki za posiljanje
+ $sending_data = array(
+ 'body_text' => $body_text,
+ 'subject_text' => $subject_text,
+ 'arch_id' => $arch_id,
+ 'msg_url' => $msg_url,
+ 'date_sent' => $date_sent,
+ 'from_email' => $email,
+ 'from_name' => $name.' '.$surname,
+ 'reply_to_email' => $reply_to
+ );
+
+ // Loop po prejemnikih in posiljanje mailov
+ $squalo = new SurveyInvitationsSqualo($this->sid);
+ if($squalo->getSqualoActive()){
+ $sending_results = $squalo->sendSqualoInvitations($sql_query, $sending_data);
+ }
+ else{
+ $sending_results = $this->sendMailToUsers($sql_query, $sending_data);
+ }
+
+ $send_ok = $sending_results['send_ok'];
+ $send_ok_ids = $sending_results['send_ok_ids'];
+ $send_users_data = $sending_results['send_users_data'];
+ $send_error = $sending_results['send_error'];
+ $send_error_ids = $sending_results['send_error_ids'];
+
+
+ // dodajmo še userje v povezovalno tabelo (arhiv)
+ if ($arch_id > 0) {
+
+ // updejtamo še tabelo arhivov
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_archive SET cnt_succsess='".count($send_ok_ids)."', cnt_error='".count($send_error_ids)."' WHERE id ='$arch_id'");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ // za arhive
+ $_archive_recipients = array();
+
+ // za tracking
+ $_tracking = array();
+
+ if (count($send_ok_ids) > 0) {
+ foreach ( $send_ok_ids AS $id) {
+ $_archive_recipients[] = "('$arch_id','$id','1')";
+ #status 1=pošta poslana
+ $_tracking[] = "('$arch_id',NOW(),'$id','1')";
+ }
+ }
+
+ if (count($send_error_ids) > 0) {
+ foreach ( $send_error_ids AS $id) {
+ $_archive_recipients[] = "('$arch_id','$id','0')";
+ #status 2=pošta - napaka
+ $_tracking[] = "('$arch_id',NOW(),'$id','2')";
+ }
+ }
+
+ if (count($_archive_recipients) > 0) {
+ $sqlString = 'INSERT INTO srv_invitations_archive_recipients (arch_id,rec_id,success) VALUES ';
+ $sqlString .= implode(', ', $_archive_recipients);
+ $sqlQuery = sisplet_query($sqlString);
+ }
+
+ if (count($_tracking) > 0) {
+ $sqlStrTracking = "INSERT INTO srv_invitations_tracking (inv_arch_id, time_insert, res_id, status) VALUES ";
+ $sqlStrTracking .= implode(', ', $_tracking);
+ $sqlQueryTracking = sisplet_query($sqlStrTracking);
+ }
+ }
+
+
+ // Izpis rezultatov - errors and successes
+ if (count($send_error) > 0 ) {
+ $return['error'] = '1';
+
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note7'].count($send_error).'</div>';
+ }
+ else if (count($send_ok) > 0 ) {
+
+ $who='';
+
+ if (trim($name) != '') {
+ $who = $name;
+ }
+
+ if (trim($surname) != '') {
+ if ($who != '') {
+ $who .=' ';
+ }
+ $who .= $surname;
+ }
+
+ if ($email != '') {
+ if ($who != '') {
+ $who .=' ('.$email.')';
+ } else {
+ $who = $email;
+ }
+ }
+
+ $return['error'] = '0';
+
+ // Uspesno poslano sporocilo
+ //$return['msg'] = '<br /><span class="bold" style="line-height:30px;">'.$lang['srv_invitation_note8a'].'</span><br />';
+ $return['msg'] .= '<div class="inv_send_message">';
+ $return['msg'] .= '<table id="inv_send_mail_preview">';
+ $return['msg'] .= '<tr><th><span>'.$lang['srv_inv_message_draft_content_subject'].':</span></th>';
+ $return['msg'] .= '<td class="inv_bt">';
+ $return['msg'] .= '<span>'.$sql_row_m['subject_text'].'</span>';
+ $return['msg'] .= '</td></tr>';
+ $return['msg'] .= '<tr><th>'.$lang['srv_inv_message_draft_content_body'].':</th>';
+ $return['msg'] .= '<td>';
+ $return['msg'] .= '<span class="nl2br">'.($sql_row_m['body_text']).'</span>';
+ $return['msg'] .= '</td></tr>';
+ $return['msg'] .= '</table>';
+ $return['msg'] .= '</div>';
+
+ // Je uporabnik poslal na ...
+ /* $return['msg'] .= sprintf($lang['srv_invitation_note8b'], $who, date("d.m.y", time()));
+ $return['msg'] .= '<span class="bold" style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok)).'</span><br />'; */
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8'], count($send_ok), $who, date("d.m.y", time())).'</span><br />';
+
+ // Arhivi
+ $return['msg'] .= '<span style="line-height:30px;">'.sprintf($lang['srv_invitation_note8c'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'</span><br />';
+
+ // Seznam emailov...
+ $return['msg'] .= '<span style="line-height:30px;">'.$lang['srv_invitation_note8d'].'</span><br />';
+
+ // Seznam mailov na katere je bilo uspesno poslano
+ if (count($send_ok) > 0) {
+ $return['msg'] .= '<div class="inv_send_message">';
+
+ foreach ($send_ok AS $email) {
+ $return['msg'] .= '&nbsp;'.$email.'<br/>';
+ }
+
+ $return['msg'] .= '</div>';
+ }
+ }
+ else {
+ $return['error'] = '0';
+ $return['msg'] = '<div class="inv_send_message">'.'<strong>'.$lang['srv_invitation_note9'].'</strong></div><br/>';
+ }
+ }
+ else {
+ #old session token
+ $return['msg'] = '<div class="inv_send_message"><span class="red strong">'.$lang['srv_invitation_note13'].'</span>'.'</div>';
+ }
+ }
+ else {
+ #nimamo $rids
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note14'].'</div>';
+ }
+
+
+ // Preverimo ce smo presegli limit za posiljanje vabil
+ $check = new SurveyCheck($this->sid);
+ $check->checkLimitVabila();
+
+
+ # popravimo timestamp za regeneracijo dashboarda
+ Common::getInstance()->Init($this->sid);
+ Common::getInstance()->updateEditStamp();
+
+ #$this->viewAarchive($return['msg']);
+ $this->viewSendMailFinish($return['msg']);
+ }
+
+ // Posljemo mail userjem - loop in send
+ private function sendMailToUsers($sql_recipients_query, $sending_data){
+ global $global_user_id;
+ global $site_url;
+ global $lang;
+
+
+ // Preverimo ce je vklopljen modul za volitve
+ $voting = SurveyInfo::getInstance()->checkSurveyModule('voting');
+
+ # če mamo SEO
+ $nice_url = SurveyInfo::getSurveyLink();
+
+ // Polovimo sistemske spremenljivke
+ $sys_vars = $this->getSystemVars();
+
+ # zakeširamo user_id za datapiping
+ $arryDataPiping = array();
+ $qryDataPiping = sisplet_query("SELECT id, inv_res_id FROM srv_user WHERE ank_id='$this->sid' AND inv_res_id IS NOT NULL");
+ while (list($dpUid, $dpInvResId) = mysqli_fetch_row($qryDataPiping)) {
+
+ if ((int)$dpInvResId > 0 && (int)$dpUid > 0) {
+ $arryDataPiping[$dpInvResId] = (int)$dpUid;
+ }
+ }
+
+ $dont_send_duplicated = false;
+ if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
+ $dont_send_duplicated = true;
+ }
+
+ $duplicated = array();
+
+ # array za rezultate
+ $send_ok = array();
+ $send_ok_ids = array();
+ $send_users_data = array();
+ $send_error = array();
+ $send_error_ids = array();
+
+ // Loop po prejemnikih
+ while ($sql_row = mysqli_fetch_assoc($sql_recipients_query)) {
+
+ $password = $sql_row['password'];
+
+ $email = $sql_row['email'];
+
+ // Preverimo ce je duplikat
+ if ($dont_send_duplicated == true && isset($duplicated[$email])) {
+ $duplicated[$email] ++;
+ continue;
+ }
+
+ $duplicated[$email] = 1;
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+
+ if ( ($individual == 1 && trim($email) != '' && trim($password) != '') || ($individual == 0 && trim($email) != '') ){
+
+ // odvisno ali imamo url za jezik.
+ if ($sending_data['msg_url'] != null && trim($sending_data['msg_url']) != '' ) {
+ $url = $sending_data['msg_url'] . ($individual == 1 ? '?code='.$password : '');
+ }
+ else {
+ $url = $nice_url . ($individual == 1 ? '&code='.$password : '');
+ }
+
+ $url .= '&ai='.(int)$sending_data['arch_id'];
+
+ // odjava
+ $unsubscribe = $site_url . 'admin/survey/unsubscribe.php?anketa=' . $this->sid . '&code='.$password;
+
+ $user_body_text = str_replace(
+ array(
+ '#URL#',
+ '#URLLINK#',
+ '#UNSUBSCRIBE#',
+ '#FIRSTNAME#',
+ '#LASTNAME#',
+ '#EMAIL#',
+ '#CODE#',
+ '#PASSWORD#',
+ '#PHONE#',
+ '#SALUTATION#',
+ '#CUSTOM#',
+ '#RELATION#',
+ ),
+ array(
+ '<a href="' . $url . '">' . $url . '</a>',
+ $url,
+ '<a href="' . $unsubscribe . '">' . $lang['user_bye_hl'] . '</a>',
+ $sql_row['firstname'],
+ $sql_row['lastname'],
+ $sql_row['email'],
+ $sql_row['password'],
+ $sql_row['password'],
+ $sql_row['phone'],
+ $sql_row['salutation'],
+ $sql_row['custom'],
+ $sql_row['relation'],
+ ),
+ $sending_data['body_text']
+ );
+
+
+ // naredimo DataPiping;
+ if (isset($arryDataPiping[$sql_row['id']])) {
+ $user_body_text = Common::getInstance()->dataPiping($user_body_text, $arryDataPiping[$sql_row['id']], 0);
+ }
+ $resultX = null;
+
+ try{
+ $MA = new MailAdapter($this->sid, $type='invitation');
+ $MA->addRecipients($email);
+ $resultX = $MA->sendMail($user_body_text, $sending_data['subject_text']);
+
+ }
+ catch (Exception $e){
+ // todo fajn bi bilo zalogirat kaj se dogaja
+ $__error = $e->getMessage();
+ $__errStack = $e->getTraceAsString();
+ }
+
+ $_user_data = $sql_row;
+ if ($resultX) {
+ $send_ok[] = $email;
+ $send_ok_ids[] = $sql_row['id'];
+ $_user_data['status'] = 1;
+ # poslalo ok
+ }
+ else {
+ // ni poslalo
+ $send_error[] = $email;
+ $send_error_ids[] = $sql_row['id'];
+ $_user_data['status'] = 2;
+ }
+
+ $send_users_data[] = $_user_data;
+
+
+ // updejtamo userja da mu je bilo poslano - PO NOVEM TO DELAMO SPROTI
+ if ( count($send_ok_ids) > 0) {
+
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET sent='1', date_sent='".$sending_data['date_sent']."' WHERE id IN (".implode(',',$send_ok_ids).")");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ // statuse popravimo samo če vabilo še ni bilo poslano ali je bila napaka
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET last_status='1' WHERE id IN (".implode(',',$send_ok_ids).") AND last_status IN ('0','2')");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ // Pri volitvah za sabo pobrisemo podatke preko katerih bi lahko povezali prejemnike z responsi
+ if($voting){
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients
+ SET cookie='', password=''
+ WHERE id IN (".implode(',',$send_ok_ids).") AND sent='1' AND last_status='1' AND ank_id='".$this->sid."'
+ ");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+ }
+
+ # updejtamo status za errorje
+ if ( count($send_error_ids) > 0) {
+
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET last_status = GREATEST(last_status,2) WHERE id IN (".implode(',',$send_error_ids).") AND last_status IN ('0')");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+
+ // če mamo personalizirana email vabila, userje dodamo v bazo
+ if ($individual == 1) {
+
+ // dodamo še userja v srv_user da je kompatibilno s staro logiko
+ $strInsertDataText = array();
+ $strInsertDataVrednost = array();
+
+ // Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
+ if($voting){
+ $_r = sisplet_query("INSERT INTO srv_user
+ (ank_id, cookie, pass, last_status, inv_res_id)
+ VALUES
+ ('".$this->sid."', '".$_user_data['cookie']."', '".$_user_data['password']."', '".$_user_data['status']."', '-1') ON DUPLICATE KEY UPDATE cookie = '".$_user_data['cookie']."', pass='".$_user_data['password']."'
+ ");
+
+ // Ce ne belezimo parapodatka za cas responsa, anonimno zabelezimo cas zadnjega responsa
+ sisplet_query("UPDATE srv_anketa SET last_response_time=NOW() WHERE id='".$this->sid."'");
+ }
+ else{
+ $_r = sisplet_query("INSERT INTO srv_user
+ (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id)
+ VALUES
+ ('".$this->sid."', '".$_user_data['email']."', '".$_user_data['cookie']."', '".$_user_data['password']."', '".$_user_data['status']."', NOW(), '".$_user_data['id']."') ON DUPLICATE KEY UPDATE cookie = '".$_user_data['cookie']."', pass='".$_user_data['password']."'
+ ");
+ }
+ $usr_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ if ($usr_id) {
+
+ // dodamo še srv_userbase in srv userstatus
+ sisplet_query("INSERT INTO srv_userbase (usr_id, tip, datetime, admin_id) VALUES ('".$usr_id."','0',NOW(),'".$global_user_id."')");
+ sisplet_query("INSERT INTO srv_userstatus (usr_id, tip, status, datetime) VALUES ('".$usr_id."', '0', '0', NOW())");
+
+ // dodamo še podatke za posameznega userja za sistemske spremenljivke
+ foreach ($sys_vars AS $sid => $spremenljivka) {
+
+ $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
+
+ if ($_user_variable !== null && trim($_user_data[$_user_variable]) != '' && $_user_data[$_user_variable] != null) {
+ if($spremenljivka['variable'] == 'odnos')
+ $strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($_user_data[$_user_variable])]."','".$usr_id."')";
+ else
+ $strInsertDataText[] = "('".$sid."','".$spremenljivka['vre_id']."','".trim($_user_data[$_user_variable])."','".$usr_id."')";
+ }
+ }
+ }
+ else {
+ // lahko da user že obstaja in je šlo za duplicated keys
+ }
+
+
+ // Pri volitvah zaradi anonimizacije ne vsatvimo nicesar v sistemske spremenljivke
+ if(!$voting){
+
+ // vstavimo v srv_data_text
+ if (count($strInsertDataText) > 0) {
+ $strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataText);
+ sisplet_query($strInsert);
+ }
+ // vstavimo v srv_data_vrednost
+ if (count($strInsertDataVrednost) > 0) {
+ $strInsert = "INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataVrednost);
+ sisplet_query($strInsert);
+ }
+ }
+ }
+ }
+ }
+
+ $results = array(
+ 'send_ok' => $send_ok,
+ 'send_ok_ids' => $send_ok_ids,
+ 'send_users_data' => $send_users_data,
+ 'send_error' => $send_error,
+ 'send_error_ids' => $send_error_ids,
+ );
+
+ return $results;
+ }
+
+ private function getSystemVars(){
+
+ // polovimo sistemske spremenljivke z vrednostmi
+ $qrySistemske = sisplet_query("SELECT s.id, s.naslov, s.variable
+ FROM srv_spremenljivka s, srv_grupa g
+ WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='".$this->sid."' AND variable IN ("."'" . implode("','",$this->inv_variables)."')
+ ORDER BY g.vrstni_red, s.vrstni_red
+ ");
+ $sys_vars = array();
+ $sys_vars_ids = array();
+
+ while ($row = mysqli_fetch_assoc($qrySistemske)) {
+ $sys_vars[$row['id']] = array('id'=>$row['id'], 'variable'=>$row['variable'],'naslov'=>$row['naslov']);
+ $sys_vars_ids[] = $row['id'];
+ }
+
+ $sqlVrednost = sisplet_query("SELECT spr_id, id AS vre_id, vrstni_red, variable FROM srv_vrednost WHERE spr_id IN(".implode(',',$sys_vars_ids).") ORDER BY vrstni_red ASC ");
+ while ($row = mysqli_fetch_assoc($sqlVrednost)) {
+
+ // Ce gre za odnos imamo radio
+ if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
+
+ if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
+ $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
+ }
+ elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
+ $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+ }
+ }
+
+ return $sys_vars;
+ }
+
+ // Rocna aktivacija vabil
+ function sendMailNoEmailing() {
+ global $lang, $site_path, $site_url, $global_user_id;
+
+ Common::getInstance()->Init($this->sid);
+
+ if (isset($_POST['rids'])) {
+
+ session_start();
+
+ # preverimo token, da ne pošiljamo večkrat
+ if (isset($_SESSION['snd_inv_token'][$this->sid])
+ && isset($_POST['_token'])
+ && $_SESSION['snd_inv_token'][$this->sid] != null
+ && $_SESSION['snd_inv_token'][$this->sid] == isset($_POST['_token'])) {
+
+ # na send smo kliknili samo 1x
+ unset($_SESSION['snd_inv_token'][$this->sid]);
+
+ session_commit();
+
+ $dont_send_duplicated = false;
+ if (isset($_POST['dont_send_duplicated']) && $_POST['dont_send_duplicated'] == 'on') {
+ $dont_send_duplicated = true;
+ }
+
+ $rids = $_POST['rids'];
+
+ $return = array();
+ $return['error'] = '0';
+ $return['msg'] = '<div class="inv_send_message">'.sprintf($lang['srv_invitation_note5_noEmailing'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_archive').'<br /><br/>';
+ $return['msg'] .= sprintf($lang['srv_invitation_note5_noEmailing2'], $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients').'</div>';
+
+ // Shranimo komentar h posiljanju
+ if(isset($_POST['comment']) && $_POST['comment'] != ''){
+ $comment = $_POST['comment'];
+ $sqlC = sisplet_query("UPDATE srv_invitations_messages SET comment='$comment' WHERE ank_id='$this->sid' AND isdefault='1'");
+ }
+
+ // Preberemo tip posiljanja (navadna posta, sms...)
+ $noMail_type = SurveySession::get('inv_noEmailing_type');
+
+ // Pripravimo arhiv pošiljanj, da dobimo arch_id
+ $sql_query_all = sisplet_query("SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0'");
+ list($count_all) = mysqli_fetch_row($sql_query_all);
+
+ $date_sent = date ("Y-m-d H:i:s");
+ $archive_naslov = 'mailing_'.date("d.m.Y").', '.date("H:i:s");
+
+ // Naslov in body
+ // polovimo sporočilo in prejemnike
+ $sql_query_m = sisplet_query("SELECT id, subject_text, body_text, reply_to, isdefault, comment, naslov, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
+ if (mysqli_num_rows($sql_query_m) > 0 ) {
+ $sql_row_m = mysqli_fetch_assoc($sql_query_m);
+ }
+ else {
+ $subject_text = $lang['srv_inv_message_noemailing_subject'];
+ $body_text = '';
+ }
+
+ $subject_text = $sql_row_m['subject_text'];
+ $body_text = $sql_row_m['body_text'];
+ $msg_url = $sql_row_m['url'];
+
+ // Vstavimo podatke v arhiv
+ $sqlQuery = sisplet_query("INSERT INTO srv_invitations_archive
+ (id, ank_id, date_send, subject_text, body_text, tip, uid, comment, naslov, rec_in_db)
+ VALUES
+ (NULL , '$this->sid', '$date_sent', '".addslashes($subject_text)."', '".addslashes($body_text)."', '$noMail_type', '$global_user_id', '$comment', '$archive_naslov', '$count_all')
+ ");
+
+ $arch_id = mysqli_insert_id($GLOBALS['connect_db']);
+ $duplicated = array();
+
+ // Polovimo sistemske spremenljivke
+ $sys_vars = $this->getSystemVars();
+
+ // prejeminki besedila
+ $sql_query = sisplet_query("SELECT id, firstname, lastname, email, password, cookie, phone, salutation, custom, relation
+ FROM srv_invitations_recipients
+ WHERE ank_id = '".$this->sid."' AND deleted='0' AND id IN (".implode(',',$rids).")
+ ORDER BY id
+ ");
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+
+ $password = $sql_row['password'];
+
+ $email = $sql_row['email'];
+ if ($dont_send_duplicated == true && isset($duplicated[$email]) && $email != '') {
+ $duplicated[$email] ++;
+ continue;
+ }
+
+ $duplicated[$email] = 1;
+ $individual = (int)$this->surveySettings['individual_invitation'];
+
+ $_user_data = $sql_row;
+
+ $send_ok[] = $email;
+ $send_ok_ids[] = $sql_row['id'];
+ $_user_data['status'] = 1;
+
+ $send_users_data[] = $_user_data;
+ }
+
+ // updejtamo userja da mu je bilo poslano
+ if ( count($send_ok_ids) > 0) {
+
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET sent = '1', date_sent = '".$date_sent."' WHERE id IN (".implode(',',$send_ok_ids).")");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ // statuse popravimo samo če vabilo še ni bilo poslano ali je bila napaka
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET last_status = '1' WHERE id IN (".implode(',',$send_ok_ids).") AND last_status IN ('0','2')");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ }
+
+ $comment = $_POST['comment'];
+
+ // dodajmo še userje v povezovalno tabelo
+ if ($arch_id > 0) {
+
+ // updejtamo še tabelo arhivov
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_archive SET cnt_succsess='".count($send_ok_ids)."' WHERE id ='$arch_id'");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ # za arhive
+ $_archive_recipients = array();
+ # za tracking
+ $_tracking = array();
+
+ if (count($send_ok_ids) > 0) {
+ foreach ( $send_ok_ids AS $id) {
+ $_archive_recipients[] = "('$arch_id','$id','1')";
+ #status 1=pošta poslana
+ $_tracking[] = "('$arch_id',NOW(),'$id','1')";
+ }
+ }
+
+ if (count($_archive_recipients) > 0) {
+ $sqlString = 'INSERT INTO srv_invitations_archive_recipients (arch_id,rec_id,success) VALUES ';
+ $sqlString .= implode(', ', $_archive_recipients);
+ $sqlQuery = sisplet_query($sqlString);
+ }
+ if (count($_tracking) > 0) {
+ $sqlStrTracking = "INSERT INTO srv_invitations_tracking (inv_arch_id, time_insert, res_id, status) VALUES ";
+ $sqlStrTracking .= implode(', ', $_tracking);
+ $sqlQueryTracking = sisplet_query($sqlStrTracking);
+ }
+ }
+
+ sisplet_query("COMMIT");
+
+ # če mamo personalizirana email vabila, userje dodamo v bazo
+ if ($individual == 1 && count($send_users_data) > 0) {
+ # dodamo še userja v srv_user da je kompatibilno s staro logiko
+ $strInsertDataText = array();
+ $strInsertUserbase = array();
+ $strInsertUserstatus = array();
+
+ foreach ($send_users_data AS $user_data) {
+
+ $_r = sisplet_query("INSERT INTO srv_user
+ (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id)
+ VALUES
+ ('".$this->sid."', '".$user_data['email']."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', NOW(), '".$user_data['id']."') ON DUPLICATE KEY UPDATE cookie = '".$user_data['cookie']."', pass='".$user_data['password']."'
+ ");
+ $usr_id = mysqli_insert_id($GLOBALS['connect_db']);
+ sisplet_query("COMMIT");
+
+ if ($usr_id) {
+ # dodamo še srv_userbase in srv userstatus
+ $strInsertUserbase[] = "('".$usr_id."','0',NOW(),'".$global_user_id."')";
+ $strInsertUserstatus[] = "('".$usr_id."', '0', '0', NOW())";
+
+ # dodamo še podatke za posameznega userja za sistemske spremenljivke
+ foreach ($sys_vars AS $sid => $spremenljivka) {
+ $_user_variable = $this->inv_variables_link[$spremenljivka['variable']];
+ if (trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ $strInsertDataText[] = "('".$sid."','".$spremenljivka['vre_id']."','".trim($user_data[$_user_variable])."','".$usr_id."')";
+ }
+ }
+ }
+ else {
+ // lahko da user že obstaja in je šlo za duplicated keys
+ }
+ }
+
+ // vstavimo v srv_userbase
+ if (count($strInsertUserbase) > 0) {
+ $strInsert = "INSERT INTO srv_userbase (usr_id, tip, datetime, admin_id) VALUES ";
+ $strInsert .= implode(',',$strInsertUserbase);
+ sisplet_query($strInsert);
+ }
+ // vstavimo v srv_userstatus
+ if (count($strInsertUserstatus) > 0) {
+ $strInsert = "INSERT INTO srv_userstatus (usr_id, tip, status, datetime) VALUES ";
+ $strInsert .= implode(',',$strInsertUserstatus);
+ sisplet_query($strInsert);
+ }
+ // vstavimo v srv_data_text
+ if (count($strInsertDataText) > 0) {
+ $strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataText);
+ sisplet_query($strInsert);
+ }
+
+ sisplet_query("COMMIT");
+ }
+
+
+ if (count($send_ok) > 0 ) {
+
+ list($name,$surname,$email) = mysqli_fetch_row(sisplet_query("SELECT name, surname, email FROM users WHERE id='$global_user_id'"));
+ $who='';
+
+ if (trim($name) != '') {
+ $who = $name;
+ }
+
+ if (trim($surname) != '') {
+ if ($who != '') {
+ $who .=' ';
+ }
+ $who .= $surname;
+ }
+
+ if ($email != '') {
+ if ($who != '') {
+ $who .=' ('.$email.')';
+ } else {
+ $who = $email;
+ }
+ }
+
+ $return['error'] = '0';
+ }
+ else {
+ $return['error'] = '0';
+ $return['msg'] = '<div class="inv_send_message">'.'<strong>'.$lang['srv_invitation_note9'].'</strong></div><br/>';
+ }
+ }
+ else {
+ #old session token
+ $return['msg'] = '<div class="inv_send_message"><span class="red strong">'.$lang['srv_invitation_note13'].'</span>'.'</div>';
+ }
+ }
+ else {
+ #nimamo $rids
+ $return['msg'] = '<div class="inv_send_message">'.$lang['srv_invitation_note14'].'</div>';
+ }
+
+ # popravimo timestamp za regeneracijo dashboarda
+ Common::getInstance()->Init();
+ Common::getInstance()->updateEditStamp();
+
+ $this->viewSendMailFinish($return['msg']);
+ }
+
+
+ function viewSendMailFinish($msg) {
+ global $lang, $site_url;
+
+ echo $msg;
+
+ echo '<br class="clr" />';
+ echo '<span class="floatLeft"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=inv_status"><span>'.$lang['srv_inv_nav_email_status'].'</span></a></div></span>';
+ }
+
+ function uploadRecipients() {
+ global $lang;
+
+ $errors = array();
+ $allowedExtensions = array("txt","csv","dat");
+
+ $_fields = trim($_POST['fields']);
+ if ($_fields != null && $_fields != '') {
+ $fields = explode(',',$_fields);
+ }
+ else {
+ $fields = array();
+ }
+
+ $file_name = $_FILES["recipientsFile"]["name"];
+ $file_type = $_FILES["recipientsFile"]["type"];
+ $file_size = $_FILES["recipientsFile"]["size"] > 0 ? $_FILES["recipientsFile"]["size"] / 1024 : 0;
+ $file_tmp = $_FILES["recipientsFile"]["tmp_name"];
+
+ $okFileType = ( $file_type == 'text/plain' || $file_type == 'text/csv' || $file_type == 'application/vnd.ms-excel' );
+ $okFileEnd = (pathinfo($file_name, PATHINFO_EXTENSION) != 'txt' || pathinfo($file_name, PATHINFO_EXTENSION) != 'csv');
+ # preverimo ali smo uploadali datoteko in če smo izbrali katero polje
+ if ($_POST['posted'] == '1' && count($fields) == 0) {
+ $errors[] = $lang['srv_inv_recipiens_upload_error_no_fields'];
+ }
+ #preverimo ime datoteke
+ if ( trim($file_name) == '' || $file_name == null ) {
+ $errors[] = $lang['srv_respondents_invalid_file'];
+
+ # preverimo tip:
+ } else if ( $okFileType == false ) {
+ $errors[] = $lang['srv_respondents_invalid_file_type'];
+
+ # prevermio še končnico (.txt)
+ } else if ($okFileEnd == false) {
+ $errors[] = $lang['srv_respondents_invalid_file_type'];
+ }
+
+ # preverimo velikost
+ else if ( (float)$file_size == 0 ) {
+ $errors[] = $lang['srv_respondents_invalid_file_size'];
+ }
+
+ # če so napake jih prikažemo če ne obdelamo datoteko
+ if (count($errors) > 0) {
+
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
+ foreach($errors as $error) {
+ echo '<span class="inv_error_note">* '.$error.'</span>';
+ }
+
+ echo '</div>';
+
+ $this->addRecipientsView($fields);
+ }
+ else {
+
+ $fh = @fopen($file_tmp, "rb");
+ if ($fh) {
+ $recipients_list = fread($fh, filesize($file_tmp));
+ fclose($fh);
+ }
+
+ # po potrebi zamenjamo delimiter iz (;) v (,)
+ // Vejica NI kul, ker se uporablja pri nazivih in v custom poljih Za interni delimiter naj bo recimo " | "...
+ $recipients_list = str_replace ($_POST['recipientsDelimiter'], "|~|", $recipients_list);
+
+ // Shranimo v seznam
+ $pid = $this->saveAppendRecipientList($pid=0, $fields, $recipients_list, $profileName='', $profileComment='');
+
+ // Dodamo polja
+ $result = $this->addMassRecipients($recipients_list, $fields, $pid);
+
+ // Prikažemo napake
+ $invalid_recipiens_array = $this->displayRecipentsErrors($result);
+
+ $this->addRecipientsView($fields, $invalid_recipiens_array);
+ }
+ }
+
+ function viewArchiveRecipients() {
+
+ $data = explode('_',$_POST['arch_to_view']);
+
+ $_success = (int)$data[2];
+ $_arch_id = $data[3];
+ $archType = $_POST['archType'];
+
+ $this->showArchiveRecipients($_arch_id, $archType);
+
+ return;
+ }
+
+ function editArchiveComment() {
+ global $lang,$site_url;
+
+ echo '<div id="inv_view_arch_recipients">';
+
+ $data = explode('_',$_POST['arch_to_view']);
+ $_success = (int)$data[2];
+ $_arch_id = $data[3];
+
+ #polovimo podatke arhiva
+ $sql_string = "SELECT comment FROM srv_invitations_archive WHERE id = '".$_arch_id."'";
+ $sql_query = sisplet_query($sql_string);
+ list($comment) = mysqli_fetch_row($sql_query);
+
+ echo '<div class="inv_FS_content">';
+ echo $lang['srv_invitation_comment'];
+ echo '<input id="inv_arch_id" type="hidden" value="'.$_arch_id.'">';
+ echo '<input id="inv_arch_comment" type="text" value="'.$comment.'">';
+ echo '</div>'; // id="arc_content"
+ echo '<div class="inv_FS_btm">';
+ echo '<div id="navigationBottom" class="printHide">';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+
+ function deleteRecipientConfirm() {
+ global $lang;
+
+ if (isset($_POST['inv_rid']) && trim($_POST['inv_rid']) != '') {
+
+ $rid = $_POST['inv_rid'];
+
+ echo '<div id="inv_delete_rec_confirm" class="divPopUp">';
+
+ echo '<h2>'.$lang['srv_inv_recipient_delete'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ echo '<p class="bottom16">'.$lang['srv_inv_recipient_delete_text'].'</p>';
+
+ # polovimo podatke respondenta
+ $sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ echo '<div id="inv_error_note" class="displayNone"/>';
+
+ echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
+ echo '<table id="inv_edit_recipient">';
+ #email
+ if (trim($sql_row['email']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_email'].'</th><td>';
+ echo $sql_row['email'];
+ echo '</td></tr>';
+ }
+ #geslo
+ if (trim($sql_row['password']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_password'].'</th><td>';
+ echo $sql_row['password'];
+ echo '</td></tr>';
+ }
+ #ime
+ if (trim($sql_row['firstname']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_firstname'].'</th><td>';
+ echo $sql_row['firstname'];
+ echo '</td></tr>';
+ }
+ #priimek
+ if (trim($sql_row['lastname']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_lastname'].'</th><td>';
+ echo $sql_row['lastname'];
+ echo '</td></tr>';
+ }
+ #naziv
+ if (trim($sql_row['salutation']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_salutation'].'</th><td>';
+ echo $sql_row['salutation'];
+ echo '</td></tr>';
+ }
+ #telefon
+ if (trim($sql_row['phone']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_phone'].'</th><td>';
+ echo $sql_row['phone'];
+ echo '</td></tr>';
+ }
+ #drugo
+ if (trim($sql_row['custom']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_custom'].'</th><td>';
+ echo $sql_row['custom'];
+ echo '</td></tr>';
+ }
+ #odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ if (trim($sql_row['relation']) != '') {
+ echo '<tr><th>'.$lang['srv_inv_field_relation'].'</th><td>';
+ echo $sql_row['relation'];
+ echo '</td></tr>';
+ }
+ }
+ echo '</table>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" title="'.$lang['srv_inv_list_profiles_delete'].'" onclick="inv_delete_recipient(); return false;">'.$lang['srv_inv_list_profiles_delete'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id="inv_delete_rec_confirm"
+ }
+ }
+
+ function deleteRecipient() {
+ global $lang, $global_user_id, $site_url;
+
+ $return = array('success'=>'0');
+
+ #array z napakami
+ $errors = array();
+ $rids = $_POST['inv_rids'];
+ if (isset($rids) && is_array($rids) && count($rids)) {
+ $sqlString = "UPDATE srv_invitations_recipients SET deleted='1', date_deleted=NOW(), uid_deleted='".$global_user_id."' WHERE ank_id='".$this->sid."' AND id IN(".implode(',',$rids).")";
+ $sqlQuery = sisplet_query($sqlString);
+ sisplet_query("COMMIT");
+
+ if (!$sqlQuery) {
+ $errors[] = $lang['srv_inv_recipient_delete_error'];
+ } else {
+ # updejtamo še srv_users
+ $sqlString = "UPDATE srv_user SET inv_res_id=NULL WHERE ank_id='".$this->sid."' AND inv_res_id IN(".implode(',',$rids).")";
+ $sqlQuery = sisplet_query($sqlString);
+ sisplet_query("COMMIT");
+
+ $return['success'] = 2;
+ //$this->viewRecipients();
+ }
+ } else {
+ $errors[] = $lang['srv_inv_recipient_delete_error'];
+ }
+
+ header('location: ' . $site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients');
+ }
+
+ function deleteRecipientSingle() {
+ global $lang, $global_user_id, $site_url;
+
+ $return = array('success'=>'0');
+
+ # single delete
+ $inv_rid = $_POST['inv_rid'];
+ if ((int)$inv_rid > 0) {
+ $sqlString = "UPDATE srv_invitations_recipients SET deleted='1', date_deleted=NOW(), uid_deleted='".$global_user_id."' WHERE ank_id='".$this->sid."' AND id ='$inv_rid'";
+ sisplet_query("COMMIT");
+ $sqlQuery = sisplet_query($sqlString);
+ if (!$sqlQuery) {
+ $return['error'] = $lang['srv_inv_recipient_delete_error'];
+ } else {
+ $return['success'] = 1;
+ echo json_encode($return);
+ exit;
+ }
+ } else {
+ $return['error'] = $lang['srv_inv_recipient_delete_error'];
+ }
+
+ echo json_encode($return);
+ exit;
+ }
+
+ function deleteRecipientAll() {
+ global $lang, $global_user_id, $site_url;
+
+ $return = array('success'=>'0');
+
+ # all delete
+ $sqlString = "UPDATE srv_invitations_recipients SET deleted='1', date_deleted=NOW(), uid_deleted='".$global_user_id."' WHERE ank_id='".$this->sid."' AND deleted ='0'";
+ sisplet_query("COMMIT");
+ $sqlQuery = sisplet_query($sqlString);
+ if (!$sqlQuery) {
+ $return['error'] = $lang['srv_inv_recipient_delete_error'];
+ } else {
+ $return['success'] = 1;
+ echo json_encode($return);
+ exit;
+ }
+
+ echo json_encode($return);
+ exit;
+ }
+
+ function addSystemVariables($variables) {
+ global $site_path, $lang;
+
+ // Pri modulu za volitve so responsi anonimni, zato nimamo nobenih sistemskih spremenljivk
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting'))
+ return;
+
+ $system_fields = array(
+ 'inv_field_email' => 'email',
+ 'inv_field_firstname' => 'ime',
+ 'inv_field_lastname' => 'priimek',
+ # 'inv_field_password' => 'geslo', # gesla ne dodajamo kot sistemsko spremenljivko
+ 'inv_field_salutation' => 'naziv',
+ 'inv_field_phone' => 'telefon',
+ 'inv_field_custom' => 'drugo',
+ 'inv_field_relation' => 'odnos',
+ );
+
+ $ba = new BranchingAjax($this->sid);
+
+ if (count($variables) > 0) {
+ // zakaj je bi ta reverse???
+ //$variables = array_reverse($variables,true);
+ foreach ($variables as $var) {
+ if (isset($system_fields[$var])) {
+ $spr_id = null;
+
+ $variable = $system_fields[$var];
+
+ $sqlVariable = sisplet_query("SELECT s.id FROM srv_spremenljivka s, srv_grupa g WHERE s.variable='".$variable."' AND s.gru_id=g.id AND g.ank_id='".$this->sid."'");
+ if (mysqli_num_rows($sqlVariable) == 0 && $variable!='pass') { // če varabla še ne obstaja jo kreiramo
+ // za polje pass - Geslo ne kreiramo sistemske variable
+
+ if ($variable != 'language') $user_base = 1;
+
+ // za polje odnos (module 360 - adecco) ustvarimo radio tip spremenljivke
+ if($system_fields[$var] == 'odnos'){
+ ob_start();
+
+ $ba->ajax_spremenljivka_new(0, 0, 1, 0, 1);
+ $spr_id = $ba->spremenljivka;
+
+ ob_clean();
+
+ $s = sisplet_query("UPDATE srv_spremenljivka SET variable='".$variable."', variable_custom='1', naslov='".$variable."', sistem='1', visible='0' WHERE id='$spr_id'");
+ if (!$s) echo 'err435'.mysqli_error($GLOBALS['connect_db']);
+
+ // če gre za sistemsko "odnos" za module 360 (adecco) ustvarimo 4 vrednosti (nadrejeni, podrejeni, sodelavec, samoocenjevalec)
+ $sql = sisplet_query("UPDATE srv_vrednost SET naslov='".$lang['srv_inv_field_relation_1']."', variable='1' WHERE spr_id='".$spr_id."' AND vrstni_red='1'");
+ $sql = sisplet_query("UPDATE srv_vrednost SET naslov='".$lang['srv_inv_field_relation_2']."', variable='2' WHERE spr_id='".$spr_id."' AND vrstni_red='2'");
+ $sql = sisplet_query("UPDATE srv_vrednost SET naslov='".$lang['srv_inv_field_relation_3']."', variable='3' WHERE spr_id='".$spr_id."' AND vrstni_red='3'");
+ $sql = sisplet_query("INSERT INTO srv_vrednost (id, spr_id, naslov, variable, vrstni_red) VALUES ('', '$spr_id', '".$lang['srv_inv_field_relation_4']."', '4', '4')");
+ }
+ // dodamo novo spremenljivko na konec, tip je 21
+ else{
+ ob_start();
+
+ $ba->ajax_spremenljivka_new(0, 0, 1, 0, 21);
+ $spr_id = $ba->spremenljivka;
+
+ ob_clean();
+
+ $s = sisplet_query("UPDATE srv_spremenljivka SET variable='".$variable."', variable_custom='1', naslov='".$variable."', sistem='1', visible='0' WHERE id='$spr_id'");
+ if (!$s) echo 'err435'.mysqli_error($GLOBALS['connect_db']);
+
+ #MAPPING za povezavo podatkov
+ # če smo dodajali email, ga dodamo tudi v mapping
+ if ($variable == 'email' && (int)$spr_id > 0) {
+ $insertString = "INSERT INTO srv_invitations_mapping (sid, spr_id, field) VALUES ('$this->sid','$spr_id','email')";
+ sisplet_query($insertString);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+ function listRecipientsProfiles() {
+ global $lang, $global_user_id;
+
+ $ppid = isset($_POST['pid']) ? (int)$_POST['pid'] : -1;
+
+ # polovimo vse profile
+ $array_profiles = array();
+
+ session_start();
+
+ # če obstaja seznam iz seje za to anketo
+ if (isset($_SESSION['inv_rec_profile'][$this->sid])) {
+ $array_profiles[-1] = array('name' => $_SESSION['inv_rec_profile'][$this->sid]['name']);
+ }
+ $array_profiles[0] = array('name' => $lang['srv_temp_profile_author']);
+
+
+ $onlyThisSurvey = (isset($_SESSION['inv_rec_only_this_survey']) && (int)$_SESSION['inv_rec_only_this_survey'] == 1) ? false : true;
+ if ($onlyThisSurvey == 0) {
+ #id-ji profilov do katerih lahko dostopamo
+ $sql_string = "SELECT * FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."') OR pid IN (SELECT DISTINCT pid FROM srv_invitations_recipients_profiles_access where uid = '$global_user_id')";
+ $sql_query = sisplet_query($sql_string);
+ } else {
+ # 1
+ $sql_string = "SELECT rp.* FROM srv_invitations_recipients_profiles AS rp WHERE from_survey = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+ }
+
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $array_profiles[$sql_row['pid']] = array('name' => $sql_row['name']);
+ }
+
+
+ echo '<div id="inv_import_list_profiles">';
+
+ echo '<ol>';
+ foreach ($array_profiles AS $_pid => $profile) {
+ echo '<li pid="'.$_pid.'" class="'.($ppid === $_pid ? ' active' : '').'">';
+
+ echo '<span>'.$profile['name'].'</span>';
+
+ if ((int)$ppid > 0 && $ppid === $_pid) {
+ # polovimo še ostale porfile
+ $sql_query = sisplet_query("SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".(int)$ppid."' AND from_survey ='".$this->sid."' ");
+
+ if (mysqli_num_rows($sql_query) > 0) {
+
+ echo '<div class="icons">';
+
+ # če je iz iste ankete, potem lahko urejamo
+ echo '<a href="#" onclick="inv_del_rec_profile();" title="'.$lang['srv_inv_recipients_delete_profile'].'"><span class="faicon delete_circle"></span></a>';
+ echo '<a href="#" onclick="inv_edit_rec_profile();" title="'.$lang['srv_inv_recipients_edit_profile'].'"><span class="faicon edit"></span></a>';
+
+ echo '</div>';
+ }
+ }
+
+ echo '</li>';
+ }
+ echo '</ol>';
+
+ echo '</div>';
+ }
+
+ function getRecipientsProfile($pid) {
+ global $lang, $global_user_id;
+
+ session_start();
+
+ $fields = array();
+ $recipients_list = null;
+ $noEmailing = SurveySession::get('inv_noEmailing');
+
+ # če ne obstaja začasen seznam ga naredimo (praznega)
+ if (!isset($_SESSION['inv_rec_profile'][$this->sid])) {
+
+ $_SESSION['inv_rec_profile'][$this->sid] = array(
+ 'pid' => -1,
+ 'name' => $lang['srv_invitation_new_templist'],
+ 'fields' => ($noEmailing == 1 ? 'firstname,lastname' : 'email'),
+ 'respondents' => '',
+ 'comment' => $lang['srv_invitation_new_templist']
+ );
+ }
+
+ #polovimo emaile in poljaiz seznama
+ if ($pid > 0) {
+
+ # če imamo pid in je večji kot nič polovimo podatke iz tabele
+ $sql_query = sisplet_query("SELECT fields,respondents FROM srv_invitations_recipients_profiles WHERE pid = '".$pid."'");
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ if (trim($sql_row['respondents']) != '') {
+ //$recipients_list = explode("\n",trim($sql_row['respondents']));
+ // Zamenjamo 1ka delimiter z default vejico, ker drugače je v seznamih porušeno
+ $recipients_list = explode("\n",str_replace ("|~|", ",", trim($sql_row['respondents'])));
+ }
+
+ $_fields = explode(",", $sql_row['fields']);
+
+ if (count($_fields) > 0) {
+ foreach ($_fields AS $field) {
+ $fields[] = 'inv_field_'.$field;
+ }
+ }
+ }
+ else if ($pid == 0) {
+
+ # če ne je začasin porfil - avtor
+ $sql_query = sisplet_query("SELECT email, name, surname FROM users WHERE id = '".$global_user_id."'");
+ $rowEmail = mysqli_fetch_assoc($sql_query);
+
+ // default smo rekli je vejica, ane?
+ $recipients_list[] = $rowEmail['email'];
+ //$recipients_list[] = $rowEmail['email'].','.$rowEmail['name'].','.$rowEmail['surname'];
+
+ $fields[]= 'inv_field_email';
+ /*$fields[]= 'inv_field_firstname';
+ $fields[]= 'inv_field_lastname';*/
+ }
+ else if ($pid == -1) {
+ # začasen profil iz seje
+ $_fields = explode(",",$_SESSION['inv_rec_profile'][$this->sid]['fields']);
+
+ if (count($_fields) > 0) {
+ foreach ($_fields AS $field) {
+ $fields[] = 'inv_field_'.$field;
+ }
+ }
+
+ if (trim($_SESSION['inv_rec_profile'][$this->sid]['respondents']) != '') {
+ $recipients_list = explode("\n",trim($_SESSION['inv_rec_profile'][$this->sid]['respondents']));
+ }
+
+ }
+ else {
+ $recipients_list[] = '';
+ $fields[]= 'inv_field_email';
+ }
+
+ return array($recipients_list,$fields);
+
+ }
+
+ function useRecipientsList($profile_id = null) {
+ if (isset($profile_id) && !is_null($profile_id))
+ {
+ $pid = $profile_id;
+ $_POST['pid'] = $profile_id;
+ }
+ else if (isset($_POST['pid']))
+ {
+ $pid = (int)$_POST['pid'];
+ }
+ else
+ {
+ if (isset($_SESSION['inv_rec_profile'][$this->sid]))
+ {
+ $pid = -1;
+ }
+ else
+ {
+ $pid = 0;
+ }
+ }
+
+ list($recipients_list,$fields) = $this->getRecipientsProfile($pid);
+
+ $this->addRecipientsView($fields,$recipients_list);
+ }
+
+ function saveRecipientList() {
+ global $lang,$site_url, $global_user_id;
+ echo 'DEPRCATED!';
+ return false;
+ $return = array('success'=>'0');
+
+ # shranjujemo v nov profil
+ $post_fields = str_replace('inv_field_','',implode(',',$_POST['fields']));
+ $post_recipients = $this->getCleanString($_POST['recipients_list']);
+
+ $pid = (int)$_POST['pid'];
+ # če je pid < 0 shranimo v nov porfil
+ if ($pid <= 0) {
+ # dodelimo ime
+ #zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
+ $new_name = $lang['srv_inv_recipient_list_new'];
+ $names = array();
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $q = sisplet_query($s);
+ while ($r = mysqli_fetch_assoc($q)) {
+ $names[] = $r['name'];
+ }
+ if (count($names) > 0) {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_recipient_list_new'].$cnt, $names)) {
+ $cnt++;
+ }
+ $new_name = $lang['srv_inv_recipient_list_new'].$cnt;
+ }
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles".
+ " (name,uid,fields,respondents,insert_time,comment, from_survey) ".
+ " VALUES ('$new_name', '$global_user_id', '$post_fields', '$post_recipients', NOW(), '', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+ if (!$sqlQuery) {
+ $return['success'] = '0';
+ $return['msg'] = mysqli_error($GLOBALS['connect_db']);
+ } else {
+ $return['success'] = '1';
+ $return['pid'] = mysqli_insert_id($GLOBALS['connect_db']);
+
+ }
+
+ } else {
+ # updejtamo obstoječ profil
+ $sql_update = " UPDATE srv_invitations_recipients_profiles".
+ " SET fields = '$post_fields', respondents ='$post_recipients' WHERE pid = '$pid'";
+
+ $sqlQuery = sisplet_query($sql_update);
+ if (!$sqlQuery) {
+ $return['success'] = '0';
+ $return['msg'] = mysqli_error($GLOBALS['connect_db']);
+ } else {
+ $return['success'] = '1';
+ $return['pid'] = $pid;
+ }
+ }
+ sisplet_query("COMMIT");
+ echo json_encode($return);
+ exit;
+
+ }
+
+ function getProfileName() {
+ echo 'DEPRECATED';
+ }
+
+ function saveRecProfile() {
+ global $lang, $site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $profile_id = isset($_POST['profile_id'])? (int)$_POST['profile_id'] : -1;
+ $profile_name = (isset($_POST['profile_name']) && trim($_POST['profile_name']) != '') ? trim($_POST['profile_name']) : $lang['srv_invitation_new_templist'];
+ $profile_comment = (isset($_POST['profile_comment']) && trim($_POST['profile_comment']) != '') ? trim($_POST['profile_comment']) : '';
+ $recipients_list = trim($this->getCleanString($_POST['recipients_list']));
+ $field_list = (isset($_POST['field_list']) && trim($_POST['field_list']) != '') ? trim($_POST['field_list']) : 'email';
+
+ if ((int)$profile_id == -1) {
+ # shranimo v začasni profil
+ session_start();
+ $_SESSION['inv_rec_profile'][$this->sid] = array(
+ 'pid'=>-1,
+ 'name'=>$lang['srv_invitation_new_templist'],
+ 'fields'=>$field_list,
+ 'respondents'=>$recipients_list,
+ 'comment'=>$profile_comment
+ );
+ $return = array('error'=>'0', 'msg'=>'x0', 'pid'=>-1);
+ }
+ else if ((int)$profile_id == 0) {
+ # shranjujemo v nov profil
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles (name,uid,fields,respondents,insert_time,comment, from_survey) VALUES ('$profile_name', '$global_user_id', '$field_list', '$recipients_list', NOW(), '$profile_comment', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error, 'pid'=>mysqli_insert_id($GLOBALS['connect_db']));
+ } else {
+ $return = array('error'=>'0', 'msg'=>'x1', 'pid'=>mysqli_insert_id($GLOBALS['connect_db']));
+ }
+ sisplet_query("COMMIT");
+ }
+ else {
+ # dodajamo v obstoječ profil
+ # polovimo podatke obstoječega profila
+ $sql_string = "SELECT * FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."') AND pid = '".$profile_id."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+ $respondents = $sql_row['respondents']."\n".$recipients_list;
+
+ $sql_string_update = "UPDATE srv_invitations_recipients_profiles SET respondents = '".$respondents."', comment='".$profile_comment."' WHERE uid in('".$global_user_id."') AND pid = '".$profile_id."'";
+ $sqlQuery = sisplet_query($sql_string_update);
+ sisplet_query("COMMIT");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error, 'pid'=>$profile_id());
+ } else {
+ $return = array('error'=>'0', 'msg'=>'x2', 'pid'=>$profile_id);
+ }
+ }
+
+ echo json_encode($return);
+
+ exit;
+ }
+
+ function updateRecProfile() {
+ global $lang,$site_url, $global_user_id;
+
+ $return = array('error'=>'0', 'msg'=>'');
+ $pid = (int)(int)$_POST['pid'];
+ $profile_name = (isset($_POST['profile_name']) && trim($_POST['profile_name']) != '') ? trim($_POST['profile_name']) : '';
+
+ /*$profile_comment = (isset($_POST['profile_comment']) && trim($_POST['profile_comment']) != '') ? trim($_POST['profile_comment']) : '';
+ $profile_respondents = (isset($_POST['profile_respondents']) && trim($_POST['profile_respondents']) != '') ? trim($_POST['profile_respondents']) : '';*/
+
+ if ($pid > 0) {
+
+ if ($profile_name != '') {
+ //$sql_update = "UPDATE srv_invitations_recipients_profiles SET name = '$profile_name', comment = '$profile_comment', respondents = '$profile_respondents' WHERE pid = '$pid'";
+ $sql_update = "UPDATE srv_invitations_recipients_profiles SET name = '$profile_name' WHERE pid = '$pid'";
+ $sqlQuery = sisplet_query($sql_update);
+ sisplet_query("COMMIT");
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error);
+ } else {
+ $return = array('error'=>'0', 'msg'=>$sql_update);
+
+ }
+ sisplet_query("COMMIT");
+ } else {
+ $return = array('error'=>'1', 'msg'=>$lang['srv_inv_msg_1']);
+ }
+
+ } else {
+ $return = array('error'=>'1', 'msg'=>$lang['srv_inv_msg_2']);
+ }
+
+ echo json_encode($return);
+
+ exit;
+ }
+
+ function deleteRecProfile() {
+ global $lang, $site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $pid = isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? (int)$_POST['pid'] : null;
+
+ if ($_POST['pid']) {
+ $sql_string = "DELETE FROM srv_invitations_recipients_profiles WHERE pid='".$pid."' AND uid='".$global_user_id."'";
+ $return['str'] = $sql_string;
+ $sqlQuery = sisplet_query($sql_string);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return['error'] = '1';
+ $return['msg'] = $error;
+ }
+ sisplet_query("COMMIT");
+ }
+
+ echo json_encode($return);
+
+ exit;
+ }
+
+ function editRecProfile() {
+ global $lang, $site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $pid = (int)$_POST['pid'];
+
+ if ($pid > 0) {
+ $sql_string = "SELECT * FROM srv_invitations_recipients_profiles WHERE pid='".$pid."'";
+ $sqlQuery = sisplet_query($sql_string);
+ $sqlRow = mysqli_fetch_assoc($sqlQuery);
+
+ echo '<div id="inv_recipients_profile_name">';
+
+ echo '<div id="inv_error_note" class="displayNone"></div>';
+
+ echo '<p>'.$lang['srv_inv_recipient_list_name'].'</p>';
+ echo '<input type="text" id="rec_profile_name" class="text large" value="'.$sqlRow['name'].'" autofocus="autofocus">';
+ echo '<input type="hidden" id="rec_profile_pid" value="'.$pid.'" >';
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_update_rec_profile(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</div>'; # id="inv_view_arch_recipients"
+
+ sisplet_query("COMMIT");
+ }
+
+ exit;
+ }
+
+ function deleteMsgProfile() {
+ global $lang, $site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $mid = isset($_POST['mid']) && (int)$_POST['mid'] > 0 ? (int)$_POST['mid'] : null;
+
+ # preštejemo koliko profilov imamo. Zadnjega ne pustimo izbrisati
+ $sql_string = "SELECT id FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id <> '".$mid."' LIMIT 1";
+ $sql_query = sisplet_query($sql_string);
+ list($id) = mysqli_fetch_row($sql_query);
+
+ if ((int)$id > 0 ) {
+ # nastavimo na nov id
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '1' WHERE ank_id = '$this->sid' AND id='$id'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ # če imamo še kak profil pustimo zbrisat izbranega
+ if ((int)$mid > 0) {
+
+ $sql_string = "DELETE FROM srv_invitations_messages WHERE id='".$mid."'";
+ $return['str'] = $sql_string;
+ $sqlQuery = sisplet_query($sql_string);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return['error'] = '1';
+ $return['msg'] = $error;
+ }
+
+ }
+ sisplet_query("COMMIT");
+ $this->viewMessage($id);
+
+ }
+
+ #$this->viewMessage();
+ # echo json_encode($return);
+ # exit;
+ }
+
+ function showMessageRename() {
+ global $lang;
+ $mid = (int)$_POST['mid'];
+
+ echo '<div id="inv_recipients_profile_name">';
+
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ # polovimo vsa sporočila
+ $sql_string = "SELECT naslov, comment FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND id = '$mid'";
+ list($naslov, $comment) = mysqli_fetch_row(sisplet_query($sql_string));
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
+ echo '<input type="text" class="text medium" id="inv_message_profile_name" value="'.$naslov.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo '<textarea id="inv_message_comment" tabindex="3">'.($comment).'</textarea>';
+ echo '</div>';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="invMessageRename(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+
+ function messageRename() {
+ global $lang, $global_user_id;
+
+ $return = array('msg'=>'', 'error'=>'0');
+
+ $mid = (int)$_POST['mid'];
+ $return['mid'] = $mid;
+
+ $name = trim($_POST['name']);
+ $comment = trim($_POST['comment']);
+
+ if ($name == '' || $name == null) {
+ $name = $this->generateMessageName();
+ }
+
+ if ($mid > 0) {
+ #updejtamo obstoječ profil
+ $sql_string = "UPDATE srv_invitations_messages SET naslov='".$name."', comment='".$comment."', edit_uid='".$global_user_id."', edit_time=NOW() WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ if ( $sqlQuery != 1) {
+ $return['error'] = '1';
+ $return['msg'] .= $lang['srv_inv_msg_4'];
+ }
+ sisplet_query("COMMIT");
+
+ } else {
+ $return['error'] = '1';
+ $return['msg'] .= $lang['srv_inv_msg_4'];
+ }
+
+ echo json_encode($return);
+ exit;
+
+ }
+ function editRecipient() {
+ global $lang;
+
+ echo '<div id="inv_recipient_edit">';
+
+ echo '<h2>'.$lang['srv_inv_recipient_edit'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ $button_check = 0;
+
+ if ((int)$_POST['inv_rid'] > 0) {
+ # polovimo podatke respondenta
+ $sql_string = "SELECT * FROM srv_invitations_recipients WHERE id = '".(int)$_POST['inv_rid']."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ echo '<div id="inv_error_note" class="displayNone"/>';
+
+ echo '<input type="hidden" id="inv_rid" value="'.$sql_row['id'].'">';
+ echo '<table id="inv_edit_recipient">';
+ #email
+ echo '<tr><th>'.$lang['srv_inv_field_email'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_email" value="'.$sql_row['email'].'" autocomplete="off" maxlength="100">';
+ echo '</td></tr>';
+ #geslo
+ echo '<tr><th>'.$lang['srv_inv_field_password'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_password" value="'.$sql_row['password'].'" autocomplete="off" maxlength="45">';
+ echo '</td></tr>';
+ #ime
+ echo '<tr><th>'.$lang['srv_inv_field_firstname'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_firstname" value="'.$sql_row['firstname'].'" autocomplete="off" maxlength="45">';
+ echo '</td></tr>';
+ #priimek
+ echo '<tr><th>'.$lang['srv_inv_field_lastname'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_lastname" value="'.$sql_row['lastname'].'" autocomplete="off" maxlength="45">';
+ echo '</td></tr>';
+ #naziv
+ echo '<tr><th>'.$lang['srv_inv_field_salutation'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_salutation" value="'.$sql_row['salutation'].'" autocomplete="off" maxlength="45">';
+ echo '</td></tr>';
+ #telefon
+ echo '<tr><th>'.$lang['srv_inv_field_phone'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_phone" value="'.$sql_row['phone'].'" autocomplete="off" maxlength="45">';
+ echo '</td></tr>';
+ #drugo
+ echo '<tr><th>'.$lang['srv_inv_field_custom'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_custom" value="'.$sql_row['custom'].'" autocomplete="off" maxlength="100">';
+ echo '</td></tr>';
+ #odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ echo '<tr><th>'.$lang['srv_inv_field_relation'].'</th><td>';
+ echo '<input type="text" class="text medium" id="rec_relation" value="'.$sql_row['relation'].'" autocomplete="off" maxlength="100">';
+ echo '</td></tr>';
+ }
+
+ echo '</table>';
+
+ $button_check = 1;
+ }
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['edit1338'].'</button>';
+ if($button_check)
+ echo '<button class="medium blue" onclick="inv_save_recipient(); return false;">'.$lang['srv_inv_recipient_save'].'</button>';
+ echo '</div>';
+ }
+
+ function saveRecipient() {
+ global $lang;
+
+ $return = array('msg'=>$lang['srv_inv_error1'], 'error'=>'0');
+
+ $rid = (int)trim($_POST['inv_rid']);
+ $rec_email = trim($_POST['rec_email']);
+ $rec_password = trim($_POST['rec_password']);
+ $rec_firstname = trim($_POST['rec_firstname']);
+ $rec_lastname = trim($_POST['rec_lastname']);
+ $rec_salutation = trim($_POST['rec_salutation']);
+ $rec_phone = trim($_POST['rec_phone']);
+ $rec_custom = trim($_POST['rec_custom']);
+ $rec_relation = (int)trim($_POST['rec_relation']);
+
+ $return['rid'] = $rid;
+
+ $sql_string = "SELECT email FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND id = '".$rid."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $newline= '<br/>';
+ # če smo imeli polje email ga preverjamo
+ if ($sql_row['email'] != null || trim($sql_row['email']) != '' || ($rec_email != null && $rec_email != '')) {
+ # email ne sme biti prazen
+ if (($sql_row['email'] != null || trim($sql_row['email']) != '') && ($rec_email == null || $rec_email == '')) {
+ $return['error'] = '1';
+
+ $return['msg'] .= $newline.$lang['srv_inv_error2'];
+ $return['error_email'] = '1';
+ $newline= '<br/>';
+ } else if (!$this->validEmail($rec_email)) {
+ # email mora biti pravilne oblike
+ $return['error'] = '1';
+
+ $return['msg'] .= $newline.$lang['srv_inv_error3'];
+ $return['error_email'] = '1';
+ $newline= '<br/>';
+ }
+ }
+ # password ne sme biti prazen
+ if ($rec_password == null || $rec_password == '') {
+ $return['error'] = '1';
+
+ $return['msg'] .= $newline.$lang['srv_inv_error4'];
+ $return['error_password'] = '1';
+ $newline= '<br/>';
+ } else {
+ #preverimo da geslo še ni uporabljeno za to anketo za katerega drugega respondenta
+ $sql_string = "SELECT * FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND password = '".$rec_password."' AND id != '".$rid."'";
+ $sql_query = sisplet_query($sql_string);
+ if (mysqli_num_rows($sql_query) > 0) {
+ $return['error'] = '1';
+
+ $return['msg'] .= $newline.$lang['srv_inv_error5'];
+ $return['error_password'] = '1';
+ $newline= '<br/>';
+ }
+ }
+
+ # če ni napak shranimo
+ if ( $return['error'] == '0') {
+ # ali shranjujemo obstoječ msg
+ $sql_string = "UPDATE srv_invitations_recipients SET"
+ ." email = '".strtolower($rec_email)."',"
+ ." password = '$rec_password',"
+ ." firstname = '$rec_firstname',"
+ ." lastname = '$rec_lastname',"
+ ." salutation = '$rec_salutation',"
+ ." phone = '$rec_phone',"
+ ." custom = '$rec_custom',"
+ ." relation = '$rec_relation'"
+ ." WHERE ank_id = '$this->sid' AND id='$rid'";
+ $sqlQuery = sisplet_query($sql_string);
+
+ sisplet_query("COMMIT");
+ if ( $sqlQuery != 1) {
+ $return['error'] = '1';
+
+ $return['msg'] .= $newline.$lang['srv_inv_error6'];
+ }
+ }
+
+ # MAP: če imamo mapirano, updejtamo tudi pri podatkih
+ $strMap = "SELECT spr_id FROM srv_invitations_mapping WHERE sid = '".$this->sid."' AND field='email'";
+ $qryMap = sisplet_query($strMap);
+ list($mapSprId) = mysqli_fetch_row($qryMap);
+ if ((int)$mapSprId > 0) {
+ # preverimo ali ima respondent povezavo na srv_user
+ $selectUser = "SELECT id FROM srv_user where ank_id='".$this->sid."' AND inv_res_id='$rid' AND deleted='0'";
+ $qryUser = sisplet_query($selectUser);
+ list($uid) = mysqli_fetch_row($qryUser);
+
+ if ((int)$uid > 0 && $this->validEmail($rec_email)) {
+ $updateStr = "UPDATE srv_data_text".$this->db_table." SET text = '$rec_email' WHERE spr_id='$mapSprId' AND usr_id='".(int)$uid."'";
+ $qryUpdate = sisplet_query($updateStr);
+ if ((int)$qryUpdate > 0) {
+ # updejtamo še timestamp userja
+ $updateUserString = "UPDATE srv_user SET time_edit=NOW() WHERE id='".(int)$uid."'";
+ $qryUserUpdate = sisplet_query($updateUserString);
+ }
+ }
+ }
+
+ $sql_string = "SELECT * FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND id = '".$rid."'";
+ $sql_query = sisplet_query($sql_string);
+
+ $return['rec'] = mysqli_fetch_assoc($sql_query);
+
+ echo json_encode($return);
+ exit;
+ }
+
+ function setRecipientFilter(){
+
+ session_start();
+
+ if (isset($_POST['inv_filter_on']) && $_POST['inv_filter_on'] == 'true') {
+ $_SESSION['inv_filter_on'] = true;
+
+ } else {
+ $_SESSION['inv_filter_on'] = false;
+ }
+
+ $_SESSION['inv_filter']['value'] = trim($_POST['inv_filter_value']);
+ $_SESSION['inv_filter']['send'] = (int)$_POST['inv_filter_send'];
+ $_SESSION['inv_filter']['respondet'] = (int)$_POST['inv_filter_respondet'];
+ $_SESSION['inv_filter']['unsubscribed'] = (int)$_POST['inv_filter_unsubscribed'];
+
+ # če ni seznama privzeto damo na vsi
+ if (!isset($_POST['inv_filter_list']) && !isset($_SESSION['inv_filter']['list'])) {
+ $_SESSION['inv_filter']['list'] = '-2';
+ } else {
+ $_SESSION['inv_filter']['list'] = (int)$_POST['inv_filter_list'];
+ }
+ if (isset($_POST['inv_filter_duplicates']) && $_POST['inv_filter_duplicates'] == 'true') {
+ $_SESSION['inv_filter']['duplicated'] = true;
+ } else {
+ $_SESSION['inv_filter']['duplicated'] = false;
+ }
+
+ session_commit();
+ return;
+ }
+
+ function exportRecipients() {
+ global $lang;
+
+ $convertTypes = array('charSet' => 'UTF-8', # windows-1250',
+ 'delimit' => ';',
+ 'newLine' => "\n",
+ 'BOMchar' => "\xEF\xBB\xBF");
+
+ #header('Content-Type: application/octet-stream; charset='.$convertTypes['charSet']);
+ header('Content-type: application/csv; charset='.$convertTypes['charSet']);
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Disposition: attachment; filename="respondenti_anketa_'.$this->sid.'-'.date('Y-m-d').'.csv"');
+ header('Pragma: public');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Cache-Control: private',false);
+
+ ob_clean();
+
+ # dodami boomchar za utf-8
+ echo $convertTypes['BOMchar'];
+
+ #array z napakami
+ $errors = array();
+ $inv_rids = $_POST['inv_rids'];
+ if (is_array($inv_rids) && count($inv_rids) > 0) {
+
+ // Ce delamo izvoz za telefonski modul
+ if(SurveyInfo::getInstance()->checkSurveyModule('phone')){
+ $delimit = '';
+ foreach ($this->inv_variables_tel_excel AS $vkey => $inv_variable) {
+ echo $delimit.$lang['srv_inv_recipients_'.$inv_variable];
+ $delimit = $convertTypes['delimit'];
+ }
+
+ #echo $delimit.$lang['srv_inv_recipients_count_inv'];
+ echo $convertTypes['newLine'];
+
+ $sqlString = "SELECT sir.*, IF(sirp.name IS NULL, '".$lang['srv_invitation_new_templist_author']."', sirp.name) AS list_name, scm.comment, scs.call_time, sch.status "
+ ." FROM srv_invitations_recipients AS sir"
+ ." LEFT JOIN srv_invitations_recipients_profiles AS sirp ON (sir.list_id = sirp.pid)"
+ ." LEFT JOIN srv_telephone_comment AS scm ON (scm.rec_id = sir.id)"
+ ." LEFT JOIN srv_telephone_schedule AS scs ON (scs.rec_id = sir.id)"
+ ." LEFT JOIN srv_telephone_history AS sch ON (sch.rec_id = sir.id)"
+
+ ." WHERE sir.id IN(".implode(',',$inv_rids).") ORDER BY id";
+
+ $sqlQuery = sisplet_query($sqlString);
+ if (mysqli_num_rows($sqlQuery)) {
+ while ($sql_row = mysqli_fetch_assoc($sqlQuery)) {
+ foreach ($this->inv_variables_tel_excel AS $vkey => $inv_variable) {
+ if($inv_variable == 'status' && $sql_row[$inv_variable] == '')
+ echo $lang['srv_telephone_status_'].$convertTypes['delimit'];
+ else
+ echo $sql_row[$inv_variable].$convertTypes['delimit'];
+ }
+
+ echo $convertTypes['newLine'];
+ }
+ }
+ }
+ // Izvoz za navadna vabila
+ else{
+ $delimit = '';
+ foreach ($this->inv_variables_excel AS $vkey => $inv_variable) {
+ echo $delimit.$lang['srv_inv_recipients_'.$inv_variable];
+ $delimit = $convertTypes['delimit'];
+ }
+
+ #echo $delimit.$lang['srv_inv_recipients_count_inv'];
+ echo $convertTypes['newLine'];
+
+ $sqlString = "SELECT sir.*, IF(sirp.name IS NULL, '".$lang['srv_invitation_new_templist_author']."', sirp.name) AS list_name "
+ ." FROM srv_invitations_recipients AS sir"
+ ." LEFT JOIN srv_invitations_recipients_profiles AS sirp ON (sir.list_id = sirp.pid)"
+ #." LEFT JOIN srv_invitations_archive_recipients AS siar ON (sir.id = siar.rec_id)"
+
+ ." WHERE sir.id IN(".implode(',',$inv_rids).") ORDER BY id";
+
+ /*
+ $sqlString = "SELECT sir.*, IF(sirp.name IS NULL, '".$lang['srv_invitation_new_templist_author']."', sirp.name) AS list_name, count(siar.arch_id) AS count_inv"
+ ." FROM srv_invitations_recipients AS sir"
+ ." LEFT JOIN srv_invitations_recipients_profiles AS sirp ON (sir.list_id = sirp.pid)"
+ ." LEFT JOIN srv_invitations_archive_recipients AS siar ON (sir.id = siar.rec_id)"
+ ." WHERE sir.id IN(".implode(',',$inv_rids).") GROUP BY siar.rec_id ORDER BY id";
+ */
+
+ $sqlQuery = sisplet_query($sqlString);
+ if (mysqli_num_rows($sqlQuery)) {
+ while ($sql_row = mysqli_fetch_assoc($sqlQuery)) {
+ foreach ($this->inv_variables_excel AS $vkey => $inv_variable) {
+ echo $sql_row[$inv_variable].$convertTypes['delimit'];
+ }
+
+ # echo $sql_row['count_inv'];
+ echo $convertTypes['newLine'];
+ }
+ }
+ }
+ }
+ else {
+ echo $lang['srv_inv_error7'];
+ }
+
+ ob_flush();
+ }
+
+ function exportRecipients_all() {
+ global $lang;
+
+ $convertTypes = array('charSet' => 'UTF-8', # windows-1250',
+ 'delimit' => ';',
+ 'newLine' => "\n",
+ 'BOMchar' => "\xEF\xBB\xBF");
+
+ #header('Content-Type: application/octet-stream; charset='.$convertTypes['charSet']);
+ header('Content-type: application/csv; charset='.$convertTypes['charSet']);
+ header('Content-Transfer-Encoding: binary');
+ header('Content-Disposition: attachment; filename="respondenti_anketa_'.$this->sid.'-'.date('Y-m-d').'.csv"');
+ header('Pragma: public');
+ header('Expires: 0');
+ header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
+ header('Cache-Control: private',false);
+
+ ob_clean();
+ # dodami boomchar za utf-8
+ echo $convertTypes['BOMchar'];
+
+
+ // Ce delamo izvoz za telefonski modul
+ if(SurveyInfo::getInstance()->checkSurveyModule('phone')){
+ #array z napakami
+ $errors = array();
+ $delimit = '';
+ foreach ($this->inv_variables_tel_excel AS $vkey => $inv_variable) {
+ echo $delimit.$lang['srv_inv_recipients_'.$inv_variable];
+ $delimit = $convertTypes['delimit'];
+ }
+
+ #echo $delimit.$lang['srv_inv_recipients_count_inv'];
+ echo $convertTypes['newLine'];
+
+ $sqlString = "SELECT sir.*, IF(sirp.name IS NULL, '".$lang['srv_invitation_new_templist_author']."', sirp.name) AS list_name, scm.comment, scs.call_time, sch.status "
+ ." FROM srv_invitations_recipients AS sir"
+ ." LEFT JOIN srv_invitations_recipients_profiles AS sirp ON (sir.list_id = sirp.pid)"
+ ." LEFT JOIN srv_telephone_comment AS scm ON (scm.rec_id = sir.id)"
+ ." LEFT JOIN srv_telephone_schedule AS scs ON (scs.rec_id = sir.id)"
+ ." LEFT JOIN srv_telephone_history AS sch ON (sch.rec_id = sir.id)"
+
+ ." WHERE sir.ank_id = '$this->sid' AND deleted='0' ORDER BY id";
+
+ $sqlQuery = sisplet_query($sqlString);
+ if (mysqli_num_rows($sqlQuery)) {
+ while ($sql_row = mysqli_fetch_assoc($sqlQuery)) {
+ foreach ($this->inv_variables_tel_excel AS $vkey => $inv_variable) {
+ if($inv_variable == 'status' && $sql_row[$inv_variable] == '')
+ echo $lang['srv_telephone_status_'].$convertTypes['delimit'];
+ else
+ echo $sql_row[$inv_variable].$convertTypes['delimit'];
+ }
+
+ echo $convertTypes['newLine'];
+ }
+ }
+ }
+ // Izvoz za navadna vabila
+ else{
+ #array z napakami
+ $errors = array();
+ $delimit = '';
+ foreach ($this->inv_variables_excel AS $vkey => $inv_variable) {
+ echo $delimit.$lang['srv_inv_recipients_'.$inv_variable];
+ $delimit = $convertTypes['delimit'];
+ }
+
+ echo $convertTypes['newLine'];
+
+ $sqlString = "SELECT sir.*, IF(sirp.name IS NULL, '".$lang['srv_invitation_new_templist_author']."', sirp.name) AS list_name "
+ ." FROM srv_invitations_recipients AS sir"
+ ." LEFT JOIN srv_invitations_recipients_profiles AS sirp ON (sir.list_id = sirp.pid)"
+ ." WHERE sir.ank_id = '$this->sid' AND deleted='0' ORDER BY id";
+
+ $sqlQuery = sisplet_query($sqlString);
+ if (mysqli_num_rows($sqlQuery)) {
+
+ while ($sql_row = mysqli_fetch_assoc($sqlQuery)) {
+
+ foreach ($this->inv_variables_excel AS $vkey => $inv_variable) {
+ echo $sql_row[$inv_variable].$convertTypes['delimit'];
+ }
+
+ echo $convertTypes['newLine'];
+ }
+ }
+ }
+
+ ob_flush();
+ }
+
+ // Izvozimo paket qr kod - NIJZ
+ private function exportRecipients_qr_codes(){
+ global $lang;
+
+ $qr = new SurveyNIJZQR($this->sid);
+ $qr->getQRCodes();
+ }
+
+ function onlyThisSurvey() {
+ session_start();
+ $_SESSION['inv_rec_only_this_survey'] = (isset($_POST['checked']) && $_POST['checked'] == 'true');
+ }
+
+ function hightlight($str, $keywords = '') {
+ $keywords = preg_replace('/\s\s+/', ' ', strip_tags(trim($keywords))); // filter
+ $style = 'inv_high';
+ $style_i = 'inv_high_i';
+ /* Apply Style */
+ $var = '';
+
+ foreach(explode(' ', $keywords) as $keyword)
+ {
+ $replacement = "<span class='".$style."'>".$keyword."</span>";
+ $var .= $replacement." ";
+ $str = str_ireplace($keyword, $replacement, $str);
+ }
+
+ /* Apply Important Style */
+
+ $str = str_ireplace(rtrim($var), "<span class='".$style_i."'>".$keywords."</span>", $str);
+
+ return $str;
+ }
+
+ // Dodamo vse userje v bazo podatkov kot respondente
+ function add_users_to_database() {
+ global $lang, $global_user_id;
+
+ // Preverimo ce je vklopljen modul za volitve
+ $voting = SurveyInfo::getInstance()->checkSurveyModule('voting');
+
+ # prejeminki besedila
+ $sql_query = sisplet_query("SELECT id, firstname, lastname, email, password, password, cookie, phone, salutation, custom, relation
+ FROM srv_invitations_recipients
+ WHERE ank_id = '".$this->sid."' AND deleted='0' AND sent='0'
+ ");
+
+ # polovimo sistemske spremenljivke z vrednostmi
+ $qrySistemske = sisplet_query("SELECT s.id, s.naslov, s.variable
+ FROM srv_spremenljivka s, srv_grupa g
+ WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='".$this->sid."'
+ AND variable IN("."'" . implode("','",$this->inv_variables)."')
+ ORDER BY g.vrstni_red, s.vrstni_red
+ ");
+
+ $sys_vars = array();
+ $sys_vars_ids = array();
+
+ while ($row = mysqli_fetch_assoc($qrySistemske)) {
+ $sys_vars[$row['id']] = array('id'=>$row['id'], 'variable'=>$row['variable'],'naslov'=>$row['naslov']);
+ $sys_vars_ids[] = $row['id'];
+ }
+
+ $sqlVrednost = sisplet_query("SELECT spr_id, id AS vre_id, vrstni_red, variable
+ FROM srv_vrednost
+ WHERE spr_id IN(".implode(',',$sys_vars_ids).")
+ ORDER BY vrstni_red ASC
+ ");
+ while ($row = mysqli_fetch_assoc($sqlVrednost)) {
+
+ // Ce gre za odnos imamo radio
+ if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
+ if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
+ $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
+ }
+ elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
+ $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+ }
+ }
+
+ # array za rezultate
+ $send_users_data = array();
+
+ # zloopamo skozi prejemnike in personaliziramo sporočila in jih pošljemo
+ $date_sent = date ("Y-m-d H:i:s");
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $_user_data = $sql_row;
+ $_user_data['status'] = 1;
+ $send_users_data[] = $_user_data;
+ }
+
+ # dodamo še userja v srv_user da je kompatibilno s staro logiko
+ $strInsertDataText = array();
+ $strInsertUserbase = array();
+ $strInsertUserstatus = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
+ $strInsertDataVrednost = array();
+ $strInsertDataText = array();
+ foreach ($send_users_data AS $user_data) {
+
+ // Pri volitvah zaradi anonimizacije ignoriramo vse identifikatorje
+ if($voting){
+ sisplet_query("INSERT INTO srv_user
+ (ank_id, cookie, pass, last_status, inv_res_id)
+ VALUES
+ ('".$this->sid."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', '-1') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status)
+ ");
+
+ // Ce ne belezimo parapodatka za cas responsa, anonimno zabelezimo cas zadnjega responsa
+ sisplet_query("UPDATE srv_anketa SET last_response_time=NOW() WHERE id='".$this->sid."'");
+ }
+ else{
+ sisplet_query("INSERT INTO srv_user
+ (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id)
+ VALUES
+ ('".$this->sid."', '".$user_data['email']."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', NOW(), '".$user_data['id']."') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status), inv_res_id=VALUES(inv_res_id)
+ ");
+ }
+
+
+
+ $usr_id = mysqli_insert_id($GLOBALS['connect_db']);
+
+ if ($usr_id) {
+ # za update v srv_invitations_respondents
+ $send_ok_ids[] = $user_data['id'];
+ }
+ else {
+ $send_error_ids[] = $user_data;
+ }
+
+ # dodamo še srv_userbase in srv userstatus
+ $strInsertUserbase[] = "('".$usr_id."','0',NOW(),'".$global_user_id."')";
+ $strInsertUserstatus[] = "('".$usr_id."', '0', '0', NOW())";
+
+ # dodamo še podatke za posameznega userja za sistemske spremenljivke
+ foreach ($sys_vars AS $sid => $spremenljivka) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && trim($user_data[$_user_variable]) != '' && $user_data[$_user_variable] != null) {
+ if($spremenljivka['variable'] == 'odnos')
+ $strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
+ else
+ $strInsertDataText[] = "('".$sid."','".$spremenljivka['vre_id']."','".trim($user_data[$_user_variable])."','".$usr_id."')";
+ }
+ }
+
+ sisplet_query("COMMIT");
+ }
+
+ # vstavimo v srv_userbase
+ if (count($strInsertUserbase) > 0) {
+ $strInsert = "INSERT INTO srv_userbase (usr_id, tip, datetime, admin_id) VALUES ";
+ $strInsert .= implode(',',$strInsertUserbase);
+ sisplet_query($strInsert);
+ }
+ # vstavimo v srv_userstatus
+ if (count($strInsertUserstatus) > 0) {
+ $strInsert = "INSERT INTO srv_userstatus (usr_id, tip, status, datetime) VALUES ";
+ $strInsert .= implode(',',$strInsertUserstatus);
+ sisplet_query($strInsert);
+ }
+
+ // Pri volitvah zaradi anonimizacije ne vsatvimo nicesar v sistemske spremenljivke
+ if(!$voting){
+
+ # vstavimo v srv_data_text
+ if (is_countable($strInsertDataText) && count($strInsertDataText) > 0) {
+ $strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataText);
+ sisplet_query($strInsert);
+ }
+ # vstavimo v srv_data_vrednost
+ if (is_countable($strInsertDataVrednost) && count($strInsertDataVrednost) > 0) {
+ $strInsert = "INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataVrednost);
+ sisplet_query($strInsert);
+ }
+ }
+
+ sisplet_query("COMMIT");
+
+ # zloopamo skozi prejemnike in personaliziramo sporočila in jih pošljemo
+ $date_sent = date ("Y-m-d H:i:s");
+
+ # updejtamo userja da mu je bilo poslano
+ if ( count($send_ok_ids) > 0) {
+
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET sent='1', date_sent = '".$date_sent."' WHERE id IN (".implode(',',$send_ok_ids).")");
+ if (!$sqlQuery)
+ $error = mysqli_error($GLOBALS['connect_db']);
+
+ $sqlQuery = sisplet_query("UPDATE srv_invitations_recipients SET last_status='1' WHERE id IN (".implode(',',$send_ok_ids).") AND last_status IN ('0','2')");
+ if (!$sqlQuery)
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ $msg = array($lang['srv_inv_activate_respondents']. count($send_ok_ids));
+
+ if (count($send_error_ids) > 0) {
+ print_r("<pre>");
+ print_r($lang['srv_inv_error0']);
+ print_r($send_error_ids);
+ print_r("</pre>");
+ }
+
+ # popravimo timestamp za regeneracijo dashboarda
+ Common::getInstance()->Init();
+ Common::getInstance()->updateEditStamp();
+
+ $this->viewRecipients(/*array(),$msg*/);
+ }
+
+ // Dodamo samo izbrane userje v bazo podatkov kot respondente
+ function add_checked_users_to_database() {
+ global $lang, $site_url, $global_user_id;
+
+ // Prejemniki, ki jih ročno dodajamo med respondente
+ $inv_rids = $_POST['inv_rids'];
+
+ # prejeminki besedila
+ $sql_string = "SELECT id, firstname, lastname, email, password, cookie, phone, salutation, custom, relation FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted='0' AND sent='0' AND id IN(".implode(',',$inv_rids).")";
+ $sql_query = sisplet_query($sql_string);
+
+ # polovimo sistemske spremenljivke z vrednostmi
+ $strSistemske = "SELECT s.id, s.naslov, s.variable FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='".$this->sid."' AND variable IN("."'" . implode("','",$this->inv_variables)."') ORDER BY g.vrstni_red, s.vrstni_red";
+ $qrySistemske = sisplet_query($strSistemske);
+ $sys_vars = array();
+ $sys_vars_ids = array();
+ while ($row = mysqli_fetch_assoc($qrySistemske)) {
+ $sys_vars[$row['id']] = array('id'=>$row['id'], 'variable'=>$row['variable'],'naslov'=>$row['naslov']);
+ $sys_vars_ids[] =$row['id'];
+ }
+ $sqlVrednost = sisplet_query("SELECT spr_id, id AS vre_id, vrstni_red, variable FROM srv_vrednost WHERE spr_id IN(".implode(',',$sys_vars_ids).") ORDER BY vrstni_red ASC ");
+
+ if($sqlVrednost !== false){
+ while ($row = mysqli_fetch_assoc($sqlVrednost)) {
+ // Ce gre za odnos imamo radio
+ if($sys_vars[$row['spr_id']]['variable'] == 'odnos'){
+ if(!isset($sys_vars[$row['spr_id']]['vre_id'][$row['vrstni_red']]))
+ $sys_vars[$row['spr_id']]['vre_id'][$row['variable']] = $row['vre_id'];
+ }
+ elseif (!isset($sys_vars[$row['spr_id']]['vre_id'])) {
+ $sys_vars[$row['spr_id']]['vre_id'] = $row['vre_id'];
+ }
+ }
+ }
+
+ # array za rezultate
+ $send_users_data = array();
+
+ # zloopamo skozi prejemnike in personaliziramo sporočila in jih pošljemo
+ $date_sent = date ("Y-m-d H:i:s");
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $_user_data = $sql_row;
+ $_user_data['status'] = 1;
+ $send_users_data[] = $_user_data;
+ }
+
+ # dodamo še userja v srv_user da je kompatibilno s staro logiko
+ $strInsertDataText = array();
+ $strInsertUserbase = array();
+ $strInsertUserstatus = array();
+ $strInsertDataVrednost = array();
+ $send_ok_ids = array();
+ $send_error_ids = array();
+ foreach ($send_users_data AS $user_data) {
+ $strInsert = "INSERT INTO srv_user (ank_id, email, cookie, pass, last_status, time_insert, inv_res_id) VALUES ('".$this->sid."', '".$user_data['email']."', '".$user_data['cookie']."', '".$user_data['password']."', '".$user_data['status']."', NOW(), '".$user_data['id']."') ON DUPLICATE KEY UPDATE last_status=VALUES(last_status), inv_res_id=VALUES(inv_res_id)";
+
+ sisplet_query($strInsert);
+ $usr_id = mysqli_insert_id($GLOBALS['connect_db']);
+ if ($usr_id) {
+ # za update v srv_invitations_respondents
+ $send_ok_ids[] = $user_data['id'];
+ } else {
+ $send_error_ids[] = $user_data;
+ }
+ # dodamo še srv_userbase in srv userstatus
+ $strInsertUserbase[] = "('".$usr_id."','0',NOW(),'".$global_user_id."')";
+ $strInsertUserstatus[] = "('".$usr_id."', '0', '0', NOW())";
+
+ # dodamo še podatke za posameznega userja za sistemske spremenljivke
+ foreach ($sys_vars AS $sid => $spremenljivka) {
+ $_user_variable = isset($this->inv_variables_link[$spremenljivka['variable']]) ? $this->inv_variables_link[$spremenljivka['variable']] : null;
+ if ($_user_variable !== null && $user_data[$_user_variable] != null && trim($user_data[$_user_variable]) != '') {
+ if($spremenljivka['variable'] == 'odnos')
+ $strInsertDataVrednost[] = "('".$sid."','".$spremenljivka['vre_id'][trim($user_data[$_user_variable])]."','".$usr_id."')";
+ else
+ $strInsertDataText[] = "('".$sid."','".$spremenljivka['vre_id']."','".trim($user_data[$_user_variable])."','".$usr_id."')";
+ }
+ }
+
+ sisplet_query("COMMIT");
+ }
+
+ # vstavimo v srv_userbase
+ if (count($strInsertUserbase) > 0) {
+ $strInsert = "INSERT INTO srv_userbase (usr_id, tip, datetime, admin_id) VALUES ";
+ $strInsert .= implode(',',$strInsertUserbase);
+ sisplet_query($strInsert);
+ }
+ # vstavimo v srv_userstatus
+ if (count($strInsertUserstatus) > 0) {
+ $strInsert = "INSERT INTO srv_userstatus (usr_id, tip, status, datetime) VALUES ";
+ $strInsert .= implode(',',$strInsertUserstatus);
+ sisplet_query($strInsert);
+ }
+ # vstavimo v srv_data_text
+ if (count($strInsertDataText) > 0) {
+ $strInsert = "INSERT INTO srv_data_text".$this->db_table." (spr_id, vre_id, text, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataText);
+ sisplet_query($strInsert);
+ }
+ # vstavimo v srv_data_vrednost
+ if (count($strInsertDataVrednost) > 0) {
+ $strInsert = "INSERT INTO srv_data_vrednost".$this->db_table." (spr_id, vre_id, usr_id) VALUES ";
+ $strInsert .= implode(',',$strInsertDataVrednost);
+ sisplet_query($strInsert);
+ }
+ sisplet_query("COMMIT");
+
+ # zloopamo skozi prejemnike in personaliziramo sporočila in jih pošljemo
+ $date_sent = date ("Y-m-d H:i:s");
+
+ # updejtamo userja da mu je bilo poslano
+ if ( count($send_ok_ids) > 0) {
+ $sqlString = "UPDATE srv_invitations_recipients SET sent = '1', date_sent = '".$date_sent."' WHERE id IN (".implode(',',$send_ok_ids).")";
+ $sqlQuery = sisplet_query($sqlString);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+ $sqlString = "UPDATE srv_invitations_recipients SET last_status = '1' WHERE id IN (".implode(',',$send_ok_ids).") AND last_status IN ('0','2')";
+ $sqlQuery = sisplet_query($sqlString);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ }
+
+ }
+
+ $msg = array($lang['srv_inv_activate_respondents']. count($send_ok_ids));
+ if (count($send_error_ids) > 0) {
+ print_r("<pre>");
+ print_r($lang['srv_inv_error0']);
+ print_r($send_error_ids);
+ print_r("</pre>");
+ }
+ # popravimo timestamp za regeneracijo dashboarda
+ Common::getInstance()->Init();
+ Common::getInstance()->updateEditStamp();
+
+ header('location: ' . $site_url . 'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients');
+ }
+
+ function getRespondents2Send($send_type, $checkboxes, $source_type, $source_lists, $noEmailing=0) {
+ $respondenti = array();
+
+ # če imamo dodatne omejitve source_type > 0 (arhivi, seznami) dodamo dodatno kontrolo na id-je respondentov
+ $advancedConditionJoin = '';
+ $advancedCondition = '';
+ $sql_sub_condition = '';
+ $sub_query = '';
+
+ if ($source_type == 0)
+ {
+ $this->user_inv_ids = array();
+ if ((int)$this->invitationAdvancedConditionId > 0)
+ {
+ $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
+ if (isset($this->user_inv_ids) && is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0 )
+ {
+ $advancedConditionJoin = " INNER JOIN srv_user AS su ON i.id = su.inv_res_id";
+ $advancedCondition = " AND su.ank_id = '$this->sid' AND su.inv_res_id IS NOT NULL AND su.deleted = '0' AND su.id IN ('".(implode('\',\'',$this->user_inv_ids))."')";
+ }
+ }
+ }
+ else if ($source_type == 1)
+ {
+ # arhivi
+ if ($source_lists != '')
+ {
+ $sub_query = " AND i.id IN(SELECT rec_id AS id FROM srv_invitations_archive_recipients WHERE arch_id IN(".$source_lists.")) ";
+ } else {
+ $sub_query = " AND 0=1 ";
+ }
+
+ }
+ else if ($source_type == 2)
+ {
+ if ($source_lists != '')
+ {
+ $sub_query = " AND i.list_id IN(".$source_lists.") ";
+ }
+ else
+ {
+ $sub_query = " AND 0=1 ";
+ }
+ }
+ # polovimo respondente ki ustrezajo posameznemu statusu
+ if ($send_type == 0 )
+ {
+ }
+ if ($send_type == 1)
+ {
+ $sql_sub_condition = " AND i.sent = '0'";
+ }
+ if ($send_type == 2)
+ {
+ $sql_sub_condition = " AND i.sent = '1' AND i.responded = '0'";
+ }
+ if ($send_type == 3)
+ {
+ $sql_sub_condition = " AND i.sent = '1' AND i.responded = '1'";
+ }
+ if ($send_type == 4)
+ {
+ if ($_POST['checkboxes'] != null && trim($_POST['checkboxes']) != '' )
+ {
+ $sql_sub_condition = " AND i.last_status IN (".$_POST['checkboxes'].")";
+ }
+ }
+
+ // Ce imamo vklopljene volitve potem posiljamo samo tistim, katerim še nismo poslali vabila (ponovno posiljanje ni mogoce)
+ $sql_voting_condition = (SurveyInfo::getInstance()->checkSurveyModule('voting')) ? " AND i.sent = '0' AND i.cookie != '' AND i.password != ''" : "";
+
+ // Ce imamo posiljanje brez emaila, ni potrebno da je email vnesen za posameznega respondenta
+ if($noEmailing == 1){
+ $sql_fields = "SELECT DISTINCT i.password, i.id, i.email, i.firstname, i.last_status, i.list_id FROM srv_invitations_recipients AS i";
+ $sql_main_condition = " WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0' AND i.unsubscribed = '0'";
+ $sql_sort = " ORDER BY i.id ASC";
+
+ $sql_string = $sql_fields
+ . $advancedConditionJoin
+ . $sql_main_condition
+ . $advancedCondition
+ . $sql_sub_condition
+ . $sub_query
+ . $sql_sort;
+ if ($sql_string != null) {
+ $qry = sisplet_query($sql_string);
+ while ($row = mysqli_fetch_assoc($qry)) {
+ $respondenti[$row['password']] = array('id'=>$row['id'], 'email'=>$row['email'], 'firstname'=>$row['firstname'], 'status'=>$row['last_status'], 'list_id'=>$row['list_id']);
+ }
+ }
+ }
+ else{
+ $sql_fields = "SELECT DISTINCT i.password, i.id, i.email, i.last_status, i.list_id FROM srv_invitations_recipients AS i";
+ $sql_main_condition = " WHERE i.ank_id = '".$this->sid."' AND i.deleted = '0' AND i.unsubscribed = '0' AND i.email IS NOT NULL";
+ $sql_sort = " ORDER BY i.id ASC";
+
+ $sql_string = $sql_fields
+ . $advancedConditionJoin
+ . $sql_main_condition
+ . $sql_voting_condition
+ . $advancedCondition
+ . $sql_sub_condition
+ . $sub_query
+ . $sql_sort;
+ if ($sql_string != null) {
+ $qry = sisplet_query($sql_string);
+ while ($row = mysqli_fetch_assoc($qry)) {
+ $respondenti[$row['password']] = array('id'=>$row['id'], 'email'=>$row['email'], 'status'=>$row['last_status'], 'list_id'=>$row['list_id']);
+ }
+ }
+ }
+
+ return($respondenti);
+ }
+
+ /* Paginacija za pregled respondentov pred pošiljanjem
+ *
+ */
+ function displaySendPagination($all_records) {
+ global $lang,$site_url;
+ #trenutna stran
+ $page = isset($_GET['page']) ? $_GET['page'] : '1';
+ $current = is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
+
+ $all = ceil($all_records / $this->rec_send_page_limit);
+
+ # current nastavimo na zadnji element
+ if ( $all > 1 ) {
+ echo '<div id="pagination">';
+ # povezava na prejšnjo stran
+ # $prev_page = $current - 1 ? $current - 1 :$current;
+ # echo('<div><a href="#" onclick="invSendPage('.($prev_page).','.$this->rec_send_page_limit.')">'.$lang['previous_page_short'].'</a></div>');
+ # povezave za vmesne strani
+ for($a = 1; $a <= $all; $a++) {
+ echo('<div value="'.$a.'" '.($a == 1 ? ' class="currentPage_small"':'').'><a href="#" onclick="invSendPage('.($a).','.$this->rec_send_page_limit.')">'.($a).'</a></div>');
+ }
+ # povezava na naslednjo stran
+ # $next_page = ($current + 1) ? ($current + 1) : $current;
+ # echo('<div><a href="#" onclick="invSendPage('.($next_page).','.$this->rec_send_page_limit.')">'.$lang['next_page_short'].'</a></div>');
+
+ $rec_on_page = $all != $current ? $this->rec_send_page_limit : ( $all_records - ($all-1)*$this->rec_send_page_limit);
+
+ echo '</div>';
+ }
+ echo '<br/><div class="justtext">'.$lang['srv_inv_pagination_shown'];
+ $rec_on_page_options = array(20,50,100,200,500,1000);
+ $none_added = true;
+ $added_over = false;
+ echo '<select onchange="invSendPageChangeLimit(this,\''.$all_records.'\'); return false;">';
+ foreach ($rec_on_page_options AS $option) {
+ if ($all_records >= $option || $none_added == true || $added_over == false) {
+ echo '<option value="'.$option.'"'.($option == $this->rec_send_page_limit ? ' selected="selected"' : '').'>'.$option.'</option>';
+ $none_added = false;
+ if ($option > $all_records) {
+ $added_over = true;
+ }
+
+ }
+ #$rec_on_page;
+ }
+ echo '</select>';
+ echo $lang['srv_inv_pagination_shown_records'].'</div>';
+
+ }
+
+ /* Paginacija za pregled reposndentov
+ *
+ */
+ function displayPagination($all_records) {
+ global $lang, $site_url;
+
+ #trenutna stran
+ $page = isset($_GET['page']) ? $_GET['page'] : '1';
+ $current = isset($_GET['page']) && is_numeric($_GET['page']) && (int)$_GET['page'] > 0 ? $page : '1';
+
+ $all = ceil($all_records / REC_ON_PAGE);
+
+ # current nastavimo na zadnji element
+ if ( $all > 1) {
+
+ echo '<div class="pagination_holder">';
+
+ echo '<div id="pagination">';
+
+ $baseUrl = $site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=view_recipients&page=';
+
+ # povezava na prejšnjo stran
+ $prev_page = $current - 1 ? $current - 1 :$current;
+ if( ($current - 1) >= 1) {
+ echo '<a href="'.$baseUrl.$prev_page.'" title="'.$lang['previous_page_short'].'"><div class="arrow left"><span class="faicon pagination_left"></span></div></a>';
+ }
+ else {
+ # brez href povezave
+ echo '<div class="arrow left disabledPage"><span class="faicon pagination_left"></span></div>';
+ }
+
+ # povezave za vmesne strani
+ $middle = $all / 2;
+ $skipped = false;
+ for($a = 1; $a <= $all; $a++) {
+
+ if ($all < ((GROUP_PAGINATE+1) * 2) || $a <= GROUP_PAGINATE || $a > ($all-GROUP_PAGINATE) || ( abs($a-$current) < GROUP_PAGINATE)){
+ if ($skipped == true) {
+ echo '<div class="page_space">...</div>';
+ $skipped = false;
+ }
+
+ if($a == $current) {
+ # brez href povezave
+ echo '<div class="page_number currentPage">'.$a.'</div>';
+ }
+ else {
+ echo '<a href="'.$baseUrl.$a.'"><div class="page_number">'.$a.'</div></a>';
+ }
+ }
+ else {
+ $skipped = true;
+ }
+ }
+
+ # povezava na naslednjo stran
+ $next_page = ($current + 1) ? ($current + 1) : $current;
+ if(($current ) < $all) {
+ echo '<a href="'.$baseUrl.$next_page.'" title="'.$lang['next_page_short'].'"><div class="arrow right"><span class="faicon pagination_right"></span></div></a>';
+ }
+ else {
+ # brez href povezave
+ echo '<div class="arrow right disabledPage"><span class="faicon pagination_right"></span></div>';
+ }
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+
+ function saveArchiveComment() {
+ $id = $_POST['aid'];
+ $comment = $_POST['comment'];
+ if ((int)$id > 0) {
+ $sql_string = "UPDATE srv_invitations_archive SET comment= '".$comment ."' WHERE id = '".$id."'";
+ $sqlQuery = sisplet_query($sql_string);
+ sisplet_query("COMMIT");
+ }
+ }
+
+ function generateMessageName() {
+ global $lang;
+ # poiščemo nov naslov
+ # zaporedno številčimo ime sporočilo1,2.... če slučajno ime že obstaja
+ $new_name = $lang['srv_inv_message_draft_name'];
+ $names = array();
+ $s = "SELECT naslov FROM srv_invitations_messages WHERE ank_id = '".$this->sid."' AND naslov LIKE '%".$new_name."%'";
+ $q = sisplet_query($s);
+ while (list($naslov) = mysqli_fetch_row($q)) {
+ $names[] = $naslov;
+ }
+ if (count($names) > 0) {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_message_draft_name'].$cnt, $names)) {
+ $cnt++;
+ }
+ $new_name = $lang['srv_inv_message_draft_name'].$cnt;
+ }
+ return $new_name;
+ }
+
+ function editMessageDetails() {
+ global $lang;
+
+ echo '<div id="inv_recipients_profile_name">';
+
+ echo '<h2>'.$lang['message'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_new_save'].':</span>';
+
+ # polovimo vsa sporočila
+ $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+
+ echo ' <select onchange="inv_new_message_list_change(this);" class="dropdown medium" autofocus="autofocus" tabindex="2">';
+ echo ' <option value="0" selected="selected" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
+ $messages = array();
+ while ( $row = mysqli_fetch_assoc($sql_query) ) {
+ $messages[$row['id']] = $row;
+ echo ' <option value="'.$row['id'].'" comment="'.$row['comment'].'">'.$row['naslov'].'</option>';
+ }
+ echo ' </select>';
+ echo '</div>';
+
+
+ echo '<div id="new_message_list_span" class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_rename_new_name'].'</span>';
+ $newName = $this->generateMessageName();
+ echo ' <input type="text" id="rec_profile_name" class="text medium" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">'.$lang['srv_inv_message_draft_list_comment'].'</span>';
+ echo ' <textarea id="inv_message_comment" tabindex="3" rows="2"></textarea>';
+ echo '</div>';
+
+
+ echo '<div class="button_holder">';
+ echo ' <button class="medium white-blue" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" >'.$lang['srv_cancel'].'</button>';
+ echo ' <button class="medium blue" onclick="inv_message_save_details(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+
+ echo '</div>';
+
+ }
+
+ function messageSaveDetails() {
+ global $lang, $global_user_id;
+ $return = array('msg'=>'', 'error'=>'0');
+
+ #echo json_encode($return);
+ $mid = (int)$_POST['mid'];
+ $return['mid'] = $mid;
+
+ $comment = trim($_POST['profile_comment']);
+ $naslov = trim($_POST['naslov']);
+
+ $body = $_POST['body'];
+ $subject = $_POST['subject'];
+
+ if ($mid > 0) {
+ #updejtamo obstoječ profil
+ $sql_string = "UPDATE srv_invitations_messages SET subject_text='".$subject."', body_text='".$body."', comment='".$comment."', edit_uid='".$global_user_id."', edit_time=NOW() WHERE ank_id = '$this->sid' AND id='$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ $return['mid'] = $mid;
+
+ if ( $sqlQuery != 1) {
+ $return['error'] = '1';
+ $return['msg'] .= $lang['srv_inv_msg_4'];
+ }
+ sisplet_query("COMMIT");
+
+ } else {
+ # shranimo v nov profil
+ # ali shranjujemo v novo sporočilo
+ $sql_insert = "INSERT INTO srv_invitations_messages (ank_id, naslov, isdefault, uid, insert_time, comment, edit_uid, edit_time, subject_text, body_text) "
+ ."VALUES ('$this->sid', '$naslov', '1', '$global_user_id', NOW(), '$comment', '$global_user_id', NOW(), '$subject', '$body')";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ $mid = mysqli_insert_id($GLOBALS['connect_db']);
+ if ($mid > 0) {
+ $return['mid'] = $mid;
+ # popravmo še isdefault pri starem zapisz
+ $sql_string = "UPDATE srv_invitations_messages SET isdefault = '0' WHERE ank_id = '$this->sid' AND id != '$mid'";
+ $sqlQuery = sisplet_query($sql_string);
+ } else {
+ $return['error'] = '1';
+ $return['msg'] .= $lang['srv_inv_msg_4'];
+ }
+ sisplet_query("COMMIT");
+ }
+ echo json_encode($return);
+ exit;
+ }
+
+ function prepareSaveMessage() {
+ global $lang;
+
+ echo '<div id="inv_recipients_profile_name">';
+ echo $lang['srv_inv_message_draft_new_save'].':&nbsp;';
+
+ # polovimo vsa sporočila
+ $sql_string = "SELECT * FROM srv_invitations_messages WHERE ank_id = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+
+ echo '<select onchange="inv_new_message_list_change(this);" autofocus="autofocus" tabindex="2">';
+ echo '<option value="0" class="gray bold">'.$lang['srv_inv_message_draft_new'].'</option>';
+ $messages = array();
+ while ( $row = mysqli_fetch_assoc($sql_query) ) {
+ $messages[$row['id']] = $row;
+ echo '<option value="'.$row['id'].'" comment="'.$row['comment'].'"'.((int)$_POST['mid'] == $row['id'] ? ' selected="selected"' : '').'>'.$row['naslov'].'</option>';
+ }
+ echo '</select>';
+ echo '<span id="new_message_list_span"'.((int)$_POST['mid'] > 0 ? ' class="displayNone"' : '').'>';
+ echo '<br><br/>';
+ echo '<label>'.$lang['srv_inv_message_draft_list_name'];
+ $newName = $this->generateMessageName();
+
+ echo '<input type="text" id="rec_profile_name" value="'.$newName.'" tabindex="1" autofocus="autofocus">';
+ echo '</label>';
+ echo '</span>';
+ echo '<br/><br/>';
+ echo $lang['srv_inv_message_draft_list_comment'];
+ echo '<textarea id="inv_message_comment" tabindex="3" rows="2" style="width:200px;">'.((int)$_POST['mid'] > 0 ? $messages[(int)$_POST['mid']]['comment'] : '').'</textarea>';
+ echo '<br class="clr" /><br class="clr" />';
+ echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_message_save_details(); return false;"><span>'.$lang['save'].'</span></a></span>';
+ echo '<br class="clr" />';
+ echo '</div>'; # id="inv_view_arch_recipients"
+
+ }
+
+ function showRecipientTracking() {
+ global $lang,$site_url,$global_user_id;
+ $_rec_id = $_POST['rid'];
+
+ # polovimo podatke o uporabniku
+ $sql_string = "SELECT firstname,lastname,email,last_status, DATE_FORMAT(date_inserted,'%d.%m.%Y, %T') AS di FROM srv_invitations_recipients WHERE id = '".(int)$_rec_id."'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_row = mysqli_fetch_assoc($sql_query);
+
+ $avtor = array();
+ if (trim($sql_row['firstname'])) {
+ $avtor[] = iconv("iso-8859-2", "utf-8",trim ($sql_row['firstname']));
+ }
+ if (trim($sql_row['lastname'])) {
+ $avtor[] = iconv("iso-8859-2", "utf-8",trim ($sql_row['lastname']));
+ }
+ $lastStatus = $sql_row['last_status'];
+
+ echo '<div id="inv_view_arch_recipients" class="singleRec">';
+
+
+ echo '<div class="inv_FS_content">';
+ echo '<div id="inv_arch_mail_preview">';
+
+ echo '<span class="strong" style="font-size: 14px;">'.$lang['srv_invitation_user_chronology_note'];
+ if ( count($avtor) > 0 ) {
+ echo '<span>';
+ echo implode(' ',$avtor);
+ if($sql_row['email'] != '')
+ echo ' ('.trim($sql_row['email']).')';
+ echo '</span>';
+ } else {
+ # izpišemo samo email
+ echo trim($sql_row['email']);
+ }
+ echo '</span>';
+
+ echo '<br/>';
+ echo $lang['srv_inv_recipients_date_inserted'].': '.$sql_row['di'];
+ # polovimo podatke uporabnikovih arhivov
+ $sql_string = "SELECT ia.*, u.name, u.surname, u.email FROM srv_invitations_archive AS ia LEFT JOIN users AS u ON ia.uid = u.id WHERE ia.id IN (SELECT inv_arch_id FROM srv_invitations_tracking WHERE res_id = '$_rec_id' ) ";
+ $sql_query = sisplet_query($sql_string);
+
+ $cnt =0;
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $cnt++;
+ $avtor_email = iconv("iso-8859-2", "utf-8",trim ($sql_row['email']));
+ $avtor = array();
+ if (trim($sql_row['name'])) {
+ $avtor[] = trim ($sql_row['name']);
+ }
+ if (trim($sql_row['surname'])) {
+ $avtor[] = trim ($sql_row['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ $avtor_name = implode(' ',$avtor);
+ } else {
+ $avtor_name = $avtor_email;
+ }
+
+ echo '<div style="font-weight:600; padding:5px 0px; ">';
+ echo $cnt.$lang['srv_invitation_user_chronology_sending'];
+ echo ' ('.$lang['srv_invitation_user_chronology_send_by'];
+ echo ' <span title="'.$avtor_email.'">'.$avtor_name.'</span>';
+ echo ')';
+ echo '</div>';
+
+
+ echo '<div style="margin-left:25px;margin-bottom:10px;">';
+
+ echo '<table id="tbl_respondentArchive">';
+
+ echo '<tr>';
+
+ echo '<th>'.$lang['srv_invitation_user_chronology_date'].'</th>';
+ // Volitve nimajo nekaterih polj
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
+ echo '<th>'.$lang['srv_invitation_user_chronology_status'].'</th>';
+ echo '<th>'.$lang['srv_inv_message_type'].'</th>';
+
+ echo '</tr>';
+
+ $sql_string1 = "SELECT status, DATE_FORMAT(time_insert,'%d.%m.%Y, %T') AS status_time FROM srv_invitations_tracking WHERE res_id = '$_rec_id' AND inv_arch_id='".$sql_row['id']."' ORDER BY uniq ASC";
+ $sql_query1 = sisplet_query($sql_string1);
+ while ($sql_row1 = mysqli_fetch_assoc($sql_query1)) {
+ echo '<tr>';
+
+ echo '<td>'.$sql_row1['status_time'].'</td>';
+
+ // Volitve nimajo nekaterih polj
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting'))
+ echo '<td>('.$sql_row1['status'].') - '.$lang['srv_userstatus_'.$sql_row1['status']].'</td>';
+
+ echo '<td>';
+ if ($sql_row['tip'] == '0')
+ echo $lang['srv_inv_message_noemailing_type1'];
+ elseif($sql_row['tip'] == '1')
+ echo $lang['srv_inv_message_noemailing_type2'];
+ elseif($sql_row['tip'] == '2')
+ echo $lang['srv_inv_message_noemailing_type3'];
+ else
+ echo $lang['email'];
+ echo '</td>';
+
+ echo '</tr>';
+ }
+ echo '</table>';
+ echo '</div>';
+ }
+
+ // Volitve nimajo nekaterih polj
+ if(!SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ echo '<div style="padding:5px 0px;">';
+ echo '<span style="font-weight:600;">'.$lang['srv_inv_recipients_final_status'].'</span> ('.$lastStatus.') - '.$lang['srv_userstatus_'.$lastStatus];
+ echo '</div>';
+ }
+
+ echo '</div>'; // inv_select_mail_preview
+
+ echo '</div>'; // id="arc_content"
+ echo '<div class="inv_FS_btm">';
+ echo '<div id="navigationBottom" class="printHide">';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+
+ }
+ function showArchiveRecipients($_arch_id = null, $archType = 'all') {
+ global $lang,$site_url,$global_user_id;
+ echo '<div id="inv_view_arch_recipients" class="fromArchive">';
+ if ($_arch_id == null) {
+ $_arch_id = $_POST['aid'];
+ }
+
+ #polovimo podatke arhiva
+ $sql_string = "SELECT sia.*, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE sia.id = '".$_arch_id."'";
+ $sql_query = sisplet_query($sql_string);
+ $row = mysqli_fetch_assoc($sql_query);
+
+ # polovimo sezname
+ $lists = array();
+ $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $lists[$sql_row['pid']] = $sql_row['name'];
+ }
+
+ $lists['-1'] = $lang['srv_invitation_new_templist'];
+ $lists['0'] = $lang['srv_invitation_new_templist_author'];
+
+ #max ststusi po userjih
+ $arch_user_max_status = array();
+ $str_max_status = "select res_id AS rid, max(status) AS usr_status from srv_invitations_tracking where inv_arch_id = '$_arch_id' GROUP BY res_id";
+ $qry_max_status = sisplet_query($str_max_status);
+ while (list($res_id,$arch_status) = mysqli_fetch_row($qry_max_status)) {
+ $arch_user_max_status[$res_id] = $arch_status;
+ }
+ #$data = explode('_',$_POST['arch_to_view']);
+ #$_success = (int)$data[2];
+ #$_arch_id = $data[3];
+ $sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '$_arch_id'";
+ $sql_query = sisplet_query($sql_string);
+ $sql_a_row = mysqli_fetch_assoc($sql_query);
+
+ #$sql_string = "SELECT id as res_id,email,firstname,lastname, password,sent,responded,unsubscribed,deleted,list_id,last_status FROM srv_invitations_recipients WHERE id IN (SELECT DISTINCT res_id FROM srv_invitations_tracking WHERE inv_arch_id = '$_arch_id' )";
+ $sql_string = "SELECT DISTINCT sir.id as res_id,sir.email,sir.firstname,sir.lastname, sir.password,sir.sent,sir.responded,sir.unsubscribed,sir.deleted,"
+ ."sir.list_id,sir.last_status FROM srv_invitations_recipients AS sir INNER JOIN srv_invitations_tracking AS sit ON sir.id = sit.res_id WHERE sit.inv_arch_id = '$_arch_id'";
+
+ // prikazujemo samo napake
+ if ($archType == 'err') {
+ $sql_string = "SELECT DISTINCT sir.id as res_id,sir.email,sir.firstname,sir.lastname, sir.password,sir.sent,sir.responded,sir.unsubscribed,sir.deleted,"
+ ."sir.list_id,sir.last_status FROM srv_invitations_recipients AS sir INNER JOIN srv_invitations_tracking AS sit ON sir.id = sit.res_id "
+ ." JOIN srv_invitations_archive_recipients siar ON sir.id = siar.rec_id AND siar.arch_id = sit.inv_arch_id AND siar.success = '0'"
+ ."WHERE sit.inv_arch_id = '$_arch_id'";
+
+ }
+ // priazujemo samo ok
+ if ($archType == 'succ') {
+ $sql_string = "SELECT DISTINCT sir.id as res_id,sir.email,sir.firstname,sir.lastname, sir.password,sir.sent,sir.responded,sir.unsubscribed,sir.deleted,"
+ ."sir.list_id,sir.last_status FROM srv_invitations_recipients AS sir INNER JOIN srv_invitations_tracking AS sit ON sir.id = sit.res_id "
+ ." JOIN srv_invitations_archive_recipients siar ON sir.id = siar.rec_id AND siar.arch_id = sit.inv_arch_id AND siar.success = '1'"
+ ."WHERE sit.inv_arch_id = '$_arch_id'";
+
+ }
+
+ $sql_query = sisplet_query($sql_string);
+
+ echo '<div class="inv_FS_content">';
+
+ $avtor_email = iconv("iso-8859-2", "utf-8",trim ($row['email']));
+ $avtor = array();
+ if (trim($row['name'])) {
+ $avtor[] = trim ($row['name']);
+ }
+ if (trim($row['surname'])) {
+ $avtor[] = trim ($row['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ $avtor_name = implode(' ',$avtor);
+ } else {
+ $avtor_name = $avtor_email;
+ }
+
+ echo '<br />';
+
+ echo '<span class="inv_dashboard_sub_detail">';
+ echo $lang['srv_inv_archive_naslov'];
+ echo ': <span class="bold"><a href="#" onclick="inv_arch_edit_details(\''.$row['id'].'\'); return false;">'.$row['naslov'].'</a>';
+ echo '</span></span><br />';
+
+ echo '<span class="inv_dashboard_sub_detail">';
+ echo $lang['srv_invitation_user_chronology_send_by'];
+ echo ' <span class="bold"><span title="'.$avtor_email.'">'.$avtor_name.'</span>';
+ echo ', ';
+ echo $row['ds'];
+ echo '</span></span><br />';
+
+ echo '<span class="inv_dashboard_sub_detail">';
+ echo $lang['srv_inv_message_type'];
+ echo ': <span class="bold">';
+ if ($row['tip'] == '0')
+ echo $lang['srv_inv_message_noemailing_type1'];
+ elseif($row['tip'] == '1')
+ echo $lang['srv_inv_message_noemailing_type2'];
+ elseif($row['tip'] == '2')
+ echo $lang['srv_inv_message_noemailing_type3'];
+ else
+ echo $lang['email'];
+ echo '</span></span>';
+
+ echo '<div id="inv_arch_mail_preview">';
+
+ echo '<table id="tbl_recipients_list">';
+
+ echo '<tr>';
+
+ // Pri volitvah ne prikazemo nekaterih stolpcev
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
+ echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
+ }
+ else{
+ echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_sent'].'">'.$lang['srv_inv_recipients_sent'].'</th>';
+ echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_responded'].'">'.$lang['srv_inv_recipients_responded'].'</th>';
+ echo '<th class="tbl_icon" title="'.$lang['srv_inv_recipients_unsubscribed'].'">'.$lang['srv_inv_recipients_unsubscribed'].'</th>';
+ echo '<th class="tbl_inv_left">'.$lang['srv_inv_recipients_email'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_password'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_firstname'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_lastname'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_max_archive_status'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_last_status'].'</th>';
+ echo '<th>'.$lang['srv_inv_recipients_list_id'].'</th>';
+ }
+
+ echo '</tr>';
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ echo '<tr>';
+
+ // Pri volitvah ne prikazemo nekaterih stolpcev
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ echo '<td><span class="as_link" onclick="showRecipientTracking(\''.$sql_row['res_id'].'\'); return false;"><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></span></td>';
+ echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
+ echo '<td>'.$sql_row['firstname'].'</td>';
+ echo '<td>'.$sql_row['lastname'].'</td>';
+ echo '<td>'.$lists[$sql_row['list_id']].'</td>';
+ }
+ else{
+ echo '<td><span class="as_link" onclick="showRecipientTracking(\''.$sql_row['res_id'].'\'); return false;"><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['sent'] == 1 ? 'email_sent.png' : 'email_open.png').'"></span></td>';
+ echo '<td><img src="'.$site_url.'admin/survey/icons/icons/'.((int)$sql_row['responded'] == 1 ? 'star_on.png' : 'star_off.png').'"></td>';
+ echo '<td><img src="'.$site_url.'admin/survey/img_0/'.((int)$sql_row['unsubscribed'] == 1 ? 'opdedout_on.png' : 'opdedout_off.png').'"></td>';
+ echo '<td class="tbl_inv_left">'.$sql_row['email'].'</td>';
+ echo '<td>'.$sql_row['password'].'</td>';
+ echo '<td>'.$sql_row['firstname'].'</td>';
+ echo '<td>'.$sql_row['lastname'].'</td>';
+ $status = $arch_user_max_status[$sql_row['res_id']];
+ echo '<td>'.$lang['srv_userstatus_'.$status].' ('.$status.')'.'</td>';
+ echo '<td>'.$lang['srv_userstatus_'.$sql_row['last_status']].' ('.$sql_row['last_status'].')'.'</td>';
+ echo '<td>'.$lists[$sql_row['list_id']].'</td>';
+ }
+
+ echo '</tr>';
+ }
+
+ echo '</table>';
+
+ echo '</div>'; // inv_select_mail_preview
+
+ echo '</div>'; // id="arc_content"
+
+ echo '<br />';
+
+ echo '<div class="inv_FS_btm">';
+ echo '<div id="navigationBottom" class="printHide">';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ function editArchiveDetails() {
+ global $lang,$site_url;
+ echo '<div id="inv_view_arch_recipients">';
+
+ $_arch_id = $_POST['aid'];
+
+ #polovimo podatke arhiva
+ $sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '".$_arch_id."'";
+ $sql_query = sisplet_query($sql_string);
+ $row = mysqli_fetch_assoc($sql_query);
+
+ echo '<div class="inv_FS_content">';
+ echo '<div id="inv_arch_mail_preview">';
+
+ echo '<input id="inv_arch_id" type="hidden" value="'.$_arch_id.'">';
+
+ echo '<table id="inv_arch_mail_preview">';
+ echo '<tr><td class="bold">'.$lang['srv_inv_message_draft_content_subject'].':</td>';
+ echo '<td class="inv_bt bold">';
+ echo '<span>'.$row['subject_text'].'</span>';
+ echo '</td></tr>';
+ echo '<tr><td>'.$lang['srv_inv_message_draft_content_body'].':</td>';
+ echo '<td class="inv_bt">';
+ echo '<span class="nl2br">'.($row['body_text']).'</span>';
+ echo '</td></tr>';
+ echo '<tr><td>'.$lang['srv_inv_message_draft_comment'].':</td>';
+ echo '<td>';
+ echo '<span>';
+ echo '<textarea id="inv_arch_comment" rows="2" style="width:380px;">'.$row['comment'].'</textarea>';
+ echo '</span>';
+ echo '</td></tr>';
+ echo '</table>';
+ echo '</div>'; // inv_select_mail_preview
+
+ echo '</div>'; // id="arc_content"
+ echo '<div class="inv_FS_btm">';
+ echo '<div id="navigationBottom" class="printHide">';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '<button class="medium blue" onclick="inv_arch_save_comment(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+ function showArchiveDetails() {
+ global $lang,$site_url;
+ echo '<div id="inv_view_arch_recipients">';
+
+ $_arch_id = $_POST['aid'];
+
+ #polovimo podatke arhiva
+ $sql_string = "SELECT * FROM srv_invitations_archive WHERE id = '".$_arch_id."'";
+ $sql_query = sisplet_query($sql_string);
+ $row = mysqli_fetch_assoc($sql_query);
+ echo '<div class="inv_FS_content">';
+ echo '<div id="inv_arch_mail_preview">';
+
+ echo '<table id="inv_arch_mail_preview">';
+ echo '<tr><td>'.$lang['srv_inv_message_draft_content_subject'].':</td>';
+ echo '<td class="inv_bt">';
+ echo '<span>'.$row['subject_text'].'</span>';
+ echo '</td></tr>';
+ echo '<tr><td>'.$lang['srv_inv_message_draft_content_body'].':</td>';
+ echo '<td class="inv_bt">';
+ echo '<span class="nl2br">'.($row['body_text']).'</span>';
+ echo '</td></tr>';
+ echo '<tr><td>'.$lang['srv_inv_message_draft_comment'].':</td>';
+ echo '<td>';
+ echo '<span>';
+ echo '<div id="inv_arch_comment" rows="2" style="width:380px;">'.$row['comment'].'</div>';
+ echo '</span>';
+ echo '</td></tr>';
+ echo '</table>';
+ echo '</div>'; // inv_select_mail_preview
+
+ echo '</div>'; // id="arc_content"
+ echo '<div class="inv_FS_btm">';
+ echo '<div id="navigationBottom" class="printHide">';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onclick="inv_arch_recipients_close(); return false;">'.$lang['srv_zapri'].'</button>';
+ echo '</div>';
+ echo '</div>';
+ echo '</div>';
+ }
+
+ function showInvitationStatus() {
+ global $admin_type, $global_user_id;
+
+ $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+ $d = new Dostop();
+
+ echo '<div class="invitations_holder half-half invitations_status">';
+
+ // Pri volitvah prikazemo samo osnovne stevilke - zaradi anonimizacije ni trackinga
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ // Ce so izklopljena ne prikazemo leve strani
+ if((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')){
+ $this->displayInvitationStatusVoting();
+ }
+ }
+ else{
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ // Ce so izklopljena ne prikazemo leve strani
+ if((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')){
+ $this->displayInvitationStatusNew();
+ }
+ }
+
+ echo '</div>';
+ }
+
+ // Prikaz statusov posiljanj
+ private function displayInvitationStatusNew() {
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
+
+ $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ // Email vabila so omogocena
+ if ((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')) {
+
+ echo '<fieldset class="left_holder inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+
+ echo '<div class="inv_filedset_inline_div">';
+
+ #koliko je vseh uporabnikov v bazi
+ $sql_query = sisplet_query("SELECT count(*) as cnt FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0'");
+ list($cnt_all_in_db) = mysqli_fetch_row($sql_query);
+
+ #zloopamo skozi posamezna pošiljanja in preštejemo vse potrebno
+ $sql_query = sisplet_query("SELECT sia.id, sia.tip, rec_in_db, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name, u.surname, u.email
+ FROM srv_invitations_archive AS sia
+ INNER JOIN users AS u ON sia.uid = u.id
+ WHERE ank_id = '".$this->sid."'
+ ORDER BY sia.date_send ASC;
+ ");
+
+ $array_dashboard = array();
+ $array_archive_subdata = array();
+ $user_max_status = array();
+ $user_lurker = array();
+
+ # štetje po pošiljanjih
+ $cnt_by_user = array();
+
+ if (mysqli_num_rows($sql_query) > 0) {
+
+ #loop po vseh arhivih
+ while($row = mysqli_fetch_assoc($sql_query)) {
+ $array_archive_subdata[$row['id']] = $row;
+ $sql_subStr = "SELECT sit.res_id,sit.status FROM srv_invitations_tracking AS sit WHERE sit.inv_arch_id = '".$row['id']."' AND sit.res_id IN (SELECT id FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted ='0')";
+ $sql_subStr = "SELECT sit.res_id,sit.status, su.lurker FROM srv_invitations_tracking AS sit"
+ ." INNER JOIN srv_invitations_recipients AS sir ON sit.res_id = sir.id"
+ ." INNER join srv_user AS su ON sit.res_id = su.inv_res_id"
+ ." WHERE sir.ank_id='$this->sid' AND sir.deleted ='0' AND su.ank_id='$this->sid' AND sit.inv_arch_id = '$row[id]'";
+ $sql_subQry = sisplet_query($sql_subStr);
+ $sub_max = array();
+ #loop po vseh trackingih posameznega arhiva
+ while($subRow = mysqli_fetch_assoc($sql_subQry)) {
+ if ((int)$subRow['status'] == 2) {
+ $subRow['status'] = -2;
+
+ }
+ if ((int)$subRow['status'] == 1) {
+ $cnt_by_user[$subRow['res_id']]++;
+ }
+ #maximalni status uporabnika za posamezen arhiv
+ $sub_max[$subRow['res_id']] = max($sub_max[$subRow['res_id']],$subRow['status']);
+
+ #globalni max statusi posameznih uporabnikov
+ $_userMaxStatus = max($user_max_status[$subRow['res_id']],$subRow['status']);
+ $user_max_status[$subRow['res_id']] = $_userMaxStatus;
+ $user_lurker[$subRow['res_id']] = $subRow['lurker'];
+ }
+ #maximalni statusi uporabniak v posameznem arhivu
+ $array_dashboard[$row['id']] = $sub_max;
+ }
+ }
+
+ # preštejemo respondente po statusu
+ $recipients_by_status = array();
+ $recipients_by_status['all']=(int)$cnt_all_in_db;
+ $user_by_status_for_archive = array();
+ if (count($user_max_status) > 0) {
+
+ foreach ($user_max_status AS $uid => $status) {
+ switch ((int)$status) {
+ # 2 - E-pošta - napaka
+ case -2:
+ $recipients_by_status['not_send'] ++;
+ $recipients_by_status['error'] ++;
+ break;
+ # 0 - E-pošta - ni poslana
+ case 0:
+ $recipients_by_status['not_send'] ++;
+ break;
+ # 1 - E-pošta - neodgovor
+ case 1:
+ $recipients_by_status['send'] ++;
+ break;
+
+ # 3 - klik na nagovor
+ case 3:
+ $recipients_by_status['send'] ++;
+ $recipients_by_status['clicked'] ++;
+ break;
+ # 4 - klik na anketo
+ case 4:
+ $recipients_by_status['send'] ++;
+ $recipients_by_status['clicked'] ++;
+ break;
+ # 5 - delno prazna
+ case 5:
+ $recipients_by_status['send'] ++;
+ #$recipients_by_status['clicked'] ++;
+ if ($user_lurker[$uid] == 1) {
+ # če je lurker
+ $recipients_by_status['clicked'] ++;
+ } else {
+ $recipients_by_status['finished'] ++;
+ }
+ break;
+ # 6 - končana
+ case 6:
+ $recipients_by_status['send'] ++;
+ if ($user_lurker[$uid] == 1) {
+ # če je lurker
+ $recipients_by_status['clicked'] ++;
+ } else {
+ $recipients_by_status['finished'] ++;
+ }
+ break;
+ # null - neznan
+ default:
+ $recipients_by_status['unknown'] ++;
+ break;
+ }
+ }
+
+
+ echo '<table class="inv_dashboard_table">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['all'].'</th>';
+ echo '<td>-</th>';
+ echo '<td>100%</th>';
+ echo '</tr>';
+
+ #popslano enotam
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</th>';
+ echo '<td>'.(int)$recipients_by_status['send'].'</th>';
+ echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</th>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['send']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</th>';
+ echo '</tr>';
+
+ #neodgovori
+ echo '<tr>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
+ $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
+ echo '<td>'.$unanswered.'</td>';
+ echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(($unanswered > 0 ? $unanswered*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['clicked'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ #če se slučajno pojavijo kaki neznani statusi
+ if ((int)$recipients_by_status['unknown'] > 0) {
+ echo '<tr>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['unknown'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
+ echo '</tr>';
+ }
+
+ echo '<tr>';
+ echo '<td class="indent">'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
+ echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td class="">'.$this->formatNumber(((int)$recipients_by_status['finished'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['all'] : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+
+
+ # POSAMEZNA pošiljanja
+ if (count($array_dashboard ) > 0) {
+ foreach ($array_dashboard AS $archive_id => $archive_data) {
+ if (count($archive_data ) > 0) {
+ foreach ($archive_data AS $uid => $status) {
+ if ((int)$status == 6 && $user_lurker[$uid] == 1) {
+ $user_by_status_for_archive[$archive_id]['6l']++;
+ }
+ elseif ((int)$status == 5 && $user_lurker[$uid] == 1) {
+ $user_by_status_for_archive[$archive_id]['5l']++;
+ }
+ else {
+ $user_by_status_for_archive[$archive_id][$status]++;
+ }
+
+ }
+ }
+ }
+ }
+ $cnt = 0;
+ if (count($user_by_status_for_archive ) > 0) {
+ foreach ($user_by_status_for_archive AS $arch_id => $archive_data) {
+ $cnt++;
+ if (count($archive_data ) > 0) {
+
+ $recipients_by_status = array();
+ $recipients_by_status['all']=(int)$array_archive_subdata[$arch_id]['rec_in_db'];
+
+ foreach ($archive_data AS $status => $cntUsers) {
+ # 0 - E-pošta - ni poslana
+ if( $status == '0') {
+ $recipients_by_status['not_send'] +=$cntUsers;
+ # 1 - E-pošta - neodgovor'
+ } else if( $status == '1') {
+ $recipients_by_status['send'] +=$cntUsers;
+ # 2 - E-pošta - napaka
+ } else if( $status == '2') {
+ $recipients_by_status['error'] +=$cntUsers;
+ # 3 - klik na nagovor
+ } else if( $status == '3') {
+ $recipients_by_status['send'] +=$cntUsers;
+ $recipients_by_status['clicked'] +=$cntUsers;
+ # 4 - klik na anketo
+ } else if( $status == '4') {
+ $recipients_by_status['send'] +=$cntUsers;
+ $recipients_by_status['clicked'] +=$cntUsers;
+ # 5 - delno prazna
+ } else if( $status == '5') {
+ $recipients_by_status['send'] +=$cntUsers;
+ #$recipients_by_status['clicked'] +=$cntUsers;
+ $recipients_by_status['finished'] +=$cntUsers;
+
+ # 5 - delno prazna -lurker
+ } else if( $status == '5l') {
+ $recipients_by_status['send'] +=$cntUsers;
+ $recipients_by_status['clicked'] +=$cntUsers;
+
+ # 6 - končana
+ } else if( $status == '6') {
+ $recipients_by_status['send'] +=$cntUsers;
+ $recipients_by_status['finished'] +=$cntUsers;
+ # 6 - končana - lurker
+ } else if( $status == '6l') {
+ $recipients_by_status['send'] +=$cntUsers;
+ $recipients_by_status['clicked'] +=$cntUsers;
+ } else {
+ # null - neznan
+ $recipients_by_status['unknown'] +=$cntUsers;
+ }
+ }
+ $avtor_email = iconv("iso-8859-2", "utf-8",trim ($array_archive_subdata[$arch_id]['email']));
+ $avtor = array();
+ if (trim($array_archive_subdata[$arch_id]['name'])) {
+ $avtor[] = trim ($array_archive_subdata[$arch_id]['name']);
+ }
+ if (trim($array_archive_subdata[$arch_id]['surname'])) {
+ $avtor[] = trim ($array_archive_subdata[$arch_id]['surname']);
+ }
+ if ( count($avtor) > 0 ) {
+ $avtor_name = implode(' ',$avtor);
+ } else {
+ $avtor_name = $avtor_email;
+ }
+ $all_rec_in_survey = (int)$recipients_by_status['all'];
+
+
+ echo '<div class="arhiv_holder">';
+
+
+ echo '<div class="arhiv_info_holder" >';
+
+ echo '<span class="inv_dashboard_sub_title as_link" onClick="$(this).parent().next().toggleClass(\'displayNone\'); $(this).find(\'.plus\').toggleClass(\'displayNone\'); $(this).find(\'.minus\').toggleClass(\'displayNone\');">';
+ echo ' <span class="plus">+ </span>';
+ echo ' <span class="minus displayNone">- </span>';
+ echo $cnt.$lang['srv_inv_dashboard_list_cnt_title'];
+ echo '</span> ';
+
+ echo $lang['sent_by2'].': '.$avtor_name.', '.$array_archive_subdata[$arch_id]['ds'].', ';
+
+ // nacin posiljanja
+ if ($array_archive_subdata[$arch_id]['tip'] == '0')
+ echo '<span>'.$lang['srv_inv_message_noemailing_type1'].'</span>';
+ elseif($array_archive_subdata[$arch_id]['tip'] == '1')
+ echo '<span>'.$lang['srv_inv_message_noemailing_type2'].'</span>';
+ elseif($array_archive_subdata[$arch_id]['tip'] == '2')
+ echo '<span>'.$lang['srv_inv_message_noemailing_type3'].'</span>';
+ else
+ echo '<span>'.$lang['email'].'</span>';
+
+ echo '</div>';
+
+
+ // Skriti spodnji del (arhiv link + tabela)
+ echo '<div class="arhiv_sub_holder displayNone">';
+
+ // arhiv
+ echo '<a href="#" class="noline" onclick="inv_arch_show_recipients(\''.$array_archive_subdata[$arch_id]['id'].'\'); return false;">'.$lang['srv_archive'].'</a>';
+
+ echo '<table class="inv_dashboard_table sub">';
+
+ echo '<tr>';
+ echo '<th>'.$lang['srv_statistic_metric'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleFrekvenca'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleOdstotek'].'</th>';
+ echo '<th>'.$lang['srv_analiza_frekvence_titleKumulativa'].'</th>';
+ echo '</tr>';
+
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<td>'.(int)$all_rec_in_survey.'</th>';
+ echo '<td>&nbsp;</th>';
+ echo '<td>100%</th>';
+ echo '</tr>';
+
+ # poslano enotam
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['send'].'</td>';
+ echo '<td>'.((int)$recipients_by_status['send'] > 0 ? '100%' : '0%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$all_rec_in_survey > 0 ? (int)$recipients_by_status['send']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ # neodgovori
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_unanswered'].'</td>';
+ $unanswered = ((int)$recipients_by_status['send']-(int)$recipients_by_status['clicked']-(int)$recipients_by_status['finished']);
+ echo '<td>'.$unanswered.'</td>';
+ echo '<td>'.$this->formatNumber(($recipients_by_status['send'] > 0 ? $unanswered*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(($all_rec_in_survey > 0 ? $unanswered*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_clicked'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['clicked'].'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['clicked']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$all_rec_in_survey > 0 ? (int)$recipients_by_status['clicked']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ #če se slučajno pojavijo kaki neznani statusi
+ if ((int)$recipients_by_status['unknown'] > 0) {
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_unknown'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['unknown'].'</td>';
+ echo '<td>'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['unknown']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$all_rec_in_survey > 0 ? (int)$recipients_by_status['unknown']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+ }
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_finished'].'</td>';
+ echo '<td>'.(int)$recipients_by_status['finished'].'</td>';
+ echo '<td class="red">'.$this->formatNumber(((int)$recipients_by_status['send'] > 0 ? (int)$recipients_by_status['finished']*100/(int)$recipients_by_status['send'] : 0),0,'%').'</td>';
+ echo '<td class="">'.$this->formatNumber(((int)$all_rec_in_survey > 0 ? (int)$recipients_by_status['finished']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ #napake
+ if ((int)$recipients_by_status['error'] > 0) {
+ echo '<tr>';
+ echo '<td class="anl_bt">'.$lang['srv_inv_dashboard_tbl_error'].'</td>';
+
+ echo '<td class="anl_bt">'.(int)$recipients_by_status['error'].'</td>';
+ echo '<td class="anl_bt">&nbsp;</td>';
+ echo '<td class="anl_bt">'.$this->formatNumber(((int)$recipients_by_status['error'] > 0 ? (int)$recipients_by_status['error']*100/(int)$all_rec_in_survey : 0),0,'%').'</td>';
+ echo '</tr>';
+ }
+
+ echo '</table>';
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+ }
+ }
+ }
+ else {
+ // Imamo sezname, ni pa poslanih vabil
+ if ((int)$cnt_all_in_db > 0){
+ echo $lang['srv_inv_dashboard_has_list2'];
+
+ echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
+ echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_message">'.$lang['srv_inv_message_draft_send'].'</a></div>';
+ }
+ // Ni seznamov in ni poslanih vabil
+ else{
+ echo $lang['srv_inv_dashboard_empty'];
+
+ echo '<div class="buttonwrapper"><a class="ovalbutton floatLeft spaceLeft" href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view">'.$lang['srv_adding_email_respondents'].'</a></div>';
+ }
+ }
+
+ echo '</div>';
+
+ echo '</fieldset>';
+ }
+ // Email vabila niso omogocena
+ else {
+ echo '<fieldset class="left_holder inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo $lang['srv_inv_dashboard_not_enabled'];
+
+ # uporabnik nima pravic omogočit vabil
+ if (!$userAccess->checkUserAccess($what='invitations')) {
+ echo '<br/>'.$lang['srv_inv_dashboard_no_permissions'];
+ }
+ # uporabnik lahko vklopi email vabila
+ else {
+ echo '&nbsp;<a href="#" onclick="enableEmailInvitation(this);">'.$lang['srv_omogoci'].'</a>';
+ }
+
+ echo '</div>';
+
+ echo '</fieldset>';
+ }
+
+
+ // predpripravimo podatke za vsa pošiljanja
+ $cnt_by_sendings = array();
+
+ $all_units_count = count($cnt_by_user);
+ if ($all_units_count > 0) {
+
+ foreach ($cnt_by_user AS $uid => $ucnt) {
+ $cnt_by_sendings[$ucnt]++;
+ }
+
+ #pregled po pošiljanjih
+ echo '<fieldset class="right_holder inv_fieldset">';
+
+ echo '<legend>';
+ echo '<span class="pointer" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
+ echo '<span class="plus strong displayNone blue">+ </span>';
+ echo '<span class="minus strong blue">- </span>';
+ echo '<span class="legend blue">'.$lang['srv_inv_nav_email_sending_status'].'</span>';
+ echo '</span>';
+ echo Help::display('srv_inv_cnt_by_sending');
+ echo '</legend>';
+
+
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo '<table style="border-spacing:0px; padding:0px; margin:0 0 20px 15px;">';
+ echo '<colgrup>';
+ echo '<col style="min-width:150px;"/>';
+ echo '<col style="min-width:150px;"/>';
+ echo '<col style="min-width:150px;"/>';
+ echo '</colgrup>';
+ echo '<tr>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_cnt'].'</th>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_units'].'</th>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_percentage'].'</th>';
+ echo '</tr>';
+ if ($cnt_by_sendings > 0) {
+ foreach ($cnt_by_sendings AS $cnt => $units) {
+ echo '<tr>';
+ echo '<td>'.$cnt.'</td>';
+ echo '<td>'.$units.'</td>';
+ $percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0;
+ echo '<td>'.Common::formatNumber ($percent,0,null,'%').'</td>';
+ echo '</tr>';
+ }
+ }
+ echo '<tr>';
+ echo '<td class="anl_bt_dot red">'.$lang['srv_inv_sending_overview_sum'].'</td>';
+ echo '<td class="anl_bt_dot red">'.$all_units_count.'</td>';
+ $percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0;
+ echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
+ echo '</tr>';
+ echo '</table>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+ }
+ }
+
+ // Prikaz statusov posiljanj pri volitvah
+ private function displayInvitationStatusVoting() {
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
+
+ $isEmail = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ // Email vabila so omogocena
+ if ((int)$isEmail > 0 && $userAccess->checkUserAccess($what='invitations')) {
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+ echo '<p>';
+
+ #koliko je vseh uporabnikov v bazi in kolkim je bil mail poslan
+ $sql_count = sisplet_query("SELECT count(id) as cnt, sent
+ FROM srv_invitations_recipients
+ WHERE ank_id='".$this->sid."' AND deleted ='0'
+ GROUP BY sent
+ ");
+
+ $cnt_all_in_db = 0;
+ $cnt_sent_in_db = 0;
+ while($row_count = mysqli_fetch_array($sql_count)){
+
+ $cnt_all_in_db += (int)$row_count['cnt'];
+
+ if($row_count['sent'] == '1'){
+ $cnt_sent_in_db += (int)$row_count['cnt'];
+ }
+ }
+
+
+ echo '<table class="inv_dashboard_table">';
+
+ // Vsi v bazi
+ echo '<tr>';
+ echo '<th>'.$lang['srv_inv_dashboard_tbl_all'].'</th>';
+ echo '<th>'.(int)$cnt_all_in_db.'</th>';
+ echo '<th>-</th>';
+ echo '<th>100%</th>';
+ echo '</tr>';
+
+ // Poslani
+ echo '<tr>';
+ echo '<td>'.$lang['srv_inv_dashboard_tbl_send'].'</td>';
+ echo '<td>'.(int)$cnt_sent_in_db.'</td>';
+ echo '<td>'.((int)$cnt_sent_in_db > 0 ? '100%' : '0%').'</td>';
+ echo '<td>'.$this->formatNumber(((int)$cnt_sent_in_db > 0 ? (int)$cnt_sent_in_db*100/(int)$cnt_all_in_db : 0),0,'%').'</td>';
+ echo '</tr>';
+
+ echo '</table>';
+
+ echo '</p>';
+ echo '</div>';
+ echo '</fieldset>';
+ }
+ // Email vabila niso omogocena
+ else {
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_email_status'].'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+ echo '<p>';
+
+ echo $lang['srv_inv_dashboard_not_enabled'];
+
+ # uporabnik nima pravic omogočit vabil
+ if (!$userAccess->checkUserAccess($what='invitations')) {
+ echo '<br/>'.$lang['srv_inv_dashboard_no_permissions'];
+ }
+ # uporabnik lahko vklopi email vabila
+ else {
+ echo '&nbsp;<a href="#" onclick="enableEmailInvitation(this);">'.$lang['srv_omogoci'].'</a>';
+ }
+
+ echo '</p>';
+ echo '</div>';
+ echo '</fieldset>';
+ }
+
+
+ // predpripravimo podatke za vsa pošiljanja
+ /*$cnt_by_sendings = array();
+
+ $all_units_count = count($cnt_by_user);
+ if ($all_units_count > 0) {
+ foreach ($cnt_by_user AS $uid => $ucnt) {
+ $cnt_by_sendings[$ucnt]++;
+ }
+
+ echo '<br/>';
+
+ #pregled po pošiljanjih
+ echo '<fieldset class="inv_fieldset">';
+
+ echo '<legend>';
+ echo '<span class="pointer" onClick="$(this).parent().parent().find(\'.inv_filedset_inline_div\').toggle(); $(this).find(\'.plus\').toggle();$(this).find(\'.minus\').toggle();">';
+ echo '<span class="plus strong displayNone blue">+ </span>';
+ echo '<span class="minus strong blue">- </span>';
+ echo '<span class="legend blue">'.$lang['srv_inv_nav_email_sending_status'].'</span>';
+ echo '</span>';
+ echo Help::display('srv_inv_cnt_by_sending');
+ echo '</legend>';
+
+ echo '<br/>';
+
+ echo '<div class="inv_filedset_inline_div">';
+ echo '<table style="border-spacing:0px; padding:0px; margin:0 0 20px 15px;">';
+ echo '<colgrup>';
+ echo '<col style="min-width:150px;"/>';
+ echo '<col style="min-width:150px;"/>';
+ echo '<col style="min-width:150px;"/>';
+ echo '</colgrup>';
+ echo '<tr>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_cnt'].'</th>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_units'].'</th>';
+ echo '<th class="anl_al">'.$lang['srv_inv_sending_overview_percentage'].'</th>';
+ echo '</tr>';
+ if ($cnt_by_sendings > 0) {
+ foreach ($cnt_by_sendings AS $cnt => $units) {
+ echo '<tr>';
+ echo '<td>'.$cnt.'</td>';
+ echo '<td>'.$units.'</td>';
+ $percent = ($all_units_count > 0) ? $units / $all_units_count * 100 : 0;
+ echo '<td>'.Common::formatNumber ($percent,0,null,'%').'</td>';
+ echo '</tr>';
+ }
+ }
+ echo '<tr>';
+ echo '<td class="anl_bt_dot red">'.$lang['srv_inv_sending_overview_sum'].'</td>';
+ echo '<td class="anl_bt_dot red">'.$all_units_count.'</td>';
+ $percent = ($all_units_count > 0) ? $all_units_count / $all_units_count * 100 : 0;
+ echo '<td class="anl_bt_dot red">'.Common::formatNumber ($percent,0,null,'%').'</td>';
+ echo '</tr>';
+ echo '</table>';
+ echo '</div>';
+ echo '</fieldset>';
+ }*/
+ }
+
+
+ function showInvitationSettings() {
+ global $lang, $admin_type, $global_user_id, $site_url, $site_path;
+
+ $row = $this->surveySettings;
+ $_email = (int)SurveyInfo::getInstance()->checkSurveyModule('email');
+
+ $userAccess = UserAccess::getInstance($global_user_id);
+
+ $noEmailing = SurveySession::get('inv_noEmailing');
+
+ # Admini, managerji in Clani, ki imajo odobren dostop - lahko vklopijo vabila
+ if ($userAccess->checkUserAccess($what='invitations')) {
+
+ // Vklop vabil
+ if ($_email == 0) {
+
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo '<p>';
+ echo $lang['srv_invitation_nonActivated_text1'];
+ echo '</p>';
+
+ echo '<p>';
+ if($lang['id'] == '1')
+ echo sprintf($lang['srv_invitation_nonActivated_text2'], 'https://www.1ka.si/d/sl/pomoc/prirocniki/posiljanje-email-vabil-pridobitev-dovoljenja?from1ka=1');
+ else
+ echo sprintf($lang['srv_invitation_nonActivated_text2'], 'https://www.1ka.si/d/en/help/manuals/sending-email-invitations-and-obtaining-authorization?from1ka=1');
+ echo '</p>';
+
+ echo '<p>';
+ // Za gorenje popravimo text
+ $text3 = (Common::checkModule('gorenje')) ? str_replace('1KA', 'ESurvey', $lang['srv_invitation_nonActivated_text3']) : $lang['srv_invitation_nonActivated_text3'];
+ echo $text3;
+ echo '</p>';
+
+
+ // Gumb OMOGOCI VABILA
+ echo '<div class="button_holder below">';
+
+ $text_button = (Common::checkModule('gorenje')) ? str_replace('1KA', 'ESurvey', $lang['srv_invitation_nonActivated_button_activate']) : $lang['srv_invitation_nonActivated_button_activate'];
+ echo '<button class="blue medium" onclick="enableEmailInvitation(\'1\');">'.$text_button.'</button>';
+
+ echo '</div>';
+
+
+ echo '</div>';
+ echo '</fieldset>';
+
+ echo '</div>';
+ }
+ // Vabila so vklopljena - NASTAVITVE
+ else{
+
+ if($noEmailing == 1){
+ echo '<div class="invitations_holder fullwidth invitations_settings">';
+ }
+ else{
+ echo '<div class="invitations_holder half-half invitations_settings">';
+ }
+
+
+ // Leva stran - navadne nastavitve
+ echo '<div class="left_holder">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_inv_nav_invitations_settings_general'].' '.Help::display('srv_inv_general_settings').'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo '<div id="surveyInvitationSetting">';
+
+ // Preverimo ce je vklopljen modul za volitve - potem ne pustimo nobenih preklopov
+ $voting_disabled = '';
+ if(SurveyInfo::getInstance()->checkSurveyModule('voting')){
+ $voting_disabled = ' disabled';
+
+ // Warning za volitve
+ echo '<div class="setting_holder red bold">'.$lang['srv_voting_warning'].'</div>';
+ }
+
+
+ $individual = (int)$this->surveySettings['individual_invitation'];
+
+ // Individualizirana vabila - GLAVNA NASTAVITEV
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_user_base_individual_invitaition'];
+ if($individual == 0)
+ echo ' '.Help::display('srv_user_base_individual_invitaition_note2').' </label>';
+ else
+ echo ' '.Help::display('srv_user_base_individual_invitaition_note').' </label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="0" id="individual_invitation_0"'.($individual == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_0">'.$lang['no1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="individual_invitation" value="1" id="individual_invitation_1"'.($individual == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'individual_invitation\',true);"/>';
+ echo ' <label for="individual_invitation_1">'.$lang['yes'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Ce niso indvidualizirana imamo samo nacin posiljanja
+ if ($individual == 0) {
+
+ // Nacin posiljanja (email, posta, sms...)
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0" '.($noEmailing == 0 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1" '.($noEmailing == 1 ? 'checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Nacin dokumentiranja (posta, sms, drugo)
+ if($noEmailing == 1){
+ $noEmailingType = SurveySession::get('inv_noEmailing_type');
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+ }
+ # Normalna vabila z unikatinim URL
+ else {
+
+ // Nacin posiljanja (email, posta, sms...)
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type'].': '.Help::display('srv_inv_sending_type').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="0" id="inv_messages_noEmailing_0"'.($noEmailing == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'0\');">';
+ echo ' <label for="inv_messages_noEmailing_0">'.$lang['srv_inv_message_noemailing_0'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="inv_messages_noEmailing" value="1" id="inv_messages_noEmailing_1"'.($noEmailing == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="noEmailingToggle(\'1\');">';
+ echo ' <label for="inv_messages_noEmailing_1">'.$lang['srv_inv_message_noemailing_1'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Nacin dokumentiranja (posta, sms, drugo)
+ if($noEmailing == 1){
+ $noEmailingType = SurveySession::get('inv_noEmailing_type');
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_inv_message_type_external'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="0" id="noMailType1" '.($noEmailingType == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'0\');" />';
+ echo ' <label for="noMailType1">'.$lang['srv_inv_message_noemailing_type1'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="1" id="noMailType2" '.($noEmailingType == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'1\');" />';
+ echo ' <label for="noMailType2">'.$lang['srv_inv_message_noemailing_type2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="noMailType" value="2" id="noMailType3" '.($noEmailingType == 2 ? ' checked="checked"' : '').' '.$voting_disabled.' onClick="noEmailingType(\'2\');" />';
+ echo ' <label for="noMailType3">'.$lang['srv_inv_message_noemailing_type3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ // Vnos kode - samo ce je email (drugace itak vedno rocni vnos)
+ if($noEmailing != 1){
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['usercode_required1'].':'.Help::display('usercode_required').'</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_required" value="0" id="usercode_required_0"'.($row['usercode_required'] == 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);">';
+ echo ' <label for="usercode_required_0">'.$lang['usercode_required2'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_required" value="1" id="usercode_required_1"'.($row['usercode_required'] == 1 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_required\',true);">';
+ echo ' <label for="usercode_required_1">'.$lang['usercode_required3'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+
+ if ($row['usercode_required'] != 0) {
+
+ echo '<div class="setting_holder">';
+
+ if($noEmailing == 1)
+ echo '<label>'.$lang['usercode_text2'].':</label>';
+ else
+ echo '<label>'.$lang['usercode_text'].':</label>';
+
+ $nagovorText = ($row['usercode_text'] && $row['usercode_text'] != null && $row['usercode_text'] != "") ? $row['usercode_text'] : $lang['srv_basecode'];
+ echo ' <textarea style="width:100%; height:65px;" name="usercode_text" onblur="surveyBaseSettingText(\'usercode_text\',false);return false;">'.$nagovorText.'</textarea>';
+
+ echo '</div>';
+ }
+
+
+ // Dostop brez kode
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="checkbox" name="usercode_skip_checkbox" value="0" id="usercode_skip_0"'.($row['usercode_skip'] != 0 ? ' checked="checked"' : '').' '.$voting_disabled.' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);" />';
+ echo ' <label for="usercode_skip_0" class="lbl_email_setting">'.$lang['srv_user_base_access_check'].' '.Help::display('srv_inv_no_code');
+ echo ' </div>';
+
+ echo '</div>';
+
+ if($row['usercode_skip'] > 0){
+
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_user_base_access'].Help::display('usercode_skip').' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="1" id="usercode_skip_1"'.($row['usercode_skip'] == 1 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_1">'.$lang['srv_vsi'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="usercode_skip" value="2" id="usercode_skip_2"'.($row['usercode_skip'] == 2 ? ' checked="checked"' : '').' onChange="surveyBaseSettingRadio(\'usercode_skip\',true);">';
+ echo ' <label for="usercode_skip_2">'.$lang['srv_setting_onlyAuthor'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+ }
+ }
+
+ // Gumb shrani - samo provizorično
+ echo '<div class="button_holder below float-right">';
+ echo ' <button class="white-black medium" title="'.$lang['save'].'">'.$lang['save'].'</button>';
+ echo ' <a href="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=add_recipients_view"><button class="blue medium">'.$lang['next1'].'</button></a>';
+ echo '</div>';
+
+
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '</fieldset>';
+
+ echo '</div>';
+
+
+ // desna stran - nastavitve streznika - samo ce imamo posiljanje preko emaila
+ if($noEmailing != 1){
+
+ // Gorenje tega nima
+ if (!Common::checkModule('gorenje')){
+
+ echo '<div class="right_holder">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_email_setting_title'].'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo '<div id="surveyInvitationSettingServer">';
+ $this->viewServerSettings();
+ echo '</div>';
+
+ echo '</div>';
+ echo '</fieldset>';
+
+ echo '</div>';
+ }
+ }
+
+
+ echo '</div>';
+ }
+ }
+ # navadni uporabniki, ki nimajo dostopa - text kako lahko pridobijo dostop
+ else {
+
+ echo '<div class="invitations_holder fullwidth invitations_switch">';
+
+ echo '<fieldset class="inv_fieldset"><legend>'.$lang['srv_invitation_nonActivated_title'].'</legend>';
+ echo '<div class="inv_filedset_inline_div">';
+
+ echo '<p>';
+ echo $lang['srv_invitation_nonActivated_text1'];
+ echo '</p>';
+
+ echo '<p>';
+ if($lang['id'] == '1')
+ echo sprintf($lang['srv_invitation_nonActivated_text2'], 'https://www.1ka.si/d/sl/pomoc/prirocniki/posiljanje-email-vabil-pridobitev-dovoljenja?from1ka=1');
+ else
+ echo sprintf($lang['srv_invitation_nonActivated_text2'], 'https://www.1ka.si/d/en/help/manuals/sending-email-invitations-and-obtaining-authorization?from1ka=1');
+
+ echo '</p>';
+
+ echo '<p>';
+ echo $lang['srv_invitation_nonActivated_text3'];
+ echo '</p>';
+
+
+ // Gumb ZAPROSI ZA DOSTOP DO VABIL
+ echo '<div class="button_holder below">';
+ echo ' <a href="https://www.1ka.si/d/sl/pomoc/vodic-za-uporabnike/objava/1ka-vabila/?from1ka=1" target="_blank">';
+ echo ' <button class="blue medium">'.$lang['srv_invitation_nonActivated_button_details'].'</button>';
+ echo ' </a>';
+ echo '</div>';
+
+
+ echo '</div>';
+ echo '</fieldset>';
+
+ echo '</div>';
+ }
+ }
+
+ function formatNumber ($value, $digit = 0, $sufix = "") {
+ if ($value <> 0 && $value != null)
+ $result = round($value, $digit);
+ else
+ $result = "0";
+
+ # polovimo decimalna mesta in vejice za tisočice
+
+ $decimal_point = SurveyDataSettingProfiles :: getSetting('decimal_point');
+ $thousands = SurveyDataSettingProfiles :: getSetting('thousands');
+
+ $result = number_format($result, $digit, $decimal_point, $thousands) . $sufix;
+
+ return $result;
+ }
+
+ function showInvitationLists($profile_id=null) {
+ global $lang,$global_user_id;
+
+ echo '<div class="invitations_holder half-half invitation_lists">';
+
+
+ echo '<div class="left_holder">';
+ echo ' <div class="top_settings">';
+ echo ' <label>'.$lang['srv_inv_list_edit_list'].':</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type1" type="radio" value="1" onclick="showInvitationListsNames();" checked="checked" autocomplete="off"><label for="inv_show_list_type1">'.$lang['srv_inv_list_edit_from_this_survey'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type2" type="radio" value="0" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type2">'.$lang['srv_inv_list_edit_from_all_surveys'].'</label>';
+ echo ' <input name="inv_show_list_type" id="inv_show_list_type3" type="radio" value="2" onclick="showInvitationListsNames();" autocomplete="off"><label for="inv_show_list_type3">'.$lang['srv_inv_list_edit_from_archive'].'</label>';
+ echo ' </div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <a href="#" onclick="inv_upload_list();" class="noline">'.$lang['srv_inv_list_upload_file'].'</a>';
+ echo ' </div>';
+
+ echo ' <div id="inv_edit_rec_list">';
+ $this->showInvitationListsNames($profile_id);
+ echo ' </div>';
+ echo '</div>';
+
+
+ echo '<div id="inv_selected_rec_list" class="right_holder">';
+ $doEdit = (isset($_SESSION['inv_edit_rec_profile'][$this->sid]) && $_SESSION['inv_edit_rec_profile'][$this->sid] == 'true') ? true : false;
+ if ($doEdit) {
+ $this->showEditRecList($profile_id);
+ }
+ else {
+ $this->showNoEditRecList($profile_id);
+ }
+ echo '</div>';
+
+
+ echo '</div>';
+ }
+
+ function showInvitationListsNames($profile_id=null) {
+ global $lang,$global_user_id;
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 1;
+ if ($profile_id == null) {
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ } else {
+ $pids = explode(',',$profile_id);
+ }
+
+ if ($onlyThisSurvey == 0) {
+ #id-ji profilov do katerih lahko dostopamo
+ $accPid = '';
+ $accStr = "SELECT DISTINCT pid FROM srv_invitations_recipients_profiles_access where uid = '$global_user_id'";
+ $accQry = sisplet_query($accStr);
+ $prefix = '';
+ while (list($pid) = mysqli_fetch_row($accQry)) {
+ $accPid .= $prefix ."'".$pid."'";
+ $prefix = ',';
+ }
+
+ # polovimo še ostale porfile
+ $sql_string = "SELECT rp.*,DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS ds, u.name as firstname, u.surname, u.email FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE rp.uid in('".$global_user_id."')".($accPid != '' ? ' OR pid IN ('.$accPid.')':'');
+
+ $sql_query = sisplet_query($sql_string);
+ } else if ($onlyThisSurvey == 2) {
+ $sql_string = "SELECT sia.*,sia.id as pid, sia.naslov AS name, DATE_FORMAT(sia.date_send,'%d.%m.%Y, %T') AS ds, u.name as firstname, u.surname, u.email FROM srv_invitations_archive AS sia LEFT JOIN users AS u ON sia.uid = u.id WHERE ank_id = '".$this->sid."' ORDER BY sia.date_send DESC;";
+ $sql_query = sisplet_query($sql_string);
+ } else {
+ # 1
+ $sql_string = "SELECT rp.*, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS ds , u.name as firstname, u.surname, u.email FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id WHERE from_survey = '$this->sid'";
+ $sql_query = sisplet_query($sql_string);
+ }
+
+ if (mysqli_num_rows($sql_query) > 0) {
+ echo '<table class="inv_edit_rec_list">';
+
+ echo '<tr>';
+
+ if ($onlyThisSurvey != 2) {
+ echo '<th class="edit">';
+ echo ' <input type="checkbox" id="inv_list_chck_all" onclick="inv_list_selectAll(this.checked);">';
+ echo ' <label for="inv_list_chck_all"></label>';
+ echo ' <a href="#" title="'.$lang['srv_invitation_recipients_delete_selected'].'" onclick="inv_recipients_list_action(\'delete\');"><span class="faicon delete"></span></a>';
+ echo '</th>';
+ }
+ else{
+ echo '<th></th>';
+ }
+
+ echo '<th>';
+ echo $lang['srv_inv_list_table_name'];
+ echo '</th>';
+ echo '<th>';
+ echo $lang['srv_inv_list_table_cnt_receive'];
+ echo '</th>';
+ echo '<th>';
+ echo $lang['srv_inv_list_table_comment'];
+ echo '</th>';
+ echo '<th>';
+ echo $lang['srv_inv_list_table_date_create'];
+ echo '</th>';
+ echo '<th>';
+ echo $lang['srv_inv_list_table_author'];
+ echo '</th>';
+ echo '</tr>';
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ echo '<tr>';
+
+ if ($onlyThisSurvey != 2) {
+
+ echo '<td class="edit">';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+
+ echo ' <span class="faicon delete" onclick="deleteRecipientsList_confirm(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_delete'].'"></span>';
+
+ echo ' <span class="faicon quick_edit users" onclick="inv_list_edit(\''.$sql_row['pid'].'\'); return false;" title="'.$lang['srv_inv_list_profiles_edit_access'].'"></span>';
+ echo '</td>';
+ }
+ else{
+ echo '<td>';
+ echo ' <input type="checkbox" class="test_checkAll" id="inv_list_chck_'.$sql_row['pid'].'" onclick="changeInvRecListCheckbox();" value="'.$sql_row['pid'].'" '.(in_array($sql_row['pid'], $pids) ? ' checked="checked"' : '').'autocomplete="off">';
+ echo ' <label for="inv_list_chck_'.$sql_row['pid'].'"></label>';
+ echo '</td>';
+ }
+
+ echo '<td>';
+ echo '<label for="inv_list_chck_'.$sql_row['pid'].'">';
+ echo $sql_row['name'];
+ echo '</label>';
+ echo '</td>';
+
+ echo '<td>';
+ if (isset($sql_row['respondents'])) {
+ $_recipients = str_replace("\n\r", "\n", $sql_row['respondents']);
+ $_recipients = explode("\n",$_recipients);
+ echo count($_recipients);
+ } else if (isset($sql_row['cnt_succsess']) || isset($sql_row['cnt_error'])) {
+ echo (int)$sql_row['cnt_succsess']+(int)$sql_row['cnt_error'];
+ }
+ echo '</td>';
+
+ echo '<td>';
+ echo $sql_row['comment'];
+ echo '</td>';
+
+ echo '<td>';
+ echo $sql_row['ds'];
+ echo '</td>';
+
+ echo '<td title="'.$sql_row['email'].'">';
+ echo $sql_row['firstname'];
+ echo ' '.(isset($sql_row['surname']) ? $sql_row['surname'] : '');
+ echo '</td>';
+
+ echo '</tr>';
+ }
+
+ echo '</table>';
+ }
+ else {
+ echo $lang['srv_inv_list_no_lists'];
+ }
+
+ return (int)mysqli_num_rows($sql_query);
+ }
+
+ function showNoEditRecList($profile_id = null) {
+ global $lang;
+
+ $pids=array();
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
+ if($profile_id == null){
+
+ # preberemo id-je profilov in respondente
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
+ $pids = explode(',',$_POST['pids']);
+ }
+ }
+ else{
+ # preberemo id-je profilov in respondente
+ if ($profile_id != ''){
+ $pids = explode(',',$profile_id);
+ }
+ }
+
+ if (is_array($pids) && count($pids) == 0) {
+ echo $lang['srv_inv_list_choose_left'].'<br>';
+ }
+
+ session_start();
+ $infoBox = null;
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
+ $fields = array();
+
+ # info box prikazujemo samo ko imamo izbran 1 seznam
+ if ($onlyThisSurvey <= 1){
+ # če imamo normalne sezname
+
+ if (is_array($pids) && count($pids) == 1) {
+ $sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
+ }
+ else {
+ $sql_string = "SELECT rp.respondents, fields FROM srv_invitations_recipients_profiles AS rp WHERE rp.pid IN(".(implode(',',$pids)).")";
+ }
+
+ $sql_query = sisplet_query($sql_string);
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query)){
+
+ # info box prikazujemo samo ko imamo izbran 1 seznam
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox .= '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
+ $infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
+ $infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
+ $infoBox .= '</span>';
+
+ if ($sql_row['fitime'] != $sql_row['fetime']) {
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
+ $infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
+ $infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
+ }
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_name'].$sql_row['name'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '<span>';
+ $infoBox .= ' <label>'.$lang['srv_inv_list_edit_comment'].$sql_row['comment'].'</label>';
+ $infoBox .= '</span>';
+
+ $infoBox .= '</div>';
+ }
+
+ $respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
+ $respondents_list = explode("\n",$respondents_list);
+ $respondents = array_merge($respondents,$respondents_list);
+
+ $_fields = explode(",",$sql_row['fields']);
+ foreach ($_fields as $_field)
+ {
+ if (!in_array($_field,$fields)) {
+ $fields[] = $_field;
+ }
+ }
+ } # end-while
+ }
+ else{
+ # imamo arhive
+ $fields = array();
+ $_recipients = array();
+ $sql_string = "SELECT email,firstname,lastname,salutation,phone,custom,relation FROM srv_invitations_recipients AS sir WHERE sir.id IN (SELECT siar.rec_id FROM srv_invitations_archive_recipients siar WHERE siar.arch_id IN (".(implode(',',$pids))."))";
+ $sql_query = sisplet_query($sql_string);
+ while ($row = mysqli_fetch_assoc($sql_query) ) {
+ $_recipients[] = $row;
+ foreach ($row AS $key => $value) {
+ if ($value !== null && !in_array($key,$fields)) {
+ $fields[] = $key;
+ }
+ }
+ }
+
+ # pripravimo respondente
+ foreach ($_recipients AS $_recipient) {
+ $recipient = '';
+ $prefix='';
+ foreach ($fields AS $field) {
+ $recipient.=$prefix.$_recipient[$field];
+ $prefix=',';
+ }
+ if ($recipient != '') {
+ $respondents[] = $recipient;
+ }
+ }
+
+ }
+
+ # pohandlamo polja
+ $field_list = array();
+ $default_fields = array(
+ 'inv_field_email' => count($fields) == 0 ? 1 : 0,
+ 'inv_field_firstname' => 0,
+ 'inv_field_lastname' => 0,
+ 'inv_field_password' => 0,
+ 'inv_field_salutation' => 0,
+ 'inv_field_phone' => 0,
+ 'inv_field_custom' => 0,
+ );
+
+ // Ce imamo modul 360 imamo tudi odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ $default_fields['inv_field_relation'] = 0;
+ }
+
+ # skreiramo nov vrstni red polj
+ if (count($fields) > 0) {
+ foreach ($fields as $field) {
+ $field_list['inv_field_'.$field] = 1;
+ if (isset($default_fields['inv_field_'.$field])) {
+ unset($default_fields['inv_field_'.$field]);
+ }
+ }
+ }
+
+ if (count($default_fields) > 0){
+ foreach ($default_fields as $key =>$field) {
+ $field_list[$key] = $field;
+ unset($default_fields[$key]);
+ }
+ }
+ $respondents = array_unique($respondents);
+
+
+ echo '<table class="inv_edit_rec_list">';
+
+ echo '<tr>';
+ $fields_cnt = 0;
+ foreach ($field_list AS $field => $checked){
+ if ($checked == 1) {
+ $fields_cnt++;
+ echo '<th title="'.$lang['srv_'.$field].'">'.$lang['srv_'.$field].'</th>';
+ }
+ }
+ echo '</tr>';
+
+ if (is_array($respondents) && count($respondents) > 0 ){
+ foreach ($respondents AS $respondent_data){
+ $row_cnt = 0;
+
+ echo '<tr>';
+
+ $respondent_data_array = explode('|~|',$respondent_data);
+ if (count($respondent_data_array) > 0) {
+ foreach ($respondent_data_array AS $tekst) {
+ if ($row_cnt < $fields_cnt) {
+ echo '<td>'.str_replace ("|~|", ",", $tekst).'</td>';
+ $row_cnt++;
+ }
+ }
+ }
+
+ echo '</tr>';
+ }
+ }
+
+ echo '</table>';
+ }
+
+ echo $infoBox;
+ }
+
+ function showEditRecList($profile_id = null){
+ global $lang;
+
+ $pids=array();
+
+ $onlyThisSurvey = isset($_POST['onlyThisSurvey']) ? (int)$_POST['onlyThisSurvey'] : 0;
+
+ if ($profile_id == null) {
+
+ # preberemo id-je profilov in respondente
+ if ($this->invitationAdvancedConditionId != '' && $this->invitationAdvancedConditionId != '0'){
+ $pids = explode(',',$this->invitationAdvancedConditionId);
+ }
+ elseif ($_POST['pids'] != '') {
+ $pids = explode(',',$_POST['pids']);
+ }
+ }
+ else {
+ # preberemo id-je profilov in respondente
+ if ($profile_id != '') {
+ $pids = explode(',',$profile_id);
+ }
+ }
+
+ if (is_array($pids) && count($pids) == 0) {
+ echo $lang['srv_inv_list_choose_left'].'<br>';
+ }
+
+ session_start();
+
+ if (is_array($pids) && !empty($pids)){
+
+ echo '<div><input name="inv_show_list_edit" id="inv_show_list_edit" type="checkbox" value="1" onclick="changeInvRecListEdit();" checked="checked"><label for="inv_show_list_edit">'.$lang['srv_inv_list_edit'].'</label></div>';
+
+ $respondents = array();
+ $fields = array();
+ $infoBox = null;
+ if ($onlyThisSurvey <= 1){
+
+ # če imamo normalne sezname
+ if (is_array($pids) && count($pids) == 1) {
+ $sql_string = "SELECT rp.respondents, fields,rp.name, rp.comment, u.email AS iemail, DATE_FORMAT(rp.insert_time,'%d.%m.%Y, %T') AS fitime, e.email AS eemail, DATE_FORMAT(rp.edit_time,'%d.%m.%Y, %T') AS fetime FROM srv_invitations_recipients_profiles AS rp LEFT JOIN users AS u ON rp.uid = u.id LEFT JOIN users AS e ON rp.uid = e.id WHERE rp.pid IN(".(implode(',',$pids)).")";
+ } else {
+ $sql_string = "SELECT rp.respondents, fields FROM srv_invitations_recipients_profiles AS rp WHERE rp.pid IN(".(implode(',',$pids)).")";
+ }
+
+ $sql_query = sisplet_query($sql_string);
+
+ while ($sql_row = mysqli_fetch_assoc($sql_query))
+ {
+ # info box prikazujemo samo ko imamo izbran 1 seznam
+ if (is_array($pids) && count($pids) == 1){
+
+ $infoBox = '<div class="info_box">';
+
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_added'].' ';
+ $infoBox .= trim($sql_row['iemail']) != '' ? $sql_row['iemail'] : $lang['srv_inv_list_edit_1kasi'];
+ $infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fitime'];
+ $infoBox .= '</span>';
+
+ if ($sql_row['fitime'] != $sql_row['fetime']){
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_changed'].' ';
+ $infoBox .= trim($sql_row['eemail']) != '' ? $sql_row['eemail'] : $lang['srv_inv_list_edit_1kasi'];
+ $infoBox .= $lang['srv_inv_list_edit_date'].$sql_row['fetime'];
+ $infoBox .= '</span>';
+ }
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_name'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium" id="rec_profile_name" value="'.$sql_row['name'].'" tabindex="1">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '<div class="setting_item">';
+ $infoBox .= '<span>';
+ $infoBox .= $lang['srv_inv_list_edit_comment'];
+ $infoBox .= '</span>';
+ $infoBox .= '<span>';
+ $infoBox .= ' <input type="text" class="medium w400" id="rec_profile_comment" value="'.$sql_row['comment'].'" tabindex="2">';
+ $infoBox .= '</span>';
+ $infoBox .= '</div>';
+
+ $infoBox .= '</div>';
+ }
+
+ $respondents_list = str_replace("\n\r", "\n", $sql_row['respondents']);
+ $respondents_list = explode("\n",$respondents_list);
+ $respondents = array_merge($respondents,$respondents_list);
+
+ $_fields = explode(",",$sql_row['fields']);
+ foreach ($_fields as $_field)
+ {
+ if (!in_array($_field,$fields))
+ {
+ $fields[] = $_field;
+ }
+ }
+ }
+ }
+ else
+ {
+ # imamo arhive
+ $fields = array();
+ $_recipients = array();
+ $sql_string = "SELECT email,firstname,lastname,salutation,phone,custom,relation FROM srv_invitations_recipients AS sir WHERE sir.id IN (SELECT siar.rec_id FROM srv_invitations_archive_recipients siar WHERE siar.arch_id IN (".(implode(',',$pids))."))";
+ $sql_query = sisplet_query($sql_string);
+ while ($row = mysqli_fetch_assoc($sql_query) ) {
+ $_recipients[] = $row;
+ foreach ($row AS $key => $value) {
+ if ($value !== null && !in_array($key,$fields)) {
+ $fields[] = $key;
+ }
+ }
+ }
+
+ # pripravimo respondente
+ foreach ($_recipients AS $_recipient) {
+ $recipient = '';
+ $prefix='';
+ foreach ($fields AS $field) {
+ $recipient.=$prefix.$_recipient[$field];
+ $prefix=',';
+ }
+ if ($recipient != '') {
+ $respondents[] = $recipient;
+ }
+ }
+
+ }
+ # pohandlamo polja
+ $field_list = array();
+ $default_fields = array(
+ 'inv_field_email' => count($fields) == 0 ? 1 : 0,
+ 'inv_field_firstname' => 0,
+ 'inv_field_lastname' => 0,
+ 'inv_field_password' => 0,
+ 'inv_field_salutation' => 0,
+ 'inv_field_phone' => 0,
+ 'inv_field_custom' => 0,
+ );
+
+ // Ce imamo modul 360 imamo tudi odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ $default_fields['inv_field_relation'] = 0;
+ }
+
+ # skreiramo nov vrstni red polj
+ if (count($fields) > 0) {
+ foreach ($fields as $field) {
+ $field_list['inv_field_'.$field] = 1;
+ if (isset($default_fields['inv_field_'.$field])) {
+ unset($default_fields['inv_field_'.$field]);
+ }
+ }
+ }
+
+ if (count($default_fields) > 0) {
+ foreach ($default_fields as $key =>$field) {
+ $field_list[$key] = $field;
+ unset($default_fields[$key]);
+ }
+ }
+ $respondents = array_unique($respondents);
+ echo '<div id="inv_field_container">';
+ echo '<ul class="connectedSortable">';
+ $field_lang = array();
+ if (count($field_list ) > 0) {
+ foreach ($field_list AS $field => $checked)
+ {
+ # ali je polje izbrano ( če imamo personalizirano e-vabilo, moramo nujno imeti polje email
+ $is_selected = ($checked == 1 ) ? true : false;
+
+ # če je polje obkljukano
+ $css = $is_selected ? ' class="inv_field_enabled"' : '';
+
+ # ali labela sproži klik checkboxa
+ $label_for = ' for="'.$field.'_chk"';
+ echo '<li id="'.$field.'"'.$css.'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
+ echo '</li>';
+ }
+ if ($is_selected == 1) {
+ $field_lang[] = $lang['srv_'.$field];
+ }
+ }
+ echo '</ul>';
+ echo '</div>';
+
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
+ echo '<div>';
+ echo '<textarea id="inv_recipients_list" name="inv_recipients_list">';
+ if (is_array($respondents) && count($respondents) > 0 ) {
+ echo str_replace ("|~|", ",", implode("\n",$respondents));
+ }
+ echo '</textarea>';
+ echo '</div>';
+
+ echo $infoBox;
+
+
+ echo '<div class="button_holder below">';
+
+ if (count($pids) <= 1 )
+ echo '<button class="medium white-black" onclick="inv_list_save_old(\''.implode('',$pids).'\'); return false;">'.$lang['srv_inv_list_save_old'].'</button>';
+ echo '<button class="medium white-blue" onclick="inv_list_get_name(\'true\'); return false;">'.$lang['srv_inv_list_save_new'].'</button>';
+
+ echo '</div>';
+ }
+
+ }
+
+ function invListEdit() {
+ global $lang,$site_url, $global_user_id;
+
+ echo '<h2>'.$lang['access'].'</h2>';
+ echo '<div class="popup_close"><a href="#" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">✕</a></div>';
+
+ # polovimo podatke profila
+ $sql_string = "SELECT pid, name, comment, uid FROM srv_invitations_recipients_profiles WHERE pid='".$_POST['pid']."'";
+ $sql_query = sisplet_query($sql_string);
+ list($pid, $name, $comment, $uid) = mysqli_fetch_row($sql_query);
+ echo '<div id="inv_recipients_profile_name" class="access">';
+ echo '<form id="inv_list_edit_form" name="inv_list_edit_form" autocomplete="off">';
+
+ $this->displayListAccess($pid);
+
+ # skrita polja za respondente in polja
+ echo '<input id="profile_id" name="profile_id" type="hidden" value="'.($_POST['pid']).'" >';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;">'.$lang['srv_cancel'].'</button>';
+ echo '<button class="medium blue" onclick="inv_list_edit_save(); return false;">'.$lang['save'].'</button>';
+ echo '</div>';
+
+ echo '</form>';
+ echo '</div>'; # id="inv_view_arch_recipients"
+ }
+
+ function listGetName() {
+ global $lang,$site_url, $global_user_id;
+
+ $saveNew = $_POST['saveNew'] == 'true' ? true : false;
+ $pid = isset($_POST['pid']) ? isset($_POST['pid']) : '';
+
+ $array_profiles = array();
+ #ne vem če je fino da lahko dodaja kar na vse sezname
+ session_start();
+
+ # polovimo še ostale porfile
+ $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')";
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $array_profiles[$sql_row['pid']] = array('name' => $sql_row['name'], 'comment'=>$sql_row['comment']);
+ }
+
+ echo '<div id="inv_recipients_profile_name">';
+ if ($saveNew == true) {
+ echo '<span id="new_recipients_list_span" >';
+ echo '<label>'.$lang['srv_inv_recipient_list_name'];
+ # zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
+ $new_name = $lang['srv_inv_recipient_list_new'];
+ $names = array();
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $q = sisplet_query($s);
+ while ($r = mysqli_fetch_assoc($q)) {
+ $names[] = $r['name'];
+ }
+ if (count($names) > 0) {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_recipient_list_new'].$cnt, $names)) {
+ $cnt++;
+ }
+ $new_name = $lang['srv_inv_recipient_list_new'].$cnt;
+ }
+
+ echo '<input type="text" id="rec_profile_name" value="'.$new_name.'" tabindex="1" autofocus="autofocus">';
+ echo '</label>';
+ echo '</span>';
+ } else {
+ echo '<span id="new_recipients_list_span" >';
+ echo '<label>'.$lang['srv_inv_recipient_list_name'];
+ echo '<input type="text" id="rec_profile_name" value="'.isset($array_profiles[$pid]['name']) ? $array_profiles[$pid]['name'] : ''.'" tabindex="1" autofocus="autofocus">';
+ echo '</label>';
+ echo '</span>';
+ }
+
+ echo '<br/><br/>';
+ echo $lang['srv_inv_recipient_list_comment'];
+
+ echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >'.isset($array_profiles[$pid]['comment']) ? $array_profiles[$pid]['comment'] : ''.'</textarea>';
+ # skrita polja za respondente in polja
+ $_fields = str_replace('inv_field_','',implode(',',$_POST['fields']));
+ echo '<input id="inv_prof_field_list" type="hidden" value="'.$_fields.'" >';
+ echo '<input id="inv_prof_recipients_list" type="hidden" value="'.$this->getCleanString($_POST['recipients_list']).'" >';
+ echo '<input id="saveNew" type="hidden" value="'.($saveNew == true ? 'true' : 'false').'" >';
+ echo '<input id="profile_id" type="hidden" value="'.($pid).'" >';
+ echo '<br class="clr" /><br/>';
+ echo '<span class="buttonwrapper floatLeft spaceRight" title="'.$lang['srv_cancel'].'"><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#fade\').fadeOut(\'slow\');$(\'#fullscreen\').fadeOut(\'slow\').html(\'\');return false;" ><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '<span class="buttonwrapper floatRight spaceRight" title="'.$lang['save'].'"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_list_save(); return false;"><span>'.$lang['save'].'</span></a></span>';
+ echo '<br class="clr" />';
+ echo '</div>'; # id="inv_view_arch_recipients"
+ echo '<script type="text/javascript">';
+ echo "$('#rec_profile_name').focus();";
+ echo '</script>';
+ }
+
+ function invListSaveOld() {
+ global $lang,$site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $recipients_list = trim($this->getCleanString($_POST['recipients_list']));
+
+ $field_list = (is_array($_POST['field_list']) && count($_POST['field_list']) > 0) ? implode(',',$_POST['field_list']) : trim($_POST['field_list']);
+ $field_list = str_replace('inv_field_','',$field_list);
+
+ $profile_id = explode(',',$_POST['profile_id']);
+ $profile_id = $profile_id[0];
+
+ $rec_profile_name = $_POST['rec_profile_name'];
+ $rec_profile_comment = $_POST['rec_profile_comment'];
+
+ # dodajamo v obstoječ profil
+ $sql_string_update = "UPDATE srv_invitations_recipients_profiles SET name='$rec_profile_name', comment='$rec_profile_comment', respondents = '$recipients_list', fields='$field_list' WHERE uid in('$global_user_id') AND pid = '$profile_id'";
+ $sqlQuery = sisplet_query($sql_string_update);
+ sisplet_query("COMMIT");
+ $this->removeDuplicates($profile_id);
+
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error, 'pid'=>$profile_id());
+ } else {
+ $return = array('error'=>'0', 'msg'=>'x2', 'pid'=>$profile_id);
+ }
+ #echo json_encode($return);
+
+ $this->showInvitationLists($profile_id);
+ }
+
+
+ function listSave() {
+ global $lang,$site_url, $global_user_id;
+
+ $return = array('error'=>'0');
+ $profile_name = (isset($_POST['profile_name']) && trim($_POST['profile_name']) != '') ? trim($_POST['profile_name']) : $lang['srv_invitation_new_templist'];
+ $profile_comment = (isset($_POST['profile_comment']) && trim($_POST['profile_comment']) != '') ? trim($_POST['profile_comment']) : '';
+ $recipients_list = trim($this->getCleanString($_POST['recipients_list']));
+ $field_list = (isset($_POST['field_list']) && trim($_POST['field_list']) != '') ? trim($_POST['field_list']) : 'email';
+ $profile_id = explode(',',$_POST['profile_id']);
+ $profile_id = $profile_id[0];
+
+
+ $saveNew = $_POST['saveNew'] == 'true' ? true : false;
+ if ($saveNew == true) {
+ # shranjujemo v nov profil
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles (name,uid,fields,respondents,insert_time,comment, from_survey) VALUES ('$profile_name', '$global_user_id', '$field_list', '$recipients_list', NOW(), '$profile_comment', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ $new_pid = mysqli_insert_id($GLOBALS['connect_db']);
+ sisplet_query("COMMIT");
+
+ #odstranimo podvojene
+ $this->removeDuplicates($new_pid);
+
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error, 'pid'=>$new_pid);
+ } else {
+ $return = array('error'=>'0', 'msg'=>'x1', 'pid'=>$new_pid);
+ }
+ sisplet_query("COMMIT");
+ } else {
+ # dodajamo v obstoječ profil
+ $sql_string_update = "UPDATE srv_invitations_recipients_profiles SET name='$profile_name', respondents = '$recipients_list', comment='$profile_comment' WHERE uid in('$global_user_id') AND pid = '$profile_id'";
+ $sqlQuery = sisplet_query($sql_string_update);
+ sisplet_query("COMMIT");
+
+ #odstranimo podvojene
+ $this->removeDuplicates($profile_id);
+
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $return = array('error'=>'1', 'msg'=>$error, 'pid'=>$profile_id());
+ } else {
+ $return = array('error'=>'0', 'msg'=>'x2', 'pid'=>$profile_id);
+ }
+ }
+ #echo json_encode($return);
+ $this->showInvitationLists();
+ }
+
+ function invListEditSave() {
+ global $lang,$site_url, $global_user_id;
+ /*
+ * rec_profile_name] => Seznam1 [rec_profile_comment] => Komentar [uid] => Array ( [0] => 1045 [1] => 1049 [2] => 1046 ) [profile_id] => 2 [anketa] => 94 )
+ */
+ $return = array('error'=>'0');
+ $profile_name = (isset($_POST['rec_profile_name']) && trim($_POST['rec_profile_name']) != '') ? trim($_POST['rec_profile_name']) : $lang['srv_invitation_new_templist'];
+ $profile_comment = (isset($_POST['rec_profile_comment']) && trim($_POST['rec_profile_comment']) != '') ? trim($_POST['rec_profile_comment']) : '';
+
+ $uids = $_POST['uid'];
+ $pid = (int)$_POST['profile_id'];
+ # pripravimo insert query (id avtorja ne dodajamo v dostope, ker je tako v uid profila)
+ $insert_string = array();
+ if (count($uids) > 0) {
+ foreach ($uids AS $key => $uid) {
+ $insert_string[] = "('".$pid."','".$uid."')";
+ }
+ }
+ # pobrišemo stare vrednosti dostopov in jih nastavimo na novo
+ $delStr = "DELETE FROM srv_invitations_recipients_profiles_access WHERE pid = '$pid'";
+ $delQuery = sisplet_query($delStr);
+
+ if (count($insert_string)) {
+ # dodamo nove vrednosti dostopov
+ $insStr = "INSERT INTO srv_invitations_recipients_profiles_access VALUES ".implode(',',$insert_string);
+ $insQuery = sisplet_query($insStr);
+ }
+ sisplet_query("COMMIT");
+
+
+
+ # dodajamo v obstoječ profil
+ # $sql_string_update = "UPDATE srv_invitations_recipients_profiles SET name='$profile_name', comment='$profile_comment' WHERE pid = '$pid'";
+ # $sqlQuery = sisplet_query($sql_string_update);
+ # sisplet_query("COMMIT");
+ // if (!$sqlQuery) {
+ # $error = mysqli_error($GLOBALS['connect_db']);
+ # $return = array('error'=>'1', 'msg'=>$error, 'pid'=>$pid);
+ # } else {
+ # $return = array('error'=>'0', 'msg'=>'x2', 'pid'=>$pid);
+ # }
+ #echo json_encode($return);
+ $this->showInvitationLists();
+ }
+
+
+ function deleteRecipientsList() {
+ global $global_user_id;
+ $id = (int)$_POST['id'];
+
+ if ($id > 0 ) {
+ $sql_string = "DELETE FROM srv_invitations_recipients_profiles WHERE pid='".$id."' AND uid='".$global_user_id."'";
+ $sqlQuery = sisplet_query($sql_string);
+ sisplet_query("COMMIT");
+ }
+ $this->showInvitationLists();
+ }
+
+ function deleteRecipientsListMulti() {
+ $return = array('success'=>'0');
+ global $global_user_id, $lang;
+
+ $ids = $_POST['ids'];
+
+ if(count($ids) > 0){
+ $sql_string = "DELETE FROM srv_invitations_recipients_profiles WHERE uid='".$global_user_id."' AND pid IN(".implode(',',$ids).")";
+ $sqlQuery = sisplet_query($sql_string);
+ $sqlQuery = sisplet_query("COMMIT");
+ }
+ if (!$sqlQuery) {
+ $errors[] = $lang['srv_inv_recipient_delete_error'];
+ } else {
+ $return['success'] = 2;
+ //$this->showInvitationLists();
+ }
+ }
+
+ function removeDuplicates($pid) {
+ # dodamo tracking
+ if ((int)$pid > 0) {
+ $sql_string = "SELECT respondents FROM srv_invitations_recipients_profiles WHERE pid = '$pid'";
+ $sql_query = sisplet_query($sql_string);
+ $respondents = array();
+ list ($new_recipients) = mysqli_fetch_row($sql_query);
+ $new_recipients = str_replace("\n\r", "\n", $new_recipients);
+ $new_recipients = explode("\n",$new_recipients);
+ $new_recipients = implode("\n",array_unique($new_recipients));
+
+ $sql_string_update = "UPDATE srv_invitations_recipients_profiles SET respondents='".$new_recipients."' WHERE pid = '$pid'";
+ $sqlQuery = sisplet_query($sql_string_update);
+ sisplet_query("COMMIT");
+ }
+ }
+
+ function displayListAccess($pid) {
+ global $lang, $global_user_id, $admin_type;
+
+ # polovimo avtorja profila
+ $uidQuery = sisplet_query("SELECT uid FROM srv_invitations_recipients_profiles WHERE pid ='$pid'");
+ list($uid) = mysqli_fetch_row($uidQuery);
+
+ # polovimo id-je userjev ki imajo dostop do tega profila
+ $accessArray = array();
+ $accessQuery = sisplet_query("SELECT uid FROM srv_invitations_recipients_profiles_access WHERE pid ='$pid'");
+ while (list($uid_) = mysqli_fetch_row($accessQuery)) {
+ $accessArray[] = $uid_;
+ }
+
+ $sqlQuery = null;
+ // tip admina: 0=>admin, 1=>manager, 2=>clan, 3=>user
+ switch ( $admin_type ) {
+ case 0: // admin vidi vse
+ $sqlQuery = sisplet_query("SELECT name, surname, id, email FROM users ORDER BY name ASC");
+ break;
+ case 1: // manager vidi ljudi pod sabo
+ // polovimo vse clane ki spo pod managerjem
+ $sqlQuery = sisplet_query("SELECT DISTINCT name, surname, id, email FROM users WHERE id IN (SELECT DISTINCT user FROM srv_dostop_manage WHERE manager='$global_user_id') OR id = '$global_user_id'");
+
+ break;
+ case 2:
+ case 3:
+ // TODO
+ // clani in userji lahko vidijo samo tiste ki so jim poslali maile in so se registrirali
+ $sqlQuery = sisplet_query("SELECT name FROM users WHERE 1 = 0");
+ break;
+ }
+ echo '<span>'.$lang['srv_inv_list_access'].'</span><br/>';
+ echo '<span class="gray small">'.$lang['srv_inv_list_access_legend'].'</span><br/><br/>';
+ echo '<span id="invListAccessShow1"><a href="#" onClick="inv_listAccess(\'true\'); return false;">'.$lang['srv_dostop_show_all'].'</a></span>';
+ echo '<span id="invListAccessShow2" class="displayNone"><a href="#" onClick="inv_listAccess(\'false\'); return false;">'.$lang['srv_dostop_hide_all'].'</a></span>';
+ echo '<div id="invListAccess">';
+
+ while ($row1 = mysqli_fetch_assoc($sqlQuery)) {
+
+ $checked = ( in_array($row1['id'],$accessArray) ||$uid == $row1['id']) ? ' checked="checked"' : '';
+
+ $_css_hidden = ($checked != '' ? '' : ' displayNone');
+ echo '<div id="div_for_uid_' . $row1['id'] . '" name="listAccess" class="floatLeft listAccess_uid'.$_css_hidden.'">';
+ echo '<input type="checkbox" name="uid[]" value="' . $row1['id'] . '" id="uid_' . $row1['id'] . '"' . $checked .($uid == $row1['id'] ? ' disabled="disabled"' : ''). ' autocomplete="off"/>';
+ echo '<label nowrap title="' . $row1['email'] . '"'.($uid == $row1['id']?' class="gray"':'').'>'.$row1['name'] . ($uid == $row1['id'] ? ' (' . $lang['author'] . ')' : '') . '</label>';
+ echo '</div>';
+ }
+
+ echo '</div>';
+
+ }
+
+ function changeInvRecListEdit() {
+ session_start();
+
+ $_SESSION['inv_edit_rec_profile'][$this->sid] = ($_POST['checked'] == 'true' ? true : false);
+
+ session_commit();
+ }
+
+ function getUrlLists() {
+ global $lang,$site_url;
+
+ $result = array();
+
+ $p = new Prevajanje($this->sid);
+ $lang_array = $p->get_all_translation_langs();
+
+ $link = SurveyInfo::getSurveyLink();
+ $sqll = sisplet_query("SELECT link FROM srv_nice_links WHERE ank_id = '$this->sid' ORDER BY id ASC");
+
+ $default_checked =false;
+ $cnt=0;
+ #lepi linki
+ while ($rowl = mysqli_fetch_assoc($sqll)) {
+
+ $result[$cnt] = array('url'=>$site_url.$rowl['link'], 'name'=>$site_url.$rowl['link'].(count($lang_array) > 0 ? ' - '.$lang['language'].' ' : ''));
+ if ($default_checked == false) {
+ $result[$cnt]['dc'] = true;
+ $default_checked = true;
+ }
+ $cnt++;
+ if (count($lang_array) > 0) {
+ #jezikovni podlinki
+ foreach ($lang_array AS $lang_id => $lang_name) {
+ $result[$cnt] = array('url'=>$site_url.$rowl['link'].'?language='.$lang_id, 'name'=>$site_url.$rowl['link'].'?language='.$lang_id.' - '.$lang_name);
+ $cnt++;
+ }
+ }
+ }
+
+ $link1 = $site_url.'a/'.SurveyInfo::getInstance()->getSurveyHash();
+ # normalen link
+ $result[$cnt] = array('url'=>$link1, 'name'=>$link1.(count($lang_array) > 0 ? ' - '.$lang['language'] : ''));
+ if ($default_checked == false) {
+ $result[$cnt]['dc'] = true;
+ $default_checked = true;
+ }
+ $cnt++;
+
+ #jezikovni link
+ if (count($lang_array) > 0) {
+ foreach ($lang_array AS $lang_id => $lang_name) {
+ $result[$cnt] = array('url'=>$link1.'?language='.$lang_id, 'name'=>$link1.'?language='.$lang_id.' - '.$lang_name);
+ if ($default_checked == false) {
+ $result[$cnt]['dc'] = true;
+ $default_checked = true;
+ }
+ $cnt++;
+ }
+ }
+
+ return $result;
+ }
+
+ function upload_list() {
+ global $lang, $site_path, $site_url;
+
+ $fields = array();
+ $field_list = array();
+ # odvisno od tipa sporočil prikažemo različna polja
+ # Personalizirano e-poštno vabilo
+
+ $default_fields = array(
+ 'inv_field_email' => 1,
+ 'inv_field_firstname' => 0,
+ 'inv_field_lastname' => 0,
+ 'inv_field_password' => 0,
+ 'inv_field_salutation' => 0,
+ 'inv_field_phone' => 0,
+ 'inv_field_custom' => 0,
+ );
+
+ // Ce imamo modul 360 imamo tudi odnos
+ if(SurveyInfo::getInstance()->checkSurveyModule('360_stopinj')){
+ $default_fields['inv_field_relation'] = 0;
+ }
+
+ # pri personaliziranih aporočilih je e-mail obvezno polje
+ array_push($fields, 'inv_field_email');
+
+ # skreiramo nov vrstni red polj
+ if (count($fields) > 0) {
+ foreach ($fields as $key=>$field) {
+ $field_list[$field] = 1;
+ if (isset($default_fields[$field])) {
+ unset($default_fields[$field]);
+ }
+ }
+ }
+
+ if (count($default_fields) > 0) {
+ foreach ($default_fields as $key =>$field) {
+ $field_list[$key] = $field;
+ unset($default_fields[$key]);
+ }
+ }
+
+
+ echo '<div id="inv_upload_list">';
+
+ echo '<h2>'.$lang['srv_inv_list_upload_header'].'</h2>';
+
+ echo '<span class="inv_note">'.$lang['srv_inv_recipiens_field_note'].':</span>';
+
+ echo '<div id="inv_field_container">';
+
+ echo '<ul class="connectedSortable">';
+ $field_lang = array();
+ if (count($field_list ) > 0) {
+ foreach ($field_list AS $field => $checked) {
+ # ali je polje izbrano ( če imamo personalizirano e-vabilo, moramo nujno imeti polje email
+ # $is_selected = ($checked == 1 || $field == 'inv_field_email' ) ? true : false;
+ $is_selected = ($checked == 1 ) ? true : false;
+
+ # če je polje obkljukano
+ $css = $is_selected ? ' class="inv_field_enabled"' : '';
+
+ # ali prikazujemo checkbox
+ # $hidden_checkbox = $field == 'inv_field_email' ? ' hidden' : '';
+
+ # ali labela sproži klik checkboxa
+ # $label_for = $field != 'inv_field_email' ? ' for="'.$field.'_chk"' : '';
+ $label_for = ' for="'.$field.'_chk"';
+
+ echo '<li id="'.$field.'"'.$css.'>';
+ echo '<input id="'.$field.'_chk" type="checkbox" class="inv_checkbox"'.($is_selected == true ? ' checked="checked"' : '').'>';
+ echo '<label'.$label_for.'>'.$lang['srv_'.$field].'</label>';
+ echo '</li>';
+ if ($is_selected == 1) {
+ $field_lang[] = $lang['srv_'.$field];
+ }
+ }
+ }
+ echo '</ul>';
+ echo '</div>';
+
+ echo '<script type="text/javascript">initInvitationsConnectedSortable();</script>';
+
+ echo '<form id="inv_recipients_upload_form" name="resp_uploader" method="post" enctype="multipart/form-data" action="'.$site_url.'admin/survey/index.php?anketa='.$this->sid.'&a='.A_INVITATIONS.'&m=send_upload_list" autocomplete="off">';
+ echo '<input type="hidden" name="fields" id="inv_recipients_upoad_fields" value="'.implode(',',$fields).'" />';
+ echo '<input type="hidden" name="posted" value="1" />';
+ echo '<span class="inv_note">'.$lang['srv_inv_recipiens_file_note_1'].'</span>';
+
+ echo '<br class="clr" />'.$lang['srv_inv_recipiens_fields'].' <span id="inv_field_list" class="inv_type_1">';
+ echo implode(',',$field_lang);
+ echo '</span>';
+ echo '<br class="clr" />';
+ echo $lang['srv_mailing_upload_list'];
+ echo '<input type="file" name="invListFile" id="invListFile" size="42" >';
+ /* if (count($errors) > 0) {
+ echo '<br class="clr" />';
+ echo '<span class="inv_error_note">';
+ foreach($errors as $error) {
+ echo '* '.$error.'<br />';
+ }
+ echo '</span>';
+ } */
+ echo '<br/><br/><label>'.$lang['srv_inv_recipient_import_file_delimiter'].'</label> <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter1" value="," checked><label for="recipientsDelimiter1">'.$lang['srv_inv_recipient_delimiter_comma'].' (,)</label>';
+ echo ' <input type="radio" name="recipientsDelimiter" id="recipientsDelimiter2" value=";"><label for="recipientsDelimiter2">'.$lang['srv_inv_recipient_delimiter_semicolon'].' (;)</label>';
+ echo '</form>';
+
+ echo '<span class="inv_sample" >';
+ echo $lang['srv_inv_recipiens_sample'].'&nbsp;</span><span class="inv_sample">';
+ echo $lang['srv_inv_recipiens_sample1'];
+ echo '</span>';
+
+ echo '<br class="clr" />';
+
+ echo '<div class="buttons_holder">';
+ echo '<span class="buttonwrapper floatRight spaceLeft" ><a class="ovalbutton ovalbutton_gray" href="#" onclick="$(\'#inv_upload_list, #fullscreen, #fade\').hide();return false;"><span>'.$lang['srv_cancel'].'</span></a></span>';
+ echo '<span class="buttonwrapper floatRight spaceLeft" ><a class="ovalbutton ovalbutton_orange" href="#" onclick="inv_upload_list_check(); return false;"><span>'.$lang['srv_inv_btn_add_recipients_add'].'</span></a></span>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ function send_upload_list() {
+ global $lang, $global_user_id;
+ $errors = array();
+ $allowedExtensions = array("txt","csv","dat");
+ $_fields = trim($_POST['fields']);
+ if ($_fields != null && $_fields != '') {
+ $fields = explode(',',$_fields);
+ } else {
+ $fields = array();
+ }
+
+ $file_name = $_FILES["invListFile"]["name"];
+ $file_type = $_FILES["invListFile"]["type"];
+ $file_size = $_FILES["invListFile"]["size"] > 0 ? $_FILES["invListFile"]["size"] / 1024 : 0;
+ $file_tmp = $_FILES["invListFile"]["tmp_name"];
+
+ $okFileType = ( $file_type == 'text/plain' || $file_type == 'text/csv' || $file_type == 'application/vnd.ms-excel' );
+ $okFileEnd = ( pathinfo($file_name, PATHINFO_EXTENSION) != 'txt'
+ || pathinfo($file_name, PATHINFO_EXTENSION) != 'csv'
+ || pathinfo($file_name, PATHINFO_EXTENSION) != 'dat');
+ # preverimo ali smo uploadali datoteko in če smo izbrali katero polje
+ if ($_POST['posted'] == '1' && count($fields) == 0) {
+ $errors[] = $lang['srv_inv_recipiens_upload_error_no_fields'];
+ }
+ #preverimo ime datoteke
+ if ( trim($file_name) == '' || $file_name == null ) {
+ $errors[] = $lang['srv_respondents_invalid_file'];
+
+ # preverimo tip:
+ } else if ( $okFileType == false ) {
+ $errors[] = $lang['srv_respondents_invalid_file_type'];
+
+ # prevermio še končnico (.txt)
+ } else if ($okFileEnd == false) {
+ $errors[] = $lang['srv_respondents_invalid_file_type'];
+ }
+
+ # preverimo velikost
+ else if ( (float)$file_size == 0 ) {
+ $errors[] = $lang['srv_respondents_invalid_file_size'];
+ }
+
+ # če so napake jih prikažemo če ne obdelamo datoteko
+ if (count($errors) > 0) {
+
+ echo '<div id="inv_message_errors">';
+
+ echo '<span>'.$lang['srv_inv_recipiens_upload_error'].'</span>';
+
+ foreach($errors as $error) {
+ echo '<span class="inv_error_note">* '.$error.'</span>';
+ }
+
+ echo '</div>';
+
+ #$this->addRecipientsView($fields, $invalid_recipiens_array);
+ }
+ else {
+
+ $fh = @fopen($file_tmp, "rb");
+ if ($fh) {
+ $_recipients = fread($fh, filesize($file_tmp));
+ fclose($fh);
+ }
+ $_recipients = str_replace("\n\r", "\n", $_recipients);
+ $recipients_list = explode("\n",$_recipients);
+ $num_recipients_list = count($recipients_list);
+
+ # pri prejemnikih odrežemo "polja", katerih nismo navedli
+ $fields_cont = (int)count($fields);
+ $fields = str_replace('inv_field_','',$fields);
+
+ $clean_recipients = array();
+ if (count($recipients_list) > 0) {
+
+ if (isset ($_POST['recipientsDelimiter'])) {
+ $delimiter = $_POST['recipientsDelimiter'];
+ }
+ else {
+ $delimiter = "|~|";
+ }
+ foreach ($recipients_list AS $recipient) {
+ #poiščemo n-ti delimiter
+ $clean_recipients[] = trim(substr($recipient, 0, $this->strpos_offset($delimiter, $recipient, $fields_cont)));
+ }
+ }
+ $clean_fields = trim(implode(',', $fields));
+ $clean_recipients = trim(implode("\n", $clean_recipients));
+ if ($fields!=null && $fields != '' && $clean_recipients != null && $clean_recipients != '') {
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles".
+ " (name,uid,fields,respondents,insert_time,comment, from_survey) ".
+ " VALUES ('Uploaded list', '$global_user_id', '$clean_fields', '$clean_recipients', NOW(), 'Uploaded list', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+
+ }
+
+ }
+ $this->showInvitationLists();
+
+ }
+
+ /**
+ * Find position of Nth $occurrence of $needle in $haystack
+ * Starts from the beginning of the string
+ **/
+ function strpos_offset($needle, $haystack, $occurrence) {
+ // explode the haystack
+ $arr = explode($needle, $haystack);
+
+ // check the needle is not out of bounds
+ switch( $occurrence ) {
+ case $occurrence == 0:
+ return false;
+ case $occurrence > max(array_keys($arr)):
+ return strlen($haystack);
+ default:
+ $index = (int)strlen(implode($needle, array_slice($arr, 0, $occurrence)));
+ return $index;
+ }
+ }
+
+ function changePaginationLimit() {
+ session_start();
+ if (isset($_POST['limit']) && (int)$_POST['limit'] > 0) {
+ $_SESSION['rec_on_send_page'] = (int)$_POST['limit'];
+ $this->rec_send_page_limit = (int)$_POST['limit'];
+ }
+ session_commit();
+ $this->displaySendPagination((int)$_POST['cnt']);
+ }
+
+ function displayMessagePreview() {
+ global $lang;
+
+ $sql_query_m = sisplet_query("SELECT id, naslov, subject_text, body_text, reply_to, isdefault, comment, url FROM srv_invitations_messages WHERE ank_id = '$this->sid' AND isdefault='1'");
+ $preview_message = mysqli_fetch_assoc($sql_query_m);
+
+ # polovimo imena vseh sporocil
+
+ echo '<div id="inv_send_mail_preview">';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_name'].':</label>';
+ $sql_query_m = sisplet_query("SELECT id, naslov FROM srv_invitations_messages WHERE ank_id = '$this->sid'");
+ if (mysqli_num_rows($sql_query_m) > 0 ) {
+ echo ' <select class="dropdown medium" onchange="mailSourceMesageChange(this);">';
+ while ($row = mysqli_fetch_assoc($sql_query_m)) {
+ echo ' <option value="'.$row['id'].'"'.($row['id'] ==$preview_message['id']?' selected="selected"':'' ).'>'.$row['naslov'].'</option>';
+ }
+ echo ' </select>';
+ }
+ echo '</div>';
+
+ echo '<div class="setting_item hor">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_subject'].':</label>';
+ echo ' <span>'.$preview_message['subject_text'].'</span>';
+ echo '</div>';
+
+ echo '<div class="setting_item hor align-top">';
+ echo ' <label class="semi-bold">'.$lang['srv_inv_message_draft_content_body'].':</label>';
+ echo ' <span>'.$preview_message['body_text'].'</span>';
+ echo '</div>';
+
+ echo '</div>';
+
+
+ // Opozorilo ce manjka #URL# v besedilu maila in imamo individualizirano vabilo
+ if(strpos($preview_message['body_text'], '#URL#') == false && $this->surveySettings['usercode_required'] == 0 && $this->surveySettings['individual_invitation'] != 0)
+ echo '<span class="red">'.$lang['srv_inv_message_draft_nourl_warning'].'</span><br />';
+
+ // Opozorilo ce je #URL# v besedilu maila in imamo neindividualizirano vabilo
+ elseif(strpos($preview_message['body_text'], '#URL#') == true && $this->surveySettings['individual_invitation'] == 0)
+ echo '<span class="red">'.$lang['srv_inv_message_draft_url_warning'].'</span><br />';
+
+ // Popravi sporocilo
+ echo '<a href="'.$this->addUrl('view_message').'" class="noline">'.$lang['srv_invitation_reedit_message'].'</a>';
+ }
+
+ function addSortField($field){
+ $type = 'ASC';
+ session_start();
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
+ if ($_SESSION['rec_sort_type'] == 'DESC') {
+ $type = 'ASC';
+ } else {
+ $type = 'DESC';
+ }
+ } else {
+ $type = 'ASC';
+ }
+ return ' onclick="inv_set_sort_field(\''.$field.'\',\''.$type.'\');" ';
+ }
+ function addSortIcon($field){
+ session_start();
+ if (isset($_SESSION['rec_sort_field']) && $_SESSION['rec_sort_field'] == $field) {
+ if ($_SESSION['rec_sort_type'] == 'DESC') {
+ return ' <span class="faicon sort_descending icon-blue"></span>';
+
+ } else {
+ return ' <span class="faicon sort_ascending icon-blue"></span>';
+ }
+ }
+ return;
+ }
+
+ function setSortField() {
+ session_start();
+ if (isset($_POST['field']) && trim($_POST['field']) != '') {
+ $_SESSION['rec_sort_field'] = trim($_POST['field']);
+ } else {
+ $_SESSION['rec_sort_field'] = 'date_inserted';
+ }
+ if (isset($_POST['type']) && trim($_POST['type']) != '') {
+ $_SESSION['rec_sort_type'] = trim($_POST['type']);
+ } else {
+ $_SESSION['rec_sort_type'] = 'ASC';
+ }
+ session_commit();
+ }
+
+
+ function getSortString() {
+ session_start();
+
+ $sort_string = ' ORDER BY i.last_status';
+
+ if (isset($_SESSION['rec_sort_field']) && trim($_SESSION['rec_sort_field']) != '') {
+ $prefix = 'i.';
+ if ($_SESSION['rec_sort_field'] == 'count_inv') {
+ $prefix = '';
+ }
+
+ if ($_SESSION['rec_sort_field'] == 'date(date_expired)') {
+ $sort_string = ' ORDER BY '.$prefix.'date_expired';
+ }
+ else{
+ $sort_string = ' ORDER BY '.$prefix.trim($_SESSION['rec_sort_field']);
+ }
+
+ if ($_SESSION['rec_sort_type'] == 'DESC') {
+ $sort_string .= ' DESC';
+ } else {
+ $sort_string .= ' ASC';
+ }
+ }
+
+ // Vedno dodatno se sortirtamo po mailu
+ $sort_string .= ', i.email';
+
+ return $sort_string;
+ }
+
+ function getAvailableSysVars() {
+ $result = array();
+ $qry = sisplet_query("SELECT s.variable, s.naslov FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='".$this->sid."' AND s.gru_id=g.id AND s.tip!='5' AND (s.tip < '10' OR s.tip = '22' OR s.tip = '25' OR s.tip='21') AND s.sistem='1'");
+ while ($row = mysqli_fetch_assoc($qry)) {
+ $result[$row['variable']] = $row['naslov'];
+ }
+ return $result;
+ }
+
+ function getAvailableIndicators() {
+ $result = array();
+ $_indicators = array('email','password','firstname','lastname','salutation','phone','custom','relation');
+ #za vsako spremenljivko preverimo zapise v bazi
+ foreach ($_indicators AS $indicator) {
+ $sql_string = "SELECT count(*) FROM srv_invitations_recipients WHERE ank_id = '".$this->sid."' AND deleted = '0' AND $indicator IS NOT NULL";
+ list($cnt) = mysqli_fetch_row(sisplet_query($sql_string));
+ if ((int)$cnt > 0) {
+ $result[] = $indicator;
+ }
+ }
+ return $result;
+ }
+
+ function createSystemVariablesMapping() {
+ global $lang;
+ # polovimo sistemske variable
+ $sys_db_maps = array('email');
+
+ $strSelect = "SELECT spr_id, field FROM srv_invitations_mapping WHERE sid = '".$this->sid."'";
+ $qrySelect = sisplet_query($strSelect);
+ $mappingArray = array();
+ while (list($spr_id,$field) = mysqli_fetch_row($qrySelect)) {
+ $mappingArray[$spr_id] = $field;
+ }
+ $qryString = "SELECT s.id, s.naslov, s.variable, s.variable_custom, s.coding FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.tip IN (1,3,17,21) AND s.gru_id=g.id AND g.ank_id='".$this->sid."' ORDER BY g.vrstni_red, s.vrstni_red";
+ $sqlSpremenlivka = sisplet_query($qryString);
+
+ if (mysqli_num_rows($sqlSpremenlivka) > 0) {
+
+ echo '<form id="inv_ValidateSysVarsMappingFrm" name="inv_ValidateSysVarsMappingFrm">';
+
+ echo $lang['srv_invitation_system_email_choose'];
+
+ echo '<div class="setting_holder">';
+ while ($row = mysqli_fetch_assoc($sqlSpremenlivka)) {
+ $system_variables[$row['id']] = $row;
+
+ echo '<div class="setting_item">';
+
+ $checked = (isset($mappingArray[$row['id']]) && $mappingArray[$row['id']] == 'email' )?' checked="checked"':'';
+
+ echo '<input type="radio" name="sysVarMap" id="sysVarMap_'.$row['id'].'" value="'.$row['id'].'"'.$checked.'>';
+ echo '<label for="sysVarMap_'.$row['id'].'"><span>'.$row['variable'].'</span>'.$row['naslov'].'</label>';
+
+ echo '</div>';
+ }
+ echo '</div>';
+
+ echo '</form>';
+
+ echo '<div id="inv_ValidateSysVarsMappingDiv" class="button_holder below">';
+ echo ' <button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
+ echo '</div>';
+
+ }
+ else {
+ echo '<span>'.$lang['srv_invitation_system_error3'].'</span>';
+ }
+ }
+
+ function validateSysVarsMapping() {
+ global $lang,$global_user_id;
+ # preverimo sistemske spremenljivke
+ $strSistemske = "SELECT count(*) FROM srv_spremenljivka s, srv_grupa g WHERE s.sistem='1' AND s.gru_id=g.id AND g.ank_id='".$this->sid."' AND variable IN("."'" . implode("','",$this->inv_variables)."') ORDER BY g.vrstni_red, s.vrstni_red";
+ list($cntSistemske) = mysqli_fetch_row(sisplet_query($strSistemske));
+
+ $emailsToAdd = array();
+ $invalidEmails = array();
+ $errors = array();
+ $emailSpr = (int)$_POST['sysVarMap'];
+ if ((int)$emailSpr > 0) {
+ # preverimo ali lovimo samo ustrezne ali vse userje , preverimo kako imamo nastavljeno pri podatkih
+ global $global_user_id;
+ $_POST['meta_akcija'] = 'data';
+ SurveyStatusProfiles :: Init($this->sid, $global_user_id);
+ $currentProfileId = SurveyStatusProfiles :: getCurentProfileId();
+ $statusProfileCondition = SurveyStatusProfiles :: getStatusAsQueryString($currentProfileId);
+
+ #zloopamo skozi userje in dodamo kateri še niso bili dodani
+ $selectUser = "SELECT id,cookie,pass,last_status,lurker,unsubscribed FROM srv_user where ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0' ".$statusProfileCondition;
+ $queryUser = sisplet_query($selectUser );
+
+ if (mysqli_num_rows($queryUser) ) {
+ #zakeširamo vrednosti za email
+ $this->getUsersDataForSpr($emailSpr);
+
+ while ($row = mysqli_fetch_assoc($queryUser)) {
+ $email = trim($this->cacheArrayVrednost[$emailSpr][$row['id']]);
+
+ if ($this->validEmail($email)) {
+ $emailsToAdd[] = $email;
+ } else {
+ $invalidEmails[] = $email;
+ }
+ }
+ if (count($invalidEmails) > 0) {
+ $errors[] = $lang['srv_invitation_system_error1']."(".count($invalidEmails).')';
+ }
+ } else {
+ $errors[] = $lang['srv_invitation_system_error2'];
+ }
+ }
+ else {
+
+ if ((int)$cntSistemske == 0) {
+ # ni sistemskih spremenljivk
+ $errors[] = $lang['srv_invitation_system_error3'];
+ } else {
+ # ni določena email spremenljivka
+ $errors[] = $lang['srv_invitation_system_error4'];
+ }
+ }
+
+
+ echo '<button class="medium white-blue" onclick="inv_ValidateSysVarsMapping();">'.$lang['srv_invitation_system_validate'].'</button>';
+
+ if (count($emailsToAdd)) {
+ echo '<button class="medium white-blue" onclick="inv_addSysVarsMapping();">'.$lang['srv_invitation_system_validateAndAdd'].'</button>';
+ }
+
+ # če že imamo prejemnike v bazi ponudimo gumb naprej
+ if (mysqli_num_rows($queryUser) > 0){
+ echo '<a href="'.$this->addUrl('view_recipients').'"><button class="medium blue">'.$lang['srv_invitation_forward'].'</button></a>';
+ }
+
+
+ echo '<div class="setting_holder">';
+
+ # če je kaj novih zapisov v bazi
+ if (mysqli_num_rows($queryUser) > 0){
+
+ echo '<span class="strong">';
+ printf($lang['srv_invitation_system_found'],mysqli_num_rows($queryUser));
+ echo '</span>';
+ echo '<br/>';
+ echo $lang['srv_invitation_system_from_this'];
+
+ if (count($emailsToAdd)) {
+ echo $lang['srv_invitation_system_from_this_valid'].(int)count($emailsToAdd);
+ if (count($invalidEmails) > 0) {
+ echo '<br/>';
+ echo $lang['srv_invitation_system_and'];
+ }
+ }
+ if (count($invalidEmails) > 0) {
+ echo $lang['srv_invitation_system_from_this_invalid'].(int)count($invalidEmails);
+ }
+ }
+ else{
+ echo '<br class="clr"/>';
+ echo '<br/>';
+ echo $lang['srv_invitation_system_not_found'];
+ }
+
+ echo '</div>';
+ }
+ function addSysVarsMapping() {
+ global $lang,$global_user_id;
+
+ $addedEmails = array();
+ $errorEmails = array();
+ $invalidEmails = array();
+ $errors = array();
+
+ #pobrišemo obstoječe povezave
+ $strDelete = "DELETE FROM srv_invitations_mapping WHERE sid = '".$this->sid."'";
+ $qryDelete = sisplet_query($strDelete);
+
+ $emailSpr = (int)$_POST['sysVarMap'];
+ if ((int)$emailSpr > 0) {
+ $insertString = "INSERT INTO srv_invitations_mapping (sid, spr_id, field) VALUES ('$this->sid','$emailSpr','email')";
+ sisplet_query($insertString);
+ sisplet_query("COMMIT");
+
+ # preverimo ali lovimo samo ustrezne ali vse userje , preverimo kako imamo nastavljeno pri podatkih
+ global $global_user_id;
+ $_POST['meta_akcija'] = 'data';
+ SurveyStatusProfiles :: Init($this->sid, $global_user_id);
+ $currentProfileId = SurveyStatusProfiles :: getCurentProfileId();
+ $statusProfileCondition = SurveyStatusProfiles :: getStatusAsQueryString($currentProfileId);
+
+ #zloopamo skozi userje in dodamo kateri še niso bili dodani
+ $selectUser = "SELECT id,cookie,pass,last_status,lurker,unsubscribed FROM srv_user where ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0' ".$statusProfileCondition;
+ $queryUser = sisplet_query($selectUser );
+ if (mysqli_num_rows($queryUser)) {
+ #zakeširamo vrednosti za email
+ $this->getUsersDataForSpr($emailSpr);
+
+ while ($row = mysqli_fetch_assoc($queryUser)) {
+ $email = trim($this->cacheArrayVrednost[$emailSpr][$row['id']]);
+ if ($this->validEmail($email)) {
+ $pass = (trim($row['pass']) != '') ? trim($row['pass']) : substr($row['cookie'],0,6);
+ #dodamo respondenra in naredimo povezav
+ $sql_insert = "INSERT IGNORE INTO srv_invitations_recipients (ank_id,email,password,cookie,sent,responded,unsubscribed,deleted,date_inserted,inserted_uid,list_id,last_status) VALUES ";
+ $sql_insert .= "('".$this->sid."','$email','$pass','".$row['cookie']."'";
+ $sql_insert .= ",'0','0','".(int)$row['unsubscribed']."','0',NOW(),'".$global_user_id."','','".$row['last_status']."')";
+ $sqlQuery = sisplet_query($sql_insert);
+ if (!$sqlQuery) {
+ $error = mysqli_error($GLOBALS['connect_db']);
+ $errorEmails[] = $email;
+ } else {
+ $rid = mysqli_insert_id($GLOBALS['connect_db']);
+ if ((int)$rid > 0) {
+ # updejtamo srv user
+ $sqlString2 = "UPDATE srv_user SET inv_res_id='$rid' WHERE id='".$row['id']."'";
+ $updateQuery2 = sisplet_query($sqlString2);
+ $addedEmails[] = $email;
+ } else {
+ $errorEmails[] = $email;
+ }
+ }
+ sisplet_query("COMMIT");
+ } else {
+ if ($email != '') {
+ $invalidEmails[] = $email;
+ } else {
+ $invalidEmails[] = $lang['srv_invitation_system_empty_email'];
+ }
+ }
+ }
+ } else {
+ #V bazi ni respondentov, katere lahko dodam v vabila!
+ $errors[] = $lang['srv_invitation_system_error2'];
+ }
+ } else {
+ # ni določena email spremenljivka
+ $errors[] = $lang['srv_invitation_system_error4'];
+ }
+ echo '<span onclick="inv_ValidateSysVarsMapping();" class="buttonwrapper floatLeft spaceLeft" ><a class="ovalbutton ovalbutton_orange" ><span>'.$lang['srv_invitation_system_validate'].'</span></a></span>';
+ echo '<br class="clr"/>';
+ echo '<br/>';
+ if (count($errors) > 0) {
+ foreach ($errors AS $error) {
+ echo '<br/><span class="strong">'.$error.'</span>';
+ }
+ }
+ if (count($addedEmails) > 0) {
+ echo '<span class="strong">'.$lang['srv_invitation_system_added_users_finish']."(".(int)count($addedEmails)."): </span>";
+ foreach ($addedEmails AS $email) {
+ echo '<br/><span>'.$email.'</span>';
+ }
+ }
+ if (count($errorEmails) > 0) {
+ echo $lang['srv_invitation_system_error6']." (".(int)count($errorEmails)."): ";
+ foreach ($errorEmails AS $email) {
+ echo '<br/><span>'.$email.'</span>';
+ }
+
+ }
+ if (count($invalidEmails) > 0) {
+ echo '<span class="strong gray">'.$lang['srv_invitation_system_error6'].'('.(int)count($invalidEmails).'): </span><br/>';
+ foreach ($invalidEmails AS $email) {
+ echo '<span>'.$email.'</span><br/>';
+ }
+
+ }
+ }
+
+ private $cacheArrayVrednost = array();
+ function getUsersDataForSpr($spr_id = 0) {
+
+ if ((int)$spr_id > 0 ) {
+ if (!isset($this->cacheArrayVrednost[$spr_id])) {
+ list($tip) = mysqli_fetch_row(sisplet_query("SELECT tip FROM srv_spremenljivka WHERE id = '$spr_id'"));
+ switch ($tip) {
+ case 21:
+ $str = "SELECT u.id, sdt.text FROM srv_data_text".$this->db_table." AS sdt LEFT JOIN srv_user AS u ON u.id=sdt.usr_id WHERE sdt.spr_id ='$spr_id' AND ank_id='".$this->sid."' AND inv_res_id IS NULL AND deleted='0'";
+ $sql = sisplet_query($str);
+ while (list($uid,$txt) = mysqli_fetch_row($sql)) {
+ if ((int)$uid > 0 && trim($txt) != '') {
+ $this->cacheArrayVrednost[$spr_id][$uid] = $txt;
+ }
+ }
+ break;
+ return $this->cacheArrayVrednost[$spr_id];
+ }
+ } else {
+ return $this->cacheArrayVrednost[$spr_id];
+ }
+ }
+ }
+
+ function saveRecipientListName() {
+ global $lang,$site_url, $global_user_id;
+
+ $array_profiles = array();
+ #ne vem če je fino da lahko dodaja kar na vse sezname
+ session_start();
+ $_only_this_survey = (isset($_SESSION['inv_rec_only_this_survey']) && (int)$_SESSION['inv_rec_only_this_survey'] == 1) ? '' : " AND from_survey = '".$this->sid. "'" ;
+
+ # polovimo še ostale porfile
+ $sql_string = "SELECT pid, name,comment FROM srv_invitations_recipients_profiles WHERE uid in('".$global_user_id."')".$_only_this_survey;
+ $sql_query = sisplet_query($sql_string);
+ while ($sql_row = mysqli_fetch_assoc($sql_query)) {
+ $array_profiles[$sql_row['pid']] = array('name' => $sql_row['name'], 'comment'=>$sql_row['comment']);
+ }
+
+ echo '<div style="margin-top:10px; padding:5px; background-color:#f2f2f2; border:1px solid #c2c2c2;">';
+ # echo '<span class="inv_new_list_note">';
+ # echo $lang[''].'Izberite seznam kamor želite dodati prejemnike. Izbirate lahko med:<br/><ul><li>\'Nov seznam\' - prejemniki se dodajo v nov seznam, kateremu določite ime</li><li>\'Začasen seznam\' - seznam obstaja samo v času seje brskalnika</li><li>ali izberete obstoječ seznam, h kateremu se bodo dodali prejemniki</li></ul><br/>';
+ # echo '</span>';
+ echo $lang['srv_invitation_recipients_list_add'].':&nbsp;';
+ echo '<select id="sel_inv_list_type" onchange="inv_new_recipients_list_change(this);" autofocus="autofocus">';
+ echo '<option value="0" class="gray bold"'.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? '' : ' selected="selected"' ).'>'.$lang['srv_invitation_new_list'].'</option>';
+ echo '<option value="-1" class="gray bold">'.$lang['srv_invitation_new_templist'].'</option>';
+ if (count($array_profiles) > 0){
+ foreach($array_profiles AS $key => $profile) {
+ echo '<option value="'.$key.'" comment="'.$profile['comment'].'"'.(isset($_POST['pid']) && $_POST['pid'] == $key ? ' selected="selected"' : '').'>'.$profile['name'].'</option>';
+ }
+ }
+ echo '</select>';
+ echo '<span id="new_recipients_list_span_note" '.(isset($_POST['pid']) && (int)$_POST['pid'] < 1 ? ' class="displayNone"' : '' ).'>';
+ echo '<br>';
+ echo '<br>';
+ echo 'Uporabniki bodo dodani v seznam: ';
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['name']) ? $array_profiles[$_POST['pid']]['name'] : '');
+ echo '<span id="new_recipients_list_span_note_name"></span>';
+ echo '</span>';
+ echo '<span id="new_recipients_list_span" '.(isset($_POST['pid']) && (int)$_POST['pid'] > 0 ? ' class="displayNone"' : '' ).'>';
+
+ echo '<br>';
+ echo '<br>';
+ echo '<label>'.$lang['srv_inv_recipient_list_name'];
+ # zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
+ $new_name = $lang['srv_inv_recipient_list_new'];
+ $names = array();
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%".$new_name."%' AND uid='$global_user_id'";
+ $q = sisplet_query($s);
+ while ($r = mysqli_fetch_assoc($q)) {
+ $names[] = $r['name'];
+ }
+ if (count($names) > 0) {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_recipient_list_new'].$cnt, $names)) {
+ $cnt++;
+ }
+ $new_name = $lang['srv_inv_recipient_list_new'].$cnt;
+ }
+
+ echo '<input type="text" id="rec_profile_name" value="'.$new_name.'" tabindex="1" autofocus="autofocus">';
+ echo '</label>';
+ echo '</span>';
+ echo '<br/><br/>';
+ echo $lang['srv_inv_recipient_list_comment'];
+ echo '<textarea id="rec_profile_comment" tabindex="3" rows="2" >';
+ echo (isset($_POST['pid']) && isset($array_profiles[$_POST['pid']]['comment']) ? $array_profiles[$_POST['pid']]['comment'] : '');
+ echo '</textarea>';
+ echo '</div>';
+
+ }
+
+ function getCleanString($string) {
+ return preg_replace ("/'/", "`", $string);
+ }
+
+ function recipientsAddForward() {
+
+ $doSave = $_POST['doSave'] == 'true' ? true : false;
+ $doAdd = $_POST['doAdd'] == 'true' ? true : false;
+
+ $fields = $_POST['fields'];
+ $recipients_list = $this->getCleanString($_POST['recipients_list']);
+ $delimiter = $_POST['recipientsDelimiter'];
+
+ $profileName = $_POST['profile_name'];
+ $profileComment = $_POST['profile_comment'];
+ $pid = $_POST['profile_id'];
+
+ // Bom kar tule rešil konverzijo iz delimiterja v |~|
+ $recipients_list = str_replace ($delimiter, "|~|", $recipients_list);
+
+ # če shranjujemo respondente
+ if ($doSave == true){
+ $pid = $this->saveAppendRecipientList($pid, $fields, $recipients_list, $profileName, $profileComment);
+ }
+
+ # če dodajamo respondente v bazo
+ if ($doAdd == true){
+ #dodamo polja
+ $result = $this->addMassRecipients($recipients_list, $fields, $pid);
+
+ # prikažemo napake
+ $invalid_recipiens_array = $this->displayRecipentsErrors($result);
+ }
+
+ # če smo dodajali repsondente v bazo, prikažemo tabelo respondentov
+ if ($doAdd == true){
+ $this->viewRecipients();
+ }
+ # če ne prikažemo profile respondentov
+ else {
+ $this->useRecipientsList($pid);
+ }
+
+ // Ce smo dodajali respondente rocno v bazo, to shranimo, ker potem ne smemo povezati mailov s podatki
+ // TEGA NE SMEMO NAREDITI, KER DRUGACE SE VSAKIC OB DODAJANJU NA NOVO UGASNE
+ /*if ($doAdd == true) {
+ $update = sisplet_query("UPDATE srv_anketa SET show_email='0' WHERE id='".$this->sid."'");
+ }*/
+ }
+
+ function saveAppendRecipientList($pid, $fields, $recipients, $profileName, $profileComment) {
+ global $lang,$site_url, $global_user_id;
+
+ # shranjujemo v nov profil
+ $post_fields = str_replace('inv_field_','',implode(',',$fields));
+ $post_recipients = $this->getCleanString($recipients);
+
+ $pid = (int)$pid;
+ # če je pid < 0 shranimo v nov porfil
+ if ($pid <= 0)
+ {
+ # ali shranjujemo v sejo
+ if ($pid == -1)
+ {
+ $this->saveSessionRecipients($post_recipients,$post_fields,$profileComment);
+ }
+ else
+ {
+ # dodelimo ime
+ if ($profileName == NULL || trim($profileName) == '')
+ {
+ #zaporedno številčimo ime seznama1,2.... če slučajno ime že obstaja
+ $profileName = $lang['srv_inv_recipient_list_new'];
+ $names = array();
+ $s = "SELECT name FROM srv_invitations_recipients_profiles WHERE name LIKE '%%' AND uid='$global_user_id'";
+ $q = sisplet_query($s);
+ while ($r = mysqli_fetch_assoc($q))
+ {
+ $names[] = $r['name'];
+ }
+ if (count($names) > 0)
+ {
+ $cnt = 1;
+ while (in_array($lang['srv_inv_recipient_list_new'].$cnt, $names))
+ {
+ $cnt++;
+ }
+ $profileName = $lang['srv_inv_recipient_list_new'].$cnt;
+ }
+ }
+ $sql_insert = "INSERT INTO srv_invitations_recipients_profiles".
+ " (name,uid,fields,respondents,insert_time,comment, from_survey) ".
+ " VALUES ('$profileName', '$global_user_id', '$post_fields', '$post_recipients', NOW(), '$profileComment', '".$this->sid."' )";
+ $sqlQuery = sisplet_query($sql_insert);
+ if (!$sqlQuery)
+ {
+ }
+ else
+ {
+ $pid = mysqli_insert_id($GLOBALS['connect_db']);
+ }
+ }
+ } else {
+ # polovimo obstoječe podatke
+
+ $s = "SELECT fields, respondents FROM srv_invitations_recipients_profiles WHERE pid ='$pid'";
+ $q = sisplet_query($s);
+ list($old_fields, $old_respondents) = mysqli_fetch_row($q);
+
+ # najprej polja
+ $old_fields = explode(',',$old_fields);
+ $post_fields = explode(',',$post_fields);
+ foreach ($post_fields AS $post_field )
+ {
+ #če polje še ni v bazi ga dodamo
+ if (!in_array($post_field, $old_fields))
+ {
+ $old_fields[] = $post_field;
+ }
+ }
+
+ # nato porihtamo podatke
+ $old_recipients_list = explode("\n", $old_respondents);
+ $new_recipients_list = explode("\n", $post_recipients);
+
+ foreach ($new_recipients_list AS $post_recipient )
+ {
+ #če polje še ni v bazi ga dodamo
+ if (!in_array($post_recipient, $old_recipients_list))
+ {
+ $old_recipients_list[] = $post_recipient;
+ }
+ }
+
+ # počistimo prazne
+ foreach ($old_recipients_list AS $k => $post_recipient )
+ {
+ if (is_null($post_recipient) || $post_recipient == '')
+ {
+ unset($old_recipients_list[$k]);
+ }
+ }
+
+ $post_fields = implode(",",$old_fields);;
+ $post_recipients = implode("\n",$old_recipients_list);
+
+ # updejtamo obstoječ profil
+ $sql_update = " UPDATE srv_invitations_recipients_profiles".
+ " SET fields = '$post_fields', respondents ='$post_recipients' WHERE pid = '$pid'";
+
+ $sqlQuery = sisplet_query($sql_update);
+ if (!$sqlQuery)
+ {
+ }
+ else
+ {
+ }
+ }
+ sisplet_query("COMMIT");
+
+ #vrnemo pid seznama (če smo kreirali nov seznam je tako now pid)
+ return $pid;
+ }
+
+
+ function showAdvancedConditions()
+ {
+ global $lang;
+
+ $scp = new SurveyCondition($this->sid);
+ $scp->setChooseAction('invitationSetCondition()');
+ $scp->displayConditions($_POST['cid']);
+
+ }
+
+ public function setAdvancedConditionProfile($pid)
+ {
+ $this->invitationAdvancedConditionProfileId = (int)$pid;
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ $this->invitationAdvancedConditionId = $scp->getProfileConditionId($this->invitationAdvancedConditionProfileId);
+
+ $this->viewRecipients();
+ }
+
+ function getConditionUserIds($cid = 0){
+ global $global_user_id;
+
+ if ($cid > 0){
+
+ // Poskrbimo za datoteko s podatki
+ $SDF = SurveyDataFile::get_instance();
+ $SDF->init($this->sid);
+ $SDF->prepareFiles();
+
+ $headFileName = $SDF->getHeaderFileName();
+ $dataFileName = $SDF->getDataFileName();
+ $dataFileStatus = $SDF->getStatus();
+
+
+ if ($dataFileStatus >= 0){
+
+ $_HEADERS = unserialize(file_get_contents($headFileName));
+
+ SurveyConditionProfiles :: Init($this->sid, $global_user_id);
+ SurveyConditionProfiles :: setHeader($_HEADERS);
+
+ $_condition_profile_AWK = SurveyConditionProfiles:: getAwkConditionString($cid);
+
+ if (IS_WINDOWS) {
+ $_command = 'gawk -F"'.STR_DLMT.'" "'.$_condition_profile_AWK.' { if ('.USER_ID_FIELD.'!=0) print \"$invUsrId[]=\",'.USER_ID_FIELD.',\";\" }" '.$dataFileName .' >> '. $dataFileName.'.tmp';
+ }
+ else {
+ $_command = 'awk -F"'.STR_DLMT.'" \' '.$_condition_profile_AWK.' { if ('.USER_ID_FIELD.'!=0) print "$invUsrId[]=",'.USER_ID_FIELD.',";" }\' '.$dataFileName .' >> '.$dataFileName.'.tmp';
+ }
+
+ $file_handler = fopen($dataFileName.'.tmp',"w");
+ fwrite($file_handler,"<?php\n");
+ fclose($file_handler);
+ $out = shell_exec($_command);
+
+ $file_handler = fopen($dataFileName.'.tmp',"a");
+ fwrite($file_handler,'?>');
+ fclose($file_handler);
+ include($dataFileName.'.tmp');
+
+ if (file_exists($dataFileName.'.tmp')) {
+ unlink($dataFileName.'.tmp');
+ }
+
+ if (isset($invUsrId) && is_array($invUsrId) && count($invUsrId) > 0){
+ return $invUsrId;
+ }
+ }
+ else{
+ echo '!!!OLD DATA FILE!!!';
+ }
+ }
+
+ return array();
+ }
+
+ function advancedCondition(){
+ global $lang;
+
+ echo '<div class="condition_holder" class="setting">';
+
+ echo '<div id="conditionProfileNote">';
+
+ echo $lang['srv_inv_condition_filter'].' ';
+
+ if ($this->invitationAdvancedConditionProfileId > 0){
+ $scp = new SurveyConditionProfiles($this->sid);
+ $scp->Init($this->sid);
+ echo '&nbsp;<strong>'.$scp->getCurentProfile()['name'].'</strong>&nbsp;';
+ /* $this->user_inv_ids = $this->getConditionUserIds($this->invitationAdvancedConditionId);
+ $note = $scp -> getConditionString($this->invitationAdvancedConditionId );
+ echo $note;
+ if (is_array($this->user_inv_ids) && count($this->user_inv_ids) > 0)
+ {
+ }
+ else
+ {
+ }
+ echo '<span onclick="showInvitationAdvancedConditions(\''.(int)$this->invitationAdvancedConditionId.'\'); return false;" title=""'.$lang['srv_profile_edit'].'"><span class="faicon edit"></span></span>';
+ echo '<span onclick="invitationSetCondition(\'0\'); return false;" title="'.$lang['srv_profile_remove'].'"><span class="faicon delete"></span></span></span>';
+ */
+ }
+ else{
+ echo '<span>'.$lang['srv_inv_condition_no_filter'].'</span>';
+ }
+
+ echo '<a href="#" class="faicon if_add" onclick="conditionProfileAction(\'showProfiles\');" data-cid="'.(int)$this->invitationAdvancedConditionId.'"></a>';
+
+
+ echo '</div>';
+
+ echo '</div>';
+ }
+
+ function listCondition(){
+ global $lang;
+
+ # get all lists
+ $lists = $this->getSurveyInvitationLists(true);
+
+ $selected = (int)(isset($_SESSION['inv_filter']['list']) ? (int)$_SESSION['inv_filter']['list'] : -2);
+
+ echo '<div class="setting">';
+
+ echo '<label>'.$lang['srv_invitation_recipients_filter_list'].'</label>';
+ echo '<select id="inv_rec_filter_list" class="dropdown small" onchange="inv_filter_recipients();">';
+ foreach ($lists AS $list_id => $list){
+ echo '<option value="'.$list_id.'"'.((int)$selected == $list_id ? ' selected="selected"' : '').'>'.$list['name'].'</option>';
+ }
+ echo '</select>';
+
+ echo '</div>';
+ }
+
+ function getSurveyInvitationLists($add_all = false)
+ {
+ global $lang;
+ # polovimo sezname
+ $lists = array();
+ if ($add_all)
+ {
+ $lists['-2'] = array('name'=>$lang['srv_invitation_recipients_filter_list_all']);
+ }
+ $lists['-1'] = array('name'=>$lang['srv_invitation_new_templist']);
+ $lists['0'] = array('name'=>$lang['srv_invitation_new_templist_author']);
+ $sql_string_lists = "SELECT * from srv_invitations_recipients_profiles WHERE pid IN(SELECT i.list_id FROM srv_invitations_recipients AS i WHERE i.ank_id = '{$this->sid}' AND i.deleted = '0' GROUP BY i.list_id ORDER BY i.id) ";
+ $sql_query_lists = sisplet_query($sql_string_lists);
+ while ($row_lists = mysqli_fetch_assoc($sql_query_lists)) {
+ $lists[$row_lists['pid']] = array('name'=>$row_lists['name']);
+ }
+
+ return $lists;
+ }
+
+
+ private function viewServerSettings(){
+ global $lang;
+ global $site_url;
+ global $site_url;
+ global $site_path;
+ global $admin_type;
+ global $global_user_id;
+ global $mysql_database_name;
+
+
+ $row = SurveyInfo::getInstance()->getSurveyRow();
+
+ echo '<form name="settingsanketa_' . $row['id'] . '" action="ajax.php?a=editanketasettings&m=inv_server" method="post" autocomplete="off">' . "\n\r";
+ echo ' <input type="hidden" name="anketa" value="' . $this->sid . '" />' . "\n\r";
+ echo ' <input type="hidden" name="location" value="' . $_GET['a'] . '" />' . "\n\r";
+ echo ' <input type="hidden" name="submited" value="1" />' . "\n\r";
+
+ $MA = new MailAdapter($this->sid, $type='invitation');
+
+ // Dostop za posiljanje mailov preko 1ka serverja
+ $enabled1ka = $MA->is1KA() ? true : false;
+
+ // Admini na testu, www in virtualkah imajo 1ka smtp
+ if(($admin_type == 0) && ($mysql_database_name == 'www1kasi' || $mysql_database_name == 'test1kasi' || $mysql_database_name == 'real1kasi'))
+ $enabled1ka = true;
+
+
+ // Squalo
+ $squalo = new SurveyInvitationsSqualo($this->sid);
+ if($squalo->getSqualoEnabled()){
+
+ // Vklop squalo
+ echo '<div class="setting_holder squalo_switch">';
+
+ echo ' <div class="setting_title">'.$lang['srv_squalo'].':</div>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="hidden" name="squalo_mode" value="0">';
+ echo ' <input type="checkbox" name="squalo_mode" id="squalo_mode" value="1" '.($squalo->getSqualoActive() ? 'checked ="checked" ' : '').' onclick="squaloSwitch();">';
+ echo ' <label for="squalo_mode">'.$lang['srv_squalo_sending'].'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ // Squalo nastavitve...
+ echo '<div class="squalo_settings '.(!$squalo->getSqualoActive() ? ' displayNone' : '').'">';
+
+ echo $lang['srv_squalo_active'];
+
+ echo '</div>';
+ }
+
+
+ // Izbira streznika
+ echo '<div class="mail_mode_switch '.($squalo->getSqualoActive() ? ' displayNone' : '').'">';
+
+ // Opozorilo, ce imamo vklopljena vabila, da gre za iste nastavitve
+
+ echo '<div class="setting_holder red">'.$lang['srv_email_server_settings_warning'].'</div>';
+
+
+ // Izbira SMTP streznika
+ echo '<div class="setting_holder">';
+
+ echo ' <div class="setting_title">'.$lang['srv_email_setting_select_server'].'</div>';
+
+ // AAI ima Arnesov smtp
+ if(isAAI()){
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' onclick="smtpAAIPopupShow();">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0_aai'].'</label>';
+ echo ' </div>';
+ }
+ else{
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_0" value="0" '.($MA->is1KA() ? 'checked ="checked" ' : '').' '.($enabled1ka ? '' : ' disabled="disabled"').' onclick="$(\'#send_mail_mode1, #send_mail_mode2\').addClass(\'displayNone\'); $(\'#send_mail_mode0\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_0">'.$lang['srv_email_setting_adapter0'].'</label>';
+ echo ' </div>';
+ }
+
+ // Google smtp je viden samo starim, kjer je ze vklopljen
+ if($MA->isGoogle()){
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_1" value="1" '.($MA->isGoogle() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode2\').addClass(\'displayNone\'); $(\'#send_mail_mode1\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_1">'.$lang['srv_email_setting_adapter1'].'</label>';
+ echo ' </div>';
+ }
+
+ // Lastni smtp
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="SMTPMailMode" id="SMTPMailMode_2" value="2" '.($MA->isSMTP() ? 'checked ="checked" ' : '').' onclick="$(\'#send_mail_mode0, #send_mail_mode1\').addClass(\'displayNone\'); $(\'#send_mail_mode2\').removeClass(\'displayNone\');">';
+ echo ' <label for="SMTPMailMode_2">'.$lang['srv_email_setting_adapter2'].' '.Help::display('srv_mail_mode').'</label>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ #1KA
+ $enkaSettings = $MA->get1KASettings($raziskave=true);
+
+ echo '<div id="send_mail_mode0" '.(!$MA->is1KA() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
+
+ echo ' <div class="setting_holder semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ # from
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" disabled="disabled" value="'.$enkaSettings['SMTPFrom'].'"><input type="hidden" name="SMTPFrom0" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
+ # replyTo
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo0" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #delay
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay0">'
+ . '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
+ . '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
+ . '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
+ . '<option value="4000000" '.($enkaSettings['SMTPDelay']=="4000000"?'selected="selected"':'') .'>4 sec (max 15 / min)</option>'
+ . '<option value="5000000" '.($enkaSettings['SMTPDelay']=="5000000"?'selected="selected"':'') .'>5 sec (max 12 / min)</option>'
+ . '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
+ . '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
+ . '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
+ . '</select>';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '</div>';
+
+
+ #GMAIL - Google
+ $enkaSettings = $MA->getGoogleSettings();
+
+ echo '<div id="send_mail_mode1" '.(!$MA->isGoogle() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="setting_item italic">'.$lang['srv_email_setting_adapter1_note'].'</div>';
+ echo ' <div class="setting_item semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ # from
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" name="SMTPFrom1" value="'.(isset($enkaSettings['SMTPFrom'])?$enkaSettings['SMTPFrom']:'').'">';
+ echo ' </div>';
+
+ # replyTo
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" name="SMTPReplyTo1" value="'.(isset($enkaSettings['SMTPReplyTo'])?$enkaSettings['SMTPReplyTo']:'').'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #Password
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" name="SMTPPassword1" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '</div>';
+
+
+ #SMTP
+ $enkaSettings = $MA->getSMTPSettings();
+
+ echo '<div id="send_mail_mode2" '.(!$MA->isSMTP() || $squalo->getSqualoActive() ? ' class="displayNone"' : '').'>';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="italic">'.$lang['srv_email_setting_adapter2_note'].'</div>';
+ echo '</div>';
+
+ echo '<div class="setting_holder">';
+ echo ' <div class="semi-bold">'.$lang['srv_email_setting_settings'].'</div>';
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ # from - NICE
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from_nice'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFromNice2" value="'.$enkaSettings['SMTPFromNice'].'">';
+ echo ' </div>';
+
+ # from
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_from'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPFrom2" value="'.$enkaSettings['SMTPFrom'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ # replyTo
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_reply'].Help::display('srv_obvescanje_odgovorZa').'</label>';
+ echo ' <input type="text" class="medium" name="SMTPReplyTo2" value="'.$enkaSettings['SMTPReplyTo'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #Username
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_username'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPUsername2" value="'.$enkaSettings['SMTPUsername'].'">';
+ echo ' </div>';
+
+ #Password
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_password'].'</label>';
+ echo ' <input type="password" class="medium" name="SMTPPassword2" placeholder="'.$lang['srv_email_setting_password_placeholder'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #autentikacija
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_autentication'].':</label>';
+ echo ' <select class="dropdown medium" name="SMTPAuth2">'
+ . '<option value="0" '.((int)$enkaSettings['SMTPAuth']!="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_no'].'</option>'
+ . '<option value="1" '.((int)$enkaSettings['SMTPAuth']=="1" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_yes'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
+ #Varnost SMTPSecure
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_encryption'].'</label>';
+ echo ' <select class="dropdown medium" name="SMTPSecure2">'
+ . '<option value="0" '.($enkaSettings['SMTPSecure']=="0" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_none'].'</option>'
+ . '<option value="ssl" '.($enkaSettings['SMTPSecure']=="ssl" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_ssl'].'</option>'
+ . '<option value="tls" '.($enkaSettings['SMTPSecure']=="tls" ? 'selected="selected"' : '') .'>'.$lang['srv_email_setting_encryption_tls'].'</option>'
+ . '</select>';
+
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #port
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_port'].$lang['srv_email_setting_port_note'].':</label>';
+ echo ' <input type="number" class="medium" min="0" max="65535" name="SMTPPort2" value="'.(int)$enkaSettings['SMTPPort'].'">';
+ echo ' </div>';
+
+ #host
+ echo ' <div class="setting_item">';
+ echo ' <label>'.$lang['srv_email_setting_host'].'</label>';
+ echo ' <input type="text" class="medium" name="SMTPHost2" value="'.$enkaSettings['SMTPHost'].'">';
+ echo ' </div>';
+
+ echo '</div>';
+
+
+ echo '<div class="setting_holder half-half">';
+
+ #delay
+ echo ' <div class="setting_item">';
+
+ echo ' <label>'.$lang['srv_email_setting_smtp_delay'].' '.Help::display('srv_inv_delay').':</label>';
+ echo ' <select class="dropdown medium" name="SMTPDelay2">'
+ . '<option value="500000" '.($enkaSettings['SMTPDelay']=="500000"?'selected="selected"':'') .'>0.5 sec (max 2 / sec)</option>'
+ . '<option value="1000000" '.($enkaSettings['SMTPDelay']=="1000000"?'selected="selected"':'') .'>1 sec (max 1 / sec)</option>'
+ . '<option value="2000000" '.($enkaSettings['SMTPDelay']=="2000000"?'selected="selected"':'') .'>2 sec (max 30 / min)</option>'
+ . '<option value="4000000" '.($enkaSettings['SMTPDelay']=="4000000"?'selected="selected"':'') .'>4 sec (max 15 / min)</option>'
+ . '<option value="5000000" '.($enkaSettings['SMTPDelay']=="5000000"?'selected="selected"':'') .'>5 sec (max 12 / min)</option>'
+ . '<option value="10000000" '.($enkaSettings['SMTPDelay']=="10000000"?'selected="selected"':'') .'>10 sec (max 6 / min)</option>'
+ . '<option value="20000000" '.($enkaSettings['SMTPDelay']=="20000000"?'selected="selected"':'') .'>20 sec (max 3 / min)</option>'
+ . '<option value="30000000" '.($enkaSettings['SMTPDelay']=="30000000"?'selected="selected"':'') .'>30 sec (max 2 / min)</option>'
+ . '</select>';
+
+ echo ' </div>';
+
+ echo '</div>';
+
+ echo '</div>';
+
+
+ echo '</div>';
+
+ echo '</form>';
+
+
+ echo '<div class="button_holder below float-right">';
+
+ // Gumb shrani
+ echo '<button class="white-black medium" onclick="document.settingsanketa_'.$row['id'].'.submit(); return false;">'.$lang['srv_email_setting_btn_save'].'</button>';
+
+ // Gumb preveri nastavitve
+ echo '<button id="send_mail_mode_test" class="white-blue medium '.($squalo->getSqualoActive() ? ' displayNone' : '').'" onclick="showTestSurveySMTP(); return false;">'.$lang['srv_email_setting_btn_test'].'</button>';
+
+ echo '</div>';
+
+
+ if (isset($_GET['s']) && $_GET['s'] == '1') {
+ echo '<script type="text/javascript">$(document).ready(function() {actionNotePopup(\'success_save\', \'success\');});</script>';
+ }
+ }
+
+ // V session nastavimo nastavitev da se posilja z/brez email posiljanja
+ function setNoEmailing(){
+
+ if(isset($_POST['value'])){
+ SurveySession::sessionStart($this->sid);
+ SurveySession::set('inv_noEmailing', (int)$_POST['value']);
+
+ // Ce preklopimo na drugo posiljanje (posta, sms...) moramo tudi preklopiti na rocni vnos kode
+ if($_POST['value'] == '1'){
+ sisplet_query("UPDATE srv_anketa SET usercode_required='1' WHERE id='".$this->sid."'");
+ }
+ }
+ }
+
+ // V session nastavimo tip posiljanja (ce ni email - posta, sms, drugo...)
+ function setNoEmailingType(){
+
+ if(isset($_POST['value'])){
+ SurveySession::sessionStart($this->sid);
+ SurveySession::set('inv_noEmailing_type', (int)$_POST['value']);
+ }
+ }
+
+ // Prikazemo popup za vklop arnes smtp-ja na aai
+ private function showAAISmtpPopup(){
+ global $lang;
+
+ echo '<div class="popup_close"><a href="#" onClick="smtpAAIPopupClose(); return false;">✕</a></div>';
+
+ echo '<h2>'.$lang['srv_email_setting_adapter0_aai_title'].'</h2>';
+
+ echo '<div class="popup_content">';
+ echo '<p class="bottom16">'.$lang['srv_email_setting_adapter0_aai_popup'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<input type="checkbox" id="aai_smtp_checkbox" name="aai_smtp_checkbox" class="pointer" onClick="smtpAAIAccept();">';
+ echo '<label for="aai_smtp_checkbox" class="semi-bold">'.$lang['srv_email_setting_adapter0_aai_popup2'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
+
+ echo '<div class="buttons_holder">';
+
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" title="'.$lang['srv_cancel'].'" onClick="smtpAAIPopupClose(); return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" id="aai_smtp_button" style="display:none;" title="'.$lang['srv_save_profile_yes'].'" onclick="smtpAAISet(); return false;">'.$lang['srv_save_profile_yes'].'</button>';
+ echo '</div>';
+
+ echo '</div>';
+ }
+}
diff --git a/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php b/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php
index 084cb9a..09d593d 100644
--- a/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php
+++ b/admin/survey/classes/surveyEmails/class.SurveyUnsubscribe.php
@@ -117,12 +117,12 @@ class SurveyUnsubscribe {
return array(substr($cookie,0,6), $cookie);
}
- function doUnsubscribe() {
+ public function doUnsubscribe() {
global $lang;
$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 = '';
diff --git a/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php b/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php
index 4b01a7f..0389ea2 100644
--- a/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php
+++ b/admin/survey/classes/surveyEmails/squalo/class.SqualoApi.php
@@ -18,12 +18,10 @@ class SqualoApi {
private function executeCall($action, $method, $data){
- global $squalo_user;
- global $squalo_key;
// Add credentials
- $data['apiUser'] = $squalo_user;
- $data['apiKey'] = $squalo_key;
+ $data['apiUser'] = AppSettings::getInstance()->getSetting('squalo-user');
+ $data['apiKey'] = AppSettings::getInstance()->getSetting('squalo-key');
// GET call - set url params
if($method == 'GET'){
@@ -222,7 +220,7 @@ class SqualoApi {
"gdprCanSend": true,
"gdprCanTrack": true
*/
- public function addRecipient($email, $list_id, $custom_attributes=array()){
+ public function addRecipient($email, $phone, $list_id, $custom_attributes=array()){
$action = 'create-recipient';
$method = 'POST';
@@ -242,6 +240,7 @@ class SqualoApi {
$data = array(
'email' => $email,
+ 'phone' => $phone,
'listIds' => array($list_id),
'accept' => true,
'confirmed' => true,
diff --git a/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php b/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php
index 77e3a2c..07fe361 100644
--- a/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php
+++ b/admin/survey/classes/surveyEmails/squalo/class.SurveyInvitationsSqualo.php
@@ -38,8 +38,6 @@ class SurveyInvitationsSqualo {
private function checkSqualoEnabled(){
global $mysql_database_name;
global $admin_type;
- global $squalo_user;
- global $squalo_key;
// Zaenkrat imajo squalo samo admini
if($admin_type != 0)
@@ -50,7 +48,7 @@ class SurveyInvitationsSqualo {
return false;
// Zaenkrat imajo squalo samo admini
- if(!isset($squalo_user) || $squalo_user == '' || !isset($squalo_key) || $squalo_key == '')
+ if(AppSettings::getInstance()->getSetting('squalo-user') === false || AppSettings::getInstance()->getSetting('squalo-key') === false)
return false;
return true;
@@ -59,7 +57,7 @@ class SurveyInvitationsSqualo {
// Preverimo ce je squalo vklopljen na anketi
private function checkSqualoActive(){
- $vabila_type = SurveyInfo::getSurveyModules('email');
+ $vabila_type = SurveyInfo::checkSurveyModule('email');
// Vklopljen squalo
if($vabila_type === '2'){
@@ -146,13 +144,14 @@ class SurveyInvitationsSqualo {
//'email' => $sql_row['email'],
'code' => $sql_row['password'],
'password' => $sql_row['password'],
- 'phone' => $sql_row['phone'],
+ //'phone' => $sql_row['phone'],
'custom' => $sql_row['custom'],
'unsubscribe' => $unsubscribe,
);
$recipients[] = array(
'email' => $sql_row['email'],
+ 'phone' => $sql_row['phone'],
'name' => $sql_row['firstname'],
'surname' => $sql_row['lastname'],
'custom_attributes' => $custom_attributes
@@ -254,8 +253,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');
@@ -359,10 +357,11 @@ class SurveyInvitationsSqualo {
foreach($recipients as $recipient){
$email = $recipient['email'];
+ $phone = $recipient['phone'];
$custom_attributes = $recipient['custom_attributes'];
- $recipient_id = $squalo_api->addRecipient($email, $list_id, $custom_attributes);
+ $recipient_id = $squalo_api->addRecipient($email, $phone, $list_id, $custom_attributes);
// Napaka pri ustvarjanju seznama
if($recipient_id == '0'){
diff --git a/admin/survey/classes/tracking/CrossRoad.php b/admin/survey/classes/tracking/CrossRoad.php
index cd8c2e4..01f9475 100644
--- a/admin/survey/classes/tracking/CrossRoad.php
+++ b/admin/survey/classes/tracking/CrossRoad.php
@@ -13,26 +13,49 @@
*/
class CrossRoad {
+
static function MainNavigation($anketa=null){
+
+ // Status za tracking sprememb
$status = -1;
+
+ // Lokacija v navigaciji
+ $first_action = '';
+ $second_action = '';
+ $third_action = '';
+
+ // Layout strani glede na to kje se nahajamo (imamo levi meni in sirina holderja)
+ $layout_menu = '';
+ $layout_width = '';
+ $hide_header = '';
+
# ajaxa se poslje skupaj z ajaxom, da ob updatu vemo kaksen 'a' je bil na originalni strani
# (drugace se ob updatu z ajaxom informacija o 'a'ju zgubi)
$get = $_GET['a'];
+
if (isset ($_GET['ajaxa']))
$get = $_GET['ajaxa'];
- if (trim($get) == '') {
+
+ if ($get === null || trim($get) == '')
$get = A_BRANCHING;
- }
-
+
+
//smo vezani na anketo
if($anketa != null && $anketa > 0){
+
switch ($get) {
- # status
+
+ # STATUS
case A_REPORTI:
$first_action = NAVI_STATUS;
$second_action = NAVI_STATUS_OSNOVNI;
+
+ $layout_width = 'wide';
+
$status = 3;
+
break;
+
case A_NONRESPONSE_GRAPH:
case A_USABLE_RESP:
case A_KAKOVOST_RESP:
@@ -45,19 +68,33 @@ class CrossRoad {
case A_PARA_GRAPH:
case 'langStatistic':
case 'AAPOR':
+ case A_STATUS_ADVANCED:
$first_action = NAVI_STATUS;
$second_action = NAVI_STATUS_OSNOVNI;
+
+ $layout_width = 'wide';
+ if ($_GET['m'] == 'advanced')
+ $layout_width = 'fullwidth';
+
$status = 4;
+
break;
- # urejanje
+
+ # UREJANJE ANKETE
case A_BRANCHING:
case A_GLASOVANJE:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_BRANCHING;
+
+ $layout_width = 'fullwidth';
+
$status = 0;
+
break;
+
+ # TESTIRANJE
case A_TESTIRANJE:
$first_action = NAVI_TESTIRANJE;
$second_action = M_TESTIRANJE_DIAGNOSTIKA;
@@ -70,26 +107,45 @@ class CrossRoad {
if ($_GET['m'] == M_TESTIRANJE_CAS) {
$second_action = NAVI_TESTIRANJE_CAS;
}
+
+ $layout_width = 'narrow';
+
+ if (isset($_GET['m']) && ($_GET['m'] == 'cas' || $_GET['m'] == 'predvidenicas')) {
+ $layout_width = 'wide';
+
+ }
+
$status = 4;
+
break;
+
+ # NASTAVITVE ANKETE
case A_KOMENTARJI:
case A_KOMENTARJI_ANKETA:
$first_action = NAVI_TESTIRANJE;
$second_action = NAVI_TESTIRANJE_KOMENTARJI;
+
+ $layout_width = 'narrow';
+ if (isset($_GET['a']) && ($_GET['a'] == 'komentarji' || $_GET['a'] == 'komentarji_anketa'))
+ $layout_width = 'wide';
+
+ $layout_menu = '';
+
$status = 0;
- break;
+ break;
+
case A_SETTINGS:
case A_OSNOVNI_PODATKI:
case A_FORMA:
-
case A_COOKIE:
case A_TRAJANJE:
case A_DOSTOP:
case A_MISSING:
case A_METADATA:
case A_MOBILESETTINGS:
+ case A_TABLESETTINGS:
case A_JEZIK: # nastavitve jezik
case A_UREJANJE: # nastavitve komentarjev
case A_PRIKAZ: # nastavitve komentarjev
@@ -98,7 +154,12 @@ class CrossRoad {
case A_GDPR:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_TEMA: # nastavitve prevajanje
@@ -106,51 +167,143 @@ class CrossRoad {
case 'edit_css': # nastavitve prevajanje
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_TEMA;
+
+ $layout_width = 'wide';
+ if($_GET['t'] == 'upload')
+ $layout_width = 'narrow';
+
$status = 0;
+
break;
case A_HIERARHIJA:
$first_action = NAVI_HIERARHIJA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
break;
case A_PREVAJANJE: # nastavitve prevajanje
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_PREVAJANJE;
+
+ $layout_width = 'fullwidth';
+
$status = 0;
+
break;
case A_ALERT:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_NAGOVORI:
+ $first_action = NAVI_UREJANJE;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
+ $status = 0;
+
+ break;
+
+
+ # ARHIVI
case A_ARHIVI:
+ $first_action = ($_GET['m'] == 'data') ? NAVI_RESULTS : NAVI_UREJANJE;
+ $second_action = NAVI_ARHIVI;
+
+ if(isset($_GET['m']) && $_GET['m'] == 'survey')
+ $third_action = NAVI_UREJANJE_ARHIVI_EXPORT1;
+ elseif(isset($_GET['m']) && $_GET['m'] == 'survey_data')
+ $third_action = NAVI_UREJANJE_ARHIVI_EXPORT2;
+ elseif(!isset($_GET['m']) || $_GET['m'] != 'data')
+ $third_action = NAVI_UREJANJE_ARHIVI;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
+
+ $status = 0;
+
+ break;
+
case A_TRACKING:
$first_action = NAVI_UREJANJE;
+ $second_action = NAVI_ARHIVI;
+
+ if(isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1')
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING3;
+ elseif($_GET['m'] == 'tracking_data')
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING2;
+ else
+ $third_action = NAVI_UREJANJE_ARHIVI_TRACKING1;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
- # objave, vabila
+
+ # OBJAVA, VABILA
case A_VABILA:
$first_action = NAVI_OBJAVA;
+ $_GET['m'] == 'settings' ? $second_action = NAVI_OBJAVA_SETTINGS : (isset($_GET['m']) && $_GET['m'] == 'url' ? $second_action = NAVI_OBJAVA_URL : $second_action = '');
+
+ $layout_width = 'narrow';
+
$status = 5;
+
break;
case A_EMAIL:
$first_action = NAVI_OBJAVA;
$second_action = NAVI_OBJAVA;
+
+ $layout_width = 'wide';
+
$status = 5;
+
break;
case 'invitations':
$first_action = NAVI_OBJAVA;
- $second_action = 'invitations';
+ $second_action = (isset($_GET['m']) && $_GET['m'] == 'view_archive') ? NAVI_ARHIVI : 'invitations';
+
+ $layout_width = 'wide';
+
+ if ($_GET['m'] == 'view_archive')
+ $layout_menu = "menu_left";
+
$status = 5;
+
break;
- # analize, podatki
+ case A_OTHER_INV:
+ $first_action = NAVI_OBJAVA;
+ $second_action = (isset($_GET['m']) && $_GET['m'] == 'view_archive') ? NAVI_ARHIVI : NAVI_OBJAVA;
+
+ $layout_width = 'narrow';
+
+ if ($_GET['m'] == 'view_archive')
+ $layout_menu = "menu_left";
+
+ $status = 5;
+
+ break;
+
+
+ # ANALIZE, PODATKI
case A_ANALYSIS:
$first_action = NAVI_ANALYSIS;
@@ -158,39 +311,163 @@ class CrossRoad {
if ($_GET['m'] == M_ANALYSIS_LINKS) {
$second_action = NAVI_ANALYSIS_LINKS;
}
+ elseif($_GET['m'] == 'anal_arch'){
+ $second_action = NAVI_ARHIVI;
+ }
+
+ if ($_GET['m'] == 'sumarnik') {
+ $third_action = M_ANALYSIS_SUMMARY;
+ }
+ elseif ($_GET['m'] == 'descriptor') {
+ $third_action = M_ANALYSIS_DESCRIPTOR;
+ }
+ elseif ($_GET['m'] == 'frequency') {
+ $third_action = M_ANALYSIS_FREQUENCY;
+ }
+ elseif ($_GET['m'] == 'crosstabs') {
+ $third_action = M_ANALYSIS_CROSSTAB;
+ }
+ elseif ($_GET['m'] == 'multicrosstabs') {
+ $third_action = M_ANALYSIS_MULTICROSSTABS;
+ }
+ elseif ($_GET['m'] == 'means') {
+ $third_action = M_ANALYSIS_MEANS;
+ }
+ elseif ($_GET['m'] == 'ttest') {
+ $third_action = M_ANALYSIS_TTEST;
+ }
+ elseif ($_GET['m'] == 'break') {
+ $third_action = M_ANALYSIS_BREAK;
+ }
+
+
+ if ($_GET['m'] == 'charts') {
+ $layout_width = 'narrow';
+ }
+ else{
+ $layout_width = 'wide';
+ }
+
+ if ($_GET['m'] == 'anal_arch') {
+ $layout_menu = 'menu_left';
+ }
+
$status = 2;
+
break;
case A_COLLECT_DATA:
$first_action = NAVI_RESULTS;
$second_action = NAVI_DATA;
+
+ $layout_width = 'fullwidth';
+
+ if ($_GET['m'] == M_COLLECT_DATA_CALCULATION) {
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CALCULATION;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_CODING){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CODING;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_CODING_AUTO){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_CODING_AUTO;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif($_GET['m'] == M_COLLECT_DATA_RECODING){
+ $second_action = NAVI_DATA_CALC;
+ $third_action = NAVI_DATA_CALC_RECODING;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+
+ elseif(isset($_GET['m']) && ($_GET['m'] == M_COLLECT_DATA_APPEND || $_GET['m'] == 'upload_xls' || $_GET['m'] == 'append_xls' || $_GET['m'] == 'merge_xls')){
+ $second_action = NAVI_DATA_IMPORT;
+ $third_action = NAVI_DATA_IMPORT_APPEND;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_COLLECT_DATA_MERGE){
+ $second_action = NAVI_DATA_IMPORT;
+ $third_action = NAVI_DATA_IMPORT_MERGE;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+ }
+ elseif (isset($_GET['m']) && $_GET['m'] == 'quick_edit') {
+ $layout_width = 'wide';
+ }
+ elseif (isset($_GET['m']) && $_GET['m'] == 'variables') {
+ $layout_width = 'wide';
+ }
+
$status = 4;
+
break;
- #izvozi
+
+ # IZVOZI
case A_COLLECT_DATA_EXPORT:
$first_action = NAVI_RESULTS;
$second_action = NAVI_DATA_EXPORT;
+
+ if(isset($_GET['m']) && $_GET['m'] == M_EXPORT_EXCEL){
+ $third_action = NAVI_DATA_EXPORT_EXCEL;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_EXCEL_XLS){
+ $third_action = NAVI_DATA_EXPORT_EXCEL_XLS;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_SAV){
+ $third_action = NAVI_DATA_EXPORT_SAV;
+ }
+ elseif(isset($_GET['m']) && $_GET['m'] == M_EXPORT_TXT){
+ $third_action = NAVI_DATA_EXPORT_TXT;
+ }
+ else{
+ $third_action = NAVI_DATA_EXPORT_SPSS;
+ }
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 4;
- if ($_GET['m'] == A_COLLECT_DATA_EXPORT_ALL) {
+
+ if (isset($_GET['m']) && $_GET['m'] == A_COLLECT_DATA_EXPORT_ALL) {
$first_action = NAVI_RESULTS;
$second_action = NAVI_ANALYSIS_LINKS;
+ $third_action = '';
+
$status = 2;
}
+
break;
- # dodatne nastavitve
+
+ # DODATNE NASTAVITVE
case A_ADVANCED:
case A_UPORABNOST:
case A_HIERARHIJA_SUPERADMIN:
case A_KVIZ:
case A_VOTING:
case A_ADVANCED_PARADATA:
+ case A_ADVANCED_TIMESTAMPS:
case A_JSON_SURVEY_EXPORT:
case A_VNOS:
case A_SOCIAL_NETWORK:
case A_CHAT:
case A_PANEL:
+ case A_EMAIL_ACCESS:
case A_SLIDESHOW:
case A_360:
case A_360_1KA:
@@ -209,7 +486,12 @@ class CrossRoad {
case 'fieldwork':
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+ $layout_menu = 'menu_left';
+
$status = 0;
+
break;
case A_TELEPHONE:
@@ -217,35 +499,125 @@ class CrossRoad {
case T_PHONE:
$first_action = NAVI_UREJANJE;
$second_action = NAVI_UREJANJE_ANKETA;
+
+ $layout_width = 'wide';
+
+ // Anektar (telefonska anketa) nima leve navigacije
+ global $global_user_id;
+ if(!Common::isUserAnketar($anketa, $global_user_id))
+ $layout_menu = 'menu_left';
+
$status = 5;
+
break;
- case A_LANGUAGE_TECHNOLOGY:
- $first_action = NAVI_TESTIRANJE;
- $second_action = NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY;
- $status = 4;
+ default:
break;
+ }
+
+ // shrani tracking za anketo
+ if(!isDemoSurvey($anketa)
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING1
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING2
+ && $third_action != NAVI_UREJANJE_ARHIVI_TRACKING3
+ ){
+ TrackingClass::update($anketa, $status);
+ }
+ }
+ // Nismo vezani na anketo, tracking uporabnika
+ else{
+
+ switch ($get) {
+
+ # AKTIVNOST in UPORABNIKI
+ case 'diagnostics':
+
+ // Uporabniki
+ if(isset($_GET['t']) && $_GET['t'] == 'uporabniki'){
+ $layout_width = 'narrow';
+ if(!isset($_GET['m']) || $_GET['m'] == 'all' || $_GET['m'] == ''){
+ $layout_width = 'fullwidth';
+ }
+ }
+ // Ativnost
+ else{
+ $layout_width = 'narrow';
+ }
- case A_LANGUAGE_TECHNOLOGY_OLD:
- $first_action = NAVI_TESTIRANJE;
- $second_action = NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY_OLD;
- $status = 4;
break;
+
+ # KNJIZNICA
+ case 'knjiznica':
+ $layout_width = 'wide';
+
+ break;
+
+
+ # NASTAVITVE
+ case 'nastavitve':
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # OBVESTILA
+ case 'obvestila':
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # GDPR
+ case 'gdpr':
+ if (isset($_GET['m']) && $_GET['m'] == 'gdpr_requests')
+ $layout_width = 'wide';
+ elseif (isset($_GET['m']) && $_GET['m'] == 'gdpr_requests_all')
+ $layout_width = 'fullwidth';
+ else
+ $layout_width = 'narrow';
+
+ break;
+
+
+ # MODUL UL EVALVACIJE
+ case 'ul_evalvation':
+ $layout_width = 'wide';
+
+ break;
+
+
+ # MOJE ANKETE
+ case 'pregledovanje':
default:
+ $layout_width = 'wide';
+
+ if ((isset($_GET['a']) && $_GET['a'] == 'ustvari_anketo') || (isset($_GET['b']) && $_GET['b'] == 'new_survey')) {
+ $layout_width = 'fullwidth';
+ $layout_menu = 'menu_left';
+ $hide_header = 'hide_header';
+ }
+
+ if ($_GET['a'] == 'narocila') {
+ $layout_width = 'narrow';
+ }
+
break;
}
- //shrani tracking
- TrackingClass::update($anketa, $status);
- //vrni podatke o navigaciji nazaj v SurveyAdmin
- return array('first_action' => $first_action, 'second_action' => $second_action);
- }
- //nismo vezani na anketo, tracking uporabnika
- else{
+ // shrani tracking za userja
TrackingClass::update_user();
}
-
-
+
+ // vrni podatke o navigaciji nazaj v SurveyAdmin
+ return array(
+ 'first_action' => $first_action,
+ 'second_action' => $second_action,
+ 'third_action' => $third_action,
+
+ 'layout_width' => $layout_width,
+ 'layout_menu' => $layout_menu,
+ 'hide_header' => $hide_header,
+ );
}
}
diff --git a/admin/survey/classes/tracking/TrackingClass.php b/admin/survey/classes/tracking/TrackingClass.php
index f635d4f..fe31ddf 100644
--- a/admin/survey/classes/tracking/TrackingClass.php
+++ b/admin/survey/classes/tracking/TrackingClass.php
@@ -23,12 +23,11 @@ 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')
+ if (isset($_GET['m']) && $_GET['m'] == 'tracking_data')
$this->sub = 'data';
- elseif ($_GET['appendMerge'] == '1')
+ elseif (isset($_GET['appendMerge']) && $_GET['appendMerge'] == '1')
$this->sub = 'append';
else
$this->sub = 'survey';
@@ -118,15 +117,11 @@ class TrackingClass
{
global $lang;
+ $surveyName = SurveyInfo::getInstance()->getSurveyTitle();
+
echo '<fieldset>';
echo '<legend>' . $lang['srv_survey_archives_tracking_' . $this->sub] . '</legend>';
- // Izvoz v Excel
- echo '<p><a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">Download Excel</a></p>';
-
-
- echo '<table id="tracking">';
-
// Tabela s podatki o spremembah podatkov
if ($this->sub == 'data') {
@@ -139,74 +134,96 @@ class TrackingClass
OR (`get` LIKE \'%urejanje: "1"%\' AND status=\'4\')
)';
- // Prva vrstica
- echo '<tr>';
- echo ' <th>' . $lang['date'] . '</th>';
- echo ' <th>User</th>';
- echo ' <th class="center">IP</th>';
- echo ' <th class="center">Recnum</th>';
- echo ' <th>GET</th>';
- echo ' <th>POST</th>';
- echo '</tr>';
-
+
// Vrstice s podatki
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $appendMerge . " " . $data . " ORDER BY datetime DESC");
- while ($row = mysqli_fetch_array($sql)) {
+ $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $data . " ORDER BY datetime DESC");
+
+ if(!empty(mysqli_fetch_array($sql))) {
+
+
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].' '.$lang['srv_survey_archives_tracking_survey_text1b'].' <a href="index.php?anketa=' . $this->anketa . '&a=data">\'<span class="caps">'.$lang['navigation_NAVI_RESULTS'].'</span>\' - \''.$lang['navigation_NAVI_DATA'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1c'].' \''.$surveyName.'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+
+ // Izvoz v Excel
+ echo '<div class="izvoz_nad_tabelo">';
+ echo '<a class="noline" href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download"><span class="faicon xls green link-right"></span>'.$lang['srv_export_excel'].'</a>';
+ echo '</div>';
+
+ echo '<table id="tracking" class="fullwidth">';
+ // Prva vrstica
echo '<tr>';
+ echo ' <th>' . $lang['date'] . '</th>';
+ echo ' <th>' . $lang['user'] . '</th>';
+ echo ' <th>IP</th>';
+ echo ' <th>Respondent</th>';
+ echo ' <th>GET</th>';
+ echo ' <th>POST</th>';
+ echo '</tr>';
- $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
+ $count = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ echo '<tr '.($count > 24 ? 'class="displayNone"' : '').($count == 24 ? ' class="show_as_last_row"' : '').'>';
- // Pri podatkih dobimo posebej podatke o editiranem respondentu
- $usr_id = '';
- $cookie = '';
+ $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
+ $rowu = mysqli_fetch_array($sqlu);
- // Preverimo ce imamo usr_id v GET-u
- $get_array_temp = explode(', ', $row['get']);
- foreach ($get_array_temp AS $get_val) {
- $param = explode(': ', $get_val);
- $get_array[$param[0]] = $param[1];
- }
+ // Pri podatkih dobimo posebej podatke o editiranem respondentu
+ $usr_id = '';
+ $cookie = '';
- if (isset($get_array['usr_id']) && $get_array['usr_id'] != '') {
- $usr_id = trim($get_array['usr_id'], '"');
- } // Preverimo ce iammo slucajno cookie
- elseif (isset($get_array['survey-' . $this->anketa]) && $get_array['survey-' . $this->anketa] != '') {
- $cookie = trim($get_array['survey-' . $this->anketa], '"');
- } else {
- // Preverimo ce imamo usr_id v POST-u
- $post_array_temp = explode(', ', $row['post']);
- foreach ($post_array_temp AS $post_val) {
- $param = explode(': ', $post_val);
- $post_array[$param[0]] = $param[1];
+ // Preverimo ce imamo usr_id v GET-u
+ $get_array_temp = explode(', ', $row['get']);
+ foreach ($get_array_temp AS $get_val) {
+ $param = explode(': ', $get_val);
+ $get_array[$param[0]] = $param[1];
}
- if (isset($post_array['usr_id']) && $post_array['usr_id'] != '')
- $usr_id = trim($post_array['usr_id'], '"');
- }
+ if (isset($get_array['usr_id']) && $get_array['usr_id'] != '') {
+ $usr_id = trim($get_array['usr_id'], '"');
+ } // Preverimo ce iammo slucajno cookie
+ elseif (isset($get_array['survey-' . $this->anketa]) && $get_array['survey-' . $this->anketa] != '') {
+ $cookie = trim($get_array['survey-' . $this->anketa], '"');
+ } else {
+ // Preverimo ce imamo usr_id v POST-u
+ $post_array_temp = explode(', ', $row['post']);
+ foreach ($post_array_temp AS $post_val) {
+ $param = explode(': ', $post_val);
+ $post_array[$param[0]] = $param[1];
+ }
+
+ if (isset($post_array['usr_id']) && $post_array['usr_id'] != '')
+ $usr_id = trim($post_array['usr_id'], '"');
+ }
- if ($usr_id != '') {
- $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE id = '$usr_id'");
- $rowR = mysqli_fetch_array($sqlR);
+ if ($usr_id != '') {
+ $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE id = '$usr_id'");
+ $rowR = mysqli_fetch_array($sqlR);
- $recnum = $rowR['recnum'];
- } elseif ($cookie != '') {
- $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE cookie = '$cookie'");
- $rowR = mysqli_fetch_array($sqlR);
+ $recnum = $rowR['recnum'];
+ } elseif ($cookie != '') {
+ $sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE cookie = '$cookie'");
+ $rowR = mysqli_fetch_array($sqlR);
- $recnum = $rowR['recnum'];
- } else
- $recnum = 0;
+ $recnum = $rowR['recnum'];
+ } else
+ $recnum = 0;
- echo ' <td>' . datetime($row['datetime']) . '</td>';
- echo ' <td>' . $rowu['name'] . ' ' . $rowu['surname'] . '</td>';
- echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td class="center">' . $recnum . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
+ echo ' <td><div class="no_wrap">' . $rowu['name'] . ' ' . $rowu['surname'] . '</div></td>';
+ echo ' <td>' . $row['ip'] . '</td>';
+ echo ' <td>' . $recnum . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . (($row['post'] != "") ? $row['post'] : '/') . '</div></td>';
- echo '</tr>';
+ echo '</tr>';
+
+ $count++;
+ }
+ }
+ else {
+ echo '<p>'.ucfirst($lang['srv_survey_archives_tracking_survey_text1b']).' <a href="index.php?anketa=' . $this->anketa . '&a=data">\'<span class="caps">'.$lang['navigation_NAVI_RESULTS'].'</span>\' - \''.$lang['navigation_NAVI_DATA'].'\'</a> '.$lang['srv_survey_archives_tracking_survey_text1d'].'.</p>';
}
+
+
} // Tabela s podatki o spremembah - vse oz. merge/append
else {
@@ -231,32 +248,53 @@ class TrackingClass
else
$appendMerge = "";
- // Prva vrstica
- echo '<tr>';
- echo ' <th>' . $lang['date'] . '</th>';
- echo ' <th>User</th>';
- echo ' <th class="center">IP</th>';
- echo ' <th class="center">Podstran</th>';
- echo ' <th>GET</th>';
- echo ' <th>POST</th>';
- echo '</tr>';
// Vrstice s podatki
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $this->status . " " . $appendMerge . " " . $data . " ORDER BY datetime DESC");
- while ($row = mysqli_fetch_array($sql)) {
+ $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '$this->anketa' " . $this->status . " " . $appendMerge . " ORDER BY datetime DESC");
+
+ if(!empty(mysqli_fetch_array($sql))) {
+
+ if($appendMerge == "")
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].' '.$lang['srv_survey_archives_tracking_survey_text1a'].' \''. $surveyName .'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+ else
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_survey_text1'].', '.$lang['srv_survey_archives_tracking_survey_text_appendmerge'].' '.$lang['srv_survey_archives_tracking_survey_text1a'].' \''. $surveyName .'\'. '.$lang['srv_survey_archives_tracking_survey_text2'].' <a href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download">'.$lang['srv_survey_archives_tracking_survey_text3'].'</a>.</p>';
+
+ // Izvoz v Excel
+ echo '<div class="izvoz_nad_tabelo">';
+ echo '<a class="noline" href="index.php?anketa=' . $this->anketa . '&a=' . $_GET['a'] . '&d=download"><span class="faicon xls green link-right"></span>'.$lang['srv_export_excel'].'</a>';
+ echo '</div>';
+
+ echo '<table id="tracking" class="fullwidth">';
+ // Prva vrstica
echo '<tr>';
-
- $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
-
- echo ' <td>' . datetime($row['datetime']) . '</td>';
- echo ' <td>' . $rowu['name'] . ' ' . $rowu['surname'] . '</td>';
- echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td class="center">' . $statuses[$row['status']] . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
-
+ echo ' <th>' . $lang['date'] . '</th>';
+ echo ' <th>' . $lang['user'] . '</th>';
+ echo ' <th>IP</th>';
+ echo ' <th>Podstran</th>';
+ echo ' <th>GET</th>';
+ echo ' <th>POST</th>';
echo '</tr>';
+
+ $count = 0;
+ while ($row = mysqli_fetch_array($sql)) {
+ echo '<tr '.($count > 24 ? 'class="displayNone"' : '').($count == 24 ? ' class="show_as_last_row"' : '').'>';
+
+ $sqlu = sisplet_query("SELECT name, surname FROM users WHERE id = '$row[user]'");
+ $rowu = mysqli_fetch_array($sqlu);
+
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
+ echo ' <td><div class="no_wrap">' . $rowu['name'] . ' ' . $rowu['surname'] . '</div></td>';
+ echo ' <td>' . $row['ip'] . '</td>';
+ echo ' <td>' . $statuses[$row['status']] . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . (($row['post'] != "") ? $row['post'] : '/') . '</div></td>';
+
+ echo '</tr>';
+ $count++;
+ }
+ }
+ else{
+ echo $lang['srv_survey_archives_tracking_append_no_data'];
}
}
@@ -265,13 +303,13 @@ class TrackingClass
echo '</fieldset>';
}
- public function csvExport()
- {
+ public function csvExport(){
+
define('delimiter', ';');
-
$podatki = 'datetime' . delimiter;
- $podatki .= 'uid' . delimiter;
+ $podatki .= 'user_id' . delimiter;
+ $podatki .= 'user_name' . delimiter;
$podatki .= 'ip' . delimiter;
$podatki .= 'status' . delimiter;
$podatki .= 'parameter' . delimiter;
@@ -279,18 +317,19 @@ class TrackingClass
$podatki .= 'parameter' . delimiter;
$podatki .= 'value' . delimiter;
-
$podatki .= "\n";
- $sql = sisplet_query("SELECT * FROM srv_tracking".$this->db_table." WHERE ank_id = '" . $this->anketa . "' " . $this->status . " ORDER BY datetime DESC");
+ $sql = sisplet_query("SELECT t.*, u.name, u.surname
+ FROM srv_tracking".$this->db_table." t, users u
+ WHERE t.ank_id = '" . $this->anketa."' ".str_replace('status', 't.status', $this->status)."
+ AND u.id=t.user
+ ORDER BY t.datetime DESC
+ ");
while ($row = mysqli_fetch_array($sql)) {
-
- $sqlu = sisplet_query("SELECT name, surname, id FROM users WHERE id = '$row[user]'");
- $rowu = mysqli_fetch_array($sqlu);
-
$podatki .= '' . datetime($row['datetime']) . delimiter;
- $podatki .= '' . $rowu['id'] . delimiter;
+ $podatki .= '' . $row['user'] . delimiter;
+ $podatki .= '' . $row['name'].' '.$row['surname'] . delimiter;
$podatki .= '' . $row['ip'] . delimiter;
$podatki .= '' . $row['status'] . delimiter;
@@ -304,6 +343,7 @@ class TrackingClass
}
$ime = str_replace('-', '_', $_GET['a']);
+
return Export::init()->csv('Spremembe_' . $ime, $podatki);
}
@@ -322,7 +362,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) {
@@ -336,9 +376,6 @@ class TrackingClass
if ($post != '')
$post .= ', ';
-// if (is_array($val))
-// $val = implode(',', $val);
-
if (is_array($val))
$val = self::arrayToString($val);
@@ -374,9 +411,6 @@ class TrackingClass
if ($post != '')
$post .= ', ';
-// if (is_array($val))
-// $val = implode(',', $val);
-
if (is_array($val))
$val = self::arrayToString($val);
diff --git a/admin/survey/classes/tracking/UserTrackingClass.php b/admin/survey/classes/tracking/UserTrackingClass.php
index 3833003..edb29ee 100644
--- a/admin/survey/classes/tracking/UserTrackingClass.php
+++ b/admin/survey/classes/tracking/UserTrackingClass.php
@@ -40,12 +40,16 @@ class UserTrackingClass
echo '<div id="div_archive_content" class="tracking">';
echo '<fieldset>';
- echo '<legend>' . $lang['srv_survey_archives_tracking'] . '</legend>';
+ echo '<legend>' . $lang['srv_survey_archives_tracking_history'] . '</legend>';
// Izvoz v Excel
- echo '<p>'.$lang['srv_survey_archives_tracking_last_changes'].'</p>';
+ echo '<p class="bottom16">'.$lang['srv_survey_archives_tracking_last_changes'].'</p>';
+ //echo '<div id="table-horizontal-scroll-wrapper1-userchanges">';
+ //echo '<div id="table-horizontal-scroll-wrapper2-userchanges">'; - wrapperja za scroll na mobilnem
+ echo '<div class="table-horizontal-scroll-wrapper1">';
+ echo '<div class="table-horizontal-scroll-wrapper2">';
echo '<table id="tracking">';
// Prva vrstica
@@ -62,20 +66,22 @@ class UserTrackingClass
while ($row = mysqli_fetch_array($sql)) {
echo '<tr>';
- echo ' <td>' . datetime($row['datetime']) . '</td>';
+ echo ' <td><div class="no_wrap">' . datetime($row['datetime']) . '</div></td>';
echo ' <td class="center">' . $row['ip'] . '</td>';
- echo ' <td>' . $row['get'] . '</td>';
- echo ' <td>' . $row['post'] . '</td>';
+ echo ' <td><div class="postget_wrap">' . $row['get'] . '</div></td>';
+ echo ' <td><div class="postget_wrap">' . $row['post'] . '</div></td>';
echo '</tr>';
}
echo '</table>';
+ echo '</div>';
+ echo '</div>'; //- wrapperja za scroll na mobilnem
+
echo '</fieldset>';
- echo '<br class="clr" />';
- echo '</div>';
+ echo '</div>';
}
public function csvExport()
diff --git a/admin/survey/css/print.css b/admin/survey/css/print.css
index 32ed23e..429eb3a 100644
--- a/admin/survey/css/print.css
+++ b/admin/survey/css/print.css
@@ -396,6 +396,105 @@ div.dashboard_cell table td{
padding: 2px 0px;
}
+.dashboard_boxes{
+ display: flex;
+ flex-wrap: wrap;
+ box-sizing: border-box;
+
+ margin-top: 32px;
+}
+
+.dashboard_box{
+ position: relative;
+ box-sizing: border-box;
+ width: 430px;
+ max-width: 100%;
+
+ padding: 32px 16px;
+ margin: 0 32px 32px 0;
+
+ font-size: 14px;
+
+ border: 1px #e5e5e5 solid;
+}
+.dashboard_box .box_title{
+ position: absolute;
+ top: -10px;
+ left: 16px;
+
+ padding: 0 16px;
+
+ font-size: 14px;
+ font-weight: bold;
+ color: #1E88E5;
+ text-transform: uppercase;
+ line-height: 18px;
+
+ background-color: white;
+}
+
+.dashboard_box .box_top_settings{
+ display: flex;
+ align-items: center;
+
+ margin-bottom: 8px;
+}
+.dashboard_box .box_top_settings span,
+.dashboard_box .box_top_settings label{
+ font-size: 14px;
+}
+
+.dashboard_box .box_top_settings select.dropdown{
+ width: auto;
+ margin: 0 0 0 8px;
+}
+
+.dashboard_box table{
+ width: 100%;
+ margin: 0 0 16px 0;
+
+
+}
+.dashboard_box table tr{
+ height: auto;
+}
+.dashboard_box table tr.row1 td{
+ padding: 8px 16px 8px 8px;
+ font-weight: 600;
+ background-color: #F8F8F8;
+}
+
+.dashboard_box table tr.row_sum td{
+ font-weight: 600;
+}
+
+.dashboard_box table tr td{
+ padding: 4px 16px 4px 8px;
+
+ font-size: 14px;
+
+ border-top: 1px #E5E5E5 solid;
+ border-bottom: 1px #E5E5E5 solid;
+}
+.dashboard_box table tr td strong{
+ font-weight: 600;
+}
+
+.dashboard_box table tr td span{
+ font-size: 14px;
+}
+.dashboard_box table tr td .graph_db {
+ float: left;
+ height: 16px;
+ margin-top: 1px;
+
+ background-color: #1E88E5;
+}
+.dashboard_box table tr td .graph_text {
+ margin-left: 8px;
+ font-size: 14px;
+}
+
#div_statistic_info { }
#div_statistic_answer_state { }
#div_statistic_status {}
diff --git a/admin/survey/definition.php b/admin/survey/definition.php
index db3951f..9cfa1ef 100644
--- a/admin/survey/definition.php
+++ b/admin/survey/definition.php
@@ -22,18 +22,27 @@
define("NAVI_TESTIRANJE_PREDVIDENI", "NAVI_TESTIRANJE_PREDVIDENI");
define("NAVI_TESTIRANJE_CAS", "NAVI_TESTIRANJE_CAS");
define("NAVI_TESTIRANJE_VNOSI", "NAVI_TESTIRANJE_VNOSI");
- define("NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY", "NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY");
- define("NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY_OLD", "NAVI_TESTIRANJE_LANGUAGE_TECHNOLOGY_OLD");
+ define("NAVI_TESTIRANJE_KOMENTARJI_ANKETA", "NAVI_TESTIRANJE_KOMENTARJI_ANKETA");
+
define("NAVI_UREJANJE_BRANCHING", "NAVI_UREJANJE_BRANCHING");
define("NAVI_UREJANJE_ANKETA", "NAVI_UREJANJE_ANKETA");
define("NAVI_UREJANJE_TEMA", "NAVI_UREJANJE_TEMA");
define("NAVI_UREJANJE_ALERT", "NAVI_UREJANJE_ALERT");
define("NAVI_UREJANJE_TESTIRANJE", "NAVI_UREJANJE_TESTIRANJE");
- define("NAVI_TESTIRANJE_KOMENTARJI_ANKETA", "NAVI_TESTIRANJE_KOMENTARJI_ANKETA");
define("NAVI_UREJANJE_PREVAJANJE", "NAVI_UREJANJE_PREVAJANJE");
+ define("NAVI_UREJANJE_ARHIVI", "NAVI_UREJANJE_ARHIVI");
+ define("NAVI_UREJANJE_ARHIVI_TRACKING1", "NAVI_UREJANJE_ARHIVI_TRACKING1");
+ define("NAVI_UREJANJE_ARHIVI_TRACKING2", "NAVI_UREJANJE_ARHIVI_TRACKING2");
+ define("NAVI_UREJANJE_ARHIVI_TRACKING3", "NAVI_UREJANJE_ARHIVI_TRACKING3");
+ define("NAVI_UREJANJE_ARHIVI_EXPORT1", "NAVI_UREJANJE_ARHIVI_EXPORT1");
+ define("NAVI_UREJANJE_ARHIVI_EXPORT2", "NAVI_UREJANJE_ARHIVI_EXPORT2");
+
define("NAVI_OBJAVA", "NAVI_OBJAVA");
+ define("NAVI_OBJAVA_SETTINGS", "NAVI_OBJAVA_SETTINGS");
+ define("NAVI_OBJAVA_URL", "NAVI_OBJAVA_URL");
+
+
define("NAVI_ANALYSIS", "NAVI_ANALYSIS");
- define("NAVI_RESULTS", "NAVI_RESULTS");
define("NAVI_ADVANCED", "NAVI_ADVANCED");
define("NAVI_UPORABNOST", "NAVI_UPORABNOST");
define("NAVI_HIERARHIJA_SUPERADMIN", "NAVI_HIERARHIJA_SUPERADMIN");
@@ -48,9 +57,28 @@
define("NAVI_STATISTIC_ANALYSIS", "NAVI_STATISTIC_ANALYSIS");
define("NAVI_ANALYSIS_LINKS", "NAVI_ANALYSIS_LINKS");
define("NAVI_ANALYSIS_TIMES", "NAVI_ANALYSIS_TIMES");
+
+ define("NAVI_ARHIVI", "NAVI_ARHIVI");
+
+ define("NAVI_RESULTS", "NAVI_RESULTS");
define("NAVI_DATA", "NAVI_DATA");
- define("NAVI_DATA_EXPORT", "NAVI_DATA_EXPORT");
+ define("NAVI_DATA_CALC", "NAVI_DATA_CALC");
+ define("NAVI_DATA_CALC_CALCULATION", "NAVI_DATA_CALC_CALCULATION");
+ define("NAVI_DATA_CALC_CODING", "NAVI_DATA_CALC_CODING");
+ define("NAVI_DATA_CALC_CODING_AUTO", "NAVI_DATA_CALC_CODING_AUTO");
+ define("NAVI_DATA_CALC_RECODING", "NAVI_DATA_CALC_RECODING");
+
+ define("NAVI_DATA_IMPORT", "NAVI_DATA_IMPORT");
+ define("NAVI_DATA_IMPORT_APPEND", "NAVI_DATA_IMPORT_APPEND");
+ define("NAVI_DATA_IMPORT_MERGE", "NAVI_DATA_IMPORT_MERGE");
+
+ define("NAVI_DATA_EXPORT", "NAVI_DATA_EXPORT");
+ define("NAVI_DATA_EXPORT_EXCEL", "NAVI_DATA_EXPORT_EXCEL");
+ define("NAVI_DATA_EXPORT_EXCEL_XLS", "NAVI_DATA_EXPORT_EXCEL_XLS");
+ define("NAVI_DATA_EXPORT_SAV", "NAVI_DATA_EXPORT_SAV");
+ define("NAVI_DATA_EXPORT_TXT", "NAVI_DATA_EXPORT_TXT");
+ define("NAVI_DATA_EXPORT_SPSS", "NAVI_DATA_EXPORT_SPSS");
# Dashboard - status - report
define("A_REPORTI", "reporti");
@@ -66,6 +94,7 @@
define("A_REMINDER_TRACKING", "reminder_tracking");
define("A_REMINDER_TRACKING_RECNUM", "recnum");
define("A_REMINDER_TRACKING_VAR", "vars");
+ define("A_STATUS_ADVANCED", "status_advanced");
#urejanje
define("A_BRANCHING", "branching");
@@ -90,6 +119,7 @@
# objava
define('A_VABILA', 'vabila');
+ define('A_OTHER_INV', 'other_inv');
define('A_EMAIL', 'email');
define('A_INVITATIONS', 'invitations');
define('M_INVITATIONS_STATUS', 'inv_status');
@@ -105,6 +135,9 @@
# PANEL
define('A_PANEL', 'panel');
+ # EMAIL ACCESS
+ define('A_EMAIL_ACCESS', 'email_access');
+
# FIELDWORK (tablice, notebooki)
define('A_FIELDWORK', 'fieldwork');
@@ -165,10 +198,13 @@
define('M_COLLECT_DATA_PRINT', 'print');
define('M_COLLECT_DATA_CALCULATION', 'calculation');
define('M_COLLECT_DATA_CODING', 'coding');
+ define('M_COLLECT_DATA_CODING_AUTO', 'coding_auto');
define('M_COLLECT_DATA_RECODING', 'recoding');
define('M_COLLECT_DATA_RECODING_DASHBOARD', 'recoding_dashboard');
define('A_COLLECT_DATA_EXPORT', 'export');
define('A_COLLECT_DATA_EXPORT_ALL', 'export_PDF');
+ define('M_COLLECT_DATA_APPEND', 'append');
+ define('M_COLLECT_DATA_MERGE', 'merge');
define('M_EXPORT_EXCEL', 'excel');
define('M_EXPORT_EXCEL_XLS', 'excel_xls');
define('M_EXPORT_SPSS', 'spss');
@@ -187,6 +223,7 @@
define('A_SOCIAL_NETWORK', 'social_network');
define('A_SLIDESHOW', 'slideshow');
define('A_ADVANCED_PARADATA', 'advanced_paradata');
+ define('A_ADVANCED_TIMESTAMPS', 'advanced_timestamps');
define('A_JSON_SURVEY_EXPORT', 'json_survey_export');
@@ -212,13 +249,12 @@
define('A_FORMA', 'forma'); # urejanje ankete - manjkajoče vrednosti
define('A_METADATA', 'metadata'); # urejanje ankete - prikaz metapodatkov
define('A_MOBILESETTINGS', 'mobile_settings'); # urejanje ankete - nastavitve prikaza pri mobitelih
+ define('A_TABLESETTINGS', 'table_settings'); # urejanje ankete - nastavitve prikaza tabel
define('A_PRIKAZ', 'prikaz'); # prikaz podatkov in analiz
define('A_MAILING', 'advanced_email'); # nastavitve email strežnika
define('A_SKUPINE', 'skupine'); # skupine
define('A_EXPORTSETTINGS', 'export_settings'); # nastavitve pdf/rtf izvozov
define('A_GDPR', 'gdpr_settings'); # GDPR nastavitve posamezne ankete
- define('A_LANGUAGE_TECHNOLOGY', 'language_technology'); # skupine
- define('A_LANGUAGE_TECHNOLOGY_OLD', 'language_technology_old'); # skupine
##### NAVIGACIJA ####
@@ -258,9 +294,9 @@
# - time insered (unix) (7)
# - record_number (8)
define('USER_ID_FIELD', '$1');
- define('RELEVANCE_FIELD', '$2');
- define('EMAIL_FIELD', '$3');
- define('STATUS_FIELD', '$4');
+ define('STATUS_FIELD', '$2');
+ define('RELEVANCE_FIELD', '$3');
+ define('EMAIL_FIELD', '$4');
define('LURKER_FIELD', '$5');
define('TIME_FIELD', '$6');
define('MOD_REC_FIELD', '$7');
diff --git a/admin/survey/export/class.ExportController.php b/admin/survey/export/class.ExportController.php
index 9cffefd..e3318e8 100644
--- a/admin/survey/export/class.ExportController.php
+++ b/admin/survey/export/class.ExportController.php
@@ -136,7 +136,7 @@ class ExportController{
case 'html':
// Ustvarimo latex dokument
$document = new LatexDocument($this->anketa);
- $document->createDocument($export_type['export_type'], $export_type['export_subtype'], $export_format, $_GET['sprID']);
+ $document->createDocument($export_type['export_type'], $export_type['export_subtype'], $export_format, (isset($_GET['sprID'])?$_GET['sprID']:null));
break;
case 'xml':
@@ -292,7 +292,7 @@ class ExportController{
// Nastavimo tip izvoza
private function getExportType(){
global $site_path, $global_user_id, $admin_type, $lang;
-
+ if(isset($_GET['a']))
switch ( $_GET['a'] ) {
case A_REPORT_VPRASALNIK_PDF:
case A_REPORT_VPRASALNIK_RTF:
@@ -349,6 +349,7 @@ class ExportController{
$export_subtype = 'activity';
break;
}
+ if(isset($_GET['m']))
switch ( $_GET['m'] ) {
// Kakšna je razlika med tema dvema izvozoma??
@@ -477,7 +478,7 @@ class ExportController{
// Nastavimo format izvoza
private function getExportFormat(){
global $site_path, $global_user_id, $admin_type, $lang;
-
+ if(isset($_GET['a']))
switch ( $_GET['a'] ) {
case A_REPORT_VPRASALNIK_PDF:
case A_REPORT_PDF_RESULTS:
@@ -507,6 +508,7 @@ class ExportController{
$export_format = 'xml';
break;
}
+ if(isset($_GET['m']))
switch ( $_GET['m'] ) {
// Kakšna je razlika med tema dvema izvozoma??
diff --git a/admin/survey/export/export_definitions.php b/admin/survey/export/export_definitions.php
index 252cab7..10b304e 100644
--- a/admin/survey/export/export_definitions.php
+++ b/admin/survey/export/export_definitions.php
@@ -1,19 +1,19 @@
<?php
# ali je OS windows ali linux
-define('IS_WINDOWS', (DIRECTORY_SEPARATOR === '\\') ? TRUE : FALSE);
-define('IS_LINUX', (DIRECTORY_SEPARATOR === '\\') ? FALSE : TRUE);
+if (!defined('IS_WINDOWS')) define('IS_WINDOWS', (DIRECTORY_SEPARATOR === '\\') ? TRUE : FALSE);
+if (!defined('IS_LINUX')) define('IS_LINUX', (DIRECTORY_SEPARATOR === '\\') ? FALSE : TRUE);
-define("M_ANALIZA_DESCRIPTOR", "descriptor");
+/* define("M_ANALIZA_DESCRIPTOR", "descriptor");
define("M_ANALIZA_FREQUENCY", "frequency");
define("M_ANALIZA_CROSSTAB", "crosstabs");
define("M_ANALIZA_STATISTICS", "statistics");
-define("M_ANALIZA_SUMS", "sums");
+define("M_ANALIZA_SUMS", "sums"); */
/*PDF*/
-define("A_REPORT_VPRASALNIK_PDF", "vprasalnik_pdf");
+/* define("A_REPORT_VPRASALNIK_PDF", "vprasalnik_pdf");
define("A_REPORT_PDF_RESULTS","pdf_results");
define("A_REPORT_PDF_COMMENT","pdf_comment");
@@ -36,14 +36,14 @@ define("M_REPORT_PDF_TEAMMETER","pdf_teammeter");
define("M_REPORT_PDF_MFDPS","pdf_mfpds");
define("M_REPORT_PDF_HEATMAP_IMAGE","heatmap_image_pdf");
-define("M_REPORT_HIERARHIJA_PDF_IZPIS", "hierarhija_pdf_izpis");
+define("M_REPORT_HIERARHIJA_PDF_IZPIS", "hierarhija_pdf_izpis"); */
-define("A_GDPR_PDF_INDIVIDUAL", "pdf_gdpr_individual");
-define("A_GDPR_PDF_ACTIVITY", "pdf_gdpr_activity");
+if (!defined('A_GDPR_PDF_INDIVIDUAL')) define("A_GDPR_PDF_INDIVIDUAL", "pdf_gdpr_individual");
+if (!defined('A_GDPR_PDF_ACTIVITY')) define("A_GDPR_PDF_ACTIVITY", "pdf_gdpr_activity");
/*RTF*/
-define("A_REPORT_VPRASALNIK_RTF", "vprasalnik_rtf");
+/* define("A_REPORT_VPRASALNIK_RTF", "vprasalnik_rtf");
define("A_REPORT_RTF_RESULTS", "rtf_results");
define("A_REPORT_RTF_COMMENT", "rtf_comment");
@@ -59,14 +59,14 @@ define("M_REPORT_ANALIZA_RTF_CHARTS", "charts_rtf");
define("M_REPORT_ANALIZA_RTF_CREPORT", "creport_rtf");
define("A_REPORT_RTF_LIST", "list_rtf");
-define("M_REPORT_ANALIZA_RTF_HEATMAP_IMAGE","heatmap_image_rtf");
+define("M_REPORT_ANALIZA_RTF_HEATMAP_IMAGE","heatmap_image_rtf"); */
-define("A_GDPR_RTF_INDIVIDUAL", "rtf_gdpr_individual");
-define("A_GDPR_RTF_ACTIVITY", "rtf_gdpr_activity");
+if (!defined('A_GDPR_RTF_INDIVIDUAL')) define("A_GDPR_RTF_INDIVIDUAL", "rtf_gdpr_individual");
+if (!defined('A_GDPR_RTF_ACTIVITY')) define("A_GDPR_RTF_ACTIVITY", "rtf_gdpr_activity");
/*XLS*/
-define("M_REPORT_ANALIZA_XLS_STAT", "statistics_xls");
+/* define("M_REPORT_ANALIZA_XLS_STAT", "statistics_xls");
define("M_REPORT_ANALIZA_XLS_FREKVENCA", "frequency_xls");
define("M_REPORT_ANALIZA_XLS_CROSSTAB_IZPIS", "crosstabs_izpis_xls");
define("M_REPORT_ANALIZA_XLS_MULTICROSSTAB_IZPIS", "multicrosstabs_izpis_xls");
@@ -79,19 +79,18 @@ define("A_REPORT_XLS_LIST", "list_xls");
define("A_REPORT_XLS_USABLE", "usable_xls");
define("A_REPORT_XLS_SPEEDER", "speeder_xls");
define("A_REPORT_XLS_TEXT_ANALYSIS", "text_analysis_xls");
-define("A_REPORT_CSV_TEXT_ANALYSIS", "text_analysis_csv");
-define("A_LANGUAGE_TECHNOLOGY_XLS", "lt_excel");
+define("A_REPORT_CSV_TEXT_ANALYSIS", "text_analysis_csv"); */
/*PPT*/
-define("M_REPORT_ANALIZA_PPT_CHARTS", "charts_ppt");
-define("M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE", "heatmap_image_ppt");
+/* define("M_REPORT_ANALIZA_PPT_CHARTS", "charts_ppt");
+define("M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE", "heatmap_image_ppt"); */
/*IMAGE*/
-define("M_REPORT_ANALIZA_HEATMAP_IMAGE", "heatmap_image");
+//define("M_REPORT_ANALIZA_HEATMAP_IMAGE", "heatmap_image");
/*XML*/
-define("A_REPORT_VPRASALNIK_XML", "vprasalnik_xml");
+if (!defined('A_REPORT_VPRASALNIK_XML')) define("A_REPORT_VPRASALNIK_XML", "vprasalnik_xml");
?> \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaBreak.php b/admin/survey/export/latexclasses/Analize/AnalizaBreak.php
index 3317de4..86064ab 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaBreak.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaBreak.php
@@ -2,41 +2,41 @@
global $site_path;
- include_once('../../function.php');
- include_once('../survey/definition.php');
+/* include_once('../../function.php');
+ include_once('../survey/definition.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
/** Class za generacijo latex
@@ -346,7 +346,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -359,14 +359,14 @@ class AnalizaBreak extends LatexAnalysisElement {
// PRVA VRSTICA
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
- //$prvaVrstica[] = $this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')');
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
+ $prvaVrstica[] = LatexDocument::encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
+ //$prvaVrstica[] = LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')');
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
if($this->export_format == 'pdf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
}elseif($this->export_format == 'rtf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
}
@@ -380,19 +380,19 @@ class AnalizaBreak extends LatexAnalysisElement {
if ($tip != 1 && $tip != 3) {
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
- $text = $this->encodeText($variable['naslov'].' ('.$variable['variable'].')');
+ $text = LatexDocument::encodeText($variable['naslov'].' ('.$variable['variable'].')');
$drugaVrstica[]=$text;
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
}
}
}
else if (count($spremenljivka['options']) < 15) {
//echo "options :".count($spremenljivka['options'])."</br>";
foreach ($spremenljivka['options'] AS $okey => $option) {
- //$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($option.' ('.$okey.')'), 1, 'C', 0, 0, 0 ,0, true);
- $text = $this->encodeText($option.' ('.$okey.')');
+ //$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($option.' ('.$okey.')'), 1, 'C', 0, 0, 0 ,0, true);
+ $text = LatexDocument::encodeText($option.' ('.$okey.')');
$drugaVrstica[]=$text;
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
}
//$this->pdf->MultiCell($singleWidth, $height, 'povprečje', 1, 'C', 0, 1, 0 ,0, true);
}
@@ -413,16 +413,16 @@ class AnalizaBreak extends LatexAnalysisElement {
// VRSTICE S PODATKI
foreach ($frequencys AS $fkey => $fkeyFrequency) {
$podatkiVrstica = array();
- $podatkiVrstica[]=$this->encodeText($forSpremenljivka['options'][$fkey]); //naslov horizontalne vrstice
+ $podatkiVrstica[]=LatexDocument::encodeText($forSpremenljivka['options'][$fkey]); //naslov horizontalne vrstice
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
if ($variable['other'] != 1) {
$sequence = $variable['sequence'];
if (($tip == 1 || $tip == 3) && count($spremenljivka['options']) < 15) {
foreach ($spremenljivka['options'] AS $okey => $option) {
- //$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']), 1, 'C', 0, 0, 0 ,0, true);
- $podatkiVrstica[]=$this->encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']);
- //echo "podatkiVrstica 1 :".$this->encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt'])."</br>";
+ //$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']), 1, 'C', 0, 0, 0 ,0, true);
+ $podatkiVrstica[]=LatexDocument::encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']);
+ //echo "podatkiVrstica 1 :".LatexDocument::encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt'])."</br>";
}
}
$podatkiVrstica[]=$this->formatNumber($means[$fkey][$sequence],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
@@ -435,7 +435,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Izpis vrstic tabele - konec ##################
/*zakljucek latex tabele*/
- $tabela .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
//echo "tabela :".$tabela."</br>";
}elseif($presirokaTabela == 1){ //ce tabela je presiroka
@@ -477,7 +477,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -490,11 +490,11 @@ class AnalizaBreak extends LatexAnalysisElement {
// PRVA VRSTICA
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
+ $prvaVrstica[] = LatexDocument::encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
if($this->export_format == 'pdf'){
- $prvaVrstica[] = '\multicolumn{'.($steviloPodstolpcev-1).'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
+ $prvaVrstica[] = '\multicolumn{'.($steviloPodstolpcev-1).'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).')').'}';
}elseif($this->export_format == 'rtf'){
- $prvaVrstica[] = '\multicolumn{'.($steviloPodstolpcev-1).'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.($steviloPodstolpcev-1).'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
}
// DRUGA IN TRETJA VRSTICA
@@ -508,10 +508,10 @@ class AnalizaBreak extends LatexAnalysisElement {
if ($tip != 1 && $tip != 3) {
for($s=$indeksPodatkov; $s<($steviloPodstolpcev-1+$indeksPodatkovOld); $s++){
$grid = $spremenljivka['grids'][$s];
- $text = $this->encodeText($grid['variables'][0]['naslov'].' ('.$grid['variables'][0]['variable'].')');
+ $text = LatexDocument::encodeText($grid['variables'][0]['naslov'].' ('.$grid['variables'][0]['variable'].')');
//echo "grid podatek: ".$text."</br>";
$drugaVrstica[] = $text;
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
$indeksPodatkov = $s;
}
$indeksPodatkov = $indeksPodatkov + 1;
@@ -521,10 +521,10 @@ class AnalizaBreak extends LatexAnalysisElement {
//echo "options :".count($spremenljivka['options'])."</br>";
//echo "znotraj </br>";
foreach ($spremenljivka['options'] AS $okey => $option) {
- //$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($option.' ('.$okey.')'), 1, 'C', 0, 0, 0 ,0, true);
- $text = $this->encodeText($option.' ('.$okey.')');
+ //$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($option.' ('.$okey.')'), 1, 'C', 0, 0, 0 ,0, true);
+ $text = LatexDocument::encodeText($option.' ('.$okey.')');
$drugaVrstica[]=$text;
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
}
//$this->pdf->MultiCell($singleWidth, $height, 'povprečje', 1, 'C', 0, 1, 0 ,0, true);
}
@@ -552,8 +552,8 @@ class AnalizaBreak extends LatexAnalysisElement {
for($fkey=1; $fkey<=($steviloVrsticSPodatki); $fkey++){ //izpis vsake vrstice posebej
//echo "indeks freq: ".$fkey."</br>";
$podatkiVrstica = array();
- $podatkiVrstica[] = $this->encodeText($forSpremenljivka['options'][$fkey]); //naslov horizontalne vrstice
- //echo "debug text: ".$this->encodeText($forSpremenljivka['options'][$fkey])."</br>";
+ $podatkiVrstica[] = LatexDocument::encodeText($forSpremenljivka['options'][$fkey]); //naslov horizontalne vrstice
+ //echo "debug text: ".LatexDocument::encodeText($forSpremenljivka['options'][$fkey])."</br>";
//foreach ($spremenljivka['grids'] AS $gkey => $grid) {
for($s1=$indeksPodatkov1; $s1<($steviloPodstolpcev-1+$indeksPodatkovOld1); $s1++){
@@ -564,8 +564,8 @@ class AnalizaBreak extends LatexAnalysisElement {
//echo "sdvsdv </br>";
/* if (($tip == 1 || $tip == 3) && count($spremenljivka['options']) < 15) {
foreach ($spremenljivka['options'] AS $okey => $option) {
- $podatkiVrstica[] = $this->encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']);
- //echo "podatki Vrstica 1 :".$this->encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt'])."</br>";
+ $podatkiVrstica[] = LatexDocument::encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt']);
+ //echo "podatki Vrstica 1 :".LatexDocument::encodeText($frequencys[$fkey][$sequence]['valid'][$okey]['cnt'])."</br>";
}
} */
$podatkiVrstica[] = $this->formatNumber($means[$fkey][$sequence],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
@@ -582,7 +582,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Izpis vrstic tabele - konec ##################
/*zakljucek latex tabele*/
- $tabela .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
//echo "tabela :".$tabela."</br>";
@@ -601,12 +601,12 @@ class AnalizaBreak extends LatexAnalysisElement {
foreach ($frequencys AS $fkey => $frequency) {
/* $this->pdf->setFont('','B','6');
- $this->pdf->MultiCell(200, 5, $this->encodeText('Tabela za: ('.$forSpremenljivka['variable'].') = '.$forSpremenljivka['options'][$fkey]), 0, 'L', 0, 1, 0 ,0, true); */
+ $this->pdf->MultiCell(200, 5, LatexDocument::encodeText('Tabela za: ('.$forSpremenljivka['variable'].') = '.$forSpremenljivka['options'][$fkey]), 0, 'L', 0, 1, 0 ,0, true); */
$text = $spremenljivka['naslov'].' ('.$spremenljivka['variable'].')';
$height = $this->getCellHeight($text, 260);
- //$this->pdf->MultiCell(260, $height, $this->encodeText($text), 1, 'C', 0, 1, 0 ,0, true);
+ //$this->pdf->MultiCell(260, $height, LatexDocument::encodeText($text), 1, 'C', 0, 1, 0 ,0, true);
//$this->pdf->setFont('','','6');
@@ -617,7 +617,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//$this->pdf->MultiCell(60, $height, '', 1, 'C', 0, 0, 0 ,0, true);
foreach ($spremenljivka['grids'][0]['variables'] AS $vkey => $variable) {
- //$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($variable['naslov']), 1, 'C', 0, 0, 0 ,0, true);
+ //$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($variable['naslov']), 1, 'C', 0, 0, 0 ,0, true);
}
//$this->pdf->MultiCell(1, $height,'', 0, 'C', 0, 1, 0 ,0, true);
@@ -626,7 +626,7 @@ class AnalizaBreak extends LatexAnalysisElement {
$text = '('.$grid['variable'].') '.$grid['naslov'];
/* $height = $this->getCellHeight($text, 60);
- $this->pdf->MultiCell(60, $height, $this->encodeText($text), 1, 'C', 0, 0, 0 ,0, true); */
+ $this->pdf->MultiCell(60, $height, LatexDocument::encodeText($text), 1, 'C', 0, 0, 0 ,0, true); */
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
@@ -680,7 +680,8 @@ class AnalizaBreak extends LatexAnalysisElement {
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
// Izrisujemo samo 1 graf v creportu
- if($_GET['m'] == 'analysis_creport'){
+ $tmp_m = isset($_GET['m'])?$_GET['m'] : '';
+ if($tmp_m == 'analysis_creport'){
if($spremenljivka['break_sub_table']['key'] == $gkey){
//$this->displayChart($forSpr,$frequencys,$spremenljivka,$type = 'number');
@@ -713,25 +714,25 @@ class AnalizaBreak extends LatexAnalysisElement {
$drugaVrstica[] = '';
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
- $drugaVrstica[] = $this->encodeText($variable['naslov'].' ('.$variable['variable'].')');
+ $drugaVrstica[] = LatexDocument::encodeText($variable['naslov'].' ('.$variable['variable'].')');
}
}
// PRVA VRSTICA
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
- //$prvaVrstica[] = $this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')'); //\multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}
+ $prvaVrstica[] = LatexDocument::encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
+ //$prvaVrstica[] = LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')'); //\multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}
$steviloPodstolpcev = count($drugaVrstica) - 1;
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
//$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}
//{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}
- //{'.$this->encodeText($this->snippet($spremenljivka['naslov']).'('.$this->snippet($spremenljivka['variable']).')').'}';
+ //{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).'('.$this->snippet($spremenljivka['variable']).')').'}';
if($this->export_format == 'pdf'){
$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}
{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}
- {'.$this->encodeText($this->snippet($spremenljivka['naslov']).'('.$this->snippet($spremenljivka['variable']).')').'}';
+ {'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).'('.$this->snippet($spremenljivka['variable']).')').'}';
}elseif($this->export_format == 'rtf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].')').'}';
}
// TRETJA VRSTICA
@@ -739,7 +740,7 @@ class AnalizaBreak extends LatexAnalysisElement {
$tretjaVrstica[] = '';
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
}
}
@@ -766,7 +767,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -794,7 +795,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//VRSTICE S PODATKI - priprava in izpis podatkov
foreach ($frequencys AS $fkey => $fkeyFrequency) {
$podatkiVrstica = array();
- $podatkiVrstica[]=$this->encodeText($forSpremenljivka['options'][$fkey]);
+ $podatkiVrstica[]=LatexDocument::encodeText($forSpremenljivka['options'][$fkey]);
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
@@ -813,7 +814,7 @@ class AnalizaBreak extends LatexAnalysisElement {
// dodamo še skupno sumo in povprečje
$sumaVrstica = array();
- $sumaVrstica[]=$this->encodeText($lang['srv_analiza_crosstab_skupaj']);
+ $sumaVrstica[]=LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']);
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
foreach ($grid['variables'] AS $vkey => $variable) {
@@ -832,7 +833,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Izpis vrstic tabele - konec
/*zakljucek latex tabele*/
- $tabela .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
}
@@ -845,7 +846,7 @@ class AnalizaBreak extends LatexAnalysisElement {
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
//izpis opisnega besedila pred tabelo
- $tabela .= $this->encodeText('Tabela za: '.$spremenljivka['naslov'].' ('.$spremenljivka['variable'].') = '.$grid['naslov'].' ('.$grid['variable'].')');
+ $tabela .= LatexDocument::encodeText('Tabela za: '.$spremenljivka['naslov'].' ('.$spremenljivka['variable'].') = '.$grid['naslov'].' ('.$grid['variable'].')');
//$tabela .= $this->texNewLine;
//Priprava parametrov za tabelo
@@ -867,7 +868,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -880,20 +881,20 @@ class AnalizaBreak extends LatexAnalysisElement {
// PRVA VRSTICA
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ $prvaVrstica[] = LatexDocument::encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
if($this->export_format == 'pdf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
}elseif($this->export_format == 'rtf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
}
// DRUGA VRSTICA
$drugaVrstica = array();
$drugaVrstica[]='';
foreach ($grid['variables'] AS $vkey => $variable) {
- $text = $this->encodeText($variable['naslov'].' ('.$variable['variable'].')');
+ $text = LatexDocument::encodeText($variable['naslov'].' ('.$variable['variable'].')');
$drugaVrstica[]=$text;
}
@@ -901,7 +902,7 @@ class AnalizaBreak extends LatexAnalysisElement {
$tretjaVrstica = array();
$tretjaVrstica[] = '';
foreach ($grid['variables'] AS $vkey => $variable) {
- $tretjaVrstica[] = $this->encodeText($lang['srv_analiza_crosstab_average']);
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_crosstab_average']);
}
//Izpis vrstic tabele
@@ -920,9 +921,9 @@ class AnalizaBreak extends LatexAnalysisElement {
// VRSTICE Z VSEBINO
foreach ($forSpremenljivka['options'] AS $okey => $option) {
$podatkiVrstica = array();
- $podatkiVrstica[]=$this->encodeText($option);
+ $podatkiVrstica[]=LatexDocument::encodeText($option);
//$height = $this->getCellHeight($option, 60);
- //$this->pdf->MultiCell(60, $height, $this->encodeText($option), 1, 'C', 0, 0, 0 ,0, true);
+ //$this->pdf->MultiCell(60, $height, LatexDocument::encodeText($option), 1, 'C', 0, 0, 0 ,0, true);
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
@@ -939,7 +940,7 @@ class AnalizaBreak extends LatexAnalysisElement {
// dodamo še skupno sumo in povprečje
$sumaVrstica = array();
- $sumaVrstica[]=$this->encodeText($lang['srv_analiza_crosstab_skupaj']);
+ $sumaVrstica[]=LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']);
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
@@ -955,7 +956,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Izpis vrstic tabele - konec
/*zakljucek latex tabele*/
- $tabela .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
}
}
@@ -996,7 +997,7 @@ class AnalizaBreak extends LatexAnalysisElement {
foreach ($spremenljivka['grids'] AS $gkey => $grid) {
//izpis opisnega besedila pred tabelo
- $tabela .= $this->encodeText('Tabela za: '.$spremenljivka['naslov'].' ('.$spremenljivka['variable'].') = '.$grid['naslov'].' ('.$grid['variable'].')');
+ $tabela .= LatexDocument::encodeText('Tabela za: '.$spremenljivka['naslov'].' ('.$spremenljivka['variable'].') = '.$grid['naslov'].' ('.$grid['variable'].')');
//Priprava parametrov za tabelo
$steviloStolpcevParameterTabular = $steviloPodstolpcev+1;
@@ -1019,7 +1020,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1033,20 +1034,20 @@ class AnalizaBreak extends LatexAnalysisElement {
// PRVA VRSTICA
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
- //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$this->snippet($grid['naslov']).' ('.$this->snippet($grid['variable']).')').'}';
+ $prvaVrstica[] = LatexDocument::encodeText($forSpremenljivka['naslov'].' ('.$forSpremenljivka['variable'].')');
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ //$prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$this->snippet($grid['naslov']).' ('.$this->snippet($grid['variable']).')').'}';
if($this->export_format == 'pdf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$this->snippet($grid['naslov']).' ('.$this->snippet($grid['variable']).')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{>{\hsize=\dimexpr '.($steviloPodstolpcev).'\hsize + '.($steviloPodstolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($this->snippet($spremenljivka['naslov']).' ('.$this->snippet($spremenljivka['variable']).') - '.$this->snippet($grid['naslov']).' ('.$this->snippet($grid['variable']).')').'}';
}elseif($this->export_format == 'rtf'){
- $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.$this->encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
+ $prvaVrstica[] = '\multicolumn{'.$steviloPodstolpcev.'}{c|}{'.LatexDocument::encodeText($spremenljivka['naslov'].' ('.$spremenljivka['variable'].') - '.$grid['naslov'].' ('.$grid['variable'].')').'}';
}
// DRUGA VRSTICA
$drugaVrstica = array();
$drugaVrstica[]='';
foreach ($grid['variables'] AS $vkey => $variable) {
- $text = $this->encodeText($variable['naslov'].' ('.$variable['variable'].')');
+ $text = LatexDocument::encodeText($variable['naslov'].' ('.$variable['variable'].')');
$drugaVrstica[]=$text;
}
@@ -1062,10 +1063,10 @@ class AnalizaBreak extends LatexAnalysisElement {
// VRSTICE Z VSEBINO
foreach ($forSpremenljivka['options'] AS $okey => $option) {
$podatkiVrstica = array();
- $podatkiVrstica[]=$this->encodeText($option);
+ $podatkiVrstica[]=LatexDocument::encodeText($option);
// Izrisemo vrstico
- //$this->pdf->MultiCell(60, $height, $this->encodeText($option), 1, 'C', 0, 0, 0 ,0, true);
+ //$this->pdf->MultiCell(60, $height, LatexDocument::encodeText($option), 1, 'C', 0, 0, 0 ,0, true);
foreach ($grid['variables'] AS $vkey => $variable) {
$sequence = $variable['sequence'];
if (count($texts[$okey][$sequence]) > 0) {
@@ -1075,8 +1076,8 @@ class AnalizaBreak extends LatexAnalysisElement {
$text .= $units['text']."; ";
}
$text = substr($text,0,-2);
- $podatkiVrstica[]=$this->encodeText($text);
- //$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($text), 1, 'C', 0, 0, 0 ,0, true);
+ $podatkiVrstica[]=LatexDocument::encodeText($text);
+ //$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($text), 1, 'C', 0, 0, 0 ,0, true);
}
else{
//$this->pdf->MultiCell($singleWidth, $height, '', 1, 'C', 0, 0, 0 ,0, true);
@@ -1088,7 +1089,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//Izpis vrstic tabele - konec
/*zakljucek latex tabele*/
- $tabela .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
}
return $tabela;
@@ -1125,7 +1126,7 @@ class AnalizaBreak extends LatexAnalysisElement {
if ($spremenljivka['tip'] != 6) {
$text .= ' ('.$grid['variable'].')';
}
- $tabela .= $this->encodeText($text);
+ $tabela .= LatexDocument::encodeText($text);
}
$seq2 = $grid['variables'][0]['sequence'];
@@ -1205,10 +1206,10 @@ class AnalizaBreak extends LatexAnalysisElement {
}
}
- $boldedTitle = $this->returnBold($this->encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
$boldedSubTitle = '';
if($spremenljivka['tip'] == 20 || $spremenljivka['tip'] == 16 || $spremenljivka['tip'] == 6){
- $boldedSubTitle = $this->returnBold($this->encodeText($subtitle)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedSubTitle = $this->returnBold(LatexDocument::encodeText($subtitle)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
}
if($imgName){
@@ -1217,7 +1218,7 @@ class AnalizaBreak extends LatexAnalysisElement {
$texImageOnly = $lang['srv_export_no_chart'];
}
- $texImage .= $this->returnCentered($boldedTitle.$boldedSubTitle.$texImageOnly); //vrni sredinsko poravnana naslov in slika
+ $texImage = $this->returnCentered($boldedTitle.$boldedSubTitle.$texImageOnly); //vrni sredinsko poravnana naslov in slika
return $texImage;
}
@@ -1246,7 +1247,7 @@ class AnalizaBreak extends LatexAnalysisElement {
//izrisemo frekvence
if($frekvence == 1){
- $this->pdf->MultiCell($width, $height, $this->encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
+ $this->pdf->MultiCell($width, $height, LatexDocument::encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
$i++;
}
@@ -1256,10 +1257,10 @@ class AnalizaBreak extends LatexAnalysisElement {
$singleWidth = round($width/$numColumnPercent);
for($j=1; $j<$numColumnPercent; $j++){
- $this->pdf->MultiCell($singleWidth, $height, $this->encodeText($data[$i]), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($data[$i]), 1, 'C', 0, 0, 0 ,0, true);
$i++;
}
- $this->pdf->MultiCell($width - (($numColumnPercent-1)*$singleWidth), $height, $this->encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
+ $this->pdf->MultiCell($width - (($numColumnPercent-1)*$singleWidth), $height, LatexDocument::encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
$i++;
}
@@ -1269,10 +1270,10 @@ class AnalizaBreak extends LatexAnalysisElement {
$singleWidth = round($width/$numColumnResidual);
for($j=1; $j<$numColumnResidual; $j++){
- $this->pdf->MultiCell($singleWidth, $height, $this->encodeText($data[$i]), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($data[$i]), 1, 'C', 0, 0, 0 ,0, true);
$i++;
}
- $this->pdf->MultiCell($width - (($numColumnResidual-1)*$singleWidth), $height, $this->encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
+ $this->pdf->MultiCell($width - (($numColumnResidual-1)*$singleWidth), $height, LatexDocument::encodeText($data[$i]), 1, 'C', 0, 1, 0 ,0, true);
$i++;
}
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaCReport.php b/admin/survey/export/latexclasses/Analize/AnalizaCReport.php
index 03291c7..df423ec 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaCReport.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaCReport.php
@@ -7,14 +7,14 @@
/* include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -150,6 +150,7 @@ class AnalizaCReport extends LatexAnalysisElement{
// Izpisemo sumarnik element
function displaySum($element=null){
+ global $global_user_id;
$sumLatex = '';
$spid = $element['spr1'];
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
@@ -256,6 +257,7 @@ class AnalizaCReport extends LatexAnalysisElement{
// Izpisemo frekvence element
function displayFreq($element=null){
+ global $global_user_id;
$freqLatex = '';
$spid = $element['spr1'];
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
@@ -329,7 +331,7 @@ class AnalizaCReport extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -346,15 +348,15 @@ class AnalizaCReport extends LatexAnalysisElement{
/*priprava polja z naslovi stolpcev*/
$text = array();
- $text[] = $this->encodeText($lang['srv_analiza_opisne_variable']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_variable_text1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_variable']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_variable_text1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_m']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_povprecje1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_min']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_max']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_m']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_min']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_max']);
/*priprava polja z naslovi stolpcev - konec*/
$descLatex .= $this->tableRow($text);
@@ -369,7 +371,7 @@ class AnalizaCReport extends LatexAnalysisElement{
$show_enota = false;
/* preverimo ali imamo samo eno variablo in če iammo enoto*/
- if ((int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
+ if (isset($spremenljivka['enota'])&&(int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
$show_enota = true;
}
@@ -405,7 +407,7 @@ class AnalizaCReport extends LatexAnalysisElement{
? false
: true;
if ($do_show) {
- $descLatex .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,$_css);
+ $descLatex .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable);
}
$grid['new_grid'] = false;
@@ -415,7 +417,7 @@ class AnalizaCReport extends LatexAnalysisElement{
} // end if $spremenljivka['tip'] != 'm'
/*zakljucek latex tabele*/
- $descLatex .= ($this->export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $descLatex .= ($this->export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
//echo "</br> Tex celotne tabele: ".$descLatex."</br>";
return $descLatex;
@@ -880,7 +882,7 @@ class AnalizaCReport extends LatexAnalysisElement{
function displayText($text=''){
global $lang;
$texTitle = '';
- $texTitle .= $this->encodeText($text).$this->texNewLine;
+ $texTitle .= LatexDocument::encodeText($text).$this->texNewLine;
return $texTitle;
}
@@ -961,7 +963,7 @@ class AnalizaCReport extends LatexAnalysisElement{
# za multicheckboxe popravimo naslov, na podtip
$sub_q1 = null;
$sub_q2 = null;
- if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
+ /* if ($spr1['tip'] == '6' || $spr1['tip'] == '7' || $spr1['tip'] == '16' || $spr1['tip'] == '17' || $spr1['tip'] == '18' || $spr1['tip'] == '19' || $spr1['tip'] == '20' || $spr1['tip'] == '21' ) {
foreach ($spr1['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_first['seq']) {
@@ -977,12 +979,12 @@ class AnalizaCReport extends LatexAnalysisElement{
}
}
}
- }
+ } */
if ($sub_q1 == null) {
$sub_q1 .= strip_tags($spr1['naslov']);
$sub_q1 .= ($show_variables_values == true ? '&nbsp;('.strip_tags($spr1['variable']).')' : '');
}
- if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
+ /* if ($spr2['tip'] == '6' || $spr2['tip'] == '7' || $spr2['tip'] == '16' || $spr2['tip'] == '17' || $spr2['tip'] == '18' || $spr2['tip'] == '19' || $spr2['tip'] == '20' || $spr2['tip'] == '21') {
foreach ($spr2['grids'] AS $grid) {
foreach ($grid['variables'] AS $variable) {
if ($variable['sequence'] == $v_second['seq']) {
@@ -998,7 +1000,7 @@ class AnalizaCReport extends LatexAnalysisElement{
}
}
}
- }
+ } */
if ($sub_q2 == null) {
$sub_q2 .= strip_tags($spr2['naslov']);
$sub_q2 .= ($show_variables_values == true ? ' ('.strip_tags($spr2['variable']).')' : '');
@@ -1077,7 +1079,7 @@ class AnalizaCReport extends LatexAnalysisElement{
$variables = $breakClass->getVariableList(2);
foreach ($variables as $variable) {
- if($breakData1[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData1[0] == $variable['sequence']){
$label1 = ( (int)$variable['sub'] == 0 ? '' : ( (int)$variable['sub'] == 1 ? '&nbsp;&nbsp;' : '&nbsp;&nbsp;&nbsp;&nbsp;' )) . $variable['variableNaslov'];
$label1 = (strlen($label1) > 60) ? substr($label1, 0, 57).'...' : $label1;
@@ -1089,7 +1091,7 @@ class AnalizaCReport extends LatexAnalysisElement{
$variables = $this->getBreakDependentVariableList($breakClass);
foreach ($variables as $variable) {
- if($breakData2[0] == $variable['sequence']){
+ if(isset($variable['sequence'])&&$breakData2[0] == $variable['sequence']){
//$label2 = $variable['variableNaslov'];
$label2 = (strlen($variable['variableNaslov']) > 60) ? substr($variable['variableNaslov'], 0, 57).'...' : $variable['variableNaslov'];
@@ -1105,7 +1107,7 @@ class AnalizaCReport extends LatexAnalysisElement{
//TODO: Potrebno je v LATEX določiti ali je stran obrnjena landscape
$width = $this->landscapeTest() ? 270 : 165;
- $boldedTitle = $this->returnBold($this->encodeText($this->encodeText($title . $subtitle)));
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText(LatexDocument::encodeText($title . $subtitle)));
$texTitle .= $this->returnCentered($boldedTitle);
return $texTitle;
@@ -1150,13 +1152,13 @@ class AnalizaCReport extends LatexAnalysisElement{
# zloopamo skozi header in dodamo variable (potrebujemo posamezne sekvence)
foreach ($breakClass->_HEADERS AS $skey => $spremenljivka) {
- $tip = $spremenljivka['tip'];
+ $tip = isset($spremenljivka['tip'])?$spremenljivka['tip']:null;
$_dropdown_condition = (is_numeric($tip) && $tip != 5 && $tip != 8 && $tip != 9) ? true : false;
if ($_dropdown_condition) {
$cnt_all = (int)$spremenljivka['cnt_all'];
- if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22)) || ($tip == 6 && $spremenljivka['enota'] == 2) ) {
+ if ( $cnt_all == '1' || in_array($tip, array(1,2,3,4,7,17,18,21,22)) || ($tip == 6 && isset($spremenljivka['enota']) && $spremenljivka['enota'] == 2) ) {
# pri tipu radio ali select dodamo tisto variablo ki ni polje "drugo"
if ($tip == 1 || $tip == 3 ) {
@@ -1223,7 +1225,7 @@ class AnalizaCReport extends LatexAnalysisElement{
# imamo več gridov - tabele
foreach($spremenljivka['grids'] AS $gid => $grid) {
$sub = 0;
- if ($grid['variable'] != '') {
+ if (isset($grid['variable']) && $grid['variable'] != '') {
$sub++;
$variablesList[] = array(
'tip'=>$tip,
@@ -1277,7 +1279,7 @@ class AnalizaCReport extends LatexAnalysisElement{
$texTitle = '';
if($text != ''){
- $texTitle .= $this->encodeText($text).$this->texNewLine;
+ $texTitle .= LatexDocument::encodeText($text).$this->texNewLine;
}
return $texTitle;
}
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaCharts.php b/admin/survey/export/latexclasses/Analize/AnalizaCharts.php
index bd632fa..a7a03ee 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaCharts.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaCharts.php
@@ -9,14 +9,14 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -129,7 +129,7 @@ class AnalizaCharts extends LatexAnalysisElement {
$this->pdf->Output($fileName, 'I');
}
- function displayCharts(){
+ function displayCharts($exportClass){
global $site_path;
global $lang;
@@ -147,7 +147,7 @@ class AnalizaCharts extends LatexAnalysisElement {
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
// preverjamo ali je meta
- if (($spremenljivka['tip'] != 'm'
+ if ((isset($spremenljivka['tip'])&&$spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
&& (!isset($_spid) || (isset($_spid) && $_spid == $spid))
&& ($this->spremenljivka == $spid || $this->spremenljivka == null) ) {
@@ -156,7 +156,7 @@ class AnalizaCharts extends LatexAnalysisElement {
if ($vars_count == 0 || ($vars_count > 0 && isset(SurveyAnalysis::$_FILTRED_VARIABLES[$spid]) ) ) {
// Ce imamo radio tip in manj kot 5 variabel po defaultu prikazemo piechart
- $vars = count($spremenljivka['options']);
+ $vars = (isset($spremenljivka['options']) && is_countable($spremenljivka['options'])) ? count($spremenljivka['options']) : 0;
$type = 0;
if( ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3) && $vars < 5 )
$type = 2;
@@ -180,7 +180,7 @@ class AnalizaCharts extends LatexAnalysisElement {
//izpis naslova/podnaslova tabele
$stevilcenje = ($exportClass->numbering == 1 ? $spremenljivka['variable'].' - ' : '');
$title = $stevilcenje . $spremenljivka['naslov'];
- $boldedTitle = $this->returnBold($this->encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
if($spremenljivka['tip'] == 2){
$boldedSubTitle = $lang['srv_info_checkbox'];
}
@@ -219,7 +219,7 @@ class AnalizaCharts extends LatexAnalysisElement {
//izpis naslova/podnaslova tabele
$stevilcenje = ($exportClass->numbering == 1 ? $spremenljivka['variable'].' - ' : '');
$title = $stevilcenje . $spremenljivka['naslov'];
- $boldedTitle = $this->returnBold($this->encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
if($spremenljivka['tip'] == 2){
$boldedSubTitle = $lang['srv_info_checkbox'];
}
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php b/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php
index 7defd7f..fda4492 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaCrosstab.php
@@ -2,43 +2,43 @@
global $site_path;
- include_once('../../function.php');
+ /*include_once('../../function.php');
include_once('../survey/definition.php');
-/* include_once('../exportclases/class.pdfIzvozAnalizaFrekvenca.php');
+ include_once('../exportclases/class.pdfIzvozAnalizaFrekvenca.php');
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
/**
* @desc Class za generacijo izvoza v Latex
@@ -71,6 +71,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
protected $spaceBetweenTables = ' \newline \vspace*{1 cm} \newline';
public $crosstabClass = null; //crosstab class
+ protected $crosstabVars = null;
protected $sessionData;
protected $counter;
@@ -170,7 +171,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$this->pdf->SetSubject('An Order');
// set default header data
- $this->pdf->SetHeaderData(null, null, "www.1ka.si", $this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
+ $this->pdf->SetHeaderData(null, null, "www.1ka.si", LatexDocument::encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
//set auto page breaks
$this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
@@ -213,8 +214,8 @@ class AnalizaCrosstab extends LatexAnalysisElement{
/* print_r($crosstabClass);
echo "</br>"; */
- $grid1 = $spr1['grids'][$v_first['grd']];
- $grid2 = $spr2['grids'][$v_second['grd']];
+ $grid1 = isset($spr1['grids'][$v_first['grd']])?$spr1['grids'][$v_first['grd']]:array();
+ $grid2 = isset($spr2['grids'][$v_second['grd']])?$spr2['grids'][$v_second['grd']]:array();
#število vrstic in število kolon
$cols = count($crosstabs['options1']);
@@ -317,13 +318,9 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$this->crosstabClass->crossChkSR +
$this->crosstabClass->crossChkAR;
- //echo "steviloVmesnihVrstic: ".$steviloVmesnihVrstic."</br>";
- //echo "steviloVmesnihStolpcevPodvrstica2: ".$steviloVmesnihStolpcevPodvrstica2."</br>";
- //echo "steviloVmesnihStolpcevPodvrstica3: ".$steviloVmesnihStolpcevPodvrstica3."</br>";
$podVrstice = 0;
- //if($steviloVmesnihStolpcevPodvrstica2||$steviloVmesnihStolpcevPodvrstica3){
if($steviloVmesnihStolpcevPodvrstica2&&$steviloVmesnihStolpcevPodvrstica3){
//echo "1 </br>";
if($steviloVmesnihStolpcevPodvrstica2 >= $steviloVmesnihStolpcevPodvrstica3){
@@ -462,18 +459,15 @@ class AnalizaCrosstab extends LatexAnalysisElement{
for($i = 0; $i < $steviloStolpcevParameterTabular; $i++){
//ce je prvi stolpec
if($i == 0){
- //$parameterTabular .= ($export_format == 'pdf' ? 'P|' : 'l|');
$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'l|');
}else{
- //$parameterTabular .= ($export_format == 'pdf' ? ' >{\hsize='.$sirinaOstalihStolpcev.'\hsize \centering\arraybackslash}X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
- //$parameterTabular .= ($export_format == 'pdf' ? 'c|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/ //pred spremembo je bilo to
}
}
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -494,10 +488,9 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$steviloArrayrulewidth = ($steviloMultiCol1-1);
if($export_format=='pdf'){
- //$tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
- $tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}c|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
+ $tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}c|}{".LatexDocument::encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
}elseif($export_format=='rtf'){
- $tabela .= " & \multicolumn{".$steviloMultiCol1."}{c|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
+ $tabela .= " & \multicolumn{".$steviloMultiCol1."}{c|}{".LatexDocument::encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
}
###########
@@ -524,9 +517,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//prva vrstica - konec ##############################################################################
// druga vrstica ####################################################################################
- $tabela .= $this->encodeText($sub_q2); //prvi stolpec 2. vrstice
- //echo "testiram, kjer ssem: ".$this->encodeText($sub_q2)."</br>";
- //echo "testiram, kjer ssem: ".$steviloTabColSep."</br>";
+ $tabela .= LatexDocument::encodeText($sub_q2); //prvi stolpec 2. vrstice
$drugaVrstica = array();
if (count($crosstabs['options1']) > 0 ) { //stolpci (izkljucno) med prvim in zadnjim
foreach ($crosstabs['options1'] as $ckey1 =>$crossVariabla) {
@@ -536,21 +527,25 @@ class AnalizaCrosstab extends LatexAnalysisElement{
if ($crossVariabla['type'] != 't') {
$text .= ' ( '.$ckey1.' )';
}
- $tabela .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, $this->encodeText($text));
+ $tabela .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, LatexDocument::encodeText($text));
}
}
- //echo "test: ".$podVrstice."</br>";
if($podVrstice){ //ce je potrebno multicol prikazovanje
//spremenljivke za pravilno sirino
$colNum = $steviloVmesnihStolpcevPodvrstic;
- $colNum2 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica2; //stevilo podstolpcev za 2. podvrstico
- $colNum3 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica3; //stevilo podstolpcev za 3. podvrstico
+ if($steviloVmesnihStolpcevPodvrstica2){
+ $colNum2 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica2; //stevilo podstolpcev za 2. podvrstico
+ }
+ if($steviloVmesnihStolpcevPodvrstica3){
+ $colNum3 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica3; //stevilo podstolpcev za 3. podvrstico
+ }
+
//spremenljivke za pravilno sirino - konec
- $tabela .= $this->MultiColCellLatex($colNum, $this->encodeText($lang['srv_analiza_crosstab_skupaj'])); //izpis naslova zadnjega stolpca 2. vestice
+ $tabela .= $this->MultiColCellLatex($colNum, LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])); //izpis naslova zadnjega stolpca 2. vestice
}else{
$tabela .= " & ";
- $tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj']); //izpis naslova zadnjega stolpca 2. vestice
+ $tabela .= LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']); //izpis naslova zadnjega stolpca 2. vestice
}
$tabela .= $this->texNewLine; /*nova vrstica*/
@@ -560,15 +555,20 @@ class AnalizaCrosstab extends LatexAnalysisElement{
// druga vrstica - konec #########################################################################
+ $tabela1 = ''; //za belezenje 1. vrstice s frekvencami
+ $tabela2 = ''; //za belezenje 2. vrstice z odstotki
+ $tabela3 = ''; //za belezenje 3. vrstice z residuali
+ $colNum = isset($colNum)?$colNum:0;
//izpis vmesnih vrstic tabele ####################################################################
if (count($crosstabs['options2']) > 0) {
+
//POSAMEZNA VMESNA VRSTICA
foreach ($crosstabs['options2'] as $ckey2 =>$crossVariabla2) {
//priprava besedila za prvo celico 1. stolpca
$text = $crossVariabla2['naslov'];
if($export_format != 'xls'){
- $text = $this->snippet($this->encodeText($text), 25);
+ $text = $this->snippet(LatexDocument::encodeText($text), 25);
}
if ($crossVariabla2['type'] !== 't') {
$text .= ' ('.$ckey2.')';
@@ -577,7 +577,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//izpis prve celice 1. stolpca
if($export_format != 'xls'){
- $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, $this->encodeText($text));
+ $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, LatexDocument::encodeText($text));
}else{
$tabela .= $text;
}
@@ -585,45 +585,54 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$tabela1 = ''; //za belezenje 1. vrstice s frekvencami
$tabela2 = ''; //za belezenje 2. vrstice z odstotki
$tabela3 = ''; //za belezenje 3. vrstice z residuali
-
+ $colNum = isset($colNum)?$colNum:0;
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
-
if ($this->crosstabClass->crossChk0) {
# frekvence crostabov
- $crossChk0 = ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ //$crossChk0 = ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ if(array_key_exists($ckey1, $crosstabs_value)&&array_key_exists($ckey2, $crosstabs_value)){
+ $crossChk0 = ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ }else{
+ $crossChk0 = 0;
+ }
$tabela1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum);
}
if ($this->crosstabClass->crossChk1) {
#procent vrstica
- $crossChk1 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaVrstica'][$ckey2], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
- $tabela2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2);
+ if(array_key_exists($ckey1, $crosstabs_value)){
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaVrstica'][$ckey2], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ $tabela2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2);
+ }
+
}
if ($this->crosstabClass->crossChk2) {
#procent stolpec
- $crossChk2 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaStolpec'][$ckey1], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaStolpec'][$ckey1], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2);
}
if ($this->crosstabClass->crossChk3) {
#procent skupni
- $crossChk3 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ if(array_key_exists($ckey1, $crosstabs_value)){
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ }
$tabela2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2);
}
# residuali
if ($this->crosstabClass->crossChkEC) {
- $crossChkEC = $this->encodeText($this->formatNumber($crosstabs['exC'][$ckey1][$ckey2], 3, ''));
+ $crossChkEC = LatexDocument::encodeText($this->formatNumber($crosstabs['exC'][$ckey1][$ckey2], 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkEC, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkRE) {
- $crossChkRE = $this->encodeText($this->formatNumber($crosstabs['res'][$ckey1][$ckey2], 3, ''));
+ $crossChkRE = LatexDocument::encodeText($this->formatNumber($crosstabs['res'][$ckey1][$ckey2], 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkRE, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkSR) {
- $crossChkSR = $this->encodeText($this->formatNumber($crosstabs['stR'][$ckey1][$ckey2], 3, ''));
+ $crossChkSR = LatexDocument::encodeText($this->formatNumber($crosstabs['stR'][$ckey1][$ckey2], 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkSR, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkAR) {
- $crossChkAR = $this->encodeText($this->formatNumber($crosstabs['adR'][$ckey1][$ckey2], 3, ''));
+ $crossChkAR = LatexDocument::encodeText($this->formatNumber($crosstabs['adR'][$ckey1][$ckey2], 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkAR, $podVrstice, $colNum3);
}
}
@@ -631,21 +640,25 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//se zadnji stolpec - vedno risemo
if ($this->crosstabClass->crossChk0) {
# suma po vrsticah
- $crossChk0 = (int)$crosstabs['sumaVrstica'][$ckey2];
+ if(array_key_exists($ckey2, $crosstabs['sumaVrstica'])){
+ $crossChk0 = (int)$crosstabs['sumaVrstica'][$ckey2];
+ }else{
+ $crossChk0 = null;
+ }
$tabela1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
# suma po vrsticah v procentih
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk3) {
- $crossChk3 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
}
@@ -691,35 +704,40 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//izpis celice v prvem stolpcu
if($export_format != 'xls'){
- $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, $this->encodeText($lang['srv_analiza_crosstab_skupaj']), $tabela2, $tabela3, $cols);
+ $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']), $tabela2, $tabela3, $cols);
}else{
- $tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj']);
+ $tabela .= LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']);
}
//izpis celice v prvem stolpcu - konec
+ $tabelaZadnja1 = ''; //belezi kodo za 1. podvrstico zadnje vrstice
+ $tabelaZadnja2 = ''; //belezi kodo za 2. podvrstico zadnje vrstice
if (count($crosstabs['options1']) > 0){
- $tabelaZadnja1 = ''; //belezi kodo za 1. podvrstico zadnje vrstice
- $tabelaZadnja2 = ''; //belezi kodo za 2. podvrstico zadnje vrstice
+
foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
# prikazujemo eno od treh možnosti
if ($this->crosstabClass->crossChk0) {
# suma po stolpcih
- $crossChk0 = (int)$crosstabs['sumaStolpec'][$ckey1];
+ if(array_key_exists($ckey1, $crosstabs['sumaStolpec'])){
+ $crossChk0 = (int)$crosstabs['sumaStolpec'][$ckey1];
+ }else{
+ $crossChk0 = null;
+ }
$tabelaZadnja1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
# suma po stolpcih v procentih
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk3){
- $crossChk3 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
}
@@ -734,15 +752,15 @@ class AnalizaCrosstab extends LatexAnalysisElement{
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
# suma po stolpcih v procentih
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk3) {
- $crossChk3 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
}
@@ -851,7 +869,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -887,16 +905,16 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$steviloTabColSep = ($steviloMultiCol1-1)*2;
$steviloArrayrulewidth = ($steviloMultiCol1-1);
if($export_format=='pdf'){
- //$tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
- $tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}c|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
+ //$tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{".LatexDocument::encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
+ $tabela .= " & \multicolumn{".$steviloMultiCol1."}{>{\hsize=\dimexpr".$steviloMultiCol1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}c|}{".LatexDocument::encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
}elseif($export_format=='rtf'){
- $tabela .= " & \multicolumn{".$steviloMultiCol1."}{c|}{".$this->encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
+ $tabela .= " & \multicolumn{".$steviloMultiCol1."}{c|}{".LatexDocument::encodeText($sub_q1)."} "; //prvi (prazen) in stolpec z besedilom
}
}else{
- $tabela .= " & ".$this->encodeText($sub_q1)." ";
+ $tabela .= " & ".LatexDocument::encodeText($sub_q1)." ";
}
###########
- //echo "testiram, kjer ssem: ".$this->encodeText($sub_q1)."</br>";
+ //echo "testiram, kjer ssem: ".LatexDocument::encodeText($sub_q1)."</br>";
if($cols[$t]!=0 &&($t == ($steviloTabel-1))){
if($steviloVmesnihStolpcevPodvrstic==1){
@@ -923,14 +941,11 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//echo "$tabela</br>";
// druga vrstica ####################################################################################
- $tabela .= $this->encodeText($sub_q2); //prvi stolpec 2. vrstice
- //echo "testiram, kjer ssem: ".$this->encodeText($sub_q2)."</br>";
- //echo "testiram, kjer ssem: ".$steviloTabColSep."</br>";
+ $tabela .= LatexDocument::encodeText($sub_q2); //prvi stolpec 2. vrstice
$drugaVrstica = array();
//echo count($crosstabsOptions1All[$t])."</br>";
- //if (count($crosstabs['options1']) > 0 ) { //stolpci (izkljucno) med prvim in zadnjim
- if (count($crosstabsOptions1All[$t]) > 0 ) { //stolpci (izkljucno) med prvim in zadnjim
+ if (isset($crosstabsOptions1All[$t])&&count($crosstabsOptions1All[$t]) > 0 ) { //stolpci (izkljucno) med prvim in zadnjim
foreach ($crosstabsOptions1All[$t] as $ckey1 =>$crossVariabla) {
#ime variable
$text = $crossVariabla['naslov'];
@@ -938,9 +953,9 @@ class AnalizaCrosstab extends LatexAnalysisElement{
if ($crossVariabla['type'] != 't') {
$text .= ' ( '.$ckey1.' )';
}
- $tabela .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, $this->encodeText($text));
+ $tabela .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, LatexDocument::encodeText($text));
//echo "steviloVmesnihStolpcevPodvrstic $t: $steviloVmesnihStolpcevPodvrstic</br>";
- //echo $this->encodeText($text)."</br>";
+ //echo LatexDocument::encodeText($text)."</br>";
}
if($niSodo && $t == ($steviloTabel-2) && $reziduali){ //ce ni sodo in je predzadnja podtabela in so reziduali, dodaj se vse potrebno za prazen stolpec
//if($niSodo && $t == ($steviloTabel-2)){ //ce ni sodo in je predzadnja podtabela, dodaj se vse potrebno za prazen stolpec
@@ -953,18 +968,22 @@ class AnalizaCrosstab extends LatexAnalysisElement{
if($podVrstice){ //ce je potrebno multicol prikazovanje
//spremenljivke za pravilno sirino
$colNum = $steviloVmesnihStolpcevPodvrstic;
- $colNum2 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica2; //stevilo podstolpcev za 2. podvrstico
- $colNum3 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica3; //stevilo podstolpcev za 3. podvrstico
+ if($steviloVmesnihStolpcevPodvrstica2){
+ $colNum2 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica2; //stevilo podstolpcev za 2. podvrstico
+ }
+ if($steviloVmesnihStolpcevPodvrstica3){
+ $colNum3 = $steviloVmesnihStolpcevPodvrstic/$steviloVmesnihStolpcevPodvrstica3; //stevilo podstolpcev za 3. podvrstico
+ }
//spremenljivke za pravilno sirino - konec
if($t == ($steviloTabel-1)){ //ce je zadnji stolpec v podtabeli
- $tabela .= $this->MultiColCellLatex($colNum, $this->encodeText($lang['srv_analiza_crosstab_skupaj'])); //izpis naslova zadnjega stolpca 2. vrstice
+ $tabela .= $this->MultiColCellLatex($colNum, LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])); //izpis naslova zadnjega stolpca 2. vrstice
}
//}else{
}elseif(($t == ($steviloTabel-1))){ //ce je zadnja podtabela
//}elseif(($t == ($steviloTabel-1)) && $niSodo == 1){
$tabela .= " & ";
- $tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj']); //izpis naslova zadnjega stolpca 2. vrstice
+ $tabela .= LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']); //izpis naslova zadnjega stolpca 2. vrstice
}
$tabela .= $this->texNewLine; /*nova vrstica*/
@@ -985,7 +1004,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//priprava besedila za prvo celico 1. stolpca
$text = $crossVariabla2['naslov'];
if($export_format != 'xls'){
- $text = $this->snippet($this->encodeText($text), 25);
+ $text = $this->snippet(LatexDocument::encodeText($text), 25);
}
if ($crossVariabla2['type'] !== 't') {
$text .= ' ('.$ckey2.')';
@@ -994,7 +1013,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//izpis prve celice 1. stolpca
if($export_format != 'xls'){
- $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, $this->encodeText($text));
+ $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, LatexDocument::encodeText($text));
}else{
$tabela .= $text;
}
@@ -1004,11 +1023,12 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$tabela3 = ''; //za belezenje 3. vrstice z residuali
//foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
+ if(isset($crosstabsOptions1All[$t]))
foreach ($crosstabsOptions1All[$t] as $ckey1 => $crossVariabla1) {
if ($this->crosstabClass->crossChk0) {
# frekvence crostabov
- $crossChk0 = ((int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
+ $crossChk0 = (isset($crosstabs_value[$ckey1][$ckey2])&&(int)$crosstabs_value[$ckey1][$ckey2] > 0) ? $crosstabs_value[$ckey1][$ckey2] : 0;
$tabela1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum);
/* if($niSodo && $t == ($steviloTabel-2)){ //ce ni sodo in je predzadnja podtabela, dodaj se vse potrebno za prazen stolpec
$tabela1 .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, '');
@@ -1017,35 +1037,35 @@ class AnalizaCrosstab extends LatexAnalysisElement{
}
if ($this->crosstabClass->crossChk1) {
#procent vrstica
- $crossChk1 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaVrstica'][$ckey2], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage((isset($crosstabs['sumaVrstica'][$ckey2])?$crosstabs['sumaVrstica'][$ckey2]:null), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:null)), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2);
}
if ($this->crosstabClass->crossChk2) {
#procent stolpec
- $crossChk2 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaStolpec'][$ckey1], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage((isset($crosstabs['sumaStolpec'][$ckey1])?$crosstabs['sumaStolpec'][$ckey1]:null), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:null)), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2);
}
if ($this->crosstabClass->crossChk3) {
#procent skupni
- $crossChk3 = $this->encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs_value[$ckey1][$ckey2]), 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber($this->crosstabClass->getCrossTabPercentage((isset($crosstabs['sumaSkupna'])?$crosstabs['sumaSkupna']:null), (isset($crosstabs_value[$ckey1][$ckey2])?$crosstabs_value[$ckey1][$ckey2]:null)), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2);
}
# residuali
if ($this->crosstabClass->crossChkEC) {
- $crossChkEC = $this->encodeText($this->formatNumber($crosstabs['exC'][$ckey1][$ckey2], 3, ''));
+ $crossChkEC = LatexDocument::encodeText($this->formatNumber((isset($crosstabs['exC'][$ckey1][$ckey2])?$crosstabs['exC'][$ckey1][$ckey2]:null), 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkEC, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkRE) {
- $crossChkRE = $this->encodeText($this->formatNumber($crosstabs['res'][$ckey1][$ckey2], 3, ''));
+ $crossChkRE = LatexDocument::encodeText($this->formatNumber((isset($crosstabs['res'][$ckey1][$ckey2])?$crosstabs['res'][$ckey1][$ckey2]:null), 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkRE, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkSR) {
- $crossChkSR = $this->encodeText($this->formatNumber($crosstabs['stR'][$ckey1][$ckey2], 3, ''));
+ $crossChkSR = LatexDocument::encodeText($this->formatNumber((isset($crosstabs['stR'][$ckey1][$ckey2])?$crosstabs['stR'][$ckey1][$ckey2]:null), 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkSR, $podVrstice, $colNum3);
}
if ($this->crosstabClass->crossChkAR) {
- $crossChkAR = $this->encodeText($this->formatNumber($crosstabs['adR'][$ckey1][$ckey2], 3, ''));
+ $crossChkAR = LatexDocument::encodeText($this->formatNumber((isset($crosstabs['adR'][$ckey1][$ckey2])?$crosstabs['adR'][$ckey1][$ckey2]:null), 3, ''));
$tabela3 .= $this->DisplayLatexCells($crossChkAR, $podVrstice, $colNum3);
}
//echo "tabela 3: $tabela3 </br>";
@@ -1056,7 +1076,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$tabela1 .= $this->MultiColCellLatex($steviloVmesnihStolpcevPodvrstic, '');
}
- if(!$crosstabsOptions1All[$t]){
+ /* if(!$crosstabsOptions1All[$t]){
if($tabela1){
//$tabela1 .= ' & ';
}
@@ -1066,34 +1086,40 @@ class AnalizaCrosstab extends LatexAnalysisElement{
if($tabela3!=''){
//$tabela3 .= ' & ';
}
- }
+ } */
//se zadnji stolpec - risemo, ko je zadnja tabela
if($t == ($steviloTabel-1)){
if ($this->crosstabClass->crossChk0) {
# suma po vrsticah
- $crossChk0 = (int)$crosstabs['sumaVrstica'][$ckey2];
- if(!$crosstabsOptions1All[$t]){
+ //$crossChk0 = isset($crosstabs['sumaVrstica'][$ckey2])?(int)$crosstabs['sumaVrstica'][$ckey2]:0;
+ if(isset($crosstabs['sumaVrstica'][$ckey2])&&array_key_exists($ckey2, $crosstabs['sumaVrstica'])){
+ $crossChk0 = (int)$crosstabs['sumaVrstica'][$ckey2];
+ }else{
+ $crossChk0 = 0;
+ }
+
+ if(!isset($crosstabsOptions1All[$t])){
$tabela1 .= ' & ';
}
$tabela1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum, $steviloVmesnihStolpcevPodvrstic, $niSodo);
}
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
- if(!$crosstabsOptions1All[$t]){
+ if(!isset($crosstabsOptions1All[$t])){
$tabela2 .= ' & ';
}
# suma po vrsticah v procentih
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic, $niSodo);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crossChk0 / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic, $niSodo);
}
if ($this->crosstabClass->crossChk3) {
- $crossChk3 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaVrstica'][$ckey2] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crossChk0 / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabela2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic, $niSodo);
}
}
@@ -1160,9 +1186,9 @@ class AnalizaCrosstab extends LatexAnalysisElement{
//izpis celice v prvem stolpcu
if($export_format != 'xls'){
- $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, $this->encodeText($lang['srv_analiza_crosstab_skupaj']), $tabela2, $tabela3, $cols[$t]);
+ $tabela .= $this->MultiRowCellLatex($steviloVmesnihVrstic, LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']), $tabela2, $tabela3, $cols[$t]);
}else{
- $tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj']);
+ $tabela .= LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj']);
}
//izpis celice v prvem stolpcu - konec
@@ -1172,26 +1198,32 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$tabelaZadnja1 = ''; //belezi kodo za 1. podvrstico zadnje vrstice
$tabelaZadnja2 = ''; //belezi kodo za 2. podvrstico zadnje vrstice
//foreach ($crosstabs['options1'] as $ckey1 => $crossVariabla1) {
+ if(isset($crosstabsOptions1All[$t]))
foreach ($crosstabsOptions1All[$t] as $ckey1 => $crossVariabla1) {
# prikazujemo eno od treh možnosti
if ($this->crosstabClass->crossChk0) {
# suma po stolpcih
- $crossChk0 = (int)$crosstabs['sumaStolpec'][$ckey1];
+ //$crossChk0 = (int)$crosstabs['sumaStolpec'][$ckey1];
+ if(isset($crosstabs['sumaStolpec'][$ckey1])&&array_key_exists($ckey1, $crosstabs['sumaStolpec'])){
+ $crossChk0 = (int)$crosstabs['sumaStolpec'][$ckey1];
+ }else{
+ $crossChk0 = 0;
+ }
$tabelaZadnja1 .= $this->DisplayLatexCells($crossChk0, $podVrstice, $colNum, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
# suma po stolpcih v procentih
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk3){
- $crossChk3 = $this->encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber( ($crosstabs['sumaSkupna'] > 0 ? (100 * $crosstabs['sumaStolpec'][$ckey1] / $crosstabs['sumaSkupna']) : 0), 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
}
@@ -1212,19 +1244,19 @@ class AnalizaCrosstab extends LatexAnalysisElement{
}
if ($this->crosstabClass->crossChk1 || $this->crosstabClass->crossChk2 || $this->crosstabClass->crossChk3) {
# suma po stolpcih v procentih
- if (!$crosstabsOptions1All[$t]){
+ if (!isset($crosstabsOptions1All[$t])){
$tabelaZadnja2 .= " & ";
}
if ($this->crosstabClass->crossChk1) {
- $crossChk1 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk1 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk1, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk2) {
- $crossChk2 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk2 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk2, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
if ($this->crosstabClass->crossChk3) {
- $crossChk3 = $this->encodeText($this->formatNumber(100, 2, '%'));
+ $crossChk3 = LatexDocument::encodeText($this->formatNumber(100, 2, '%'));
$tabelaZadnja2 .= $this->DisplayLatexCells($crossChk3, $podVrstice, $colNum2, $steviloVmesnihStolpcevPodvrstic);
}
}
@@ -1264,7 +1296,7 @@ class AnalizaCrosstab extends LatexAnalysisElement{
// skupni sestevki po stolpcih - ZADNJA VRSTICA - konec #############################################################################
$stevec++;
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
}
}
}
@@ -1272,13 +1304,12 @@ class AnalizaCrosstab extends LatexAnalysisElement{
/*zakljucek latex tabele*/
if($presirokaTabela == 0){ //ce ni presiroka tabela
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
}
/*zaljucek latex tabele - konec */
- //echo "showChart: ".$this->sessionData['showChart']."</br>";
// Izris grafa (ce je vklopljena nastavitev)
- if($this->sessionData['showChart'] == '1' && $creport == false){
+ if((isset($this->sessionData['showChart'])?$this->sessionData['showChart']:0) == '1' && $creport == false){
$tabela .= $this->displayCrosstabChart();
}
}
@@ -1294,18 +1325,18 @@ class AnalizaCrosstab extends LatexAnalysisElement{
$chartID = implode('_', $this->crosstabClass->variabla1[0]).'_'.implode('_', $this->crosstabClass->variabla2[0]);
$chartID .= '_counter_'.$this->counter;
- $settings = $this->sessionData[$chartID];
- $imgName = $settings['name'];
+ $settings = isset($this->sessionData[$chartID])?$this->sessionData[$chartID]:array();
+ $imgName = isset($settings['name']) ? $settings['name'] : $chartID;
// Naslov posameznega grafa
- if($settings['type'] == 1 || $settings['type'] == 4){
+ /* if($settings['type'] == 1 || $settings['type'] == 4){
$title = $this->crosstabVars[0].'/'.$this->crosstabVars[1];
}
else{
$title = $this->crosstabVars[0];
- }
+ } */
- $boldedTitle = $this->returnBold($this->encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText(/* $title */)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
copy('pChart/Cache/'.$imgName,'pChart/Cache/'.$imgName.'.png');
$texImageOnly = " \\includegraphics[scale=0.75]{".$imgName."} "; //latex za sliko
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaDesc.php b/admin/survey/export/latexclasses/Analize/AnalizaDesc.php
index 8433e9b..b7c427b 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaDesc.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaDesc.php
@@ -8,14 +8,14 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if (!defined('ALLOW_HIDE_ZERRO_REGULAR')) define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if (!defined('ALLOW_HIDE_ZERRO_MISSING')) define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_AVERAGE')) define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_DEVIATION')) define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if (!defined('M_ANALIZA_DESCRIPTOR')) define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if (!defined('M_ANALIZA_FREQUENCY')) define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -163,7 +163,7 @@ class AnalizaDesc extends LatexAnalysisElement{
$this->pdf->SetSubject('An Order');
// set default header data
- $this->pdf->SetHeaderData(null, null, "www.1ka.si", $this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
+ $this->pdf->SetHeaderData(null, null, "www.1ka.si", LatexDocument::encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
//set auto page breaks
$this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
@@ -211,7 +211,7 @@ class AnalizaDesc extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -226,16 +226,16 @@ class AnalizaDesc extends LatexAnalysisElement{
/*priprava polja z naslovi stolpcev*/
$text = array();
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_variable']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_variable_text1']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_variable']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_variable_text1']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_m']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_num_units']).'}';
- //$text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_povprecje1']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_povprecje_odstotek1']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_odklon']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_min']).'}';
- $text[] = '\textbf{'.$this->encodeText($lang['srv_analiza_opisne_max']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_m']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_num_units']).'}';
+ //$text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje_odstotek1']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_min']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($lang['srv_analiza_opisne_max']).'}';
/*priprava polja z naslovi stolpcev - konec*/
$tabela .= $this->tableRow($text);
@@ -249,14 +249,14 @@ class AnalizaDesc extends LatexAnalysisElement{
/*izpis ostalih vrstic*/
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
/* preverjamo ali je meta*/
- if ($spremenljivka['tip'] != 'm'
+ if (isset($spremenljivka['tip'])?$spremenljivka['tip']:'' != 'm'
&& ( count(SurveyAnalysis::$_FILTRED_VARIABLES) == 0 || (count(SurveyAnalysis::$_FILTRED_VARIABLES) > 0 && isset(SurveyAnalysis::$_FILTRED_VARIABLES[$spid]) ))
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES)
&& ($this->spremenljivka == $spid || $this->spremenljivka == null) ) {
$show_enota = false;
/* preverimo ali imamo samo eno variablo in če iammo enoto*/
- if ((int)$spremenljivka['enota'] != 0 || $spremenljivka['cnt_all'] > 1 ) {
+ if ((int)(isset($spremenljivka['enota'])?$spremenljivka['enota']:0) != 0 || isset($spremenljivka['cnt_all'])?$spremenljivka['cnt_all']:0 > 1 ) {
$show_enota = true;
}
@@ -292,12 +292,11 @@ class AnalizaDesc extends LatexAnalysisElement{
if (count ($grid['variables']) > 0)
foreach ($grid['variables'] AS $vid => $variable ){
/* dodamo ostale vrstice*/
- $do_show = ($variable['other'] !=1 && ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3 || $spremenljivka['tip'] == 5 || $spremenljivka['tip'] == 8 ))
+ $do_show = (isset($variable['other'])?$variable['other']:0 !=1 && ($spremenljivka['tip'] == 1 || $spremenljivka['tip'] == 3 || $spremenljivka['tip'] == 5 || $spremenljivka['tip'] == 8 ))
? false
: true;
if ($do_show) {
- //self::displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,$_css);
- $tabela .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,$_css);
+ $tabela .= $this->displayDescriptivesVariablaRow($spremenljivka,$grid,$variable,isset($_css)?$_css:null);
}
$grid['new_grid'] = false;
@@ -310,9 +309,8 @@ class AnalizaDesc extends LatexAnalysisElement{
/*zakljucek latex tabele*/
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele - konec */
- //echo "</br> Tex celotne tabele: ".$tabela."</br>";
return $tabela;
}
}
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaFreq.php b/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
index 8945266..8926858 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaFreq.php
@@ -8,39 +8,39 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
- define ('MEJA_DOLZINA_VPRASANJA', 132);
+ if(!defined("MEJA_DOLZINA_VPRASANJA"))define ('MEJA_DOLZINA_VPRASANJA', 132);
/**
* @desc Class za generacijo izvoza v Latex
@@ -69,7 +69,6 @@ class AnalizaFreq extends LatexAnalysisElement{
protected $texBigSkip = '\bigskip';
protected $spaceBetweenTables = ' \newline \vspace*{1 cm} \newline';
-
/**
* @desc konstruktor
*/
@@ -169,7 +168,9 @@ class AnalizaFreq extends LatexAnalysisElement{
case 5:
# nagovor
//pdfIzvozAnalizaSums::sumNagovor($spid,'freq');
- $tabela .= $this->sumNagovor($spid,'freq');
+ //$tabela .= $this->sumNagovor($spid,'freq');
+ $analizaSums = new AnalizaSums;
+ $tabela .= $analizaSums->sumNagovor($spid,'freq');
//$tabela .= $this->spaceBetweenTables;
break;
}
@@ -212,7 +213,7 @@ class AnalizaFreq extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -228,14 +229,14 @@ class AnalizaFreq extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev+1).'\hsize + '.($steviloOstalihStolpcev+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
- if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev+1).'\hsize + '.($steviloOstalihStolpcev+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
+ if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloOstalihStolpcev."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -273,9 +274,9 @@ class AnalizaFreq extends LatexAnalysisElement{
$maxAnswer = (SurveyDataSettingProfiles :: getSetting('numOpenAnswers') > 0) ? SurveyDataSettingProfiles :: getSetting('numOpenAnswers') : 30;
$counter = 0;
$_kumulativa = 0;
- //SurveyAnalysis::$_FREQUENCYS[$_sequence]
- if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
- foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
+ $surveyAnalisysFreqValid = isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']:0;
+ if (is_countable($surveyAnalisysFreqValid) && count($surveyAnalisysFreqValid)> 0 ) {
+ foreach ($surveyAnalisysFreqValid AS $vkey => $vAnswer) {
if ($vAnswer['cnt'] > 0 /*&& $counter < $maxAnswer*/ || true) { # izpisujemo samo tiste ki nisno 0
if (in_array($spremenljivka['tip'],array(4,7,8,19,20,21))) { // text, number, datum, mtext, mnumber, text*
$options['isTextAnswer'] = true;
@@ -297,7 +298,7 @@ class AnalizaFreq extends LatexAnalysisElement{
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
$_Z_MV = !$this->hideEmpty;
if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $tex .= $this->encodeText($lang['srv_anl_missing1']);
+ $tex .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
@@ -319,7 +320,7 @@ class AnalizaFreq extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
# izpišemo še tekstovne odgovore za polja drugo
@@ -347,9 +348,9 @@ class AnalizaFreq extends LatexAnalysisElement{
$options[$_oKey] = $_option;
}
- $text[] = $this->encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
- $text[] = $this->encodeText($variable['naslov']);
+ $text[] = LatexDocument::encodeText($variable['naslov']);
$text[] = '';
$text[] = '';
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaMean.php b/admin/survey/export/latexclasses/Analize/AnalizaMean.php
index e2bceba..138afcc 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaMean.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaMean.php
@@ -7,14 +7,14 @@
/* include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if (!defined('ALLOW_HIDE_ZERRO_REGULAR')) define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if (!defined('ALLOW_HIDE_ZERRO_MISSING')) define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_AVERAGE')) define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_DEVIATION')) define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if (!defined('M_ANALIZA_DESCRIPTOR')) define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if (!defined('M_ANALIZA_FREQUENCY')) define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -125,11 +125,6 @@ class AnalizaMean extends LatexAnalysisElement{
$singleWidth = round( 180 / $cols / 2 );
// visina prve vrstice
-/* $firstHeight = 0;
- for ($i = 0; $i < $cols; $i++) {
- $label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']);
- $firstHeight = ($firstHeight > $this->getCellHeight($this->encodeText($label1), $singleWidth*2)) ? $firstHeight : $this->getCellHeight($this->encodeText($label1), $singleWidth*2);
- } */
//Priprava parametrov za tabelo
$steviloStolpcevParameterTabular = 3;
@@ -152,7 +147,7 @@ class AnalizaMean extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -167,11 +162,10 @@ class AnalizaMean extends LatexAnalysisElement{
//prva vrstica tabele
$label2 = $this->meansClass->getSpremenljivkaTitle($_means[0]['v2']);
- //$this->pdf->MultiCell(80, $firstHeight, $this->encodeText($label2), 'TLR', 'C', 0, 0, 0 ,0, true);
$prva = '';
for ($i = 0; $i < $cols; $i++) {
$label1 = $this->meansClass->getSpremenljivkaTitle($_means[$i]['v1']);
- //$this->pdf->MultiCell($singleWidth*2, $firstHeight, $this->encodeText($label1), 1, 'C', 0, 0, 0 ,0, true);
+ //$this->pdf->MultiCell($singleWidth*2, $firstHeight, LatexDocument::encodeText($label1), 1, 'C', 0, 0, 0 ,0, true);
$prva .= $label1.' ';
}
@@ -188,28 +182,18 @@ class AnalizaMean extends LatexAnalysisElement{
$steviloArrayrulewidth = ($steviloPodStolpcev1-1);
if($export_format=='pdf'){
- $tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
+ $tabela .= LatexDocument::encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}".$poravnava."|}{".LatexDocument::encodeText($prva)."} ".$this->texNewLine;
}elseif($export_format=='rtf'){
- $tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
+ $tabela .= LatexDocument::encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".LatexDocument::encodeText($prva)."} ".$this->texNewLine;
}
############
-
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{>{\hsize=\dimexpr".$steviloPodStolpcev1."\hsize+".$steviloPodStolpcev1."\\tabcolsep+\arrayrulewidth\\relax}".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{".$poravnava."|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2)." & \multicolumn{".$steviloPodStolpcev1."}{C|}{".$this->encodeText($prva)."} ".$this->texNewLine;
- //$tabela .= $this->encodeText($label2).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1).'\hsize + '.($steviloPodStolpcev1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($prva).'} '.$this->texNewLine;
-
+
//prva vrstica tabele - konec
//druga vrstica tabele
- //$this->pdf->MultiCell(80, 7, $this->encodeText(''), 'BLR', 'C', 0, 0, 0 ,0, true);
- //echo "stolpci: ".$cols."</br>";
- //echo "vrstice: ".$rows."</br>";
$druga = array();
$steviloPodStolpcev = $steviloPodStolpcev1 + 1;
- //$tabela .= "\\cline{2-".$steviloPodStolpcev."} & "; //horizontalna vrstica od 2 do zadnje celice
if($export_format != 'xls'){
$tabela .= "\\cline{2-".$steviloPodStolpcev."} "; //horizontalna vrstica od 2 do zadnje celice
}
@@ -219,12 +203,9 @@ class AnalizaMean extends LatexAnalysisElement{
$brezHline = $this->getBrezHline($export_format);
for ($i = 0; $i < $cols; $i++) {
- $druga[] = $this->encodeText($lang['srv_means_label']);
- $druga[] = $this->encodeText($lang['srv_means_label4']);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_means_label']), 1, 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($lang['srv_means_label4']), 1, 'C', 0, 0, 0 ,0, true);
+ $druga[] = LatexDocument::encodeText($lang['srv_means_label']);
+ $druga[] = LatexDocument::encodeText($lang['srv_means_label4']);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($druga, $brezHline)." ";
//druga vrstica tabele - konec
@@ -236,24 +217,19 @@ class AnalizaMean extends LatexAnalysisElement{
$variabla = $crossVariabla2['naslov'];
# če ni tekstovni odgovor dodamo key
if ($crossVariabla2['type'] !== 't' ) {
- if ($crossVariabla2['vr_id'] == null) {
+ if ((isset($crossVariabla2['vr_id'])?$crossVariabla2['vr_id']:null) == null) {
$variabla .= ' ( '.$ckey2.' )';
} else {
$variabla .= ' ( '.$crossVariabla2['vr_id'].' )';
}
}
- //$this->pdf->MultiCell(80, 7, $this->encodeText($variabla), 1, 'C', 0, 0, 0 ,0, true);
- $dataVrstica[] = $this->encodeText($variabla);
+ $dataVrstica[] = LatexDocument::encodeText($variabla);
# celice z vsebino
- for ($i = 0; $i < $cols; $i++) {
- //$dataVrstica[] = $this->encodeText($this->meansClass->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $dataVrstica[] = $this->encodeText(self::formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $dataVrstica[] = $this->encodeText((int)$_means[$i]['sumaVrstica'][$ckey2]);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['result'][$ckey2], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaVrstica'][$ckey2]), 1, 'C', 0, 0, 0 ,0, true);
+ for ($i = 0; $i < $cols; $i++) {
+ $dataVrstica[] = LatexDocument::encodeText(self::formatNumber(isset($_means[$i]['result'][$ckey2])?$_means[$i]['result'][$ckey2]:0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ $dataVrstica[] = LatexDocument::encodeText((int)isset($_means[$i]['sumaVrstica'][$ckey2])?$_means[$i]['sumaVrstica'][$ckey2]:0);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($dataVrstica, $brezHline)." ";
}
}
@@ -261,21 +237,19 @@ class AnalizaMean extends LatexAnalysisElement{
//SKUPAJ
$skupajVrstica = array();
- //$this->pdf->MultiCell(80, 7, $this->encodeText($lang['srv_means_label3']), 1, 'C', 0, 0, 0 ,0, true);
- $skupajVrstica[] = $this->encodeText($lang['srv_means_label3']);
+ $skupajVrstica[] = LatexDocument::encodeText($lang['srv_means_label3']);
for ($i = 0; $i < $cols; $i++) {
- //$skupajVrstica[] = $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- $skupajVrstica[] = $this->encodeText(self::formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
- $skupajVrstica[] = $this->encodeText((int)$_means[$i]['sumaSkupna']);
- //$this->pdf->MultiCell($singleWidth, 7, $this->encodeText((int)$_means[$i]['sumaSkupna']), 1, 'C', 0, 0, 0 ,0, true);
+ //$skupajVrstica[] = LatexDocument::encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ $skupajVrstica[] = LatexDocument::encodeText(self::formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL')));
+ //$this->pdf->MultiCell($singleWidth, 7, LatexDocument::encodeText($this->meansClass->formatNumber($_means[$i]['sumaMeans'], SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_RESIDUAL'))), 1, 'C', 0, 0, 0 ,0, true);
+ $skupajVrstica[] = LatexDocument::encodeText((int)$_means[$i]['sumaSkupna']);
+ //$this->pdf->MultiCell($singleWidth, 7, LatexDocument::encodeText((int)$_means[$i]['sumaSkupna']), 1, 'C', 0, 0, 0 ,0, true);
}
- //$this->pdf->MultiCell(1, 7, $this->encodeText(''), 0, 'C', 0, 1, 0 ,0, true);
$tabela .= $this->tableRow($skupajVrstica, $brezHline)." ";
//SKUPAJ - konec
//zaljucek latex tabele z obrobo za prvo tabelo
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
return $tabela;
}
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php
index 02f6eb9..ce2126a 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaMultiCrosstab.php
@@ -7,14 +7,14 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php');
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if (!defined('ALLOW_HIDE_ZERRO_REGULAR')) define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if (!defined('ALLOW_HIDE_ZERRO_MISSING')) define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_AVERAGE')) define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_DEVIATION')) define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if (!defined('M_ANALIZA_DESCRIPTOR')) define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if (!defined('M_ANALIZA_FREQUENCY')) define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -84,12 +84,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
global $global_user_id;
// preverimo ali imamo stevilko ankete
- //if ( is_numeric($anketa) ){
if ( is_numeric($anketa['id']) ){
- //$this->anketa['id'] = $anketa;
$this->anketa = $anketa;
- // create new PDF document
- //$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
else{
$this->pi['msg'] = "Anketa ni izbrana!";
@@ -142,14 +138,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$this->multiCrosstabClass->getSelectedVars();
// Izpisemo naslov tabele
- //echo "naslov tabele: ".$this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title'])."</br>";
- $tabela .= '\textbf{'.$this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']).'}'.$this->texBigSkip.$this->texNewLine;
- //echo $tabela."</br>";
-/* $this->pdf->setFont('','B','10');
- $this->pdf->MultiCell(150, 5, $this->encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']), 0, 'L', 0, 1, 0 ,0, true);
- $this->pdf->ln(5);
- $this->pdf->setFont('','','6'); */
-
+ $tabela .= '\textbf{'.LatexDocument::encodeText($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['title']).'}'.$this->texBigSkip.$this->texNewLine;
+
// TABELA
@@ -198,17 +188,16 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
$cntVerVars++;
}
- //echo "cntVerVars: ".$cntVerVars."</br>";
+ $tretjaVrsticaVert = array();
+ $cetrtaVrsticaVert = array();
if($this->multiCrosstabClass->colSpan == 0){
- //$this->cellWidth = $dataWidth/2;
- //$this->pdf->MultiCell($metaWidth, 0, '', 'B', 'L', 0, 1, 0 ,0, true);
+
$steviloPodstolpcev = 1;
$steviloPodstolpcevV1[] = $steviloPodstolpcev;
}
// Imamo 2 nivoja
elseif($this->multiCrosstabClass->colLevel2){
- //echo "vertikalno izbrane sprem. 1. vrstica, ko imamo 2 nivoja</br>";
$this->cellWidth = $dataWidth / $this->multiCrosstabClass->colSpan;
@@ -223,7 +212,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
foreach($parentVar['sub'] as $var){
foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $suboption){
- //$this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->snippet($suboption, 25), 1, 'C', 0, 0, 0 ,0, true, $stretch=0, $ishtml=false, $autopadding=false, $maxh=0);
if($export_format != 'xls'){
$cetrtaVrsticaVertText = $this->snippet($suboption, 25);
$cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
@@ -241,25 +229,19 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
else{
- //$this->pdf->MultiCell($this->cellWidth*count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']), $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
-
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
- //$this->pdf->MultiCell($this->cellWidth, $lineHeight*2, $this->snippet($option, 25), 1, 'C', 0, 0, 0 ,0, true);
-
- /* $cetrtaVrsticaVert[] = $this->snippet($option, 25);
- $cetrtaVrsticaVertTmp[] = $this->snippet($suboption, 25); */
if($export_format != 'xls'){
$cetrtaVrsticaVertText = $this->snippet($option, 25);
- $cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
+ //$cetrtaVrsticaVertTmpText = $this->snippet($suboption, 25);
}else{
$cetrtaVrsticaVertText = $option;
- $cetrtaVrsticaVertTmpText = $suboption;
+ //$cetrtaVrsticaVertTmpText = $suboption;
}
$cetrtaVrsticaVert[] = $cetrtaVrsticaVertText;
- $cetrtaVrsticaVertTmp[] = $cetrtaVrsticaVertTmpText;
+ //$cetrtaVrsticaVertTmp[] = $cetrtaVrsticaVertTmpText;
$indeksMultiRow[] = 0;
}
- $steviloPodstolpcev = count($cetrtaVrsticaVertTmp);
+ //$steviloPodstolpcev = count($cetrtaVrsticaVertTmp);
$steviloPodstolpcevV3[] = count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']);
}
if($steviloPodstolpcev!=0){
@@ -271,7 +253,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$prvaVrsticaVert = array();
@@ -283,43 +264,36 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$rowspan = 1;
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$var['sub'][0]['spr']]['options']) * count($this->multiCrosstabClass->variablesList[$var['spr']]['options']);
if($export_format != 'xls'){
- $naslov = $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
+ $naslov = LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
}else{
- $naslov = $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
+ $naslov = LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
}
}
else{
$rowspan = 2;
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$var['spr']]['options']);
if($export_format != 'xls'){
- $naslov = '\multirow{2}{*}{ '.$this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)).' }';
+ $naslov = '\multirow{2}{*}{ '.LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)).' }';
}else{
- $naslov = $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
+ $naslov = LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov']);
}
}
- //$this->pdf->MultiCell($width, $lineHeight*$rowspan, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 1, 'C', 0, 0, 0 ,0, true);
-
- //$naslov = $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25);
- //$naslov = $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25));
$prvaVrsticaVert[] = $naslov;
//echo "naslov: ".$naslov."</br>";
}
}
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'L', 0, 1, 0 ,0, true);
+
// Izris vrstic za 2. nivo - 3. in 4. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
+
if(count($this->multiCrosstabClass->selectedVars['ver'])){
- $tretjaVrsticaVert = array();
foreach($this->multiCrosstabClass->selectedVars['ver'] as $parentVar){
// ce imamo childe na 2. nivoju
if(count($parentVar['sub']) > 0){
- //$tretjaVrsticaVert = array();
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
$width = $this->cellWidth * count($this->multiCrosstabClass->variablesList[$parentVar['sub'][0]['spr']]['options']);
foreach($parentVar['sub'] as $var){
- //$this->pdf->MultiCell($width, $lineHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 1, 'C', 0, 0, 0 ,0, true);
if($export_format != 'xls'){
$tretjaVrsticaVert[] = $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25);
}else{
@@ -331,9 +305,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
else{
- //$this->pdf->MultiCell($this->cellWidth*count($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options']), $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
- //$tretjaVrsticaVert[] = '';
$tretjaVrsticaVert[] = '\multirow{2}{*}{}';
@@ -343,7 +315,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Izrisemo VARIABLE za spremenljivko - 2. vrstica
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'L', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$drugaVrsticaVert = array();
@@ -378,16 +349,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
}
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'L', 0, 1, 0 ,0, true);
}
// Imamo samo 1 nivo
else{
// Izrisemo VERTIKALNO izbrane spremenljivkec - 1. vrstica
- //echo "Samo 1 nivo </br>";
// Izracunamo sirine celic
$this->cellWidth = $dataWidth / $this->multiCrosstabClass->fullColSpan;
- //$this->pdf->MultiCell($metaWidth, $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
if(count($this->multiCrosstabClass->selectedVars['ver'])){
$prvaVrsticaVert = array();
@@ -403,22 +371,12 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
- //$prvaVrsticaVert[] = $this->snippet($naslov, 35);
-
- //$sprWidth = count($this->multiCrosstabClass->variablesList[$var['spr']]['options']) * $this->cellWidth;
- //if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['sums'] == 1 && !$this->multiCrosstabClass->rowLevel2)
- //$sprWidth += $this->cellWidth;
- //$this->pdf->MultiCell($sprWidth, $lineHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 35), 1, 'C', 0, 0, 0 ,0, true);
-
+ //$prvaVrsticaVert[] = $this->snippet($naslov, 35);
}
-
- //$this->pdf->MultiCell(1, $lineHeight, '', 0, 'C', 0, 1, 0 ,0, true);
- //$tabela .= $this->tableRow($prvaVrsticaVert);
- //echo $tabela;
+
}
// Nimamo nobene vertikalne spremenljivke in 2 horizontalni
elseif($this->multiCrosstabClass->rowLevel2){
- //$this->pdf->MultiCell($dataWidth, $lineHeight, '', 0, 'C', 0, 0, 0 ,0, true);
echo "Nimamo nobene vertikalne spremenljivke in 2 horizontalni </br>";
}
@@ -429,22 +387,12 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Iracunamo visino najvisje celice
$cellHeight = $lineHeight;
-/* foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
-
- foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $option){
- $height = $this->getCellHeight($this->snippet($option, 25), $this->cellWidth);
- $cellHeight = ($height > $cellHeight) ? $height : $cellHeight;
- }
- } */
-
- //$this->pdf->MultiCell($metaWidth, $cellHeight, '', 'B', 'C', 0, 0, 0 ,0, true);
-
foreach($this->multiCrosstabClass->selectedVars['ver'] as $var){
$steviloPodstolpcev = 0;
// Loop cez variable spremenljivke
foreach($this->multiCrosstabClass->variablesList[$var['spr']]['options'] as $option){
- //$this->pdf->MultiCell($this->cellWidth, $cellHeight, $this->snippet($option, 25), 1, 'C', 0, 0, 0 ,0, true);
+
if($export_format != 'xls'){
$drugaVrsticaVert[] = $this->snippet($option, 25);
}else{
@@ -456,16 +404,10 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Suma (ce jo imamo vklopljeno)
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['sums'] == 1 && !$this->multiCrosstabClass->rowLevel2){
- //$this->pdf->MultiCell($this->cellWidth, $cellHeight, $lang['srv_analiza_crosstab_skupaj'], 1, 'C', 0, 0, 0 ,0, true);
$drugaVrsticaVert[] = $lang['srv_analiza_crosstab_skupaj'];
$steviloPodstolpcev++;
}
-
-/* if($colspan<4){
- $steviloPodstolpcevV2[] = $steviloPodstolpcev;
- }elseif($steviloPodstolpcev!=0&&$colspan==4){
- $steviloPodstolpcevV2[] = $steviloPodstolpcev;
- } */
+
if($steviloPodstolpcev!=0){
$steviloPodstolpcevV1[] = $steviloPodstolpcev;
}
@@ -473,7 +415,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//$steviloPodstolpcevV2[] = $steviloPodstolpcev;
}
//$tabela .= $this->tableRow($drugaVrsticaVert);
- //$this->pdf->MultiCell(1, $cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
}
}
@@ -501,7 +442,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
/*Priprava parametrov za tabelo in ostala polja za nadaljnji izpis - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -512,8 +453,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$tabela .= "\\cline{".($colspan+1)."-".$steviloStolpcevParameterTabular."}"; //prekinjena horizontalna vrstica na vrhu tabele
}
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v prvi vrstici
- //$tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV1); //izpis prve vrstice tabele
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v prvi vrstici
$tabela .= $this->tableRow($prvaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV1); //izpis prve vrstice tabele
//prekinjena horizontalna vrstica po prvi vrstici
@@ -523,9 +463,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//prekinjena horizontalna vrstica po prvi vrstici - konec
if(count($drugaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
if(count($steviloPodstolpcevV2)){
- //$tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV2);
$tabela .= $this->tableRow($drugaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV2);
}else{
$tabela .= $this->tableRow($drugaVrsticaVert, 1);
@@ -538,10 +477,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//prekinjena horizontalna vrstica po drugi vrstici - konec
}
- if(count($tretjaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ if(is_countable($tretjaVrsticaVert) && count($tretjaVrsticaVert)){
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
if(count($steviloPodstolpcevV3)){
- //$tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, $steviloPodstolpcevV3);
$tabela .= $this->tableRow($tretjaVrsticaVert, 1, 0, 0, '', $export_format, $steviloPodstolpcevV3);
}else{
$tabela .= $this->tableRow($tretjaVrsticaVert, 1);
@@ -552,7 +490,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
if(count($cetrtaVrsticaVert)){
- $tabela .= $this->MultiColCellLatex($colspan, '', 1); //prazne celice v drugi vrstici
+ $tabela .= $this->MultiColCellLatex($colspan, '', 1, $export_format); //prazne celice v drugi vrstici
$tabela .= $this->tableRow($cetrtaVrsticaVert, 1);
}
@@ -572,7 +510,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$order0 = 0;
foreach($this->multiCrosstabClass->variablesList[$parentVar['spr']]['options'] as $option){
- //echo "option hor 2. nivoja: ".$option."</br>";
$cnt2 = 0;
// ce imamo childe na 2. nivoju
@@ -605,17 +542,14 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
if($cnt == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25))." & ";
}else{
- $tabela .= $this->encodeText($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'])." & ";
+ $tabela .= LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'])." & ";
}
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25), 'LR', 'C', 0, 0, 0 ,0, true);
- //echo "naslov : ".$this->snippet($this->multiCrosstabClass->variablesList[$parentVar['spr']]['naslov'], 25)."</br>";
+
}
else{
$tabela .= " & ";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border1, 'C', 0, 0, 0 ,0, true);
- //echo "naslov : </br>";
}
@@ -623,54 +557,42 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
//if($cnt2 == floor(count($this->multiCrosstabClass->variablesList[$var['spr']]['options'])/2)){
if($cnt2 == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($option, 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($option, 25))." & ";
}else{
- $tabela .= $this->encodeText($option)." & ";
+ $tabela .= LatexDocument::encodeText($option)." & ";
}
- //echo "variabla : ".$this->snippet($option, 25)."</br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($option, 25), 'LR', 'C', 0, 0, 0 ,0, true);
}
else{
$tabela .= " & ";
- //echo "variabla : </br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border2, 'C', 0, 0, 0 ,0, true);
}
//if($cnt3 == floor(count($this->multiCrosstabClass->variablesList[$var['spr']]['options'])/2)){
if($cnt3 == 0){
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25))." & ";
}else{
- $tabela .= $this->encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'])." & ";
+ $tabela .= LatexDocument::encodeText($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'])." & ";
}
- //echo "variabla cnt3: ".$this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25)."</br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($this->multiCrosstabClass->variablesList[$var['spr']]['naslov'], 25), 'LR', 'C', 0, 0, 0 ,0, true);
}
else{
- $tabela .= " & ";
- //echo "variabla cnt3: </br>";
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'LR'.$border2, 'C', 0, 0, 0 ,0, true);
+ $tabela .= " & ";
}
// Variabla 2
if($export_format != 'xls'){
- $tabela .= $this->encodeText($this->snippet($suboption, 25))." & ";
+ $tabela .= LatexDocument::encodeText($this->snippet($suboption, 25))." & ";
}else{
- $tabela .= $this->encodeText($suboption)." & ";
+ $tabela .= LatexDocument::encodeText($suboption)." & ";
}
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($suboption, 25), 1, 'C', 0, 0, 0 ,0, true);
- //echo "option variabla 2: ".$this->snippet($suboption, 25)."</br>";
// Celice s podatki
$vrsticaPodatki = $this->displayDataCells($parentVar, $order0, $var, $cnt3);
- //print_r($vrsticaPodatki);
+
################# izpis celic s podatki
$tabela .= $this->displayDataCellLatex($vrsticaPodatki, $this->tableSettingsNumerus, $this->tableSettingsAvgVar, $this->tableSettingsDelezVar, $colspan, $steviloStolpcevParameterTabular, $export_format);
################# izpis celic s podatki - konec
// Celice s podatki - konec
- //$this->pdf->MultiCell(1, $this->cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
-
$cnt++;
$cnt2++;
$cnt3++;
@@ -753,11 +675,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}else{
$naslovVarHor = '';
}
- //echo "naslovVarHor: ".$naslovVarHor."</br>";
$tabela .= $naslovVarHor." & ";
// Variabla
- //$this->pdf->MultiCell($width, $this->cellHeight, $this->snippet($option, 25), '1', 'C', 0, 0, 0 ,0, true);
//echo "variabla: ".$this->snippet($option, 25)."</br>";
if($export_format != 'xls'){
$tabela .= $this->snippet($option, 25)." & ";
@@ -766,8 +686,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Celice s podatki
- //echo "celica s podatki: ".$var."</br>";
// Ce nimamo nobenega krizanja izpisemo prazne
+ $spr2=isset($spr2)?$spr2:'';
if($spr2 == '' && $this->multiCrosstabClass->colSpan == 0){
//$tabela .= " & ";
$tabela .= $this->texNewLine;
@@ -778,7 +698,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$tabela .= $this->displayDataCellLatex($vrsticaPodatki, $this->tableSettingsNumerus, $this->tableSettingsAvgVar, $this->tableSettingsDelezVar, $colspan, $steviloStolpcevParameterTabular, $export_format);
################# izpis celic s podatki - konec
}
- //$this->pdf->MultiCell(1, $this->cellHeight, '', 0, 'C', 0, 1, 0 ,0, true);
if($export_format != 'xls'){
$tabela .= "\\cline{".($colspan)."-".$steviloStolpcevParameterTabular."}"; //prekinjena horizontalna vrstica
@@ -788,11 +707,8 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
// Vrstica za sumo (ce jo imamo vklopljeno)
if($suma){
-
- //$this->pdf->MultiCell($width, $this->cellHeight, '', 'BLR', 'C', 0, 0, 0 ,0, true);
- //$this->pdf->MultiCell($width, $this->cellHeight, $lang['srv_analiza_crosstab_skupaj'], '1', 'C', 0, 0, 0 ,0, true);
- $tabela .= " & ".$this->encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
- //$tabela .= $this->encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
+
+ $tabela .= " & ".LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])." & ";
$vrsticaPodatkiSumNum = array();
$vrsticaPodatkiSumPer = array();
@@ -876,7 +792,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
if($this->tableSettingsDelezVar!= ''){
$color = 'red';
- //$tabela .= $this->tableRow($vrsticaPodatkiSumDelez,1);
$tabela .= $this->tableRow($vrsticaPodatkiSumDelez,1,0,0,$color, $export_format);
}
}
@@ -898,7 +813,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
//zaljucek latex tabele z obrobo za drugo tabelo
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
//echo "tabela: ".$tabela;
return $tabela;
@@ -1434,27 +1349,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
function displaySumsCell($spr1=null, $spr2=null, $val=null, $orientation=null){
$celicaSums = array();
- //echo "Orientacija skupaj: ".$orientation."</br>";
-/* $startX = $this->pdf->getX();
- $startY = $this->pdf->getY(); */
-
- // Nastavimo visino posamezne vrstice
-/* $cellSpan = 0;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1)
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1)
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['avgVar'] != '')
- $cellSpan++;
- if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['delezVar'] != '')
- $cellSpan++;
- $cellSpan = ($cellSpan > 0) ? $cellSpan : 1;
- $lineHeight = $this->cellHeight / $cellSpan; */
-
- // Nastavimo barvo texta
-/* $this->pdf->SetTextColor(160, 0, 0);
- $this->pdf->setFont('','B','6'); */
-
$crosstabs = $this->multiCrosstabClass->crosstabData[$spr1['spr'].'-'.$spr2['spr']];
// Celica s skupno sumo
@@ -1463,16 +1357,11 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = $crosstabs['sumaSkupna'];
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaSkupna'], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
// Povprecje
@@ -1490,13 +1379,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$avg = $tempAvg / $crosstabs['sumaSkupna'];
}
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1511,15 +1393,7 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
}
}
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
// Suma na koncu vrstice
@@ -1530,16 +1404,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaVrstica'][$val], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
$celicaSums['numerus'] = $crosstabs['sumaVrstica'][$val];
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
else{
@@ -1547,15 +1418,11 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = '0';
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
@@ -1574,13 +1441,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1593,17 +1453,9 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$delez += $tempDelez;
}
}
+
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
}
// Suma za stolpce
@@ -1614,15 +1466,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = $crosstabs['sumaStolpec'][$val];
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstabs['sumaStolpec'][$val], 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber($this->multiCrosstabClass->getCrossTabPercentage($crosstabs['sumaSkupna'], $crosstabs['sumaStolpec'][$val]), SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
else{
@@ -1630,16 +1480,13 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
$celicaSums['numerus'] = '0';
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
- //$celicaSums['percent'] = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['percent'] = $this->encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['percent'] = LatexDocument::encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
@@ -1658,13 +1505,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
}
$celicaSums['avg'] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
}
// Delez
@@ -1677,33 +1517,21 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
$delez += $tempDelez[$val];
}
}
- //$celicaSums['delez'] = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $celicaSums['delez'] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $celicaSums['delez'] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
}
-
-/* $this->pdf->SetTextColor(0, 0, 0);
- $this->pdf->setFont('','','6');
- $this->pdf->setXY($startX + $this->cellWidth, $startY); */
+
return $celicaSums;
}
// Izpis celice z vrednostmi
- //function displayDataCell($crosstab, $percent, $avg, $delez){
function displayDataCell($crosstab=null, $percent=null, $avg=null, $delez=null, $cnt=null){
- //$podatekCelice = '';
$podatekCelice = array();
- //$startX = $this->pdf->getX();
- //$startY = $this->pdf->getY();
+
$lineHeight = ($this->cellSpan > 1) ? 5 : 6;
@@ -1711,68 +1539,41 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $crosstab, 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $crosstab;
$podatekCelice['numerus'][$cnt] = $crosstab;
- //echo "Crosstab ce crosstab > 0: ".$crosstab."</br>";
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //$podatekCelice['percent'][$cnt] = $this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $podatekCelice['percent'][$cnt] = $this->encodeText($this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //echo "Procenti ce crosstab > 0: ".$podatekCelice."</br>";
+
+ $podatekCelice['percent'][$cnt] = LatexDocument::encodeText($this->formatNumber($percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
else{
// Numerus
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['numerus'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, '0', 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
$podatekCelice['numerus'][$cnt] = '0';
}
// Procenti
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['percent'] == 1){
-/* $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
- //$podatekCelice = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //$podatekCelice['percent'][$cnt] = $this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- $podatekCelice['percent'][$cnt] = $this->encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
+ $podatekCelice['percent'][$cnt] = LatexDocument::encodeText($this->formatNumber(0, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
}
}
// Povprecje
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['avgVar'] > 0){
- //$podatekCelice = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
- //echo "Povprecje: ".$podatekCelice."</br>";
+
$podatekCelice['avg'][$cnt] = $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-/* $this->pdf->SetFillColor(220, 220, 255);
- $this->pdf->SetTextColor(0, 0, 230);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($avg, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE')), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
}
// Delez
if($this->multiCrosstabClass->table_settings[$this->multiCrosstabClass->table_id]['delezVar'] > 0){
- //$podatekCelice = $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%');
- //echo "Delez: ".$podatekCelice."</br>";
- $podatekCelice['delez'][$cnt] = $this->encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-/* $this->pdf->SetFillColor(255, 220, 220);
- $this->pdf->SetTextColor(230, 0, 0);
- $this->pdf->MultiCell($this->cellWidth, $lineHeight, $this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'), 1, 'C', 1, 0, 0 ,0, true);
- $this->pdf->SetFillColor(250, 250, 250);
- $this->pdf->SetTextColor(0, 0, 0);
-
- $this->pdf->setXY($this->pdf->getX() - $this->cellWidth, $this->pdf->getY() + $lineHeight); */
+
+ $podatekCelice['delez'][$cnt] = LatexDocument::encodeText($this->formatNumber($delez*100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+
}
- //$this->pdf->setXY($startX + $this->cellWidth, $startY);
return $podatekCelice;
}
@@ -1858,13 +1659,6 @@ class AnalizaMultiCrosstab extends LatexAnalysisElement {
return $result;
}
-/* function encodeText($text){
- // popravimo sumnike ce je potrebno
- $text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
- $text = str_replace(array("&scaron;","&#353;","&#269;"),array("š","š","č"),$text);
-
- return strip_tags($text);
- } */
/*Skrajsa tekst in doda '...' na koncu*/
function snippet($text='', $length=64, $tail="..."){
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaSums.php b/admin/survey/export/latexclasses/Analize/AnalizaSums.php
index ca37139..2979f0d 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaSums.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaSums.php
@@ -1,5 +1,7 @@
<?php
+use Drupal\migrate\Plugin\migrate\id_map\NullIdMap;
+
global $site_path;
include_once('../../function.php');
@@ -8,37 +10,37 @@
include_once('../exportclases/class.pdfIzvozAnalizaFunctions.php');
require_once('../exportclases/class.enka.pdf.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
define ('MEJA_DOLZINA_VPRASANJA', 132);
@@ -165,7 +167,6 @@ class AnalizaSums extends LatexAnalysisElement{
//$vars_count = count(SurveyAnalysis::$_FILTRED_VARIABLES);
//$line_break = '';
- //echo "Spr tip v Sums: ".$spremenljivka['tip']."</br>";
switch ($spremenljivka['tip']) {
case 1:
# radio - prikaže navpično
@@ -203,11 +204,11 @@ class AnalizaSums extends LatexAnalysisElement{
break;
case 21: # besedilo*
- # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
+ # varabla tipa »besedilo« je v sumarniku IDENTIČNA kot v FREKVENCAH.
if ($spremenljivka['cnt_all'] == 1) {
// če je enodimenzionalna prikažemo kot frekvence
- // predvsem zaradi vprašanj tipa: language, email...
- $tabela .= self::sumTextVertical($spid,'sums', $export_format);
+ // predvsem zaradi vprašanj tipa: language, email...
+ $tabela .= self::sumTextVertical($spid,'sums', $export_format, $spremenljivka['tip']);
} else {
$tabela .= self::sumMultiText($spid,'sums', $export_format);
}
@@ -294,7 +295,7 @@ class AnalizaSums extends LatexAnalysisElement{
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -308,15 +309,15 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{>{\hsize=\dimexpr 6\hsize+\arrayrulewidth}X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{>{\hsize=\dimexpr 6\hsize+\arrayrulewidth}X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
@@ -381,7 +382,7 @@ class AnalizaSums extends LatexAnalysisElement{
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
$_Z_MV = !$this->hideEmpty;
if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $tex .= $this->encodeText($lang['srv_anl_missing1']);
+ $tex .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
//echo "iAnswer cnt: ".$iAnswer['cnt']."</br>";
@@ -409,7 +410,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
/* odklon */
@@ -431,7 +432,7 @@ class AnalizaSums extends LatexAnalysisElement{
if ($show_valid_percent == 1 && SurveyAnalysis::$_HEADERS[$spid]['skala'] != 1) {
$brezHline = 1;
//zacetek latex tabele za drugo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -445,12 +446,12 @@ class AnalizaSums extends LatexAnalysisElement{
//$text[] = '';
//$text[] = '';
- $text[] = $this->encodeText($lang['srv_analiza_opisne_povprecje1']);
- $text[] = $this->encodeText(self::formatNumber($avg,NUM_DIGIT_AVERAGE,''));
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']);
+ $text[] = LatexDocument::encodeText(self::formatNumber($avg,NUM_DIGIT_AVERAGE,''));
- $text[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
- $text[] = $this->encodeText(self::formatNumber($div,NUM_DIGIT_AVERAGE,''));
+ $text[] = LatexDocument::encodeText(self::formatNumber($div,NUM_DIGIT_AVERAGE,''));
if($export_format == 'pdf'){
@@ -470,7 +471,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za drugo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
}
@@ -496,7 +497,9 @@ class AnalizaSums extends LatexAnalysisElement{
$tex = '';
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
$_answersOther = array();
-
+ $_navedbe = array();
+ $_valid_cnt = array();
+ $_approp_cnt = array();
//TODO: Koda se nikjer ne uporablja
//$inline_legenda = count ($spremenljivka['grids']) > 1;
//if ($variable['other'] != '1' && $variable['text'] != '1') {
@@ -510,17 +513,18 @@ class AnalizaSums extends LatexAnalysisElement{
/* ugotovimo koliko imamo kolon*/
if (count($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
+ $_clmn_cnt[$gid] = $grid['cnt_vars']-(isset($grid['cnt_other']) ? $grid['cnt_other'] : 0);
if (count ($grid['variables']) > 0)
foreach ($grid['variables'] AS $vid => $variable) {
$_sequence = $variable['sequence'];
- $_valid_cnt[$gid] = max($_valid_cnt[$gid], SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']);
- $_approp_cnt[$gid] = max($_approp_cnt[$gid], SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
+ $_valid_cnt[$gid] = max(isset($_valid_cnt[$gid])?$_valid_cnt[$gid]:0, array_key_exists('validCnt', SurveyAnalysis::$_FREQUENCYS[$_sequence])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:null);
+ $_approp_cnt[$gid] = max(isset($_approp_cnt[$gid])?$_approp_cnt[$gid]:0, SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
if ($variable['other'] == true) {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
- $_valid[$gid][$vid] = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'];
- $_navedbe[$gid] += SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
+ $_valid[$gid][$vid] = array_key_exists('valid', SurveyAnalysis::$_FREQUENCYS[$_sequence])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']:null;
+ //$_navedbe[$gid] += SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
+ $_navedbe[$gid] = isset($_navedbe[$gid])?$_navedbe[$gid]:0 + SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
}
}
@@ -544,7 +548,7 @@ class AnalizaSums extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -557,13 +561,13 @@ class AnalizaSums extends LatexAnalysisElement{
//zacetek latex tabele z obrobo za prvo tabelo - konec
//prva vrstica
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{8}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{8}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{8}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{8}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
if($export_format != 'xls'){
@@ -571,7 +575,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//druga vrstica
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{5}{c|}{".$this->encodeText($lang['srv_analiza_opisne_units'])."} & \multicolumn{2}{c|}{".$this->encodeText($lang['srv_analiza_opisne_arguments'])."} ".$this->texNewLine;
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{5}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_units'])."} & \multicolumn{2}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_arguments'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -580,13 +584,13 @@ class AnalizaSums extends LatexAnalysisElement{
$text = array();
$text[] = '';
$text[] = '';
- $text[] = $this->encodeText($lang['srv_analiza_opisne_frequency']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_valid']);
- $text[] = $this->encodeText('% - '.$lang['srv_analiza_opisne_valid']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units_valid']);
- $text[] = $this->encodeText('% - '.$lang['srv_analiza_num_units_valid']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_frequency']);
- $text[] = $this->encodeText('%');
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_frequency']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid']);
+ $text[] = LatexDocument::encodeText('% - '.$lang['srv_analiza_opisne_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units_valid']);
+ $text[] = LatexDocument::encodeText('% - '.$lang['srv_analiza_num_units_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_frequency']);
+ $text[] = LatexDocument::encodeText('%');
$brezHline = $this->getBrezHline($export_format);
//echo "notnot: $brezHline </br>";
@@ -606,38 +610,38 @@ class AnalizaSums extends LatexAnalysisElement{
$text = array();
- $text[] = $this->encodeText($variable['variable']);
- $text[] = $this->encodeText($variable['naslov']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText($variable['naslov']);
// Frekvence
- $text[] = $this->encodeText((int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']);
+ $text[] = LatexDocument::encodeText((int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']);
// Veljavni
- $text[] = $this->encodeText((int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']));
+ $text[] = LatexDocument::encodeText((int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']));
// Procent - veljavni
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
- $text[] = $this->encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
$_max_appropriate = max($_max_appropriate, (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
$_max_valid = max ($_max_valid, ((int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt'])));
// Ustrezni
- $text[] = $this->encodeText((int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
+ $text[] = LatexDocument::encodeText((int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
// % Ustrezni
$valid = (int)(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']+(int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['0']['cnt']);
$valid = (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'];
$_percent = ($_max_appropriate > 0 ) ? 100*$valid / $_max_appropriate : 0;
- $text[] = $this->encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
- $text[] = $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']);
+ $text[] = LatexDocument::encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt']);
$_percent = ($_navedbe[$gid] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']['1']['cnt'] / $_navedbe[$gid] : 0;
- $text[] = $this->encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
$tex .= $this->tableRow($text, $brezHline); //izpis vrstic z odgovori
} else {
@@ -649,26 +653,26 @@ class AnalizaSums extends LatexAnalysisElement{
$text[] = '';
- $text[] = $this->encodeText($lang['srv_anl_suma_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_anl_suma_valid']);
$text[] = '';
- $text[] = $this->encodeText($_max_valid);
+ $text[] = LatexDocument::encodeText($_max_valid);
$text[] = '';
- $text[] = $this->encodeText($_max_appropriate);
+ $text[] = LatexDocument::encodeText($_max_appropriate);
$text[] = '';
- $text[] = $this->encodeText($_navedbe[$gid]);
+ $text[] = LatexDocument::encodeText($_navedbe[$gid]);
- $text[] = $this->encodeText(self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber('100',SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%'));
$tex .= $this->tableRow($text, $brezHline); //izpis vrstice SKUPAJ
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
# izpišemo še tekstovne odgovore za polja drugo
@@ -716,7 +720,7 @@ class AnalizaSums extends LatexAnalysisElement{
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -730,7 +734,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- $tex .= $this->encodeText($spremenljivka['variable'])." & ".$this->encodeText($spremenljivka['naslov'])." ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & ".LatexDocument::encodeText($spremenljivka['naslov'])." ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -741,8 +745,8 @@ class AnalizaSums extends LatexAnalysisElement{
/* $this->pdf->setFont('','b','6');
$this->pdf->ln(5);
- $this->pdf->MultiCell(18, 5, $this->encodeText($spremenljivka['variable']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(162, 5, $this->encodeText($spremenljivka['naslov']), 1, 'L', 0, 1, 0 ,0, true); */
+ $this->pdf->MultiCell(18, 5, LatexDocument::encodeText($spremenljivka['variable']), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(162, 5, LatexDocument::encodeText($spremenljivka['naslov']), 1, 'L', 0, 1, 0 ,0, true); */
//echo "Latex tabele: ".$tex."</br>";
return $tex;
}
@@ -756,7 +760,7 @@ class AnalizaSums extends LatexAnalysisElement{
global $lang;
$tex = '';
$spremenljivka = SurveyAnalysis::$_HEADERS[$spid];
-
+ $_approp_cnt = array();
# dodamo opcijo kje izrisujemo legendo
# če je besedilo * in je samo ena kategorija je inline legenda false
$inline_legenda = (SurveyAnalysis::$_HEADERS[$spid]['cnt_all'] == 1 || in_array($spremenljivka['tip'],array(1,8) ) ) ? false: true;
@@ -764,18 +768,18 @@ class AnalizaSums extends LatexAnalysisElement{
# ali izpisujemo enoto:
$show_enota = true;
- if ((int)$spremenljivka['enota'] == 0 && SurveyAnalysis::$_HEADERS[$spid]['cnt_all'] == 1) {
+ if ((int)isset($spremenljivka['enota'])?$spremenljivka['enota']:null == 0 && SurveyAnalysis::$_HEADERS[$spid]['cnt_all'] == 1) {
$show_enota = false;
}
# ugotovimo koliko imamo kolon
if (count($spremenljivka['grids']) > 0)
foreach ($spremenljivka['grids'] AS $gid => $grid) {
- $_clmn_cnt[$gid] = $grid['cnt_vars']-$grid['cnt_other'];
+ $_clmn_cnt[$gid] = $grid['cnt_vars']-(isset($grid['cnt_other']) ? $grid['cnt_other'] : 0);
if (count($grid['variables']) > 0)
foreach ($grid['variables'] AS $vid => $variable) {
$_sequence = $variable['sequence'];
- $_approp_cnt[$gid] = max($_approp_cnt[$gid], SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
+ $_approp_cnt[$gid] = max(isset($_approp_cnt[$gid])?$_approp_cnt[$gid]:null, SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
# za povprečje
$sum_xi_fi=0;
@@ -796,7 +800,7 @@ class AnalizaSums extends LatexAnalysisElement{
#povprečje
$avg = ($N > 0) ? $sum_xi_fi / $N : 0;
- $sum_avg += $avg;
+ //$sum_avg += $avg; //Pokomentiral, ker te spremenljivke se ne uporablja nikjer - Patrik
SurveyAnalysis::$_FREQUENCYS[$_sequence]['validAvg'] = $avg;
SurveyAnalysis::$_FREQUENCYS[$_sequence]['validMin'] = $min;
SurveyAnalysis::$_FREQUENCYS[$_sequence]['validMax'] = $max;
@@ -839,7 +843,7 @@ class AnalizaSums extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -853,15 +857,16 @@ class AnalizaSums extends LatexAnalysisElement{
//prva vrstica
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{p{16cm}|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -876,20 +881,20 @@ class AnalizaSums extends LatexAnalysisElement{
if ($show_enota) {
if ($spremenljivka['tip'] == 20 || $spremenljivka['tip'] == 7) {
- $text[] = $this->encodeText($lang['srv_analiza_opisne_subquestion1']);;
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1']);;
} else {
- $text[] = $this->encodeText($lang['srv_analiza_opisne_variable_text1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_variable_text1']);
}
} else {
$text[] = '';
}
- $text[] = $this->encodeText($lang['srv_analiza_opisne_m']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_povprecje1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_min']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_max']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_m']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_min']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_max']);
$brezHline = $this->getBrezHline($export_format);
$tex .= $this->tableRow($text, $brezHline);
@@ -915,13 +920,13 @@ class AnalizaSums extends LatexAnalysisElement{
$text = array();
if ($spremenljivka['tip'] != 7 ) {
- $text[] = $this->encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
}
else
$text[] = '';
if ($show_enota) {
- $text[] = $this->encodeText((count($grid['variables']) > 1 && $spremenljivka['tip'] == 20 ? $grid['naslov'] . ' - ' : '' ).$variable['naslov']);
+ $text[] = LatexDocument::encodeText((count($grid['variables']) > 1 && $spremenljivka['tip'] == 20 ? $grid['naslov'] . ' - ' : '' ).$variable['naslov']);
} else {
$text[] = '';;
}
@@ -947,7 +952,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
# izpišemo še tekstovne odgovore za polja drugo
@@ -1013,7 +1018,7 @@ class AnalizaSums extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1027,15 +1032,16 @@ class AnalizaSums extends LatexAnalysisElement{
/* prva vrstica */
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|} {'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|} {'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{p{16cm}|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -1045,28 +1051,28 @@ class AnalizaSums extends LatexAnalysisElement{
/* $this->pdf->setFont('','b','6');
$this->pdf->ln(5);
- $this->pdf->MultiCell(18, 5, $this->encodeText($spremenljivka['variable']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(162, 5, $this->encodeText($spremenljivka['naslov']), 1, 'L', 0, 1, 0 ,0, true); */
+ $this->pdf->MultiCell(18, 5, LatexDocument::encodeText($spremenljivka['variable']), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(162, 5, LatexDocument::encodeText($spremenljivka['naslov']), 1, 'L', 0, 1, 0 ,0, true); */
/* prva vrstica - konec */
/* druga vrstica */
$steviloPodStolpcev2 = count($spremenljivka['options']) + 1;
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$steviloPodStolpcev2."}{c|}{".$this->encodeText($lang['srv_analiza_opisne_answers'])."} ";
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$steviloPodStolpcev2."}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_answers'])."} ";
-/* $this->pdf->MultiCell(18, 5, $this->encodeText(''), 1, 'L', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(30, 5, $this->encodeText($lang['srv_analiza_opisne_subquestion']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(72, 5, $this->encodeText($lang['srv_analiza_opisne_answers']), 1, 'C', 0, 0, 0 ,0, true); */
+/* $this->pdf->MultiCell(18, 5, LatexDocument::encodeText(''), 1, 'L', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(30, 5, LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion']), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(72, 5, LatexDocument::encodeText($lang['srv_analiza_opisne_answers']), 1, 'C', 0, 0, 0 ,0, true); */
$text = array();
if ($additional_field){
- $text[] = $this->encodeText($lang['srv_analiza_opisne_valid']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_povprecje1']);
- $text[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_povprecje1']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
}
else{
- $text[] = $this->encodeText($lang['srv_analiza_opisne_valid']);
- $text[] = $this->encodeText($lang['srv_analiza_num_units']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_analiza_num_units']);
}
//$tex .= $this->tableRow($text); //izpis ostalega dela vrstice $arrayText, $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0
@@ -1114,7 +1120,7 @@ class AnalizaSums extends LatexAnalysisElement{
$tex .= $this->dynamicCells($textDynamicCells, $count); //izpis celic z odgovori v stolpcih (npr. Sploh ne velja, ...)
- $tex .= " & ".$this->encodeText($lang['srv_anl_suma1']); //Skupaj
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_anl_suma1']); //Skupaj
/*zadnji stolpci po Skupaj*/
if ($additional_field){
@@ -1151,7 +1157,7 @@ class AnalizaSums extends LatexAnalysisElement{
if ($variable['other'] != true) {
// Ce gre za dvojno tabelo naredimo vrstico s naslovom podtabele
- if($spremenljivka['tip'] == 6 && $spremenljivka['enota'] == 3){
+ if(isset($spremenljivka['tip'])&&$spremenljivka['tip'] == 6 && isset($spremenljivka['enota'])&&$spremenljivka['enota'] == 3){
// Če začnemo z drugo podtabelo izpišemo vrstico z naslovom
if($podtabela != $grid['part']){
@@ -1160,9 +1166,9 @@ class AnalizaSums extends LatexAnalysisElement{
$subtitle = $subtitle == '' ? $lang['srv_grid_subtitle_def'].' '.$grid['part'] : $subtitle;
/* $this->pdf->setFont('','b','6');
- $this->pdf->MultiCell(180, $height_title, $this->encodeText($subtitle), 1, 'C', 0, 1, 0 ,0, true);
+ $this->pdf->MultiCell(180, $height_title, LatexDocument::encodeText($subtitle), 1, 'C', 0, 1, 0 ,0, true);
$this->pdf->setFont('','','6'); */
- $tex .= $this->encodeText($subtitle);
+ $tex .= LatexDocument::encodeText($subtitle);
$podtabela = $grid['part'];
}
@@ -1171,7 +1177,7 @@ class AnalizaSums extends LatexAnalysisElement{
if($variable['naslov'] == '')
$variable['naslov'] = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($variable['naslov']), 30);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($variable['naslov']), 30);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
//ce smo na prelomu strani
@@ -1181,10 +1187,10 @@ class AnalizaSums extends LatexAnalysisElement{
$arrayParams['border'] .= 'T';
} */
-/* $this->pdf->MultiCell(18, $height, $this->encodeText($variable['variable']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(30, $height, $this->encodeText($variable['naslov']), 1, 'C', 0, 0, 0 ,0, true); */
- $tex .= $this->encodeText($variable['variable']);
- $tex .= " & ".$this->encodeText($variable['naslov']);
+/* $this->pdf->MultiCell(18, $height, LatexDocument::encodeText($variable['variable']), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(30, $height, LatexDocument::encodeText($variable['naslov']), 1, 'C', 0, 0, 0 ,0, true); */
+ $tex .= LatexDocument::encodeText($variable['variable']);
+ $tex .= " & ".LatexDocument::encodeText($variable['naslov']);
# za odklon in povprečje
@@ -1203,7 +1209,7 @@ class AnalizaSums extends LatexAnalysisElement{
$N += $fi;
}
- $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] * 100 / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ $_percent = ((isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:null) > 0 ) ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'] * 100 / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
$text[] = SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'][$key]['cnt'].' ('.self::formatNumber($_percent,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').')';
@@ -1214,20 +1220,16 @@ class AnalizaSums extends LatexAnalysisElement{
$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
// suma
- $tex .= " & ".$this->encodeText((int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'].' ('.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').')');
+ $tex .= " & ".LatexDocument::encodeText((int)(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0).' ('.self::formatNumber(100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%').')');
// zamenjano veljavni ustrezni
if ($additional_field){
-/* $this->pdf->MultiCell(15, $height, $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(15, $height, $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']), 1, 'C', 0, 0, 0 ,0, true); */
- $tex .= " & ".$this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']);
- $tex .= " & ".$this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
+ $tex .= " & ".LatexDocument::encodeText(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0);
+ $tex .= " & ".LatexDocument::encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
}
else{
-/* $this->pdf->MultiCell(30, $height, $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(30, $height, $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']), 1, 'C', 0, 1, 0 ,0, true); */
- $tex .= " & ".$this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']);
- $tex .= " & ".$this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
+ $tex .= " & ".LatexDocument::encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']);
+ $tex .= " & ".LatexDocument::encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']);
}
# za odklon in povprečje
@@ -1245,8 +1247,8 @@ class AnalizaSums extends LatexAnalysisElement{
}
$div = (($N -1) > 0) ? sqrt($sum_pow_xi_fi_avg / ($N -1)) : 0;
- $tex .= " & ".$this->encodeText(self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
- $tex .= " & ".$this->encodeText(self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ $tex .= " & ".LatexDocument::encodeText(self::formatNumber($avg,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ $tex .= " & ".LatexDocument::encodeText(self::formatNumber($div,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
}
/*zakljucek vrstice*/
@@ -1265,7 +1267,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
# izpišemo še tekstovne odgovore za polja drugo
@@ -1315,7 +1317,7 @@ class AnalizaSums extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za tabelo z imenom vprasanja/spremenljivke in besedilom vprasanja
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1329,15 +1331,15 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovna vrstica tabele*/
//prva vrstica tabele
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{>{\hsize=\dimexpr 6\hsize+\arrayrulewidth}X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- $tex .= $this->encodeText($spremenljivka['variable']).' & '.$this->encodeText($spremenljivka['naslov']).' '.$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{>{\hsize=\dimexpr 6\hsize+\arrayrulewidth}X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable']).' & '.LatexDocument::encodeText($spremenljivka['naslov']).' '.$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
//zaljucek latex tabele z obrobo za tabelo z imenom vprasanja/spremenljivke in besedilom vprasanja
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
#Priprava prve tabele, z imenom vprasanja/spremenljivke in besedilom vprasanja - konec #############################################
@@ -1365,7 +1367,7 @@ class AnalizaSums extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1419,7 +1421,7 @@ class AnalizaSums extends LatexAnalysisElement{
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
$_Z_MV = !$this->hideEmpty;
if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $tex .= $this->encodeText($lang['srv_anl_missing1']);
+ $tex .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
@@ -1440,7 +1442,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
#Priprava druge tabele, z odgovori - konec #############################################
@@ -1456,7 +1458,7 @@ class AnalizaSums extends LatexAnalysisElement{
return $tex;
}
- function sumTextVertical($spid=null, $_from=null, $export_format='') {
+ function sumTextVertical($spid=null, $_from=null, $export_format='', $spremTip=null) {
//echo "sumTextVertical </br>";
global $lang;
$tex = '';
@@ -1468,7 +1470,13 @@ class AnalizaSums extends LatexAnalysisElement{
$options=array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'textAnswerExceed' => false, 'exportFormat' => $export_format);
//Priprava parametrov za tabelo
- $steviloStolpcevParameterTabular = 6;
+ if($spremTip==21){
+ $steviloStolpcevParameterTabular = 2;
+ }else{
+ $steviloStolpcevParameterTabular = 6;
+ }
+
+
$steviloOstalihStolpcev = $steviloStolpcevParameterTabular - 1; /*stevilo stolpcev brez prvega stolpca, ki ima fiksno sirino*/
$sirinaOstalihStolpcev = 0.9/$steviloOstalihStolpcev;
$parameterTabular = '|';
@@ -1477,17 +1485,19 @@ class AnalizaSums extends LatexAnalysisElement{
//ce je prvi stolpec
if($i == 0){
$parameterTabular .= ($export_format == 'pdf' ? 'P|' : 'l|');
- //$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'l|');
}else{
+ if($spremTip!=21){ //ce ni samo besedilo
$parameterTabular .= ($export_format == 'pdf' ? '>{\hsize='.$sirinaOstalihStolpcev.'\hsize \centering\arraybackslash}X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
- //$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
+ }else{
+ $parameterTabular .= ($export_format == 'pdf' ? '>{\hsize='.$sirinaOstalihStolpcev.'\hsize }X|' : 'l|');
+ }
}
}
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1501,15 +1511,19 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{>{\hsize=\dimexpr 6\hsize+\arrayrulewidth}X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
- //echo $dolzinaVprasanja."</br>";
- if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
+ if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
+ if($spremTip==21){
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & ".LatexDocument::encodeText($spremenljivka['naslov'])." ".$this->texNewLine;
+ }else{
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ }
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ if($spremTip==21){
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & ".LatexDocument::encodeText($spremenljivka['naslov'])." ".$this->texNewLine;
+ }else{
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{5}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ }
}
@@ -1518,10 +1532,11 @@ class AnalizaSums extends LatexAnalysisElement{
}
//druga vrstica tabele z naslovi stolpcev
- $tex .= $this->tableHeader($export_format);
+ if($spremTip!=21){ //ce ni samo besedilo
+ $tex .= $this->tableHeader($export_format);
+ }
/*Naslovni vrstici tabele - konec*/
-
$_answersOther = array();
$_grids_count = count($spremenljivka['grids']);
if ($_grids_count > 0)
@@ -1539,58 +1554,55 @@ class AnalizaSums extends LatexAnalysisElement{
$maxAnswer = (SurveyDataSettingProfiles :: getSetting('numOpenAnswers') > 0) ? SurveyDataSettingProfiles :: getSetting('numOpenAnswers') : 30;
$counter = 0;
$_kumulativa = 0;
- //SurveyAnalysis::$_FREQUENCYS[$_sequence]
- if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
+ $freq_seq = array_key_exists('valid', SurveyAnalysis::$_FREQUENCYS[$_sequence])?SurveyAnalysis::$_FREQUENCYS[$_sequence]:null;
+ if (is_countable($freq_seq)&&count($freq_seq)> 0 ) {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
- if (/*$vAnswer['cnt'] > 0 &&*/ $counter < $maxAnswer) { # izpisujemo samo tiste ki nisno 0
+ if ($counter < $maxAnswer) { # izpisujemo samo tiste ki nisno 0
# ali prikažemo vse odgovore ali pa samo toliko koliko je nastavljeno v TEXT_ANSWER_LIMIT
$textAnswerExceed = ($counter >= TEXT_ANSWER_LIMIT && count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']) > TEXT_ANSWER_LIMIT+2) ? true : false; # ali začnemo skrivati tekstovne odgovore
$options['isTextAnswer']=true;
$options['textAnswerExceed'] = $textAnswerExceed;
- /*$counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);*/
- $tex .= self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options);
+ $tex .= self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,$options, $spremTip);
}
$counter++;
}
# izpišemo sumo veljavnih
- /*$counter = self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);*/
- $tex .= self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
- }
- if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
- $_Z_MV = !$this->hideEmpty;
- if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $tex .= $this->encodeText($lang['srv_anl_missing1']);
+ if($spremTip!=21){ //ce ni samo besedilo
+ $tex .= self::outputSumaValidAnswerVertical($counter,$_sequence,$spid,$options);
}
- foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
- if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
- /*$counter = self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);*/
- $tex .= self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
+ }
+ if($spremTip!=21){ //ce ni samo besedilo
+ if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
+ $_Z_MV = !$this->hideEmpty;
+ if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
+ $tex .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
+ foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
+ if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
+ $tex .= self::outputInvalidAnswerVertical($counter,$ikey,$iAnswer,$_sequence,$spid,$options);
+ }
+ }
+ # izpišemo sumo veljavnih
+ $tex .= self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
}
- # izpišemo sumo veljavnih
- /*$counter = self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);*/
- $tex .= self::outputSumaInvalidAnswerVertical($counter,$_sequence,$spid,$options);
+ #izpišemo še skupno sumo
+ $tex .= self::outputSumaVertical($counter,$_sequence,$spid,$options);
}
- #izpišemo še skupno sumo
- /*$counter = self::outputSumaVertical($counter,$_sequence,$spid,$options);*/
- $tex .= self::outputSumaVertical($counter,$_sequence,$spid,$options);
} else {
$_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
}
}
}
//zaljucek latex tabele z obrobo za prvo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
-
+
# izpišemo še tekstovne odgovore za polja drugo
if (count($_answersOther) > 0 && self::$_FILTRED_OTHER) {
foreach ($_answersOther AS $oAnswers) {
- /*self::outputOtherAnswers($oAnswers);*/
$tex .= self::outputOtherAnswers($oAnswers, $parameterTabular, $export_format);
}
}
-
return $tex;
}
@@ -1616,7 +1628,7 @@ class AnalizaSums extends LatexAnalysisElement{
$_answers = SurveyAnalysis::getAnswers($spremenljivka,$num_show_records);
$_all_valid_answers_cnt = $_answers['validCnt'];
- $_valid_answers = $_answers['valid'];
+ $_valid_answers = isset($_answers['valid'])?$_answers['valid']:null;
$_answersOther = array();
@@ -1639,7 +1651,7 @@ class AnalizaSums extends LatexAnalysisElement{
$text[] = $_col['naslov'];
}
else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ $_answersOther[] = array('spid'=>$spid,'gid'=>isset($gid)?$gid:0,'vid'=>isset($vid)?$vid:0,'sequence'=>$_sequence);
}
$count++;
@@ -1666,7 +1678,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*Priprava parametrov za tabelo in ostala polja za nadaljnji izpis - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1683,15 +1695,12 @@ class AnalizaSums extends LatexAnalysisElement{
/*prva vrstica*/
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{p{16cm}|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
if($export_format != 'xls'){
@@ -1701,17 +1710,7 @@ class AnalizaSums extends LatexAnalysisElement{
if ($_grids_count > 0) {
$height = 0;
-/* // Testiramo visino vrstice glede na najdaljsi text
- foreach ($text AS $string){
- $singleWidth = ($count > 0) ? round(162 / $count): 162;
- //$height = ($this->getCellHeight($string, $singleWidth) > $height) ? $this->getCellHeight($string, $singleWidth) : $height;
- $height = 1;
- } */
-
- /*$this->pdf->MultiCell(18, $height, $this->encodeText(''), 1, 'C', 0, 0, 0 ,0, true);*/
-
- /*$this->dynamicCells($text, $count, 162, $height);*/
- /*$this->pdf->ln($height);*/
+
/*druga vrstica*/
$brezHline3 = 1;
$brezNoveVrstice3 = 1;
@@ -1743,7 +1742,7 @@ class AnalizaSums extends LatexAnalysisElement{
$_max_i = 0;
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']));
+ $_max_i = max($_max_i,min($num_show_records,(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:null)));
}
# za barvanje
@@ -1759,7 +1758,7 @@ class AnalizaSums extends LatexAnalysisElement{
# tabela z navedbami
$index=0;
# odvisno ali imamo odgovor
- if (count($_valid_answers) > 0) {
+ if (is_countable($_valid_answers) && count($_valid_answers) > 0) {
$text2 = '(';
foreach ($_valid_answers AS $answer) {
@@ -1771,7 +1770,7 @@ class AnalizaSums extends LatexAnalysisElement{
if($enota == 3)
$text2 .= $_ans."), (";
else
- $answers[$count][$index]='('.$this->encodeText($_ans).')';
+ $answers[$count][$index]='('.LatexDocument::encodeText($_ans).')';
}
$index++;
@@ -1790,40 +1789,38 @@ class AnalizaSums extends LatexAnalysisElement{
$last = $_max_i;
}
- if($enota != 3){
- for($i=0; $i<sizeof($answers[0]); $i++){
- $row = array();
- for($j=0; $j<$count; $j++){
- // Testiramo visino vrstice glede na najdaljsi text
- $singleWidth = ($count > 0) ? round(162 / $count): 162;
- //$height = ($this->getCellHeight($answers[$j][$i], $singleWidth) > $height) ? $this->getCellHeight($answers[$j][$i], $singleWidth) : $height;
- $height = 1;
- $row[$j] = $answers[$j][$i];
- }
-
-
- //$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
- $tex .= $this->sumLokacijaRowOutput($row, $count, $height, $grid['variable']);
- /*$this->sumLokacijaRowOutput($row, $count, $height, $grid['variable']);*/
-
- $tex .= $this->texNewLine; //nova vrstica
- if($export_format != 'xls'){
- $tex .= $this->horizontalLineTex; /*horizontalna crta*/
- }
- }
- }
- else{
- // Testiramo visino vrstice glede na najdaljsi text
- foreach ($text AS $string){
- $singleWidth = ($count > 0) ? round(162 / $count): 162;
- //$height = ($this->getCellHeight($string, $singleWidth) > $height) ? $this->getCellHeight($string, $singleWidth) : $height;
- $height = 1;
- }
-
- //$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
- $tex .= $this->sumLokacijaRowOutput($text, $count, $height, $grid['variable']);
- /*$this->sumLokacijaRowOutput($text, $count, $height, $grid['variable']);*/
- }
+ if($enota != 3){
+ for($i=0; $i<sizeof(isset($answers[0])?$answers[0]:array()); $i++){
+ $row = array();
+ for($j=0; $j<$count; $j++){
+ // Testiramo visino vrstice glede na najdaljsi text
+ $singleWidth = ($count > 0) ? round(162 / $count): 162;
+ //$height = ($this->getCellHeight($answers[$j][$i], $singleWidth) > $height) ? $this->getCellHeight($answers[$j][$i], $singleWidth) : $height;
+ $height = 1;
+ $row[$j] = $answers[$j][$i];
+ }
+
+
+ //$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
+ $tex .= $this->sumLokacijaRowOutput($row, $count, $height, $variable['variable']);
+
+ $tex .= $this->texNewLine; //nova vrstica
+ if($export_format != 'xls'){
+ $tex .= $this->horizontalLineTex; /*horizontalna crta*/
+ }
+ }
+ }
+ else{
+ // Testiramo visino vrstice glede na najdaljsi text
+ foreach ($text AS $string){
+ $singleWidth = ($count > 0) ? round(162 / $count): 162;
+ //$height = ($this->getCellHeight($string, $singleWidth) > $height) ? $this->getCellHeight($string, $singleWidth) : $height;
+ $height = 1;
+ }
+
+ //$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
+ $tex .= $this->sumLokacijaRowOutput($text, $count, $height, $variable['variable']);
+ }
/*zakljucek vrstice s podatki*/
/* $tex .= $this->texNewLine; //nova vrstica
$tex .= $this->horizontalLineTex; //horizontalna crta */
@@ -1832,7 +1829,7 @@ class AnalizaSums extends LatexAnalysisElement{
//zaljucek latex tabele z obrobo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo - konec
}
//echo "tex: ".$tex."</br>";
@@ -1847,10 +1844,10 @@ class AnalizaSums extends LatexAnalysisElement{
* @param type $height - izracunana najvisja visina celice v vrstici
* @param type $variable - array variabel/stolpcev
*/
- function sumLokacijaRowOutput($text='', $count, $height=null, $variable='') {
+ function sumLokacijaRowOutput($text='', $count=null, $height=null, $variable='') {
$texSumLokacijaRowOutput = '';
- $texSumLokacijaRowOutput .= " & ".$this->encodeText($variable);
-/* $this->pdf->MultiCell(18, $height, $this->encodeText($variable), 1, 'C', 0, 0, 0 ,0, true);
+ $texSumLokacijaRowOutput .= " & ".LatexDocument::encodeText($variable);
+/* $this->pdf->MultiCell(18, $height, LatexDocument::encodeText($variable), 1, 'C', 0, 0, 0 ,0, true);
$this->dynamicCells($text, $count, 162, $height);
$this->pdf->ln($height); */
$texSumLokacijaRowOutput .= $this->dynamicCells($text, $count);
@@ -1862,7 +1859,7 @@ class AnalizaSums extends LatexAnalysisElement{
*
* @param unknown_type $spid
*/
- function sumMultiText($spid=null, $_from, $export_format='') {
+ function sumMultiText($spid=null, $_from=null, $export_format='') {
//echo "sumMultiText </br>";
global $lang;
$tex = '';
@@ -1914,7 +1911,7 @@ class AnalizaSums extends LatexAnalysisElement{
$text[] = $_col['naslov'];
}
else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ $_answersOther[] = array('spid'=>$spid,'gid'=>isset($gid)?$gid:0,'vid'=>isset($vid)?$vid:0,'sequence'=>$_sequence);
}
$count++;
@@ -1941,7 +1938,7 @@ class AnalizaSums extends LatexAnalysisElement{
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1956,16 +1953,17 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{p{16cm}|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -1974,7 +1972,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//druga vrstica
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$count."}{c|}{".$this->encodeText($lang['srv_analiza_opisne_arguments'])."} ".$this->texNewLine;
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$count."}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_arguments'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -2021,7 +2019,7 @@ class AnalizaSums extends LatexAnalysisElement{
$_max_i = 0;
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $_max_i = max($_max_i,min($num_show_records,SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']));
+ $_max_i = max($_max_i,min($num_show_records,(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:null)));
}
# za barvanje
@@ -2066,8 +2064,8 @@ class AnalizaSums extends LatexAnalysisElement{
$height = 1;
}
- $tex .= $this->encodeText($grid['variable']);
- $tex .= " & ".$this->encodeText($grid['naslov']);
+ $tex .= LatexDocument::encodeText(isset($grid['variable'])?$grid['variable']:'');
+ $tex .= " & ".LatexDocument::encodeText($grid['naslov']);
$tex .= " & ".$this->dynamicCells($text, $count); //izpis celic z izracuni odgovorov v stolpcih (npr. Sploh ne velja, ...)
@@ -2082,7 +2080,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*izpis vrstic s podatki - konec*/
//zaljucek latex tabele z obrobo za drugo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
}
@@ -2123,7 +2121,7 @@ class AnalizaSums extends LatexAnalysisElement{
$text[] = $_col['naslov'];
}
else {
- $_answersOther[] = array('spid'=>$spid,'gid'=>$gid,'vid'=>$vid,'sequence'=>$_sequence);
+ $_answersOther[] = array('spid'=>$spid,'gid'=>isset($gid)?$gid:0,'vid'=>isset($vid)?$vid:0,'sequence'=>$_sequence);
}
$count++;
@@ -2149,7 +2147,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*Priprava parametrov za tabelo in ostala polja za nadaljnji izpis - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -2164,16 +2162,16 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
if($export_format != 'xls'){
@@ -2181,7 +2179,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
//druga vrstica
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$count."}{c|}{".$this->encodeText($lang['srv_analiza_sums_average'])."} ".$this->texNewLine;
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$count."}{c|}{".LatexDocument::encodeText($lang['srv_analiza_sums_average'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -2214,8 +2212,8 @@ class AnalizaSums extends LatexAnalysisElement{
foreach ($spremenljivka['grids'] AS $gid => $grid) {
$_variables_count = count($grid['variables']);
- $tex .= $this->encodeText($grid['variable']);
- $tex .= " & ".$this->encodeText($grid['naslov']);
+ $tex .= LatexDocument::encodeText($grid['variable']);
+ $tex .= " & ".LatexDocument::encodeText($grid['naslov']);
if ($_variables_count > 0) {
@@ -2225,7 +2223,7 @@ class AnalizaSums extends LatexAnalysisElement{
$_sequence = $variable['sequence']; # id kolone z podatki
if ($variable['other'] != true) {
# tabela z navedbami
- $text[] = self::formatNumber(SurveyAnalysis::$_FREQUENCYS[$_sequence]['average'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
+ $text[] = self::formatNumber((isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['average'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['average']:null),SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'');
$count++;
}
//$count++;
@@ -2241,7 +2239,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*izpis vrstic s podatki - konec*/
//zaljucek latex tabele z obrobo za drugo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
}
@@ -2263,7 +2261,7 @@ class AnalizaSums extends LatexAnalysisElement{
# ugotovimo koliko imamo kolon
$gid=0;
- $_clmn_cnt = SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_vars']-SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_other'];
+ $_clmn_cnt = SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_vars']-(isset(SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_other'])?SurveyAnalysis::$_HEADERS[$spid]['grids'][$gid]['cnt_other']:null);
# tekst vprašanja
/*Priprava parametrov za tabelo in polja za 3. vrstico */
@@ -2304,7 +2302,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*Priprava parametrov za tabelo in polja za 3. vrstico - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -2319,15 +2317,15 @@ class AnalizaSums extends LatexAnalysisElement{
/* prva vrstica */
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ //$tex .= LatexDocument::encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.LatexDocument::encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
//echo $dolzinaVprasanja."</br>";
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
if($export_format != 'xls'){
@@ -2338,13 +2336,13 @@ class AnalizaSums extends LatexAnalysisElement{
/* druga vrstica*/
//$steviloPodStolpcev2 = count($spremenljivka['options']) + 1;
$steviloPodStolpcev2 = $count;
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$steviloPodStolpcev2."}{c|}{".$this->encodeText($lang['srv_analiza_opisne_answers'])."} ";
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_subquestion1'])." & \multicolumn{".$steviloPodStolpcev2."}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_answers'])."} ";
- $tex .= " & ".$this->encodeText($lang['srv_analiza_opisne_valid']);
- $tex .= " & ".$this->encodeText($lang['srv_analiza_num_units']);
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_opisne_valid']);
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_analiza_num_units']);
$steviloPodStolpcev3 = $count+1;
- $tex .= " & \multicolumn{".$steviloPodStolpcev3."}{c|}{".$this->encodeText($lang['srv_analiza_opisne_arguments'])."} ";
+ $tex .= " & \multicolumn{".$steviloPodStolpcev3."}{c|}{".LatexDocument::encodeText($lang['srv_analiza_opisne_arguments'])."} ";
$tex .= $this->texNewLine; //nova vrstica
if($export_format != 'xls'){
@@ -2389,7 +2387,7 @@ class AnalizaSums extends LatexAnalysisElement{
}
$this->dynamicCells($text, $count, 44, $height); */
- $tex .= " & ".$this->encodeText($lang['srv_anl_suma1']); //Skupaj
+ $tex .= " & ".LatexDocument::encodeText($lang['srv_anl_suma1']); //Skupaj
$tex .= $this->texNewLine;
if($export_format != 'xls'){
@@ -2401,12 +2399,12 @@ class AnalizaSums extends LatexAnalysisElement{
foreach (SurveyAnalysis::$_HEADERS[$spid]['grids'] AS $gid => $grids) {
$_cnt = 0;
- $height = 1;//$height = $this->getCellHeight($this->encodeText($grids['naslov']), 18);
+ $height = 1;//$height = $this->getCellHeight(LatexDocument::encodeText($grids['naslov']), 18);
$height = ($height < 8 ? 8 : $height);
# vodoravna vrstice s podatki
- $tex .= $this->encodeText($grids['variable']);
- $tex .= " & ".$this->encodeText($grids['naslov']);
+ $tex .= LatexDocument::encodeText($grids['variable']);
+ $tex .= " & ".LatexDocument::encodeText($grids['naslov']);
$_arguments = 0;
@@ -2472,7 +2470,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*vrstice s podatki - konec*/
/*zaljucek latex tabele z obrobo za prvo tabelo*/
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
/*zaljucek latex tabele z obrobo za prvo tabelo - konec*/
# izpišemo še tekstovne odgovore za polja drugo
@@ -2494,10 +2492,11 @@ class AnalizaSums extends LatexAnalysisElement{
*/
function outputGridLabelVertical($gid=null, $grid=null, $vid=null, $variable=null, $spid=null, $_options=array()) {
//echo "outputGridLabelVertical </br>";
+ $counter = 0;
$text = array();
- $text[] = $this->encodeText($variable['variable']);
- $text[] = $this->encodeText(($grid['naslov'] != '' ? $grid['naslov']. '&nbsp;-&nbsp;' : '').$variable['naslov']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText(($grid['naslov'] != '' ? $grid['naslov']. '&nbsp;-&nbsp;' : '').$variable['naslov']);
$text[] = '';
$text[] = '';
@@ -2548,7 +2547,7 @@ class AnalizaSums extends LatexAnalysisElement{
if (count($grid['variables']) > 0 )
foreach ($grid['variables'] AS $vid => $variable ){
$_sequence = $variable['sequence']; # id kolone z podatki
- $only_valid += (int)SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'];
+ $only_valid += (int)(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:null);
}
}
}
@@ -2602,14 +2601,13 @@ class AnalizaSums extends LatexAnalysisElement{
//$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'l|');
}else{
$parameterTabular .= ($export_format == 'pdf' ? '>{\hsize='.$sirinaOstalihStolpcev.'\hsize \centering\arraybackslash}X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
- //$parameterTabular .= ($export_format == 'pdf' ? 'X|' : 'c|'); /*sirina ostalih je odvisna od njihovega stevila, da se sirine razporedijo po celotni sirini tabele*/
}
}
/*Priprava parametrov za tabelo in ostala polja za nadaljnji izpis - konec*/
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -2624,15 +2622,11 @@ class AnalizaSums extends LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
$steviloPodStolpcev1 = $steviloStolpcevParameterTabular - 1;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
- //$tex .= $this->encodeText($spremenljivka['variable']).' & \multicolumn{'.$steviloPodStolpcev1.'}{>{\hsize=\dimexpr '.($steviloPodStolpcev1+1).'\hsize + '.($steviloPodStolpcev1+1).'\tabcolsep + \arrayrulewidth}X|}{'.$this->encodeText($spremenljivka['naslov']).'} '.$this->texNewLine;
- $dolzinaVprasanja = strlen($this->encodeText($spremenljivka['naslov']));
- //echo $dolzinaVprasanja."</br>";
+ $dolzinaVprasanja = strlen(LatexDocument::encodeText($spremenljivka['naslov']));
if($dolzinaVprasanja > MEJA_DOLZINA_VPRASANJA){ //ce je dolzina vprasanja daljsa od ene vrstice v tabeli
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{X|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}else{
- $tex .= $this->encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".$this->encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
+ $tex .= LatexDocument::encodeText($spremenljivka['variable'])." & \multicolumn{".$steviloPodStolpcev1."}{l|}{".LatexDocument::encodeText($spremenljivka['naslov'])."} ".$this->texNewLine;
}
@@ -2659,7 +2653,7 @@ class AnalizaSums extends LatexAnalysisElement{
/*Konec naslovnih vrstic*/
//tretja vrstica
- $tex .= " \multicolumn{".$steviloStolpcevParameterTabular."}{|c|}{".$this->encodeText($lang['srv_analiza_heatmap_clicked_coords'])."} ".$this->texNewLine;
+ $tex .= " \multicolumn{".$steviloStolpcevParameterTabular."}{|c|}{".LatexDocument::encodeText($lang['srv_analiza_heatmap_clicked_coords'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -2670,13 +2664,13 @@ class AnalizaSums extends LatexAnalysisElement{
//cetrta vrstica
$cetrtaVrstica = array();
- $cetrtaVrstica[] = $this->encodeText($lang['coordinates']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_valid_heatmap']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_num_units_valid_heatmap']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_means_label']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_odklon']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_min']);
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_max']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['coordinates']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid_heatmap']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_num_units_valid_heatmap']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_means_label']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_odklon']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_min']);
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_max']);
$tex .= $this->tableRow($cetrtaVrstica, $brezHline);
//cetrta vrstica - konec
@@ -2684,24 +2678,24 @@ class AnalizaSums extends LatexAnalysisElement{
//peta vrstica x
$petaVrstica = array();
$petaVrstica[] = 'x';
- $petaVrstica[] = $this->encodeText($validHeatmapRegion);
- $petaVrstica[] = $this->encodeText($ustrezniHeatmapRegion);
- $petaVrstica[] = $this->encodeText($povprecjeHeatmapClicksX);
- $petaVrstica[] = $this->encodeText($stdevHeatmapClicksX);
- $petaVrstica[] = $this->encodeText($minHeatmapClicksX);
- $petaVrstica[] = $this->encodeText($maxHeatmapClicksX);
+ $petaVrstica[] = LatexDocument::encodeText($validHeatmapRegion);
+ $petaVrstica[] = LatexDocument::encodeText($ustrezniHeatmapRegion);
+ $petaVrstica[] = LatexDocument::encodeText($povprecjeHeatmapClicksX);
+ $petaVrstica[] = LatexDocument::encodeText($stdevHeatmapClicksX);
+ $petaVrstica[] = LatexDocument::encodeText($minHeatmapClicksX);
+ $petaVrstica[] = LatexDocument::encodeText($maxHeatmapClicksX);
$tex .= $this->tableRow($petaVrstica, $brezHline);
//peta vrstica x - konec
//sesta vrstica y
$sestaVrstica = array();
$sestaVrstica[] = 'y';
- $sestaVrstica[] = $this->encodeText($validHeatmapRegion);
- $sestaVrstica[] = $this->encodeText($ustrezniHeatmapRegion);
- $sestaVrstica[] = $this->encodeText($povprecjeHeatmapClicksY);
- $sestaVrstica[] = $this->encodeText($stdevHeatmapClicksY);
- $sestaVrstica[] = $this->encodeText($minHeatmapClicksY);
- $sestaVrstica[] = $this->encodeText($maxHeatmapClicksY);
+ $sestaVrstica[] = LatexDocument::encodeText($validHeatmapRegion);
+ $sestaVrstica[] = LatexDocument::encodeText($ustrezniHeatmapRegion);
+ $sestaVrstica[] = LatexDocument::encodeText($povprecjeHeatmapClicksY);
+ $sestaVrstica[] = LatexDocument::encodeText($stdevHeatmapClicksY);
+ $sestaVrstica[] = LatexDocument::encodeText($minHeatmapClicksY);
+ $sestaVrstica[] = LatexDocument::encodeText($maxHeatmapClicksY);
$tex .= $this->tableRow($sestaVrstica, $brezHline);
//sesta vrstica y - konec
//vrstici s podatki za x in y koordinati - konec
@@ -2712,7 +2706,7 @@ class AnalizaSums extends LatexAnalysisElement{
if($RegionPresent){ //ce imamo obmocja
//7. vrstica - naslovna za obmocja
- $tex .= " \multicolumn{".$steviloStolpcevParameterTabular."}{|c|}{".$this->encodeText($lang['srv_analiza_heatmap_clicked_regions'])."} ".$this->texNewLine;
+ $tex .= " \multicolumn{".$steviloStolpcevParameterTabular."}{|c|}{".LatexDocument::encodeText($lang['srv_analiza_heatmap_clicked_regions'])."} ".$this->texNewLine;
if($export_format != 'xls'){
$tex .= $this->horizontalLineTex; /*obroba*/
}
@@ -2720,13 +2714,13 @@ class AnalizaSums extends LatexAnalysisElement{
//8. vrstica
$osmaVrstica = array();
- $osmaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_frequency_heatmap']);//od tretjega stolpca dalje, ker prva dva sta za naslov Obmocja kot multicolumn
- $osmaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_valid_heatmap']);
- $osmaVrstica[] = $this->encodeText('% - '.$lang['srv_analiza_opisne_valid_heatmap']);
- $osmaVrstica[] = $this->encodeText($lang['srv_analiza_num_units_valid_heatmap']);
- $osmaVrstica[] = $this->encodeText('% - '.$lang['srv_analiza_num_units_valid_heatmap']);
+ $osmaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_frequency_heatmap']);//od tretjega stolpca dalje, ker prva dva sta za naslov Obmocja kot multicolumn
+ $osmaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid_heatmap']);
+ $osmaVrstica[] = LatexDocument::encodeText('% - '.$lang['srv_analiza_opisne_valid_heatmap']);
+ $osmaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_num_units_valid_heatmap']);
+ $osmaVrstica[] = LatexDocument::encodeText('% - '.$lang['srv_analiza_num_units_valid_heatmap']);
- $tex .= " \multicolumn{2}{|c|}{".$this->encodeText($lang['srv_hot_spot_regions_menu'])."} ";
+ $tex .= " \multicolumn{2}{|c|}{".LatexDocument::encodeText($lang['srv_hot_spot_regions_menu'])."} ";
$tex .= $this->tableRow($osmaVrstica, 0, 0, 1);
//echo $tex;
//8. vrstica - konec
@@ -2739,58 +2733,45 @@ class AnalizaSums extends LatexAnalysisElement{
if ($_grids_count > 0) {
$_row = $spremenljivka['grids'][0];
$indeks = 0;
- //$veljavnaSkupnaFreq = 0;
if (count($_row['variables'])>0){
foreach ($_row['variables'] AS $rid => $_col ){
$_sequence = $_col['sequence']; # id kolone z podatki
if ($_col['other'] != true) {
if($indeks != 0){
- //echo "_col: ".strip_tags ($_col['naslov'])."</br>";
//od 9. vrstice dalje, kjer so po vrsticah obmocja in njihovi podatki
$devetaVrstica = array();
//1. stolpcev z imenom obmocja
- //echo $_col['naslov'];
- //$devetaVrstica[] = $this->encodeText($_col['naslov']);
- $devetaVrstica[] = " \multicolumn{2}{|c|}{".$this->encodeText($_col['naslov'])."} ";
- //$tex .= " \multicolumn{2}{|c|}{".$this->encodeText($_col['naslov'])."} ";
+ $devetaVrstica[] = " \multicolumn{2}{|c|}{".LatexDocument::encodeText($_col['naslov'])."} ";
//1. stolpcev z imenom obmocja - konec
//2. stolpec - Frekvenca
$freqHeatmapRegion = SurveyAnalysis::freqHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers, $indeks, $export);
- $veljavnaSkupnaFreq = $veljavnaSkupnaFreq + $freqHeatmapRegion;
- //echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$freqHeatmapRegion.'</td>';
- //$devetaVrstica[] = $this->encodeText($freqHeatmapRegion);
+ $veljavnaSkupnaFreq = isset($veljavnaSkupnaFreq)?$veljavnaSkupnaFreq:0 + $freqHeatmapRegion;
$devetaVrstica[] = $freqHeatmapRegion;
//2. stolpec - Frekvenca - konec
//3. stolpec - Veljavni
- //$validHeatmapRegion = self::validHeatmapRegion($spremenljivka['grids'], $spid, $_valid_answers);
- //echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$validHeatmapRegion.'</td>';
- $devetaVrstica[] = $this->encodeText($validHeatmapRegion);
+ $devetaVrstica[] = LatexDocument::encodeText($validHeatmapRegion);
//3. stolpec - Veljavni - konec
//4. stolpec - % Veljavni
$_procentValidHeatmapRegion = ($validHeatmapRegion > 0 ) ? 100*$freqHeatmapRegion / $validHeatmapRegion : 0;
$_procentValidHeatmapRegion = self::formatNumber($_procentValidHeatmapRegion, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- //echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$_procentValidHeatmapRegion.'</td>';
- $devetaVrstica[] = $this->encodeText($_procentValidHeatmapRegion);
+ $devetaVrstica[] = LatexDocument::encodeText($_procentValidHeatmapRegion);
//4. stolpec - % Veljavni - konec
//5. stolpec - Ustrezni
$ustrezniHeatmapRegion = SurveyAnalysis::ustrezniHeatmapRegion($spid, $_valid_answers, $_sequence); //vsi mozni kliki
- //echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$ustrezniHeatmapRegion.'</td>';
- $devetaVrstica[] = $this->encodeText($ustrezniHeatmapRegion);
+ $devetaVrstica[] = LatexDocument::encodeText($ustrezniHeatmapRegion);
//5. stolpec - Ustrezni - konec
//6. stolpec - % Ustrezni
$_procentUstrezniHeatmapRegion = ($ustrezniHeatmapRegion > 0 ) ? 100*$freqHeatmapRegion / $ustrezniHeatmapRegion : 0;
$_procentUstrezniHeatmapRegion = self::formatNumber($_procentUstrezniHeatmapRegion, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'),'%');
- //echo '<td class="anl_bl anl_br anl_bb anl_ac">'.$_procentUstrezniHeatmapRegion.'</td>';
- $devetaVrstica[] = $this->encodeText($_procentUstrezniHeatmapRegion);
+ $devetaVrstica[] = LatexDocument::encodeText($_procentUstrezniHeatmapRegion);
//6. stolpec - % Ustrezni - konec
$tex .= $this->tableRow($devetaVrstica, $brezHline);
- //echo $tex;
//od 9. vrstice dalje, kjer so po vrsticah obmocja in njihovi podatki - konec
//*********** Izris veljavnih in manjkajocih vrednosti
@@ -2798,14 +2779,10 @@ class AnalizaSums extends LatexAnalysisElement{
$options['isTextAnswer'] = false;
$manjkajoci = $ustrezniHeatmapRegion - $validHeatmapRegion;
- //10. vrstica
- //$validHeatmapRegion
- //echo $validHeatmapRegion;
- //echo "validHeatmapRegion: ".$validHeatmapRegion."</br>";
- //$counter = SurveyAnalysis::outputSumaValidAnswerHeatmap($counter,$_sequence,$spid,$options, $validHeatmapRegion);
+ //10. vrstica
$desetaVrstica = array();
- $desetaVrstica[] = $this->encodeText($lang['srv_analiza_opisne_valid']);
- $desetaVrstica[] = $this->encodeText($lang['srv_analiza_manjkajocevrednosti']);
+ $desetaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_opisne_valid']);
+ $desetaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_manjkajocevrednosti']);
$desetaVrstica[] = $validHeatmapRegion;
$desetaVrstica[] = " \multicolumn{4}{|c|}{ } ";
$tex .= $this->tableRow($desetaVrstica, $brezHline);
@@ -2813,8 +2790,8 @@ class AnalizaSums extends LatexAnalysisElement{
//11. vrstica
$enajstaVrstica = array();
- $enajstaVrstica[] = $this->encodeText($lang['srv_anl_missing1']);
- $enajstaVrstica[] = $this->encodeText($lang['srv_analiza_manjkajocevrednosti']);
+ $enajstaVrstica[] = LatexDocument::encodeText($lang['srv_anl_missing1']);
+ $enajstaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_manjkajocevrednosti']);
$enajstaVrstica[] = $manjkajoci;
$enajstaVrstica[] = " \multicolumn{4}{|c|}{ } ";
$tex .= $this->tableRow($enajstaVrstica, $brezHline);
@@ -2822,30 +2799,12 @@ class AnalizaSums extends LatexAnalysisElement{
//12. vrstica
$dvanajstaVrstica = array();
- $dvanajstaVrstica[] = " \multicolumn{2}{|c|}{".$this->encodeText($lang['srv_anl_suma_valid'])." } ";
+ $dvanajstaVrstica[] = " \multicolumn{2}{|c|}{".LatexDocument::encodeText($lang['srv_anl_suma_valid'])." } ";
$dvanajstaVrstica[] = $ustrezniHeatmapRegion;
$dvanajstaVrstica[] = " \multicolumn{4}{|c|}{ } ";
$tex .= $this->tableRow($dvanajstaVrstica, $brezHline);
//12. vrstica - konec
-/* if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
- foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
- if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki niso 0
- //$counter = SurveyAnalysis::outputInvalidAnswerHeatmap($counter,$ikey,$iAnswer,$_sequence,$spid,$options, $manjkajoci);
- //$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$iAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
- $_invalid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ) ? 100*$iAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
- echo "_invalid: ".$_invalid."</br>";
- //echo "_percent: ".$_percent."</br>";
- }
- }
- # izpišemo sumo neveljavnih
- //$counter = SurveyAnalysis::outputSumaInvalidAnswerHeatmap($counter,$_sequence,$spid,$options, $manjkajoci);
- echo "manjkajoci: ".$manjkajoci."</br>";
- } */
- #izpišemo še skupno sumo
- //$counter = SurveyAnalysis::outputSumaHeatmap($counter,$_sequence,$spid,$options, $ustrezniHeatmapRegion);
- //$ustrezniHeatmapRegion
- //echo "ustrezniHeatmapRegion: ".$ustrezniHeatmapRegion."</br>";
$veljavnaSkupnaFreq = 0;
}
//*********** Izris veljavnih in manjkajocih vrednosti - konec
@@ -2871,7 +2830,7 @@ class AnalizaSums extends LatexAnalysisElement{
//zaljucek latex tabele z obrobo za drugo tabelo
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za drugo tabelo - konec
/* if (count($spremenljivka['grids']) > 0) {
@@ -2892,31 +2851,31 @@ class AnalizaSums extends LatexAnalysisElement{
if($arrayText[0] == '')
$arrayText[0] = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 30);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 30);
$linecount == 1 ? $height = 1 : $height = 4.7 + ($linecount-1)*3.3;*/
$text = array();
for($i=0; $i<$count-1; $i++){
//for($i=0; $i<$count; $i++){
if($arrayText[$i] == '')
$arrayText[$i] = '';
- /*$this->pdf->MultiCell($singleWidth, $height, $this->encodeText($arrayText[$i]), 1, 'C', 0, 0, 0 ,0, true);*/
+ /*$this->pdf->MultiCell($singleWidth, $height, LatexDocument::encodeText($arrayText[$i]), 1, 'C', 0, 0, 0 ,0, true);*/
- /*$texDynamicCells .= $this->encodeText($arrayText[$i]);*/
- $text[$i] = $this->encodeText($arrayText[$i]);
+ /*$texDynamicCells .= LatexDocument::encodeText($arrayText[$i]);*/
+ $text[$i] = LatexDocument::encodeText($arrayText[$i]);
}
//zadnje polje izrisemo druge sirine ker se drugace zaradi zaokrozevanja tabela porusi
/*$lastWidth = ($lastWidth < 4) ? 4 : $lastWidth;*/
if($count > 0){
- /*$this->pdf->MultiCell($lastWidth, $height, $this->encodeText($arrayText[$count-1]), 1, 'C', 0, 0, 0 ,0, true);*/
+ /*$this->pdf->MultiCell($lastWidth, $height, LatexDocument::encodeText($arrayText[$count-1]), 1, 'C', 0, 0, 0 ,0, true);*/
- /*$texDynamicCells .= $this->encodeText($arrayText[$count-1]);*/
- $text[$count-1] = $this->encodeText($arrayText[$count-1]);
+ /*$texDynamicCells .= LatexDocument::encodeText($arrayText[$count-1]);*/
+ $text[$count-1] = LatexDocument::encodeText($arrayText[$count-1]);
}else{
- /*$this->pdf->MultiCell($lastWidth, $height, $this->encodeText(''), 1, 'C', 0, 0, 0 ,0, true);*/
+ /*$this->pdf->MultiCell($lastWidth, $height, LatexDocument::encodeText(''), 1, 'C', 0, 0, 0 ,0, true);*/
- /*$texDynamicCells .= $this->encodeText('');*/
- $text[$count-1] = $this->encodeText('');
+ /*$texDynamicCells .= LatexDocument::encodeText('');*/
+ $text[$count-1] = LatexDocument::encodeText('');
}
$brezHline = 1;
@@ -2929,7 +2888,7 @@ class AnalizaSums extends LatexAnalysisElement{
function getCellHeight($string='', $width=null){
// Star nacin
- //$linecount = $this->pdf->getNumLines($this->encodeText($string), $width);
+ //$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($string), $width);
//$height = ( $linecount == 1 ? 4.7 : (4.7 + ($linecount-1)*3.5) );
$this->pdf->startTransaction();
@@ -2945,6 +2904,7 @@ class AnalizaSums extends LatexAnalysisElement{
static function HeatmapRegionPresence($spremenljivkaGrids=null, $spid=null, $_valid_answers=null){
$HeatmapRegionPresence = false;
+ $num_show_records = SurveyAnalysis::getNumRecords();
foreach ($spremenljivkaGrids AS $gid => $grid){
$_variables_count = count($grid['variables']);
if ($_variables_count > 0){
diff --git a/admin/survey/export/latexclasses/Analize/AnalizaTTest.php b/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
index a0f832b..8e1bb58 100644
--- a/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
+++ b/admin/survey/export/latexclasses/Analize/AnalizaTTest.php
@@ -2,41 +2,41 @@
global $site_path;
- include_once('../../function.php');
- include_once('../survey/definition.php');
+/* include_once('../../function.php');
+ include_once('../survey/definition.php'); */
- define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
- define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
+ if(!defined("ALLOW_HIDE_ZERRO_REGULAR"))define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
+ if(!defined("ALLOW_HIDE_ZERRO_MISSING"))define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
-
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
-
- define("FNT_FREESERIF", "freeserif");
- define("FNT_FREESANS", "freesans");
- define("FNT_HELVETICA", "helvetica");
-
- define("FNT_MAIN_TEXT", FNT_FREESANS);
- define("FNT_QUESTION_TEXT", FNT_FREESANS);
- define("FNT_HEADER_TEXT", FNT_FREESANS);
-
- define("FNT_MAIN_SIZE", 10);
- define("FNT_QUESTION_SIZE", 9);
- define("FNT_HEADER_SIZE", 10);
-
- define("RADIO_BTN_SIZE", 3);
- define("CHCK_BTN_SIZE", 3);
- define("LINE_BREAK", 6);
-
- define ('PDF_MARGIN_HEADER', 8);
- define ('PDF_MARGIN_FOOTER', 12);
- define ('PDF_MARGIN_TOP', 18);
- define ('PDF_MARGIN_BOTTOM', 18);
- define ('PDF_MARGIN_LEFT', 15);
- define ('PDF_MARGIN_RIGHT', 15);
+ if(!defined("NUM_DIGIT_AVERAGE"))define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if(!defined("NUM_DIGIT_DEVIATION"))define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+
+ if(!defined("M_ANALIZA_DESCRIPTOR"))define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if(!defined("M_ANALIZA_FREQUENCY"))define("M_ANALIZA_FREQUENCY", "frequency");
+
+ if(!defined("FNT_FREESERIF"))define("FNT_FREESERIF", "freeserif");
+ if(!defined("FNT_FREESANS"))define("FNT_FREESANS", "freesans");
+ if(!defined("FNT_HELVETICA"))define("FNT_HELVETICA", "helvetica");
+
+ if(!defined("FNT_MAIN_TEXT"))define("FNT_MAIN_TEXT", FNT_FREESANS);
+ if(!defined("FNT_QUESTION_TEXT"))define("FNT_QUESTION_TEXT", FNT_FREESANS);
+ if(!defined("FNT_HEADER_TEXT"))define("FNT_HEADER_TEXT", FNT_FREESANS);
+
+ if(!defined("FNT_MAIN_SIZE"))define("FNT_MAIN_SIZE", 10);
+ if(!defined("FNT_QUESTION_SIZE"))define("FNT_QUESTION_SIZE", 9);
+ if(!defined("FNT_HEADER_SIZE"))define("FNT_HEADER_SIZE", 10);
+
+ if(!defined("RADIO_BTN_SIZE"))define("RADIO_BTN_SIZE", 3);
+ if(!defined("CHCK_BTN_SIZE"))define("CHCK_BTN_SIZE", 3);
+ if(!defined("LINE_BREAK"))define("LINE_BREAK", 6);
+
+ if(!defined("PDF_MARGIN_HEADER"))define ('PDF_MARGIN_HEADER', 8);
+ if(!defined("PDF_MARGIN_FOOTER"))define ('PDF_MARGIN_FOOTER', 12);
+ if(!defined("PDF_MARGIN_TOP"))define ('PDF_MARGIN_TOP', 18);
+ if(!defined("PDF_MARGIN_BOTTOM"))define ('PDF_MARGIN_BOTTOM', 18);
+ if(!defined("PDF_MARGIN_LEFT"))define ('PDF_MARGIN_LEFT', 15);
+ if(!defined("PDF_MARGIN_RIGHT"))define ('PDF_MARGIN_RIGHT', 15);
/** Class za generacijo izvoza v Latex
@@ -76,8 +76,6 @@ class AnalizaTTest extends LatexAnalysisElement{
{
$this->anketa['id'] = $anketa;
$this->anketa['podstran'] = $podstran;
- // create new PDF document
- //$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
else
{
@@ -106,12 +104,7 @@ class AnalizaTTest extends LatexAnalysisElement{
{
return $this->pi['canCreate'];
}
- function getFile($fileName=null)
- {
- //Close and output PDF document
- ob_end_clean();
- $this->pdf->Output($fileName, 'I');
- }
+
function init()
@@ -125,35 +118,7 @@ class AnalizaTTest extends LatexAnalysisElement{
$language_meta['a_meta_language'] = 'sl';
$language_meta['w_page'] = $lang['page'];
- //set some language-dependent strings
- $this->pdf->setLanguageArray($language_meta);
-
- //set margins
- $this->pdf->setPrintHeaderFirstPage(true);
- $this->pdf->setPrintFooterFirstPage(true);
- $this->pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
- $this->pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
- $this->pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
-
- // set header and footer fonts
- $this->pdf->setHeaderFont(Array(FNT_HEADER_TEXT, "I", FNT_HEADER_SIZE));
- $this->pdf->setFooterFont(Array(FNT_HEADER_TEXT, 'I', FNT_HEADER_SIZE));
-
-
- // set document information
- $this->pdf->SetAuthor('An Order Form');
- $this->pdf->SetTitle('An Order');
- $this->pdf->SetSubject('An Order');
-
- // set default header data
- $this->pdf->SetHeaderData(null, null, "www.1ka.si", $this->encodeText(SurveyInfo::getInstance()->getSurveyAkronim()));
- //set auto page breaks
- $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
-
- $this->pdf->SetFont(FNT_MAIN_TEXT, '', FNT_MAIN_SIZE);
- //set image scale factor
- $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
return true;
}
@@ -210,7 +175,7 @@ class AnalizaTTest extends LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za prvo tabelo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -239,8 +204,8 @@ class AnalizaTTest extends LatexAnalysisElement{
$poravnava = "c";
- $tabela .= " & \multicolumn{".$steviloOstalihStolpcev."}{".$poravnava."|}{".$this->returnBold($this->encodeText($sprLabel1))."} ".$this->texNewLine;
- //$tabela .= ' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev).'\hsize + '.($steviloOstalihStolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->returnBold($this->encodeText($sprLabel1)).'} '.$this->texNewLine;
+ $tabela .= " & \multicolumn{".$steviloOstalihStolpcev."}{".$poravnava."|}{".$this->returnBold(LatexDocument::encodeText($sprLabel1))."} ".$this->texNewLine;
+ //$tabela .= ' & \multicolumn{'.$steviloOstalihStolpcev.'}{>{\hsize=\dimexpr '.($steviloOstalihStolpcev).'\hsize + '.($steviloOstalihStolpcev).'\tabcolsep + \arrayrulewidth}X|}{'.$this->returnBold(LatexDocument::encodeText($sprLabel1)).'} '.$this->texNewLine;
// prva vrstica - konec
// druga vrstica
@@ -248,7 +213,7 @@ class AnalizaTTest extends LatexAnalysisElement{
$tabela .= "\\cline{2-".$steviloStolpcevParameterTabular."} "; //horizontalna vrstica od 2 do zadnje celice
}
$druga = array();
- $druga[] = $this->returnBold($this->encodeText($sprLabel2));
+ $druga[] = $this->returnBold(LatexDocument::encodeText($sprLabel2));
$druga[] = 'n';
$druga[] = 'x';
$druga[] = 's$^2$';
@@ -269,7 +234,7 @@ class AnalizaTTest extends LatexAnalysisElement{
//tretja vrstica
$tretja = array();
- $tretja[] = $this->encodeText($label1); //1. stolpec
+ $tretja[] = LatexDocument::encodeText($label1); //1. stolpec
$tretja[] = $this->formatNumber($ttest[1]['n'], 0);
$tretja[] = $this->formatNumber($ttest[1]['x'], 3);
$tretja[] = $this->formatNumber($ttest[1]['s2'], 3);
@@ -285,9 +250,9 @@ class AnalizaTTest extends LatexAnalysisElement{
//cetrta vrstica
$cetrta = array();
if($export_format != 'xls'){
- $cetrta[] = '\cline{1-'.$zadnjiStolpecDvojnihVrstic.'} '.$this->encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
+ $cetrta[] = '\cline{1-'.$zadnjiStolpecDvojnihVrstic.'} '.LatexDocument::encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
}else{
- $cetrta[] = $this->encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
+ $cetrta[] = LatexDocument::encodeText($label2); //1. stolpec, //crta samo do dolocenega stolpca
}
$cetrta[] = $this->formatNumber($ttest[2]['n'], 0);
$cetrta[] = $this->formatNumber($ttest[2]['x'], 3);
@@ -304,7 +269,7 @@ class AnalizaTTest extends LatexAnalysisElement{
// vrstici s podatki - konec
//zaljucek latex tabele z obrobo za prvo tabelo
- $tabela .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $tabela .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele z obrobo za prvo tabelo - konec
}
@@ -341,9 +306,9 @@ class AnalizaTTest extends LatexAnalysisElement{
if($creport==false){
// Naslov posameznega grafa
$title = $lang['srv_chart_ttest_title'].':'.$this->texNewLine;
- $title .= $this->encodeText($this->ttestVars[0]);
- $title .= $this->encodeText('/');
- $title .= $this->encodeText($this->ttestVars[1]);
+ $title .= LatexDocument::encodeText($this->ttestVars[0]);
+ $title .= LatexDocument::encodeText('/');
+ $title .= LatexDocument::encodeText($this->ttestVars[1]);
$boldedTitle = $this->returnBold($title).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
}else{
$boldedTitle = '';
@@ -375,11 +340,6 @@ class AnalizaTTest extends LatexAnalysisElement{
return $text;
}
- function drawLine()
- {
- $cy = $this->pdf->getY();
- $this->pdf->Line(15, $cy , 195, $cy , $this->currentStyle);
- }
function setUserId($usrId=null) {$this->anketa['uid'] = $usrId;}
function getUserId() {return ($this->anketa['uid'])?$this->anketa['uid']:false;}
@@ -394,20 +354,7 @@ class AnalizaTTest extends LatexAnalysisElement{
return $result;
}
-
- function getCellHeight($string='', $width=null){
-
- $this->pdf->startTransaction();
- // get the number of lines calling you method
- $linecount = $this->pdf->MultiCell($width, 0, $string, 0, 'L', 0, 0, '', '', true, 0, false, true, 0);
- // restore previous object
- $this->pdf = $this->pdf->rollbackTransaction();
-
- $height = ($linecount <= 1) ? 4.7 : $linecount * ($this->pdf->getFontSize() * $this->pdf->getCellHeightRatio()) + 2;
- return $height;
- }
-
}
?> \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php b/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php
index 0e68338..83fcee1 100644
--- a/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/BesediloLatex.php
@@ -10,8 +10,8 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
class BesediloLatex extends LatexSurveyElement
{
@@ -19,6 +19,7 @@ class BesediloLatex extends LatexSurveyElement
protected $texBigSkip = '\bigskip';
protected $export_subtype;
protected $path2SignatureImages;
+ protected $path2HeatmapImages;
protected $texGapBeforeTable = '\vspace*{-\baselineskip}';
public function __construct()
@@ -41,6 +42,7 @@ class BesediloLatex extends LatexSurveyElement
}
public function export($spremenljivke=null, $export_format='', $questionText=null, $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $anketa=null, $export_subtype='', $preveriSpremenljivko=null, $export_data_type=null, $loop_id=null){
+ //$time_start = microtime(true);
global $site_path;
$this->path2HeatmapImages = $site_path.'main/survey/uploads/';
@@ -62,7 +64,7 @@ class BesediloLatex extends LatexSurveyElement
$tex = '';
$podatekVBazi = 0;
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
//nastavitve text box-a iz baze##########################
$steviloOken = $spremenljivke['text_kosov'];
@@ -212,7 +214,7 @@ class BesediloLatex extends LatexSurveyElement
//Ureditev dodajanja manjsega razmika med besedilom vprasanja in tabelo - konec
#ZACETEK TABELE
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
}
//echo "ni vodoravno ob vprašanju </br>";
@@ -220,22 +222,22 @@ class BesediloLatex extends LatexSurveyElement
}elseif($postavitev==0&&$polozajBesedila==3){ //
#ZACETEK TABELE
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//echo "je vodoravno ob vprašanju zgoraj</br>";
}elseif($postavitev==0&&$polozajBesedila==2){
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//echo "je vodoravno ob vprašanju spodaj</br>";
}elseif($postavitev==0&&$steviloOken>1){
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//echo "stevilo oken večje in ob vprašanju </br>";
}
}
- //echo "tex koda: ".$tex."</br>";
+
// iz baze preberemo vse moznosti - ko nimamo izpisa z odgovori respondenta
$sqlVrednosti = sisplet_query("SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
-
+
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
# po potrebi se prevede besedilo, ki se pojavi pred textbox-om
@@ -264,7 +266,9 @@ class BesediloLatex extends LatexSurveyElement
//priprava besedila za izpis
$stringNaslov = $rowVrednost['naslov'];
- $stringNaslov = Common::getInstance()->dataPiping($stringNaslov, $usr_id, $loop_id);
+ if($userAnswer){ //ce je kaj v bazi oz. se izpisujejo odgovori respondenta
+ $stringNaslov = Common::getInstance()->dataPiping($stringNaslov, $usr_id, $loop_id);
+ }
//priprava besedila za izpis - konec
//ce ni other ali missing
@@ -281,11 +285,9 @@ class BesediloLatex extends LatexSurveyElement
$besedilo .= $textSignature;
//}elseif($spremenljivke['upload'] == 1){
}elseif($spremenljivke['upload']){
- //$besedilo .= $textUpload;
- $besedilo .= $this->encodeText($textUpload);
+ $besedilo .= LatexDocument::encodeText($textUpload);
}else{
- //$besedilo .= $userAnswer['text'];
- $besedilo .= $this->encodeText($userAnswer['text']);
+ $besedilo .= LatexDocument::encodeText(isset($userAnswer['text'])?$userAnswer['text']:'');
}
if($export_format=='pdf'){
@@ -310,7 +312,7 @@ class BesediloLatex extends LatexSurveyElement
}
array_push($textBoxes, $dataTextBox); //filanje polja s praznimi text box-i
- array_push($besedila, $this->encodeText($stringNaslov)); //filanje polja z besedili
+ array_push($besedila, LatexDocument::encodeText($stringNaslov)); //filanje polja z besedili
if($okvir == 0){
if($spremenljivke['tip'] == 21){ //ce je ta novo besedilo, ki je v uporabi
@@ -320,7 +322,7 @@ class BesediloLatex extends LatexSurveyElement
//izpis besedila
if($polozajBesedila!=0){ //ce je prisotno dodatno besedilo ob okvirju
- $tex .= $this->encodeText($stringNaslov)." ";
+ $tex .= LatexDocument::encodeText($stringNaslov)." ";
}
$tex .= ' '.$dataTextBox;
}elseif($spremenljivke['tip'] == 4){ //ce je ta staro besedilo, ki ni vec v uporabi vsaj 9 let (2020)
@@ -338,7 +340,7 @@ class BesediloLatex extends LatexSurveyElement
}
//izpis besedila
- $tex .= $this->encodeText($stringNaslov)." ";
+ $tex .= LatexDocument::encodeText($stringNaslov)." ";
//izpis text box-a dolocene sirine in visine z besedilom odgovora
$tex .= ' '.$dataTextBox;
@@ -353,10 +355,12 @@ class BesediloLatex extends LatexSurveyElement
'vrstni_red'=>$rowVrednost['vrstni_red'],
'value'=>$text[$rowVrednost['vrstni_red']],
); */
+ $vrstniRedTmp = isset($rowVrednost['vrstni_red'])?$rowVrednost['vrstni_red']:null;
+ echo $vrstniRedTmp;
$array_others[$rowVrednost['id']] = array(
- 'naslov'=>$this->encodeText($stringNaslov),
- 'vrstni_red'=>$rowVrednost['vrstni_red'],
- 'value'=>$text[$rowVrednost['vrstni_red']],
+ 'naslov'=>LatexDocument::encodeText($stringNaslov),
+ 'vrstni_red'=>$vrstniRedTmp,
+ //'value'=>$text[$vrstniRedTmp] - pokomentiral, ker ne vem, zakaj je tako, saj drugače PHP javlja warning
);
}
@@ -392,20 +396,20 @@ class BesediloLatex extends LatexSurveyElement
if($postavitev!=0){
if($steviloOken>1){ //ce je stevilo oken vec kot 1, zakljuci tabelo
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
}
}elseif($postavitev==0&&$polozajBesedila==3){
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
}elseif($postavitev==0&&$polozajBesedila==2){
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
}elseif($postavitev==0&&$steviloOken>1){
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
}
}
@@ -453,6 +457,9 @@ class BesediloLatex extends LatexSurveyElement
}
//echo "tex koda: ".$tex." in indeks $indeksZaWhile</br>";
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time besedilo 1:</b> '.$execution_time.' sec</br>'; */
return $tex;
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php b/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
index 7110873..006863f 100644
--- a/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/DatumLatex.php
@@ -36,6 +36,7 @@ class DatumLatex extends LatexSurveyElement
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $loop_id=null){
+ //$time_start = microtime(true);
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
@@ -65,19 +66,25 @@ class DatumLatex extends LatexSurveyElement
//$sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
//$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ";
$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' ";
- //echo $sqlUserAnswerString;
+ //$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND loop_id = $loop_id";
+ if($loop_id){
+ $sqlUserAnswerString = $sqlUserAnswerString." AND loop_id = '$loop_id'";
+ }
+
+ //echo $sqlUserAnswerString."</br>";
+
$sqlUserAnswer = sisplet_query($sqlUserAnswerString);
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
//echo "userAnswer: ".$userAnswer['text']."</br>";
//ureditev polja s podatki trenutnega uporabnika - konec ##############################################
//ureditev besedila odgovora respondenta v doloceno barvo
- $besedilo = '\\textcolor{crta}{';
- $besedilo .= $userAnswer['text'];
+ $besedilo = '\\textcolor{crta}{';
+ $besedilo .= isset($userAnswer['text'])?$userAnswer['text']:null;
$besedilo .= '}';
//ureditev besedila odgovora respondenta v doloceno barvo - konec
- if($userAnswer['text']==''){ //ce ni izpisa odgovorov respondentov, priprava izpis s tabelo
+ if(isset($userAnswer['text'])?$userAnswer['text']:null==''){ //ce ni izpisa odgovorov respondentov, priprava izpis s tabelo
$answerTextBox = $this->LatexTextBox($export_format, $textboxHeight, $textboxWidth, $besedilo, $textboxAllignment, $noBorders);
//parametri tabele
@@ -91,12 +98,12 @@ class DatumLatex extends LatexSurveyElement
//IZRIS
#ZACETEK TABELE
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
$tex .= $answerTextBox; //izris znotraj tabele
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
#KONEC TABELE
$tex .= $this->texBigSkip;
}else{ //ce je izpis odgovorov respondentov
@@ -114,11 +121,11 @@ class DatumLatex extends LatexSurveyElement
$array_others[$rowVrednost['id']] = array(
'naslov'=>$rowVrednost['naslov'],
'vrstni_red'=>$rowVrednost['vrstni_red'],
- 'value'=>$text[$rowVrednost['vrstni_red']],
+ //'value'=>$text[$rowVrednost['vrstni_red']],
);
}
}
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
//priprava missing-ov - konec
// Izris polj drugo - ne vem...
@@ -133,7 +140,9 @@ class DatumLatex extends LatexSurveyElement
}
//IZRIS - KONEC
-
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time datum:</b> '.$execution_time.' sec'; */
return $tex;
}
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php b/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php
index 3b67102..96dbff8 100644
--- a/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/GridMultipleLatex.php
@@ -10,9 +10,9 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
+ if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+ if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+ if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
class GridMultipleLatex extends LatexSurveyElement
{
@@ -29,6 +29,9 @@ class GridMultipleLatex extends LatexSurveyElement
private static $_instance;
protected $texBigSkip = '\bigskip ';
protected $loop_id = null; // id trenutnega loopa ce jih imamo
+ protected $usr_id = null;
+ protected $language;
+ protected $prevod;
public static function getInstance()
{
@@ -38,28 +41,40 @@ class GridMultipleLatex extends LatexSurveyElement
return new GridMultipleLatex();
}
- public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $export_data_type='', $loop_id=null){
+ public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $export_data_type='', $loop_id=null, $language=null){
+ //$time_start = microtime(true);
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
+ $this->usr_id = $usr_id;
+
+ $this->language = $language;
+
+ //preverjanje, ali je prevod
+ if(isset($_GET['language'])){
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
+ $this->prevod = 1;
+ }else{
+ $this->prevod = 0;
+ }
+ //preverjanje, ali je prevod - konec
+
+
//echo "<b>tip izpisa: $export_data_type</b> </br>"; //$export_data_type: 1 - Razsirjen, 2 - Skrcen
$presirokaTabela = 0;
//preveri, ce je kaj v bazi
$questionText=0;
$userDataPresent=0;
$izpisOdgovorov = 0;
+ $userAnswer = null;
if($usr_id){ //ce je prisotne id uporabnika, je izpis odgovorov in je potrebno narediti naslednje stvari
- //$userAnswer = $this->GetUsersDataKombinirana($spremenljivke, $db_table, $usr_id, $questionText, $this->loop_id, $export_data_type);
$userAnswer = $this->GetUsersDataKombinirana($spremenljivke, $db_table, $usr_id, $presirokaTabela, $this->loop_id, $export_data_type);
foreach($userAnswer as $value){
if($value!=''){
$userDataPresent=1;
}
- //echo "Value: ".$value."</br>";
}
$izpisOdgovorov = 1;
}
- //echo "Usr_id: ".$usr_id.'</br>';
- //echo "Stevilo odgovorov: ".count($userAnswer).'</br>';
if($userDataPresent!=0||$export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){ //ce je kaj v bazi ali je prazen vprasalnik ali je potrebno pokazati tudi ne odgovorjena vprasanja
@@ -82,10 +97,10 @@ class GridMultipleLatex extends LatexSurveyElement
}
//poizvedba vseh potrebnih podatkov dodanih moznosti v kombinirani tabeli
- $sqlMultiple = sisplet_query("SELECT g.*, s.tip, s.enota, s.dostop FROM srv_grid g, srv_grid_multiple m, srv_spremenljivka s WHERE s.id=g.spr_id AND g.spr_id=m.spr_id AND m.spr_id IN (".implode($multipleSprId, ',').") ORDER BY m.vrstni_red, g.vrstni_red");
+ $sqlMultiple = sisplet_query("SELECT g.*, s.tip, s.enota, s.dostop FROM srv_grid g, srv_grid_multiple m, srv_spremenljivka s WHERE s.id=g.spr_id AND g.spr_id=m.spr_id AND m.spr_id IN (".implode(',', $multipleSprId).") ORDER BY m.vrstni_red, g.vrstni_red");
//echo "SELECT g.*, s.tip, s.enota, s.dostop FROM srv_grid g, srv_grid_multiple m, srv_spremenljivka s WHERE s.id=g.spr_id AND g.spr_id=m.spr_id AND m.spr_id IN (".implode($multipleSprId, ',').") ORDER BY m.vrstni_red, g.vrstni_red";
//poizvedba podnaslovov v kombinirani tabeli
- $sqlMultiplePodNaslovi = sisplet_query("SELECT naslov FROM srv_spremenljivka WHERE id IN (".implode($multipleSprId, ',').")");
+ $sqlMultiplePodNaslovi = sisplet_query("SELECT naslov FROM srv_spremenljivka WHERE id IN (".implode(',', $multipleSprId).")");
//novo za kombinirano tabelo - konec
$spremenljivkaParams = new enkaParameters($spremenljivke['params']);
@@ -114,14 +129,14 @@ class GridMultipleLatex extends LatexSurveyElement
if($usr_id){
$multipleVredIdDrugo = array(); //polje za shranjevanje vre_id, kjer je prisotna moznost Drugo:
//poizvedba vrednosti polj, kjer se pojavijo polja Drugo:
- $sqlMultipleVredIdZaDrugo = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id IN (".implode($multipleSprId, ',').") AND other = 1");
+ $sqlMultipleVredIdZaDrugo = sisplet_query("SELECT id FROM srv_vrednost WHERE spr_id IN (".implode(',', $multipleSprId).") AND other = 1");
while ($rowsqlMultipleVredIdZaDrugo = mysqli_fetch_array($sqlMultipleVredIdZaDrugo)) {
$multipleVredIdDrugo[] = $rowsqlMultipleVredIdZaDrugo['id'];
}
if(!empty($multipleVredIdDrugo)){
$multipleBesediloDrugo = array(); //polje za shranjevanje vnesenega besedila iz strani respondenta, kjer je prisotna moznost Drugo:
- $sqlStavekMultipleBesediloDrugo = "SELECT text FROM srv_data_text_active WHERE vre_id IN (".implode($multipleVredIdDrugo, ',').") AND usr_id=".$usr_id." ";
+ $sqlStavekMultipleBesediloDrugo = "SELECT text FROM srv_data_text_active WHERE vre_id IN (".implode(',', $multipleVredIdDrugo).") AND usr_id=".$usr_id." ";
$sqlMultipleBesediloDrugo = sisplet_query($sqlStavekMultipleBesediloDrugo);
while ($rowsqlMultipleBesediloDrugo = mysqli_fetch_array($sqlMultipleBesediloDrugo)) {
$multipleBesediloDrugo[] = $rowsqlMultipleBesediloDrugo['text'];
@@ -133,13 +148,27 @@ class GridMultipleLatex extends LatexSurveyElement
//ce je prisoten id uporabnika - ureditev belezenja vnesenega odgovora pod Drugo: - konec
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - navpicni odgovori
- while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
- $stringTitleRow = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
+ while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
+ $stringTitleRow = '';
+ /* $stringTitleRow = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
# po potrebi prevedemo naslov
$naslov = $this->srv_language_vrednost($rowVrednost['id']);
if ($naslov != '') {
//$rowVrednost['naslov'] = $naslov;
$stringTitleRow = $naslov;
+ } */
+
+ if($this->prevod){ //ce je prevod ankete
+ # po potrebi prevedemo naslov
+ $rowl = $this->srv_language_vrednost($rowVrednost['id']);
+ if ($rowl != '') {
+ $stringTitleRow = ((( $rowl['naslov'] ) ? $rowl['naslov'] : ( ( $rowl['naslov2'] ) ? $rowl['naslov2'] : $rowl['variable'] ) )); //prevod naslova v ustreznem jeziku;
+ }
+ if($stringTitleRow == ''){ //ce ni prevoda, prevzemi izvirno
+ $stringTitleRow = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
+ }
+ }else{
+ $stringTitleRow = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
}
$besediloDrugo = '';
@@ -148,13 +177,15 @@ class GridMultipleLatex extends LatexSurveyElement
if($rowVrednost['other'] && $usr_id){
//zabelezi besedilo, ki je trenuten uporabnik za trenuten odgovor zapisal pod Drugo:
$besediloDrugo = $multipleBesediloDrugo[$indeksBesediloDrugo];
- $this->encodeText($besediloDrugo);
+ LatexDocument::encodeText($besediloDrugo);
$besediloDrugo = ' \\textcolor{crta}{\footnotesize{'.$besediloDrugo.'}} ';
$indeksBesediloDrugo++; //povecaj indeks za izpis vnesenega besedila v Drugo:
}
//ce je drugo vnesen kot odgovor in je prisoten id uporabnika - konec
-
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow)." ".$besediloDrugo); //filanje polja z navpicnimi odgovori (po vrsticah)
+ if($usr_id){
+ $stringTitleRow = Common::getInstance()->dataPiping($stringTitleRow, $usr_id, $loop_id);
+ }
+ array_push($navpicniOdgovori, LatexDocument::encodeText($stringTitleRow, 0, 1)." ".$besediloDrugo); //filanje polja z navpicnimi odgovori (po vrsticah)
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - navpicni odgovori - konec
@@ -164,19 +195,19 @@ class GridMultipleLatex extends LatexSurveyElement
$steviloSkupinRoletSeznamov = 0; //belezi stevilo enot z roletami ali seznamov (pomembno za pravilen izris, za presiroko tabelo)
$steviloOdgovorovRoletSeznamov = 0; //belezi stevilo posameznih odgovorov, ki sestavljajo razlicne rolete ali sezname
$sprIdRoletSeznamov = 0;
- $sprIdRoletSeznamovTmp = 0;
+ $sprIdRoletSeznamovTmp = 0;
//pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti - vodoravni odgovori
while ($colVrednost = mysqli_fetch_assoc($sqlStolpciVrednosti)){
-
- #staro, izpis naslovov stolpcev tabele z isto velikostjo pisave, kot vse ostalo
- /* $stringTitleCol = $colVrednost['naslov'];
- array_push($vodoravniOdgovori, $this->encodeText($stringTitleCol, 0, 1) ); //filanje polja z vodoravnimi odgovori (po stolpcih) */
- #staro - konec
-
- $stringTitleCol = $this->encodeText($colVrednost['naslov'], 0, 1);
- $stringTitleCol = '\footnotesize{'.$stringTitleCol.'}'; //zmanjsanje pisave za naslove stolpcev tabele
- array_push($vodoravniOdgovori, $stringTitleCol); //filanje polja z vodoravnimi odgovori (po stolpcih)
+ $stringTitleCol = '';
+ $rowl = $this->srv_language_grid($colVrednost['variable'],$colVrednost['spr_id']);
+ if ($rowl !=null && strip_tags($rowl['naslov']) != '') $colVrednost['naslov'] = $rowl['naslov'];
+ $stringTitleCol = $colVrednost['naslov'];
+ if($usr_id){
+ $stringTitleCol = Common::getInstance()->dataPiping($stringTitleCol, $usr_id, $loop_id);
+ }
+ $stringTitleCol = '\footnotesize{'.LatexDocument::encodeText($stringTitleCol, 0, 1).'}'; //zmanjsanje pisave za naslove stolpcev tabele
+ array_push($vodoravniOdgovori, $stringTitleCol); //filanje polja z vodoravnimi odgovori (po stolpcih)
$rowMultiple = mysqli_fetch_array($sqlMultiple);
array_push($vodoravniOdgovoriTip, $rowMultiple['tip']); //filanje polja s tipi spremenljivk
@@ -187,38 +218,25 @@ class GridMultipleLatex extends LatexSurveyElement
if(($rowMultiple['enota'] == 2 || $rowMultiple['enota'] == 6)){
$sprIdRoletSeznamov = $rowMultiple['spr_id'];
}
-
- /* echo "enota ".$rowMultiple['enota']."</br>";
- echo "spr ".$rowMultiple['spr_id']."</br>"; */
- //if(($rowMultiple['enota'] == 2 || $rowMultiple['enota'] == 6)){ //ce je roleta ali seznam IN je izpis odgovorov
+
//if(($rowMultiple['enota'] == 2 || $rowMultiple['enota'] == 6)&&$izpisOdgovorov){ //ce je roleta ali seznam IN je izpis odgovorov
if((($rowMultiple['enota'] == 2 || $rowMultiple['enota'] == 6)&&$izpisOdgovorov) || ($izpisOdgovorov&&$rowMultiple['tip']==6&&$export_data_type==2)){ //(ce je roleta ALI seznam IN je izpis odgovorov) ALI (je izpis odgovorov IN je radio button)
if($sprIdRoletSeznamovTmp != $sprIdRoletSeznamov){
$steviloSkupinRoletSeznamov++;
}
$steviloOdgovorovRoletSeznamov++;
- //echo "spr: $sprIdRoletSeznamov </br>";
}
- $sprIdRoletSeznamovTmp = $sprIdRoletSeznamov;
+ $sprIdRoletSeznamovTmp = $sprIdRoletSeznamov;
}
//pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti - vodoravni odgovori - konec
$vodoravniOdgovoriVsi = $vodoravniOdgovori;
- /* echo "stevilo skupin rolet/seznamov ".($steviloSkupinRoletSeznamov)." </br>";
- echo "stevilo odgovorov v roletah ali seznamu ".($steviloOdgovorovRoletSeznamov)." </br>"; */
-
-/* echo "vodoravniOdgovoriSprId: ";
- print_r($vodoravniOdgovoriSprId);
- echo "</br>";
- echo "Enote: ";
- print_r($vodoravniOdgovoriEnota);
- echo "</br>"; */
//ureditev polja z nadnaslovi kombinirane tabele
while ($rowMultiplePodNaslovi = mysqli_fetch_array($sqlMultiplePodNaslovi)){
- array_push($podNaslovi, $this->encodeText($rowMultiplePodNaslovi['naslov']));
+ array_push($podNaslovi, LatexDocument::encodeText($rowMultiplePodNaslovi['naslov'], 0, 1));
}
//ureditev polja z nadnaslovi kombinirane tabele - konec
@@ -228,10 +246,8 @@ class GridMultipleLatex extends LatexSurveyElement
$steviloPodstolpcev = $numColSql - $steviloOdgovorovRoletSeznamov + $steviloSkupinRoletSeznamov;
$mejaZaVelikeTabele = 7;
$velikostTabele = $steviloPodstolpcev-1;
- //echo "<b>velikost tabele: </b>".($velikostTabele)." </br>";
+
if($velikostTabele > $mejaZaVelikeTabele){ //ce imamo veliko tabelo, jo je potrebno razbiti na vec tabel, ker drugace je presiroka
- //echo "tabela je prevelika, ima ".($velikostTabele)." stolpcev</br>";
-
$presirokaTabela = 1;
$steviloTabelCelih = intval($velikostTabele / $mejaZaVelikeTabele);
$steviloTabelMod = $velikostTabele % $mejaZaVelikeTabele;
@@ -240,11 +256,6 @@ class GridMultipleLatex extends LatexSurveyElement
$delnaTabela = 1;
}
$steviloTabel = $steviloTabelCelih + $delnaTabela;
-
- //echo "stevilo podtabel celih ".($steviloTabelCelih)." </br>";
- //echo "stevilo podtabel mod ".($steviloTabelMod)." </br>";
- //echo "stevilo podtabel za izpis: ".($steviloTabel)." </br>";
- //echo "stevilo podatkov za izpis: ".($steviloPodatkovZaIzpis)." </br>";
}else{
$presirokaTabela = 0;
@@ -273,11 +284,6 @@ class GridMultipleLatex extends LatexSurveyElement
$valueTmp = null;
foreach($vodoravniOdgovoriSprId as $value){ //parametri tabele ZA OSTALE STOLPCE+pridobitev stevila stolpcev+priprava polj in spremenljivk ###############
- //echo $vodoravniOdgovoriEnota[$indeksParameterTabular-1]."</br>";
- //echo "value: ".$value."</br>";
- //echo "valueTmp: ".$valueTmp."</br>";
- //echo "indeksParameterTabular: ".$indeksParameterTabular."</br>";
- //echo "Stevilo vodoravniOdgovoriSprId: ".count($vodoravniOdgovoriSprId)."</br>";
if($izpisOdgovorov == 0 || ($izpisOdgovorov == 1 && $vodoravniOdgovoriEnota[$indeksParameterTabular-1]==0 && $export_data_type == 1) || ($izpisOdgovorov == 1 && $vodoravniOdgovoriEnota[$indeksParameterTabular-1]==0 && $vodoravniOdgovoriTip[$indeksParameterTabular-1]!=6 && $export_data_type == 2)){ //ce je prazen vprasalnik ALI (je izpis odgovorov IN ni roleta/seznam IN je Razsirjen izvoz) ALI (je izpis odgovorov IN ni roleta/seznam IN ni radio button IN je skrcen izvoz)
if($indeksParameterTabular==1){ //ce je prvi podstolpec
@@ -345,8 +351,6 @@ class GridMultipleLatex extends LatexSurveyElement
$indeksVodoravniOdgovori++;
} //parametri tabele ZA OSTALE STOLPCE+pridobitev stevila stolpcev+priprava polj in spremenljivk - konec ##########################################
- //echo "Parametri tabel: ".$parameterTabular."</br>";
-
//brisanje odvecnih elementov polja in ponovna indeksacija polja
foreach($toDelete as $value){
unset($vodoravniOdgovoriPrva[$value]); //brisanje ustreznih elementov polja
@@ -371,20 +375,17 @@ class GridMultipleLatex extends LatexSurveyElement
}else{
$numColSqlPrva = $numColSql;
}
- //echo "stevilo stolpcev prva vrstica $numColSqlPrva </br>";
//dodatna priprava polj in spremenljivk, ce enota je razlicna od nula oz. izris ni klasicna tabela - konec #############################
//ureditev parametrov za tabelo, pridobitev stevila stolpcev za vsak tip dodanega vprasanja (podstolpec), priprava polj in spremenljivk, ce enota je razlicna od nula oz. izris ni klasicna tabela - konec ########
//IZRIS TABELE
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1); //zacetek tabele
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1); //zacetek tabele
#nadnaslovi nad prvo vrstico #########################################################
if($spremenljivke['grid_subtitle1']==1){ //ce so podnaslovi
for($n=0;$n<count($podNaslovi);$n++){
- //echo $podNaslovi[$n].'</br>';
- //$tex .= ' & \multicolumn{'.$steviloPodStolpcev[$n].'}{c}{'.$podNaslovi[$n].'}';
$tex .= ' & \multicolumn{'.$steviloPodStolpcev[$n].'}{C}{'.$podNaslovi[$n].'}';
}
}
@@ -398,20 +399,20 @@ class GridMultipleLatex extends LatexSurveyElement
$tex .= $texNewLine;
- //print_r($userAnswer);
-
#izris vrstic tabele
$fillablePdf = 0;
//echo "stevilo stolpcev tabele $numColSql </br>";
- $tex .= $this->LatexVrsticeMultigrid($numRowsSql, $export_format, $enota, $simbolTex, $navpicniOdgovori, 0, $fillablePdf, $numColSql, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, 0, 0, $vodoravniOdgovoriTip, $vodoravniOdgovoriEnota, $vodoravniOdgovoriSprId, $userAnswer, $export_subtype, $preveriSpremenljivko, $userDataPresent, $presirokaTabela, $export_data_type);
+ $tex .= $this->LatexVrsticeMultigrid($numRowsSql, $export_format, $enota, null, $navpicniOdgovori, 0, $fillablePdf, $numColSql, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, 0, 0, $vodoravniOdgovoriTip, $vodoravniOdgovoriEnota, $vodoravniOdgovoriSprId, $userAnswer, $export_subtype, $preveriSpremenljivko, $userDataPresent, $presirokaTabela, $export_data_type, $this->usr_id, $this->loop_id);
#izris vrstic tabele - konec
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular'); //zakljucek tabele
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular'); //zakljucek tabele
//IZRIS TABELE - KONEC
$tex .= $this->texBigSkip;
$tex .= $this->texBigSkip;
-
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time kombinirana tabela:</b> '.$execution_time.' sec'; */
return $tex;
}elseif($presirokaTabela == 1){ //ce je tabela presiroka #################################################
@@ -419,7 +420,6 @@ class GridMultipleLatex extends LatexSurveyElement
//za vsako spremenljivko oz. podtabelo
foreach($multipleSprId AS $sprId){
- //echo "$sprId</br>";
#pobiranje podatkov o odgovorih respondenta za vsako podtabelo posebej
if($usr_id){ //ce je prisotne id uporabnika, je izpis odgovorov in je potrebno narediti naslednje stvari
@@ -429,13 +429,10 @@ class GridMultipleLatex extends LatexSurveyElement
if($value!=''){
$userDataPresent=1;
}
- //echo "Value: ".$value."</br>";
}
$izpisOdgovorov = 1;
}
- //echo "podatek je: ".$userDataPresent."</br>";
- /* print_r($userAnswer);
- echo "</br>"; */
+
#pobiranje podatkov o odgovorih respondenta za vsako podtabelo posebej - konec
$vodoravniOdgovoriTip = array();
@@ -452,9 +449,12 @@ class GridMultipleLatex extends LatexSurveyElement
array_push($vodoravniOdgovoriTip, $rowMultiple['tip']); //filanje polja s tipi spremenljivk
array_push($vodoravniOdgovoriSprId, $rowMultiple['spr_id']); //filanje polja z id spremenljivk
array_push($vodoravniOdgovoriEnota, $rowMultiple['enota']); //filanje polja z enoto spremenljivk
- //print_r($vodoravniOdgovoriTip);
- $stringTitleCol = $this->encodeText($rowMultiple['naslov'], 0, 1);
- $stringTitleCol = '\footnotesize{'.$stringTitleCol.'}'; //zmanjsanje pisave za naslove stolpcev tabele
+
+ $stringTitleCol = $rowMultiple['naslov'];
+ if($usr_id){
+ $stringTitleCol = Common::getInstance()->dataPiping($stringTitleCol, $usr_id, $loop_id);
+ }
+ $stringTitleCol = '\footnotesize{'.LatexDocument::encodeText($stringTitleCol, 0, 1).'}'; //zmanjsanje pisave za naslove stolpcev tabele
//if(($vodoravniOdgovoriEnota[0] == 2 || $vodoravniOdgovoriEnota[0] == 6) && $izpisOdgovorov && $export_data_type == 1){ //(ce je roleta ALI seznam) IN je izpis odgovorov IN razsirjen izvoz
if(($vodoravniOdgovoriEnota[0] == 2 || $vodoravniOdgovoriEnota[0] == 6) && $izpisOdgovorov && $export_data_type == 1 || ($izpisOdgovorov && $export_data_type == 2 && $vodoravniOdgovoriTip[0] == 6 )){ //(ce je roleta ALI seznam) IN je izpis odgovorov IN razsirjen izvoz ALI (je izpis odgovorov IN skrcen izvoz IN radio button)
@@ -462,48 +462,25 @@ class GridMultipleLatex extends LatexSurveyElement
}else{
array_push($vodoravniOdgovori, $stringTitleCol); //filanje polja z vodoravnimi odgovori (po stolpcih)
}
- //array_push($vodoravniOdgovori, $stringTitleCol); //filanje polja z vodoravnimi odgovori (po stolpcih)
- //echo $rowMultiple['naslov']."</br>";
}
//poizvedba podnaslovov v podtabeli kombinirane tabele
$sqlMultiplePodNaslovi = sisplet_query("SELECT naslov FROM srv_spremenljivka WHERE id =".$sprId);
//ureditev polja z nadnaslovi kombinirane tabele
while ($rowMultiplePodNaslovi = mysqli_fetch_array($sqlMultiplePodNaslovi)){
- array_push($podNaslovi, $this->encodeText($rowMultiplePodNaslovi['naslov']));
+ array_push($podNaslovi,LatexDocument::encodeText($rowMultiplePodNaslovi['naslov'], 0, 1));
}
//ureditev polja z nadnaslovi kombinirane tabele - konec
$enota = $vodoravniOdgovoriEnota[0];
- /* print_r($vodoravniOdgovoriTip);
- echo "</br>";
- print_r($vodoravniOdgovoriSprId);
- echo "</br>";*/
- /* print_r($vodoravniOdgovoriEnota);
- echo "</br>"; */
- /* print_r($vodoravniOdgovori);
- echo "</br>"; */
//ureditev parametrov tabele
- /* echo "enota:".$vodoravniOdgovoriEnota[0]."</br>";
- echo "izpisOdgovorov:".$izpisOdgovorov."</br>";
- echo "tip:".$vodoravniOdgovoriTip[0]."</br>";
- echo "export_data_type:".$export_data_type."</br>"; */
- //if(($enota == 2 || $enota == 6) && $izpisOdgovorov && $export_data_type == 1){ //(ce je roleta ALI seznam) IN je izpis odgovorov IN razsirjen izvoz
if(($enota == 2 || $enota == 6) && $izpisOdgovorov && $export_data_type == 1 || ($izpisOdgovorov && $export_data_type == 2 && $vodoravniOdgovoriTip[0] == 6 )){ //(ce je roleta ALI seznam) IN je izpis odgovorov IN razsirjen izvoz ALI (je izpis odgovorov IN skrcen izvoz IN radio button)
$steviloStolpcev = 1 + 1;
}else{
$steviloStolpcev = count($vodoravniOdgovoriSprId) + 1;
}
- //echo "stevilo stolpcev: $steviloStolpcev</br>";
-
- /* if((($vodoravniOdgovoriEnota[0] == 2 || $vodoravniOdgovoriEnota[0] == 6)&&$izpisOdgovorov&&$export_data_type == 1) || ($izpisOdgovorov&&$export_data_type == 2&&$vodoravniOdgovoriTip[$indeksParameterTabular-1]==6)){ //(ce je roleta ali izberite iz seznama IN je izpis odgovorov IN razsirjen izvoz) ALI (je izpis odgovorov IN skrcen izvoz IN radio button)
-
- } */
-
-
- //echo "stevilo stolpcev: $steviloStolpcev</br>";
$parameterTabular = '';
$parameterTabular .= ($export_format == 'pdf' ? 'A' : 'l'); //leva poravnava stolpca fiksne sirine ZA PRVI STOLPEC (parameteri tabele)
@@ -511,7 +488,6 @@ class GridMultipleLatex extends LatexSurveyElement
for($i=1; $i<$steviloStolpcev;$i++){
$parameterTabular .= ($export_format == 'pdf' ? 'C' : 'c'); //sredinska poravnava stolpca
}
- //echo "parametri tabele: $parameterTabular </br>";
//ureditev parametrov tabele - konec
@@ -522,8 +498,6 @@ class GridMultipleLatex extends LatexSurveyElement
$steviloPodStolpcev = $steviloStolpcev - 1;
if($spremenljivke['grid_subtitle1']==1){ //ce so podnaslovi
for($n=0;$n<count($podNaslovi);$n++){
- //echo "podnaslov za sprem ".$vodoravniOdgovoriSprId[0]." je: ".$podNaslovi[$n]." število stolpcev pa $steviloPodStolpcev</br>";
- //$tex .= ' & \multicolumn{'.$steviloPodStolpcev.'}{c}{'.$podNaslovi[$n].'}';
$tex .= ' & \multicolumn{'.$steviloPodStolpcev.'}{C}{'.$podNaslovi[$n].'}';
}
}
@@ -540,7 +514,7 @@ class GridMultipleLatex extends LatexSurveyElement
#izris vrstic tabele
$fillablePdf = 0;
//echo "stevilo stolpcev tabele $steviloStolpcev </br>";
- $tex .= $this->LatexVrsticeMultigrid($numRowsSql, $export_format, $enota, $simbolTex, $navpicniOdgovori, 0, $fillablePdf, $steviloStolpcev, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, 0, 0, $vodoravniOdgovoriTip, $vodoravniOdgovoriEnota, $vodoravniOdgovoriSprId, $userAnswer, $export_subtype, $preveriSpremenljivko, $userDataPresent, $presirokaTabela, $export_data_type);
+ $tex .= $this->LatexVrsticeMultigrid($numRowsSql, $export_format, $enota, null, $navpicniOdgovori, 0, $fillablePdf, $steviloStolpcev, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, 0, 0, $vodoravniOdgovoriTip, $vodoravniOdgovoriEnota, $vodoravniOdgovoriSprId, $userAnswer, $export_subtype, $preveriSpremenljivko, $userDataPresent, $presirokaTabela, $export_data_type, $this->usr_id, $this->loop_id);
#izris vrstic tabele - konec
$tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular'); //zakljucek tabele
diff --git a/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php b/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
index 94e86fb..f65b419 100644
--- a/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/HeatmapLatex.php
@@ -9,9 +9,10 @@
* Datum: 09/2017
*****************************************/
//use enkaParameters;
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
+
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
class HeatmapLatex extends LatexSurveyElement
{
@@ -74,15 +75,19 @@ class HeatmapLatex extends LatexSurveyElement
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$stringTitleRow = $rowVrednost['naslov']; //odgovori na levi strani
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow) ); //filanje polja z navpicnimi odgovori (po vrsticah)
+ if($usr_id){
+ $stringTitleRow = Common::getInstance()->dataPiping($stringTitleRow, $usr_id, $loop_id);
+ }
+ array_push($navpicniOdgovori, LatexDocument::encodeText($stringTitleRow) ); //filanje polja z navpicnimi odgovori (po vrsticah)
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - konec
//$tex .= $this->IzrisVsotaTabela($spremenljivke, $numRowsSql, $navpicniOdgovori, $texNewLine, $texNewLineAfterTable, $export_format, 0);
- $imageName = $this->getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
- //echo("iz heatmap ime slike: ".$imageName."</br>");
+ //html slike
+ //$imageName = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
$path2Images = $this->path2Images;
$imageNameTest = $path2Images.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
@@ -92,7 +97,7 @@ class HeatmapLatex extends LatexSurveyElement
$imageName = $path2Images.$imageName;
- if(filesize($imageNameTest) > 0){
+ if(filesize(file_exists($imageNameTest)) > 0){
$image = PIC_SIZE."{".$imageName."}"; //priprave slike predefinirane dimenzije
}else{
//$image = 'ni slike';
@@ -110,22 +115,29 @@ class HeatmapLatex extends LatexSurveyElement
if($whileIndeks == 0){ //ce so prisotna imena obmocij, izpisi besedilo "Obmocja na sliki"
$tex .= $lang['srv_export_hotspot_regions_names'].': '.$texNewLine; //izpis besedila "Obmocja na sliki"
}
- $tex .= $rowHotSpotRegions['region_name'].''.$texNewLine;
- if($rowHotSpotRegions['region_name']){
- array_push($obmocjaNaSliki, $rowHotSpotRegions['region_name']);
- //array_push($coordsObmocijNaSliki, $rowHotSpotRegions['region_coords']);
- $coordsObmocijNaSliki[$rowHotSpotRegions['region_name']]=$rowHotSpotRegions['region_coords'];
- $point[$rowHotSpotRegions['region_name']] = 0;
+
+ $regionName = $rowHotSpotRegions['region_name'];
+ if($usr_id){
+ $regionName = Common::getInstance()->dataPiping($regionName, $usr_id, $loop_id);
+ }
+ $regionName = LatexDocument::encodeText($regionName);
+ $tex .= $regionName.''.$texNewLine;
+ //echo "ime: $regionName </br>";
+
+ if($regionName){
+ array_push($obmocjaNaSliki, $regionName);
+ $coordsObmocijNaSliki[$regionName]=$rowHotSpotRegions['region_coords'];
+ $point[$regionName] = 0;
}
$whileIndeks++;
}
$tex .= $texNewLine;
- //ureditev missing-ov
- if(count($missingOdgovori)!=0){ //ce so missing-i
+ //ureditev missing-ov - pokomentiranje missing-ov ob preurejanju kode za PHP8 - Patrik
+/* if(count($missingOdgovori)!=0){ //ce so missing-i
$vodoravniOdgovori = $this->AddMissingsToAnswers($vodoravniOdgovori, $missingOdgovori);
- }
+ } */
//ureditev missing-ov - konec
@@ -152,6 +164,7 @@ class HeatmapLatex extends LatexSurveyElement
$textboxHeightOdgovori = 0; //visina okvirja z odgovorom
$noBordersOdgovori = 0;
$parameterTabular = 'l';
+ $textboxAllignment = null;
//za ureditev stevila tock v izbranih obmocjih
$dataPointValue = array();
$data = array();
@@ -221,7 +234,7 @@ class HeatmapLatex extends LatexSurveyElement
$point[$obmocjaNaSliki[$o]]++;
}
}
- //echo "stevilo tock znotraj obmocja: ".$point["Besedilo"]."</br>";
+ //echo "stevilo tock znotraj obmocja: ".$point["Besedilo"]."</br>";
}
#pridobitev podatkov o obmocjih in podatka o prisotnosti tocke v obmocju - konec
//echo $answer."</br>";
@@ -230,13 +243,13 @@ class HeatmapLatex extends LatexSurveyElement
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//izpis latex kode za prazen okvir oz. okvir z odgovori respondenta
$tex .= $this->LatexTextBox($export_format, $textboxHeightOdgovori, $textboxWidthOdgovori, $answer, $textboxAllignment, $noBordersOdgovori);
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
//$tex .= $texNewLine;
}
@@ -256,13 +269,13 @@ class HeatmapLatex extends LatexSurveyElement
}
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//izpis latex kode za prazen okvir oz. okvir z odgovori respondenta
$tex .= $this->LatexTextBox($export_format, $textboxHeightOdgovori, $textboxWidthOdgovori, $answerRegions, $textboxAllignment, $noBordersOdgovori);
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
//$tex .= $texNewLine;
}
@@ -298,8 +311,8 @@ class HeatmapLatex extends LatexSurveyElement
#funkcija, ki skrbi za pretvorbo stringa koordinat obmocja v polja
function convertPolyString($polypoints=null){
$poly = [];
- //$tmpX;
- //$tmpY;
+ $tmpX = null;
+ $tmpY = null;
$j = 0;
$poly = explode(",", $polypoints);
diff --git a/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php b/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php
index d025c58..00bf512 100644
--- a/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/KalkulacijaLatex.php
@@ -9,7 +9,7 @@
* Datum: 05/2018
*****************************************/
- define("NAGOVOR_LINE_WIDTH", 0.5);
+ if (!defined("NAGOVOR_LINE_WIDTH")) define("NAGOVOR_LINE_WIDTH", 0.5);
class KalkulacijaLatex extends LatexSurveyElement
{
diff --git a/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php b/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php
index f20eef4..41fe2a4 100644
--- a/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/KvotaLatex.php
@@ -9,7 +9,7 @@
* Datum: 05/2018
*****************************************/
- define("NAGOVOR_LINE_WIDTH", 0.5);
+ if (!defined("NAGOVOR_LINE_WIDTH")) define("NAGOVOR_LINE_WIDTH", 0.5);
class KvotaLatex extends LatexSurveyElement
{
@@ -71,7 +71,7 @@ class KvotaLatex extends LatexSurveyElement
//ime spremenljivke
if($rowKvota['spr_id']>0){ //ce je spr_id vecji od 0
$rowVariableName = Cache::srv_spremenljivka($rowKvota['spr_id']); //pridobitev imena spremenljivke iz njenega id
- $tex .= $lang['srv_vprasanje_tip_25'].'('.$rowVariableName['variable'].$this->encodeText('_').$rowVariableVrednostVrstniRed['vrstni_red'].')';
+ $tex .= $lang['srv_vprasanje_tip_25'].'('.$rowVariableName['variable'].LatexDocument::encodeText('_').$rowVariableVrednostVrstniRed['vrstni_red'].')';
}else{ //drugace, ko je spr_id manjsi od 0, je negativne vrednosti, so zapisani statusi in tipi odgovorov
switch ( $rowKvota['spr_id'] ){
case -1:
diff --git a/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php b/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php
index 90a40c1..ba2405a 100644
--- a/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/LokacijaLatex.php
@@ -111,13 +111,13 @@ class LokacijaLatex extends LatexSurveyElement
#priprava odgovora respondenta - konec #######################################################################################
//zacetek tabele
- $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tex .= $this->StartLatexTable($export_format, $parameterTabular, 'xltabular', 'tabular', 1, 1);
//izpis latex kode za prazen okvir oz. okvir z odgovori respondenta
$tex .= $this->LatexTextBox($export_format, $textboxHeightOdgovori, $textboxWidthOdgovori, $answer, $textboxAllignment, $noBordersOdgovori);
//zakljucek tabele
- $tex .= $this->EndLatexTable($export_format, 'tabularx', 'tabular');
+ $tex .= $this->EndLatexTable($export_format, 'xltabular', 'tabular');
//$tex .= $texNewLine;
}
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php b/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php
index 11f4be2..e7d8347 100644
--- a/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/MultiGridLatex.php
@@ -10,15 +10,16 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
-define("U_SHAPE_WIDTH_U", 4);
-define("U_SHAPE_WIDTH_OKVIR", 3.62);
-define("U_SHAPE_WIDTH_TEXT_U", 2.2);
-define("U_SHAPE_WIDTH_TEXT_OKVIR", 1.81);
-define("MAXSTEVILOSTOLPCEV", 21); //max Stevilo Stolpcev za prvo vrstico pod Drsnikom, zaradi tezav z izrisom, ce je teh vec kot toliko
-define("VAS_SIZE", 0.04); //VAS_SIZE
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
+if (!defined('U_SHAPE_WIDTH_U')) define("U_SHAPE_WIDTH_U", 4);
+if (!defined('U_SHAPE_WIDTH_OKVIR')) define("U_SHAPE_WIDTH_OKVIR", 3.62);
+if (!defined('U_SHAPE_WIDTH_TEXT_U')) define("U_SHAPE_WIDTH_TEXT_U", 2.2);
+if (!defined('U_SHAPE_WIDTH_TEXT_OKVIR')) define("U_SHAPE_WIDTH_TEXT_OKVIR", 1.81);
+if (!defined('MAXSTEVILOSTOLPCEV')) define("MAXSTEVILOSTOLPCEV", 21); //max Stevilo Stolpcev za prvo vrstico pod Drsnikom, zaradi tezav z izrisom, ce je teh vec kot toliko
+if (!defined('VAS_SIZE')) define("VAS_SIZE", 0.04); //VAS_SIZE
class MultiGridLatex extends LatexSurveyElement
{
@@ -40,11 +41,13 @@ class MultiGridLatex extends LatexSurveyElement
protected $textRVreId = array(); //belezi vre_id navpicnih odgovorov, ki so bili izbrani in morajo biti na desni strani povleci-spusti
protected $navpicniOdgovoriVreId = array(); //belezi vre_id navpicnih odgovorov
protected $loop_id = null; // id trenutnega loopa ce jih imamo
+ protected $usr_id = null;
protected $path2ImagesMulti;
-
+
protected $language;
-
+ protected $prevod;
+
public function __construct()
{
global $site_path;
@@ -68,7 +71,9 @@ class MultiGridLatex extends LatexSurveyElement
#funkcija za izvoz vprasalnika za posameznega respondenta
public function exportData($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype=''){
global $lang;
- //echo "exportData";
+
+
+
// iz baze preberemo vse moznosti - ko nimamo izpisa z odgovori respondenta
//$sqlVrednosti = sisplet_query("SELECT id, naslov, naslov2, variable, other, spr_id FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
$sqlVrednosti = sisplet_query("SELECT id, naslov, naslov2, variable, other, spr_id FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' AND hidden='0' ORDER BY vrstni_red");
@@ -97,7 +102,6 @@ class MultiGridLatex extends LatexSurveyElement
$texNewLineAfterTable = $texNewLine." ".$texNewLine." ".$texNewLine;
if($spremenljivke['enota']==10){ //ce je image hotspot
$indeksZaWhile = 1;
- //echo "Indeks je ena ce je hotspot </br>";
}
$indeksDvojnaTabela1 = 1;
$indeksDvojnaTabela2 = 1;
@@ -110,10 +114,10 @@ class MultiGridLatex extends LatexSurveyElement
while ($colVrednost = mysqli_fetch_assoc($sqlStolpciVrednosti)){
if($colVrednost['other'] != 0){
$stringMissingOdgovor = $colVrednost['naslov'];
- array_push($missingOdgovori, $this->encodeText($stringMissingOdgovor) ); //filanje polja z missing odgovori
+ array_push($missingOdgovori, LatexDocument::encodeText($stringMissingOdgovor, 0, 1) ); //filanje polja z missing odgovori
}else{
$stringTitleCol = $colVrednost['naslov'];
- array_push($vodoravniOdgovori, $this->encodeText($stringTitleCol) ); //filanje polja z vodoravnimi odgovori (po stolpcih)
+ array_push($vodoravniOdgovori, LatexDocument::encodeText($stringTitleCol, 0, 1) ); //filanje polja z vodoravnimi odgovori (po stolpcih)
}
}
//pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti - konec
@@ -135,7 +139,7 @@ class MultiGridLatex extends LatexSurveyElement
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$indeksZaWhile = 1;
//navpicni odgovori
- $stringCell_title = $this->encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) );
+ $stringCell_title = LatexDocument::encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ), 0, 1 );
// še dodamo textbox če je polje other
$_txt = '';
@@ -143,18 +147,10 @@ class MultiGridLatex extends LatexSurveyElement
//$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id='".$usr_id."' AND loop_id $loop_id");
$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id);
$row4 = mysqli_fetch_assoc($sqlOtherText);
- $_txt = ' '.$row4['text'];
- //if($_txt!=' '){
- //$stringCell_title .= $_txt.':';
- //}
+ if(isset($row4)){
+ $_txt = ' '.$row4['text'];
+ }
}
- //echo "zacetek funkcije </br>";
- //if($spremenljivke['enota']!=10){ //ce ni image hotspot
-/* if($spremenljivke['enota']!=10&&$indeksZaWhile==1){ //ce ni image hotspot
- $indeksZaWhile = 1;
- echo "Indeks je ena ce ni hotspot </br>";
- } */
- //echo "odgovor: ".$stringCell_title." </br>";
$IndeksZaMissing=1;
@@ -166,21 +162,15 @@ class MultiGridLatex extends LatexSurveyElement
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
if((count($missingOdgovori))&&($spremenljivke['tip']==19||$spremenljivke['tip']==20)){ //ce so missing-i
- //echo "missing</br>";
$sqlUserAnswerMissing = $this->GetUsersDataGrid($spremenljivkeData, $db_table, $rowVrednost, $rowVsehVrednosti, $usr_id,0);
$userAnswerMissing = mysqli_fetch_assoc($sqlUserAnswerMissing);
- //echo "userAnswer Missing: ".$userAnswerMissing['grd_id'].'</br>';
}
- //echo "rowVsehVrednosti['id']: ".$rowVsehVrednosti['id'].'</br>';
- //echo "userAnswer: ".$userAnswer['text'].'</br>';
- //echo "userAnswer: ".$userAnswer['grd_id'].'</br>';
- //echo "rowVrednost['spr_id']: ".$rowVrednost['spr_id'].'</br>';
- if($rowVsehVrednosti['id'] == $userAnswer['grd_id']){ //ce je podatek
+ if($rowVsehVrednosti['id'] == isset($userAnswer['grd_id'])){ //ce je podatek
if($indeksDvojnaTabela1==1&&$spremenljivke['enota']==3&&in_array($spremenljivke['tip'], array(6, 16))){ //samo prvic izpisi nadnaslov 1, ce je dvojna tabela
//naslov prvega dela grida za dvojno tabelo
- $tex1 .= $this->encodeText($spremenljivke['grid_subtitle1']).$texNewLine;
+ $tex1 .= LatexDocument::encodeText($spremenljivke['grid_subtitle1'], 0, 1).$texNewLine;
}
if($spremenljivke['tip']==6||$spremenljivke['tip']==16){
if(($vNovoVrstico==1&&$spremenljivke['tip']==16)||$spremenljivke['tip']==6){
@@ -192,32 +182,24 @@ class MultiGridLatex extends LatexSurveyElement
if($spremenljivke['tip']==16&&$indeksZaWhile!=1){
$tex1 .= ', ';
}
- $tex1 .= ' '.$this->encodeText($rowVsehVrednosti['naslov']);
+ $tex1 .= ' '.LatexDocument::encodeText($rowVsehVrednosti['naslov'], 0, 1);
//$tex1 .= ' \\textcolor{crta}{'.$this->encodeText($rowVsehVrednosti['naslov']).'}';
}
- //echo "Sprememba indeksa </br>";
$indeksZaWhile++;
- $podatek = 1;
- //echo "Zgornji: ".$indeksZaWhile."</br>";
- //echo "Zgornji: ".$indeksZaWhile." za ".$this->encodeText($rowVsehVrednosti['naslov'])."</br>";
- //echo "tex: ".$tex1."</br>";
+ $podatek = 1;
}else{
$podatek = 0;
}
-
- //echo $this->encodeText($this->userAnswer['text']).'</br>';
if($spremenljivke['tip']==19||$spremenljivke['tip']==20){ //ce je grid stevilk ali besedil
- //echo "Indeks missing: ".$IndeksZaMissing."</br>";
if(($IndeksZaMissing > ($numColSql-count($missingOdgovori)))&&(count($missingOdgovori))){
- //echo "userAnswer Missing je prisoten in njegov grd_id je: ".$userAnswerMissing['grd_id'].'</br>';
- $okvirZOdgovori = $this->getAnswerSymbol($export_format, $fillablePdf, 6, $spremenljivke['grids'], count($missingOdgovori), $userAnswerMissing['grd_id']);
+ $okvirZOdgovori = $this->getAnswerSymbol(null, $export_format, $fillablePdf, 6, $spremenljivke['grids'], count($missingOdgovori), $userAnswerMissing['grd_id']);
}else{
- $okvirZOdgovori = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], count($missingOdgovori),$this->encodeText($userAnswer['text']));
+ $user_answer_var = isset($userAnswer['text'])?$userAnswer['text']:'';
+ $okvirZOdgovori = $this->getAnswerSymbol(null, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], count($missingOdgovori), $user_answer_var);
}
//$okvirZOdgovori = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], count($missingOdgovori),$this->encodeText($userAnswer['text']));
- //echo "okvirZOdgovori: ".$okvirZOdgovori."</br>";
array_push($odgovoriRespondent, $okvirZOdgovori);
}
@@ -238,11 +220,7 @@ class MultiGridLatex extends LatexSurveyElement
$tex2 = '';
$tex .= $tex1.$tex2; //zdruzitev obeh delov latex kode
- //echo "tex: ".$tex." za ".$spremenljivke['variable']."</br>";
if($spremenljivke['tip']==19||$spremenljivke['tip']==20){ //ce je grid stevilk ali besedil
- //echo "stevilo odgovorov: ".count($odgovoriRespondent)."</br>";
- //echo "stevilo odgovorov missing: ".count($userAnswerMissing)."</br>";
- //echo "stevilo odgovorov : ".count($userAnswer)."</br>";
return $odgovoriRespondent;
}else{
return $tex;
@@ -252,18 +230,23 @@ class MultiGridLatex extends LatexSurveyElement
#funkcija za izvoz vprasalnika za posameznega respondenta - konec
- //public function export($spremenljivke, $export_format, $questionText, $fillablePdf, $texNewLine, $export_subtype){
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $skipEmptySub=null, $export_data_type='', $skipEmpty=null, $loop_id=null, $language=null){
- //echo $export_data_type."</br>";
+ $time_start = microtime(true);
+ $this->exportDataType = $export_data_type;
global $lang;
$this->language = $language;
-
+ //preverjanje, ali je prevod
+ $this->prevod = $this->language?1:0;
+ //preverjanje, ali je prevod - konec
+
$this->preveriSpremenljivko = $preveriSpremenljivko;
- $this->skipEmpty =$skipEmpty;
+ $this->skipEmpty = $skipEmpty;
$this->skipEmptySub = $skipEmptySub;
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
+ $this->usr_id = $usr_id;
+
// iz baze preberemo vse moznosti - ko nimamo izpisa z odgovori respondenta
//$sqlVrednosti = sisplet_query("SELECT id, naslov, naslov2, variable, other, spr_id FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
@@ -276,9 +259,9 @@ class MultiGridLatex extends LatexSurveyElement
$tex = '';
- if($export_subtype!='q_empty'&&$export_data_type!=1){ //ce ni prazen vprasalnik in izpis ni Dolg, dodaj prazno vrstico
+ //if($export_subtype!='q_empty'&&$export_data_type!=1){ //ce ni prazen vprasalnik in izpis ni Dolg, dodaj prazno vrstico
//$tex .= '\\\\';
- }
+ //}
$navpicniOdgovori = array();
$navpicniOdgovori = [];
@@ -289,188 +272,128 @@ class MultiGridLatex extends LatexSurveyElement
$missingOdgovori = array();
$missingOdgovori = [];
$userAnswerData = array();
- //$textRVreId = array();
-
+
$indeksOdgovorovTextR = 0;
$texNewLineAfterTable = $texNewLine." ".$texNewLine." ".$texNewLine;
$indeksZaWhile = 1;
$indeksOdgovorov = 0;
- //echo "Funkcija export </br>";
-
$nacinVnosa = $spremenljivke['ranking_k']; //nacin vnosa 0-Stevilo, 1-Drsnik
+ //$sqlVsehVrednsti = sisplet_query("SELECT id, naslov FROM srv_grid WHERE spr_id='".$spremenljivke['id']."' ORDER BY 'vrstni_red'");
+
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
- //$prop['full'] = ( isset($userAnswer[$rowVrednost['id']]) );
-
- //$stringTitleRow = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
-
- #ce je respondent odgovarjal v drugem jeziku ########################
- $rowl = $this->srv_language_vrednost($rowVrednost['id']);
- if (strip_tags($rowl['naslov']) != '') $rowVrednost['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['naslov2']) != '') $rowVrednost['naslov2'] = $rowl['naslov2'];
- #ce je respondent odgovarjal v drugem jeziku - konec ################
-
- $stringTitleRow = $rowVrednost['naslov']; //odgovori na levi strani (za tabela diferencial)
- $stringTitleRow2 = $rowVrednost['naslov2']; //odgovori na desni strani (za tabela diferencial)
-
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow, $rowVrednost['id']) ); //filanje polja z navpicnimi odgovori (po vrsticah)
- array_push($navpicniOdgovori2, $this->encodeText($stringTitleRow2, $rowVrednost['id']) ); //filanje polja z navpicnimi odgovori2 (po vrsticah)
if($spremenljivke['enota']==9){ //ce je povleci-spusti
array_push($this->navpicniOdgovoriVreId, $rowVrednost['id'] ); //filanje polja z vre_id navpicnih odgovorov (po vrsticah), potrebno za povleci-spusti
- //array_push($this->navpicniOdgovoriVreId, $rowVrednost['spr_id'] ); //filanje polja z vre_id navpicnih odgovorov (po vrsticah), potrebno za povleci-spusti
}
$indeksZaWhile++;
- //echo "rowVrednost['id']: ".$rowVrednost['id'].'</br>';
$indeksZaWhileVsehVrednosti = 1;
$indeksEnaMoznostProtiDrugi = 0; //belezi stevilo odgovorov v eni vrstici za enota=4
- $sqlVsehVrednsti = sisplet_query("SELECT id, naslov FROM srv_grid WHERE spr_id='".$spremenljivke['id']."' ORDER BY 'vrstni_red'");
- //echo "začne drugi while </br>";
+ $sqlVsehVrednsti = sisplet_query("SELECT id, naslov FROM srv_grid WHERE spr_id='".$spremenljivke['id']."' ORDER BY 'vrstni_red'");
while ($rowVsehVrednosti = mysqli_fetch_assoc($sqlVsehVrednsti)){
- //$indeksZaWhile = $this->GetUsersDataGrid($spremenljivke, $this->db_table, $rowVrednost, $rowVsehVrednosti, $this->usr_id, 1);
- //$sqlUserAnswer = $this->GetUsersDataGrid($spremenljivke, $db_table, $rowVrednost, $rowVsehVrednosti, $usr_id, 0);
$sqlUserAnswer = $this->GetUsersDataGrid($spremenljivke, $db_table, $rowVrednost, $rowVsehVrednosti, $usr_id, 0, $this->loop_id);
-
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- //echo "userAnswer: ".$userAnswer['grd_id'].'</br>';
- //echo "userAnswerVreId: ".$userAnswer['vre_id'].'</br>';
- //echo "text: ".$userAnswer['text'].'</br>';
-
-/* if($spremenljivke['enota']==4&&$userAnswer['grd_id']){
- $userAnswerData[$indeksOdgovorov] = $userAnswer['grd_id'];
- echo "userAnswerData: ".$userAnswerData[$indeksOdgovorov].'</br>';
- //echo 'je 4 </br>';
- $indeksOdgovorov++; */
if($spremenljivke['enota']==4){ //ce je ena moznost proti drugi
- //echo 'je 4 '.$indeksOdgovorov.'</br>';
if($userAnswer['grd_id']){ //ce je podatek, ga zabelezi
$userAnswerData[$indeksOdgovorov] = $userAnswer['grd_id'];
- //echo "userAnswerData s podatkom: ".$userAnswerData[$indeksOdgovorov].'</br>';
- //echo 'je 4 '.$indeksOdgovorov.'</br>';
$indeksOdgovorov++;
}else{ //drugace
if($indeksEnaMoznostProtiDrugi>=1){
$userAnswerData[$indeksOdgovorov] = $userAnswer['grd_id'];
- //echo "rabim prazno polje </br>";
- //echo "userAnswerData brez podatka: ".$userAnswerData[$indeksOdgovorov].'</br>';
- //echo 'je 4 '.$indeksOdgovorov.'</br>';
$indeksOdgovorov++;
}
- //echo "indeks se spremeni </br>";
$indeksEnaMoznostProtiDrugi++;
}
- //echo "indeksEnaMoznostProtiDrugi: ".$indeksEnaMoznostProtiDrugi.'</br>';
- //echo "userAnswerData: ".$userAnswerData[$indeksOdgovorov].'</br>';
- }elseif($spremenljivke['enota']!=4){
- $userAnswerData[$indeksOdgovorov] = $userAnswer['grd_id'];
- $userAnswerDataText[$indeksOdgovorov] = $userAnswer['text'];
+ }elseif($spremenljivke['enota']!=4){
+ $userAnswerData[$indeksOdgovorov] = isset($userAnswer['grd_id']) ? $userAnswer['grd_id'] : null;
+ $userAnswerDataText[$indeksOdgovorov] = isset($userAnswer['text']) ? $userAnswer['text'] : '';
if($spremenljivke['enota']==9){ //povleci spusti
- $this->textRVreId[$indeksOdgovorov] = $userAnswer['vre_id'];
+ $this->textRVreId[$indeksOdgovorov] = isset($userAnswer['vre_id']) ? $userAnswer['vre_id'] : null;
if(isset($userAnswer['vre_id'])){
//$sqlTextRString = 'SELECT naslov FROM srv_vrednost WHERE id='.$userAnswer['vre_id'].' ';
- $sqlTextRString = 'SELECT naslov FROM srv_vrednost WHERE id='.$userAnswer['vre_id'].' AND hidden="0" ';
- //echo $sqlTextRString."</br>";
+ $sqlTextRString = 'SELECT naslov FROM srv_vrednost WHERE id='.(isset($userAnswer['vre_id']) ? $userAnswer['vre_id'] : null).' AND hidden="0" ';
$sqlTextR = sisplet_query($sqlTextRString);
$rowTextR = mysqli_fetch_assoc($sqlTextR);
- //echo $rowTextR['naslov']."</br>";
- //echo $indeksOdgovorovTextR.'</br>';
-
- //$this->textRArray[$indeksOdgovorovTextR] = $rowTextR['naslov'];
-
- //$this->textRArrayIndex[$userAnswer['grd_id']] = array($this->textRArray[$indeksOdgovorovTextR]);
- //echo "this->textRArray indeks ".$userAnswer['grd_id']." ".$this->textRArrayIndex[$userAnswer['grd_id']][$indeksOdgovorovTextR].'</br>';
$this->textRArray[$indeksOdgovorovTextR][$userAnswer['grd_id']]=$rowTextR['naslov'];
- //echo "this->textRArray: ".$this->textRArray[$indeksOdgovorovTextR][$userAnswer['grd_id']].'</br>';
- //echo "this->textRArray indeks ".$indeksOdgovorov." ".$textRVreId[$indeksOdgovorov].'</br>';
$indeksOdgovorovTextR++;
}
}
$indeksOdgovorov++;
- }
- //echo "rowVrednost['spr_id']: ".$rowVrednost['spr_id'].'</br>';
- //echo "rowVrednost['id']: ".$rowVrednost['id'].'</br>';
- //echo "rowVsehVrednosti['id']: ".$rowVsehVrednosti['id'].'</br>';
- if($rowVsehVrednosti['id'] == $userAnswer['grd_id']){
+ }
+ if( ($userAnswer!=null && ($rowVsehVrednosti['id'] == $userAnswer['grd_id'])) || $rowVrednost['other'] ){
$indeksZaWhileVsehVrednosti++;
}
if($indeksZaWhileVsehVrednosti!=1){
$userDataPresent = 1;
+ }else{
+ $userDataPresent = 0;
}
- //echo "userAnswerData: ".$userAnswerData[$indeksOdgovorov].'</br>';
- //echo "enota: ".$spremenljivke['enota'].'</br>';
- //echo "indeksOdgovorov: ".$indeksOdgovorov.'</br>';
- //$indeksOdgovorov++;
}
+
+ #ce je respondent odgovarjal v drugem jeziku ########################
+ $rowl = $this->srv_language_vrednost($rowVrednost['id']);
+ if ($rowl!=null && strip_tags($rowl['naslov']) != '' && !$userDataPresent) $rowVrednost['naslov'] = $rowl['naslov'];
+ if ($rowl!=null && strip_tags($rowl['naslov2']) != '' && !$userDataPresent) $rowVrednost['naslov2'] = $rowl['naslov2'];
+ #ce je respondent odgovarjal v drugem jeziku - konec ################
+
+ if($usr_id){
+ $stringTitleRow = Common::getInstance()->dataPiping($rowVrednost['naslov'], $usr_id, $loop_id); //odgovori na levi strani (za tabela diferencial)
+ $stringTitleRow2 = Common::getInstance()->dataPiping($rowVrednost['naslov2'], $usr_id, $loop_id); //odgovori na desni strani (za tabela diferencial)
+ }else{
+ $stringTitleRow = $rowVrednost['naslov'];
+ $stringTitleRow2 = $rowVrednost['naslov2'];
+ }
+
+ array_push($navpicniOdgovori, LatexDocument::encodeText($stringTitleRow, $rowVrednost['id'], 1) ); //filanje polja z navpicnimi odgovori (po vrsticah)
+ array_push($navpicniOdgovori2, LatexDocument::encodeText($stringTitleRow2, $rowVrednost['id'], 1) ); //filanje polja z navpicnimi odgovori2 (po vrsticah)
+
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - konec
-
- /* echo "userDataPresent: ".$userDataPresent."</br>";
- echo "preveriSpremenljivko: ".$preveriSpremenljivko."</br>"; */
-
+
$this->userDataPresent = $userDataPresent;
- if($userDataPresent!=0||$export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){ //ce je kaj v bazi ali je prazen vprasalnik ali je potrebno pokazati tudi ne odgovorjena vprasanja
- //echo count($userAnswerData)." za ".$spremenljivke['id']."</br>";
+ //if($userDataPresent!=0||$export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){ //ce je kaj v bazi ali je prazen vprasalnik ali je potrebno pokazati tudi ne odgovorjena vprasanja
//pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti
- while ($colVrednost = mysqli_fetch_assoc($sqlStolpciVrednosti)){
+ while ($colVrednost = mysqli_fetch_assoc($sqlStolpciVrednosti)){
+ #ce je respondent odgovarjal v drugem jeziku ########################
+ $rowl = $this->srv_language_grid($colVrednost['id'],$spremenljivke['id']);
+ if ($rowl!=null && strip_tags($rowl['naslov']) != '' && !$userDataPresent) $colVrednost['naslov'] = $rowl['naslov'];
+ #ce je respondent odgovarjal v drugem jeziku - konec ################
if($colVrednost['other'] != 0){
$stringMissingOdgovor = $colVrednost['naslov'];
- array_push($missingOdgovori, $this->encodeText($stringMissingOdgovor) ); //filanje polja z missing odgovori
- }else{
- #ce je respondent odgovarjal v drugem jeziku ########################
- $rowl = $this->srv_language_grid($colVrednost['id'],$spremenljivke['id']);
- if (strip_tags($rowl['naslov']) != '') $colVrednost['naslov'] = $rowl['naslov'];
- #ce je respondent odgovarjal v drugem jeziku - konec ################
-
+ array_push($missingOdgovori, LatexDocument::encodeText($stringMissingOdgovor, 0, 1) ); //filanje polja z missing odgovori
+ }else{
$stringTitleCol = $colVrednost['naslov'];
$stringTitleCol = str_replace('<br />','',$stringTitleCol); //odstranitev odvecnih </br> iz naslova stolpcev
- array_push($vodoravniOdgovori, $this->encodeText($stringTitleCol) ); //filanje polja z vodoravnimi odgovori (po stolpcih)
+ if($usr_id){
+ $stringTitleCol = Common::getInstance()->dataPiping($stringTitleCol, $usr_id, $loop_id);
+ }
+ array_push($vodoravniOdgovori, LatexDocument::encodeText($stringTitleCol, 0, 1) ); //filanje polja z vodoravnimi odgovori (po stolpcih)
}
}
- //pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti - konec
+ //pregled vseh odgovorov po stolpcih po $sqlStolpciVrednosti - konec
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){ //ce je dolg izvoz
- //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov
- if($spremenljivke['tip']==6){ //grid radio
- //if($spremenljivke['enota']!=11){ //ce ni VAS
- if($spremenljivke['enota']!=11 && $spremenljivke['enota']!=12){ //ce ni VAS in ni slikovni tip
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0);
- //$tex .= '{\ChoiceMenu[radio,radiosymbol=\ding{108},name=myGroupOfRadiobuttons]{}{='.$stringTitle.'}}'.$stringTitle.' '.$this->texNewLine;
- //echo "simbol radio grid: ".$symbol."</br>";
- }else{ //drugace, ce je VAS
- //$symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0, $spremenljivke['enota']);
- //echo "simbol VAS: ".$symbol."</br>";
- //echo "simbol radio grid: ".$spremenljivke['enota']."</br>";
- }
- $internalCellHeight = '1 cm'; //visina praznega okvirja @povleci-spusti
- }else if($spremenljivke['tip']==16){ //grid checkbox
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0);
- $internalCellHeight = '3 cm'; //visina praznega okvirja @povleci-spusti
- }else if($spremenljivke['tip']==19||$spremenljivke['tip']==20){//multi text ali multinumber
+ //na novo
+ $fillablePdf = 0;
+ if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){ //ce je dolg izvoz ALI ( je izvoz praznega vprasalnika ali vprasalnika s komentarji)
+ $internalCellHeight = '3 cm';
+ if($spremenljivke['tip'] == 19 || $spremenljivke['tip'] == 20){ // ce je multitext ali multinumber
+ //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov
if($export_subtype=='q_empty'||$export_subtype=='q_comment'){ //ce je prazen vprasalnik ali vprasalnik s komentarji
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], count($missingOdgovori), 0);
- //$internalCellHeight = '3 cm'; //visina praznega okvirja @povleci-spusti
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], count($missingOdgovori), 0);
}else{ //ce je vprasalnik s podatki
$symbol = $this->exportData($spremenljivke, $export_format, $questionText, $fillablePdf, $texNewLine, $usr_id, $db_table, $export_subtype);
}
- }
- $this->internalCellHeight = $internalCellHeight;
- //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov - konec
- }
-
- $fillablePdf = 0;
- if((($spremenljivke['enota']==0)&&($spremenljivke['tip']==6||$spremenljivke['tip']==16))||($spremenljivke['tip']==19||$spremenljivke['tip']==20)){ //klasicna tabela ali multitext ali multinumber
-
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- if($spremenljivke['tip']==20){ //ce je tip vprasanja stevilo
+ //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov - konec
+
+ if($spremenljivke['tip'] == 20){ //ce je tip vprasanja stevilo
if(($nacinVnosa == 0)){ //ce je nacin vnosa Stevilo
$tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerDataText, $export_subtype);
}else if($nacinVnosa == 1 && $export_format=='pdf'){ //ce so drsniki in je pdf
@@ -478,170 +401,104 @@ class MultiGridLatex extends LatexSurveyElement
}else if($nacinVnosa == 1 && $export_format=='rtf'){ //ce so drsniki in je rtf
$tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerDataText, $export_subtype);
}
- }else{
+ }else{ //drugace (ce je multitext)
$tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
}
-
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Skrcen izvoz
- //$tex .= "Navaden ali Kratek izvoz ".$texNewLine;
- //echo "export_data_type $export_data_type </br>";
-
- $navpicniOdgovori2 = 0;
- //if($spremenljivke['tip']==20){ //ce je tip vprasanja stevilo
- if($spremenljivke['tip']==20 || $spremenljivke['tip']==19){ //ce je tip vprasanja multi stevilo ali multi besedilo
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerDataText, $export_subtype);
- }else{ //ce je grid en in vec odgovorov
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- //$tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerDataText, $export_subtype);
+ }elseif($spremenljivke['tip'] == 6 || $spremenljivke['tip'] == 16){ //klasicna tabela
+ //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov
+ if($spremenljivke['tip'] == 6){ //grid radio
+ if($spremenljivke['enota'] != 11 && $spremenljivke['enota'] != 12){ //ce ni VAS in ni slikovni tip
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0);
+ }elseif($spremenljivke['enota'] == 11){ // ce je VAS
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0, $spremenljivke['enota'], 1, '', $spremenljivke['id']);
+ //$symbol = [];
+ //$symbol = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas1}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas4}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas7}");
+ }
+ $internalCellHeight = '1 cm'; //visina praznega okvirja @povleci-spusti
+ }else if($spremenljivke['tip'] == 16){ //grid checkbox
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0);
+ $internalCellHeight = '3 cm'; //visina praznega okvirja @povleci-spusti
}
- }
- }elseif($spremenljivke['enota']==1){ //tabela diferencial
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==2 || $spremenljivke['enota']==6){ //roleta ali izberite s seznama
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==4){ //ena moznost proti drugi
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- //$tex .= "Navaden ali Kratek izvoz ".$texNewLine;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==5){ //maxdiff
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- //$tex .= "Navaden ali Kratek izvoz ".$texNewLine;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==8){ //tabela da/ne
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- //$tex .= "Navaden ali Kratek izvoz ".$texNewLine;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
-
- }
- }elseif($spremenljivke['enota']==10){ //image hotspot
- //if($export_subtype=='q_empty'){ //ce je prazen vprasalnik
- //if($export_subtype=='q_empty'||$export_subtype=='q_comment'){ //ce je prazen vprasalnik
- if($export_data_type==1||$export_subtype=='q_empty'||$export_subtype=='q_comment'){ //ce je prazen vprasalnik
- $imageName = $this->getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
- $imageNameTest = $this->path2ImagesMulti.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
- //echo("za image hot spot grid: ".$imageNameTest."</br>");
- if(filesize($imageNameTest) > 0){
- $image = PIC_SIZE."{".$this->path2ImagesMulti."".$imageName."}"; //priprave slike predefinirane dimenzije
+ //pridobitev ustreznega simbola (ali podatkov) za izris odgovorov - konec
+
+ $enote_brez_navp_odgov_2 = array(0, 2, 6, 5, 8, 3, 11, 12); //grid en in vec odgovorov, roleta, izberite s seznama, maxdiff, tabela da/ne, dvojna tabela, VAS, slikovni tip
+ if( in_array($spremenljivke['enota'], $enote_brez_navp_odgov_2) ){
+ $navpicniOdgovori2 = 0;
+ }
+ if($spremenljivke['enota']==10){ //image hotspot
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
+ $imageNameTest = $this->path2ImagesMulti.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
+ if(filesize($imageNameTest) > 0){
+ $image = PIC_SIZE."{".$this->path2ImagesMulti."".$imageName."}"; //priprave slike predefinirane dimenzije
+ }else{
+ $image = $lang['srv_pc_unavailable'];
+ }
+
+ $tex .= $texNewLine; //prazna vrstica po vprasanju
+ $tex .= $image."".$texNewLine; //izris slike
+
+ //iz baze poberi imena obmocij
+ $sqlHotSpotRegions = sisplet_query("SELECT region_name FROM srv_hotspot_regions WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
+
+ //izris imen obmocij po $sqlHotSpotRegions
+ $tex .= $lang['srv_export_hotspot_regions_names'].': '.$texNewLine;
+ while ($rowHotSpotRegions = mysqli_fetch_assoc($sqlHotSpotRegions))
+ {
+ $tex .= $rowHotSpotRegions['region_name'].''.$texNewLine;
+ }
+
+ //ureditev missing-ov
+ if(count($missingOdgovori)!=0){ //ce so missing-i
+ $vodoravniOdgovori = $this->AddMissingsToAnswers($vodoravniOdgovori, $missingOdgovori);
+ }
+ //ureditev missing-ov - konec
+
+ //izris moznih odgovorov
+ $tex .= $lang['srv_drag_drop_answers'].': '.$texNewLine;
+ for($i=0; $i<$numColSql; $i++){
+ $tex .= $vodoravniOdgovori[$i].$texNewLine;
+ }
+ if(($export_subtype=='q_data'||$export_subtype=='q_data_all')){ //ce je izpis respodenta
+ $tex .= $this->texNewLine;
+ $tex .= $lang['srv_respondent_answer'].": ".$this->texNewLine;
+ $navpicniOdgovori2 = 0;
+ $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
+ }else{
+ //prostor po izpisu, ce ni odgovorov respondenta
+ $tex .= '\vspace{0.5 cm}';
+ $tex .= $texNewLine;
+ }
+ }elseif($spremenljivke['enota'] == 9){ //povleci spusti
+ $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
}else{
- //$image = 'ni slike';
- $image = $lang['srv_pc_unavailable'];
- }
-
- $tex .= $texNewLine; //prazna vrstica po vprasanju
- $tex .= $image."".$texNewLine; //izris slike
-
- //iz baze poberi imena obmocij
- $sqlHotSpotRegions = sisplet_query("SELECT region_name FROM srv_hotspot_regions WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
-
- //izris imen obmocij po $sqlHotSpotRegions
- $tex .= $lang['srv_export_hotspot_regions_names'].': '.$texNewLine;
- while ($rowHotSpotRegions = mysqli_fetch_assoc($sqlHotSpotRegions))
- {
- $tex .= $rowHotSpotRegions['region_name'].''.$texNewLine;
+ $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
}
-
- //$tex .= $texNewLine;
-
- //ureditev missing-ov
- if(count($missingOdgovori)!=0){ //ce so missing-i
- $vodoravniOdgovori = $this->AddMissingsToAnswers($vodoravniOdgovori, $missingOdgovori);
- }
- //ureditev missing-ov - konec
-
-
- //izris moznih odgovorov
- $tex .= $lang['srv_drag_drop_answers'].': '.$texNewLine;
- for($i=0; $i<$numColSql; $i++){
- $tex .= $vodoravniOdgovori[$i].$texNewLine;
- }
- }/* else{ //ce je vprasalnik s podatki
- $tex .= $this->exportData($spremenljivke, $export_format, $questionText, $fillablePdf, $texNewLine, $usr_id, $db_table, $export_subtype);
- } */
- if(($export_data_type==1||$export_data_type==0||$export_data_type==2)&&($export_subtype=='q_data'||$export_subtype=='q_data_all')){ //ce je Dolg, Navaden ali Kratek izvoz
- if($export_data_type==1){ //ce je Dolg izvoz
- $tex .= $this->texNewLine;
- $tex .= $lang['srv_respondent_answer'].": ".$this->texNewLine;
- }
-
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
-
- //prostor po izpisu tabele
- //$tex .= $texNewLine;
- //$tex .= $texNewLine;
-
- }elseif($spremenljivke['enota']==3){ //dvojna tabela
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
}
- }elseif($spremenljivke['enota']==9){ //povleci spusti
-
- //if($export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){
- //if($export_data_type==1||$export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){
- if($export_data_type==1||$export_subtype=='q_empty'||$export_subtype=='q_comment'||($preveriSpremenljivko&&$export_data_type==1)){
- $this->exportDataType = $export_data_type;
-
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==11){ //VAS
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Navaden ali Kratek izvoz
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
- }
- }elseif($spremenljivke['enota']==12){ //slikovni tip
- if($export_data_type==1||($export_subtype=='q_empty'||$export_subtype=='q_comment')){//ce je dolg izvoz ali(prazen vprasalnik ali vpr. s komentarji)
- //izris tabel ustrezne postavitve
- $tex .= $this->IzrisTabeleMultiGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $symbol, $texNewLine, $texNewLineAfterTable, $export_format, 0, $missingOdgovori, $userAnswerData, $export_subtype);
- }elseif($export_data_type==0||$export_data_type==2){ //ce je Skrcen izvoz
- $navpicniOdgovori2 = 0;
- $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
+ $this->internalCellHeight = $internalCellHeight;
+ }elseif($export_data_type==0||$export_data_type==2){ //ce je Skrcen izvoz
+ if($spremenljivke['tip'] == 20 || $spremenljivke['tip'] == 19){ //ce je tip vprasanja multi stevilo ali multi besedilo
+ $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, 0, $export_format, $fillablePdf, $missingOdgovori, $userAnswerDataText, $export_subtype);
+ }elseif($spremenljivke['tip'] == 6 || $spremenljivke['tip'] == 16){ //klasicna tabela
+ $enote_brez_navp_odgov_2 = array(0, 3, 9, 10, 11, 12); //grid en in vec odgovorov, dvojna tabela, povleci-spusti, image hotspot, VAS, slikovni tip
+ if( in_array($spremenljivke['enota'], $enote_brez_navp_odgov_2) ){
+ $navpicniOdgovori2 = 0;
+ }
+ $tex .= $this->IzpisOdgovorovGrid($spremenljivke, $numColSql, $numRowsSql, $vodoravniOdgovori, $navpicniOdgovori, $navpicniOdgovori2, $export_format, $fillablePdf, $missingOdgovori, $userAnswerData, $export_subtype);
}
}
-
+ //na novo - konec
+
+
//$tex .= $texNewLine;
//$tex .= $this->texBigSkip;
//$tex .= $this->texBigSkip;
- if($export_format == 'pdf'){ //ce je pdf
- //$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
- }else{ //ce je rtf
-
- }
+ $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ //echo '</br><b>Total Execution Time tabele</b> '.$execution_time.' sec za vprašanje '.strip_tags($spremenljivke['naslov']).'</br>';
return $tex;
- }
+ //}
+
}
#konec export funkcije
@@ -651,8 +508,6 @@ class MultiGridLatex extends LatexSurveyElement
global $lang;
$skipRow = false;
$izpis = '';
-
-
#missingi##################
if(count($missingOdgovori)!=0){ //ce so missingi, jih je potrebno dodati polju z odgovori po stolpcih ($vodoravniOdgovori)
for($m=0;$m<count($missingOdgovori);$m++){
@@ -660,17 +515,6 @@ class MultiGridLatex extends LatexSurveyElement
}
}
#missingi - konec###########
-
- // TODO: Zanke, ki ne izpisujejo ničesar
- /* foreach($vodoravniOdgovori AS $key => $vodoravniOdgovor){ //za vsak odgovor v vrstici
- echo $vodoravniOdgovor."</br>";
- //echo $key."</br>";
- } */
- //
- /* foreach($data AS $key => $datum){ //za vsak odgovor v vrstici
- echo "Podatek: ".$datum."</br>";
- //echo $key."</br>";
- } */
$z = $j = $i = 0;
@@ -721,7 +565,6 @@ class MultiGridLatex extends LatexSurveyElement
}
foreach($navpicniOdgovori AS $key => $navpicniOdgovor){ //za vsak odgovor v vrstici
- //echo $navpicniOdgovor.": ";
#Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici ###############################
if($this->skipEmptySub == 1){
$skipRow = true;
@@ -729,7 +572,6 @@ class MultiGridLatex extends LatexSurveyElement
if(isset($data[$z])){ //ce je podatek
$skipRow = false;
}
- //echo "surov podatek: ".$data[$z]."</br>";
}
}
#Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici - konec #######################
@@ -758,8 +600,8 @@ class MultiGridLatex extends LatexSurveyElement
if($spremenljivke['enota']==4){ //ce je ena proti drugi
$steviloStolpcev = 1;
}
+ $indeksOdgovor2 = 0;
foreach($navpicniOdgovori AS $key => $navpicniOdgovor){ //za vsak odgovor v vrstici
- //echo $navpicniOdgovor.": ";
#Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici ###############################
if($this->skipEmptySub == 1){
$skipRow = true;
@@ -767,25 +609,24 @@ class MultiGridLatex extends LatexSurveyElement
if(isset($data[$z])){ //ce je podatek
$skipRow = false;
}
- //echo "surov podatek: ".$data[$z]."</br>";
}
}
#Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici - konec #######################
-
$steviloSlikovnihIkon = 0; //belezi stevilo slikovnih ikon
if(!$skipRow){
- //$izpis .= ' \hspace*{0.25\textwidth} '; //da je indent do 25 % sirine strani
if($spremenljivke['enota']!=4){
- $izpis .= $navpicniOdgovor.": ";
+ if($spremenljivke['enota']==1){ //ce je diferencial
+ $izpis .= $navpicniOdgovor."/".$navpicniOdgovori2[$indeksOdgovor2].": ";
+ }else{
+ $izpis .= $navpicniOdgovor.": ";
+ }
}
$odgovorPrisoten = 0; //zastavica za ureditev izpisa vejice, ko je vec odgovorov v eni vrstici
for($j=$j;$j<($steviloStolpcev*($key+1));$j++){
- //echo $j.' ';
- //echo "surov podatek: ".$data[$j]."</br>";
if($spremenljivke['enota']==4){ //ce je ena proti drugi
if($data[$j]==2){
$odgovorEnaProtiDrugi = '\\textcolor{crta}{'.$navpicniOdgovori2[$key].'}';
@@ -793,74 +634,21 @@ class MultiGridLatex extends LatexSurveyElement
$odgovorEnaProtiDrugi = '\\textcolor{crta}{'.$navpicniOdgovor.'}';
}
$izpis .= $odgovorEnaProtiDrugi;
- }/* elseif($spremenljivke['enota']==11){ //ce je VAS
- //echo "surov podatek: ".$data[$j]."</br>";
- //echo "stevilo stolpcev VAS: ".$steviloStolpcev."</br>";
- //$izpis .= "smily ";
- if($data[$j]){
- //$symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, 0, $spremenljivke['enota'], $data[$j]);
- //$VASNumber = $data[$j];
- ##########
- switch ($steviloStolpcev) {
- case 1:
- $VAS = "";
- break;
- case 2:
- $arrayVAS = ['vas3checked', 'vas5checked'];
- break;
- case 3:
- $arrayVAS = ['vas3checked', 'vas4checked', 'vas5checked'];
- break;
- case 4:
- $arrayVAS = ['vas2checked', 'vas3checked', 'vas5checked', 'vas6checked'];
- break;
- case 5:
- $arrayVAS = [ 'vas2checked', 'vas3checked', 'vas4checked', 'vas5checked', 'vas6checked'];
- break;
- case 6:
- $arrayVAS = ['vas1checked', 'vas2checked', 'vas3checked', 'vas5checked', 'vas6checked', 'vas7checked'];
- break;
- case 7:
- $arrayVAS = ['vas1checked', 'vas2checked', 'vas3checked', 'vas4checked', 'vas5checked', 'vas6checked', 'vas7checked'];
- break;
- }
-
- ##########
- if($steviloStolpcev > 1){
- $VAS = $arrayVAS[($data[$j]-1)];
- $symbol = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
-
- $izpis .= $symbol;
- // echo "symbol za VAS odgovor: ".$symbol."</br>";
- }
- } elseif($spremenljivke['enota']==12){ //ce je slikovni tip
- if($data[$j]){ //ce je podatek
- $steviloSlikovnihIkon = $data[$j];
- //echo "stevilo slikovnih ikon: ".$steviloSlikovnihIkon."</br>";
- //echo "_______________________</br>";
- }
- }*/else{
+ }else{
if($i==$steviloStolpcev){
$i=0;
}
- /* echo "tip: ".$spremenljivke['tip']."</br>";
- echo "enota: ".$spremenljivke['enota']."</br>"; */
if(isset($data[$j])){ //ce je podatek
- //echo $vodoravniOdgovori[$i].", ";
- //echo $data[$j].", ";
if($odgovorPrisoten==0){
$odgovorPrisoten = 1;
}else{
- //}elseif($odgovorPrisoten==1){
$izpis .= ", ";
}
- //if($spremenljivke['tip']==20){ //ce je tip vprasanja stevilo
if($spremenljivke['tip']==20||$spremenljivke['enota']==11||$spremenljivke['enota']==12){ //ce je tip vprasanja stevilo ALI VAS ALI slikovni tip
$izpis .= '\\textcolor{crta}{'.$data[$j].'}';
}else{
if($spremenljivke['tip']==19){ //ce je tip vprasanja besedilo
- $izpis .= '\\textcolor{crta}{'.$data[$j].'}';
+ $izpis .= '\\textcolor{crta}{'.LatexDocument::encodeText($data[$j]).'}';
}else{
$izpis .= '\\textcolor{crta}{'.$vodoravniOdgovori[$i].'}';
}
@@ -875,20 +663,18 @@ class MultiGridLatex extends LatexSurveyElement
}
if($spremenljivke['enota']==12){ //ce je slikovni tip, izpisi ustrezno stevilo simbololov
$prviOdgovorSlikovniTip = 1;
- //echo "izpis kode: ".$izpis."</br>";
for($p=0; $p<$steviloSlikovnihIkon; $p++){
$izpis .= ICON_SIZE."{".$this->path2Images."".$this->getCustomRadioSymbol($spremenljivke['id'], $prviOdgovorSlikovniTip)."}";
}
$izpis .= $this->texNewLine;
}
+ $indeksOdgovor2++;
}
} //konec, ce ni dvojna tabela
+ $izpis .= '\vspace{0.5 cm}';
$izpis .= $this->texNewLine;
- /* if($spremenljivke['enota']==3){
- echo $izpis;
- } */
return $izpis;
}
#funkcija, ki skrbi za izpis odgovor za grid vprasanja - konec ########################################################################
@@ -896,19 +682,32 @@ class MultiGridLatex extends LatexSurveyElement
#funkcija, ki skrbi za izris Grida radio buttonov ali checkboxov za klasicno postavitev tabele ################################
function IzrisTabeleMultiGrid($spremenljivke=null, $steviloStolpcev=null, $steviloVrstic=null, $vodoravniOdgovori=null, $navpicniOdgovori=null, $navpicniOdgovori2=null, $simbolTex=null, $texNewLine='', $texNewLineAfterTable=null, $typeOfDocument=null, $fillablePdf=null, $missingOdgovori=null, $data=null, $export_subtype=''){
global $lang;
-
$spremenljivkaParams = new enkaParameters($spremenljivke['params']);
$isCheckBox = 0;
$enota = $spremenljivke['enota'];
+
+ //ce je prevod, naj pobere prevedene razlicice podnaslovov
+ $rowl1 = $this->srv_language_grid(1,$spremenljivke['id']);
+ if ($rowl1) {
+ if (strip_tags($rowl1['podnaslov']) != ''){
+ $spremenljivke['grid_subtitle1'] = $rowl1['podnaslov'];
+ }
+ }
+
+ $rowl2 = $this->srv_language_grid(2,$spremenljivke['id']);
+ if ($rowl2) {
+ if (strip_tags($rowl2['podnaslov']) != '') $spremenljivke['grid_subtitle2'] = $rowl2['podnaslov'];
+ }
+ //ce je prevod, naj pobere prevedene razlicice podnaslovov - konec
+
$podnaslov1 = $spremenljivke['grid_subtitle1']; //podnaslova @dvojna tabela
$podnaslov2 = $spremenljivke['grid_subtitle2'];
+
$trak = ($spremenljivkaParams->get('diferencial_trak') ? $spremenljivkaParams->get('diferencial_trak') : 0);
$customColumnLabelOption = ($spremenljivkaParams->get('custom_column_label_option') ? $spremenljivkaParams->get('custom_column_label_option') : 1); //1 - "vse" labele, 2 - "le koncne" labele, 3 - "koncne in vmesna" labele
-
- //$radioButtonTex = ($export_format=='pdf'?"{\Large $\ocircle$}" : "\\includegraphics[scale=".RADIO_BTN_SIZE."]{radio}");
-
//ce je izbrana oblika traku, poberi potrebne parametre spremenljivke ##################
+ $trakStartingNumber = null;
if($trak == 1){
//stevilo s katerim se zacenja trak
$trakStartingNumber = ($spremenljivkaParams->get('diferencial_trak_starting_num') ? $spremenljivkaParams->get('diferencial_trak_starting_num') : 0);
@@ -926,101 +725,8 @@ class MultiGridLatex extends LatexSurveyElement
}
//ce je izbrana oblika traku, poberi potrebne parametre spremenljivke - konec ##########
- //echo "Grids: ".$spremenljivke['grids']." ";
- //echo "Stevilo stolpcev: ".$steviloStolpcev." ";
-
- //ureditev stevila stolpcev (za parametre tabele in nadaljnji izris) glede na izbrano postavitev #################################################
-
- //if(($enota == 0||$enota == 3)||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali dvojna tabela ali je multitext ali multinumber
- //if(($enota == 0||$enota == 3 || $enota == 11)||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali dvojna tabela ali je multitext ali multinumber ali VAS
- if(($enota == 0||$enota == 3 || $enota == 11 || $enota == 12)||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali dvojna tabela ali je multitext ali multinumber ali VAS ali slikovni tip
- //if($trak == 0 || $enota == 3 || ($trak == 1 && $spremenljivke['tip'] == 16)){
- if(($trak == 0 || $enota == 3 || ($trak == 1 && $spremenljivke['tip'] == 16))||($spremenljivke['tip']==19||$spremenljivke['tip']==20)){
- $steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 1; //ker je prvi stolpec prazen, je potrebno dodati + 1
- }elseif($trak == 1 && $enota == 0 && $spremenljivke['tip'] == 6){
- $steviloStolpcevParameterTabular = $steviloStolpcev + 1;
- }
- }elseif($enota == 1){ //diferencial
- if($trak == 0){ //ce ni na traku
- //$steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
- if(count($missingOdgovori)!=0){ //ce so missingi
- $steviloStolpcevParameterTabular = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
- $steviloStolpcev = $steviloStolpcev + 2 - count($missingOdgovori);
- }else{
- $steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
- }
- }else{ //ce je na traku
- $steviloStolpcevParameterTabular = $steviloStolpcev + 2;
- $steviloStolpcev = $steviloStolpcev + 2 + count($missingOdgovori);
- }
- }elseif($enota == 2 || $enota == 6){ //roleta ali izberite s seznama
- $steviloStolpcevParameterTabular = 2; //pri roleti sta potrebna le dva stolpca
- if(count($missingOdgovori)!=0){ //ce so missingi
- $steviloStolpcev = $spremenljivke['grids'] + count($missingOdgovori) + 1; //+1, ker se pri izrisu indeks zacne z 1
- }
- }elseif($enota == 4){ //ena moznost proti drugi
- $steviloStolpcevParameterTabular = 5;
- if(count($missingOdgovori)!=0){
- $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
- $steviloStolpcev = $steviloStolpcev-count($missingOdgovori);
- }
- }elseif($enota == 5){ //maxdiff
- $steviloStolpcevParameterTabular = 3;
- if(count($missingOdgovori)!=0){
- $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
- $steviloStolpcev = $steviloStolpcev-count($missingOdgovori);
- }
- }elseif($enota == 8){ //tabela da/ne
- $steviloStolpcevParameterTabular = $steviloStolpcev = 3;
- if(count($missingOdgovori)!=0){
- $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
- $steviloStolpcev = $steviloStolpcev+count($missingOdgovori);
- }
- }
- //echo $steviloStolpcev.'</br>';
- //ureditev stevila stolpcev (za parametre tabele in nadaljnji izris) glede na izbrano postavitev - konec #################################################
-
- //ureditev parametrov za tabelo #################################################################################################
- $parameterTabular = '';
- for($i = 0; $i < $steviloStolpcevParameterTabular; $i++){
- //ce je prvi stolpec in ni "ena moznost proti drugi" ALI je zadnji stolpec (pred missing-i) in je "diferencial" ali "ena moznost proti drugi" z missing-i
- if( ($i == 0 && $enota != 4) || ($i == $spremenljivke['grids']+1 && $enota == 1) || (($i == $spremenljivke['grids']+2 && $enota == 4)&&(count($missingOdgovori)!=0)) ) {
- //$parameterTabular .= ($typeOfDocument == 'pdf' ? 'X' : 'l'); //leva poravnava stolpca
- //if($enota == 0 || $enota == 1 || $enota == 3){ //ce je "klasicna tabela" ali diferencial ali dvojna tabela
- //if($enota == 0 || $enota == 1 || $enota == 3 || $enota == 11){ //ce je "klasicna tabela" ali diferencial ali dvojna tabela ali VAS
- if($enota == 0 || $enota == 1 || $enota == 3 || $enota == 11 || $enota == 12){ //ce je "klasicna tabela" ali diferencial ali dvojna tabela ali VAS ali slikovni tip
- if($enota == 1){ //ce je diferencial
- if($i == 0){ //ce je prvi stolpec
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'A' : 'l'); //leva poravnava stolpca fiksne sirine
- }elseif($i == $spremenljivke['grids']+1){ //ce je zadnji stolpec
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'R' : 'r'); //desna poravnava stolpca fiksne sirine
- }
- }else{
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'A' : 'l'); //leva poravnava stolpca fiksne sirine
- }
- }else{
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'X' : 'l'); //leva poravnava stolpca prilagojena sirini
- }
- }elseif($i == $spremenljivke['grids']+2 && $enota == 4){ //ce je zadnji stolpec in je "ena moznost proti drugi" brez missing-ov
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'r' : 'r'); //desna poravnava
- }
- elseif($i == 0 && $enota == 4){ //ce je prvi stolpec in "ena moznost proti drugi"
- //$parameterTabular .= ($typeOfDocument == 'pdf' ? 'r' : 'r'); //desna poravnava stolpca
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'l' : 'l'); //leva poravnava prvega stolpca
- }elseif($i == (intval($steviloStolpcev/2)) && $enota == 3){ //ce smo na sredini stolpcev in je dvojna tabela
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'C|' : 'c|'); //sredinska poravnava stolpca
- }elseif($i == ($steviloStolpcev) && $enota == 5){ //ce je zadnji stolpec in je maxdiff
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'R' : 'r'); //desna za pdf in sredinska poravnava stolpca za rtf
- }else{
- $parameterTabular .= ($typeOfDocument == 'pdf' ? 'C' : 'c'); //sredinska poravnava stolpca
- }
- }
- //ureditev parametrov za tabelo - konec ##########################################################################################
- //echo 'Param: '.$parameterTabular.' enota param: '.$enota.'</br>';
-
//izpis tabela
$tabela = '';
- //echo $enota;
#IZPIS ZA POVLECI SPUSTI
if($enota == 9){ //ce je povleci spusti
@@ -1036,9 +742,9 @@ class MultiGridLatex extends LatexSurveyElement
#pred zacetkom tabel za povleci spusti#######################################################################
//prva vrstica pred tabelo z odgovori
if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= '\keepXColumns\begin{tabularx}{0.45\textwidth}{C} '; //izris s tabelo
+ $tabela .= '\keepXColumns\begin{xltabular}{0.45\textwidth}{C} '; //izris s tabelo
$tabela .= $lang['srv_ranking_available_categories'].': '.$texNewLine;
- $tabela .= '\rule{0.4\textwidth}{0.7 pt} \end{tabularx}';
+ $tabela .= '\rule{0.4\textwidth}{0.7 pt} \end{xltabular}';
}else{ //ce je rtf
$tabela .= '\begin{tabular}{l} '; //izris z enostolpicno tabelo
$tabela .= $lang['srv_ranking_available_categories'].': '.$texNewLine; //Razpolozljive kategorije
@@ -1055,7 +761,7 @@ class MultiGridLatex extends LatexSurveyElement
//zacetek tabele
if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'tabularx', 'tabular*', 0.45, 0.2);
+ $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'xltabular', 'tabular*', 0.45, 0.2);
}
//argumenti za leve okvirje
@@ -1065,7 +771,6 @@ class MultiGridLatex extends LatexSurveyElement
//izris notranjosti leve tabele
- //if($this->exportDataType){ //ce je dolg izpis izvoza odgovorov respondenta/respondentov
if($this->exportDataType&&$spremenljivke['tip']==6){ //ce je dolg izpis izvoza odgovorov respondenta/respondentov in je tabela en odgovor
//najdi razlike med poljema, kjer se belezijo vre_id odgovorov iz leve in desni strani @ povleci-spusti
$navpicniOdgovori = array();
@@ -1079,7 +784,7 @@ class MultiGridLatex extends LatexSurveyElement
$sqlTextL = sisplet_query($sqlTextLString);
$rowTextL = mysqli_fetch_assoc($sqlTextL);
- array_push($navpicniOdgovori, $this->encodeText($rowTextL['naslov']));
+ array_push($navpicniOdgovori, LatexDocument::encodeText($rowTextL['naslov'], 0, 1));
}
}
}
@@ -1113,7 +818,7 @@ class MultiGridLatex extends LatexSurveyElement
//zakljucek tabele
if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= $this->EndLatexTable($typeOfDocument, 'tabularx', 'tabular*');
+ $tabela .= $this->EndLatexTable($typeOfDocument, 'xltabular', 'tabular*');
}
#tabela s kategorijami odgovorov iz levega okvirja - konec ##################################################################
@@ -1123,12 +828,11 @@ class MultiGridLatex extends LatexSurveyElement
#pred zacetkom "desne" tabele za povleci spusti#######################################################################
//prva vrstica pred tabelo z odgovori
if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= '\keepXColumns\begin{tabularx}{0.45\textwidth}{C} '; //izris s tabelo
+ $tabela .= '\keepXColumns\begin{xltabular}{0.45\textwidth}{C} '; //izris s tabelo
$tabela .= $lang['srv_drag_drop_answers'].': '.$texNewLine;
- $tabela .= '\rule{0.4\textwidth}{0.7 pt} \end{tabularx}';
+ $tabela .= '\rule{0.4\textwidth}{0.7 pt} \end{xltabular}';
}else{ //ce je rtf
$tabela .= '\begin{tabular}{l} '; //izris z enostolpicno tabelo
- //$tabela .= $lang['srv_ranking_available_categories'].': '.$texNewLine; //Razpolozljive kategorije
$tabela .= $lang['srv_drag_drop_answers'].': '.$texNewLine; //Razpolozljive kategorije
$tabela .= '\hline \end{tabular} ';
}
@@ -1163,13 +867,7 @@ class MultiGridLatex extends LatexSurveyElement
$texSmallSkip = '';
$textDV = $vodoravniOdgovori[$i]; //besedilo odgovora v okvirju
//izpis latex kode za okvir z odgovorom
- //$textRIzpis .= ' '.$textDV.' '.$this->texNewLine.' \hline';
-
- //$textRIzpis .= ' '.$textDV;
$textNaslovOkvir .= ' '.$textDV;
-
- //$tabela .= $texNewLine;
- //$tabela .= '\indent ';
}else{ //drugace, ce je oblika skatle (prazen okvir na vrhu+tekst spodaj)
$texSmallSkip = $this->texSmallSkip;
}
@@ -1183,14 +881,15 @@ class MultiGridLatex extends LatexSurveyElement
$jeOdgovor = 1;
if(!$izpisano){
foreach($this->textRArray AS $indeksTextRArray => $textR){
- if($this->textRArray[$indeksTextRArray][$datum]){
- $textR = $this->encodeText($textR[$datum]);
- $textR = $tableCentering.' '.$textR;
- //$textRIzpis .= '\fbox{\parbox{0.2\textwidth}{'.$textR.'}} '.$texSmallSkip.' '.$this->texNewLine; //zacetna varianta
- $textIzpis .= ' \vspace{0.5\baselineskip} ';
- $textIzpis .= '\fbox{\parbox{0.2\textwidth}{'.$textR.'}} '.$texSmallSkip.' '.$this->texNewLine;
- //$textRIzpis .= ' \hline \fbox{\parbox{0.2\textwidth}{'.$textR.'}} '.$texSmallSkip.' '.$this->texNewLine;
- $izpisano = 1;
+ if(array_key_exists($datum, $this->textRArray) && array_key_exists($indeksTextRArray, $this->textRArray)){
+ if(isset($this->textRArray[$indeksTextRArray][$datum])){
+ //$textR = Common::getInstance()->dataPiping($textR[$datum], $this->usr_id, $this->loop_id);
+ $textR = LatexDocument::encodeText($textR[$datum]);
+ $textR = $tableCentering.' '.$textR;
+ $textIzpis .= ' \vspace{0.5\baselineskip} ';
+ $textIzpis .= '\fbox{\parbox{0.2\textwidth}{'.$textR.'}} '.$texSmallSkip.' '.$this->texNewLine;
+ $izpisano = 1;
+ }
}
}
}else{
@@ -1227,9 +926,8 @@ class MultiGridLatex extends LatexSurveyElement
//izpis latex kode za okvir (brez obrobe oz. fbox) z odgovorom
//$tabela .= ' \indent \parbox{0.2\textwidth}{ '.$tableCentering.' '.$vodoravniOdgovori[$i].' } '.$texNewLine;
$tabela .= ' \parbox{0.2\textwidth}{ '.$tableCentering.' '.$vodoravniOdgovori[$i].' } '.$texNewLine;
- $tabela .= '\end{tabularx}'; //konec tabele, ki se je zacela pri izpisu skatle
+ $tabela .= '\end{xltabular}'; //konec tabele, ki se je zacela pri izpisu skatle
}
- //echo "TABELA TEX: ".$tabela."</br>";
}elseif($typeOfDocument == 'rtf'){
if($i != 0){ //ce ni prvi, dodaj prostor
$tabela .= ' '.$this->texBigSkip;
@@ -1244,7 +942,7 @@ class MultiGridLatex extends LatexSurveyElement
if(!$izpisano){
foreach($this->textRArray AS $indeksTextRArray => $textR){
if($this->textRArray[$indeksTextRArray][$datum]){
- $textR = $this->encodeText($textR[$datum]);
+ $textR = LatexDocument::encodeText($textR[$datum]);
$textR = $tableCentering.' '.$textR;
$textRIzpis .= '\fbox{\parbox{0.2\textwidth}{'.$textR.'}} '.$this->texNewLine;
$izpisano = 1;
@@ -1287,16 +985,98 @@ class MultiGridLatex extends LatexSurveyElement
}
#IZPIS ZA POVLECI SPUSTI - KONEC
-
- if($enota != 9){ //ce ni povleci spusti
+ if($enota != 9){ //ce ni povleci spusti
+ //ureditev stevila stolpcev (za parametre tabele in nadaljnji izris) glede na izbrano postavitev #################################################
+
+ if(($enota == 0||$enota == 3 || $enota == 11 || $enota == 12)||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali dvojna tabela ali je multitext ali multinumber ali VAS ali slikovni tip
+ if(($trak == 0 || $enota == 3 || ($trak == 1 && $spremenljivke['tip'] == 16))||($spremenljivke['tip']==19||$spremenljivke['tip']==20)){
+ $steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 1; //ker je prvi stolpec prazen, je potrebno dodati + 1
+ if(count($missingOdgovori)!=0){ //ce so missingi
+ $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular + 1;
+ }
+ }elseif($trak == 1 && $enota == 0 && $spremenljivke['tip'] == 6){
+ $steviloStolpcevParameterTabular = $steviloStolpcev + 1;
+ }
+ }elseif($enota == 1){ //diferencial
+ if($trak == 0){ //ce ni na traku
+ //$steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
+ if(count($missingOdgovori)!=0){ //ce so missingi
+ $steviloStolpcevParameterTabular = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
+ $steviloStolpcev = $steviloStolpcev + 2 - count($missingOdgovori);
+ }else{
+ $steviloStolpcevParameterTabular = $steviloStolpcev = $steviloStolpcev + 2; //ker sta prvi in zadnji stolpec prazna, je potrebno dodati + 2
+ }
+ }else{ //ce je na traku
+ $steviloStolpcevParameterTabular = $steviloStolpcev + 2;
+ $steviloStolpcev = $steviloStolpcev + 2 + count($missingOdgovori);
+ }
+ }elseif($enota == 2 || $enota == 6){ //roleta ali izberite s seznama
+ $steviloStolpcevParameterTabular = 2; //pri roleti sta potrebna le dva stolpca
+ if(count($missingOdgovori)!=0){ //ce so missingi
+ $steviloStolpcev = $spremenljivke['grids'] + count($missingOdgovori) + 1; //+1, ker se pri izrisu indeks zacne z 1
+ }
+ }elseif($enota == 4){ //ena moznost proti drugi
+ $steviloStolpcevParameterTabular = 5;
+ if(count($missingOdgovori)!=0){
+ $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
+ $steviloStolpcev = $steviloStolpcev-count($missingOdgovori);
+ }
+ }elseif($enota == 5){ //maxdiff
+ $steviloStolpcevParameterTabular = 3;
+ if(count($missingOdgovori)!=0){
+ $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
+ $steviloStolpcev = $steviloStolpcev-count($missingOdgovori);
+ }
+ }elseif($enota == 8){ //tabela da/ne
+ $steviloStolpcevParameterTabular = $steviloStolpcev = 3;
+ if(count($missingOdgovori)!=0){
+ $steviloStolpcevParameterTabular = $steviloStolpcevParameterTabular+count($missingOdgovori);
+ $steviloStolpcev = $steviloStolpcev+count($missingOdgovori);
+ }
+ }
+ //ureditev stevila stolpcev (za parametre tabele in nadaljnji izris) glede na izbrano postavitev - konec #################################################
+
+ //ureditev parametrov za tabelo #################################################################################################
+ $parameterTabular = '';
+ for($i = 0; $i < $steviloStolpcevParameterTabular; $i++){
+ //ce je prvi stolpec in ni "ena moznost proti drugi" ALI je zadnji stolpec (pred missing-i) in je "diferencial" ali "ena moznost proti drugi" z missing-i
+ if( ($i == 0 && $enota != 4) || ($i == $spremenljivke['grids']+1 && $enota == 1) || (($i == $spremenljivke['grids']+2 && $enota == 4)&&(count($missingOdgovori)!=0)) ) {
+ if($enota == 0 || $enota == 1 || $enota == 3 || $enota == 11 || $enota == 12){ //ce je "klasicna tabela" ali diferencial ali dvojna tabela ali VAS ali slikovni tip
+ if($enota == 1){ //ce je diferencial
+ if($i == 0){ //ce je prvi stolpec
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'A' : 'l'); //leva poravnava stolpca fiksne sirine
+ }elseif($i == $spremenljivke['grids']+1){ //ce je zadnji stolpec
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'R' : 'r'); //desna poravnava stolpca fiksne sirine
+ }
+ }else{
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'A' : 'l'); //leva poravnava stolpca fiksne sirine
+ }
+ }else{
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'X' : 'l'); //leva poravnava stolpca prilagojena sirini
+ }
+ }elseif($i == $spremenljivke['grids']+2 && $enota == 4){ //ce je zadnji stolpec in je "ena moznost proti drugi" brez missing-ov
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'r' : 'r'); //desna poravnava
+ }
+ elseif($i == 0 && $enota == 4){ //ce je prvi stolpec in "ena moznost proti drugi"
+ //$parameterTabular .= ($typeOfDocument == 'pdf' ? 'r' : 'r'); //desna poravnava stolpca
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'l' : 'l'); //leva poravnava prvega stolpca
+ }elseif($i == (intval($steviloStolpcev/2)) && $enota == 3){ //ce smo na sredini stolpcev in je dvojna tabela
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'C|' : 'c|'); //sredinska poravnava stolpca
+ }elseif($i == ($steviloStolpcev) && $enota == 5){ //ce je zadnji stolpec in je maxdiff
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'R' : 'r'); //desna za pdf in sredinska poravnava stolpca za rtf
+ }else{
+ $parameterTabular .= ($typeOfDocument == 'pdf' ? 'C' : 'c'); //sredinska poravnava stolpca
+ }
+ }
+ //ureditev parametrov za tabelo - konec ##########################################################################################
#ZACETEK MAIN TABELE #########################################################################
- $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabular, 'tabularx', 'tabular', 1, 1);
+ $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabular, 'xltabular', 'tabular', 1, 1);
#nad prvo vrstico, ampak se vedno v tabeli - naslovi trakov, podnaslovi dvojne tabele ################################################
if( ($enota == 3) && ($podnaslov1 || $podnaslov2) ){ //ce je dvojna tabela in sta prisotna podnaslova
$tabela .= ' & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov1.'} & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov2.'} '.$texNewLine;
- //$tabela .= ' & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov1.'} & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov2.'} ';
+ //$tabela .= ' & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov1.'} & \multicolumn{'.intval($steviloStolpcev/2).'}{c}{'.$podnaslov2.'} ';
}elseif($trak == 1 && $spremenljivke['tip'] == 6 && ($enota == 0 || $enota == 1)){ //ce imamo obliko traku, uredi nadnaslove traka
if($spremenljivke['grids']%$trakNumOfTitles == 0){ //ce je stevilo stolpcev deljivo s trenutnim izbranim stevilom nadnaslovov
for($i=0; $i<$trakNumOfTitles; $i++){
@@ -1351,7 +1131,6 @@ class MultiGridLatex extends LatexSurveyElement
if($enota == 1){ //ce je diferencial tabela
$tabela .= ' & ';
}
- //echo $tabela;
//missingi
if(count($missingOdgovori)!=0 && ($enota==0||$enota==1)){ //ce so missingi in (je klasicna tabela ali diferencial)
@@ -1363,7 +1142,6 @@ class MultiGridLatex extends LatexSurveyElement
}
#nad prvo vrstico, ampak se vedno v tabeli - konec#######################################################
- //echo $steviloStolpcev."</br>";
//ureditev missing-ov za tabela da/ne, klasicna ali dvojna tabela #############################
if($enota==8){ //ce je tabela da/ne
@@ -1381,21 +1159,17 @@ class MultiGridLatex extends LatexSurveyElement
}
}
}
-/* for($m=0;$m<count($vodoravniOdgovori);$m++){
- echo $vodoravniOdgovori[$m].'</br>';
- } */
+
}
//ureditev missing-ov za tabela da/ne, klasicna ali dvojna tabela - konec #####################
+
#prva vrstica tabele ####################################################################################
$tabela .= $this->LatexPrvaVrsticaMultiGrid($steviloStolpcev, $enota, $trak, $customColumnLabelOption, $spremenljivke, $vodoravniOdgovori, $missingOdgovori);
#prva vrstica tabele - konec ##################################################################################
-
- if($enota!=2 && $enota!=6){ //ce ni roleta in izberite s seznama in ena moznost proti drugi
+ if(($enota!=2 && $enota!=6)||($enota==2&&$spremenljivke['tip']==19)){ //ce ni roleta in izberite s seznama in ena moznost proti drugi
$tabela .= $texNewLine; //skok v drugo vrstico, kjer se zacnejo navpicni odgovori
}
-
- //echo "koda za tabelo: ".$tabela."</br>";
//preureditev stevila stolpcev za pravilen izris####################################
if($enota == 1){ //ce je diferencial tabela
@@ -1412,11 +1186,7 @@ class MultiGridLatex extends LatexSurveyElement
if(($enota == 0) && count($missingOdgovori)!=0){ //ce je klasicna tabela in so missingi
//$steviloStolpcev = $steviloStolpcev + count($missingOdgovori);
- }
-
- //echo $steviloStolpcev.'</br>';
- //echo $spremenljivke['grids'].'</br>';
-
+ }
//preureditev stevila stolpcev za pravilen izris - konec ############################
//ureditev missing-ov za roleta in izberite iz seznama ##############################
@@ -1426,23 +1196,18 @@ class MultiGridLatex extends LatexSurveyElement
}
}
//ureditev missing-ov za roleta in izberite iz seznama - konec ######################
-
- #izris vrstic tabele
- $trakStartingNumberTmp = null;
- //$tabela .= $this->LatexVrsticeMultigrid($steviloVrstic, $typeOfDocument, $enota, $simbolTex, $navpicniOdgovori, $trakStartingNumberTmp, $fillablePdf, $steviloStolpcev, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, $navpicniOdgovori2, $missingOdgovori, 0, 0, 0, $data, $export_subtype);
- $tabela .= $this->LatexVrsticeMultigrid($steviloVrstic, $typeOfDocument, $enota, $simbolTex, $navpicniOdgovori, $trakStartingNumberTmp, $fillablePdf, $steviloStolpcev, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, $navpicniOdgovori2, $missingOdgovori, 0, 0, 0, $data, $export_subtype, $this->preveriSpremenljivko, $this->userDataPresent);
+ #izris vrstic tabele
+ $tabela .= $this->LatexVrsticeMultigrid($steviloVrstic, $typeOfDocument, $enota, $simbolTex, $navpicniOdgovori, $trakStartingNumber, $fillablePdf, $steviloStolpcev, $spremenljivke, $trak, $vodoravniOdgovori, $texNewLine, $navpicniOdgovori2, $missingOdgovori, 0, 0, 0, $data, $export_subtype, $this->preveriSpremenljivko, $this->userDataPresent, null, $this->exportDataType, null, null, $this->skipEmpty, $this->skipEmptySub);
#izris vrstic tabele - konec
-/* if($enota==12||$enota==11){
- echo "tabela tex: ".$tabela."</br>";
- } */
- $tabela .= $this->EndLatexTable($typeOfDocument, 'tabularx', 'tabular'); //zakljucek tabele
+ $tabela .= $this->EndLatexTable($typeOfDocument, 'xltabular', 'tabular'); //zakljucek tabele
//$tabela .= $texNewLineAfterTable;
#KONEC MAIN TABELE #########################################################################
}
//prostor po izpisu tabele
- $tabela .= $this->texBigSkip;
- $tabela .= $this->texBigSkip;
+ //$tabela .= $this->texBigSkip;
+ //$tabela .= $this->texBigSkip;
+ $tabela .= '\vspace{1 cm}';
//izpis tabela - konec
@@ -1552,10 +1317,9 @@ class MultiGridLatex extends LatexSurveyElement
}
}
//ureditev parametrov za tabelo - konec
- //echo "parameterTabularLabelePrvaPod: ".$parameterTabularLabelePrvaPod."</br>";
//zacetek tabele
- $tex .= ($export_format == 'pdf' ? '{ \begin{tabularx}{1\textwidth}{'.$parameterTabularLabelePrvaPod.'}' : '\begin{tabular}{'.$parameterTabularLabelePrvaPod.'}');
+ $tex .= ($export_format == 'pdf' ? '{ \begin{xltabular}{1\textwidth}{'.$parameterTabularLabelePrvaPod.'}' : '\begin{tabular}{'.$parameterTabularLabelePrvaPod.'}');
//prva vrstica, ce so opisne labele
#IZRIS OPISNIH LABEL NAD DRSNIKOM #################################################
@@ -1571,13 +1335,13 @@ class MultiGridLatex extends LatexSurveyElement
$tex .= ' & ';
//labela na levi strani
- $tex .= $this->encodeText($MinLabel);
+ $tex .= LatexDocument::encodeText($MinLabel, 0, 1);
//vmesni prazni stolpci
$steviloPraznihStolpcev = $steviloStolpcevPrvaVrstica - 2 + 1;
for($p=0; $p<$steviloPraznihStolpcev; $p++){
if($p==$steviloPraznihStolpcev-2){ //ce je pred-zadnji stolpec
- $tex .= '\multicolumn{2}{c}{'.$this->encodeText($MaxLabel).'}'; //labela na desni v zadnji dveh desnih stolpcih
+ $tex .= '\multicolumn{2}{c}{'.LatexDocument::encodeText($MaxLabel, 0, 1).'}'; //labela na desni v zadnji dveh desnih stolpcih
}elseif($p==$steviloPraznihStolpcev-1){ //ce je zadnji stolpec
}else{ //drugace
@@ -1587,7 +1351,6 @@ class MultiGridLatex extends LatexSurveyElement
}
//labela na desni strani
- //$tex .= $this->encodeText($MaxLabel);
//v novo vrstico po izrisu opisnih label
$tex .= $this->texNewLine;
@@ -1607,7 +1370,6 @@ class MultiGridLatex extends LatexSurveyElement
#IZRIS MOZNIH ODGOVOROV - KONEC
$tex .= ' & ';
- //echo $userAnswer[$key]."</br>";
if($export_format == 'pdf'){ //ce je pdf, pokazi drsnike tudi graficno
#IZRIS DRSNIKA {dolzina}{pozicija bunkice}####################################
$steviloStolpcevZaSlider = $steviloStolpcevPrvaVrstica - 1;
@@ -1694,8 +1456,7 @@ class MultiGridLatex extends LatexSurveyElement
}
//konec tabele
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx} }" : "\\end{tabular} \\noindent");
- //echo $tex;
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular} }" : "\\end{tabular} \\noindent");
################# izpis s samo eno tabelo, saj zaradi ltablex, to ni vec mozno - konec
#Konec tabele za izris odgovora in drsnika - konec #################################################################################
@@ -1758,9 +1519,9 @@ class MultiGridLatex extends LatexSurveyElement
#############################################################################################################
//se ena tabela, da naredimo dovolj prostora na koncu vprasanja
- $tex .= ($export_format == 'pdf' ? '\begin{tabularx}{0.9\textwidth}{X}' : '');
+ $tex .= ($export_format == 'pdf' ? '\begin{xltabular}{0.9\textwidth}{X}' : '');
$tex .= $this->texNewLine;
- $tex .= ($export_format == 'pdf' ? '\end{tabularx}' : '');
+ $tex .= ($export_format == 'pdf' ? '\end{xltabular}' : '');
return $tex;
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php b/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php
index 23ffe0e..be21419 100644
--- a/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/NagovorLatex.php
@@ -9,12 +9,14 @@
* Datum: 09/2017
*****************************************/
- define("NAGOVOR_LINE_WIDTH", 0.5);
+ if (!defined("NAGOVOR_LINE_WIDTH")) define("NAGOVOR_LINE_WIDTH", 0.5);
class NagovorLatex extends LatexSurveyElement
{
var $internalCellHeight;
protected $texBigSkip = '\bigskip';
+ protected $db_table = '';
+ protected $usr_id = null;
public function __construct()
{
@@ -42,12 +44,8 @@ class NagovorLatex extends LatexSurveyElement
$this->loop_id = $loop_id;
//preveri, ce je kaj v bazi
- //$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id);
- $userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id, $this->loop_id);
- //echo "userDataPresent za spremenljivko".$spremenljivke['id']." je: ".$userDataPresent."</br>";
-
- //if($userDataPresent||$export_subtype=='q_empty'){ //ce je kaj v bazi ali je prazen vprasalnik
- if($userDataPresent||$export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){ //ce je kaj v bazi ali je prazen vprasalnik ali je potrebno pokazati tudi ne odgovorjena vprasanja
+ $tex = '';
+ if($export_subtype=='q_empty'||$export_subtype=='q_comment'||$preveriSpremenljivko){ //ce je kaj v bazi ali je prazen vprasalnik ali je potrebno pokazati tudi ne odgovorjena vprasanja
global $lang;
$spremenljivkaParams = new enkaParameters($spremenljivke['params']);
@@ -66,7 +64,6 @@ class NagovorLatex extends LatexSurveyElement
}else{ //ce je rtf
}
-
return $tex;
}
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php b/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
index 51b5ddb..df4228f 100644
--- a/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/RadioCheckboxSelectLatex.php
@@ -11,8 +11,8 @@
//namespace Export\Latexclasses\Vprasanja;
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
class RadioCheckboxSelectLatex extends LatexSurveyElement
{
@@ -40,6 +40,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $preveriSpremenljivko=null, $export_data_type=null, $export_subtype=null, $loop_id=null, $language=null){
+ //$time_start = microtime(true);
global $lang, $site_path;
$this->language = $language;
@@ -47,7 +48,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
//preverjanje, ali je prevod
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
$this->prevod = 1;
}else{
$this->prevod = 0;
@@ -73,6 +74,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$indeksOdgovorov = 0;
$oznakaVprasanja = $this->UrediOznakoVprasanja($spremenljivke['id']); //uredi oznako vprasanja, ker ne sme biti stevilska
$prviOdgovorSlikovniTip = 0;
+ $vizualnaSkalaNumber = null;
if ($usr_id){
$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id, $this->loop_id); //zgenerira podatke z odgovori respondenta v $this->userAnswer, zabelezi, ce so podatki prisotni
@@ -91,24 +93,24 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#ce je respondent odgovarjal v drugem jeziku ########################
$rowl = $this->srv_language_vrednost($rowVrednost['id']);
- if (strip_tags($rowl['naslov']) != '') $rowVrednost['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['naslov2']) != '') $rowVrednost['naslov2'] = $rowl['naslov2'];
+ if ($rowl!=null && strip_tags($rowl['naslov']) != '') $rowVrednost['naslov'] = $rowl['naslov'];
+ if ($rowl!=null && strip_tags($rowl['naslov2']) != '') $rowVrednost['naslov2'] = $rowl['naslov2'];
#ce je respondent odgovarjal v drugem jeziku - konec ################
- $stringTitle = ( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] );
- $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
- $stringTitle = '\\textcolor{crta}{'.$this->encodeText($stringTitle).'}';
-
- //echo $stringTitle."za indeks: ".$indeksZaWhile."</br>";
- //stetje stevila vrstic
- //$stetje_vrstic = $this->pdf->getNumLines($stringTitle, 180*$expand_width);
- // še dodamo textbox če je polj other
+ $stringTitle = ( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] );
+ if($usr_id){
+ $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
+ }
+ $stringTitle = '\\textcolor{crta}{'.LatexDocument::encodeText($stringTitle, 0, 0, $indeksZaWhile).'}'; //encodeText($text='', $vre_id=0, $no_br = 0, $img_id=0, $variable_name = '')
+
+ // še dodamo textbox če je polje other
$_txt = '';
if ( $rowVrednost['other'] == 1 && $usr_id ){
//$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id='".$this->getUserId()."' AND loop_id $loop_id");
- $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id);
- $row4 = mysqli_fetch_assoc($sqlOtherText);
- $_txt = ' \\textcolor{crta}{'.$row4['text'].'}';
+ $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $_txt = ' \\textcolor{crta}{'.LatexDocument::encodeText($row4['text']).'}';
}
//$tex .= ' '.$stringTitle.$_txt.',';
if($indeksZaWhile==1){
@@ -150,7 +152,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#za ureditev preloma odgovorov, ce so odgovori ob vprasanju - najprej je potrebno zabeleziti dolzino besedila vprasanja
if($spremenljivke['orientation']==0 && $export_format == 'pdf'){ //vodoravno ob vprasanju, ce je pdf
- $tex .= '\settowidth{\questionLength}{'.$this->encodeText($questionText).'}'; //v definirano dolzino shranimo trenutno dolzino teksta vprasanja
+ $tex .= '\settowidth{\questionLength}{'.LatexDocument::encodeText($questionText).'}'; //v definirano dolzino shranimo trenutno dolzino teksta vprasanja
$tex .= '\addtolength{\questionTotalLength}{\questionLength}'; //celotni dolzini dodamo dolzino vprasanja
//ce je opomba prisotna, daj spremenljivko na 2
@@ -163,40 +165,35 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
#za ureditev preloma odgovorov, ce so odgovori ob vprasanju - konec
if($spremenljivke['orientation']==7){ //navpicno - tekst levo
- //$tex .= '\begin{tabular}{l l}'.$texNewLine;
if($export_format == 'pdf'){
- $tex .= '\begin{tabularx}{.5\textwidth}{l l}';
+ $tex .= '\begin{xltabular}{.5\textwidth}{l l}';
}else{
$tex .= '\begin{tabular}{l l}'.$texNewLine; //za omogociti izris odgovorov v tabeli
}
}elseif($spremenljivke['orientation']==8){ //ce je "povleci-spusti"
- $tex .= '\setlength{\parindent}{0.1\textwidth} ';
+ $tex .= '\setlength{\parindent}{0.04\textwidth} ';
//prva vrstica pred tabelo z odgovori
if($export_format == 'pdf'){ //ce je pdf
$tex .= '\begin{tabular}{l c l} '; //izris z vecstolpicno tabelo
- //$tex .= '\begin{tabularx}{.5\textwidth}{l c l} '; //izris z vecstolpicno tabelo
$tex .= $lang['srv_ranking_available_categories'].': & \hspace{0.1\textwidth} & '.$lang['srv_drag_drop_answers'].': '.$texNewLine;
- $tex .= '\rule{0.4\textwidth}{0.4 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{tabular} '.$texBigSkip;
+ $tex .= '\rule{0.4\textwidth}{0.4 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{tabular} ';
$tex .= $texNewLine;
}else{ //ce je rtf
$tex .= '\begin{tabular}{l} '; //izris z enostolpicno tabelo
$tex .= $lang['srv_ranking_available_categories'].': '.$texNewLine; //Rapolozljive kategorije
- //$tex .= '\hline \end{tabular} '.$texBigSkip;
$tex .= '\hline \end{tabular} ';
}
//prva vrstica pred tabelo z odgovori - konec
if($export_format == 'pdf'){ //ce je pdf
//$tex .= '\begin{tabular}{c c c} '; //izris s tabelo
- $tex .= '\begin{tabularx}{.5\textwidth}{c c c} '; //izris s tabelo
+ $tex .= '\begin{xltabular}{.5\textwidth}{c c c} '; //izris s tabelo
}
}elseif($spremenljivke['orientation']==10){ //image hot-spot
- $imageName = $this->getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
$imageNameTest = $this->path2ImagesRadio.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
- //error_log("za image hot spot ne grid: ".$imageNameTest);
- //echo("za image hot spot ne grid: ".$imageNameTest."</br>");
if(filesize($imageNameTest) > 0){
$image = PIC_SIZE."{".$this->path2ImagesRadio."".$imageName."}"; //priprave slike predefinirane dimenzije
}else{
@@ -220,14 +217,15 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$tex .= $texNewLine.$lang['srv_export_hotspot_chosen_regions_names'].': '.$texNewLine; //besedilo "Izbrana obmocja na sliki"
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
if( isset($this->userAnswer[$rowVrednost['id']]) ){ //ce je podatek prisoten
- $stringTitle = ($this->encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
- // še dodamo textbox če je polj other
+ $stringTitle = (LatexDocument::encodeText(( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ), 0, 0, 0, '', 1 ));
+ // še dodamo textbox če je polje other
$_txt = '';
if ( $rowVrednost['other'] == 1 && $usr_id ){
//$sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$this->db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id='".$this->getUserId()."' AND loop_id $loop_id");
- $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id);
+ $sqlOtherText = sisplet_query("SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
$row4 = mysqli_fetch_assoc($sqlOtherText);
- $_txt = ' '.$row4['text'];
+ $_txt = ' '.LatexDocument::encodeText($row4['text']);
}
$tex .= $stringTitle.$_txt.$texNewLine;
}
@@ -236,30 +234,26 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}elseif($spremenljivke['orientation']==9 || $spremenljivke['orientation']==11){ //ce je "slikovni tip" ali VAS
if($spremenljivke['orientation']==11){ //ce je VAS
$spremenljivkaParams = new enkaParameters($spremenljivke['params']);
- $vizualnaSkalaNumber = $spremenljivkaParams->get('vizualnaSkalaNumber');
+ $vizualnaSkalaNumber = ($spremenljivkaParams->get('vizualnaSkalaNumber') ? $spremenljivkaParams->get('vizualnaSkalaNumber') : '5');
$numRowsSql = $vizualnaSkalaNumber;
}
- //echo "stevilo zadev: ".$numRowsSql."</br>";
if($spremenljivke['orientation']==9){
$mejaVAS = 20;
}elseif($spremenljivke['orientation']==11){
$mejaVAS = 8;
$numRowsSql = mysqli_num_rows($sqlVrednosti);
}
- //if($numRowsSql<20){ //ce je manj kot x slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
if($numRowsSql<$mejaVAS){ //ce je manj kot x slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
$tableParamsSlikovniTip = '';
for($i=0; $i<$numRowsSql;$i++){
$tableParamsSlikovniTip .= ' c ';
}
- $tex .= '\begin{tabular}{'.$tableParamsSlikovniTip.'} '; //izris s tabelo
+ $tex .= '\\\\ \begin{tabular}{'.$tableParamsSlikovniTip.'} '; //izris s tabelo
}
- //echo "parametri tabele: ".$tableParamsSlikovniTip."</br>";
}
if($spremenljivke['orientation']!=10){ //ce ni image hot-spot
-
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$prop['full'] = ( isset($userAnswer[$rowVrednost['id']]) );
@@ -267,57 +261,132 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
if($this->prevod){ //ce je prevod ankete
$rowl = $this->srv_language_vrednost($rowVrednost['id']); //pridobi prevod naslova v ustreznem jeziku
$stringTitle = ((( $rowl['naslov'] ) ? $rowl['naslov'] : ( ( $rowl['naslov2'] ) ? $rowl['naslov2'] : $rowl['variable'] ) )); //prevod naslova v ustreznem jeziku
+ if($stringTitle == ''){ //ce ni prevoda, prevzemi izvirno
+ $stringTitle = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
+ }
}else{
$stringTitle = ((( $rowVrednost['naslov'] ) ? $rowVrednost['naslov'] : ( ( $rowVrednost['naslov2'] ) ? $rowVrednost['naslov2'] : $rowVrednost['variable'] ) ));
}
- $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
-
- //echo "naslov: $stringTitle</br>";
- //echo "jezik: ".$this->language."</br>";
- if ( $spremenljivke['tip'] == 1 || $spremenljivke['tip'] == 3 ){
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $this->userAnswer[$rowVrednost['id']], $spremenljivke['orientation'], $indeksZaWhile, $vizualnaSkalaNumber);
- //$tex .= '{\ChoiceMenu[radio,radiosymbol=\ding{108},name=myGroupOfRadiobuttons]{}{='.$stringTitle.'}}'.$stringTitle.' '.$this->texNewLine;
- $internalCellHeight = '0.3 cm'; //visina praznega okvirja @povleci-spusti
- }else if ( $spremenljivke['tip'] == 2 ){
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $this->userAnswer[$rowVrednost['id']]);
- $internalCellHeight = '3 cm'; //visina praznega okvirja @povleci-spusti
+ if($usr_id){
+ $stringTitle = Common::getInstance()->dataPiping($stringTitle, $usr_id, $loop_id);
+ }
+
+ $userAnswerTmp = isset($this->userAnswer[$rowVrednost['id']])?$this->userAnswer[$rowVrednost['id']]:null;
+
+ if ( $spremenljivke['tip'] == 1 || $spremenljivke['tip'] == 3 ){
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $userAnswerTmp, $spremenljivke['orientation'], $indeksZaWhile, $vizualnaSkalaNumber);
+ $internalCellHeight = 1; //visina praznega okvirja @povleci-spusti
+
+ }else if ( $spremenljivke['tip'] == 2 ){
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $spremenljivke['grids'], 0, $userAnswerTmp);
+ $internalCellHeight = 3; //visina praznega okvirja @povleci-spusti
}
- if($spremenljivke['orientation']==1&&$spremenljivke['tip'] != 3){ //navpicno
- $tex .= $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- //$test = $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- //echo "tukaj! $test </br>";
- }elseif($spremenljivke['orientation']==7){ //navpicno - tekst levo
- $text = $this->encodeText($stringTitle, $rowVrednost['id']).' & '.$symbol.' '.$texNewLine;
+ if($spremenljivke['orientation'] == 1 && $spremenljivke['tip'] != 3){ //navpicno
+ $tex .= $symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ $tex .= $texNewLine;
+ }elseif($spremenljivke['orientation'] == 7){ //navpicno - tekst levo
+
+ $text = LatexDocument::encodeText($stringTitle,$rowVrednost['id'], 0, 0, '', 1).' & '.$symbol.' '.$texNewLine;
$textLength = strlen($text);
if($textLength > MAX_STRING_LENGTH){
$tex .= '\vspace{2 mm}';
- $tex .= '\parbox{'.LINE_BREAK_AT.'}{'.$this->encodeText($stringTitle, $rowVrednost['id']).'} & '.$symbol.' '.$texNewLine; //tekst odgovora razbij pri LINE_BREAK_AT (5 cm) in zraven dodaj ustrezni simbol
+ $tex .= '\parbox{'.LINE_BREAK_AT.'}{'.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).'} & '.$symbol.' '.$texNewLine; //tekst odgovora razbij pri LINE_BREAK_AT (5 cm) in zraven dodaj ustrezni simbol
}else{
- $tex .= $text;
- }
+ $tex .= LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' & ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ $tex .= $symbol.' '.$texNewLine;
+ }
}elseif($spremenljivke['orientation']==0){ //vodoravno ob vprasanju
- $tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
+ $tex .= ' '.$symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
}elseif($spremenljivke['orientation']==2){ //vodoravno pod vprasanjem
- $tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
- }elseif(($spremenljivke['tip'] == 3&&$spremenljivke['orientation']==1)||$spremenljivke['orientation']==6){ //roleta ali izberite s seznama
- if($export_data_type==1&&isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
- $tex .= ' \textbf{'.$this->encodeText($stringTitle, $rowVrednost['id']).'} '.$texNewLine;
+ $tex .= ' '.$symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ }
+ }elseif(($spremenljivke['tip'] == 3 && $spremenljivke['orientation'] == 1) || $spremenljivke['orientation'] == 6){ //roleta ali izberite s seznama
+ if($export_data_type == 1 && isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
+ $tex .= ' \textbf{'.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' }';
}else{
- $tex .= $this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
- }
+ $tex .= LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' ';
+ }
+ if($rowVrednost['other'] == 1){ //ce je odgovor Drugo:, izpisi se tabelo za drugo
+ $tex .= '\begin{tabular}{c} '; //izris s tabelo brez obrob
+ if(isset($this->userAnswer[$rowVrednost['id']])){
+ $sqlOtheText1 = "SELECT * FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND vre_id='".$rowVrednost['id']."' AND usr_id=".$usr_id .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : "");
+ $sqlOtherText = sisplet_query($sqlOtheText1);
+ $row4 = mysqli_fetch_assoc($sqlOtherText);
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ '.LatexDocument::encodeText($row4['text']).' }} ';
+ }else{
+ $tex .= '\fbox{\parbox{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}} }} ';
+ }
+ $tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
+ if($export_data_type==1&&isset($this->userAnswer[$rowVrednost['id']])){ //ce je dolg izvoz in je podatek za odgovor
+ $tex .= '}';
+ }
+
+ }
+ $tex .= $texNewLine;
}elseif($spremenljivke['orientation']==8){ //povleci-spusti
-
if(isset($this->userAnswer[$rowVrednost['id']])){
- $textR = $this->encodeText($stringTitle, $rowVrednost['id']);
+ $textR = LatexDocument::encodeText($stringTitle, $rowVrednost['id']);
$textRArray[$indeksZaWhile] = $textR; //rabimo kasneje, za izpis rtf desne strani vprasanja, ce izpisujemo odgovore respondenta
$textL = '';
}else{
- $textL = $this->encodeText($stringTitle, $rowVrednost['id']);
+ $textL = LatexDocument::encodeText($stringTitle, $rowVrednost['id']);
$textR = '';
}
-
+
if($export_format == 'pdf'){ //ce je pdf
if($textL){
@@ -327,7 +396,8 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
}
if($indeksZaWhile == 1&&($export_subtype=='q_empty')){
- $tex .= '& \hspace{1.2 cm} \multirow{'.$numRowsSql.'}{*}{\fbox{\parbox[t]['.$internalCellHeight.']{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}}} } } '; //v prvi vrstici izrisi prazen okvir, ki se razpotegne skozi vse vrstice
+ $visinaOkvirja = $internalCellHeight; //$visinaOkvirja = $internalCellHeight*$numRowsSql;
+ $tex .= '& \hspace{1.2 cm} \multirow{'.$numRowsSql.'}{*}{\fbox{\parbox[t]['.$visinaOkvirja.' cm]{0.2\textwidth}{ \hphantom{\hspace{0.2\textwidth}}} } } '; //v prvi vrstici izrisi prazen okvir, ki se razpotegne skozi vse vrstice
}elseif($export_subtype=='q_empty'){
$tex .= '& '; //izrisi potrebno praznino za multirow okvir iz prve vrstice
}else{
@@ -373,22 +443,21 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$prviOdgovorSlikovniTip = 1;
}
- }elseif($spremenljivke['orientation']==11){ //ce je VAS
- //$tex .= ' '.$symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' ';
+ }elseif($spremenljivke['orientation'] == 11){ //ce je VAS
if($indeksZaWhile == 1){
- if($numRowsSql<=7){ //ce je manj kot 7 slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
- $tex .= ' '.$symbol;
+ if($numRowsSql<=7){ //ce je manj kot 7 VAS, izpisemo s tabelo, drugace simbol in zraven število
+ $tex .= ' '.$symbol[$indeksZaWhile-1];
}
}else{
- if($numRowsSql<=7){ //ce je manj kot 7 slikovnih tipov, izpisemo s tabelo, drugace simbol in zraven število
- $tex .= ' & '.$symbol;
+ if($numRowsSql<=7){ //ce je manj kot 7 VAS, izpisemo s tabelo, drugace simbol in zraven število
+ $tex .= ' & '.$symbol[$indeksZaWhile-1];
}
}
if($numRowsSql>7){
$tex .= ' ('.$indeksZaWhile.') ';
}
}else{ //ce ni urejenega izrisa naj bo default oz. navpicno
- $tex .= $symbol.' '.$this->encodeText($stringTitle, $rowVrednost['id']).' '.$texNewLine;
+ $tex .= $symbol.' '.LatexDocument::encodeText($stringTitle, $rowVrednost['id'], 0, 0, '', 1).' '.$texNewLine;
}
$oznakaOdgovora++;
@@ -407,7 +476,7 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
$tex .= ' & ('.$i.')';
}
}
- $tex .= ' \end{tabular}'; //zakljuci izris odgovorov v tabeli za "slikovni tip"
+ $tex .= ' \end{tabular}'.$texBigSkip; //zakljuci izris odgovorov v tabeli za "slikovni tip"
}
//$tex .= $texNewLine;
$tex .= $texNewLine;
@@ -415,10 +484,10 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
if($export_format == 'pdf'|| $spremenljivke['orientation']==7){ //ce je pdf
//if($spremenljivke['orientation']==7 && $export_format == 'pdf'){
if($export_format == 'pdf'){
- $tex .= '\end{tabularx}'; //za zakljuciti izrisa odgovorov v tabeli//tabularx
+ $tex .= '\end{xltabular}'; //za zakljuciti izrisa odgovorov v tabeli//tabularx
$tex .= $this->texBigSkip;
$tex .= $this->texBigSkip;
- $tex .= ' \noindent ';
+ //$tex .= ' \noindent ';
}else{
$tex .= ' \end{tabular}'; //za zakljuciti izris odgovorov v tabeli
$tex .= $texNewLine;
@@ -483,6 +552,10 @@ class RadioCheckboxSelectLatex extends LatexSurveyElement
//$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
}
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time radio:</b> '.floatval($execution_time).' sec</br>'; */
+
return $tex;
}
} \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php b/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php
index c93ceb0..96c1557 100644
--- a/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/RazvrscanjeLatex.php
@@ -10,9 +10,9 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
class RazvrscanjeLatex extends LatexSurveyElement
{
@@ -27,6 +27,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
private static $_instance;
protected $texBigSkip = ' \bigskip ';
protected $loop_id = null; // id trenutnega loopa ce jih imamo
+ protected $path2ImagesRadio = null;
public static function getInstance()
{
@@ -38,8 +39,11 @@ class RazvrscanjeLatex extends LatexSurveyElement
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype='', $preveriSpremenljivko=null, $export_data_type=null, $loop_id=null){
+ //$time_start = microtime(true);
+ global $lang, $site_path;
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
+ $this->path2ImagesRadio = $site_path.'uploadi/editor/';
//preveri, ce je kaj v bazi
//$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id);
@@ -80,7 +84,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
if($userDataPresent){ //ce so prisotni podatki respondenta
//preverjanje podatkov trenutnega uporabnika ######################################################
//$sqlUserAnswer = sisplet_query("SELECT vrstni_red FROM srv_data_rating WHERE spr_id=".$spremenljivke['id']." AND usr_id='".$this->getUserId()."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
- $sqlUserAnswer = sisplet_query("SELECT vrstni_red FROM srv_data_rating WHERE spr_id=".$spremenljivke['id']." AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ");
+ $sqlUserAnswer = sisplet_query("SELECT vrstni_red FROM srv_data_rating WHERE spr_id=".$spremenljivke['id']." AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ".($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
@@ -95,7 +99,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
}
if($jeOdgovor==0||$tipRazvrscanja==1){ //ce ni odgovor respondenta, bo naslov na levi strani; ali je Ostevilcevanje
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow, $rowVrednost['id']) ); //filanje polja z navpicnimi odgovori (po vrsticah)
+ array_push($navpicniOdgovori, LatexDocument::encodeText($stringTitleRow, $rowVrednost['id']) ); //filanje polja z navpicnimi odgovori (po vrsticah)
}
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - konec
@@ -103,18 +107,18 @@ class RazvrscanjeLatex extends LatexSurveyElement
if($userDataPresent&&$tipRazvrscanja!=1){ //ce so prisotni podatki respondenta in ni Ostevilcevanje
#ureditev polja s podatki trenutnega uporabnika ######################################################
//$sqlOdgovoriRespondentaString = "SELECT v.naslov, v.id from srv_vrednost v, srv_data_rating r WHERE r.spr_id=v.spr_id AND r.usr_id=".$usr_id." AND r.vre_id=v.id AND r.spr_id=".$spremenljivke['id']." ORDER BY r.vrstni_red";
- $sqlOdgovoriRespondentaString = "SELECT v.naslov, v.id from srv_vrednost v, srv_data_rating r WHERE r.spr_id=v.spr_id AND r.usr_id=".$usr_id." AND r.vre_id=v.id AND r.spr_id=".$spremenljivke['id']." AND hidden='0' ORDER BY r.vrstni_red";
+ $sqlOdgovoriRespondentaString = "SELECT v.naslov, v.id from srv_vrednost v, srv_data_rating r WHERE ".($loop_id !== null ? " r.loop_id='$loop_id' AND " : "")."r.spr_id=v.spr_id AND r.usr_id=".$usr_id." AND r.vre_id=v.id AND r.spr_id=".$spremenljivke['id']." AND hidden='0' ORDER BY r.vrstni_red";
//echo $sqlOdgovoriRespondentaString."</br>";
$sqlOdgovoriRespondenta = sisplet_query($sqlOdgovoriRespondentaString);
//pregled vseh odgovorov respondenta razvrsceni kot morajo biti
while ($rowOdgovoriRespondenta = mysqli_fetch_assoc($sqlOdgovoriRespondenta)){
- $odgovorRespondenta = $this->encodeText($rowOdgovoriRespondenta['naslov'], $rowOdgovoriRespondenta['id']);
+ $odgovorRespondenta = LatexDocument::encodeText($rowOdgovoriRespondenta['naslov'], $rowOdgovoriRespondenta['id']);
array_push($odgovoriRespondenta, $odgovorRespondenta); //filanje polja z odgovori respondenta
}
+
//pregled vseh odgovorov respondenta razvrsceni kot morajo biti
#ureditev polja s podatki trenutnega uporabnika - konec ##############################################
}
-
//izris tabel dolocenega razvrscanja
if($export_data_type==2){ //ce je kratek izpis izvoza
$tex .= $this->IzrisRazvrscanjaKratko($spremenljivke, $steviloDesnihOkvirjev, $numRowsSql, $navpicniOdgovori, $texNewLine, $texNewLineAfterTable, $export_format, 0, $tipRazvrscanja, $odgovoriRespondenta, $export_subtype);
@@ -123,6 +127,8 @@ class RazvrscanjeLatex extends LatexSurveyElement
$tex .= $this->IzrisRazvrscanjaTabele($spremenljivke, $steviloDesnihOkvirjev, $numRowsSql, $navpicniOdgovori, $texNewLine, $texNewLineAfterTable, $export_format, 0, $tipRazvrscanja, $odgovoriRespondenta, $export_subtype);
}elseif($tipRazvrscanja==1){ //ce je Ostevilcevanje
$tex .= $this->IzrisRazvrscanja($spremenljivke, $numRowsSql, $navpicniOdgovori, $odgovoriRespondenta, $texNewLine, $export_format, 0);
+ }elseif($tipRazvrscanja==3){ //ce je Image hotspot
+ $tex .= $this->IzrisRazvrscanjaImageHotSpot($spremenljivke, $export_data_type, $odgovoriRespondenta, $texNewLine);
}
}
//izris tabel dolocenega razvrscanja - konec
@@ -135,8 +141,11 @@ class RazvrscanjeLatex extends LatexSurveyElement
}else{
$tex .= $this->texBigSkip;
}
- }
-
+ }
+ //echo "latex koda: $tex";
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time razvrščanje:</b> '.$execution_time.' sec'; */
return $tex;
}
}
@@ -154,9 +163,9 @@ class RazvrscanjeLatex extends LatexSurveyElement
$tabela .= '\setlength{\parindent}{0.1\textwidth} ';
//prva vrstica pred tabelo z odgovori
if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= '\begin{tabularx}{\textwidth}{l c l} '; //izris s tabelo tabularx
+ $tabela .= '\begin{xltabular}{\textwidth}{l c l} '; //izris s tabelo xltabular
$tabela .= $lang['srv_ranking_available_categories'].': & \hspace{0.1\textwidth} & '.$lang['srv_ranking_ranked_categories1'].': '.$texNewLine;
- $tabela .= '\rule{0.4\textwidth}{0.7 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{tabularx} ';
+ $tabela .= '\rule{0.4\textwidth}{0.7 pt} & & \rule{0.4\textwidth}{0.4 pt} \end{xltabular} ';
}else{ //ce je rtf
$tabela .= '\begin{tabular}{l c l} '; //izris s tabelo
$tabela .= $lang['srv_ranking_available_categories'].': & & '.$lang['srv_ranking_ranked_categories1'].': '.$texNewLine;
@@ -180,7 +189,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
#################################################
//zacetek tabele
- $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'tabularx', 'tabular', 1, 0.2);
+ $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'xltabular', 'tabular', 1, 0.2);
//argumenti za leve okvirje
$textboxWidthL = 0.25;
@@ -201,17 +210,12 @@ class RazvrscanjeLatex extends LatexSurveyElement
$textboxHeightL = 0;
}
- //echo "textboxHeightL: ".$textboxHeightL."</br>";
-/* echo "odgovori respondenta: ".count($odgovoriRespondenta)."</br>";
- echo "navpični odgovori: ".count($navpicniOdgovori)."</br>";
- echo "stevilo Odgovorov: ".$steviloOdgovorov."</br>";
- echo "stevilo desnih okvirjev: ".$steviloDesnihOkvirjev."</br>"; */
//izris notranjosti tabele
for ($i = 1; $i <= $steviloOdgovorov; $i++){
-
- $textL = $tableCentering.' '.$navpicniOdgovori[$i-1]; //odgovor znotraj okvirja
-
+ if(array_key_exists($i-1, $navpicniOdgovori)){
+ $textL = $tableCentering.' '.$navpicniOdgovori[$i-1]; //odgovor znotraj okvirja
+ }
if($tipRazvrscanja==2){ //ce je postavitev Premikanje
$tabela .= $indeksZaStevilaL.'. '; //pred okvirjem s kategorijo odgovora dodaj stevilko s piko
@@ -222,7 +226,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
//izpis latex kode za okvir z odgovorom
if($tipRazvrscanja==0||($tipRazvrscanja==2&&count($odgovoriRespondenta)==0)){ //ce je Prestavljanje ali Premikanje in ni podatkov respondenta
- if($navpicniOdgovori[$i-1]!=''){ //ce so prisotni odgovori
+ if(array_key_exists($i-1, $navpicniOdgovori)&&($navpicniOdgovori[$i-1]!='')){ //ce so prisotni odgovori
$textVOkvirju = $textL;
}
}elseif($tipRazvrscanja==2&&count($odgovoriRespondenta)!=0){ //ce je postavitev Premikanje in imamo odgovore respondenta
@@ -232,7 +236,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
//echo "text V Okvirju: ".$textVOkvirju."</br>";
//izpis latex kode za okvir z odgovorom
- if($tipRazvrscanja==0&&$navpicniOdgovori[$i-1]!=''){
+ if($tipRazvrscanja==0&&(array_key_exists($i-1, $navpicniOdgovori)&&$navpicniOdgovori[$i-1]!='')){
if($typeOfDocument == 'pdf'){ //ce je pdf
$tabela .= $this->LatexTextBox($typeOfDocument, $textboxHeightL, $textboxWidthL, $textVOkvirju, $textboxAllignmentL, 0);
}else{
@@ -245,13 +249,6 @@ class RazvrscanjeLatex extends LatexSurveyElement
$tabela .= $textVOkvirju;
}
}
-/* if(($tipRazvrscanja==0&&$navpicniOdgovori[$i-1]!='')||($tipRazvrscanja==2||$tipRazvrscanja==1)){
- if($typeOfDocument == 'pdf'){ //ce je pdf
- $tabela .= $this->LatexTextBox($typeOfDocument, $textboxHeightL, $textboxWidthL, $textVOkvirju, $textboxAllignmentL, 0);
- }else{
- $tabela .= $textVOkvirju;
- }
- } */
if($typeOfDocument == 'pdf'){
$tabela .= ' \bigskip ';
@@ -271,7 +268,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
$textboxAllignmentDE = 'c'; //allignment desnega okvirja, ki je empty
if($indeksZaStevilaD <= $steviloDesnihOkvirjev){ //ce se ni preseglo zeleno stevilo desnih okvirjev
$tabela .= $indeksZaStevilaD.'. ';
- $odgovorZaIzpis = $odgovoriRespondenta[$i-1];
+ $odgovorZaIzpis = isset($odgovoriRespondenta[$i-1])?$odgovoriRespondenta[$i-1]:null;
if($typeOfDocument == 'pdf'){
//echo "odgovori respondenta na desni: ".$odgovoriRespondenta[$i-1]."</br>";
if($odgovorZaIzpis){ //ce je odgovor respondenta
@@ -307,7 +304,7 @@ class RazvrscanjeLatex extends LatexSurveyElement
}
//zakljucek tabele
- $tabela .= $this->EndLatexTable($typeOfDocument, 'tabularx', 'tabular');
+ $tabela .= $this->EndLatexTable($typeOfDocument, 'xltabular', 'tabular');
#################################################
if($tipRazvrscanja==2){ //ce je postavitev Premikanje
@@ -320,8 +317,6 @@ class RazvrscanjeLatex extends LatexSurveyElement
return $tabela;
}
#funkcija, ki skrbi za izris ustreznih tabel za razvrscanje (postavitev: Prestavljanje in Premikanje) - konec ################################
-
-
#funkcija, ki skrbi za izris ustreznih tabel za razvrscanje (postavitev: Prestavljanje in Premikanje) ################################
@@ -331,18 +326,22 @@ class RazvrscanjeLatex extends LatexSurveyElement
$textboxWidth = 0.1;
$textboxHeight = '0.2cm';
$textboxAllignment = 'c'; //dummy spremenljivka
+ $odgovorRespondenta = null;
if($typeOfDocument == 'rtf'){ //ce je rtf, zacetek tabele, kjer sta dva stolpca (prazen okvir + okvir z odgovorom)
//$tex .= '\begin{tabular}{l l} '; //izris z enostolpicno tabelo
$tex .= '\begin{tabular}{c l} '; //izris z enostolpicno tabelo
}
-
for ($i = 1; $i <= $steviloVrstic; $i++){
$tex .= ' \noindent '; //da ni premika besedila v desno
//izpis latex kode za prazen okvir oz. okvirjem z ustreznim stevilskim odgovorom
//$tex .= $this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, $odgovoriRespondenta[$i-1], $textboxAllignment, 0);
- $tex .= $this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, '\\textcolor{crta}{'.$odgovoriRespondenta[$i-1].'}', $textboxAllignment, 0);
+ if(array_key_exists($i-1, $odgovoriRespondenta)){
+ $odgovorRespondenta = $odgovoriRespondenta[$i-1];
+ }
+ //$tex .= $this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, '\\textcolor{crta}{'.$odgovoriRespondenta[$i-1].'}', $textboxAllignment, 0);
+ $tex .= $this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, '\\textcolor{crta}{'.$odgovorRespondenta.'}', $textboxAllignment, 0);
if($typeOfDocument == 'rtf'){ //ce je rtf
$tex .= ' & '; //meja med stolpcema tabele 1. prazen okvir (okvir s stevilskim odgovorom), 2. navpicni odgovor
@@ -369,18 +368,19 @@ class RazvrscanjeLatex extends LatexSurveyElement
$indeksZaStevila=1;
$steviloOdgovorov=count($navpicniOdgovori);
$steviloOdgovorov=count($odgovoriRespondenta);
-
$tex = '';
-
+
//izpis stevil in odgovorov
for ($i = 1; $i <= $steviloOdgovorov; $i++){
- if($tipRazvrscanja==0||$tipRazvrscanja==2){ //ce je Prestavljanje ali Premikanje
+ $navpicniOdgovor = null;
+ if(array_key_exists(($i-1), $navpicniOdgovori)){
+ $navpicniOdgovor = $navpicniOdgovori[$i-1];
+ }
+ if($tipRazvrscanja==0||$tipRazvrscanja==2||$tipRazvrscanja==3){ //ce je Prestavljanje ali Premikanje ali image hotspot
$tex .= $indeksZaStevila.'. '; //stevilka pred odgovorom
- //$tex .= $odgovoriRespondenta[$i-1]; //odgovor
$tex .= '\\textcolor{crta}{'.$odgovoriRespondenta[$i-1].'}'; //odgovor
- }elseif($tipRazvrscanja==1){ //ce je Ostevilcevanje
- $tex .= $navpicniOdgovori[$i-1].': ';
- //$tex .= $odgovoriRespondenta[$i-1]; //odgovor
+ }elseif($tipRazvrscanja==1){ //ce je Ostevilcevanje
+ $tex .=$navpicniOdgovor.': ';
$tex .= '\\textcolor{crta}{'.$odgovoriRespondenta[$i-1].'}'; //odgovor
}
$tex .= '; ';
@@ -393,5 +393,51 @@ class RazvrscanjeLatex extends LatexSurveyElement
return $tex;
}
#funkcija, ki skrbi za izris razvrscanje za kratek izpis izvoza - konec ################################
+
+ #funkcija, ki skrbi za izris razvrscanje za kratek izpis izvoza ################################
+ function IzrisRazvrscanjaImageHotSpot($spremenljivke=null, $export_data_type=null, $odgovoriRespondenta=null, $texNewLine=''){
+ global $lang;
+ $indeksZaStevila=1;
+
+ $steviloOdgovorov=count($odgovoriRespondenta);
+ $tex = '';
+ $imageName = LatexDocument::getImageName('hotspot', $spremenljivke['id'], 'hotspot_image=');
+ $imageNameTest = $this->path2ImagesRadio.$imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
+
+ //echo("za image hot spot ne grid: ".$imageNameTest."</br>");
+ if(filesize($imageNameTest) > 0){
+ $image = PIC_SIZE."{".$this->path2ImagesRadio."".$imageName."}"; //priprave slike predefinirane dimenzije
+ }else{
+ $image = $lang['srv_pc_unavailable'];
+ }
+
+ $tex .= $image."".$texNewLine; //izris slike
+
+ //iz baze poberi imena obmocij
+ $sqlHotSpotRegions = sisplet_query("SELECT region_name FROM srv_hotspot_regions WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
+
+ //izris imen obmocij po $sqlHotSpotRegions
+ $tex .= $lang['srv_export_hotspot_regions_names'].': '.$texNewLine; //besedilo "Obmocja na sliki"
+ while ($rowHotSpotRegions = mysqli_fetch_assoc($sqlHotSpotRegions))
+ {
+ $tex .= $rowHotSpotRegions['region_name'].''.$texNewLine;
+ }
+
+ if(count($odgovoriRespondenta)){
+ $tex .= $lang['srv_ranking_ranked_categories1'].": ".$texNewLine;
+ //izpis odgovorov
+ for ($i = 1; $i <= $steviloOdgovorov; $i++){
+ $tex .= '\\textcolor{crta}{'.$odgovoriRespondenta[$i-1].'}'; //odgovor
+ $tex .= ' \\\\ ';
+ $indeksZaStevila++;
+ }
+ }
+
+ $tex .= ' \\\\ ';
+ $tex .= ' \\\\ ';
+
+ return $tex;
+ }
+ #funkcija, ki skrbi za izris razvrscanje za kratek izpis izvoza - konec ################################
} \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/Vprasanja/SNImena.php b/admin/survey/export/latexclasses/Vprasanja/SNImena.php
index e7d7ef1..bf7ae8c 100644
--- a/admin/survey/export/latexclasses/Vprasanja/SNImena.php
+++ b/admin/survey/export/latexclasses/Vprasanja/SNImena.php
@@ -9,7 +9,7 @@
* Datum: 05/2018
*****************************************/
- define("NAGOVOR_LINE_WIDTH", 0.5);
+ if (!defined("NAGOVOR_LINE_WIDTH")) define("NAGOVOR_LINE_WIDTH", 0.5);
class SNImenaLatex extends LatexSurveyElement
{
@@ -60,7 +60,7 @@ class SNImenaLatex extends LatexSurveyElement
$sqlUserAnswerString = "SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND loop_id $loop_id ";
$sqlUserAnswer = sisplet_query($sqlUserAnswerString);
while($userAnswer = mysqli_fetch_array($sqlUserAnswer)){
- array_push($textVOkvirju, $this->encodeText($userAnswer['text']));
+ array_push($textVOkvirju, LatexDocument::encodeText($userAnswer['text']));
}
$steviloOkvirjev=count($textVOkvirju);
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php b/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php
index b6def64..539148e 100644
--- a/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/SteviloLatex.php
@@ -10,9 +10,9 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("MAXSTEVILOSTOLPCEV", 21); //max Stevilo Stolpcev za prvo vrstico pod Drsnikom, zaradi tezav z izrisom, ce je teh vec kot toliko
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('MAXSTEVILOSTOLPCEV')) define("MAXSTEVILOSTOLPCEV", 21); //max Stevilo Stolpcev za prvo vrstico pod Drsnikom, zaradi tezav z izrisom, ce je teh vec kot toliko
class SteviloLatex extends LatexSurveyElement
{
@@ -39,9 +39,10 @@ class SteviloLatex extends LatexSurveyElement
}
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype=null, $preveriSpremenljivko=null, $export_data_type=null, $loop_id=null){
+ //$time_start = microtime(true);
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
-
+
//preveri, ce je kaj v bazi
//$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id);
$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id, $this->loop_id);
@@ -57,7 +58,7 @@ class SteviloLatex extends LatexSurveyElement
$tex = '';
- $symbol = $this->getAnswerSymbol($export_format, $fillablePdf, 2, 10, 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
+ $symbol = $this->getAnswerSymbol($export_subtype, $export_format, $fillablePdf, 2, 10, 0, 0); //poberi simbol checkbox za other in missing moznosti odgovora
//nastavitve iz baze ##########################
$steviloOken = $spremenljivke['size']; //stevilo oken
@@ -102,10 +103,11 @@ class SteviloLatex extends LatexSurveyElement
/* if($postavitev!=0){
$tex .= $texNewLine;
} */
-
+
//ureditev polja s podatki trenutnega uporabnika ######################################################
//$sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
- $sqlUserAnswer = sisplet_query("SELECT text, text2 FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' ");
+ $sqlUserAnswer = sisplet_query("SELECT text, text2 FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."'" .
+ ($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
//echo "userAnswer: ".$userAnswer['text']."</br>";
//ureditev polja s podatki trenutnega uporabnika - konec ##############################################
@@ -152,12 +154,16 @@ class SteviloLatex extends LatexSurveyElement
//echo "parametri tabele: ".$parameterTabular."</br>";
//ureditev parametrov za tabelo - konec######################
- if($userAnswer['text']){
- $okvir = 0;
- }elseif($userAnswer['text'] == ''){ //ce nimamo odgovora
- $okvir = 1; //rabimo okvir
+ if(isset($userAnswer['text'])){
+ if($userAnswer['text']){
+ $okvir = 0;
+ }elseif($userAnswer['text'] == ''){ //ce nimamo odgovora
+ $okvir = 1; //rabimo okvir
+ }
+ }else{
+ $okvir = 1;
}
-
+
#ZACETEK TABELE
//zacetek tabele
if($polozajEnota!=0){ //ce je prisotno besedilo za enoto
@@ -169,7 +175,8 @@ class SteviloLatex extends LatexSurveyElement
}
$izpisStevilk = 0; //belezi, ali se je stevilo ali stevila ze izpisalo
-
+ $txtTmp = []; //polje, ki belezi vnesene odgovore okvirjev
+
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
# po potrebi se prevede besedilo, ki se pojavi pred textbox-om
@@ -181,11 +188,10 @@ class SteviloLatex extends LatexSurveyElement
//ce ni other ali missing
if( (int)$rowVrednost['other'] == 0 && $rowVrednost['naslov']){ //in se ni se izpisalo stevila
-
- $drugoStevilo = $userAnswer['text2']; //belezi drugo mozno stevilo
+
+ $drugoStevilo = isset($userAnswer['text2'])?$userAnswer['text2']:null; //belezi drugo mozno stevilo
if($izpisStevilk == 0 && $okvir == 0){ //ce ni bilo se izpisano nobeno stevilo in ne rabimo tabele za izpis
- $txtTmp = [];
if($export_format=='pdf'){
if($polozajEnota==0){ //ce ni besedila za enoto, rabimo odstavek za pravilen izpis
$txtTmp1 = " \par { ";
@@ -219,10 +225,9 @@ class SteviloLatex extends LatexSurveyElement
array_push($txtTmp, $txtTmp2); //filanje polja z besedili
}
}
-
if($okvir == 1){ //ce rabimo okvir, izpisi
- //$dataTextBox = $this->LatexTextBox($export_format, $textboxHeight, $textboxWidth, $txtTmp, $textboxAllignment, 0);
if($polozajEnota==0){ //ce ni besedila za enoto, rabimo odstavek za pravilen izpis
+ $dataTextBox = "";
if($steviloOken>1){
$dataTextBox = " \par { ";
}
@@ -241,28 +246,27 @@ class SteviloLatex extends LatexSurveyElement
}
-
- if($polozajEnota==0){ //ce polozaja besedila enote je na NE
+ if($polozajEnota==0){ //ce polozaj besedila enote je na NE
if($indeksZaWhile!=1){
- //if($okvir == 1){ //ce rabimo prazen okvir, izpisi
if($okvir == 1 && $textboxWidth<0.49){ //ce rabimo prazen okvir, izpisi
$tex .= ' & '; //skoci v nov stolpec
}else{
- $tex .= ' \\\\ '; //pojdi v novo vrstico
+ //$tex .= ' \\\\ '; //pojdi v novo vrstico
+ $tex .= ' & '; //pojdi v nov stolpec
}
}
if($okvir == 1){ //ce rabimo prazen okvir, izpisi
//izpis praznega text box-a dolocene sirine in visine
- //$tex .= ' & '.$dataTextBox;
$tex .= ' '.$dataTextBox;
}else{ //ce je podatek ob levi enoti
- //$tex .= ' & '.$txtTmp[$indeksZaWhile-1];
- $tex .= ' '.$txtTmp[$indeksZaWhile-1];
+ $tmp_indeks = $indeksZaWhile-1;
+ if (array_key_exists($tmp_indeks , $txtTmp)) {
+ $tex .= ' '.$txtTmp[$indeksZaWhile-1];
+ }
}
}
- //if($polozajEnota==1){ //ce je polozaj besedila enote na LEVI
elseif($polozajEnota==1){ //ce je polozaj besedila enote na LEVI
if($indeksZaWhile!=1){
if($okvir == 1 && $textboxWidth<0.30){ //ce rabimo prazen okvir in je njegova sirina manjsa od 30, izpisi
@@ -274,8 +278,10 @@ class SteviloLatex extends LatexSurveyElement
//izpis besedila enote
$stringEnota = $rowVrednost['naslov'];
- $stringEnota = Common::getInstance()->dataPiping($stringEnota, $usr_id, $loop_id);
- $tex .= $this->encodeText($stringEnota);
+ if($usr_id){
+ $stringEnota = Common::getInstance()->dataPiping($stringEnota, $usr_id, $loop_id);
+ }
+ $tex .= LatexDocument::encodeText($stringEnota);
if($okvir == 1){ //ce rabimo prazen okvir, izpisi
//izpis praznega text box-a dolocene sirine in visine
@@ -288,8 +294,6 @@ class SteviloLatex extends LatexSurveyElement
$tex .= ' & '.$txtTmp[$indeksZaWhile-1];
}
- //echo "tex koda: ".$tex."</br>";
-
}elseif($polozajEnota==2){ //ce je polozaj besedila enote na DESNI
//if($indeksZaWhile!=1&&$export_format=='rtf'){//ce je drugi okvir in je rtf
if($indeksZaWhile!=1){//ce je drugi okvir
@@ -320,8 +324,10 @@ class SteviloLatex extends LatexSurveyElement
}
$stringEnota = $rowVrednost['naslov'];
- $stringEnota = Common::getInstance()->dataPiping($stringEnota, $usr_id, $loop_id);
- $tex .= ' '.$this->encodeText($stringEnota);
+ if($usr_id){
+ $stringEnota = Common::getInstance()->dataPiping($stringEnota, $usr_id, $loop_id);
+ }
+ $tex .= ' '.LatexDocument::encodeText($stringEnota);
if($indeksZaWhile==1&&$export_format=='pdf'){ //ce je prvi okvir in je pdf
//$tex .= ' \hspace{0.5cm} '; //dodaj še nekaj prostora, za prvim okvirjem, da bo dovolj prostora
@@ -336,11 +342,14 @@ class SteviloLatex extends LatexSurveyElement
}
elseif((int)$rowVrednost['other'] != 0) { //drugace, ce imamo missinge ali podobne, jih zabelezi v polju
- // imamo polje drugo - ne vem, zavrnil...
+ $rowVrednostNaslov= array_key_exists('naslov', $rowVrednost)?$rowVrednost['naslov']:null;
+ $rowVrednostVrstni_red= array_key_exists('vrstni_red', $rowVrednost)?$rowVrednost['vrstni_red']:null;
+
+ // imamo polje drugo - ne vem, zavrnil...
$array_others[$rowVrednost['id']] = array(
- 'naslov'=>$rowVrednost['naslov'],
- 'vrstni_red'=>$rowVrednost['vrstni_red'],
- 'value'=>$text[$rowVrednost['vrstni_red']],
+ 'naslov'=>$rowVrednostNaslov,
+ 'vrstni_red'=>$rowVrednostVrstni_red,
+ //'value'=>$text[$rowVrednost['vrstni_red']], //- pokomentiral, ker ne vem, zakaj je tako, saj drugače PHP javlja warning
);
}
@@ -373,13 +382,6 @@ class SteviloLatex extends LatexSurveyElement
#KONEC TABELE
}
//echo "tex koda: ".$tex."</br>";
-
-/* $tex .= $this->texNewLine;
- $tex .= $this->texNewLine;
- if($okvir == 1){ //ce je prazen vprasalnik, dodaj se dve prazni vrstici
- $tex .= $this->texNewLine;
- $tex .= $this->texNewLine;
- } */
}elseif($nacinVnosa==1&&$export_format=='pdf'){ //ce je drsnik in je izvoz v pdf
@@ -446,7 +448,7 @@ class SteviloLatex extends LatexSurveyElement
$array_others[$rowVrednost['id']] = array(
'naslov'=>$rowVrednost['naslov'],
'vrstni_red'=>$rowVrednost['vrstni_red'],
- 'value'=>$text[$rowVrednost['vrstni_red']],
+ //'value'=>$text[$rowVrednost['vrstni_red']], // - pokomentiral, ker ne vem, zakaj je tako, saj drugače PHP javlja warning
);
}
}
@@ -461,6 +463,7 @@ class SteviloLatex extends LatexSurveyElement
for($i=1; $i<=$slider_NumofDescrLabels; $i++){
$slider_CustomDescriptiveLabelsTmp = ($spremenljivkaParams->get('slider_Labela_opisna_'.$i) ? $spremenljivkaParams->get('slider_Labela_opisna_'.$i) : '');
$slider_CustomDescriptiveLabelsTmp = preg_replace("/\s|&nbsp;/",' ',$slider_CustomDescriptiveLabelsTmp); //za odstranitev morebitnih presledkov, ki lahko delajo tezave pri polju za drsnik
+ $slider_CustomDescriptiveLabels = '';
if($i == 1){
$slider_CustomDescriptiveLabels = $slider_CustomDescriptiveLabelsTmp;
}else{
@@ -479,14 +482,14 @@ class SteviloLatex extends LatexSurveyElement
$parameterTabularLabeleNad = 'lR'; //leva (l) pa desna poravnava, ki se prilagaja (R)
//zacetek tabele
- $tex .= ($export_format == 'pdf' ? '\keepXColumns \begin{tabularx}{0.9\textwidth}{'.$parameterTabularLabeleNad.'}' : '\begin{tabular*}{3 cm}{c}');
+ $tex .= ($export_format == 'pdf' ? '\keepXColumns \begin{xltabular}{0.9\textwidth}{'.$parameterTabularLabeleNad.'}' : '\begin{tabular*}{3 cm}{c}');
//vrstice in stolpci v tabeli
- $tex .= $this->encodeText($MinLabel).' & '.$this->encodeText($MaxLabel); //izpis naslovov label v eni vrstici
+ $tex .= LatexDocument::encodeText($MinLabel).' & '.LatexDocument::encodeText($MaxLabel); //izpis naslovov label v eni vrstici
//vrstice in stolpci v tabeli - konec
//konec tabele
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular*} \\noindent");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular*} \\noindent");
//$tex .= $texNewLine; //v novo vrstico po izrisu label
$tex .= '\par'; //odstavek
@@ -538,7 +541,7 @@ class SteviloLatex extends LatexSurveyElement
//zacetek tabele
//$tex .= ($export_format == 'pdf' ? '\begin{tabularx}{0.9\textwidth}{'.$parameterTabularLabelePrvaPod.'}' : '\begin{tabular}{'.$parameterTabularLabelePrvaPod.'}');
- $tex .= ($export_format == 'pdf' ? '\keepXColumns \begin{tabularx}{0.9\textwidth}{'.$parameterTabularLabelePrvaPod.'}' : '\begin{tabular}{'.$parameterTabularLabelePrvaPod.'}');
+ $tex .= ($export_format == 'pdf' ? '\keepXColumns \begin{xltabular}{0.9\textwidth}{'.$parameterTabularLabelePrvaPod.'}' : '\begin{tabular}{'.$parameterTabularLabelePrvaPod.'}');
// \keepXColumns
//izris vrstice in stolpcev v tabeli
for($i=0; $i<$steviloStolpcevPrvaVrstica; $i++){
@@ -563,6 +566,7 @@ class SteviloLatex extends LatexSurveyElement
}
}else{ //za vse ostale stolpce med prvi in zadnjim
if($slider_VmesneNumLabel&&$steviloStolpcevPrvaVrsticaOrig<=MAXSTEVILOSTOLPCEV){ //ce so vmesne labele stevilske in je stevilo stolpcev manjsi od maximalnega dovoljenega za ustrezen izris
+ $vmesnoStevilo=0;
if($i==1){
$vmesnoStevilo=$slider_MinNumLabel+$slider_handle_step;
}else{
@@ -578,7 +582,7 @@ class SteviloLatex extends LatexSurveyElement
//izris vrstice in stolpcev v tabeli - konec
//konec tabele
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular} \\noindent");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular} \\noindent");
#IZRIS PRVE VRSTICE POD DRSNIKOM - KONEC ######################################
//echo $tex;
@@ -588,6 +592,7 @@ class SteviloLatex extends LatexSurveyElement
//ureditev parametrov za tabeli
$parameterTabularLabeleDrugaPod='';
$prazniStolpciZaGraficneOznake = '';
+ $parameterTabularLabeleTretjaPod = '';
for($i=0; $i<$slider_StevLabelPodrocij; $i++){
$parameterTabularLabeleDrugaPod .= ($export_format == 'pdf' ? '|C|' : '|c|'); //sredinska poravnava
$parameterTabularLabeleTretjaPod .= ($export_format == 'pdf' ? 'C' : 'c'); //sredinska poravnava
@@ -599,19 +604,19 @@ class SteviloLatex extends LatexSurveyElement
//ureditev parametrov za tabeli - konec
//zacetek tabele z graficnimi oznakami
- $tex .= ($export_format == 'pdf' ? '\begin{tabularx}{0.9\textwidth}{'.$parameterTabularLabeleDrugaPod.'}' : '\begin{tabular}{'.$parameterTabularLabeleDrugaPod.'}');
+ $tex .= ($export_format == 'pdf' ? '\begin{xltabular}{0.9\textwidth}{'.$parameterTabularLabeleDrugaPod.'}' : '\begin{tabular}{'.$parameterTabularLabeleDrugaPod.'}');
//izris prazne vrstice z graficnimi oznakami label (crta horizontal)
$tex .= $prazniStolpciZaGraficneOznake;
//izris prazne vrstice z graficnimi oznakami label (crta horizontal) - konec
//konec tabele z graficnimi oznakami
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular} \\noindent");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular} \\noindent");
$tex .= $texNewLine;
//zacetek tabele z naslovi label
- $tex .= ($export_format == 'pdf' ? '\begin{tabularx}{0.9\textwidth}{'.$parameterTabularLabeleTretjaPod.'}' : '\begin{tabular}{'.$parameterTabularLabeleTretjaPod.'}');
+ $tex .= ($export_format == 'pdf' ? '\begin{xltabular}{0.9\textwidth}{'.$parameterTabularLabeleTretjaPod.'}' : '\begin{tabular}{'.$parameterTabularLabeleTretjaPod.'}');
//izris naslovov label
$slider_Labela_podrocja = []; //polje, ki hrani vpisane naslove labele podrocij
@@ -628,7 +633,7 @@ class SteviloLatex extends LatexSurveyElement
//izris naslovov label - konec
//konec tabele z naslovi label
- $tex .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular} \\noindent");
+ $tex .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular} \\noindent");
}
#IZRIS DRUGE VRSTICE POD DRSNIKOM - LABELE PODROCIJ ###########################
//echo $tex;
@@ -653,7 +658,6 @@ class SteviloLatex extends LatexSurveyElement
}
if($nacinVnosa==1){ //ce je drsnik
- //if($export_data_type==1||$export_data_type==0){ //ce je dolg ali navaden izpis izvoza, ko se izrisuje drsnik
if(($export_data_type==1||$export_data_type==0)&&(count($array_others)==0)){ //ce je dolg ALI navaden izpis izvoza IN ni missing, ko se izrisuje drsnik
$tex .= $this->texBigSkip;
$tex .= $this->texBigSkip." ";
@@ -669,18 +673,9 @@ class SteviloLatex extends LatexSurveyElement
//$tex .= $this->texNewLine;
}
}
-
-
-/* $tex .= $texNewLine;
- $tex .= $texNewLine; */
- /* $tex .= $this->texBigSkip;
- $tex .= $this->texBigSkip." "; */
-
- if($export_format == 'pdf'){ //ce je pdf
- //$tex .= '\\end{absolutelynopagebreak}'; //zakljucimo environment, da med vprasanji ne bo prelomov strani
- }else{ //ce je rtf
-
- }
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time število:</b> '.$execution_time.' sec </br>'; */
return $tex;
}
diff --git a/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php b/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php
index 3cd5a14..88e3aa7 100644
--- a/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php
+++ b/admin/survey/export/latexclasses/Vprasanja/VsotaLatex.php
@@ -10,9 +10,9 @@
*****************************************/
-define("PIC_SIZE", "\includegraphics[width=10cm]"); //slika sirine 50mm
-define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
-define("RADIO_BTN_SIZE", 0.13);
+if (!defined('PIC_SIZE')) define("PIC_SIZE", "\includegraphics[width=5cm]"); //slika sirine 50mm
+if (!defined('ICON_SIZE')) define("ICON_SIZE", "\includegraphics[width=0.5cm]"); //za ikone @ slikovni tip
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
class VsotaLatex extends LatexSurveyElement
{
@@ -27,6 +27,7 @@ class VsotaLatex extends LatexSurveyElement
private static $_instance;
protected $texBigSkip = ' \bigskip ';
protected $loop_id = null; // id trenutnega loopa ce jih imamo
+ protected $usr_id = null;
public static function getInstance()
{
@@ -38,9 +39,10 @@ class VsotaLatex extends LatexSurveyElement
public function export($spremenljivke=null, $export_format='', $questionText='', $fillablePdf=null, $texNewLine='', $usr_id=null, $db_table=null, $export_subtype=null, $preveriSpremenljivko=null, $loop_id=null){
+ //$time_start = microtime(true);
// Ce je spremenljivka v loopu
$this->loop_id = $loop_id;
-
+ $this->usr_id = $usr_id;
//preveri, ce je kaj v bazi
//$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id);
$userDataPresent = $this->GetUsersData($db_table, $spremenljivke['id'], $spremenljivke['tip'], $usr_id, $this->loop_id);
@@ -72,17 +74,21 @@ class VsotaLatex extends LatexSurveyElement
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$stringTitleRow = $rowVrednost['naslov']; //odgovori na levi strani
- array_push($navpicniOdgovori, $this->encodeText($stringTitleRow) ); //filanje polja z navpicnimi odgovori (po vrsticah)
+ if($usr_id){
+ $stringTitleRow = Common::getInstance()->dataPiping($stringTitleRow, $usr_id, $loop_id);
+ }
+ $stringTitleRow = LatexDocument::encodeText($stringTitleRow);
+ array_push($navpicniOdgovori, $stringTitleRow ); //filanje polja z navpicnimi odgovori (po vrsticah)
//ureditev polja s podatki trenutnega uporabnika ######################################################
//$sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
- $sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ");
+ $sqlUserAnswer = sisplet_query("SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivke['id']."' AND usr_id='".$usr_id."' AND vre_id='".$rowVrednost['id']."' ".($loop_id !== null ? " AND loop_id='$loop_id'" : ""));
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- //echo "userAnswer: ".$userAnswer['text']." za vre_id: ".$rowVrednost['id']."</br>";
- array_push($odgovoriRespondenta, '\\textcolor{crta}{'.$userAnswer['text'].'}' ); //filanje polja z odgovori respondenta
+ $texUserAnswer = isset($userAnswer['text'])?$userAnswer['text']:null;
+ array_push($odgovoriRespondenta, '\\textcolor{crta}{'.$texUserAnswer.'}' ); //filanje polja z odgovori respondenta
//ureditev polja s podatki trenutnega uporabnika - konec ##############################################
- $vsota += $userAnswer['text']; //izracun sprotne vsote
+ $vsota += isset($userAnswer['text'])?$userAnswer['text']:null; //izracun sprotne vsote
}
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti - konec
@@ -105,7 +111,9 @@ class VsotaLatex extends LatexSurveyElement
}else{ //ce je rtf
}
-
+ /* $time_end = microtime(true);
+ $execution_time = ($time_end - $time_start);
+ echo '<b>Total Execution Time vsota:</b> '.$execution_time.' sec </br>'; */
return $tex;
}
}
@@ -119,14 +127,18 @@ class VsotaLatex extends LatexSurveyElement
$parameterTabularL = 'rl'; //parametri za tabelo
- $textVsota = $this->encodeText($spremenljivke['vsota']);
+ $textVsota = $spremenljivke['vsota'];
+ if($this->usr_id){
+ $textVsota = Common::getInstance()->dataPiping($textVsota, $this->usr_id, $this->loop_id);
+ }
+ $textVsota = LatexDocument::encodeText($textVsota);
if($textVsota==''){
$textVsota = $lang['srv_vsota_text'];
}
//zacetek tabele
- $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'tabularx', 'tabular*', 0.45, 0.2);
+ $tabela .= $this->StartLatexTable($typeOfDocument, $parameterTabularL, 'xltabular', 'tabular*', 0.45, 0.2);
//argumenti za leve okvirje
$textboxWidthL = 0.2;
@@ -153,11 +165,10 @@ class VsotaLatex extends LatexSurveyElement
}
//besedilo in okvir pod crto, kjer je prikazana koncna vsota
- $tabela .= $textVsota.' & '.$this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, $odgovoriRespondenta[$i-1], $textboxAllignment, $noBorders);
- //$tabela .= $lang['srv_vsota_text'].' & '.$this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, $odgovoriRespondenta[$i-1], $textboxAllignment, $noBorders);
+ $tabela .= $textVsota.' & '.$this->LatexTextBox($typeOfDocument, $textboxHeight, $textboxWidth, isset($odgovoriRespondenta[$i-1])?$odgovoriRespondenta[$i-1]:null, $textboxAllignment, $noBorders);
//zakljucek tabele
- $tabela .= $this->EndLatexTable($typeOfDocument, 'tabularx', 'tabular*');
+ $tabela .= $this->EndLatexTable($typeOfDocument, 'xltabular', 'tabular*');
//izpis kode tabela - konec
diff --git a/admin/survey/export/latexclasses/class.LatexAnalysis.php b/admin/survey/export/latexclasses/class.LatexAnalysis.php
index ec00834..98815ed 100644
--- a/admin/survey/export/latexclasses/class.LatexAnalysis.php
+++ b/admin/survey/export/latexclasses/class.LatexAnalysis.php
@@ -86,13 +86,9 @@ class LatexAnalysis{
# preberemo header
if ($this->headFileName !== null) {
//polovimo podatke o nastavitvah trenutnega profila (missingi..)
- //SurveyMissingProfiles :: Init(self::$sid,$global_user_id);
SurveyMissingProfiles :: Init($this->spremenljivka,$this->anketa['uid']);
SurveyAnalysis::$missingProfileData = SurveyMissingProfiles::getProfile(SurveyAnalysis::$currentMissingProfile);
- //echo "SurveyAnalysis::missingProfileData in displayAnalysis: ".SurveyAnalysis::$missingProfileData." </br>";
- //echo "Indeksi SurveyAnalysis::missingProfileData v displayAnalysis: ".print_r(array_keys(SurveyAnalysis::$missingProfileData))." </br>";
- //echo "display_mv_type in displayAnalysis: ".SurveyAnalysis::$missingProfileData['display_mv_type']." </br>";
// Preverimo ce imamo zanke (po skupinah)
SurveyAnalysis::$_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
@@ -105,14 +101,9 @@ class LatexAnalysis{
#odstranimo sistemske variable
SurveyAnalysis::removeSystemVariables();
-
- //echo in_array($this->$spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES );
//$vars_count = count(SurveyAnalysis::$_FILTRED_VARIABLES);
- //echo 'sprID: '.$_GET['sprID'].'</br>';
- //echo 'export_subtype: '.$export_subtype.'</br>';
-
/*Izpis naslova izvoza*/
switch ( $export_subtype ){
case 'sums':
@@ -166,13 +157,10 @@ class LatexAnalysis{
foreach (SurveyAnalysis::$_HEADERS AS $spid => $spremenljivka) {
$analysisTable = new LatexAnalysisElement($this->anketa, $spremenljivka, $this->export_format, 0, $spid, $this->headFileName, $export_subtype);
//if(SurveyAnalysis::$_FILTRED_VARIABLES[$spid]){
- if (($spremenljivka['tip'] != 'm'
+ if ((isset($spremenljivka['tip']) && $spremenljivka['tip'] != 'm'
&& in_array($spremenljivka['tip'], SurveyAnalysis::$_FILTRED_TYPES ))
&& (!isset($_spid) || (isset($_spid) && $_spid == $spid))
&& ($this->spremenljivka == $spid || $this->spremenljivka == null) ){
- //echo "spremenljivka tip : ".$spremenljivka['tip']."</br>";
- /*echo "spr_id: ".$this->spremenljivka."</br>";
- echo "spid : ".$spid."</br>"; */
# če nimamo zank
if(count(SurveyAnalysis::$_LOOPS) == 0){
$tex .= $analysisTable->displayTablesLatex($spid, $this->export_format);
@@ -238,8 +226,10 @@ class LatexAnalysis{
break;
case 'crosstab':
- $crossData1 = explode(",", $_GET['data1']);
- $crossData2 = explode(",", $_GET['data2']);
+ $tmp_data1 = isset($_GET['data1'])?$_GET['data1']:null;
+ $tmp_data2 = isset($_GET['data2'])?$_GET['data2']:null;
+ $crossData1 = explode(",", $tmp_data1);
+ $crossData2 = explode(",", $tmp_data2);
$analysisTable = new LatexAnalysisElement($this->anketa, 0, $this->export_format, 0, 0, $this->headFileName, $export_subtype);
$tex .= $analysisTable->displayCrosstabsTablesLatex($crossData1, $crossData2);
break;
@@ -261,11 +251,13 @@ class LatexAnalysis{
break;
case 'heatmap_image_pdf':
$analysisHeatmapImage = new LatexAnalysisElement($this->anketa, 0, $this->export_format, 0, 0, $this->headFileName, $export_subtype);
- $tex .= $analysisHeatmapImage->displayHeatmapImageLatex($_GET['sprID']);
+ $tmp_sprID = isset($_GET['sprID'])?$_GET['sprID']:null;
+ $tex .= $analysisHeatmapImage->displayHeatmapImageLatex($tmp_sprID);
break;
case 'chart':
$analysisChart = new LatexAnalysisElement($this->anketa, 0, $this->export_format, 0, 0, $this->headFileName, $export_subtype);
- $tex .= $analysisChart->displayChartLatex($_GET['sprID']);
+ $tmp_sprID = isset($_GET['sprID'])?$_GET['sprID']:null;
+ $tex .= $analysisChart->displayChartLatex($tmp_sprID);
break;
case 'creport':
$analysisCreport = new LatexAnalysisElement($this->anketa, 0, $this->export_format, 0, 0, $this->headFileName, $export_subtype);
diff --git a/admin/survey/export/latexclasses/class.LatexAnalysisElement.php b/admin/survey/export/latexclasses/class.LatexAnalysisElement.php
index 9b3cec2..4e0696b 100644
--- a/admin/survey/export/latexclasses/class.LatexAnalysisElement.php
+++ b/admin/survey/export/latexclasses/class.LatexAnalysisElement.php
@@ -9,7 +9,7 @@
include('../../vendor/autoload.php');
-define("MAX_STRING_LENGTH", 20);
+if (!defined("MAX_STRING_LENGTH")) define("MAX_STRING_LENGTH", 20);
class LatexAnalysisElement{
@@ -35,6 +35,20 @@ class LatexAnalysisElement{
protected $export_subtype;
protected $export_format;
+
+ protected $path2HeatmapImages = '';
+
+ protected $counter = 0;
+
+ protected $ttestClass = null;
+
+ protected $tableSettingsNumerus = null;
+
+ protected $tableSettingsPercent = null;
+
+ protected $tableSettingsAvgVar = null;
+
+ protected $tableSettingsDelezVar = null;
public $crosstabClass = null; //crosstab class
protected $crossData1;
@@ -59,7 +73,7 @@ class LatexAnalysisElement{
protected $path2Images;
protected $path2Charts;
-
+
//function __construct($anketa, $spremenljivka){ //$anketa, $export_format, $fillablePdf, $usr_id
//function __construct($anketa, $export_format, $fillablePdf, $usr_id, $export_subtype){
@@ -171,11 +185,10 @@ class LatexAnalysisElement{
switch ( $this->export_subtype ){
case 'crosstab':
- $this->crosstabClass->_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
- //echo "stevilo crosstab loopov: ".count($this->crosstabClass->_LOOPS)."</br>";
- if (count($this->crosstabClass->_LOOPS) > 0) {
+ $_LOOPS = SurveyZankaProfiles::getFiltersForLoops();
+ if (count($_LOOPS) > 0) {
# če mamo zanke
- foreach ( $this->crosstabClass->_LOOPS AS $loop) {
+ foreach ( $_LOOPS AS $loop) {
$this->crosstabClass->_CURRENT_LOOP = $loop;
$tabela .= $this->displayCrosstabsTable();
}
@@ -187,10 +200,12 @@ class LatexAnalysisElement{
for($j=0; $j<sizeof($this->crossData2); $j++){
for($i=0; $i<sizeof($this->crossData1); $i++){
- if($addPage)
- $this->pdf->AddPage();
- else
+ if($addPage){
+ //$this->pdf->AddPage();
+ }else{
$addPage = true;
+ }
+
/*$this->pdf->ln(5);*/
$this->crosstabClass->setVariables($this->crossData2[$j][0],$this->crossData2[$j][1],$this->crossData2[$j][2],$this->crossData1[$i][0],$this->crossData1[$i][1],$this->crossData1[$i][2]);
@@ -310,7 +325,7 @@ class LatexAnalysisElement{
$means = array();
- if (meanData1 !== null && $meanData2 !== null) {
+ if ($meanData1 !== null && $meanData2 !== null) {
$variables1 = $meanData2;
$variables2 = $meanData1;
$c1=0;
@@ -322,7 +337,7 @@ class LatexAnalysisElement{
if(is_array($variables2) && count($variables2) > 0){
#prikazujemo ločeno
- if ($this->sessionData['means']['meansSeperateTables'] == true || $this->sessionData['mean_charts']['showChart'] == '1') {
+ if ((isset($this->sessionData['means']['meansSeperateTables'])?$this->sessionData['means']['meansSeperateTables']:null) == true || (isset($this->sessionData['mean_charts']['showChart'])?$this->sessionData['mean_charts']['showChart']:0) == '1') {
foreach ($variables2 AS $v_second) {
if (is_array($variables1) && count($variables1) > 0) {
foreach ($variables1 AS $v_first) {
@@ -358,7 +373,7 @@ class LatexAnalysisElement{
$count = 0;
foreach ($means AS $mean_sub_grup) {
- if($this->sessionData['mean_charts']['showChart'] == '1'){
+ if((isset($this->sessionData['mean_charts']['showChart'])?$this->sessionData['mean_charts']['showChart']:0) == '1'){
//$this->displayMeansTable($mean_sub_grup);
$tabela .= $mean->displayMeansTable($mean_sub_grup, $this->meansClass, $this->export_format);
@@ -441,7 +456,7 @@ class LatexAnalysisElement{
# če nimamo zank
if(count(SurveyAnalysis::$_LOOPS) == 0){
- $graf .= $chart->displayCharts();
+ $graf .= $chart->displayCharts($this->exportClass);
}
else{
// izrisemo samo eno tabelo iz enega loopa
@@ -452,14 +467,7 @@ class LatexAnalysisElement{
SurveyAnalysis::$_CURRENT_LOOP = $loop;
// Izpisemo naslov zanke za skupino
-/* $this->pdf->setFont('','B','10');
- $this->pdf->ln(5);
- $this->pdf->MultiCell(200, 5, $this->encodeText($lang['srv_zanka_note'].$loop['text']), 0, 'L', 0, 1, 0 ,0, true);
- $this->pdf->ln(5);
- $this->pdf->setFont('','','6'); */
-
- //$graf .= $this->displayCharts();
- $graf .= $chart->displayCharts();
+ $graf .= $chart->displayCharts($this->exportClass);
}
// Izrisemo vse tabele spremenljivka (iz vseh loopov)
@@ -472,14 +480,7 @@ class LatexAnalysisElement{
SurveyAnalysis::$_CURRENT_LOOP = $loop;
// Izpisemo naslov zanke za skupino
-/* $this->pdf->setFont('','B','10');
- $this->pdf->ln(5);
- $this->pdf->MultiCell(200, 5, $this->encodeText($lang['srv_zanka_note'].$loop['text']), 0, 'L', 0, 1, 0 ,0, true);
- $this->pdf->ln(5);
- $this->pdf->setFont('','','6'); */
-
- //$graf .= $this->displayCharts();
- $graf .= $chart->displayCharts();
+ $graf .= $chart->displayCharts($this->exportClass);
}
}
}
@@ -506,7 +507,7 @@ class LatexAnalysisElement{
$creportProfile= $creport->getCreportProfile();
$what = 'creport_title_profile_'.$creportProfile;
- $sqlT = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$this->ank_id' AND uid='$this->usr_id' AND what='$what'");
+ $sqlT = sisplet_query("SELECT value FROM srv_user_setting_for_survey WHERE sid='$anketaId' AND uid='$global_user_id' AND what='$what'");
if(mysqli_num_rows($sqlT) == 0){
$titleString = $lang['export_analisys_creport'].': '.SurveyInfo::getInstance()->getSurveyTitle();
@@ -516,9 +517,9 @@ class LatexAnalysisElement{
$titleString = $rowT['value'];
}
- $naslovIzvoza = $this->encodeText($titleString);
+ $naslovIzvoza = LatexDocument::encodeText($titleString);
//$creportLatex .= '\textbf{'.$naslovIzvoza.'}'.$this->texBigSkip.$this->texNewLine;
- $creportLatex .= '\MakeUppercase{\huge \textbf{'.$naslovIzvoza.'}}'.$this->texBigSkip.$this->texNewLine;
+ $creportLatex .= '\MakeUppercase{\huge \textbf{'.$naslovIzvoza.'}}'./* $this->texBigSkip. */$this->texNewLine;
if($this->export_format == 'pdf'){
$creportLatex .= '\begin{tableAnalysis}'; /*zacetek environmenta z manjsim fontom*/
@@ -755,6 +756,8 @@ class LatexAnalysisElement{
$imgName = $Cache->GetHash($ID,$DataSet->GetData());
}
+ $boldedSubTitle='';
+ $boldedTitle='';
// Izrisemo naslov (v creportu ne, ker imamo drugacne naslove)
if($fromCharts){
@@ -780,7 +783,7 @@ class LatexAnalysisElement{
//self::$exportClass->pdf->setFont('','b','6');
//self::$exportClass->pdf->MultiCell(165, 5, $title, 0, 'C', 0, 1, 0 ,0, true);
- $boldedTitle = $this->returnBold($this->encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
+ $boldedTitle = $this->returnBold(LatexDocument::encodeText($title)).$this->texNewLine; //vrni boldan naslov in skoci v novo vrstico
if($spremenljivka['tip'] == 2){
//self::$exportClass->pdf->setFont('','','5');
@@ -804,7 +807,8 @@ class LatexAnalysisElement{
shell_exec($pretvoriPng_v_Pdf);
##### ZA TESTIRANJE ureditev pretvorbe slike v pdf - konec
- $texImageOnly = " \\includegraphics[scale=0.66]{".$this->path2Charts."".$imgName."} "; //latex za sliko
+ $texImageOnly = " \\includegraphics[width=\linewidth, frame, scale=0.66]{".$this->path2Charts."".$imgName."} "; //latex za sliko
+ //$texImageOnly = " \\includegraphics[scale=0.66]{".$this->path2Charts."".$imgName."} "; //latex za sliko
//$texImageOnly = " \\includegraphics[scale=0.66, draft=false]{".$this->path2Charts."".$imgName."} "; //latex za sliko
//$texImageOnly = " \\includegraphics[scale=0.85]{".$this->path2Charts."".$imgName."} "; //latex za sliko
//echo "ime slike: $texImageOnly </br>";
@@ -838,30 +842,26 @@ class LatexAnalysisElement{
#moja funkcija encodeText
function encodeText($text=''){
- // popravimo sumnike ce je potrebno
- //$text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
- //$text = str_replace("&scaron;","š",$text);
- //echo "Encoding ".$text."</br>";
-
+ $text = isset($text)?$text:'';
//resevanje razbirajanja predolgih neprekinjenih besed in URL - spremenljivke za kasnejsi prilagojen izpis
$numOfWords = str_word_count($text, 0); //stevilo besed v besedilu
$numOfSpacesPrej = substr_count($text, ' '); //stevilo presledkov v besedilu
$stringLength = strlen($text); //dolzina besedila
-
+
$findSpace = ' ';
$findHttp = 'http://';
$findHttps = 'https://';
$posHttp = strpos($text, $findHttp);
$posHttps = strpos($text, $findHttps);
$isURL = 0;
- /* if($posHttp !== false || $posHttps !== false) { //imamo URL naslov
- $isURL = 1;
- } */
//resevanje razbirajanja predolgih neprekinjenih besed in URL - konec
+
if($text == ''){ //ce ni teksta, vrni se
return;
}
+
+
$textOrig = $text;
$findme = '<br />';
$findmeLength = strlen($findme);
@@ -884,27 +884,19 @@ class LatexAnalysisElement{
$posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
$textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
- //$text = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
$text = $textPrej.' '.PIC_SIZE_ANS."{".$this->path2Images."".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
}
//pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
- $findImgCode = '\includegraphics';
+ $findImgCode = '\includegraphics';
$posOfImgCode = strpos($text, $findImgCode);
- //echo $posOfImgCode."</br>";
$textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
- //echo $textToImgCode."</br>";
$textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
- //echo $textFromImgCode."</br>";
$findImgCodeEnd = '}';
- //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
$posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
- //echo $posOfImgCodeEnd."</br>";
$textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
- //echo $textAfterImgCode."</br>";
$textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
- //echo $textOfImgCode."</br>";
$text = $textToImgCode.$textAfterImgCode;
@@ -912,6 +904,7 @@ class LatexAnalysisElement{
}
//ureditev izrisa slike - konec
+
//ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
$text = str_replace('\\','\textbackslash{} ',$text);
//$text = str_replace('{','\{',$text);
@@ -925,29 +918,22 @@ class LatexAnalysisElement{
//$text = str_replace('_','\_ ',$text);
$text = str_replace('_','\_',$text);
$text = str_replace('~','\textasciitilde{} ',$text);
- if(strpos($text, '&amp;')){ //ce je prisotno v besedilu &amp;'
- $text = str_replace('&amp;','\& ',$text);
- }else{
- $text = str_replace('&','\& ',$text);
- }
-
- $andSymbolPresent = 0;
- $posAndSymbolPresent = strpos($text,'&amp;');
- if($posAndSymbolPresent !== false){ //ce je v besedilu prisoten '&' zapisan kot '&amp;'
- $text = str_replace('&amp;','\&',$text);
- $andSymbolPresent = 1;
- }
- if($andSymbolPresent == 0){
- $text = str_replace('&','\&',$text);
- }
//$text = str_replace('&lt;','\textless ',$text);
$text = str_replace('&lt;','\textless',$text);
//$text = str_replace('&gt;','\textgreater ',$text);
$text = str_replace('&gt;','\textgreater',$text);
$text = str_replace('&nbsp;',' ',$text);
+
+ if(strpos($text, '&amp;')){ //ce je prisotno v besedilu &amp;'
+ $text = str_replace('&amp;','\&',$text);
+ }
+ else{
+ $text = str_replace('&','\&',$text);
+ }
//ureditev posebnih karakterjev za Latex - konec
+
//ureditev grskih crk
$text = str_replace('α','\textalpha ',$text);
$text = str_replace('β','\textbeta ',$text);
@@ -975,39 +961,38 @@ class LatexAnalysisElement{
$text = str_replace('ω','\textomega ',$text);
//ureditev grskih crk - konec
+
//ureditev preureditve html kode ul in li v latex itemize
$findUl = '<ul';
$findUlLength = strlen($findUl);
$posUl = strpos($text, $findUl);
+
if($posUl !== false){
- //echo "text prej: ".$text."</br>";
+
$numOfUl = substr_count($text, $findUl); //stevilo '<ul' v tekstu
- //echo "numOfUl ".$numOfUl."</br>";
- ######################
+
if($numOfUl!=0){
$text = str_replace('<ul>','\begin{itemize} ', $text);
$text = str_replace('<li>','\item ', $text);
$text = str_replace('</ul>','\end{itemize} ', $text);
}
- //echo "prazno v html: ".strpos($text, '\r')."</br>";
- //echo "text potem: ".$text."</br>";
- ######################
}
-
//ureditev preureditve html kode ul in li v latex itemize - konec
+
//po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
if($posImg !== false){
$text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
}
//po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
- if($pos === false && $posImg === false) { //v tekstu ni br in img
- //return $text;
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); */
- }else { //v tekstu sta prisotna br ali img
+
+ //v tekstu ni br in img
+ if($pos === false && $posImg === false) {
+
+ }
+ //v tekstu sta prisotna br ali img
+ else {
$text2Return = ''; //tekst ki bo vrnjen
//ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
@@ -1015,6 +1000,7 @@ class LatexAnalysisElement{
$pos = strpos($text, $findme);
$numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
for($i=0; $i<$numOfBr; $i++){
+
if($i == 0){ //ce je prvi najdeni '<br />'
$textPrej = substr($text, 0, $pos);
$textPotem = substr($text, $pos+$findmeLength);
@@ -1023,7 +1009,8 @@ class LatexAnalysisElement{
}else{
$text2Return .= $textPrej.' \break ';
}
- }else{ //drugace
+ }
+ else{ //drugace
$pos = strpos($textPotem, $findme);
$textPrej = substr($textPotem, 0, $pos);
$textPotem = substr($textPotem, $pos+$findmeLength);
@@ -1034,40 +1021,43 @@ class LatexAnalysisElement{
}
}
}
+
$text = $text2Return;
}
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); //vrni tekst brez html tag-ov */
}
+
//ureditev odstranjevanja presledkov, ce so na zacetku ali koncu besedila
if(($numOfSpacesPrej)){ //ce so prisotni presledki
$odstranjeno = 0; //belezi, ali so bili presledki odstranjeni iz zacetka ali konca
+
for($numPresledkovTmp = 1; $numPresledkovTmp <= $numOfSpacesPrej; $numPresledkovTmp++){ //za vsak presledek
$posSpace = strpos($text, $findSpace); //najdi pozicijo presledka v besedilu//preveri, kje se nahaja
+
if($posSpace==0){ //ce je presledek na zacetku besedila
$text = substr_replace($text, '', $posSpace, 1); //odstrani presledek iz besedila
$stringLength = strlen($text);
$odstranjeno = 1;
- }elseif($posSpace==$stringLength){ //ce je presledek na koncu besedila
+ }
+ elseif($posSpace==$stringLength){ //ce je presledek na koncu besedila
$text = substr_replace($text, '', $posSpace, 1); //odstrani presledek iz besedila
$stringLength = strlen($text);
$odstranjeno = 1;
}
}
+
$numOfSpacesPrej = substr_count($text, ' '); //stevilo presledkov v besedilu
}
//ureditev odstranjevanja presledkov, ce so na zacetku ali koncu besedila - konec
+
- //echo "v besedilu $text je stevilo presledkov $numOfSpacesPrej in besed $numOfWords </br>";
//priprava izpisa zelo dolgega besedila brez presledkov s seqsplit (URL, email, ...)
- if( ($numOfSpacesPrej == 0 && $stringLength >= MAX_STRING_LENGTH && $odstranjeno) ){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
+ if( ($numOfSpacesPrej == 0 && $stringLength >= MAX_STRING_LENGTH && isset($odstranjeno)?$odstranjeno:0) ){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
$text = "\seqsplit{".$text."}"; //ni v redu seqsplit, ker ne dela, če so posebni znaki
}
//priprava izpisa zelo dolgega besedila brez presledkov - konec
+
return strip_tags($text); //vrni tekst brez html tag-ov
}
@@ -1078,9 +1068,10 @@ class LatexAnalysisElement{
$tex .= '\keepXColumns';
if($export_format == 'pdf'){
$tex .= '\begin{'.$pdfTable.'}';
- if($pdfTable=='tabularx'){
+ if($pdfTable=='xltabular'){
//$tex .= '{'.$pdfTableWidth.'\textwidth}';
- $tex .= '{\hsize}';
+ //$tex .= '{\hsize}';
+ $tex .= '{\textwidth}';
}
$tex .= '{ '.$parameterTabular.' }';
}elseif($export_format == 'rtf'||$export_format == 'xls'){
@@ -1098,7 +1089,7 @@ class LatexAnalysisElement{
global $lang;
$text = array();
- $texoutputSumaValidAnswerVertical = '';
+ $outputSumaValidAnswerVertical = '';
# opcije
$options = array( 'isTextAnswer' => false, # ali je tekstovni odgovor
@@ -1110,26 +1101,26 @@ class LatexAnalysisElement{
$options[$_oKey] = $_option;
}
- $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+ $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0) / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_brez_MV = ((int)SurveyAnalysis::$currentMissingProfile == 2) ? TRUE : FALSE;
$_sufix = '';
- $text[] = $this->encodeText($lang['srv_anl_valid']);
- $text[] = $this->encodeText($lang['srv_anl_suma1']);
+ $text[] = LatexDocument::encodeText($lang['srv_anl_valid']);
+ $text[] = LatexDocument::encodeText($lang['srv_anl_suma1']);
- $text[] = $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0);
+ $text[] = LatexDocument::encodeText((isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0) > 0 ? (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0) : 0);
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber(100, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = '';
- $exportformat = $options['exportFormat'];
+ $exportformat = isset($options['exportFormat'])?$options['exportFormat']:null;
$brezHline = $this->getBrezHline($exportformat);
$outputSumaValidAnswerVertical .= self::tableRow($text, $brezHline);
@@ -1138,9 +1129,8 @@ class LatexAnalysisElement{
//return $counter;
}
- function outputValidAnswerVertical($counter=null,$vkey='', $vAnswer=null, $_sequence=null,$spid=null, &$_kumulativa=null,$_options=array()) {
+ function outputValidAnswerVertical($counter=null,$vkey='', $vAnswer=null, $_sequence=null,$spid=null, &$_kumulativa=null,$_options=array(), $sprTip=null) {
global $lang;
- //echo "funkcija outputValidAnswerVertical </br>";
$text = array();
$texoutputValidAnswerVertical = '';
@@ -1156,50 +1146,33 @@ class LatexAnalysisElement{
}
$cssBck = ' '.SurveyAnalysis::$cssColors['0_' . ($counter & 1)];
- $_valid = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
+ $_valid = ((isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt']:0) > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['validCnt'] : 0;
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
$_kumulativa += $_valid;
# ali presegamo število prikazanih vrstic, takrat v zadnji prikazani dodamo link več.. ostale vrstice pa skrijemo
-/* if ($options['textAnswerExceed'] == true) {
- if ($counter == TEXT_ANSWER_LIMIT ) {
- # link za več
- $show_more = '<div id="valid_row_togle_'.$_sequence.'" class="floatRight blue pointer" onclick="showHidenTextRow(\''.$_sequence.'\');return false;">(več...)</div>'.NEW_LINE;
- } elseif ($counter > TEXT_ANSWER_LIMIT ) {
- $hide_row = ' hidden';
- $_exceed = true;
- }
- } */
- //if ($counter < TEXT_MAX_ANSWER_LIMIT) {
- $text[] = '';
+ $text[] = '';
- $addText = (($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' ('.$vAnswer['text'] .')' : '');
- //$text[] = $this->encodeText(' '.$vkey.$addText);
- $text[] = $this->snippet($this->encodeText(' '.$vkey.$addText), 400);
-
+ $addText = (($options['isTextAnswer'] == false && (string)$vkey != $vAnswer['text']) ? ' ('.$vAnswer['text'] .')' : '');
+ $tmptext = $this->snippet($vkey.$addText, 400);
+ $text[] = LatexDocument::encodeText($tmptext);
+ //$text[] = $this->snippet(LatexDocument::encodeText(' '.$vkey.$addText), 400);
+
+ if($sprTip!=21){
$text[] = (int)$vAnswer['cnt'];
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_valid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_valid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_valid, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
-
- /*} elseif ($counter == TEXT_MAX_ANSWER_LIMIT ) {
- echo '<tr id="'.$spid.'_'.$_sequence.'_'.$counter.'" name="valid_row_'.$_sequence.'">';
- echo '<td class="anl_bl anl_ac anl_br gray anl_dash_bt anl_dash_bb" colspan="'.(6+(int)SurveyAnalysis::$_HEADERS[$spid]['show_valid_percent']+((int)SurveyAnalysis::$_SHOW_LEGENDA*2)).'"> . . . Prikazujemo samo prvih '.TEXT_MAX_ANSWER_LIMIT.' veljavnih odgovorov!</td>';
- echo '</tr>';
- }*/
+ $text[] = LatexDocument::encodeText(self::formatNumber($_kumulativa, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ }
- $exportformat = $options['exportFormat'];
+ $exportformat = isset($options['exportFormat'])?$options['exportFormat']:null;
$brezHline = $this->getBrezHline($exportformat);
$texoutputValidAnswerVertical .= self::tableRow($text, $brezHline);
- //echo "Besedilo na koncu funkcije outputValidAnswerVertical:".$texoutputValidAnswerVertical."</br>";
return $texoutputValidAnswerVertical;
/* $counter++;
return $counter; */
@@ -1221,7 +1194,7 @@ class LatexAnalysisElement{
$options[$_oKey] = $_option;
}
- $exportformat = $options['exportFormat'];
+ $exportformat = isset($options['exportFormat'])?$options['exportFormat']:null;
$brezHline = $this->getBrezHline($exportformat);
$_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*$vAnswer['cnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
@@ -1236,17 +1209,17 @@ class LatexAnalysisElement{
//$_Z_MV = 1;
if($_Z_MV){
//echo "this->hideEmpty: ".$this->hideEmpty."</br>";
- //$text[] = $this->encodeText($lang['srv_anl_missing1']);
- //$text[] = '\multirow{ '.$vAnswer['cnt'].'}{*}{ '.$this->encodeText($lang['srv_anl_missing1']).' }';
+ //$text[] = LatexDocument::encodeText($lang['srv_anl_missing1']);
+ //$text[] = '\multirow{ '.$vAnswer['cnt'].'}{*}{ '.LatexDocument::encodeText($lang['srv_anl_missing1']).' }';
$text[] = '';
- $text[] = $this->encodeText($vkey.' (' . $vAnswer['text'].')');
+ $text[] = LatexDocument::encodeText($vkey.' (' . $vAnswer['text'].')');
- $text[] = $this->encodeText((int)$vAnswer['cnt']);
+ $text[] = LatexDocument::encodeText((int)$vAnswer['cnt']);
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = '';
$text[] = '';
@@ -1274,34 +1247,32 @@ class LatexAnalysisElement{
$options[$_oKey] = $_option;
}
- $exportformat = $options['exportFormat'];
+ $exportformat = isset($options['exportFormat'])?$options['exportFormat']:null;
$brezHline = $this->getBrezHline($exportformat);
$cssBck = ' '.SurveyAnalysis::$cssColors['text_' . ($counter & 1)];
- $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] / SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0;
+ $_percent = (SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] > 0 ) ? 100*(isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt']:0) / (isset(SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt']:null) : 0;
//$_brez_MV = ((int)SurveyAnalysis::$missingProfileData['display_mv_type'] === 0) ? TRUE : FALSE;
$_brez_MV = $this->hideEmpty;
if(!$_brez_MV){
$text = array();
- //$text[] = $this->encodeText($lang['srv_anl_missing1']);
$text[] = '';
- $text[] = $this->encodeText($lang['srv_anl_suma1']);
- //$text[] = $this->encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt']);
+ $text[] = LatexDocument::encodeText($lang['srv_anl_suma1']);
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt']);
$answer['cnt'] = SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] > 0 ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalidCnt'] : 0;
- $text[] = $this->encodeText((int)$answer['cnt']);
+ $text[] = LatexDocument::encodeText((int)$answer['cnt']);
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_percent, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = '';
$text[] = '';
$texoutputSumaInvalidAnswerVertical .= $this->tableRow($text, $brezHline);
}
- //echo $texoutputSumaInvalidAnswerVertical."</br>";
return $texoutputSumaInvalidAnswerVertical;
/* $counter++;
return $counter; */
@@ -1331,7 +1302,7 @@ class LatexAnalysisElement{
$brezHline = 0;
} */
- $exportformat = $options['exportFormat'];
+ $exportformat = isset($options['exportFormat'])?$options['exportFormat']:null;
$brezHline = $this->getBrezHline($exportformat);
$_brez_MV = $this->hideEmpty;
@@ -1340,10 +1311,10 @@ class LatexAnalysisElement{
$text = array();
$text[] = '';
- $text[] = $this->encodeText($lang['srv_anl_suma2']);
- $text[] = $this->encodeText((SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0));
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
- $text[] = $this->encodeText(self::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText($lang['srv_anl_suma2']);
+ $text[] = LatexDocument::encodeText((SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] ? SurveyAnalysis::$_FREQUENCYS[$_sequence]['allCnt'] : 0));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber('100', SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'), '%'));
$text[] = '';
$text[] = '';
@@ -1383,7 +1354,7 @@ class LatexAnalysisElement{
//Priprava parametrov za tabelo - konec
//zacetek latex tabele z obrobo za Drugo
- $pdfTable = 'tabularx';
+ $pdfTable = 'xltabular';
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
@@ -1396,8 +1367,8 @@ class LatexAnalysisElement{
/*Naslovni vrstici tabele*/
//prva vrstica tabele
- $texOutputOtherAnswers .= $this->encodeText($_variable['variable'])." & \multicolumn{5}{l|}{".$this->encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )')."} ".$this->texNewLine;
- //$texOutputOtherAnswers .= $this->encodeText($_variable['variable'])." & \multicolumn{5}{X|}{".$this->encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )')."} ".$this->texNewLine;
+ $texOutputOtherAnswers .= LatexDocument::encodeText($_variable['variable'])." & \multicolumn{5}{l|}{".LatexDocument::encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )')."} ".$this->texNewLine;
+ //$texOutputOtherAnswers .= LatexDocument::encodeText($_variable['variable'])." & \multicolumn{5}{X|}{".LatexDocument::encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )')."} ".$this->texNewLine;
if($export_format != 'xls'){
$texOutputOtherAnswers .= $this->horizontalLineTex; /*obroba*/
$brezHline = 1;
@@ -1415,8 +1386,8 @@ class LatexAnalysisElement{
//prva vrstica
/* $this->pdf->setFont('','b','6');
$this->pdf->ln(5);
- $this->pdf->MultiCell(18, $height, $this->encodeText($_variable['variable']), 1, 'C', 0, 0, 0 ,0, true);
- $this->pdf->MultiCell(162, $height, $this->encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )'), 1, 'L', 0, 1, 0 ,0, true); */
+ $this->pdf->MultiCell(18, $height, LatexDocument::encodeText($_variable['variable']), 1, 'C', 0, 0, 0 ,0, true);
+ $this->pdf->MultiCell(162, $height, LatexDocument::encodeText(SurveyAnalysis::$_HEADERS[$oAnswers['spid']]['variable'].' ('.$_variable['naslov'].' )'), 1, 'L', 0, 1, 0 ,0, true); */
//druga vrstica
/* $this->tableHeader();
@@ -1425,7 +1396,8 @@ class LatexAnalysisElement{
$counter = 1;
$_kumulativa = 0;
- if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'])> 0 ) {
+ $freg_seq = array_key_exists('valid', SurveyAnalysis::$_FREQUENCYS[$_sequence])?SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid']:null;
+ if (is_countable($freg_seq)&&count($freg_seq)> 0 ) {
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['valid'] AS $vkey => $vAnswer) {
if ($vAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
//$counter = self::outputValidAnswerVertical($counter,$vkey,$vAnswer,$_sequence,$spid,$_kumulativa,array('isOtherAnswer'=>true));
@@ -1439,7 +1411,7 @@ class LatexAnalysisElement{
if (count(SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'])> 0 ) {
$_Z_MV = !$this->hideEmpty;
if($_Z_MV){ //ce je potrebno izpisati tudi manjkajoce
- $texOutputOtherAnswers .= $this->encodeText($lang['srv_anl_missing1']);
+ $texOutputOtherAnswers .= LatexDocument::encodeText($lang['srv_anl_missing1']);
}
foreach (SurveyAnalysis::$_FREQUENCYS[$_sequence]['invalid'] AS $ikey => $iAnswer) {
if ($iAnswer['cnt'] > 0 ) { # izpisujemo samo tiste ki nisno 0
@@ -1457,7 +1429,7 @@ class LatexAnalysisElement{
$texOutputOtherAnswers .= self::outputSumaVertical($counter,$_sequence,$spid,array('isOtherAnswer'=>true, 'exportFormat'=>$export_format));
//zaljucek latex tabele za Drugo
- $texOutputOtherAnswers .= ($export_format == 'pdf' ? "\\end{tabularx}" : "\\end{tabular}");
+ $texOutputOtherAnswers .= ($export_format == 'pdf' ? "\\end{xltabular}" : "\\end{tabular}");
//zaljucek latex tabele za Drugo - konec
return $texOutputOtherAnswers;
@@ -1470,11 +1442,11 @@ class LatexAnalysisElement{
$naslov = array();
$naslov[] = '';
- $naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleAnswers']);
- $naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleFrekvenca']);
- $naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleOdstotek']);
- $naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleVeljavni']);
- $naslov[] = $this->encodeText($lang['srv_analiza_frekvence_titleKumulativa']);
+ $naslov[] = LatexDocument::encodeText($lang['srv_analiza_frekvence_titleAnswers']);
+ $naslov[] = LatexDocument::encodeText($lang['srv_analiza_frekvence_titleFrekvenca']);
+ $naslov[] = LatexDocument::encodeText($lang['srv_analiza_frekvence_titleOdstotek']);
+ $naslov[] = LatexDocument::encodeText($lang['srv_analiza_frekvence_titleVeljavni']);
+ $naslov[] = LatexDocument::encodeText($lang['srv_analiza_frekvence_titleKumulativa']);
$params = array('border' => 'TB', 'bold' => 'B', 'align2' => 'C');
@@ -1486,9 +1458,9 @@ class LatexAnalysisElement{
}
$tableHeader .= $this->tableRow($naslov, $brezHline);
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 90);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 90);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
- $height = 1; //$height = $this->getCellHeight($this->encodeText($arrayText[1]), 90);
+ $height = 1; //$height = $this->getCellHeight(LatexDocument::encodeText($arrayText[1]), 90);
//ce smo na prelomu strani
/* if( ($this->pdf->getY() + $height) > 270){
@@ -1509,9 +1481,10 @@ class LatexAnalysisElement{
}
//funkcija skrbi za izpis multicol celice
- function MultiColCellLatex($steviloVmesnihStolpcevPodvrstic=null, $text='', $odZacetka=0){
+ function MultiColCellLatex($steviloVmesnihStolpcevPodvrstic=null, $text='', $odZacetka=0, $export_format=null){
$tabela = '';
//echo "steviloVmesnihStolpcevPodvrstic: $steviloVmesnihStolpcevPodvrstic</br>";
+ //echo "format: $export_format</br>";
if($steviloVmesnihStolpcevPodvrstic==1){ //ce je 1, ne sme biti multicolumn{1}, saj so drugace tezave z izpisom
$tabela .= " & ".$text." ";
}else{
@@ -1519,10 +1492,19 @@ class LatexAnalysisElement{
$steviloArrayrulewidth = ($steviloVmesnihStolpcevPodvrstic-1);
if($odZacetka==0){
//$tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}{";//zacetek multicol
- $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol
+ if($export_format=='pdf'){
+ $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol
+ }elseif($export_format=='rtf'){
+ $tabela .= " & \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{C|}{";//zacetek multicol
+ }
+
}else{
//$tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{X|}{";//zacetek multicol
- $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol
+ if($export_format=='pdf'){
+ $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{>{\hsize=\dimexpr".$steviloVmesnihStolpcevPodvrstic."\hsize+".$steviloTabColSep."\\tabcolsep+".$steviloArrayrulewidth."\arrayrulewidth\\relax}C|}{";//zacetek multicol
+ }elseif($export_format=='rtf'){
+ $tabela .= " \multicolumn{".$steviloVmesnihStolpcevPodvrstic."}{C|}{";//zacetek multicol
+ }
}
$tabela .= $text;
if($odZacetka==0){
@@ -1546,7 +1528,7 @@ class LatexAnalysisElement{
$tabela .= '\multirow{'.$steviloVmesnihVrstic.'}{*}{'; //zacetek multirow
}
$tabela .= $text;
- /* if($cols==0 && $text==$this->encodeText($lang['srv_analiza_crosstab_skupaj'])){ //premaknil nize, ker je delalo težave pri izpisu daljsih tabel
+ /* if($cols==0 && $text==LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])){ //premaknil nize, ker je delalo težave pri izpisu daljsih tabel
$tabela .= ' & ';
} */
//if($steviloVmesnihVrstic > 1){ //ce je potrebno multirow prikazovanje
@@ -1554,7 +1536,7 @@ class LatexAnalysisElement{
$tabela .= '}'; //konec multirow
}
- if($cols==0 && $text==$this->encodeText($lang['srv_analiza_crosstab_skupaj'])){
+ if($cols==0 && $text==LatexDocument::encodeText($lang['srv_analiza_crosstab_skupaj'])){
$tabela .= ' & ';
}
//echo $tabela."</br>";
@@ -1575,21 +1557,14 @@ class LatexAnalysisElement{
return $tabela;
}
- //function tableRow($arrayText, $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0, $steviloPodstolpcev){
- //function tableRow($arrayText, $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0, $color='', $export_format, $steviloPodstolpcev){
+
function tableRow($arrayText=[], $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0, $color='', $export_format='', $steviloPodstolpcev=[]){
$tableRow = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 90);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 90);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
- $height = 1; //$height = $this->getCellHeight($this->encodeText($arrayText[1]), 90);
-/* echo $arrayText[0]."</br>";
- echo $arrayText[1]."</br>";
- echo "brez hline: ".$brezHline."</br>"; */
-
- if($arrayParams['align2'] != 'C')
- $arrayParams['align2'] = 'L';
- //echo "velikost polja s tekstom: ".count($arrayText)."</br>";
-
+ $height = 1; //$height = $this->getCellHeight(LatexDocument::encodeText($arrayText[1]), 90);
+
+ $cellBgColor = '';
if($export_format == 'pdf'){
if($color=='blue'){
//$cellBgColor = 'cyan';
@@ -1787,35 +1762,33 @@ class LatexAnalysisElement{
//echo "funkcija displayDescriptivesSpremenljivkaRow: ".$spremenljivka['variable']." </br>";
$texDisplayDescriptivesSpremenljivkaRow = '';
if ($_sequence != null) {
- $_desc = SurveyAnalysis::$_DESCRIPTIVES[$_sequence];
+ $_desc = isset(SurveyAnalysis::$_DESCRIPTIVES[$_sequence])?SurveyAnalysis::$_DESCRIPTIVES[$_sequence]:null;
}
$text = array();
- $text[] = '\textbf{'.$this->encodeText($spremenljivka['variable']).'}';
- $text[] = '\textbf{'.$this->encodeText($spremenljivka['naslov']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($spremenljivka['variable']).'}';
+ $text[] = '\textbf{'.LatexDocument::encodeText($spremenljivka['naslov']).'}';
#veljavno
- $text[] = $this->encodeText((!$show_enota ? (int)$_desc['validCnt'] : ''));
+ $text[] = LatexDocument::encodeText((!$show_enota ? (int)(isset($_desc['validCnt'])?$_desc['validCnt']:0) : ''));
#ustrezno
- $text[] = $this->encodeText((!$show_enota ? (int)$_desc['allCnt'] : ''));
+ $text[] = LatexDocument::encodeText((!$show_enota ? (int)(isset($_desc['allCnt'])?$_desc['allCnt']:0) : ''));
if (isset($_desc['avg']) && (int)$spremenljivka['skala'] !== 1)
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
- $text[] = $this->encodeText(self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
else
- $text[] = $this->encodeText('');
+ $text[] = LatexDocument::encodeText('');
if (isset($_desc['div']) && (int)$spremenljivka['skala'] !== 1)
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
- $text[] = $this->encodeText(self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
else
- $text[] = $this->encodeText('');
+ $text[] = LatexDocument::encodeText('');
- //$text[] = $this->encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['min'] : '');
- //$text[] = $this->encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['max'] : '');
- $text[] = (int)$spremenljivka['skala'] !== 1 ? $_desc['min'] : '';
- $text[] = (int)$spremenljivka['skala'] !== 1 ? $_desc['max'] : '';
+ $text[] = (int)(isset($spremenljivka['skala'])?$spremenljivka['skala']:0) !== 1 ? (isset($_desc['min'])?$_desc['min']:0) : '';
+ $text[] = (int)(isset($spremenljivka['skala'])?$spremenljivka['skala']:0) !== 1 ? (isset($_desc['max'])?$_desc['max']:0) : '';
//$texDisplayDescriptivesSpremenljivkaRow .= $this->descTableRow($text);
@@ -1836,55 +1809,50 @@ class LatexAnalysisElement{
$texDescriptivesVariablaRow = '';
$_sequence = $variable['sequence']; # id kolone z podatki
if ($_sequence != null) {
- $_desc = SurveyAnalysis::$_DESCRIPTIVES[$_sequence];
+ $_desc = isset(SurveyAnalysis::$_DESCRIPTIVES[$_sequence])?SurveyAnalysis::$_DESCRIPTIVES[$_sequence]:null;
}
$text = array();
- $text[] = $this->encodeText($variable['variable']);
- $text[] = $this->encodeText($variable['naslov']);
+ $text[] = LatexDocument::encodeText($variable['variable']);
+ $text[] = LatexDocument::encodeText($variable['naslov']);
#veljavno
- $text[] = $this->encodeText((int)$_desc['validCnt']);
+ $text[] = LatexDocument::encodeText((int)(isset($_desc['validCnt'])?$_desc['validCnt']:0));
#ustrezno
- $text[] = $this->encodeText((int)$_desc['allCnt']);
+ $text[] = LatexDocument::encodeText((int)(isset($_desc['allCnt'])?$_desc['allCnt']:0));
- //if (isset($_desc['avg']) && (int)$spremenljivka['skala'] !== 1)
- //if (isset($_desc['avg']) && (int)$spremenljivka['skala'] !== 1 && $spremenljivka['tip'] != 16)
if (isset($_desc['avg']) && (int)$spremenljivka['skala'] !== 1 && ($spremenljivka['tip'] != 16 && $spremenljivka['tip'] != 2))
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
- $text[] = $this->encodeText(self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_desc['avg'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),''));
//else if (isset($_desc['avg']) && $spremenljivka['tip'] == 2 && (int)$spremenljivka['skala'] == 1 )
else if (isset($_desc['avg']) && $spremenljivka['tip'] == 2 && (int)$spremenljivka['skala'] !== 1 && ($spremenljivka['tip'] != 16))
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'));
- $text[] = $this->encodeText(self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'));
else
- $text[] = $this->encodeText('');
+ $text[] = LatexDocument::encodeText('');
- //if (isset($_desc['div']) && (int)$spremenljivka['skala'] !== 1)
- //if (isset($_desc['div']) && (int)$spremenljivka['skala'] !== 1 && $spremenljivka['tip'] != 16)
if (isset($_desc['div']) && (int)$spremenljivka['skala'] !== 1 && ($spremenljivka['tip'] != 16 && $spremenljivka['tip'] != 2))
- //$text[] = $this->encodeText(SurveyAnalysis::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
- $text[] = $this->encodeText(self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
+ //$text[] = LatexDocument::encodeText(SurveyAnalysis::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
+ $text[] = LatexDocument::encodeText(self::formatNumber($_desc['div'],SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_DEVIATION'),''));
else
- $text[] = $this->encodeText('');
+ $text[] = LatexDocument::encodeText('');
- //if ((int)$spremenljivka['skala'] !== 1 && $spremenljivka['tip'] != 16){
- if ((int)$spremenljivka['skala'] !== 1 && ($spremenljivka['tip'] != 16 && $spremenljivka['tip'] != 2)){
- $text[] = $this->encodeText($_desc['min']);
- $text[] = $this->encodeText($_desc['max']);
+ if ((int)(isset($spremenljivka['skala'])?$spremenljivka['skala']:0) !== 1 && ($spremenljivka['tip'] != 16 && $spremenljivka['tip'] != 2)){
+ $text[] = LatexDocument::encodeText(isset($_desc['min'])?$_desc['min']:0);
+ $text[] = LatexDocument::encodeText(isset($_desc['max'])?$_desc['max']:0);
}else{
- $text[] = $this->encodeText('');
- $text[] = $this->encodeText('');
+ $text[] = LatexDocument::encodeText('');
+ $text[] = LatexDocument::encodeText('');
}
- //$text[] = $this->encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['min'] : '');
- //$text[] = $this->encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['max'] : '');
+ //$text[] = LatexDocument::encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['min'] : '');
+ //$text[] = LatexDocument::encodeText((int)$spremenljivka['skala'] !== 1 ? $_desc['max'] : '');
$texDescriptivesVariablaRow .= $this->tableRow($text);
- //echo "nekaj: ".$this->encodeText(self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'))." ".$spremenljivka['tip']."</br>";
+ //echo "nekaj: ".LatexDocument::encodeText(self::formatNumber($_desc['avg']*100,SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'),'&nbsp;%'))." ".$spremenljivka['tip']."</br>";
//echo "tex iz funkcije displayDescriptivesVariablaRow: ".$texDescriptivesVariablaRow."</br>";
return $texDescriptivesVariablaRow;
}
@@ -2019,4 +1987,182 @@ class LatexAnalysisElement{
return $brezHline;
}
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati ######################################
+ function getImageName($text='', $sprId=null, $findme='', $vre_id=0, $img_id=0){
+ global $site_path, $site_url;
+ $imageName = '';
+ //echo "id slike $img_id </br>";
+ if($text == 'hotspot' && $findme == 'hotspot_image='){
+ $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
+ $rowParametrov = mysqli_fetch_row($sqlParametrov);
+ $text = $rowParametrov[0];
+ }
+
+ $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
+ //echo "text za echo: ".$text."</br>";
+ //if($pos!=''){ //ce je slika v bazi
+ if($pos!=''||$pos==0){ //ce je slika v bazi
+ $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
+ //echo "imageName prej: ".$imageName."</br>";
+
+ //$findme = $site_path.'uploadi/editor/';
+ $findme = $site_url.'uploadi/editor/';
+ //$findme = 'uploadi/editor/';
+ //$findme = 'editor/';
+ //echo "findme: ".$findme."</br>";
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta v $findme
+ //echo "najdi tole: ".$findme."</br>";
+ //echo "najdi tukaj: ".$imageName."</br>";
+ //echo "pozicija tega: ".$pos."</br>";
+ if($pos){ //ce je slika na strezniku
+ $slikaNaStrezniku = 1;
+ }else{//ce slike ni na strezniku
+ $slikaNaStrezniku = 0;
+ }
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==1){ //ce je slika na strezniku
+ $findEditor = 'editor/';
+ $posEditor = strpos($imageName, $findEditor); //najdi pozicijo teksta v $findEditor
+ $imageName = substr($imageName,$posEditor+7); //pokazi le del params od besedila 'editor/' dalje, brez besedila 'editor/'
+ //echo "imagename : ".$imageName."</br>";
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif)
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+
+ $path = $site_path.'uploadi/editor/'.$imageName;
+ //$path = $site_url.'uploadi/editor/'.$imageName;
+
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }
+
+ if($imageExtension == 'jpg' || $imageExtension == 'peg'){ //ce je slika jpg ali jpeg, jo je potrebno pretvoriti v png
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }elseif($slikaNaStrezniku==0){ //ce slike ni na strezniku
+ //echo "vre_id: $vre_id </br>";
+ $imageName = $this->getOnlineImageName($imageName, $slikaNaStrezniku, $vre_id, $img_id); //pridobi njen URL
+ }
+
+ $imageName = substr($imageName, 0, strrpos($imageName, '.'));
+
+ }
+
+ //echo "imagename pred return: ".$imageName."</br>";
+ return $imageName;
+ }
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati - konec ###############################
+ function getEndPosition($imageName=''){
+ $findme = '"';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta '"'
+ return $pos;
+ }
+
+ function convertGifToPng($path='', $slikaNaStrezniku=null){
+ //echo "path: ".$path."</br>";
+ $image = imagecreatefromgif($path); //pripravi sliko iz gif za pretvorbo
+ $imageName = substr($path, 0, -3); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno gif sliko v png
+
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, GIF izbrisi
+ unlink($imageName.'gif'); //izbrisi gif sliko
+ }
+ }
+
+ function convertJpgToPng($path='', $slikaNaStrezniku=null, $imageExtension=''){
+ $image = imagecreatefromjpeg($path); //pripravi sliko iz jpg za pretvorbo
+ $imageName = substr($path, 0, strrpos($path, '.')); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'.png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno jpg sliko v png
+ //echo "pretvorba v png: ".$imageNamePNG."</br>";
+ //echo "xtens: ".$imageExtension."</br>";
+ //$origExtension = strrchr($path, '.');
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, izbrisi jo
+ //echo "tukaj </br>";
+ if($imageExtension == 'jpg'){
+ unlink($imageName.'.'.$imageExtension); //izbrisi sliko
+ }elseif($imageExtension == 'peg'){
+ unlink($imageName.'.j'.$imageExtension); //izbrisi sliko
+ }
+ }
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike ######################################
+ function getOnlineImageName($imageName='', $slikaNaStrezniku=null, $vre_id=null, $img_id=0){
+ global $site_path;
+ //echo "imageName v getOnlineImageName nekje vmes 1: ".$imageName."</br>";
+ $row = Cache::srv_spremenljivka(self::$spremenljivka);
+ //echo "sprem: ".self::$spremenljivka."</br>";
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ //echo "params: ".$spremenljivkaParams->get('hotspot_image')."</br>";
+ $imageNameTmp = $spremenljivkaParams->get('hotspot_image');
+ //if($imageNameTmp!=''){ //ce je hotspot
+ if($imageNameTmp!=''&&$vre_id==0){ //ce je hotspot
+ $imageName = $imageNameTmp;
+ }
+
+ $findHttp = 'http';
+ $posHttp = strpos($imageName, $findHttp);
+ $imageName = substr($imageName,$posHttp); //besedilo do zacetka http
+
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+ //echo "imageName v getOnlineImageName nekje vmes 2: ".$imageName."</br>";
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike
+ //echo "imageExtension: ".$imageExtension."</br>";
+
+ //if($imageExtension!='jpg'&&$imageExtension!='png'&&$imageExtension!='gif'&&$imageExtension!='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ if($imageExtension=='jpg'||$imageExtension=='gif'||$imageExtension=='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ //echo "spremeni extension </br>";
+ $imageExtension='png';
+ }
+
+ if($vre_id){ //ce se pridobiva imena tmp slik iz vrednosti vprasanja
+ //$imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }else{
+ //$imgFilename = self::$spremenljivka.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }
+
+ $pathDir = $site_path.'uploadi/editor/'; //pot za novo mapo, kjer se bodo shranjevale slike za trenutno anketo
+ $path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+ # ukaz za pretakanje slike
+ if(IS_WINDOWS){
+ //za windows sisteme //powershell -command "& { iwr URL -OutFile 'PATH' }"
+ $command = 'powershell -command "& { iwr \''.$imageName.'\' -OutFile \''.$path.'\' }"';
+ //$command = 'wget -O \''.$imageName.'\' -O '.$path.' ';
+ }elseif(IS_LINUX){
+ //za linux sisteme //exec('wget URL -P PATH ');
+ //$command = 'wget \''.$imageName.'\' -P '.$path.' ';
+ $command = 'wget -O '.$path.' \''.$imageName.'\' ';
+ //echo "ukaz za pobiranje: $command </br>";
+ }
+
+ //echo "command: ".$command."</br>";
+ exec($command); //pretoci sliko
+
+ //$path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+/* if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ } */
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ if($imageExtension != 'png'){ //ce slika ni png, jo pretvori
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }else{
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }
+
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ return $imgFilename;
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike - konec ###############################
+
} \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/class.LatexDocument.php b/admin/survey/export/latexclasses/class.LatexDocument.php
index dce1108..63b6cac 100644
--- a/admin/survey/export/latexclasses/class.LatexDocument.php
+++ b/admin/survey/export/latexclasses/class.LatexDocument.php
@@ -99,8 +99,10 @@ omenjeno kodo je potrebno deliti z 255, da dobimo stevilke, ki ustrezajo Latex =
include('../../vendor/autoload.php');
define("ENKA_LOGO_SIZE", 'width=3.51cm,height=2cm,keepaspectratio');
define("ENKA_LOGO_SIZE_HEADER", 'width=1.75cm,height=1cm,keepaspectratio');
+define("ENKA_LOGO_SIZE_HEADER_RTF", 'width=40cm,keepaspectratio');
define("SINGLE_TABLE_WIDTH", 3000);
define("PAGE_TEXT_WIDTH", 10200); //17 cm, 170 mm, je 10200 twips, 1 mm je 60 twips
+if (!defined("MAX_STRING_LENGTH")) define("MAX_STRING_LENGTH", 90);
#definicija za izris drsnika s kroglico
define ("circleSlider", '\def\circleSLIDER#1#2{% 1: length, 2: position of the mark (0 to 1)
@@ -142,7 +144,7 @@ class LatexDocument{
var $grupa = null; // trenutna grupa
var $usrId = null; // trenutni user
- var $spremenljivka = null; // trenutna spremenljivka
+ protected static $spremenljivka = null; // trenutna spremenljivka
//spremenljivke za Nastavitve pdf/rtf izvozov
var $export_font_size = 10;
@@ -173,7 +175,7 @@ class LatexDocument{
var $commentType = 1; // tip izpisa komentarjev
- var $texNewLine = '\\\\ ';
+ public static $texNewLine = '\\\\ ';
protected $isAnswer = '';
protected $isAnswerBreakPodVprasanjem = '';
@@ -181,6 +183,10 @@ class LatexDocument{
protected $pathToTexFile;
protected $path2Images;
+
+ protected $export_show_recnum;
+
+ protected $path2UploadedImages;
protected $language = -1; // Katero verzijo prevoda izvazamo
protected $usr_id; //id respondenta
@@ -200,9 +206,11 @@ class LatexDocument{
public function createDocument($export_type='', $export_subtype='', $export_format='', $sprID = null){
global $lang, $site_path;
- $this->usr_id = $_GET['usr_id'];
+ $this->usr_id = isset($_GET['usr_id'])?$_GET['usr_id']:null;
if($export_subtype=='heatmap_image'){ //ce je potrebno zgenerirati sliko heatmap
- $this->HeatmapImage($_GET['sprID']);
+ //$this->HeatmapImage($_GET['sprID']);
+ $spr_heatmap = isset($_GET['sprID'])?$_GET['sprID']:null;
+ $this->HeatmapImage($spr_heatmap);
return;
}
@@ -232,16 +240,8 @@ class LatexDocument{
$surveyId = SurveyInfo::getSurveyId();
################################################
#spremenljivke################################################################# konec
-
- /*echo 'export_type: '.$export_type.'</br>';
- echo 'export_subtype: '.$export_subtype.'</br>';
- echo 'export_format: '.$export_format.'</br>';
- echo 'anketaID: '.$_GET['anketa'].'</br>';
- /*echo 'sprID: '.$_GET['sprID'].'</br>';
- echo '$this->export_font_size: '.$this->export_font_size.'</br>';
- echo '$this->export_data_type: '.$this->export_data_type.'</br>';
- echo 'SurveyId: '.SurveyInfo::getSurveyId().'</br>'; */
+ //$time_start = microtime(true);
#za pridobitev jezika respondenta
//pridobitev splosnega jezika ankete za respondenta nastavitev=> Osnovni jezik za respondente:
$sqlL = sisplet_query("SELECT lang_resp FROM srv_anketa WHERE id='$this->anketa' ");
@@ -250,7 +250,7 @@ class LatexDocument{
############testiranje za jezik
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
//echo "jezik test: ".$this->language."</br>";
// Naložimo jezikovno datoteko
$file = '../../lang/'.$this->language.'.php';
@@ -259,12 +259,18 @@ class LatexDocument{
}
############testiranje za jezik - konec
+ //$time_end = microtime(true);
+ //$execution_time = ($time_end - $time_start)/60;
+ //echo '<b>Total Execution Time:</b> '.$execution_time.' Mins';
+
if ($this->usr_id != '') { //ce je izpis za dolocenega respondenta
$sqlL = sisplet_query("SELECT language FROM srv_user WHERE id = '$this->usr_id ' AND ank_id='$this->anketa' ");
$rowL = mysqli_fetch_array($sqlL);
$this->language = $rowL['language'];
$lang['id'] = $this->language;
}
+ //echo "jezik: ".$this->language."</br>";
+ //$this->language = 1; //rocno dodal, da uredim polja stevil, saj iz baze pobira 0 (???)
#za pridobitev jezika respondenta - konec
//Tex preamble in zacetek latex dokumenta
@@ -272,7 +278,7 @@ class LatexDocument{
//Dodatek h kodi, da bo črka đ vidna v pdf
if($export_format == 'pdf'){
- $tex .= "\\fontencoding{T1}\selectfont \n";
+ //$tex .= "\\fontencoding{T1}\selectfont \n";
}
if($export_format != 'xls'){ //ce ni xls
@@ -307,7 +313,7 @@ class LatexDocument{
{
case 'survey':
$survey = new LatexSurvey($this->anketa, $export_format, $this->export_show_intro, $this->export_show_if, $this->export_data_skip_empty, $this->export_data_skip_empty_sub);
- //$tex .= $survey->displaySurvey($export_subtype);
+
switch ( $export_subtype )
{
case 'q_empty':
@@ -342,48 +348,6 @@ class LatexDocument{
case 'other':
if($export_subtype == 'edits_analysis'){
-/* if ($_GET['seansa'] > 0){
- //if (isset ($_GET['seansa'])){
- $seansa = $_GET['seansa'];
- }else{
- $seansa = '30';
- }
- if (isset ($_GET['time'])){
- $time = $_GET['time'];
- }else{
- $time = '1 month';
- }
- if (isset ($_GET['status'])){
- $status = $_GET['status'];
- }else{
- $status = 0;
- }
- if (isset ($_GET['from'])){
- $from = $_GET['from'];
- }else{
- $from = '';
- }
- if (isset ($_GET['to'])){
- $to = $_GET['to'];
- }else{
- $to = '';
- }
- if (isset ($_GET['user'])){
- $user = $_GET['user'];
- }else{
- $user = 'all';
- }
- if (isset ($_GET['period'])){
- $period = $_GET['period'];
- }else{
- $period = 'day';
- }
- //print_r($_GET);
- //print_r($_POST);
- if (isset ($_GET['seansa'])){
- echo "seansa iz get: ".$_GET['seansa']."</br>";
- } */
-
//$editAnalysis = new LatexEditsAnalysis($this->anketa, $seansa, $time, $status, $from, $to, $user, $period);
$editAnalysis = new LatexEditsAnalysis($this->anketa);
$tex .= $editAnalysis->displayEditAnalysis();
@@ -477,11 +441,11 @@ class LatexDocument{
/********************* END TEST *****************************/
//brisanje temp datotek tex
- unlink($filenameTex); //tex
- unlink($filename.".aux"); //aux
- unlink($filename.".log"); //log
- unlink($filename.".pdf"); //pdf
- unlink($filename.".out"); //out
+ file_exists($filenameTex)?unlink($filenameTex):null; //tex
+ file_exists($filename.".aux")?unlink($filename.".aux"):null; //aux
+ file_exists($filename.".log")?unlink($filename.".log"):null; //log
+ file_exists($filename.".pdf")?unlink($filename.".pdf"):null; //pdf
+ file_exists($filename.".out")?unlink($filename.".out"):null; //out
//brisanje temp datotek tex - konec
//brisanje temp slikovnih datotek
@@ -497,7 +461,7 @@ class LatexDocument{
#####################################################################################################
function InitDocumentVars($export_type='', $export_subtype='', $export_format='')
{
- global $site_path;
+ global $site_path, $site_url;
global $lang;
$baseLineSkip = intval($this->export_font_size*1.2);
@@ -528,7 +492,8 @@ class LatexDocument{
############testiranje za jezik
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ //$this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
//echo "jezik test: ".$this->language."</br>";
// Naložimo jezikovno datoteko
$file = '../../lang/'.$this->language.'.php';
@@ -583,45 +548,6 @@ class LatexDocument{
#Nastavitve pdf/rtf izvozov################################################################konec
}
- //echo "export show if: ".$this->export_show_if."</br>";
- //echo "export type: ".$export_type." subtype: ".$this->export_subtype."</br>";
- #### pokomentiral, ker z uporabo template ni vec potrebno in ker po novih specifikacijah je velikost pisave in razmik med vrsticami predefiniran
-/* if($export_type == 'analysis'||$export_type == 'status'||$export_type == 'other'){ //ce je izpis analize ALI status ALI drugo
- if($export_type == 'analysis'){
- $tableAnalysisEnvironment = ' \newenvironment{tableAnalysis}
- {\parindent0pt \fontsize{6}{'.$baseLineSkip.'} \selectfont }
- { }';
- if($export_format == 'xls' || $export_format == 'pdf'){
- $lTablex = '\usepackage{ltablex}';
- }
- //$linespread = 1.15;
- $linespread = 1.5;
- //}elseif($export_type == 'status'){
- }elseif($export_type == 'status'||$export_subtype == 'edits_analysis'){
- $tableStatusEnvironment = ' \newenvironment{tableStatus}
- {\parindent0pt \fontsize{8}{'.$baseLineSkip.'} \selectfont }
- { }';
- //$linespread = 0.8;
- $linespread = 1;
- }
- }else{
- $tableAnalysisEnvironment = '';
- $tableStatusEnvironment = '';
- $lTablex = ''; //ce je ltablex prisoten pri survey izvozih, so tezave
- //$linespread = 1.15;
- $linespread = 1.5;
- }
- if($this->export_data_landscape==1||($export_type=='analysis'&&($this->export_subtype=='crosstab'||$this->export_subtype=='mean'||$this->export_subtype=='ttest'||$this->export_subtype=='multicrosstab')||$this->export_subtype=='break'||$this->export_subtype=='chart'||$this->export_subtype=='creport'||$this->export_subtype=='status')){ //ce je postavitev landscape ALI je izvoz analiz in (Tabele ali Povprecja ali T-test ali Multitabele ali razbitje)
- $landscapePostavitev = "landscape";
- $visinaTeksta = 210;
- $sirinaTeksta = 294;
- $hSize = '\hsize='.$sirinaTeksta.'mm';
- }else{
- $landscapePostavitev = "portrait";
- $visinaTeksta = 294;
- $hSize = '';
- } */
- #### pokomentiral, ker z uporabo template ni vec potrebno in ker po novih specifikacijah je velikost pisave in razmik med vrsticami predefiniran - konec
if($export_format == 'pdf'){
####################################
@@ -632,7 +558,6 @@ class LatexDocument{
\graphicspath{ {'.$site_path.'admin/survey/export/latexclasses/textemp/images/}, {'.$site_path.'uploadi/editor/}, {'.$site_path.'main/survey/uploads/}, {'.$site_path.'admin/survey/pChart/Cache/} }
\begin{document}
';
- //}elseif($this->export_data_landscape==1||($export_type=='analysis'&&($this->export_subtype=='crosstab'||$this->export_subtype=='mean'||$this->export_subtype=='ttest'||$this->export_subtype=='multicrosstab')||$this->export_subtype=='break'||$this->export_subtype=='chart'||$this->export_subtype=='creport'||$this->export_subtype=='status')||($export_type=='other'&&$export_subtype == 'edits_analysis')){ //ce je potreben landscape pogled
}elseif(($export_type=='analysis'&&($this->export_subtype=='crosstab'||$this->export_subtype=='mean'||$this->export_subtype=='ttest'||$this->export_subtype=='multicrosstab')||$this->export_subtype=='break'||$this->export_subtype=='chart'||$this->export_subtype=='creport'||$this->export_subtype=='status')||($export_type=='other'&&$export_subtype == 'edits_analysis')){ //ce je potreben landscape pogled
$this->head = '
\documentclass{latexTemplatePdfAnalysisAndOtherLandscape} %include datoteke s template
@@ -688,23 +613,18 @@ class LatexDocument{
#################################### tex preamble + zacetek dokumenta za rtf - konec
####################################
//definiranje ukaza za glave in noge za rtf
- /*ima 5 vhodnih podatkov:
- 1. ime ankete v glavi levo;
- 2. logo 1KA v glavi na desni;
- 3. besedilo "Stran" v nogi na desni;
- 4. velikost logo 1KA v glavi na desni;
- 5. datum generiranja izvoza v nogi na levi.
+ /*ima 7 vhodnih podatkov:
+ 1. ime ankete v glavi;
+ 2. logo 1KA v glavi;
+ 3. besedilo "Stran" v nogi ;
+ 4. velikost logo 1KA v glavi;
+ 5. datum generiranja izvoza v nogi na levi;
+ 6. identifikator respondenta;
+ 7. url korenske spletne strani.
*/
- /* $this->headerAndFooter = '
- \\newcommand{\headerfooter}[5]{
- \\lhead{\\includegraphics[scale=#4]{#2} #1}
- \\lfoot{www.1ka.si}
- \\rfoot{#3 \\thepage}
- }
- '; */
-
+
+ $recnumBesedilo = "";
if($this->usr_id){
- //echo "usr id: ".$this->usr_id;
$recnum = $this->getRecnum();
if($recnum && (int)SurveySetting::getInstance()->getSurveyMiscSetting('export_data_show_recnum')){
$recnumBesedilo = "(Recnum $recnum)";
@@ -712,22 +632,13 @@ class LatexDocument{
$recnumBesedilo = "";
}
}
-
$this->headerAndFooter = '
- \\newcommand{\headerfooter}[6]{
- \\lhead{\\includegraphics[scale=#4]{#2} #1 '.$recnumBesedilo.'}
- \\lfoot{www.1ka.si}
+ \\newcommand{\headerfooter}[7]{
+ \\lhead{#1 '.$recnumBesedilo.' \\includegraphics[#4]{#2}}
+ \\lfoot{#7}
\\rfoot{#3 \\thepage}
}
';
-/* $this->headerAndFooter = '
- \\newcommand{\headerfooter}[5]{
- \\lhead{#1}
- \\rhead{\\includegraphics[scale=#4]{#2}}
- \\lfoot{www.1ka.si}
- \\rfoot{#3 \\thepage}
- }
- '; */
#################################### definiranje ukaza za glave in noge za rtf - konec
}
@@ -743,10 +654,10 @@ class LatexDocument{
//Funkcija za izris glave in noge za pdf ######################################
function GenerateHeaderFooter($imeAnkete='', $stranDokumenta=null, $datumGeneriranjaIzvoza='', $export_format=''){
- global $lang, $site_path;
+ global $lang, $site_path, $site_url;
//Definiranje ukaza
$tex = $this->headerAndFooter; //definiranje ukaza za glavo in nogo dokumenta
-
+ $recnumBesedilo = "";
//izbira ustreznega logotipa za določen jezik
if($lang['id'] == 1){ //ce je id 1, naj bo slovenski
$logo1ka = 'logo1ka';
@@ -766,8 +677,15 @@ class LatexDocument{
}
}
- //Izris glave in noge s predefiniranim ukazom za pdf
- $tex .= "\headerfooter{".$imeAnkete."}{".$this->path2Images."".$logo1ka."}{".$stranDokumenta."}{".ENKA_LOGO_SIZE_HEADER."}{".$datumGeneriranjaIzvoza."}{".$recnumBesedilo."}";
+ //Izris glave in noge s predefiniranim ukazom
+ if($export_format == 'rtf'){
+ $enka_logo_size_header = ENKA_LOGO_SIZE_HEADER_RTF;
+ }else{
+ $enka_logo_size_header = ENKA_LOGO_SIZE_HEADER;
+ }
+
+
+ $tex .= "\headerfooter{".$imeAnkete."}{".$this->path2Images."".$logo1ka."}{".$stranDokumenta."}{".$enka_logo_size_header."}{".$datumGeneriranjaIzvoza."}{".$recnumBesedilo."}{".$site_url."}";
return $tex;
}
@@ -791,7 +709,6 @@ class LatexDocument{
$logo1ka = 'logo1kaeng';
}
//izbira ustreznega logotipa za določen jezik - konec
- //echo "stevilo spremenljivk: ".(SurveyInfo::getSurveyVariableCount());
$steviloSpremenljivk = SurveyInfo::getSurveyVariableCount();
@@ -801,17 +718,8 @@ class LatexDocument{
//klicanje latex funkcije za generiranje naslovnice
$tex .= '
\naslovnica
- {'.ENKA_LOGO_SIZE.', right}
- {'.$logo1ka.'}
- {'.$imeAnkete.'}
- {'.$vsiOdgovoriBesedilo.'}
- {\MakeUppercase{{'.$kratkoImeAnketeBesedilo.'}}: & {'.$kratkoImeAnkete.'}}
- {\MakeUppercase{{'.$steviloVprasanjNaslovnicaBesedilo.'}}: & {'.$steviloVprasanjNaslovnica.'} \\\\
- & \\\\
- \MakeUppercase{{'.$lang['srv_usableResp_qcount'].'}}: & {'.$steviloSpremenljivk.'}}
- {\MakeUppercase{{'.$lang['srv_displaydata_status'].'}}: & {'.$activityTex.'}}
- {\MakeUppercase{{'.$avtorNaslovnicaBesedilo.'}}: & {'.$avtorNaslovnica.', '.$anketaUstvarjenaNaslovnica.'}}
- {\MakeUppercase{{'.$avtorSpremenilNaslovnicaBesedilo.'}}: & {'.$avtorSpremenilNaslovnica.', '.$anketaSpremenjenaNaslovnica.'}}
+ {'.ENKA_LOGO_SIZE.', right}{'.$logo1ka.'}{'.$imeAnkete.'}{'.$vsiOdgovoriBesedilo.'}{\MakeUppercase{{'.$kratkoImeAnketeBesedilo.'}}: & {'.$kratkoImeAnkete.'}}{\MakeUppercase{{'.$steviloVprasanjNaslovnicaBesedilo.'}}: & {'.$steviloVprasanjNaslovnica.'} \\\\
+ & \\\\\MakeUppercase{{'.$lang['srv_usableResp_qcount'].'}}: & {'.$steviloSpremenljivk.'}}{\MakeUppercase{{'.$lang['srv_displaydata_status'].'}}: & {'.$activityTex.'}}{\MakeUppercase{{'.$avtorNaslovnicaBesedilo.'}}: & {'.$avtorNaslovnica.', '.$anketaUstvarjenaNaslovnica.'}}{\MakeUppercase{{'.$avtorSpremenilNaslovnicaBesedilo.'}}: & {'.$avtorSpremenilNaslovnica.', '.$anketaSpremenjenaNaslovnica.'}}
';
#################################### //tex za pdf naslovnico - konec
}else if($export_format == 'rtf'){
@@ -851,7 +759,7 @@ class LatexDocument{
###########################################
//Funkcija za pridobitev aktiviranosti ankete
- function GetAktiviranostAnkete($activity=''){
+ function GetAktiviranostAnkete($activity=null){
global $lang;
$tex = '';
$_last_active = end($activity);
@@ -882,16 +790,18 @@ class LatexDocument{
# generating pdf file //ukaz je potrebno zagnati 2x, ker drugace ne pride do koncnega stevila strani, ki se nahaja v nogi, poleg trenutne strani
chdir($this->pathToTexFile);
+
if(IS_WINDOWS){
//za windows sisteme
$ukaz = 'latexmk -pdf '.$filenameTex;
//$ukaz = "latexmk -silent -f -pdf -e \'$max_repeat=2\' -pdflatex=\"/usr/bin/pdflatex -interaction=batchmode \"". $filenameTex;
exec($ukaz);
- }elseif(IS_LINUX){
+ }
+ elseif(IS_LINUX){
//za linux sisteme
- exec("/usr/bin/pdflatex ".$filenameTex);
+ exec("/usr/bin/xelatex --no-shell-escape ".$filenameTex);
+ //exec("/usr/bin/pdflatex ".$filenameTex);
//exec("/usr/bin/buf_size=2000000 pdflatex ".$filenameTex);
-
}
# generating pdf file - konec
@@ -984,12 +894,9 @@ class LatexDocument{
shell_exec($rtfGeneratingCommand);
# generating rtf file - konec
- //$filename = 'export_'.$this->export_subtype.'_'.$surveyId.'_'.$this->export_format;
$filename = 'export_'.$this->export_subtype.'_'.$surveyId.'_'.$this->export_format.'_'.$niPrijavljenUporabnik;
$filenameRtf = $filename.'.rtf';
- $file = $this->pathToTexFile.$filenameRtf;
- //$file = $filenameRtf;
- //echo "file: ".$file;
+ $file = $this->pathToTexFile.$filenameRtf;
#uredi sirino stolpca tabele glede na stevilo stolpcev v tabeli neposredno v rtf ############################################
$this->urediStolpceTabele($file);
@@ -1025,11 +932,6 @@ class LatexDocument{
//header('Content-Disposition: attachment;filename="'.basename($filename).'"');
#header-ji rtf datoteke - konec
- #Stara varianta
- //readfile($file);
- #Stara varianta - konec
-
- #nova varianta
set_time_limit(0);
$chunksize = 2 * (1024 * 1024); //5 MB (= 5 242 880 bytes) per one chunk of file.
//$fileD = @fopen($file,"r");
@@ -1040,7 +942,6 @@ class LatexDocument{
ob_flush();
flush();
}
- #nova varianta - konec
//brisanje temp datotek
unlink($file); //rtf
@@ -1348,76 +1249,423 @@ class LatexDocument{
return $recnum;
}
+
#funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno
- function encodeText($text=''){
+ public static function encodeText($text = '', $vre_id = 0, $no_br = 0, $img_id = 0, $variable_name = '', $no_par = 0){
global $site_path, $lang;
- //$text = str_replace(' ','X',$text); //nadomesti presledke
+
//echo "Encoding ".$text."</br>";
+
+ $text = htmlspecialchars_decode($text); //vse html special chars kot je &amp; spremeni v ustrezne simbole (npr. &amp;=>&)
+ $text = html_entity_decode($text);
+
+ //Pucanje html kode *****************************************************************
+ if($no_par){ //ce ne sme biti <p> tag
+ $allowed_tags = '<br><img><ul><ol><li>'; //Seznam dovoljenih html znack
+ }else{
+ $allowed_tags = '<br><img><p><ul><ol><li>'; //Seznam dovoljenih html znack
+ }
+
+
+ $text = strip_tags($text, $allowed_tags); //Odstranitev vseh znack, razen dovoljenih
+
+ $text = preg_replace('/(<[^>]+) style=".*?"/i', '$1', $text); //Pucanje stylinga iz znack, ki so ostale
+
+ //echo "Po pucanju".$text."</br>";
+ //Pucanje html kode - konec ********************************************************
+
+ $numOfUl = 0;
+
+ //resevanje razbirajanja predolgih neprekinjenih besed in URL - spremenljivke za kasnejsi prilagojen izpis - PREVERITI, CE JE SE POTREBNO GLEDE NA SKOK NA XELATEX - PATRIK 8.1.2024
+ $numOfSpacesPrej = substr_count($text, ' '); //stevilo presledkov v besedilu
+ $stringLength = strlen($text);
+
+ $findSpace = ' ';
+ $posSpace1 = strpos($text, $findSpace); //najdi pozicijo prvega presledka v besedilu
+ $posSpace2 = strripos($text, $findSpace); //najdi pozicijo zadnjega presledka v besedilu
+
+
+ $findHttp = 'http://';
+ $findHttps = 'https://';
+ $posHttp = strpos($text, $findHttp);
+ $posHttps = strpos($text, $findHttps);
+ $isURL = 0;
+ //resevanje razbirajanja predolgih neprekinjenih besed in URL - konec
- $this->path2UploadedImages = $site_path.'uploadi/editor/';
+
+ $path2UploadedImages = $site_path.'uploadi/editor/';
if($text == ''){ //ce ni teksta, vrni se
return;
}
+
+ $textOrig = $text;
+ $findme = '<br />';
+ $findmeLength = strlen($findme);
+ $findImg = '<img';
+ $findImgLength = strlen($findImg);
+ $findUl = '<ul';
+ $findUlLength = strlen($findUl);
+ $findOl = '<ol';
+ $findLi = '<li';
+
+ $findPar = '<p>';
+
+ $pos = strpos($text, $findme);
+ $posImg = strpos($text, $findImg);
+ $posUl = strpos($text, $findUl);
+ $posOl = strpos($text, $findOl);
+ $posLi = strpos($text, $findLi);
+ $posPar = strpos($text, $findPar);
+
+ //ureditev izrisa slike
+ if($posImg !== false){
+ $numOfImgs = substr_count($text, $findImg); //stevilo '<img ' v tekstu
+ $posImg = strpos($text, $findImg);
+ $textPrej = '';
+ $textPotem = '';
+ for($i=0; $i<$numOfImgs; $i++){
+ $posImg = strpos($text, $findImg);
+ $textPrej = substr($text, 0, $posImg); //tekst do img
+ $textPotem = substr($text, $posImg); //tekst po img, z vkljuceno hmlt kodo z img
+ $posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
+ $textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
+
+ $imageName = $path2UploadedImages."".self::getImageName($text, 0, '<img', $vre_id, $img_id);
+ $imageNameTest = $imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
+
+ $text = '';
+
+ if(file_exists($imageNameTest)){
+ $text .= $textPrej.' '.PIC_SIZE_ANS."{".$imageName."}";
+ }
+ else{
+ $image = $lang['srv_pc_unavailable'];
+ $text .= $image;
+ }
+ $text .= ' '.$textPotem;
+ }
- //ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
- $text = str_replace('\\','\textbackslash{} ',$text);
- //$text = str_replace('{','\{',$text);
- //$text = str_replace('}','\}',$text);
- $text = str_replace('$','\$ ',$text);
- $text = str_replace('#','\# ',$text);
- $text = str_replace('%','\% ',$text);
- $text = str_replace('€','\euro',$text);
- $text = str_replace('^','\textasciicircum{} ',$text);
- $text = str_replace('_','\_ ',$text);
- $text = str_replace('~','\textasciitilde{} ',$text);
- if(strpos($text, '&amp;')){ //ce je prisotno v besedilu &amp;'
- $text = str_replace('&amp;','\& ',$text);
- }else{
- $text = str_replace('&','\& ',$text);
+
+ //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
+ $findImgCode = '\includegraphics';
+ $posOfImgCode = strpos($text, $findImgCode);
+ //echo $posOfImgCode."</br>";
+ $textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
+ //echo $textToImgCode."</br>";
+ $textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
+ //echo $textFromImgCode."</br>";
+ $findImgCodeEnd = '}';
+ //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
+ $posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
+ //echo $posOfImgCodeEnd."</br>";
+ $textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
+ //echo $textAfterImgCode."</br>";
+ $textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
+ //echo $textOfImgCode."</br>";
+
+ $text = $textToImgCode.$textAfterImgCode;
+ //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike - konec
}
- $text = str_replace('&nbsp;','~',$text);
- //$text = str_replace('&lt;','\textless ',$text);
- $text = str_replace('&lt;',' \textless ',$text);
- //$text = str_replace('&gt;','\textgreater ',$text);
- $text = str_replace('&gt;',' \textgreater ',$text);
+ //ureditev izrisa slike - konec
+
+
+ //ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
+ //brez tega se sesuje tudi pri uporabi XeLatex
+ $text = str_replace('\\','\textbackslash ',$text);
+ if(substr_count($text, '#')){ //ce je stevilo # vecje od 1
+ $text = str_replace('#','\#',$text);
+ }
+ else{
+ $text = str_replace('#','\# ',$text);
+ }
+ $text = str_replace('$','\$ ',$text);
+ $text = str_replace('%','\% ',$text);
+ $text = str_replace('{','\{',$text);
+ $text = str_replace('}','\}',$text);
+ $text = str_replace('^','\textasciicircum ',$text);
+ $text = str_replace('_','\_',$text);
+ $text = str_replace('~','\textasciitilde ',$text);
+ $text = str_replace('&','\&',$text);
+ //brez tega se sesuje tudi pri uporabi XeLatex - konec
+
+
//ureditev posebnih karakterjev za Latex - konec
- //ureditev grskih crk
- $text = str_replace('α','\textalpha ',$text);
- $text = str_replace('β','\textbeta ',$text);
- $text = str_replace('γ','\textgamma ',$text);
- $text = str_replace('δ','\textdelta ',$text);
- $text = str_replace('ε','\textepsilon ',$text);
- $text = str_replace('ζ','\textzeta ',$text);
- $text = str_replace('η','\texteta ',$text);
- $text = str_replace('θ','\texttheta ',$text);
- $text = str_replace('ι','\textiota ',$text);
- $text = str_replace('κ','\textkappa ',$text);
- $text = str_replace('λ','\textlambda ',$text);
- $text = str_replace('μ','\textmugreek ',$text);
- $text = str_replace('ν','\textnu ',$text);
- $text = str_replace('ξ','\textxi ',$text);
- //$text = str_replace('ο','\textomikron ',$text);
- $text = str_replace('π','\textpi ',$text);
- $text = str_replace('ρ','\textrho ',$text);
- $text = str_replace('σ','\textsigma ',$text);
- $text = str_replace('τ','\texttau ',$text);
- $text = str_replace('υ','\textupsilon ',$text);
- $text = str_replace('φ','\textphi ',$text);
- $text = str_replace('χ','\textchi ',$text);
- $text = str_replace('ψ','\textpsi ',$text);
- $text = str_replace('ω','\textomega ',$text);
- //ureditev grskih crk - konec
-
-
- //RESEVANJE BESEDILA V CIRILICI
- $contains_cyrillic = (bool) preg_match('/[\p{Cyrillic}]/u', $text); //ali je v besedilu cirilica?
- if($contains_cyrillic){ // ce je cirilica v besedilu
- $text = '\foreignlanguage{russian}{'.$text.'}';
+
+ //ureditev preureditve html kode ul oz. ol in li v latex itemize oz. enumate
+ if($posUl !== false || $posOl !== false){
+ $numOfUl = substr_count($text, $findUl); //stevilo '<ul' v tekstu
+ $numOfOl = substr_count($text, $findOl); //stevilo '<ol' v tekstu
+ ######################
+ if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
+ $text = str_replace(['<ul>', '<ul'],'', $text);
+ $text = str_replace(['<li>', '<li'],' \\\\ ', $text);
+ $text = str_replace('</ul>','', $text);
+ }
+ ######################
+ }
+ //ureditev preureditve html kode ul oz. ol in li v latex itemize oz. enumate - konec
+
+ //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
+ if($posImg !== false){
+ $text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
+ }
+ //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
+
+ if($posPar !== false){ //ce je kaksen html tag <p> in jih je potrebno izpisati, dodaj prazno vrstico oz. break
+ if($variable_name == 'gdpr' || $variable_name == 'intro'){
+ if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
+ $divider = ' ';
+ }else{
+ $divider = ' \\ \\\\ ';
+ }
+ $text = str_replace(['<p>', '</p>'], $divider, $text);
+ }else{
+ $text = str_replace(['<p>', '</p>'],' ', $text);
+ }
+ }
+
+ //priprava izpisa zelo dolgega besedila brez presledkov (URL, email, ...) - PREVERITI, CE JE SE POTREBNO GLEDE NA SKOK NA XELATEX - PATRIK 8.1.2024
+ //if($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
+ if( ($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)) || ($numOfSpacesPrej == 1 && $posSpace1 == $posSpace2 && $stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
+ $text = "\seqsplit{".$text."}";
+ }
+ //priprava izpisa zelo dolgega besedila brez presledkov - konec
+
+ //echo "text potem: ".$text."</br>";
+
+ if($pos !== false){ // ce je v tekstu prisoten br
+ //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
+ if($no_br == 0){ // ce besedilo potrebuje ustrezen nadomestek <br> v latex kodi
+ $text = str_replace(['<br>', '<br/>', '<br />'],' '.self::$texNewLine, $text); //preuredi
+ }
+ //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
+
+ //Odstranitev odvecnega skoka v novo vrtico na zacetku in koncu besedila
+ $find_texNewLine = ' \\\\ ';
+ $pos_find_texNewLine_1 = strpos($text, $find_texNewLine); //najdi pozicijo prvega simbola za novo vrstico v besedilu
+ if($pos_find_texNewLine_1 == 0 && $pos_find_texNewLine_1 !== false){ //ce je simbol na samem zacetku besedila
+ $text = substr_replace($text, ' ', $pos_find_texNewLine_1, strlen($find_texNewLine)); //nadomesti ga s presledkom
+ }
+
+ $pos_find_texNewLine_2 = strripos($text, $find_texNewLine); //najdi pozicijo zadnjega simbola za novo vrstico v besedilu
+ if($pos_find_texNewLine_2 == (strlen($text) - strlen($find_texNewLine)) && $pos_find_texNewLine_2 !== false){ //ce je simbol na ustrezni poziciji na koncu besedila
+ $text = substr_replace($text, ' ', $pos_find_texNewLine_2, strlen($find_texNewLine)); //nadomesti ga s presledkom
+ }
+
+ $text = trim($text); //Odstranitev posebnih znakov za novo vrstico, presledek, ... na zacetku in koncu besedila
+ //Odstranitev odvecnega skoka v novo vrtico na zacetku in koncu besedila - konec
}
- //RESEVANJE BESEDILA V CIRILICI - konec
- return $text;
+ return strip_tags($text);
}
#funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno - konec
+
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati ######################################
+ public static function getImageName($text='', $sprId=null, $findme='', $vre_id=0, $img_id=0){
+ global $site_path, $site_url;
+ $imageName = '';
+ //echo "id slike $img_id </br>";
+ if($text == 'hotspot' && $findme == 'hotspot_image='){
+ $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
+ $rowParametrov = mysqli_fetch_row($sqlParametrov);
+ $text = $rowParametrov[0];
+ }
+
+ $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
+ if($pos!=''||$pos==0){ //ce je slika v bazi
+ $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
+
+ $findme = $site_url.'uploadi/editor/';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta v $findme
+ if($pos){ //ce je slika na strezniku
+ $slikaNaStrezniku = 1;
+ }else{//ce slike ni na strezniku
+ $slikaNaStrezniku = 0;
+ }
+ if($slikaNaStrezniku==1){ //ce je slika na strezniku
+ $findEditor = 'editor/';
+ $posEditor = strpos($imageName, $findEditor); //najdi pozicijo teksta v $findEditor
+ $imageName = substr($imageName,$posEditor+7); //pokazi le del params od besedila 'editor/' dalje, brez besedila 'editor/'
+
+ $pos = self::getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif)
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+
+ $path = $site_path.'uploadi/editor/'.$imageName;
+
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png
+ self::convertGifToPng($path, $slikaNaStrezniku);
+ }
+
+ if($imageExtension == 'jpg' || $imageExtension == 'peg'){ //ce je slika jpg ali jpeg, jo je potrebno pretvoriti v png
+ self::convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }elseif($slikaNaStrezniku==0){ //ce slike ni na strezniku
+ self::$spremenljivka = $sprId;
+ $row = Cache::srv_spremenljivka($sprId);
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ $imageName = ($spremenljivkaParams->get('hotspot_image') ? $spremenljivkaParams->get('hotspot_image') : "");
+ if($imageName!=''){
+ $imageName = self::getOnlineImageName($imageName, $slikaNaStrezniku, $vre_id, $img_id); //pridobi njen URL
+ }
+ }
+ if($imageName!=''){
+ $imageName = substr($imageName, 0, strrpos($imageName, '.'));
+ }else{
+ $imageName = 'ni slike';
+ }
+
+ }
+
+ //echo "imagename pred return: ".$imageName."</br>";
+ return $imageName;
+ }
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati - konec ###############################
+
+ #funkcija, ki skrbi za pridobitev ustrezne strezniske poti do slike - trenutno ni v uporabi ########################################################
+ function getPath2Images($text='', $sprId=null, $findme=''){
+ global $site_path;
+ $imageName = '';
+
+ if($text == 'hotspot' && $findme == 'hotspot_image='){
+ $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
+ $rowParametrov = mysqli_fetch_row($sqlParametrov);
+ $text = $rowParametrov[0];
+ }
+
+ $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
+
+ if($pos!=''||$pos==0){ //ce je slika v bazi
+ $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
+
+ $findme = 'editor/';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta 'editor/'
+
+ if($pos){ //ce je slika na strezniku
+ $slikaNaStrezniku = 1;
+ }else{//ce slike ni na strezniku
+ $slikaNaStrezniku = 0;
+ }
+
+ if($slikaNaStrezniku==1){ //ce slika je bila prenesena na streznik
+ $path2Images = $site_path.'admin/survey/export/latexclasses/textemp/images/';
+ }elseif($slikaNaStrezniku==0){ //ce slika je bila na dolocenem URL
+ $path2Images = $site_path.'uploadi/editor/';
+ }
+
+ }
+ //echo "pot do slik: ".$path2Images."</br>";
+ return $path2Images;
+ }
+ #funkcija, ki skrbi za pridobitev ustrezne strezniske poti do slike - konec ########################################################
+
+
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike ######################################
+ public static function getOnlineImageName($imageName='', $slikaNaStrezniku=null, $vre_id=null, $img_id=0){
+ global $site_path;
+ //echo "imageName v getOnlineImageName nekje vmes 1: ".$imageName."</br>";
+ $row = Cache::srv_spremenljivka(self::$spremenljivka);
+ //echo "sprem: ".self::$spremenljivka."</br>";
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ //echo "params: ".$spremenljivkaParams->get('hotspot_image')."</br>";
+ $imageNameTmp = $spremenljivkaParams->get('hotspot_image');
+ //echo "imageNameTmp: ".$imageNameTmp."</br>";
+ //if($imageNameTmp!=''){ //ce je hotspot
+ if($imageNameTmp!=''&&$vre_id==0){ //ce je hotspot
+ $imageName = $imageNameTmp;
+ }
+
+ $findHttp = 'http';
+ $posHttp = strpos($imageName, $findHttp);
+ $imageName = substr($imageName,$posHttp); //besedilo do zacetka http
+
+ $pos = self::getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+ //echo "imageName v getOnlineImageName nekje vmes 2: ".$imageName."</br>";
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike
+ //echo "imageExtension: ".$imageExtension."</br>";
+
+ //if($imageExtension!='jpg'&&$imageExtension!='png'&&$imageExtension!='gif'&&$imageExtension!='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ if($imageExtension=='jpg'||$imageExtension=='gif'||$imageExtension=='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ //echo "spremeni extension </br>";
+ $imageExtension='png';
+ }
+
+ if($vre_id){ //ce se pridobiva imena tmp slik iz vrednosti vprasanja
+ $imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+vre_id+tmpImage+img_id+extension
+ }else{
+ $imgFilename = self::$spremenljivka.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+img_id+extension
+ }
+
+ $pathDir = $site_path.'uploadi/editor/'; //pot za novo mapo, kjer se bodo shranjevale slike za trenutno anketo
+ $path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+ # ukaz za pretakanje slike
+ if(IS_WINDOWS){
+ //za windows sisteme //powershell -command "& { iwr URL -OutFile 'PATH' }"
+ $command = 'powershell -command "& { iwr \''.$imageName.'\' -OutFile \''.$path.'\' }"';
+ //$command = 'wget -O \''.$imageName.'\' -O '.$path.' ';
+ }elseif(IS_LINUX){
+ //za linux sisteme //exec('wget URL -P PATH ');
+ //$command = 'wget \''.$imageName.'\' -P '.$path.' ';
+ $command = 'wget -O '.$path.' \''.$imageName.'\' ';
+ //echo "ukaz za pobiranje: $command </br>";
+ }
+
+ //echo "command: ".$command."</br>";
+ exec($command); //pretoci sliko
+
+ if($imageExtension != 'png'){ //ce slika ni png, jo pretvori
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ self::convertGifToPng($path, $slikaNaStrezniku);
+ }else{
+ self::convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }
+
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ return $imgFilename;
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike - konec ###############################
+
+
+ public static function convertGifToPng($path='', $slikaNaStrezniku=null){
+ //echo "path: ".$path."</br>";
+ $image = imagecreatefromgif($path); //pripravi sliko iz gif za pretvorbo
+ $imageName = substr($path, 0, -3); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno gif sliko v png
+
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, GIF izbrisi
+ unlink($imageName.'gif'); //izbrisi gif sliko
+ }
+ }
+
+ public static function convertJpgToPng($path='', $slikaNaStrezniku=null, $imageExtension=''){
+ $image = imagecreatefromjpeg($path); //pripravi sliko iz jpg za pretvorbo
+ $imageName = substr($path, 0, strrpos($path, '.')); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'.png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno jpg sliko v png
+ //echo "pretvorba v png: ".$imageNamePNG."</br>";
+ //echo "xtens: ".$imageExtension."</br>";
+ //$origExtension = strrchr($path, '.');
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, izbrisi jo
+ //echo "tukaj </br>";
+ if($imageExtension == 'jpg'){
+ unlink($imageName.'.'.$imageExtension); //izbrisi sliko
+ }elseif($imageExtension == 'peg'){
+ unlink($imageName.'.j'.$imageExtension); //izbrisi sliko
+ }
+ }
+ }
+
+ public static function getEndPosition($imageName=''){
+ $findme = '"';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta '"'
+ return $pos;
+ }
} \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php b/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php
index 698f79c..1dd4fc8 100644
--- a/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php
+++ b/admin/survey/export/latexclasses/class.LatexEditsAnalysis.php
@@ -68,6 +68,13 @@ class LatexEditsAnalysis {
protected $texTimeEdits='';
protected $vrsticaTex = array();
+
+ protected $seanse = null;
+ protected $timings = null;
+
+ protected $interval_criteria = array();
+
+ public static $spremenljivka=null;
public static $sea = null; //SurveyEditsAnalysis class
@@ -86,7 +93,7 @@ class LatexEditsAnalysis {
if ( is_numeric($anketa) )
{
$this->anketa['id'] = $anketa;
- $this->anketa['podstran'] = $podstran;
+ //$this->anketa['podstran'] = $podstran; //pokomentirano, ker se ne uporablja nikjer in je težava s PHP8
}
else
{
@@ -269,7 +276,7 @@ class LatexEditsAnalysis {
$texEditAnalysis .= $this->texBigSkip.$this->texNewLine;
- if(sizeof($this->data) == 0){
+ if(is_countable($this->data) && sizeof($this->data) == 0){
$texEditAnalysis .= $lang['srv_edits_analysis_no_data'];
}
else{
@@ -307,10 +314,10 @@ class LatexEditsAnalysis {
$tex = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_edits_analysis_counter']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_edits_analysis_counter']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
- if(sizeof($this->data) == 0)
+ if(is_countable($this->data) && sizeof($this->data) == 0)
$tex .= $lang['srv_edits_analysis_no_data'];
else{
@@ -357,10 +364,10 @@ class LatexEditsAnalysis {
//Priprava podatkov za izpis vrstic tabele in njihov izpis
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($lang['srv_edits_analysis_counter_editor']);
- $prvaVrstica[] = $this->encodeText($lang['srv_edits_analysis_time_time']);
- $prvaVrstica[] = $this->encodeText($lang['srv_edits_analysis_num_sessions']);
- $prvaVrstica[] = $this->encodeText($lang['srv_edits_analysis_time_actions']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_counter_editor']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_time']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_num_sessions']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_actions']);
$tex .= $this->tableRow($prvaVrstica); //Izpis 1. vrstice tabele
@@ -381,7 +388,7 @@ class LatexEditsAnalysis {
// vsota veljavnih
$vrsticaSum = array();
- $vrsticaSum[] = $this->encodeText($lang['srv_edits_analysis_time_total']);
+ $vrsticaSum[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_total']);
$vrsticaSum[] = $this->sea->calculateTimeFromSeconds($sum_time);
$vrsticaSum[] = $sum_seans;
$vrsticaSum[] = $sum_akcij;
@@ -411,7 +418,7 @@ class LatexEditsAnalysis {
$sum_data = $this->sum_data;
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_edits_analysis_countinu']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_edits_analysis_countinu']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//izpis nastavitev
@@ -458,7 +465,7 @@ class LatexEditsAnalysis {
$interval = $this->sea->calculateTimeBetweenActions($temp_time, DateTime::createFromFormat('Y-m-d'.$interval_crit, $row['formatdate']));
//if interval between actions are 1 unit (1 hour or 1 day), add it to continued editing session
- if($interval/$interval_seconds-$zapored < 2){
+ if((float) $interval/$interval_seconds-$zapored < 2){
$zapored++;
//set maxValue, needed for width of bars
$maxValue = max($maxValue, $zapored);
@@ -482,7 +489,7 @@ class LatexEditsAnalysis {
}
if(!$results){
//$this->echoNoData();
- $tex .= $this->encodeText($lang['srv_no_data']).$this->texNewLine;
+ $tex .= LatexDocument::encodeText($lang['srv_no_data']).$this->texNewLine;
}
else{
//Priprava parametrov za tabelo s podatki o anketi
@@ -526,7 +533,7 @@ class LatexEditsAnalysis {
}
} else{
//$this->echoNoData();
- $tex .= $this->encodeText($lang['srv_no_data']).$this->texNewLine;
+ $tex .= LatexDocument::encodeText($lang['srv_no_data']).$this->texNewLine;
}
#################
@@ -575,7 +582,7 @@ class LatexEditsAnalysis {
$sum_data = $this->sum_data;
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_edits_analysis_editing_details']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_edits_analysis_editing_details']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
$tex .= $this->texTimeEdits;
@@ -652,7 +659,6 @@ class LatexEditsAnalysis {
$textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
$text = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
- //$text2Return = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text2Return, 0, 'img')."}".' '.$textPotem;
}
//pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
@@ -811,13 +817,12 @@ class LatexEditsAnalysis {
//function tableRow($arrayText, $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0, $steviloPodstolpcev){
function tableRow($arrayText=null, $brezHline=0, $brezNoveVrstice=0, $nadaljevanjeVrstice=0, $color='', $export_format = null, $steviloPodstolpcev = null){
$tableRow = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 90);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 90);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
- $height = 1; //$height = $this->getCellHeight($this->encodeText($arrayText[1]), 90);
+ $height = 1; //$height = $this->getCellHeight(LatexDocument::encodeText($arrayText[1]), 90);
- if($arrayParams['align2'] != 'C')
- $arrayParams['align2'] = 'L';
- //echo "velikost polja s tekstom: ".count($arrayText)."</br>";
+ /* if($arrayParams['align2'] != 'C')
+ $arrayParams['align2'] = 'L'; */
if($export_format == 'pdf'){
if($color=='blue'){
@@ -833,7 +838,6 @@ class LatexEditsAnalysis {
for($i=0;$i<count($arrayText);$i++){
//echo "array text: ".$arrayText[$i]."</br>";
if($color!=''){ //ce je potrebno besedilo dolocene barve
- //$text = ' \cellcolor{'.$cellBgColor.'} '.$this->coloredTextLatex($color, $arrayText[$i]);
$text = $cellColoring.''.$this->coloredTextLatex($color, $arrayText[$i]);
}else{
$text = $arrayText[$i];
@@ -954,7 +958,7 @@ class LatexEditsAnalysis {
//Priprava podatkov za izpis vrstic tabele in izpis vrstic /////////////////////////////////////////////////////
- $time_sum += $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
+ $time_sum += (float) $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
//Izpis posameznih vrstic
foreach($this->vrsticaTex as $vrstica){
@@ -1024,7 +1028,7 @@ class LatexEditsAnalysis {
else{
$datetime_last = clone $datetime_start;
$datetime_last->add(new DateInterval('PT5S'));
- $time_sum += $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
+ $time_sum += (float) $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
$st_akcij = 1;
$st_seans_sum++;
$datetime_start = clone $temp_time;
@@ -1044,7 +1048,7 @@ class LatexEditsAnalysis {
}
//akcija je izven kriterija seanse, izpisi vse prejsnje akcije
else{
- $time_sum += $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
+ $time_sum += (float) $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
$st_akcij = 1;
$st_seans_sum++;
$datetime_start = clone $temp_time;
@@ -1070,7 +1074,7 @@ class LatexEditsAnalysis {
$datetime_last->add(new DateInterval('PT5S'));
}
- $time_sum += $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
+ $time_sum += (float) $this -> TimeEditsRow($datetime_start, $datetime_last, $st_akcij, $action_type, $user_id.'_'.$row_id);
//Izpis posameznih vrstic
foreach($this->vrsticaTex as $vrstica){
@@ -1140,7 +1144,7 @@ class LatexEditsAnalysis {
* quotes and no stat and end braces)
* @return type valid converted JSON
*/
- function convertToJSON($toJSON=null){
+ function convertToJSON($toJSON=''){
$toJSON = preg_replace('/("(.*?)"|(\w+))(\s*:\s*(".*?"|.))/s', '"$2$3"$4', $toJSON);
$toJSON = '{'.$toJSON.'}';
return json_decode($toJSON, true);
@@ -1159,17 +1163,17 @@ class LatexEditsAnalysis {
$latexVrstica = array();
//casovni razpon urejanja
- $latexVrstica[] = $this->encodeText($datetime);
+ $latexVrstica[] = LatexDocument::encodeText($datetime);
//cas urejanja
- $latexVrstica[] = $this->encodeText($cas_seanse);
+ $latexVrstica[] = LatexDocument::encodeText($cas_seanse);
//stevilo akcij
- $latexVrstica[] = $this->encodeText($st_akcij);
+ $latexVrstica[] = LatexDocument::encodeText($st_akcij);
if($action_type != null){
//vrsta akcij
- $latexVrstica[] = $this->encodeText($action_type.' ');
+ $latexVrstica[] = LatexDocument::encodeText($action_type.' ');
}
$tex .= $this->tableRow($latexVrstica);
@@ -1183,7 +1187,7 @@ class LatexEditsAnalysis {
* @param type $row_id - int sequence nuber of row (unique user int and row in table)
* @return string - converter array to string to put it in table cell
*/
- function createActionsTypeString($action_type=null, $row_id=null){
+ function createActionsTypeString($action_type=array(), $row_id=null){
$action_type_string = '';
//urejanje - ali drug specificen status
if(!isset($action_type[0]['sum'])){
@@ -1228,7 +1232,7 @@ class LatexEditsAnalysis {
$tex = '';
$vrsticaPodatkovSkupaj = array();
//casovni razpon urejanja
- $vrsticaPodatkovSkupaj[] = $this->returnBold($this->encodeText($lang['srv_edits_analysis_time_total']));
+ $vrsticaPodatkovSkupaj[] = $this->returnBold(LatexDocument::encodeText($lang['srv_edits_analysis_time_total']));
//cas urejanja
$vrsticaPodatkovSkupaj[] = $this->returnBold($this->sea->calculateTimeFromSeconds($time));
@@ -1238,7 +1242,7 @@ class LatexEditsAnalysis {
if($action_type != null){
//vrsta akcij
- $vrsticaPodatkovSkupaj[] = $this->returnBold($this->encodeText($this->createActionsTypeString($action_type, $row_id)));
+ $vrsticaPodatkovSkupaj[] = $this->returnBold(LatexDocument::encodeText($this->createActionsTypeString($action_type, $row_id)));
}
$tex .= $this->tableRow($vrsticaPodatkovSkupaj); //Izpis vrstic tabele s podatki o sumi
@@ -1284,11 +1288,11 @@ class LatexEditsAnalysis {
$tex .= $this->tableRow($prvaVrstica);
$drugaVrstica = array();
- $drugaVrstica[] = $this->encodeText($lang['srv_edits_analysis_time_span']);
- $drugaVrstica[] = $this->encodeText($lang['srv_edits_analysis_time_time']);
- $drugaVrstica[] = $this->encodeText($lang['srv_edits_analysis_time_actions']);
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_span']);
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_time']);
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_time_actions']);
if($status < 1){
- $drugaVrstica[] = $this->encodeText($lang['srv_edits_analysis_action_type']);
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_edits_analysis_action_type']);
}else{
$drugaVrstica[] = '';
}
@@ -1300,6 +1304,191 @@ class LatexEditsAnalysis {
$tex = "\\end{tabularx}";
return $tex;
}
+
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati ######################################
+ function getImageName($text='', $sprId=null, $findme='', $vre_id=0, $img_id=0){
+ global $site_path, $site_url;
+ $imageName = '';
+ self::$spremenljivka = $sprId;
+ if($text == 'hotspot' && $findme == 'hotspot_image='){
+ $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
+ $rowParametrov = mysqli_fetch_row($sqlParametrov);
+ $text = $rowParametrov[0];
+ }
+
+ $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
+ //echo "text za echo: ".$text."</br>";
+ //if($pos!=''){ //ce je slika v bazi
+ if($pos!=''||$pos==0){ //ce je slika v bazi
+ $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
+ //echo "imageName prej: ".$imageName."</br>";
+
+ //$findme = $site_path.'uploadi/editor/';
+ $findme = $site_url.'uploadi/editor/';
+ //$findme = 'uploadi/editor/';
+ //$findme = 'editor/';
+ //echo "findme: ".$findme."</br>";
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta v $findme
+ //echo "najdi tole: ".$findme."</br>";
+ //echo "najdi tukaj: ".$imageName."</br>";
+ //echo "pozicija tega: ".$pos."</br>";
+ if($pos){ //ce je slika na strezniku
+ $slikaNaStrezniku = 1;
+ }else{//ce slike ni na strezniku
+ $slikaNaStrezniku = 0;
+ }
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==1){ //ce je slika na strezniku
+ $findEditor = 'editor/';
+ $posEditor = strpos($imageName, $findEditor); //najdi pozicijo teksta v $findEditor
+ $imageName = substr($imageName,$posEditor+7); //pokazi le del params od besedila 'editor/' dalje, brez besedila 'editor/'
+ //echo "imagename : ".$imageName."</br>";
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif)
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+
+ $path = $site_path.'uploadi/editor/'.$imageName;
+ //$path = $site_url.'uploadi/editor/'.$imageName;
+
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }
+
+ if($imageExtension == 'jpg' || $imageExtension == 'peg'){ //ce je slika jpg ali jpeg, jo je potrebno pretvoriti v png
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }elseif($slikaNaStrezniku==0){ //ce slike ni na strezniku
+ //echo "vre_id: $vre_id </br>";
+ $imageName = $this->getOnlineImageName($imageName, $slikaNaStrezniku, $vre_id, $img_id); //pridobi njen URL
+ }
+
+ $imageName = substr($imageName, 0, strrpos($imageName, '.'));
+
+ }
+
+ //echo "imagename pred return: ".$imageName."</br>";
+ return $imageName;
+ }
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati - konec ###############################
+ function getEndPosition($imageName=''){
+ $findme = '"';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta '"'
+ return $pos;
+ }
+
+ function convertGifToPng($path='', $slikaNaStrezniku=null){
+ //echo "path: ".$path."</br>";
+ $image = imagecreatefromgif($path); //pripravi sliko iz gif za pretvorbo
+ $imageName = substr($path, 0, -3); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno gif sliko v png
+
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, GIF izbrisi
+ unlink($imageName.'gif'); //izbrisi gif sliko
+ }
+ }
+
+ function convertJpgToPng($path='', $slikaNaStrezniku=null, $imageExtension=''){
+ $image = imagecreatefromjpeg($path); //pripravi sliko iz jpg za pretvorbo
+ $imageName = substr($path, 0, strrpos($path, '.')); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'.png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno jpg sliko v png
+ //echo "pretvorba v png: ".$imageNamePNG."</br>";
+ //echo "xtens: ".$imageExtension."</br>";
+ //$origExtension = strrchr($path, '.');
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, izbrisi jo
+ //echo "tukaj </br>";
+ if($imageExtension == 'jpg'){
+ unlink($imageName.'.'.$imageExtension); //izbrisi sliko
+ }elseif($imageExtension == 'peg'){
+ unlink($imageName.'.j'.$imageExtension); //izbrisi sliko
+ }
+ }
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike ######################################
+ function getOnlineImageName($imageName='', $slikaNaStrezniku=null, $vre_id=null, $img_id=0){
+ global $site_path;
+ //echo "imageName v getOnlineImageName nekje vmes 1: ".$imageName."</br>";
+ $row = Cache::srv_spremenljivka(self::$spremenljivka);
+ //echo "sprem: ".self::$spremenljivka."</br>";
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ //echo "params: ".$spremenljivkaParams->get('hotspot_image')."</br>";
+ $imageNameTmp = $spremenljivkaParams->get('hotspot_image');
+ //if($imageNameTmp!=''){ //ce je hotspot
+ if($imageNameTmp!=''&&$vre_id==0){ //ce je hotspot
+ $imageName = $imageNameTmp;
+ }
+
+ $findHttp = 'http';
+ $posHttp = strpos($imageName, $findHttp);
+ $imageName = substr($imageName,$posHttp); //besedilo do zacetka http
+
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+ //echo "imageName v getOnlineImageName nekje vmes 2: ".$imageName."</br>";
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike
+ //echo "imageExtension: ".$imageExtension."</br>";
+
+ //if($imageExtension!='jpg'&&$imageExtension!='png'&&$imageExtension!='gif'&&$imageExtension!='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ if($imageExtension=='jpg'||$imageExtension=='gif'||$imageExtension=='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ //echo "spremeni extension </br>";
+ $imageExtension='png';
+ }
+
+ if($vre_id){ //ce se pridobiva imena tmp slik iz vrednosti vprasanja
+ //$imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }else{
+ //$imgFilename = self::$spremenljivka.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }
+
+ $pathDir = $site_path.'uploadi/editor/'; //pot za novo mapo, kjer se bodo shranjevale slike za trenutno anketo
+ $path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+ # ukaz za pretakanje slike
+ if(IS_WINDOWS){
+ //za windows sisteme //powershell -command "& { iwr URL -OutFile 'PATH' }"
+ $command = 'powershell -command "& { iwr \''.$imageName.'\' -OutFile \''.$path.'\' }"';
+ //$command = 'wget -O \''.$imageName.'\' -O '.$path.' ';
+ }elseif(IS_LINUX){
+ //za linux sisteme //exec('wget URL -P PATH ');
+ //$command = 'wget \''.$imageName.'\' -P '.$path.' ';
+ $command = 'wget -O '.$path.' \''.$imageName.'\' ';
+ //echo "ukaz za pobiranje: $command </br>";
+ }
+
+ //echo "command: ".$command."</br>";
+ exec($command); //pretoci sliko
+
+ //$path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+/* if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ } */
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ if($imageExtension != 'png'){ //ce slika ni png, jo pretvori
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }else{
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }
+
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ return $imgFilename;
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike - konec ###############################
+
+ function coloredTextLatex($color='', $text=''){
+ $coloredText = '';
+ $coloredText .= '\textcolor{'.$color.'}{'.$text.'}';
+ return $coloredText;
+ }
+
}
?> \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/class.LatexStatus.php b/admin/survey/export/latexclasses/class.LatexStatus.php
index 522e843..62e9c83 100644
--- a/admin/survey/export/latexclasses/class.LatexStatus.php
+++ b/admin/survey/export/latexclasses/class.LatexStatus.php
@@ -9,11 +9,11 @@
define("ALLOW_HIDE_ZERRO_REGULAR", false); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za navadne odgovore
define("ALLOW_HIDE_ZERRO_MISSING", true); // omogočimo delovanje prikazovanja/skrivanja ničelnih vnosti za missinge
- define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
- define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_AVERAGE')) define("NUM_DIGIT_AVERAGE", 2); // stevilo digitalnih mest za povprecje
+ if (!defined('NUM_DIGIT_DEVIATION')) define("NUM_DIGIT_DEVIATION", 2); // stevilo digitalnih mest za povprecje
- define("M_ANALIZA_DESCRIPTOR", "descriptor");
- define("M_ANALIZA_FREQUENCY", "frequency");
+ if (!defined('M_ANALIZA_DESCRIPTOR')) define("M_ANALIZA_DESCRIPTOR", "descriptor");
+ if (!defined('M_ANALIZA_FREQUENCY')) define("M_ANALIZA_FREQUENCY", "frequency");
define("FNT_FREESERIF", "freeserif");
define("FNT_FREESANS", "freesans");
@@ -50,7 +50,7 @@
* @desc: po novem je potrebno form elemente generirati ro�no kot slike
*
*/
-class LatexStatus {
+class LatexStatus{
var $anketa;// = array(); // trenutna anketa
@@ -79,7 +79,7 @@ class LatexStatus {
if ( is_numeric($anketa) )
{
$this->anketa['id'] = $anketa;
- $this->anketa['podstran'] = $podstran;
+ //$this->anketa['podstran'] = $podstran;
// create new PDF document
//$this->pdf = new enka_TCPDF('L', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
}
@@ -148,7 +148,6 @@ class LatexStatus {
$this->ss->PrepareStatusView();
//naslov izvoza
- //$texStatus .= $this->returnBold('Status').$this->texNewLine.$this->texNewLine;
$texStatus .= '\MakeUppercase{\huge \textbf{Status - '.$lang['srv_status_summary'].'}}'.$this->texBigSkip.$this->texNewLine;
@@ -203,7 +202,7 @@ class LatexStatus {
$texStatusInfo = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_info_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_info_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -241,89 +240,89 @@ class LatexStatus {
//ime ankete
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($lang['srv_info_name'].':');
- //$prvaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText(SurveyInfo::getSurveyTitle()).'} ';
- $prvaVrstica[] = $this->encodeText(SurveyInfo::getSurveyTitle());
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_info_name'].':');
+ //$prvaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText(SurveyInfo::getSurveyTitle()).'} ';
+ $prvaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyTitle());
//katere napredne možnosti so vklopljene
- $row = SurveyInfo::getSurveyRow();
+ $row = SurveyInfo::getSurveyModules();
$enabled_advanced = null;
$prefix = '';
- if ($row['uporabnost'] == 1) {
+ if (isset($row['uporabnost'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_4'];
$prefix = ', ';
}
- if ($row['user_from_cms'] == 1) {
+ if (isset($row['user_from_cms'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_5'];
$prefix = ', ';
}
- if ($row['quiz'] == 1) {
+ if (isset($row['quiz'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_6'];
$prefix = ', ';
}
- if ($row['voting'] == 1) {
+ if (isset($row['voting'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_18'];
$prefix = ', ';
}
- if ($row['phone'] == 1) {
+ if (isset($row['phone'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_7'];
$prefix = ', ';
}
- if ($row['social_network'] == 1) {
+ if (isset($row['social_network'])) {
$enabled_advanced .= $prefix . $lang['srv_vrsta_survey_type_8'];
$prefix = ', ';
}
//tip ankete
$drugaVrstica = array();
- $drugaVrstica[] = $this->encodeText($lang['srv_info_type'].':');
+ $drugaVrstica[] = LatexDocument::encodeText($lang['srv_info_type'].':');
//$drugaVrstica[] = '\multicolumn{2}{l}{ '.$lang['srv_vrsta_survey_type_'.SurveyInfo::getSurveyType()] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' ).'} ';
$drugaVrstica[] = $lang['srv_vrsta_survey_type_'.SurveyInfo::getSurveyType()] . ($enabled_advanced != null ? ' ('.$enabled_advanced.')' : '' );
/* //vprašanj, variabel
$tretjaVrstica = array();
- //$tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ').$this->encodeText(SurveyInfo::getSurveyQuestionCount());
- $tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ');
- $tretjaVrstica[] = $this->encodeText(SurveyInfo::getSurveyQuestionCount());
- //$tretjaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_info_variables'].': ').$this->encodeText(SurveyInfo::getSurveyVariableCount()).'} ';
- $tretjaVrstica[] = $this->encodeText($lang['srv_info_variables'].': ').$this->encodeText(SurveyInfo::getSurveyVariableCount()); */
+ //$tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ');
+ $tretjaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ //$tretjaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_info_variables'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount()).'} ';
+ $tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_variables'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount()); */
//vprašanj
$tretjaVrsticaA = array();
- //$tretjaVrstica[] = $this->encodeText($lang['srv_info_questions1'].': ').$this->encodeText(SurveyInfo::getSurveyQuestionCount());
- $tretjaVrsticaA[] = $this->encodeText($lang['srv_info_questions1'].': ');
- $tretjaVrsticaA[] = $this->encodeText(SurveyInfo::getSurveyQuestionCount());
+ //$tretjaVrstica[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
+ $tretjaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_questions1'].': ');
+ $tretjaVrsticaA[] = LatexDocument::encodeText(SurveyInfo::getSurveyQuestionCount());
//variabel
$tretjaVrsticaB = array();
- $tretjaVrsticaB[] = $this->encodeText($lang['srv_info_variables'].': ');
- $tretjaVrsticaB[] = $this->encodeText(SurveyInfo::getSurveyVariableCount());
+ $tretjaVrsticaB[] = LatexDocument::encodeText($lang['srv_info_variables'].': ');
+ $tretjaVrsticaB[] = LatexDocument::encodeText(SurveyInfo::getSurveyVariableCount());
/* //uporabnikov, odgovorov
$cetrtaVrstica = array();
- $cetrtaVrstica[] = $this->encodeText($lang['srv_analiza_stUporabnikov'].':');
- $cetrtaVrstica[] = $this->encodeText(SurveyInfo::getSurveyAnswersCount());
- $cetrtaVrstica[] = $this->encodeText($lang['srv_info_answers_valid'].': ').$this->encodeText(SurveyInfo::getSurveyApropriateAnswersCount()); */
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_analiza_stUporabnikov'].':');
+ $cetrtaVrstica[] = LatexDocument::encodeText(SurveyInfo::getSurveyAnswersCount());
+ $cetrtaVrstica[] = LatexDocument::encodeText($lang['srv_info_answers_valid'].': ').LatexDocument::encodeText(SurveyInfo::getSurveyApropriateAnswersCount()); */
//uporabnikov
$cetrtaVrsticaA = array();
- $cetrtaVrsticaA[] = $this->encodeText($lang['srv_analiza_stUporabnikov'].':');
- $cetrtaVrsticaA[] = $this->encodeText(SurveyInfo::getSurveyAnswersCount());
+ $cetrtaVrsticaA[] = LatexDocument::encodeText($lang['srv_analiza_stUporabnikov'].':');
+ $cetrtaVrsticaA[] = LatexDocument::encodeText(SurveyInfo::getSurveyAnswersCount());
//odgovorov
$cetrtaVrsticaB = array();
- $cetrtaVrsticaB[] = $this->encodeText($lang['srv_info_answers_valid'].': ');
- $cetrtaVrsticaB[] = $this->encodeText(SurveyInfo::getSurveyApropriateAnswersCount());
+ $cetrtaVrsticaB[] = LatexDocument::encodeText($lang['srv_info_answers_valid'].': ');
+ $cetrtaVrsticaB[] = LatexDocument::encodeText(SurveyInfo::getSurveyApropriateAnswersCount());
//jezik ankete
$petaVrstica = array();
- $petaVrstica[] = $this->encodeText($lang['srv_info_language'].':');
- //$petaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText(SurveyInfo::getRespondentLanguage()).'} ';
- $petaVrstica[] = $this->encodeText(SurveyInfo::getRespondentLanguage());
+ $petaVrstica[] = LatexDocument::encodeText($lang['srv_info_language'].':');
+ //$petaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText(SurveyInfo::getRespondentLanguage()).'} ';
+ $petaVrstica[] = LatexDocument::encodeText(SurveyInfo::getRespondentLanguage());
//avtor
$sestaVrstica = array();
- $sestaVrstica[] = $this->encodeText($lang['srv_info_creator'].':');
+ $sestaVrstica[] = LatexDocument::encodeText($lang['srv_info_creator'].':');
$text = '';
$text .= SurveyInfo::getSurveyInsertName();
if (SurveyInfo::getSurveyInsertDate() && SurveyInfo::getSurveyInsertDate() != "00.00.0000")
@@ -331,12 +330,12 @@ class LatexStatus {
if (SurveyInfo::getSurveyInsertTime() && SurveyInfo::getSurveyInsertTime() != "00:00:00")
$text .= SurveyInfo::getDateTimeSeperator() . $this->ss->dateFormat(SurveyInfo::getSurveyInsertTime(),TIME_FORMAT_SHORT);
- //$sestaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $sestaVrstica[] = $this->encodeText($text);
+ //$sestaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $sestaVrstica[] = LatexDocument::encodeText($text);
//spreminjal
$sedmaVrstica = array();
- $sedmaVrstica[] = $this->encodeText($lang['srv_info_modify'].':');
+ $sedmaVrstica[] = LatexDocument::encodeText($lang['srv_info_modify'].':');
$text = '';
$text .= SurveyInfo::getSurveyEditName();
if (SurveyInfo::getSurveyEditDate() && SurveyInfo::getSurveyEditDate() != "00.00.0000")
@@ -344,49 +343,49 @@ class LatexStatus {
if (SurveyInfo::getSurveyEditTime() && SurveyInfo::getSurveyEditTime() != "00:00:00")
$text .= SurveyInfo::getDateTimeSeperator() . $this->ss->dateFormat(SurveyInfo::getSurveyEditTime(),TIME_FORMAT_SHORT);
- //$sedmaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $sedmaVrstica[] = $this->encodeText($text);
+ //$sedmaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $sedmaVrstica[] = LatexDocument::encodeText($text);
//dostop, Kdo razen avtorja ima dostop
$dostop = SurveyInfo::getSurveyAccessUsers();
if ($dostop) {
- //$this->pdf->Cell(20, 3, $this->encodeText($lang['srv_info_access'].':'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(20, 3, LatexDocument::encodeText($lang['srv_info_access'].':'), 0, 0, 'L', 0);
$osmaVrstica = array();
- $osmaVrstica[] = $this->encodeText($lang['srv_info_access'].':');
+ $osmaVrstica[] = LatexDocument::encodeText($lang['srv_info_access'].':');
$prefix='';
foreach ( $dostop as $user) {
$prefix .= $user['name'].'; ';
}
$prefix = substr($prefix, 0, -2);
- //$osmaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($prefix).'} ';
- $osmaVrstica[] = $this->encodeText($prefix);
+ //$osmaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($prefix).'} ';
+ $osmaVrstica[] = LatexDocument::encodeText($prefix);
}
//aktivnost
$devetaVrstica = array();
$activity = SurveyInfo:: getSurveyActivity();
$_last_active = end($activity);
- $devetaVrstica[] = $this->encodeText($lang['srv_displaydata_status'].':');
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_displaydata_status'].':');
if (SurveyInfo::getSurveyColumn('active') == 1) {
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_anketa_active2']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_anketa_active2']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_anketa_active2']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_anketa_active2']);
} else {
# preverimo ali je bila anketa že aktivirana
if (!isset($_last_active['starts'])) {
# anketa še sploh ni bila aktivirana
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_survey_non_active_notActivated1']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_survey_non_active_notActivated1']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_survey_non_active_notActivated1']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_survey_non_active_notActivated1']);
} else {
# anketa je že bila aktivirna ampak je sedaj neaktivna
- //$devetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_survey_non_active1']).'} ';
- $devetaVrstica[] = $this->encodeText($lang['srv_survey_non_active1']);
+ //$devetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_survey_non_active1']).'} ';
+ $devetaVrstica[] = LatexDocument::encodeText($lang['srv_survey_non_active1']);
}
}
//trajanje: datumi aktivnosti
- if ( count($activity) > 0 ) {
+ if (is_countable($activity) && count($activity) > 0 ) {
$desetaVrstica = array();
- $desetaVrstica[] = $this->encodeText($lang['srv_info_activity'].':');
+ $desetaVrstica[] = LatexDocument::encodeText($lang['srv_info_activity'].':');
$prefix = '';
foreach ($activity as $active) {
$_starts = explode('-',$active['starts']);
@@ -395,8 +394,8 @@ class LatexStatus {
$prefix .= $_starts[2].'.'.$_starts[1].'.'.$_starts[0].'-'.$_expire[2].'.'.$_expire[1].'.'.$_expire[0];
$prefix .= '; ';
}
- //$desetaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($prefix).'} ';
- $desetaVrstica[] = $this->encodeText($prefix);
+ //$desetaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($prefix).'} ';
+ $desetaVrstica[] = LatexDocument::encodeText($prefix);
}
# predviceni cas trajanja enkete
@@ -407,12 +406,12 @@ class LatexStatus {
//predviceni cas trajanja enkete
$enajstaVrstica = array();
- $enajstaVrstica[] = $this->encodeText($lang['srv_info_duration'].':');
+ $enajstaVrstica[] = LatexDocument::encodeText($lang['srv_info_duration'].':');
$text = '';
$text .= ($skupni_cas != '') ? $skupni_cas.', ' : '';
$text .= $lang['srv_predvideno'].': '.$skupni_predvideni_cas;
- //$enajstaVrstica[] = '\multicolumn{2}{l}{ '.$this->encodeText($text).'} ';
- $enajstaVrstica[] = $this->encodeText($text);
+ //$enajstaVrstica[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($text).'} ';
+ $enajstaVrstica[] = LatexDocument::encodeText($text);
//VNOSI - prvi / zadnji vnos
@@ -423,22 +422,22 @@ class LatexStatus {
$dvanajstaVrstica = array();
$dvanajstaVrsticaA = array();
if ($prvi_vnos_date != null) {
- $dvanajstaVrstica[] = $this->encodeText($lang['srv_info_first_entry'].':');
+ $dvanajstaVrstica[] = LatexDocument::encodeText($lang['srv_info_first_entry'].':');
$text = '';
$text .= $this->ss->dateFormat($prvi_vnos_date,DATE_FORMAT_SHORT);
$text .= $prvi_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->ss->dateFormat($prvi_vnos_time,TIME_FORMAT_SHORT)) : '';
- $dvanajstaVrstica[] = $this->encodeText($text);
+ $dvanajstaVrstica[] = LatexDocument::encodeText($text);
}else{
$dvanajstaVrstica[] = '';
$dvanajstaVrstica[] = '';
}
if ($zadnji_vnos_date != null) {
- $dvanajstaVrsticaA[] = $this->encodeText($lang['srv_info_last_entry'].':');
+ $dvanajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_last_entry'].':');
$text = '';
$text .= $this->ss->dateFormat($zadnji_vnos_date,DATE_FORMAT_SHORT);
$text .= $zadnji_vnos_time != null ? (SurveyInfo::$dateTimeSeperator .$this->ss->dateFormat($zadnji_vnos_time,TIME_FORMAT_SHORT)) : '';
- //$dvanajstaVrsticaA[] = $this->encodeText($lang['srv_info_last_entry'].': '.$this->encodeText($text));
- $dvanajstaVrsticaA[] = $this->encodeText($text);
+ //$dvanajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_info_last_entry'].': '.LatexDocument::encodeText($text));
+ $dvanajstaVrsticaA[] = LatexDocument::encodeText($text);
}else{
$dvanajstaVrsticaA[] = '';
}
@@ -463,17 +462,17 @@ class LatexStatus {
$trinajstaVrsticaB = array();
$trinajstaVrsticaC = array();
- $trinajstaVrsticaA[] = $this->encodeText($lang['srv_diagnostic_4_element_0'].':');
- //$trinajstaVrsticaA[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved).'} ';
- $trinajstaVrsticaA[] = $this->encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved);
+ $trinajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_0'].':');
+ //$trinajstaVrsticaA[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved).'} ';
+ $trinajstaVrsticaA[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_1'].': '.(int)$commentsAll.' / '.(int)$commentsUnresolved);
$trinajstaVrsticaB[] = '';
- //$trinajstaVrsticaB[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved).'} ';
- $trinajstaVrsticaB[] = $this->encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved);
+ //$trinajstaVrsticaB[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved).'} ';
+ $trinajstaVrsticaB[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_6'].': '.(int)$commentsQuestionAll.' / '.(int)$commentsQuestionUnresolved);
$trinajstaVrsticaC[] = '';
- //$trinajstaVrsticaC[] = '\multicolumn{2}{l}{ '.$this->encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved).'} ';
- $trinajstaVrsticaC[] = $this->encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved);
+ //$trinajstaVrsticaC[] = '\multicolumn{2}{l}{ '.LatexDocument::encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved).'} ';
+ $trinajstaVrsticaC[] = LatexDocument::encodeText($lang['srv_diagnostic_4_element_7'].': '.(int)$commentsUser.' / '.(int)$commentsUserUnresolved);
$komentarji = 1;
}
@@ -496,7 +495,7 @@ class LatexStatus {
$texStatusInfo .= $this->tableRow($osmaVrstica, 1);
}
$texStatusInfo .= $this->tableRow($devetaVrstica, 1);
- if ( count($activity) > 0 ) {
+ if ( is_countable($activity) && count($activity) > 0 ) {
$texStatusInfo .= $this->tableRow($desetaVrstica, 1);
}
$texStatusInfo .= $this->tableRow($enajstaVrstica, 1);
@@ -537,7 +536,7 @@ class LatexStatus {
$texStatusView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_status_title1']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_status_title1']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -556,6 +555,7 @@ class LatexStatus {
$rtfTable = 'tabular';
$pdfTableWidth = 1;
$rtfTableWidth = 1;
+ $cntInvitation = 0;
$texStatusView .= $this->StartLatexTable($export_format, $parameterTabular, $pdfTable, $rtfTable, $pdfTableWidth, $rtfTableWidth); /*zacetek tabele*/
@@ -570,8 +570,8 @@ class LatexStatus {
foreach ($this->ss->appropriateStatus as $status) {
$vrsticaA = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['valid'][$status] == 0)) {// da ne delamo po neporebnem
- $vrsticaA[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaA[] = $this->encodeText($this->ss->userByStatus['valid'][$status]);
+ $vrsticaA[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaA[] = LatexDocument::encodeText($this->ss->userByStatus['valid'][$status]);
$texStatusView .= $this->tableRow($vrsticaA,1);
$cntValid++;
}
@@ -581,15 +581,15 @@ class LatexStatus {
if ($cntValid > 0 || !$this->ss->hideNullValues_status) {
$vrsticaB = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_valid']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['valid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_valid']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['valid']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
$texStatusView .= $this->horizontalLineTex;
- $vrsticaB[] = $this->encodeText($lang['srv_statistic_redirection_sum_valid']);
- $vrsticaB[] = $this->encodeText($this->ss->cntUserByStatus['valid']);
+ $vrsticaB[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_valid']);
+ $vrsticaB[] = LatexDocument::encodeText($this->ss->cntUserByStatus['valid']);
$texStatusView .= $this->tableRow($vrsticaB,1);
$texStatusView .= $this->texNewLine;
}
@@ -598,10 +598,10 @@ class LatexStatus {
foreach ($this->ss->unAppropriateStatus as $status) {
$vrsticaC = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['nonvalid'][$status] == 0)) {// da ne delamo po neporebnem
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText($this->ss->userByStatus['nonvalid'][$status]), 0, 1, 'L', 0);
- $vrsticaC[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaC[] = $this->encodeText($this->ss->userByStatus['nonvalid'][$status]);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->userByStatus['nonvalid'][$status]), 0, 1, 'L', 0);
+ $vrsticaC[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaC[] = LatexDocument::encodeText($this->ss->userByStatus['nonvalid'][$status]);
$texStatusView .= $this->tableRow($vrsticaC,1);
$cntNonValid++;
//$this->pdf->setX($X);
@@ -610,12 +610,12 @@ class LatexStatus {
// se status null (neznan status)
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['nonvalid'][-1] == 0)) {// da ne delamo po neporebnem
$vrsticaD = array();
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_null']), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0'), 0, 1, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_null']), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0'), 0, 1, 'L', 0);
//$texStatusView .= $this->horizontalLineTex;
- $vrsticaD[] = $this->encodeText($lang['srv_userstatus_null']);
- $vrsticaD[] = $this->encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0');
+ $vrsticaD[] = LatexDocument::encodeText($lang['srv_userstatus_null']);
+ $vrsticaD[] = LatexDocument::encodeText(isset($this->ss->userByStatus['nonvalid'][-1]) ? $this->ss->userByStatus['nonvalid'][-1] : '0');
$texStatusView .= $this->tableRow($vrsticaD,1);
//$texStatusView .= $this->texNewLine;
$cntNonValid++;
@@ -626,29 +626,29 @@ class LatexStatus {
if ($cntNonValid > 0 || !$this->ss->hideNullValues_status) {
$vrsticaE = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaE[] = $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
- $vrsticaE[] = $this->encodeText($this->ss->cntUserByStatus['nonvalid']);
+ $vrsticaE[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
+ $vrsticaE[] = LatexDocument::encodeText($this->ss->cntUserByStatus['nonvalid']);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaE,1);
$texStatusView .= $this->texNewLine;
}
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']), 'T', 1, 'L', 0);
$this->pdf->setFont('','','6');
$this->pdf->setX($X); */
$texStatusView .= $this->horizontalLineTex;
$vrsticaF = array();
- $vrsticaF[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- if(($this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']))){
- $vrsticaF[] = $this->encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']);
+ $vrsticaF[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ if((LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']))){
+ $vrsticaF[] = LatexDocument::encodeText($this->ss->cntUserByStatus['valid']+$this->ss->cntUserByStatus['nonvalid']);
}else{
$vrsticaF[] = 0;
}
@@ -665,10 +665,10 @@ class LatexStatus {
foreach ($this->ss->invitationStatus as $status){
$vrsticaG = array();
if (!($this->ss->hideNullValues_status && $this->ss->userByStatus['invitation'][$status] == 0)){// da ne delamo po neporebnem
- //$this->pdf->Cell(45, 0, $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
- //$this->pdf->Cell(45, 0, $this->encodeText($this->ss->userByStatus['invitation'][$status]), 0, 1, 'L', 0);
- $vrsticaG[] = $this->encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
- $vrsticaG[] = $this->encodeText($this->ss->userByStatus['invitation'][$status]);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :'), 0, 0, 'L', 0);
+ //$this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->userByStatus['invitation'][$status]), 0, 1, 'L', 0);
+ $vrsticaG[] = LatexDocument::encodeText($lang['srv_userstatus_'.$status] . ' ('.$status.') :');
+ $vrsticaG[] = LatexDocument::encodeText($this->ss->userByStatus['invitation'][$status]);
$texStatusView .= $this->tableRow($vrsticaG,1);
$cntInvitation++;
}
@@ -678,14 +678,14 @@ class LatexStatus {
if ($cntInvitation > 0 || !$this->ss->hideNullValues_status) {
$vrsticaH = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_invitation']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($this->ss->cntUserByStatus['invitation']), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_invitation']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($this->ss->cntUserByStatus['invitation']), 'T', 1, 'L', 0);
$this->pdf->setY($this->pdf->getY() + 3);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaH[] = $this->encodeText($lang['srv_statistic_redirection_sum_invitation']);
- $vrsticaH[] = $this->encodeText($this->ss->cntUserByStatus['invitation']);
+ $vrsticaH[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_invitation']);
+ $vrsticaH[] = LatexDocument::encodeText($this->ss->cntUserByStatus['invitation']);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaH,1);
$texStatusView .= $this->texNewLine;
@@ -699,14 +699,14 @@ class LatexStatus {
$this->pdf->Cell(90, 6, '', 'B', 1, 'L', 0);
$this->pdf->setX($X);
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_test']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText((int)$this->ss->testDataCount), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_test']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText((int)$this->ss->testDataCount), 'T', 1, 'L', 0);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaI[] = $this->encodeText($lang['srv_statistic_redirection_test']);
- $vrsticaI[] = $this->encodeText((int)$this->ss->testDataCount);
+ $vrsticaI[] = LatexDocument::encodeText($lang['srv_statistic_redirection_test']);
+ $vrsticaI[] = LatexDocument::encodeText((int)$this->ss->testDataCount);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaI,1);
$texStatusView .= $this->texNewLine;
@@ -719,13 +719,13 @@ class LatexStatus {
if ($view_count > 0 || !$this->ss->hideNullValues_status){
$vrsticaJ = array();
/* $this->pdf->setFont('','B','6');
- $this->pdf->Cell(45, 0, $this->encodeText($lang['srv_statistic_redirection_sum_view']), 'T', 0, 'L', 0);
- $this->pdf->Cell(45, 0, $this->encodeText($view_count), 'T', 1, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($lang['srv_statistic_redirection_sum_view']), 'T', 0, 'L', 0);
+ $this->pdf->Cell(45, 0, LatexDocument::encodeText($view_count), 'T', 1, 'L', 0);
$this->pdf->setX($X);
$this->pdf->setFont('','','6'); */
- $vrsticaJ[] = $this->encodeText($lang['srv_statistic_redirection_sum_view']);
- $vrsticaJ[] = $this->encodeText($view_count);
+ $vrsticaJ[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_view']);
+ $vrsticaJ[] = LatexDocument::encodeText($view_count);
$texStatusView .= $this->horizontalLineTex;
$texStatusView .= $this->tableRow($vrsticaJ,1);
$texStatusView .= $this->texNewLine;
@@ -751,7 +751,7 @@ class LatexStatus {
$texAnswerStateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_answer_state_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_answer_state_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//Priprava parametrov za tabelo s podatki o anketi
@@ -784,9 +784,9 @@ class LatexStatus {
//prva vrstica
$prvaVrstica = array();
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_status']);
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_frequency']);
- $prvaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_percent']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_status']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_frequency']);
+ $prvaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_percent']);
$texAnswerStateView .= $this->tableRow($prvaVrstica,1);
$texAnswerStateView .= $this->horizontalLineTex;
@@ -795,9 +795,9 @@ class LatexStatus {
foreach ($order as $key) {
$vrstica2N = array();
- $vrstica2N[] = $this->encodeText($lang['srv_userstatus_'.$key]);
- $vrstica2N[] = $this->encodeText($this->ss->realUsersByStatus[$key]['cnt'] > 0 ? $this->ss->realUsersByStatus[$key]['cnt'] : '0');
- $vrstica2N[] = $this->encodeText( ((float)$this->ss->realUsersByStatus[$key]['percent'] > 1.0) ? '--' : $this->formatNumber($this->ss->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%') );
+ $vrstica2N[] = LatexDocument::encodeText($lang['srv_userstatus_'.$key]);
+ $vrstica2N[] = LatexDocument::encodeText($this->ss->realUsersByStatus[$key]['cnt'] > 0 ? $this->ss->realUsersByStatus[$key]['cnt'] : '0');
+ $vrstica2N[] = LatexDocument::encodeText( ((float)$this->ss->realUsersByStatus[$key]['percent'] > 1.0) ? '--' : $this->formatNumber($this->ss->realUsersByStatus[$key]['percent']*100,NUM_DIGIT_PERCENT,'%') );
$texAnswerStateView .= $this->tableRow($vrstica2N,1);
}
@@ -823,7 +823,7 @@ class LatexStatus {
$texReferalsView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_redirection_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_redirection_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
// izrisemo graf
@@ -857,8 +857,8 @@ class LatexStatus {
//naslovna vrstica
$naslovnaVrstica = array();
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_site']);
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_click']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_site']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_click']);
$texReferalsView .= $this->tableRow($naslovnaVrstica);
//pridobitev skupnega stevila klikov $value_sum za izris grafov
@@ -884,10 +884,10 @@ class LatexStatus {
if (count($this->ss->userRedirections["valid"])) {
foreach ($this->ss->userRedirections["valid"] as $key => $value) {
$vmesnaVrsticaA = array();
- $vmesnaVrsticaA[] = $this->encodeText($key);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaA[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaA[] = LatexDocument::encodeText($key);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaA[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaA[] = 0;
}
@@ -899,10 +899,10 @@ class LatexStatus {
if ($this->ss->userRedirections["direct"] > 0) {
$value = $this->ss->userRedirections["direct"];
$vmesnaVrsticaB = array();
- $vmesnaVrsticaB[] = $this->encodeText($lang['srv_statistic_redirection_direct']);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaB[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaB[] = LatexDocument::encodeText($lang['srv_statistic_redirection_direct']);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaB[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaB[] = 0;
}
@@ -913,10 +913,10 @@ class LatexStatus {
if ($this->ss->userRedirections["email"] > 0) {
$value = $this->ss->userRedirections["email"];
$vmesnaVrsticaC = array();
- $vmesnaVrsticaC[] = $this->encodeText($lang['srv_statistic_redirection_email']);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vmesnaVrsticaC[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vmesnaVrsticaC[] = LatexDocument::encodeText($lang['srv_statistic_redirection_email']);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vmesnaVrsticaC[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vmesnaVrsticaC[] = 0;
}
@@ -926,8 +926,8 @@ class LatexStatus {
// dodamo sumo
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSuma = array();
- $vrsticaSuma[] = $this->encodeText($lang['srv_statistic_redirection_sum_clicked']);
- $vrsticaSuma[] = $this->encodeText($value_sum);
+ $vrsticaSuma[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_clicked']);
+ $vrsticaSuma[] = LatexDocument::encodeText($value_sum);
$texReferalsView .= $this->tableRow($vrsticaSuma,1);
// dodamo se neveljavne *******************************************
@@ -945,10 +945,10 @@ class LatexStatus {
$value = $this->ss->userRedirections["$key"];
if ($value > 0) {
$vrsticaNeveljavni = array();
- $vrsticaNeveljavni[] = $this->encodeText($lang['srv_userstatus_'.$key]);
- if($this->encodeText($value)){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*$this->encodeText($value);
- $vrsticaNeveljavni[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $vrsticaNeveljavni[] = LatexDocument::encodeText($lang['srv_userstatus_'.$key]);
+ if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$value_sum)*LatexDocument::encodeText($value);
+ $vrsticaNeveljavni[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
}else{
$vrsticaNeveljavni[] = 0;
}
@@ -959,15 +959,15 @@ class LatexStatus {
if ($value_sum_nonvalid > 0 ) {
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSumaNeveljavni = array();
- $vrsticaSumaNeveljavni[] = $this->encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
- $vrsticaSumaNeveljavni[] = $this->encodeText($value_sum_nonvalid);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum_nonvalid']);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($value_sum_nonvalid);
$texReferalsView .= $this->tableRow($vrsticaSumaNeveljavni,1);
}
if (!($value_sum_nonvalid == 0 || $value_sum == 0 )) {
$texReferalsView .= $this->horizontalLineTex;
$vrsticaSumaNeveljavni = array();
- $vrsticaSumaNeveljavni[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- $vrsticaSumaNeveljavni[] = $this->encodeText($value_sum+$value_sum_nonvalid);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ $vrsticaSumaNeveljavni[] = LatexDocument::encodeText($value_sum+$value_sum_nonvalid);
$texReferalsView .= $this->tableRow($vrsticaSumaNeveljavni,1);
}
// dodamo se neveljavne - konec *******************************************
@@ -977,19 +977,19 @@ class LatexStatus {
//zaljucek latex tabele s podatki - konec
}
else {
- $texReferalsView .= $this->encodeText($lang['srv_statistic_show_no_referals']).$this->texNewLine;
+ $texReferalsView .= LatexDocument::encodeText($lang['srv_statistic_show_no_referals']).$this->texNewLine;
}
//stevilo razlicnih IP stevilk
$texReferalsView .= $this->texBigSkip.' ';
//$texReferalsView .= $this->texNewLine;
- $texReferalsView .= $this->encodeText($lang['srv_count_ip_list'].': '.count($this->ss->ip_list));
+ $texReferalsView .= LatexDocument::encodeText($lang['srv_count_ip_list'].': '.count($this->ss->ip_list));
if ($admin_type==0 && count($this->ss->ip_list) > 0) {
$texReferalsView .= ' '.$this->texBigSkip;
$texReferalsView .= $this->texNewLine;
- $titleTextIP = $this->encodeText($lang['srv_detail_ip_list']);
+ $titleTextIP = LatexDocument::encodeText($lang['srv_detail_ip_list']);
$titleIP = $this->returnBoldAndRed($titleTextIP);
$texReferalsView .= $this->returnBoldAndRed($titleIP).$this->texNewLine;
@@ -1016,8 +1016,8 @@ class LatexStatus {
//Izpis vrstic
foreach($this->ss->ip_list AS $key => $val) {
$vrsticaIP = array();
- $vrsticaIP[] = $this->encodeText($val);
- $vrsticaIP[] = $this->encodeText($key);
+ $vrsticaIP[] = LatexDocument::encodeText($val);
+ $vrsticaIP[] = LatexDocument::encodeText($key);
$texReferalsView .= $this->tableRow($vrsticaIP,1);
}
@@ -1040,7 +1040,7 @@ class LatexStatus {
$texDateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_timeline_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_timeline_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
$this->ss->maxValue *= GRAPH_REDUCE;
@@ -1084,11 +1084,11 @@ class LatexStatus {
foreach ($this->ss->arrayRange as $key => $value) {
$label = $this->ss->formatStatsString($key, $this->ss->period);
$vmesnaVrstica = array();
- $vmesnaVrstica[] = $this->encodeText($label);
- //if($this->encodeText($value)){ //ce vrednost ni nula
+ $vmesnaVrstica[] = LatexDocument::encodeText($label);
+ //if(LatexDocument::encodeText($value)){ //ce vrednost ni nula
if($value){ //ce vrednost ni nula
- $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$cnt)*$this->encodeText($value);
- //$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, $this->encodeText($value));
+ $graphLineLength = (GRAPH_LINE_LENGTH_MAX/$cnt)*LatexDocument::encodeText($value);
+ //$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, LatexDocument::encodeText($value));
$vmesnaVrstica[] = $this->drawGraphLatex($graphLineLength, $value);
}else{
$vmesnaVrstica[] = 0;
@@ -1100,8 +1100,8 @@ class LatexStatus {
// dodamo sumo
$texDateView .= $this->horizontalLineTex;
$vrsticaSuma = array();
- $vrsticaSuma[] = $this->encodeText($lang['srv_statistic_redirection_sum']);
- $vrsticaSuma[] = $this->encodeText($cnt);
+ $vrsticaSuma[] = LatexDocument::encodeText($lang['srv_statistic_redirection_sum']);
+ $vrsticaSuma[] = LatexDocument::encodeText($cnt);
$texDateView .= $this->tableRow($vrsticaSuma,1);
//zaljucek latex tabele s podatki
@@ -1109,7 +1109,7 @@ class LatexStatus {
//zaljucek latex tabele s podatki - konec
}
else {
- $texDateView .= $this->encodeText($lang['srv_no_data']).$this->texNewLine;
+ $texDateView .= LatexDocument::encodeText($lang['srv_no_data']).$this->texNewLine;
}
//izpis tabele in beedila v okvir
@@ -1127,7 +1127,7 @@ class LatexStatus {
$texPagesStateView = '';
//naslov okvirja
- $titleText = $this->encodeText($lang['srv_statistic_pages_state_title']).$this->texNewLine;
+ $titleText = LatexDocument::encodeText($lang['srv_statistic_pages_state_title']).$this->texNewLine;
$title = $this->returnBoldAndRed($titleText);
//ali lovimo samo strani ki niso bile preskočene
@@ -1173,21 +1173,21 @@ class LatexStatus {
//Priprava podatkov za izpis vrstic tabele in izpis vrstic
//naslovna vrstica
$naslovnaVrstica = array();
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_answer_state_status']);
- $naslovnaVrstica[] = $this->encodeText($lang['srv_statistic_redirection_click']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_answer_state_status']);
+ $naslovnaVrstica[] = LatexDocument::encodeText($lang['srv_statistic_redirection_click']);
$texPagesStateView .= $this->tableRow($naslovnaVrstica);
# status 3 - "Klik na anketo"
$value = $this->ss->realUsersByStatus['3ll']['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_3']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_3']), LatexDocument::encodeText($value), $maxValue);
# status 4 - "Klik na prvo stran"
$value = $this->ss->realUsersByStatus['4ll']['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_4']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_4']), LatexDocument::encodeText($value), $maxValue);
# status 5 - "Zacel izpolnjevati",
$value = $this->ss->realUsersByStatus[5]['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_5']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_5']), LatexDocument::encodeText($value), $maxValue);
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
$texPagesStateView .= $this->texNewLine; //prazna crta
@@ -1195,7 +1195,7 @@ class LatexStatus {
#strani
foreach ($pages as $key => $page) {
$value = $page['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($page['naslov']), $this->encodeText($value), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($page['naslov']), LatexDocument::encodeText($value), $maxValue);
}
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
@@ -1203,7 +1203,7 @@ class LatexStatus {
# status 6 - "Koncal",
$value6 = $this->ss->realUsersByStatus[6]['cnt'];
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_6']), $this->encodeText($value6), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_6']), LatexDocument::encodeText($value6), $maxValue);
#če imamo lurkerje 6l dodamo skupaj konačal anketo (to je 6 + 6l) in nato še koliko jih je samo s statusom 6 (končal anketo)
# status 6l - "Koncal - lurker", izpišemo samo če obstajajo 6l
@@ -1212,13 +1212,13 @@ class LatexStatus {
$valueall = $this->ss->realUsersByStatus['6ll']['cnt'] ;
# končal s tem da je lurker (6l)
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_6l']), $this->encodeText($lurkerjev), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_6l']), LatexDocument::encodeText($lurkerjev), $maxValue);
#črta
$texPagesStateView .= $this->horizontalLineTex; //horizontalna crta
# končal ne glede na to ali je lurker
- $texPagesStateView .= $this->displayStatusLine($this->encodeText($lang['srv_userstatus_all']), $this->encodeText($valueall), $maxValue);
+ $texPagesStateView .= $this->displayStatusLine(LatexDocument::encodeText($lang['srv_userstatus_all']), LatexDocument::encodeText($valueall), $maxValue);
}
//zaljucek latex tabele s podatki
@@ -1269,151 +1269,7 @@ class LatexStatus {
return $result;
}
-
- #moja funkcija encodeText
- function encodeText($text=''){
- // popravimo sumnike ce je potrebno
- //$text = html_entity_decode($text, ENT_NOQUOTES, 'UTF-8');
- //$text = str_replace("&scaron;","š",$text);
- //echo "Encoding ".$text."</br>";
- if($text == ''){ //ce ni teksta, vrni se
- return;
- }
- $textOrig = $text;
- $findme = '<br />';
- $findmeLength = strlen($findme);
- $findImg = '<img';
- $findImgLength = strlen($findImg);
-
- $pos = strpos($text, $findme);
- $posImg = strpos($text, $findImg);
-
- //ureditev izrisa slike
- if($posImg !== false){
- $numOfImgs = substr_count($text, $findImg); //stevilo '<br />' v tekstu
- $posImg = strpos($text, $findImg);
- $textPrej = '';
- $textPotem = '';
- for($i=0; $i<$numOfImgs; $i++){
- $posImg = strpos($text, $findImg);
- $textPrej = substr($text, 0, $posImg); //tekst do img
- $textPotem = substr($text, $posImg); //tekst po img, z vkljuceno hmlt kodo z img
- $posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
- $textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
-
- $text = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
- //$text2Return = $textPrej.' '.PIC_SIZE_ANS."{".$this->getImageName($text2Return, 0, 'img')."}".' '.$textPotem;
- }
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
- $findImgCode = '\includegraphics';
- $posOfImgCode = strpos($text, $findImgCode);
- //echo $posOfImgCode."</br>";
- $textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
- //echo $textToImgCode."</br>";
- $textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
- //echo $textFromImgCode."</br>";
- $findImgCodeEnd = '}';
- //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
- $posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
- //echo $posOfImgCodeEnd."</br>";
- $textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
- //echo $textAfterImgCode."</br>";
- $textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
- //echo $textOfImgCode."</br>";
-
- $text = $textToImgCode.$textAfterImgCode;
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike - konec
- }
- //ureditev izrisa slike - konec
-
- //ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
- $text = str_replace('\\','\textbackslash{} ',$text);
- //$text = str_replace('{','\{',$text);
- //$text = str_replace('}','\}',$text);
- $text = str_replace('$','\$ ',$text);
- $text = str_replace('#','\# ',$text);
- $text = str_replace('%','\% ',$text);
- $text = str_replace('€','\euro',$text);
- $text = str_replace('^','\textasciicircum{} ',$text);
- //$text = str_replace('_','\_ ',$text);
- $text = str_replace('_','\_',$text);
- $text = str_replace('~','\textasciitilde{} ',$text);
- $text = str_replace('&amp;','\&',$text);
- $text = str_replace('&','\&',$text);
- //$text = str_replace('&lt;','\textless ',$text);
- $text = str_replace('&lt;','\textless',$text);
- //$text = str_replace('&gt;','\textgreater ',$text);
- $text = str_replace('&gt;','\textgreater',$text);
- $text = str_replace('&nbsp;',' ',$text);
- //ureditev posebnih karakterjev za Latex - konec
-
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
- if($posImg !== false){
- $text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
- }
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
-
- if($pos === false && $posImg === false) { //v tekstu ni br in img
- //return $text;
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); */
- }else { //v tekstu sta prisotna br ali img
- $text2Return = ''; //tekst ki bo vrnjen
-
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
- if($pos !== false){
- $pos = strpos($text, $findme);
- $numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
- for($i=0; $i<$numOfBr; $i++){
- if($i == 0){ //ce je prvi najdeni '<br />'
- $textPrej = substr($text, 0, $pos);
- $textPotem = substr($text, $pos+$findmeLength);
- if($i == $numOfBr-1){
- $text2Return .= $textPrej.' \break '.$textPotem;
- }else{
- $text2Return .= $textPrej.' \break ';
- }
- }else{ //drugace
- $pos = strpos($textPotem, $findme);
- $textPrej = substr($textPotem, 0, $pos);
- $textPotem = substr($textPotem, $pos+$findmeLength);
- if($i == $numOfBr-1){
- $text2Return .= $textPrej.' \break '.$textPotem;
- }else{
- $text2Return .= $textPrej.' \break ';
- }
- }
- }
- $text = $text2Return;
- }
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
-/* echo "encode pred strip: ".$text."</br>";
- echo "encode po strip: ".strip_tags($text)."</br>";
- return strip_tags($text); //vrni tekst brez html tag-ov */
- }
- //preveri, ce je url v besedilu (http:// ... ) in uredi Latex izpis le-tega
- $findHttp = 'http://';
- $findHttps = 'https://';
- $posHttp = strpos($text, $findHttp);
- $posHttps = strpos($text, $findHttps);
-
- if($posHttp !== false || $posHttps !== false) { //v imamo URL naslov
- $space = ' ';
- if($posHttp !== false){
- $text = substr_replace($text, $space, ($posHttp+7), 0);
- }elseif($posHttps !== false){
- $text = substr_replace($text, $space, ($posHttps+8), 0);
- }
- }
- //preveri, ce je url v besedilu (http:// ... ) in uredi Latex izpis le-tega - konec
-
- return strip_tags($text); //vrni tekst brez html tag-ov
- }
-
function returnBold($text=''){
$boldedText = '';
$boldedText .= '\textbf{'.$text.'}';
@@ -1460,13 +1316,9 @@ class LatexStatus {
function tableRow($arrayText=[], $brezHline=0){
$tableRow = '';
- /*$linecount = $this->pdf->getNumLines($this->encodeText($arrayText[1]), 90);
+ /*$linecount = $this->pdf->getNumLines(LatexDocument::encodeText($arrayText[1]), 90);
$linecount == 1 ? $height = 4.7 : $height = 4.7 + ($linecount-1)*3.3;*/
- $height = 1; //$height = $this->getCellHeight($this->encodeText($arrayText[1]), 90);
-
- if($arrayParams['align2'] != 'C')
- $arrayParams['align2'] = 'L';
- //echo "velikost polja s tekstom: ".count($arrayText)."</br>";
+ $height = 1; //$height = $this->getCellHeight(LatexDocument::encodeText($arrayText[1]), 90);
for($i=0;$i<count($arrayText);$i++){
//echo "array text: ".$arrayText[$i]."</br>";
diff --git a/admin/survey/export/latexclasses/class.LatexSurvey.php b/admin/survey/export/latexclasses/class.LatexSurvey.php
index 7f93749..575043e 100644
--- a/admin/survey/export/latexclasses/class.LatexSurvey.php
+++ b/admin/survey/export/latexclasses/class.LatexSurvey.php
@@ -10,14 +10,14 @@
include('../../vendor/autoload.php');
-define("RADIO_BTN_SIZE", 0.13);
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
+if (!defined('PIC_SIZE_ANS')) define("PIC_SIZE_ANS", "\includegraphics[width=3cm]"); //slika dolocene sirine
class LatexSurvey{
var $anketa; // ID ankete
var $tex; //shrani tex kodo
var $texNewLine = '\\\\ ';
- //var $texPageBreak = "\\pagebreak";
var $texPageBreak = "\\newpage";
var $export_format;
var $export_data_show_recnum;
@@ -28,6 +28,7 @@ class LatexSurvey{
var $loop_id = null; // id trenutnega loopa ce jih imamo
var $db_table = '';
+ var $path2Images = '';
protected $showIntro = 0;
protected $showGDPRIntro = 0;
@@ -43,13 +44,18 @@ class LatexSurvey{
protected $usr_id = 0;
protected $texBigSkip = '\bigskip';
+ protected $grupa = 0;
+ protected $currentHeight = 0;
+ protected $variableName = '';
+
protected $admin_type;
protected $path2UploadedImages;
protected $language = -1; // Katero verzijo prevoda izvazamo
+
+ public static $spremenljivka;
- //function __construct($anketa, $export_format){
function __construct($anketa=null, $export_format='', $export_show_intro=null, $export_show_if=null, $export_data_skip_empty=null, $export_data_skip_empty_sub=null){
global $site_path, $global_user_id, $admin_type, $lang;
@@ -58,7 +64,7 @@ class LatexSurvey{
$this->admin_type = $admin_type;
- $this->usr_id = $_GET['usr_id'];
+ $this->usr_id = isset($_GET['usr_id']) ? $_GET['usr_id'] : '';
$this->showIntro = $export_show_intro;
$this->showIf = $export_show_if;
@@ -73,12 +79,9 @@ class LatexSurvey{
//Prikazi GDPR v uvodu
$gdpr = new GDPR();
$this->showGDPRIntro = $gdpr->isGDPRSurveyTemplate($this->anketa);
- //echo "gdpr nastavitve: ".$this->showGDPRIntro."</br>";
if($this->showGDPRIntro){
$this->GDPRIntro = $gdpr->getSurveyIntro($this->anketa);
- //echo "gdpr te: ".$this->GDPRIntro."</br>";
}
-
if ($this->usr_id != '') {
$sqlR = sisplet_query("SELECT recnum FROM srv_user WHERE id = '$this->usr_id '");
$rowR = mysqli_fetch_array($sqlR);
@@ -95,9 +98,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;
@@ -107,7 +108,7 @@ class LatexSurvey{
#funkcija, ki skrbi za izpis praznega vprasalnika in vprasalnika z odgovori enega respondenta
public function displaySurvey($export_subtype='', $export_data_type='', $language=null){
global $lang, $site_url;
- //echo "Funkcija displaySurvey user: $this->usr_id</br>";
+
$this->language = $language;
if($this->language!=-1){
// Naložimo jezikovno datoteko
@@ -130,12 +131,13 @@ class LatexSurvey{
$tmp_svp_pv[$vid] = substr($vid, 0, strpos($vid, '_'));
}
-
+ $tex = '';
+
if($export_subtype=='q_data'){ //ce je vprasalnik za enega respondenta
//pridobitev podatkov trenutnega respondenta za izpis Recnum
$izbranStatusProfile = SurveyStatusProfiles :: getStatusAsQueryString();
$sqluString = "SELECT id, last_status, lurker, recnum FROM srv_user WHERE ank_id = '".$this->anketa."' ".$izbranStatusProfile." AND deleted='0' AND preview='0' AND id='".$this->usr_id."' ORDER BY recnum";
- //echo $sqluString;
+
$sqlu = sisplet_query($sqluString);
$rowu = mysqli_fetch_array($sqlu);
$recnum = $rowu['recnum'];
@@ -145,20 +147,18 @@ class LatexSurvey{
$recnumBesedilo = "";
}
//pridobitev podatkov trenutnega respondenta za izpis Recnum - konec
-
-
-
- //$tex .= $lang['srv_respondent_answer'].": ".$this->recnum;
- $tex .= '\MakeUppercase{\huge \textbf{'.$lang['srv_respondent_answer'].' '.$recnumBesedilo.'}}'; //izpisi "Odgovori respondenta"
+
+ $tex .= '\MakeUppercase{\huge \textbf{'./* $lang['srv_respondent_answer']. */' '.$recnumBesedilo.'}}'; //izpisi "Odgovori respondenta"
$tex .= $this->texNewLine;
$tex .= $this->texNewLine;
}
-
//ce je potrebno izpisati GDPR besedilo v intro
- if($this->showGDPRIntro == 1){
- //$GDPRintro = "gdpr INTRO";
+ if($this->showGDPRIntro == 1){
$GDPRintro = strip_tags($this->GDPRIntro, '<a><img><ul><li><ol><br><p>');
- $GDPRintro = $this->encodeTextHere($GDPRintro);
+
+ //$GDPRintro = $this->encodeTextHere($GDPRintro);
+ $GDPRintro = LatexDocument::encodeText($GDPRintro, 0, 0, 0, 'gdpr');
+
$tex .= ' \textbf{'.$GDPRintro.'} ';
//radio buttona
@@ -176,11 +176,11 @@ class LatexSurvey{
//pridobitev informacije obiska strani oz. ankete
$sqlStringStran = "SELECT time_edit FROM srv_user_grupa".$this->db_table." WHERE usr_id='".$this->usr_id."' AND gru_id='".$grupa."'";
- //echo $sqlStringStran;
+
$sqlStran = sisplet_query($sqlStringStran);
$rowStran = mysqli_fetch_array( $sqlStran );
$stran = $rowStran['time_edit'];
- //echo $stran;
+
//pridobitev informacije obiska strani oz. ankete - konec
if($stran){
@@ -209,28 +209,31 @@ class LatexSurvey{
{
//preverjanje, ali je prevod
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ //$this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
$prevod = 1;
}else{
$prevod = 0;
}
//preverjanje, ali je prevod - konec
- //if($this->language!=-1){ //ce je prevod ankete
if($prevod){ //ce je prevod ankete
$spr_id_uvod = -1;
$sqll = sisplet_query("SELECT naslov, info FROM srv_language_spremenljivka WHERE ank_id='".$this->anketa."' AND spr_id='".$spr_id_uvod."' AND lang_id='".$this->language."'");
$rowl = mysqli_fetch_array($sqll); //pridobi prevod uvoda v ustreznem jeziku
$intro = $rowl['naslov']; //prevod uvoda v ustreznem jeziku
}else{
- $intro = (SurveyInfo::getInstance()->getSurveyIntro() == '') ? $lang['srv_intro'] : SurveyInfo::getInstance()->getSurveyIntro();
- }
- $tex .= $this->encodeTextHere($intro);
+ $sqlIntroString = "SELECT introduction FROM srv_anketa WHERE id=".$this->anketa." ";
+ $sqlIntro = sisplet_query($sqlIntroString);
+ $rowl = mysqli_fetch_array($sqlIntro); //pridobi besedilu uvoda
+ $intro = $rowl['introduction']; //prevod uvoda v ustreznem jeziku
+ }
+ $tex .= LatexDocument::encodeText($intro, 0, 0, 0, 'intro');
if($intro){
+ $tex .= "\r\n";
$tex .= $this->texNewLine;
$tex .= $this->texNewLine;
}
-
}
}
@@ -244,22 +247,19 @@ class LatexSurvey{
}
$question = new LatexSurveyElement($this->anketa, $this->export_format, 0, $this->usr_id, $export_subtype, $language);
-
########
while ( $rowGrupe = mysqli_fetch_assoc( $sqlGrupe ) )
{ // sprehodmo se skozi grupe ankete
$this->grupa = $rowGrupe['id'];
-
// Pogledamo prvo spremenljivko v grupi ce je v loopu
$sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC");
$row = mysqli_fetch_array($sql);
-
+
// ce je ima loop za parenta
- $if_id = $this->find_parent_loop($row['id']);
+ $if_id = isset(($row['id']))?$this->find_parent_loop($row['id']):null;
if ($if_id > 0 && ($export_subtype=='q_data'||$export_subtype=='q_data_all')){ //ce je loop in (je izpis odgovorov respondentov)
$texLoop = '';
- //echo "Je v loopu $if_id </br>";
$sql1 = sisplet_query("SELECT if_id FROM srv_loop WHERE if_id = '$if_id'");
$row1 = mysqli_fetch_array($sql1);
@@ -277,14 +277,13 @@ class LatexSurvey{
// Izrisemo naslov loopa
$tex .= $this->dataPiping($loop_title);
-
+ $zaporedna = 0;
//TODO: TUdi tu se celotna spremenljivka prenaša naprej
- $sqlSpremenljivke = sisplet_query("SELECT id, tip, visible, sistem, variable, naslov, info, orientation, dostop FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC");
- //echo "SELECT id, tip, visible, sistem, variable, naslov, info, orientation FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC "."</br>";
+ $sqlSpremenljivke = sisplet_query("SELECT id, tip, visible, sistem, variable, naslov, info, orientation, dostop, grids, ranking_k, enota, grid_subtitle1, grid_subtitle2, text_kosov, text_orientation, signature, upload, size, design, vsota FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC");
while ($rowSpremenljivke = mysqli_fetch_assoc($sqlSpremenljivke))
{ // sprehodimo se skozi spremenljivke grupe
-
+
$spremenljivka = $rowSpremenljivke['id'];
if ($rowSpremenljivke['visible'] == 0 || !( ($this->admin_type <= $rowSpremenljivke['dostop'] && $this->admin_type>=0) || ($this->admin_type==-1 && $rowSpremenljivke['dostop']==4) ) ) {
@@ -308,16 +307,23 @@ class LatexSurvey{
{
if ($rowSpremenljivke['sistem'] == 1)
{ // če je oboje = vijolčno
- $this->pdf->SetTextColor(128,0,128);
+ //$this->pdf->SetTextColor(128,0,128);
}
else
{ // Če je skrito = rdeče
- $this->pdf->SetTextColor(255,0,0);
+ //$this->pdf->SetTextColor(255,0,0);
}
}
else if ($rowSpremenljivke['sistem'] == 1)
- $this->pdf->SetTextColor(0,0,255);
-
+ {
+ //$this->pdf->SetTextColor(0,0,255);
+ }
+
+ // če imamo številčenje Type = 1 potem številčimo V1
+ if (SurveyInfo::getInstance()->getSurveyCountType())
+ $zaporedna++;
+ $stevilcenje = ( SurveyInfo::getInstance()->getSurveyCountType() ) ?
+ ( ( SurveyInfo::getInstance()->getSurveyCountType() == 2 ) ? $rowSpremenljivke['variable'].") " : $zaporedna.") " ) : null;
// Izpis vprasalnika z rezultati
@@ -363,11 +369,8 @@ class LatexSurvey{
$loop_id = 'IS NULL';
$zaporedna = 0;
//TODO: Omenjen query je potrebno optimizirati in da se naprej samo prenaša ID, ki se potem v podfunkcijah kliče ustrezen query
- // trenutno se potrebuje: id, tip, visible, sistem, variable, params
- $sqlSpremenljivke = sisplet_query("SELECT * FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC");
-
- //$testniStavek = "SELECT * FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC";
- //echo "sql stavek za testiranje: ".$testniStavek."</br>";
+ // trenutno se potrebuje: id, tip, visible, sistem, variable, params
+ $sqlSpremenljivke = sisplet_query("SELECT id, tip, visible, sistem, variable, params, dostop, naslov, orientation, info, grids, ranking_k, enota, grid_subtitle1, grid_subtitle2, text_kosov, text_orientation, signature, upload, size, design, vsota FROM srv_spremenljivka WHERE gru_id='".$this->grupa."' AND visible='1' ORDER BY vrstni_red ASC");
while ($rowSpremenljivke = mysqli_fetch_assoc($sqlSpremenljivke)){ // sprehodimo se skozi spremenljivke grupe
$spremenljivka = $rowSpremenljivke['id'];
@@ -383,7 +386,6 @@ class LatexSurvey{
$preveriSpremenljivko = $this->checkSpremenljivka($spremenljivka);
}
- //if ( $this->checkSpremenljivka ($spremenljivka) /*|| $this->showIf == 1*/ )
if ($preveriSpremenljivko)
{ // lahko izrišemo spremenljivke
@@ -587,7 +589,7 @@ class LatexSurvey{
if ( mysqli_num_rows($sql) > 0 && ( (int)$question_resp_comment_viewadminonly + (int)$question_comment_viewadminonly ) > 0 ) {
-
+ $zaporedna = 0;
while ($row = mysqli_fetch_array($sql)) {
$sql1 = sisplet_query("SELECT thread, note FROM srv_spremenljivka WHERE id = '$row[id]'");
@@ -613,6 +615,12 @@ class LatexSurvey{
if ($this->commentType == 5) $only_unresolved = " AND ocena = 3 ";
if ($this->commentType == 5) $only_unresolved2 = " AND text2 = 3 ";
+
+ // če imamo številčenje Type = 1 potem številčimo V1
+ if (SurveyInfo::getInstance()->getSurveyCountType())
+ $zaporedna++;
+ $stevilcenje = ( SurveyInfo::getInstance()->getSurveyCountType() ) ?
+ ( ( SurveyInfo::getInstance()->getSurveyCountType() == 2 ) ? $row['variable'].") " : $zaporedna.") " ) : null;
$tema_vsebuje = substr($lang['srv_forum_intro'],0,10); // da ne prikazujemo 1. default sporocila
@@ -642,11 +650,11 @@ class LatexSurvey{
//$tex .= $texNewLine;
$tex .= $this->texNewLine;
- $tex .= $question->encodeText($lang['hour_comment']);
+ $tex .= LatexDocument::encodeText($lang['hour_comment']);
//$tex .= $texNewLine;
$tex .= $this->texNewLine;
- $tex .= $question->encodeText($row1['note']);
+ $tex .= LatexDocument::encodeText($row1['note']);
}
}
@@ -656,17 +664,15 @@ class LatexSurvey{
if (mysqli_num_rows($sqlt) > 0) {
//$tex .= $texNewLine;
$tex .= $this->texNewLine;
- //$tex .= '\textbf{'.$question->encodeText($lang['srv_admin_comment']).'}'; //izpis naslova komentarjev
- $tex .= '\textcolor{komentar}{\textbf{'.$question->encodeText($lang['srv_admin_comment']).'}}'; //izpis naslova komentarjev
- //$tex .= '\textcolor{komentar}{\textbf{'.$question->encodeText($lang['srv_admin_comment']).'}}'; //izpis naslova komentarjev
+ $tex .= '\textcolor{komentar}{\textbf{'.LatexDocument::encodeText($lang['srv_admin_comment']).'}}'; //izpis naslova komentarjev
$tex .= '\\\\';
$i = 0;
while ($rowt = mysqli_fetch_array($sqlt)) {
- $tex .= '\textbf{'.$question->encodeText($f->user($rowt['uid'])).'}'; //izpis imena trenutnega urednika
+ $tex .= '\textbf{'.LatexDocument::encodeText($f->user($rowt['uid'])).'}'; //izpis imena trenutnega urednika
- $tex .= $question->encodeText(' ('.$f->datetime1($rowt['time']).'):'); //izpis datuma komentarja
+ $tex .= LatexDocument::encodeText(' ('.$f->datetime1($rowt['time']).'):'); //izpis datuma komentarja
$tex .= '\\\\';
@@ -674,7 +680,7 @@ class LatexSurvey{
$vsebina = $rowt['vsebina'];
$odgovori = explode("<blockquote style=\"margin-left:20px\">", $vsebina);
- $tex .= $question->encodeText($odgovori[0]); //izpis komentarja
+ $tex .= LatexDocument::encodeText($odgovori[0]); //izpis komentarja
unset($odgovori[0]);
foreach($odgovori as $odgovor){ //izpis replik
@@ -683,12 +689,12 @@ class LatexSurvey{
$tex .= '\\\\';
$tex .= '\forceindent'; //da je indented
- $tex .= '\textbf{'.$question->encodeText($avtor[0]).'} '; //avtor replike
- $tex .= $question->encodeText($avtor[1]); //izpis datuma replike
+ $tex .= '\textbf{'.LatexDocument::encodeText($avtor[0]).'} '; //avtor replike
+ $tex .= LatexDocument::encodeText($avtor[1]); //izpis datuma replike
$tex .= '\\\\';
$tex .= '\forceindent '; //da je indented
- $tex .= $question->encodeText($odgovor[1]); //izpis replike
+ $tex .= LatexDocument::encodeText($odgovor[1]); //izpis replike
}
// Crta
@@ -703,14 +709,8 @@ class LatexSurvey{
if ($row2['count'] > 0) {
if ($admin_type <= $question_resp_comment_viewadminonly) {
-
-/* $this->pdf->Ln(3);
- $this->pdf->setFont('','B', 10);
- $this->pdf->Write (0, $this->encodeText($lang['srv_repondent_comment']), '', 0, 'l', 1, 1); */
- //$tex .= $texNewLine;
$tex .= $this->texNewLine;
- //$tex .= '\textbf{'.$question->encodeText($lang['srv_repondent_comment']).'}'; //izpisa naslova komentarjev
- $tex .= '\textcolor{komentar}{\textbf{'.$question->encodeText($lang['srv_repondent_comment']).'}}'; //izpisa naslova komentarjev
+ $tex .= '\textcolor{komentar}{\textbf{'.LatexDocument::encodeText($lang['srv_repondent_comment']).'}}'; //izpisa naslova komentarjev
$tex .= '\\\\';
//$this->pdf->Ln(3);
@@ -720,16 +720,12 @@ class LatexSurvey{
$sqlt = sisplet_query("SELECT d.text AS text, u.time_edit AS time_edit FROM srv_data_text".$this->db_table." d, srv_user u WHERE d.spr_id='0' AND d.vre_id='$row[id]' AND u.id=d.usr_id $only_unresolved2 ORDER BY d.id ASC");
if (!$sqlt) echo mysqli_error($GLOBALS['connect_db']);
while ($rowt = mysqli_fetch_array($sqlt)) {
-
-/* $this->pdf->setFont('','', 10);
- $this->pdf->Write(0, $this->encodeText($f->datetime1($rowt['time_edit']).':'), '', 0, 'l', 1, 1);*/
-
- $tex .= $question->encodeText($f->datetime1($rowt['time_edit']).':'); //izpis datuma komentarja
+
+ $tex .= LatexDocument::encodeText($f->datetime1($rowt['time_edit']).':'); //izpis datuma komentarja
$tex .= '\\\\';
- //$this->pdf->MultiCell(100, 0, $this->encodeText($rowt['text']),0,'L',0,1,0,0,true,0);
- $tex .= $question->encodeText($rowt['text']); //izpis komentarja respondenta
+ $tex .= LatexDocument::encodeText($rowt['text']); //izpis komentarja respondenta
$tex .= '\\\\';
@@ -1070,14 +1066,16 @@ class LatexSurvey{
$sql = sisplet_query("SELECT parent FROM srv_branching WHERE element_spr = '$element_spr' AND element_if = '$element_if' AND ank_id='".$this->anketa."'");
if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
$row = mysqli_fetch_array($sql);
+
+ $row_parent = isset($row['parent'])?$row['parent']:null;
- if ($row['parent'] == 0) return 0;
-
+ if ($row_parent == 0) return 0;
+
$count = sisplet_query("SELECT COUNT(*) AS st FROM srv_if WHERE id = '$row[parent]' AND tip = '2'", "obj");
if ($count->st > 0) {
- return $row['parent'];
+ return $row_parent;
}else {
- return $this->find_parent_loop(0, $row['parent']);
+ return $this->find_parent_loop(0, $row_parent);
}
}
@@ -1217,11 +1215,34 @@ class LatexSurvey{
}
#funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno
- function encodeTextHere($text='', $vre_id=0){
+ function encodeTextHere($text='', $vre_id=0, $naslovStolpca = 0, $img_id=0){
global $site_path, $lang;
-
+ //$text = str_replace(' ','X',$text); //nadomesti presledke
//echo "Encoding ".$text."</br>";
//echo "vre_id: ".$vre_id."</br>";
+ //echo "ime spremenljivke ".$this->variableName."</br>";
+
+ $text = ($text!=null && $text='' ? htmlspecialchars_decode($text) : ''); //vse html special chars kot je &amp; spremeni v ustrezne simbole (npr. &amp;=>&)
+
+ //resevanje razbirajanja predolgih neprekinjenih besed in URL - spremenljivke za kasnejsi prilagojen izpis
+ //$numOfWords = str_word_count($text, 0);
+ $numOfSpacesPrej = substr_count($text, ' '); //stevilo presledkov v besedilu
+ $stringLength = strlen($text);
+
+ $findSpace = ' ';
+ $posSpace1 = strpos($text, $findSpace); //najdi pozicijo prvega presledka v besedilu
+ $posSpace2 = strripos($text, $findSpace); //najdi pozicijo zadnjega presledka v besedilu
+
+
+ $findHttp = 'http://';
+ $findHttps = 'https://';
+ $posHttp = strpos($text, $findHttp);
+ $posHttps = strpos($text, $findHttps);
+ $isURL = 0;
+ /* if($posHttp !== false || $posHttps !== false) { //imamo URL naslov
+ $isURL = 1;
+ } */
+ //resevanje razbirajanja predolgih neprekinjenih besed in URL - konec
$this->path2UploadedImages = $site_path.'uploadi/editor/';
if($text == ''){ //ce ni teksta, vrni se
@@ -1234,6 +1255,7 @@ class LatexSurvey{
$findImgLength = strlen($findImg);
$findUl = '<ul';
$findUlLength = strlen($findUl);
+ $findOl = '<ol';
$findLi = '<li';
$findPar = '<p>';
@@ -1241,28 +1263,140 @@ class LatexSurvey{
$pos = strpos($text, $findme);
$posImg = strpos($text, $findImg);
$posUl = strpos($text, $findUl);
+ $posOl = strpos($text, $findOl);
$posLi = strpos($text, $findLi);
$posPar = strpos($text, $findPar);
-
+ //echo "pozicija paragrafa: $posPar </br>";
+
+ //ureditev izrisa slike
+ if($posImg !== false){
+ $numOfImgs = substr_count($text, $findImg); //stevilo '<img ' v tekstu
+ $posImg = strpos($text, $findImg);
+ $textPrej = '';
+ $textPotem = '';
+ for($i=0; $i<$numOfImgs; $i++){
+ $posImg = strpos($text, $findImg);
+ $textPrej = substr($text, 0, $posImg); //tekst do img
+ $textPotem = substr($text, $posImg); //tekst po img, z vkljuceno hmlt kodo z img
+ $posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
+ $textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
+
+ $imageName = $this->path2UploadedImages."".$this->getImageName($text, 0, '<img', $vre_id, $img_id);
+ $imageNameTest = $imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
+ //echo $imageName."</br>";
+ //error_log("iz survey element: ".$imageNameTest);
+ //echo("iz survey element imageNameTest: ".$imageNameTest."</br>");
+ //echo "Obstaja ? ".file_exists($imageNameTest)."</br>";
+ //echo("iz survey element imageName: ".$imageName."</br>");
+ //echo "velikost: ".filesize($imageNameTest)."</br>";
+/* if(filesize($imageNameTest) > 0){
+ $text = $textPrej.' '.PIC_SIZE_ANS."{".$imageName."}".' '.$textPotem;
+ }else{
+ $image = $lang['srv_pc_unavailable'];
+ $text = $textPrej.' '.$image.' '.$textPotem;
+ } */
+ $text = '';
+ //$text = $textPrej.' ';
+
+ //if(filesize($imageNameTest) > 0){
+ if(file_exists($imageNameTest)){
+ $text .= $textPrej.' '.PIC_SIZE_ANS."{".$imageName."}";
+ }else{
+ $image = $lang['srv_pc_unavailable'];
+ $text .= $image;
+ }
+ $text .= ' '.$textPotem;
+ }
+
+ //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
+ $findImgCode = '\includegraphics';
+ $posOfImgCode = strpos($text, $findImgCode);
+ //echo $posOfImgCode."</br>";
+ $textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
+ //echo $textToImgCode."</br>";
+ $textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
+ //echo $textFromImgCode."</br>";
+ $findImgCodeEnd = '}';
+ //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
+ $posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
+ //echo $posOfImgCodeEnd."</br>";
+ $textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
+ //echo $textAfterImgCode."</br>";
+ $textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
+ //echo $textOfImgCode."</br>";
+
+ $text = $textToImgCode.$textAfterImgCode;
+
+ //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike - konec
+ }
+ //ureditev izrisa slike - konec
+
//ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
$text = str_replace('\\','\textbackslash{} ',$text);
//$text = str_replace('{','\{',$text);
//$text = str_replace('}','\}',$text);
$text = str_replace('$','\$ ',$text);
- $text = str_replace('#','\# ',$text);
+
+ if(substr_count($text, '#')){ //ce je stevilo # vecje od 1
+ $text = str_replace('#','\#',$text);
+ }else{
+ $text = str_replace('#','\# ',$text);
+ }
$text = str_replace('%','\% ',$text);
$text = str_replace('€','\euro',$text);
$text = str_replace('^','\textasciicircum{} ',$text);
$text = str_replace('_','\_ ',$text);
$text = str_replace('~','\textasciitilde{} ',$text);
- $text = str_replace('&amp;','\&',$text);
+ if(strpos($text, '&amp;')){ //ce je prisotno v besedilu &amp;'
+ $text = str_replace('&amp;','\& ',$text);
+ }else{
+ $text = str_replace('&','\& ',$text);
+ }
+ $text = str_replace('&nbsp;','~',$text);
//$text = str_replace('&lt;','\textless ',$text);
- $text = str_replace('&lt;','\textless',$text);
+ $text = str_replace('&lt;',' \textless ',$text);
//$text = str_replace('&gt;','\textgreater ',$text);
- $text = str_replace('&gt;','\textgreater',$text);
+ $text = str_replace('&gt;',' \textgreater ',$text);
//ureditev posebnih karakterjev za Latex - konec
+ //ureditev grskih crk
+ /* $text = str_replace('α','\textalpha ',$text); //ά
+ $text = str_replace('ά','\textalpha ',$text);
+ $text = str_replace('β','\textbeta ',$text);
+ $text = str_replace('γ','\textgamma ',$text);
+ $text = str_replace('δ','\textdelta ',$text);
+ $text = str_replace('ε','\textepsilon ',$text);
+ $text = str_replace('ζ','\textzeta ',$text);
+ $text = str_replace('η','\texteta ',$text);
+ $text = str_replace('θ','\texttheta ',$text);
+ $text = str_replace('ι','\textiota ',$text);
+ $text = str_replace('κ','\textkappa ',$text);
+ $text = str_replace('λ','\textlambda ',$text);
+ $text = str_replace('μ','\textmugreek ',$text);
+ $text = str_replace('ν','\textnu ',$text);
+ $text = str_replace('ξ','\textxi ',$text); */
+ //$text = str_replace('ο','o',$text); // \textomicron ne dela
+ //$text = str_replace('ο','\textgreek{ο}',$text);
+ //$text = str_replace('ς','\textvarsigma ',$text);
+ /* $text = str_replace('ς','\textgreek{ς}',$text);
+ $text = str_replace('π','\textpi ',$text);
+ $text = str_replace('ρ','\textrho ',$text);
+ $text = str_replace('σ','\textsigma ',$text);
+ $text = str_replace('τ','\texttau ',$text);
+ $text = str_replace('υ','\textupsilon ',$text);
+ $text = str_replace('φ','\textphi ',$text);
+ $text = str_replace('χ','\textchi ',$text);
+ $text = str_replace('ψ','\textpsi ',$text);
+ $text = str_replace('ω','\textomega ',$text);
+ $text = str_replace('ύ','\textgreek{ύ}',$text); */
+ //ureditev grskih crk - konec
+
+ //ureditev ostalih posebnih crk
+ $text = str_replace('ə','\textschwa ',$text);
+ //ureditev ostalih posebnih crk - konec
+
+
//ureditev preureditve html kode ul in li v latex itemize
if($posUl !== false){
//echo "text prej: ".$text."</br>";
@@ -1272,27 +1406,148 @@ class LatexSurvey{
//if($numOfUl!=0){
if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
$text = str_replace('<ul>','\begin{itemize} ', $text);
- $text = str_replace('<li>','\item ', $text);
- $text = str_replace('</ul>','\end{itemize} ', $text);
+ $text = str_replace('<ul','\begin{itemize} ', $text);
+/* $text = str_replace('<li>','\item ', $text);
+ $text = str_replace('<li','\item ', $text); */
+ $text = str_replace('<li>','\item \ ', $text);
+ $text = str_replace('<li','\item \ ', $text);
+ $text = str_replace('</ul>','\end{itemize} \ ', $text);
}
//echo "prazno v html: ".strpos($text, '\r')."</br>";
//echo "text potem: ".$text."</br>";
######################
}
//ureditev preureditve html kode ul in li v latex itemize - konec
-
+
+ //ureditev preureditve html kode ol in li v latex enumerate, ki je ostevilcen
+ if($posOl !== false){
+ //echo "text prej: ".$text."</br>";
+ $numOfOl = substr_count($text, $findOl); //stevilo '<ol' v tekstu
+ //echo "numOfUl ".$numOfUl."</br>";
+ ######################
+ //if($numOfUl!=0){
+ if($numOfOl!=0 && $posLi !== false){ //ce imamo ol in li
+ $text = str_replace('<ol>','\begin{enumerate} ', $text);
+/* $text = str_replace('<li>','\item ', $text);
+ $text = str_replace('<li','\item ', $text); */
+ $text = str_replace('<li>','\item \ ', $text);
+ $text = str_replace('<li','\item \ ', $text);
+ $text = str_replace('</ol>','\end{enumerate} \ ', $text);
+ }
+ //echo "prazno v html: ".strpos($text, '\r')."</br>";
+ //echo "text potem: ".$text."</br>";
+ ######################
+ }
+ //ureditev preureditve html kode ol in li v latex enumerate, ki je ostevilcen - konec
+
+ //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
+ if($posImg !== false){
+ $text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
+ }
+ //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
+
if($posPar !== false){ //ce je kaksen html tag <p>, dodaj prazno vrstico oz. break
- if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
- $divider = ' ';
+ if($this->variableName=='gdpr'){
+ if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
+ $divider = ' ';
+ }else{
+ $divider = ' \\ \\\\ ';
+ }
+ $text = str_replace('<p>',$divider, $text);
+ }else{
+ $text = str_replace('<p>',' ', $text);
+ }
+ }
+
+
+ //priprava izpisa zelo dolgega besedila brez presledkov (URL, email, ...)
+ //if($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
+ if( ($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)) || ($numOfSpacesPrej == 1 && $posSpace1 == $posSpace2 && $stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
+ //$text = "\seqsplit{".$text."}"; //ni v redu seqsplit, ker ne dela, če so posebni znaki
+ $text = substr_replace($text, $this->texNewLine, MAX_STRING_LENGTH, 0); //dodaj na ustrezni dolzini besedila prehod v novo vrstico
+ }
+ //priprava izpisa zelo dolgega besedila brez presledkov - konec
+
+ //echo "text potem: ".$text."</br>";
+
+ //detekcija prisotnosti e-naslova v besedilu in primerna preureditev, da pride do pravilnega izpisa
+ $findAt = '@1'; //IZKLOPIL DETEKCIJO, KER DELA TUDI BREZ TEGA
+ $numOfAt = substr_count($text, $findAt); //stevilo '@' v besedilu
+ $findNewline = 'br';
+
+ $text = preg_replace("/<\/?a( [^>]*)?>/i", "", $text); //remove anchor tag from string <a href= ... </a>, to se je uredilo za rešiti <a href= mailto: ...
+
+ $posAt = strpos($text, $findAt);
+ if($posAt && $posSpace1){ //ce je prisotna afna in je prisoten presledek v besedilu
+
+ $posSpace1Mail = strpos(substr($text, $posAt), $findSpace); //najdi pozicijo prvega presledka v besedilu po e-naslovu
+ $posSpace1Mail = $posSpace1Mail+$posAt; //koncna pozicija, ce se gleda celotno besedilo
+ //echo "pozicija prvega presledka v besedilu po e-naslovu: ".$posSpace1Mail."</br>";
+
+ //najdi prvi presledek pred afno
+ $posSpace2Mail = strripos(substr($text, 0, $posAt), $findSpace); //najdi pozicijo zadnjega presledka v besedilu pred e-naslovom
+ //echo "pozicijo zadnjega presledka v besedilu pred e-naslovom: ".$posSpace2Mail."</br>";
+
+
+
+ //najdi prvi simbol za v novo vrstico "br" po afni
+ //echo substr($text, $posAt) ."</br>";
+ $posNewLineMail = strpos(substr($text, $posAt), $findNewline); //najdi pozicijo prvega simbola za v novo vrstico v besedilu po e-naslovu
+ $posNewLineMail = $posNewLineMail+$posAt-1; //koncna pozicija, ce se gleda celotno besedilo
+
+ if($posSpace1Mail<$posNewLineMail){ //ce se po e-naslovu pojavi prej presledek
+ $posKonec = $posSpace1Mail; //se zakljuci pri presledku, ker je ta lokacija za zakljucek url
}else{
- $divider = ' \\ \\\\ ';
+ $posKonec = $posNewLineMail; //se zakljuci pred simbolom za novo vrstico, ker je ta lokacija za zakljucek url
}
- //$text = str_replace('<p>',' ', $text);
- //$text = str_replace('<p>',' \break ', $text);
- //$text = str_replace('<p>',' \\\\ ', $text);
+ //echo "posKonec: ".$posKonec."</br>";
+
+ //dodaj po e-naslovu potrebno latex kodo za zakljucek url
+ //$text = substr_replace($text, '}', $posSpace1Mail, 0);
+ $text = substr_replace($text, '}', $posKonec, 0);
+
+ //dodaj pred e-naslovom potrebno latex kodo za url
+ //substr_replace(string_name, replacement_string, start_pos, length)
+ $text = substr_replace($text, ' \url{', $posSpace2Mail, 0);
+ //echo $text."</br>";
- $text = str_replace('<p>', $divider, $text);
}
+ //detekcija prisotnosti e-naslova v besedilu in primerna preureditev, da pride do pravilnega izpisa - konec
+
+
+ //RESEVANJE BESEDILA V CIRILICI
+ $contains_cyrillic = (bool) preg_match('/[\p{Cyrillic}]/u', $text); //ali je v besedilu cirilica?
+ if($contains_cyrillic){ // ce je cirilica v besedilu
+ $text = '\foreignlanguage{russian}{'.$text.'}';
+ }
+ //RESEVANJE BESEDILA V CIRILICI - konec
+
+
+
+ //RESEVANJE odstranitve dodatnih style tag-ov po ul, ipd. #######################################################
+ $findStyleTagFull = '<style="';
+ $findStyleTagIn = 'style="';
+ $findStyleTagEnd = '">';
+ $numOfStyleTagsFull = substr_count($text, $findStyleTagFull); //stevilo '<style=" ' v tekstu
+ $numOfStyleTagsIn = substr_count($text, $findStyleTagIn); //stevilo 'style=" ' v tekstu
+ if($numOfStyleTagsFull){
+ $numOfStyleTags = $numOfStyleTagsFull;
+ $findStyleTag = $findStyleTagFull;
+ $offset = 2;
+ }else{
+ $numOfStyleTags = $numOfStyleTagsIn;
+ $findStyleTag = $findStyleTagIn;
+ $offset = 1;
+ }
+ for($s=0; $s<$numOfStyleTags; $s++){ //za vsako najdeno 'style=" ' besedilo, uredi njeno odstranitev
+ $posStyleTag = strpos($text, $findStyleTag);
+ $posStyleTagEnd = strpos($text, $findStyleTagEnd, $posStyleTag); //strpos(string,find,start) najdi $findStyleTagEnd v $text, isci od $posStyleTag dalje
+ $dolzinaOff = $posStyleTagEnd - $posStyleTag + $offset;
+ $text = substr_replace($text, "", $posStyleTag, $dolzinaOff); //substr_replace(string,replacement,start,length)
+ }
+ //RESEVANJE odstranitve dodatnih style tag-ov po ul, ipd. - konec #################################################
+
+ //echo "po style: ".$text."</br>";
if($pos === false && $posImg === false) { //v tekstu ni br in img
@@ -1300,37 +1555,39 @@ class LatexSurvey{
return strip_tags($text);
}else { //v tekstu sta prisotna br ali img
$text2Return = ''; //tekst ki bo vrnjen
-
+
//ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
- if($pos !== false){
- $pos = strpos($text, $findme);
- $numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
- for($i=0; $i<$numOfBr; $i++){
- if($i == 0){ //ce je prvi najdeni '<br />'
- $textPrej = substr($text, 0, $pos);
- $textPotem = substr($text, $pos+$findmeLength);
- if($i == $numOfBr-1){
- //$text2Return .= $textPrej.' \break '.$textPotem;
- $text2Return .= $textPrej.' \\\\ '.$textPotem;
- }else{
- //$text2Return .= $textPrej.' \break ';
- $text2Return .= $textPrej.' \\\\ ';
- }
- }else{ //drugace
- $pos = strpos($textPotem, $findme);
- $textPrej = substr($textPotem, 0, $pos);
- $textPotem = substr($textPotem, $pos+$findmeLength);
- if($i == $numOfBr-1){
- //$text2Return .= $textPrej.' \break '.$textPotem;
- $text2Return .= $textPrej.' \\\\ '.$textPotem;
- }else{
- //$text2Return .= $textPrej.' \break ';
- $text2Return .= $textPrej.' \\\\ ';
+ if($naslovStolpca==0){ // ce besedilo ni naslov stolpca tabele
+ if($pos !== false){
+ $pos = strpos($text, $findme);
+ $numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
+ for($i=0; $i<$numOfBr; $i++){
+ if($i == 0){ //ce je prvi najdeni '<br />'
+ $textPrej = substr($text, 0, $pos);
+ $textPotem = substr($text, $pos+$findmeLength);
+ if($i == $numOfBr-1){
+ //$text2Return .= $textPrej.' \break '.$textPotem;
+ $text2Return .= $textPrej.' \\\\ '.$textPotem;
+ }else{
+ //$text2Return .= $textPrej.' \break ';
+ $text2Return .= $textPrej.' \\\\ ';
+ }
+ }else{ //drugace
+ $pos = strpos($textPotem, $findme);
+ $textPrej = substr($textPotem, 0, $pos);
+ $textPotem = substr($textPotem, $pos+$findmeLength);
+ if($i == $numOfBr-1){
+ //$text2Return .= $textPrej.' \break '.$textPotem;
+ $text2Return .= $textPrej.' \\\\ '.$textPotem;
+ }else{
+ //$text2Return .= $textPrej.' \break ';
+ $text2Return .= $textPrej.' \\\\ ';
+ }
}
}
+ $text = $text2Return;
}
- $text = $text2Return;
- }
+ }
//ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
//echo "text potem: ".$text."</br>";
$text = preg_replace("/(\R){2,}/", "$1", $text);
@@ -1338,5 +1595,184 @@ class LatexSurvey{
}
}
#funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno - konec
+
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati ######################################
+ function getImageName($text='', $sprId=null, $findme='', $vre_id=0, $img_id=0){
+ global $site_path, $site_url;
+ $imageName = '';
+ //echo "id slike $img_id </br>";
+ if($text == 'hotspot' && $findme == 'hotspot_image='){
+ $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
+ $rowParametrov = mysqli_fetch_row($sqlParametrov);
+ $text = $rowParametrov[0];
+ }
+
+ $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
+ //echo "text za echo: ".$text."</br>";
+ //if($pos!=''){ //ce je slika v bazi
+ if($pos!=''||$pos==0){ //ce je slika v bazi
+ $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
+ //echo "imageName prej: ".$imageName."</br>";
+
+ //$findme = $site_path.'uploadi/editor/';
+ $findme = $site_url.'uploadi/editor/';
+ //$findme = 'uploadi/editor/';
+ //$findme = 'editor/';
+ //echo "findme: ".$findme."</br>";
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta v $findme
+ //echo "najdi tole: ".$findme."</br>";
+ //echo "najdi tukaj: ".$imageName."</br>";
+ //echo "pozicija tega: ".$pos."</br>";
+ if($pos){ //ce je slika na strezniku
+ $slikaNaStrezniku = 1;
+ }else{//ce slike ni na strezniku
+ $slikaNaStrezniku = 0;
+ }
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==1){ //ce je slika na strezniku
+ $findEditor = 'editor/';
+ $posEditor = strpos($imageName, $findEditor); //najdi pozicijo teksta v $findEditor
+ $imageName = substr($imageName,$posEditor+7); //pokazi le del params od besedila 'editor/' dalje, brez besedila 'editor/'
+ //echo "imagename : ".$imageName."</br>";
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif)
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+
+ $path = $site_path.'uploadi/editor/'.$imageName;
+ //$path = $site_url.'uploadi/editor/'.$imageName;
+
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }
+
+ if($imageExtension == 'jpg' || $imageExtension == 'peg'){ //ce je slika jpg ali jpeg, jo je potrebno pretvoriti v png
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }elseif($slikaNaStrezniku==0){ //ce slike ni na strezniku
+ //echo "vre_id: $vre_id </br>";
+ $imageName = $this->getOnlineImageName($imageName, $slikaNaStrezniku, $vre_id, $img_id); //pridobi njen URL
+ }
+
+ $imageName = substr($imageName, 0, strrpos($imageName, '.'));
+
+ }
+
+ //echo "imagename pred return: ".$imageName."</br>";
+ return $imageName;
+ }
+ #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati - konec ###############################
+ function getEndPosition($imageName=''){
+ $findme = '"';
+ $pos = strpos($imageName, $findme); //najdi pozicijo teksta '"'
+ return $pos;
+ }
+
+ function convertGifToPng($path='', $slikaNaStrezniku=null){
+ //echo "path: ".$path."</br>";
+ $image = imagecreatefromgif($path); //pripravi sliko iz gif za pretvorbo
+ $imageName = substr($path, 0, -3); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno gif sliko v png
+
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, GIF izbrisi
+ unlink($imageName.'gif'); //izbrisi gif sliko
+ }
+ }
+
+ function convertJpgToPng($path='', $slikaNaStrezniku=null, $imageExtension=''){
+ $image = imagecreatefromjpeg($path); //pripravi sliko iz jpg za pretvorbo
+ $imageName = substr($path, 0, strrpos($path, '.')); //ime slike brez extension-a
+ //echo $imageName."</br>";
+ $imageNamePNG = $imageName.'.png'; //ime slike z ustreznim extension
+ imagepng($image, $imageNamePNG); //pretvori pripravljeno jpg sliko v png
+ //echo "pretvorba v png: ".$imageNamePNG."</br>";
+ //echo "xtens: ".$imageExtension."</br>";
+ //$origExtension = strrchr($path, '.');
+ //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
+ if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, izbrisi jo
+ //echo "tukaj </br>";
+ if($imageExtension == 'jpg'){
+ unlink($imageName.'.'.$imageExtension); //izbrisi sliko
+ }elseif($imageExtension == 'peg'){
+ unlink($imageName.'.j'.$imageExtension); //izbrisi sliko
+ }
+ }
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike ######################################
+ function getOnlineImageName($imageName='', $slikaNaStrezniku=null, $vre_id=null, $img_id=0){
+ global $site_path;
+ //echo "imageName v getOnlineImageName nekje vmes 1: ".$imageName."</br>";
+ $row = Cache::srv_spremenljivka(self::$spremenljivka);
+ //echo "sprem: ".self::$spremenljivka."</br>";
+ $spremenljivkaParams = new enkaParameters($row['params']);
+ //echo "params: ".$spremenljivkaParams->get('hotspot_image')."</br>";
+ $imageNameTmp = $spremenljivkaParams->get('hotspot_image');
+ //if($imageNameTmp!=''){ //ce je hotspot
+ if($imageNameTmp!=''&&$vre_id==0){ //ce je hotspot
+ $imageName = $imageNameTmp;
+ }
+
+ $findHttp = 'http';
+ $posHttp = strpos($imageName, $findHttp);
+ $imageName = substr($imageName,$posHttp); //besedilo do zacetka http
+
+ $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
+ $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
+ //echo "imageName v getOnlineImageName nekje vmes 2: ".$imageName."</br>";
+ $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike
+ //echo "imageExtension: ".$imageExtension."</br>";
+
+ //if($imageExtension!='jpg'&&$imageExtension!='png'&&$imageExtension!='gif'&&$imageExtension!='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ if($imageExtension=='jpg'||$imageExtension=='gif'||$imageExtension=='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
+ //echo "spremeni extension </br>";
+ $imageExtension='png';
+ }
+
+ if($vre_id){ //ce se pridobiva imena tmp slik iz vrednosti vprasanja
+ //$imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }else{
+ //$imgFilename = self::$spremenljivka.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ $imgFilename = self::$spremenljivka.'_tmpImage_'.$img_id.'.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
+ }
+
+ $pathDir = $site_path.'uploadi/editor/'; //pot za novo mapo, kjer se bodo shranjevale slike za trenutno anketo
+ $path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+ # ukaz za pretakanje slike
+ if(IS_WINDOWS){
+ //za windows sisteme //powershell -command "& { iwr URL -OutFile 'PATH' }"
+ $command = 'powershell -command "& { iwr \''.$imageName.'\' -OutFile \''.$path.'\' }"';
+ //$command = 'wget -O \''.$imageName.'\' -O '.$path.' ';
+ }elseif(IS_LINUX){
+ //za linux sisteme //exec('wget URL -P PATH ');
+ //$command = 'wget \''.$imageName.'\' -P '.$path.' ';
+ $command = 'wget -O '.$path.' \''.$imageName.'\' ';
+ //echo "ukaz za pobiranje: $command </br>";
+ }
+
+ //echo "command: ".$command."</br>";
+ exec($command); //pretoci sliko
+
+ //$path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
+
+/* if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ } */
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ if($imageExtension != 'png'){ //ce slika ni png, jo pretvori
+ if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
+ $this->convertGifToPng($path, $slikaNaStrezniku);
+ }else{
+ $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
+ }
+ }
+
+ //echo "imgfilename na koncu: ".$imgFilename."</br>";
+ return $imgFilename;
+ }
+ #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike - konec ###############################
+
} \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/class.LatexSurveyElement.php b/admin/survey/export/latexclasses/class.LatexSurveyElement.php
index 587fb3a..e8bf384 100644
--- a/admin/survey/export/latexclasses/class.LatexSurveyElement.php
+++ b/admin/survey/export/latexclasses/class.LatexSurveyElement.php
@@ -10,13 +10,13 @@
include('../../vendor/autoload.php');
-define("MAX_STRING_LENGTH", 90);
-define("LINE_BREAK_AT", '7 cm');
-define("RADIO_BTN_SIZE", 0.13);
-define("CHCK_BTN_SIZE", 0.13);
-define("PIC_SIZE_ANS", "\includegraphics[width=3cm]"); //slika dolocene sirine
-define("DROPDOWN_SIZE", 0.8);
-define("VAS_SIZE", 0.04); //VAS_SIZE
+if (!defined("MAX_STRING_LENGTH")) define("MAX_STRING_LENGTH", 90);
+if (!defined("LINE_BREAK_AT")) define("LINE_BREAK_AT", '7 cm');
+if (!defined('RADIO_BTN_SIZE')) define("RADIO_BTN_SIZE", 0.13);
+if (!defined('CHCK_BTN_SIZE')) define("CHCK_BTN_SIZE", 0.13);
+if (!defined('PIC_SIZE_ANS')) define("PIC_SIZE_ANS", "\includegraphics[width=3cm]"); //slika dolocene sirine
+if (!defined('DROPDOWN_SIZE')) define("DROPDOWN_SIZE", 0.8);
+if (!defined('VAS_SIZE')) define("VAS_SIZE", 0.04); //VAS_SIZE
class LatexSurveyElement{
@@ -48,6 +48,8 @@ class LatexSurveyElement{
protected $prevod;
protected $admin_type;
protected $variableName;
+ protected $path2UrlImages;
+ protected $export_subtype;
function __construct($anketa=null, $export_format='', $fillablePdf=null, $usr_id=null, $export_subtype='', $language=null){
@@ -86,11 +88,12 @@ class LatexSurveyElement{
//preverjanje, ali je prevod
if(isset($_GET['language'])){
- $this->language = $_GET['language'];
+ //$this->language = $_GET['language'];
+ $this->language = isset($_GET['language'])?$_GET['language']:null;
$this->prevod = 1;
}else{
$this->prevod = 0;
- }
+ }
//preverjanje, ali je prevod - konec
//if($language!=-1){ //ce ni default jezik, ampak je prevod
@@ -102,8 +105,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;
@@ -116,7 +118,6 @@ class LatexSurveyElement{
public function displayQuestionText($spremenljivke=null, $zaporedna=null, $export_subtype='', $preveriSpremenljivko=null, $loop_id=null, $export_data_type=''){
$tex = '';
$userDataPresent = null; //dodal definicijo spremenljivke zaradi intellisense napake
- //echo "Funkcija displayQuestionText </br>";
self::$spremenljivka = $spremenljivke['id'];
$row = Cache::srv_spremenljivka($spremenljivke['id']);
$this->spremenljivkaParams = new enkaParameters($row['params']);
@@ -128,21 +129,18 @@ class LatexSurveyElement{
if($export_subtype!='q_empty'){
if( in_array($spremenljivke['tip'], array(1, 2, 3)) ){ //ce je radio,checkbox ali roleta
//if( in_array($spremenljivke['tip'], array(1, 2, 3)) && $spremenljivke['orientation']!=5){
- //echo "orientation: ".$spremenljivke['orientation'];
$userDataPresent = $this->GetUsersData($this->db_table, $spremenljivke['id'], $spremenljivke['tip'], $this->usr_id, $this->loop_id);
}elseif( in_array($spremenljivke['tip'], array(6, 16, 19, 20)) ){ //ce je multigrid radio, checkbox, besedilo ali stevilo
$sqlVrednosti = sisplet_query("SELECT id, naslov, naslov2, variable, other, spr_id FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
- //echo "Funkcija displayQuestionText </br>";
//pregled vseh moznih vrednosti (kategorij) po $sqlVrednosti
while ($rowVrednost = mysqli_fetch_assoc($sqlVrednosti)){
$indeksZaWhile = 1;
- //echo "rowVrednost['id']: ".$rowVrednost['id'].'</br>';
$sqlVsehVrednsti = sisplet_query("SELECT id, naslov FROM srv_grid WHERE spr_id='".$spremenljivke['id']."' ORDER BY 'vrstni_red'");
while ($rowVsehVrednosti = mysqli_fetch_assoc($sqlVsehVrednsti)){
$sqlUserAnswer = $this->GetUsersDataGrid($spremenljivke, $this->db_table, $rowVrednost, $rowVsehVrednosti, $this->usr_id, 0, $this->loop_id);
$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- if($rowVsehVrednosti['id'] == $userAnswer['grd_id']){
+ if(isset($userAnswer['grd_id']) && $rowVsehVrednosti['id'] == $userAnswer['grd_id']){
$indeksZaWhile++;
}
if($indeksZaWhile!=1){
@@ -159,16 +157,12 @@ class LatexSurveyElement{
$indeksPolja = 0;
$userDataPresentArray = $this->GetUsersDataKombinirana($spremenljivke, $this->db_table, $this->usr_id, $questionText, $this->loop_id);
if (is_array($userDataPresentArray)){
- //echo "je polje".'</br>';
$userDataPresent=0;
- //echo "Dolzina polja: ".count($userDataPresentArray)."</br>";
- //echo "Id: ".$spremenljivke['id']."</br>";
foreach($userDataPresentArray as $key=>$value){
if($key==$indeksPolja){
if($value!=''){
$userDataPresent=1;
}
- //echo "Podatek z indeksom ".$key." je :".$value."</br>";
$indeksPolja++;
}
}
@@ -181,14 +175,12 @@ class LatexSurveyElement{
}
}
}
- //echo "userDataPresent za spremenljivko ".$spremenljivke['id'].': '.$userDataPresent.'</br>';
- //echo "Preveri spremenljivko: $preveriSpremenljivko</br>";
#pridobitev podatkov o odgovorih respondenta na trenutno vprasanje - konec ####################################
if(($export_subtype=='q_empty')||($export_subtype=='q_comment')||(($export_subtype=='q_data'||$export_subtype=='q_data_all')&&($userDataPresent!=0||$preveriSpremenljivko))){ //ce je prazen vprasalnik ali (je vprasalnik poln in (so podatki prisotni ali je potrebno pokazati vprasanje tudi, ce ni podatkov))
$rowl = $this->srv_language_spremenljivka($spremenljivke);
- if (strip_tags($rowl['naslov']) != '') $spremenljivke['naslov'] = $rowl['naslov'];
- if (strip_tags($rowl['info']) != '') $spremenljivke['info'] = $rowl['info'];
+ if ($rowl!=null && strip_tags($rowl['naslov']) != '') $spremenljivke['naslov'] = $rowl['naslov'];
+ if ($rowl!=null && strip_tags($rowl['info']) != '') $spremenljivke['info'] = $rowl['info'];
#Pridobimo tekst vprasanja#################################################################################
@@ -202,22 +194,18 @@ class LatexSurveyElement{
######################################### Pridobimo tekst vprasanja - konec
#Stevilcenje vprasanj###############################################################
- //$numberingText = ($this->numbering == 1) ? $spremenljivke['variable'].' - ' : '';
- $numberingText = ($this->numbering == 1) ? $this->encodeText($spremenljivke['variable']).' - ' : '';
+ $numberingText = ($this->numbering == 1) ? ($spremenljivke['variable']).' - ' : '';
######################################### Stevilcenje vprasanj - konec
- //echo "goli naslov: ".$spremenljivke['naslov']."</br>";
-
+
//belezenje imena spremenljivke, zaradi GDPR vprasanja
- $this->variableName =$spremenljivke['variable'];
+ $this->variableName = $spremenljivke['variable'];
//belezenje imena spremenljivke, zaradi GDPR vprasanja - konec
#Izris stevilke in besedila vprasanja ter IF ali BLOK, ce so prisotni ###############################################
- //$text = strip_tags($numberingText . $spremenljivke['naslov'], '<a><img><ul><li><ol><br>');
- $text = strip_tags($numberingText . $spremenljivke['naslov'], '<a><img><ul><li><ol><br><p>'); //je potrebno spustiti <p>, zaradi GDPR vprasanja
+ $text = strip_tags($numberingText . $spremenljivke['naslov'], '<a><img><ul><li><ol><br><p>'); //je potrebno spustiti <p>, zaradi GDPR vprasanja
- //echo "naslov: ".$text."</br>";
//$tex = $text." ".$texNewLine;
- if( !in_array($spremenljivke['tip'], array(1, 2, 3, 4, 7, 8, 6, 16, 19, 20, 21, 17, 18, 24, 26, 27)) ){ //ce ni radio, check, roleta, stevilo, datum, multigrid radio, checkbox, besedilo, stevilo, razvrscanje, vsota ali kombinirana tabela, lokacija, ali heatmap
+ if( !in_array($spremenljivke['tip'], array(0, 1, 2, 3, 4, 7, 8, 6, 16, 19, 20, 21, 17, 18, 24, 26, 27)) ){ //ce ni radio, check, roleta, stevilo, datum, multigrid radio, checkbox, besedilo, stevilo, razvrscanje, vsota ali kombinirana tabela, lokacija, ali heatmap
$tex .= ($this->export_format == 'pdf' ? '\\begin{absolutelynopagebreak} \\noindent ' : ' '); //ce je pdf uredimo, da med vprasanji ne bo prelomov strani
}
@@ -258,7 +246,7 @@ class LatexSurveyElement{
Cache::cache_all_srv_branching($this->anketa);
$parents = Cache::srv_branching($spremenljivke['id'], 0)['parent'];
if($parents){
- $tex .= $this->displayIf($parents);
+ $tex .= ' '.LatexDocument::encodeText($this->displayIf($parents));
$tex .= $this->texNewLine;
}
#preuredil kodo, da zadeva deluje tako kot ta stara, ki se nahaja nad tem
@@ -269,21 +257,20 @@ class LatexSurveyElement{
//$tex .= '\textbf{'.$text.'} '.$texNewLine; //izris besedila vprasanja
if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
- $text = $this->dataPiping($text); //pokazi odgovore po zanki
+ $text = $this->dataPiping($text); //pokazi odgovore po zanki
}
$tex .= ' \noindent '; //dodal pred vsakim tekstom vprasanja, da ni indent-a
if($spremenljivke['orientation']==0){ //ce je vodoravno ob vprasanju
- //if($spremenljivke['tip'] == 21){ //ce je besedilo (vodoravno ob vprasanju)
if($spremenljivke['tip'] == 21 || $spremenljivke['tip'] == 4){ //ce je besedilo (vodoravno ob vprasanju)
$tex .= ' \par { '; //dodaj zacetek odstavka, ki je pomemben za pravile izpis
}
}
- $tex .= '\textbf{'.$this->encodeText($text).'} '; //izris besedila vprasanja
+ $tex .= '\textbf{'.LatexDocument::encodeText($text, null, null, $loop_id).'} '; //izris besedila vprasanja //encodeText($text='', $vre_id=0, $naslovStolpca = 0, $img_id=0){
- $this->questionText = $text; //zabelezimo tekst vprasanja, ki ga potrebujemo kasneje
+ $this->questionText = $text; //zabelezimo tekst vprasanja, ki ga potrebujemo kasneje
#Izris stevilke in besedila vprasanja ter IF ali BLOK, ce so prisotni - konec ###############################################
@@ -294,8 +281,7 @@ class LatexSurveyElement{
if($spremenljivke['info'] != ''){
$tex .= $this->texNewLine;
$tex .= '\vspace{2 mm}';
- //$tex .= ' {\noindent \\footnotesize '.$this->encodeText($spremenljivke['info']).'}';
- $tex .= ' \noindent \\footnotesize '.$this->encodeText($spremenljivke['info']).' \\normalsize ';
+ $tex .= ' \noindent \\footnotesize '.LatexDocument::encodeText($spremenljivke['info']).' \\normalsize ';
}
if( !in_array($spremenljivke['tip'], array(4, 6, 16, 19, 20, 21, 7, 8, 18)) ){ //ce ni multigrid radio, checkbox, besedilo, stevilo, datum ali vsota ki ne potrebujejo prazne vrstice zaradi uporabe tabele
@@ -314,49 +300,13 @@ class LatexSurveyElement{
}
}
}
-
- ####################
-/* if( !in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce ni multigrid radio, checkbox, besedilo ali stevilo
-
- //preveri, ce je itemize v besedilu in ustrezno uredi prazno vrstico
- $findItemize = '\begin{itemize}';
- $posItemize = strpos($tex, $findItemize); //v trenutni tex kodi najdi prisotnost besedila za itemize
- if($posItemize === false){ //ce ni besedila itemize, dodaj prazno vrstico
- //pejdi v novo vrstico
- $tex .= $this->texNewLine;
- }
- //preveri, ce je itemize v besedilu in ustrezno uredi prazno vrstico - konec
- }
-
- if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
- if( in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce je multigrid radio, checkbox, besedilo ali stevilo
- $tex .= $this->texNewLine;
- //echo "ni vodoravno ob vprašanju in je število ali besedilo </br>";
- }
- }
-
- //ce imamo opombo, jo izpisi
- if($spremenljivke['info'] != ''){
- if( in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce je multigrid radio, checkbox, besedilo ali stevilo
- $tex .= $this->texNewLine;
- echo "ni vodoravno ob vprašanju in je število ali besedilo </br>";
- }
- //$tex .= $this->texNewLine;
- $tex .= '\vspace{2 mm}';
- $tex .= ' {\indent \\footnotesize '.$this->encodeText($spremenljivke['info']).'}';
- if( !in_array($spremenljivke['tip'], array(6, 16, 19, 20, 21, 7)) ){ //ce ni multigrid radio, checkbox, besedilo ali stevilo
- $tex .= $this->texNewLine;
- }
- } */
- ####################
}else{ //ce je vodoravno ob vprasanju
//ce imamo opombo, jo izpisi
if($spremenljivke['info'] != ''){
//pejdi v novo vrstico
$tex .= $this->texNewLine;
$tex .= '\vspace{2 mm}';
- //$tex .= ' {\indent \\footnotesize '.$this->encodeText($spremenljivke['info']).'} ';
- $tex .= ' {\noindent \\footnotesize '.$this->encodeText($spremenljivke['info']).' \\normalsize } ';
+ $tex .= ' {\noindent \\footnotesize '.LatexDocument::encodeText($spremenljivke['info']).' \\normalsize } ';
}
if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je izpis odgovorov
@@ -368,7 +318,6 @@ class LatexSurveyElement{
#Izris opombe - konec #########################################################################
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf
- //echo $rowVrstic[0]."za spremenljivko: ".$spremenljivke['tip']."</br>";
if($rowVrstic[0]==0 && (in_array($spremenljivke['tip'], array(1, 2, 3, 6, 16, 17, 20, 9, 19, 17))) ){
if($this->export_format == 'pdf'){ //ce je pdf
if($spremenljivke['orientation']==0 || $spremenljivke['orientation']==2){ //ce sta vodoravni orientaciji
@@ -387,7 +336,6 @@ class LatexSurveyElement{
}
#ce vprasanje nima moznih odgovorov, je potrebno zakljuciti environment (absolutelynopagebreak) pri pdf - konec
}
- //echo "tex: ".$tex."</br>";
return $tex;
}
#funkcija, ki pripravi latex kodo za prikazovanje besedila vprasanja - konec ############################################################################
@@ -395,7 +343,7 @@ class LatexSurveyElement{
#funkcija, ki pripravi latex kodo za prikazovanje moznih odgovorov glede na tip vprasanja################################################################
public function displayAnswers($spremenljivke=null, $export_subtype='', $preveriSpremenljivko=null, $export_data_type='', $loop_id=null){
-
+
switch ( $spremenljivke['tip'] )
{
case 1: //radio
@@ -406,7 +354,7 @@ class LatexSurveyElement{
case 6: //multigrid
case 16:// multicheckbox
case 19:// multitext
- case 20:// multinumber
+ case 20:// multinumber
return MultiGridLatex::getInstance()->export($spremenljivke, $this->export_format, $this->questionText, $this->fillablePdf, $this->texNewLine, $this->getUserId(), $this->db_table, $export_subtype, $preveriSpremenljivko, $this->skipEmptySub, $export_data_type, $this->skipEmpty, $loop_id, $this->language);
break;
case 21: //besedilo
@@ -428,7 +376,7 @@ class LatexSurveyElement{
return VsotaLatex::getInstance()->export($spremenljivke, $this->export_format, $this->questionText, $this->fillablePdf, $this->texNewLine, $this->getUserId(), $this->db_table, $export_subtype, $preveriSpremenljivko, $loop_id);
break;
case 24: // kombinirana tabela
- return GridMultipleLatex::getInstance()->export($spremenljivke, $this->export_format, $this->questionText, $this->fillablePdf, $this->texNewLine, $this->getUserId(), $this->db_table, $export_subtype, $preveriSpremenljivko, $export_data_type, $loop_id);
+ return GridMultipleLatex::getInstance()->export($spremenljivke, $this->export_format, $this->questionText, $this->fillablePdf, $this->texNewLine, $this->getUserId(), $this->db_table, $export_subtype, $preveriSpremenljivko, $export_data_type, $loop_id, $this->language);
break;
case 26: //lokacija
return LokacijaLatex::getInstance()->export($spremenljivke, $this->export_format, $this->questionText, $this->fillablePdf, $this->texNewLine, $this->getUserId(), $this->db_table, $export_subtype, $preveriSpremenljivko, $loop_id);
@@ -470,7 +418,6 @@ class LatexSurveyElement{
function displayIf($if=null){
global $lang;
- //echo "funckija za if </br>";
$sql_if = sisplet_query("SELECT tip FROM srv_if WHERE id = '$if'");
$row_if = mysqli_fetch_array($sql_if);
@@ -521,7 +468,7 @@ class LatexSurveyElement{
} else
$row1 = null;
- $output .= $this->encodeText($row1['variable']);
+ $output .= LatexDocument::encodeText($row1['variable']);
// radio, checkbox, dropdown in multigrid
if (($row2['tip'] <= 3 || $row2['tip'] == 6) && ($row['spr_id'] || $row['vre_id'])) {
@@ -595,24 +542,19 @@ class LatexSurveyElement{
}
#funkcija, ki skrbi za izbiro radio, checkbox ali ostale simbole, ki so potrebni za izris odgovorov #############################################################
- function getAnswerSymbol($export_format='', $fillablePdf=null, $spremenljivkeTip=null, $spremenljivkeGrids=null, $numOfMissings=null, $data=null, $enota='', $indeksVASIcon='', $VASNumberRadio='', $spremenljivkeId=null){
- $tip=$spremenljivkeTip;
+ function getAnswerSymbol($export_subtype=null, $export_format='', $fillablePdf=null, $spremenljivkeTip=null, $spremenljivkeGrids=null, $numOfMissings=null, $data=null, $enota='', $indeksVASIcon=0, $VASNumberRadio='', $spremenljivkeId=null){
+ //return;
+ $tip = $spremenljivkeTip;
global $site_path;
$this->path2Images = $site_path.'admin/survey/export/latexclasses/textemp/images/';
- //echo $tip;
- //$numGrids=$spremenljivke['grids'];
+ $this->export_subtype = $export_subtype;
$numGrids=$spremenljivkeGrids;
- //echo "Data:".($data)."</br>";
- //echo "DataCount:".count($data)."</br>";
- //if($tip==21||$tip==8){ //ce je besedilo ali datum,
if($tip==21||$tip==4||$tip==8){ //ce je besedilo ali datum,
$tip=2; //naj se pobere checkbox
}
-
if( ($export_format=='pdf'&&$fillablePdf==0)||$export_format=='rtf'){//ce je navaden pdf ali rtf dokument (brez moznosti izbire ali vnosa v polja)
-
if($data){
- $data = $this->encodeText($data);
+ $data = LatexDocument::encodeText($data);
}
if($tip==1||$tip==6){ //radio ali multigrid z radio
@@ -654,9 +596,9 @@ class LatexSurveyElement{
break;
case 5:
$arrayVAS = [ 'vas2checked', 'vas3checked', 'vas4checked', 'vas5checked', 'vas6checked'];
- foreach($arrayVAS AS $VAS){
+ /* foreach($arrayVAS AS $VAS){
$radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ } */
break;
case 6:
$arrayVAS = ['vas1checked', 'vas2checked', 'vas3checked', 'vas5checked', 'vas6checked', 'vas7checked'];
@@ -677,99 +619,77 @@ class LatexSurveyElement{
$prviOdgovorSlikovniTip = 1;
$radioButtonTex = ICON_SIZE."{".$this->path2Images."".$this->getCustomRadioSymbol($spremenljivkeId, $prviOdgovorSlikovniTip)."}";
}
- }else{
+ }else{ //ce ni odgovorov respondenta oz. je prazen vprasalnik
if($enota!=11&&$enota!=12){ //ce ni VAS ali slikovni tip
$radioButtonTex = ($export_format=='pdf'?"{\Large $\ocircle$}" : "\\includegraphics[scale=".RADIO_BTN_SIZE."]{".$this->path2Images."radio}");
}elseif($enota==11){ //drugace, ce je VAS
- if($tip==1){
+ if($tip == 1){ //ce je radio
$VASNumber = $VASNumberRadio;
- }else{
- $spremenljivkeGrids = $spremenljivkeGrids - 1;
+ }else{ //drugace (ce je tabela z radio)
$VASNumber = $spremenljivkeGrids;
- }
- $indeksVASIcon = $indeksVASIcon - 1;
- $radioButtonTex = [];
- if($VASNumber>1){
+ }
+ if($VASNumber > 1){
switch ($VASNumber) {
case 1:
$radioButtonTex = "";
break;
case 2:
- $arrayVAS = ['vas3', 'vas5'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}");
break;
case 3:
- $arrayVAS = ['vas3', 'vas4', 'vas5'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas4}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}");
break;
- case 4:
- $arrayVAS = ['vas2', 'vas3', 'vas5', 'vas6'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ case 4:
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas1}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas7}");
break;
case 5:
- $arrayVAS = [ 'vas2', 'vas3', 'vas4', 'vas5', 'vas6'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas1}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas4}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas7}");
break;
case 6:
- $arrayVAS = ['vas1', 'vas2', 'vas3', 'vas5', 'vas6', 'vas7'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas1}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas2}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas6}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas7}");
break;
case 7:
- $arrayVAS = ['vas1', 'vas2', 'vas3', 'vas4', 'vas5', 'vas6', 'vas7'];
- foreach($arrayVAS AS $VAS){
- $radioButtonTex[] = "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."".$VAS."}";
- }
+ $radioButtonTex = array("\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas1}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas2}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas3}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas4}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas5}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas6}", "\\includegraphics[scale=".VAS_SIZE."]{".$this->path2Images."vas7}");
break;
}
- return $radioButtonTex[$indeksVASIcon]; //$indeksVASIcon
+ //echo "polje z VAS simboli </br>";
+ return $radioButtonTex;
}
- }elseif($enota==12){
+ }elseif($enota==12){ //ce je slikovni tip
$prviOdgovorSlikovniTip = 0;
$radioButtonTex = ICON_SIZE."{".$this->path2Images."".$this->getCustomRadioSymbol($spremenljivkeId, $prviOdgovorSlikovniTip)."}";
}
}
return $radioButtonTex;
}else if($tip==2||$tip==16){ //checkbox ali multigrid s checkbox
- if($data){
+ if($data){ //ce je odgovor respondenta
$checkboxTex = ($export_format=='pdf'?'{\Large \CheckedBox}' : "\\includegraphics[scale=".CHCK_BTN_SIZE."]{".$this->path2Images."checkbox2}");
- }else{
+ }else{ //ce ni odgovorov respondenta oz. je prazen vprasalnik
$checkboxTex = ($export_format=='pdf'?'{\Large \Square}' : "\\includegraphics[scale=".CHCK_BTN_SIZE."]{".$this->path2Images."checkbox}");
}
return $checkboxTex;
}elseif($tip==19||$tip==20){ //multi text ali multi number
- $textboxWidth = 0.5/($numGrids+$numOfMissings); //sirina praznega textbox-a
+ $textboxWidth = 0.4/($numGrids+$numOfMissings); //sirina praznega textbox-a
//priprava latex kode za prazen text box dolocene sirine in visine glede na export format
- if($export_format == 'pdf'){
- if($data!=''){
+ if($export_format == 'pdf'){
+ if($data != null){ //ce je odgovor respondenta
$TextBoxWithText = ' \\textcolor{crta}{\footnotesize{'.$data.'}} ';
- //$TextBoxWithText = ' \\textcolor{crta}{\footnotesize{'.$this->encodeText($data).'}} ';
$emptyTextBox = $TextBoxWithText;
- }else{
+ }else{ //ce ni odgovorov respondenta oz. je prazen vprasalnik
if($this->export_subtype == 'q_empty' || $this->export_subtype == 'q_comments'){
$emptyTextBox = ' \fbox{\parbox{'.$textboxWidth.'\textwidth}{ \hphantom{\hspace{'.$textboxWidth.'\textwidth}} }} ';
}else{
$emptyTextBox = ' ';
}
-
}
}elseif($export_format == 'rtf'){
- if($data!=''){
+ if($data!=0){ //ce je odgovor respondenta
$TextBoxWithText = ' '.$data.' ';
$emptyTextBox = $TextBoxWithText;
- }else{
+ }else{ //ce ni odgovorov respondenta oz. je prazen vprasalnik
if($this->export_subtype == 'q_empty' || $this->export_subtype == 'q_comments'){
- $emptyTextBox =' \fbox{\parbox{'.$textboxWidth.'\textwidth}{ \hphantom{\hspace{'.$textboxWidth.'\textwidth}} }} ';
+ $emptyTextBox =' \rule{'.$textboxWidth.'\textwidth}{.1pt} ';
}else{
$emptyTextBox = ' ';
}
@@ -795,548 +715,6 @@ class LatexSurveyElement{
return $temp;
}
#funkcija, ki ureja pretvorbo stevilskega ID vprasanja v "crkovsko" identifikacijo, ker Latex ne podpira imen s stevilkami - konec #############################
-
- #funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno
- function encodeText($text='', $vre_id=0, $naslovStolpca = 0){
- global $site_path, $lang;
- //$text = str_replace(' ','X',$text); //nadomesti presledke
- //echo "Encoding ".$text."</br>";
- //echo "vre_id: ".$vre_id."</br>";
- //echo "ime spremenljivke ".$this->variableName."</br>";
-
- $text = htmlspecialchars_decode($text); //vse html special chars kot je &amp; spremeni v ustrezne simbole (npr. &amp;=>&)
-
- //resevanje razbirajanja predolgih neprekinjenih besed in URL - spremenljivke za kasnejsi prilagojen izpis
- //$numOfWords = str_word_count($text, 0);
- $numOfSpacesPrej = substr_count($text, ' '); //stevilo presledkov v besedilu
- $stringLength = strlen($text);
-
- $findSpace = ' ';
- $posSpace1 = strpos($text, $findSpace); //najdi pozicijo prvega presledka v besedilu
- $posSpace2 = strripos($text, $findSpace); //najdi pozicijo zadnjega presledka v besedilu
-
-
- $findHttp = 'http://';
- $findHttps = 'https://';
- $posHttp = strpos($text, $findHttp);
- $posHttps = strpos($text, $findHttps);
- $isURL = 0;
- /* if($posHttp !== false || $posHttps !== false) { //imamo URL naslov
- $isURL = 1;
- } */
- //resevanje razbirajanja predolgih neprekinjenih besed in URL - konec
-
- $this->path2UploadedImages = $site_path.'uploadi/editor/';
- if($text == ''){ //ce ni teksta, vrni se
- return;
- }
- $textOrig = $text;
- $findme = '<br />';
- $findmeLength = strlen($findme);
- $findImg = '<img';
- $findImgLength = strlen($findImg);
- $findUl = '<ul';
- $findUlLength = strlen($findUl);
- $findOl = '<ol';
- $findLi = '<li';
-
- $findPar = '<p>';
-
- $pos = strpos($text, $findme);
- $posImg = strpos($text, $findImg);
- $posUl = strpos($text, $findUl);
- $posOl = strpos($text, $findOl);
- $posLi = strpos($text, $findLi);
- $posPar = strpos($text, $findPar);
-
- //echo "pozicija paragrafa: $posPar </br>";
-
- //ureditev izrisa slike
- if($posImg !== false){
- $numOfImgs = substr_count($text, $findImg); //stevilo '<img ' v tekstu
- $posImg = strpos($text, $findImg);
- $textPrej = '';
- $textPotem = '';
- for($i=0; $i<$numOfImgs; $i++){
- $posImg = strpos($text, $findImg);
- $textPrej = substr($text, 0, $posImg); //tekst do img
- $textPotem = substr($text, $posImg); //tekst po img, z vkljuceno hmlt kodo z img
- $posImgEnd = strpos($textPotem, '/>'); //pozicija, kjer se konca html koda za img
- $textPotem = substr($textPotem, $posImgEnd+strlen('/>')); //tekst od konca html kode za img dalje
-
- //$text = $textPrej.' '.PIC_SIZE_ANS."{".$this->path2UploadedImages."".$this->getImageName($text, 0, '<img')."}".' '.$textPotem;
- //$text = $textPrej.' '.PIC_SIZE_ANS."{".$this->path2UploadedImages."".$this->getImageName($text, 0, '<img', $vre_id)."}".' '.$textPotem;
- $imageName = $this->path2UploadedImages."".$this->getImageName($text, 0, '<img', $vre_id);
- $imageNameTest = $imageName.'.png'; //za preveriti, ali obstaja slikovna datoteka na strezniku
- //error_log("iz survey element: ".$imageNameTest);
- //echo("iz survey element: ".$imageNameTest."</br>");
- if(filesize($imageNameTest) > 0){
- $text = $textPrej.' '.PIC_SIZE_ANS."{".$imageName."}".' '.$textPotem;
- }else{
- $image = $lang['srv_pc_unavailable'];
- $text = $textPrej.' '.$image.' '.$textPotem;
- }
- }
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike
- $findImgCode = '\includegraphics';
- $posOfImgCode = strpos($text, $findImgCode);
- //echo $posOfImgCode."</br>";
- $textToImgCode = substr($text, 0, $posOfImgCode); //tekst do $findImgCode
- //echo $textToImgCode."</br>";
- $textFromImgCode = substr($text, $posOfImgCode); //tekst po $findImgCode
- //echo $textFromImgCode."</br>";
- $findImgCodeEnd = '}';
- //$posOfImgCodeEnd = strpos($text, $findImgCodeEnd);
- $posOfImgCodeEnd = strpos($textFromImgCode, $findImgCodeEnd);
- //echo $posOfImgCodeEnd."</br>";
- $textAfterImgCode = substr($textFromImgCode, $posOfImgCodeEnd+1); //tekst po $findImgCodeEnd
- //echo $textAfterImgCode."</br>";
- $textOfImgCode = substr($text, $posOfImgCode, $posOfImgCodeEnd+1);
- //echo $textOfImgCode."</br>";
-
- $text = $textToImgCode.$textAfterImgCode;
-
- //pred ureditvijo posebnih karakterjev, odstrani del teksta s kodo za sliko, da se ne pojavijo tezave zaradi imena datoteke od slike - konec
- }
- //ureditev izrisa slike - konec
-
- //ureditev posebnih karakterjev za Latex http://www.cespedes.org/blog/85/how-to-escape-latex-special-characters, https://en.wikibooks.org/wiki/LaTeX/Special_Characters#Other_symbols
- $text = str_replace('\\','\textbackslash{} ',$text);
- //$text = str_replace('{','\{',$text);
- //$text = str_replace('}','\}',$text);
- $text = str_replace('$','\$ ',$text);
-
- if(substr_count($text, '#')){ //ce je stevilo # vecje od 1
- $text = str_replace('#','\#',$text);
- }else{
- $text = str_replace('#','\# ',$text);
- }
- $text = str_replace('%','\% ',$text);
- $text = str_replace('€','\euro',$text);
- $text = str_replace('^','\textasciicircum{} ',$text);
- $text = str_replace('_','\_ ',$text);
- $text = str_replace('~','\textasciitilde{} ',$text);
- if(strpos($text, '&amp;')){ //ce je prisotno v besedilu &amp;'
- $text = str_replace('&amp;','\& ',$text);
- }else{
- $text = str_replace('&','\& ',$text);
- }
- $text = str_replace('&nbsp;','~',$text);
- //$text = str_replace('&lt;','\textless ',$text);
- $text = str_replace('&lt;',' \textless ',$text);
- //$text = str_replace('&gt;','\textgreater ',$text);
- $text = str_replace('&gt;',' \textgreater ',$text);
- //ureditev posebnih karakterjev za Latex - konec
-
- //ureditev grskih crk
- $text = str_replace('α','\textalpha ',$text);
- $text = str_replace('β','\textbeta ',$text);
- $text = str_replace('γ','\textgamma ',$text);
- $text = str_replace('δ','\textdelta ',$text);
- $text = str_replace('ε','\textepsilon ',$text);
- $text = str_replace('ζ','\textzeta ',$text);
- $text = str_replace('η','\texteta ',$text);
- $text = str_replace('θ','\texttheta ',$text);
- $text = str_replace('ι','\textiota ',$text);
- $text = str_replace('κ','\textkappa ',$text);
- $text = str_replace('λ','\textlambda ',$text);
- $text = str_replace('μ','\textmugreek ',$text);
- $text = str_replace('ν','\textnu ',$text);
- $text = str_replace('ξ','\textxi ',$text);
- //$text = str_replace('ο','\textomikron ',$text);
- $text = str_replace('π','\textpi ',$text);
- $text = str_replace('ρ','\textrho ',$text);
- $text = str_replace('σ','\textsigma ',$text);
- $text = str_replace('τ','\texttau ',$text);
- $text = str_replace('υ','\textupsilon ',$text);
- $text = str_replace('φ','\textphi ',$text);
- $text = str_replace('χ','\textchi ',$text);
- $text = str_replace('ψ','\textpsi ',$text);
- $text = str_replace('ω','\textomega ',$text);
- //ureditev grskih crk - konec
-
- //ureditev preureditve html kode ul in li v latex itemize
- if($posUl !== false){
- //echo "text prej: ".$text."</br>";
- $numOfUl = substr_count($text, $findUl); //stevilo '<ul' v tekstu
- //echo "numOfUl ".$numOfUl."</br>";
- ######################
- //if($numOfUl!=0){
- if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
- $text = str_replace('<ul>','\begin{itemize} ', $text);
- $text = str_replace('<ul','\begin{itemize} ', $text);
- $text = str_replace('<li>','\item ', $text);
- $text = str_replace('<li','\item ', $text);
- $text = str_replace('</ul>','\end{itemize} \ ', $text);
- }
- //echo "prazno v html: ".strpos($text, '\r')."</br>";
- //echo "text potem: ".$text."</br>";
- ######################
- }
- //ureditev preureditve html kode ul in li v latex itemize - konec
-
- //ureditev preureditve html kode ol in li v latex enumerate, ki je ostevilcen
- if($posOl !== false){
- //echo "text prej: ".$text."</br>";
- $numOfOl = substr_count($text, $findOl); //stevilo '<ol' v tekstu
- //echo "numOfUl ".$numOfUl."</br>";
- ######################
- //if($numOfUl!=0){
- if($numOfOl!=0 && $posLi !== false){ //ce imamo ol in li
- $text = str_replace('<ol>','\begin{enumerate} ', $text);
- $text = str_replace('<li>','\item ', $text);
- $text = str_replace('<li','\item ', $text);
- $text = str_replace('</ol>','\end{enumerate} \ ', $text);
- }
- //echo "prazno v html: ".strpos($text, '\r')."</br>";
- //echo "text potem: ".$text."</br>";
- ######################
- }
- //ureditev preureditve html kode ol in li v latex enumerate, ki je ostevilcen - konec
-
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
- if($posImg !== false){
- $text = substr_replace($text, $textOfImgCode, $posOfImgCode, 0);
- }
- //po ureditvi posebnih karakterjev, dodati del teksta s kodo za sliko, ce je slika prisotna
-
- if($posPar !== false){ //ce je kaksen html tag <p>, dodaj prazno vrstico oz. break
- if($this->variableName=='gdpr'){
- if($numOfUl!=0 && $posLi !== false){ //ce imamo ul in li
- $divider = ' ';
- }else{
- $divider = ' \\ \\\\ ';
- }
- $text = str_replace('<p>',$divider, $text);
- }else{
- $text = str_replace('<p>',' ', $text);
- }
- }
-
-
- //priprava izpisa zelo dolgega besedila brez presledkov (URL, email, ...)
- //if($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
- if( ($numOfSpacesPrej == 0 && ($stringLength >= MAX_STRING_LENGTH)) || ($numOfSpacesPrej == 1 && $posSpace1 == $posSpace2 && $stringLength >= MAX_STRING_LENGTH)){ //ce v besedilu ni presledkov in je besedilo daljse od max dovoljene dolzine
- //$text = "\seqsplit{".$text."}"; //ni v redu seqsplit, ker ne dela, če so posebni znaki
- $text = substr_replace($text, $this->texNewLine, MAX_STRING_LENGTH, 0); //dodaj na ustrezni dolzini besedila prehod v novo vrstico
- }
- //priprava izpisa zelo dolgega besedila brez presledkov - konec
- //echo "text potem: ".$text."</br>";
-
- //detekcija prisotnosti e-naslova v besedilu in primerna preureditev, da pride do pravilnega izpisa
- $findAt = '@';
- $numOfAt = substr_count($text, $findAt); //stevilo '@' v besedilu
-
- $posAt = strpos($text, $findAt);
- if($posAt && $posSpace1){ //ce je prisotna afna in je prisoten presledek v besedilu
- //echo "afna je: $posAt </br>";
- //echo "Encoding: ".$text."</br>";
-
- //najdi prvi presledek po afni
- //echo substr($text, $posAt) ."</br>";
- $posSpace1Mail = strpos(substr($text, $posAt), $findSpace); //najdi pozicijo prvega presledka v besedilu po e-naslovu
- $posSpace1Mail = $posSpace1Mail+$posAt; //koncna pozicija, ce se gleda celotno besedilo
- //echo $posSpace1Mail."</br>";
-
- //najdi prvi presledek pred afno
- $posSpace2Mail = strripos(substr($text, 0, $posAt), $findSpace); //najdi pozicijo zadnjega presledka v besedilu pred e-naslovom
- //echo $posSpace2Mail."</br>";
-
- //dodaj po e-naslovu potrebno latex kodo za zakljucek url
- $text = substr_replace($text, '}', $posSpace1Mail, 0);
-
- //dodaj pred e-naslovom potrebno latex kodo za url
- //substr_replace(string_name, replacement_string, start_pos, length)
- $text = substr_replace($text, ' \url{', $posSpace2Mail+1, 0);
- //echo $text."</br>";
- }
- //detekcija prisotnosti e-naslova v besedilu in primerna preureditev, da pride do pravilnega izpisa - konec
-
-
- //RESEVANJE BESEDILA V CIRILICI
- $contains_cyrillic = (bool) preg_match('/[\p{Cyrillic}]/u', $text); //ali je v besedilu cirilica?
- if($contains_cyrillic){ // ce je cirilica v besedilu
- $text = '\foreignlanguage{russian}{'.$text.'}';
- }
- //RESEVANJE BESEDILA V CIRILICI - konec
-
-
-
- //RESEVANJE odstranitve dodatnih style tag-ov po ul, ipd. #######################################################
- $findStyleTag = 'style="';
- //$findStyleTagEnd = '"';
- $findStyleTagEnd = '">';
- $numOfStyleTags = substr_count($text, $findStyleTag); //stevilo 'style=" ' v tekstu
- //echo "stevilo style: ".$numOfStyleTags." </br>";
- //echo $text."</br>";
- for($s=0; $s<$numOfStyleTags; $s++){ //za vsako najdeno 'style=" ' besedilo, uredi njeno odstranitev
- $posStyleTag = strpos($text, $findStyleTag);
- $posStyleTagEnd = strpos($text, $findStyleTagEnd, $posStyleTag); //strpos(string,find,start) najdi $findStyleTagEnd v $text, isci od $posStyleTag dalje
- $dolzinaOff = $posStyleTagEnd - $posStyleTag + 2;
- $text = substr_replace($text, "", $posStyleTag, $dolzinaOff);
-
- }
- //RESEVANJE odstranitve dodatnih style tag-ov po ul, ipd. - konec #################################################
-
- if($pos === false && $posImg === false) { //v tekstu ni br in img
-
- $text = preg_replace("/(\R){2,}/", "$1", $text);
- return strip_tags($text);
- }else { //v tekstu sta prisotna br ali img
- $text2Return = ''; //tekst ki bo vrnjen
-
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico
- if($naslovStolpca==0){ // ce besedilo ni naslov stolpca tabele
- if($pos !== false){
- $pos = strpos($text, $findme);
- $numOfBr = substr_count($text, $findme); //stevilo '<br />' v tekstu
- for($i=0; $i<$numOfBr; $i++){
- if($i == 0){ //ce je prvi najdeni '<br />'
- $textPrej = substr($text, 0, $pos);
- $textPotem = substr($text, $pos+$findmeLength);
- if($i == $numOfBr-1){
- //$text2Return .= $textPrej.' \break '.$textPotem;
- $text2Return .= $textPrej.' \\\\ '.$textPotem;
- }else{
- //$text2Return .= $textPrej.' \break ';
- $text2Return .= $textPrej.' \\\\ ';
- }
- }else{ //drugace
- $pos = strpos($textPotem, $findme);
- $textPrej = substr($textPotem, 0, $pos);
- $textPotem = substr($textPotem, $pos+$findmeLength);
- if($i == $numOfBr-1){
- //$text2Return .= $textPrej.' \break '.$textPotem;
- $text2Return .= $textPrej.' \\\\ '.$textPotem;
- }else{
- //$text2Return .= $textPrej.' \break ';
- $text2Return .= $textPrej.' \\\\ ';
- }
- }
- }
- $text = $text2Return;
- }
- }
- //ureditev preureditev html kode za novo vrstico v latex, ureditev prenosa v novo vrstico - konec
- //echo "text potem: ".$text."</br>";
- $text = preg_replace("/(\R){2,}/", "$1", $text);
- return strip_tags($text); //vrni tekst brez html tag-ov
- }
- }
- #funkcija ki skrbi za encode dolocenih spornih delov besedila v latex-u prijazno - konec
-
- #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati ######################################
- function getImageName($text='', $sprId=null, $findme='', $vre_id=0){
- global $site_path;
- $imageName = '';
-
- if($text == 'hotspot' && $findme == 'hotspot_image='){
- $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
- $rowParametrov = mysqli_fetch_row($sqlParametrov);
- $text = $rowParametrov[0];
- }
-
- $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
- //echo "text za echo: ".$text."</br>";
- //if($pos!=''){ //ce je slika v bazi
- if($pos!=''||$pos==0){ //ce je slika v bazi
- $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
- //echo "imageName prej: ".$imageName."</br>";
-
- $findme = $site_path.'uploadi/editor/';
- //$findme = 'uploadi/editor/';
-
- $pos = strpos($imageName, $findme); //najdi pozicijo teksta v $findme
- //echo "najdi tole: ".$findme."</br>";
- //echo "najdi tukaj: ".$imageName."</br>";
- //echo "pozicija tega: ".$pos."</br>";
- if($pos){ //ce je slika na strezniku
- $slikaNaStrezniku = 1;
- }else{//ce slike ni na strezniku
- $slikaNaStrezniku = 0;
- }
- //echo "ali je slika na strežniku: ".$slikaNaStrezniku."</br>";
- if($slikaNaStrezniku==1){ //ce je slika na strezniku
- $imageName = substr($imageName,$pos+7); //pokazi le del params od besedila 'editor/' dalje, brez besedila 'editor/'
- $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
- $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif)
- /* echo "exr1: ".$imageExtension."</br>";
- $imageExtension = strrchr($imageName, '.'); //pridobi koncnico slike (za gif je potrebno sliko pretvoriti v png, saj latex ne podpira gif, jpg in jpeg)
- echo "exr2: ".$imageExtension."</br>"; */
-
- $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
-
- $path = $site_path.'uploadi/editor/'.$imageName;
-
- if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png
- $this->convertGifToPng($path, $slikaNaStrezniku);
- }
-
- if($imageExtension == 'jpg' || $imageExtension == 'peg'){ //ce je slika jpg ali jpeg, jo je potrebno pretvoriti v png
- $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
- }
- }elseif($slikaNaStrezniku==0){ //ce slike ni na strezniku
- //echo "vre_id: $vre_id </br>";
- $imageName = $this->getOnlineImageName($imageName, $slikaNaStrezniku, $vre_id); //pridobi njen URL
- }
-
- $imageName = substr($imageName, 0, strrpos($imageName, '.'));
-
- }
-
- //echo "imagename pred return: ".$imageName."</br>";
- return $imageName;
- }
- #funkcija, ki skrbi za pridobitev imena slike, ki jo je potrebno izrisati - konec ###############################
-
-
- #funkcija, ki skrbi za pridobitev ustrezne strezniske poti do slike - trenutno ni v uporabi ########################################################
- function getPath2Images($text='', $sprId=null, $findme=''){
- global $site_path;
- $imageName = '';
-
- if($text == 'hotspot' && $findme == 'hotspot_image='){
- $sqlParametrov = sisplet_query("SELECT params FROM srv_spremenljivka WHERE id='".$sprId."'");
- $rowParametrov = mysqli_fetch_row($sqlParametrov);
- $text = $rowParametrov[0];
- }
-
- $pos = strpos($text, $findme); //najdi pozicijo teksta v $findme
-
- if($pos!=''||$pos==0){ //ce je slika v bazi
- $imageName = substr($text,$pos); //pokazi le del text od besedila $findme dalje (vkljucno z besedilom)
-
- $findme = 'editor/';
- $pos = strpos($imageName, $findme); //najdi pozicijo teksta 'editor/'
-
- if($pos){ //ce je slika na strezniku
- $slikaNaStrezniku = 1;
- }else{//ce slike ni na strezniku
- $slikaNaStrezniku = 0;
- }
-
- if($slikaNaStrezniku==1){ //ce slika je bila prenesena na streznik
- $path2Images = $site_path.'admin/survey/export/latexclasses/textemp/images/';
- }elseif($slikaNaStrezniku==0){ //ce slika je bila na dolocenem URL
- $path2Images = $site_path.'uploadi/editor/';
- }
-
- }
- //echo "pot do slik: ".$path2Images."</br>";
- return $path2Images;
- }
- #funkcija, ki skrbi za pridobitev ustrezne strezniske poti do slike - konec ########################################################
-
-
- #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike ######################################
- function getOnlineImageName($imageName='', $slikaNaStrezniku=null, $vre_id=null){
- global $site_path;
- //echo "imageName v getOnlineImageName nekje vmes 1: ".$imageName."</br>";
- $row = Cache::srv_spremenljivka(self::$spremenljivka);
- //echo "sprem: ".self::$spremenljivka."</br>";
- $spremenljivkaParams = new enkaParameters($row['params']);
- //echo "params: ".$spremenljivkaParams->get('hotspot_image')."</br>";
- $imageNameTmp = $spremenljivkaParams->get('hotspot_image');
- //if($imageNameTmp!=''){ //ce je hotspot
- if($imageNameTmp!=''&&$vre_id==0){ //ce je hotspot
- $imageName = $imageNameTmp;
- }
-
- $findHttp = 'http';
- $posHttp = strpos($imageName, $findHttp);
- $imageName = substr($imageName,$posHttp); //besedilo do zacetka http
-
- $pos = $this->getEndPosition($imageName); //najdi pozicijo konca URL slike
- $imageName = substr($imageName, 0, $pos); //pokazi le del params od zacetka besedila do '"' oz. konca URL slike
- //echo "imageName v getOnlineImageName nekje vmes 2: ".$imageName."</br>";
- $imageExtension = substr($imageName, $pos-3, 3); //pridobi koncnico slike
- //echo "imageExtension: ".$imageExtension."</br>";
-
- if($imageExtension!='jpg'&&$imageExtension!='png'&&$imageExtension!='gif'&&$imageExtension!='jpeg'){ //ce ni veljavnen extension, spremeni ga v png
- $imageExtension='png';
- }
-
- if($vre_id){ //ce se pridobiva imena tmp slik iz vrednosti vprasanja
- $imgFilename = self::$spremenljivka.'_'.$vre_id.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
- }else{
- $imgFilename = self::$spremenljivka.'_tmpImage.'.$imageExtension; //tmp ime slike, ki je sestavljeno iz id spremenljivke+tmpImage+extension
- }
-
- $pathDir = $site_path.'uploadi/editor/'; //pot za novo mapo, kjer se bodo shranjevale slike za trenutno anketo
- $path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
-
- # ukaz za pretakanje slike
- if(IS_WINDOWS){
- //za windows sisteme //powershell -command "& { iwr URL -OutFile 'PATH' }"
- $command = 'powershell -command "& { iwr \''.$imageName.'\' -OutFile \''.$path.'\' }"';
- //$command = 'wget -O \''.$imageName.'\' -O '.$path.' ';
- }elseif(IS_LINUX){
- //za linux sisteme //exec('wget URL -P PATH ');
- //$command = 'wget \''.$imageName.'\' -P '.$path.' ';
- $command = 'wget -O '.$path.' \''.$imageName.'\' ';
- }
-
- //echo "command: ".$command."</br>";
- exec($command); //pretoci sliko
-
- //$path = $pathDir.$imgFilename; //pot do datoteke z imenom datoteke
-
-/* if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
- $this->convertGifToPng($path, $slikaNaStrezniku);
- } */
-
- if($imageExtension != 'png'){ //ce slika ni png, jo pretvori
- if($imageExtension == 'gif'){ //ce je slika gif, jo je potrebno pretvoriti v png, saj latex ne podpira gif
- $this->convertGifToPng($path, $slikaNaStrezniku);
- }else{
- $this->convertJpgToPng($path, $slikaNaStrezniku, $imageExtension);
- }
- }
-
- //echo "imgfilename: ".$imgFilename."</br>";
- return $imgFilename;
- }
- #funkcija, ki skrbi za pridobitev slike, ki se nahaja nekje online in jo je potrebno izrisati, in vrne lokalno ime slike - konec ###############################
-
-
- function convertGifToPng($path='', $slikaNaStrezniku=null){
- //echo "path: ".$path."</br>";
- $image = imagecreatefromgif($path); //pripravi sliko iz gif za pretvorbo
- $imageName = substr($path, 0, -3); //ime slike brez extension-a
- //echo $imageName."</br>";
- $imageNamePNG = $imageName.'png'; //ime slike z ustreznim extension
- imagepng($image, $imageNamePNG); //pretvori pripravljeno gif sliko v png
-
- if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, GIF izbrisi
- unlink($imageName.'gif'); //izbrisi gif sliko
- }
- }
-
- function convertJpgToPng($path='', $slikaNaStrezniku=null, $imageExtension=''){
- $image = imagecreatefromjpeg($path); //pripravi sliko iz jpg za pretvorbo
- $imageName = substr($path, 0, strrpos($path, '.')); //ime slike brez extension-a
-
- $imageNamePNG = $imageName.'.png'; //ime slike z ustreznim extension
- imagepng($image, $imageNamePNG); //pretvori pripravljeno jpg sliko v png
-
- //$origExtension = strrchr($path, '.');
-
- if($slikaNaStrezniku==0){ //ce slika je iz URL in ni na strezniku, izbrisi jo
- if($imageExtension == 'jpg'){
- unlink($imageName.'.'.$imageExtension); //izbrisi sliko
- }elseif($imageExtension == 'peg'){
- unlink($imageName.'.j'.$imageExtension); //izbrisi sliko
- }
- }
- }
-
- function getEndPosition($imageName=''){
- $findme = '"';
- $pos = strpos($imageName, $findme); //najdi pozicijo teksta '"'
- return $pos;
- }
-
#funkcija, ki skrbi za pridobitev simbola za slikovni tip ######################################
function getCustomRadioSymbol($sprId=null, $odgovor=null){
@@ -1351,7 +729,6 @@ class LatexSurveyElement{
if($odgovor){ //ce je odgovor
$customRadioSymbol = $customRadioSymbol."Inverted"; //preuredi, da bo razvidna grafika, ko je prisoten odgovor respondenta
}
- //echo $customRadioSymbol.' asca</br>';
return $customRadioSymbol;
}
#funkcija, ki skrbi za pridobitev simbola za slikovni tip - konec ###############################
@@ -1363,11 +740,12 @@ class LatexSurveyElement{
* @param mixed $vrednost
*/
function srv_language_vrednost ($vre_id=null) {
- //if ($this->language != -1) {
+ //if ($this->language != -1) {
+
if ($this->prevod) {
$sqllString = "SELECT naslov, naslov2 FROM srv_language_vrednost WHERE vre_id='".$vre_id."' AND lang_id='".$this->language."'";
$sqll = sisplet_query($sqllString);
- $rowl = mysqli_fetch_array($sqll);
+ $rowl = mysqli_fetch_array($sqll);
return $rowl;
}
return false;
@@ -1379,10 +757,9 @@ class LatexSurveyElement{
* @param mixed $vrednost
*/
function srv_language_grid ($grd_id=null, $spr_id=null) {
-
//if ($this->language != -1) {
if ($this->prevod) {
- $sqllString = "SELECT naslov FROM srv_language_grid WHERE spr_id = '".$spr_id."' AND grd_id='".$grd_id."' AND lang_id='".$this->language."'";
+ $sqllString = "SELECT naslov, podnaslov FROM srv_language_grid WHERE spr_id = '".$spr_id."' AND grd_id='".$grd_id."' AND lang_id='".$this->language."'";
$sqll = sisplet_query($sqllString);
$rowl = mysqli_fetch_array($sqll);
return $rowl;
@@ -1390,7 +767,7 @@ class LatexSurveyElement{
return false;
}
-/* function srv_language_grid ($spremenljivka, $grid) {
+ function srv_language_grid_old ($spremenljivka, $grid) {
if ($this->language != -1) {
$sqll = sisplet_query("SELECT * FROM srv_language_grid WHERE ank_id='".$this->anketa['id']."' AND spr_id='".$spremenljivka."' AND grd_id='".$grid."' AND lang_id='".$this->language."'");
@@ -1400,7 +777,7 @@ class LatexSurveyElement{
}
return false;
- } */
+ }
#funkcija, ki skrbi za filanje obstojecega polja z odgovori z missing odgovori #############################################################
function AddMissingsToAnswers($vodoravniOdgovori=[], $missingOdgovori=[]){
@@ -1414,11 +791,12 @@ class LatexSurveyElement{
#funkcija, ki skrbi za izpis latex kode za zacetek tabele ##################################################################################
#argumenti 1. export_format, 2. parametri tabele, 3. tip tabele za pdf, 4. tip tabele za rtf, 5. sirina pdf tabele (delez sirine strani), 6. sirina rtf tabele (delez sirine strani)
function StartLatexTable($export_format='', $parameterTabular='', $pdfTable=null, $rtfTable=null, $pdfTableWidth=null, $rtfTableWidth=null){
- $tex = '';
- $tex .= '\keepXColumns';
+ $tex = "";
+ $tex .= "\keepXColumns";
if($export_format == 'pdf'){
- $tex .= '\begin{'.$pdfTable.'}';
- if($pdfTable=='tabularx'){
+ //$tex .= "\r\n";
+ $tex .= "\begin{".$pdfTable."}";
+ if($pdfTable=='xltabular'){
$tex .= '{'.$pdfTableWidth.'\textwidth}';
}
$tex .= '{ '.$parameterTabular.' }';
@@ -1458,13 +836,16 @@ class LatexSurveyElement{
$tex .= ' {\parbox{'.$textboxWidth.'\textwidth}';
}
+
+ if(is_array($text)){
+ $text = implode(" ", $text);
+ }
if($text==''){ //ce ni teksta, je okvir prazen
if($export_format == 'pdf'){
$tex .= '{ \hphantom{\hspace{'.$textboxWidth.'\textwidth}} }}';
}elseif($export_format == 'rtf'){
- //$tex .= ' \rule{40mm}{.1pt} '; //izpisi neprekinjeno crto, ki je dolga 40mmm in debela 0.1pt
- $tex .= ' \rule{'.$textboxWidth.'\textwidth}{.1pt} '; //izpisi neprekinjeno crto, ki je dolga 40mmm in debela 0.1pt
+ $tex .= ' \rule{'.$textboxWidth.'\textwidth}{.1pt} '; //izpisi neprekinjeno crto, ki je premaknjena za hspace in dolga $textboxWidth in debela 0.1pt
}
}else{ //drugace, izpisi besedilo
if($export_format == 'pdf'){
@@ -1483,7 +864,7 @@ class LatexSurveyElement{
function LatexUShape($export_format='', $textboxHeight=null, $textboxWidth=null){
$tex = '';
if($export_format == 'pdf'&&$textboxHeight!=0){
- $tex .= '\keepXColumns\begin{tabularx}{0.25\textwidth}{C} '; //zacetek tabele, ki bo zgledala kot okvir
+ $tex .= '\keepXColumns\begin{xltabular}{0.25\textwidth}{C} '; //zacetek tabele, ki bo zgledala kot okvir
$tex .= ' \begin{tikzpicture} ';
//$tex .= ' \draw (0,0) -- (4,0) -- (4,4) (0,4) -- (0,0);';
$tex .= ' \draw (0,0) -- ('.$textboxWidth.',0) -- ('.$textboxWidth.','.$textboxHeight.') (0,'.$textboxHeight.') -- (0,0);';
@@ -1503,7 +884,7 @@ class LatexSurveyElement{
$tex = '';
if($export_format == 'pdf'&&$textboxHeight!=0){
- $tex .= '\keepXColumns\begin{tabularx}{0.25\textwidth}{C} '; //zacetek tabele, ki bo zgledala kot okvir
+ $tex .= '\keepXColumns\begin{xltabular}{0.25\textwidth}{C} '; //zacetek tabele, ki bo zgledala kot okvir
$tex .= ' \begin{tikzpicture} ';
//\draw (-2,0) -- (2,0) -- (2,1.5 cm) (-2,1.5 cm) -- (-2,0)
@@ -1531,11 +912,11 @@ class LatexSurveyElement{
$tex = '';
if($export_format == 'pdf'&&$textboxHeight!=0){
if($jeOdgovor==0){
- $tex .= '\keepXColumns\begin{tabularx}{0.25\textwidth}{|C|} '; //zacetek tabele, ki bo zgledala kot okvir
+ $tex .= '\keepXColumns\begin{xltabular}{0.25\textwidth}{|C|} '; //zacetek tabele, ki bo zgledala kot okvir
$tex .= '\hline'; //izris horizontalne obrobe za zacetek tabele
- $tex .= '{\parbox{0.25\textwidth}{\vspace{0.5\baselineskip} \centering ';
+ $tex .= '{\parbox{0.25\textwidth} \centering '; //$tex .= '{\parbox{0.25\textwidth}{\vspace{0.5\baselineskip} \centering ';
$tex .= $textNaslovOkvir;
- $tex .= '\vspace{0.5\baselineskip}}}';
+ $tex .= '}'; //$tex .= '\vspace{0.5\baselineskip}}}';
$tex .= $this->texNewLine;
$tex .= '\hline'; //izris horizontalne obrobe za zakljuciti tabelo
$tex .= '{\parbox{0.25\textwidth}{\vspace{0.5\baselineskip} \centering ';
@@ -1543,15 +924,15 @@ class LatexSurveyElement{
$tex .= '\vspace{0.5\baselineskip}}}';
$tex .= $this->texNewLine;
$tex .= '\hline'; //izris horizontalne obrobe za zakljuciti tabelo
- $tex .= '\end{tabularx}'; //konec tabele znotraj skatle
+ $tex .= '\end{xltabular}'; //konec tabele znotraj skatle
}else{
- $tex .= '\keepXColumns\begin{tabularx}{0.25\textwidth}{|C|} '; //zacetek tabele, ki bo zgledala kot okvir
+ $tex .= '\keepXColumns\begin{xltabular}{0.25\textwidth}{|C|} '; //zacetek tabele, ki bo zgledala kot okvir
$tex .= '\hline'; //izris horizontalne obrobe za zacetek tabele
$tex .= $textNaslovOkvir;
$tex .= '\hline'; //izris horizontalne obrobe za zakljuciti tabelo
$tex .= $textIzpis;
$tex .= '\hline'; //izris horizontalne obrobe za zakljuciti tabelo
- $tex .= '\end{tabularx}'; //konec tabele znotraj skatle
+ $tex .= '\end{xltabular}'; //konec tabele znotraj skatle
}
}elseif($export_format == 'rtf'||($export_format == 'pdf'&&$textboxHeight==0)){
$tex .= ' \fbox{\parbox{'.$textboxWidth.'\textwidth}';
@@ -1567,34 +948,29 @@ class LatexSurveyElement{
$tex = '';
for($i = 0; $i < $steviloStolpcev; $i++){
if ($i != 0){ //ce ni prvi stolpec
- //if($enota==11 || $enota==12 || ($enota==0 && ($trak==0&&$customColumnLabelOption==1)) ||($enota==0 && $spremenljivke['tip']==16) ||($enota==1 && ($trak==0&&$customColumnLabelOption==1)) || $enota==8 || $enota==3){ //klasicna ali diferencial tabela (brez traku) ali tabela da/ne ali dvojna tabela ali VAS ali slikovni tip
- if(($enota==0 && ($trak==0&&$customColumnLabelOption==1)) ||($enota==0 && $spremenljivke['tip']==16) ||($enota==1 && ($trak==0&&$customColumnLabelOption==1)) || $enota==8 || $enota==3 || $enota==11 || $enota==12 || ($enota==2 && $spremenljivke['tip']==24)){ // ce je klasicna ali diferencial tabela (brez traku) ali tabela da/ne ali dvojna tabela ali VAS ali slikovni tip ali roleta/seznam v kombinirani tabeli
+ if((($enota==0 && ($trak==0&&$customColumnLabelOption==1)) || ($enota==1 && ($trak==0&&$customColumnLabelOption==1))) ||($enota==0 && $spremenljivke['tip']==16) ||($enota==1 && ($trak==0&&$customColumnLabelOption==1)) || $enota==8 || $enota==3 || $enota==11 || $enota==12 || ($enota==2 && $spremenljivke['tip']==24)){ // ce je (klasicna ali diferencial tabela (brez traku)) ali tabela da/ne ali dvojna tabela ali VAS ali slikovni tip ali roleta/seznam v kombinirani tabeli
if($i==$steviloStolpcev-1 && $enota==1){ //ce je zadnji stolpec in je diferencial
for($m=0;$m<count($missingOdgovori);$m++){
$tex .= " & ".$missingOdgovori[$m];
}
$tex .= " & ";
}else{
- $tex .= " & ".$vodoravniOdgovori[$i-1];
+ $tex .= " & ".$vodoravniOdgovori[$i-1];
+
}
}elseif($enota == 5){ //maxdiff
if($i == 1){
$tex .= ' & ';
}
$tex .= $vodoravniOdgovori[$i];
- }
+ }
}elseif($i == 0 && $enota != 5){ //ce je prvi stolpec tabele in ni "maxdiff"
$tex .= '';
}elseif($i == 0 && $enota == 5){ //ce je prvi stolpec tabele in "maxdiff"
$tex .= $vodoravniOdgovori[$i].' & ';
- //}elseif( ($i == $steviloStolpcev-1 && $enota != 5) || $enota == 1){ //ce je zadnji stolpec tabele in ni "maxdiff" ali je diferencial
- }elseif( ($i == $steviloStolpcev-1 && $enota != 5) ){ //ce je zadnji stolpec tabele in ni "maxdiff" ali je diferencial
- $tex .= ' & ';
+ }elseif( ($i == $steviloStolpcev-1 && $enota != 5) ){ //ce je zadnji stolpec tabele in ni "maxdiff"
+ $tex .= ' & ';
}
-
-
- //echo "odgovori ".$i.": ".$vodoravniOdgovori[$i-1]." </br>";
- //echo "koda za indeks ".$i.": ".$tex." </br>";
}
#Nastavitev UPORABA LABEL
@@ -1641,102 +1017,94 @@ class LatexSurveyElement{
}
}
#Nastavitev UPORABA LABEL - KONEC
- //echo "</br>";
//$tex .= '\endhead'; //da se naslovna vrstica ponovi na vsaki strani, ce tabela gre na novo stran
- //echo "koda: ".$tex."</br>";
- return $tex;
+ return $tex;
}
#funkcija, ki skrbi za pravilen izris prve vrstice v tabelah (vrstica z vodoravnimi naslovi multigridov) - konec #####################
#funkcija, ki skrbi za izris vrstic tabele (z multigrid) ###########################################################
- function LatexVrsticeMultigrid($numRowsSql=null, $export_format='', $enota=null, $simbolTex=null, $navpicniOdgovori=null, $trakStartingNumberTmp=null, $fillablePdf=null, $numColSql=null, $spremenljivke=null, $trak=null, $vodoravniOdgovori=null, $texNewLine='', $navpicniOdgovori2=null, $missingOdgovori=null, $vodoravniOdgovoriTip=null, $vodoravniOdgovoriEnota=null, $vodoravniOdgovoriSprId=null, $data=null, $export_subtype=null, $preveriSpremenljivko=null, $userDataPresent=null, $presirokaKombo = null, $export_data_type=null){
+ function LatexVrsticeMultigrid($numRowsSql=null, $export_format='', $enota=null, $simbolTex=null, $navpicniOdgovori=null, $trakStartingNumber=null, $fillablePdf=null, $numColSql=null, $spremenljivke=null, $trak=null, $vodoravniOdgovori=null, $texNewLine='', $navpicniOdgovori2=null, $missingOdgovori=null, $vodoravniOdgovoriTip=null, $vodoravniOdgovoriEnota=null, $vodoravniOdgovoriSprId=null, $data=null, $export_subtype=null, $preveriSpremenljivko=null, $userDataPresent=null, $presirokaKombo = null, $export_data_type=null, $usr_id=null, $loop_id=null, $skipEmpty = null, $skipEmptySub = null){
+ //$time_start = microtime(true);
+
$this->export_subtype = $export_subtype;
$tex = '';
global $lang, $site_path;
$this->path2Images = $site_path.'admin/survey/export/latexclasses/textemp/images/';
- //$radioButtonTex = ($export_format=='pdf'?"{\Large $\ocircle$}" : "\\includegraphics[scale=".RADIO_BTN_SIZE."]{radio}");
$indeksOdgovorovRespondentMultiNumText = 0;
-
- if($spremenljivke['enota']==2||$spremenljivke['enota']==6){ //ce je seznam ali roleta //$enota == 2 || $enota == 6
+
+ if(($spremenljivke['enota']==2||$spremenljivke['enota']==6)&&($spremenljivke['tip']!=20&&$spremenljivke['tip']!=19)){ //ce je seznam ali roleta in ni multinumber ALI multitext
if(count($missingOdgovori)==0){ //ce ni missing vrednosti
$numColSql = $numColSql + 1;
- }
+ }
}
$userAnswerIndex = array();
$userAnswerIndex[$spremenljivke['id']] = 0;
$z = 0;
$skipRow = false;
- $this->skipEmpty = (int)SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty'); // izpusti vprasanja brez odgovora
- $this->skipEmptySub = (int)SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty_sub'); // izpusti podvprasanja brez odgovora
+ //$this->skipEmpty = (int)SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty'); // izpusti vprasanja brez odgovora
+ //$this->skipEmptySub = (int)SurveySetting::getInstance()->getSurveyMiscSetting('export_data_skip_empty_sub'); // izpusti podvprasanja brez odgovora
+ $this->skipEmpty = $skipEmpty;
+ $this->skipEmptySub = $skipEmptySub;
if($spremenljivke['tip']==24){ //ce je kombinirana tabela
- //echo "stevilo stolpcev za izpis kombinirane podan: ".$numColSql."</br>";
- //print_r($data);
- //if($presirokaKombo == 1 && count($data) != 0 && ($enota == 2 || $enota == 6)){
if($presirokaKombo == 1 && count($data) != 0 && (($enota == 2 || $enota == 6) || $export_data_type == 2 && $vodoravniOdgovoriTip[0] == 6)){
$numColSql = 1 + 1;
- //echo "stevilo stolpcev za izpis kombinirane izračunan: ".$numColSql."</br>";
}else{
$numColSql = count($vodoravniOdgovoriEnota) + 1;
}
}
-
- //echo "stevilo vrstic: $numRowsSql za enoto: ".$spremenljivke['enota']."</br>";
+ if($trakStartingNumber && $trak){
+ $trakStartingNumberTmp = intval($trakStartingNumber); //tmp spremenljivka, ki je potrebna za pravilen izris stevilk, ce imamo trak
+ }
+
+
//IZRIS PO VRSTICAH
+
for ($i = 1; $i <= $numRowsSql; $i++){ //za vsako vrstico
-
+
if($i == 1 && ($enota == 2 || $enota == 6)&&$spremenljivke['tip']!=24){ //ce je prvi dogovor IN je roleta ALI seznam IN ni kombinirana tabela
if($export_format == 'rtf'){ //ce je rtf
$tex .= ' \hline '; //dodaj crto
}
}
-
- //echo "preskakovanje vprašanj: ".$this->skipEmptySub."</br>";
-
+
// Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici
if($this->skipEmptySub == 1){
$skipRow = true;
- for($z=$z;$z<$i*($numColSql-1);$z++){
- //echo "Podatek: ".$data[$z]."</br>";
- if($data[$z]){
- //echo "Podatek je"."</br>";
- $skipRow = false;
- $podatekZaSlikovniTip = $data[$z]; //belezi podatek za slikovni tip, ki pride prav za pravilen izpis izvoza
+ for($z = $z; $z < $i * ($numColSql - 1); $z++){
+ if(is_array($data)){
+ if(array_key_exists($z, $data)){
+ if($data[$z]){
+ $skipRow = false;
+ $podatekZaSlikovniTip = $data[$z]; //belezi podatek za slikovni tip, ki pride prav za pravilen izpis izvoza
+ }
+ }
}
}
- }
-
- /* echo "skipRow je $skipRow"."</br>";
- echo "userDataPresent je $userDataPresent"."</br>";
- echo "skipEmpty je ".$this->skipEmpty."</br>"; */
- //echo "____________________________________________</br>";
+ }
// Ce imamo nastavljeno preskakovanje podvprasanj preverimo ce je kaksen odgovor v vrstici - konec
- //echo "za vrstico $i je $skipRow na stolpcih: $numColSql</br>";
- //if(!$skipRow||(!$userDataPresent&&$this->skipEmpty==0)){ /* ce je potrebno preskociti vrstico ALI (ni podatkov za prikaz, vendar je potrebno pokazati vprasanja brez odgovorov) */
- if(!$skipRow||(!$userDataPresent&&$this->skipEmpty==0)||$export_subtype == 'q_empty'){ /* ce je potrebno preskociti vrstico ALI (ni podatkov za prikaz, vendar je potrebno pokazati vprasanja brez odgovorov) */
+
+ if(!$skipRow || (!$userDataPresent && $this->skipEmpty == 0) || $export_subtype == 'q_empty'){ /* ce je potrebno preskociti vrstico ALI (ni podatkov za prikaz, vendar je potrebno pokazati vprasanja brez odgovorov) ALI je prazen vprasalnik */
if($i%2 != 0 && $export_format == 'pdf'){
if($enota == 5){ //ce je maxdiff
+ $tex .= "\\rowcolor[gray]{.9}".$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' & '; //pobarvaj ozadje vrstice
//$tex .= "\\rowcolor[gray]{.9}".$simbolTex.' & '; //pobarvaj ozadje vrstice
- $tex .= "\\rowcolor[gray]{.9}".$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' & '; //pobarvaj ozadje vrstice
$userAnswerIndex[$spremenljivke['id']]++;
}else{
$tex .= "\\rowcolor[gray]{.9}".$navpicniOdgovori[$i-1]; //pobarvaj ozadje vrstice
}
}else{
if($enota == 5){ //ce je maxdiff
- //$tex .= $simbolTex.' & ';
- $tex .= $this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' & ';
+ $tex .= $this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' & ';
$userAnswerIndex[$spremenljivke['id']]++;
}else{
$tex .= $navpicniOdgovori[$i-1];
}
}
- //tmp spremenljivka, ki je potrebna za pravilen izris stevilk, ce imamo trak
- //$trakStartingNumberTmp = intval($trakStartingNumber);
- $trakStartingNumberTmp = intval($trakStartingNumberTmp); //spremenil, zaradi intelephense napake
+
//ureditev spremenljivk za pravilen kasnejsi izris seznama ali rolete
$roletaAliSeznam = 0; //belezi, ali je tak tip podtabele ali tabele prisoten
@@ -1750,292 +1118,187 @@ class LatexSurveyElement{
$noItem = 1;
}
}
-
-
//$numColSql = count($vodoravniOdgovoriEnota) + 1;
-
-
- //echo "stevilo stolpcev za izpis kombinirane izračunan: ".$numColSql."</br>";
- //echo "stevilo stolpcev za izpis kombinirane izračunan: ".count($vodoravniOdgovoriEnota)."</br>";
- //print_r($vodoravniOdgovoriEnota);
- //$numColSql = 4;
- /* echo "Enote: ";
- print_r($vodoravniOdgovoriEnota);
- echo "</br>";
- echo "Vodoravni odgvoroi spr id: ";
- print_r($vodoravniOdgovoriSprId);
- echo "</br>";
- echo "Podatki: ";
- print_r($data);
- echo "</br>";
- echo "Tip: ";
- print_r($vodoravniOdgovoriTip);
- echo "</br>"; */
}
//ureditev spremenljivk za pravilen kasnejsi izris seznama ali rolete - konec
- //echo "___________________________________________________</br>";
-
- $izpisRoletePresiroka = 0;
-
- if($fillablePdf == 0){ //naveden pdf (brez vnosnih polj) in rtf
- //echo "INDEKS vrstic: ".$i."</br>";
- //IZRIS PO STOLPCIH
- //echo "___________________________________________________</br>";
- //echo "stevilo stolpcev izpis: ".$numColSql."</br>";
- for($j = 1; $j < $numColSql; $j++){ //izris posameznega stolpca v vrstici
-
- //for($j = 1; $j <= $numColSql; $j++){ //izris posameznega stolpca v vrstici #################### PAZI!!! DODAL ROČNO ZA TESTIRANJE
- if($spremenljivke['tip']==24){ //ce je kombinirana tabela, uredi enote znotraj te tabele
-
- if($presirokaKombo == 1 && count($data) != 0 && ($enota == 2 || $enota == 6)){
- $enota = $vodoravniOdgovoriEnota[0];
- }else{
- $enota = $vodoravniOdgovoriEnota[$j-1];
- }
-
- //$enota = $vodoravniOdgovoriEnota[$j-1];
- $sprID = $vodoravniOdgovoriSprId[$j-1];
-
-
- //echo "Odgovori: ".$vodoravniOdgovori[$j-1]."</br>";
- //echo "INDEKS: ".$j."</br>";
- //echo "id spremenljivke: ".$sprID."</br>";
- //echo "enota tukaj: ".$enota."</br>";
- //if($j == 1){
- /* echo "___________________________________________________</br>";
- echo "Enote: ";
- print_r($vodoravniOdgovoriEnota);
- echo "</br>";
- echo "Vodoravni odgovori spr id: ";
- print_r($vodoravniOdgovoriSprId);
- echo "</br>";
- echo "Odgovori: ";
- print_r($vodoravniOdgovori);
- echo "</br>";
- echo "Tip: ";
- print_r($vodoravniOdgovoriTip);
- echo "</br>"; */
-
- /* echo "indeks for zanke: ".($j-1)."</br>";
- echo "enota for zanke: ".($enota)."</br>";
- echo "spr for zanke: ".($sprID )."</br>";
- echo "___________________________________________________</br>"; */
- //}
+ for($j = 1; $j < $numColSql; $j++){ //izris posameznega stolpca v vrstici
+ if($spremenljivke['tip']==24){ //ce je kombinirana tabela, uredi enote znotraj te tabele
+ if($presirokaKombo == 1 && count($data) != 0 && ($enota == 2 || $enota == 6)){
+ $enota = $vodoravniOdgovoriEnota[0];
+ }else{
+ $enota = $vodoravniOdgovoriEnota[$j-1];
}
-
- if($enota==0||$enota==1||$enota==3||$enota==11||$enota==12||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali diferencial ali VAS ali slikovni tip ali multitext ali multinumber
- if(($trak == 1 && $enota != 3 && $spremenljivke['tip'] == 6)||($spremenljivke['tip']==19||$spremenljivke['tip']==20)){ //ce je trak ali multitext
- if($j<=$spremenljivke['grids']){ //ce so stolpci, ki vsebujejo trak s stevilkami ali textbox-e
- if($spremenljivke['tip']==19||$spremenljivke['tip']==20){ //ce je multitext ali multinumber
- if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je odgovor respondenta ali vec respondentov
- $tex .= "& ".$simbolTex[$indeksOdgovorovRespondentMultiNumText];
- }elseif($export_subtype=='q_empty'||$export_subtype=='q_comment'){
- $tex .= "& ".$simbolTex;
- }
- }else{
- $tex .= '& '.($trakStartingNumberTmp); //prikazovanje brez obrob celic
-
- //$tabela .= '& \multicolumn{1}{|c|}{'.($trakStartingNumberTmp).'} '; //1. moznost z navpicnimi obrobami
-
- //2. moznost z navpicnimi obrobami
- /*if($j==1){ //ce je prvi stolpec, ko je trak
- $tabela .= '& \multicolumn{1}{|c}{'.($trakStartingNumberTmp).'} ';
- }else{
- $tabela .= '& \multicolumn{1}{c|}{'.($trakStartingNumberTmp).'} ';
- } */
- $trakStartingNumberTmp++;
- }
- }else{ //drugace so missing-i, kjer je potrebno izrisati ustrezen simbol (radio button)
- if($enota==0&&($spremenljivke['tip']==6||$spremenljivke['tip']==16)){ //ce je klasicna tabela ali multitext ali multinumber
+ $sprID = $vodoravniOdgovoriSprId[$j-1];
+ }
+
+ if($enota==0||$enota==1||$enota==3||$enota==11||$enota==12||$spremenljivke['tip']==19||$spremenljivke['tip']==20){ //klasika ali diferencial ali VAS ali slikovni tip ali multitext ali multinumber
+ if(($trak == 1 && $enota != 3 && $spremenljivke['tip'] == 6)||($spremenljivke['tip']==19||$spremenljivke['tip']==20)){ //ce je trak ali multitext ali multinumber
+ if($j<=$spremenljivke['grids']){ //ce so stolpci, ki vsebujejo trak s stevilkami ali textbox-e
+ if($spremenljivke['tip']==19||$spremenljivke['tip']==20){ //ce je multitext ali multinumber
+ if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je odgovor respondenta ali vec respondentov
+ $tex .= "& ".$simbolTex[$indeksOdgovorovRespondentMultiNumText];
+ }elseif($export_subtype=='q_empty'||$export_subtype=='q_comment'){
$tex .= "& ".$simbolTex;
- }elseif($spremenljivke['tip']==19||$spremenljivke['tip']==20){//ce je multitext ali multinumber, izrisi missing simbol kot radio
- if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je odgovor respondenta ali vec respondentov
- $tex .= "& ".$simbolTex[$indeksOdgovorovRespondentMultiNumText];
- }else{
- $radioButtonTex = ($export_format=='pdf'?"{\Large $\ocircle$}" : "\\includegraphics[scale=".RADIO_BTN_SIZE."]{".$this->path2Images."radio}");
- $tex .= "& ".$radioButtonTex;
- }
- //$tex .= "& ".$radioButtonTex;
-
- //echo "radio button, ko je missing: ".$radioButtonTex."</br>";
- }
+ }
+ }else{
+ $tex .= '& '.($trakStartingNumberTmp); //prikazovanje brez obrob celic
+ $trakStartingNumberTmp++;
}
- }else{
- if($spremenljivke['tip']==24){ //ce je kombinirana tabela, s klasicno podtabelo
-
- //$tex .= "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- //$test = "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- //echo "vodoravni odgovori tip ".$vodoravniOdgovoriTip[$j-1]." $i</br>";
- //echo "tip exp: ".$export_data_type."</br>";
- //echo "testna koda $test z enoto $enota</br>";
-
- if($export_data_type==0 || $export_data_type==1 || ($export_data_type==2 && $vodoravniOdgovoriTip[$j-1] != 6)){ //ce je razsirjen izvoz ALI je skrcen izvoz IN ni klasicna tabela
- $tex .= "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- //$test = "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- //echo "testna koda $test z enoto $enota</br>";
- //echo "tip exp: ".$export_data_type."</br>";
- //echo $vodoravniOdgovoriTip[$j-1]."</br>";
-
+ }else{ //drugace so missing-i, kjer je potrebno izrisati ustrezen simbol (radio button)
+ if($enota==0&&($spremenljivke['tip']==6||$spremenljivke['tip']==16)){ //ce je klasicna tabela ali multitext ali multinumber
+ $tex .= "& ".$simbolTex;
+ }elseif($spremenljivke['tip']==19||$spremenljivke['tip']==20){//ce je multitext ali multinumber, izrisi missing simbol kot radio
+ if($export_subtype=='q_data'||$export_subtype=='q_data_all'){ //ce je odgovor respondenta ali vec respondentov
+ $tex .= "& ".$simbolTex[$indeksOdgovorovRespondentMultiNumText];
}else{
- $tex .= ' & \\textcolor{crta}{\footnotesize{'.$data[$userAnswerIndex[$spremenljivke['id']]].'}}';
- //echo "vodoravni odgovori tip ".$vodoravniOdgovoriTip[$j-1]." $i</br>";
+ $radioButtonTex = ($export_format=='pdf'?"{\Large $\ocircle$}" : "\\includegraphics[scale=".RADIO_BTN_SIZE."]{".$this->path2Images."radio}");
+ $tex .= "& ".$radioButtonTex;
}
- /* elseif($export_data_type==2 && $vodoravniOdgovoriTip[$j-1]){ //ce je skrcen izvoz IN
-
- } */
+ //$tex .= "& ".$radioButtonTex;
- }else{ //ce so ostali tipi vprasanj
- if($enota == 12){ //ce je slikovni tip
- $podatekSlikovniTip = $podatekZaSlikovniTip;
- if($j <= $podatekSlikovniTip){
- $podatekSlikovniTipTmp = $podatekSlikovniTip;
- }else{
- $podatekSlikovniTipTmp = 0;
- }
- $tex .= "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0,
- $podatekSlikovniTipTmp, $enota, $j, '', $spremenljivke['id']);
- }else{
- $tex .= "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]], $enota, $j, '', $spremenljivke['id']);
- }
- //echo "tukaj ".$spremenljivke['id']." </br>";
- //echo "userAnswerData: ".$data[$userAnswerIndex[$spremenljivke['id']]]."</br>";
- }
- }
- }elseif($enota==2||$enota==6){ //roleta ali izberite s seznama
- if($export_format == 'pdf'){ //ce je pdf
- $beginItemize = '& \begin{itemize}[leftmargin=*]'; //zacetek itemize, ce je pdf
- }else{
- $beginItemize = '& \begin{itemize}'; //zacetek itemize, ce je rtf
+ //echo "radio button, ko je missing: ".$radioButtonTex."</br>";
+ }
}
- if($spremenljivke['tip']!=24){ //ce ni kombinirana tabela
- if($j==1){ //ce je prvi mozen odgovor v roleti ali seznamu
- $tex .= $beginItemize; //zacetek itemize
+ }else{
+ if($spremenljivke['tip']==24){ //ce je kombinirana tabela, s klasicno podtabelo
+ if( is_array($data) ){
+ $data_4_izpis = $data[$userAnswerIndex[$spremenljivke['id']]];
+ }else{
+ $data_4_izpis = null;
}
- //$tex .= '\item[] '.$vodoravniOdgovori[$j-1]; //izris odgovora v roleti ali seznamu kot item
- }/* elseif($spremenljivke['tip']==24){ //ce je kombinirana tabela
- if($presirokaKombo == 0){ //ce ni presiroka kombinirana tabela, zacni z itemize
- if($roletaAliSeznam){ //ce je zacetek seznama ali rolete
- //$tex .= $beginItemize; //zacetek itemize
- //$tex .= ' & ';
- $roletaAliSeznam = 0;
+ if($export_data_type==0 || $export_data_type==1 || ($export_data_type==2 && $vodoravniOdgovoriTip[$j-1] != 6)){ //ce je razsirjen izvoz ALI je skrcen izvoz IN ni klasicna tabela
+
+ $tex .= "& ".$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data_4_izpis);
+
+ }else{
+ $test = $data_4_izpis;
+ if($usr_id){
+ $test = Common::getInstance()->dataPiping($test, $usr_id, $loop_id);
}
- }
- } */
-
- if($export_subtype=='q_empty'){ //ce je prazen vprasalnik
- //echo count($vodoravniOdgovori);
- if($spremenljivke['tip']==24){ //ce je kombinirana tabela z izberite s seznama (ali roleto)
- //echo "id spremenljivk $sprID ".$vodoravniOdgovoriSprId[$j]." za indeks $j </br>";
- //$tex .= ' & '.$vodoravniOdgovori[$j-1]; //izpis odgovora
- //$tex .= ' & radio'; //izpis kot radio odgovora
- $tex .= "& ".$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
+ $test = LatexDocument::encodeText($test);
+ $tex .= ' & \\textcolor{crta}{\footnotesize{'.$test.'}}';
}
- else{ //ce je roleta ali seznam
- if($i==1){ //samo za prvo vrstico izpisi vse mozne odgovore v roleti
- $tex .= '\item[] '.$vodoravniOdgovori[$j-1]; //izris odgovora v roleti kot item
- }elseif($j==1){
- $tex .= '\item[] '; //prazno vrstico
+ /* elseif($export_data_type==2 && $vodoravniOdgovoriTip[$j-1]){ //ce je skrcen izvoz IN
+
+ } */
+
+ }else{ //ce so ostali tipi vprasanj
+ if($enota == 12){ //ce je slikovni tip
+ $podatekSlikovniTip = $podatekZaSlikovniTip;
+ if($j <= $podatekSlikovniTip){
+ $podatekSlikovniTipTmp = $podatekSlikovniTip;
+ }else{
+ $podatekSlikovniTipTmp = 0;
+ }
+ $tex .= "& ".$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0,
+ $podatekSlikovniTipTmp, $enota, $j, '', $spremenljivke['id']);
+ }elseif($enota == 11){ //ce je VAS
+ if(array_key_exists($userAnswerIndex[$spremenljivke['id']], $data)){
+ $dataUserAnswerIndex = $data[$userAnswerIndex[$spremenljivke['id']]];
+ }
+ $tex .= "& ".$simbolTex[$j-1];
+ //if($i == 1){ //ce je prva iteracija uredi VAS simbole
+ // $tex .= "& ".$simbolTex[$j-1];
+ //}else{ //drugace naj bo prazno
+ // $tex .= "& ";
+ //}
+ }else{ //drugace
+ if(array_key_exists($userAnswerIndex[$spremenljivke['id']], $data)){
+ $dataUserAnswerIndex = $data[$userAnswerIndex[$spremenljivke['id']]];
}
+ $tex .= "& ".$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $dataUserAnswerIndex, $enota, $j, '', $spremenljivke['id']);
}
- }else{ //drugace, ce je vprasalnik z odgovori
- if($spremenljivke['tip'] != 24){ //ce ni kombinirana tabela z izberite s seznama (ali roleto)
- if($data[$userAnswerIndex[$spremenljivke['id']]]==($indeksRoleta)){ //ce je prisoten podatek za doloceni indeks seznama, ga izpisi
- //$tex .= '& \\textcolor{crta}{'.$vodoravniOdgovori[$j-1].'}'; //izris odgovora respondenta v roleti ali seznamu
- //$tex .= '& \\textcolor{crta}{\footnotesize{'.$vodoravniOdgovori[$j-1].'}}'; //izris odgovora respondenta v roleti ali seznamu
- if($export_data_type==0||$export_data_type==2){ //ce skrcen izvoz
- $tex .= '& \\textcolor{crta}{\footnotesize{'.$vodoravniOdgovori[$j-1].'}}'; //izris odgovora respondenta v roleti ali
- }else{ //drugace, ce je razsirjen izvoz
- $tex .= '\item[] \\textcolor{crta}{\footnotesize{'.$vodoravniOdgovori[$j-1].'}}'; //izris odgovora respondenta v roleti ali
- }
- $noItem = 0;
-
- }else{
+ }
+ }
+ }elseif($enota==2||$enota==6){ //roleta ali izberite s seznama
+ if($export_format == 'pdf'){ //ce je pdf
+ $beginItemize = '& \begin{itemize}[leftmargin=*]'; //zacetek itemize, ce je pdf
+ }else{
+ $beginItemize = '& \begin{itemize}'; //zacetek itemize, ce je rtf
+ }
+ if($spremenljivke['tip']!=24){ //ce ni kombinirana tabela
+ if($j==1){ //ce je prvi mozen odgovor v roleti ali seznamu
+ $tex .= $beginItemize; //zacetek itemize
+ }
+ }
+
+ if($export_subtype=='q_empty'){ //ce je prazen vprasalnik
+ if($spremenljivke['tip']==24){ //ce je kombinirana tabela z izberite s seznama (ali roleto)
+ $tex .= "& ".$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
+ }
+ else{ //ce je roleta ali seznam
+ if($i==1){ //samo za prvo vrstico izpisi vse mozne odgovore v roleti
+ $tex .= '\item[] '.$vodoravniOdgovori[$j-1]; //izris odgovora v roleti kot item
+ }elseif($j==1){
+ $tex .= '\item[] '; //prazno vrstico
+ }
+ }
+ }else{ //drugace, ce je vprasalnik z odgovori
+ if($spremenljivke['tip'] != 24){ //ce ni kombinirana tabela z izberite s seznama (ali roleto)
+ if($data[$userAnswerIndex[$spremenljivke['id']]]==($indeksRoleta)){ //ce je prisoten podatek za doloceni indeks seznama, ga izpisi
+ if($export_data_type==0||$export_data_type==2){ //ce skrcen izvoz
+ $tex .= '& \\textcolor{crta}{\footnotesize{'.$vodoravniOdgovori[$j-1].'}}'; //izris odgovora respondenta v roleti ali
+ }else{ //drugace, ce je razsirjen izvoz
+ $tex .= '\item[] \\textcolor{crta}{\footnotesize{'.$vodoravniOdgovori[$j-1].'}}'; //izris odgovora respondenta v roleti ali
+ }
+ $noItem = 0;
+
+ }else{
+ if($export_data_type==0||$export_data_type==2){ //ce skrcen izvoz
+ $tex .= ' & '.$vodoravniOdgovori[$j-1];
+ }else{ //drugace, ce je razsirjen izvoz
//echo "tip exp: ".$export_data_type."</br>";
- if($export_data_type==0||$export_data_type==2){ //ce skrcen izvoz
- $tex .= ' & '.$vodoravniOdgovori[$j-1];
- }else{ //drugace, ce je razsirjen izvoz
-
- }
-
}
- }else{ //ce je kombinirana tabela z izberite s seznama (ali roleto)
- $tex .= ' & \\textcolor{crta}{\footnotesize{'.$data[$userAnswerIndex[$spremenljivke['id']]].'}}';
- /* echo "odgovor : ".$data[$userAnswerIndex[$spremenljivke['id']]]."</br>";
- print_r($data); */
}
-
- }
-
- $indeksRoleta++;
- /* echo "indeks za testirati tale del: ".$j."</br>";
- echo "spremenljivka sprID: ".$sprID."</br>";
- echo "spremenljivka odoravniOdgovoriSprId: ".$vodoravniOdgovoriSprId[$j]."</br>"; */
-
-
+ }else{ //ce je kombinirana tabela z izberite s seznama (ali roleto)
+ $tex .= ' & \\textcolor{crta}{\footnotesize{'.$data[$userAnswerIndex[$spremenljivke['id']]].'}}';
- if($spremenljivke['tip']==24&&$sprID!=$vodoravniOdgovoriSprId[$j]){//ce je naslednji ID spremenljivke razlicen od trenutnega ID
- if($presirokaKombo == 0){
- //$tex .= '\end{itemize}'; //zakljucek itemize
- }
- $roletaAliSeznam = 1;
}
-
- }elseif($enota == 4){ //ena moznost proti drugi
- //$tex .= '& '.$simbolTex.' & '.$lang['srv_tip_sample_t6_4_vmes'].' & '.$simbolTex;
- //$this->getAnswerSymbol($export_format, $fillablePdf, $vodoravniOdgovoriTip[$j-1], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]])
- //echo "userAnswerData: ".$data[$userAnswerIndex[$spremenljivke['id']]]." ".$spremenljivke['id']."</br>";
- //echo "V latexSurveyElement </br>";
- //echo "userAnswerData: ".$data[$userAnswerIndex[$spremenljivke['id']]]." </br>";
- //echo "indeks: ".$userAnswerIndex[$spremenljivke['id']]." </br>";
- if($data[$userAnswerIndex[$spremenljivke['id']]]==1){
- $simbolTex1=$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- $simbolTex2=$simbolTex;
- //echo "levo </br>";
- }elseif($data[$userAnswerIndex[$spremenljivke['id']]]==2){
- $simbolTex1=$simbolTex;
- $simbolTex2=$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, 1);
- //echo "desno</br>";
- }elseif($data[$userAnswerIndex[$spremenljivke['id']]]==''){
- $simbolTex1=$simbolTex;
- $simbolTex2=$simbolTex;
- $simbolTex3='';
- }
- $tex .= '& '.$simbolTex1.' & '.$lang['srv_tip_sample_t6_4_vmes'].' & '.$simbolTex2;
- //echo "userAnswerData: ".$data[$userAnswerIndex[$spremenljivke['id']]]."</br>";
- }elseif($enota == 5){ //maxdiff
- //$tex .= $navpicniOdgovori[$i-1].' & '.$simbolTex;
- $tex .= $navpicniOdgovori[$i-1].' & '.$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
- }elseif($enota == 8){ //tabela da/ne
- //$tex .= ' & '.$simbolTex;
- $tex .= ' & '.$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
}
- $indeksOdgovorovRespondentMultiNumText++;
-
- $userAnswerIndex[$spremenljivke['id']]++;
- //echo "simbolTex: ".$simbolTex."</br>";
- } //IZRIS PO STOLPCIH - KONEC
- }else if($fillablePdf == 1){
- $isCheckBox = null;
- for($j = 1; $j < $numColSql; $j++){
- if($isCheckBox){
- $tex .= '& {\CheckBox[name=checkbox_'.$j.'_'.$i.',checkboxsymbol=\ding{56}]{}}';
- }else{
- $tex .= '& {\ChoiceMenu[radio, name=radio_'.$i.',radiosymbol=\ding{108}]{}{='.$j.'}}';
+ $indeksRoleta++;
+
+ if($spremenljivke['tip']==24&&$sprID!=$vodoravniOdgovoriSprId[$j]){//ce je naslednji ID spremenljivke razlicen od trenutnega ID
+ if($presirokaKombo == 0){
+ //$tex .= '\end{itemize}'; //zakljucek itemize
+ }
+ $roletaAliSeznam = 1;
}
+
+
+ }elseif($enota == 4){ //ena moznost proti drugi
+ if($data[$userAnswerIndex[$spremenljivke['id']]]==1){
+ $simbolTex1=$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
+ $simbolTex2=$simbolTex;
+ }elseif($data[$userAnswerIndex[$spremenljivke['id']]]==2){
+ $simbolTex1=$simbolTex;
+ $simbolTex2=$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, 1);
+ }elseif($data[$userAnswerIndex[$spremenljivke['id']]]==''){
+ $simbolTex1=$simbolTex;
+ $simbolTex2=$simbolTex;
+ $simbolTex3='';
+ }
+ $tex .= '& '.$simbolTex1.' & '.$lang['srv_tip_sample_t6_4_vmes'].' & '.$simbolTex2;
+ }elseif($enota == 5){ //maxdiff
+ $tex .= $navpicniOdgovori[$i-1].' & '.$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
+ }elseif($enota == 8){ //tabela da/ne
+ $tex .= ' & '.$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
}
- }
+
+ $indeksOdgovorovRespondentMultiNumText++;
+
+ $userAnswerIndex[$spremenljivke['id']]++;
+ } //IZRIS PO STOLPCIH - KONEC
if($enota==1 || $enota==4){ //ce je "diferencial tabela" ali "ena moznost proti drugi", dodaj se tekst v zadnjem stolpcu tabele
$tex .= ' & '.$navpicniOdgovori2[$i-1].' '; //tekst v drugem stolpcu ob symbol
if(($enota==4 && count($missingOdgovori)!=0)||($enota==1 && $trak==1 && count($missingOdgovori)!=0)){ //ce je "ena moznost proti drugi" in so missingi ALI je "diferencial tabela" na traku in so missingi
for($m=0;$m<count($missingOdgovori);$m++){
- //$tex .= ' & '.$simbolTex;
- $tex .= ' & '.$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
+ $tex .= ' & '.$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]);
$userAnswerIndex[$spremenljivke['id']]++;
if($enota==4){ //ce je "ena moznost proti drugi"
$tex .= ' '.$missingOdgovori[$m]; //izpisi se missing odgovor
@@ -2048,22 +1311,16 @@ class LatexSurveyElement{
if($enota==5&&count($missingOdgovori)!=0){ //ce je maxdiff in so missingi
for($m=0;$m<count($missingOdgovori);$m++){
//$tex .= ' & '.$simbolTex.' '.$missingOdgovori[$m];
- $tex .= ' & '.$this->getAnswerSymbol($export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' '.$missingOdgovori[$m];
+ $tex .= ' & '.$this->getAnswerSymbol($this->export_subtype, $export_format, $fillablePdf, $spremenljivke['tip'], $numColSql, 0, $data[$userAnswerIndex[$spremenljivke['id']]]).' '.$missingOdgovori[$m];
$userAnswerIndex[$spremenljivke['id']]++;
}
}
- if(($enota == 2 || $enota == 6)&&$spremenljivke['tip']!=24){ //ce je roleta ali seznam in ni kombinirana tabela
+ if(($enota == 2 || $enota == 6)&&$spremenljivke['tip']!=24&&$spremenljivke['tip']!=20&&$spremenljivke['tip']!=19){ //ce je roleta ali seznam in ni kombinirana tabela in ni mutinumber in ni multitekst
$tex .= '\end{itemize}'; //zakljucek itemize
-
- /* if($export_format == 'rtf'){ //ce je rtf
- $tex .= ' \hline '; //dodaj crto na koncu vrstice
- } */
-
}
$tex .= $texNewLine;
- //echo "tex: ".$tex."</br>";
if($spremenljivke['tip']==24){
//$userAnswerIndex++;
}
@@ -2075,9 +1332,12 @@ class LatexSurveyElement{
$tex .= ' \hline '; //dodaj crto na koncu vrstice
}
}
+ //echo "koda vrstice: $tex </br>";
}
//IZRIS PO VRSTICAH - KONEC
- //echo "tex: ".$tex."</br>";
+ //$time_end = microtime(true);
+ // $execution_time = ($time_end - $time_start);
+ // echo '</br><b>Total Execution Time izpisa vrstice</b> '.$execution_time.' sec za vprašanje '.strip_tags($spremenljivke['naslov']).'</br>';
return $tex;
}
#funkcija, ki skrbi za izris vrstic tabele (z multigrid) - konec ###########################################################
@@ -2088,31 +1348,25 @@ class LatexSurveyElement{
function GetUsersData($db_table=null, $spremenljivkeId=null, $spremenljivkeTip=null, $usr_id=null, $loop_id_raw=null){
$userDataPresent = 0; //belezi, ali je odgovor respondenta prisoten in je indeks za določena polja, ki shranjujejo podatke o odgovorih respondenta
$loop_id = $loop_id_raw == null ? " IS NULL" : " = '".$loop_id_raw."'";
- //echo "loop_id v GetUsersData: ".$loop_id."</br>";
// če imamo vnose, pogledamo kaj je odgovoril uporabnik
- //if( in_array($spremenljivkeTip, array(21, 7, 8, 18)) ){ //ce je tip besedilo ali stevilo ali datum ali vsota
if( in_array($spremenljivkeTip, array(21, 4, 7, 8, 18)) ){ //ce je tip besedilo ali besedilo staro (4) ali stevilo ali datum ali vsota
$sqlUserAnswerString ="SELECT text FROM srv_data_text".$db_table." WHERE spr_id='".$spremenljivkeId."' AND usr_id='".$usr_id."' AND loop_id $loop_id ";
}elseif($spremenljivkeTip==17){ //ce je razvrscanje
//$sqlUserAnswer = sisplet_query("SELECT vrstni_red FROM srv_data_rating WHERE spr_id=".$spremenljivke['id']." AND usr_id='".$this->getUserId()."' AND vre_id='".$rowVrednost['id']."' AND loop_id $loop_id");
//$sqlUserAnswerString = "SELECT vrstni_red FROM srv_data_rating WHERE spr_id='".$spremenljivkeId."' AND usr_id='".$usr_id."' ";
$sqlUserAnswerString = "SELECT vrstni_red FROM srv_data_rating WHERE spr_id='".$spremenljivkeId."' AND usr_id='$usr_id' AND loop_id $loop_id ";
- //echo $sqlUserAnswerString."</br>";
}elseif($spremenljivkeTip==26){ //ce je lokacija
//$sqlUserAnswerString ="SELECT lat, lng, address, text FROM srv_data_map WHERE spr_id='".$spremenljivkeId."' AND usr_id='".$usr_id."' ";
$sqlUserAnswerString ="SELECT IF(dm.lat > 0, dm.lat, vm.lat) as lat, IF(dm.lng > 0, dm.lng, vm.lng) as lng, IF(dm.address != \"\", dm.address, vm.address) as address, text FROM srv_data_map as dm "
. "LEFT JOIN (SELECT lat, lng, address, vre_id FROM srv_vrednost_map) AS vm on vm.vre_id=dm.vre_id "
. "WHERE spr_id='".$spremenljivkeId."' AND usr_id='$usr_id' AND loop_id $loop_id ";
- //echo $sqlUserAnswerString."</br>";
}elseif($spremenljivkeTip==27){ //ce je heatmap
//$sqlUserAnswerString ="SELECT lat, lng, address, text FROM srv_data_heatmap WHERE spr_id='".$spremenljivkeId."' AND usr_id='".$usr_id."' ";
$sqlUserAnswerString ="SELECT lat, lng, address, text FROM srv_data_heatmap WHERE spr_id='".$spremenljivkeId."' AND usr_id='$usr_id' AND loop_id $loop_id ";
- //echo $sqlUserAnswerString."</br>";
}else{
//$sqlUserAnswerString = "SELECT vre_id FROM srv_data_vrednost".$db_table." WHERE spr_id='$spremenljivkeId' AND usr_id=$usr_id";
$sqlUserAnswerString = "SELECT vre_id FROM srv_data_vrednost".$db_table." WHERE spr_id='$spremenljivkeId' AND usr_id='$usr_id' AND loop_id $loop_id";
- //echo $sqlUserAnswerString."</br>";
}
$sqlUserAnswer = sisplet_query($sqlUserAnswerString);
@@ -2120,7 +1374,6 @@ class LatexSurveyElement{
if( in_array($spremenljivkeTip, array(21, 4, 7, 8, 18, 17)) ){//ce je tip besedilo ali stevilo ali datum ali vsota ali razvrscanje
$rowAnswers = mysqli_fetch_assoc($sqlUserAnswer);
if($rowAnswers){ //ce je kaj v bazi
- //echo "Nekaj je v bazi za spremenljivko".$spremenljivkeId." in usr ".$usr_id."</br>";
$userDataPresent++;
}
}else{
@@ -2129,11 +1382,9 @@ class LatexSurveyElement{
if($spremenljivkeTip==26||$spremenljivkeTip==27){
//$this->userAnswer = $rowAnswers;
$this->userAnswer[$userDataPresent] = $rowAnswers;
- //echo "rowAnswers: ".$this->userAnswer['address'].' za odgovore tip '.$spremenljivkeTip.' id '.$spremenljivkeId.' usr '.$usr_id.'</br>';
$userDataPresent++;
}else{
$this->userAnswer[$rowAnswers['vre_id']] = $rowAnswers['vre_id'];
- //echo "rowAnswers: ".$rowAnswers['vre_id'].' za odgovore tip '.$spremenljivkeTip.' id '.$spremenljivkeId.' usr '.$usr_id.'</br>';
if($rowAnswers['vre_id']>0){
$userDataPresent++;
}
@@ -2141,7 +1392,6 @@ class LatexSurveyElement{
}
}
}
- //echo "userDataPresent za tip ".$spremenljivkeTip." id ".$spremenljivkeId." usr ".$usr_id." je:".$userDataPresent." in loop: $loop_id</br>";
return $userDataPresent;
}
#funkcija, ki skrbi za preverjanje obstoja podatkov za vprasanja, ki niso grid ali kombinirana tabela - konec
@@ -2149,87 +1399,33 @@ class LatexSurveyElement{
#funkcija, ki skrbi za preverjanje obstoja podatkov za vprasanja z grid
function GetUsersDataGrid($spremenljivke=null, $db_table=null, $rowVrednost=null, $rowVsehVrednosti=null, $usr_id=null, $subtip=null, $loop_id_raw=null, $export_data_type=null){
$loop_id = $loop_id_raw == null ? " IS NULL" : " = '".$loop_id_raw."'";
-
// poiščemo kaj je odgovoril uporabnik: PREVERITI, CE JE POTREBEN STAVEK Z LOOP IN KDAJ JE TO AKTUALNO
if(($spremenljivke['tip']==16)||($spremenljivke['tip']==6&&$spremenljivke['enota']==3)){ //ce je grid checkbox ali dvojna tabela
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = '".$rowVsehVrednosti['id']."' AND loop_id $loop_id");
- //$sqlString = "SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
-
- //$sqlString = "SELECT grd_id, vre_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
$sqlString = "SELECT grd_id, vre_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']." AND loop_id $loop_id";
-
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']);
- $sqlUserAnswer = sisplet_query($sqlString);
- //}elseif($spremenljivke['tip']==6){ //ce je grid radio
}elseif($spremenljivke['tip']==6){ //ce je grid radio
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_grid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND loop_id $loop_id");
-
- //$sqlString ="SELECT grd_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
-
- //$sqlString ="SELECT grd_id, vre_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
$sqlString ="SELECT grd_id, vre_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']." AND loop_id $loop_id";
- //echo $sqlString."</br>";
- $sqlUserAnswer = sisplet_query($sqlString);
-
- //echo $sqlString."</br>";
}elseif($spremenljivke['tip']==19||$spremenljivke['tip']==20){ //ce je grid besedila ali stevil
$sqlString = "SELECT grd_id, text, vre_id FROM srv_data_textgrid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
- //$sqlUserAnswer = sisplet_query("SELECT grd_id, text FROM srv_data_textgrid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']);
- //echo "sqlString: ".$sqlString."</br>";
- $sqlUserAnswer = sisplet_query($sqlString);
- }elseif($spremenljivke['tip']==24){ //ce je kombo
- //echo "Subtip kombo vprasanja: ".$subtip."</br>";
- //echo "enota kombo vprasanja: ".$rowVrednost['enota']."</br>";
-
+ }elseif($spremenljivke['tip']==24){ //ce je kombo
if($subtip==6){ //ce je grid radio
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_grid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND loop_id $loop_id");
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_grid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = ".$rowVrednost['id']);
- //$sqlString ="SELECT grd_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = ".$rowVrednost['id'];
- //$sqlString ="SELECT grd_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
- //if($rowVrednost['enota'] != 2 && $rowVrednost['enota'] != 6){ //ce ni roleta ali seznam
if($rowVrednost['enota'] != 2 && $rowVrednost['enota'] != 6 && ($export_data_type == 1)){ //ce ni roleta in seznam IN je razsirjen izvoz
$sqlString ="SELECT grd_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']." AND loop_id $loop_id";
}else{ //ce je roleta ali seznam
- //$sqlString ="SELECT grd_id FROM srv_data_grid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND loop_id $loop_id";
$sqlString ="SELECT g.naslov, gdata.grd_id FROM srv_grid g, srv_data_grid".$db_table." gdata WHERE g.id=gdata.grd_id AND g.spr_id = '".$rowVrednost['spr_id']."' AND gdata.usr_id = '".$usr_id."' AND gdata.vre_id = '".$rowVrednost['id']."' AND gdata.loop_id $loop_id";
}
-
- //echo $sqlString."</br>";
- $sqlUserAnswer = sisplet_query($sqlString);
-
- //echo $sqlString."</br>";
}elseif($subtip==16){ //ce je grid checkbox ali dvojna tabela
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = '".$rowVsehVrednosti['id']."' AND loop_id $loop_id");
-
- //$sqlString = "SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
$sqlString = "SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']." AND loop_id $loop_id";
- //$sqlUserAnswer = sisplet_query("SELECT grd_id FROM srv_data_checkgrid".$db_table." WHERE spr_id = '".$rowVrednost['spr_id']."' AND usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id']);
- $sqlUserAnswer = sisplet_query($sqlString);
}elseif($subtip==19||$subtip==20){ //ce je grid besedila ali stevil
$sqlString = "SELECT grd_id, text FROM srv_data_textgrid".$db_table." where spr_id = '".$rowVrednost['spr_id']."' and usr_id = '".$usr_id."' AND vre_id = '".$rowVrednost['id']."' AND grd_id = ".$rowVsehVrednosti['id'];
-
- $sqlUserAnswer = sisplet_query($sqlString);
-
- //$this->userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- //echo "userAnswer v funkciji: ".$this->userAnswer['text'].'</br>';
}
}
-
- //echo $sqlString."</br>";
- //$this->userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- //$userAnswer = mysqli_fetch_assoc($sqlUserAnswer);
- //echo "userAnswer v funkciji: ".$this->userAnswer['grd_id'].'</br>';
- //echo "userAnswer v funkciji: ".$userAnswer['text'].'</br>';
- //echo "userAnswer v funkciji: ".$userAnswer['grd_id'].'</br>';
-
+ $sqlUserAnswer = sisplet_query($sqlString);
return $sqlUserAnswer;
-
}
#funkcija, ki skrbi za preverjanje obstoja podatkov za vprasanja z grid - konec
#funkcija, ki skrbi za preverjanje obstoja podatkov za vprasanja s kombinirano tabelo
function GetUsersDataKombinirana($spremenljivke=null, $db_table=null, $usr_id=null, $presirokaTabela=0, $loop_id_raw=null, $export_data_type=null){
- //function GetUsersDataKombinirana($spremenljivke=null, $db_table=null, $usr_id=null, $questionText=null, $loop_id_raw=null, $export_data_type=null){
$userDataPresent = 0; //belezi, ali je odgovor respondenta prisoten in je indeks za določena polja, ki shranjujejo podatke o odgovorih respondenta
$userAnswerSprIds = array();
$userAnswerSprTip = array();
@@ -2237,27 +1433,21 @@ class LatexSurveyElement{
$orStavek = '';
//$loop_id = $loop_id_raw == null ? " IS NULL" : " = '".$loop_id_raw."'";
$loop_id = $loop_id_raw;
+ $userAnswers = array();
#za pridobitev stevila vrstic
- //echo "SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red </br>";
$sqlVrednostiKombo = sisplet_query("SELECT id, naslov, naslov2, variable, other FROM srv_vrednost WHERE spr_id='".$spremenljivke['id']."' ORDER BY vrstni_red");
$numRowsSql = mysqli_num_rows($sqlVrednostiKombo);
- //echo $numRowsSql."</br>";
- //echo $spremenljivke['id']."</br>";
-
#za pridobitev stevila vrstic - konec
#za pridobitev stevila stolpcev
$sqlStVrednostiKombo = sisplet_query("SELECT count(*) FROM srv_grid g, srv_grid_multiple m WHERE m.spr_id=g.spr_id AND m.parent='".$spremenljivke['id']."'");
$rowStVrednost = mysqli_fetch_array($sqlStVrednostiKombo); //stevilo stolpcev
$numColSql = $rowStVrednost['count(*)']; //stevilo vseh stolpcev
- //echo "stevilo stolpcev: ".$numColSql."</br>";
#za pridobitev stevila stolpcev - konec
- //echo "presirokaTabela: ".$presirokaTabela."</br>";
if($presirokaTabela==0){ //ce tabela ni presiroka
$sqlSubGrid = sisplet_query("SELECT m.spr_id, s.tip FROM srv_grid_multiple m, srv_spremenljivka s WHERE m.parent='".$spremenljivke['id']."' AND m.spr_id=s.id ORDER BY m.vrstni_red"); //pridobimo spr_id in tip podvprasanj, ki sestavljajo kombinirano tabelo
- //echo "SELECT m.spr_id, s.tip FROM srv_grid_multiple m, srv_spremenljivka s WHERE m.parent='".$spremenljivke['id']."' AND m.spr_id=s.id ORDER BY m.vrstni_red"."</br>";
while($rowSubGrid = mysqli_fetch_array($sqlSubGrid)){
array_push($userAnswerSprIds, $rowSubGrid['spr_id'] ); //filanje polja s spr_id podvprasanj
@@ -2265,34 +1455,20 @@ class LatexSurveyElement{
if($userAnswerSprIdsIndex){
$orStavek .= ' OR ';
}
- //$orStavek .= "spr_id='".$rowSubGrid['spr_id']."' ";
$orStavek .= "v.spr_id='".$rowSubGrid['spr_id']."' ";
$userAnswerSprIdsIndex++;
}
}else{
$orStavek = "v.spr_id='".$spremenljivke['id']."' ";
}
- //echo $orStavek."</br>";
-
- //echo count($userAnswerSprTip)."</br>";
for($i=1;$i<=$numRowsSql;$i++){
- //$sqlVrednostiString = "SELECT id, naslov, spr_id FROM srv_vrednost WHERE (".$orStavek.") AND vrstni_red=".($i).";";
- //$sqlVrednostiString = "SELECT v.spr_id, v.naslov, s.tip, v.id FROM srv_vrednost v, srv_spremenljivka s WHERE v.spr_id=s.id AND (".$orStavek.") AND v.vrstni_red=".($i).";";
$sqlVrednostiString = "SELECT v.spr_id, v.naslov, s.tip, v.id, s.enota FROM srv_vrednost v, srv_spremenljivka s WHERE v.spr_id=s.id AND (".$orStavek.") AND v.vrstni_red=".($i).";";
- //echo $sqlVrednostiString."</br>";
$sqlVrednosti = sisplet_query($sqlVrednostiString);
while($rowVrednosti = mysqli_fetch_assoc($sqlVrednosti)){
$sqlVsehVrednostiString = "SELECT id, naslov FROM srv_grid WHERE spr_id='".$rowVrednosti['spr_id']."' ORDER BY 'vrstni_red'";
-
- //echo $sqlVsehVrednostiString."</br>";
- //echo $rowVrednosti['tip']."</br>";
- //echo $rowVrednosti['other']."</br>";
- //echo "Vrednost: ".$rowVrednosti['spr_id']."</br>";
- $sqlVsehVrednosti = sisplet_query($sqlVsehVrednostiString);
- //echo mysqli_num_rows($sqlVsehVrednosti)."</br>";
-
+ $sqlVsehVrednosti = sisplet_query($sqlVsehVrednostiString);
$roletaZabelezena = 0;
@@ -2317,12 +1493,6 @@ class LatexSurveyElement{
}
}
- //echo $this->userAnswer[$userDataPresent]."</br>";
- //echo "odgovori respondenta: ".$userAnswers[$userDataPresent]."</br>";
- //echo "index userDataPresent: ".$userDataPresent."</br>";
- /* if($rowVrednosti['enota']==2){
- $roletaZabelezena = 1;
- }*/
if($roletaZabelezena == 0){
$userDataPresent++;
}
@@ -2331,25 +1501,20 @@ class LatexSurveyElement{
}
}
- //if($questionText){
- //return $userDataPresent;
- //}else{
- //return $this->userAnswer;
- return $userAnswers;
- //}
+ return $userAnswers;
}
#funkcija, ki skrbi za preverjanje obstoja podatkov za vprasanja s kombinirano tabelo - konec
#funkcija, ki skrbi za pridobitev operatorja iz stevilskega podatka ###########################################################
function GetOperator($operatorNum=null){
if ($operatorNum == 0){
- $operator = $this->encodeText('+');
+ $operator = LatexDocument::encodeText('+');
}elseif ($operatorNum == 1){
- $operator = $this->encodeText('-');
+ $operator = LatexDocument::encodeText('-');
}elseif ($operatorNum == 2){
- $operator = $this->encodeText('*');
+ $operator = LatexDocument::encodeText('*');
}elseif ($operatorNum == 3){
- $operator = $this->encodeText('/');
+ $operator = LatexDocument::encodeText('/');
}
return $operator;
}
@@ -2359,12 +1524,7 @@ class LatexSurveyElement{
* @desc V podanem stringu poisce spremenljivke in jih spajpa z vrednostmi
*/
function dataPiping ($text='') {
-/* echo "text: ".$text."</br>";
- echo "Usr_id: ".$this->usr_id."</br>";
- echo "Loop_id: ".$this->loop_id."</br>";
- echo "_____________________</br>"; */
Common::getInstance()->Init($this->anketa);
- //echo Common::getInstance()->dataPiping($text, $this->usr_id, $this->loop_id);
return Common::getInstance()->dataPiping($text, $this->usr_id, $this->loop_id);
}
diff --git a/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisAndOtherLandscape.cls b/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisAndOtherLandscape.cls
index 535b617..fea6e53 100644
--- a/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisAndOtherLandscape.cls
+++ b/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisAndOtherLandscape.cls
@@ -4,25 +4,27 @@
%uporabljene knjiznice
\usepackage[a4paper, landscape, left=20mm, right=20mm, headheight=1cm, top=1cm, bottom=2cm, footskip=3cm, includehead, includefoot, heightrounded]{geometry} % za robove, ipd.
\usepackage{tabularx, booktabs} % za lazje urejanje in izris tabel (ni podprto v latex2rtf)
+\usepackage{xltabular}
\usepackage{color}
\usepackage[dvipsnames]{xcolor} % za uporabo HTML in RGB barv
\usepackage{pgf} % za aritmetiko z length
\usepackage{printlen} %
\usepackage{eurosym} % za izpis simbola €
\usepackage[export]{adjustbox} % za poravnavo slik
-\usepackage[utf8]{inputenc} % za uporabo utf8
-\usepackage{amssymb} %za unicode simbole
+
\usepackage{graphicx} % za prikazovanje slik in ostalih grafik
%\usepackage[allfiguresdraft]{draftfigure}
\usepackage{colortbl} %The pack­age al­lows rows and columns to be coloured, and even in­di­vid­ual cells
\usepackage{fancyhdr} % za ureditev glav in nog
-\usepackage{montserrat} % za uporabo Montserrat pisave v dokumentu
+%\usepackage{montserrat} % za uporabo Montserrat pisave v dokumentu
+\usepackage[default]{sourcesanspro} % za uporabo Source Sans Pro pisave v dokumentu
\usepackage{multirow} % za spajanje vrstic v tabeli
\usepackage{hyperref}
\usepackage{tikz} % za risanje crt, ki oznacujejo stevilo klikov v Status
\usepackage{ltablex}
\usepackage{seqsplit} % za samodejno razbijanje dolgih besed v tabelah
\usepackage{url} %za razbijanje url-jev v tabelah
+\usepackage{fontspec} %ureditev veh UTF-8 charaterjev
\usepackage{textgreek} %za resevanje grskih crk
\urlstyle{same} %nastavitev, da je font URL isti kot je font ostalega besedila (http://ctan.ijs.si/tex-archive/macros/latex/contrib/url/url.pdf)
%definiranje uporabljenih barv
@@ -51,7 +53,7 @@
%definiranje novih ukazov, funkcij, nastavitev potrebnih za izris dolocenih delov besedila
\linespread{1} % za razmik med vrsticami
\fontencoding{T1}\selectfont % za encode besedila
-\renewcommand{\familydefault}{\sfdefault} % za izbiro novega fonta Montserrat
+\renewcommand{\familydefault}{\sfdefault} % za izbiro izbranega fonta, trenutno Source Sans Pro
\color{besedilo} % za izbiro barve besedila
\newenvironment{analysis} % za ureditev prostora za izpis analize
{\parindent0pt \fontsize{10}{12} \selectfont }
@@ -74,8 +76,7 @@
{\par\xdef\tpd{\the\prevdepth}\egroup
\prevdepth=\tpd}
\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}} %
-\pdfcompresslevel=0 %uncompressed PDFs za pohitritev
-\pdfobjcompresslevel=0 %uncompressed PDFs za pohitritev
+
%vse za glavo in nogo
\pagestyle{fancy}
\fancyhf{}
@@ -84,17 +85,10 @@
\renewcommand{\headrulewidth}{6pt} %debelina crte glave
\renewcommand{\footrulewidth}{0.25pt} %debelina crte noga
\setlength{\headsep}{1.5cm} %odmik iz roba strani
-\newcommand{\headerfooter}[5]{ %funkcija za izpis glave in noge
+\newcommand{\headerfooter}[7]{ %funkcija za izpis glave in noge
\lhead{\begin{tabular}{@{} m{135mm} } #1 \end{tabular}}
\rhead{\includegraphics[#4]{#2}}
- \fancyfoot[l]{www.1ka.si}
+ \fancyfoot[l]{#7}
\fancyfoot[r]{\thepage}
}
-%vse za glavo in nogo - konec
-
-\DeclareUnicodeCharacter{200B}{{\hskip 0pt}}
-\DeclareUnicodeCharacter{03C7}{$\chi$}
-\DeclareUnicodeCharacter{2265}{$\geq$}
-\DeclareUnicodeCharacter{03B5}{$\epsilon$
-\DeclareUnicodeCharacter{2003}{$\enspace$}}
-\DeclareUnicodeCharacter{0014}{$\thinspace$} %ni ta pravi nadomestek, ker v Latexu tak simbol ne obstaja \ No newline at end of file
+%vse za glavo in nogo - konec \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisPortrait.cls b/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisPortrait.cls
index e21e21a..659551a 100644
--- a/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisPortrait.cls
+++ b/admin/survey/export/latexclasses/textemp/latexTemplatePdfAnalysisPortrait.cls
@@ -5,6 +5,7 @@
%\usepackage[a4paper, portrait, left=20mm, right=20mm, headheight=1cm, top=1cm, bottom=2cm, footskip=3cm, includehead, includefoot, heightrounded]{geometry} % za robove, ipd.
\usepackage[a4paper, portrait, left=15mm, right=15mm, headheight=1cm, top=1cm, bottom=2cm, footskip=3cm, includehead, includefoot, heightrounded]{geometry} % za robove, ipd.
\usepackage{tabularx, booktabs} % za lazje urejanje in izris tabel (ni podprto v latex2rtf)
+\usepackage{xltabular}
\usepackage{ltablex} % Mod­i­fies the tab­u­larx en­vi­ron­ment to com­bine the fea­tures of the tab­u­larx pack­age (auto-sized columns in a fixed width ta­ble) with those of the longtable pack­age (multi-page ta­bles)
\usepackage{color}
\usepackage[dvipsnames]{xcolor} % za uporabo HTML in RGB barv
@@ -17,12 +18,14 @@
\usepackage{graphicx} % za prikazovanje slik in ostalih grafik
\usepackage{colortbl} %The pack­age al­lows rows and columns to be coloured, and even in­di­vid­ual cells
\usepackage{fancyhdr} % za ureditev glav in nog
-\usepackage{montserrat} % za uporabo Montserrat pisave v dokumentu
+%\usepackage{montserrat} % za uporabo Montserrat pisave v dokumentu
+\usepackage[default]{sourcesanspro} % za uporabo Source Sans Pro pisave v dokumentu
\usepackage{multirow} % za spajanje vrstic v tabeli
\usepackage{hyperref}
\usepackage{tikz} % za risanje
\usepackage{seqsplit} % za samodejno razbijanje dolgih besed v tabelah
\usepackage{url} %za razbijanje url-jev v tabelah
+\usepackage{fontspec} %ureditev veh UTF-8 charaterjev
\usepackage{textgreek} %za resevanje grskih crk
\urlstyle{same} %nastavitev, da je font URL isti kot je font ostalega besedila (http://ctan.ijs.si/tex-archive/macros/latex/contrib/url/url.pdf)
%\usepackage{adjustbox} %za samodejno dimenzioniranje tabel
@@ -52,7 +55,7 @@
%\linespread{1.5} % za razmik med vrsticami
\linespread{1.2} % za razmik med vrsticami
\fontencoding{T1}\selectfont % za encode besedila
-\renewcommand{\familydefault}{\sfdefault} % za izbiro novega fonta Montserrat
+\renewcommand{\familydefault}{\sfdefault} % za izbiro izbranega fonta, trenutno Source Sans Pro
\renewcommand{\arraystretch}{1.5}
\color{besedilo} % za izbiro barve besedila
\newenvironment{analysis} % za ureditev prostora za izpis analize
@@ -70,8 +73,7 @@
{\parindent0pt \fontsize{8}{9} \selectfont }
{ }
\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}} %
-\pdfcompresslevel=0 %uncompressed PDFs za pohitritev
-\pdfobjcompresslevel=0 %uncompressed PDFs za pohitritev
+
%vse za glavo in nogo
\pagestyle{fancy}
\fancyhf{}
@@ -80,19 +82,11 @@
\renewcommand{\headrulewidth}{6pt} %debelina crte glave
\renewcommand{\footrulewidth}{0.25pt} %debelina crte noga
\setlength{\headsep}{1.5cm} %odmik iz roba strani
-\newcommand{\headerfooter}[5]{ %funkcija za izpis glave in noge
+\newcommand{\headerfooter}[7]{ %funkcija za izpis glave in noge
\lhead{\begin{tabular}{@{} m{135mm} } #1 \end{tabular}}
\rhead{\includegraphics[#4]{#2}}
- \fancyfoot[l]{www.1ka.si}
+ \fancyfoot[l]{#7}
\fancyfoot[r]{\thepage}
}
%vse za glavo in nogo - konec
-\DeclareUnicodeCharacter{2212}{-}
-\DeclareUnicodeCharacter{030C}{Č}
-\DeclareUnicodeCharacter{200B}{{\hskip 0pt}}
-\DeclareUnicodeCharacter{03C7}{$\chi$}
-\DeclareUnicodeCharacter{2265}{$\geq$}
-\DeclareUnicodeCharacter{03B5}{$\epsilon$}
-\DeclareUnicodeCharacter{2003}{$\enspace$}
-\DeclareUnicodeCharacter{0014}{$\thinspace$} %ni ta pravi nadomestek, ker v Latexu tak simbol ne obstaja \ No newline at end of file
diff --git a/admin/survey/export/latexclasses/textemp/latexTemplatePdfSurvey.cls b/admin/survey/export/latexclasses/textemp/latexTemplatePdfSurvey.cls
index 378680c..296178e 100644
--- a/admin/survey/export/latexclasses/textemp/latexTemplatePdfSurvey.cls
+++ b/admin/survey/export/latexclasses/textemp/latexTemplatePdfSurvey.cls
@@ -1,129 +1,37 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{latexTemplatePdfSurvey}
\LoadClass{article}
+%da ignorira warninge ob compilanju
+%\hbadness=10000
+%\vbadness=10000
+%\tolerance=10000
%uporabljene knjiznice
-\usepackage[a4paper, portrait, left=20mm, right=20mm, headheight=1cm, top=1cm, bottom=2cm, footskip=3cm, includehead, includefoot, heightrounded]{geometry} % za robove, ipd.
-\usepackage{tabularx, booktabs} % za lazje urejanje in izris tabel (ni podprto v latex2rtf)
-\usepackage{ltablex} % Mod­i­fies the tab­u­larx en­vi­ron­ment to com­bine the fea­tures of the tab­u­larx pack­age (auto-sized columns in a fixed width ta­ble) with those of the longtable pack­age (multi-page ta­bles)
+\usepackage[a4paper, portrait, left=20mm, right=20mm, headheight=1cm, top=1cm, bottom=2cm, footskip=1cm, includehead, includefoot, heightrounded]{geometry} % za robove, ipd.
+%\usepackage{tabularx, booktabs} % za lazje urejanje in izris tabel (ni podprto v latex2rtf)
+%\usepackage{ltablex} % Mod­i­fies the tab­u­larx en­vi­ron­ment to com­bine the fea­tures of the tab­u­larx pack­age (auto-sized columns in a fixed width ta­ble) with those of the longtable pack­age (multi-page ta­bles)
%\usepackage{color}
+\usepackage{xltabular}
\usepackage[dvipsnames]{xcolor} % za uporabo HTML in RGB barv
-\usepackage{pgf} % za aritmetiko z length
-\usepackage{printlen} %
+%\usepackage{pgf} % za aritmetiko z length
+%\usepackage{printlen} %
\usepackage{enumitem} % za itemize, ki je potreben za pravilen izris rolet in izberite iz seznama v tabelah
-\usepackage{eurosym} % za izpis simbola €
\usepackage[export]{adjustbox} % za poravnavo slik
\usepackage{wasysym} % za izris radio button, checkbox
-\usepackage{tikzsymbols} %za izpis emoji-jev
-
-\usepackage{textgreek} %za resevanje grskih crk
-
-\usepackage[T2A,T1]{fontenc} %za cirilico
-\usepackage[russian,english]{babel} %za cirilico
-%\usepackage[russian]{babel} %za cirilico
-
-\usepackage[utf8]{inputenc} % za uporabo utf8
-\usepackage{amssymb} %za unicode simbole
-
-%DEFINIRANJE NADOMESTIL NEIZPISLJIVIH UNICODE CHARACTER-JEV
-\DeclareUnicodeCharacter{200B}{{\hskip 0pt}}
-\DeclareUnicodeCharacter{03C7}{$\chi$}
-\DeclareUnicodeCharacter{2265}{$\geq$}
-\DeclareUnicodeCharacter{03B5}{$\epsilon$}
-\DeclareUnicodeCharacter{2003}{$\enspace$}
-\DeclareUnicodeCharacter{0014}{$\thinspace$} %ni ta pravi nadomestek, ker v Latexu tak simbol ne obstaja
-
-%Emoji - izpis urejen s slikicami emoji-jev
-\DeclareUnicodeCharacter{1F600}{\includegraphics[height=1em]{1F600.png}}
-\DeclareUnicodeCharacter{1F601}{\includegraphics[height=1em]{1F601.png}}
-\DeclareUnicodeCharacter{1F602}{\includegraphics[height=1em]{1F602.png}}
-\DeclareUnicodeCharacter{1F603}{\includegraphics[height=1em]{1F603.png}}
-\DeclareUnicodeCharacter{1F604}{\includegraphics[height=1em]{1F604.png}}
-\DeclareUnicodeCharacter{1F605}{\includegraphics[height=1em]{1F605.png}}
-\DeclareUnicodeCharacter{1F606}{\includegraphics[height=1em]{1F606.png}}
-\DeclareUnicodeCharacter{1F609}{\includegraphics[height=1em]{1F609.png}}
-\DeclareUnicodeCharacter{1F60A}{\includegraphics[height=1em]{1F60A.png}}
-\DeclareUnicodeCharacter{1F60B}{\includegraphics[height=1em]{1F60B.png}}
-\DeclareUnicodeCharacter{1F60E}{\includegraphics[height=1em]{1F60C.png}}
-\DeclareUnicodeCharacter{1F60D}{\includegraphics[height=1em]{1F60D.png}}
-\DeclareUnicodeCharacter{1F60E}{\includegraphics[height=1em]{1F60E.png}}
-\DeclareUnicodeCharacter{1F60D}{\includegraphics[height=1em]{1F60F.png}}
-
-\DeclareUnicodeCharacter{1F600}{\includegraphics[height=1em]{1F610.png}}
-\DeclareUnicodeCharacter{1F611}{\includegraphics[height=1em]{1F611.png}}
-\DeclareUnicodeCharacter{1F612}{\includegraphics[height=1em]{1F612.png}}
-\DeclareUnicodeCharacter{1F613}{\includegraphics[height=1em]{1F613.png}}
-\DeclareUnicodeCharacter{1F614}{\includegraphics[height=1em]{1F614.png}}
-\DeclareUnicodeCharacter{1F615}{\includegraphics[height=1em]{1F615.png}}
-\DeclareUnicodeCharacter{1F616}{\includegraphics[height=1em]{1F616.png}}
-\DeclareUnicodeCharacter{1F619}{\includegraphics[height=1em]{1F619.png}}
-\DeclareUnicodeCharacter{1F61A}{\includegraphics[height=1em]{1F61A.png}}
-\DeclareUnicodeCharacter{1F61B}{\includegraphics[height=1em]{1F61B.png}}
-\DeclareUnicodeCharacter{1F61E}{\includegraphics[height=1em]{1F61C.png}}
-\DeclareUnicodeCharacter{1F61D}{\includegraphics[height=1em]{1F61D.png}}
-\DeclareUnicodeCharacter{1F61E}{\includegraphics[height=1em]{1F61E.png}}
-\DeclareUnicodeCharacter{1F61D}{\includegraphics[height=1em]{1F61F.png}}
-
-\DeclareUnicodeCharacter{1F600}{\includegraphics[height=1em]{1F620.png}}
-\DeclareUnicodeCharacter{1F621}{\includegraphics[height=1em]{1F621.png}}
-\DeclareUnicodeCharacter{1F622}{\includegraphics[height=1em]{1F622.png}}
-\DeclareUnicodeCharacter{1F623}{\includegraphics[height=1em]{1F623.png}}
-\DeclareUnicodeCharacter{1F624}{\includegraphics[height=1em]{1F624.png}}
-\DeclareUnicodeCharacter{1F625}{\includegraphics[height=1em]{1F625.png}}
-\DeclareUnicodeCharacter{1F626}{\includegraphics[height=1em]{1F626.png}}
-\DeclareUnicodeCharacter{1F629}{\includegraphics[height=1em]{1F629.png}}
-\DeclareUnicodeCharacter{1F62A}{\includegraphics[height=1em]{1F62A.png}}
-\DeclareUnicodeCharacter{1F62B}{\includegraphics[height=1em]{1F62B.png}}
-\DeclareUnicodeCharacter{1F62E}{\includegraphics[height=1em]{1F62C.png}}
-\DeclareUnicodeCharacter{1F62D}{\includegraphics[height=1em]{1F62D.png}}
-\DeclareUnicodeCharacter{1F62E}{\includegraphics[height=1em]{1F62E.png}}
-\DeclareUnicodeCharacter{1F62D}{\includegraphics[height=1em]{1F62F.png}}
-
-\DeclareUnicodeCharacter{1F600}{\includegraphics[height=1em]{1F630.png}}
-\DeclareUnicodeCharacter{1F631}{\includegraphics[height=1em]{1F631.png}}
-\DeclareUnicodeCharacter{1F632}{\includegraphics[height=1em]{1F632.png}}
-\DeclareUnicodeCharacter{1F633}{\includegraphics[height=1em]{1F633.png}}
-\DeclareUnicodeCharacter{1F634}{\includegraphics[height=1em]{1F634.png}}
-\DeclareUnicodeCharacter{1F635}{\includegraphics[height=1em]{1F635.png}}
-\DeclareUnicodeCharacter{1F636}{\includegraphics[height=1em]{1F636.png}}
-\DeclareUnicodeCharacter{1F639}{\includegraphics[height=1em]{1F639.png}}
-\DeclareUnicodeCharacter{1F63A}{\includegraphics[height=1em]{1F63A.png}}
-\DeclareUnicodeCharacter{1F63B}{\includegraphics[height=1em]{1F63B.png}}
-\DeclareUnicodeCharacter{1F63E}{\includegraphics[height=1em]{1F63C.png}}
-\DeclareUnicodeCharacter{1F63D}{\includegraphics[height=1em]{1F63D.png}}
-\DeclareUnicodeCharacter{1F63E}{\includegraphics[height=1em]{1F63E.png}}
-\DeclareUnicodeCharacter{1F63D}{\includegraphics[height=1em]{1F63F.png}}
-
-\DeclareUnicodeCharacter{1F600}{\includegraphics[height=1em]{1F640.png}}
-\DeclareUnicodeCharacter{1F641}{\includegraphics[height=1em]{1F641.png}}
-\DeclareUnicodeCharacter{1F642}{\includegraphics[height=1em]{1F642.png}}
-\DeclareUnicodeCharacter{1F643}{\includegraphics[height=1em]{1F643.png}}
-\DeclareUnicodeCharacter{1F644}{\includegraphics[height=1em]{1F644.png}}
-\DeclareUnicodeCharacter{1F645}{\includegraphics[height=1em]{1F645.png}}
-\DeclareUnicodeCharacter{1F646}{\includegraphics[height=1em]{1F646.png}}
-\DeclareUnicodeCharacter{1F649}{\includegraphics[height=1em]{1F649.png}}
-\DeclareUnicodeCharacter{1F64A}{\includegraphics[height=1em]{1F64A.png}}
-\DeclareUnicodeCharacter{1F64B}{\includegraphics[height=1em]{1F64B.png}}
-\DeclareUnicodeCharacter{1F64E}{\includegraphics[height=1em]{1F64C.png}}
-\DeclareUnicodeCharacter{1F64D}{\includegraphics[height=1em]{1F64D.png}}
-\DeclareUnicodeCharacter{1F64E}{\includegraphics[height=1em]{1F64E.png}}
-\DeclareUnicodeCharacter{1F64D}{\includegraphics[height=1em]{1F64F.png}}
-
-%Emoji - izpis urejen s slikicami emoji-jev - konec
-
-%DEFINIRANJE NADOMESTIL NEIZPISLJIVIH UNICODE CHARACTER-JEV - KONEC
-
+\usepackage{fontspec} %ureditev veh UTF-8 charaterjev
+%\usepackage{float} % For the 'H' placement option
\usepackage{graphicx} % za prikazovanje slik in ostalih grafik
\usepackage{colortbl} %The pack­age al­lows rows and columns to be coloured, and even in­di­vid­ual cells
\usepackage{fancyhdr} % za ureditev glav in nog
\usepackage{seqsplit} % za samodejno razbijanje dolgih besed v tabelah
-\usepackage{url} %za razbijanje url-jev v tabelah
-\urlstyle{same} %nastavitev, da je font URL isti kot je font ostalega besedila (http://ctan.ijs.si/tex-archive/macros/latex/contrib/url/url.pdf)
-\usepackage{montserrat} % za uporabo Montserrat pisave v dokumentu
+%\usepackage{url} %za razbijanje url-jev v tabelah
+%\urlstyle{same} %nastavitev, da je font URL isti kot je font ostalega besedila (http://ctan.ijs.si/tex-archive/macros/latex/contrib/url/url.pdf)
+\usepackage[default]{sourcesanspro} % za uporabo Source Sans Pro pisave v dokumentu
\usepackage{multirow} % za spajanje vrstic v tabeli
-\usepackage[hidelinks]{hyperref}
+%\usepackage[hidelinks]{hyperref}
\usepackage{tikz} % za risanje drsnikov
\usetikzlibrary{calc} % za risanje drsnikov
+
%definiranje uporabljenih barv
\definecolor{Mycolor1}{HTML}{00F9DE}
\definecolor{oneclick}{rgb}{0.2, 0.2, 0.2}
@@ -131,10 +39,11 @@
\definecolor{crta}{HTML}{1e88e5}
\definecolor{1ka_orange}{HTML}{ffa608}
\definecolor{komentar}{HTML}{ff0000}
+
%definiranje poravnav za tabele
\newcolumntype{C}{>{\centering\arraybackslash}X} % za sredinsko poravnavo celice, ki se samodejno prilagaja sirini
\newcolumntype{R}{>{\raggedleft\arraybackslash}X} % za desno poravnavo celice, ki se samodejno prilagaja sirini
-\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}} % za sredinsko poravnane zadeve v tabularx tabeli
+%\renewcommand{\tabularxcolumn}[1]{>{\arraybackslash}m{#1}} % za sredinsko poravnane zadeve v tabularx tabeli
\newcolumntype{s}{>{\hsize=.55\hsize \centering\arraybackslash}X} % za sredinsko poravnane celice manjse dimenzije (0.55 navadne dimenzije)
\newcolumntype{S}{>{\hsize=.2\hsize}X} % za celice manjse dimenzije (0.3 navadne dimenzije)
\newcolumntype{b}{>{\hsize=.5\hsize}X} % za celice manjse dimenzije (0.5 navadne dimenzije)
@@ -152,7 +61,7 @@
\linespread{1.5} % za razmik med vrsticami
%\fontencoding{T1}\selectfont % za encode besedila
%\fontencoding{T2A,T1}\selectfont % za encode besedila
-\renewcommand{\familydefault}{\sfdefault} % za izbiro novega fonta Montserrat
+\renewcommand{\familydefault}{\sfdefault} % za izbiro izbranega fonta, trenutno Source Sans Pro
\color{besedilo} % za izbiro barve besedila
\newenvironment{absolutelynopagebreak} % za ureditev dela besedila, kjer ne sme biti odsek strani; za prepreciti prelome strani, kjer ni potrebno
{\par\nobreak\vfil\penalty0\vfilneg
@@ -167,8 +76,7 @@
{ }
{ }
\newcommand{\forceindent}{\leavevmode{\parindent=1em\indent}} %
-\pdfcompresslevel=0 %uncompressed PDFs za pohitritev
-\pdfobjcompresslevel=0 %uncompressed PDFs za pohitritev
+
%vse za glavo in nogo
\pagestyle{fancy}
\fancyhf{}
@@ -177,21 +85,15 @@
\renewcommand{\headrulewidth}{6pt} %debelina crte glave
\renewcommand{\footrulewidth}{0.25pt} %debelina crte noga
\setlength{\headsep}{1.5cm} %odmik iz roba strani
-%newcommand{\headerfooter}[5]{ %funkcija za izpis glave in noge
-% \lhead{\begin{tabular}{@{} m{135mm} } #1 \end{tabular}}
-% \rhead{\includegraphics[#4]{#2}}
-% \fancyfoot[l]{www.1ka.si}
-% %\fancyfoot[r]{#3 \thepage{}}
-% \fancyfoot[r]{ \thepage}
-%}
-\newcommand{\headerfooter}[6]{ %funkcija za izpis glave in noge
+
+\newcommand{\headerfooter}[7]{ %funkcija za izpis glave in noge
\lhead{\begin{tabular}{@{} m{135mm} } #1 #6 \end{tabular}}
\rhead{\includegraphics[#4]{#2}}
- \fancyfoot[l]{www.1ka.si}
- %\fancyfoot[r]{#3 \thepage{}}
+ \fancyfoot[l]{#7}
\fancyfoot[r]{ \thepage}
}
%vse za glavo in nogo - konec
+
%vse za naslovnico
\newcommand{\naslovnica}[9]{
\begin{titlepage}
@@ -207,7 +109,7 @@
\textcolor{crta}{\noindent\makebox[\linewidth]{\rule{\textwidth}{6pt}}} \par
\noindent
{\large \fontseries{l} \selectfont
- \begin{tabularx}{\textwidth}{Xl}
+ \begin{xltabular}{\textwidth}{Xl}
& \\
#5 \\
& \\
@@ -218,9 +120,10 @@
#8 \\
& \\
#9
- \end{tabularx}
+ \end{xltabular}
}
\vfill
\end{titlepage}
}
-%vse za naslovnico - konec \ No newline at end of file
+%vse za naslovnico - konec
+
diff --git a/admin/survey/export/xmlClasses/class.XmlSurvey.php b/admin/survey/export/xmlClasses/class.XmlSurvey.php
index c4f7250..893b05e 100644
--- a/admin/survey/export/xmlClasses/class.XmlSurvey.php
+++ b/admin/survey/export/xmlClasses/class.XmlSurvey.php
@@ -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;
diff --git a/admin/survey/export/xmlClasses/class.XmlSurveyElement.php b/admin/survey/export/xmlClasses/class.XmlSurveyElement.php
index 630cdca..dceb330 100644
--- a/admin/survey/export/xmlClasses/class.XmlSurveyElement.php
+++ b/admin/survey/export/xmlClasses/class.XmlSurveyElement.php
@@ -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;
diff --git a/admin/survey/img_new/jazvem.png b/admin/survey/img_new/jazvem.png
new file mode 100644
index 0000000..d41f6b7
--- /dev/null
+++ b/admin/survey/img_new/jazvem.png
Binary files differ
diff --git a/admin/survey/index.php b/admin/survey/index.php
index 27fc206..1132b41 100644
--- a/admin/survey/index.php
+++ b/admin/survey/index.php
@@ -5,6 +5,10 @@
header('Cache-Control: no-cache');
header('Pragma: no-cache');
+ // Preprecimo vkljucevanje v iframe
+ header('X-Frame-Options: SAMEORIGIN');
+
+
include_once 'definition.php';
include_once '../../function.php';
include_once '../../vendor/autoload.php';
@@ -21,7 +25,7 @@
}
- global $site_url, $global_user_id, $app_settings;
+ global $site_url, $global_user_id;
$surveySkin = 0;
@@ -85,8 +89,8 @@
$rowv = mysqli_fetch_array($sqlv);
// Custom head title
- if(isset($app_settings['head_title_custom']) && $app_settings['head_title_custom'] == 1){
- echo '<title>'.$app_settings['head_title_text'].'</title>' . "\n";
+ if(AppSettings::getInstance()->getSetting('app_settings-head_title_custom')){
+ echo '<title>'.AppSettings::getInstance()->getSetting('app_settings-head_title_text').'</title>' . "\n";
}
// Default head title
else{
@@ -103,6 +107,7 @@
// ZAMENJAMO UREJEVALNIK ZA CKEDITOR
echo '<script type="text/javascript" src="'.$site_url.'editors/ckeditor_4_4/ckeditor.js"></script>';
echo '<script>';
+ echo ' CKEDITOR.timestamp=\'28092023\';';
echo ' CKEDITOR.disableAutoInline = true;';
echo ' CKEDITOR.config.contentsCss = \'css/modules/themes.css\';';
echo ' CKEDITOR.config.language = '.($lang_admin == 2 ? '\'en\'' : '\'sl\'').';';
@@ -120,7 +125,7 @@
if(isset($_GET['a']) && ($_GET['a'] == 'hierarhija_superadmin' || $_GET['a'] == 'hierarhija')){
echo '<script type="text/javascript" src="minify/g=jshierarhija?v='.$rowv['value'].'"></script>';
}
- elseif($_GET['a'] == 'narocila' || $_GET['t'] == 'uporabniki'){
+ elseif((isset($_GET['a']) && $_GET['a'] == 'narocila') || (isset($_GET['t']) && $_GET['t'] == 'uporabniki')){
echo '<script type="text/javascript" src="minify/g=jsLastLib?v='.$rowv['value'].'"></script>';
}
else{
@@ -137,7 +142,8 @@
}
// Fonts
- echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext" rel="stylesheet" />';
+ echo '<link type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,500,500i,600,600i,700,700i&subset=latin-ext" rel="stylesheet">';
+
?>
<!--[if lt IE 7]>
@@ -171,20 +177,43 @@
}
- // za css - barve ozadja
- if (isset($_GET['anketa']))
- $cssBodyClass = ' body_anketa';
- else if (isset($_GET['a']) && $_GET['a'] == 'knjiznica' )
- $cssBodyClass = ' body_library';
- else
- $cssBodyClass = ' body_folders';
-
- $sql = sisplet_query("SELECT email FROM users WHERE id='$global_user_id'");
- $row = mysqli_fetch_assoc($sql);
+ /**************** BODY ****************/
+ // za css - barve ozadja
+ $cssBodyClass = '';
+ if(isset($_GET['anketa'])){
+ $cssBodyClass = 'body_anketa';
+ }
+ elseif(isset($_GET['a']) && $_GET['a'] == 'knjiznica'){
+ $cssBodyClass = 'body_library';
+ }
+ elseif(!isset($_GET['a']) || $_GET['a'] == 'pregledovanje'){
+
+ // Pogled s folderji
+ if(SurveyList::hasFolders()){
+ $cssBodyClass = 'body_mySurveys_folders';
+ }
+ // Klasicne moje ankete
+ else{
+ $cssBodyClass = 'body_mySurveys';
+ }
+ }
+
+ // Class za jezik
+ $langBodyClass = ($lang['id'] != "1") ? 'eng' : 'slo';
+
+ // Class za fullscreen tabelo s podatki
+ session_start();
+ $dataFullscreen = '';
+ if($anketa > 0){
+ //ali imamo full screen za podatke?
+ //naredi full screen samo na strani pregleda podatkov (v nasprotnem primeru laho uporabnik klikne browser nazaj in meniji niso prikazani)
+ $dataFullscreen = (isset($_SESSION['sid_'.$anketa]['data_fullscreen']) && $_SESSION['sid_'.$anketa]['data_fullscreen'] == true
+ && isset($_GET['a']) && $_GET['a'] == 'data' && !isset($_GET['m']))
+ ? 'data_fullscreen' : '';
+ }
- /**************** BODY ****************/
- echo '<body class="mainBody'.$cssBodyClass.'">'."\n";
+ echo '<body class="mainBody '.$cssBodyClass.' '.$langBodyClass.' '.$dataFullscreen.'">'."\n";
// Google analytics
if($site_domain == 'www.1ka.si'){
@@ -200,11 +229,13 @@
<![endif]-->
<?php
- // preverimo dostop
+
+ // preverimo dostop - do demo ankete lahko dostopa tudi neprijavljen
$result = sisplet_query ("SELECT value FROM misc WHERE what='SurveyDostop'");
list ($SurveyDostop) = mysqli_fetch_row ($result);
-
- if ( ( ($admin_type <= $SurveyDostop && $SurveyDostop<3) || ($SurveyDostop==3) ) && ($admin_type>=0) ) {
+ if ( ((($admin_type <= $SurveyDostop && $SurveyDostop<3) || ($SurveyDostop==3)) && ($admin_type>=0))
+ || isDemoSurvey($anketa)
+ ) {
$s = new SurveyAdmin();
$s->display();
}
diff --git a/admin/survey/izvoz.php b/admin/survey/izvoz.php
index 421765c..af30516 100644
--- a/admin/survey/izvoz.php
+++ b/admin/survey/izvoz.php
@@ -6,7 +6,7 @@ include_once('definition.php');
include_once('../../function.php');
include_once('../../vendor/autoload.php');
-global $site_path, $global_user_id, $admin_type, $lang, $app_settings;
+global $site_path, $global_user_id, $admin_type, $lang;
# error reporting
@@ -51,6 +51,8 @@ define("M_REPORT_PDF_EMPLOYMETER","pdf_employmeter");
define("M_REPORT_PDF_MFDPS","pdf_mfpds");
define("M_REPORT_PDF_MJU","pdf_mju");
define("M_REPORT_PDF_MJU2","pdf_mju2");
+define("M_REPORT_PDF_NIJZ","pdf_nijz");
+define("M_REPORT_XLS_NIJZ_PUBLIC","xls_nijz_public");
define("M_REPORT_BORZA","borza_chart");
define("M_REPORT_PDF_HEATMAP_IMAGE","heatmap_image_pdf");
define("M_REPORT_HIERARHIJA_PDF_IZPIS", "hierarhija_pdf_izpis");
@@ -88,12 +90,11 @@ define("A_REPORT_XLS_TEXT_ANALYSIS", "text_analysis_xls");
define("A_REPORT_CSV_TEXT_ANALYSIS", "text_analysis_csv");
define("M_REPORT_CSV_MAZA_USERS", "maza_csv");
define("M_REPORT_CSV_ADVANCED_PARADATA", "advanced_paradata_csv");
+define("M_REPORT_XLS_ADVANCED_TIMESTAMPS", "advanced_timestamps_xls");
/*JSON*/
define("M_REPORT_JSON_SURVEY_EXPORT", "json_survey");
-define("A_LANGUAGE_TECHNOLOGY_XLS", "lt_excel");
-
/*PPT*/
define("M_REPORT_ANALIZA_PPT_CHARTS", "charts_ppt");
define("M_REPORT_ANALIZA_PPT_HEATMAP_IMAGE","heatmap_image_ppt");
@@ -115,7 +116,9 @@ if (!isset($_GET['anketa']) && isset($_GET['dc']) && $_GET['dc'] != null) {
}
}
-$anketa = $_GET['anketa'];
+$anketa = isset($_GET['anketa']) ? $_GET['anketa'] : '';
+$a = isset($_GET['a']) ? $_GET['a'] : '';
+$m = isset($_GET['m']) ? $_GET['m'] : '';
# PDF lahko vidijo vsi, ki kliknejo na link za kreacijo PDF-ja
# zato, kadar uporabnik ni logiran v CMS za pdf nastavimo $global_user_id kateri je enak avtorju ankete
@@ -132,22 +135,21 @@ $file = '../../lang/'.$lang_admin.'.php';
include($file);
-
/****** PREVERIMO CE IZVAJAMO NOV ALI STAR EXPORT ******/
// GDPR so vedno novi izvozi
-if(in_array($_GET['a'], array('pdf_gdpr_individual', 'pdf_gdpr_activity', 'rtf_gdpr_individual', 'rtf_gdpr_activity'))){
+if(in_array($a, array('pdf_gdpr_individual', 'pdf_gdpr_activity', 'rtf_gdpr_individual', 'rtf_gdpr_activity'))){
$export_type = 'new';
}
// Posebna porocila, ki so vedno stari izvozi
-elseif(in_array($_GET['m'], array('pdf_teammeter','pdf_employmeter', 'pdf_evoli', 'maza_csv', 'borza_csv', 'pdf_mju', 'pdf_mju2', 'advanced_paradata_csv', 'json_survey'))){
+elseif(in_array($m, array('pdf_teammeter','pdf_employmeter', 'pdf_evoli', 'maza_csv', 'borza_csv', 'pdf_mju', 'pdf_mju2', 'advanced_paradata_csv', 'advanced_timestamps_xls', 'json_survey', 'pdf_nijz', 'xls_nijz_public'))){
$export_type = 'old';
}
// Ce imamo vklopljeno nastavitev za nove izvoze
-elseif(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new'){
+elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new'){
$export_type = 'new';
}
// Ce imamo vklopljeno nastavitev za nove izvoze samo za admine
-elseif(isset($app_settings['export_type']) && $app_settings['export_type'] == 'new_admin' && $admin_type == 0){
+elseif(AppSettings::getInstance()->getSetting('app_settings-export_type') == 'new_admin' && $admin_type == 0){
$export_type = 'new';
}
else{
@@ -174,7 +176,7 @@ if($export_type == 'new'){
/****** IZVEDEMO STAR EXPORT ******/
# uporabnik ima dostop do ankete, preverimo še ali lahko pogleda userja
-switch ( $_GET['a'] ) {
+switch ($a) {
case A_REPORT_VPRASALNIK_PDF:
include($site_path.'admin/exportclases/class.pdfIzvoz.php');
@@ -277,36 +279,10 @@ switch ( $_GET['a'] ) {
$izvoz->createXls();
$izvoz->getFile('xls_analiza.xls');
- break;
- //////////////XLS//////////////////////
- case A_LANGUAGE_TECHNOLOGY_XLS:
-
- global $site_path;
- try {
-
-
- $folder = $site_path . EXPORT_FOLDER.'/';
- $filename = $folder . "lt_" . $_GET['file'] . '.xlsx';
- if (!file_exists($filename)) {
- die("ERROR! Can't locate exported file!");
- }
-
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Length: ' . filesize($filename));
- header('Content-Disposition: attachment; filename="languageTechnology.xlsx"');
- readfile($filename);
- } catch (Exception $e) {
- print_r("ERROR! Can't download exported file!");
- }
- if (file_exists($filename)) {
- unlink($filename);
- }
- break;
-
+ break;
}
-switch ( $_GET['m'] ) {
+switch ($m) {
//////////////////HEATMAP IMAGE/////////
case M_REPORT_ANALIZA_HEATMAP_IMAGE:
@@ -368,6 +344,25 @@ switch ( $_GET['m'] ) {
$sme->executeExport2($type, $enota);
break;
/////////////////////////////////////
+
+ //////////////////NIJZ/////////////////
+ case M_REPORT_PDF_NIJZ:
+
+ $usr_id = (isset($_GET['usr_id']) && $_GET['usr_id'] > 0) ? $_GET['usr_id'] : 0;
+ $anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0;
+
+ $nijz = new SurveyNIJZ($anketa, $usr_id, $nijz_type='2');
+ $nijz->createReport2();
+ break;
+
+ case M_REPORT_XLS_NIJZ_PUBLIC:
+
+ $anketa = (isset($_GET['anketa']) && $_GET['anketa'] > 0) ? $_GET['anketa'] : 0;
+
+ $nijz = new SurveyNIJZPublic($anketa);
+ $nijz->executeExport();
+ break;
+ /////////////////////////////////////
//////////////////MFDPS/////////////////
case M_REPORT_PDF_MFDPS:
@@ -710,7 +705,7 @@ switch ( $_GET['m'] ) {
//include ($site_path.'admin/survey/modules/mod_MAZA/class.MAZAExport.php');
$ME = new MAZAExport($_GET['anketa']);
- switch($_GET['a']){
+ switch($a){
case 'ident_export':
$ME->exportCSVIdentifiers();
break;
@@ -752,7 +747,12 @@ switch ( $_GET['m'] ) {
$sape = new SurveyAdvancedParadataExport($_GET['anketa']);
$sape->exportTable($table);
}
- break;
+ break;
+
+ case M_REPORT_XLS_ADVANCED_TIMESTAMPS:
+ $sat = new SurveyAdvancedTimestamps($_GET['anketa']);
+ $sat->exportTable();
+ break;
//////////////////////////////////////////
diff --git a/admin/survey/minify/.htaccess b/admin/survey/minify/.htaccess
index 06c1161..adb0653 100644
--- a/admin/survey/minify/.htaccess
+++ b/admin/survey/minify/.htaccess
@@ -1,13 +1,13 @@
-<IfModule mod_rewrite.c>
-RewriteEngine on
-
-# You may need RewriteBase on some servers
-#RewriteBase /min
-
-# rewrite URLs like "/min/f=..." to "/min/?f=..."
-RewriteRule ^([bfg]=.*) index.php?$1 [L,NE]
-</IfModule>
-<IfModule mod_env.c>
-# In case AddOutputFilterByType has been added
-SetEnv no-gzip
-</IfModule>
+<IfModule mod_rewrite.c>
+RewriteEngine on
+
+# You may need RewriteBase on some servers
+#RewriteBase /min
+
+# rewrite URLs like "/min/f=..." to "/min/?f=..."
+RewriteRule ^([bfg]=.*) index.php?$1 [L,NE]
+</IfModule>
+<IfModule mod_env.c>
+# In case AddOutputFilterByType has been added
+SetEnv no-gzip
+</IfModule>
diff --git a/admin/survey/minify/.php_cs b/admin/survey/minify/.php_cs
index d0e6de4..8edfbaa 100644
--- a/admin/survey/minify/.php_cs
+++ b/admin/survey/minify/.php_cs
@@ -1,27 +1,23 @@
<?php
-$finder = Symfony\CS\Finder\DefaultFinder::create()
- ->in(__DIR__ . '/lib')
-;
+$rules = array(
+ '@PSR2' => true,
+);
-return Symfony\CS\Config\Config::create()
- ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
- ->setUsingCache(true)
- ->fixers(array(
- 'linefeed',
- 'trailing_spaces',
- 'unused_use',
- 'short_tag',
- 'return',
- 'visibility',
- 'php_closing_tag',
- 'extra_empty_lines',
- 'function_declaration',
- 'include',
- 'controls_spaces',
- 'elseif',
- '-eof_ending',
- '-method_argument_space',
- ))
- ->finder($finder)
-;
+$config = PhpCsFixer\Config::create();
+$finder = $config->getFinder();
+
+$finder
+ ->in(array('.', 'builder/', 'lib/', 'tests/', 'min_extras/', 'static/'))
+ ->name('*.php')
+ ->ignoreDotFiles(true)
+ ->ignoreVCS(true);
+
+return $config
+ ->setUsingCache(true)
+ ->setRiskyAllowed(true)
+ ->setRules($rules)
+ ->setIndent(' ')
+ ->setLineEnding("\n");
+
+// vim:ft=php
diff --git a/admin/survey/minify/.semver b/admin/survey/minify/.semver
new file mode 100644
index 0000000..547de9d
--- /dev/null
+++ b/admin/survey/minify/.semver
@@ -0,0 +1,6 @@
+---
+:major: 3
+:minor: 0
+:patch: 11
+:special: ''
+:metadata: ''
diff --git a/admin/survey/minify/.travis.yml b/admin/survey/minify/.travis.yml
index a8a35cd..c89a368 100644
--- a/admin/survey/minify/.travis.yml
+++ b/admin/survey/minify/.travis.yml
@@ -5,7 +5,8 @@ dist: trusty
jobs:
fast_finish: true
allow_failures:
- - php: "hhvm"
+ - php: "nightly"
+ - name: "Php CS Fixer"
include:
- php: "5.3"
dist: precise
@@ -15,8 +16,13 @@ jobs:
- php: "7.0"
- php: "7.1"
- php: "7.2"
+ - php: "7.3"
+ - php: "7.4"
- php: "nightly"
- - php: "hhvm"
+ - name: "Php CS Fixer"
+ php: "7.3"
+ env:
+ - PHP_CS_FIXER=1
env:
- CLOSURE_VERSION: 20161024
@@ -36,7 +42,14 @@ before_script:
- tests/dl-closure.sh
script:
+ - PATH=vendor/bin:$PATH
- composer validate
- - phpunit --verbose
+ - |
+ if [ "$PHP_CS_FIXER" ]; then
+ composer config --unset platform.php
+ composer require --dev friendsofphp/php-cs-fixer:2.16
+ php-cs-fixer fix --verbose --diff --dry-run --ansi
+ fi
+ - vendor/bin/phpunit --verbose
# vim:ts=2:sw=2:et
diff --git a/admin/survey/minify/CHANGELOG.md b/admin/survey/minify/CHANGELOG.md
index 4f5d424..78db1f7 100644
--- a/admin/survey/minify/CHANGELOG.md
+++ b/admin/survey/minify/CHANGELOG.md
@@ -1,18 +1,101 @@
-## Version 3.0.3 (2017-11-03)
+# Changelog
-* Fix closure-compiler's error "redirection limit reached". #618, #619
+All notable changes to this project will be documented in this file.
-## Version 3.0.2 (2017-09-14)
+The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
+and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-* Fixes syntax error in Groups controller, #613
-* Better-maintained lessphp fork, #610
-* No longer corrupts some chars in some environments, #608
+## [3.0.11] - 2021-03-11
-## Version 3.0.1 (2017-06-09)
+- PHP 8.0 support, [#685], [#682], [#677]
-* Update CSSmin to v4, #599, #590
+[3.0.11]: https://github.com/mrclay/minify/compare/3.0.10...3.0.11
+[#685]: https://github.com/mrclay/minify/pull/685
+[#682]: https://github.com/mrclay/minify/pull/682
+[#677]: https://github.com/mrclay/minify/pull/677
+
+## [3.0.10] - 2020-04-02
+
+- Exclude SSI Comments from HTML minify, [#670], [#671]
+
+[3.0.10]: https://github.com/mrclay/minify/compare/3.0.9...3.0.10
+[#671]: https://github.com/mrclay/minify/issues/671
+[#670]: https://github.com/mrclay/minify/pull/670
+
+## [3.0.9] - 2020-03-24
+
+- Allow `intervention/httpauth` 3.x, [#667], [#666], [#664]
+
+[3.0.9]: https://github.com/mrclay/minify/compare/3.0.8...3.0.9
+[#664]: https://github.com/mrclay/minify/issues/664
+[#666]: https://github.com/mrclay/minify/pull/666
+[#667]: https://github.com/mrclay/minify/pull/667
+
+## [3.0.8] - 2020-03-19
+
+- Removed deprecated get_magic_quotes_gpc() function that since PHP 5.4.0 returns FALSE always, and since PHP 7.4 is deprecated, [#661]
+
+[3.0.8]: https://github.com/mrclay/minify/compare/3.0.7...3.0.8
+[#661]: https://github.com/mrclay/minify/pull/661
+
+## [3.0.7] - 2019-12-10
+
+- Allow mrclay/props-dic ^3.0, [#658]
+
+[3.0.7]: https://github.com/mrclay/minify/compare/3.0.6...3.0.7
+[#658]: https://github.com/mrclay/minify/pull/658
+
+## [3.0.6] - 2019-10-28
+
+- Bugfix for option sanitizer, [#654], [#655]
+
+[3.0.6]: https://github.com/mrclay/minify/compare/3.0.5...3.0.6
+[#654]: https://github.com/mrclay/minify/issues/654
+[#655]: https://github.com/mrclay/minify/pull/655
+
+## [3.0.5] - 2019-10-01
+
+- Fix syntax error in composer.json, [#653]
+
+[3.0.5]: https://github.com/mrclay/minify/compare/3.0.4...3.0.5
+[#653]: https://github.com/mrclay/minify/pull/653
+
+## 3.0.4 - 2019-09-24
+
+- Fix PHP 7.3 compatibility issues, [#648]
+
+[3.0.4]: https://github.com/mrclay/minify/compare/3.0.3...3.0.4
+[#648]: https://github.com/mrclay/minify/issues/648
+
+## [3.0.3] - 2017-11-03
+
+- Fix closure-compiler's error "redirection limit reached". [#618], [#619]
+
+[3.0.3]: https://github.com/mrclay/minify/compare/3.0.2...3.0.3
+[#618]: https://github.com/mrclay/minify/pull/618
+[#619]: https://github.com/mrclay/minify/issues/619
+
+## [3.0.2] - 2017-09-14
+
+- Fixes syntax error in Groups controller, [#613]
+- Better-maintained lessphp fork, [#610]
+- No longer corrupts some chars in some environments, [#608]
+
+[3.0.2]: https://github.com/mrclay/minify/compare/3.0.1...3.0.2
+[#608]: https://github.com/mrclay/minify/pull/608
+[#610]: https://github.com/mrclay/minify/pull/610
+[#613]: https://github.com/mrclay/minify/issues/613
+
+## [3.0.1] - 2017-06-09
+
+- Update CSSmin to v4, [#599], [#590]
+
+[3.0.1]: https://github.com/mrclay/minify/compare/3.0.0...3.0.1
+[#590]: https://github.com/mrclay/minify/issues/590
+[#599]: https://github.com/mrclay/minify/pull/599
+
+## 3.0.0 - 2017-04-03
-## Version 3.0.0 (2017-04-03)
* Improved CSS minification via Túbal Martín's CSSMin
* Easier error identification (just see error_log)
* Adds feature to serve static files directly
@@ -30,7 +113,8 @@
* BREAKING: Removes `$min_libPath` option
* BREAKING: The Minify, source, and controller components have changed APIs
-## Version 2.3.0 (2016-03-11)
+## 2.3.0 - 2016-03-11
+
* Adds `$min_concatOnly` option to just concatenate files
* Deprecates use of Minify_Loader
* Deprecates use of Minify_Logger
@@ -38,13 +122,15 @@
* Deprecates use of FirePHP
* Deprecates use of DooDigestAuth
-## Version 2.2.1 (2014-10-30)
+## 2.2.1 - 2014-10-30
+
* Builder styled with Bootstrap (thanks to help from acidvertigo)
* Update CSSmin to v.2.4.8
* Added WinCache
* URLs with spaces properly rewritten
-## Version 2.2.0 (2014-03-12)
+## 2.2.0 - 2014-03-12
+
* Fix handling of RegEx in certain situations in JSMin
* Thanks to Vovan-VE for reporting this
* Update composer.json with support info
@@ -66,11 +152,13 @@
* Allow far-future expiration and file versioning with the "v" querystirng parameter in addition to existing method
* Lots of general code tidy ups
-## Version 2.1.7 (2013-07-23)
+## 2.1.7 - 2013-07-23
+
* Fixes arbitrary file inclusion vulnerability on some systems
* Thanks to Matt Mecham for reporting this
-## Version 2.1.6 (2013-07-19)
+## 2.1.6 - 2013-07-19
+
* JSMin fixes
* Prevents some Closure Compiler API failures
* Uses autoloading for all class loading
@@ -82,7 +170,8 @@
* CLI script more portable
* Adds composer.json
-## Version 2.1.5 (2012-03-10)
+## 2.1.5 - 2012-03-10
+
* Removed XSS vulnerability
* Disabled builder by default
* command line tools to minify and rewrite URIs in CSS
@@ -91,7 +180,8 @@
* Closure Compiler uses cURL when allow\_url\_fopen is off
* Missing file notices when using groups
-## Version 2.1.4b (2010-07-10)
+## 2.1.4b - 2010-07-10
+
* Option to minify JS with Closure Compiler API w/ JSMin failover
* Cookie/bookmarklet-based debug mode. No HTML editing!
* Allows 1 file to be missing w/o complete failure
@@ -107,7 +197,8 @@
* Removed annoying maxFiles limit
* mbstring.func\_overload usage is safer
-## Version 2.1.3 (2009-06-30)
+## 2.1.3 - 2009-06-30
+
* CSS fixes
* A few URI rewriting bugs fixed
* comment/whitespace removal no longer breaks some values
@@ -122,7 +213,8 @@
* API: Can set contentType Minify\_Source objects (fixes an annoying [caveat](http://groups.google.com/group/minify/msg/8446d32ee99a4961))
* [Resolved Issue list](http://code.google.com/p/minify/issues/list?can=1&q=label%3ARelease-2.1.2%20status%3AVerified)
-## Version 2.1.2 (2009-03-04)
+## 2.1.2 - 2009-03-04
+
* Javascript fixes
* Debug mode no longer confused by `*/*` in strings/RegExps (jQuery)
* quote characters inside RegExp literals no longer cause exception
@@ -134,14 +226,16 @@
* Builder app doesn't fail on systems without gzdeflate()
* APC caching class included
-## Version 2.1.1 (2008-10-19)
+## 2.1.1 - 2008-10-19
+
* Bug fix release
* Detection and workarounds for zlib.output\_compression and non-PHP encoding modules
* Zlib not required (mod\_rewrite, et.al., can still be used for encoding)
* HTML : More IE conditional comments preserved
* Minify\_groupUri() utility fixed
-## Version 2.1.0 (2008-09-18)
+## 2.1.0 - 2008-09-18
+
* "min" default application for quick deployment
* Minify URI Builder app & bookmarklet for quickly creating minify URIs
* Relative URIs in CSS file are fixed automatically by default
@@ -157,8 +251,8 @@
* Minify\_Cache\_File has flock()s (by default)
* Workaround for Windows mtime reporting bug
+## 2.0.0 - 2008-05-22
-## Version 2.0.0 (2008-05-22)
* Complete code overhaul. Minify is now a PEAR-style class and toolkit for building customized minifying file servers.
* Content-Encoding: deflate/gzip/compress, based on request headers
* Expanded CSS and HTML minifiers with test cases
@@ -167,10 +261,12 @@
* Compression & encoding modules lazy-loaded as needed (304 responses use minimal code)
* Separate utility classes for HTTP encoding and cache control
-## Version 1.0.1 (2007-05-05)
+## 1.0.1 - 2007-05-05
+
* Fixed various problems resolving pathnames when hosted on an NFS mount.
* Fixed 'undefined constant' notice.
* Replaced old JSMin library with a much faster custom implementation.
-## Version 1.0.0 (2007-05-02)
+## 1.0.0 - 2007-05-02
+
* First release.
diff --git a/admin/survey/minify/bootstrap.php b/admin/survey/minify/bootstrap.php
index 4812aea..be0809c 100644
--- a/admin/survey/minify/bootstrap.php
+++ b/admin/survey/minify/bootstrap.php
@@ -25,4 +25,4 @@ call_user_func(function () {
require $file;
});
-return new \Minify\App(__DIR__);
+return new \Minify\App(__DIR__); \ No newline at end of file
diff --git a/admin/survey/minify/builder/.htaccess b/admin/survey/minify/builder/.htaccess
new file mode 100644
index 0000000..2da1eff
--- /dev/null
+++ b/admin/survey/minify/builder/.htaccess
@@ -0,0 +1,4 @@
+<IfModule mod_rewrite.c>
+RewriteEngine on
+RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
+</IfModule> \ No newline at end of file
diff --git a/admin/survey/minify/builder/index.php b/admin/survey/minify/builder/index.php
index a9a58c2..1240513 100644
--- a/admin/survey/minify/builder/index.php
+++ b/admin/survey/minify/builder/index.php
@@ -1,4 +1,4 @@
-<?php
+<?php
$app = (require __DIR__ . '/../bootstrap.php');
/* @var \Minify\App $app */
diff --git a/admin/survey/minify/builder/ocCheck.php b/admin/survey/minify/builder/ocCheck.php
index 85b272c..c357b11 100644
--- a/admin/survey/minify/builder/ocCheck.php
+++ b/admin/survey/minify/builder/ocCheck.php
@@ -1,7 +1,7 @@
<?php
/**
* AJAX checks for zlib.output_compression
- *
+ *
* @package Minify
*/
@@ -29,7 +29,6 @@ if ($app->env->get('hello')) {
));
$he->encode();
$he->sendAll();
-
} else {
// echo status "0" or "1"
header('Content-Type: text/plain');
diff --git a/admin/survey/minify/builder/test.php b/admin/survey/minify/builder/test.php
index b818f8c..95e3dd2 100644
--- a/admin/survey/minify/builder/test.php
+++ b/admin/survey/minify/builder/test.php
@@ -37,7 +37,7 @@ if (isset($_GET['oc'])) {
echo "<p class=topNote><strong>\$_SERVER['SUBDOMAIN_DOCUMENT_ROOT'] is set.</strong> "
. "You may need to set \$min_documentRoot to this in config.php</p>";
}
-
+
}
-//*/ \ No newline at end of file
+//*/
diff --git a/admin/survey/minify/composer.json b/admin/survey/minify/composer.json
index d306dd7..3ead9a9 100644
--- a/admin/survey/minify/composer.json
+++ b/admin/survey/minify/composer.json
@@ -1,7 +1,7 @@
{
"name": "mrclay/minify",
"type": "library",
- "description": "Minify is a PHP5 app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers",
+ "description": "Minify is a PHP app that helps you follow several rules for client-side performance. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers",
"homepage": "https://github.com/mrclay/minify",
"license": "BSD-3-Clause",
"authors": [
@@ -22,26 +22,31 @@
"autoload-dev": {
"psr-4": {"Minify\\Test\\": "tests/"}
},
+ "config": {
+ "platform": {
+ "php": "5.3.29"
+ },
+ "sort-packages": true
+ },
"require": {
+ "php": "^5.3.0 || ^7.0 || ^8.0",
"ext-pcre": "*",
- "intervention/httpauth": "~2.0",
- "monolog/monolog": "~1.1",
+ "intervention/httpauth": "^2.0|^3.0",
+ "marcusschwarz/lesserphp": "^0.5.1",
+ "monolog/monolog": "~1.1|~2.0",
"mrclay/jsmin-php": "~2",
- "mrclay/props-dic": "^2.2",
- "php": "^5.3.0 || ^7.0",
+ "mrclay/props-dic": "^2.2|^3.0",
"tubalmartin/cssmin": "~4"
},
"require-dev": {
"firephp/firephp-core": "~0.4.0",
"leafo/scssphp": "^0.3 || ^0.6 || ^0.7",
- "marcusschwarz/lesserphp": "~0.5.1",
"meenie/javascript-packer": "~1.1",
"phpunit/phpunit": "^4.8.36",
"tedivm/jshrink": "~1.1.0"
},
"suggest": {
"firephp/firephp-core": "Use FirePHP for Log messages",
- "marcusschwarz/lesserphp": "LESS support",
"meenie/javascript-packer": "Keep track of the Packer PHP port using Composer"
},
"scripts": {
diff --git a/admin/survey/minify/config-test.php b/admin/survey/minify/config-test.php
index c903086..790b81b 100644
--- a/admin/survey/minify/config-test.php
+++ b/admin/survey/minify/config-test.php
@@ -4,7 +4,6 @@
*
* To test config options, place them in this file and add "&test" to your Minify URL.
* Note that if this is on a public server, anyone can execute your test.
- *
+ *
* @package Minify
*/
-
diff --git a/admin/survey/minify/groupsConfig.php b/admin/survey/minify/groupsConfig.php
index 38987e9..10f6b85 100644
--- a/admin/survey/minify/groupsConfig.php
+++ b/admin/survey/minify/groupsConfig.php
@@ -47,8 +47,9 @@ return [
dirname(__FILE__).'/../script/statistika.js',
dirname(__FILE__).'/../script/vprasanje.js',
dirname(__FILE__).'/../script/vprasanjeInline.js',
+ dirname(__FILE__).'/../script/vprasanjeDeleted.js',
+ dirname(__FILE__).'/../script/comments.js',
dirname(__FILE__).'/../script/prevajanje.js',
- dirname(__FILE__).'/../script/telefon.js',
dirname(__FILE__).'/../script/missingValues.js',
dirname(__FILE__).'/../script/missingProfiles.js',
dirname(__FILE__).'/../script/variableProfiles.js',
@@ -89,6 +90,7 @@ return [
dirname(__FILE__).'/../script/trak_respondent.js',
dirname(__FILE__).'/../script/GDPR.js',
dirname(__FILE__).'/../script/narocila.js',
+ dirname(__FILE__).'/../script/domainChange.js',
dirname(__FILE__).'/../script/HeatMap/heatmap_admin.js',
dirname(__FILE__).'/../script/HeatMap/HeatMapCanvasAdmin.js',
dirname(__FILE__).'/../script/HeatMap/HeatMapSumarnikPopUp.js',
@@ -97,6 +99,10 @@ return [
dirname(__FILE__).'/../script/DragDrop/dragdropInAdmin.js',
dirname(__FILE__).'/../script/custom_column_label_respondent.js',
dirname(__FILE__).'/../script/ImageHotSpot/imagemap_question_editor.js',
+ dirname(__FILE__).'/../script/ImageHotSpot/imageHotspot.js',
+
+ dirname(__FILE__).'/../script/Chartjs/chart.js', //source za chartjs grafe
+ dirname(__FILE__).'/../script/Chartjs.js',
dirname(__FILE__).'/../script/jquery/jquery.imagemapster.js',
@@ -210,6 +216,7 @@ return [
dirname(__FILE__).'/../script/dostop.js',
dirname(__FILE__).'/../script/narocila.js',
dirname(__FILE__).'/../script/datepicker.js',
+ dirname(__FILE__).'/../script/notifications.js',
],
@@ -289,7 +296,9 @@ return [
dirname(__FILE__).'/../css/style_sprites_test.css',
# css za admin
- dirname(__FILE__).'/../../../public/css/admin.css',
+ //dirname(__FILE__).'/../../../public/css/admin.css',
+ dirname(__FILE__).'/../../../public/css/admin_new.css',
+
dirname(__FILE__).'/../script/jquery/jquery.selectbox-0.6.1/css/jquery.selectbox.css',
dirname(__FILE__).'/../script/jquery/jquery.ui.Slider.Pips/jquery-ui-slider-pips.css',
diff --git a/admin/survey/minify/index.php b/admin/survey/minify/index.php
index 2d17007..9c98438 100644
--- a/admin/survey/minify/index.php
+++ b/admin/survey/minify/index.php
@@ -1,9 +1,9 @@
<?php
/**
* Sets up MinApp controller and serves files
- *
+ *
* DO NOT EDIT! Configure this utility via config.php and groupsConfig.php
- *
+ *
* @package Minify
*/
diff --git a/admin/survey/minify/lib/HTTP/ConditionalGet.php b/admin/survey/minify/lib/HTTP/ConditionalGet.php
index d81f8db..1ae37fb 100644
--- a/admin/survey/minify/lib/HTTP/ConditionalGet.php
+++ b/admin/survey/minify/lib/HTTP/ConditionalGet.php
@@ -128,8 +128,8 @@ class HTTP_ConditionalGet
$etagAppend = '';
if (isset($spec['encoding'])) {
$this->_stripEtag = true;
- $this->_headers['Vary'] = 'Accept-Encoding';
if ('' !== $spec['encoding']) {
+ $this->_headers['Vary'] = 'Accept-Encoding';
if (0 === strpos($spec['encoding'], 'x-')) {
$spec['encoding'] = substr($spec['encoding'], 2);
}
@@ -317,7 +317,7 @@ class HTTP_ConditionalGet
if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
return false;
}
- $clientEtagList = get_magic_quotes_gpc()
+ $clientEtagList = PHP_VERSION_ID < 50400 && get_magic_quotes_gpc()
? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
: $_SERVER['HTTP_IF_NONE_MATCH'];
$clientEtags = explode(',', $clientEtagList);
diff --git a/admin/survey/minify/lib/HTTP/Encoder.php b/admin/survey/minify/lib/HTTP/Encoder.php
index c1c989e..b489242 100644
--- a/admin/survey/minify/lib/HTTP/Encoder.php
+++ b/admin/survey/minify/lib/HTTP/Encoder.php
@@ -204,9 +204,10 @@ class HTTP_Encoder
}
// gzip checks (slow)
if (preg_match(
- '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
+ '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae,
+ $m
+ )) {
return array('gzip', $m[1]);
}
if ($allowDeflate) {
@@ -217,14 +218,17 @@ class HTTP_Encoder
|| 0 === strpos($ae, 'deflate,') // opera
// slow parsing
|| preg_match(
- '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae)) {
+ '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae
+ )) {
return array('deflate', 'deflate');
}
}
if ($allowCompress && preg_match(
- '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
- ,$ae
- ,$m)) {
+ '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@',
+ $ae,
+ $m
+ )) {
return array('compress', $m[1]);
}
diff --git a/admin/survey/minify/lib/Minify.php b/admin/survey/minify/lib/Minify.php
index b01a2b9..047d9ed 100644
--- a/admin/survey/minify/lib/Minify.php
+++ b/admin/survey/minify/lib/Minify.php
@@ -242,7 +242,7 @@ class Minify
if (! $this->options['quiet']) {
$this->errorExit($this->options['badRequestHeader'], self::URL_DEBUG);
} else {
- list(,$statusCode) = explode(' ', $this->options['badRequestHeader']);
+ list(, $statusCode) = explode(' ', $this->options['badRequestHeader']);
return array(
'success' => false,
@@ -470,7 +470,7 @@ class Minify
public function errorExit($header, $url = '', $msgHtml = '')
{
$url = htmlspecialchars($url, ENT_QUOTES);
- list(,$h1) = explode(' ', $header, 2);
+ list(, $h1) = explode(' ', $header, 2);
$h1 = htmlspecialchars($h1);
// FastCGI environments require 3rd arg to header() to be set
list(, $code) = explode(' ', $header, 3);
@@ -593,7 +593,8 @@ class Minify
! $source // yes, we ran out of sources
|| $type === self::TYPE_CSS // yes, to process CSS individually (avoiding PCRE bugs/limits)
|| $minifier !== $lastMinifier // yes, minifier changed
- || $options !== $lastOptions)) { // yes, options changed
+ || $options !== $lastOptions // yes, options changed
+ )) {
// minify previous sources with last settings
$imploded = implode($implodeSeparator, $groupToProcessTogether);
$groupToProcessTogether = array();
diff --git a/admin/survey/minify/lib/Minify/App.php b/admin/survey/minify/lib/Minify/App.php
index 5ddb3e9..1270672 100644
--- a/admin/survey/minify/lib/Minify/App.php
+++ b/admin/survey/minify/lib/Minify/App.php
@@ -80,6 +80,12 @@ class App extends Container
};
$varNames = array_map($prefixer, $propNames);
+ $varDefined = get_defined_vars();
+
+ $varNames = array_filter($varNames, function ($name) use ($varDefined) {
+ return array_key_exists($name, $varDefined);
+ });
+
$vars = compact($varNames);
foreach ($varNames as $varName) {
diff --git a/admin/survey/minify/lib/Minify/CSSmin.php b/admin/survey/minify/lib/Minify/CSSmin.php
index dcde782..7fbcb68 100644
--- a/admin/survey/minify/lib/Minify/CSSmin.php
+++ b/admin/survey/minify/lib/Minify/CSSmin.php
@@ -73,16 +73,16 @@ class Minify_CSSmin
}
if ($options['currentDir']) {
return Minify_CSS_UriRewriter::rewrite(
- $css
- ,$options['currentDir']
- ,$options['docRoot']
- ,$options['symlinks']
+ $css,
+ $options['currentDir'],
+ $options['docRoot'],
+ $options['symlinks']
);
}
return Minify_CSS_UriRewriter::prepend(
- $css
- ,$options['prependRelativePath']
+ $css,
+ $options['prependRelativePath']
);
}
}
diff --git a/admin/survey/minify/lib/Minify/Cache/Null.php b/admin/survey/minify/lib/Minify/Cache/Null.php
index b6f6566..0c9183e 100644
--- a/admin/survey/minify/lib/Minify/Cache/Null.php
+++ b/admin/survey/minify/lib/Minify/Cache/Null.php
@@ -64,4 +64,4 @@ class Minify_Cache_Null implements Minify_CacheInterface
public function fetch($id)
{
}
-} \ No newline at end of file
+}
diff --git a/admin/survey/minify/lib/Minify/Cache/WinCache.php b/admin/survey/minify/lib/Minify/Cache/WinCache.php
index 089d66d..cec9cd8 100644
--- a/admin/survey/minify/lib/Minify/Cache/WinCache.php
+++ b/admin/survey/minify/lib/Minify/Cache/WinCache.php
@@ -136,4 +136,4 @@ class Minify_Cache_WinCache implements Minify_CacheInterface
return true;
}
-} \ No newline at end of file
+}
diff --git a/admin/survey/minify/lib/Minify/Controller/Files.php b/admin/survey/minify/lib/Minify/Controller/Files.php
index a9bb941..32d5a56 100644
--- a/admin/survey/minify/lib/Minify/Controller/Files.php
+++ b/admin/survey/minify/lib/Minify/Controller/Files.php
@@ -68,4 +68,3 @@ class Minify_Controller_Files extends Minify_Controller_Base
return new Minify_ServeConfiguration($options, $sources);
}
}
-
diff --git a/admin/survey/minify/lib/Minify/Controller/Groups.php b/admin/survey/minify/lib/Minify/Controller/Groups.php
index 6d4e5f4..521a58e 100644
--- a/admin/survey/minify/lib/Minify/Controller/Groups.php
+++ b/admin/survey/minify/lib/Minify/Controller/Groups.php
@@ -73,4 +73,3 @@ class Minify_Controller_Groups extends Minify_Controller_Files
return parent::createConfiguration($options);
}
}
-
diff --git a/admin/survey/minify/lib/Minify/Controller/Page.php b/admin/survey/minify/lib/Minify/Controller/Page.php
index 8ca00d5..3fa0ee3 100644
--- a/admin/survey/minify/lib/Minify/Controller/Page.php
+++ b/admin/survey/minify/lib/Minify/Controller/Page.php
@@ -66,4 +66,3 @@ class Minify_Controller_Page extends Minify_Controller_Base
return new Minify_ServeConfiguration($options, $sources, $selectionId);
}
}
-
diff --git a/admin/survey/minify/lib/Minify/ControllerInterface.php b/admin/survey/minify/lib/Minify/ControllerInterface.php
index d468635..dad19a9 100644
--- a/admin/survey/minify/lib/Minify/ControllerInterface.php
+++ b/admin/survey/minify/lib/Minify/ControllerInterface.php
@@ -19,4 +19,4 @@ interface Minify_ControllerInterface
* @return Minify_Env
*/
public function getEnv();
-} \ No newline at end of file
+}
diff --git a/admin/survey/minify/lib/Minify/HTML.php b/admin/survey/minify/lib/Minify/HTML.php
index 24b14ac..c5caad2 100644
--- a/admin/survey/minify/lib/Minify/HTML.php
+++ b/admin/survey/minify/lib/Minify/HTML.php
@@ -99,32 +99,34 @@ class Minify_HTML
// replace SCRIPTs (and minify) with placeholders
$this->_html = preg_replace_callback(
- '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/iu'
- ,array($this, '_removeScriptCB')
- ,$this->_html);
+ '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/iu',
+ array($this, '_removeScriptCB'),
+ $this->_html
+ );
// replace STYLEs (and minify) with placeholders
$this->_html = preg_replace_callback(
- '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/iu'
- ,array($this, '_removeStyleCB')
- ,$this->_html);
+ '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/iu',
+ array($this, '_removeStyleCB'),
+ $this->_html
+ );
// remove HTML comments (not containing IE conditional comments).
$this->_html = preg_replace_callback(
- '/<!--([\\s\\S]*?)-->/u'
- ,array($this, '_commentCB')
- ,$this->_html);
+ '/<!--([\\s\\S]*?)-->/u',
+ array($this, '_commentCB'),
+ $this->_html
+ );
// replace PREs with placeholders
- $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/iu'
- ,array($this, '_removePreCB')
- ,$this->_html);
+ $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/iu', array($this, '_removePreCB'), $this->_html);
// replace TEXTAREAs with placeholders
$this->_html = preg_replace_callback(
- '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/iu'
- ,array($this, '_removeTextareaCB')
- ,$this->_html);
+ '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/iu',
+ array($this, '_removeTextareaCB'),
+ $this->_html
+ );
// trim each line.
// @todo take into account attribute values that span multiple lines.
@@ -139,24 +141,25 @@ class Minify_HTML
// remove ws outside of all elements
$this->_html = preg_replace(
- '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</u'
- ,'>$1$2$3<'
- ,$this->_html);
+ '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</u',
+ '>$1$2$3<',
+ $this->_html
+ );
// use newlines before 1st attribute in open tags (to limit line lengths)
$this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/iu', "$1\n$2", $this->_html);
// fill placeholders
$this->_html = str_replace(
- array_keys($this->_placeholders)
- ,array_values($this->_placeholders)
- ,$this->_html
+ array_keys($this->_placeholders),
+ array_values($this->_placeholders),
+ $this->_html
);
// issue 229: multi-pass to catch scripts that didn't get replaced in textareas
$this->_html = str_replace(
- array_keys($this->_placeholders)
- ,array_values($this->_placeholders)
- ,$this->_html
+ array_keys($this->_placeholders),
+ array_values($this->_placeholders),
+ $this->_html
);
return $this->_html;
@@ -164,7 +167,7 @@ class Minify_HTML
protected function _commentCB($m)
{
- return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<!['))
+ return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<![') || 0 === strpos($m[1], '#'))
? $m[0]
: '';
}
@@ -209,7 +212,8 @@ class Minify_HTML
: 'trim';
$css = call_user_func($minifier, $css);
- return $this->_reservePlace($this->_needsCdata($css)
+ return $this->_reservePlace(
+ $this->_needsCdata($css)
? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
: "{$openStyle}{$css}</style>"
);
@@ -238,7 +242,8 @@ class Minify_HTML
: 'trim';
$js = call_user_func($minifier, $js);
- return $this->_reservePlace($this->_needsCdata($js)
+ return $this->_reservePlace(
+ $this->_needsCdata($js)
? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
: "{$ws1}{$openScript}{$js}</script>{$ws2}"
);
diff --git a/admin/survey/minify/lib/Minify/ImportProcessor.php b/admin/survey/minify/lib/Minify/ImportProcessor.php
index 0f8c981..57c22e8 100644
--- a/admin/survey/minify/lib/Minify/ImportProcessor.php
+++ b/admin/survey/minify/lib/Minify/ImportProcessor.php
@@ -66,7 +66,7 @@ class Minify_ImportProcessor
$this->_currentDir = dirname($file);
// remove UTF-8 BOM if present
- if (pack("CCC",0xef,0xbb,0xbf) === substr($content, 0, 3)) {
+ if (pack("CCC", 0xef, 0xbb, 0xbf) === substr($content, 0, 3)) {
$content = substr($content, 3);
}
// ensure uniform EOLs
@@ -182,7 +182,7 @@ class Minify_ImportProcessor
private function truepath($path)
{
// whether $path is unix or not
- $unipath = ('' === $path) || ($path{0} !== '/');
+ $unipath = ('' === $path) || ($path[0] !== '/');
// attempts to detect if path is relative in which case, add cwd
if (strpos($path, ':') === false && $unipath) {
diff --git a/admin/survey/minify/lib/Minify/JS/ClosureCompiler.php b/admin/survey/minify/lib/Minify/JS/ClosureCompiler.php
index 05e2e33..63f7b90 100644
--- a/admin/survey/minify/lib/Minify/JS/ClosureCompiler.php
+++ b/admin/survey/minify/lib/Minify/JS/ClosureCompiler.php
@@ -195,13 +195,13 @@ class Minify_JS_ClosureCompiler
curl_close($ch);
} else {
throw new Minify_JS_ClosureCompiler_Exception(
- "Could not make HTTP request: allow_url_open is false and cURL not available"
+ "Could not make HTTP request: allow_url_open is false and cURL not available"
);
}
if (false === $contents) {
throw new Minify_JS_ClosureCompiler_Exception(
- "No HTTP response from server"
+ "No HTTP response from server"
);
}
diff --git a/admin/survey/minify/lib/Minify/NailgunClosureCompiler.php b/admin/survey/minify/lib/Minify/NailgunClosureCompiler.php
index 683e30f..516cc5e 100644
--- a/admin/survey/minify/lib/Minify/NailgunClosureCompiler.php
+++ b/admin/survey/minify/lib/Minify/NailgunClosureCompiler.php
@@ -110,4 +110,4 @@ class Minify_NailgunClosureCompiler extends Minify_ClosureCompiler
$this->shell("$serverCommand </dev/null >/dev/null 2>/dev/null & sleep 10");
}
-} \ No newline at end of file
+}
diff --git a/admin/survey/minify/lib/Minify/Source/Factory.php b/admin/survey/minify/lib/Minify/Source/Factory.php
index 4371931..a817417 100644
--- a/admin/survey/minify/lib/Minify/Source/Factory.php
+++ b/admin/survey/minify/lib/Minify/Source/Factory.php
@@ -170,7 +170,7 @@ class Minify_Source_Factory
if ($this->options['noMinPattern'] && preg_match($this->options['noMinPattern'], $basename)) {
if (preg_match('~\.(css|less)$~i', $basename)) {
$spec['minifyOptions']['compress'] = false;
- // we still want URI rewriting to work for CSS
+ // we still want URI rewriting to work for CSS
} else {
$spec['minifier'] = 'Minify::nullMinifier';
}
diff --git a/admin/survey/minify/lib/Minify/YUICompressor.php b/admin/survey/minify/lib/Minify/YUICompressor.php
index 40fd02c..3d14f41 100644
--- a/admin/survey/minify/lib/Minify/YUICompressor.php
+++ b/admin/survey/minify/lib/Minify/YUICompressor.php
@@ -154,4 +154,3 @@ class Minify_YUICompressor
}
}
}
-
diff --git a/admin/survey/minify/lib/MrClay/Cli.php b/admin/survey/minify/lib/MrClay/Cli.php
index 4622b14..1f9b7ea 100644
--- a/admin/survey/minify/lib/MrClay/Cli.php
+++ b/admin/survey/minify/lib/MrClay/Cli.php
@@ -390,4 +390,3 @@ class Cli
$this->errors[$letter][] = sprintf($msg, $value);
}
}
-
diff --git a/admin/survey/minify/phpunit.xml b/admin/survey/minify/phpunit.xml
index 285c66f..5a96b1e 100644
--- a/admin/survey/minify/phpunit.xml
+++ b/admin/survey/minify/phpunit.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- http://phpunit.de/manual/current/en/appendixes.configuration.html -->
+<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
@@ -10,7 +10,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
- syntaxCheck="false"
bootstrap="vendor/autoload.php">
<testsuites>
@@ -32,6 +31,7 @@
<directory>.</directory>
<exclude>
<directory>tests</directory>
+ <directory>vendor</directory>
</exclude>
</whitelist>
</filter>
diff --git a/admin/survey/minify/server-info.php b/admin/survey/minify/server-info.php
index 0b1ada7..37a31c9 100644
--- a/admin/survey/minify/server-info.php
+++ b/admin/survey/minify/server-info.php
@@ -13,7 +13,8 @@ if (!$enabled) {
die('Set $enabled to true to see server info.');
}
-function assertTrue($test, $message) {
+function assertTrue($test, $message)
+{
if (!$test) {
echo "Warning: $message\n";
}
diff --git a/admin/survey/minify/static/.htaccess b/admin/survey/minify/static/.htaccess
index f9cc303..36927be 100644
--- a/admin/survey/minify/static/.htaccess
+++ b/admin/survey/minify/static/.htaccess
@@ -1,40 +1,40 @@
-<IfModule mod_expires.c>
- ExpiresActive On
- ExpiresDefault "access plus 1 year"
-</IfModule>
-
-<FilesMatch "\.(js|css|less)$">
- FileETag MTime Size
-</FilesMatch>
-
-<IfModule mod_gzip.c>
- mod_gzip_on yes
- mod_gzip_dechunk yes
- mod_gzip_keep_workfiles No
- mod_gzip_minimum_file_size 1000
- mod_gzip_maximum_file_size 1000000
- mod_gzip_maximum_inmem_size 1000000
- mod_gzip_item_include mime ^text/.*
- mod_gzip_item_include mime ^application/javascript$
- mod_gzip_item_include mime ^application/x-javascript$
- # Exclude old browsers and images since IE has trouble with this
- mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
- mod_gzip_item_exclude mime ^image/.*
-</IfModule>
-
-<IfModule mod_deflate.c>
- AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
- BrowserMatch ^Mozilla/4 gzip-only-text/html
- BrowserMatch ^Mozilla/4\.[0678] no-gzip
- BrowserMatch \bMSIE !no-gzip
-</IfModule>
-
-<IfModule mod_rewrite.c>
-RewriteEngine on
-
-# You may need RewriteBase on some servers
-#RewriteBase /min/static
-
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ gen.php [QSA,L]
-</IfModule>
+<IfModule mod_expires.c>
+ ExpiresActive On
+ ExpiresDefault "access plus 1 year"
+</IfModule>
+
+<FilesMatch "\.(js|css|less)$">
+ FileETag MTime Size
+</FilesMatch>
+
+<IfModule mod_gzip.c>
+ mod_gzip_on yes
+ mod_gzip_dechunk yes
+ mod_gzip_keep_workfiles No
+ mod_gzip_minimum_file_size 1000
+ mod_gzip_maximum_file_size 1000000
+ mod_gzip_maximum_inmem_size 1000000
+ mod_gzip_item_include mime ^text/.*
+ mod_gzip_item_include mime ^application/javascript$
+ mod_gzip_item_include mime ^application/x-javascript$
+ # Exclude old browsers and images since IE has trouble with this
+ mod_gzip_item_exclude reqheader "User-Agent: .*Mozilla/4\..*\["
+ mod_gzip_item_exclude mime ^image/.*
+</IfModule>
+
+<IfModule mod_deflate.c>
+ AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript
+ BrowserMatch ^Mozilla/4 gzip-only-text/html
+ BrowserMatch ^Mozilla/4\.[0678] no-gzip
+ BrowserMatch \bMSIE !no-gzip
+</IfModule>
+
+<IfModule mod_rewrite.c>
+RewriteEngine on
+
+# You may need RewriteBase on some servers
+#RewriteBase /min/static
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ gen.php [QSA,L]
+</IfModule>
diff --git a/admin/survey/minify/static/gen.php b/admin/survey/minify/static/gen.php
index 2bc40af..5ec84a5 100644
--- a/admin/survey/minify/static/gen.php
+++ b/admin/survey/minify/static/gen.php
@@ -7,12 +7,12 @@ if (is_file(__DIR__ . '/bootstrap.php')) {
$bootstrap_file = __DIR__ . '/../bootstrap.php';
}
-$send_400 = function($content = 'Bad URL') {
+$send_400 = function ($content = 'Bad URL') {
http_response_code(400);
die($content);
};
-$send_301 = function($url) {
+$send_301 = function ($url) {
http_response_code(301);
header("Cache-Control: max-age=31536000");
header("Location: $url");
diff --git a/admin/survey/minify/static/lib.php b/admin/survey/minify/static/lib.php
index 32c6df5..3cd02d6 100644
--- a/admin/survey/minify/static/lib.php
+++ b/admin/survey/minify/static/lib.php
@@ -10,7 +10,8 @@ namespace Minify\StaticService;
* @param string $type "css" or "js"
* @return string
*/
-function build_uri($static_uri, $query, $type) {
+function build_uri($static_uri, $query, $type)
+{
$static_uri = rtrim($static_uri, '/');
$query = ltrim($query, '?');
@@ -30,7 +31,8 @@ function build_uri($static_uri, $query, $type) {
* @param bool $auto_create Automatically create the directory if missing?
* @return null|string null if missing or can't create
*/
-function get_cache_time($auto_create = true) {
+function get_cache_time($auto_create = true)
+{
foreach (scandir(__DIR__) as $entry) {
if (ctype_digit($entry)) {
return $entry;
@@ -50,14 +52,16 @@ function get_cache_time($auto_create = true) {
return $time;
}
-function flush_cache() {
+function flush_cache()
+{
$time = get_cache_time(false);
if ($time) {
remove_tree(__DIR__ . "/$time");
}
}
-function remove_tree($dir) {
+function remove_tree($dir)
+{
$files = array_diff(scandir($dir), array('.', '..'));
foreach ($files as $file) {
diff --git a/admin/survey/minify/utils.php b/admin/survey/minify/utils.php
index 983cde5..36d992c 100644
--- a/admin/survey/minify/utils.php
+++ b/admin/survey/minify/utils.php
@@ -48,7 +48,7 @@ function Minify_getUri($keyOrFiles, $opts = array())
*
* Since this makes a bunch of stat() calls, you might not want to check this
* on every request.
- *
+ *
* @param array $keysAndFiles group keys and/or file paths/URIs.
* @return int latest modification time of all given keys/files
*/
diff --git a/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php b/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php
index aa4a6c0..3e8a375 100644
--- a/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php
+++ b/admin/survey/modules/mod_360_1KA/class.Survey3601ka.php
@@ -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();
}
}
diff --git a/admin/survey/modules/mod_MAZA/class.MAZA.php b/admin/survey/modules/mod_MAZA/class.MAZA.php
index c430546..5c67424 100644
--- a/admin/survey/modules/mod_MAZA/class.MAZA.php
+++ b/admin/survey/modules/mod_MAZA/class.MAZA.php
@@ -1115,12 +1115,11 @@ class MAZA {
* @return type - json result of curl output
*/
private function send_FCM_mesage_curl($fields){
- #API access key from Google API's Console
- global $FCM_server_key;
+ #API access key from Google API's Console
$headers = array
(
- 'Authorization: key=' . $FCM_server_key,
+ 'Authorization: key=' . AppSettings::getInstance()->getSetting('maza-FCM_server_key'),
'Content-Type: application/json'
);
#Send Reponse To FireBase Server
@@ -1339,7 +1338,7 @@ class MAZA {
* @param type $tactivity_id - id of triggered activity
* @param type $mode - mode of survey (repeater, geofence, activity, entry)
*/
- public function maza_save_srv_user($maza_uid, $srv_uid, $srv_version, $tgeofence_id=null, $tactivity_id=null, $mode) {
+ public function maza_save_srv_user($maza_uid, $srv_uid, $srv_version, $tgeofence_id=null, $tactivity_id=null, $mode=null) {
//check if pair already existst in DB
$sql = sisplet_query("SELECT * FROM maza_srv_users WHERE maza_user_id='$maza_uid' AND srv_user_id='$srv_uid'");
//it is already there
@@ -1790,16 +1789,14 @@ class MAZA {
* @param type $password - passwor to set in nextpin for this user
*/
public function nextpin_create_user($identifier, $password){
- #credentials to use nextpin API
- global $NextPinMainToken;
-
+ #credentials to use nextpin API
$fields = array
(
'username' => $this->nextpin_token_prefix . $identifier,
'password' => $password
);
- $this -> nextpin_API_call($NextPinMainToken, $fields, 'auth/createUser');
+ $this -> nextpin_API_call(AppSettings::getInstance()->getSetting('maza-NextPinMainToken'), $fields, 'auth/createUser');
}
/**
diff --git a/admin/survey/modules/mod_MAZA/js/MAZA.js b/admin/survey/modules/mod_MAZA/js/MAZA.js
index a229c26..7d96c15 100644
--- a/admin/survey/modules/mod_MAZA/js/MAZA.js
+++ b/admin/survey/modules/mod_MAZA/js/MAZA.js
@@ -476,7 +476,7 @@ function maza_klikNaMapo() {
maza_saveGeofence(data.formatted_address, maza_create_basic_circle(pos, data.formatted_address, maza_default_radius, false));
} else {
//odpre se okno, ce je prislo do napake - null - (mozen je tudi prekratek delay med geocoding requesti)
- alert(lang['srv_resevanje_alert_location_not_found_map']);
+ genericAlertPopup('srv_resevanje_alert_location_not_found_map');
}
});
diff --git a/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php b/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php
index 87a1e8b..a15d706 100644
--- a/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php
+++ b/admin/survey/modules/mod_SPEEDINDEX/class.SurveySpeedIndex.php
@@ -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();
}
}
diff --git a/admin/survey/modules/mod_WPN/class.WPN.php b/admin/survey/modules/mod_WPN/class.WPN.php
index baabfef..6a78d1b 100644
--- a/admin/survey/modules/mod_WPN/class.WPN.php
+++ b/admin/survey/modules/mod_WPN/class.WPN.php
@@ -99,7 +99,6 @@ class WPN {
}
public function sendWebPushNotificationsToAll(){
- //global $FCM_server_key;
$title = $_POST['wpn_title'];
$message = $_POST['wpn_message'];
diff --git a/admin/survey/modules/mod_WPN/frontend/index.html b/admin/survey/modules/mod_WPN/frontend/index.html
index 1b5c4a9..c20522a 100644
--- a/admin/survey/modules/mod_WPN/frontend/index.html
+++ b/admin/survey/modules/mod_WPN/frontend/index.html
@@ -1,196 +1,196 @@
-<!doctype html>
-<html lang="en-us">
-
- <head>
-
- <!-- Meta -->
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width,initial-scale=1">
-
- <title>1KA WPN</title>
- <meta name="description" content="">
-
- <!-- The compiled CSS file -->
- <link rel="stylesheet" href="admin/survey/modules/mod_WPN/frontend/css/production.css">
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
-
- <!-- Web fonts -->
- <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700|Source+Serif+Pro:700" rel="stylesheet">
-
- <!-- favicon.ico. Place these in the root directory. -->
- <link rel="shortcut icon" href="favicon.ico">
-
- <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
- <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
- <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
- <link rel="manifest" href="manifest.json">
- <link rel="mask-icon" href="safari-pinned-tab.svg" color="#ffffff">
- <meta name="msapplication-TileColor" content="#da532c">
- <meta name="theme-color" content="#ffffff">
- <meta name="apple-moblile-web-app-capable" content="yes">
- <meta name="apple-moblile-web-app-status-bar-style" content="default">
- <link rel="apple-touch-startup-image" href="apple-touch-icon.png">
- <!-- iOS Splash Screen Images -->
- <link rel="apple-touch-startup-image" href="apple-splash-640.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-750.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1242.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1125.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1536.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1668.png" media="(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-2048.png" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
-
- </head>
-
- <body>
-
-
- <!-- Header -->
- <header class="align--center pt3">
- <div class="container--lg border--bottom pb3">
- <img class="logo mb3" src="admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png" alt="1KA">
- <div id="notif_join_div" style="display: none;">
- <button class="mb2 btn btn--secondary" id="notif_join_button" onclick="clickButtonSubscribe();" style="font-size: 1.5em;">Join us!</button>
- <br><br>
- <div id="notification_permission_warning" style="display: none;">
- <h3 class="mb2" style="color:red">In order to use our services, you have to enable notifications</h3>
- <br><br>
- </div>
- <h1 class="mb2">Be first to know when new surveys are up!</h1>
- </div>
- <div id="notif_joined_div" style="display: none;">
- <h1 class="mb2">You are in!</h1>
- <p class="mb2">You will be among first who will get notifications when new surveys are up!</p>
- </div>
- <div id="notif_not_supported_div" style="display: none;">
- <h1 class="mb2">This browser does not support our services!</h1>
- <p class="mb2">Please update your browser or use another (latest versions of Chrome and Firefox are recommended)</p>
- </div>
- <!--<span>
- <a href="https://www.apple.com/ios/app-store/" class="link"><img class="download" src="/pwa/img/ios.png" alt="Download on the App Store"></a>
- </span>
- <span>
- <a href="https://play.google.com/store" class="link"><img class="download" src="/pwa/img/googleplay.png" alt="Download on Google Play"></a>
- </span>-->
- </div>
- </header>
-
- <main>
- <!-- Feature list -->
- <div class="container pt3 mt2 text--gray align--center">
- <p class="mb3">Efficient data gathering.</p>
- <div class="grid-row">
- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/messaging.svg" alt="Fast messaging">
- <p>Fast messaging</p>
- </div>
- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/assign.svg" alt="Assign to others">
- <p>Assign to others</p>
- </div>
- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/connected.svg" alt="Stay connected">
- <p>Stay connected</p>
- </div>
- <!-- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="img/search.svg" alt="Powerful search">
- <p>Powerful search</p>
- </div>
- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="img/vault.svg" alt="Put in a vault">
- <p>Put in a vault</p>
- </div>-->
- <!-- <div class="grid-column span-one-third mb3">
- <img class="illustration--small mb1" src="img/mail.svg" alt="Share with others">
- <p>Share with others</p>
- </div>-->
- </div>
- </div>
-
- <!-- Focus -->
- <div class="container--lg pt1 pb1">
-
- <div class="grid-row grid-row--center">
- <div class="grid-column mt3 mb2 order-2">
- <div class="border--bottom pb2 mb2">
- <h2>Usage data</h2>
- <p>Quis istud possit, inquit, negare? Videamus animi partes, quarum est conspectus illustrior; Illa sunt similia: hebes acies est cuipiam oculorum, corpore alius senescit; Non enim, si omnia non&nbsp;sequebatur.</p>
- </div>
- <p class="italic text--gray mb1">Quae quo sunt excelsiores, eo dant clariora indicia naturae. Causa autem fuit huc veniendi ut quosdam&nbsp;hinc.</p>
- <p class="bold">Carry Andersen, COO at&nbsp;Stripe</p>
- </div>
- <div class="grid-column span-1"></div>
- <div class="grid-column mt3 mb2 order-1">
- <img src="admin/survey/modules/mod_WPN/frontend/img/data.svg" alt="Usage data">
- </div>
- </div>
-
- <div class="grid-row grid-row--center">
- <div class="grid-column mt3 mb2">
- <img src="admin/survey/modules/mod_WPN/frontend/img/security.svg" alt="Absolute security">
- </div>
- <div class="grid-column span-1"></div>
- <div class="grid-column mt3 mb2">
- <div class="border--bottom pb2 mb2">
- <h2>Absolute security</h2>
- <p>Itaque his sapiens semper vacabit. Qualis ista philosophia est, quae non interitum afferat pravitatis, sed sit contenta mediocritate vitiorum? Quid de Platone aut de Democrito loquar? Quis istud possit, inquit&nbsp;negare?</p>
- </div>
- <p class="italic text--gray mb1">Estne, quaeso, inquam, sitienti in bibendo voluptas? Duo Reges: constructio&nbsp;interrete.</p>
- <p class="bold">Josh Blenton, Product Manager at&nbsp;Blinkist</p>
- </div>
- </div>
-
- </div>
-
- <!-- Mentioned -->
- <!--<div class="container--lg pt3 pb3 mb2 align--center">
- <p class="mb2">Mentioned in</p>
- <span><img class="mentioned" src="img/mentioned.svg" alt="New York Times, TC, Product Hunt, Recode"></span>
- </div>-->
-
- <!-- CTA -->
- <!--<div class="bg--dark-gray align--center pt3 pb3">
- <div class="container pt2 pb2">
- <img class="cta-image mb2" src="img/text.svg" alt="Text the app">
- <p class="h3 text--white mb1 bold">We'll text you the&nbsp;app</p>
- <p class="text--white mb3">Just insert your number below. Messaging rates&nbsp;apply.</p>
- <div class="inline-block mr1 no-mr-on-mobile" style="width:280px;max-width:100%">
- <input class="form-control" type="tel" placeholder="Phone number">
- </div>
- <button class="btn btn--secondary">Send</button>
- </div>
- </div>-->
-
- </main>
-
- <!-- Footer -->
- <footer class="pt1 pb3 align--center-on-mobile">
- <!--<div class="container">
- <div class="grid-row">
- <div class="grid-column mt2 span-half">
- <div class="mb1">
- <span>
- <a href="https://www.apple.com/ios/app-store/" class="link"><img class="download" src="img/ios.png" alt="Download on the App Store"></a>
- </span>
- <span>
- <a href="https://play.google.com/store" class="link"><img class="download" src="img/googleplay.png" alt="Download on Google Play"></a>
- </span>
- </div>
- <p class="small">Design by <a href="https://www.eatapapaya.com" class="link link--text">Papaya</a>. Illustrations from&nbsp;<a href="https://undraw.co/" class="link link--text">Undraw</a>.</p>
- </div>
- <div class="grid-column mt2 span-half align--right align--center-on-mobile">
- <ul class="no-bullets list--inline">
- <li class="mr1"><a href="" class="link"><img class="icon" src="img/youtube.svg" alt="YouTube"></a></li>
- <li class="mr1"><a href="" class="link"><img class="icon" src="img/twitter.svg" alt="Twitter"></a></li>
- <li><a href="" class="link"><img class="icon" src="img/facebook.svg" alt="Facebook"></a></li>
- </ul>
- </div>
- </div>
- </div>-->
- </footer>
-
- <script src="admin/survey/modules/mod_WPN/frontend/js/main.js"></script>
- </body>
-</html>
-
+<!doctype html>
+<html lang="en-us">
+
+ <head>
+
+ <!-- Meta -->
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <title>1KA WPN</title>
+ <meta name="description" content="">
+
+ <!-- The compiled CSS file -->
+ <link rel="stylesheet" href="admin/survey/modules/mod_WPN/frontend/css/production.css">
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
+
+ <!-- Web fonts -->
+ <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700|Source+Serif+Pro:700" rel="stylesheet">
+
+ <!-- favicon.ico. Place these in the root directory. -->
+ <link rel="shortcut icon" href="favicon.ico">
+
+ <link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
+ <link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
+ <link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
+ <link rel="manifest" href="manifest.json">
+ <link rel="mask-icon" href="safari-pinned-tab.svg" color="#ffffff">
+ <meta name="msapplication-TileColor" content="#da532c">
+ <meta name="theme-color" content="#ffffff">
+ <meta name="apple-moblile-web-app-capable" content="yes">
+ <meta name="apple-moblile-web-app-status-bar-style" content="default">
+ <link rel="apple-touch-startup-image" href="apple-touch-icon.png">
+ <!-- iOS Splash Screen Images -->
+ <link rel="apple-touch-startup-image" href="apple-splash-640.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-750.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1242.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1125.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1536.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1668.png" media="(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-2048.png" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+
+ </head>
+
+ <body>
+
+
+ <!-- Header -->
+ <header class="align--center pt3">
+ <div class="container--lg border--bottom pb3">
+ <img class="logo mb3" src="admin/survey/modules/mod_WPN/frontend/img/1ka_logo_en.png" alt="1KA">
+ <div id="notif_join_div" style="display: none;">
+ <button class="mb2 btn btn--secondary" id="notif_join_button" onclick="clickButtonSubscribe();" style="font-size: 1.5em;">Join us!</button>
+ <br><br>
+ <div id="notification_permission_warning" style="display: none;">
+ <h3 class="mb2" style="color:red">In order to use our services, you have to enable notifications</h3>
+ <br><br>
+ </div>
+ <h1 class="mb2">Be first to know when new surveys are up!</h1>
+ </div>
+ <div id="notif_joined_div" style="display: none;">
+ <h1 class="mb2">You are in!</h1>
+ <p class="mb2">You will be among first who will get notifications when new surveys are up!</p>
+ </div>
+ <div id="notif_not_supported_div" style="display: none;">
+ <h1 class="mb2">This browser does not support our services!</h1>
+ <p class="mb2">Please update your browser or use another (latest versions of Chrome and Firefox are recommended)</p>
+ </div>
+ <!--<span>
+ <a href="https://www.apple.com/ios/app-store/" class="link"><img class="download" src="/pwa/img/ios.png" alt="Download on the App Store"></a>
+ </span>
+ <span>
+ <a href="https://play.google.com/store" class="link"><img class="download" src="/pwa/img/googleplay.png" alt="Download on Google Play"></a>
+ </span>-->
+ </div>
+ </header>
+
+ <main>
+ <!-- Feature list -->
+ <div class="container pt3 mt2 text--gray align--center">
+ <p class="mb3">Efficient data gathering.</p>
+ <div class="grid-row">
+ <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/messaging.svg" alt="Fast messaging">
+ <p>Fast messaging</p>
+ </div>
+ <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/assign.svg" alt="Assign to others">
+ <p>Assign to others</p>
+ </div>
+ <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="admin/survey/modules/mod_WPN/frontend/img/connected.svg" alt="Stay connected">
+ <p>Stay connected</p>
+ </div>
+ <!-- <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="img/search.svg" alt="Powerful search">
+ <p>Powerful search</p>
+ </div>
+ <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="img/vault.svg" alt="Put in a vault">
+ <p>Put in a vault</p>
+ </div>-->
+ <!-- <div class="grid-column span-one-third mb3">
+ <img class="illustration--small mb1" src="img/mail.svg" alt="Share with others">
+ <p>Share with others</p>
+ </div>-->
+ </div>
+ </div>
+
+ <!-- Focus -->
+ <div class="container--lg pt1 pb1">
+
+ <div class="grid-row grid-row--center">
+ <div class="grid-column mt3 mb2 order-2">
+ <div class="border--bottom pb2 mb2">
+ <h2>Usage data</h2>
+ <p>Quis istud possit, inquit, negare? Videamus animi partes, quarum est conspectus illustrior; Illa sunt similia: hebes acies est cuipiam oculorum, corpore alius senescit; Non enim, si omnia non&nbsp;sequebatur.</p>
+ </div>
+ <p class="italic text--gray mb1">Quae quo sunt excelsiores, eo dant clariora indicia naturae. Causa autem fuit huc veniendi ut quosdam&nbsp;hinc.</p>
+ <p class="bold">Carry Andersen, COO at&nbsp;Stripe</p>
+ </div>
+ <div class="grid-column span-1"></div>
+ <div class="grid-column mt3 mb2 order-1">
+ <img src="admin/survey/modules/mod_WPN/frontend/img/data.svg" alt="Usage data">
+ </div>
+ </div>
+
+ <div class="grid-row grid-row--center">
+ <div class="grid-column mt3 mb2">
+ <img src="admin/survey/modules/mod_WPN/frontend/img/security.svg" alt="Absolute security">
+ </div>
+ <div class="grid-column span-1"></div>
+ <div class="grid-column mt3 mb2">
+ <div class="border--bottom pb2 mb2">
+ <h2>Absolute security</h2>
+ <p>Itaque his sapiens semper vacabit. Qualis ista philosophia est, quae non interitum afferat pravitatis, sed sit contenta mediocritate vitiorum? Quid de Platone aut de Democrito loquar? Quis istud possit, inquit&nbsp;negare?</p>
+ </div>
+ <p class="italic text--gray mb1">Estne, quaeso, inquam, sitienti in bibendo voluptas? Duo Reges: constructio&nbsp;interrete.</p>
+ <p class="bold">Josh Blenton, Product Manager at&nbsp;Blinkist</p>
+ </div>
+ </div>
+
+ </div>
+
+ <!-- Mentioned -->
+ <!--<div class="container--lg pt3 pb3 mb2 align--center">
+ <p class="mb2">Mentioned in</p>
+ <span><img class="mentioned" src="img/mentioned.svg" alt="New York Times, TC, Product Hunt, Recode"></span>
+ </div>-->
+
+ <!-- CTA -->
+ <!--<div class="bg--dark-gray align--center pt3 pb3">
+ <div class="container pt2 pb2">
+ <img class="cta-image mb2" src="img/text.svg" alt="Text the app">
+ <p class="h3 text--white mb1 bold">We'll text you the&nbsp;app</p>
+ <p class="text--white mb3">Just insert your number below. Messaging rates&nbsp;apply.</p>
+ <div class="inline-block mr1 no-mr-on-mobile" style="width:280px;max-width:100%">
+ <input class="form-control" type="tel" placeholder="Phone number">
+ </div>
+ <button class="btn btn--secondary">Send</button>
+ </div>
+ </div>-->
+
+ </main>
+
+ <!-- Footer -->
+ <footer class="pt1 pb3 align--center-on-mobile">
+ <!--<div class="container">
+ <div class="grid-row">
+ <div class="grid-column mt2 span-half">
+ <div class="mb1">
+ <span>
+ <a href="https://www.apple.com/ios/app-store/" class="link"><img class="download" src="img/ios.png" alt="Download on the App Store"></a>
+ </span>
+ <span>
+ <a href="https://play.google.com/store" class="link"><img class="download" src="img/googleplay.png" alt="Download on Google Play"></a>
+ </span>
+ </div>
+ <p class="small">Design by <a href="https://www.eatapapaya.com" class="link link--text">Papaya</a>. Illustrations from&nbsp;<a href="https://undraw.co/" class="link link--text">Undraw</a>.</p>
+ </div>
+ <div class="grid-column mt2 span-half align--right align--center-on-mobile">
+ <ul class="no-bullets list--inline">
+ <li class="mr1"><a href="" class="link"><img class="icon" src="img/youtube.svg" alt="YouTube"></a></li>
+ <li class="mr1"><a href="" class="link"><img class="icon" src="img/twitter.svg" alt="Twitter"></a></li>
+ <li><a href="" class="link"><img class="icon" src="img/facebook.svg" alt="Facebook"></a></li>
+ </ul>
+ </div>
+ </div>
+ </div>-->
+ </footer>
+
+ <script src="admin/survey/modules/mod_WPN/frontend/js/main.js"></script>
+ </body>
+</html>
+
diff --git a/admin/survey/modules/mod_WPN/frontend/index1.html b/admin/survey/modules/mod_WPN/frontend/index1.html
index eca291f..629bf8f 100644
--- a/admin/survey/modules/mod_WPN/frontend/index1.html
+++ b/admin/survey/modules/mod_WPN/frontend/index1.html
@@ -1,360 +1,360 @@
-<!doctype html>
-<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
-<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
-<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
-<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <title>NCC Computer Science</title>
- <meta name="description" content="NCC Computer Science Progressive Web App">
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <link rel="stylesheet" href="css/normalize.min.css">
- <link rel="stylesheet" href="css/main.css">
- <script src="js/main.js"></script>
-
- <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
- <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
- <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
- <link rel="manifest" href="/manifest.json">
- <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
- <meta name="msapplication-TileColor" content="#da532c">
- <meta name="theme-color" content="#ffffff">
- <meta name="apple-moblile-web-app-capable" content="yes">
- <meta name="apple-moblile-web-app-status-bar-style" content="default">
- <link rel="apple-touch-startup-image" href="/apple-touch-icon.png">
- <!-- iOS Splash Screen Images -->
- <link rel="apple-touch-startup-image" href="apple-splash-640.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-750.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1242.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1125.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1536.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-1668.png" media="(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
- <link rel="apple-touch-startup-image" href="apple-splash-2048.png" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
-
- </head>
- <body>
- <!--[if lt IE 8]>
- <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
- <![endif]-->
- <div class="header-container">
- <header class="wrapper clearfix">
- <span id="trigger" onClick="toggleNav()">
- <span class="triggerLine"></span>
- <span class="triggerLine"></span>
- <span class="triggerLine"></span>
- </span>
- <h1 class="title">Computer Science</h1>
- <nav>
- <ul>
- <li><a href="#faculty" onclick="toggleNav()">Faculty</a></li>
- <li><a href="#programs" onclick="toggleNav()">Programs</a></li>
- <li><a href="#courses" onclick="toggleNav()">Courses</a></li>
- </ul>
- </nav>
- </header>
- </div>
-
- <div class="main-container">
- <div class="main wrapper clearfix">
- <section id="addToHomeScreen">
- <h1>Install App</h1>
- <img src="/pwa/android-chrome-192x192.png" alt="NCC CS" />
- Add our app to your home screen?<br />
- <a href="javascript:void(0)" onClick="hidePrompt()" style="text-decoration:none;">No, Thanks</a>
- <button onClick="installApp()">Yes, Please!</button>
- </section>
- <article id="top">
- <header>
- <h1>Welcome!</h1>
- <p class="subtitle">
- You've come to the right place!
- </p>
- <p>
- It’s an exciting – and lucrative – time to be a
- Computer Science major. At NCC, you’ll be grounded
- in Computer Science fundamentals and exposed to
- today’s employable technologies. Want to build
- Mobile Apps? Want to create state of the art web
- pages? Want to learn advanced topics? No worries
- – we’ve got you covered.
- </p>
- <p>
- Whether you are a transfer student looking to start
- an advanced degree or a programmer learning a new
- language or just looking to add skills to your tool
- set, NCC’s Computer Science Department has Courses
- and Programs to meet your needs.
- </p>
-
- </header>
- <section id="faculty">
- <h2>Faculty</h2>
- <p>
- NCC's Computer Science faculty possess an abundance
- of real world experience coupled with twenty-first century
- teaching abilities. The result is classes that ground
- students in theory while teaching them how to implement
- the technologies needed to thrive in today's economy.
- </p>
- <div class="facultyContainer">
- <h4>
- Professor Tom Duffy, Department Chair
- </h4>
- <div class="facultyImage">
- <p>
- <img class="responsiveImg" src="img/duffy.jpg" alt="Tom Duffy" />
- </p>
- <p>
- <a href="tel:2038576892">(203) 857-6892</a>
- </p>
- <p>
- <a href="mailto:tduffy@norwalk.edu">tduffy@norwalk.edu</a>
- </p>
- </div>
- <p>
-
- Professor Tom Duffy is the Chair of the Computer
- Science Department and the Program Coordinator
- for the Computer Science degree as well as the Web
- Developer, Relational Database, and Smartphone App
- Development certificates. He teaches courses in Web
- Development, XML, Java, and Mobile Device Programming.
- </p>
- <p>
- Tom holds a Bachelor of Science degree in Mathematics
- and Master of Arts degree in Mathematics/Computer Science
- from Western Connecticut State University. He is the
- owner of Bright Moments Software – a software company
- specializing in Web Technologies.
- </p>
- <p>
- Tom has recently published <a href="http://www.bright-moments.com/pmd" target="_blank" rel="noopener">Programming With Mobile Applications</a>, his second book. The book is available from Cengage Learning.
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
-
- </div>
- <div class="facultyContainer">
- <h4>
- Professor Patrick Cassidy
- </h4>
- <div class="facultyImage">
- <p>
- <img class="responsiveImg" src="img/cassidy.jpg" alt="Patrick Cassidy" />
- </p>
- <p>
- <a href="tel:2038577336">(203) 857-7336</a>
- </p>
- <p>
- <a href="mailto:pcassidy@norwalk.edu">pcassidy@norwalk.edu</a>
- </p>
- </div>
- <p>
- Professor Cassidy is the Coordinator for the Computer
- Security degree and Networking Certificate programs.
- He is also the Main Contact for NCC’s Cisco Academy.
- </p>
- <p>
- Before coming to NCC, Prof. Cassidy was a Project
- Associate for the University of Michigan working out
- of the General Motors Plant in Tarrytown, NY. He has
- also taught at Westchester Community College in both
- the Mathematics and Computer Science departments.
- </p>
- <p>
- He holds a M.S. in Computer Science from Polytechnic
- University, a B.S. in Aeronautical Science from
- Embry Riddle Aeronautical University, and an A.S.
- in Mathematics and Science from Westchester Community
- College. Prof. Cassidy is a Cisco Certified Network
- Associate (CCNA) and Cisco Certified Academy Instructor
- (CCAI). He also holds multiple ratings from the
- FAA as well as being a Certified Flight
- Instructor – Instrument (CFII).
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
- </div>
- <div class="facultyContainer">
- <h4>
- Professor Kerry Cramer
- </h4>
- <div class="facultyImage">
- <p>
- <img class="responsiveImg" src="img/cramer.jpg" alt="Kerry Cramer" />
- </p>
- <p>
- <a href="tel:2038573332">(203) 857-3332</a>
- </p>
- <p>
- <a href="mailto:kcramer@norwalk.edu">kcramer@norwalk.edu</a>
- </p>
- </div>
- <p>
- Professor Kerry V. Cramer is an information technology
- professional with 30 years experience in computer
- programming, information technologies, and IT project
- management. Mr. Cramer has been an adjunct professor at
- Manhattanville College, and University of New Haven
- teaching several courses in the Computer Science
- curriculum as well as substitute teaching K-12 at
- schools in the Danbury, CT area.
- </p>
- <p>Professor Cramer’s strengths
- include strong project management disciplines,
- technical, supervisory and team management skills in
- Internet, Lotus Notes, and legacy application development
- and maintenance environments as well as extensive college
- and professional recruiting experience.
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
- </div>
- <div class="facultyContainer">
- <h4>
- Professor Charles Gabor
- </h4>
- <div class="facultyImage">
- <p>
- <img class="responsiveImg" src="img/gabor.jpg" alt="Charles Gabor" />
- </p>
- <p>
- <a href="tel:2038577315">(203) 857-7315</a>
- </p>
- <p>
- <a href="mailto:cgabor@norwalk.edu">cgabor@norwalk.edu</a>
- </p>
- </div>
- <p>
- Professor Gabor teaches Database Development and Java courses.
- Before joining the NCC faculty he was a Lieutenant/Senior
- Military Instructor at the United States Naval Academy.
- Prior to that he was a Software Engineer at Pitney Bowes Inc.
- </p>
- <p>
- Professor Gabor holds a graduate certificate in Computer
- Science from Purdue University, a M.S. degree from
- the University of New Haven and a B.S degree in
- Applied Science from Charter Oak State College.
- He is a member of the Honor Society in Computer Science,
- Upsilon Pi Epsilon and a retired Commander in the U.S. Navy.
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
- </div>
-
- </section>
- <section id="programs">
- <h2>Programs</h2>
- <p>
- Our programs serve both traditional first-time students
- as well as professionals currently working in the field.
- The curriculum is flexible enough to meet the needs of
- students who wish to transfer to a baccalaureate
- institution and students preparing for immediate
- entry into the workplace.
- </p>
- <p class="subtitle">
- Degree Programs
- </p>
- <p>
- <a href="https://norwalk.edu/academics/cs/computer-science-program-a-s/" target="_blank" rel="noopener">AS Computer Science</a>
- </p>
- <p>
- <a href="https://norwalk.edu/academics/cs/computer-security-program-a-s/" target="_blank" rel="noopener">AS Computer Security</a>
- </p>
- <p class="subtitle">
- Certificate Programs
- </p>
- <p>
- <a href="https://norwalk.edu/academics/cs/relational-database-development-certificate-program/" target="_blank" rel="noopener">Relational Database Development</a>
- </p>
- <p>
- <a href="https://norwalk.edu/academics/cs/smartphone-app-development-certificate-program/" target="_blank" rel="noopener">Smartphone App Development</a>
- </p>
- <p>
- <a href="https://norwalk.edu/academics/cs/web-developer-certificate-program/" target="_blank" rel="noopener">Web Developer</a>
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
- </section>
- <section id="courses">
- <h2>Courses</h2>
- <p>
- Computer Science courses at NCC not only prepare students to
- transfer into a baccalaureate institution. They also serve
- those students who wish to enter the workforce directly.
- All our courses expose students to the course's underlying CS
- theory as well as teach students how to implement those
- theories. The result is students who are prepared for
- whatever they choose to do next.
- </p>
- <p>
- <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CSC&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Science (CSC)</a>
- </p>
- <p>
- <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CST&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Technology (CST)</a>
- </p>
- <p>
- <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CSA&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Applications (CSA)</a>
- </p>
- <p>
- <a href="#top">Back To Top</a>
- </p>
- </section>
- </article>
-
- <aside id="info">
- <h3>&lt;metadata></h3>
- <h4>
- &nbsp;&nbsp;<a href="https://insights.stackoverflow.com/survey/2018/#technology" target="_blank" rel="noopener">Most popular lang</a>
- </h4>
- <h4>
- &nbsp;&nbsp;<a href="https://www.indeed.com/jobtrends/techsoftware-category-trends" target="_blank" rel="noopener">Job Trends</a>
- </h4>
- <h4>
- &nbsp;&nbsp;<a href="https://www.naceweb.org/job-market/compensation/the-top-paid-majors-for-the-class-of-2018/" target="_blank" rel="noopener">Top Paid Majors</a>
- </h4>
- <h4>
- &nbsp;&nbsp;<a href="https://youtu.be/nKIu9yen5nc" target="_blank" rel="noopener">Get Coding!</a>
- </h4>
- <h3>&lt;/metadata></h3>
- </aside>
-
- </div>
- </div>
-
- <div class="footer-container">
- <footer class="wrapper">
- <p class="footerLinks">
- <a href="#top">Top</a><br/>
- <a href="#faculty">Faculty</a><br/>
- <a href="#programs">Programs</a><br/>
- <a href="#courses">Courses</a>
- </p>
- <p>
- &copy; 2017 Norwalk Community College <br/>188 Richards Avenue <br/>Norwalk, CT 06854 <br/>203-857-7000
- </p>
- </footer>
- </div>
- <div id="instructions">
- <button onClick="hideInstructions()">X</button>
- <p>
- <img src="apple-touch-icon.png" alt="icon" />
- </p>
- <p>
- Install our app on your Home Screen for Quick Access
- </p>
- <p>
- Tap <img src="img/share.png" alt="share" /> then <img src="img/aths.png" alt="Add To Home Screen" />
- </p>
- </div>
- </body>
-</html>
+<!doctype html>
+<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
+<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
+<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
+ <head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+ <title>NCC Computer Science</title>
+ <meta name="description" content="NCC Computer Science Progressive Web App">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+ <link rel="stylesheet" href="css/normalize.min.css">
+ <link rel="stylesheet" href="css/main.css">
+ <script src="js/main.js"></script>
+
+ <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
+ <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
+ <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
+ <link rel="manifest" href="/manifest.json">
+ <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
+ <meta name="msapplication-TileColor" content="#da532c">
+ <meta name="theme-color" content="#ffffff">
+ <meta name="apple-moblile-web-app-capable" content="yes">
+ <meta name="apple-moblile-web-app-status-bar-style" content="default">
+ <link rel="apple-touch-startup-image" href="/apple-touch-icon.png">
+ <!-- iOS Splash Screen Images -->
+ <link rel="apple-touch-startup-image" href="apple-splash-640.png" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-750.png" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1242.png" media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1125.png" media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1536.png" media="(min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-1668.png" media="(min-device-width: 834px) and (max-device-width: 834px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+ <link rel="apple-touch-startup-image" href="apple-splash-2048.png" media="(min-device-width: 1024px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio: 2) and (orientation: portrait)">
+
+ </head>
+ <body>
+ <!--[if lt IE 8]>
+ <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
+ <![endif]-->
+ <div class="header-container">
+ <header class="wrapper clearfix">
+ <span id="trigger" onClick="toggleNav()">
+ <span class="triggerLine"></span>
+ <span class="triggerLine"></span>
+ <span class="triggerLine"></span>
+ </span>
+ <h1 class="title">Computer Science</h1>
+ <nav>
+ <ul>
+ <li><a href="#faculty" onclick="toggleNav()">Faculty</a></li>
+ <li><a href="#programs" onclick="toggleNav()">Programs</a></li>
+ <li><a href="#courses" onclick="toggleNav()">Courses</a></li>
+ </ul>
+ </nav>
+ </header>
+ </div>
+
+ <div class="main-container">
+ <div class="main wrapper clearfix">
+ <section id="addToHomeScreen">
+ <h1>Install App</h1>
+ <img src="/pwa/android-chrome-192x192.png" alt="NCC CS" />
+ Add our app to your home screen?<br />
+ <a href="javascript:void(0)" onClick="hidePrompt()" style="text-decoration:none;">No, Thanks</a>
+ <button onClick="installApp()">Yes, Please!</button>
+ </section>
+ <article id="top">
+ <header>
+ <h1>Welcome!</h1>
+ <p class="subtitle">
+ You've come to the right place!
+ </p>
+ <p>
+ It’s an exciting – and lucrative – time to be a
+ Computer Science major. At NCC, you’ll be grounded
+ in Computer Science fundamentals and exposed to
+ today’s employable technologies. Want to build
+ Mobile Apps? Want to create state of the art web
+ pages? Want to learn advanced topics? No worries
+ – we’ve got you covered.
+ </p>
+ <p>
+ Whether you are a transfer student looking to start
+ an advanced degree or a programmer learning a new
+ language or just looking to add skills to your tool
+ set, NCC’s Computer Science Department has Courses
+ and Programs to meet your needs.
+ </p>
+
+ </header>
+ <section id="faculty">
+ <h2>Faculty</h2>
+ <p>
+ NCC's Computer Science faculty possess an abundance
+ of real world experience coupled with twenty-first century
+ teaching abilities. The result is classes that ground
+ students in theory while teaching them how to implement
+ the technologies needed to thrive in today's economy.
+ </p>
+ <div class="facultyContainer">
+ <h4>
+ Professor Tom Duffy, Department Chair
+ </h4>
+ <div class="facultyImage">
+ <p>
+ <img class="responsiveImg" src="img/duffy.jpg" alt="Tom Duffy" />
+ </p>
+ <p>
+ <a href="tel:2038576892">(203) 857-6892</a>
+ </p>
+ <p>
+ <a href="mailto:tduffy@norwalk.edu">tduffy@norwalk.edu</a>
+ </p>
+ </div>
+ <p>
+
+ Professor Tom Duffy is the Chair of the Computer
+ Science Department and the Program Coordinator
+ for the Computer Science degree as well as the Web
+ Developer, Relational Database, and Smartphone App
+ Development certificates. He teaches courses in Web
+ Development, XML, Java, and Mobile Device Programming.
+ </p>
+ <p>
+ Tom holds a Bachelor of Science degree in Mathematics
+ and Master of Arts degree in Mathematics/Computer Science
+ from Western Connecticut State University. He is the
+ owner of Bright Moments Software – a software company
+ specializing in Web Technologies.
+ </p>
+ <p>
+ Tom has recently published <a href="http://www.bright-moments.com/pmd" target="_blank" rel="noopener">Programming With Mobile Applications</a>, his second book. The book is available from Cengage Learning.
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+
+ </div>
+ <div class="facultyContainer">
+ <h4>
+ Professor Patrick Cassidy
+ </h4>
+ <div class="facultyImage">
+ <p>
+ <img class="responsiveImg" src="img/cassidy.jpg" alt="Patrick Cassidy" />
+ </p>
+ <p>
+ <a href="tel:2038577336">(203) 857-7336</a>
+ </p>
+ <p>
+ <a href="mailto:pcassidy@norwalk.edu">pcassidy@norwalk.edu</a>
+ </p>
+ </div>
+ <p>
+ Professor Cassidy is the Coordinator for the Computer
+ Security degree and Networking Certificate programs.
+ He is also the Main Contact for NCC’s Cisco Academy.
+ </p>
+ <p>
+ Before coming to NCC, Prof. Cassidy was a Project
+ Associate for the University of Michigan working out
+ of the General Motors Plant in Tarrytown, NY. He has
+ also taught at Westchester Community College in both
+ the Mathematics and Computer Science departments.
+ </p>
+ <p>
+ He holds a M.S. in Computer Science from Polytechnic
+ University, a B.S. in Aeronautical Science from
+ Embry Riddle Aeronautical University, and an A.S.
+ in Mathematics and Science from Westchester Community
+ College. Prof. Cassidy is a Cisco Certified Network
+ Associate (CCNA) and Cisco Certified Academy Instructor
+ (CCAI). He also holds multiple ratings from the
+ FAA as well as being a Certified Flight
+ Instructor – Instrument (CFII).
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+ </div>
+ <div class="facultyContainer">
+ <h4>
+ Professor Kerry Cramer
+ </h4>
+ <div class="facultyImage">
+ <p>
+ <img class="responsiveImg" src="img/cramer.jpg" alt="Kerry Cramer" />
+ </p>
+ <p>
+ <a href="tel:2038573332">(203) 857-3332</a>
+ </p>
+ <p>
+ <a href="mailto:kcramer@norwalk.edu">kcramer@norwalk.edu</a>
+ </p>
+ </div>
+ <p>
+ Professor Kerry V. Cramer is an information technology
+ professional with 30 years experience in computer
+ programming, information technologies, and IT project
+ management. Mr. Cramer has been an adjunct professor at
+ Manhattanville College, and University of New Haven
+ teaching several courses in the Computer Science
+ curriculum as well as substitute teaching K-12 at
+ schools in the Danbury, CT area.
+ </p>
+ <p>Professor Cramer’s strengths
+ include strong project management disciplines,
+ technical, supervisory and team management skills in
+ Internet, Lotus Notes, and legacy application development
+ and maintenance environments as well as extensive college
+ and professional recruiting experience.
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+ </div>
+ <div class="facultyContainer">
+ <h4>
+ Professor Charles Gabor
+ </h4>
+ <div class="facultyImage">
+ <p>
+ <img class="responsiveImg" src="img/gabor.jpg" alt="Charles Gabor" />
+ </p>
+ <p>
+ <a href="tel:2038577315">(203) 857-7315</a>
+ </p>
+ <p>
+ <a href="mailto:cgabor@norwalk.edu">cgabor@norwalk.edu</a>
+ </p>
+ </div>
+ <p>
+ Professor Gabor teaches Database Development and Java courses.
+ Before joining the NCC faculty he was a Lieutenant/Senior
+ Military Instructor at the United States Naval Academy.
+ Prior to that he was a Software Engineer at Pitney Bowes Inc.
+ </p>
+ <p>
+ Professor Gabor holds a graduate certificate in Computer
+ Science from Purdue University, a M.S. degree from
+ the University of New Haven and a B.S degree in
+ Applied Science from Charter Oak State College.
+ He is a member of the Honor Society in Computer Science,
+ Upsilon Pi Epsilon and a retired Commander in the U.S. Navy.
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+ </div>
+
+ </section>
+ <section id="programs">
+ <h2>Programs</h2>
+ <p>
+ Our programs serve both traditional first-time students
+ as well as professionals currently working in the field.
+ The curriculum is flexible enough to meet the needs of
+ students who wish to transfer to a baccalaureate
+ institution and students preparing for immediate
+ entry into the workplace.
+ </p>
+ <p class="subtitle">
+ Degree Programs
+ </p>
+ <p>
+ <a href="https://norwalk.edu/academics/cs/computer-science-program-a-s/" target="_blank" rel="noopener">AS Computer Science</a>
+ </p>
+ <p>
+ <a href="https://norwalk.edu/academics/cs/computer-security-program-a-s/" target="_blank" rel="noopener">AS Computer Security</a>
+ </p>
+ <p class="subtitle">
+ Certificate Programs
+ </p>
+ <p>
+ <a href="https://norwalk.edu/academics/cs/relational-database-development-certificate-program/" target="_blank" rel="noopener">Relational Database Development</a>
+ </p>
+ <p>
+ <a href="https://norwalk.edu/academics/cs/smartphone-app-development-certificate-program/" target="_blank" rel="noopener">Smartphone App Development</a>
+ </p>
+ <p>
+ <a href="https://norwalk.edu/academics/cs/web-developer-certificate-program/" target="_blank" rel="noopener">Web Developer</a>
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+ </section>
+ <section id="courses">
+ <h2>Courses</h2>
+ <p>
+ Computer Science courses at NCC not only prepare students to
+ transfer into a baccalaureate institution. They also serve
+ those students who wish to enter the workforce directly.
+ All our courses expose students to the course's underlying CS
+ theory as well as teach students how to implement those
+ theories. The result is students who are prepared for
+ whatever they choose to do next.
+ </p>
+ <p>
+ <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CSC&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Science (CSC)</a>
+ </p>
+ <p>
+ <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CST&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Technology (CST)</a>
+ </p>
+ <p>
+ <a href="http://catalog.norwalk.edu/content.php?filter%5B27%5D=CSA&filter%5B29%5D=&filter%5Bcourse_type%5D=-1&filter%5Bkeyword%5D=&filter%5B32%5D=1&filter%5Bcpage%5D=1&cur_cat_oid=3&expand=&navoid=136&search_database=Filter#acalog_template_course_filter" target="_blank" rel="noopener">Computer Applications (CSA)</a>
+ </p>
+ <p>
+ <a href="#top">Back To Top</a>
+ </p>
+ </section>
+ </article>
+
+ <aside id="info">
+ <h3>&lt;metadata></h3>
+ <h4>
+ &nbsp;&nbsp;<a href="https://insights.stackoverflow.com/survey/2018/#technology" target="_blank" rel="noopener">Most popular lang</a>
+ </h4>
+ <h4>
+ &nbsp;&nbsp;<a href="https://www.indeed.com/jobtrends/techsoftware-category-trends" target="_blank" rel="noopener">Job Trends</a>
+ </h4>
+ <h4>
+ &nbsp;&nbsp;<a href="https://www.naceweb.org/job-market/compensation/the-top-paid-majors-for-the-class-of-2018/" target="_blank" rel="noopener">Top Paid Majors</a>
+ </h4>
+ <h4>
+ &nbsp;&nbsp;<a href="https://youtu.be/nKIu9yen5nc" target="_blank" rel="noopener">Get Coding!</a>
+ </h4>
+ <h3>&lt;/metadata></h3>
+ </aside>
+
+ </div>
+ </div>
+
+ <div class="footer-container">
+ <footer class="wrapper">
+ <p class="footerLinks">
+ <a href="#top">Top</a><br/>
+ <a href="#faculty">Faculty</a><br/>
+ <a href="#programs">Programs</a><br/>
+ <a href="#courses">Courses</a>
+ </p>
+ <p>
+ &copy; 2017 Norwalk Community College <br/>188 Richards Avenue <br/>Norwalk, CT 06854 <br/>203-857-7000
+ </p>
+ </footer>
+ </div>
+ <div id="instructions">
+ <button onClick="hideInstructions()">X</button>
+ <p>
+ <img src="apple-touch-icon.png" alt="icon" />
+ </p>
+ <p>
+ Install our app on your Home Screen for Quick Access
+ </p>
+ <p>
+ Tap <img src="img/share.png" alt="share" /> then <img src="img/aths.png" alt="Add To Home Screen" />
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/admin/survey/modules/mod_WPN/frontend/ui.html b/admin/survey/modules/mod_WPN/frontend/ui.html
index dc088f5..9dca28b 100644
--- a/admin/survey/modules/mod_WPN/frontend/ui.html
+++ b/admin/survey/modules/mod_WPN/frontend/ui.html
@@ -1,104 +1,104 @@
-<!doctype html>
-<html lang="en-us">
-
- <head>
-
- <!-- Meta -->
- <meta charset="utf-8">
- <meta http-equiv="x-ua-compatible" content="ie=edge">
- <meta name="viewport" content="width=device-width,initial-scale=1">
-
- <title>Carta</title>
- <meta name="description" content="">
-
- <!-- The compiled CSS file -->
- <link rel="stylesheet" href="css/production.css">
-
- <!-- Web fonts -->
- <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700|Source+Serif+Pro:700" rel="stylesheet">
-
- <!-- favicon.ico. Place these in the root directory. -->
- <link rel="shortcut icon" href="favicon.ico">
-
- </head>
-
- <body>
-
-
- <div class="container pt3 pb3">
-
- <!-- Colors -->
- <section class="pb4 align--center">
- <h2 class="text--gray pb1 border--bottom">Colors</h2>
- <div class="pt1 pb1 text--white bg--primary-color">Primary brand color</div>
- <div class="pt1 pb1 text--white bg--secondary-color">Secondary brand color</div>
- <div class="pt1 pb1 text--white bg--tertiary-color">Brand accent color</div>
- <div class="pt1 pb1 text--white bg--darkest-gray">Darkest gray</div>
- <div class="pt1 pb1 text--white bg--dark-gray">Dark gray</div>
- <div class="pt1 pb1 text--white bg--gray">Gray</div>
- <div class="pt1 pb1 text--white bg--light-gray">Light gray</div>
- <div class="pt1 pb1 bg--lightest-gray">Lightest gray</div>
- </section>
-
- <!-- Type -->
- <section class="pb4 reading-font">
- <h2 class="text--gray pb1 border--bottom">Type</h2>
- <h1>A new take on health care for small businesses.</h1>
- <h2>Heading 2</h2>
- <h3>Heading 3</h3>
- <h4>Heading 4</h4>
- <h5>Heading 5</h5>
- <h6>Heading 6</h6>
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, semper suscipit, posuere a, pede.</p>
- <p>Sed adipiscing ornare risus. Morbi est est, blandit sit amet, sagittis vel, euismod vel, velit. Pellentesque egestas sem. Suspendisse commodo ullamcorper magna. Ut aliquam sollicitudin leo.</p>
- <blockquote class="blockquote">This is a blockquote. Suspendisse commodo ullamcorper magna.</blockquote>
- <p>Lorem <sup>superscript</sup> dolor <sub>subscript</sub> amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. <cite>cite</cite>. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Morbi imperdiet augue quis tellus. Suspendisse quam sem, <abbr title="Avenue">AVE</abbr> consequat at, commodo vitae, feugiat in nunc.</p>
- <p>Morbi in sem quis dui <a class="link" href="#">placerat ornare</a>. Pellentesque odio nisi, euismod in <a class="link" href="#">pharetra</a> a, ultricies in, diam. Sed arcu. Cras consequat.</p>
- <ul class="list--indented">
- <li>Aliquam tincidunt mauris eu risus.</li>
- <li>Vestibulum auctor dapibus neque.</li>
- <li>Nunc dignissim risus id metus.</li>
- <li>Vivamus vestibulum nulla nec ante.</li>
- </ul>
- <p>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</p>
- <ol class="list--indented m0">
- <li>Integer vitae libero ac risus egestas placerat.</li>
- <li>Praesent placerat risus quis eros.</li>
- <li>Ut aliquam sollicitudin leo.</li>
- <li>Donec quis dui at dolor tempor interdum.</li>
- </ol>
- </section>
-
- <!-- Forms -->
- <section class="pb4">
- <h2 class="text--gray pb1 border--bottom">Forms</h2>
- <form class="form">
- <input class="form-control mb1" placeholder="Name">
- <input class="form-control mb1" type="email" placeholder="Email Address">
- <input class="form-control mb1" type="subject" placeholder="Subject">
- <div class="select mb1">
- <select>
- <option selected="selected">Open this select</option>
- <option>One</option>
- <option>Two</option>
- <option>Three</option>
- </select>
- </div>
- <textarea class="form-control mb1" placeholder="Message"></textarea>
- <button class="btn btn--default">Default</button>
- </form>
- </section>
-
- <!-- Buttons -->
- <section class="pb4">
- <h2 class="text--gray pb1 border--bottom">Buttons</h2>
- <a class="btn btn--default" href="">Medium Default</a>
- <a class="btn btn--outline" href="">Medium Outline</a>
- <a class="btn btn--default btn--sm" href="">Small Default</a>
- </section>
-
- </div> <!-- End container -->
-
- </body>
-</html>
-
+<!doctype html>
+<html lang="en-us">
+
+ <head>
+
+ <!-- Meta -->
+ <meta charset="utf-8">
+ <meta http-equiv="x-ua-compatible" content="ie=edge">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <title>Carta</title>
+ <meta name="description" content="">
+
+ <!-- The compiled CSS file -->
+ <link rel="stylesheet" href="css/production.css">
+
+ <!-- Web fonts -->
+ <link href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,700|Source+Serif+Pro:700" rel="stylesheet">
+
+ <!-- favicon.ico. Place these in the root directory. -->
+ <link rel="shortcut icon" href="favicon.ico">
+
+ </head>
+
+ <body>
+
+
+ <div class="container pt3 pb3">
+
+ <!-- Colors -->
+ <section class="pb4 align--center">
+ <h2 class="text--gray pb1 border--bottom">Colors</h2>
+ <div class="pt1 pb1 text--white bg--primary-color">Primary brand color</div>
+ <div class="pt1 pb1 text--white bg--secondary-color">Secondary brand color</div>
+ <div class="pt1 pb1 text--white bg--tertiary-color">Brand accent color</div>
+ <div class="pt1 pb1 text--white bg--darkest-gray">Darkest gray</div>
+ <div class="pt1 pb1 text--white bg--dark-gray">Dark gray</div>
+ <div class="pt1 pb1 text--white bg--gray">Gray</div>
+ <div class="pt1 pb1 text--white bg--light-gray">Light gray</div>
+ <div class="pt1 pb1 bg--lightest-gray">Lightest gray</div>
+ </section>
+
+ <!-- Type -->
+ <section class="pb4 reading-font">
+ <h2 class="text--gray pb1 border--bottom">Type</h2>
+ <h1>A new take on health care for small businesses.</h1>
+ <h2>Heading 2</h2>
+ <h3>Heading 3</h3>
+ <h4>Heading 4</h4>
+ <h5>Heading 5</h5>
+ <h6>Heading 6</h6>
+ <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec odio. Quisque volutpat mattis eros. Nullam malesuada erat ut turpis. Suspendisse urna nibh, semper suscipit, posuere a, pede.</p>
+ <p>Sed adipiscing ornare risus. Morbi est est, blandit sit amet, sagittis vel, euismod vel, velit. Pellentesque egestas sem. Suspendisse commodo ullamcorper magna. Ut aliquam sollicitudin leo.</p>
+ <blockquote class="blockquote">This is a blockquote. Suspendisse commodo ullamcorper magna.</blockquote>
+ <p>Lorem <sup>superscript</sup> dolor <sub>subscript</sub> amet, consectetuer adipiscing elit. Nullam dignissim convallis est. Quisque aliquam. <cite>cite</cite>. Donec sed tellus eget sapien fringilla nonummy. <acronym title="National Basketball Association">NBA</acronym> Morbi imperdiet augue quis tellus. Suspendisse quam sem, <abbr title="Avenue">AVE</abbr> consequat at, commodo vitae, feugiat in nunc.</p>
+ <p>Morbi in sem quis dui <a class="link" href="#">placerat ornare</a>. Pellentesque odio nisi, euismod in <a class="link" href="#">pharetra</a> a, ultricies in, diam. Sed arcu. Cras consequat.</p>
+ <ul class="list--indented">
+ <li>Aliquam tincidunt mauris eu risus.</li>
+ <li>Vestibulum auctor dapibus neque.</li>
+ <li>Nunc dignissim risus id metus.</li>
+ <li>Vivamus vestibulum nulla nec ante.</li>
+ </ul>
+ <p>Morbi in sem quis dui placerat ornare. Pellentesque odio nisi, euismod in, pharetra a, ultricies in, diam. Sed arcu. Cras consequat.</p>
+ <ol class="list--indented m0">
+ <li>Integer vitae libero ac risus egestas placerat.</li>
+ <li>Praesent placerat risus quis eros.</li>
+ <li>Ut aliquam sollicitudin leo.</li>
+ <li>Donec quis dui at dolor tempor interdum.</li>
+ </ol>
+ </section>
+
+ <!-- Forms -->
+ <section class="pb4">
+ <h2 class="text--gray pb1 border--bottom">Forms</h2>
+ <form class="form">
+ <input class="form-control mb1" placeholder="Name">
+ <input class="form-control mb1" type="email" placeholder="Email Address">
+ <input class="form-control mb1" type="subject" placeholder="Subject">
+ <div class="select mb1">
+ <select>
+ <option selected="selected">Open this select</option>
+ <option>One</option>
+ <option>Two</option>
+ <option>Three</option>
+ </select>
+ </div>
+ <textarea class="form-control mb1" placeholder="Message"></textarea>
+ <button class="btn btn--default">Default</button>
+ </form>
+ </section>
+
+ <!-- Buttons -->
+ <section class="pb4">
+ <h2 class="text--gray pb1 border--bottom">Buttons</h2>
+ <a class="btn btn--default" href="">Medium Default</a>
+ <a class="btn btn--outline" href="">Medium Outline</a>
+ <a class="btn btn--default btn--sm" href="">Small Default</a>
+ </section>
+
+ </div> <!-- End container -->
+
+ </body>
+</html>
+
diff --git a/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php
index 267231a..acaef1f 100644
--- a/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php
+++ b/admin/survey/modules/mod_advanced_paradata/class.SurveyAdvancedParadataLog.php
@@ -17,26 +17,18 @@ class SurveyAdvancedParadataLog {
// Privatni construct, ki ga 1x poklice getInstance
- private function __construct (/*$anketa*/) {
+ private function __construct () {
- /*ini_set('display_errors', 1);
- ini_set('display_startup_errors', 1);
- error_reporting(E_ALL);*/
-
- // Ce imamo anketo
- /*if ((int)$anketa > 0){
- $this->anketa = $anketa;
- }*/
-
- $this->anketa = (int)$_REQUEST['anketa'];
- //$this->anketa = $anketa_id;
+ if((isset($_GET['m']) && $_GET['m'] == 'quick_edit') || (isset($_GET['t']) && $_GET['t'] == 'postprocess'))
+ return false;
+
+ $anketa_hash = $_REQUEST['anketa'];
+ $this->anketa = getSurveyIdFromHash($anketa_hash);
if($this->anketa > 0){
SurveyInfo::getInstance()->SurveyInit($this->anketa);
$this->collectParadata = (SurveyInfo::getInstance()->checkSurveyModule('advanced_paradata')) ? true : false;
}
- else
- throw new Exception('Survey ID not set in class.SurveyAdvancedParadataLog.php !');
}
// Vrne instanco classa - da mamo singleton
@@ -50,6 +42,10 @@ class SurveyAdvancedParadataLog {
// Vrne ce zbiramo napredne parapodatke
public function paradataEnabled(){
+
+ if((isset($_GET['m']) && $_GET['m'] == 'quick_edit') || (isset($_GET['t']) && $_GET['t'] == 'postprocess'))
+ return false;
+
return $this->collectParadata;
}
diff --git a/admin/survey/modules/mod_advanced_timestamps/class.SurveyAdvancedTimestamps.php b/admin/survey/modules/mod_advanced_timestamps/class.SurveyAdvancedTimestamps.php
new file mode 100644
index 0000000..a6cc56c
--- /dev/null
+++ b/admin/survey/modules/mod_advanced_timestamps/class.SurveyAdvancedTimestamps.php
@@ -0,0 +1,238 @@
+<?php
+
+/*
+ * Modul za pregledovanje in urejanje nastavitev naprednih časov po straneh
+ *
+ */
+
+
+use PhpOffice\PhpSpreadsheet\Spreadsheet;
+use PhpOffice\PhpSpreadsheet\IOFactory;
+use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+
+
+class SurveyAdvancedTimestamps {
+
+ var $anketa; # id ankete
+
+
+ function __construct($anketa){
+
+ // Ce imamo anketo
+ if ((int)$anketa > 0){
+ $this->anketa = $anketa;
+ }
+ }
+
+
+ public function displaySettings(){
+ global $lang;
+
+
+ echo '<fieldset><legend>'.$lang['srv_results'].'</legend>';
+
+ $href_csv = 'izvoz.php?m=advanced_timestamps_xls&anketa='.$this->anketa;
+ echo ' <span><a href="'.$href_csv.'">Excel izvoz parapodatkov</a></span>';
+
+ echo '</fieldset>';
+ }
+
+ // Izvozimo tabelo s parapodatki v xls
+ public function exportTable(){
+ global $site_path;
+
+ ini_set('memory_limit', '4048M');
+
+
+ // Pridobimo podatke za vse tabele
+ $timestamp_data = $this->getTimestampData();
+ $page_data = $this->getPageData();
+ $question_data = $this->getQuestionData();
+ $variable_data = $this->getVariableData();
+
+
+ $spreadsheet = new Spreadsheet();
+
+
+ // Zavihek strani
+ $sheet = $spreadsheet->getActiveSheet();
+
+ $sheet->setTitle("Strani");
+ $sheet->fromArray(
+ $page_data, // The data to set
+ NULL, // Array values with this value will not be set
+ 'A1' // Top left coordinate of the worksheet range where
+ );
+
+ $spreadsheet->createSheet();
+
+
+ // Zavihek vprasanja
+ $sheet = $spreadsheet->getSheet(1);
+
+ $sheet->setTitle("Vprašanja");
+ $sheet->fromArray(
+ $question_data, // The data to set
+ NULL, // Array values with this value will not be set
+ 'A1' // Top left coordinate of the worksheet range where
+ );
+
+ $spreadsheet->createSheet();
+
+
+ // Zavihek itemi
+ $sheet = $spreadsheet->getSheet(2);
+
+ $sheet->setTitle("Itemi");
+ $sheet->fromArray(
+ $variable_data, // The data to set
+ NULL, // Array values with this value will not be set
+ 'A1' // Top left coordinate of the worksheet range where
+ );
+
+ $spreadsheet->createSheet();
+
+
+ // Zavihek casi po straneh
+ $sheet = $spreadsheet->getSheet(3);
+
+ $sheet->setTitle("Časi po straneh");
+ $sheet->fromArray(
+ $timestamp_data, // The data to set
+ NULL, // Array values with this value will not be set
+ 'A1' // Top left coordinate of the worksheet range where
+ );
+
+
+ $writer = new Xlsx($spreadsheet);
+
+ // ob_clean();
+ // ob_start();
+ $filename = 'advanced_timestamps_'.$this->anketa.'.xlsx';
+
+ header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+ header("Content-Disposition: attachment;filename=".$filename);
+ header("Cache-Control: max-age=0");
+ header("Last-Modified: ".date("D, d M Y H:i:s"));
+ header("Cache-Control: cache, must-revalidate");
+ header("Pragma: public");
+
+ $writer->save("php://output");
+ // ob_end_flush();
+
+ die();
+ }
+
+
+
+ // Pridobimo parapodatke casov po straneh
+ private function getTimestampData(){
+
+ $data = array(0 => array('Stran ID', 'Respondent ID', 'Čas'));
+
+ // Najprej dobimo case na uvodih (gru_id=0)
+ $sql = sisplet_query("SELECT at.gru_id, at.usr_id, at.time_edit
+ FROM srv_advanced_timestamps at, srv_user u
+ WHERE u.ank_id='".$this->anketa."' AND at.usr_id=u.id AND gru_id<1
+ ORDER BY at.usr_id ASC, at.id ASC
+ ");
+ while($row = mysqli_fetch_assoc($sql)){
+ $data[] = $row;
+ }
+
+ // Dobimo se ostale case
+ $sql = sisplet_query("SELECT at.gru_id, at.usr_id, at.time_edit
+ FROM srv_advanced_timestamps at, srv_grupa g
+ WHERE g.ank_id='".$this->anketa."' AND at.gru_id=g.id
+ ORDER BY at.usr_id ASC, at.id ASC
+ ");
+ while($row = mysqli_fetch_assoc($sql)){
+ $data[] = $row;
+ }
+
+ return $data;
+ }
+
+ // Pridobimo podatke strani v anketi
+ private function getPageData(){
+
+ $data = array(0 => array('Stran ID', 'Naslov', 'Vrstni red'));
+
+ $sql = sisplet_query("SELECT id, naslov, vrstni_red
+ FROM srv_grupa
+ WHERE ank_id='".$this->anketa."'
+ ORDER BY vrstni_red ASC
+ ");
+ while($row = mysqli_fetch_assoc($sql)){
+ $data[] = $row;
+ }
+
+ return $data;
+ }
+
+ // Pridobimo podatke vprasanj v anketi
+ private function getQuestionData(){
+
+ $question_types = array(
+ '1' => 'radio',
+ '2' => 'checkbox',
+ '3' => 'select',
+ '4' => 'text',
+ '21' => 'besedilo*',
+ '5' => 'label',
+ '6' => 'multigrid',
+ '16' => 'multicheckbox',
+ '19' => 'multitext',
+ '20' => 'multinumber',
+ '7' => 'number',
+ '22' => 'compute ',
+ '25' => 'quota',
+ '8' => 'datum ',
+ '17' => 'ranking ',
+ '18' => 'vsota',
+ '24' => 'grid - multiple',
+ '23' => 'iz knjiznice',
+ '9' => 'SN-imena',
+ '26' => 'Lokacija',
+ '27' => 'HeatMap ',
+ );
+
+ $data = array(0 => array('Vprašanje ID', 'Stran ID', 'Naslov', 'Variabla', 'Tip'));
+
+ $sql = sisplet_query("SELECT s.id, s.gru_id, s.naslov, s.variable, s.tip
+ FROM srv_spremenljivka s, srv_grupa g
+ WHERE g.ank_id='".$this->anketa."' AND s.gru_id=g.id
+ ORDER BY g.vrstni_red ASC, s.id ASC
+ ");
+ while($row = mysqli_fetch_assoc($sql)){
+
+ $row['tip'] = $question_types[$row['tip']];
+ $row['naslov'] = strip_tags($row['naslov']);
+
+ $data[] = $row;
+ }
+
+ return $data;
+ }
+
+ // Pridobimo podatke posameznih itemov v vprasanjih
+ private function getVariableData(){
+
+ $data = array(0 => array('Vrednost ID', 'Vprašanje ID, ', 'Naslov', 'Variabla', 'Vrstni red'));
+
+ $sql = sisplet_query("SELECT v.id, v.spr_id, v.naslov, v.variable, v.vrstni_red
+ FROM srv_vrednost v, srv_spremenljivka s, srv_grupa g
+ WHERE g.ank_id='".$this->anketa."' AND s.gru_id=g.id AND v.spr_id=s.id
+ ORDER BY g.vrstni_red ASC, s.id ASC, v.id ASC
+ ");
+ while($row = mysqli_fetch_assoc($sql)){
+
+ $row['naslov'] = strip_tags($row['naslov']);
+
+ $data[] = $row;
+ }
+
+ return $data;
+ }
+
+} \ No newline at end of file
diff --git a/admin/survey/modules/mod_chat/class.SurveyChat.php b/admin/survey/modules/mod_chat/class.SurveyChat.php
index 4f65b13..6afa624 100644
--- a/admin/survey/modules/mod_chat/class.SurveyChat.php
+++ b/admin/survey/modules/mod_chat/class.SurveyChat.php
@@ -26,6 +26,10 @@ class SurveyChat{
// Nastavitve chat-a (na kateri strani se prikaze...)
public function displaySettings(){
global $lang;
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
$row = SurveyInfo::getInstance()->getSurveyRow();
@@ -40,27 +44,44 @@ class SurveyChat{
$row = mysqli_fetch_array($sql);
$code = $row['code'];
}
- echo '<span class="nastavitveSpan2" style="vertical-align:top;">'.$lang['srv_chat_code'].':</span>';
- echo '<textarea id="chat_code" name="chat_code" rows="5" cold="20">'.$code.'</textarea>';
-
- echo '<br /><br />';
+
+ echo '<p class="bottom16">'.$lang['srv_vrsta_survey_note_14_1a'].':</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<p class="bold">'.$lang['srv_chat_code'].':</p>';
+ echo '<textarea class="wauto" id="chat_code" name="chat_code">'.$code.'</textarea>';
+ echo '</div>';
// Prikaz vklopa chata
- echo '<span class="nastavitveSpan2" >'.$lang['srv_chat_type'].':</span>';
- echo '<input type="radio" name="chat_type" id="chat_type_0" value="0" '.(($row['chat_type'] == 0) ? ' checked="checked" ' : '').' /><label for="chat_type_0">'.$lang['srv_chat_type_0'].'</label>';
- echo '<input type="radio" name="chat_type" id="chat_type_1" value="1" '.(($row['chat_type'] == 1) ? ' checked="checked" ' : '').' /><label for="chat_type_1">'.$lang['srv_chat_type_1'].'</label>';
- echo '<input type="radio" name="chat_type" id="chat_type_2" value="2" '.(($row['chat_type'] == 2) ? ' checked="checked" ' : '').' /><label for="chat_type_2">'.$lang['srv_chat_type_2'].'</label>';
-
- echo '<br /><br />';
+ echo '<p class="top16 bottom16">'.$lang['srv_vrsta_survey_note_14_1c'].'</p>';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="bold setting_title">'.$lang['srv_chat_type'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="chat_type" id="chat_type_0" value="0" '.(($row['chat_type'] == 0) ? ' checked="checked" ' : '').' />';
+ echo '<label for="chat_type_0">'.$lang['srv_chat_type_0'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="chat_type" id="chat_type_1" value="1" '.(($row['chat_type'] == 1) ? ' checked="checked" ' : '').' />';
+ echo '<label for="chat_type_1">'.$lang['srv_chat_type_1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="chat_type" id="chat_type_2" value="2" '.(($row['chat_type'] == 2) ? ' checked="checked" ' : '').' />';
+ echo '<label for="chat_type_2">'.$lang['srv_chat_type_2'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
echo '</fieldset>';
// Gumb shrani
- echo '<br class="clr" />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="chat_save_settings(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="chat_save_settings(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
echo '<div id="success_save"></div>';
}
diff --git a/admin/survey/modules/mod_email_access/class.SurveyEmailAccess.php b/admin/survey/modules/mod_email_access/class.SurveyEmailAccess.php
new file mode 100644
index 0000000..4526154
--- /dev/null
+++ b/admin/survey/modules/mod_email_access/class.SurveyEmailAccess.php
@@ -0,0 +1,280 @@
+<?php
+/**
+ *
+ * Modul za povezovanje panela (npr. Valicon, GFK...) z 1ka anketo
+ *
+ */
+
+class SurveyEmailAccess{
+
+ var $anketa; # id ankete
+ var $db_table = '';
+
+
+ function __construct($anketa){
+ global $site_url;
+
+ // Ce imamo anketo, smo v status->ul evealvacija
+ if ((int)$anketa > 0){
+ $this->anketa = $anketa;
+
+ # polovimo vrsto tabel (aktivne / neaktivne)
+ SurveyInfo :: getInstance()->SurveyInit($this->anketa);
+ $this->db_table = SurveyInfo::getInstance()->getSurveyArchiveDBString();
+ }
+ }
+
+
+ // Prikazemo nastavitve pri vklopu naprednega modula
+ public function displaySettings(){
+ global $lang;
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
+
+ $rowA = SurveyInfo::getInstance()->getSurveyRow();
+ $row = $this->getEmailAccessSettings();
+
+
+ echo '<fieldset><legend>'.$lang['settings'].'</legend>';
+
+ // Captcha
+ echo '<div class="setting_holder">';
+ echo ' <input type="checkbox" id="captcha" name="captcha" value="1" '.($row['captcha'] == 1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="captcha">'.$lang['srv_captcha_edit'].'</label> ';
+ echo '</div>';
+
+ // Text pogoji uporabe
+ $pogoji_warning = $row['terms_text'] == '' ? true : false;
+ echo '<div class="setting_holder">';
+ echo ' <p '.($pogoji_warning ? 'class="red"' : '').'>'.$lang['user_agreement'] . ($pogoji_warning ? ' (polje obvezno izpolnite)' : '').':</p>';
+ echo ' <textarea name="terms_text" class="wauto '.($pogoji_warning ? 'redBorder' : '').'" id="terms_text" placeholder="Dopolnite s Pogoji uporabe osebnih podatkov">'.$row['terms_text'].'</textarea>';
+ echo '</div>';
+
+ echo '</fieldset>';
+
+
+ // Gumb shrani
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="email_access_save_settings(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
+ echo '<div id="success_save"></div>';
+ }
+
+ // Izvedemo vse potrebno, ko modul aktiviramo
+ public function activateEmailAccess(){
+ global $lang;
+
+ // privzeto besedilo za pogoje uporabe
+ $terms_text = '';
+
+ // Vstavimo vrstico z nastavitvami
+ $sql1 = sisplet_query("INSERT INTO srv_email_access_settings (ank_id, terms_text) VALUES ('".$this->anketa."', '".$terms_text."')");
+
+ // Ugasnimo belezenje parapodatkov - samo za mju
+ if(true){
+ SurveySetting::getInstance()->Init($this->anketa);
+
+ SurveySetting::getInstance()->setSurveyMiscSetting('survey_ip', '1');
+ SurveySetting::getInstance()->setSurveyMiscSetting('survey_browser', '1');
+ SurveySetting::getInstance()->setSurveyMiscSetting('survey_referal', '1');
+ //SurveySetting::getInstance()->setSurveyMiscSetting('survey_date', '1');
+ }
+ }
+
+ // Vrnemo nastavitve modula
+ public function getEmailAccessSettings($what = ''){
+
+ if($what != ''){
+ $sql = sisplet_query("SELECT ".$what." FROM srv_email_access_settings WHERE ank_id='".$this->anketa."'");
+ $row = mysqli_fetch_array($sql);
+
+ return $row[$what];
+ }
+ else{
+ $sql = sisplet_query("SELECT * FROM srv_email_access_settings WHERE ank_id='".$this->anketa."'");
+ $row = mysqli_fetch_array($sql);
+
+ return $row;
+ }
+ }
+
+
+ // Zgeneriramo kodo za dostop do ankete in jo posljemo na mail
+ public function sendAccessCode($email){
+ global $lang;
+
+ $return = array();
+
+ // Dobimo domeno iz emaila
+ $parts = explode("@", $email);
+ $domain = $parts[1];
+
+ // Preverimo ce je veljaven email
+ if(!validEmail($email)){
+ $return['error']['email'] = 'Neveljaven email';
+ }
+ elseif($this->checkEmailBlacklist($domain)){
+ $return['error']['email'] = 'Uporaba email naslova z domene '.$domain.' ni dovoljena.';
+ }
+ // Preverimo, ce email ze obstaja v bazi
+ else{
+ $sql = sisplet_query("SELECT * FROM srv_email_access WHERE ank_id='".$this->anketa."' AND email='".$email."' AND status!='0'");
+ if(mysqli_num_rows($sql) > 0){
+ $return['error']['email'] = 'Na ta email je bila že poslana koda.';
+ }
+ }
+
+ // Preverimo, ce se je strinjal s pogoji uporabe
+ if(isset($_POST['terms']) && $_POST['terms'] != '1'){
+ $return['error']['terms'] = 'Strinjanje s pogoji uporabe je obvezno.';
+ }
+
+ if(isset($return['error']['email']) || isset($return['error']['terms'])){
+ return $return;
+ }
+
+
+ // Zgeneriramo 8 mestno kodo za dostop
+ //$chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
+ $chars = '0123456789';
+
+ // Preverimo za vsak slučaj, da koda še ne obstaja
+ $code_ok = false;
+ while(!$code_ok){
+ $code = substr(str_shuffle($chars), 0, 6);
+
+ $sql = sisplet_query("SELECT * FROM srv_email_access WHERE ank_id='".$this->anketa."' AND access_code='".$code."'");
+ if(mysqli_num_rows($sql) == 0){
+ $code_ok = true;
+ }
+ }
+
+ // Vstavimo podatke v bazo
+ $sql = sisplet_query("INSERT INTO srv_email_access
+ (ank_id, email, access_code, status)
+ values
+ ('".$this->anketa."', '".$email."', '".$code."', '0')
+ ON DUPLICATE KEY UPDATE
+ access_code='".$code."'
+ ");
+
+
+ // Sestavimo email za posiljanje
+ $email_subject = $lang['srv_email_access_email_subject'];
+
+ $email_body = '<p>'.$lang['srv_email_access_email_body0'].'</p>';
+ $email_body .= '<p>'.$lang['srv_email_access_email_body1'].'</p>';
+ $email_body .= '<span style="font-size:24px; font-weight:600;">'.substr($code, 0, 3).' '.substr($code, 3, 6).'</span>';
+ $email_body .= '<p>'.$lang['srv_email_access_email_body2'].' \''.SurveyInfo::getSurveyTitle().'\'.</p>';
+ $email_body .= '<p>'.$lang['srv_email_access_email_body3'].'</p>';
+
+
+ // Posljemo email s kodo
+ try{
+ $MA = new MailAdapter($this->anketa, $type='invitation');
+ $MA->addRecipients($email);
+ $resultX = $MA->sendMail($email_body, $email_subject);
+ }
+ catch (Exception $e) {
+ $return['error']['email'] = 'Napaka pri pošiljanju kode na email.';
+ return $return;
+ }
+
+ // Na koncu popravimo status, da je bil email uspesno poslan
+ $sql = sisplet_query("UPDATE srv_email_access SET status='1' WHERE ank_id='".$this->anketa."' AND email='".$email."'");
+
+ return true;
+ }
+
+ // Preverimo, ce imamo vneseno kodo in ce se ni bila uporabljena - potem ustvarimo cookie in nastavimo status na uporabljeno kodo
+ public function checkAccessCode($code){
+
+ // Preverimo kodo
+ $sql = sisplet_query("SELECT * FROM srv_email_access WHERE ank_id='".$this->anketa."' AND access_code='".$code."'");
+
+ // Koda ne obstaja v bazi
+ if(mysqli_num_rows($sql) == 0){
+ $return['error'] = 'Vnešena koda ni pravilna!';
+ return $return;
+ }
+ $row = mysqli_fetch_array($sql);
+
+ // Koda še ni bila poslana
+ if($row['status'] == '0'){
+ $return['error'] = 'Vnešena koda še ni bila aktivirana!';
+ return $return;
+ }
+
+ // Koda je bila že uporabljena
+ if($row['status'] == '2'){
+ $return['error'] = 'Vnešena koda je bila že uporabljena!';
+ return $return;
+ }
+
+ // Vse ok, nastavimo status da je bila koda uporabljena in nastavimo cookie
+ $sql = sisplet_query("UPDATE srv_email_access SET status='2' WHERE ank_id='".$this->anketa."' AND access_code='".$code."'");
+
+ return true;
+ }
+
+ // Preverimo, ce email obstaja na blacklisti zacasnih emailov
+ private function checkEmailBlacklist($domain){
+ global $site_path;
+
+ $filename = $site_path."/admin/survey/modules/mod_email_access/disposable_email_blocklist.txt";
+ $file = new SplFileObject($filename);
+
+ $found = false;
+
+ // Loop through each line in the file
+ foreach ($file as $line) {
+ $line = trim($line);
+
+ // Check if the line matches the email
+ if ($line === $domain) {
+ $found = true;
+ break;
+ }
+ }
+
+ $file = null; // Close the file
+
+ return $found;
+ }
+
+
+
+ // Pobrisemo vse kode povezane za anketo (za mju - 7 dni po deaktivaciji ankete)
+ private static function deleteSurveyEmailsAndCodes($ank_id){
+
+ if ((int)$ank_id <= 0)
+ return;
+
+ $sql = sisplet_query("DELETE * FROM srv_email_access WHERE ank_id='".$ank_id."'");
+ }
+
+
+ public function ajax() {
+
+ if(isset($_GET['a']) && $_GET['a'] == 'save_settings'){
+
+ $captcha = isset($_POST['captcha']) ? $_POST['captcha'] : '0';
+ $terms_text = isset($_POST['terms_text']) ? $_POST['terms_text'] : '';
+
+
+ $sql = sisplet_query("UPDATE srv_email_access_settings
+ SET captcha='".$captcha."', terms_text='".$terms_text."'
+ WHERE ank_id='".$this->anketa."'
+ ");
+ if (!$sql) echo mysqli_error($GLOBALS['connect_db']);
+
+
+ $this->displaySettings();
+ }
+
+ }
+} \ No newline at end of file
diff --git a/admin/survey/modules/mod_email_access/disposable_email_blocklist.txt b/admin/survey/modules/mod_email_access/disposable_email_blocklist.txt
new file mode 100644
index 0000000..944a059
--- /dev/null
+++ b/admin/survey/modules/mod_email_access/disposable_email_blocklist.txt
@@ -0,0 +1,3474 @@
+0-mail.com
+027168.com
+0815.ru
+0815.ry
+0815.su
+0845.ru
+0box.eu
+0clickemail.com
+0n0ff.net
+0nelce.com
+0v.ro
+0w.ro
+0wnd.net
+0wnd.org
+0x207.info
+1-8.biz
+1-tm.com
+10-minute-mail.com
+1000rebates.stream
+100likers.com
+105kg.ru
+10dk.email
+10mail.com
+10mail.org
+10minut.com.pl
+10minut.xyz
+10minutemail.be
+10minutemail.cf
+10minutemail.co.uk
+10minutemail.co.za
+10minutemail.com
+10minutemail.de
+10minutemail.ga
+10minutemail.gq
+10minutemail.ml
+10minutemail.net
+10minutemail.nl
+10minutemail.pro
+10minutemail.us
+10minutemailbox.com
+10minutemails.in
+10minutenemail.de
+10minutesmail.com
+10minutesmail.fr
+10minutmail.pl
+10x9.com
+11163.com
+123-m.com
+12hosting.net
+12houremail.com
+12minutemail.com
+12minutemail.net
+12storage.com
+140unichars.com
+147.cl
+14n.co.uk
+15qm.com
+1blackmoon.com
+1ce.us
+1chuan.com
+1clck2.com
+1fsdfdsfsdf.tk
+1mail.ml
+1pad.de
+1s.fr
+1secmail.com
+1secmail.net
+1secmail.org
+1st-forms.com
+1to1mail.org
+1usemail.com
+1webmail.info
+1zhuan.com
+2012-2016.ru
+20email.eu
+20email.it
+20mail.eu
+20mail.in
+20mail.it
+20minutemail.com
+20minutemail.it
+20mm.eu
+2120001.net
+21cn.com
+247web.net
+24hinbox.com
+24hourmail.com
+24hourmail.net
+2anom.com
+2chmail.net
+2ether.net
+2fdgdfgdfgdf.tk
+2odem.com
+2prong.com
+2wc.info
+300book.info
+30mail.ir
+30minutemail.com
+30wave.com
+3202.com
+36ru.com
+3d-painting.com
+3l6.com
+3mail.ga
+3trtretgfrfe.tk
+4-n.us
+4057.com
+418.dk
+42o.org
+4gfdsgfdgfd.tk
+4k5.net
+4mail.cf
+4mail.ga
+4nextmail.com
+4nmv.ru
+4tb.host
+4warding.com
+4warding.net
+4warding.org
+50set.ru
+55hosting.net
+5ghgfhfghfgh.tk
+5gramos.com
+5july.org
+5mail.cf
+5mail.ga
+5minutemail.net
+5oz.ru
+5tb.in
+5x25.com
+5ymail.com
+60minutemail.com
+672643.net
+675hosting.com
+675hosting.net
+675hosting.org
+6hjgjhgkilkj.tk
+6ip.us
+6mail.cf
+6mail.ga
+6mail.ml
+6paq.com
+6somok.ru
+6url.com
+75hosting.com
+75hosting.net
+75hosting.org
+7days-printing.com
+7mail.ga
+7mail.ml
+7tags.com
+80665.com
+8127ep.com
+8mail.cf
+8mail.ga
+8mail.ml
+99.com
+99cows.com
+99experts.com
+9mail.cf
+9me.site
+9mot.ru
+9ox.net
+9q.ro
+a-bc.net
+a45.in
+a7996.com
+aa5zy64.com
+abacuswe.us
+abakiss.com
+abcmail.email
+abilitywe.us
+abovewe.us
+absolutewe.us
+abundantwe.us
+abusemail.de
+abuser.eu
+abyssmail.com
+ac20mail.in
+academiccommunity.com
+academywe.us
+acceleratewe.us
+accentwe.us
+acceptwe.us
+acclaimwe.us
+accordwe.us
+accreditedwe.us
+acentri.com
+achievementwe.us
+achievewe.us
+acornwe.us
+acrossgracealley.com
+acrylicwe.us
+activatewe.us
+activitywe.us
+acucre.com
+acuitywe.us
+acumenwe.us
+adaptivewe.us
+adaptwe.us
+add3000.pp.ua
+addictingtrailers.com
+adeptwe.us
+adfskj.com
+adios.email
+adiq.eu
+aditus.info
+admiralwe.us
+ado888.biz
+adobeccepdm.com
+adoniswe.us
+adpugh.org
+adroh.com
+adsd.org
+adubiz.info
+advantagewe.us
+advantimo.com
+adventurewe.us
+adventwe.us
+advisorwe.us
+advocatewe.us
+adwaterandstir.com
+aegde.com
+aegia.net
+aegiscorp.net
+aegiswe.us
+aelo.es
+aeonpsi.com
+afarek.com
+affiliate-nebenjob.info
+affiliatedwe.us
+affilikingz.de
+affinitywe.us
+affluentwe.us
+affordablewe.us
+afrobacon.com
+afterhourswe.us
+agedmail.com
+agendawe.us
+agger.ro
+agilewe.us
+agorawe.us
+agtx.net
+aheadwe.us
+ahem.email
+ahk.jp
+ahmedkhlef.com
+air2token.com
+airmailbox.website
+airsi.de
+ajaxapp.net
+akapost.com
+akerd.com
+akgq701.com
+akmail.in
+al-qaeda.us
+albionwe.us
+alchemywe.us
+alfaceti.com
+aliaswe.us
+alienware13.com
+aligamel.com
+alisongamel.com
+alivance.com
+alivewe.us
+all-cats.ru
+allaccesswe.us
+allamericanwe.us
+allaroundwe.us
+alldirectbuy.com
+allegiancewe.us
+allegrowe.us
+allemojikeyboard.com
+allgoodwe.us
+alliancewe.us
+allinonewe.us
+allofthem.net
+alloutwe.us
+allowed.org
+alloywe.us
+allprowe.us
+allseasonswe.us
+allstarwe.us
+allthegoodnamesaretaken.org
+allurewe.us
+almondwe.us
+alph.wtf
+alpha-web.net
+alphaomegawe.us
+alpinewe.us
+altairwe.us
+altitudewe.us
+altuswe.us
+ama-trade.de
+ama-trans.de
+amadeuswe.us
+amail.club
+amail.com
+amail1.com
+amail4.me
+amazon-aws.org
+amberwe.us
+ambiancewe.us
+ambitiouswe.us
+amelabs.com
+americanawe.us
+americasbestwe.us
+americaswe.us
+amicuswe.us
+amilegit.com
+amiri.net
+amiriindustries.com
+amplewe.us
+amplifiedwe.us
+amplifywe.us
+ampsylike.com
+analogwe.us
+analysiswe.us
+analyticalwe.us
+analyticswe.us
+analyticwe.us
+anappfor.com
+anappthat.com
+andreihusanu.ro
+andthen.us
+animesos.com
+anit.ro
+ano-mail.net
+anon-mail.de
+anonbox.net
+anonmail.top
+anonmails.de
+anonymail.dk
+anonymbox.com
+anonymized.org
+anonymousness.com
+anotherdomaincyka.tk
+ansibleemail.com
+anthony-junkmail.com
+antireg.com
+antireg.ru
+antispam.de
+antispam24.de
+antispammail.de
+anyalias.com
+aoeuhtns.com
+apfelkorps.de
+aphlog.com
+apkmd.com
+appc.se
+appinventor.nl
+appixie.com
+apps.dj
+appzily.com
+arduino.hk
+ariaz.jetzt
+armyspy.com
+aron.us
+arroisijewellery.com
+art-en-ligne.pro
+artman-conception.com
+arur01.tk
+arurgitu.gq
+arvato-community.de
+aschenbrandt.net
+asdasd.nl
+asdasd.ru
+ashleyandrew.com
+ask-mail.com
+asorent.com
+ass.pp.ua
+astonut.tk
+astroempires.info
+asu.mx
+asu.su
+at.hm
+at0mik.org
+atnextmail.com
+attnetwork.com
+augmentationtechnology.com
+ausgefallen.info
+auti.st
+autorobotica.com
+autosouvenir39.ru
+autotwollow.com
+autowb.com
+aver.com
+averdov.com
+avia-tonic.fr
+avls.pt
+awatum.de
+awdrt.org
+awiki.org
+awsoo.com
+axiz.org
+axon7zte.com
+axsup.net
+ayakamail.cf
+azazazatashkent.tk
+azcomputerworks.com
+azmeil.tk
+b1of96u.com
+b2bx.net
+b2cmail.de
+badgerland.eu
+badoop.com
+badpotato.tk
+balaket.com
+banit.club
+banit.me
+bank-opros1.ru
+bareed.ws
+barryogorman.com
+bartdevos.be
+basscode.org
+bauwerke-online.com
+bazaaboom.com
+bbbbyyzz.info
+bbhost.us
+bcaoo.com
+bcast.ws
+bcb.ro
+bccto.me
+bdmuzic.pw
+beaconmessenger.com
+bearsarefuzzy.com
+beddly.com
+beefmilk.com
+belamail.org
+belljonestax.com
+beluckygame.com
+benipaula.org
+bepureme.com
+beribase.ru
+beribaza.ru
+berirabotay.ru
+best-john-boats.com
+bestchoiceusedcar.com
+bestlistbase.com
+bestoption25.club
+bestparadize.com
+bestsoundeffects.com
+besttempmail.com
+betr.co
+bgtmail.com
+bgx.ro
+bheps.com
+bidourlnks.com
+big1.us
+bigprofessor.so
+bigstring.com
+bigwhoop.co.za
+bij.pl
+binka.me
+binkmail.com
+binnary.com
+bio-muesli.info
+bio-muesli.net
+bione.co
+bitwhites.top
+bitymails.us
+blackgoldagency.ru
+blackmarket.to
+bladesmail.net
+blip.ch
+blnkt.net
+block521.com
+blogmyway.org
+blogos.net
+blogspam.ro
+blondemorkin.com
+bluedumpling.info
+bluewerks.com
+bnote.com
+boatmail.us
+bobmail.info
+bobmurchison.com
+bofthew.com
+bonobo.email
+boofx.com
+bookthemmore.com
+bootybay.de
+borged.com
+borged.net
+borged.org
+bot.nu
+boun.cr
+bouncr.com
+boxformail.in
+boximail.com
+boxmail.lol
+boxomail.live
+boxtemp.com.br
+bptfp.net
+brandallday.net
+brasx.org
+breakthru.com
+brefmail.com
+brennendesreich.de
+briggsmarcus.com
+broadbandninja.com
+bsnow.net
+bspamfree.org
+bspooky.com
+bst-72.com
+btb-notes.com
+btc.email
+btcmail.pw
+btcmod.com
+btizet.pl
+buccalmassage.ru
+budaya-tionghoa.com
+budayationghoa.com
+buffemail.com
+bugmenever.com
+bugmenot.com
+bulrushpress.com
+bum.net
+bumpymail.com
+bunchofidiots.com
+bund.us
+bundes-li.ga
+bunsenhoneydew.com
+burnthespam.info
+burstmail.info
+businessbackend.com
+businesssuccessislifesuccess.com
+buspad.org
+bussitussi.com
+buymoreplays.com
+buyordie.info
+buyusdomain.com
+buyusedlibrarybooks.org
+buzzcluby.com
+byebyemail.com
+byespm.com
+byom.de
+c51vsgq.com
+cachedot.net
+californiafitnessdeals.com
+cam4you.cc
+camping-grill.info
+candymail.de
+cane.pw
+capitalistdilemma.com
+car101.pro
+carbtc.net
+cars2.club
+carsencyclopedia.com
+cartelera.org
+caseedu.tk
+cashflow35.com
+casualdx.com
+cavi.mx
+cbair.com
+cbes.net
+cc.liamria
+ccmail.uk
+cdfaq.com
+cdpa.cc
+ceed.se
+cek.pm
+cellurl.com
+centermail.com
+centermail.net
+cetpass.com
+cfo2go.ro
+chacuo.net
+chaichuang.com
+chalupaurybnicku.cz
+chammy.info
+chasefreedomactivate.com
+chatich.com
+cheaphub.net
+cheatmail.de
+chenbot.email
+chibakenma.ml
+chickenkiller.com
+chielo.com
+childsavetrust.org
+chilkat.com
+chinamkm.com
+chithinh.com
+chitthi.in
+choco.la
+chogmail.com
+choicemail1.com
+chong-mail.com
+chong-mail.net
+chong-mail.org
+chumpstakingdumps.com
+cigar-auctions.com
+civx.org
+ckaazaza.tk
+ckiso.com
+cl-cl.org
+cl0ne.net
+claimab.com
+clandest.in
+classesmail.com
+clearwatermail.info
+click-email.com
+clickdeal.co
+clipmail.eu
+clixser.com
+clonemoi.tk
+cloud-mail.top
+cloudns.cx
+clrmail.com
+cmail.club
+cmail.com
+cmail.net
+cmail.org
+cnamed.com
+cndps.com
+cnew.ir
+cnmsg.net
+cnsds.de
+co.cc
+cobarekyo1.ml
+cocoro.uk
+cocovpn.com
+codeandscotch.com
+codivide.com
+coffeetimer24.com
+coieo.com
+coin-host.net
+coinlink.club
+coldemail.info
+compareshippingrates.org
+completegolfswing.com
+comwest.de
+conf.work
+consumerriot.com
+contbay.com
+cooh-2.site
+coolandwacky.us
+coolimpool.org
+coreclip.com
+cosmorph.com
+courrieltemporaire.com
+coza.ro
+crankhole.com
+crapmail.org
+crastination.de
+crazespaces.pw
+crazymailing.com
+cream.pink
+crepeau12.com
+cringemonster.com
+cross-law.ga
+cross-law.gq
+crossmailjet.com
+crossroadsmail.com
+crunchcompass.com
+crusthost.com
+cs.email
+csh.ro
+cszbl.com
+ctmailing.us
+ctos.ch
+cu.cc
+cubiclink.com
+cuendita.com
+cuirushi.org
+cuoly.com
+cupbest.com
+curlhph.tk
+curryworld.de
+cust.in
+cutout.club
+cutradition.com
+cuvox.de
+cyber-innovation.club
+cyber-phone.eu
+cylab.org
+d1yun.com
+d3p.dk
+daabox.com
+dab.ro
+dacoolest.com
+daemsteam.com
+daibond.info
+daily-email.com
+daintly.com
+damai.webcam
+dammexe.net
+damnthespam.com
+dandikmail.com
+darkharvestfilms.com
+daryxfox.net
+dasdasdascyka.tk
+dash-pads.com
+dataarca.com
+datarca.com
+datazo.ca
+datenschutz.ru
+datum2.com
+davidkoh.net
+davidlcreative.com
+dawin.com
+daymail.life
+daymailonline.com
+dayrep.com
+dbunker.com
+dcctb.com
+dcemail.com
+ddcrew.com
+de-a.org
+dea-21olympic.com
+deadaddress.com
+deadchildren.org
+deadfake.cf
+deadfake.ga
+deadfake.ml
+deadfake.tk
+deadspam.com
+deagot.com
+dealja.com
+dealrek.com
+deekayen.us
+defomail.com
+degradedfun.net
+deinbox.com
+delayload.com
+delayload.net
+delikkt.de
+delivrmail.com
+demen.ml
+dengekibunko.ga
+dengekibunko.gq
+dengekibunko.ml
+der-kombi.de
+derkombi.de
+derluxuswagen.de
+desoz.com
+despam.it
+despammed.com
+dev-null.cf
+dev-null.ga
+dev-null.gq
+dev-null.ml
+devnullmail.com
+deyom.com
+dharmatel.net
+dhm.ro
+dhy.cc
+dialogus.com
+diapaulpainting.com
+dicopto.com
+digdig.org
+digital-message.com
+digitalesbusiness.info
+digitalmail.info
+digitalmariachis.com
+digitalsanctuary.com
+dildosfromspace.com
+dim-coin.com
+dingbone.com
+diolang.com
+directmail24.net
+disaq.com
+disbox.net
+disbox.org
+discard.cf
+discard.email
+discard.ga
+discard.gq
+discard.ml
+discard.tk
+discardmail.com
+discardmail.de
+discos4.com
+disign-concept.eu
+disign-revelation.com
+dispo.in
+dispomail.eu
+disposable-e.ml
+disposable-email.ml
+disposable.cf
+disposable.ga
+disposable.ml
+disposable.site
+disposableaddress.com
+disposableemailaddresses.com
+disposableinbox.com
+disposablemails.com
+dispose.it
+disposeamail.com
+disposemail.com
+disposemymail.com
+dispostable.com
+divad.ga
+divermail.com
+divismail.ru
+diwaq.com
+dlemail.ru
+dmarc.ro
+dndent.com
+dnses.ro
+doanart.com
+dob.jp
+dodgeit.com
+dodgemail.de
+dodgit.com
+dodgit.org
+dodsi.com
+doiea.com
+dolphinnet.net
+domforfb1.tk
+domforfb18.tk
+domforfb19.tk
+domforfb2.tk
+domforfb23.tk
+domforfb27.tk
+domforfb29.tk
+domforfb3.tk
+domforfb4.tk
+domforfb5.tk
+domforfb6.tk
+domforfb7.tk
+domforfb8.tk
+domforfb9.tk
+domozmail.com
+donemail.ru
+dongqing365.com
+dontreg.com
+dontsendmespam.de
+doquier.tk
+dotman.de
+dotmsg.com
+dotslashrage.com
+doublemail.de
+douchelounge.com
+dozvon-spb.ru
+dp76.com
+dr69.site
+drdrb.com
+drdrb.net
+dred.ru
+drevo.si
+drivetagdev.com
+droolingfanboy.de
+dropcake.de
+dropjar.com
+droplar.com
+dropmail.me
+dropsin.net
+dsgvo.ru
+dsiay.com
+dspwebservices.com
+duam.net
+duck2.club
+dudmail.com
+duk33.com
+dukedish.com
+dump-email.info
+dumpandjunk.com
+dumpmail.de
+dumpyemail.com
+durandinterstellar.com
+duskmail.com
+dwse.edu.pl
+dyceroprojects.com
+dz17.net
+e-mail.com
+e-mail.org
+e-marketstore.ru
+e-tomarigi.com
+e3z.de
+e4ward.com
+eanok.com
+easy-trash-mail.com
+easynetwork.info
+easytrashmail.com
+eatmea2z.club
+eay.jp
+ebbob.com
+ebeschlussbuch.de
+ecallheandi.com
+ecolo-online.fr
+edgex.ru
+edinburgh-airporthotels.com
+edv.to
+ee1.pl
+ee2.pl
+eeedv.de
+eelmail.com
+efxs.ca
+egzones.com
+einmalmail.de
+einrot.com
+einrot.de
+eintagsmail.de
+elearningjournal.org
+electro.mn
+elitevipatlantamodels.com
+elki-mkzn.ru
+email-fake.cf
+email-fake.com
+email-fake.ga
+email-fake.gq
+email-fake.ml
+email-fake.tk
+email-jetable.fr
+email-lab.com
+email-temp.com
+email.edu.pl
+email.net
+email1.pro
+email60.com
+emailage.cf
+emailage.ga
+emailage.gq
+emailage.ml
+emailage.tk
+emailate.com
+emailcu.icu
+emaildienst.de
+emaildrop.io
+emailfake.com
+emailfake.ml
+emailfreedom.ml
+emailgenerator.de
+emailgo.de
+emailias.com
+emailigo.de
+emailinfive.com
+emailisvalid.com
+emaillime.com
+emailmiser.com
+emailna.co
+emailnax.com
+emailo.pro
+emailondeck.com
+emailportal.info
+emailproxsy.com
+emailresort.com
+emails.ga
+emailsecurer.com
+emailsensei.com
+emailsingularity.net
+emailspam.cf
+emailspam.ga
+emailspam.gq
+emailspam.ml
+emailspam.tk
+emailsy.info
+emailtech.info
+emailtemporanea.com
+emailtemporanea.net
+emailtemporar.ro
+emailtemporario.com.br
+emailthe.net
+emailtmp.com
+emailto.de
+emailure.net
+emailwarden.com
+emailxfer.com
+emailz.cf
+emailz.ga
+emailz.gq
+emailz.ml
+emeil.in
+emeil.ir
+emeraldwebmail.com
+emil.com
+emkei.cf
+emkei.ga
+emkei.gq
+emkei.ml
+emkei.tk
+eml.pp.ua
+emlhub.com
+emlpro.com
+emltmp.com
+empireanime.ga
+emstjzh.com
+emz.net
+enayu.com
+enterto.com
+envy17.com
+eoffice.top
+eoopy.com
+epb.ro
+ephemail.net
+ephemeral.email
+eposta.buzz
+eposta.work
+eqiluxspam.ga
+ericjohnson.ml
+ero-tube.org
+esbano-ru.ru
+esc.la
+escapehatchapp.com
+esemay.com
+esgeneri.com
+esiix.com
+esprity.com
+estate-invest.fr
+eth2btc.info
+ether123.net
+ethereum1.top
+ethersports.org
+ethersportz.info
+etotvibor.ru
+etranquil.com
+etranquil.net
+etranquil.org
+euaqa.com
+evanfox.info
+eveav.com
+evilcomputer.com
+evopo.com
+evyush.com
+exdonuts.com
+existiert.net
+exitstageleft.net
+explodemail.com
+express.net.ua
+extremail.ru
+eyepaste.com
+ez.lv
+ezehe.com
+ezfill.com
+ezstest.com
+f4k.es
+f5.si
+facebook-email.cf
+facebook-email.ga
+facebook-email.ml
+facebookmail.gq
+facebookmail.ml
+fackme.gq
+fadingemail.com
+faecesmail.me
+fag.wf
+failbone.com
+faithkills.com
+fake-box.com
+fake-email.pp.ua
+fake-mail.cf
+fake-mail.ga
+fake-mail.ml
+fakedemail.com
+fakeinbox.cf
+fakeinbox.com
+fakeinbox.ga
+fakeinbox.info
+fakeinbox.ml
+fakeinbox.tk
+fakeinformation.com
+fakemail.fr
+fakemail.io
+fakemailgenerator.com
+fakemailz.com
+fallinhay.com
+fammix.com
+fanclub.pm
+fangoh.com
+fansworldwide.de
+fantasymail.de
+farrse.co.uk
+fast-email.info
+fast-mail.fr
+fastacura.com
+fastchevy.com
+fastchrysler.com
+fasternet.biz
+fastkawasaki.com
+fastmazda.com
+fastmitsubishi.com
+fastnissan.com
+fastsubaru.com
+fastsuzuki.com
+fasttoyota.com
+fastyamaha.com
+fatflap.com
+fbma.tk
+fddns.ml
+fdfdsfds.com
+fer-gabon.org
+fermaxxi.ru
+fettometern.com
+fexbox.org
+fexbox.ru
+fexpost.com
+ficken.de
+fictionsite.com
+fightallspam.com
+figjs.com
+figshot.com
+figurescoin.com
+fiifke.de
+filbert4u.com
+filberts4u.com
+film-blog.biz
+filzmail.com
+findemail.info
+findu.pl
+fir.hk
+firemailbox.club
+fitnesrezink.ru
+fivemail.de
+fixmail.tk
+fizmail.com
+fleckens.hu
+flemail.ru
+flowu.com
+flu.cc
+fluidsoft.us
+flurred.com
+fly-ts.de
+flyinggeek.net
+flyspam.com
+foobarbot.net
+footard.com
+foreastate.com
+forecastertests.com
+foreskin.cf
+foreskin.ga
+foreskin.gq
+foreskin.ml
+foreskin.tk
+forgetmail.com
+fornow.eu
+forspam.net
+forward.cat
+fosil.pro
+foxja.com
+foxtrotter.info
+fr.nf
+fr33mail.info
+fragolina2.tk
+frapmail.com
+frappina.tk
+free-email.cf
+free-email.ga
+free-temp.net
+freebabysittercam.com
+freeblackbootytube.com
+freecat.net
+freedom4you.info
+freedompop.us
+freefattymovies.com
+freehotmail.net
+freeinbox.email
+freelance-france.eu
+freeletter.me
+freemail.ms
+freemails.cf
+freemails.ga
+freemails.ml
+freemeil.ga
+freemeil.gq
+freemeil.ml
+freeml.net
+freeplumpervideos.com
+freerubli.ru
+freeschoolgirlvids.com
+freesistercam.com
+freeteenbums.com
+freundin.ru
+friendlymail.co.uk
+front14.org
+frwdmail.com
+ftp.sh
+ftpinc.ca
+fuckedupload.com
+fuckingduh.com
+fuckme69.club
+fucknloveme.top
+fuckxxme.top
+fudgerub.com
+fuirio.com
+fukaru.com
+fukurou.ch
+fulvie.com
+fun64.com
+funnycodesnippets.com
+funnymail.de
+furzauflunge.de
+fuwamofu.com
+fuwari.be
+fux0ringduh.com
+fxnxs.com
+fyii.de
+g14l71lb.com
+g1xmail.top
+g2xmail.top
+g3xmail.top
+g4hdrop.us
+gafy.net
+gage.ga
+galaxy.tv
+gally.jp
+gamail.top
+gamegregious.com
+gamgling.com
+garasikita.pw
+garbagecollector.org
+garbagemail.org
+gardenscape.ca
+garizo.com
+garliclife.com
+garrymccooey.com
+gav0.com
+gawab.com
+gbcmail.win
+gbmail.top
+gcmail.top
+gdmail.top
+gedmail.win
+geekforex.com
+geew.ru
+gehensiemirnichtaufdensack.de
+geldwaschmaschine.de
+gelitik.in
+genderfuck.net
+geronra.com
+geschent.biz
+get-mail.cf
+get-mail.ga
+get-mail.ml
+get-mail.tk
+get.pp.ua
+get1mail.com
+get2mail.fr
+getairmail.cf
+getairmail.com
+getairmail.ga
+getairmail.gq
+getairmail.ml
+getairmail.tk
+geteit.com
+getfun.men
+getmails.eu
+getnada.com
+getnowtoday.cf
+getonemail.com
+getonemail.net
+getover.de
+getsimpleemail.com
+gett.icu
+gexik.com
+ggmal.ml
+ghosttexter.de
+giacmosuaviet.info
+giaiphapmuasam.com
+giantmail.de
+gifto12.com
+ginzi.be
+ginzi.co.uk
+ginzi.es
+ginzi.net
+ginzy.co.uk
+ginzy.eu
+girlmail.win
+girlsindetention.com
+girlsundertheinfluence.com
+gishpuppy.com
+giveh2o.info
+givememail.club
+givmail.com
+glitch.sx
+globaltouron.com
+glubex.com
+glucosegrin.com
+gmal.com
+gmatch.org
+gmial.com
+gmx1mail.top
+gmxmail.top
+gmxmail.win
+gnctr-calgary.com
+go2usa.info
+go2vpn.net
+goemailgo.com
+golemico.com
+gomail.in
+goonby.com
+goplaygame.ru
+gorillaswithdirtyarmpits.com
+goround.info
+gosuslugi-spravka.ru
+gothere.biz
+gotmail.com
+gotmail.net
+gotmail.org
+gowikibooks.com
+gowikicampus.com
+gowikicars.com
+gowikifilms.com
+gowikigames.com
+gowikimusic.com
+gowikinetwork.com
+gowikitravel.com
+gowikitv.com
+grandmamail.com
+grandmasmail.com
+great-host.in
+greencafe24.com
+greendike.com
+greenhousemail.com
+greensloth.com
+greggamel.com
+greggamel.net
+gregorsky.zone
+gregorygamel.com
+gregorygamel.net
+grish.de
+griuc.schule
+grn.cc
+groupbuff.com
+grr.la
+grugrug.ru
+gruz-m.ru
+gs-arc.org
+gsredcross.org
+gsrv.co.uk
+gsxstring.ga
+gudanglowongan.com
+guerillamail.biz
+guerillamail.com
+guerillamail.de
+guerillamail.info
+guerillamail.net
+guerillamail.org
+guerillamailblock.com
+guerrillamail.biz
+guerrillamail.com
+guerrillamail.de
+guerrillamail.info
+guerrillamail.net
+guerrillamail.org
+guerrillamailblock.com
+gustr.com
+gxemail.men
+gynzi.co.uk
+gynzi.es
+gynzy.at
+gynzy.es
+gynzy.eu
+gynzy.gr
+gynzy.info
+gynzy.lt
+gynzy.mobi
+gynzy.pl
+gynzy.ro
+gynzy.sk
+gzb.ro
+h8s.org
+habitue.net
+hacccc.com
+hackersquad.tk
+hackthatbit.ch
+hahawrong.com
+haida-edu.cn
+hairs24.ru
+haltospam.com
+hamham.uk
+hangxomcuatoilatotoro.ml
+happydomik.ru
+harakirimail.com
+haribu.com
+hartbot.de
+hasanmail.ml
+hat-geld.de
+hatespam.org
+hawrong.com
+haydoo.com
+hazelnut4u.com
+hazelnuts4u.com
+hazmatshipping.org
+hccmail.win
+headstrong.de
+heathenhammer.com
+heathenhero.com
+hecat.es
+heisei.be
+hellodream.mobi
+helloricky.com
+helpinghandtaxcenter.org
+helpjobs.ru
+heros3.com
+herp.in
+herpderp.nl
+hezll.com
+hi5.si
+hiddentragedy.com
+hidebox.org
+hidebusiness.xyz
+hidemail.de
+hidemail.pro
+hidemail.us
+hidzz.com
+highbros.org
+hiltonvr.com
+himail.online
+hmail.us
+hmamail.com
+hmh.ro
+hoanggiaanh.com
+hoanglong.tech
+hochsitze.com
+hola.org
+holl.ga
+honeys.be
+honor-8.com
+hopemail.biz
+hornyalwary.top
+host1s.com
+hostcalls.com
+hostguru.top
+hostingmail.me
+hostlaba.com
+hot-mail.cf
+hot-mail.ga
+hot-mail.gq
+hot-mail.ml
+hot-mail.tk
+hotmai.com
+hotmailproduct.com
+hotmial.com
+hotpop.com
+hotprice.co
+hotsoup.be
+housat.com
+hpc.tw
+hs.vc
+ht.cx
+huangniu8.com
+hukkmu.tk
+hulapla.de
+humaility.com
+hungpackage.com
+hushmail.cf
+huskion.net
+hvastudiesucces.nl
+hwsye.net
+i2pmail.org
+i6.cloudns.cc
+iaoss.com
+ibnuh.bz
+icantbelieveineedtoexplainthisshit.com
+icemail.club
+ichigo.me
+icx.in
+icx.ro
+idx4.com
+idxue.com
+ieatspam.eu
+ieatspam.info
+ieh-mail.de
+iencm.com
+iffymedia.com
+ige.es
+igg.biz
+ignoremail.com
+ihateyoualot.info
+ihazspam.ca
+iheartspam.org
+ikbenspamvrij.nl
+illistnoise.com
+ilovespam.com
+imail1.net
+imails.info
+imailt.com
+imgof.com
+imgv.de
+immo-gerance.info
+imstations.com
+imul.info
+in-ulm.de
+inactivemachine.com
+inbax.tk
+inbound.plus
+inbox.si
+inbox2.info
+inboxalias.com
+inboxbear.com
+inboxclean.com
+inboxclean.org
+inboxdesign.me
+inboxed.im
+inboxed.pw
+inboxkitten.com
+inboxproxy.com
+inboxstore.me
+inclusiveprogress.com
+incognitomail.com
+incognitomail.net
+incognitomail.org
+incq.com
+ind.st
+indieclad.com
+indirect.ws
+indomaed.pw
+indomina.cf
+indoserver.stream
+indosukses.press
+ineec.net
+infocom.zp.ua
+inggo.org
+inkomail.com
+inmynetwork.tk
+inoutmail.de
+inoutmail.eu
+inoutmail.info
+inoutmail.net
+inpwa.com
+insanumingeniumhomebrew.com
+insorg-mail.info
+instaddr.ch
+instance-email.com
+instant-mail.de
+instantblingmail.info
+instantemailaddress.com
+instantmail.fr
+internet-v-stavropole.ru
+internetoftags.com
+interstats.org
+intersteller.com
+intopwa.com
+intopwa.net
+intopwa.org
+investore.co
+iozak.com
+ip4.pp.ua
+ip6.li
+ip6.pp.ua
+ipoo.org
+ippandansei.tk
+ipsur.org
+irabops.com
+irc.so
+irish2me.com
+irishspringrealty.com
+iroid.com
+ironiebehindert.de
+irssi.tv
+is.af
+isdaq.com
+ishop2k.com
+isosq.com
+istii.ro
+isukrainestillacountry.com
+it7.ovh
+italy-mail.com
+itcompu.com
+itfast.net
+itunesgiftcodegenerator.com
+iubridge.com
+iuemail.men
+iwi.net
+ixaks.com
+ixx.io
+j-p.us
+jafps.com
+jajxz.com
+janproz.com
+jaqis.com
+jdmadventures.com
+jdz.ro
+je-recycle.info
+jellow.ml
+jellyrolls.com
+jeoce.com
+jet-renovation.fr
+jetable.com
+jetable.net
+jetable.org
+jetable.pp.ua
+jiooq.com
+jmail.ovh
+jmail.ro
+jnxjn.com
+jobbikszimpatizans.hu
+jobposts.net
+jobs-to-be-done.net
+joelpet.com
+joetestalot.com
+jopho.com
+joseihorumon.info
+josse.ltd
+jourrapide.com
+jpco.org
+jsrsolutions.com
+jumonji.tk
+jungkamushukum.com
+junk.to
+junk1e.com
+junkmail.ga
+junkmail.gq
+just-email.com
+justemail.ml
+juyouxi.com
+jwork.ru
+kademen.com
+kadokawa.cf
+kadokawa.ga
+kadokawa.gq
+kadokawa.ml
+kadokawa.tk
+kaengu.ru
+kagi.be
+kakadua.net
+kalapi.org
+kamen-market.ru
+kamsg.com
+kaovo.com
+kappala.info
+kara-turk.net
+karatraman.ml
+kariplan.com
+karta-kykyruza.ru
+kartvelo.com
+kasmail.com
+kaspop.com
+katztube.com
+kazelink.ml
+kbox.li
+kcrw.de
+keepmymail.com
+keinhirn.de
+keipino.de
+kekita.com
+kellychibale-researchgroup-uct.com
+kemptvillebaseball.com
+kennedy808.com
+kiani.com
+killmail.com
+killmail.net
+kimsdisk.com
+kingsq.ga
+kino-100.ru
+kiois.com
+kismail.ru
+kisstwink.com
+kitnastar.com
+kjkszpjcompany.com
+kkmail.be
+kksm.be
+klassmaster.com
+klassmaster.net
+klick-tipp.us
+klipschx12.com
+kloap.com
+kludgemush.com
+klzlk.com
+kmail.li
+kmhow.com
+knol-power.nl
+kobrandly.com
+kommunity.biz
+kon42.com
+konultant-jurist.ru
+kook.ml
+kopagas.com
+kopaka.net
+korona-nedvizhimosti.ru
+koshu.ru
+kosmetik-obatkuat.com
+kostenlosemailadresse.de
+koszmail.pl
+kpay.be
+kpooa.com
+kpost.be
+krd.ag
+krsw.tk
+kruay.com
+krypton.tk
+ksmtrck.tk
+kuhrap.com
+kulmeo.com
+kulturbetrieb.info
+kurzepost.de
+kutakbisajauhjauh.gq
+kvhrr.com
+kvhrs.com
+kvhrw.com
+kwift.net
+kwilco.net
+kyal.pl
+kyois.com
+kzccv.com
+l-c-a.us
+l33r.eu
+l6factors.com
+labetteraverouge.at
+labworld.org
+lacedmail.com
+lackmail.net
+lackmail.ru
+lacto.info
+lags.us
+lain.ch
+lak.pp.ua
+lakelivingstonrealestate.com
+lakqs.com
+lamasticots.com
+landmail.co
+laoeq.com
+larisia.com
+last-chance.pro
+lastmail.co
+lastmail.com
+lawlita.com
+lazyinbox.com
+lazyinbox.us
+ldaho.biz
+ldop.com
+ldtp.com
+le-tim.ru
+lee.mx
+leeching.net
+leetmail.co
+legalrc.loan
+lellno.gq
+lenovog4.com
+lerbhe.com
+letmeinonthis.com
+letthemeatspam.com
+lez.se
+lgxscreen.com
+lhsdv.com
+liamcyrus.com
+lifebyfood.com
+lifetimefriends.info
+lifetotech.com
+ligsb.com
+lillemap.net
+lilo.me
+lindenbaumjapan.com
+link2mail.net
+linkedintuts2016.pw
+linshiyouxiang.net
+linuxmail.so
+litedrop.com
+liveradio.tk
+lkgn.se
+llogin.ru
+loadby.us
+loan101.pro
+loaoa.com
+loapq.com
+locanto1.club
+locantofuck.top
+locantowsite.club
+locomodev.net
+login-email.cf
+login-email.ga
+login-email.ml
+login-email.tk
+logular.com
+loh.pp.ua
+loin.in
+lolfreak.net
+lolmail.biz
+lookugly.com
+lordsofts.com
+lortemail.dk
+losemymail.com
+lovemeet.faith
+lovemeleaveme.com
+lpfmgmtltd.com
+lr7.us
+lr78.com
+lroid.com
+lru.me
+ls-server.ru
+lsyx24.com
+luckymail.org
+lukecarriere.com
+lukemail.info
+lukop.dk
+luv2.us
+lyfestylecreditsolutions.com
+lzoaq.com
+m21.cc
+m4ilweb.info
+maboard.com
+mac-24.com
+macr2.com
+macromaid.com
+macromice.info
+magamail.com
+maggotymeat.ga
+magicbox.ro
+magim.be
+magspam.net
+maidlow.info
+mail-card.net
+mail-easy.fr
+mail-filter.com
+mail-help.net
+mail-hosting.co
+mail-hub.info
+mail-now.top
+mail-owl.com
+mail-share.com
+mail-temporaire.com
+mail-temporaire.fr
+mail-tester.com
+mail.by
+mail.wtf
+mail0.ga
+mail1.top
+mail114.net
+mail1a.de
+mail1web.org
+mail21.cc
+mail22.club
+mail2rss.org
+mail333.com
+mail4trash.com
+mail666.ru
+mail7.io
+mail707.com
+mail72.com
+mailapp.top
+mailback.com
+mailbidon.com
+mailbiz.biz
+mailblocks.com
+mailbox.in.ua
+mailbox52.ga
+mailbox80.biz
+mailbox82.biz
+mailbox87.de
+mailbox92.biz
+mailboxy.fun
+mailbucket.org
+mailcat.biz
+mailcatch.com
+mailchop.com
+mailcker.com
+maildax.me
+mailde.de
+mailde.info
+maildrop.cc
+maildrop.cf
+maildrop.ga
+maildrop.gq
+maildrop.ml
+maildu.de
+maildx.com
+maileater.com
+mailed.in
+mailed.ro
+maileimer.de
+maileme101.com
+mailexpire.com
+mailf5.com
+mailfa.tk
+mailfall.com
+mailfirst.icu
+mailforspam.com
+mailfree.ga
+mailfree.gq
+mailfree.ml
+mailfreeonline.com
+mailfs.com
+mailguard.me
+mailgutter.com
+mailhazard.com
+mailhazard.us
+mailhex.com
+mailhub.pro
+mailhz.me
+mailimate.com
+mailin8r.com
+mailinatar.com
+mailinater.com
+mailinator.co.uk
+mailinator.com
+mailinator.gq
+mailinator.info
+mailinator.net
+mailinator.org
+mailinator.us
+mailinator0.com
+mailinator1.com
+mailinator2.com
+mailinator2.net
+mailinator3.com
+mailinator4.com
+mailinator5.com
+mailinator6.com
+mailinator7.com
+mailinator8.com
+mailinator9.com
+mailincubator.com
+mailismagic.com
+mailita.tk
+mailjunk.cf
+mailjunk.ga
+mailjunk.gq
+mailjunk.ml
+mailjunk.tk
+mailmate.com
+mailme.gq
+mailme.ir
+mailme.lv
+mailme24.com
+mailmetrash.com
+mailmoat.com
+mailmoth.com
+mailms.com
+mailna.biz
+mailna.co
+mailna.in
+mailna.me
+mailnator.com
+mailnesia.com
+mailnull.com
+mailonaut.com
+mailorc.com
+mailorg.org
+mailox.fun
+mailpick.biz
+mailpluss.com
+mailpooch.com
+mailpoof.com
+mailpress.gq
+mailproxsy.com
+mailquack.com
+mailrock.biz
+mailsac.com
+mailscrap.com
+mailseal.de
+mailshell.com
+mailshiv.com
+mailsiphon.com
+mailslapping.com
+mailslite.com
+mailsucker.net
+mailt.net
+mailt.top
+mailtechx.com
+mailtemp.info
+mailtemporaire.com
+mailtemporaire.fr
+mailto.plus
+mailtome.de
+mailtothis.com
+mailtraps.com
+mailtrash.net
+mailtrix.net
+mailtv.net
+mailtv.tv
+mailuniverse.co.uk
+mailzi.ru
+mailzilla.com
+mailzilla.org
+mainerfolg.info
+makemenaughty.club
+makemetheking.com
+malahov.de
+malayalamdtp.com
+mama3.org
+mamulenok.ru
+mandraghen.cf
+manifestgenerator.com
+mannawo.com
+mansiondev.com
+manybrain.com
+mark-compressoren.ru
+marketlink.info
+markmurfin.com
+mask03.ru
+masonline.info
+maswae.world
+matamuasu.ga
+matchpol.net
+matra.site
+max-mail.org
+mbox.re
+mbx.cc
+mcache.net
+mciek.com
+mdhc.tk
+meantinc.com
+mebelnu.info
+mechanicalresumes.com
+medkabinet-uzi.ru
+meepsheep.eu
+meinspamschutz.de
+meltedbrownies.com
+meltmail.com
+memsg.site
+mentonit.net
+mepost.pw
+merry.pink
+messagebeamer.de
+messwiththebestdielikethe.rest
+metadownload.org
+metaintern.net
+metalunits.com
+mezimages.net
+mfsa.info
+mfsa.ru
+mhzayt.online
+miaferrari.com
+miauj.com
+midcoastcustoms.com
+midcoastcustoms.net
+midcoastsolutions.com
+midcoastsolutions.net
+midiharmonica.com
+midlertidig.com
+midlertidig.net
+midlertidig.org
+mierdamail.com
+migmail.net
+migmail.pl
+migumail.com
+mihep.com
+mijnhva.nl
+ministry-of-silly-walks.de
+minsmail.com
+mintemail.com
+mirai.re
+misterpinball.de
+miucce.com
+mji.ro
+mjj.edu.ge
+mjukglass.nu
+mkpfilm.com
+ml8.ca
+mm.my
+mm5.se
+mnode.me
+moakt.cc
+moakt.co
+moakt.com
+moakt.ws
+mobileninja.co.uk
+mobilevpn.top
+moburl.com
+mockmyid.com
+moeri.org
+mofu.be
+mohmal.com
+mohmal.im
+mohmal.in
+mohmal.tech
+moimoi.re
+molms.com
+momentics.ru
+monachat.tk
+monadi.ml
+moneypipe.net
+monumentmail.com
+moonwake.com
+moot.es
+moreawesomethanyou.com
+moreorcs.com
+morriesworld.ml
+morsin.com
+moruzza.com
+motique.de
+mountainregionallibrary.net
+mox.pp.ua
+moy-elektrik.ru
+moza.pl
+mozej.com
+mp-j.ga
+mr24.co
+mrvpm.net
+mrvpt.com
+msgos.com
+mspeciosa.com
+msrc.ml
+mswork.ru
+msxd.com
+mt2009.com
+mt2014.com
+mt2015.com
+mtmdev.com
+muathegame.com
+muchomail.com
+mucincanon.com
+muehlacker.tk
+muell.icu
+muell.monster
+muell.xyz
+muellemail.com
+muellmail.com
+munoubengoshi.gq
+musiccode.me
+mutant.me
+mvrht.com
+mvrht.net
+mwarner.org
+mxclip.com
+mxfuel.com
+my-pomsies.ru
+my-teddyy.ru
+my10minutemail.com
+mybitti.de
+mycleaninbox.net
+mycorneroftheinter.net
+myde.ml
+mydemo.equipment
+myecho.es
+myemailboxy.com
+mygeoweb.info
+myindohome.services
+myinterserver.ml
+mykickassideas.com
+mymail-in.net
+mymail90.com
+mymailoasis.com
+mynetstore.de
+myopang.com
+mypacks.net
+mypartyclip.de
+myphantomemail.com
+mysamp.de
+myspaceinc.com
+myspaceinc.net
+myspaceinc.org
+myspacepimpedup.com
+myspamless.com
+mystvpn.com
+mysugartime.ru
+mytemp.email
+mytempemail.com
+mytempmail.com
+mytrashmail.com
+mywarnernet.net
+mywrld.site
+mywrld.top
+myzx.com
+mzico.com
+n1nja.org
+na-cat.com
+nabuma.com
+nada.email
+nada.ltd
+nagi.be
+nakedtruth.biz
+nanonym.ch
+naslazhdai.ru
+nationalgardeningclub.com
+nawmin.info
+nbzmr.com
+negated.com
+neko2.net
+nekochan.fr
+neomailbox.com
+neotlozhniy-zaim.ru
+nepwk.com
+nervmich.net
+nervtmich.net
+net1mail.com
+netcom.ws
+netmails.com
+netmails.net
+netricity.nl
+netris.net
+netviewer-france.com
+netzidiot.de
+nevermail.de
+newbpotato.tk
+newfilm24.ru
+newideasfornewpeople.info
+newmail.top
+next.ovh
+nextmail.info
+nextstopvalhalla.com
+nezdiro.org
+nezid.com
+nezumi.be
+nezzart.com
+nfast.net
+nguyenusedcars.com
+nh3.ro
+nice-4u.com
+nicknassar.com
+nincsmail.com
+nincsmail.hu
+niseko.be
+niwl.net
+nm7.cc
+nmail.cf
+nnh.com
+nnot.net
+nnoway.ru
+no-spam.ws
+no-ux.com
+noblepioneer.com
+nobugmail.com
+nobulk.com
+nobuma.com
+noclickemail.com
+nodezine.com
+nogmailspam.info
+noicd.com
+nokiamail.com
+nolemail.ga
+nomail.cf
+nomail.ga
+nomail.pw
+nomail2me.com
+nomorespamemails.com
+nonspam.eu
+nonspammer.de
+nonze.ro
+noref.in
+norseforce.com
+norwegischlernen.info
+nospam4.us
+nospamfor.us
+nospamthanks.info
+nothingtoseehere.ca
+notif.me
+notmailinator.com
+notrnailinator.com
+notsharingmy.info
+now.im
+nowhere.org
+nowmymail.com
+nowmymail.net
+nproxi.com
+nthrl.com
+ntlhelp.net
+nubescontrol.com
+nullbox.info
+nurfuerspam.de
+nut.cc
+nutpa.net
+nuts2trade.com
+nvhrw.com
+nwldx.com
+nwytg.com
+nwytg.net
+ny7.me
+nypato.com
+nyrmusic.com
+o2stk.org
+o7i.net
+oalsp.com
+obfusko.com
+objectmail.com
+obobbo.com
+oborudovanieizturcii.ru
+obxpestcontrol.com
+octovie.com
+odaymail.com
+odem.com
+odnorazovoe.ru
+oepia.com
+oerpub.org
+offshore-proxies.net
+ohaaa.de
+ohi.tw
+oida.icu
+oing.cf
+okclprojects.com
+okinawa.li
+okrent.us
+okzk.com
+olimp-case.ru
+olypmall.ru
+omail.pro
+omnievents.org
+omtecha.com
+one-mail.top
+one-time.email
+one2mail.info
+onekisspresave.com
+onemail.host
+oneoffemail.com
+oneoffmail.com
+onetm.jp
+onewaymail.com
+onlatedotcom.info
+online.ms
+onlineidea.info
+onqin.com
+ontyne.biz
+oohioo.com
+oolus.com
+oonies-shoprus.ru
+oopi.org
+oosln.com
+opayq.com
+openavz.com
+opendns.ro
+opentrash.com
+opmmedia.ga
+opp24.com
+optimaweb.me
+opwebw.com
+oranek.com
+ordinaryamerican.net
+oreidresume.com
+orgmbx.cc
+oroki.de
+oshietechan.link
+otherinbox.com
+ourklips.com
+ourpreviewdomain.com
+outlawspam.com
+outmail.win
+ovomail.co
+ovpn.to
+owleyes.ch
+owlpic.com
+ownsyou.de
+oxopoha.com
+ozyl.de
+p-banlis.ru
+p33.org
+p71ce1m.com
+pa9e.com
+pachilly.com
+packiu.com
+pagamenti.tk
+paharpurmim.ga
+pakadebu.ga
+pancakemail.com
+papierkorb.me
+paplease.com
+para2019.ru
+parlimentpetitioner.tk
+pastebitch.com
+patonce.com
+pavilionx2.com
+payperex2.com
+payspun.com
+pe.hu
+pecinan.com
+pecinan.net
+pecinan.org
+penisgoes.in
+penoto.tk
+pepbot.com
+peterdethier.com
+petloca.com
+petrzilka.net
+pewpewpewpew.pw
+pfui.ru
+phone-elkey.ru
+photo-impact.eu
+photomark.net
+pi.vu
+piaa.me
+pig.pp.ua
+pii.at
+piki.si
+pimpedupmyspace.com
+pinehill-seattle.org
+pingir.com
+pipemail.space
+pisls.com
+pitaniezdorovie.ru
+pivo-bar.ru
+pjjkp.com
+placebomail10.com
+pleasenoham.org
+plexfirm.com
+plexolan.de
+plhk.ru
+ploae.com
+plw.me
+poehali-otdihat.ru
+pojok.ml
+pokemail.net
+pokiemobile.com
+polarkingxx.ml
+politikerclub.de
+polyfaust.net
+pooae.com
+poofy.org
+pookmail.com
+poopiebutt.club
+popcornfarm7.com
+popcornfly.com
+popesodomy.com
+popgx.com
+porjoton.com
+porsh.net
+posdz.com
+posta.store
+postacin.com
+postonline.me
+poutineyourface.com
+powered.name
+powerencry.com
+powlearn.com
+pp7rvv.com
+ppetw.com
+pptrvv.com
+pqoia.com
+pratikmail.com
+pratikmail.net
+pratikmail.org
+prazdnik-37.ru
+predatorrat.cf
+predatorrat.ga
+predatorrat.gq
+predatorrat.ml
+predatorrat.tk
+premium-mail.fr
+primabananen.net
+prin.be
+privacy.net
+privatdemail.net
+privy-mail.com
+privy-mail.de
+privymail.de
+pro-tag.org
+pro5g.com
+procrackers.com
+profast.top
+projectcl.com
+promailt.com
+proprietativalcea.ro
+propscore.com
+protempmail.com
+proxymail.eu
+proxyparking.com
+prtnx.com
+prtshr.com
+prtz.eu
+psh.me
+psles.com
+psoxs.com
+puglieisi.com
+puji.pro
+punkass.com
+puppetmail.de
+purcell.email
+purelogistics.org
+put2.net
+puttanamaiala.tk
+putthisinyourspamdatabase.com
+pwrby.com
+qasti.com
+qbfree.us
+qc.to
+qibl.at
+qiott.com
+qipmail.net
+qiq.us
+qisdo.com
+qisoa.com
+qmrbe.com
+qoika.com
+qopow.com
+qq.my
+qsl.ro
+qtum-ico.com
+quadrafit.com
+quick-mail.cc
+quickemail.info
+quickinbox.com
+quickmail.nl
+quicksend.ch
+ququb.com
+qvy.me
+qwickmail.com
+r4nd0m.de
+ra3.us
+rabin.ca
+rabiot.reisen
+rackabzar.com
+raetp9.com
+rainbowly.ml
+raketenmann.de
+rancidhome.net
+randomail.io
+randomail.net
+rapt.be
+raqid.com
+rax.la
+raxtest.com
+razemail.com
+razuz.com
+rbb.org
+rcasd.com
+rcpt.at
+rdklcrv.xyz
+re-gister.com
+reality-concept.club
+reallymymail.com
+realtyalerts.ca
+rebates.stream
+receiveee.com
+recipeforfailure.com
+recode.me
+reconmail.com
+recyclemail.dk
+redfeathercrow.com
+reftoken.net
+regbypass.com
+regspaces.tk
+reimondo.com
+rejectmail.com
+rejo.technology
+reliable-mail.com
+remail.cf
+remail.ga
+remarkable.rocks
+remote.li
+reptilegenetics.com
+resgedvgfed.tk
+revolvingdoorhoax.org
+rfc822.org
+rhyta.com
+richfinances.pw
+riddermark.de
+rifkian.ga
+rippb.com
+risingsuntouch.com
+riski.cf
+rklips.com
+rkomo.com
+rm2rf.com
+rma.ec
+rmqkr.net
+rnailinator.com
+ro.lt
+robertspcrepair.com
+robot-mail.com
+rollindo.agency
+ronnierage.net
+rootfest.net
+rosebearmylove.ru
+rotaniliam.com
+rover.info
+rowe-solutions.com
+royal.net
+royaldoodles.org
+royalmarket.life
+royandk.com
+rppkn.com
+rsvhr.com
+rtrtr.com
+rtskiya.xyz
+rudymail.ml
+rumgel.com
+runi.ca
+rupayamail.com
+ruru.be
+rustydoor.com
+rvb.ro
+ryteto.me
+s0ny.net
+s33db0x.com
+sabrestlouis.com
+sackboii.com
+safaat.cf
+safermail.info
+safersignup.de
+safetymail.info
+safetypost.de
+saharanightstempe.com
+salmeow.tk
+samsclass.info
+sandcars.net
+sandelf.de
+sandwhichvideo.com
+sanfinder.com
+sanim.net
+sanstr.com
+sast.ro
+satisfyme.club
+satukosong.com
+sausen.com
+saynotospams.com
+scatmail.com
+scay.net
+schachrol.com
+schafmail.de
+schmeissweg.tk
+schrott-email.de
+scrsot.com
+sd3.in
+sdvft.com
+sdvgeft.com
+sdvrecft.com
+secmail.pw
+secretemail.de
+secure-mail.biz
+secure-mail.cc
+secured-link.net
+securehost.com.es
+seekapps.com
+seekjobs4u.com
+sejaa.lv
+selfdestructingmail.com
+selfdestructingmail.org
+send22u.info
+sendfree.org
+sendingspecialflyers.com
+sendnow.win
+sendspamhere.com
+senseless-entertainment.com
+server.ms
+services391.com
+sexforswingers.com
+sexical.com
+sexyalwasmi.top
+shadap.org
+shalar.net
+sharedmailbox.org
+sharklasers.com
+sheryli.com
+shhmail.com
+shhuut.org
+shieldedmail.com
+shieldemail.com
+shiftmail.com
+shipfromto.com
+shiphazmat.org
+shipping-regulations.com
+shippingterms.org
+shitaway.tk
+shitmail.de
+shitmail.me
+shitmail.org
+shmeriously.com
+shopxda.com
+shortmail.net
+shotmail.ru
+showslow.de
+shrib.com
+shut.name
+shut.ws
+siberpay.com
+sidelka-mytischi.ru
+siftportal.ru
+sify.com
+sika3.com
+sikux.com
+siliwangi.ga
+silvercoin.life
+sim-simka.ru
+simaenaga.com
+simpleitsecurity.info
+sin.cl
+sinaite.net
+sinema.ml
+sinfiltro.cl
+singlespride.com
+sinnlos-mail.de
+sino.tw
+siteposter.net
+sizzlemctwizzle.com
+sjuaq.com
+skeefmail.com
+skrx.tk
+sky-inbox.com
+sky-ts.de
+skyrt.de
+slapsfromlastnight.com
+slaskpost.se
+slave-auctions.net
+slippery.email
+slipry.net
+slopsbox.com
+slothmail.net
+slushmail.com
+sluteen.com
+sly.io
+smallker.tk
+smapfree24.com
+smapfree24.de
+smapfree24.eu
+smapfree24.info
+smapfree24.org
+smarttalent.pw
+smashmail.de
+smellfear.com
+smellrear.com
+smellypotato.tk
+smtp99.com
+smwg.info
+snakemail.com
+snapwet.com
+sneakmail.de
+snece.com
+social-mailer.tk
+socialfurry.org
+sofia.re
+sofimail.com
+sofort-mail.de
+sofortmail.de
+sofrge.com
+softkey-office.ru
+softpls.asia
+sogetthis.com
+sohai.ml
+sohus.cn
+soioa.com
+soisz.com
+solar-impact.pro
+solvemail.info
+solventtrap.wiki
+songsign.com
+sonshi.cf
+soodmail.com
+soodomail.com
+soodonims.com
+soon.it
+spacebazzar.ru
+spam-be-gone.com
+spam.care
+spam.la
+spam.org.es
+spam.su
+spam4.me
+spamail.de
+spamarrest.com
+spamavert.com
+spambob.com
+spambob.net
+spambob.org
+spambog.com
+spambog.de
+spambog.net
+spambog.ru
+spambooger.com
+spambox.info
+spambox.me
+spambox.org
+spambox.us
+spamcero.com
+spamcon.org
+spamcorptastic.com
+spamcowboy.com
+spamcowboy.net
+spamcowboy.org
+spamday.com
+spamdecoy.net
+spamex.com
+spamfighter.cf
+spamfighter.ga
+spamfighter.gq
+spamfighter.ml
+spamfighter.tk
+spamfree.eu
+spamfree24.com
+spamfree24.de
+spamfree24.eu
+spamfree24.info
+spamfree24.net
+spamfree24.org
+spamgoes.in
+spamherelots.com
+spamhereplease.com
+spamhole.com
+spamify.com
+spaminator.de
+spamkill.info
+spaml.com
+spaml.de
+spamlot.net
+spammer.fail
+spammotel.com
+spammy.host
+spamobox.com
+spamoff.de
+spamsalad.in
+spamslicer.com
+spamsphere.com
+spamspot.com
+spamstack.net
+spamthis.co.uk
+spamthis.network
+spamthisplease.com
+spamtrail.com
+spamtrap.ro
+spamtroll.net
+spamwc.cf
+spamwc.ga
+spamwc.gq
+spamwc.ml
+speedgaus.net
+sperma.cf
+spikio.com
+spindl-e.com
+spoofmail.de
+spr.io
+spritzzone.de
+spruzme.com
+spybox.de
+spymail.com
+squizzy.de
+squizzy.net
+sroff.com
+sry.li
+ssoia.com
+stanfordujjain.com
+starlight-breaker.net
+starpower.space
+startfu.com
+startkeys.com
+statdvr.com
+stathost.net
+statiix.com
+stayhome.li
+steam-area.ru
+steambot.net
+stexsy.com
+stinkefinger.net
+stop-my-spam.cf
+stop-my-spam.com
+stop-my-spam.ga
+stop-my-spam.ml
+stop-my-spam.pp.ua
+stop-my-spam.tk
+stopspam.app
+storiqax.top
+storj99.com
+storj99.top
+streetwisemail.com
+stromox.com
+stuckmail.com
+stuffmail.de
+stumpfwerk.com
+stylist-volos.ru
+submic.com
+suburbanthug.com
+suckmyd.com
+sueshaw.com
+suexamplesb.com
+suioe.com
+super-auswahl.de
+supergreatmail.com
+supermailer.jp
+superplatyna.com
+superrito.com
+supersave.net
+superstachel.de
+superyp.com
+suremail.info
+sute.jp
+svip520.cn
+svk.jp
+svxr.org
+sweetpotato.ml
+sweetxxx.de
+swift-mail.net
+swift10minutemail.com
+sylvannet.com
+symphonyresume.com
+syosetu.gq
+syujob.accountants
+szerz.com
+tafmail.com
+tafoi.gr
+taglead.com
+tagmymedia.com
+tagyourself.com
+talkinator.com
+tanukis.org
+tapchicuoihoi.com
+taphear.com
+tapi.re
+tarzanmail.cf
+tastrg.com
+taukah.com
+tb-on-line.net
+tdtda.com
+tech69.com
+techblast.ch
+techemail.com
+techgroup.me
+technoproxy.ru
+teerest.com
+teewars.org
+tefl.ro
+telecomix.pl
+teleworm.com
+teleworm.us
+tellos.xyz
+teml.net
+temp-link.net
+temp-mail.com
+temp-mail.de
+temp-mail.org
+temp-mail.pp.ua
+temp-mail.ru
+temp-mails.com
+tempail.com
+tempalias.com
+tempe-mail.com
+tempemail.biz
+tempemail.co.za
+tempemail.com
+tempemail.net
+tempinbox.co.uk
+tempinbox.com
+tempmail.cn
+tempmail.co
+tempmail.de
+tempmail.eu
+tempmail.it
+tempmail.pp.ua
+tempmail.us
+tempmail.ws
+tempmail2.com
+tempmaildemo.com
+tempmailer.com
+tempmailer.de
+tempmailer.net
+tempmailo.com
+tempomail.fr
+tempomail.org
+temporarily.de
+temporarioemail.com.br
+temporary-mail.net
+temporaryemail.net
+temporaryemail.us
+temporaryforwarding.com
+temporaryinbox.com
+temporarymailaddress.com
+tempr.email
+tempsky.com
+tempthe.net
+tempymail.com
+tensi.org
+ternaklele.ga
+testore.co
+testudine.com
+thanksnospam.info
+thankyou2010.com
+thatim.info
+thc.st
+theaviors.com
+thebearshark.com
+thecarinformation.com
+thechildrensfocus.com
+thecity.biz
+thecloudindex.com
+thediamants.org
+thedirhq.info
+theeyeoftruth.com
+thejoker5.com
+thelightningmail.net
+thelimestones.com
+thembones.com.au
+themegreview.com
+themostemail.com
+thereddoors.online
+theroyalweb.club
+thescrappermovie.com
+theteastory.info
+thex.ro
+thichanthit.com
+thietbivanphong.asia
+thisisnotmyrealemail.com
+thismail.net
+thisurl.website
+thnikka.com
+thoas.ru
+thraml.com
+thrma.com
+throam.com
+thrott.com
+throwam.com
+throwawayemailaddress.com
+throwawaymail.com
+throwawaymail.pp.ua
+throya.com
+thrubay.com
+thunderbolt.science
+thunkinator.org
+thxmate.com
+tiapz.com
+tic.ec
+tilien.com
+timgiarevn.com
+timkassouf.com
+tinoza.org
+tinyurl24.com
+tipsb.com
+tittbit.in
+tiv.cc
+tizi.com
+tkitc.de
+tlpn.org
+tmail.com
+tmail.ws
+tmailinator.com
+tmails.net
+tmpbox.net
+tmpemails.com
+tmpeml.com
+tmpeml.info
+tmpjr.me
+tmpmail.net
+tmpmail.org
+toddsbighug.com
+tofeat.com
+toiea.com
+tokem.co
+tokenmail.de
+tonaeto.com
+tonne.to
+tonymanso.com
+toomail.biz
+toon.ml
+top-shop-tovar.ru
+top101.de
+top1mail.ru
+top1post.ru
+topinrock.cf
+topmail2.com
+topmail2.net
+topofertasdehoy.com
+topranklist.de
+toprumours.com
+tormail.org
+toss.pw
+tosunkaya.com
+totallynotfake.net
+totalvista.com
+totesmail.com
+totoan.info
+tourcc.com
+tp-qa-mail.com
+tqoai.com
+tqosi.com
+tradermail.info
+tranceversal.com
+trash-amil.com
+trash-mail.at
+trash-mail.cf
+trash-mail.com
+trash-mail.de
+trash-mail.ga
+trash-mail.gq
+trash-mail.ml
+trash-mail.tk
+trash-me.com
+trash2009.com
+trash2010.com
+trash2011.com
+trashcanmail.com
+trashdevil.com
+trashdevil.de
+trashemail.de
+trashemails.de
+trashinbox.com
+trashmail.at
+trashmail.com
+trashmail.de
+trashmail.gq
+trashmail.io
+trashmail.me
+trashmail.net
+trashmail.org
+trashmail.ws
+trashmailer.com
+trashmailgenerator.de
+trashmails.com
+trashymail.com
+trashymail.net
+trasz.com
+trayna.com
+trbvm.com
+trbvn.com
+trbvo.com
+trend-maker.ru
+trgfu.com
+trgovinanaveliko.info
+trialmail.de
+trickmail.net
+trillianpro.com
+trixtrux1.ru
+trollproject.com
+tropicalbass.info
+trungtamtoeic.com
+truthfinderlogin.com
+tryalert.com
+tryninja.io
+tryzoe.com
+ttirv.org
+ttszuo.xyz
+tualias.com
+tuofs.com
+turoid.com
+turual.com
+turuma.com
+tvchd.com
+tverya.com
+twinmail.de
+twkly.ml
+twocowmail.net
+twoweirdtricks.com
+twzhhq.online
+txen.de
+txtadvertise.com
+tyhe.ro
+tyldd.com
+tympe.net
+uacro.com
+uber-mail.com
+ubismail.net
+ubm.md
+ucche.us
+ucupdong.ml
+uemail99.com
+ufacturing.com
+uggsrock.com
+uguuchantele.com
+uhe2.com
+uhhu.ru
+uiu.us
+ujijima1129.gq
+uk.to
+ultra.fyi
+ultrada.ru
+uma3.be
+umail.net
+undo.it
+unicodeworld.com
+unids.com
+unimark.org
+unit7lahaina.com
+unmail.ru
+uooos.com
+upliftnow.com
+uplipht.com
+uploadnolimit.com
+upozowac.info
+urfunktion.se
+urhen.com
+uroid.com
+us.af
+us.to
+usa.cc
+usako.net
+usbc.be
+used-product.fr
+ushijima1129.cf
+ushijima1129.ga
+ushijima1129.gq
+ushijima1129.ml
+ushijima1129.tk
+utiket.us
+uu.gl
+uu2.ovh
+uuf.me
+uwork4.us
+uyhip.com
+vaasfc4.tk
+vaati.org
+valemail.net
+valhalladev.com
+vankin.de
+vctel.com
+vda.ro
+vddaz.com
+vdig.com
+veanlo.com
+vemomail.win
+venompen.com
+veo.kr
+ver0.cf
+ver0.ga
+ver0.gq
+ver0.ml
+ver0.tk
+vercelli.cf
+vercelli.ga
+vercelli.gq
+vercelli.ml
+verdejo.com
+vermutlich.net
+veryday.ch
+veryday.eu
+veryday.info
+veryrealemail.com
+vesa.pw
+vevs.de
+vfemail.net
+via.tokyo.jp
+vickaentb.tk
+victime.ninja
+victoriantwins.com
+vidchart.com
+viditag.com
+viewcastmedia.com
+viewcastmedia.net
+viewcastmedia.org
+vikingsonly.com
+vinernet.com
+vintomaper.com
+vipepe.com
+vipmail.name
+vipmail.pw
+vipxm.net
+viralplays.com
+virtualemail.info
+visal007.tk
+visal168.cf
+visal168.ga
+visal168.gq
+visal168.ml
+visal168.tk
+vixletdev.com
+vixtricks.com
+vkcode.ru
+vmailing.info
+vmani.com
+vmpanda.com
+vnedu.me
+voidbay.com
+volaj.com
+voltaer.com
+vomoto.com
+vorga.org
+votiputox.org
+voxelcore.com
+vpn.st
+vps30.com
+vps911.net
+vradportal.com
+vremonte24-store.ru
+vrmtr.com
+vsimcard.com
+vssms.com
+vtxmail.us
+vubby.com
+vuiy.pw
+vusra.com
+vztc.com
+w-asertun.ru
+w3internet.co.uk
+wakingupesther.com
+walala.org
+walkmail.net
+walkmail.ru
+wallm.com
+wanko.be
+watch-harry-potter.com
+watchever.biz
+watchfull.net
+watchironman3onlinefreefullmovie.com
+wazabi.club
+wbdev.tech
+wbml.net
+web-contact.info
+web-ideal.fr
+web-inc.net
+web-mail.pp.ua
+web2mailco.com
+webcontact-france.eu
+webemail.me
+webhook.site
+webm4il.info
+webmail24.top
+webtrip.ch
+webuser.in
+wee.my
+wef.gr
+weg-werf-email.de
+wegwerf-email-addressen.de
+wegwerf-email-adressen.de
+wegwerf-email.at
+wegwerf-email.de
+wegwerf-email.net
+wegwerf-emails.de
+wegwerfadresse.de
+wegwerfemail.com
+wegwerfemail.de
+wegwerfemail.info
+wegwerfemail.net
+wegwerfemail.org
+wegwerfemailadresse.com
+wegwerfmail.de
+wegwerfmail.info
+wegwerfmail.net
+wegwerfmail.org
+wegwerpmailadres.nl
+wegwrfmail.de
+wegwrfmail.net
+wegwrfmail.org
+wekawa.com
+welikecookies.com
+wellsfargocomcardholders.com
+wemel.top
+wetrainbayarea.com
+wetrainbayarea.org
+wfgdfhj.tk
+wg0.com
+wh4f.org
+whatiaas.com
+whatifanalytics.com
+whatpaas.com
+whatsaas.com
+whiffles.org
+whopy.com
+whyspam.me
+wibblesmith.com
+wickmail.net
+widaryanto.info
+widget.gg
+wierie.tk
+wifimaple.com
+wifioak.com
+wikidocuslava.ru
+wilemail.com
+willhackforfood.biz
+willselfdestruct.com
+wimsg.com
+winemaven.info
+wins.com.br
+wlist.ro
+wmail.cf
+wmail.club
+wokcy.com
+wolfmail.ml
+wolfsmail.tk
+wollan.info
+worldspace.link
+wpdork.com
+wpg.im
+wralawfirm.com
+writeme.us
+wronghead.com
+ws.gy
+wsym.de
+wudet.men
+wuespdj.xyz
+wupics.com
+wuuvo.com
+wuzup.net
+wuzupmail.net
+wwjmp.com
+wwwnew.eu
+wxnw.net
+x24.com
+xagloo.co
+xagloo.com
+xbaby69.top
+xcode.ro
+xcodes.net
+xcompress.com
+xcoxc.com
+xcpy.com
+xemaps.com
+xemne.com
+xents.com
+xjoi.com
+xkx.me
+xl.cx
+xmail.com
+xmailer.be
+xmaily.com
+xn--9kq967o.com
+xn--d-bga.net
+xojxe.com
+xost.us
+xoxox.cc
+xperiae5.com
+xrap.de
+xrho.com
+xvx.us
+xwaretech.com
+xwaretech.info
+xwaretech.net
+xww.ro
+xxhamsterxx.ga
+xxi2.com
+xxlocanto.us
+xxolocanto.us
+xxqx3802.com
+xy9ce.tk
+xyzfree.net
+xzsok.com
+yabai-oppai.tk
+yahmail.top
+yahooproduct.net
+yamail.win
+yanet.me
+yannmail.win
+yapped.net
+yaqp.com
+yarnpedia.ga
+ycare.de
+ycn.ro
+ye.vc
+yedi.org
+yeezus.ru
+yep.it
+yermail.net
+yhg.biz
+ynmrealty.com
+yodx.ro
+yogamaven.com
+yoggm.com
+yomail.info
+yoo.ro
+yopmail.com
+yopmail.fr
+yopmail.gq
+yopmail.net
+yopmail.pp.ua
+yordanmail.cf
+you-spam.com
+yougotgoated.com
+youmail.ga
+youmailr.com
+youneedmore.info
+youpymail.com
+yourdomain.com
+youremail.cf
+yourewronghereswhy.com
+yourlms.biz
+yourspamgoesto.space
+yourtube.ml
+yroid.com
+yspend.com
+ytpayy.com
+yugasandrika.com
+yui.it
+yuoia.com
+yuurok.com
+yxzx.net
+yyolf.net
+z-o-e-v-a.ru
+z0d.eu
+z1p.biz
+z86.ru
+zain.site
+zainmax.net
+zaktouni.fr
+zarabotokdoma11.ru
+zasod.com
+zaym-zaym.ru
+zcrcd.com
+zdenka.net
+ze.tc
+zebins.com
+zebins.eu
+zehnminuten.de
+zehnminutenmail.de
+zepp.dk
+zetmail.com
+zfymail.com
+zhaoqian.ninja
+zhaoyuanedu.cn
+zhcne.com
+zhewei88.com
+zhorachu.com
+zik.dj
+zipcad.com
+zipo1.gq
+zippymail.info
+zipsendtest.com
+zoaxe.com
+zoemail.com
+zoemail.net
+zoemail.org
+zoetropes.org
+zombie-hive.com
+zomg.info
+zsero.com
+zumpul.com
+zv68.com
+zxcv.com
+zxcvbnm.com
+zymuying.com
+zzi.us
+zzrgg.com
+zzz.com \ No newline at end of file
diff --git a/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php b/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php
index a8942f7..4d4ac81 100644
--- a/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php
+++ b/admin/survey/modules/mod_geoIP/class.SurveyGeoIP.php
@@ -47,10 +47,12 @@ class SurveyGeoIP{
echo '<p class="bold">'.$lang['srv_geoip_warning'].'</p>';
- echo '<div>';
- echo '<div class="floatLeft">';
+ echo '<div class="geoip_holder">';
+
// Izpis tabele frekvenc
+ echo '<div class="geoip_table_holder">';
+
echo '<table class="geoip_table">';
// Prva vrstica
@@ -109,7 +111,7 @@ class SurveyGeoIP{
// Google maps on right of table
if(count($this->countriesLocationsData)>0){
- echo '<div class="floatLeft" style="margin: 15px 0px 0px 50px;">';
+ echo '<div class="geoip_map_holder">';
if(count($this->countriesLocationsData) > 1)
$this->displayNavigationMaps();
@@ -122,6 +124,8 @@ class SurveyGeoIP{
echo '<script type="text/javascript">passMapDataRaw('.json_encode($cities).');googleMapsAPIProcedura(initializeMapGeneralForIPs);</script>';
}
+
+
echo '</div>';
}
@@ -248,29 +252,9 @@ class SurveyGeoIP{
$countries = mb_convert_encoding($this->countriesLocationsData, "UTF-8", "ISO-8859-1");
$cities = mb_convert_encoding($this->data['all']['all']['cities'], "UTF-8", "ISO-8859-1");
- echo '<div class="secondNavigation">';
- echo '<ul class="secondNavigation">';
-
- echo'<li>';
- echo '<a class="no-img active" id="geoip_cities" onclick=\'geoip_map_navigation_toggle(this, '.json_encode($cities).');\'>';
- echo '<span class="label">' . $lang['srv_geoip_map_cities'] . '</span>';
- echo '</a>';
- echo'</li>';
-
- #space
- echo'<li class="space">';
- echo'</li>';
-
- echo'<li>';
- echo '<a class="no-img" id="geoip_countries" onclick=\'geoip_map_navigation_toggle(this, '.json_encode($countries).');\'>';
- echo '<span class="label">' . $lang['srv_geoip_map_countries'] . '</span>';
- echo '</a>';
- echo'</li>';
-
- echo'</ul>';
+ echo '<div class="geoip_navigation">';
+ echo ' <a class="active" id="geoip_cities" onclick=\'geoip_map_navigation_toggle(this, '.json_encode($cities).');\'>'.$lang['srv_geoip_map_cities'].'</a>';
+ echo ' <a id="geoip_countries" onclick=\'geoip_map_navigation_toggle(this, '.json_encode($countries).');\'>'.$lang['srv_geoip_map_countries'].'</a>';
echo '</div>';
-
- echo '<br class="clr" />';
- echo '<br class="clr" />';
}
} \ No newline at end of file
diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php
index 652cfa9..0770ee9 100644
--- a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php
+++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxHierarhijaDostopUporabnikovClass.php
@@ -40,13 +40,14 @@ class AjaxHierarhijaDostopUporabnikovClass {
}else {
echo '<h2> Vpiši uporabnika za dostop do SA modula</h2>';
}
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
echo '<div>';
// EMAIL
echo '<div style="width: 100%;">';
echo '<label>Elektronski naslov</label><br/>';
if(!empty($user)){
- echo '<input type="email" value="'.$user->email .'" disabled="disabled" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="email" value="'.$user->email .'" disabled="disabled" />';
}else{
echo '<input type="email"
value=""
@@ -54,7 +55,7 @@ class AjaxHierarhijaDostopUporabnikovClass {
id="sa-email"
onblur="preveriVpisanEmailZaSAdostop()"
required="required"
- style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ />';
echo '<input type="hidden" value="" id="sa-id" "/>';
echo '<span id="sa-email-sporocilo"></span>';
}
@@ -63,13 +64,13 @@ class AjaxHierarhijaDostopUporabnikovClass {
// Organizzacija
echo '<div style="padding:15px 0;width: 100%;">';
echo '<label>Šola oz. javni zavod</label><br/>';
- echo '<input type="text" value="'.(!empty($user) ? $user->ustanova : NULL).'" placeholder="Srednja šola" id="sa-ustanova" required="required" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="text" value="'.(!empty($user) ? $user->ustanova : NULL).'" placeholder="Srednja šola" id="sa-ustanova" required="required" />';
echo '</div>';
// Email za AAI dostop
echo '<div style="padding-bottom:15px; width: 100%;">';
echo '<label>Elektronski naaslov za AAI dostop (v kolikor je primarni email drugačen od AAI dostopa)</label><br/>';
- echo '<input type="email" value="'.(!empty($user) ? $user->aai_email : NULL).'" placeholder="janez.novak@guest.arnes.si" id="sa-aai" style="width: 80%; padding: 4px; margin: 2px 0;"/>';
+ echo '<input type="email" value="'.(!empty($user) ? $user->aai_email : NULL).'" placeholder="janez.novak@guest.arnes.si" id="sa-aai" />';
echo '</div>';
echo '</div>';
@@ -77,17 +78,29 @@ class AjaxHierarhijaDostopUporabnikovClass {
// Gumb za zapret popup in potrdit
echo '<div class="sa-modul">';
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
if(!empty($user)) {
echo '<a class="ovalbutton ovalbutton_orange sa-potrdi" href="#" onclick="posodobiSAuporabnika(\'' . $user->id . '\')"; return false;"><span>' . $lang['srv_potrdi'] . '</span></a>' . "\n\r";
}else {
echo '<a class="ovalbutton ovalbutton_orange sa-potrdi" href="#" onclick="shraniSAuporabnika()"; return false;"><span>' . $lang['srv_potrdi'] . '</span></a>' . "\n\r";
}
- echo '</div>';
+ echo '</div>'; */
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>' . $lang['srv_close_profile'] . '</span></a>' . "\n\r";
+ echo '</div>'; */
+ echo '<div class="button_holder">';
+
+ echo '<button class="medium white-blue" href="#" onclick="edit_user_close();return false;"><span>' . $lang['srv_close_profile'] . '</span></button>' . "\n\r";
+
+ if(!empty($user)) {
+ echo '<button class="medium blue" href="#" onclick="posodobiSAuporabnika(\'' . $user->id . '\')"; return false;"><span>' . $lang['srv_potrdi'] . '</span></button>' . "\n\r";
+ }else {
+ echo '<button class="medium blue" href="#" onclick="shraniSAuporabnika()"; return false;"><span>' . $lang['srv_potrdi'] . '</span></button>' . "\n\r";
+ }
+
echo '</div>';
+
echo '</div>';
echo '</div>';
@@ -182,6 +195,7 @@ class AjaxHierarhijaDostopUporabnikovClass {
echo '<div class="sa-modul">';
echo '<h3><strong>'.$lang['user2'].'</strong></h3>';
+ echo '<div class="popup_close"><a href="#" onClick="edit_user_close();">✕</a></div>';
echo '<p><label for="type">'.$lang['admin_type'].':</label>';
switch ($user->type){
case 0:
@@ -217,8 +231,11 @@ class AjaxHierarhijaDostopUporabnikovClass {
// Gumb za zapret popup in potrdit
echo '<div style=" display: block;">';
- echo '<div class="buttonwrapper spaceRight floatLeft">';
+ /* echo '<div class="buttonwrapper spaceRight floatLeft">';
echo '<a class="ovalbutton ovalbutton_gray" href="#" onclick="vrednost_cancel(); return false;"><span>' . $lang['srv_close_profile'] . '</span></a>' . "\n\r";
+ echo '</div>'; */
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" href="#" onclick="edit_user_close(); return false;"><span>' . $lang['srv_close_profile'] . '</span></button>' . "\n\r";
echo '</div>';
echo '</div>';
echo '</div>';
diff --git a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php
index 628977f..56db0f3 100644
--- a/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php
+++ b/admin/survey/modules/mod_hierarhija/class/Ajax/AjaxUporabnikiClass.php
@@ -319,7 +319,7 @@ class AjaxUporabniki
$sql_user = sisplet_query("SELECT id FROM users WHERE email='$email'");
if (mysqli_num_rows($sql_user) == 0) {
- sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surname', '$email', '" . base64_encode((hash(SHA256, '' . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
+ sisplet_query("INSERT INTO users (name, surname, email, pass, type, when_reg, came_from) VALUES ('$name', '$surname', '$email', '" . base64_encode((hash('SHA256', '' . $pass_salt))) . "', '3', DATE_FORMAT(NOW(), '%Y-%m-%d'), '1')");
$user_id = mysqli_insert_id($GLOBALS['connect_db']);
} else {
$row = mysqli_fetch_array($sql_user);
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php
index 0ed3956..cc0d5c4 100644
--- a/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php
+++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAjaxClass.php
@@ -922,10 +922,9 @@ class HierarhijaAjax
public function pridobiVseAnketeKiSoVknjizniciZaHierarhijo()
{
global $site_url;
- global $hierarhija_folder_id;
- $ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . $hierarhija_folder_id . "'", "obj")->naslov;
- $ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . $hierarhija_folder_id . "'", "obj");
+ $ime_mape = sisplet_query("SELECT * FROM srv_library_folder where id='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj")->naslov;
+ $ankete_v_knjiznici = sisplet_query("SELECT * FROM srv_library_anketa WHERE folder='" . AppSettings::getInstance()->getSetting('hierarhija-folder_id') . "'", "obj");
if (empty($ime_mape) && sizeof($ankete_v_knjiznici) == 0) {
echo 'Knjižnica je prazna.';
@@ -937,14 +936,14 @@ class HierarhijaAjax
if (is_array($ankete_v_knjiznici) && empty($ankete_v_knjiznici->ank_id)) {
foreach ($ankete_v_knjiznici as $anketa) {
- $srv_anketa = sisplet_query("SELECT id, naslov FROM srv_anketa WHERE id='" . $anketa->ank_id . "'", "obj");
+ $srv_anketa = sisplet_query("SELECT id, naslov, hash FROM srv_anketa WHERE id='" . $anketa->ank_id . "'", "obj");
if(!empty($srv_anketa->naslov)) {
echo '<li>';
echo '<input type="radio" name="knjiznica_izbira" id="ank_'.$anketa->ank_id.'" value="'.$anketa->ank_id.'" /> ';
echo '<span class="enka-checkbox-radio"></span>';
echo '<span>
- <a href="'.$this->site_url.'/main/survey/index.php?anketa='.$anketa->ank_id.'&amp;preview=on" target="_blank" title="Predogled ankete">
+ <a href="'.$this->site_url.'/main/survey/index.php?anketa='.$srv_anketa->hash.'&amp;preview=on" target="_blank" title="Predogled ankete">
<span class="faicon preview"></span>
</a>
</span>';
@@ -953,13 +952,13 @@ class HierarhijaAjax
}
}
} elseif (is_object($ankete_v_knjiznici)) {
- $srv_anketa = sisplet_query("SELECT id, naslov FROM srv_anketa WHERE id='" . $ankete_v_knjiznici->ank_id . "'", "obj");
+ $srv_anketa = sisplet_query("SELECT id, naslov, hash FROM srv_anketa WHERE id='" . $ankete_v_knjiznici->ank_id . "'", "obj");
if(!empty($srv_anketa->naslov)) {
echo '<li>';
echo '<input type="radio" name="knjiznica_izbira" id="ank_'.$ankete_v_knjiznici->ank_id.'" value="'.$ankete_v_knjiznici->ank_id.'" /> ';
echo '<span>
- <a href="'.$this->site_url.'main/survey/index.php?anketa='.$ankete_v_knjiznici->ank_id.'&amp;preview=on" target="_blank" title="Predogled ankete">
+ <a href="'.$this->site_url.'main/survey/index.php?anketa='.$srv_anketa->hash.'&amp;preview=on" target="_blank" title="Predogled ankete">
<span class="faicon preview"></span>
</a>
</span>';
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php
index a322a5d..dcf18f7 100644
--- a/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php
+++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaAnalysisClass.php
@@ -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);
@@ -1183,10 +1181,7 @@ class HierarhijaAnalysis
$options = array('inline_legenda' => $inline_legenda, 'isTextAnswer' => false, 'isOtherAnswer' => false, 'num_show_records' => $num_show_records);
-// if (self :: $show_spid_div == true) {
-// echo '<div id="sum_'.$spid.'" loop="'.self::$_CURRENT_LOOP['cnt'].'" class="div_sum_variable div_analiza_holder">';
-// self::displaySpremenljivkaIcons($spid);
-// }
+
# tekst vprašanja
echo '<table class="anl_tbl anl_bt anl_br tbl_clps">';
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php
index 37bf787..14275df 100644
--- a/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php
+++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaClass.php
@@ -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
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php
index 3f283f6..fbc615a 100644
--- a/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php
+++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaHelper.php
@@ -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;
@@ -195,8 +192,7 @@ class HierarhijaHelper
$strani = [
'https://www.1ka.si/',
- 'http://test.1ka.si/',
- 'http://1ka.test/',
+ 'https://test.1ka.si/',
'https://1ka.arnes.si/'
];
@@ -211,6 +207,10 @@ class HierarhijaHelper
if ($admin_type == 0) {
return true;
}
+ // ZAENKRAT JE HIERARHHIJA VIDNA SAMO ADMINOM, KER ITAK NE DELUJE OK
+ else{
+ return false;
+ }
//AAI uporabnik
if (! empty($_COOKIE['aai']) && $_COOKIE['aai'] == 1) {
diff --git a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php
index 18bda68..d361812 100644
--- a/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php
+++ b/admin/survey/modules/mod_hierarhija/class/HierarhijaIzvoz.php
@@ -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
diff --git a/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css b/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css
index aca8f9d..b127dff 100644
--- a/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css
+++ b/admin/survey/modules/mod_hierarhija/css/vendor/datatables.min.css
@@ -10,7 +10,7 @@
* DataTables 1.10.12, Responsive 2.1.0, Scroller 1.4.2
*/
-table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("DataTables-1.10.12/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("DataTables-1.10.12/images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("DataTables-1.10.12/images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("DataTables-1.10.12/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("DataTables-1.10.12/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
+table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc{cursor:pointer;*cursor:hand}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("DataTables-1.10.12/images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("DataTables-1.10.12/images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("DataTables-1.10.12/images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("DataTables-1.10.12/images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("DataTables-1.10.12/images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{-webkit-box-sizing:content-box;box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table,.dataTables_wrapper.no-footer div.dataTables_scrollBody table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
table.dataTable.dtr-inline.collapsed>tbody>tr>td.child,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty{cursor:default !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th.child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>td.dataTables_empty:before{display:none !important}table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child{position:relative;padding-left:30px;cursor:pointer}table.dataTable.dtr-inline.collapsed>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed>tbody>tr>th:first-child:before{top:9px;left:4px;height:14px;width:14px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#31b131}table.dataTable.dtr-inline.collapsed>tbody>tr.parent>td:first-child:before,table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th:first-child:before{content:'-';background-color:#d33333}table.dataTable.dtr-inline.collapsed>tbody>tr.child td:before{display:none}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td:first-child,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th:first-child{padding-left:27px}table.dataTable.dtr-inline.collapsed.compact>tbody>tr>td:first-child:before,table.dataTable.dtr-inline.collapsed.compact>tbody>tr>th:first-child:before{top:5px;left:4px;height:14px;width:14px;border-radius:14px;line-height:14px;text-indent:3px}table.dataTable.dtr-column>tbody>tr>td.control,table.dataTable.dtr-column>tbody>tr>th.control{position:relative;cursor:pointer}table.dataTable.dtr-column>tbody>tr>td.control:before,table.dataTable.dtr-column>tbody>tr>th.control:before{top:50%;left:50%;height:16px;width:16px;margin-top:-10px;margin-left:-10px;display:block;position:absolute;color:white;border:2px solid white;border-radius:14px;box-shadow:0 0 3px #444;box-sizing:content-box;text-align:center;font-family:'Courier New', Courier, monospace;line-height:14px;content:'+';background-color:#31b131}table.dataTable.dtr-column>tbody>tr.parent td.control:before,table.dataTable.dtr-column>tbody>tr.parent th.control:before{content:'-';background-color:#d33333}table.dataTable>tbody>tr.child{padding:0.5em 1em}table.dataTable>tbody>tr.child:hover{background:transparent !important}table.dataTable>tbody>tr.child ul{display:inline-block;list-style-type:none;margin:0;padding:0}table.dataTable>tbody>tr.child ul li{border-bottom:1px solid #efefef;padding:0.5em 0}table.dataTable>tbody>tr.child ul li:first-child{padding-top:0}table.dataTable>tbody>tr.child ul li:last-child{border-bottom:none}table.dataTable>tbody>tr.child span.dtr-title{display:inline-block;min-width:75px;font-weight:bold}div.dtr-modal{position:fixed;box-sizing:border-box;top:0;left:0;height:100%;width:100%;z-index:100;padding:10em 1em}div.dtr-modal div.dtr-modal-display{position:absolute;top:0;left:0;bottom:0;right:0;width:50%;height:50%;overflow:auto;margin:auto;z-index:102;overflow:auto;background-color:#f5f5f7;border:1px solid black;border-radius:0.5em;box-shadow:0 12px 30px rgba(0,0,0,0.6)}div.dtr-modal div.dtr-modal-content{position:relative;padding:1em}div.dtr-modal div.dtr-modal-close{position:absolute;top:6px;right:6px;width:22px;height:22px;border:1px solid #eaeaea;background-color:#f9f9f9;text-align:center;border-radius:3px;cursor:pointer;z-index:12}div.dtr-modal div.dtr-modal-close:hover{background-color:#eaeaea}div.dtr-modal div.dtr-modal-background{position:fixed;top:0;left:0;right:0;bottom:0;z-index:101;background:rgba(0,0,0,0.6)}@media screen and (max-width: 767px){div.dtr-modal div.dtr-modal-display{width:95%}}
diff --git a/admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js b/admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js
index 4bd3d75..876f406 100644
--- a/admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js
+++ b/admin/survey/modules/mod_hierarhija/js/vendor/hierarhija_analize.js
@@ -297,7 +297,7 @@ function doArchiveMeans() {
$('#fullscreen').show();
});
} else {
- alert('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveMeans() {
@@ -323,7 +323,7 @@ function submitArchiveMeans() {
$("#fullscreen").show();
});
} else {
- alert('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -347,9 +347,9 @@ function createArchiveMeansBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!" + response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!" + response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -357,7 +357,7 @@ function createArchiveMeansBeforeEmail() {
});
} else {
- alert('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
diff --git a/admin/survey/modules/mod_kakovost/R/kakovost.R b/admin/survey/modules/mod_kakovost/R/kakovost.R
index de05f1e..d7fa8d0 100644
--- a/admin/survey/modules/mod_kakovost/R/kakovost.R
+++ b/admin/survey/modules/mod_kakovost/R/kakovost.R
@@ -1,47 +1,357 @@
-#uporabnost <- function(params){
+# Created by Miha 27.5.2021
+# Modified (sixth version) by Miha 7.6.2021
-#setwd("path od mape, kjer se nahaja ta glavna datoteka, npr. C:/mapa")
-# Import data.table & functions ------------------------------------------------------
-require("data.table")
-source("modules/mod_uporabnost/R/gen.survey.str.R")
-source("modules/mod_uporabnost/R/gen.usability.matrix.R")
-source("modules/mod_uporabnost/R/calc.usability.R")
+# Note: The formated banners of comments are generated with
+#' @bannerCommenter package.
-# Input data ------------------------------------------------------
+
+###########################################################################
+###########################################################################
+### ###
+### DESCRIPTION: ###
+### RESPONSE TIME WINSORIZATION ###
+### ###
+###########################################################################
+###########################################################################
+#' @param VVMM PRIPRAVA PODATKOV:
+#' NOTE: tole kodo smo po VV zmišljevanjui tolikokrat spremenili
+#' da se mi ne da več pisat v angleščini in konstantno popravljati :)
+#'
+# Za ustrezno obravnavo časov, je treba predhodno pripraviti podatke.
+# Glavni problemi ki pri tem nastanejo so: respondenti, ki na določeni strani
+# niso odogovrili na vsa vprašanja zaradi česar so njihovi časi neupraviečno
+# prekratki,potem nerespondenti, ki so priskočili določeno stran 3) respodneti,
+# ki so na določeni strnai imeli notranji pogodj oz so izbrali vprašanje drugo.
+# In 4) respondeti, ki so prepočasni v smislu gausov eksponentre krivulje kar
+# se vstorki obravnava z postopki in odstraniujo asimetrijo v normalbi porazdleitvi
+# zaradi aktere pride do amanomalj vtestirnaju 5) popravek za čase respondentov,
+# ki so prekinili izpolnjevanje
+
+# Postopek metode
+
+#' @1.Trunciranje enote, ki so na posamezni strani nad 95tim percentilom
+#' @2.Strani, ki so nagovori se pri izračunu indeksa ne upošteva
+#' @3.Preverimo ali je stran za respondenta mešana, torej ali vprašanja
+#' oziroma postavke, poleg veljavnih vrednosti respondenta na stran
+#' (verdnosti večje od 1), vsebujejo še kakšno manjkajočo vrednost zaradi pogoja
+#' (-2)
+#' @4.V kolikor obstajajo mešane vrednosti, potem čas respondenta na tej mešani
+#' strani pomnožimo z deležem ocenjenega časa, ki bi na tej strnai sicer
+#' pripadal temu vprašanju. Privzeta tehnična meritev orodja za spletno anketirnaje,
+#' ki ima algoritem( priloži sliko 1KA časov). Zmanjšaš čas, za 10 procentov
+#' (pomnožiš z 90 %).
+#' @5.Preverimo ali so na strani respondenta manjkajoče vrednosti. Če manjkajoča
+#' vrednost obstaja, čas respondenta na tej strani delimo z 0.9
+#' @6.Nato izračunamo indeks respondenta (Rti), ki je izračunan tako, da vsot
+#' o strani respondenta (brez -2) delimo z vsoto median taistih strani.
+#' @7. Ponovno izračunamo mediane strani.
+#' @8. Vrednosti, ki smo jih v prvem koraku truncirali imputiramo, in sicer so
+#' truncirane vrednosti zmnožek indeksa posameznega respondenta pomnožene z mediano
+#' strani oziroma Rti * mediana stranii
+
+#------------------------- // DESCRIPTION // -----------------------------#
+
+
+#------------ List of packages we need --------------#
+library(data.table)
+library(dplyr)
+#------------ List of packages we need --------------#
+
+
+
+############################################################################
+############################################################################
+### ###
+### DATA: ###
+### IMPORT AMD PREPARATION ###
+### ###
+############################################################################
+############################################################################
+
+#setwd("E:\\Doktorat\\Modul kakovost 1ka/")
+
+##---------------------
+## Input on 1KA side
+##---------------------
+# To know for which survey we are calculating response time
params <- commandArgs(trailingOnly = TRUE)
ID <- params[1]
+#ID <- 8699
+
+##----------------------------
+## Import data and paradata
+##----------------------------
+# We need thrtee files
+#' @data: data frame with paradata (response time)
+#' @questions: data about page ID nad number of
+#' items/variables per page, in order to properly calculate our
+#' index
+#' @items: questions item info. Important part is char_count, which
+#' represents the 1KA estimeted time (100 char_count == 10 sekund)
+#' We will merge items and questions
+
+
+
+## Data -----
+# path
+rt.file <- paste0("modules/mod_kakovost/temp/data_", ID, ".csv")
+# Import
+rt <-
+ as.data.frame(fread(rt.file, header = TRUE), stringsAsFactors = FALSE)
+
+## Questionns --------
+# get question and item files
+questions.file <-
+ paste0("modules/mod_kakovost/temp/questions_", ID, ".csv")
+# Import
+questions <-
+ fread(
+ questions.file,
+ header = TRUE,
+ data.table = FALSE
+ )
+# Check if there is question type "Nagovor", we want to omit
+# this form analysis
+
+# FOR NOW: later we will retunr back
+# more testing is needed
+questions$params <-
+ ifelse(grepl("nagovor", questions$params), questions$params, "")
+
+
+## Items --------
+# We need ITems to calculate response time pe ritem
+# and use it in calculation of response time
+## Questionns --------
+# get question and item files
+items.file <-
+ paste0("modules/mod_kakovost/temp/items_", ID, ".csv")
+# Import
+items <-
+ fread(
+ items.file,
+ header = TRUE,
+ data.table = FALSE
+ )
+
+
+
+
+# Important
+# 1KA računa čas na naslednji način
+# Čas za vprašanje (na 100 znakov besedila) = 10 sekund
+# Čas za kategorijo (na 100 znakov besedila) = 5 sekund
+# Torej bomo znake pretvorili v sekunde
+
+# Vprašanje
+questions$cas1KA <- questions$char_count * 10 / 100
+# Kategorija
+items$cas1KA <- items$char_count * 5 / 100
+
+
+# Merge Questions and items in order to get number of character per
+# item and per questions
+Ques.item <-
+ merge(questions,
+ items,
+ by = "ID QUESTION",
+ all = TRUE,
+ sort = FALSE)
+
+# Sort from smallest to largest, so the first page is always
+# in the beginning
+Ques.item <- arrange(Ques.item, `ID PAGE`)
+
+
+#--------------------------------------------------------------------------#
+
+
+############################################################################
+############################################################################
+### ###
+### RESPONSE TIME ###
+### CALCULATE RESPONSE TIME IN SECONDS FOR EACH PAGE ###
+### ###
+############################################################################
+############################################################################
+## SUBSET COLNAMES "date_" ##
+# Iz baze izberemo le stolpce, ki nas zanimajo:
+# Vse stolpce, ki v imenu vsebujejo Date_ (ker ra?unamo ?ase na strani)
+times <- rt[, grepl("t_insert|date_" , colnames(rt))]
-#get & import dsa: the main survey data file (containing only recnum, status, lurker and all variables relating to answers to survey questions)
-dsa.file <- paste0("modules/mod_uporabnost/temp/data_", ID, ".csv")
-dsa <- fread(dsa.file, header=T, drop=c(1:5, 7, 8))
+# čas v sekundah, ki ga je anketiranec preživel na x strani
+# (ki se izračuna kot razlika med stolpcem date_x in date_x+1)
+makeTime <- function(x) {
+ as.POSIXct(x, format = "%d.%m.%Y %H:%M:%S")
+}
+dat <- apply(times, 2, makeTime)
+response_times <- mapply(x = 2:ncol(dat),
+ y = 1:(ncol(dat) - 1),
+ function(x, y)
+ (dat)[, x] - (dat)[, y])
+
+
+# Zamenjamo ure in minute s sekundami
+rt[, grepl("t_insert|date_" , colnames(rt))] <- cbind(response_times, NA)
+rt[, grepl("t_insert|date_" , colnames(rt))][rt[, grepl("t_insert|date_" , colnames(rt))] < 0] <-
+ NA
+
+
+##################################################################
+## RT preparation ##
+##################################################################
+# Nov we need to match Items/variables with survey pages
+# so we will know which items match response time per page
+# This is important in order to correctly calculate
+# response times and remove respondents (set missing) with
+# item nonresponse per item.
+
+# First subset columns with time per page
+rt.page <- rt[, grepl("t_insert|date_" , colnames(rt))]
+# Zadnji stolpec je NA kot rezultat odštevanje stolpcev
+rt.page[ncol(rt.page)] <- NULL
+#rt.page[3,2] <- 1
+
+
+# ROČNO!!!!!!!
+# Popravimo vrednost na strani 4, ki ni mešana
+# ampak -8, saj sta na eni strani dve vprašanji
+#, ki pa sta bili porazdeljeni 50-50.
+# rt$Q7a.1 <- ifelse(rt$Q7a.1== -2 & rt$Q7b.1 >=0, rt$Q7b.1, rt$Q7a.1)
+# rt$Q7b.1 <- NULL
+# questions <- questions[-26,]
+# # Enako velja za stran 20 torej "Q28a" "Q28b"
+# rt$Q28a <- ifelse(rt$Q28a== -2 & rt$Q28b >=0, rt$Q28b, rt$Q28a)
+# rt$Q28b <- NULL
+# questions <- questions[-136,]
+#----------------------------- // Data // --------------------------------#
-#get question and item files
-questions.file <- paste0("modules/mod_uporabnost/temp/questions_", ID, ".csv")
-items.file <- paste0("modules/mod_uporabnost/temp/items_", ID, ".csv")
+#---------------------
+test <- rt.page
+miss1 <- vector()
+miss2 <- vector()
+mesanaStranR <- list()
+find.na <- list()
+
+#' @1.Trunciranje
+for (i in 1:ncol(test)) {
+ test[test < 0] <- NA
+ quantiles <- quantile(test[, i], .95, na.rm = TRUE)
+ # pripraviš vektor, s katerim najdeš katere vrednosti si zamenjal szs NA
+ find.na[[i]] <- which(test[, i] > quantiles)
+ # najprej nadomestiš vrednosti, ki so večje od thresholda z NA
+ # browser()
+ test[, i][find.na[[i]]] <- NA
+}
-# Main & Output ------------------------------------------------------
-#generate survey structure
-survey.str <- gen.survey.str(colnames(dsa)[-(1)], questions.file, items.file)
-if(any(!(is.data.table(survey.str)), nrow(survey.str)==0)){
- write(survey.str, paste0("modules/mod_uporabnost/results/usability_", ID, ".csv"))
-}else{
- #delete invisible variables and types: 5, 9, 22, 23, 25
- survey.str <- survey.str[visible==1 & !(tip %in% c(5, 9, 22, 23, 25)),]
+# We do not start with 0 because it is introduction page
+for(i in 1: ncol(test)) {
+ #' @2.Strani, ki so nagovori se pri izračunu indeksa ne upošteva
+ Ques.item <-
+ Ques.item[!grepl("nagovorLine=0", Ques.item$params), ]
+
+ #' @param 2: Set missing response time per page
+ # Split variables acording to page
+ var.per.page <- split(Ques.item, Ques.item$`ID PAGE`)
+ # Find number of variables per page
+ var.lab <- var.per.page[[i]][c("variable.x", "variable.y")]
+ # Only valid items
+ var.lab <- var.lab[var.lab > 1]
+
+ #' @3.Preverimo ali obstaja mešana stran
+ page.q <- rt %>% select(any_of(var.lab))
+ if(ncol(page.q) > 1) {
+ page.q <- page.q[, order(colnames(page.q))]
+ }
+ mesanaStranR[[i]] <-
+ data.frame(R=apply(page.q, 1, function(x)
+ ifelse(-2 %in% x & any(x > 0), "YES", "NO")))
+
+ #' @Vasja_2
+ #' Za te »mešane strani« nato pogledate vsakega respondenta
+ #' in greste skozi vse njegove iteme na tej strani:
+
+ #- Če ima item -2, ga spremenite v -7.
+
+ #- Če ima item -1, ga pusite pri miru
- #generate usability matrix
- m.all <- gen.usability.matrix(dsa, survey.str)
-
- if(any(!(is.data.table(m.all)), nrow(m.all)==0)){
- write(m.all, paste0("modules/mod_uporabnost/results/usability_", ID, ".csv"))
- }else{
- #calculate usability indexes
- m.final <- calc.usability(m.all, 3)
+ #- Če item ni mešan, ga pustite pri miru.
+ if (any(mesanaStranR[[i]] == "YES")) {
+ # -7
+ page.q[page.q == -2] <- -7
- #write to results
- write.csv2(m.final, paste0("modules/mod_uporabnost/results/usability_", ID, ".csv"), row.names = FALSE)
+ for (j in 1:nrow(test)) {
+
+ test[j, i] <-
+ ifelse(any(page.q[j,] > 0) &
+ any(page.q[j,] == -7), test[j, i] * sum(
+ subset(
+ Ques.item,
+ variable.x == colnames(page.q)[page.q[j,] != -7] |
+ variable.y == colnames(page.q)[page.q[j,] != -7],
+ select = c("cas1KA.x", "cas1KA.y")
+ )
+ ), test[j, i])
+
+ }
}
+ #' @5.Preverimo ali so na strnai manjkajole vrednosti
+ for (j in 1:nrow(test)) {
+ test[j, i] <-
+ suppressWarnings(ifelse(any(page.q[j,] == -1) &
+ !is.na(test[j, i]), test[j, i] / sum(
+ subset(
+ Ques.item,
+ variable.x == colnames(page.q)[page.q[j, ] == -1] |
+ variable.y == colnames(page.q)[page.q[j, ] == -1],
+ select = c("cas1KA.x", "cas1KA.y")
+ )
+ ), test[j, i]))
+ }
+
}
-#} \ No newline at end of file
+
+#' @6.Nato izračunamo indeks respondenta (Rti), ki je izračunan tako, da vsot
+#' o strani respondenta (brez -2) delimo z vsoto median taistih strani.
+# Mediana
+med.per.page <- apply(test, 2, function(x)
+ median(x, na.rm = TRUE))
+
+Rti <- NULL
+
+Rt_i <- lapply(seq_len(nrow(test)), function(y) {
+ indx <- which(!is.na(test[y, ]))
+ if( length(indx) != 0) {
+ Rti[y] <-
+ round(sum(test[y, ][indx], na.rm = TRUE) / sum(med.per.page[indx], na.rm = TRUE), 3)
+ } else {
+ Rti[y] <- NA
+ }
+})
+# Rti korak I
+Rt.i <- do.call(rbind, Rt_i)
+
+
+
+#' @8. Vrednosti, ki smo jih v prvem koraku truncirali imputiramo, in sicer so
+#' truncirane vrednosti zmnožek indeksa posameznega respondenta pomnožene z mediano
+#' strani oziroma Rti * mediana stranii
+
+imput.time <- test
+
+for(i in 1:length(med.per.page)) {
+ for (j in 1:nrow(test)) {
+ imput.time[find.na[[i]], i] <- Rt.i[find.na[[i]]] * med.per.page[i]
+ }
+}
+
+
+# Potem naredite novo datoteko z modificiranimi
+# PRAVIMI RT na stran ter dodamo imena stolpcev, ki
+# odražajo strani
+colnames(imput.time) <- paste("date_", 1:ncol(imput.time))
+# Zapišemo za prikaz v tabeli in prenos s strani uporabnika.
+write.csv2(imput.time, paste0("modules/mod_kakovost/results/rt_", ID, ".csv"), row.names = FALSE)
diff --git a/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php b/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php
index 711bdd7..ec86761 100644
--- a/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php
+++ b/admin/survey/modules/mod_kakovost/class.SurveyKakovost.php
@@ -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);
@@ -377,7 +375,7 @@ class SurveyKakovost{
// Testiranje - izpis errorjev
if($admin_type == 0){
- echo '<div style="display:none;">';
+ echo '<div>';
echo 'Rscript '.$script;
//echo '<br />'.$out.'<br />';
var_dump($output);
@@ -392,7 +390,7 @@ class SurveyKakovost{
$result_folder = $site_path . RESULTS_FOLDER.'/';
- if (($handle = fopen($result_folder."usability_".$this->anketa.".csv", "r")) !== FALSE) {
+ if (($handle = fopen($result_folder."rt_".$this->anketa.".csv", "r")) !== FALSE) {
// Loop po vrsticah
$cnt = 0;
@@ -753,8 +751,8 @@ class SurveyKakovost{
}
// Pobrisemo CSV datoteko z rezultati
- if (file_exists($result_folder.'/usability_'.$this->anketa.'.csv')) {
- unlink($result_folder.'/usability_'.$this->anketa.'.csv');
+ if (file_exists($result_folder.'/rt_'.$this->anketa.'.csv')) {
+ unlink($result_folder.'/rt_'.$this->anketa.'.csv');
}
}
diff --git a/admin/survey/modules/mod_panel/class.SurveyPanel.php b/admin/survey/modules/mod_panel/class.SurveyPanel.php
index 30113ad..d3a8da6 100644
--- a/admin/survey/modules/mod_panel/class.SurveyPanel.php
+++ b/admin/survey/modules/mod_panel/class.SurveyPanel.php
@@ -20,16 +20,18 @@ 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();
}
}
// Prikazemo nastavitve pri vklopu naprednega modula
public function displaySettings(){
- global $lang;
+ global $lang;
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
echo '<fieldset><legend>'.$lang['settings'].'</legend>';
@@ -37,49 +39,78 @@ class SurveyPanel{
$row = $this->getPanelSettings();
// Url za preusmeritev
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url'].':</span>';
- echo '<input type="text" size="40" name="url" id="url" value="'.$rowA['url'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url'].':</p>';
+ echo '<input type="text" class="large w300" name="url" id value="'.$rowA['url'].'" />';
+ echo '</div>';
// Ime parametra za id respondenta
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_user_id_name'].':</span>';
- echo '<input type="text" name="user_id_name" id="user_id_name" value="'.$row['user_id_name'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_user_id_name'].':</p>';
+ echo '<input type="text" class="large w300" name="user_id_name" id="user_id_name" value="'.$row['user_id_name'].'" />';
+ echo '</div>';
// Ime parametra za status
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_status_name'].':</span>';
- echo '<input type="text" name="status_name" id="status_name" value="'.$row['status_name'].'" />';
-
- echo '<br />';
+ echo '<div class="setting_holder">';
+ echo '<p" >'.$lang['srv_panel_status_name'].':</p>';
+ echo '<input type="text" class="large w300" name="status_name" id="status_name" value="'.$row['status_name'].'" />';
+ echo '</div>';
// Privzeta vrednost status parametra
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_status_default'].':</span>';
- echo '<input type="text" name="status_default" id="status_default" value="'.$row['status_default'].'" />';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_status_default'].':</p>';
+ echo '<input type="text" class="large w300" name="status_default" id="status_default" value="'.$row['status_default'].'" />';
+ echo '</div>';
// Primer zacetnega url-ja
$link = SurveyInfo::getSurveyLink();
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url1_example'].':</span>';
- echo $link.'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url1_example'].':</p>';
+ echo '<p class="gray">'.$link.'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID</p>';
+ echo '</div>';
// Primer končnega url-ja
- echo '<span class="nastavitveSpan1" >'.$lang['srv_panel_url2_example'].':</span>';
- echo $rowA['url'].'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS';
-
+ echo '<div class="setting_holder">';
+ echo '<p>'.$lang['srv_panel_url2_example'].':</p>';
+ // Dodaten pogoj, ce imamo slucajno ? ze v osnovnem delu urlja (da vracamo tudi recimo fiksen parameter)
+ if(strpos($rowA['url'], "?") !== false){
+ echo '<p class="gray">'.$rowA['url'].'&'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS</p>';
+ }
+ else{
+ echo '<p class="gray">'.$rowA['url'].'?'.$row['user_id_name'].'=RESPONDENT_PANEL_ID&'.$row['status_name'].'=PANEL_STATUS</p>';
+ }
+ echo '</div>';
+
+ // Ko se uporabnik vrne (zacne od zacetka/nadaljuje kjer je ostal)
+ echo '<div class="setting_holder">';
+ echo ' <span class="setting_title">' . $lang['srv_cookie_return'] . Help :: display('srv_cookie_return') . ':</span>';
+
+ echo ' <div class="setting_item">';
+ echo ' <input type="radio" name="cookie_return" value="0" id="cookie_return_0"' . ($rowA['cookie_return'] == 0 ? ' checked="checked"' : '') . ' />';
+ echo ' <label for="cookie_return_0">' . $lang['srv_cookie_return_start'] . '</label>';
+ echo ' </div>';
+ echo ' <div class="setting_item no-cookie">';
+ echo ' <input type="radio" name="cookie_return" value="1" id="cookie_return_1"' . ($rowA['cookie_return'] == 1 ? ' checked="checked"' : '') . ' />';
+ echo ' <label for="cookie_return_1">' . $lang['srv_cookie_return_middle'] . '</label>';
+ echo ' </div>';
+ echo '</div>';
+
+ // Nadaljevanje kasneje
+ echo '<div class="setting_holder">';
+ echo ' <input type="checkbox" id="continue_later" name="continue_later" value="1" '.($rowA['continue_later'] == 1 ? ' checked="checked"' : '').'>';
+ echo ' <label for="continue_later">'.$lang['srv_show_continue_later'].' '.Help::display('srv_continue_later_setting').'</label> ';
+ echo '</div>';
+
echo '</fieldset>';
-
+
// Gumb shrani
- echo '<br class="clr" />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="panel_save_settings(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="panel_save_settings(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
echo '<div id="success_save"></div>';
}
@@ -90,8 +121,8 @@ class SurveyPanel{
// Vstavimo vrstico z nastavitvami
$sql1 = sisplet_query("INSERT INTO srv_panel_settings (ank_id) VALUES ('".$this->anketa."')");
- // Uredimo nastavitve zakljucka
- $sql2 = sisplet_query("UPDATE srv_anketa SET concl_link='1' WHERE id='".$this->anketa."'");
+ // Uredimo nastavitve zakljucka, deaktiviramo piskotke in nastavimo nastavitev za nadaljevanje, da nadaljuje kjer je ostal
+ $sql2 = sisplet_query("UPDATE srv_anketa SET concl_link='1', cookie='-1', cookie_return='1' WHERE id='".$this->anketa."'");
if (!$sql2) echo mysqli_error($GLOBALS['connect_db']);
// Ustvarimo sistemsko skrito vprasanje za panel id respondenta
@@ -160,6 +191,15 @@ class SurveyPanel{
$sqlS = sisplet_query("UPDATE srv_spremenljivka s, srv_grupa g
SET s.variable='".$user_id_name."'
WHERE s.variable='".$user_id_name_old."' AND s.gru_id=g.id AND g.ank_id='".$this->anketa."'");
+
+
+ // Shranimo kje nadaljuje in ce ima opcijo za nadaljevanje kasneje
+ if (isset($_POST['cookie_return']) && isset($_POST['continue_later']))
+ $sql = sisplet_query("UPDATE srv_anketa SET cookie_return='".$_POST['cookie_return']."', continue_later='".$_POST['continue_later']."' WHERE id='".$this->anketa."'");
+
+
+ // vsilimo refresh podatkov
+ SurveyInfo :: getInstance()->resetSurveyData();
$this->displaySettings();
}
diff --git a/admin/survey/modules/mod_quiz/class.SurveyQuiz.php b/admin/survey/modules/mod_quiz/class.SurveyQuiz.php
index bb28d76..12e014d 100644
--- a/admin/survey/modules/mod_quiz/class.SurveyQuiz.php
+++ b/admin/survey/modules/mod_quiz/class.SurveyQuiz.php
@@ -25,45 +25,56 @@ class SurveyQuiz{
// Nastavitve kviza (prikaz rezultatov, grafa...)
public function displaySettings(){
global $lang;
-
-
- // Posebne opcije in navodile za anketo kviz
- /*echo '<fieldset><legend>'.$lang['srv_kviz_navodila_1'].'</legend>';
- echo '<p>'.$lang['srv_kviz_navodila_2'].'</p>';
- echo '<p>'.$lang['srv_kviz_navodila_3'].'</p>';
- echo '<p>'.$lang['srv_kviz_navodila_4'].'</p>';
- echo '<p>'.$lang['srv_kviz_navodila_6'].' '.Help::display('DataPiping').'</p>';
- echo '<p>'.$lang['srv_kviz_navodila_7'].'</p>';
- echo '</fieldset>';*/
+ global $site_url;
+
+ $preklici_url = ltrim(str_replace("&s=1","",$_SERVER['REQUEST_URI']),"/");
+ $preklici_url = "'". $site_url . $preklici_url . "'";
-
+
echo '<fieldset><legend>'.$lang['settings'].'</legend>';
// Pridobimo trenutne nastavitve
- $settings = $this->getSettings();
-
+ $settings = $this->getSettings();
+
// Prikaz rezultatov v zakljucku
- echo '<span class="nastavitveSpan1" >'.$lang['srv_quiz_results'].':</span>';
- echo '<label for="quiz_results_0"><input type="radio" name="quiz_results" id="quiz_results_0" value="0" '.(($settings['results'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'].'</label>';
- echo '<label for="quiz_results_1"><input type="radio" name="quiz_results" id="quiz_results_1" value="1" '.(($settings['results'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'].'</label>';
-
- echo '<br />';
+
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_quiz_results'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="quiz_results" id="quiz_results_0" value="0" '.(($settings['results'] == 0) ? ' checked="checked" ' : '').' />';
+ echo '<label for="quiz_results_0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="quiz_results" id="quiz_results_1" value="1" '.(($settings['results'] == 1) ? ' checked="checked" ' : '').' />';
+ echo '<label for="quiz_results_1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
// Prikaz grafa rezultatov v zakljucku
- echo '<span class="nastavitveSpan1" >'.$lang['srv_quiz_results_chart'].':</span>';
- echo '<label for="quiz_results_chart_0"><input type="radio" name="quiz_results_chart" id="quiz_results_chart_0" value="0" '.(($settings['results_chart'] == 0) ? ' checked="checked" ' : '').' />'.$lang['no1'].'</label>';
- echo '<label for="quiz_results_chart_1"><input type="radio" name="quiz_results_chart" id="quiz_results_chart_1" value="1" '.(($settings['results_chart'] == 1) ? ' checked="checked" ' : '').' />'.$lang['yes'].'</label>';
-
- echo '<br /><br />';
+ echo '<div class="setting_holder">';
+ echo '<span class="setting_title">'.$lang['srv_quiz_results_chart'].':</span>';
+
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="quiz_results_chart" id="quiz_results_chart_0" value="0" '.(($settings['results_chart'] == 0) ? ' checked="checked" ' : '').' />';
+ echo '<label for="quiz_results_chart_0">'.$lang['no1'].'</label>';
+ echo '</div>';
+ echo '<div class="setting_item">';
+ echo '<input type="radio" name="quiz_results_chart" id="quiz_results_chart_1" value="1" '.(($settings['results_chart'] == 1) ? ' checked="checked" ' : '').' />';
+ echo '<label for="quiz_results_chart_1">'.$lang['yes'].'</label>';
+ echo '</div>';
+
+ echo '</div>';
echo '</fieldset>';
-
// Gumb shrani
- echo '<br class="clr" />';
- echo '<span class="floatLeft spaceRight"><div class="buttonwrapper"><a class="ovalbutton ovalbutton_orange btn_savesettings" href="#" onclick="quiz_save_settings(); return false;"><span>';
- echo $lang['edit1337'] . '</span></a></div></span>';
- echo '<div class="clr"></div>';
+ echo '<div class="button_holder">';
+ echo '<button class="medium white-blue" onClick="window.location='.$preklici_url.'; return false;">'.$lang['edit1338'].'</button>';
+ echo '<button class="medium blue" onclick="quiz_save_settings(); return false;">'.$lang['edit1337'].'</button>';
+ echo '</div>';
+
echo '<div id="success_save"></div>';
}
diff --git a/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php b/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php
index 9da5bcf..44eae0a 100644
--- a/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php
+++ b/admin/survey/modules/mod_uporabnost/class.SurveyUporabnost.php
@@ -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);
diff --git a/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php b/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php
index 1c9884b..c39645c 100644
--- a/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php
+++ b/admin/survey/modules/mod_vizualizacija/class.SurveyVizualizacija.php
@@ -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();
}
}
@@ -135,10 +133,11 @@ class SurveyVizualizacija{
'BOMchar' => "\xEF\xBB\xBF");
# dodamo boomchar za utf-8
fwrite($fd2, $convertTypes[$convertType]['BOMchar']);
-
+ $output1='';
+ $output2='';
# naredimo header row
foreach ($_HEADERS AS $spid => $spremenljivka) {
- if (count($spremenljivka['grids']) > 0) {
+ if (isset($spremenljivka['grids'])&&count($spremenljivka['grids']) > 0) {
foreach ($spremenljivka['grids'] AS $gid => $grid) {
foreach ($grid['variables'] AS $vid => $variable ){
if ($spremenljivka['tip'] !== 'sm' && !($variable['variable'] == 'uid' && $variable['naslov'] == 'User ID')){
diff --git a/admin/survey/modules/mod_voting/class.SurveyVoting.php b/admin/survey/modules/mod_voting/class.SurveyVoting.php
index 98ef5fb..8f0dd35 100644
--- a/admin/survey/modules/mod_voting/class.SurveyVoting.php
+++ b/admin/survey/modules/mod_voting/class.SurveyVoting.php
@@ -47,15 +47,13 @@ class SurveyVoting{
echo '<fieldset><legend>'.$lang['settings'].'</legend>';
- echo '<br>';
-
- echo $lang['srv_voting_edit1'].' <a href="index.php?anketa='.$this->anketa.'&amp;a='.A_BRANCHING.'"><span class="bold">'.$lang['srv_voting_edit2'].'</span></a>.';
-
- echo '<br><br>';
+ echo ' <p class="bottom16">';
+ echo $lang['srv_voting_edit1'].' <a href="index.php?anketa='.$this->anketa.'&amp;a='.A_BRANCHING.'">'.$lang['srv_voting_edit2'].'</a>.';
+ echo ' </p>';
- echo $lang['srv_voting_invitations1'].' <a href="index.php?anketa='.$this->anketa.'&amp;a='.A_INVITATIONS.'"><span class="bold">'.$lang['srv_voting_invitations2'].'</span></a>.';
-
- echo '<br><br>';
+ echo ' <p>';
+ echo $lang['srv_voting_invitations1'].' <a href="index.php?anketa='.$this->anketa.'&amp;a='.A_INVITATIONS.'">'.$lang['srv_voting_invitations2'].'</a>.';
+ echo ' </p>';
echo '</fieldset>';
}
diff --git a/admin/survey/pChart/classes/class.MyHorBar.php b/admin/survey/pChart/classes/class.MyHorBar.php
index 8194add..ed822d2 100644
--- a/admin/survey/pChart/classes/class.MyHorBar.php
+++ b/admin/survey/pChart/classes/class.MyHorBar.php
@@ -1,16 +1,16 @@
-<?php
-
+<?php
+
/*
pChart - a PHP class to build charts!
Copyright (C) 2008 Jean-Damien POGOLOTTI
- Version 1.27d last updated on 09/30/08
-
- Extension by Gabriele FERRI
- http://www.gabrieleferri.it
- MyHorBar.class is writen to extend pChart.class to write a horizontal bar charts
- Copyright (C) 2009 Gabriele FERRI
- version 1.0beta 08/05/2009
- Contact me with bug reports and comments: info@gabrieleferri.it
+ Version 1.27d last updated on 09/30/08
+
+ Extension by Gabriele FERRI
+ http://www.gabrieleferri.it
+ MyHorBar.class is writen to extend pChart.class to write a horizontal bar charts
+ Copyright (C) 2009 Gabriele FERRI
+ version 1.0beta 08/05/2009
+ Contact me with bug reports and comments: info@gabrieleferri.it
http://pchart.sourceforge.net
@@ -27,16 +27,17 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
- Draw methods :
+
+ Draw methods :
drawHorBarGraph($Data,$DataDescription,$Shadow=TRUE,$Alpha=100)
- drawHorScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE)
- drawHorGrid($LineWidth,$Mosaic,$R=220,$G=220,$B=220,$Alpha=100)
- drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnBottom=FALSE,$TickWidth=4,$FreeText=NULL,$Angle=0)
-*/
-
+ drawHorScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE)
+ drawHorGrid($LineWidth,$Mosaic,$R=220,$G=220,$B=220,$Alpha=100)
+ drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnBottom=FALSE,$TickWidth=4,$FreeText=NULL,$Angle=0)
+*/
+
class MyHorBar extends pChart
- {
-
+ {
+
/* This function draw a bar graph */
function drawHorBarGraph($Data,$DataDescription,$insideValues=false,$insideValuesSmall=false,$Shadow=TRUE,$Alpha=100)
{
@@ -45,22 +46,23 @@ class MyHorBar extends pChart
$this->validateData("drawBarGraph",$Data);
$GraphID = 0;
- $Series = count($DataDescription["Values"]);
+ $Series = (isset($DataDescription["Values"])?count($DataDescription["Values"]):0);
$SeriesWidth = $this->DivisionWidth / ($Series+1);
-
- $SerieYOffset = $this->DivisionWidth / 2 - $SeriesWidth * $Series / 2;
-
+
+ $SerieYOffset = $this->DivisionWidth / 2 - $SeriesWidth * $Series / 2;
+
$XZero = $this->GArea_X1 + ((0-$this->VMin) * $this->DivisionRatio);
- if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
+ if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
$SerieID = 0;
+ if(isset($DataDescription["Values"]))
foreach ( $DataDescription["Values"] as $Key2 => $ColName )
{
$ID = 0;
foreach ( $DataDescription["Description"] as $keyI => $ValueI )
{ if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; }
- $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset + $SeriesWidth * $SerieID;
+ $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset + $SeriesWidth * $SerieID;
$XLast = -1;
foreach ( $Data as $Key => $Values )
@@ -69,8 +71,8 @@ class MyHorBar extends pChart
{
if ( is_numeric($Data[$Key][$ColName]) )
{
- $Value = $Data[$Key][$ColName];
-
+ $Value = $Data[$Key][$ColName];
+
$XPos = $this->GArea_X1 + (($Value-$this->VMin) * $this->DivisionRatio);
/* Save point into the image map if option activated */
@@ -82,46 +84,46 @@ class MyHorBar extends pChart
if ( $Shadow && $Alpha == 100 )
$this->drawRectangle($XZero,$YPos+1,$XPos,$YPos+$SeriesWidth-1,25,25,25,TRUE,$Alpha);
- $this->drawFilledRectangle($XZero,$YPos+1,$XPos,$YPos+$SeriesWidth-1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha);
-
- // Izrisemo vrednosti znotraj stolpca
- if($insideValues == true){
-
- if($DataDescription["Unit"]["Y"] == '%')
- $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'));
- else
- $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-
- if ( $DataDescription["Format"]["Y"] == "number" )
- $Text = $Value.$DataDescription["Unit"]["Y"];
- if ( $DataDescription["Format"]["Y"] == "time" )
- $Text = $this->ToTime($Value);
- if ( $DataDescription["Format"]["Y"] == "date" )
- $Text = $this->ToDate($Value);
- if ( $DataDescription["Format"]["Y"] == "metric" )
- $Text = $this->ToMetric($Value);
- if ( $DataDescription["Format"]["Y"] == "currency" )
- $Text = $this->ToCurrency($Value);
-
- $Position = imageftbbox($this->FontSize,0,$this->FontName,$Text);
- $TextWidth = $Position[2]-$Position[0];
-
- $X = ($XZero + $XPos) / 2;
- $Y = ($YPos+1 + $YPos+$SeriesWidth-1) / 2;
-
- $text_colors = $this->getContrastTextColor($this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
- $C_TextColor = $this->AllocateColor($this->Picture,$text_colors['R'],$text_colors['G'],$text_colors['B']);
-
- //imagettftext($this->Picture,$this->FontSize,0,$XPos-($this->FontSize/2),$this->GArea_Y1-10,$C_TextColor,$this->FontName,$Value);
- if($Value > 0 && ($this->VMin != 1 || $Value > 1) && ($XPos-$XZero > 20)){
- imagettftext($this->Picture,$this->FontSize,0,$X-($TextWidth/2),$Y+4,$C_TextColor,$this->FontName,$Text);
- }
- // Izrisemo se majhne vrednosti zraven stolpca
- elseif($insideValuesSmall == true){
- $C_TextColor = $this->AllocateColor($this->Picture,0,0,0);
- imagettftext($this->Picture,$this->FontSize,0,$XPos+4,$Y+4,$C_TextColor,$this->FontName,$Text);
- }
- }
+ $this->drawFilledRectangle($XZero,$YPos+1,$XPos,$YPos+$SeriesWidth-1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha);
+
+ // Izrisemo vrednosti znotraj stolpca
+ if($insideValues == true){
+
+ if($DataDescription["Unit"]["Y"] == '%')
+ $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'));
+ else
+ $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
+
+ if ( $DataDescription["Format"]["Y"] == "number" )
+ $Text = $Value.$DataDescription["Unit"]["Y"];
+ if ( $DataDescription["Format"]["Y"] == "time" )
+ $Text = $this->ToTime($Value);
+ if ( $DataDescription["Format"]["Y"] == "date" )
+ $Text = $this->ToDate($Value);
+ if ( $DataDescription["Format"]["Y"] == "metric" )
+ $Text = $this->ToMetric($Value);
+ if ( $DataDescription["Format"]["Y"] == "currency" )
+ $Text = $this->ToCurrency($Value);
+
+ $Position = imageftbbox($this->FontSize,0,$this->FontName,$Text);
+ $TextWidth = $Position[2]-$Position[0];
+
+ $X = ($XZero + $XPos) / 2;
+ $Y = ($YPos+1 + $YPos+$SeriesWidth-1) / 2;
+
+ $text_colors = $this->getContrastTextColor($this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
+ $C_TextColor = $this->AllocateColor($this->Picture,$text_colors['R'],$text_colors['G'],$text_colors['B']);
+
+ //imagettftext($this->Picture,$this->FontSize,0,$XPos-($this->FontSize/2),$this->GArea_Y1-10,$C_TextColor,$this->FontName,$Value);
+ if($Value > 0 && ($this->VMin != 1 || $Value > 1) && ($XPos-$XZero > 20)){
+ imagettftext($this->Picture,$this->FontSize,0,$X-($TextWidth/2),$Y+4,$C_TextColor,$this->FontName,$Text);
+ }
+ // Izrisemo se majhne vrednosti zraven stolpca
+ elseif($insideValuesSmall == true){
+ $C_TextColor = $this->AllocateColor($this->Picture,0,0,0);
+ imagettftext($this->Picture,$this->FontSize,0,$XPos+4,$Y+4,$C_TextColor,$this->FontName,$Text);
+ }
+ }
}
}
@@ -129,173 +131,173 @@ class MyHorBar extends pChart
}
$SerieID++;
}
- }
-
- /* Izrisemo horizontalni graf s sestavljenimi stolpci */
- function drawStackedHorBarGraph($Data,$DataDescription,$insideValues=false,$Alpha=100)
- {
- /* Validate the Data and DataDescription array */
- $this->validateDataDescription("drawBarGraph",$DataDescription);
- $this->validateData("drawBarGraph",$Data);
-
- $GraphID = 0;
- $Series = count($DataDescription["Values"]);
- $SeriesWidth = $this->DivisionWidth * .8; //$this->DivisionWidth / ($Series+1);
-
- $SerieYOffset = $this->DivisionWidth / 2;
-
- $XZero = $this->GArea_X1 + ((0-$this->VMin) * $this->DivisionRatio);
- if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
-
- $SerieID = 0;
- $LastValue = array();
- foreach ( $DataDescription["Values"] as $Key2 => $ColName )
- {
- $ID = 0;
-
- foreach ( $DataDescription["Description"] as $keyI => $ValueI )
- { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; }
-
- $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset - $SeriesWidth / 2;
-
- $XLast = -1;
- foreach ( $Data as $Key => $Values )
- {
- if ( isset($Data[$Key][$ColName]))
- {
- if ( is_numeric($Data[$Key][$ColName]) )
- {
- $Value = $Data[$Key][$ColName];
-
- if ( isset($LastValue[$Key]) )
- {
- $XPos = $this->GArea_X1 + ((($Value+$LastValue[$Key])-$this->VMin) * $this->DivisionRatio);
- $XLeft = $this->GArea_X1 + (($LastValue[$Key]-$this->VMin) * $this->DivisionRatio);
- $LastValue[$Key] += $Value;
- }
- else
- {
- $XPos = $this->GArea_X1 + (($Value-$this->VMin) * $this->DivisionRatio);
- $XLeft = $XZero;
- $LastValue[$Key] = $Value;
- }
-
- /* Save point into the image map if option activated */
- if ( $this->BuildMap )
- {
- $this->addToImageMap(min($XLeft,$XPos),$YPos+1,max($XLeft,$XPos), $YPos+$SeriesWidth-1,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Bar");
- }
-
- if ( $Shadow && $Alpha == 100 )
- $this->drawRectangle($XLeft,$YPos+1,$XPos,$YPos+$SeriesWidth-1,25,25,25,TRUE,$Alpha);
-
- $this->drawFilledRectangle($XLeft,$YPos+1,$XPos,$YPos+$SeriesWidth-1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha);
-
- // Izrisemo vrednosti znotraj stolpca
- if($insideValues == true){
- $X = 0;
- $Y = 0;
-
- if($DataDescription["Unit"]["Y"] == '%')
- $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'));
- else
- $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
-
- if ( $DataDescription["Format"]["Y"] == "number" )
- $Text = $Value.$DataDescription["Unit"]["Y"];
- if ( $DataDescription["Format"]["Y"] == "time" )
- $Text = $this->ToTime($Value);
- if ( $DataDescription["Format"]["Y"] == "date" )
- $Text = $this->ToDate($Value);
- if ( $DataDescription["Format"]["Y"] == "metric" )
- $Text = $this->ToMetric($Value);
- if ( $DataDescription["Format"]["Y"] == "currency" )
- $Text = $this->ToCurrency($Value);
-
- $Position = imageftbbox($this->FontSize,0,$this->FontName,$Text);
- $TextWidth = $Position[2]-$Position[0];
-
- $X = ($XLeft + $XPos) / 2;
- $Y = ($YPos+1 + $YPos+$SeriesWidth-1) / 2;
-
- $text_colors = $this->getContrastTextColor($this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
- $C_TextColor = $this->AllocateColor($this->Picture,$text_colors['R'],$text_colors['G'],$text_colors['B']);
-
- //imagettftext($this->Picture,$this->FontSize,0,$XPos-($this->FontSize/2),$this->GArea_Y1-10,$C_TextColor,$this->FontName,$Value);
- if($Value > 0 && ($XPos-$XLeft > 20))
- imagettftext($this->Picture,$this->FontSize,0,$X-($TextWidth/2),$Y+4,$C_TextColor,$this->FontName,$Text);
- }
-
-
- }
- }
- $YPos = $YPos + $this->DivisionWidth;
- }
- $SerieID++;
- }
- }
-
-
- /* Izrisemo navpicen linijski graf */
- function drawVerLineGraph($Data,$DataDescription,$insideValues=false,$Shadow=TRUE,$Alpha=100)
- {
- /* Validate the Data and DataDescription array */
- $this->validateDataDescription("drawBarGraph",$DataDescription);
- $this->validateData("drawBarGraph",$Data);
-
- $GraphID = 0;
- $Series = count($DataDescription["Values"]);
- $SeriesWidth = $this->DivisionWidth / ($Series+1);
-
- $SerieYOffset = $this->DivisionWidth / 2;
-
- $XZero = $this->GArea_X1 + ((0-$this->VMin) * $this->DivisionRatio);
- if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
-
- $SerieID = 0;
- foreach ( $DataDescription["Values"] as $Key2 => $ColName )
- {
- $ID = 0;
- foreach ( $DataDescription["Description"] as $keyI => $ValueI )
- { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; }
-
- $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset;
-
- $XLast = -1;
- foreach ( $Data as $Key => $Values )
- {
- if ( isset($Data[$Key][$ColName]))
- {
- if ( is_numeric($Data[$Key][$ColName]) )
- {
- $Value = $Data[$Key][$ColName];
-
- $XPos = $this->GArea_X1 + (($Value-$this->VMin) * $this->DivisionRatio);
-
- // Save point into the image map if option activated
- if ( $this->BuildMap )
- {
- $this->addToImageMap(min($XZero,$XPos),$YPos+1,max($XZero,$XPos), $YPos+$SeriesWidth-1,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Bar");
- }
-
- if ( $XLast != -1 ){
- $this->drawLine($XLast,$YLast,$XPos,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE);
- $this->drawFilledCircle($XLast+1,$YLast+1,$SmallRadius=2,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
- }
-
- $XLast = $XPos;
- $YLast = $YPos;
- }
- }
- $YPos = $YPos + $this->DivisionWidth;
- }
- $SerieID++;
-
- $this->drawFilledCircle($XLast+1,$YLast+1,$SmallRadius=2,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
- }
- }
-
-
+ }
+
+ /* Izrisemo horizontalni graf s sestavljenimi stolpci */
+ function drawStackedHorBarGraph($Data,$DataDescription,$insideValues=false,$Alpha=100)
+ {
+ /* Validate the Data and DataDescription array */
+ $this->validateDataDescription("drawBarGraph",$DataDescription);
+ $this->validateData("drawBarGraph",$Data);
+
+ $GraphID = 0;
+ $Series = count($DataDescription["Values"]);
+ $SeriesWidth = $this->DivisionWidth * .8; //$this->DivisionWidth / ($Series+1);
+
+ $SerieYOffset = $this->DivisionWidth / 2;
+
+ $XZero = $this->GArea_X1 + ((0-$this->VMin) * $this->DivisionRatio);
+ if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
+
+ $SerieID = 0;
+ $LastValue = array();
+ foreach ( $DataDescription["Values"] as $Key2 => $ColName )
+ {
+ $ID = 0;
+
+ foreach ( $DataDescription["Description"] as $keyI => $ValueI )
+ { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; }
+
+ $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset - $SeriesWidth / 2;
+
+ $XLast = -1;
+ foreach ( $Data as $Key => $Values )
+ {
+ if ( isset($Data[$Key][$ColName]))
+ {
+ if ( is_numeric($Data[$Key][$ColName]) )
+ {
+ $Value = $Data[$Key][$ColName];
+
+ if ( isset($LastValue[$Key]) )
+ {
+ $XPos = $this->GArea_X1 + ((($Value+$LastValue[$Key])-$this->VMin) * $this->DivisionRatio);
+ $XLeft = $this->GArea_X1 + (($LastValue[$Key]-$this->VMin) * $this->DivisionRatio);
+ $LastValue[$Key] += $Value;
+ }
+ else
+ {
+ $XPos = $this->GArea_X1 + (($Value-$this->VMin) * $this->DivisionRatio);
+ $XLeft = $XZero;
+ $LastValue[$Key] = $Value;
+ }
+
+ /* Save point into the image map if option activated */
+ if ( $this->BuildMap )
+ {
+ $this->addToImageMap(min($XLeft,$XPos),$YPos+1,max($XLeft,$XPos), $YPos+$SeriesWidth-1,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Bar");
+ }
+
+ if ( /* $Shadow */false && $Alpha == 100 )
+ $this->drawRectangle($XLeft,$YPos+1,$XPos,$YPos+$SeriesWidth-1,25,25,25,TRUE,$Alpha);
+
+ $this->drawFilledRectangle($XLeft,$YPos+1,$XPos,$YPos+$SeriesWidth-1,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE,$Alpha);
+
+ // Izrisemo vrednosti znotraj stolpca
+ if($insideValues == true){
+ $X = 0;
+ $Y = 0;
+
+ if($DataDescription["Unit"]["Y"] == '%')
+ $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_PERCENT'));
+ else
+ $Value = round($Value, SurveyDataSettingProfiles :: getSetting('NUM_DIGIT_AVERAGE'));
+
+ if ( $DataDescription["Format"]["Y"] == "number" )
+ $Text = $Value.$DataDescription["Unit"]["Y"];
+ if ( $DataDescription["Format"]["Y"] == "time" )
+ $Text = $this->ToTime($Value);
+ if ( $DataDescription["Format"]["Y"] == "date" )
+ $Text = $this->ToDate($Value);
+ if ( $DataDescription["Format"]["Y"] == "metric" )
+ $Text = $this->ToMetric($Value);
+ if ( $DataDescription["Format"]["Y"] == "currency" )
+ $Text = $this->ToCurrency($Value);
+
+ $Position = imageftbbox($this->FontSize,0,$this->FontName,$Text);
+ $TextWidth = $Position[2]-$Position[0];
+
+ $X = ($XLeft + $XPos) / 2;
+ $Y = ($YPos+1 + $YPos+$SeriesWidth-1) / 2;
+
+ $text_colors = $this->getContrastTextColor($this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
+ $C_TextColor = $this->AllocateColor($this->Picture,$text_colors['R'],$text_colors['G'],$text_colors['B']);
+
+ //imagettftext($this->Picture,$this->FontSize,0,$XPos-($this->FontSize/2),$this->GArea_Y1-10,$C_TextColor,$this->FontName,$Value);
+ if($Value > 0 && ($XPos-$XLeft > 20))
+ imagettftext($this->Picture,$this->FontSize,0,$X-($TextWidth/2),$Y+4,$C_TextColor,$this->FontName,$Text);
+ }
+
+
+ }
+ }
+ $YPos = $YPos + $this->DivisionWidth;
+ }
+ $SerieID++;
+ }
+ }
+
+
+ /* Izrisemo navpicen linijski graf */
+ function drawVerLineGraph($Data,$DataDescription,$insideValues=false,$Shadow=TRUE,$Alpha=100)
+ {
+ /* Validate the Data and DataDescription array */
+ $this->validateDataDescription("drawBarGraph",$DataDescription);
+ $this->validateData("drawBarGraph",$Data);
+
+ $GraphID = 0;
+ $Series = count($DataDescription["Values"]);
+ $SeriesWidth = $this->DivisionWidth / ($Series+1);
+
+ $SerieYOffset = $this->DivisionWidth / 2;
+
+ $XZero = $this->GArea_X1 + ((0-$this->VMin) * $this->DivisionRatio);
+ if ( $XZero < $this->GArea_X1 ) { $XZero = $this->GArea_X1; }
+
+ $SerieID = 0;
+ foreach ( $DataDescription["Values"] as $Key2 => $ColName )
+ {
+ $ID = 0;
+ foreach ( $DataDescription["Description"] as $keyI => $ValueI )
+ { if ( $keyI == $ColName ) { $ColorID = $ID; }; $ID++; }
+
+ $YPos = $this->GArea_Y1 + $this->GAreaXOffset + $SerieYOffset;
+
+ $XLast = -1;
+ foreach ( $Data as $Key => $Values )
+ {
+ if ( isset($Data[$Key][$ColName]))
+ {
+ if ( is_numeric($Data[$Key][$ColName]) )
+ {
+ $Value = $Data[$Key][$ColName];
+
+ $XPos = $this->GArea_X1 + (($Value-$this->VMin) * $this->DivisionRatio);
+
+ // Save point into the image map if option activated
+ if ( $this->BuildMap )
+ {
+ $this->addToImageMap(min($XZero,$XPos),$YPos+1,max($XZero,$XPos), $YPos+$SeriesWidth-1,$DataDescription["Description"][$ColName],$Data[$Key][$ColName].$DataDescription["Unit"]["Y"],"Bar");
+ }
+
+ if ( $XLast != -1 ){
+ $this->drawLine($XLast,$YLast,$XPos,$YPos,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"],TRUE);
+ $this->drawFilledCircle($XLast+1,$YLast+1,$SmallRadius=2,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
+ }
+
+ $XLast = $XPos;
+ $YLast = $YPos;
+ }
+ }
+ $YPos = $YPos + $this->DivisionWidth;
+ }
+ $SerieID++;
+
+ $this->drawFilledCircle($XLast+1,$YLast+1,$SmallRadius=2,$this->Palette[$ColorID]["R"],$this->Palette[$ColorID]["G"],$this->Palette[$ColorID]["B"]);
+ }
+ }
+
+
/* Compute and draw the scale */
function drawHorScale($Data,$DataDescription,$ScaleMode,$R,$G,$B,$DrawTicks=TRUE,$Angle=0,$Decimals=1,$WithMargin=FALSE,$SkipLabels=1,$RightScale=FALSE,$roundText=35)
{
@@ -305,16 +307,16 @@ class MyHorBar extends pChart
$C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B);
$this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y1,$R,$G,$B);
- $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X1,$this->GArea_Y2,$R,$G,$B);
- if($RightScale)
+ $this->drawLine($this->GArea_X1,$this->GArea_Y1,$this->GArea_X1,$this->GArea_Y2,$R,$G,$B);
+ if($RightScale)
$this->drawLine($this->GArea_X2,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B);
if ( $this->VMin == NULL && $this->VMax == NULL)
{
if (isset($DataDescription["Values"][0]))
{
- $this->VMin = $Data[0][$DataDescription["Values"][0]];
- $this->VMax = $Data[0][$DataDescription["Values"][0]];
+ $this->VMin = isset($Data[0][$DataDescription["Values"][0]])?$Data[0][$DataDescription["Values"][0]]:null;
+ $this->VMax = isset($Data[0][$DataDescription["Values"][0]])?$Data[0][$DataDescription["Values"][0]]:null;
}
else { $this->VMin = 2147483647; $this->VMax = -2147483647; }
@@ -361,11 +363,11 @@ class MyHorBar extends pChart
}
}
- if ( $this->VMax > preg_replace('/\.[0-9]+/','',$this->VMax) ){
+ if ( $this->VMax!=null && $this->VMax > preg_replace('/\.[0-9]+/','',$this->VMax) ){
if(preg_replace('/\.[0-9]+/','',$this->VMax) == 100)
- $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax);
- else
- $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax)+1;
+ $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax);
+ else
+ $this->VMax = preg_replace('/\.[0-9]+/','',$this->VMax)+1;
}
/* If all values are the same */
@@ -380,12 +382,12 @@ class MyHorBar extends pChart
/* Compute automatic scaling */
$ScaleOk = FALSE; $Factor = 1;
- $MinDivHeight = 25;
-
+ $MinDivHeight = 25;
+
$MaxDivs = ($this->GArea_X2 - $this->GArea_X1) / $MinDivHeight;
if ( $this->VMin == 0 && $this->VMax == 0 )
- { $this->VMin = 0; $this->VMax = 2; $Scale = 1; $Divisions = 2;}
+ { $this->VMin = 0; $this->VMax = 2; $Scale = 1; $Divisions = 2;}
elseif ($MaxDivs > 1)
{
@@ -425,61 +427,61 @@ class MyHorBar extends pChart
$Divisions = 2;
if ($Scale == 1 && $Divisions%2 == 1)
- $Divisions--;
-
- // Posebeni primeri skal
- // 0 - 10
- if ( $this->VMin == 0 && in_array($this->VMax,array(3,4,5,6,7,8,9,10)) ){
- $Divisions = $this->VMax;
- }
- // 10 - 25
- elseif ( $this->VMin == 0 && $this->VMax > 10 && $this->VMax <= 25){
- $this->VMax = $this->roundToNearest($this->VMax, 5);
- $Divisions = $this->VMax/5;
- }
- // 25 - 50
- elseif ( $this->VMin == 0 && $this->VMax > 25 && $this->VMax <= 50 ){
- $this->VMax = $this->roundToNearest($this->VMax, 10);
- $Divisions = $this->VMax/10;
- }
- // 50+
- elseif ( $this->VMin == 0 && $this->VMax > 50 && $this->VMax <= 200 ){
- $this->VMax = $this->roundToNearest($this->VMax, 20);
- $Divisions = $this->VMax/20;
- }
- // 200+
- elseif ( $this->VMin == 0 && $this->VMax > 200 ){
- $this->VMax = $this->roundToNearest($this->VMax, 100);
- $Divisions = 8;
+ $Divisions--;
+
+ // Posebeni primeri skal
+ // 0 - 10
+ if ( $this->VMin == 0 && in_array($this->VMax,array(3,4,5,6,7,8,9,10)) ){
+ $Divisions = $this->VMax;
+ }
+ // 10 - 25
+ elseif ( $this->VMin == 0 && $this->VMax > 10 && $this->VMax <= 25){
+ $this->VMax = $this->roundToNearest($this->VMax, 5);
+ $Divisions = $this->VMax/5;
+ }
+ // 25 - 50
+ elseif ( $this->VMin == 0 && $this->VMax > 25 && $this->VMax <= 50 ){
+ $this->VMax = $this->roundToNearest($this->VMax, 10);
+ $Divisions = $this->VMax/10;
+ }
+ // 50+
+ elseif ( $this->VMin == 0 && $this->VMax > 50 && $this->VMax <= 200 ){
+ $this->VMax = $this->roundToNearest($this->VMax, 20);
+ $Divisions = $this->VMax/20;
+ }
+ // 200+
+ elseif ( $this->VMin == 0 && $this->VMax > 200 ){
+ $this->VMax = $this->roundToNearest($this->VMax, 100);
+ $Divisions = 8;
}
}
else
$Divisions = $this->Divisions;
-
- $Divisions = ($Divisions == 0) ? 1 : $Divisions;
+
+ $Divisions = ($Divisions == 0) ? 1 : $Divisions;
$this->DivisionCount = $Divisions;
$DataRange = $this->VMax - $this->VMin;
if ( $DataRange < 0.1 ) { $DataRange = .1; }
-
- $this->DivisionHeight = ( $this->GArea_X2 - $this->GArea_X1 ) / $Divisions;
+
+ $this->DivisionHeight = ( $this->GArea_X2 - $this->GArea_X1 ) / $Divisions;
$this->DivisionRatio = ( $this->GArea_X2 - $this->GArea_X1 ) / $DataRange;
-
+
$this->GAreaYOffset = 0;
if ( count($Data) > 1 )
{
- if ( $WithMargin == FALSE )
+ if ( $WithMargin == FALSE )
$this->DivisionWidth = ( $this->GArea_Y2 - $this->GArea_Y1 ) / (count($Data)-1);
else
- {
- $this->DivisionWidth = ( $this->GArea_Y2 - $this->GArea_Y1 ) / (count($Data));
+ {
+ $this->DivisionWidth = ( $this->GArea_Y2 - $this->GArea_Y1 ) / (count($Data));
$this->GAreaYOffset = $this->DivisionWidth / 2;
}
}
else
- {
- $this->DivisionWidth = $this->GArea_Y2 - $this->GArea_Y1;
+ {
+ $this->DivisionWidth = $this->GArea_Y2 - $this->GArea_Y1;
$this->GAreaYOffset = $this->DivisionWidth / 2;
}
@@ -487,39 +489,41 @@ class MyHorBar extends pChart
if ( $DrawTicks == FALSE )
return(0);
-
- $XPos = $this->GArea_X1;
- $YMin = NULL;
+
+ $XPos = $this->GArea_X1;
+ $YMin = NULL;
for($i=1;$i<=$Divisions+1;$i++)
- {
+ {
$this->drawLine($XPos,$this->GArea_Y1,$XPos,$this->GArea_Y1-floor($this->FontSize/2),$R,$G,$B);
- $Value = $this->VMin + ($i-1) * (( $this->VMax - $this->VMin ) / $Divisions);
+ $Value = $this->VMin + ($i-1) * (( $this->VMax - $this->VMin ) / $Divisions);
$OrigValue = $Value;
$Value = round($Value * pow(10,$Decimals)) / pow(10,$Decimals);
- if ( $DataDescription["Format"]["Y"] == "number" )
- $Value = $Value.$DataDescription["Unit"]["Y"];
- if ( $DataDescription["Format"]["Y"] == "time" )
- $Value = $this->ToTime($Value);
- if ( $DataDescription["Format"]["Y"] == "date" )
- $Value = $this->ToDate($Value);
- if ( $DataDescription["Format"]["Y"] == "metric" )
- $Value = $this->ToMetric($Value);
- if ( $DataDescription["Format"]["Y"] == "currency" )
- $Value = $this->ToCurrency($Value);
-
- // Ce je oznacba na skali decimalka je ne izpisemo (ker zaokrozujemo na cela stevila)
- if($Decimals == 0)
- $Value = ($OrigValue != $Value) ? '' : $Value;
+ if(isset($DataDescription["Format"]["Y"])){
+ if ( $DataDescription["Format"]["Y"] == "number" )
+ $Value = $Value.$DataDescription["Unit"]["Y"];
+ if ( $DataDescription["Format"]["Y"] == "time" )
+ $Value = $this->ToTime($Value);
+ if ( $DataDescription["Format"]["Y"] == "date" )
+ $Value = $this->ToDate($Value);
+ if ( $DataDescription["Format"]["Y"] == "metric" )
+ $Value = $this->ToMetric($Value);
+ if ( $DataDescription["Format"]["Y"] == "currency" )
+ $Value = $this->ToCurrency($Value);
+ }
+
+ // Ce je oznacba na skali decimalka je ne izpisemo (ker zaokrozujemo na cela stevila)
+ if($Decimals == 0)
+ $Value = ($OrigValue != $Value) ? '' : $Value;
$Position = imageftbbox($this->FontSize,0,$this->FontName,$Value);
$TextWidth = $Position[2]-$Position[0];
imagettftext($this->Picture,$this->FontSize,0,$XPos-($TextWidth/2),$this->GArea_Y1-$this->FontSize,$C_TextColor,$this->FontName,$Value);
-
+
if ( $YMin > $this->GArea_Y1-10-$TextWidth || $YMin == NULL ) { $YMin = $this->GArea_Y1-10-$TextWidth; }
-
+
$XPos = $XPos + $this->DivisionHeight;
}
@@ -535,56 +539,56 @@ class MyHorBar extends pChart
/* Horizontal Axis */
$YPos = $this->GArea_Y1 + $this->GAreaYOffset;
- $ID = 1;
+ $ID = 1;
$XMax = NULL;
foreach ( $Data as $Key => $Values )
{
if ( $ID % $SkipLabels == 0 )
- {
+ {
$this->drawLine($this->GArea_X1,floor($YPos),$this->GArea_X1-floor($this->FontSize/2),floor($YPos),$R,$G,$B);
-
- $Value = $Data[$Key][$DataDescription["Position"]];
-
- //razbijemo text v dve vrstici
- $Value2 = '';
- if(($roundText == 60 || $roundText == 80 || $roundText == 40) && strlen($Value)>$roundText){
-
- $pos = strrpos(substr($Value,0,$roundText), ' ');
-
- $Value2 = substr($Value, $pos);
- $Value = substr($Value, 0, $pos);
-
- //$Value2 = substr($Value, 61);
- //$Value = substr($Value, 0, 60);
-
- $Value2 = $this->snippet($Value2, $roundText);
- }
+
+ $Value = $Data[$Key][$DataDescription["Position"]];
+
+ //razbijemo text v dve vrstici
+ $Value2 = '';
+ if(($roundText == 60 || $roundText == 80 || $roundText == 40) && strlen($Value)>$roundText){
+
+ $pos = strrpos(substr($Value,0,$roundText), ' ');
+
+ $Value2 = substr($Value, $pos);
+ $Value = substr($Value, 0, $pos);
+
+ //$Value2 = substr($Value, 61);
+ //$Value = substr($Value, 0, 60);
+
+ $Value2 = $this->snippet($Value2, $roundText);
+ }
// snippet - skrajsamo text na poljubno dolzino
- else{
- $Value = $this->snippet($Data[$Key][$DataDescription["Position"]], $roundText);
- }
-
- // Labele na desni za sem. diferencial
- if(isset($DataDescription["Right"])){
- $ValueSem = $Data[$Key][$DataDescription["Right"]];
-
- //razbijemo text v dve vrstici
- $ValueSem2 = '';
- if(($roundText == 60 || $roundText == 80 || $roundText == 40) && strlen($ValueSem)>$roundText){
-
- $pos = strrpos(substr($ValueSem,0,$roundText), ' ');
-
- $ValueSem2 = substr($ValueSem, $pos);
- $ValueSem = substr($ValueSem, 0, $pos);
-
- $ValueSem2 = $this->snippet($ValueSem2, $roundText);
- }
- // snippet - skrajsamo text na poljubno dolzino
- else{
- $ValueSem = $this->snippet($Data[$Key][$DataDescription["Right"]], $roundText);
- }
- }
-
+ else{
+ $Value = $this->snippet($Data[$Key][$DataDescription["Position"]], $roundText);
+ }
+
+ // Labele na desni za sem. diferencial
+ if(isset($DataDescription["Right"])){
+ $ValueSem = $Data[$Key][$DataDescription["Right"]];
+
+ //razbijemo text v dve vrstici
+ $ValueSem2 = '';
+ if(($roundText == 60 || $roundText == 80 || $roundText == 40) && strlen($ValueSem)>$roundText){
+
+ $pos = strrpos(substr($ValueSem,0,$roundText), ' ');
+
+ $ValueSem2 = substr($ValueSem, $pos);
+ $ValueSem = substr($ValueSem, 0, $pos);
+
+ $ValueSem2 = $this->snippet($ValueSem2, $roundText);
+ }
+ // snippet - skrajsamo text na poljubno dolzino
+ else{
+ $ValueSem = $this->snippet($Data[$Key][$DataDescription["Right"]], $roundText);
+ }
+ }
+
if ( $DataDescription["Format"]["X"] == "number" )
$Value = $Value.$DataDescription["Unit"]["X"];
if ( $DataDescription["Format"]["X"] == "time" )
@@ -598,77 +602,78 @@ class MyHorBar extends pChart
$Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value);
$TextWidth = abs($Position[2])+abs($Position[0]);
- $TextHeight = abs($Position[5])-abs($Position[1]);
-
- if(($roundText == 60 || $roundText == 80 || $roundText == 40) && $Value2 != ''){
- $Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value2);
- $TextWidth2 = abs($Position[2])+abs($Position[0]);
+ $TextHeight = abs($Position[5])-abs($Position[1]);
+
+ if(($roundText == 60 || $roundText == 80 || $roundText == 40) && $Value2 != ''){
+ $Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value2);
+ $TextWidth2 = abs($Position[2])+abs($Position[0]);
}
if ( $Angle == 0 )
- {
- //izpisemo v 2 vrsticah
- if(($roundText == 60 || $roundText == 80 || $roundText == 40) && $Value2 != ''){
- $XPos = $this->GArea_Y2+floor($this->FontSize*2);
- imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth),floor($YPos)-(2*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$Value);
- imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth2),floor($YPos)+$TextHeight+(3*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$Value2);
- }
- else{
- $XPos = $this->GArea_Y2+floor($this->FontSize*2); imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth),floor($YPos)+floor($TextHeight/2),$C_TextColor,$this->FontName,$Value);
+ {
+ //izpisemo v 2 vrsticah
+ if(($roundText == 60 || $roundText == 80 || $roundText == 40) && $Value2 != ''){
+ $XPos = $this->GArea_Y2+floor($this->FontSize*2);
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth),floor($YPos)-(2*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$Value);
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth2),floor($YPos)+$TextHeight+(3*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$Value2);
+ }
+ else{
+ $XPos = $this->GArea_Y2+floor($this->FontSize*2);
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X1-$this->FontSize-floor($TextWidth),floor($YPos)+floor($TextHeight/2),$C_TextColor,$this->FontName,$Value);
}
}
else
- {
- $XPos = $this->GArea_Y2+10+$TextHeight;
- if ( $Angle <= 90 )
+ {
+ $XPos = $this->GArea_Y2+10+$TextHeight;
+ if ( $Angle <= 90 )
imagettftext($this->Picture,$this->FontSize,$Angle,$XPos,floor($YPos)-$TextWidth+5,$C_TextColor,$this->FontName,$Value);
- else
+ else
imagettftext($this->Picture,$this->FontSize,$Angle,$XPos,floor($YPos)+$TextWidth+5,$C_TextColor,$this->FontName,$Value);
- }
- if ( $XMax < $XPos || $XMax == NULL ) { $XMax = $XPos; }
-
- // Se izpis skale na desni (pri semanticnem diferencialu)
- if(isset($DataDescription["Right"]) && $RightScale){
- $this->drawLine($this->GArea_X2,floor($YPos),$this->GArea_X2+5,floor($YPos),$R,$G,$B);
-
- //izpisemo v 2 vrsticah
- if($roundText == 40 && $ValueSem2 != ''){
- $XPos = $this->GArea_Y2+floor($this->FontSize*2);
- imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)-(2*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$ValueSem);
- imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)+$TextHeight+(3*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$ValueSem2);
- }
- else{
- imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)+5-floor($TextHeight/2),$C_TextColor,$this->FontName,$ValueSem);
- }
+ }
+ if ( $XMax < $XPos || $XMax == NULL ) { $XMax = $XPos; }
+
+ // Se izpis skale na desni (pri semanticnem diferencialu)
+ if(isset($DataDescription["Right"]) && $RightScale){
+ $this->drawLine($this->GArea_X2,floor($YPos),$this->GArea_X2+5,floor($YPos),$R,$G,$B);
+
+ //izpisemo v 2 vrsticah
+ if($roundText == 40 && $ValueSem2 != ''){
+ $XPos = $this->GArea_Y2+floor($this->FontSize*2);
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)-(2*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$ValueSem);
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)+$TextHeight+(3*floor($this->FontSize/8)),$C_TextColor,$this->FontName,$ValueSem2);
+ }
+ else{
+ imagettftext($this->Picture,$this->FontSize,$Angle,$this->GArea_X2+$this->FontSize,floor($YPos)+5-floor($TextHeight/2),$C_TextColor,$this->FontName,$ValueSem);
+ }
}
}
-
+
$YPos = $YPos + $this->DivisionWidth;
$ID++;
}
-
- if($RightScale)
- $this->drawLine($this->GArea_X2,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B);
+
+ if($RightScale)
+ $this->drawLine($this->GArea_X2,$this->GArea_Y1,$this->GArea_X2,$this->GArea_Y2,$R,$G,$B);
- /* Write the X Axis caption if set */
+ /* Write the X Axis caption if set */
if ( isset($DataDescription["Axis"]["Y"]) )
- {
+ {
$Position = imageftbbox($this->FontSize,0,$this->FontName,$DataDescription["Axis"]["Y"]);
- $TextWidth = abs($Position[2])+abs($Position[0]);
- $TextLeft = $this->GArea_X1 - ($TextWidth/2);
-
+ $TextWidth = abs($Position[2])+abs($Position[0]);
+ $TextLeft = $this->GArea_X1 - ($TextWidth/2);
+
imagettftext($this->Picture,$this->FontSize,0,$TextLeft,$this->FontSize+12,$C_TextColor,$this->FontName,$DataDescription["Axis"]["Y"]);
}
- }
-
-
+ }
+
+
/* Compute and draw the scale */
function drawHorGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=100)
{
/* Draw mosaic */
if ( $Mosaic )
- {
- $LayerWidth = $this->GArea_Y2-$this->GArea_Y1;
+ {
+ $LayerWidth = $this->GArea_Y2-$this->GArea_Y1;
$LayerHeight = $this->GArea_X2-$this->GArea_X1;
$this->Layers[0] = imagecreatetruecolor($LayerWidth,$LayerHeight);
@@ -677,54 +682,54 @@ class MyHorBar extends pChart
imagecolortransparent($this->Layers[0],$C_White);
$C_Rectangle =$this->AllocateColor($this->Layers[0],250,250,250);
- $XPos = $LayerHeight;
- $LastX = $XPos;
+ $XPos = $LayerHeight;
+ $LastX = $XPos;
for($i=0;$i<=$this->DivisionCount;$i++)
- {
- $LastX = $XPos;
+ {
+ $LastX = $XPos;
$XPos = $XPos - $this->DivisionHeight;
-
+
if ( $XPos <= 0 ) { $XPos = 1; }
if ( $i % 2 == 0 )
- {
+ {
imagefilledrectangle($this->Layers[0],$XPos,1,$LastX,$LayerWidth-1,$C_Rectangle);
}
}
imagecopymerge($this->Picture,$this->Layers[0],$this->GArea_X1,$this->GArea_Y1,0,0,$LayerWidth,$LayerHeight,$Alpha);
imagedestroy($this->Layers[0]);
- }
-
- /* Vertical lines */
+ }
+
+ /* Vertical lines */
$XPos = $this->GArea_X2 - $this->DivisionHeight;
for($i=1;$i<=$this->DivisionCount;$i++)
- {
+ {
if ( $XPos > $this->GArea_X1 && $XPos < $this->GArea_X2 )
- $this->drawDottedLine($XPos,$this->GArea_Y1,$XPos,$this->GArea_Y2,$LineWidth,$R,$G,$B);
+ $this->drawDottedLine($XPos,$this->GArea_Y1,$XPos,$this->GArea_Y2,$LineWidth,$R,$G,$B);
$XPos = $XPos - $this->DivisionHeight;
}
-
+
/* Horizontal lines */
if ( $this->GAreaYOffset == 0 )
- { $YPos = $this->GArea_Y1 + $this->DivisionWidth + $this->GAreaYOffset;
+ { $YPos = $this->GArea_Y1 + $this->DivisionWidth + $this->GAreaYOffset;
$ColCount = $this->DataCount-2; }
else
- { $YPos = $this->GArea_Y1 + $this->GAreaYOffset;
- //$ColCount = floor( ($this->GArea_X2 - $this->GArea_X1) / $this->DivisionWidth );
- $ColCount = $this->DataCount;
+ { $YPos = $this->GArea_Y1 + $this->GAreaYOffset;
+ //$ColCount = floor( ($this->GArea_X2 - $this->GArea_X1) / $this->DivisionWidth );
+ $ColCount = $this->DataCount;
}
for($i=1;$i<=$ColCount;$i++)
- {
+ {
if ( $YPos > $this->GArea_Y1 && $YPos < $this->GArea_Y2 )
- $this->drawDottedLine($this->GArea_X1,floor($YPos),$this->GArea_X2,floor($YPos),$LineWidth,$R,$G,$B);
-
+ $this->drawDottedLine($this->GArea_X1,floor($YPos),$this->GArea_X2,floor($YPos),$LineWidth,$R,$G,$B);
+
$YPos = $YPos + $this->DivisionWidth;
}
- }
-
-
+ }
+
+
/* Compute and draw the scale */
function drawTreshold($Value,$R,$G,$B,$ShowLabel=FALSE,$ShowOnBottom=FALSE,$TickWidth=4,$FreeText=NULL,$Angle=0)
{
@@ -732,43 +737,43 @@ class MyHorBar extends pChart
if ( $G < 0 ) { $G = 0; } if ( $G > 255 ) { $G = 255; }
if ( $B < 0 ) { $B = 0; } if ( $B > 255 ) { $B = 255; }
- $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B);
+ $C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B);
$X = $this->GArea_X1 + ($Value - $this->VMin) * $this->DivisionRatio;
-
+
if ( $X <= $this->GArea_X1 || $X >= $this->GArea_X2 )
return(-1);
- if ( $TickWidth == 0 )
+ if ( $TickWidth == 0 )
$this->drawLine($X,$this->GArea_Y1,$X,$this->GArea_Y2,$R,$G,$B);
- else
+ else
$this->drawDottedLine($X,$this->GArea_Y1,$X,$this->GArea_Y2,$TickWidth,$R,$G,$B);
if ( $ShowLabel )
- {
+ {
if ( $FreeText == NULL )
- { $Label = $Value; } else { $Label = $FreeText; }
-
+ { $Label = $Value; } else { $Label = $FreeText; }
+
$Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Label);
- $TextWidth = abs($Position[2])-abs($Position[0]);
+ $TextWidth = abs($Position[2])-abs($Position[0]);
$TextLeft = abs($Position[3])-abs($Position[1]);
-
+
if ( $ShowOnBottom )
imagettftext($this->Picture,$this->FontSize,$Angle,$X+9,$this->GArea_Y2,$C_TextColor,$this->FontName,$Label);
else
imagettftext($this->Picture,$this->FontSize,$Angle,$X+9,$this->GArea_Y1+$TextLeft,$C_TextColor,$this->FontName,$Label);
}
- }
-
- /* zaokrozimo stevilo $number na $toNearest */
- function roundToNearest($number, $toNearest) {
-
- $retval = 0;
- $mod = $number % $toNearest;
-
- $retval = ($mod > 0) ? $number + ( $toNearest - $mod ) : $number;
-
- return $retval;
- }
-
- }
-?>
+ }
+
+ /* zaokrozimo stevilo $number na $toNearest */
+ function roundToNearest($number, $toNearest) {
+
+ $retval = 0;
+ $mod = $number % $toNearest;
+
+ $retval = ($mod > 0) ? $number + ( $toNearest - $mod ) : $number;
+
+ return $retval;
+ }
+
+ }
+?>
diff --git a/admin/survey/pChart/classes/class.pChart.php b/admin/survey/pChart/classes/class.pChart.php
index af3c0a8..36929f6 100644
--- a/admin/survey/pChart/classes/class.pChart.php
+++ b/admin/survey/pChart/classes/class.pChart.php
@@ -412,8 +412,8 @@
{
if (isset($DataDescription["Values"][0]))
{
- $this->VMin = $Data[0][$DataDescription["Values"][0]];
- $this->VMax = $Data[0][$DataDescription["Values"][0]];
+ $this->VMin = (isset($Data[0][$DataDescription["Values"][0]])?$Data[0][$DataDescription["Values"][0]]:0);
+ $this->VMax = (isset($Data[0][$DataDescription["Values"][0]])?$Data[0][$DataDescription["Values"][0]]:0);
}
else { $this->VMin = 2147483647; $this->VMax = -2147483647; }
@@ -1500,9 +1500,9 @@
$C_TextColor =$this->AllocateColor($this->Picture,$R,$G,$B);
$C_ShadowColor =$this->AllocateColor($this->Picture,0,0,0);
if ( $Shadow )
- imagettftext($this->Picture,$this->FontSize,$Angle,$X+1,$Y+1,$C_ShadowColor,$this->FontName,$Text);
+ imagettftext($this->Picture,$this->FontSize,$Angle,round($X)+1,round($Y)+1,$C_ShadowColor,$this->FontName,$Text);
- imagettftext($this->Picture,$this->FontSize,$Angle,$X,$Y,$C_TextColor,$this->FontName,$Text);
+ imagettftext($this->Picture,$this->FontSize,$Angle,round($X),round($Y),$C_TextColor,$this->FontName,$Text);
}
/* Compute and draw the scale */
@@ -3540,17 +3540,17 @@
for($i=0;$i<=90;$i=$i+$Step)
{
- $Xi1 = cos(($i+180)*3.1418/180) * $Radius + $X1 + $Radius;
- $Yi1 = sin(($i+180)*3.1418/180) * $Radius + $Y1 + $Radius;
+ $Xi1 = round(cos(($i+180)*3.1418/180) * $Radius + $X1 + $Radius);
+ $Yi1 = round(sin(($i+180)*3.1418/180) * $Radius + $Y1 + $Radius);
- $Xi2 = cos(($i-90)*3.1418/180) * $Radius + $X2 - $Radius;
- $Yi2 = sin(($i-90)*3.1418/180) * $Radius + $Y1 + $Radius;
+ $Xi2 = round(cos(($i-90)*3.1418/180) * $Radius + $X2 - $Radius);
+ $Yi2 = round(sin(($i-90)*3.1418/180) * $Radius + $Y1 + $Radius);
- $Xi3 = cos(($i)*3.1418/180) * $Radius + $X2 - $Radius;
- $Yi3 = sin(($i)*3.1418/180) * $Radius + $Y2 - $Radius;
+ $Xi3 = round(cos(($i)*3.1418/180) * $Radius + $X2 - $Radius);
+ $Yi3 = round(sin(($i)*3.1418/180) * $Radius + $Y2 - $Radius);
- $Xi4 = cos(($i+90)*3.1418/180) * $Radius + $X1 + $Radius;
- $Yi4 = sin(($i+90)*3.1418/180) * $Radius + $Y2 - $Radius;
+ $Xi4 = round(cos(($i+90)*3.1418/180) * $Radius + $X1 + $Radius);
+ $Yi4 = round(sin(($i+90)*3.1418/180) * $Radius + $Y2 - $Radius);
imageline($this->Picture,$Xi1,$Yi1,$X1+$Radius,$Yi1,$C_Rectangle);
imageline($this->Picture,$X2-$Radius,$Yi2,$Xi2,$Yi2,$C_Rectangle);
@@ -3856,7 +3856,7 @@
if ( $Alpha == 100 )
{
$C_Aliased = $this->AllocateColor($this->Picture,$R,$G,$B);
- imagesetpixel($this->Picture,$X,$Y,$C_Aliased);
+ imagesetpixel($this->Picture,round($X),round($Y),$C_Aliased);
}
else
$this->drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B);
@@ -3888,7 +3888,7 @@
if ( $Alpha == 100 )
{
$C_Aliased = $this->AllocateColor($this->Picture,$R,$G,$B);
- imagesetpixel($this->Picture,$X,$Y,$C_Aliased);
+ imagesetpixel($this->Picture,round($X),round($Y),$C_Aliased);
}
else
$this->drawAlphaPixel($X,$Y,$Alpha,$R,$G,$B);
@@ -3909,13 +3909,14 @@
if (!isset($DataDescription["Description"]))
{
$this->Errors[] = "[Warning] ".$FunctionName." - Series descriptions are not set.";
+ if(isset($DataDescription["Values"]))
foreach($DataDescription["Values"] as $key => $Value)
{
$DataDescription["Description"][$Value] = $Value;
}
}
- if (count($DataDescription["Description"]) < count($DataDescription["Values"]))
+ if (isset($DataDescription["Values"])&&count($DataDescription["Description"]) < count($DataDescription["Values"]))
{
$this->Errors[] = "[Warning] ".$FunctionName." - Some series descriptions are not set.";
foreach($DataDescription["Values"] as $key => $Value)
@@ -3943,7 +3944,7 @@
}
}
- if ( max($DataSummary) == 0 )
+ if ( count($DataSummary)==0||max($DataSummary) == 0 )
$this->Errors[] = "[Warning] ".$FunctionName." - No data set.";
foreach($DataSummary as $key => $Value)
diff --git a/admin/survey/pChart/classes/class.pData.php b/admin/survey/pChart/classes/class.pData.php
index c6be3ff..768bea8 100644
--- a/admin/survey/pChart/classes/class.pData.php
+++ b/admin/survey/pChart/classes/class.pData.php
@@ -132,7 +132,7 @@
for($i=0;$i<=count($this->Data);$i++)
{ if(isset($this->Data[$i][$Serie])) { $ID = $i+1; } }
- if ( count($Value) == 1 )
+ if ( is_integer($Value) || (is_countable($Value) && count($Value) == 1) )
{
$this->Data[$ID][$Serie] = $Value;
if ( $Description != "" )
@@ -140,7 +140,7 @@
elseif (!isset($this->Data[$ID]["Name"]))
$this->Data[$ID]["Name"] = $ID;
}
- elseif( count($Value) > 1 )
+ elseif( is_countable($Value) && count($Value) > 1 )
{
foreach($Value as $key => $Val)
{
diff --git a/admin/survey/parapodatki.php b/admin/survey/parapodatki.php
index b1615cd..95be083 100644
--- a/admin/survey/parapodatki.php
+++ b/admin/survey/parapodatki.php
@@ -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,29 @@ 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;
+
+ // Arhivska 3
+ case '3':
+ $db_table = '_archive3';
+ break;
+
+ // Aktivna anketa
+ case '1':
+ default:
+ $db_table = '_active';
+ break;
+ }
echo $row['id'].delimiter;
echo $row['uid'].delimiter;
diff --git a/admin/survey/public.php b/admin/survey/public.php
index 9db2e6e..06aced8 100644
--- a/admin/survey/public.php
+++ b/admin/survey/public.php
@@ -1,16 +1,15 @@
<?php
+
/** Za hendlanje "javnih" povezav do podatkov...
*
*/
+
ob_start();
header('Cache-Control: no-cache');
header('Pragma: no-cache');
include_once 'definition.php';
-
include_once '../../function.php';
-
-
include_once('../../vendor/autoload.php');
@@ -66,42 +65,58 @@ if ((int)$anketa > 0){
$hashUrl = new HashUrl($anketa);
if ($hashUrl->hashExists($hash)) {
- $properties = $hashUrl -> getProperties($hash);
- $anketa = $properties['anketa'];
+ $properties = $hashUrl -> getProperties($hash);
+ $anketa = $properties['anketa'];
- //refresh every 15s if set
- if($hashUrl -> IsHashRefresh($hash)){
- header('Refresh: 15; URL="'.$site_url.'podatki/'.$anketa.'/'.$hash.'/' );
- }
+ //refresh every 15s if set
+ if($hashUrl -> IsHashRefresh($hash)){
+ header('Refresh: 15; URL="'.$site_url.'podatki/'.$anketa.'/'.$hash.'/' );
+ }
+
+ //check if access password is set and set session values
+ if($hashUrl -> IsHashAccessPass($hash)){
+ session_start();
+ $hashUrl -> checkHashlinkAccessSessionValues($hash);
+ }
+
+ //access password not needed or access already granted
+ if(!$hashUrl -> IsHashAccessPass($hash) || ($hashUrl -> IsHashAccessPass($hash) && isset($_SESSION['hashlink_access'][$hash]) && $_SESSION['hashlink_access'][$hash] == '1')){
- //check if access password is set and set session values
- if($hashUrl -> IsHashAccessPass($hash)){
- session_start();
- $hashUrl -> checkHashlinkAccessSessionValues($hash);
+ if (isset($properties['a'])) {
+ $_GET['a'] = $properties['a'];
}
-
- //access password not needed or access already granted
- if(!$hashUrl -> IsHashAccessPass($hash) || ($hashUrl -> IsHashAccessPass($hash) && isset($_SESSION['hashlink_access'][$hash]) && $_SESSION['hashlink_access'][$hash] == '1')){
- if (isset($properties['a'])) {
- $_GET['a'] = $properties['a'];
- }
- $action = $properties['a'];
- if (isset($properties['m'])) {
- $_GET['m'] = $properties['m'];
+ $action = $properties['a'];
+ if (isset($properties['m'])) {
+ $_GET['m'] = $properties['m'];
- if ($_GET['m'] == M_ANALYSIS_CHARTS) {
- $action = M_ANALYSIS_CHARTS;
- }
+ if ($_GET['m'] == M_ANALYSIS_CHARTS) {
+ $action = M_ANALYSIS_CHARTS;
+ }
- if ($_GET['m'] == M_ANALYSIS_CREPORT) {
- $action = M_ANALYSIS_CREPORT;
- }
+ if ($_GET['m'] == M_ANALYSIS_CREPORT) {
+ $action = M_ANALYSIS_CREPORT;
}
+ }
- $podstran = $properties['m'];
+ $podstran = $properties['m'];
- switch ($action) {
+
+ // Preverimo, ce imamo podatke
+ $SDF = SurveyDataFile::get_instance();
+ $SDF->init($anketa);
+ $SDF->prepareFiles();
+ $dataFileStatus = $SDF->getStatus();
+
+ // Opozorilo, da se ni podatkov
+ if ( $dataFileStatus == FILE_STATUS_NO_DATA || $dataFileStatus == FILE_STATUS_SRV_DELETED) {
+ Common::Init($anketa);
+ Common::noDataAlertPublic($action);
+ die();
+ }
+
+
+ switch ($action) {
case 'data':
$sd = new SurveyDataDisplay($anketa);
$sd::displayPublicData($properties);
@@ -114,29 +129,34 @@ if ((int)$anketa > 0){
$sc::displayPublicChart($properties);
break;
- case M_ANALYSIS_CREPORT:
+ case M_ANALYSIS_CREPORT:
$scr = new SurveyCustomReport($anketa);
$scr->setUpIsForPublic(true);
$scr->displayPublicCReport($properties);
break;
- case 'analysis':
- $sda = new SurveyAnalysis();
- $sda::Init($anketa);
- $sda::$publicAnalyse = true;
- $sda::displayPublicAnalysis($properties);
- break;
-
- default:
- echo 'Error!';
- break;
- }
- }
- //access password needed
- else {
- $hashUrl -> HashlinkAccessPasswordForm($hash);
+ case 'analysis':
+ $sda = new SurveyAnalysis();
+ $sda::Init($anketa);
+ $sda::$publicAnalyse = true;
+ $sda::displayPublicAnalysis($properties);
+ break;
+
+ case 'data_nijz':
+ $nijz = new SurveyNIJZPublic($anketa);
+ $nijz->displayPublicData();
+ break;
+
+ default:
+ echo 'Error!';
+ break;
}
}
+ //access password needed
+ else {
+ $hashUrl -> HashlinkAccessPasswordForm($hash);
+ }
+ }
// Ajax - moramo nastavit userja kot avtorja, drugace ne izvede ajaxa
elseif($_GET['a'] == 'get_variable_labels' || $_GET['a'] == 'getDataStatusTitles'){
diff --git a/admin/survey/redesign_test.php b/admin/survey/redesign_test.php
new file mode 100644
index 0000000..d08207f
--- /dev/null
+++ b/admin/survey/redesign_test.php
@@ -0,0 +1,311 @@
+<?php
+
+?>
+
+<html>
+
+
+ <head>
+
+ <title>1KA | Spletne ankete</title>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta content="width=device-width; initial-scale=1.0;" name="viewport">
+
+ <!-- stari css-ji -->
+ <!--
+ <link type="text/css" href="minify/g=css?v=22.09.30" media="screen" rel="stylesheet">
+ <link type="text/css" href="minify/g=cssPrint?v=22.09.30" media="print" rel="stylesheet">
+ <link type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext" rel="stylesheet">
+ -->
+
+ <!-- novi css -->
+ <link type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext" rel="stylesheet">
+ <link type="text/css" href="../../public/css/admin_new.css" media="screen" rel="stylesheet">
+
+
+ <link rel="shortcut icon" type="image/ico" href="http://localhost//favicon.ico">
+
+ </head>
+
+
+ <body class="mainBody body_anketa">
+
+
+ <div id="main_holder">
+
+ <header>
+ Header
+ </header>
+
+ <div id="main">
+
+ <div id="anketa">
+
+ <div id="anketa_edit" class="menu_left wide">
+
+ <div class="layout_left_item">
+
+ <span class="menu_left-title">
+ Naslov menija
+ </span>
+
+ <ul class="menu_left-list">
+ <li>
+ Posamezna stran
+ </li>
+
+ <li class="active">
+ Aktivna stran
+ </li>
+
+ <li>
+ <a href="https://www.1ka.si/">1ka.si</a>
+ </li>
+
+ <li>
+ Posamezna stran
+ </li>
+ </ul>
+
+ <span class="menu_left-title paid_locked">
+ Plačljivi moduli
+ </span>
+ <span class="faicon lock_close yellow"></span>
+
+
+ <ul class="menu_left-list paid_locked">
+ <li>
+ Posamezna stran
+ </li>
+
+ <li>
+ <a href="https://www.1ka.si/">1ka.si</a>
+ </li>
+
+ <li>
+ Posamezna stran 0123456789
+ </li>
+
+ <li>
+ Posamezna stran z zelo dolgim imenom
+ </li>
+ </ul>
+
+ <span class="menu_left-title">
+ Delno plačljivi moduli
+ </span>
+
+ <ul class="menu_left-list">
+ <li>
+ Odprta stran
+ </li>
+
+ <li>
+ <a class="paid_locked" href="https://www.1ka.si/">Zaklenjena stran</a>
+ <span class="faicon lock_close yellow"></span>
+ </li>
+
+ <li>
+ Odprta stran
+ </li>
+ </ul>
+
+ </div>
+
+ <div class="layout_right_item">
+
+ <fieldset>
+ <legend>Box z vsebino</legend>
+
+ <div class="setting_holder">
+ <label for="textarea1">Tekstovno polje:</label>
+
+ <form>
+ <textarea id="textarea1" name="textarea1"></textarea>
+ </form>
+
+ </div>
+
+ <div class="setting_holder">
+ <label for="textarea1" disabled>Disabled tekstovno polje:</label>
+ <form>
+ <textarea class="disabled" id="textarea1" name="textarea1">Besedilo v disabled polju.</textarea>
+ </form>
+
+ </div>
+
+ <div class="setting_holder">
+ <label for="text1">Input text - large:</label>
+ <form>
+ <input id="text1" class="large" type="text">
+ </form>
+ </div>
+
+ <div class="setting_holder">
+ <label for="text2">Input text - medium:</label>
+ <form>
+ <input id="text2" class="medium" type="text">
+ </form>
+ </div>
+
+ <div class="setting_holder">
+ <label for="text3" disabled>Input text - small - disabled:</label>
+ <form>
+ <input id="text3" class="small disabled" type="text">
+ </form>
+ </div>
+
+ <div class="setting_holder">
+ <label for="dropdown1">Veliki dropdown meni:</label>
+ <form>
+ <select id="dropdown1" class="dropdown large">
+ <option>Q1: veliko besedilaaaaa</option>
+ <option>Q2: manj besedila</option>
+ <option>Q3: malo</option>
+ </select>
+ </form>
+ </div>
+
+ <div class="setting_holder">
+ <label for="dropdown2">Srednji dropdown meni:</label>
+ <form>
+ <select id="dropdown2" class="dropdown medium">
+ <option>Q1: veliko besedilaaaaa</option>
+ <option>Q2: manj besedila</option>
+ <option>Q3: malo</option>
+ </select>
+ </form>
+ </div>
+
+ <div class="setting_holder">
+ <label for="dropdown3" disabled>Mali dropdown meni - disabled:</label>
+ <form>
+ <select id="dropdown3">
+ <option>Q1: veliko besedilaaaaa</option>
+ <option>Q2: manj besedila</option>
+ <option>Q3: malo</option>
+ </select>
+ </form>
+ </div>
+
+ <div class="setting_holder">
+
+ <span class="setting_title">Radio gumbi:</span>
+
+ <div class="setting_item">
+ <input type="radio" id="r1" name="radio">
+ <label for="r1">Option 1</label>
+ </div>
+
+ <div class="setting_item">
+ <input type="radio" id="r2" name="radio">
+ <label for="r2">Option 2</label>
+ </div>
+
+ <div class="setting_item">
+ <input type="radio" id="r3" name="radio" disabled>
+ <label for="r3" disabled>Option 3 - disabled</label>
+ </div>
+
+ </div>
+
+ <div class="setting_holder">
+ <span class="setting_title">Checkboxi - related:</span>
+ <div class="setting_item">
+ <input type="checkbox" id="o1" name="checkbox"></input>
+ <label for="o1">Option 1</label>
+ </div>
+ <div class="setting_item">
+ <input type="checkbox" id="o2" name="checkbox" disabled></input>
+ <label for="o2" disabled>Option 2 - disabled</label>
+ </div>
+ </div>
+
+
+ <p>Checkboxi - unrelated</p>
+
+ <div class="setting_holder">
+ <input type="checkbox" id="c1" name="checkbox"></input>
+ <label for="c1">Ena nastavitev</label>
+ </div>
+ <div class="setting_holder">
+ <input type="checkbox" id="c2" name="checkbox"></input>
+ <label for="c2">Druga nastavitev</label>
+ </div>
+ <div class="setting_holder">
+ <input type="checkbox" id="c3" name="checkbox"></input>
+ <label for="c3">Tretja nastavitev</label>
+ </div>
+
+
+
+ <div class="setting_holder">
+ <label>Gumbi:</label><br><br>
+
+ <button class="small red">Gumb - majhen rdeč</button> <br><br>
+ <button class="large blue">Gumb - velik moder</button> <br><br>
+ <button class="small white-blue">Gumb - white-blue</button> <br><br>
+ <button class="small white-black">Gumb - white-black</button> <br><br>
+ <button class="medium gray">Gumb - siv</button> <br><br>
+ <button class="small yellow">Gumb - rumen</button> <br><br>
+
+ </div>
+
+ <div class="setting_holder">
+ Povezava: <a href="https://www.1ka.si/">www.1ka.si</a>
+ </div>
+
+ <div class="setting_holder">
+ <a class="noline" href="https://www.1ka.si/"><span class="faicon lock_close link-right"></span>Povezava z ikono: www.1ka.si</a>
+ </div>
+
+ <p>Tole je navaden normalen odstavek teksta.</p>
+ <p class="warning">To je opozorilo, ki je celo rdeče.</p>
+ <p><span class="warning">Opozorilo:</span> Tole je opozorilo, ki ni celo rdeče.<p>
+
+
+ <p>Tole je tabela</p>
+ <table>
+ <tr>
+ <th>Tekst - levo</th>
+ <th class="center">Ostalo - center</th>
+ <th>Številka - desno</th>
+ </tr>
+ <tr>
+ <td>Besedilo 1</td>
+ <td class="center">Nekaj</td>
+ <td class="right">1200</td>
+ </tr>
+ <tr>
+ <td>Besedilo 2</td>
+ <td class="center">Nekaj</td>
+ <td class="right">2</td>
+ </tr>
+ </table>
+
+
+
+ </fieldset>
+
+ </div>
+
+ </div>
+ </div>
+ </div>
+
+
+ <footer id="srv_footer">
+ Footer
+ </footer>
+
+ </div>
+
+ </body>
+
+</html>
+
+
+<?php
+
+?> \ No newline at end of file
diff --git a/admin/survey/redesign_test_narrow.php b/admin/survey/redesign_test_narrow.php
new file mode 100644
index 0000000..90ad06f
--- /dev/null
+++ b/admin/survey/redesign_test_narrow.php
@@ -0,0 +1,113 @@
+<?php
+
+?>
+
+<html>
+
+
+ <head>
+
+ <title>1KA | Spletne ankete</title>
+
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta content="width=device-width; initial-scale=1.0;" name="viewport">
+
+ <!-- stari css-ji -->
+ <!--
+ <link type="text/css" href="minify/g=css?v=22.09.30" media="screen" rel="stylesheet">
+ <link type="text/css" href="minify/g=cssPrint?v=22.09.30" media="print" rel="stylesheet">
+ <link type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext" rel="stylesheet">
+ -->
+
+ <!-- novi css -->
+ <link type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,500,500i,600,600i,700,700i&amp;subset=latin-ext" rel="stylesheet">
+ <link type="text/css" href="../../public/css/admin_new.css" media="screen" rel="stylesheet">
+
+
+ <link rel="shortcut icon" type="image/ico" href="http://localhost//favicon.ico">
+
+ </head>
+
+
+ <body class="mainBody body_anketa">
+
+
+ <div id="main_holder">
+
+ <header>
+ Header
+ </header>
+
+ <div id="main">
+
+ <div id="anketa">
+
+ <div id="anketa_edit" class="narrow">
+
+ <fieldset>
+ <legend>Box z vsebino</legend>
+
+ <div class="content_div">
+
+ <h1>
+ H1 Naslov...
+ </h1>
+
+ <h2>
+ H2 Naslov...
+ </h2>
+
+ <h3>
+ H3 Naslov...
+ </h3>
+
+ <h4>
+ H4 Naslov...
+ </h4>
+
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+
+ </div>
+
+
+ </fieldset>
+
+ <fieldset>
+ <legend>Box z vsebino</legend>
+
+ <div class="content_div">
+
+ <h2>
+ H2 Naslov...
+ </h2>
+
+ <p>
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+ </p>
+
+ </div>
+
+
+ </fieldset>
+
+ </div>
+ </div>
+ </div>
+
+
+ <footer id="srv_footer">
+ Footer
+ </footer>
+
+ </div>
+
+ </body>
+
+</html>
+
+
+<?php
+
+?> \ No newline at end of file
diff --git a/admin/survey/script/Chartjs.js b/admin/survey/script/Chartjs.js
new file mode 100644
index 0000000..d968d2f
--- /dev/null
+++ b/admin/survey/script/Chartjs.js
@@ -0,0 +1,28 @@
+function diagnosticsChart(place,display) {
+
+ const data = {
+ datasets: [{
+ data: display,
+ backgroundColor: [
+ 'rgb(229,229,229)',
+ 'rgb(30, 136, 229)',
+ ],
+ borderWidth: 0, //spacing between slices
+ }]
+ };
+
+ const config = {
+ type: 'doughnut',
+ data: data,
+ options: {
+ events: [], //no hover labels,animations,...
+ cutout: 30, //slice width
+ }
+ };
+
+ const myChart = new Chart(
+ document.getElementById(place),
+ config
+ );
+
+} \ No newline at end of file
diff --git a/admin/survey/script/Chartjs/chart.js b/admin/survey/script/Chartjs/chart.js
new file mode 100644
index 0000000..27815c8
--- /dev/null
+++ b/admin/survey/script/Chartjs/chart.js
@@ -0,0 +1,13 @@
+/*!
+ * Chart.js v3.8.0
+ * https://www.chartjs.org
+ * (c) 2022 Chart.js Contributors
+ * Released under the MIT License
+ */
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";const t="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function e(e,i,s){const n=s||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...s){a=n(s),o||(o=!0,t.call(window,(()=>{o=!1,e.apply(i,a)})))}}function i(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const s=t=>"start"===t?"left":"end"===t?"right":"center",n=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,o=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;var a=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=t.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}};
+/*!
+ * @kurkle/color v0.2.1
+ * https://github.com/kurkle/color#readme
+ * (c) 2022 Jukka Kurkela
+ * Released under the MIT License
+ */function r(t){return t+.5|0}const l=(t,e,i)=>Math.max(Math.min(t,i),e);function h(t){return l(r(2.55*t),0,255)}function c(t){return l(r(255*t),0,255)}function d(t){return l(r(t/2.55)/100,0,1)}function u(t){return l(r(100*t),0,100)}const f={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},g=[..."0123456789ABCDEF"],p=t=>g[15&t],m=t=>g[(240&t)>>4]+g[15&t],b=t=>(240&t)>>4==(15&t);function x(t){var e=(t=>b(t.r)&&b(t.g)&&b(t.b)&&b(t.a))(t)?p:m;return t?"#"+e(t.r)+e(t.g)+e(t.b)+((t,e)=>t<255?e(t):"")(t.a,e):void 0}const _=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function y(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function v(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function w(t,e,i){const s=y(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function M(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(t,e,i,s,n){return t===n?(e-i)/s+(e<i?6:0):e===n?(i-t)/s+2:(t-e)/s+4}(e,i,s,h,n),r=60*r+.5),[0|r,l||0,a]}function k(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(c)}function S(t,e,i){return k(y,t,e,i)}function P(t){return(t%360+360)%360}function D(t){const e=_.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?h(+e[5]):c(+e[5]));const n=P(+e[2]),o=+e[3]/100,a=+e[4]/100;return i="hwb"===e[1]?function(t,e,i){return k(w,t,e,i)}(n,o,a):"hsv"===e[1]?function(t,e,i){return k(v,t,e,i)}(n,o,a):S(n,o,a),{r:i[0],g:i[1],b:i[2],a:s}}const C={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},O={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let A;function T(t){A||(A=function(){const t={},e=Object.keys(O),i=Object.keys(C);let s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<i.length;n++)o=i[n],r=r.replace(o,C[o]);o=parseInt(O[a],16),t[r]=[o>>16&255,o>>8&255,255&o]}return t}(),A.transparent=[0,0,0,0]);const e=A[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}const L=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const R=t=>t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055,E=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function I(t,e,i){if(t){let s=M(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=S(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function z(t,e){return t?Object.assign(e||{},t):t}function F(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=c(t[3]))):(e=z(t,{r:0,g:0,b:0,a:1})).a=c(e.a),e}function B(t){return"r"===t.charAt(0)?function(t){const e=L.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=e[8]?h(t):l(255*t,0,255)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?h(i):l(i,0,255)),s=255&(e[4]?h(s):l(s,0,255)),n=255&(e[6]?h(n):l(n,0,255)),{r:i,g:s,b:n,a:o}}}(t):D(t)}class V{constructor(t){if(t instanceof V)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=F(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*f[s[1]],g:255&17*f[s[2]],b:255&17*f[s[3]],a:5===o?17*f[s[4]]:255}:7!==o&&9!==o||(n={r:f[s[1]]<<4|f[s[2]],g:f[s[3]]<<4|f[s[4]],b:f[s[5]]<<4|f[s[6]],a:9===o?f[s[7]]<<4|f[s[8]]:255})),i=n||T(t)||B(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=z(this._rgb);return t&&(t.a=d(t.a)),t}set rgb(t){this._rgb=F(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${d(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?x(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;const e=M(t),i=e[0],s=u(e[1]),n=u(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${d(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let n;const o=e===n?.5:e,a=2*o-1,r=i.a-s.a,l=((a*r==-1?a:(a+r)/(1+a*r))+1)/2;n=1-l,i.r=255&l*i.r+n*s.r+.5,i.g=255&l*i.g+n*s.g+.5,i.b=255&l*i.b+n*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=function(t,e,i){const s=E(d(t.r)),n=E(d(t.g)),o=E(d(t.b));return{r:c(R(s+i*(E(d(e.r))-s))),g:c(R(n+i*(E(d(e.g))-n))),b:c(R(o+i*(E(d(e.b))-o))),a:t.a+i*(e.a-t.a)}}(this._rgb,t._rgb,e)),this}clone(){return new V(this.rgb)}alpha(t){return this._rgb.a=c(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=r(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return I(this._rgb,2,t),this}darken(t){return I(this._rgb,2,-t),this}saturate(t){return I(this._rgb,1,t),this}desaturate(t){return I(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=M(t);i[0]=P(i[0]+e),i=S(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function N(t){return new V(t)}function W(t){if(t&&"object"==typeof t){const e=t.toString();return"[object CanvasPattern]"===e||"[object CanvasGradient]"===e}return!1}function H(t){return W(t)?t:N(t)}function j(t){return W(t)?t:N(t).saturate(.5).darken(.1).hexString()}function $(){}const Y=function(){let t=0;return function(){return t++}}();function U(t){return null==t}function X(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.slice(0,7)&&"Array]"===e.slice(-6)}function q(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const K=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function G(t,e){return K(t)?t:e}function Z(t,e){return void 0===t?e:t}const J=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,Q=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function tt(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function et(t,e,i,s){let n,o,a;if(X(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<o;n++)e.call(i,t[n],n);else if(q(t))for(a=Object.keys(t),o=a.length,n=0;n<o;n++)e.call(i,t[a[n]],a[n])}function it(t,e){let i,s,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function st(t){if(X(t))return t.map(st);if(q(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=st(t[i[n]]);return e}return t}function nt(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function ot(t,e,i,s){if(!nt(t))return;const n=e[t],o=i[t];q(n)&&q(o)?at(n,o,s):e[t]=st(o)}function at(t,e,i){const s=X(e)?e:[e],n=s.length;if(!q(t))return t;const o=(i=i||{}).merger||ot;for(let a=0;a<n;++a){if(!q(e=s[a]))continue;const n=Object.keys(e);for(let s=0,a=n.length;s<a;++s)o(n[s],t,e,i)}return t}function rt(t,e){return at(t,e,{merger:lt})}function lt(t,e,i){if(!nt(t))return;const s=e[t],n=i[t];q(s)&&q(n)?rt(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=st(n))}function ht(t,e){const i=t.indexOf(".",e);return-1===i?t.length:i}function ct(t,e){if(""===e)return t;let i=0,s=ht(e,i);for(;t&&s>i;)t=t[e.slice(i,s)],i=s+1,s=ht(e,i);return t}function dt(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ut=t=>void 0!==t,ft=t=>"function"==typeof t,gt=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function pt(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const mt=Object.create(null),bt=Object.create(null);function xt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;e<s;++e){const s=i[e];t=t[s]||(t[s]=Object.create(null))}return t}function _t(t,e,i){return"string"==typeof e?at(xt(t,e),i):at(xt(t,""),e)}var yt=new class{constructor(t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>j(e.backgroundColor),this.hoverBorderColor=(t,e)=>j(e.borderColor),this.hoverColor=(t,e)=>j(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return _t(this,t,e)}get(t){return xt(this,t)}describe(t,e){return _t(bt,t,e)}override(t,e){return _t(mt,t,e)}route(t,e,i,s){const n=xt(this,t),o=xt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return q(t)?Object.assign({},e,t):Z(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function vt(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,o=0;for(;n-o>1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const wt=(t,e,i)=>vt(t,i,(s=>t[s][e]<i)),Mt=(t,e,i)=>vt(t,i,(s=>t[s][e]>=i));function kt(t,e,i){let s=0,n=t.length;for(;s<n&&t[s]<e;)s++;for(;n>s&&t[n-1]>i;)n--;return s>0||n<t.length?t.slice(s,n):t}const St=["push","pop","shift","splice","unshift"];function Pt(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),St.forEach((e=>{const i="_onData"+dt(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function Dt(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(St.forEach((e=>{delete t[e]})),delete t._chartjs)}function Ct(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}const Ot=Math.PI,At=2*Ot,Tt=At+Ot,Lt=Number.POSITIVE_INFINITY,Rt=Ot/180,Et=Ot/2,It=Ot/4,zt=2*Ot/3,Ft=Math.log10,Bt=Math.sign;function Vt(t){const e=Math.round(t);t=Ht(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Ft(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function Nt(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s==0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort(((t,e)=>t-e)).pop(),e}function Wt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Ht(t,e,i){return Math.abs(t-e)<i}function jt(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function $t(t,e,i){let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Yt(t){return t*(Ot/180)}function Ut(t){return t*(180/Ot)}function Xt(t){if(!K(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function qt(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let o=Math.atan2(s,i);return o<-.5*Ot&&(o+=At),{angle:o,distance:n}}function Kt(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gt(t,e){return(t-e+Tt)%At-Ot}function Zt(t){return(t%At+At)%At}function Jt(t,e,i,s){const n=Zt(t),o=Zt(e),a=Zt(i),r=Zt(o-n),l=Zt(a-n),h=Zt(n-o),c=Zt(n-a);return n===o||n===a||s&&o===a||r>l&&h<c}function Qt(t,e,i){return Math.max(e,Math.min(i,t))}function te(t){return Qt(t,-32768,32767)}function ee(t,e,i,s=1e-6){return t>=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function ie(){return"undefined"!=typeof window&&"undefined"!=typeof document}function se(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function ne(t,e,i){let s;return"string"==typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const oe=t=>window.getComputedStyle(t,null);function ae(t,e){return oe(t).getPropertyValue(e)}const re=["top","right","bottom","left"];function le(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=re[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function he(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:s}=e,n=oe(i),o="border-box"===n.boxSizing,a=le(n,"padding"),r=le(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.touches,s=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=s;let a,r,l=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(n,o,t.target))a=n,r=o;else{const t=e.getBoundingClientRect();a=s.clientX-t.left,r=s.clientY-t.top,l=!0}return{x:a,y:r,box:l}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const ce=t=>Math.round(10*t)/10;function de(t,e,i,s){const n=oe(t),o=le(n,"margin"),a=ne(n.maxWidth,t,"clientWidth")||Lt,r=ne(n.maxHeight,t,"clientHeight")||Lt,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=se(t);if(o){const t=o.getBoundingClientRect(),a=oe(o),r=le(a,"border","width"),l=le(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=ne(a.maxWidth,o,"clientWidth"),n=ne(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||Lt,maxHeight:n||Lt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=le(n,"border","width"),e=le(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?Math.floor(h/s):c-o.height),h=ce(Math.min(h,a,l.maxWidth)),c=ce(Math.min(c,r,l.maxHeight)),h&&!c&&(c=ce(h/2)),{width:h,height:c}}function ue(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=n/s,t.width=o/s;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const fe=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function ge(t,e){const i=ae(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function pe(t){return!t||U(t.size)||U(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function me(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function be(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,h,c,d,u;for(l=0;l<r;l++)if(d=i[l],null!=d&&!0!==X(d))a=me(t,n,o,a,d);else if(X(d))for(h=0,c=d.length;h<c;h++)u=d[h],null==u||X(u)||(a=me(t,n,o,a,u));t.restore();const f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function xe(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function _e(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ye(t,e,i,s){let n,o,a,r,l;const h=e.pointStyle,c=e.rotation,d=e.radius;let u=(c||0)*Rt;if(h&&"object"==typeof h&&(n=h.toString(),"[object HTMLImageElement]"===n||"[object HTMLCanvasElement]"===n))return t.save(),t.translate(i,s),t.rotate(u),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),h){default:t.arc(i,s,d,0,At),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=zt,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=zt,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,o=Math.cos(u+It)*r,a=Math.sin(u+It)*r,t.arc(i-o,s-a,l,u-Ot,u-Et),t.arc(i+a,s-o,l,u-Et,u),t.arc(i+o,s+a,l,u,u+Et),t.arc(i-a,s+o,l,u+Et,u+Ot),t.closePath();break;case"rect":if(!c){r=Math.SQRT1_2*d,t.rect(i-r,s-r,2*r,2*r);break}u+=It;case"rectRot":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+a,s-o),t.lineTo(i+o,s+a),t.lineTo(i-a,s+o),t.closePath();break;case"crossRot":u+=It;case"cross":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o);break;case"star":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o),u+=It,o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a),t.moveTo(i+a,s-o),t.lineTo(i-a,s+o);break;case"line":o=Math.cos(u)*d,a=Math.sin(u)*d,t.moveTo(i-o,s-a),t.lineTo(i+o,s+a);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(u)*d,s+Math.sin(u)*d)}t.fill(),e.borderWidth>0&&t.stroke()}}function ve(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function we(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Me(t){t.restore()}function ke(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!=!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function Se(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function Pe(t,e,i,s,n,o={}){const a=X(e)?e:[e],r=o.strokeWidth>0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);U(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;l<a.length;++l)h=a[l],r&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),U(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(h,i,s,o.maxWidth)),t.fillText(h,i,s,o.maxWidth),De(t,i,s,h,o),s+=n.lineHeight;t.restore()}function De(t,e,i,s,n){if(n.strikethrough||n.underline){const o=t.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,h=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(a,c),t.lineTo(r,c),t.stroke()}}function Ce(t,e){const{x:i,y:s,w:n,h:o,radius:a}=e;t.arc(i+a.topLeft,s+a.topLeft,a.topLeft,-Et,Ot,!0),t.lineTo(i,s+o-a.bottomLeft),t.arc(i+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,Ot,Et,!0),t.lineTo(i+n-a.bottomRight,s+o),t.arc(i+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,Et,0,!0),t.lineTo(i+n,s+a.topRight),t.arc(i+n-a.topRight,s+a.topRight,a.topRight,0,-Et,!0),t.lineTo(i+a.topLeft,s)}function Oe(t,e=[""],i=t,s,n=(()=>t[0])){ut(s)||(s=Ne("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:n,override:n=>Oe([n,...t],e,i,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>Ee(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=Ne(Le(o,t),i),ut(n))return Re(t,n)?Be(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>We(t).includes(e),ownKeys:t=>We(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function Ae(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:Te(t,s),setContext:e=>Ae(t,e,i,s),override:n=>Ae(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>Ee(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];ft(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t),e=e(o,a||s),r.delete(t),Re(t,e)&&(e=Be(n._scopes,n,t,e));return e}(e,r,t,i));X(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(ut(o.index)&&s(t))e=e[o.index%e.length];else if(q(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=Be(s,n,t,l);e.push(Ae(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable));Re(e,r)&&(r=Ae(r,n,o&&o[e],a));return r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function Te(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:ft(i)?i:()=>i,isIndexable:ft(s)?s:()=>s}}const Le=(t,e)=>t?t+dt(e):e,Re=(t,e)=>q(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function Ee(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function Ie(t,e,i){return ft(t)?t(e,i):t}const ze=(t,e)=>!0===t?e:"string"==typeof t?ct(e,t):void 0;function Fe(t,e,i,s,n){for(const o of e){const e=ze(i,o);if(e){t.add(e);const o=Ie(e._fallback,i,n);if(ut(o)&&o!==i&&o!==s)return o}else if(!1===e&&ut(s)&&i!==s)return null}return!1}function Be(t,e,i,s){const n=e._rootScopes,o=Ie(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let l=Ve(r,a,i,o||i,s);return null!==l&&((!ut(o)||o===i||(l=Ve(r,a,o,l,s),null!==l))&&Oe(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];if(X(n)&&q(i))return i;return n}(e,i,s))))}function Ve(t,e,i,s,n){for(;i;)i=Fe(t,e,i,s,n);return i}function Ne(t,e){for(const i of e){if(!i)continue;const e=i[t];if(ut(e))return e}}function We(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}function He(t,e,i,s){const{iScale:n}=t,{key:o="r"}=this._parsing,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={r:n.parse(ct(c,o),h)};return a}const je=Number.EPSILON||1e-14,$e=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ye=t=>"x"===t?"y":"x";function Ue(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=Kt(o,n),l=Kt(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Xe(t,e="x"){const i=Ye(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=$e(t,0);for(a=0;a<s;++a)if(r=l,l=h,h=$e(t,a+1),l){if(h){const t=h[e]-l[e];n[a]=0!==t?(h[i]-l[i])/t:0}o[a]=r?h?Bt(n[a-1])!==Bt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}!function(t,e,i){const s=t.length;let n,o,a,r,l,h=$e(t,0);for(let c=0;c<s-1;++c)l=h,h=$e(t,c+1),l&&h&&(Ht(e[c],0,je)?i[c]=i[c+1]=0:(n=i[c]/e[c],o=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(o,2),r<=9||(a=3/Math.sqrt(r),i[c]=n*a*e[c],i[c+1]=o*a*e[c])))}(t,n,o),function(t,e,i="x"){const s=Ye(i),n=t.length;let o,a,r,l=$e(t,0);for(let h=0;h<n;++h){if(a=r,r=l,l=$e(t,h+1),!r)continue;const n=r[i],c=r[s];a&&(o=(n-a[i])/3,r[`cp1${i}`]=n-o,r[`cp1${s}`]=c-o*e[h]),l&&(o=(l[i]-n)/3,r[`cp2${i}`]=n+o,r[`cp2${s}`]=c+o*e[h])}}(t,o,e)}function qe(t,e,i){return Math.max(Math.min(t,i),e)}function Ke(t,e,i,s,n){let o,a,r,l;if(e.spanGaps&&(t=t.filter((t=>!t.skip))),"monotone"===e.cubicInterpolationMode)Xe(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)r=t[o],l=Ue(i,r,t[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&function(t,e){let i,s,n,o,a,r=ve(t[0],e);for(i=0,s=t.length;i<s;++i)a=o,o=r,r=i<s-1&&ve(t[i+1],e),o&&(n=t[i],a&&(n.cp1x=qe(n.cp1x,e.left,e.right),n.cp1y=qe(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=qe(n.cp2x,e.left,e.right),n.cp2y=qe(n.cp2y,e.top,e.bottom)))}(t,i)}const Ge=t=>0===t||1===t,Ze=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*At/i),Je=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*At/i)+1,Qe={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*Et),easeOutSine:t=>Math.sin(t*Et),easeInOutSine:t=>-.5*(Math.cos(Ot*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Ge(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Ge(t)?t:Ze(t,.075,.3),easeOutElastic:t=>Ge(t)?t:Je(t,.075,.3),easeInOutElastic(t){const e=.1125;return Ge(t)?t:t<.5?.5*Ze(2*t,e,.45):.5+.5*Je(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Qe.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Qe.easeInBounce(2*t):.5*Qe.easeOutBounce(2*t-1)+.5};function ti(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function ei(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function ii(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=ti(t,n,i),r=ti(n,o,i),l=ti(o,e,i),h=ti(a,r,i),c=ti(r,l,i);return ti(h,c,i)}const si=new Map;function ni(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=si.get(i);return s||(s=new Intl.NumberFormat(t,e),si.set(i,s)),s}(e,i).format(t)}const oi=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ai=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ri(t,e){const i=(""+t).match(oi);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function li(t,e){const i={},s=q(e),n=s?Object.keys(e):e,o=q(t)?s?i=>Z(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+o(t)||0;return i}function hi(t){return li(t,{top:"y",right:"x",bottom:"y",left:"x"})}function ci(t){return li(t,["topLeft","topRight","bottomLeft","bottomRight"])}function di(t){const e=hi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ui(t,e){t=t||{},e=e||yt.font;let i=Z(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=Z(t.style,e.style);s&&!(""+s).match(ai)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:Z(t.family,e.family),lineHeight:ri(Z(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:Z(t.weight,e.weight),string:""};return n.string=pe(n),n}function fi(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;n<o;++n)if(a=t[n],void 0!==a&&(void 0!==e&&"function"==typeof a&&(a=a(e),r=!1),void 0!==i&&X(a)&&(a=a[i%a.length],r=!1),void 0!==a))return s&&!r&&(s.cacheable=!1),a}function gi(t,e,i){const{min:s,max:n}=t,o=Q(e,(n-s)/2),a=(t,e)=>i&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function pi(t,e){return Object.assign(Object.create(t),e)}function mi(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function bi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function xi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function _i(t){return"angle"===t?{between:Jt,compare:Gt,normalize:Zt}:{between:ee,compare:(t,e)=>t-e,normalize:t=>t}}function yi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function vi(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=_i(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=_i(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c&&a(r(e[d%l][s]),n,o);++h)d--,u--;d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}(t,e,i),g=[];let p,m,b,x=!1,_=null;const y=()=>x||l(n,b,p)&&0!==r(n,b),v=()=>!x||0===r(o,p)||l(o,b,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==b&&(x=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(yi({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,b=p));return null!==_&&g.push(yi({start:_,end:d,loop:u,count:a,style:f})),g}function wi(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const o=vi(s[n],t.points,e);o.length&&i.push(...o)}return i}function Mi(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:a,end:r}=function(t,e,i,s){let n=0,o=e-1;if(i&&!s)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return ki(t,[{start:a,end:r,loop:o}],i,e);return ki(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,r<a?r+n:r,!!t._fullLoop&&0===a&&r===n-1),i,e)}function ki(t,e,i,s){return s&&s.setContext&&i?function(t,e,i,s){const n=t._chart.getContext(),o=Si(t.options),{_datasetIndex:a,options:{spanGaps:r}}=t,l=i.length,h=[];let c=o,d=e[0].start,u=d;function f(t,e,s,n){const o=r?-1:1;if(t!==e){for(t+=l;i[t%l].skip;)t-=o;for(;i[e%l].skip;)e+=o;t%l!=e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const t of e){d=r?d:t.start;let e,o=i[d%l];for(u=d+1;u<=t.end;u++){const r=i[u%l];e=Si(s.setContext(pi(n,{type:"segment",p0:o,p1:r,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Pi(e,c)&&f(d,u-1,t.loop,c),o=r,c=e}d<u-1&&f(d,u-1,t.loop,c)}return h}(t,e,i,s):e}function Si(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Pi(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}var Di=Object.freeze({__proto__:null,easingEffects:Qe,isPatternOrGradient:W,color:H,getHoverColor:j,noop:$,uid:Y,isNullOrUndef:U,isArray:X,isObject:q,isFinite:K,finiteOrDefault:G,valueOrDefault:Z,toPercentage:J,toDimension:Q,callback:tt,each:et,_elementsEqual:it,clone:st,_merger:ot,merge:at,mergeIf:rt,_mergerIf:lt,_deprecated:function(t,e,i,s){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+s+'" instead')},resolveObjectKey:ct,_capitalize:dt,defined:ut,isFunction:ft,setsEqual:gt,_isClickEvent:pt,toFontString:pe,_measureText:me,_longestText:be,_alignPixel:xe,clearCanvas:_e,drawPoint:ye,_isPointInArea:ve,clipArea:we,unclipArea:Me,_steppedLineTo:ke,_bezierCurveTo:Se,renderText:Pe,addRoundedRectPath:Ce,_lookup:vt,_lookupByKey:wt,_rlookupByKey:Mt,_filterBetween:kt,listenArrayEvents:Pt,unlistenArrayEvents:Dt,_arrayUnique:Ct,_createResolver:Oe,_attachContext:Ae,_descriptors:Te,_parseObjectDataRadialScale:He,splineCurve:Ue,splineCurveMonotone:Xe,_updateBezierControlPoints:Ke,_isDomSupported:ie,_getParentNode:se,getStyle:ae,getRelativePosition:he,getMaximumSize:de,retinaScale:ue,supportsEventListenerOptions:fe,readUsedSize:ge,fontString:function(t,e,i){return e+" "+t+"px "+i},requestAnimFrame:t,throttled:e,debounce:i,_toLeftRightCenter:s,_alignStartEnd:n,_textX:o,_pointInLine:ti,_steppedInterpolation:ei,_bezierInterpolation:ii,formatNumber:ni,toLineHeight:ri,_readValueToProps:li,toTRBL:hi,toTRBLCorners:ci,toPadding:di,toFont:ui,resolve:fi,_addGrace:gi,createContext:pi,PI:Ot,TAU:At,PITAU:Tt,INFINITY:Lt,RAD_PER_DEG:Rt,HALF_PI:Et,QUARTER_PI:It,TWO_THIRDS_PI:zt,log10:Ft,sign:Bt,niceNum:Vt,_factorize:Nt,isNumber:Wt,almostEquals:Ht,almostWhole:jt,_setMinAndMaxByKey:$t,toRadians:Yt,toDegrees:Ut,_decimalPlaces:Xt,getAngleFromPoint:qt,distanceBetweenPoints:Kt,_angleDiff:Gt,_normalizeAngle:Zt,_angleBetween:Jt,_limitValue:Qt,_int16Range:te,_isBetween:ee,getRtlAdapter:mi,overrideTextDirection:bi,restoreTextDirection:xi,_boundSegment:vi,_boundSegments:wi,_computeSegments:Mi});function Ci(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?Mt:wt;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Oi(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t<i;++t){const{index:i,data:r}=o[t],{lo:l,hi:h}=Ci(o[t],e,a,n);for(let t=l;t<=h;++t){const e=r[t];e.skip||s(e,i,t)}}}function Ai(t,e,i,s,n){const o=[];if(!n&&!t.isPointInArea(e))return o;return Oi(t,i,e,(function(i,a,r){(n||ve(i,t.chartArea,0))&&i.inRange(e.x,e.y,s)&&o.push({element:i,datasetIndex:a,index:r})}),!0),o}function Ti(t,e,i,s,n,o){let a=[];const r=function(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,o=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2))}}(i);let l=Number.POSITIVE_INFINITY;return Oi(t,i,e,(function(i,h,c){const d=i.inRange(e.x,e.y,n);if(s&&!d)return;const u=i.getCenterPoint(n);if(!(!!o||t.isPointInArea(u))&&!d)return;const f=r(e,u);f<l?(a=[{element:i,datasetIndex:h,index:c}],l=f):f===l&&a.push({element:i,datasetIndex:h,index:c})})),a}function Li(t,e,i,s,n,o){return o||t.isPointInArea(e)?"r"!==i||s?Ti(t,e,i,s,n,o):function(t,e,i,s){let n=[];return Oi(t,i,e,(function(t,i,o){const{startAngle:a,endAngle:r}=t.getProps(["startAngle","endAngle"],s),{angle:l}=qt(t,{x:e.x,y:e.y});Jt(l,a,r)&&n.push({element:t,datasetIndex:i,index:o})})),n}(t,e,i,n):[]}function Ri(t,e,i,s,n){const o=[],a="x"===i?"inXRange":"inYRange";let r=!1;return Oi(t,i,e,((t,s,l)=>{t[a](e[i],n)&&(o.push({element:t,datasetIndex:s,index:l}),r=r||t.inRange(e.x,e.y,n))})),s&&!r?[]:o}var Ei={evaluateInteractionItems:Oi,modes:{index(t,e,i,s){const n=he(e,t),o=i.axis||"x",a=i.includeInvisible||!1,r=i.intersect?Ai(t,n,o,s,a):Li(t,n,o,!1,s,a),l=[];return r.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=r[0].index,i=t.data[e];i&&!i.skip&&l.push({element:i,datasetIndex:t.index,index:e})})),l):[]},dataset(t,e,i,s){const n=he(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;let r=i.intersect?Ai(t,n,o,s,a):Li(t,n,o,!1,s,a);if(r.length>0){const e=r[0].datasetIndex,i=t.getDatasetMeta(e).data;r=[];for(let t=0;t<i.length;++t)r.push({element:i[t],datasetIndex:e,index:t})}return r},point:(t,e,i,s)=>Ai(t,he(e,t),i.axis||"xy",s,i.includeInvisible||!1),nearest(t,e,i,s){const n=he(e,t),o=i.axis||"xy",a=i.includeInvisible||!1;return Li(t,n,o,i.intersect,s,a)},x:(t,e,i,s)=>Ri(t,he(e,t),"x",i.intersect,s),y:(t,e,i,s)=>Ri(t,he(e,t),"y",i.intersect,s)}};const Ii=["left","top","right","bottom"];function zi(t,e){return t.filter((t=>t.pos===e))}function Fi(t,e){return t.filter((t=>-1===Ii.indexOf(t.pos)&&t.box.axis===e))}function Bi(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Vi(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Ii.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o<a;++o){r=t[o];const{fullSize:a}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:a&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:a&&e.availableHeight)}return i}function Ni(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function Wi(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Hi(t,e,i,s){const{pos:n,box:o}=i,a=t.maxPadding;if(!q(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?o.height:o.width),i.size=e.size/e.count,t[n]+=i.size}o.getPadding&&Wi(a,o.getPadding());const r=Math.max(0,e.outerWidth-Ni(a,t,"left","right")),l=Math.max(0,e.outerHeight-Ni(a,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function ji(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach((t=>{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function $i(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;o<a;++o){r=t[o],l=r.box,l.update(r.width||e.w,r.height||e.h,ji(r.horizontal,e));const{same:a,other:d}=Hi(e,i,r,s);h|=a&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&$i(n,e,i,s)||c}function Yi(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Ui(t,e,i,s){const n=i.padding;let{x:o,y:a}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,o=l.size||t.height;ut(l.start)&&(a=l.start),t.fullSize?Yi(t,n.left,a,i.outerWidth-n.right-n.left,o):Yi(t,e.left+l.placed,a,s,o),l.start=a,l.placed+=s,a=t.bottom}else{const s=e.h*h,a=l.size||t.width;ut(l.start)&&(o=l.start),t.fullSize?Yi(t,o,n.top,a,i.outerHeight-n.bottom-n.top):Yi(t,o,e.top+l.placed,a,s),l.start=o,l.placed+=s,o=t.right}}e.x=o,e.y=a}yt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Xi={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=di(t.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(i-n.height,0),r=function(t){const e=function(t){const e=[];let i,s,n,o,a,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:o,options:{stack:a,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}(t),i=Bi(e.filter((t=>t.box.fullSize)),!0),s=Bi(zi(e,"left"),!0),n=Bi(zi(e,"right")),o=Bi(zi(e,"top"),!0),a=Bi(zi(e,"bottom")),r=Fi(e,"x"),l=Fi(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:zi(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;et(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);Wi(u,di(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=Vi(l.concat(h),d);$i(r.fullSize,f,d,g),$i(l,f,d,g),$i(h,f,d,g)&&$i(l,f,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),Ui(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Ui(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},et(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};class qi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ki extends qi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Gi={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zi=t=>null===t||""===t;const Ji=!!fe&&{passive:!0};function Qi(t,e,i){t.canvas.removeEventListener(e,i,Ji)}function ts(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function es(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ts(i.addedNodes,s),e=e&&!ts(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function is(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||ts(i.removedNodes,s),e=e&&!ts(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const ss=new Map;let ns=0;function os(){const t=window.devicePixelRatio;t!==ns&&(ns=t,ss.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function as(t,i,s){const n=t.canvas,o=n&&se(n);if(!o)return;const a=e(((t,e)=>{const i=o.clientWidth;s(t,e),i<o.clientWidth&&s()}),window),r=new ResizeObserver((t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){ss.size||window.addEventListener("resize",os),ss.set(t,e)}(t,a),r}function rs(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){ss.delete(t),ss.size||window.removeEventListener("resize",os)}(t)}function ls(t,i,s){const n=t.canvas,o=e((e=>{null!==t.ctx&&s(function(t,e){const i=Gi[t.type]||t.type,{x:s,y:n}=he(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,Ji)}(n,i,o),o}class hs extends qi{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Zi(n)){const e=ge(t,"width");void 0!==e&&(t.width=e)}if(Zi(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=ge(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];U(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:es,detach:is,resize:as}[e]||ls;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:rs,detach:rs,resize:rs}[e]||Qi)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return de(t,e,i,s)}isAttached(t){const e=se(t);return!(!e||!e.isConnected)}}function cs(t){return!ie()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Ki:hs}var ds=Object.freeze({__proto__:null,_detectPlatform:cs,BasePlatform:qi,BasicPlatform:Ki,DomPlatform:hs});const us="transparent",fs={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=H(t||us),n=s.valid&&H(e||us);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class gs{constructor(t,e,i,s){const n=e[i];s=fi([t.to,s,n,t.from]);const o=fi([t.from,n,s]);this._active=!0,this._fn=t.fn||fs[t.type||typeof o],this._easing=Qe[t.easing]||Qe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=fi([t.to,e,s,t.from]),this._from=fi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e<i),!this._active)return this._target[s]=a,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=o&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t<i.length;t++)i[t][e]()}}yt.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const ps=Object.keys(yt.animation);yt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),yt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),yt.describe("animations",{_fallback:"animation"}),yt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class ms{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!q(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!q(s))return;const n={};for(const t of ps)n[t]=s[t];(X(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,n)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e<s.length;e++){const n=t[s[e]];n&&n.active()&&i.push(n.wait())}return Promise.all(i)}(t.options.$animations,i).then((()=>{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new gs(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(a.add(this._chart,i),!0):void 0}}function bs(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function xs(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n<o;++n)i.push(s[n].index);return i}function _s(t,e,i,s={}){const n=t.keys,o="single"===s.mode;let a,r,l,h;if(null!==e){for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===i){if(s.all)continue;break}h=t.values[l],K(h)&&(o||0===e||Bt(e)===Bt(h))&&(e+=h)}return e}}function ys(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function vs(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function ws(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Ms(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;t<d;++t){const i=e[t],{[l]:o,[h]:d}=i;u=(i._stacks||(i._stacks={}))[h]=vs(n,c,o),u[r]=d,u._top=ws(u,a,!0,s.type),u._bottom=ws(u,a,!1,s.type)}}function ks(t,e){const i=t.scales;return Object.keys(i).filter((t=>i[t].axis===e)).shift()}function Ss(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const Ps=t=>"reset"===t||"none"===t,Ds=(t,e)=>e?t:Object.assign({},t);class Cs{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ys(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ss(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=Z(i.xAxisID,ks(t,"x")),o=e.yAxisID=Z(i.yAxisID,ks(t,"y")),a=e.rAxisID=Z(i.rAxisID,ks(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,o,a),h=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Dt(this._data,this),t._stacked&&Ss(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(q(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s],i[s]={x:o,y:t[o]};return i}(e);else if(i!==e){if(i){Dt(i,this);const t=this._cachedMeta;Ss(t),t._parsed=[]}e&&Object.isExtensible(e)&&Pt(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=ys(e.vScale,e),e.stack!==i.stack&&(s=!0,Ss(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&Ms(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:o}=i,a=n.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,d=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=X(s[t])?this.parseArrayData(i,s,t,e):q(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[a]||d&&l[a]<d[a];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(n()&&(c=!1),d=l);i._sorted=c}o&&Ms(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:o}=t,a=n.axis,r=o.axis,l=n.getLabels(),h=n===o,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[a]:h||n.parse(l[f],f),[r]:o.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:o}=t,a=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],a[r]={x:n.parse(c[0],h),y:o.parse(c[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:n,yScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(ct(u,a),d),y:o.parse(ct(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,o=e[t.axis];return _s({keys:xs(s,!0),values:e._stacks[t.axis]},o,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let o=null===n?NaN:n;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=_s(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),r=((t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:xs(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function f(){u=s[d];const e=u[a.axis];return!K(u[t.axis])||h>e||c<e}for(d=0;d<o&&(f()||(this.updateRangeFromParsed(l,t,u,r),!n));++d);if(n)for(d=o-1;d>=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s<n;++s)o=e[s][t.axis],K(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=function(t){let e,i,s,n;return q(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}(Z(this.options.clip,function(t,e,i){if(!1===i)return!1;const s=bs(t,i),n=bs(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,o=[],a=this._drawStart||0,r=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,n,a,r),h=a;h<a+r;++h){const e=s[h];e.hidden||(e.active&&l?o.push(e):e.draw(t,n))}for(h=0;h<o.length;++h)o[h].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=function(t,e,i){return pi(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=function(t,e){return pi(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,o=t+"-"+e,a=n[o],r=this.enableOptionSharing&&ut(i);if(a)return Ds(a,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(yt.elements[t]),f=l.resolveNamedOptions(d,u,(()=>this.getContext(i,s)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ds(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new ms(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ps(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){Ps(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ps(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,o=t+e;let a;const r=t=>{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a<o;++a)n[a]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Ss(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}Cs.defaults={},Cs.prototype.datasetElementType=null,Cs.prototype.dataElementType=null;class Os{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Wt(this.x)&&Wt(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach((t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}Os.defaults={},Os.defaultRoutes=void 0;const As={values:t=>X(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=Ft(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),ni(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Ft(t)));return 1===s||2===s||5===s?As.numeric.call(this,t,e,i):""}};var Ts={formatters:As};function Ls(t,e){const i=t.options.ticks,s=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}(e):[],o=n.length,a=n[0],r=n[o-1],l=[];if(o>s)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===a&&(e.push(t[n]),o++,a=i[o*s])}(e,l,n,o/s),l;const h=function(t,e,i){const s=function(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}(t),n=e.length/i;if(!s)return Math.max(n,1);const o=Nt(s);for(let t=0,e=o.length-1;t<e;t++){const e=o[t];if(e>n)return e}return Math.max(n,1)}(n,e,s);if(o>0){let t,i;const s=o>1?Math.round((r-a)/(o-1)):null;for(Rs(e,l,h,U(s)?0:a-s,a),t=0,i=o-1;t<i;t++)Rs(e,l,h,n[t],n[t+1]);return Rs(e,l,h,r,U(s)?e.length:r+s),l}return Rs(e,l,h),l}function Rs(t,e,i,s,n){const o=Z(s,0),a=Math.min(Z(n,t.length),t.length);let r,l,h,c=0;for(i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),h=o;h<0;)c++,h=Math.round(o+c*i);for(l=Math.max(o,0);l<a;l++)l===h&&(e.push(t[l]),c++,h=Math.round(o+c*i))}yt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ts.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),yt.route("scale.ticks","color","","color"),yt.route("scale.grid","color","","borderColor"),yt.route("scale.grid","borderColor","","borderColor"),yt.route("scale.title","color","","color"),yt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),yt.describe("scales",{_fallback:"scale"}),yt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Es=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Is(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;o<n;o+=s)i.push(t[Math.floor(o)]);return i}function zs(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),o=t._startPixel,a=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-o,a-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<o-r||h>a+r)))return h}function Fs(t){return t.drawTicks?t.tickLength:0}function Bs(t,e){if(!t.display)return 0;const i=ui(t.font,e),s=di(t.padding);return(X(t.text)?t.text.length:1)*i.lineHeight+s.height}function Vs(t,e,i){let n=s(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Ns extends Os{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=G(t,Number.POSITIVE_INFINITY),e=G(e,Number.NEGATIVE_INFINITY),i=G(i,Number.POSITIVE_INFINITY),s=G(s,Number.NEGATIVE_INFINITY),{min:G(t,i),max:G(e,s),minDefined:K(t),maxDefined:K(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;r<l;++r)e=a[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),o||(s=Math.max(s,e.max));return i=o&&i>s?s:i,s=n&&i>s?i:s,{min:G(i,G(s,i)),max:G(s,G(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){tt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gi(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a<this.ticks.length;this._convertTicksToLabels(r?Is(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||"auto"===o.source)&&(this.ticks=Ls(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){tt(this.options.afterUpdate,[this])}beforeSetDimensions(){tt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=tt(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,n=e.maxRotation;let o,a,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=Qt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Fs(t.grid)-e.padding-Bs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Ut(Math.min(Math.asin(Qt((h.highest.height+6)/o,-1,1)),Math.asin(Qt(a/r,-1,1))-Math.asin(Qt(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=Bs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Fs(n)+o):(t.height=this.maxHeight,t.width=Fs(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=Yt(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:"inner"!==n&&(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){tt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)U(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Is(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,n=[],o=[];let a,r,l,h,c,d,u,f,g,p,m,b=0,x=0;for(a=0;a<e;++a){if(h=t[a].label,c=this._resolveTickFontOptions(a),i.font=d=c.string,u=s[d]=s[d]||{data:{},gc:[]},f=c.lineHeight,g=p=0,U(h)||X(h)){if(X(h))for(r=0,l=h.length;r<l;++r)m=h[r],U(m)||X(m)||(g=me(i,u.data,u.gc,g,m),p+=f)}else g=me(i,u.data,u.gc,g,h),p=f;n.push(g),o.push(p),b=Math.max(g,b),x=Math.max(p,x)}!function(t,e){et(t,(t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}}))}(s,e);const _=n.indexOf(b),y=o.indexOf(x),v=t=>({width:n[t]||0,height:o[t]||0});return{first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:n,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return te(this._alignToPixels?xe(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=function(t,e,i){return pi(t,{tick:i,index:e,type:"tick"})}(this.getContext(),t,i))}return this.$context||(this.$context=pi(this.chart.getContext(),{scale:this,type:"scale"}))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),o=t.autoSkipPadding||0,a=n?n.widest.width+o:0,r=n?n.highest.height+o:0;return this.isHorizontal()?r*i>a*s?a/i:r/s:r*s<a*i?r/i:a/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o}=s,a=n.offset,r=this.isHorizontal(),l=this.ticks.length+(a?1:0),h=Fs(n),c=[],d=n.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return xe(i,t,u)};let p,m,b,x,_,y,v,w,M,k,S,P;if("top"===o)p=g(this.bottom),y=this.bottom-h,w=p-f,k=g(t.top)+f,P=t.bottom;else if("bottom"===o)p=g(this.top),k=t.top,P=g(t.bottom)-f,y=p+f,w=this.top+h;else if("left"===o)p=g(this.right),_=this.right-h,v=p-f,M=g(t.left)+f,S=t.right;else if("right"===o)p=g(this.left),M=t.left,S=g(t.right)-f,_=p+f,v=this.left+h;else if("x"===e){if("center"===o)p=g((t.top+t.bottom)/2+.5);else if(q(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}k=t.top,P=t.bottom,y=p+f,w=y+h}else if("y"===e){if("center"===o)p=g((t.left+t.right)/2);else if(q(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,v=_-h,M=t.left,S=t.right}const D=Z(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/D));for(m=0;m<l;m+=C){const t=n.setContext(this.getContext(m)),e=t.lineWidth,s=t.color,o=n.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,d=t.tickColor,u=t.tickBorderDash||[],f=t.tickBorderDashOffset;b=zs(this,m,a),void 0!==b&&(x=xe(i,b,e),r?_=v=M=S=x:y=w=k=P=x,c.push({tx1:_,ty1:y,tx2:v,ty2:w,x1:M,y1:k,x2:S,y2:P,width:e,color:s,borderDash:o,borderDashOffset:l,tickWidth:h,tickColor:d,tickBorderDash:u,tickBorderDashOffset:f}))}return this._ticksLength=l,this._borderValue=p,c}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,o=this.isHorizontal(),a=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=n,d=Fs(i.grid),u=d+h,f=c?-h:u,g=-Yt(this.labelRotation),p=[];let m,b,x,_,y,v,w,M,k,S,P,D,C="middle";if("top"===s)v=this.bottom-f,w=this._getXAxisLabelAlignment();else if("bottom"===s)v=this.top+f,w=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(d);w=t.textAlign,y=t.x}else if("x"===e){if("center"===s)v=(t.top+t.bottom)/2+u;else if(q(s)){const t=Object.keys(s)[0],e=s[t];v=this.chart.scales[t].getPixelForValue(e)+u}w=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)y=(t.left+t.right)/2-u;else if(q(s)){const t=Object.keys(s)[0],e=s[t];y=this.chart.scales[t].getPixelForValue(e)}w=this._getYAxisLabelAlignment(d).textAlign}"y"===e&&("start"===r?C="top":"end"===r&&(C="bottom"));const O=this._getLabelSizes();for(m=0,b=a.length;m<b;++m){x=a[m],_=x.label;const t=n.setContext(this.getContext(m));M=this.getPixelForTick(m)+n.labelOffset,k=this._resolveTickFontOptions(m),S=k.lineHeight,P=X(_)?_.length:1;const e=P/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let d,u=w;if(o?(y=M,"inner"===w&&(u=m===b-1?this.options.reverse?"left":"right":0===m?this.options.reverse?"right":"left":"center"),D="top"===s?"near"===l||0!==g?-P*S+S/2:"center"===l?-O.highest.height/2-e*S+S:-O.highest.height+S/2:"near"===l||0!==g?S/2:"center"===l?O.highest.height/2-e*S:O.highest.height-P*S,c&&(D*=-1)):(v=M,D=(1-P)*S/2),t.showLabelBackdrop){const e=di(t.backdropPadding),i=O.heights[m],s=O.widths[m];let n=v+D-e.top,o=y-e.left;switch(C){case"middle":n-=i/2;break;case"bottom":n-=i}switch(w){case"center":o-=s/2;break;case"right":o-=s}d={left:o,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}p.push({rotation:g,label:_,font:k,color:i,strokeColor:r,strokeWidth:h,textOffset:D,textAlign:u,textBaseline:C,translation:[y,v],backdrop:d})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return"top"===t?"left":"right";let i="center";return"start"===e.align?i="left":"end"===e.align?i="right":"inner"===e.align&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,o=t+n,a=this._getLabelSizes().widest.width;let r,l;return"left"===e?s?(l=this.right+n,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l+=a)):(l=this.right-o,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l=this.left)):"right"===e?s?(l=this.left+n,"near"===i?r="right":"center"===i?(r="center",l-=a/2):(r="left",l-=a)):(l=this.left+o,"near"===i?r="left":"center"===i?(r="center",l+=a/2):(r="right",l=this.right)):r="right",{textAlign:r,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex((e=>e.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n<o;++n){const t=s[n];e.drawOnChartArea&&a({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&a({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),n=i.drawBorder?s.borderWidth:0;if(!n)return;const o=i.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=xe(t,this.left,n)-n/2,l=xe(t,this.right,o)+o/2,h=c=a):(h=xe(t,this.top,n)-n/2,c=xe(t,this.bottom,o)+o/2,r=l=a),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const e=this.ctx,i=this._computeLabelArea();i&&we(e,i);const s=this._labelItems||(this._labelItems=this._computeLabelItems(t));let n,o;for(n=0,o=s.length;n<o;++n){const t=s[n],i=t.font,o=t.label;t.backdrop&&(e.fillStyle=t.backdrop.color,e.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height)),Pe(e,o,0,t.textOffset,i,t)}i&&Me(e)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=ui(i.font),a=di(i.padding),r=i.align;let l=o.lineHeight/2;"bottom"===e||"center"===e||q(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:h,titleY:c,maxWidth:d,rotation:u}=function(t,e,i,s){const{top:o,left:a,bottom:r,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let u,f,g,p=0;const m=r-o,b=l-a;if(t.isHorizontal()){if(f=n(s,a,l),q(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)+m-e}else g="center"===i?(c.bottom+c.top)/2+m-e:Es(t,i,e);u=l-a}else{if(q(i)){const t=Object.keys(i)[0],s=i[t];f=d[t].getPixelForValue(s)-b+e}else f="center"===i?(c.left+c.right)/2-b+e:Es(t,i,e);g=n(s,r,o),p="left"===i?-Et:Et}return{titleX:f,titleY:g,maxWidth:u,rotation:p}}(this,l,e,r);Pe(t,i.text,0,0,o,{color:i.color,maxWidth:d,rotation:u,textAlign:Vs(r,e,s),textBaseline:"middle",translation:[h,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=Z(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Ns.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n<o;++n){const o=e[n];o[i]!==this.id||t&&o.type!==t||s.push(o)}return s}_resolveTickFontOptions(t){return ui(this.options.ticks.setContext(this.getContext(t)).font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ws{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;(function(t){return"id"in t&&"defaults"in t})(e)&&(i=this.register(e));const s=this.items,n=t.id,o=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s||(s[n]=t,function(t,e,i){const s=at(Object.create(null),[i?yt.get(i):{},yt.get(e),t.defaults]);yt.set(e,s),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((i=>{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");yt.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&yt.describe(e,t.descriptors)}(t,o,i),this.override&&yt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in yt[s]&&(delete yt[s][i],this.override&&delete mt[i])}}var Hs=new class{constructor(){this.controllers=new Ws(Cs,"datasets",!0),this.elements=new Ws(Os,"elements"),this.plugins=new Ws(Object,"plugins"),this.scales=new Ws(Ns,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):et(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=dt(t);tt(i["before"+s],[],i),e[t](i),tt(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}};class js{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(n,t,e,i);return"afterDestroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin;if(!1===tt(t[i],[e,s,n.options],t)&&s.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Z(i.options&&i.options.plugins,{}),n=function(t){const e=[],i=Object.keys(Hs.plugins.items);for(let t=0;t<i.length;t++)e.push(Hs.getPlugin(i[t]));const s=t.plugins||[];for(let t=0;t<s.length;t++){const i=s[t];-1===e.indexOf(i)&&e.push(i)}return e}(i);return!1!==s||e?function(t,e,i,s){const n=[],o=t.getContext();for(let a=0;a<e.length;a++){const r=e[a],l=$s(i[r.id],s);null!==l&&n.push({plugin:r,options:Ys(t.config,r,l,o)})}return n}(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function $s(t,e){return e||!1!==t?!0===t?{}:t:null}function Ys(t,e,i,s){const n=t.pluginScopeKeys(e),o=t.getOptionScopes(i,n);return t.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Us(t,e){const i=yt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Xs(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function qs(t){const e=t.options||(t.options={});e.plugins=Z(e.plugins,{}),e.scales=function(t,e){const i=mt[t.type]||{scales:{}},s=e.scales||{},n=Us(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!q(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=Xs(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(r,n),h=i.scales||{};o[r]=o[r]||t,a[t]=rt(Object.create(null),[{axis:r},e,h[r],h[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,r=i.indexAxis||Us(n,e),l=(mt[n]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||o[e]||e;a[n]=a[n]||Object.create(null),rt(a[n],[{axis:e},s[n],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];rt(e,[yt.scales[e.type],yt.scale])})),a}(t,e)}function Ks(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const Gs=new Map,Zs=new Set;function Js(t,e){let i=Gs.get(t);return i||(i=e(),Gs.set(t,i),Zs.add(i)),i}const Qs=(t,e,i)=>{const s=ct(e,i);void 0!==s&&t.add(s)};class tn{constructor(t){this._config=function(t){return(t=t||{}).data=Ks(t.data),qs(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Ks(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),qs(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Js(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Js(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Js(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Js(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Qs(r,t,e)))),e.forEach((t=>Qs(r,s,t))),e.forEach((t=>Qs(r,mt[n]||{},t))),e.forEach((t=>Qs(r,yt,t))),e.forEach((t=>Qs(r,bt,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Zs.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,mt[e]||{},yt.datasets[e]||{},{type:e},yt,bt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=en(this._resolverCache,t,s);let r=o;if(function(t,e){const{isScriptable:i,isIndexable:s}=Te(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(ft(a)||sn(a))||o&&X(a))return!0}return!1}(o,e)){n.$shared=!1;r=Ae(o,i=ft(i)?i():i,this.createResolver(t,i,a))}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=en(this._resolverCache,t,i);return q(e)?Ae(n,e,void 0,s):n}}function en(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:Oe(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const sn=t=>q(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||ft(t[i])),!1);const nn=["top","bottom","left","right","chartArea"];function on(t,e){return"top"===t||"bottom"===t||-1===nn.indexOf(t)&&"x"===e}function an(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function rn(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),tt(i&&i.onComplete,[t],e)}function ln(t){const e=t.chart,i=e.options.animation;tt(i&&i.onProgress,[t],e)}function hn(t){return ie()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const cn={},dn=t=>{const e=hn(t);return Object.values(cn).filter((t=>t.canvas===e)).pop()};function un(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class fn{constructor(t,e){const s=this.config=new tn(e),n=hn(t),o=dn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||cs(n)),this.platform.updateConfig(s);const l=this.platform.acquireContext(n,r.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;this.id=Y(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new js,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=i((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],cn[this.id]=this,l&&h?(a.listen(this,"complete",rn),a.listen(this,"progress",ln),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return U(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ue(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return _e(this.canvas,this.ctx),this}stop(){return a.stop(this),this}resize(t,e){a.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ue(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),tt(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){et(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Xs(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),et(n,(e=>{const n=e.options,o=n.id,a=Xs(o,n),r=Z(n.type,e.dtype);void 0!==n.position&&on(n.position,a)===on(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;if(o in i&&i[o].type===r)l=i[o];else{l=new(Hs.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(n,t)})),et(s,((t,e)=>{t||delete i[e]})),et(i,(t=>{Xi.configure(this,t,t.options),Xi.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(an("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const o=s.type||this.config.type;if(n.type&&n.type!==o&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=o,n.indexAxis=s.indexAxis||Us(o,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=Hs.getController(o),{datasetElementType:s,dataElementType:a}=yt.datasets[o];Object.assign(e.prototype,{dataElementType:Hs.getElement(a),datasetElementType:s&&Hs.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){et(this.data.datasets,((t,e)=>{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t<e;t++){const{controller:e}=this.getDatasetMeta(t),i=!s&&-1===n.indexOf(e);e.buildOrUpdateElements(i),o=Math.max(+e.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||et(n,(t=>{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(an("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){et(this.scales,(t=>{Xi.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);gt(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){un(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;t<e;t++)if(!gt(s,i(t)))return;return Array.from(s).map((t=>t.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;Xi.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],et(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t<e;++t)this.getDatasetMeta(t).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,ft(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(a.has(this)?this.attached&&!a.running(this)&&a.start(this):(this.draw(),rn({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&we(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&Me(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return ve(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const n=Ei.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=pi(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);ut(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),a.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),_e(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete cn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};et(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){et(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},et(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a<r;++a){o=t[a];const e=o&&this.getDatasetMeta(o.datasetIndex).controller;e&&e[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map((({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!it(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=pt(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,tt(n.onHover,[t,a,this],this),r&&tt(n.onClick,[t,a,this],this));const h=!it(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}const gn=()=>et(fn.instances,(t=>t._plugins.invalidate())),pn=!0;function mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(fn,{defaults:{enumerable:pn,value:yt},instances:{enumerable:pn,value:cn},overrides:{enumerable:pn,value:mt},registry:{enumerable:pn,value:Hs},version:{enumerable:pn,value:"3.8.0"},getChart:{enumerable:pn,value:dn},register:{enumerable:pn,value:(...t)=>{Hs.add(...t),gn()}},unregister:{enumerable:pn,value:(...t)=>{Hs.remove(...t),gn()}}});class bn{constructor(t){this.options=t||{}}formats(){return mn()}parse(t,e){return mn()}format(t,e){return mn()}add(t,e,i){return mn()}diff(t,e,i){return mn()}startOf(t,e,i){return mn()}endOf(t,e){return mn()}}bn.override=function(t){Object.assign(bn.prototype,t)};var xn={_date:bn};function _n(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Ct(s.sort(((t,e)=>t-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(ut(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;s<n;++s)o=e.getPixelForValue(i[s]),l();for(a=void 0,s=0,n=e.ticks.length;s<n;++s)o=e.getPixelForTick(s),l();return r}function yn(t,e,i,s){return X(t)?function(t,e,i,s){const n=i.parse(t[0],s),o=i.parse(t[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,h=r;Math.abs(a)>Math.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function vn(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(a[h],h),l.push(yn(u,d,o,h));return l}function wn(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Mn(t,e,i,s){let n=e.borderSkipped;const o={};if(!n)return void(t.borderSkipped=o);const{start:a,end:r,reverse:l,top:h,bottom:c}=function(t){let e,i,s,n,o;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:s,reverse:e,top:n,bottom:o}}(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(o[kn(c,a,r,l)]=!0,n=h)),o[kn(n,a,r,l)]=!0,t.borderSkipped=o}function kn(t,e,i,s){var n,o,a;return s?(a=i,t=Sn(t=(n=t)===(o=e)?a:n===a?o:n,i,e)):t=Sn(t,e,i),t}function Sn(t,e,i){return"start"===t?e:"end"===t?i:t}function Pn(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}class Dn extends Cs{parsePrimitiveData(t,e,i,s){return vn(t,e,i,s)}parseArrayData(t,e,i,s){return vn(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:o}=t,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?a:r,h="x"===o.axis?a:r,c=[];let d,u,f,g;for(d=i,u=i+s;d<u;++d)g=e[d],f={},f[n.axis]=n.parse(ct(g,l),d),c.push(yn(ct(g,h),f,o,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),o=n._custom,a=wn(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();this._cachedMeta.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const n="reset"===s,{index:o,_cachedMeta:{vScale:a}}=this,r=a.getBasePixel(),l=a.isHorizontal(),h=this._getRuler(),c=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(c),u=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let c=e;c<e+i;c++){const e=this.getParsed(c),i=n||U(e[a.axis])?{base:r,head:r}:this._calculateBarValuePixels(c),f=this._calculateBarIndexPixels(c,h),g=(e._stacks||{})[a.axis],p={horizontal:l,base:i.base,enableBorderRadius:!g||wn(e._custom)||o===g._top||o===g._bottom,x:l?i.head:f.center,y:l?f.center:i.head,height:l?f.size:Math.abs(i.size),width:l?Math.abs(i.size):f.size};u&&(p.options=d||this.resolveDataElementOptions(c,t[c].active?"active":s));const m=p.options||t[c].options;Mn(p,m,g,o),Pn(p,m,h.ratio),this.updateElement(t[c],c,p,s)}}_getStacks(t,e){const i=this._cachedMeta.iScale,s=i.getMatchingVisibleMetas(this._type),n=i.options.stacked,o=s.length,a=[];let r,l;for(r=0;r<o;++r)if(l=s[r],l.controller.options.grouped){if(void 0!==e){const t=l.controller.getParsed(e)[l.controller._cachedMeta.vScale.axis];if(U(t)||isNaN(t))continue}if((!1===n||-1===a.indexOf(l.stack)||void 0===n&&void 0===l.stack)&&a.push(l.stack),l.index===t)break}return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,o;for(n=0,o=e.data.length;n<o;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const a=t.barThickness;return{min:a||_n(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:n}}=this,o=s||0,a=this.getParsed(t),r=a._custom,l=wn(r);let h,c,d=a[e.axis],u=0,f=i?this.applyStack(e,a,i):d;f!==d&&(u=f-d,f=d),l&&(d=r.barStart,f=r.barEnd-r.barStart,0!==d&&Bt(d)!==Bt(r.barEnd)&&(u=0),u+=d);const g=U(s)||l?u:s;let p=e.getPixelForValue(g);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(u+f):p,c=h-p,Math.abs(c)<n){c=function(t,e,i){return 0!==t?Bt(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}(c,e,o)*n,d===o&&(p-=c/2);const t=e.getPixelForDecimal(0),i=e.getPixelForDecimal(1),s=Math.min(t,i),a=Math.max(t,i);p=Math.max(Math.min(p,a),s),h=p+c}if(p===e.getPixelForValue(o)){const t=Bt(c)*e.getLineWidthForValue(o)/2;p+=t,c-=t}return{size:c,base:p,head:h,center:h+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=Z(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===a&&(a=o-(null===r?e.end-e.start:r-o)),null===r&&(r=o+o-a);const h=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:i.barPercentage,start:h}}(t,e,s,i):function(t,e,i,s){const n=i.barThickness;let o,a;return U(n)?(o=e.min*i.categoryPercentage,a=i.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:e.pixels[t]-o/2}}(t,e,s,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);a=l.start+l.chunk*h+l.chunk/2,r=Math.min(o,l.chunk*l.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(o,e.min*e.ratio);return{base:a-r/2,head:a+r/2,center:a,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[e.axis]&&i[n].draw(this._ctx)}}Dn.id="bar",Dn.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Dn.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Cn extends Cs{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let t=0;t<n.length;t++)n[t]._custom=this.resolveDataElementOptions(t+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=Z(s[2],this.resolveDataElementOptions(t+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let t=0;t<n.length;t++){const s=e[i+t];n[t]._custom=Z(s&&s.r&&+s.r,this.resolveDataElementOptions(t+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=o.axis,d=a.axis;for(let r=e;r<e+i;r++){const e=t[r],i=!n&&this.getParsed(r),l={},u=l[c]=n?o.getPixelForDecimal(.5):o.getPixelForValue(i[c]),f=l[d]=n?a.getBasePixel():a.getPixelForValue(i[d]);l.skip=isNaN(u)||isNaN(f),h&&(l.options=this.resolveDataElementOptions(r,e.active?"active":s),n&&(l.options.radius=0)),this.updateElement(e,r,l,s)}this.updateSharedOptions(l,s,r)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=Z(i&&i._custom,n),s}}Cn.id="bubble",Cn.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Cn.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:()=>""}}}};class On extends Cs{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(q(i[t])){const{key:t="value"}=this._parsing;a=e=>+ct(i[e],t)}for(n=t,o=t+e;n<o;++n)s._parsed[n]=a(n)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=At,e=-At;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),o=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),r=Math.min(J(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:f,offsetY:g}=function(t,e,i){let s=1,n=1,o=0,a=0;if(e<At){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>Jt(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Jt(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(Et,c,u),b=g(Ot,h,d),x=g(Ot+Et,c,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(c,h,r),p=(i.width-o)/d,m=(i.height-o)/u,b=Math.max(Math.min(p,m)/2,0),x=Q(this.options.radius,b),_=(x-Math.max(x*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*x,this.offsetY=g*x,s.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/At)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,f=this.resolveDataElementOptions(e,s),g=this.getSharedOptions(f),p=this.includeOptions(s,g);let m,b=this._getRotation();for(m=0;m<e;++m)b+=this._circumference(m,n);for(m=e;m<e+i;++m){const e=this._circumference(m,n),i=t[m],o={x:l+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+e,circumference:e,outerRadius:u,innerRadius:d};p&&(o.options=g||this.resolveDataElementOptions(m,i.active?"active":s)),b+=e,this.updateElement(i,m,o,s)}this.updateSharedOptions(g,s,f)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?At*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ni(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=a.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}On.id="doughnut",On.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},On.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},On.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return X(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class An extends Cs{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=Qt(Math.min(wt(r,a.axis,h).lo,i?s:wt(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?Qt(Math.max(wt(r,a.axis,c).hi+1,i?0:wt(e,l,a.getPixelForValue(c)).hi+1),n,s)-n:s-n}return{start:n,count:o}}(e,s,o);this._drawStart=a,this._drawCount=r,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=o.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Wt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||n||"none"===s;let x=e>0&&this.getParsed(e-1);for(let h=e;h<e+i;++h){const e=t[h],i=this.getParsed(h),g=b?e:{},_=U(i[f]),y=g[u]=o.getPixelForValue(i[u],h),v=g[f]=n||_?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,i,r):i[f],h);g.skip=isNaN(y)||isNaN(v)||_,g.stop=h>0&&Math.abs(i[u]-x[u])>m,p&&(g.parsed=i,g.raw=l.data[h]),d&&(g.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),b||this.updateElement(e,h,g,s),x=i}this.updateSharedOptions(c,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}An.id="line",An.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},An.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Tn extends Cs{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=ni(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach(((t,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<e.min&&(e.min=s),s>e.max&&(e.max=s))})),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.options.animation,r=this._cachedMeta.rScale,l=r.xCenter,h=r.yCenter,c=r.getIndexAngle(0)-.5*Ot;let d,u=c;const f=360/this.countVisibleElements();for(d=0;d<e;++d)u+=this._computeAngle(d,s,f);for(d=e;d<e+i;d++){const e=t[d];let i=u,g=u+this._computeAngle(d,s,f),p=o.getDataVisibility(d)?r.getDistanceFromCenterForValue(this.getParsed(d).r):0;u=g,n&&(a.animateScale&&(p=0),a.animateRotate&&(i=g=c));const m={x:l,y:h,innerRadius:0,outerRadius:p,startAngle:i,endAngle:g,options:this.resolveDataElementOptions(d,e.active?"active":s)};this.updateElement(e,d,m,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach(((t,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++})),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}Tn.id="polarArea",Tn.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Tn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Ln extends On{}Ln.id="pie",Ln.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Rn extends Cs{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return He.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this._cachedMeta.rScale,o="reset"===s;for(let a=e;a<e+i;a++){const e=t[a],i=this.resolveDataElementOptions(a,e.active?"active":s),r=n.getPointPositionForValue(a,this.getParsed(a).r),l=o?n.xCenter:r.x,h=o?n.yCenter:r.y,c={x:l,y:h,angle:r.angle,skip:isNaN(l)||isNaN(h),options:i};this.updateElement(e,a,c,s)}}}Rn.id="radar",Rn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Rn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class En extends An{}En.id="scatter",En.defaults={showLine:!1,fill:!1},En.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:()=>"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var In=Object.freeze({__proto__:null,BarController:Dn,BubbleController:Cn,DoughnutController:On,LineController:An,PolarAreaController:Tn,PieController:Ln,RadarController:Rn,ScatterController:En});function zn(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(o,a,r,s-h,i+h),l>n?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+Et,s-Et),t.closePath(),t.clip()}function Fn(t,e,i,s){const n=li(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return Qt(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Qt(n.innerStart,0,a),innerEnd:Qt(n.innerEnd,0,a)}}function Bn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Vn(t,e,i,s,n){const{x:o,y:a,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const f=n-r;if(s){const t=((h>0?h-s:0)+(c>0?c-s:0))/2;u=(f-(0!==t?f*t/(t+s):f))/2}const g=(f-Math.max(.001,f*c-i/Ot)/c)/2,p=r+g+u,m=n-g-u,{outerStart:b,outerEnd:x,innerStart:_,innerEnd:y}=Fn(e,d,c,m-p),v=c-b,w=c-x,M=p+b/v,k=m-x/w,S=d+_,P=d+y,D=p+_/S,C=m-y/P;if(t.beginPath(),t.arc(o,a,c,M,k),x>0){const e=Bn(w,k,o,a);t.arc(e.x,e.y,x,k,m+Et)}const O=Bn(P,m,o,a);if(t.lineTo(O.x,O.y),y>0){const e=Bn(P,C,o,a);t.arc(e.x,e.y,y,m+Et,C+Math.PI)}if(t.arc(o,a,d,m-y/d,p+_/d,!0),_>0){const e=Bn(S,D,o,a);t.arc(e.x,e.y,_,D+Math.PI,p-Et)}const A=Bn(v,p,o,a);if(t.lineTo(A.x,A.y),b>0){const e=Bn(v,M,o,a);t.arc(e.x,e.y,b,p-Et,M)}t.closePath()}function Nn(t,e,i,s,n){const{options:o}=e,{borderWidth:a,borderJoinStyle:r}=o,l="inner"===o.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=r||"round"):(t.lineWidth=a,t.lineJoin=r||"bevel"),e.fullCircles&&function(t,e,i){const{x:s,y:n,startAngle:o,pixelMargin:a,fullCircles:r}=e,l=Math.max(e.outerRadius-a,0),h=e.innerRadius+a;let c;for(i&&zn(t,e,o+At),t.beginPath(),t.arc(s,n,h,o+At,o,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,n,l,o,o+At),c=0;c<r;++c)t.stroke()}(t,e,l),l&&zn(t,e,n),Vn(t,e,i,s,n),t.stroke())}class Wn extends Os{constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:o}=qt(s,{x:t,y:e}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=Z(c,r-a)>=At||Jt(n,a,r),f=ee(o,l+d,h+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>At?Math.floor(i/At):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(s){o=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=Ot&&(o=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,i,s){const{fullCircles:n,startAngle:o,circumference:a}=e;let r=e.endAngle;if(n){Vn(t,e,i,s,o+At);for(let e=0;e<n;++e)t.fill();isNaN(a)||(r=o+a%At,a%At==0&&(r+=At))}return Vn(t,e,i,s,r),t.fill(),r}(t,this,o,n);Nn(t,this,o,n,a),t.restore()}}function Hn(t,e,i=e){t.lineCap=Z(i.borderCapStyle,e.borderCapStyle),t.setLineDash(Z(i.borderDash,e.borderDash)),t.lineDashOffset=Z(i.borderDashOffset,e.borderDashOffset),t.lineJoin=Z(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Z(i.borderWidth,e.borderWidth),t.strokeStyle=Z(i.borderColor,e.borderColor)}function jn(t,e,i){t.lineTo(i.x,i.y)}function $n(t,e,i={}){const s=t.length,{start:n=0,end:o=s-1}=i,{start:a,end:r}=e,l=Math.max(n,a),h=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Yn(t,e,i,s){const{points:n,options:o}=e,{count:a,start:r,loop:l,ilen:h}=$n(n,i,s),c=function(t){return t.stepped?ke:t.tension||"monotone"===t.cubicInterpolationMode?Se:jn}(o);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=h;++d)u=n[(r+(p?h-d:d))%a],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,o.stepped),f=u);return l&&(u=n[(r+(p?h:0))%a],c(t,f,u,p,o.stepped)),!!l}function Un(t,e,i,s){const n=e.points,{count:o,start:a,ilen:r}=$n(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,g,p,m=0,b=0;const x=t=>(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=g=i),p=i}_()}function Xn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?Un:Yn}Wn.id="arc",Wn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Wn.defaultRoutes={backgroundColor:"backgroundColor"};const qn="function"==typeof Path2D;function Kn(t,e,i,s){qn&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Hn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Xn(e);for(const r of n)Hn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class Gn extends Os{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ke(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Mi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=wi(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?ei:t.tension||"monotone"===t.cubicInterpolationMode?ii:ti}(i);let l,h;for(l=0,h=o.length;l<h;++l){const{start:h,end:c}=o[l],d=n[h],u=n[c];if(d===u){a.push(d);continue}const f=r(d,u,Math.abs((s-d[e])/(u[e]-d[e])),i.stepped);f[e]=t[e],a.push(f)}return 1===a.length?a[0]:a}pathSegment(t,e,i){return Xn(this)(t,this,e,i)}path(t,e,i){const s=this.segments,n=Xn(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=n(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const n=this.options||{};(this.points||[]).length&&n.borderWidth&&(t.save(),Kn(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Zn(t,e,i,s){const n=t.options,{[i]:o}=t.getProps([i],s);return Math.abs(e-o)<n.radius+n.hitRadius}Gn.id="line",Gn.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Gn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Gn.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Jn extends Os{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Zn(this,t,"x",e)}inYRange(t,e){return Zn(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){let e=(t=t||this.options||{}).radius||0;e=Math.max(e,e&&t.hoverRadius||0);return 2*(e+(e&&t.borderWidth||0))}draw(t,e){const i=this.options;this.skip||i.radius<.1||!ve(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ye(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Qn(t,e){const{x:i,y:s,base:n,width:o,height:a}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=a/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=o/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function to(t,e,i,s){return t?0:Qt(e,i,s)}function eo(t){const e=Qn(t),i=e.right-e.left,s=e.bottom-e.top,n=function(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,o=hi(s);return{t:to(n.top,o.top,0,i),r:to(n.right,o.right,0,e),b:to(n.bottom,o.bottom,0,i),l:to(n.left,o.left,0,e)}}(t,i/2,s/2),o=function(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=ci(n),a=Math.min(e,i),r=t.borderSkipped,l=s||q(n);return{topLeft:to(!l||r.top||r.left,o.topLeft,0,a),topRight:to(!l||r.top||r.right,o.topRight,0,a),bottomLeft:to(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:to(!l||r.bottom||r.right,o.bottomRight,0,a)}}(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function io(t,e,i,s){const n=null===e,o=null===i,a=t&&!(n&&o)&&Qn(t,s);return a&&(n||ee(e,a.left,a.right))&&(o||ee(i,a.top,a.bottom))}function so(t,e){t.rect(e.x,e.y,e.w,e.h)}function no(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-s,a=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+o,h:t.h+a,radius:t.radius}}Jn.id="point",Jn.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Jn.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class oo extends Os{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:o}=eo(this),a=(r=o.radius).topLeft||r.topRight||r.bottomLeft||r.bottomRight?Ce:so;var r;t.save(),o.w===n.w&&o.h===n.h||(t.beginPath(),a(t,no(o,e,n)),t.clip(),a(t,no(n,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,no(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return io(this,t,e,i)}inXRange(t,e){return io(this,t,null,e)}inYRange(t,e){return io(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}oo.id="bar",oo.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},oo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var ao=Object.freeze({__proto__:null,ArcElement:Wn,LineElement:Gn,PointElement:Jn,BarElement:oo});function ro(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function lo(t){t.data.datasets.forEach((t=>{ro(t)}))}var ho={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void lo(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:o,indexAxis:a}=e,r=t.getDatasetMeta(n),l=o||e.data;if("y"===fi([a,t.options.indexAxis]))return;if(!r.controller.supportsDecimation)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=Qt(wt(e,o.axis,a).lo,0,i-1)),s=h?Qt(wt(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(r,l);if(d<=(i.threshold||4*s))return void ro(e);let u;switch(U(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;c<o-2;c++){let s,n=0,o=0;const h=Math.floor((c+1)*r)+1+e,m=Math.min(Math.floor((c+2)*r)+1,i)+e,b=m-h;for(s=h;s<m;s++)n+=t[s].x,o+=t[s].y;n/=b,o/=b;const x=Math.floor(c*r)+1+e,_=Math.min(Math.floor((c+1)*r)+1,i)+e,{x:y,y:v}=t[p];for(u=f=-1,s=x;s<_;s++)f=.5*Math.abs((y-n)*(t[s].y-v)-(y-t[s].x)*(o-v)),f>u&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(l,c,d,s,i);break;case"min-max":u=function(t,e,i,s){let n,o,a,r,l,h,c,d,u,f,g=0,p=0;const m=[],b=e+i-1,x=t[e].x,_=t[b].x-x;for(n=e;n<e+i;++n){o=t[n],a=(o.x-x)/_*s,r=o.y;const e=0|a;if(e===l)r<u?(u=r,h=n):r>f&&(f=r,c=n),g=(p*g+o.x)/++p;else{const i=n-1;if(!U(h)&&!U(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:g}),s!==d&&s!==i&&m.push({...t[s],x:g})}n>0&&i!==d&&m.push(t[i]),m.push(o),l=e,p=0,u=f=r,h=c=d=n}}return m}(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u}))},destroy(t){lo(t)}};function co(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=Zt(n),o=Zt(o)),{property:t,start:n,end:o}}function uo(t,e,i){for(;e>t;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function fo(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function go(t,e){let i=[],s=!1;return X(t)?(s=!0,i=t):i=function(t,e){const{x:i=null,y:s=null}=t||{},n=e.points,o=[];return e.segments.forEach((({start:t,end:e})=>{e=uo(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new Gn({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function po(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!K(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function mo(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=Z(i&&i.target,i);void 0===s&&(s=!!e.backgroundColor);if(!1===s||null===s)return!1;if(!0===s)return"origin";return s}(t);if(q(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return K(n)&&Math.floor(n)===n?function(t,e,i,s){"-"!==t&&"+"!==t||(i=e+i);if(i===e||i<0||i>=s)return!1;return i}(s[0],e,n,i):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function bo(t,e,i){const s=[];for(let n=0;n<i.length;n++){const o=i[n],{first:a,last:r,point:l}=xo(o,e,"x");if(!(!l||a&&r))if(a)s.unshift(l);else if(t.push(l),!r)break}t.push(...s)}function xo(t,e,i){const s=t.interpolate(e,i);if(!s)return{};const n=s[i],o=t.segments,a=t.points;let r=!1,l=!1;for(let t=0;t<o.length;t++){const e=o[t],s=a[e.start][i],h=a[e.end][i];if(ee(n,s,h)){r=n===s,l=n===h;break}}return{first:r,last:l,point:s}}class _o{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:At},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function yo(t){const{chart:e,fill:i,line:s}=t;if(K(i))return function(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}(e,i);if("stack"===i)return function(t){const{scale:e,index:i,line:s}=t,n=[],o=s.segments,a=s.points,r=function(t,e){const i=[],s=t.getMatchingVisibleMetas("line");for(let t=0;t<s.length;t++){const n=s[t];if(n.index===e)break;n.hidden||i.unshift(n.dataset)}return i}(e,i);r.push(go({x:null,y:e.bottom},s));for(let t=0;t<o.length;t++){const e=o[t];for(let t=e.start;t<=e.end;t++)bo(n,a[t],r)}return new Gn({points:n,options:{}})}(t);if("shape"===i)return!0;const n=function(t){if((t.scale||{}).getPointPositionForValue)return function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,a=function(t,e,i){let s;return s="start"===t?i:"end"===t?e.options.reverse?e.min:e.max:q(t)?t.value:e.getBaseValue(),s}(i,e,o),r=[];if(s.grid.circular){const t=e.getPointPositionForValue(0,o);return new _o({x:t.x,y:t.y,radius:e.getDistanceFromCenterForValue(a)})}for(let t=0;t<n;++t)r.push(e.getPointPositionForValue(t,a));return r}(t);return function(t){const{scale:e={},fill:i}=t,s=function(t,e){let i=null;return"start"===t?i=e.bottom:"end"===t?i=e.top:q(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}(i,e);if(K(s)){const t=e.isHorizontal();return{x:t?s:null,y:t?null:s}}return null}(t)}(t);return n instanceof _o?n:go(n,s)}function vo(t,e,i){const s=yo(e),{line:n,scale:o,axis:a}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(we(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==n&&(wo(t,s,a.top),Mo(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),wo(t,s,a.bottom));Mo(t,{line:i,target:s,color:o,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:o,axis:a}),Me(t))}function wo(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[uo(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Mo(t,e){const{line:i,target:s,property:n,color:o,scale:a}=e,r=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=uo(s,r,n);const l=co(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=wi(e,l);for(const e of h){const s=co(i,o[e.start],o[e.end],e.loop),r=vi(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:fo(l,s,"start",Math.max)},end:{[i]:fo(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=o}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,ko(t,a,d&&co(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():So(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||So(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function ko(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function So(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}var Po={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a<s;++a)o=t.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Gn&&(l={visible:t.isDatasetVisible(a),index:a,fill:mo(r,a,s),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],l&&!1!==l.fill&&(l.fill=po(n,a,i.propagate))},beforeDraw(t,e,i){const s="beforeDraw"===i.drawTime,n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let e=n.length-1;e>=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&vo(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&vo(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&vo(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Do=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Co extends Os{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=ui(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=Do(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,n,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const p=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:s},d=Math.max(d,p),u+=s+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=mi(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=n(i,this.left+s,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=n(i,this.left+s,this.right-this.lineWidths[o])),l.top+=this.top+t+s,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+s}else{let o=0,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+s,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;we(t,this),this._draw(),Me(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:a,labels:r}=t,l=yt.color,h=mi(t.rtl,this.left,this.width),c=ui(r.font),{color:d,padding:u}=r,f=c.size,g=f/2;let p;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:x}=Do(r,f),_=this.isHorizontal(),y=this._computeTitleHeight();p=_?{x:n(a,this.left+u,this.right-i[0]),y:this.top+u+y,line:0}:{x:this.left+u,y:n(a,this.top+y+u,this.bottom-e[0].height),line:0},bi(this.ctx,t.textDirection);const v=x+u;this.legendItems.forEach(((w,M)=>{s.strokeStyle=w.fontColor||d,s.fillStyle=w.fontColor||d;const k=s.measureText(w.text).width,S=h.textAlign(w.textAlign||(w.textAlign=r.textAlign)),P=m+g+k;let D=p.x,C=p.y;h.setWidth(this.width),_?M>0&&D+P+u>this.right&&(C=p.y+=v,p.line++,D=p.x=n(a,this.left+u,this.right-i[p.line])):M>0&&C+v>this.bottom&&(D=p.x=D+e[p.line].width+u,p.line++,C=p.y=n(a,this.top+y+u,this.bottom-e[p.line].height));!function(t,e,i){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;s.save();const n=Z(i.lineWidth,1);if(s.fillStyle=Z(i.fillStyle,l),s.lineCap=Z(i.lineCap,"butt"),s.lineDashOffset=Z(i.lineDashOffset,0),s.lineJoin=Z(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=Z(i.strokeStyle,l),s.setLineDash(Z(i.lineDash,[])),r.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},a=h.xPlus(t,m/2);ye(s,o,a,e+g)}else{const o=e+Math.max((f-b)/2,0),a=h.leftForLtr(t,m),r=ci(i.borderRadius);s.beginPath(),Object.values(r).some((t=>0!==t))?Ce(s,{x:a,y:o,w:m,h:b,radius:r}):s.rect(a,o,m,b),s.fill(),0!==n&&s.stroke()}s.restore()}(h.x(D),C,w),D=o(S,D+m+g,_?D+P:this.right,t.rtl),function(t,e,i){Pe(s,i.text,t,e+x/2,c,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(D),C,w),_?p.x+=P+u:p.y+=v})),xi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ui(e.font),o=di(e.padding);if(!e.display)return;const a=mi(t.rtl,this.left,this.width),r=this.ctx,l=e.position,h=i.size/2,c=o.top+h;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=n(t.align,u,this.right-f);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);d=c+n(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=n(l,u,u+f);r.textAlign=a.textAlign(s(l)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Pe(r,e.text,g,d,i)}_computeTitleHeight(){const t=this.options.title,e=ui(t.font),i=di(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(ee(t,this.left,this.right)&&ee(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;i<n.length;++i)if(s=n[i],ee(t,s.left,s.left+s.width)&&ee(e,s.top,s.top+s.height))return this.legendItems[i];return null}handleEvent(t){const e=this.options;if(!function(t,e){if(("mousemove"===t||"mouseout"===t)&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if("mousemove"===t.type||"mouseout"===t.type){const o=this._hoveredItem,a=(n=i,null!==(s=o)&&null!==n&&s.datasetIndex===n.datasetIndex&&s.index===n.index);o&&!a&&tt(e.onLeave,[t,o,this],this),this._hoveredItem=i,i&&!a&&tt(e.onHover,[t,i,this],this)}else i&&tt(e.onClick,[t,i,this],this);var s,n}}var Oo={id:"legend",_element:Co,start(t,e,i){const s=t.legend=new Co({ctx:t.ctx,options:i,chart:t});Xi.configure(t,s,i),Xi.addBox(t,s)},stop(t){Xi.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const s=t.legend;Xi.configure(t,s,i),s.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const s=e.datasetIndex,n=i.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),r=di(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Ao extends Os{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=X(i.text)?i.text.length:1;this._padding=di(i.padding);const n=s*ui(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l,h,c,d=0;return this.isHorizontal()?(h=n(r,i,o),c=e+t,l=o-i):("left"===a.position?(h=i+t,c=n(r,s,e),d=-.5*Ot):(h=o-t,c=n(r,e,s),d=.5*Ot),l=s-e),{titleX:h,titleY:c,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ui(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);Pe(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:l,textAlign:s(e.align),textBaseline:"middle",translation:[o,a]})}}var To={id:"title",_element:Ao,start(t,e,i){!function(t,e){const i=new Ao({ctx:t.ctx,options:e,chart:t});Xi.configure(t,i,e),Xi.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;Xi.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;Xi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Lo=new WeakMap;var Ro={id:"subtitle",start(t,e,i){const s=new Ao({ctx:t.ctx,options:i,chart:t});Xi.configure(t,s,i),Xi.addBox(t,s),Lo.set(t,s)},stop(t){Xi.removeBox(t,Lo.get(t)),Lo.delete(t)},beforeUpdate(t,e,i){const s=Lo.get(t);Xi.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Eo={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,n+=t.y,++o}}return{x:s/o,y:n/o}},nearest(t,e){if(!t.length)return!1;let i,s,n,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=Kt(e,s.getCenterPoint());t<r&&(r=t,n=s)}}if(n){const t=n.tooltipPosition();o=t.x,a=t.y}return{x:o,y:a}}};function Io(t,e){return e&&(X(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function zo(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Fo(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Bo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=ui(e.bodyFont),h=ui(e.titleFont),c=ui(e.footerFont),d=o.length,u=n.length,f=s.length,g=di(e.padding);let p=g.height,m=0,b=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const _=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=h.string,et(t.title,_),i.font=l.string,et(t.beforeBody.concat(t.afterBody),_),x=e.displayColors?a+2+e.boxPadding:0,et(s,(t=>{et(t.before,_),et(t.lines,_),et(t.after,_)})),x=0,i.font=c.string,et(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Vo(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function No(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Vo(t,e,i,s),yAlign:s}}function Wo(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ci(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:Qt(g,0,s.width-e.width),y:Qt(p,0,s.height-e.height)}}function Ho(t,e,i){const s=di(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function jo(t){return Io([],zo(t))}function $o(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class Yo extends Os{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new ms(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,pi(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=Io(a,zo(s)),a=Io(a,zo(n)),a=Io(a,zo(o)),a}getBeforeBody(t,e){return jo(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return et(t,(t=>{const e={before:[],lines:[],after:[]},n=$o(i,t);Io(e.before,zo(n.beforeLabel.call(this,t))),Io(e.lines,n.label.call(this,t)),Io(e.after,zo(n.afterLabel.call(this,t))),s.push(e)})),s}getAfterBody(t,e){return jo(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=Io(a,zo(s)),a=Io(a,zo(n)),a=Io(a,zo(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;a<r;++a)l.push(Fo(this.chart,e[a]));return t.filter&&(l=l.filter(((e,s,n)=>t.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),et(l,(e=>{const i=$o(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Eo[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Bo(this,i),a=Object.assign({},t,e),r=No(this.chart,i,a),l=Wo(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=ci(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,x=_+o,y=_-o):(p=d+f,m=p+o,x=_-o,y=_+o),b=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(x=u,_=x-o,p=m-o,b=m+o):(x=u+g,_=x+o,p=m+o,b=m-o),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=mi(i.rtl,this.x,this.width);for(t.x=Ho(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=ui(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,r+1===n&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,n){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:r,boxWidth:l,boxPadding:h}=n,c=ui(n.bodyFont),d=Ho(this,"left",n),u=s.x(d),f=r<c.lineHeight?(c.lineHeight-r)/2:0,g=e.y+f;if(n.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=g+r/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ye(t,e,i,h),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,ye(t,e,i,h)}else{t.lineWidth=o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const e=s.leftForLtr(u,l-h),i=s.leftForLtr(s.xPlus(u,1),l-h-2),a=ci(o.borderRadius);Object.values(a).some((t=>0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,Ce(t,{x:e,y:g,w:l,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ce(t,{x:i,y:g+1,w:l-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,l,r),t.strokeRect(e,g,l,r),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=ui(i.bodyFont);let d=c.lineHeight,u=0;const f=mi(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,b,x,_,y,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=Ho(this,p,i),e.fillStyle=i.bodyColor,et(this.beforeBody,g),u=a&&"right"!==p?"center"===o?l/2+h:l+2+h:0,_=0,v=s.length;_<v;++_){for(m=s[_],b=this.labelTextColors[_],e.fillStyle=b,et(m.before,g),x=m.lines,a&&x.length&&(this._drawColorBox(e,t,_,f,i),d=Math.max(c.lineHeight,r)),y=0,w=x.length;y<w;++y)g(x[y]),d=c.lineHeight;et(m.after,g)}u=0,d=c.lineHeight,et(this.afterBody,g),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let o,a;if(n){const r=mi(i.rtl,this.x,this.width);for(t.x=Ho(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",o=ui(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<n;++a)e.fillText(s[a],r.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:o}=this,{x:a,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=ci(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+c,r),"top"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,r),e.quadraticCurveTo(a+l,r,a+l,r+d),"center"===o&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(a+l,r+h-f),e.quadraticCurveTo(a+l,r+h,a+l-f,r+h),"bottom"===o&&this.drawCaret(t,e,i,s),e.lineTo(a+u,r+h),e.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(a,r+c),e.quadraticCurveTo(a,r,a+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Eo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Bo(this,t),a=Object.assign({},i,this._size),r=No(e,t,a),l=Wo(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=di(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),bi(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),xi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!it(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!it(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Eo[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}Yo.positioners=Eo;var Uo={id:"tooltip",_element:Yo,positioners:Eo,afterInit(t,e,i){i&&(t.tooltip=new Yo({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(!1===t.notifyPlugins("beforeTooltipDraw",i))return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:$,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:$,beforeBody:$,beforeLabel:$,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return U(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:$,afterBody:$,beforeFooter:$,footer:$,afterFooter:$}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Xo=Object.freeze({__proto__:null,Decimation:ho,Filler:Po,Legend:Oo,SubTitle:Ro,Title:To,Tooltip:Uo});function qo(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}class Ko extends Ns{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(U(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:Qt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:qo(i,t,Z(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!=typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Go(t,e,{horizontal:i,minRotation:s}){const n=Yt(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}Ko.id="category",Ko.defaults={ticks:{callback:Ko.prototype.getLabelForValue}};class Zo extends Ns{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return U(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=Bt(s),e=Bt(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,f=h-1,{min:g,max:p}=e,m=!U(o),b=!U(a),x=!U(l),_=(p-g)/(c+1);let y,v,w,M,k=Vt((p-g)/f/u)*u;if(k<1e-14&&!m&&!b)return[{value:g},{value:p}];M=Math.ceil(p/k)-Math.floor(g/k),M>f&&(k=Vt(M*k/f/u)*u),U(r)||(y=Math.pow(10,r),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(g/k)*k,w=Math.ceil(p/k)*k):(v=g,w=p),m&&b&&n&&jt((a-o)/n,k/1e3)?(M=Math.round(Math.min((a-o)/k,h)),k=(a-o)/M,v=o,w=a):x?(v=m?o:v,w=b?a:w,M=l-1,k=(w-v)/M):(M=(w-v)/k,M=Ht(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Xt(k),Xt(v));y=Math.pow(10,U(r)?S:r),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let P=0;for(m&&(d&&v!==o?(i.push({value:o}),v<o&&P++,Ht(Math.round((v+P*k)*y)/y,o,Go(o,_,t))&&P++):v<o&&P++);P<M;++P)i.push({value:Math.round((v+P*k)*y)/y});return b&&d&&w!==a?i.length&&Ht(i[i.length-1].value,a,Go(a,_,t))?i[i.length-1].value=a:i.push({value:a}):b&&w!==a||i.push({value:w}),i}({maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},this._range||this);return"ticks"===t.bounds&&$t(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ni(t,this.chart.options.locale,this.options.ticks.format)}}class Jo extends Zo{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?t:0,this.max=K(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function Qo(t){return 1===t/Math.pow(10,Math.floor(Ft(t)))}Jo.id="linear",Jo.defaults={ticks:{callback:Ts.formatters.numeric}};class ta extends Ns{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Zo.prototype.parse.apply(this,[t,e]);if(0!==i)return K(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=K(t)?Math.max(0,t):null,this.max=K(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Ft(t))+e);i===s&&(i<=0?(n(1),o(10)):(n(a(i,-1)),o(a(s,1)))),i<=0&&n(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&n(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Ft(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=G(t.min,Math.pow(10,Math.floor(Ft(e.min)))),a=Math.floor(Ft(o)),r=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{n.push({value:o,major:Qo(o)}),++r,10===r&&(r=1,++a,l=a>=0?1:l),o=Math.round(r*Math.pow(10,a)*l)/l}while(a<i||a===i&&r<s);const h=G(t.max,o);return n.push({value:h,major:Qo(o)}),n}({min:this._userMin,max:this._userMax},this);return"ticks"===t.bounds&&$t(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return void 0===t?"0":ni(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ft(t),this._valueRange=Ft(this.max)-Ft(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ft(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function ea(t){const e=t.ticks;if(e.display&&t.display){const t=di(e.backdropPadding);return Z(e.font&&e.font.size,yt.font.size)+t.height}return 0}function ia(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function sa(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,r=a.centerPointLabels?Ot/o:0;for(let d=0;d<o;d++){const o=a.setContext(t.getPointLabelContext(d));n[d]=o.padding;const u=t.getPointPosition(d,t.drawingArea+n[d],r),f=ui(o.font),g=(l=t.ctx,h=f,c=X(c=t._pointLabels[d])?c:[c],{w:be(l,h.string,c),h:c.length*h.lineHeight});s[d]=g;const p=Zt(t.getIndexAngle(d)+r),m=Math.round(Ut(p));na(i,e,p,ia(m,u.x,g.w,0,180),ia(m,u.y,g.h,90,270))}var l,h,c;t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=function(t,e,i){const s=[],n=t._pointLabels.length,o=t.options,a=ea(o)/2,r=t.drawingArea,l=o.pointLabels.centerPointLabels?Ot/n:0;for(let o=0;o<n;o++){const n=t.getPointPosition(o,r+a+i[o],l),h=Math.round(Ut(Zt(n.angle+Et))),c=e[o],d=ra(n.y,c.h,h),u=oa(h),f=aa(n.x,c.w,u);s.push({x:n.x,y:d,textAlign:u,left:f,top:d,right:f+c.w,bottom:d+c.h})}return s}(t,s,n)}function na(t,e,i,s,n){const o=Math.abs(Math.sin(i)),a=Math.abs(Math.cos(i));let r=0,l=0;s.start<e.l?(r=(e.l-s.start)/o,t.l=Math.min(t.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/a,t.t=Math.min(t.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function oa(t){return 0===t||180===t?"center":t<180?"left":"right"}function aa(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function ra(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function la(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,At);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o<s;o++)i=t.getPointPosition(o,e),n.lineTo(i.x,i.y)}}ta.id="logarithmic",ta.defaults={ticks:{callback:Ts.formatters.logarithmic,major:{enabled:!0}}};class ha extends Zo{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=di(ea(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=K(t)&&!isNaN(t)?t:0,this.max=K(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ea(this.options))}generateTickLabels(t){Zo.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map(((t,e)=>{const i=tt(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?sa(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return Zt(t*(At/(this._pointLabels.length||1))+Yt(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(U(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(U(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return function(t,e,i){return pi(t,{label:i,index:e,type:"pointLabel"})}(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Et+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),la(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,n=this._pointLabels.length;let o,a,r;if(e.pointLabels.display&&function(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=s.setContext(t.getPointLabelContext(n)),o=ui(e.font),{x:a,y:r,textAlign:l,left:h,top:c,right:d,bottom:u}=t._pointLabelItems[n],{backdropColor:f}=e;if(!U(f)){const t=ci(e.borderRadius),s=di(e.backdropPadding);i.fillStyle=f;const n=h-s.left,o=c-s.top,a=d-h+s.width,r=u-c+s.height;Object.values(t).some((t=>0!==t))?(i.beginPath(),Ce(i,{x:n,y:o,w:a,h:r,radius:t}),i.fill()):i.fillRect(n,o,a,r)}Pe(i,t._pointLabels[n],a,r+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,n),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),la(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,s.setContext(this.getContext(e-1)),a,n)}})),i.display){for(t.save(),o=n-1;o>=0;o--){const s=i.setContext(this.getPointLabelContext(o)),{color:n,lineWidth:l}=s;l&&n&&(t.lineWidth=l,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=ui(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=di(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}Pe(t,s.label,0,-n,l,{color:r.color})})),t.restore()}drawTitle(){}}ha.id="radialLinear",ha.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ts.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},ha.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},ha.descriptors={angleLines:{_fallback:"grid"}};const ca={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},da=Object.keys(ca);function ua(t,e){return t-e}function fa(t,e){if(U(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof s&&(a=s(a)),K(a)||(a="string"==typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!Wt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function ga(t,e,i,s){const n=da.length;for(let o=da.indexOf(t);o<n-1;++o){const t=ca[da[o]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return da[o]}return da[n-1]}function pa(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=vt(i,e);t[i[s]>=e?i[s]:i[n]]=!0}}else t[e]=!0}function ma(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return 0!==o&&i?function(t,e,i,s){const n=t._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}(t,s,n,i):s}class ba extends Ns{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new xn._date(t.adapters.date);rt(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:fa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function r(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=K(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=K(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=kt(s,n,this.max);return this._unit=e.unit||(i.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=da.length-1;o>=da.indexOf(i);o--){const i=da[o];if(ca[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return da[i?da.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=da.indexOf(t)+1,i=da.length;e<i;++e)if(ca[da[e]].common)return da[e]}(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),ma(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map((t=>+t.value)))}initOffsets(t){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;s=Qt(s,0,o),n=Qt(n,0,o),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,o=n.unit||ga(n.minUnit,e,i,this._getLabelCapacity(e)),a=Z(n.stepSize,1),r="week"===o&&n.isoWeekday,l=Wt(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,a,o),d++)pa(h,c,f);return c!==i&&"ticks"!==s.bounds&&1!==d||pa(h,c,f),Object.keys(h).sort(((t,e)=>t-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.time.displayFormats,a=this._unit,r=this._majorUnit,l=a&&o[a],h=r&&o[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),f=n.ticks.callback;return f?tt(f,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*n+a*o,h:i*o+a*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,ma(this,[t],this._majorUnit),s),o=this._getLabelSize(n),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(fa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ct(t.sort(ua))}}function xa(t,e,i){let s,n,o,a,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=wt(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=wt(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}ba.id="time",ba.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class _a extends ba{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=xa(e,this.min),this._tableRange=xa(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o<a;++o)l=t[o],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)h=s[o+1],r=s[o-1],l=s[o],Math.round((h+r)/2)!==l&&n.push({time:l,pos:o/(a-1)});return n}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(xa(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return xa(this._table,i*this._tableRange+this._minPos,!0)}}_a.id="timeseries",_a.defaults=ba.defaults;var ya=Object.freeze({__proto__:null,CategoryScale:Ko,LinearScale:Jo,LogarithmicScale:ta,RadialLinearScale:ha,TimeScale:ba,TimeSeriesScale:_a});return fn.register(In,ya,ao,Xo),fn.helpers={...Di},fn._adapters=xn,fn.Animation=gs,fn.Animations=ms,fn.animator=a,fn.controllers=Hs.controllers.items,fn.DatasetController=Cs,fn.Element=Os,fn.elements=ao,fn.Interaction=Ei,fn.layouts=Xi,fn.platforms=ds,fn.Scale=Ns,fn.Ticks=Ts,Object.assign(fn,In,ya,ao,Xo,ds),fn.Chart=fn,"undefined"!=typeof window&&(window.Chart=fn),fn}));
diff --git a/admin/survey/script/DragDrop/dragdropInAdmin.js b/admin/survey/script/DragDrop/dragdropInAdmin.js
index 65d1799..f95ebe8 100644
--- a/admin/survey/script/DragDrop/dragdropInAdmin.js
+++ b/admin/survey/script/DragDrop/dragdropInAdmin.js
@@ -120,8 +120,8 @@ function Draggable(tip, spremenljivka, vre_id, ajax, anketa, site_url, usr_id, o
var top_cat = -1;
var left_cat = -1;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
}
$('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).addClass('drag_and_drop').detach().appendTo('#half_frame_dropping_'+spremenljivka) //zeleni element s kategorijami dodaj v zacetnem kontejnerju
@@ -334,8 +334,8 @@ function DragDropDelovanje(tip, spremenljivka, site_url, ajax, anketa, usr_id, n
var left_cat = -1;
var default_var_height = 290;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
default_var_height = 220; //default visina celotnega vprasanja @ mobile == 0 (desktop) in mobile == 2 (tablica)
}
@@ -568,8 +568,8 @@ function GridDraggable(tip, spremenljivka, vre_id, ajax, anketa, site_url, usr_i
var top_cat = -1;
var left_cat = -1;
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
top_cat_right = 30;
}
//*********************
@@ -828,8 +828,8 @@ function GridDragDropDelovanje(num_grids, indeks, tip, spremenljivka, site_url,
var left_cat = -1;
var default_var_height = 290; //default visina celotnega vprasanja
if (mobile == 0 || mobile == 2){
- top_cat = -6;
- left_cat = -6;
+ //top_cat = -6;
+ //left_cat = -6;
top_cat_right = 30;
var default_var_height = 220; //default visina celotnega vprasanja
}
diff --git a/admin/survey/script/GDPR.js b/admin/survey/script/GDPR.js
index 7ac7a24..15be256 100644
--- a/admin/survey/script/GDPR.js
+++ b/admin/survey/script/GDPR.js
@@ -103,6 +103,8 @@ function toggleGDPRInfoText(obj){
function previewGDPRExport(type){
var ank_id = $("input[name=anketa]").val();
+
+ $('#fullscreen').addClass("divPopUp");
$('#fullscreen').html('').fadeIn('slow').draggable({
delay: 100
@@ -145,17 +147,22 @@ function toggleGDPRDPO(){
var has_dpo = $('input[name=has_dpo]:checked').val();
if(organization == '1' || has_dpo == '1')
- $("#gdpr_dpo").show();
+ $("#gdpr_dpo").removeClass('displayNone');
+
else
- $("#gdpr_dpo").hide();
+ $("#gdpr_dpo").addClass('displayNone');
+
if(organization == '1'){
- $("#gdpr_organization").show();
- $("#gdpr_has_dpo").hide();
+ $("#gdpr_organization").removeClass('displayNone');
+ $("#gdpr_has_dpo").addClass('displayNone');
+ $("#gdpr_has_dpo").find('.setting_holder').removeClass('bottom16');
+
}
else{
- $("#gdpr_organization").hide();
- $("#gdpr_has_dpo").show();
+ $("#gdpr_organization").addClass('displayNone');
+ $("#gdpr_has_dpo").removeClass('displayNone');
+ $("#gdpr_has_dpo").find('.setting_holder').addClass('bottom16');
}
}
// Prikazemo/skrijemo nastavitve organizacije in dpo-ja (ce je zasebnik)
@@ -164,9 +171,10 @@ function toggleGDPRHasDPO(){
var has_dpo = $('input[name=has_dpo]:checked').val();
if(has_dpo == '1')
- $("#gdpr_dpo").show();
+ $("#gdpr_dpo").removeClass('displayNone');
+
else
- $("#gdpr_dpo").hide();
+ $("#gdpr_dpo").addClass('displayNone');
}
// Nastavimo zahtevo za izbris da je opravljena
@@ -195,7 +203,7 @@ function setGDPRRequestComment(request_id, text){
var value = text;
- $("#anketa_edit").load('ajax.php?t=gdpr&a=gdpr_request_comment', {request_id: request_id, value:value});
+ $("#gdpr_nastavitve").load('ajax.php?t=gdpr&a=gdpr_request_comment', {request_id: request_id, value:value});
}
// Nastavimo komentar zahtevi za izbris - znotraj ankete
function setGDPRRequestCommentSurvey(request_id, text){
@@ -205,3 +213,79 @@ function setGDPRRequestCommentSurvey(request_id, text){
$("#survey_requests").load('ajax.php?t=gdpr&a=gdpr_request_comment_survey', {request_id: request_id, value:value, ank_id:ank_id});
}
+
+
+// Filter po gdpr anketah - seznam anket
+function gdpr_ankete(){
+
+ var check_gdpr_ankete = document.getElementById('gdpr_ankete_check');
+
+ if (check_gdpr_ankete.checked){
+ check_gdpr_ankete.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box1').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.green_row').hide();
+ }
+ else {
+ check_gdpr_ankete.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box1').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.green_row').show();
+ }
+}
+
+// Filter po potencialnih gdpr anketah - seznam anket
+function potenc_gdpr_ankete(){
+
+ var check_potenc_gdpr = document.getElementById('potenc_gdpr_ankete_check');
+
+ if (check_potenc_gdpr.checked){
+ check_potenc_gdpr.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box2').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.red_row').hide();
+ }
+ else {
+ check_potenc_gdpr.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box2').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.red_row').show();
+ }
+}
+
+// Filter po ne-gdpr anketah - seznam anket
+function ne_gdpr_ankete(){
+
+ var check_negdpr_ankete = document.getElementById('ne_gdpr_ankete');
+
+ if (check_negdpr_ankete.checked){
+ check_negdpr_ankete.checked = false;
+
+ // box-u odstranimo barvo
+ $('#num_box3').removeClass('checked');
+
+ // skrijemo vrstice v tabeli
+ $('.grey_row').hide();
+ }
+ else {
+ check_negdpr_ankete.checked = true;
+
+ // box-u dodamo barvo
+ $('#num_box3').addClass('checked');
+
+ // prikazemo vrstice v tabeli
+ $('.grey_row').show();
+ }
+}
diff --git a/admin/survey/script/Maps/VnaprejMarkers.js b/admin/survey/script/Maps/VnaprejMarkers.js
index 3bca4e6..de6e83c 100644
--- a/admin/survey/script/Maps/VnaprejMarkers.js
+++ b/admin/survey/script/Maps/VnaprejMarkers.js
@@ -317,7 +317,7 @@ function drawMarkers(spremenljivka) {
} else {
marker.setMap(null);
//odpre se okno, ce je prislo do napake - null - (mozen je tudi prekratek delay med geocoding requesti)
- alert(lang['srv_resevanje_alert_location_not_found_map']);
+ genericAlertPopup('srv_resevanje_alert_location_not_found_map');
}
});
});
diff --git a/admin/survey/script/appendMerge.js b/admin/survey/script/appendMerge.js
index bc24c3d..f091294 100644
--- a/admin/survey/script/appendMerge.js
+++ b/admin/survey/script/appendMerge.js
@@ -105,10 +105,10 @@ function append_prepare_add_recipients() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=get_profile_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', doAdd:doAdd, pid:pid});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
} else if (type == 0) {
@@ -158,10 +158,10 @@ function append_add_recipients(profile_id) {
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -180,14 +180,16 @@ function merge_getItems () {
var id = $(this).closest('li').attr('id');
var label = $(this).closest('li').find('label').text();
+ var dataTip = $(this).closest('li').data('tip');
var ch, cl;
if (checked == id+'_radio') { ch=' checked'; cl='inv_field_enabled'; } else { cd=''; cl=''; }
-
- $('ul#merge').append('<li class="'+cl+'"><input type="radio" id="'+id+'_radio"'+ch+' name="merge" value="'+id+'" onclick="merge_labels();"><label style="display: inline;" for="'+id+'_radio">'+label+'</label></li>');
+
+ //za checkboxe in tabele ne dovolimo, da so identifikator pri merge
+ if(dataTip != 2 && dataTip != 6)
+ $('ul#merge').append('<li class="'+cl+'"><input type="radio" id="'+id+'_radio"'+ch+' name="merge" value="'+id+'" onclick="merge_labels();"><label style="display: inline;" for="'+id+'_radio">'+label+'</label></li>');
});
-
}
function merge_labels() {
@@ -202,5 +204,21 @@ function merge_labels() {
}
});
-
+}
+
+// Sortiranje box-ov pri dodajanju respondentov
+function initAppendMergeConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ append_refreshFieldsList();
+ },
+ forcePlaceholderSize: 'true',
+ tolerance: 'pointer',
+ placeholder: 'inv_field_placeholder'
+ });
} \ No newline at end of file
diff --git a/admin/survey/script/branching.js b/admin/survey/script/branching.js
index 613b205..6585325 100644
--- a/admin/survey/script/branching.js
+++ b/admin/survey/script/branching.js
@@ -49,10 +49,10 @@ function onload_init_branching() {
if (locked) {
$('#branching ul.first.locked').bind('click', function (event) {
if ($("#prevent_unlock").val() == 1) {
- alert(lang['srv_unlock_popup3']);
+ genericAlertPopup('srv_unlock_popup3');
}
else {
- alert(lang['srv_unlock_popup2']);
+ genericAlertPopup('srv_unlock_popup2');
}
});
return;
@@ -60,6 +60,7 @@ function onload_init_branching() {
// funkcijo poklicemo ko se stran naloada in ob koncu vsakega ajax klica
branching_struktura();
+
$("body").ajaxStop(function () {
branching_struktura();
});
@@ -83,6 +84,34 @@ function onload_init_branching() {
branching_if_mouseleave(event);
}
});
+
+ // Copy paste iz worda - pocistimo text
+ $('div[contenteditable=true]').on('paste', function(e) {
+
+ // Prevent the default action
+ e.preventDefault();
+
+ // Dobimo plain text iz clipboarda
+ var text = e.originalEvent.clipboardData.getData('text/plain');
+
+ if (document.queryCommandSupported('insertText')) {console.log('xxx' + text);
+ document.execCommand('insertText', false, text);
+ }
+ else {console.log('aaaa' + text);
+ // Insert text at the current position of caret
+ const range = document.getSelection().getRangeAt(0);
+ range.deleteContents();
+
+ const textNode = document.createTextNode(text);
+ range.insertNode(textNode);
+ range.selectNodeContents(textNode);
+ range.collapse(false);
+
+ const selection = window.getSelection();
+ selection.removeAllRanges();
+ selection.addRange(range);
+ }
+ });
}
// polovi vse click-e, ki se zgodijo v branchingu
@@ -107,12 +136,12 @@ function branching_click(event) {
}
// spremeni tip skale (ordinalna/nominalna) za tip 1,3,6
- if (ta.is('div.spr_edit a.scale_ordnom')) {
+ if (ta.is('div.spr_edit .scale_ordnom button:not(.active)')) {
var id = ta.parent().parent().attr('id');
id = id.replace('edit_', '');
value = ta.parent().parent().parent().find('.spremenljivka_content').attr('skala');
- if(value == 0) value = 1;
+ if(value == 0 || value == -1) value = 1;
else value = 0;
scale_ordnom(id, value);
@@ -148,7 +177,7 @@ function branching_click(event) {
}
// preview spremenljivke
- if (ta.is('div.spr_edit a.preview')) {
+ if (ta.is('div.spr_edit a.monitor')) {
var id = ta.parent().attr('id');
id = id.replace('edit_', '');
preview_spremenljivka(id);
@@ -239,7 +268,7 @@ function branching_click(event) {
// plusminus if, blok
- if (ta.is('a.pm')) {
+ if (ta.is('span.pm')) {
var id = ta.parent().attr('id');
id = id.replace('branching_if', '');
plusminus(id);
@@ -364,15 +393,20 @@ function branching_click(event) {
}
// pagebreak (klik na celo vrstico)
- td = $(event.target).closest('li.drop span, li.nodrop span');
+ td = $(event.target).closest('li.drop > div, li.nodrop > div');
if (td.hasClass('pb_new') || td.hasClass('pb_on')) {
- var spr;
- if (td.parent().attr('spr_pb'))
- spr = td.parent().attr('spr_pb');
- else
- spr = td.parent().attr('spr');
- if (!td.hasClass('permanent'))
+
+ if (!td.hasClass('permanent')){
+ var spr;
+
+ if (td.parent().attr('spr_pb'))
+ spr = td.parent().attr('spr_pb');
+ else
+ spr = td.parent().attr('spr');
+
pagebreak(spr);
+ }
+
return false;
}
@@ -431,6 +465,7 @@ function branching_mouseover(event) {
edit = edit.replace('branching_', '');
if (edit > 0) {
if (branchborder.find('div.spr_edit').length == 0) {
+
var html_snippet;
// Dodamo izbiro nominalne/ordinalne skale pri tipih 1, 3 in 6
@@ -443,24 +478,26 @@ function branching_mouseover(event) {
scale = 1;
if(scale == 1){
- scale_string = '<span class="scale_ordnom"><a class="scale_ordnom">' + lang['srv_skala_0'] + '</a>' +
- ' / ' +
- '<span class="bold">' + lang['srv_skala_1'] + '</span></span>';
+ scale_string = '<div class="scale_ordnom"><button class="small">' + lang['srv_skala_0'] + '</button>' +
+ '<button class="small active">' + lang['srv_skala_1'] + '</button></div>';
}
else{
- scale_string = '<span class="scale_ordnom"><span class="bold">' + lang['srv_skala_0'] + '</span>' +
- ' / ' +
- '<a class="scale_ordnom">' + lang['srv_skala_1'] + '</a></span>';
+ scale_string = '<div class="scale_ordnom"><button class="small active">' + lang['srv_skala_0'] + '</button>' +
+ '<button class="small">' + lang['srv_skala_1'] + '</button></div>';
}
}
- html_snippet = /*'<div class="spr_edit" id="edit_'+edit+'"><span class="edit">'+lang['srv_editirajspremenljivko']+' </span>'+*/
- '<div class="spr_edit" id="edit_' + edit + '">' +
- scale_string +
+ // Svincnik - urejanje
+ html_snippet = '<div class="spr_edit" id="edit_' + edit + '">' +
+ scale_string +
'<a title="' + lang['srv_editirajspremenljivko'] + '" class="edit faicon"></a>';
+ // Glasovanje te ikone nima
+ if($('#branching').hasClass('branching_glasovanje')){
+
+ }
// Disablamo ife, ce nima ustreznega paketa
- if ($('#commercial_package').attr('value') == '1') {
+ else if ($('#commercial_package').attr('value') == '1') {
html_snippet = html_snippet +
'<a title="' + lang['srv_if_new_question'] + '" class="addif faicon user_access_locked"></a>';
}
@@ -483,8 +520,12 @@ function branching_mouseover(event) {
signature = 1;
}
+ // Glasovanje te ikone nima
+ if($('#branching').hasClass('branching_glasovanje')){
+
+ }
// Disablamo kopiranje, ce nima ustreznega paketa za ta tip vprasanja
- if ( ($('#commercial_package').attr('value') == '1' && ['17','18','24','26','27'].includes(tip))
+ else if ( ($('#commercial_package').attr('value') == '1' && ['17','18','24','26','27'].includes(tip))
|| (($('#commercial_package').attr('value') == '1' || $('#commercial_package').attr('value') == '2') && ['22','25'].includes(tip))
|| (($('#commercial_package').attr('value') == '1' || $('#commercial_package').attr('value') == '2') && ['21'].includes(tip) && signature == 1) ) {
@@ -496,15 +537,22 @@ function branching_mouseover(event) {
'<a title="' + lang['srv_copy_spr'] + '" class="copy faicon"></a>';
}
- html_snippet = html_snippet +
- '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="preview faicon"></a>';
+ // Kalkulacija in kvota nimata predogleda
+ if(!['22','25'].includes(tip)){
+ html_snippet = html_snippet +
+ '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="monitor faicon"></a>';
+ }
+
}
// zarad tega so errorji
if (vprasanje_tracking == 2)
html_snippet += '<a title="'+lang['srv_analiza_arhiviraj']+'" class="arhiv faicon"></a>';
- html_snippet += '<a title="' + lang['srv_brisispremenljivko'] + '" class="delete faicon"></a>' +
- '</div>';
+ // Glasovanje te ikone nima
+ if(!$('#branching').hasClass('branching_glasovanje')){
+ html_snippet += '<a title="' + lang['srv_brisispremenljivko'] + '" class="delete faicon"></a>' + '</div>';
+ }
+
branchborder.prepend(html_snippet);
}
@@ -520,6 +568,7 @@ function branching_mouseover(event) {
html_snippet = '<div class="spr_edit" id="edit_' + edit + '">' +
'<a title="' + (hidden == 1 ? lang['edit_show'] : lang['edit_hide']) + '" class="hide faicon ' + (hidden == 1 ? 'unhide_icon' : 'hide_icon') + '"></a>' +
'<a title="' + (edit == -1 ? lang['srv_editirajuvod'] : lang['srv_editirajzakljucek']) + '" class="faicon edit"></a>' +
+ '<a title="' + lang['srv_predogled_spremenljivka'] + '" class="monitor faicon"></a>'+
'</div>';
branchborder.prepend(html_snippet);
@@ -620,7 +669,7 @@ function branching_struktura() {
// nastavimo droppable
$('li.drop', $('#branching')).droppable({
- accept: '.spr, .if, .block, .endif, .endblock, .new_spr, .new_adv, .new_if, .new_block, .new_loop, .new_pb, .loop, .endloop',
+ accept: '.spr, .if, .block, .endif, .endblock, .new_spr, .new_if, .new_block, .new_loop, .new_pb, .loop, .endloop',
hoverClass: 'branchinghover',
tolerance: 'pointer',
drop: function (e, ui) {
@@ -642,12 +691,6 @@ function branching_struktura() {
spremenljivka_new(spr, _if, endif, copy, tip, podtip, drop);
}
- } else if ($(ui.draggable).hasClass('new_adv')) { // nova advanced spremenljivka (odpre se popup za izbiro)
- var spr = $(this).attr('spr');
- var _if = $(this).attr('if');
- var endif = $(this).attr('endif');
- toolbox_add_advanced(spr, _if, endif);
-
} else if ($(ui.draggable).hasClass('new_if')) { // nov if iz toolbox
var spr = $(this).attr('spr');
var _if = $(this).attr('if');
@@ -681,53 +724,44 @@ function branching_struktura() {
});
load_help(); // help moramo loadati tudi na zacetku in ob vsakem ajax klicu
-
- // paste from word alert
- $('div[contenteditable=true]').off('paste', pasteFromWordAlert);
- $('div[contenteditable=true]').on('paste', pasteFromWordAlert);
-
}
-var pasteFromWord = false;
-function pasteFromWordAlert() {
-
- if (pasteFromWord == true) return;
- pasteFromWord = true;
-}
-
-function pasteFromWordAlertClose() {
-
- $('#pasteFromWordAlert').hide();
- $('#fade').fadeOut('slow');
-}
var is_new_spr_dragable = false; // gledamo ali vlečemo new_spr da skrbimo za skrivanje
// inicializira toolbox na levi strani
function init_toolbox() {
- /*$('#toolbox, #toolbox_basic, #toolbox_settings').draggable({handle: '.handle'});*/
- $('p.new_spr:not(.user_access_locked), p.new_adv:not(.user_access_locked), p.new_if:not(.user_access_locked), p.new_block:not(.user_access_locked), p.new_loop:not(.user_access_locked), p.new_pb', '#toolbox_basic').draggable({
- start: function () {
- is_new_spr_dragable = true, $('#toolbox_add_advanced').addClass('dragging')
+ $('.new_spr:not(.user_access_locked), .new_if:not(.user_access_locked), .new_block:not(.user_access_locked), .new_loop:not(.user_access_locked), .new_pb', '#toolbox_basic').draggable({
+ start: function (e, ui) {
+ is_new_spr_dragable = true;
+ $('#toolbox_add_advanced').addClass('dragging');
+ $(ui.helper).addClass("clone-dragging");
},
- stop: function () {
- is_new_spr_dragable = false, $('#toolbox_add_advanced').removeClass('dragging')
+ stop: function (e, ui) {
+ is_new_spr_dragable = false;
+ $('#toolbox_add_advanced').removeClass('dragging');
+ $(ui.helper).removeClass("clone-dragging");
},
revert: false,
helper: 'clone',
opacity: 0.9,
appendTo: 'body',
- distance: 5
+ distance: 5,
+ cursor: 'pointer'
}).bind('click', function (event) {
var ta = $(event.target);
- ta = $(ta).closest('p');
+ ta = $(ta).closest('.new_spr, .new_if, .new_block, .new_loop');
+
if (ta.hasClass('new_spr')) { // nova spremenljivka (iz toolboxa)
- //$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()}); // scrollamo na dno zaslona
+
var tip = ta.attr('tip');
var podtip = 0;
- if (ta.hasClass('podtip')) podtip = ta.attr('podtip');
+
+ if (ta.hasClass('podtip'))
+ podtip = ta.attr('podtip');
+
// pri kreiranju generatorja imen ustvarimo za njim se loop in nagovor, ki mu pripadata
if (tip == '9_sn') {
SN_generator_new(0, 1);
@@ -736,78 +770,112 @@ function init_toolbox() {
spremenljivka_new(0, 0, 1, 0, tip, podtip);
}
- } else if (ta.hasClass('new_adv')) { // nova spremenljivka advanced (prikaze se popup z vsemi tipi vprasanj)
- //$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()}); // scrollamo na dno zaslona
- toolbox_add_advanced(0, 0, 1);
-
- } else if (ta.hasClass('new_if')) { // nov if iz toolbox
+ }
+ else if (ta.hasClass('new_if')) { // nov if iz toolbox
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 0);
-
- } else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
+ }
+ else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 1);
-
- } else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
+ }
+ else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
$('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
if_new(0, 0, 1, 2);
}
$('#toolbox_add_advanced').addClass('dragging');
+
setTimeout(function () {
$('#toolbox_add_advanced').removeClass('dragging');
}, 500);
+ event.stopPropagation();
});
// mousever preview vprasanja
$('#toolbox_basic').bind('mouseover', function (event) {
- var tip = $(event.target).closest('p.new_spr, p.new_adv, p.new_if, p.new_block, p.new_loop, p.new_sn');
+ var tip = $(event.target).closest('.new_spr, .new_adv, .new_if, .new_block, .new_loop, .new_sn');
- if (tip.hasClass('adv')) { // tooltip za vprasanja v advanced toolboxu
- if (tip.hasClass('podtip')) { // vprasanja s podtipom
+ // tooltip za vprasanja v advanced toolboxu
+ if (tip.hasClass('adv')) {
+
+ // vprasanja s podtipom
+ if (tip.hasClass('podtip')) {
show_tip_preview_subtype(-1, tip.attr('podtip'), tip.attr('tip'));
}
else if (tip.hasClass('new_sn')) {
show_tip_preview_toolbox(tip.attr('tip'), 0, 1);
}
- else if (tip.hasClass('new_spr')) { // osnovna vprasanja, samo z tipom
+ // osnovna vprasanja, samo z tipom
+ else if (tip.hasClass('new_spr')) {
show_tip_preview_toolbox(tip.attr('tip'), 0, 1);
}
}
- else if (tip.hasClass('new_spr') && !is_new_spr_dragable) { // tooltip za vprasanja v osnovnemu toolboxu
+ // tooltip za vprasanja v osnovnemu toolboxu
+ else if (tip.hasClass('new_spr') && !is_new_spr_dragable) {
var podtip = tip.attr('podtip');
show_tip_preview_toolbox(tip.attr('tip'), undefined, undefined, podtip);
}
else if (tip.hasClass('new_if') || tip.hasClass('new_block') || tip.hasClass('new_loop')) {
show_tip_preview_toolbox(tip.attr('tip'));
}
- else if (tip.hasClass('new_adv')) { // gumb za +
+ // gumb za +
+ else if (tip.hasClass('new_adv')) {
// prikazemo s CSSom
}
}).bind('mouseout', function (event) {
$("#tip_preview").hide();
});
-
- // max-height toolboxa
- //$('#toolbox_basic').css('max-height', $(window).height()-188);
}
// prikaze popup za dodajanje naprednih tipov vprasanj
-function toolbox_add_advanced(spr, _if, endif) {
+function toolbox_add_advanced_popup() {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').show().load('ajax.php?t=branching&a=toolbox_add_advanced', {
- anketa: srv_meta_anketa_id,
- spr: spr,
- 'if': _if,
- endif: endif
- });
+
+ $('#fullscreen').show().load('ajax.php?t=branching&a=toolbox_add_advanced', {anketa: srv_meta_anketa_id}, function(){
+
+ $('#toolbox_add_advanced_popup .new_spr:not(.user_access_locked), #toolbox_add_advanced_popup .new_if:not(.user_access_locked), #toolbox_add_advanced_popup .new_block:not(.user_access_locked), #toolbox_add_advanced_popup .new_loop:not(.user_access_locked)').click(function() {
+ var ta = $(event.target);
+
+ if (ta.hasClass('new_spr')) { // nova spremenljivka (iz toolboxa)
+
+ var tip = ta.attr('tip');
+ var podtip = 0;
+
+ if (ta.hasClass('podtip'))
+ podtip = ta.attr('podtip');
+
+ // pri kreiranju generatorja imen ustvarimo za njim se loop in nagovor, ki mu pripadata
+ if (tip == '9_sn') {
+ SN_generator_new(0, 1);
+ }
+ else {
+ spremenljivka_new(0, 0, 1, 0, tip, podtip);
+ }
+
+ }
+ else if (ta.hasClass('new_if')) { // nov if iz toolbox
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 0);
+ }
+ else if (ta.hasClass('new_block')) { // nov blok iz toolboxa
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 1);
+ }
+ else if (ta.hasClass('new_loop')) { // nov loop iz toolboxa
+ $('html, body').animate({scrollTop: $('body').height() + $('#branching').height()}); // scrollamo na dno zaslona
+ if_new(0, 0, 1, 2);
+ }
+ });
+ });
}
+
// ----------------------- funkcije, ki se klicejo iz htmlja
// -----------------------
@@ -827,25 +895,10 @@ function change_mode(what, value) {
}
// spremeni hitre nastavitve pri formi
-function change_form_quicksettings(what) {
+function change_form_quicksettings() {
- var status = $('#' + what).css('display');
- if (status == 'none') {
- $('#' + what).show();
- if (what == 'form_settings_obvescanje') {
- $('#obvescanje_switch').removeClass("plus").addClass("minus");
- } else {
- $('#email_switch').removeClass("plus").addClass("minus");
- }
- }
- else {
- $('#' + what).hide();
- if (what == 'form_settings_obvescanje') {
- $('#obvescanje_switch').removeClass("minus").addClass("plus");
- } else {
- $('#email_switch').removeClass("minus").addClass("plus");
- }
- }
+ $('#form_settings_obvescanje').slideToggle();
+ $('#obvescanje_switch').toggleClass("arrow2_d").toggleClass("arrow2_u");
vprasanje_save();
}
@@ -860,7 +913,7 @@ function toolbox_advanced(checked) {
}
// doda nov if
-function if_new(spremenljivka, _if, endif, tip, copy, no_content, follow_up) {
+function if_new(spremenljivka, _if, endif, tip, copy=0, no_content=0, follow_up=0) {
close_all_editing();
@@ -896,6 +949,9 @@ function if_new(spremenljivka, _if, endif, tip, copy, no_content, follow_up) {
condition_editing(new_if_id);
}
}
+ else{
+ actionNotePopup('condition_copy', 'success');
+ }
});
}
@@ -934,6 +990,7 @@ function spremenljivka_new(spremenljivka, _if, endif, copy, tip, podtip, drop) {
}
else {
refreshLeft(data.nova_spremenljivka_id);
+ actionNotePopup('question_copy', 'success');
}
// dvojne gride moramo na novo shranit da se prepise grid v bazi
@@ -1011,7 +1068,7 @@ function if_remove(_if, all, confirmed) {
// Warning da brisemo vsebino pogoja in imamo ze podatke, ki jih bomo pobrisali
if (data.substring(0, 3) === '<p>' || data.substring(0, 4) === '<h2>') {
$('#fade').fadeIn("fast");
- $('#dropped_alert').html(data).fadeIn("fast").css('width', '400px');
+ $('#dropped_alert').html(data).fadeIn("fast").css('width', '600px');
}
else{
$('#branching').html(data);
@@ -1050,8 +1107,6 @@ function if_tip(_if, tip) {
'if': _if,
anketa: srv_meta_anketa_id,
tip: tip
- }, function () {
- centerDiv2Page('#div_condition_editing');
});
}
@@ -1138,17 +1193,13 @@ function vrednost_condition_editing(vrednost) {
'ajax.php?t=branching&a=vrednost_condition_editing', {
'vrednost': vrednost,
'anketa': srv_meta_anketa_id
- }, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_conditions .clr_if').children('span').show(); //prikažemo zvezdico *IF
}
);
}
function condition_editing(_if, odpreminus) {
+
close_all_editing();
- // zapremo knjiznico
- $('#toolbox_library').hide();
$('li#branching_if' + _if).addClass('if_editing');
$('ul#if_' + _if).addClass('if_editing');
@@ -1202,16 +1253,16 @@ function condition_editing_close(_if, if_nova) {
var plus = 0;
- if ($('#branching_if' + _if + ' a.pm').hasClass('plus'))
+ if ($('#branching_if' + _if + ' span.pm').hasClass('plus'))
plus = 1;
$.post('ajax.php?t=branching&a=condition_editing_close', {anketa: srv_meta_anketa_id, 'if': _if, if_nova: if_nova},
function (data) {
if (plus == 1)
- $('#branching_if' + _if).html('<a class="pm plus"></a>' + data);
+ $('#branching_if' + _if).html('<span class="pm faicon plus"></span>' + data);
else
- $('#branching_if' + _if).html('<a class="pm minus"></a>' + data);
+ $('#branching_if' + _if).html('<span class="pm faicon minus"></span>' + data);
if ($('#vprasanje').css('display') == 'block') { // refreshamo tudi preview pogoja v urejanju vprasanja
@@ -1281,7 +1332,7 @@ function vrednost_condition_editing_close_save(vrednost, _if) {
//če pa pogoja še nimamo potem moramo najprej narediti span element, kamor bomo vstavili IF pogoj
//za checkox, radio in tisti, ki imajo div in ne tabele
if (v.is('div')) {
- v.append('<span style="font-size:9px; cursor:pointer" id="if_notranji_' + vrednost + '" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">');
+ v.append('<span style="cursor:pointer" id="if_notranji_' + vrednost + '" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">');
}//za vsa vprašanja, ki so v tabelah
if (v.is('tr')) {
v.find('td.grid_question').closest('td').append('<span class="red" style="cursor:pointer" onclick="vrednost_condition_editing(\'' + vrednost + '\'); return false;" title="' + lang['srv_podif_edit'] + '">*</span>');
@@ -1308,9 +1359,7 @@ function condition_add(_if, conjunction, negation, vrednost) {
'noupdate': __vnosi + __analiza,
'anketa': srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $("#div_condition_editing_container").attr({scrollTop: $("#div_condition_editing_container").attr("scrollHeight")});
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
+ $(".condition_editing_body").animate({ scrollTop: $('.condition_editing_body').prop("scrollHeight")}, 1000);
});
}
@@ -1485,7 +1534,6 @@ function bracket_edit_new(condition, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
});
@@ -1501,12 +1549,35 @@ function conjunction_edit(condition, conjunction, negation) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
});
}
+function conjunction_dropdown_edit(condition) {
+
+ var conj = $('#conjunction_dropdown_' + condition).val().split('_');
+
+ var conjunction = conj[0];
+ var negation = conj[1];
+
+ $('#div_condition_editing_inner').load('ajax.php?t=branching&a=conjunction_edit',
+ {
+ condition: condition,
+ conjunction: conjunction,
+ negation: negation,
+ noupdate: __vnosi + __analiza,
+ anketa: srv_meta_anketa_id
+ }, function () {
+
+ // Zascrollamo na pravo pozicijo
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
+ }
+ );
+}
+
function fill_value(condition, vrednost) {
var spr_id = document.getElementById('spremenljivka_' + condition);
@@ -1519,15 +1590,16 @@ function fill_value(condition, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
- $('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
- });
+ var scroll_position = $(".condition_editing_body").scrollTop() + $('#condition_'+condition).position().top - $(".condition_editing_body").height()/2 + $('#condition_'+condition).height()/2;
+ $(".condition_editing_body").animate({ scrollTop: scroll_position }, 1000);
+});
}
function edit_fill_value(condition) {
$('#edit_fill_value_' + condition).show();
$('#preview_fill_value_' + condition).hide();
+ $('#preview_fill_link_' + condition).hide();
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
}
@@ -1580,7 +1652,6 @@ function condition_remove(_if, condition, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#div_condition_editing_inner').resize(); // trigger, da se poklice resize event
});
@@ -1618,8 +1689,6 @@ function calculation_editing_close(condition, vrednost) {
anketa: srv_meta_anketa_id,
condition: condition,
vrednost: vrednost
- }, function () {
- centerDiv2Page('#div_condition_editing');
});
// kalkulacija kot tip vprasanja
@@ -1638,9 +1707,8 @@ function calculation_editing_close(condition, vrednost) {
'ajax.php?t=branching&a=calculation_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
}
}
}
@@ -1665,8 +1733,7 @@ function calculation_add(condition, operator, vrednost) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- $("#calculation_editing_inner").attr({scrollTop: $("#calculation_editing_inner").attr("scrollHeight")});
- $('#calculation_editing_inner').scroll();
+ $(".calculation_editing_body").animate({ scrollTop: $('.calculation_editing_body').prop("scrollHeight")}, 1000);
});
}
@@ -1680,7 +1747,6 @@ function calculation_operator_edit(calculation, operator) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#calculation_editing_inner').scroll();
});
}
@@ -1696,6 +1762,17 @@ function calculation_sort(condition) {
});
}
+function quota_sort(condition) {
+
+ $('#quota_editing_inner').load('ajax.php?t=branching&a=quota_sort', {
+ 'condition': condition,
+ sortable: $('#quota_editing_inner').sortable('serialize'),
+ anketa: srv_meta_anketa_id
+ }, function () {
+ $('#quota_editing_inner').scroll();
+ });
+}
+
function calculation_edit(calculation, vrednost) {
var spr_id = document
@@ -1740,7 +1817,6 @@ function calculation_bracket_edit_new(calculation, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#calculation_editing_inner').scroll();
});
}
@@ -1823,7 +1899,7 @@ function vprasanje_edit(spremenljivka, buffer) {
function plusminus(id, odpremo) {
- var a = $('#branching_if' + id + ' a.pm');
+ var a = $('#branching_if' + id + ' span.pm');
// blok/if je prikazan, mi ga bomo skrili
if (a.hasClass('minus') && odpremo != 1) {
@@ -1952,13 +2028,39 @@ function intro_concl_preview(spremenljivka) {
});
}
+function toggle_missing_dropdown_table(spr){
+ if($('[id="table_missings_menu_'+spr+'"]').last().css('display') == 'none')
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'inline');
+ else
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'none');
+}
+
+function close_missing_menu(spr){
+ $('[id="table_missings_menu_'+spr+'"]').last().css('display', 'none');
+}
+
// preklopi ordinalno/nominalno skalo
function scale_ordnom(spremenljivka, value) {
$('#branching_' + spremenljivka).load('ajax.php?t=branching&a=scale_ordnom', {spremenljivka: spremenljivka, value: value, anketa: srv_meta_anketa_id}, function () {
- $('input[type="radio"][name="skala"]').not(':checked').prop("checked", true, function () {
+
+ //as radio
+ /* $('input[type="checkbox"][name="skala"]').not(':checked').prop("checked", true, function () {
vprasanje_save();
- });
+ }); */
+
+ //as checkbox
+ if(value == 1){
+ $('input[type="checkbox"][name="skala"]').prop("checked", false, function () {
+ vprasanje_save();
+ });
+ }
+ else {
+ $('input[type="checkbox"][name="skala"]').prop("checked", true, function () {
+ vprasanje_save();
+ });
+ }
+
show_scale_text(value);
});
}
@@ -2144,7 +2246,7 @@ function expandCollapseAllPlusMinus(what) {
var id = $(this).attr('id').replace('branching_if', '');
- var a = $('#branching_if' + id + ' a.pm');
+ var a = $('#branching_if' + id + ' span.pm');
if (what == 'expand') {
// blok/if je skrit
@@ -2184,12 +2286,6 @@ function branch_brisi_grupo(id, text) {
}
}
-// document ready funkcijo sem prestavil na vrh strani, da je vse skupaj
-
-function centerDiv2Page(id) {
- return false;
-}
-
// prestevilci anketo v branchingu
function prestevilci() {
@@ -2220,10 +2316,9 @@ function alert_close_block() {
}
// hitre nastavitve
-function quick_settings(spremenljivka, results, what) {
+function quick_settings(results, what) {
var status1 = $('#form_settings_obvescanje').css('display');
- //var status2 = $('#form_settings_vabila').css('display');
if (what == 'finish_author' || what == 'finish_respondent_cms' || what == 'finish_respondent' || what == 'finish_other') {
if (results.checked == true)
@@ -2232,23 +2327,18 @@ function quick_settings(spremenljivka, results, what) {
results = 0;
}
- //$("#simple").load('ajax.php?a=form_settings', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, results: results, what: what});
- //$.post('ajax.php?a=form_settings', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, results: results, what: what});
-
$("#quick_settings").load('ajax.php?t=branching&a=edit_quick_settings', {
anketa: srv_meta_anketa_id,
- spremenljivka: spremenljivka,
results: results,
what: what,
- status1: status1,
- status2: status2
+ status1: status1
});
- if (what == 'finish_respondent')
+ /*if (what == 'finish_respondent')
$("#branching").load('ajax.php?t=branching&a=refresh_left', {
anketa: srv_meta_anketa_id,
spremenljivka: spremenljivka
- });
+ });*/
}
function calculation_edit_variable(spremenljivka) {
@@ -2522,7 +2612,6 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_' + spremenljivka).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_' + spremenljivka).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2530,7 +2619,6 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2550,12 +2638,10 @@ function slider_edit_init(spremenljivka, min, max, def, slider_handle, slider_ha
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
@@ -2669,7 +2755,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
//globalne spremenljivke, ki so potrebne za posodobitev drsnika v prevodih - konec
$("#variabla_limit_" + spremenljivka).css('display', 'none');
- //$("input[name^='foo_" + spremenljivka + "']").parent().css('display', 'none'); //pokomnetiral zaradi skrivanja missing-ov
var minmaxlabela = "label";//hrani nastavitev za minmax labele
var rest = false; //hrani nastavitve za vmesne črtice z ("label") in brez label ("pip") ter odsotnost črtic (false)
@@ -2693,7 +2778,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_prevajanje' + spremenljivka).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2701,7 +2785,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_prevajanje' + spremenljivka).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2721,12 +2804,10 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
@@ -2735,14 +2816,6 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
rest = "label";
}
-/* if(tip_vmesne_descr_labele != 0 && prevod==''){ //ce se je izbralo prednalozene vmesne opisne labele in ni prevoda
- vmesne_opisne_labele = vmesne_descr_labele.split(";");
- max = vmesne_opisne_labele.length-1;
- }else if((slider_VmesneDescrLabel)||(tip_vmesne_descr_labele != 0 && prevod)){ //ce se je izbralo Brez oz. custom opisne labele ALI se je izbralo prednalozene vmesne opisne labele in je prevod
- vmesne_opisne_labele = slider_CustomDescriptiveLabels.split(";");
- max = vmesne_opisne_labele.length;
- } */
-
if((slider_VmesneDescrLabel)||(tip_vmesne_descr_labele != 0)){ //ce se je izbralo Brez oz. custom opisne labele ALI se je izbralo prednalozene vmesne opisne labele
vmesne_opisne_labele = slider_CustomDescriptiveLabels.split(";");
max = vmesne_opisne_labele.length;
@@ -2757,7 +2830,8 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
slide: function (event, ui) {
if (slider_window_number == 0){ //ce rabimo stevilo nad handle
- // Sproti popravljamo vrednost v okencu ob slidu
+
+ // Sproti popravljamo vrednost v okencu ob slidu
$("#sliderTextbranching_" + spremenljivka).html(ui.value);
// Premikamo okencek skupaj z sliderjem
@@ -2769,12 +2843,7 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
};
// wait for the ui.handle to set its position
setTimeout(delay, 5);
- }
-
- //if (slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', '');//
- //}
-
+ }
},
// Prikazemo okencek s vrednostjo
@@ -2805,19 +2874,11 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
}
$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('left', percent_def + '%');
-
-
- //if (slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#sliderbranching_' + spremenljivka + ' .special_slider').css('visibility', '');//skrij handle
- //}
-
-
+
// Postavimo na zacetku okencek na pravo mesto
if (slider_window_number == 0){
$("#sliderTextbranching_" + spremenljivka).position({
of: $('#sliderbranching_' + spremenljivka + ' .ui-slider-handle'),
- //of: $('#sliderbranching_' + spremenljivka + ' .classic_slider'),
offset: "0, -37"
});
}
@@ -2829,7 +2890,7 @@ function slider_edit_init_prevajanje(spremenljivka, min, max, def, slider_handle
last: minmaxlabela,
labels: vmesne_opisne_labele,
});
- //$( ".selector" ).slider( "option", "value", 10 );
+
$('#sliderbranching_prevajanje' + spremenljivka).slider("option", "value", def);//postavi rocico na mesto, kjer je izracunana default vrednost
}
//*********************************************************
@@ -2868,7 +2929,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
if (nakazi_odgovore == 1 && slider_handle == 1){//ce zelimo bunke za nakazovanje odgovorov
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().removeClass("classic_slider"); //odstrani razred s klasicnimi crticami
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("circle_slider"); //dodaj razred z bunkicami za nakazovanje
- //$('#sliderbranching_' + spremenljivka + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
}
else if (nakazi_odgovore == 0 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("classic_slider"); //dodaj klasicen razred
@@ -2876,7 +2936,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
}
else if (nakazi_odgovore == 1 && slider_handle == 0){ //drugace
$('#sliderbranching_' + spremenljivka + '_' + vrednost).slider().addClass("elipse_slider"); //dodaj klasicen razred
- //$('#sliderbranching_' + spremenljivka).slider().removeClass("circle_slider"); //odstrani razred circle slider
}
//konec ureditve bunk in elips za nakazovanje moznih odgovorov
@@ -2972,11 +3031,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
}
$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('left', percent_def + '%');
- //if($('#slider_handle_'+spremenljivka+' option:selected').val() == 2){//ce si zelimo skriti handle
- //if(slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#slider_' + spremenljivka + ' .ui-slider-handle.ui-state-default.ui-corner-all').css('visibility', 'hidden');//skrij handle
- //}
if (slider_window_number == 0){
// Postavimo na zacetku okencek na pravo mesto
$("#sliderTextbranching_" + spremenljivka + "_" + vrednost).position({
@@ -2986,8 +3040,6 @@ function slider_edit_grid_init(spremenljivka, vrednost, min, max, def, vmesne_la
});
}
}
-
- //});
})
.slider("pips",{
rest: rest,
@@ -3072,11 +3124,9 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
if (vmesne_Crtice == 1){//ce je potrebno pokazati vmesne črtice
rest = "pip";
- //console.log('Črtice');
}
else if (vmesne_Crtice == 0) {
rest = false;
- //console.log('Brez črtic');
}
//if (vmesne_labels == 1) {
@@ -3146,11 +3196,6 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
}
$('#sliderbranching_prevajanje' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('left', percent_def + '%');
- //if($('#slider_handle_'+spremenljivka+' option:selected').val() == 2){//ce si zelimo skriti handle
- //if(slider_handle == 1){//ce si zelimo skriti handle
- //$('#sliderbranching_' + spremenljivka + '_' + vrednost + ' .ui-slider-handle').css('visibility', 'hidden');//skrij handle
- //$('#slider_' + spremenljivka + ' .ui-slider-handle.ui-state-default.ui-corner-all').css('visibility', 'hidden');//skrij handle
- //}
if (slider_window_number == 0){
// Postavimo na zacetku okencek na pravo mesto
$("#sliderTextbranching_" + spremenljivka + "_" + vrednost).position({
@@ -3160,8 +3205,6 @@ function slider_edit_grid_init_prevajanje(spremenljivka, vrednost, min, max, def
});
}
}
-
- //});
})
.slider("pips",{
rest: rest,
diff --git a/admin/survey/script/break.js b/admin/survey/script/break.js
index f0603d5..018666a 100644
--- a/admin/survey/script/break.js
+++ b/admin/survey/script/break.js
@@ -3,18 +3,23 @@ function break_init() {
function breakSpremenljivkaChange() {
+
// drugi dropdown
var spr = $('#breakSpremenljivka').val();
var seq = $("#breakSpremenljivka option:selected").attr('seq');
+
$("#breakResults").html('');
+
$("#breakResults").load("ajax.php?t=break&a=spremenljivkaChange", {anketa:srv_meta_anketa_id, spr:spr, seq:seq}, function() {
$("#breakResults").fadeTo(100, 1);
}).show();
}
function change_break_percent () {
+
var break_percent = $("#break_percent").is(':checked');
var crossChk1 = break_percent;
+
//ponastavimo tudi za crostabe
$.post("ajax.php?t=crosstab&a=change_cb_percent", {anketa:srv_meta_anketa_id, crossChk1:crossChk1}, function() {
$.post("ajax.php?t=break&a=change_break_percent", {anketa:srv_meta_anketa_id, break_percent:break_percent}, function() {
@@ -31,6 +36,7 @@ function change_break_charts (break_charts) {
}
function doArchiveBreak() {
+
//preverimo ali obstaja vsebina breakResults
if ($("#breakResults").length > 0 && $("#breakResults").html() != '') {
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
@@ -38,11 +44,14 @@ function doArchiveBreak() {
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
+
function submitArchiveBreak() {
+
//preverimo ali obstaja vsebina meansa
if ($("#breakResults").html().length > 0 ) {
var content = $("#breakResults").html();
@@ -55,33 +64,40 @@ function submitArchiveBreak() {
$("#fullscreen").load('ajax.php?a=submitArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, name:name, note:note, access:access, duration:duration, durationType:durationType, content:content}, function() {
$("#fullscreen").show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
function createArchiveBreakBeforeEmail() {
+
//preverimo ali obstaja vsebina breakResults
if ($("#breakResults").html().length > 0 ) {
+
var content = $("#breakResults").html();
+
$.post('ajax.php?a=createArchiveBeforeEmail', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, content:content}, function(response) {
if (parseInt(response) > 0) {
var aid = parseInt(response);
$("#fullscreen").load('ajax.php?a=emailArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, aid:aid}, function() {
$('#fullscreen').show();
});
- } else {
+ }
+ else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
- } else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
+ }
+ else {
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
}
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/cReport.js b/admin/survey/script/cReport.js
index 9159b6e..c421d23 100644
--- a/admin/survey/script/cReport.js
+++ b/admin/survey/script/cReport.js
@@ -7,8 +7,8 @@ function creport_init () {
// sortable za custom report
$('.report_element').live('mouseover', function (event) {
$('#custom_report_sortable').sortable({
- items: 'li',
- handle: '.report_element_title',
+ items: 'li.report_element_standard, li.report_element_break',
+ handle: '.report_element_head',
opacity: 0.8,
revert: true,
create:function(){
@@ -32,18 +32,23 @@ function creport_init () {
});
$(".report_element_separator").live({
+
mouseenter: function(){
- $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:1}, 500);
+ //}
},
mouseleave: function(){
- $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //if(!$(this).hasClass('last_separator')){
+ $(this).find('.add_element').stop().animate({opacity:0}, 500);
+ //}
}
});
// click report elementa
- $(".report_element_title").live("click", function(event) {
+ $(".report_element_head").live("click", function(event) {
- var element = $(this).parent().parent();
+ var element = $(this).parent();
var id = $(element).attr('id').substr(15);
expandCustomReportElement(id);
@@ -218,6 +223,7 @@ function addPBCustomReportElement(id) {
// zbrise element iz custom reporta
function deleteCustomReportElement(element_id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=delete_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:element_id});
+ event.stopPropagation();
}
// razsirjanje elementa v custom reportu
@@ -260,6 +266,7 @@ function editCustomReportTTestVar(id) {
// kopiranje elementa v custom reportu
function copyCustomReportElement(id) {
$('#anketa_custom_report').load('ajax.php?t=custom_report&a=copy_element', {anketa: srv_meta_anketa_id, expanded: global_expanded, element_id:id});
+ event.stopPropagation();
}
function printCustomReportElement(ime, id){
@@ -280,6 +287,8 @@ function printCustomReportElement(ime, id){
newWin.focus();
newWin.document.close();
+
+ event.stopPropagation();
}
// alert za dodajanje vseh elementov istega tipa v custom report
@@ -340,28 +349,14 @@ function addCustomReportAllElements(type) {
* nastavi editor na contenteditable element za naslov
*/
function creport_load_editor (_this) {
-
- /*$(_this).css('display', 'none');
- var el = $(_this).parent().find('.creport_textarea');
-
- var el_id = el.attr('el_id');
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
- create_editor('report_element_texteditor_'+el_id);*/
-
-
-
$(_this).css('display', 'none');
var el = $(_this).parent().find('.creport_text_inline');
var el_id = el.attr('el_id');
-
-
- el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:99%">'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="creport_save_editor(\''+el_id+'\'); return false;"><span>'+lang['save']+'</span></a></span>');
+ el.replaceWith('<textarea id="report_element_texteditor_'+el_id+'" class="creport_textarea" style="width:100%">'+el.html()+'</textarea>'+
+ '<div class="button_holder below"><button class="medium blue" onclick="creport_save_editor(\''+el_id+'\'); return false;">'+lang['save']+'</button></div>');
create_editor('report_element_texteditor_'+el_id);
}
@@ -370,17 +365,7 @@ function creport_load_editor (_this) {
* shrani editor in nastavi nazaj contenteditable
*/
function creport_save_editor(el_id) {
-
- /*get_editor_close('report_element_texteditor_'+el_id);
-
- var el = $('#report_element_texteditor_'+el_id);
- var parent = el.parent();
-
- el.replaceWith('<textarea style="width:90%; height: 80px;" class="creport_textarea" el_id="'+el_id+'" id="report_element_text_'+el_id+'" onBlur="editCustomReportElement('+el_id+', text, this.value)">');
- parent.find('span.buttonwrapper').remove();
-
- editCustomReportElement(el_id, 'text', el.val());*/
-
+
get_editor_close('report_element_texteditor_'+el_id);
var el = $('#report_element_texteditor_'+el_id);
@@ -402,13 +387,14 @@ function doArchiveCReport() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
+
function submitArchiveCReport() {
+
//preverimo ali obstaja vsebina meansa
if ($("#custom_report_elements").html().length > 0 ) {
- //var content = $("#custom_report_elements").html();
var name = $("#newAnalysisArchiveName").val();
var note = $("#newAnalysisArchiveNote").val();
@@ -418,8 +404,9 @@ function submitArchiveCReport() {
$("#fullscreen").load('ajax.php?a=submitArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, name:name, note:note, access:access, duration:duration, durationType:durationType}, function() {
$("#fullscreen").show();
});
- } else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ }
+ else {
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -435,9 +422,9 @@ function createArchiveCReportBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -445,7 +432,7 @@ function createArchiveCReportBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
@@ -458,15 +445,11 @@ function showCReportPreview() {
recipe.document.write('<html><head><title>Predogled poro&#269;ila po meri</title>');
- recipe.document.write('<link rel="stylesheet" href="css/style_font.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_basic.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_main.css">');
- recipe.document.write('<link rel="stylesheet" href="css/style_new2.css">');
- recipe.document.write('<link rel="stylesheet" href="css/print.css">');
+ recipe.document.write('<link rel="stylesheet" href="minify/g=css">');
recipe.document.write('<link rel="stylesheet" href="css/style_print.css" media="print">');
-
+
recipe.document.write('<style>');
- recipe.document.write('.container {margin-bottom:45px;} #navigationBottom {width: 100%; background-color: #f2f2f2; border-top: 1px solid gray; height:25px; padding: 10px 30px 10px 0px !important; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;}');
+ recipe.document.write('ul{margin: 16px; padding: 0; list-style-type: none;} li{margin:16px 0;} .container {margin-bottom:45px;} #navigationBottom {width: 100%; margin-bottom: 16px; padding-right: 16px;}');
recipe.document.write('</style>');
recipe.document.write('</head><body>');
@@ -516,6 +499,16 @@ function use_creport_profile() {
});
}
+// Preklopimo porocilo
+function change_creport_profile(profile_id, author) {
+
+ $.post('ajax.php?t=custom_report&a=use_creport_profile', {anketa:srv_meta_anketa_id, id:profile_id, author:author}, function(){
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=analysis&m=analysis_creport&expanded='+global_expanded;
+ window.location.href = srv_site_url;
+ });
+}
+
// popravljamo custom report profil
function creport_profile_action(action){
diff --git a/admin/survey/script/calendar/calendar.js b/admin/survey/script/calendar/calendar.js
index 1dbcef4..8272439 100644
--- a/admin/survey/script/calendar/calendar.js
+++ b/admin/survey/script/calendar/calendar.js
@@ -641,7 +641,7 @@ Calendar.cellClick = function(el, ev) {
"Thank you!\n" +
"http://dynarch.com/mishoo/calendar.epl\n";
}
- alert(text);
+ genericAlertPopup('alert_parameter_text');
return;
case -2:
if (year > cal.minYear) {
diff --git a/admin/survey/script/charts.js b/admin/survey/script/charts.js
index 3d64bb7..2451e4e 100644
--- a/admin/survey/script/charts.js
+++ b/admin/survey/script/charts.js
@@ -264,7 +264,7 @@ function chartSaveAdvancedSettings (spid, loop) {
var checkEmpty = chartAdvancedSettingsLimitEmpty();
if(checkEmpty == true){
- alert(lang['srv_chart_num_limit_warning']);
+ genericAlertPopup('srv_chart_num_limit_warning');
}
else{
$.post('ajax.php?t=charts&a=chart_save_advanced_settings', form, function(data) {
@@ -280,10 +280,10 @@ function chartSaveAdvancedSettings (spid, loop) {
// prikaze napredno urejanje grafa
function chartTabAdvancedSettings (tab) {
- $('.chartSettingsArea').css('visibility', 'hidden');
+ $('.chartSettingsArea').addClass("displayNone");
$('.chartTab').removeClass('active');
- $('#chartSettingsArea'+tab).css('visibility', 'visible');
+ $('#chartSettingsArea'+tab).removeClass("displayNone");
$('#chartTab'+tab).addClass('active');
}
@@ -500,9 +500,11 @@ function tableChartSaveAdvancedSettings (chartID) {
function edit_labels(val){
if(val == 0) {
$('.chart_editing :input').attr('disabled', true);
+ $('#title_edit').addClass('gray');
}
else {
$('.chart_editing :input').removeAttr('disabled');
+ $('#title_edit').removeClass('gray');
}
}
diff --git a/admin/survey/script/collectData.js b/admin/survey/script/collectData.js
index 704e054..da91e99 100644
--- a/admin/survey/script/collectData.js
+++ b/admin/survey/script/collectData.js
@@ -24,7 +24,7 @@ function collectDataAjax(){
location.reload();
}
else{
- alert(lang['srv_collectdata_failed']);
+ genericAlertPopup('srv_collectdata_failed');
}
}
});
diff --git a/admin/survey/script/comments.js b/admin/survey/script/comments.js
new file mode 100644
index 0000000..9ada2b4
--- /dev/null
+++ b/admin/survey/script/comments.js
@@ -0,0 +1,198 @@
+
+// Prikaze popup v urejanju ankete (spodnja vrstica pod vsakim vprasanjem - 3 gumbi)
+function openCommentPopupInline (type, spremenljivka) {
+
+ // Vse odprte najprej zapremo
+ $('.comment_inline_popup').addClass('displayNone');
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_inline_add_"+spremenljivka).removeClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_inline_editor_"+spremenljivka).removeClass('displayNone');
+ }
+ // komentarji respondentov
+ else if (type==3){
+ $("#comment_inline_respondent_"+spremenljivka).removeClass('displayNone');
+ }
+}
+
+// Zapre popupe v urejanju ankete (spodnja vrstica pod vsakim vprasanjem - 3 gumbi)
+function closeCommentPopupInline (type, spremenljivka) {
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_inline_add_"+spremenljivka).addClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_inline_editor_"+spremenljivka).addClass('displayNone');
+ }
+ // komentarji respondentov
+ else if (type==3){
+ $("#comment_inline_respondent_"+spremenljivka).addClass('displayNone');
+ }
+}
+
+// Prikaze popup v urejanju ankete (spodnja vrstica pod vsakim pogojem - 2 gumba)
+function openIfCommentPopupInline (type, if_id) {
+
+ // Vse odprte najprej zapremo
+ $('.comment_inline_popup').addClass('displayNone');
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_if_inline_add_"+if_id).removeClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_if_inline_editor_"+if_id).removeClass('displayNone');
+ }
+}
+
+// Zapre popupe v urejanju ankete (spodnja vrstica pod vsakim pogojem - 2 gumba)
+function closeIfCommentPopupInline (type, if_id) {
+
+ // dodaj komentar
+ if (type==1){
+ $("#comment_if_inline_add_"+if_id).addClass('displayNone');
+ }
+ // komentarji urednikov
+ else if (type==2){
+ $("#comment_if_inline_editor_"+if_id).addClass('displayNone');
+ }
+}
+
+
+function toggleCommentDropdown () {
+ $("#comment_dropdown").toggleClass('displayNone');
+}
+
+function toggleCommentDropdownTestSurvey () {
+ $("#comment_dropdown_test_survey").toggleClass('displayNone');
+ $(".open_comment_box").toggleClass('active');
+}
+
+function toggleCommentOptions(id) {
+ $("#options_"+id).toggleClass("displayNone");
+}
+
+
+var siteurl = '';
+if ( typeof srv_site_url !== 'undefined' ) { // komentarji v izpolnjevanju ankete
+ siteurl = srv_site_url + '/admin/survey/';
+}
+
+// doda komentar in osvezi oblacek
+// type=0 : anketa, type=1 : vprasanje
+function add_comment (spremenljivka, type, view, vsebina) {
+
+ $('div#survey_comment_'+spremenljivka+'_'+view).load(siteurl+'ajax.php?t=branching&a=comment_manage', {type: type, view: view, spremenljivka: spremenljivka, vsebina: vsebina, anketa: srv_meta_anketa_id, refresh: '1'},
+ function () {
+
+ // V predogledu izpisemo samo text da je bil uspesno dodan
+ if(view == 1 && (type == 0 || type == 4)){
+ $('#comment_dropdown_test_survey').html('<div class="success">'+lang['action_note_comment_added']+'</div>');
+ }
+ // pri opciji Dodaj komentar (urejanje vprasalnika - pod vsakim vprasanjem), skrijemo oblacek po submitu
+ else if (view == 0) {
+ $(".comment_inline_popup").addClass('displayNone');
+ }
+ else if (view == 4 || view == 5) {
+ window.location.reload();
+ }
+ }
+ );
+}
+
+// nastavi podanemu linku (a.surveycomment) oblacek za komentarje
+function load_comment (__this, show) {
+ if (show == 1) { // opcije za takrat, ko je po defaultu ze na zacetku prikazan - za dodat komentar na anketo
+ _when = false;
+ _ready = true;
+ var corners = ['leftMiddle', 'leftMiddle'];
+ var opposites = ['rightMiddle', 'rightMiddle'];
+ } else if (show == 2) { // opcija za takrat, ko se aktivira preko oblacka, ko se prikaze takoj
+ _when = 'click';
+ _ready = true;
+ var corners = ['topRight', 'topRight'];
+ var opposites = ['bottomLeft', 'bottomLeft'];
+ } else { // default za normalne komentarje, da se odpre na klik
+ _when = 'click';
+ _ready = false;
+ var corners = ['topLeft', 'topRight'];
+ var opposites = ['bottomRight', 'bottomLeft'];
+ }
+
+ var width = $(document).width();
+ // nastavitve za help
+
+ // preverimo ali prikažemo tip na levo stran
+ var position = $(__this).offset(); // position = { left: 42, top: 567 }
+
+ var left = width - position.left;
+
+ var i = (left >= 350) ? 0 : 1;
+
+ if ($(__this).data("qtip")) {
+ $(__this).qtip("destroy");
+ $('div.qtip').html('');
+ }
+
+ // Posebej naslov ce smo v urejanju
+ if($(__this).attr('view') == '1' && !show && $('#comment_qtip_title').length > 0 && $(__this).attr('subtype') == undefined){
+ var naslov = $('#comment_qtip_title').val();
+ }
+ // komentar na vprasanje
+ else if($(__this).attr('subtype') == 'q_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_q_title'];
+ }
+ // komentar na if
+ else if($(__this).attr('subtype') == 'if_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_if_title'];
+ }
+ // komentarji na if
+ else if($(__this).attr('subtype') == 'if_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_if_all_title'];
+ }
+ // komentar na blok
+ else if($(__this).attr('subtype') == 'blok_admin_add'){
+ var naslov = lang['srv_testiranje_komentar_blok_title'];
+ }
+ // komentarji na blok
+ else if($(__this).attr('subtype') == 'blok_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_blok_all_title'];
+ }
+ // komentarji na vprasanja
+ else if($(__this).attr('subtype') == 'q_admin_all'){
+ var naslov = lang['srv_testiranje_komentar_q_all_title'];
+ }
+ // komentarji respondentov na vprasanja
+ else if($(__this).attr('subtype') == 'q_resp_all'){
+ var naslov = lang['srv_testiranje_komentar_q_resp_all_title'];
+ }
+ else{
+ var naslov = lang['srv_testiranje_komentarji_anketa_title2'];
+ }
+
+ $(__this).qtip({
+ content: {text: '<div class="qtip_comment"><h1>'+naslov+'</h1><div id="survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')+'"></div></div>', title: {button: '&#x2715;'}},
+ fixed: false, show: {when: _when, ready: _ready, solo: true},hide: {when: 'click'},
+ style: {name: 'light', border: {width: 3, radius: 8}, width: 350, tip: {corner: corners[i]}},
+ position: {corner: {tooltip: corners[i], target: opposites[i] }, adjust: {screen : true}},
+ api: {
+ beforeShow: function () {
+ // tuki se poklice zato, ker se drugace content: {url: ....} ne refresha, ce zapres in spet odpres oblacek
+ _comment = 1;
+ $('div#survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')).load(siteurl+'ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: $(__this).attr('type'), view: $(__this).attr('view'), spremenljivka: $(__this).attr('spremenljivka'), vsebina: '', anketa: srv_meta_anketa_id, refresh: '1'});
+ },
+ onShow: function () {
+ $('div.qtip').draggable();
+ }
+ }
+ });
+
+}
+var _comment = 0; \ No newline at end of file
diff --git a/admin/survey/script/conditionProfiles.js b/admin/survey/script/conditionProfiles.js
index a56c697..240aaf4 100644
--- a/admin/survey/script/conditionProfiles.js
+++ b/admin/survey/script/conditionProfiles.js
@@ -54,7 +54,7 @@ function conditionProfileAction(action) {
// dropdownu dodamo nov prodil in ga izberemo
$("#current_condition_profile").append( $("<option></option>").attr("value", newId).attr( "selected", true).text(name));
} else {
- alert('Error!');
+ genericAlertPopup('error');
}
});
@@ -106,5 +106,5 @@ function conditionProfileAction(action) {
$.post('ajax.php?t=conditionProfile&a=change_condition_profile', { anketa : srv_meta_anketa_id, pid : pid, meta_akcija : srv_meta_akcija, podstran : srv_meta_podstran, condition_label:condition_label, condition_error:condition_error }, function() {
return reloadData('condition');
});
- } else {alert('Missing action:'+action)};
+ } else {genericAlertPopup('alert_missing_action',action)};
} \ No newline at end of file
diff --git a/admin/survey/script/crosstab.js b/admin/survey/script/crosstab.js
index e2bb144..78b2ac9 100644
--- a/admin/survey/script/crosstab.js
+++ b/admin/survey/script/crosstab.js
@@ -14,12 +14,6 @@ function add_new_variable(which) {
var spr = new Array();
var grid = new Array();
- if (which == '2' ) {
- //$('#crossRightHolder #crosstab_add_new').hide();
- } else {
- //$('#crossLeftHolder #crosstab_add_new').hide();
- }
-
$('select[name=crosstab_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
@@ -32,19 +26,17 @@ function add_new_variable(which) {
$.post("ajax.php?t=crosstab&a=add_new_variable", {anketa:srv_meta_anketa_id, which:which, sequence:sequence, spr:spr, grid:grid, crossNavVsEno:crossNavVsEno}, function(response) {
if (which == '2' ) {
- $(response).appendTo('#crossRightHolder');
+ $(response).appendTo('#crossRightDropdowns');
} else {
- $(response).appendTo('#crossLeftHolder');
+ $(response).appendTo('#crossLeftDropdowns');
}
});
}
function crs_remove_variable(what) {
- $(what).parent().remove();
- if ( $(what).parent().find('select').val() > 0 ) {
- change_crosstab();
- }
+ $(what).parent().parent().remove();
+ change_crosstab();
}
function change_crosstab (action) {
@@ -108,7 +100,7 @@ function change_crosstab (action) {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
$("#crosstab_drobdowns").load("ajax.php?t=crosstab&a=changeDropdown", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
spr1:spr1, spr2:spr2 , crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2}, function() {
if (isNaN(spr1) && isNaN(spr2)) {
@@ -117,7 +109,7 @@ function change_crosstab (action) {
});
} else {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
}
});
@@ -125,7 +117,7 @@ function change_crosstab (action) {
function change_crosstab_cb () {
$("#crosstab_drobdowns").fadeTo(100, 0.2);
- $("#crosstab_table").fadeTo(100, 0.2);
+ $("#crosstab_tables").fadeTo(100, 0.2);
// prebereomo dropdown variabli
@@ -149,12 +141,12 @@ function change_crosstab_cb () {
var crossNavVsEno = $('#crossNavVsEno1').is(':checked') ? '1' : '0';
- $("#crosstab_table").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
+ $("#crosstab_tables").load("ajax.php?t=crosstab&a=change_cb", {anketa:srv_meta_anketa_id, sequence1:sequence1, sequence2:sequence2,
//crossChk0:crossChk0, crossChk1:crossChk1, crossChk2:crossChk2, crossChk3:crossChk3,
//crossChkEC:crossChkEC, crossChkRE:crossChkRE,crossChkSR:crossChkSR,crossChkAR:crossChkAR, doColor:doColor,
spr1:spr1, spr2:spr2, crossNavVsEno:crossNavVsEno, grid1:grid1, grid2:grid2 }, function () {
$("#crosstab_drobdowns").fadeTo(100, 1);
- $("#crosstab_table").fadeTo(100, 1);
+ $("#crosstab_tables").fadeTo(100, 1);
});
}
@@ -203,20 +195,20 @@ function doInspectFromCrosstab(el,event) {
function doArchiveCrosstab() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function createArchiveCrosstabBeforeEmail() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -230,9 +222,9 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -240,13 +232,13 @@ function createArchiveCrosstabBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveCrosstabs() {
//preverimo ali obstaja vsebina crosstaba
- if ($("#crosstab_table").length > 0 && $("#crosstab_table").html() != '') {
- var content = $("#crosstab_table").html();
+ if ($("#crosstab_tables").length > 0 && $("#crosstab_tables").html() != '') {
+ var content = $("#crosstab_tables").html();
//global replace
var regex = new RegExp('ct_inspect', "g");
content = content.replace(regex, '');
@@ -263,7 +255,7 @@ function submitArchiveCrosstabs() {
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
diff --git a/admin/survey/script/customizeImageView.js b/admin/survey/script/customizeImageView.js
index fd8fb41..7969324 100644
--- a/admin/survey/script/customizeImageView.js
+++ b/admin/survey/script/customizeImageView.js
@@ -119,7 +119,7 @@ function customizeImageView4Respondent(tip, spremenljivka, vre_id, ajax, anketa,
}
//ureditev visine kategorije (div) glede na prisotnost slike ali vecvrsticnega teksta **************************************************
- var default_cat_height = 15;
+ var default_cat_height = 30;
var final_height = 0;
//var cat_text_length = $('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).text().length; //hrani stevilo znakov, ki so vpisani v trenutni kategoriji odgovora
var cat_text_length = $('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).html().length; //hrani stevilo znakov, ki so vpisani v trenutni kategoriji odgovora
@@ -222,6 +222,7 @@ function customizeImageView4Respondent(tip, spremenljivka, vre_id, ajax, anketa,
if (final_height != 0){
$('#spremenljivka_'+spremenljivka+'_vrednost_'+vre_id).css({'height':final_height}); //dodaj style atributu še novo višino za levi blok
}
+ //console.log(final_height);
//ureditev visine kategorije (div) glede na prisotnost slike ali vecvrsticnega teksta - konec********************************************
//ureditev visine celotnega vprasanja****************************************************************************************************
@@ -274,6 +275,23 @@ function question_height_ranking(spremenljivka){
//console.log("final_height: "+final_height);
}
+function frame_height_ranking (ui, spremenljivka){
+ var trenutna_visina_prenesenega = ui.item.height();
+ console.log(trenutna_visina_prenesenega);
+ //console.log('drugo');
+ var trenutni_okvir = $('#half2_'+spremenljivka);
+ var stevilo_prisotnih = trenutni_okvir.children('div').length;
+ console.log(stevilo_prisotnih);
+ var i = 0;
+ trenutni_okvir.siblings().children('li').children('div').each(function(){ //preleti prazne okvirje
+ i = i + 1;
+ if(stevilo_prisotnih == i){
+ $(this).height(trenutna_visina_prenesenega);
+ //console.log(i);
+ }
+ });
+}
+
function frame_height_ranking_premikanje_dyn (ui, spremenljivka){
var trenutna_visina_prenesenega = ui.item.height();
var trenutni_okvir = $('#sortzone_'+spremenljivka);
diff --git a/admin/survey/script/dataSettingProfiles.js b/admin/survey/script/dataSettingProfiles.js
index df3c624..0b79cb1 100644
--- a/admin/survey/script/dataSettingProfiles.js
+++ b/admin/survey/script/dataSettingProfiles.js
@@ -139,7 +139,7 @@ function dataSettingProfileAction(action) {
var chartPieZeros = $("#chartPieZeros").is(':checked') ? '1' : '0';
var hideEmpty = $("#hideEmpty").is(':checked') ? '1' : '0';
var hideAllSystem = $("#hideAllSystem").is(':checked') ? '1' : '0';
- var numOpenAnswers = $("#numOpenAnswers").val();
+ var numOpenAnswers = $("#dsp_content #numOpenAnswers").val();
// var enableInspect = $('input[name="enableInspect"]:checked').val();
var dataPdfType = $('#dataPdfType').val();
var exportDataNumbering = $("#exportDataNumbering").is(':checked') ? '1' : '0';
@@ -157,7 +157,7 @@ function dataSettingProfileAction(action) {
var dataShowIcons = $('input[name="dataShowIcons"]:checked').val();
var analysisGoTo = $('#analysisGoTo').val();
var analiza_legenda = $("#analiza_legenda").is(':checked') ? '1' : '0';
-
+
$.post("ajax.php?t=dataSettingProfile&a=saveProfile", {anketa:srv_meta_anketa_id, pid:pid, dsp_ndp:dsp_ndp, dsp_nda:dsp_nda, dsp_ndd:dsp_ndd, dsp_res:dsp_res, dsp_sep:dsp_sep,
crossChk0:crossChk0, crossChk1:crossChk1, crossChk2:crossChk2, crossChk3:crossChk3,
crossChkEC:crossChkEC, crossChkRE:crossChkRE, crossChkSR:crossChkSR, crossChkAR:crossChkAR, doColor:doColor, doValues:doValues,
@@ -171,7 +171,7 @@ function dataSettingProfileAction(action) {
return reloadData('dataSetting');
});
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
return false;
}
}
diff --git a/admin/survey/script/datatables/jquery.dataTables.min.css b/admin/survey/script/datatables/jquery.dataTables.min.css
index 2e710c3..ea45ffe 100644
--- a/admin/survey/script/datatables/jquery.dataTables.min.css
+++ b/admin/survey/script/datatables/jquery.dataTables.min.css
@@ -1 +1 @@
-table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
+table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png")}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png")}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#ffffff}table.dataTable tbody tr.selected{background-color:#B0BED9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px 4px 4px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{margin-left:0.5em}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:0.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:0.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:0.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:-o-linear-gradient(top, #fff 0%, #dcdcdc 100%);background:linear-gradient(to bottom, #fff 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));background:-webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:-o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);background:linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:0.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:0.5em}}
diff --git a/admin/survey/script/datepicker.js b/admin/survey/script/datepicker.js
index 8fc4a10..ca340fc 100644
--- a/admin/survey/script/datepicker.js
+++ b/admin/survey/script/datepicker.js
@@ -17,8 +17,6 @@ function datepicker (selector, event_trigger, datetime) {
dateFormat: "dd.mm.yy",
showAnim: "slideDown",
showOn: "button",
- /*buttonImage: srv_site_url + "admin/survey/script/calendar/calendar.gif",
- buttonImageOnly: true,*/
buttonText: "",
controlType: 'select',
oneLine: true,
@@ -42,9 +40,7 @@ function datepicker (selector, event_trigger, datetime) {
changeYear: true,
dateFormat: "dd.mm.yy",
showAnim: "slideDown",
- showOn: "button",
- /*buttonImage: srv_site_url + "admin/survey/script/calendar/calendar.gif",*/
- /*buttonImageOnly: true,*/
+ showOn: "both",
buttonText: "",
onSelect: function(selected,evnt) {
if (event_trigger) {
diff --git a/admin/survey/script/domainChange.js b/admin/survey/script/domainChange.js
new file mode 100644
index 0000000..2ab3f90
--- /dev/null
+++ b/admin/survey/script/domainChange.js
@@ -0,0 +1,28 @@
+
+// Prikaz popupa za preklop domene
+function popupSwitch() {
+
+ $('#fade').fadeTo('slow', 1);
+ $("#popup_user_access").load('ajax.php?t=domainChange&a=displaySwitchPopup');
+ $("#popup_user_access").show();
+}
+
+// Prikaz popupa za preklop domene - zapri
+function popupSwitch_close() {
+
+ $("#popup_user_access").html().hide();
+ $('#fade').fadeOut('slow');
+}
+
+//
+function popupSwitch_save(switch_status){
+
+ $.post('ajax.php?t=domainChange&a=setSwitchStatus', {switch_status:switch_status}, function (response) {
+
+ var data = JSON.parse(response);
+
+ if(data['action'] == 'switch_domain'){
+ window.location = data['url'];
+ }
+ });
+} \ No newline at end of file
diff --git a/admin/survey/script/dostop.js b/admin/survey/script/dostop.js
index 95c634b..f16083f 100644
--- a/admin/survey/script/dostop.js
+++ b/admin/survey/script/dostop.js
@@ -326,7 +326,7 @@ $(document).ready(function () {
},
fnInitComplete : function() {
if ($(this).find('tbody tr td').hasClass('dataTables_empty')) {
- $(this).parent().parent().hide();
+ //$(this).parent().parent().hide();
}
}
});
diff --git a/admin/survey/script/folders.js b/admin/survey/script/folders.js
index bafbac3..5cb69b3 100644
--- a/admin/survey/script/folders.js
+++ b/admin/survey/script/folders.js
@@ -102,7 +102,7 @@ function folders_myknjiznica (anketa) {
function language_change (lang) {
$.post('ajax.php?t=surveyList&a=language_change', {lang: lang}, function () {
- /*window.location.reload();*/
- window.location = window.location.href.split("?")[0];
+ window.location.reload();
+ //window.location = window.location.href.split("?")[0];
});
} \ No newline at end of file
diff --git a/admin/survey/script/inspect.js b/admin/survey/script/inspect.js
index 304d9c7..e8088f6 100644
--- a/admin/survey/script/inspect.js
+++ b/admin/survey/script/inspect.js
@@ -6,7 +6,7 @@ function inspect_init() {
//});
$('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=inspect&a=show_inspectListSpr', {anketa : srv_meta_anketa_id}).addClass('z-index200');
+ $("#fullscreen").load('ajax.php?t=inspect&a=show_inspectListSpr', {anketa : srv_meta_anketa_id}).addClass('z-index200').addClass('popupShadow');
});
$("#dsp_inspect_cancel").live('click', function(event) {
diff --git a/admin/survey/script/invitations.js b/admin/survey/script/invitations.js
index 05d2a56..71c36f6 100644
--- a/admin/survey/script/invitations.js
+++ b/admin/survey/script/invitations.js
@@ -19,6 +19,7 @@ function inv_delete_recipient() {
}
function editRecipient(inv_rid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_recipient', {anketa:srv_meta_anketa_id, inv_rid:inv_rid,noNavi:'true'});
}
@@ -61,7 +62,7 @@ function inv_change_import_type() {
}
function toggleInvCheckbox(what) {
var id = $(what).attr("id");
-
+
if ( $(what).is(":checked") ) {
$(what).parent().addClass('inv_field_enabled');
}
@@ -77,7 +78,7 @@ function refreshFieldsList() {
var fields_id = '';
var prefix = '';
var pass_field = false;
-
+
$('ul').children('li.inv_field_enabled').each(function(idx, elm) {
fields = fields + prefix + $(elm).find('label').html();
fields_id = fields_id + prefix + $(elm).attr('id');
@@ -116,7 +117,7 @@ function inv_save_rec_profile() {
inv_add_recipients(data.pid);
} else {
// prikažemo profil
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:data.pid });
}
});
@@ -129,7 +130,7 @@ function inv_update_rec_profile() {
var pid = $('#inv_recipients_profile_name').find('#rec_profile_pid').val();
var profile_name = $('#inv_recipients_profile_name').find('#rec_profile_name').val();
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post('ajax.php?t=invitations&a=update_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, profile_name:profile_name, noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
@@ -137,11 +138,11 @@ function inv_update_rec_profile() {
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
// osvežimo polja
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid});
} else {
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
}
});
}
@@ -163,17 +164,17 @@ function inv_add_recipients(profile_id) {
});
if (fields.length > 0) {
if (recipients_list.length > 0) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_recipients', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, pid:pid, save_profile:save_profile});
// porihtamo še navigacijo - hardcoded
$elm = $("ul.secondNavigation li.inv_ff_left_on");
$elm.prev().find('a').removeClass('active');
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -210,7 +211,7 @@ function inv_save_recipient() {
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
$("#inv_error_note").show();
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.error_email == '1') {
$("#rec_email").addClass('inv_input_error');
}
@@ -238,27 +239,29 @@ function inv_filter_recipients() {
$("#globalSettingsInner").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
else{
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
}
});
}
function inv_add_rec_to_db() {
$('#fade').fadeTo('slow', 1);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
+ $("#anketa_edit").load('ajax.php?t=invitations&a=add_users_to_database', {anketa:srv_meta_anketa_id}, function() {
$('#fade').fadeOut('slow');
});
}
function recipientsProfileOnlyThisSurvey() {
- //var checked = $("#inv_rec_only_this_survey").is(":checked");
+
var checked = $('input[name=inv_show_list_type]:checked').val() == 1 ? true : false;
+
$.post('ajax.php?t=invitations&a=only_this_survey', {anketa:srv_meta_anketa_id, checked:checked, noNavi:'true'}, function(data) {
var pid = $("#inv_import_list_profiles ol li.active").attr('pid');
if (pid == 'undefined') {
pid = '-1';
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
});
}
@@ -468,11 +471,10 @@ function invitations_init() {
// izbira obstoječega profila prejemnikov
$("#inv_import_list_profiles ol li").live('click', function(event) {
-
- var target = $(event.target);
- var pid = $(target).attr('pid');
+
+ var pid = $(this).attr('pid');
if (pid != 'undefined') {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:pid });
}
});
@@ -499,7 +501,7 @@ function invChangeMessage(mid) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=make_default',
+ $("#anketa_edit").load('ajax.php?t=invitations&a=make_default',
{anketa:srv_meta_anketa_id, mid:mid },
function(){
if (!CKEDITOR.instances) {
@@ -510,12 +512,18 @@ function invChangeMessage(mid) {
}
function invMessageDelete() {
+
var mid = $("#invitation_messages ol li.active").attr("mid");
- if (confirm(lang['srv_inv_recipients_delete_profile_confirm'])) {
+
+ if (confirm(lang['srv_inv_recipients_delete_message_confirm'])) {
+
if(CKEDITOR.instances['inv_message_body']) {
delete CKEDITOR.instances['inv_message_body'];
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ $("#anketa_edit").load('ajax.php?t=invitations&a=delete_msg_profile', {anketa:srv_meta_anketa_id, mid:mid });
+
+ event.stopPropagation();
}
}
@@ -523,6 +531,7 @@ function invShowMessageRename() {
// prikažemo popup za preimenovanje
var mid = $("#invitation_messages ol li.active").attr("mid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=show_message_rename', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
@@ -555,12 +564,17 @@ function invMessageRename() {
}
);
}
+
+// najprej dodatno poeditiramo sporočilo
function inv_message_save_advanced(mid) {
- // najprej dodatno poeditiramo sporočilo
+
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
+
$("#fullscreen").load('ajax.php?t=invitations&a=edit_message_details', {anketa:srv_meta_anketa_id, noNavi:'true', mid:mid});
}
+
function inv_message_save_forward(mid) {
//v kolikor je CKEditor vklopljen potem, ga odstranimo pred skranjevanjem
if(CKEDITOR.instances['inv_message_body']){
@@ -586,7 +600,7 @@ function inv_message_save_forward(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward',
{
@@ -610,7 +624,7 @@ function inv_message_save_forward(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_¸ge_replyto").css({
'border' : '1px solid red'
@@ -651,7 +665,7 @@ function inv_message_save_forward_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=message_save_forward_noEmail',
{
@@ -674,7 +688,7 @@ function inv_message_save_forward_noEmail(mid) {
}
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -712,7 +726,7 @@ function inv_message_save_simple(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple',
{
@@ -725,15 +739,17 @@ function inv_message_save_simple(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('inv_message_body', true);
data = jQuery.parseJSON(data);
+
if (data.error == 0) {
return true;
- }else {
+ }
+ else {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_messge_replyto").css({
'border' : '1px solid red'
@@ -773,7 +789,7 @@ function inv_message_save_simple_noEmail(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message_simple_noEmail',
{
@@ -785,7 +801,7 @@ function inv_message_save_simple_noEmail(mid) {
noNavi : 'true'
},
function(data) {
- create_inv_editor('', true)
+ create_editor('', true)
data = jQuery.parseJSON(data);
if (data.error == 0) {
return true;
@@ -793,7 +809,7 @@ function inv_message_save_simple_noEmail(mid) {
// skrijemo okno in
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_subject == '1') {
$("#inv_message_subject").css({
'border' : '1px solid red'
@@ -843,7 +859,7 @@ function inv_message_save_details() {
window.location.reload()
} else {
// so napake
- alert (' '+data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
}
);
@@ -860,100 +876,6 @@ function inv_new_message_list_change(what) {
}
}
-/*
-function edit_message_save(mid) {
- // shranimo v mid
- var replyto = $("#inv_message_replyto").val();
- var subject = $("#inv_message_subject").val();
- var body = $("#inv_message_body").val();
- var profile_comment = $("#inv_message_comment").val();
- var quickSave = true;
- if (!mid || mid == 'undefined') {
- mid = $("#inv_recipients_profile_name select").val();
- quickSave = false;
- }
- var naslov = $("#rec_profile_name").val();
- var old_mid = $("#invitation_messages ol li.active").attr('mid');
- // resetiramo morebitne prejšne napake
- $("#inv_message_replyto").css({
- 'border' : 'none'
- });
- $("#inv_message_subject").css({
- 'border' : 'none'
- });
- $("#inv_message_body").css({
- 'border' : 'none'
- });
-
- $("#inv_error_note").addClass('hidden');
-
- $.post(
- 'ajax.php?t=invitations&a=save_message',
- {
- anketa : srv_meta_anketa_id,
- mid : mid,
- old_mid:old_mid,
- quickSave:quickSave,
- replyto : replyto,
- subject : subject,
- body : body,
- noNavi : 'true',
- profile_comment : profile_comment,
- naslov:naslov
- },
- function(data) {
- data = jQuery.parseJSON(data);
- if (data.error == "0") {
- // redirektamo na pošiljanje
- //var href = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=send_message';
- //window.location = href;
- window.location.reload()
- } else {
- // skrijemo okno in
- $('#fade').fadeOut('slow');
- $('#fullscreen').fadeOut('slow').html('')
- // prikažemo obvestilo o napaki
- $("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
- if (data.inv_message_replyto == '1') {
- $("#inv_message_replyto").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_subject == '1') {
- $("#inv_message_subject").css({
- 'border' : '1px solid red'
- });
- }
- if (data.inv_message_body == '1') {
- $("#inv_message_body").css({
- 'border' : '1px solid red'
- });
- }
- }
- });
-
- return false;
-
-}
-
-function invSendMail() {
- var send_type = $('input[name=mailto]:checked').val();
- var prefix = "";
- var checkboxes = "";
-
- $('input[name="mailto_status[]"]:checked').each(function(el) {
- checkboxes = checkboxes+prefix+$(this).val();
- prefix = ",";
- });
-
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
-
- $("#fullscreen").load('ajax.php?t=invitations&a=check_send_mail',{anketa:srv_meta_anketa_id, noNavi:'true', send_type:send_type, checkboxes:checkboxes});
-
-};
-*/
function inv_del_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
@@ -970,7 +892,7 @@ function inv_del_rec_profile() {
var new_pid = $("#inv_import_list_profiles ol li").first().next().attr('pid');
}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
+ $("#anketa_edit").load('ajax.php?t=invitations&a=use_recipients_list', {anketa:srv_meta_anketa_id, pid:new_pid });
});
}
}
@@ -979,12 +901,13 @@ function inv_edit_rec_profile() {
var pid = $("#inv_import_list_profiles ol li.active").attr("pid");
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=edit_rec_profile', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
function inv_prepare_add_recipients() {
- alert('Deprecated!');
+ genericAlertPopup('alert_deprecated');
return false;
}
@@ -1005,10 +928,10 @@ function inv_recipients_add_to_list() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=get_profile_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', doAdd:doAdd});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1064,7 +987,10 @@ function invTogleSend(what) {
}
}
-function inv_selectAll(val){
+function inv_selectAll(checkbox){
+
+ val = $(checkbox).is(':checked');
+
// oznacimo vse checkboxe
$('#tbl_recipients_list tr td input[type="checkbox"]').each(function() {
$(this).attr("checked", val);
@@ -1073,32 +999,33 @@ function inv_selectAll(val){
if(val == true){
$("#inv_switch_on").hide();
$("#inv_switch_off").show();
- } else{
+ }
+ else{
$("#inv_switch_off").hide();
$("#inv_switch_on").show();
}
}
function inv_list_selectAll(val){
- $(document).ready(function(){
- if(val == true){
- $('.test_checkAll').each(function(){
- this.checked = true;
- })
- $("#inv_switch_on").hide();
- $("#inv_switch_off").show();
- }else{
- $('.test_checkAll').each(function(){
- this.checked = false;
- })
- $("#inv_switch_on").show();
- $("#inv_switch_off").hide();
- }
- });
+
+ if(val == true){
+ $('.test_checkAll').each(function(){
+ this.checked = true;
+ })
+ $("#inv_switch_on").hide();
+ $("#inv_switch_off").show();
+ }
+ else{
+ $('.test_checkAll').each(function(){
+ this.checked = false;
+ })
+ $("#inv_switch_on").show();
+ $("#inv_switch_off").hide();
+ }
}
function inv_recipients_form_action(action) {
-
+
var recipents = $('#tbl_recipients_list input[name="inv_rids[]"]:checked');
if (action == 'delete') {
@@ -1116,9 +1043,9 @@ function inv_recipients_form_action(action) {
$.post('ajax.php?t=invitations&a=delete_recipient_all', {anketa:srv_meta_anketa_id,noNavi:'true'}, function(data) {
data = jQuery.parseJSON(data);
if (data.success == 1) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
} else {
- alert(data.error);
+ genericAlertPopup('alert_parameter_dataerror',data.error);
}
});
}
@@ -1132,6 +1059,13 @@ function inv_recipients_form_action(action) {
return false;
}
+ else if (action == 'export_qr_codes') {
+ $("#frm_inv_rec_export").attr("action", "ajax.php?t=invitations&a=export_recipients_qr_codes");
+ $("#frm_inv_rec_export").attr("target", "_blank");
+ $('#frm_inv_rec_export').submit();
+
+ return false;
+ }
else if (action == 'export') {
// imamo akcijo izvozi
//če je kak izbran izvozimo tistega, če ne pa izberemo vse in izvozimo vse
@@ -1186,7 +1120,7 @@ function inv_recipients_list_action(action){
url: "ajax.php?t=invitations&a=deleteRecipientsListMulti",
success: function(data){
//console.log("Tle pride");
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_lists', {anketa:srv_meta_anketa_id});
}
});
}
@@ -1242,7 +1176,7 @@ function edit_message_save(mid) {
'border' : 'none'
});
- $("#inv_error_note").addClass('hidden');
+ $("#inv_error_note").addClass('displayNone');
$.post(
'ajax.php?t=invitations&a=save_message',
@@ -1271,7 +1205,7 @@ function edit_message_save(mid) {
$('#fullscreen').fadeOut('slow').html('')
// prikažemo obvestilo o napaki
$("#inv_error_note").html(data.msg);
- $("#inv_error_note").removeClass('hidden');
+ $("#inv_error_note").removeClass('displayNone');
if (data.inv_message_replyto == '1') {
$("#inv_message_replyto").css({
'border' : '1px solid red'
@@ -1328,10 +1262,12 @@ function showRecipientTracking(rid) {
function changeInvRecListCheckbox() {
var pids = "";
var prefix = "";
+
$('#inv_edit_rec_list table tr td input:checked').each(function(idx, elm) {
pids = pids + prefix + $(elm).attr('value');
prefix = ',';
});
+
var onlyThisSurvey = $('input[name=inv_show_list_type]:checked').val();
$("#inv_selected_rec_list").load('ajax.php?t=invitations&a=editRecList', {anketa:srv_meta_anketa_id,noNavi:'true',pids:pids, onlyThisSurvey:onlyThisSurvey});
@@ -1372,6 +1308,7 @@ $("#inv_edit_rec_list table tr td").live('click', function(event) {
*/
function inv_list_edit(pid) {
$('#fade').fadeTo('slow', 1);
+ $('#fullscreen').addClass('divPopUp PopUpNarrow');
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=invListEdit', {anketa:srv_meta_anketa_id, pid:pid, noNavi:'true'});
}
@@ -1399,10 +1336,10 @@ function inv_list_get_name(saveNew) {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=invitations&a=list_get_name', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid, saveNew:saveNew});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1420,8 +1357,8 @@ function inv_list_save() {
var recipients_list = $("#inv_prof_recipients_list").val();
var field_list = $("#inv_prof_field_list").val();
var saveNew = ($("#saveNew").val() == 'true') ? 'true': 'false';
- alert(profile_name);
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
+ genericAlertPopup('alert_parameter_profilename',profile_name);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=inv_list_save', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:field_list, profile_id:profile_id, profile_name:profile_name, profile_comment:profile_comment, saveNew:saveNew});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1430,7 +1367,7 @@ function inv_list_edit_save() {
form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
form_serialize[form_serialize.length] = {name:'noNavi', value:'true'}
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListEditSave', form_serialize);
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
@@ -1444,14 +1381,14 @@ function inv_list_save_old(profile_id) {
var rec_profile_name = $("#rec_profile_name").val();
var rec_profile_comment = $("#rec_profile_comment").val();
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=invListSaveOld', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, field_list:fields, profile_id:profile_id, rec_profile_name:rec_profile_name, rec_profile_comment:rec_profile_comment});
$('#fade').fadeOut('slow');
$('#fullscreen').fadeOut('slow').html('');
}
function deleteRecipientsList_confirm(id) {
if (confirm(lang['srv_inv_recipients_delete_list_confirm'])) {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=deleteRecipientsList', {anketa:srv_meta_anketa_id, id:id});
}
}
@@ -1517,10 +1454,10 @@ function inv_upload_list_check() {
if (extension == 'txt' || extension == 'csv') {
$('#inv_recipients_upload_form').submit();
} else {
- alert("Nepravilna vrsta datoteke!");
+ genericAlertPopup('alert_incorrect_filetype');
}
} else {
- alert("Izberite datoteko!");
+ genericAlertPopup('alert_choose_file');
}
}
@@ -1554,7 +1491,7 @@ function mailSourceMesageChange(what) {
function inv_set_sort_field(field,type) {
$.post('ajax.php?t=invitations&a=setSortField', {anketa:srv_meta_anketa_id,noNavi:'true', field:field,type:type}, function() {
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=view_recipients', {anketa:srv_meta_anketa_id});
});
}
@@ -1650,16 +1587,18 @@ function invRecipientsForward() {
if (recipients_list.length > 0)
{
// shranimo seznam ali dodamo respondente ali oboje
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
- }
+ $("#anketa_edit").load('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ /*$.post('ajax.php?t=invitations&a=recipientsAddForward', {anketa:srv_meta_anketa_id, doAdd:doAdd, doSave:doSave, recipients_list:recipients_list, fields:fields, profile_name:profile_name, profile_comment:profile_comment, profile_id:profile_id, recipientsDelimiter: recipientsDelimiter});
+ window.location = 'index.php?anketa='+srv_meta_anketa_id+'&a=invitations&m=view_recipients';*/
+ }
else
{
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1');
}
}
else
{
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2');
}
}
@@ -1688,7 +1627,7 @@ function invitationSetCondition(cid)
$('#fullscreen').fadeOut('slow').html('');
$('#fade').fadeOut('slow');
- $(".anketa_edit_main").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
+ $("#anketa_edit").load('ajax.php?t=invitations&a=setAdvancedCondition', {anketa:srv_meta_anketa_id, cid:cid});
}
function noEmailingToggle(value){
@@ -1715,28 +1654,20 @@ function noEmailingType(value){
function smtpAAIPopupShow(){
$('#fade').fadeTo('slow', 1);
- $('#popup_note').html('').fadeIn('slow');
- $("#popup_note").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=invitations&a=showAAISmtpPopup', {anketa: srv_meta_anketa_id, noNavi:'true'});
}
function smtpAAIPopupClose(){
// Ni sprejel - vrnemo radio
$('input[name=SMTPMailMode][value=2]').prop('checked', true);
- $('#popup_note').fadeOut('slow').html('');
- $('#fade').fadeOut('slow');
+ popupClose();
}
function smtpAAISet(){
// Shranimo formo
$("form[name='settingsanketa_"+srv_meta_anketa_id+"']").submit();
-
- // Prikazemo nastavitve za Arnes smtp
- /*$('#send_mail_mode1, #send_mail_mode2').hide();
- $('#send_mail_mode0').show();
-
- // Zapremo popup
- smtpAAIPopupClose();*/
}
function smtpAAIAccept(){
@@ -1751,13 +1682,30 @@ function smtpAAIAccept(){
function squaloSwitch(){
if($('#squalo_mode').prop('checked')){
- $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').hide();
+ $('#send_mail_mode0, #send_mail_mode1, #send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').addClass('displayNone');
$('#success_save').hide();
}
else{
- $('.squalo_settings').hide();
- $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').show();
+ $('.squalo_settings').addClass('displayNone');
+ $('#send_mail_mode2, .mail_mode_switch, #send_mail_mode_test').removeClass('displayNone');
$('#success_save').hide();
}
}
+// Sortiranje box-ov pri dodajanju respondentov
+function initInvitationsConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ refreshFieldsList();
+ },
+ forcePlaceholderSize:'true',
+ tolerance:'pointer',
+ placeholder:'inv_field_placeholder',
+ cancel:'#inv_field_relation'
+ });
+}
diff --git a/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js b/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
index 1a1ca5d..21bcdb8 100644
--- a/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
+++ b/admin/survey/script/jquery/jquery.selectbox-0.6.1/jquery.selectbox-0.6.1.js
@@ -12,6 +12,11 @@
* @author Krzysztof Suszyński <k.suszynski@wit.edu.pl>
**/
jQuery.fn.selectbox = function(options){
+
+ // Na mobitelu pustimo vedno default dropdowne
+ if ($('.mobile_header:visible').length != 0)
+ return;
+
/* Default settings */
var settings = {
className: 'jquery-selectbox',
@@ -159,7 +164,7 @@ jQuery.fn.selectbox = function(options){
jQuery('.'+settings.className + '-currentItem', replacement).text(v.text());
}
});
- replacement.find('.' + settings.className + '-moreButton').click(function(){
+ replacement.find('.'+settings.className+'-moreButton, .'+settings.className+'-currentItem').click(function(){
var thisMoreButton = jQuery(this);
var otherLists = jQuery('.' + settings.className + '-list')
.not(thisMoreButton.siblings('.' + settings.className + '-list'));
diff --git a/admin/survey/script/js-lang.php b/admin/survey/script/js-lang.php
index ab71fd3..6493ba1 100644
--- a/admin/survey/script/js-lang.php
+++ b/admin/survey/script/js-lang.php
@@ -108,6 +108,7 @@ lang('srv_disable');
lang('srv_if_new');
lang('srv_if_new_question');
lang('srv_chart_edit_warning');
+lang('srv_inv_recipients_delete_message_confirm');
lang('srv_inv_recipients_delete_profile_confirm');
lang('srv_inv_recipients_delete_list_confirm');
lang('srv_inv_recipients_delete_multi');
@@ -115,6 +116,7 @@ lang('srv_inv_recipients_delete_all');
lang('srv_inv_list_delete_multi');
lang('save');
lang('srv_new_vrednost');
+lang('srv_new_vrednost_grid');
lang('srv_analiza_arhiviraj');
lang('srv_success_save');
lang('srv_invitation_note1');
@@ -126,6 +128,8 @@ lang('srv_novavrednost_drugo');
lang('srv_unlock_alert');
lang('srv_custom_report_first');
lang('srv_ask_delete');
+lang('srv_ask_delete_data');
+lang('srv_ask_delete_multiple_data');
lang('srv_brisivrednostconfirm');
lang('srv_brisivrednost');
lang('srv_incremental_hs1');
@@ -146,22 +150,6 @@ lang('srv_advanced_slideshow');
lang('srv_urlLinks_delete');
lang('srv_zapri');
lang('srv_remind_preview');
-lang('srv_language_technology_flagged_wordings');
-lang('srv_language_technology_wording_properites');
-lang('srv_language_technology_wording');
-lang('srv_language_technology_freguency');
-lang('srv_language_technology_word_type');
-lang('srv_language_technology_word_type');
-lang('srv_language_technology_meanings');
-lang('srv_language_technology_noun');
-lang('srv_language_technology_verb');
-lang('srv_language_technology_adjective');
-lang('srv_language_technology_adverb');
-lang('srv_language_technology_existential');
-lang('srv_language_technology_relevant_meanings');
-lang('srv_language_technology_alternative_wordings');
-lang('srv_language_technology_no_alternative');
-lang('srv_language_technology_no_alternative_selected');
lang('srv_aapor_automatic');
lang('edit_hide');
lang('edit_show');
@@ -193,6 +181,21 @@ lang('srv_alert_upload_ext');
lang('srv_trans_lang');
lang('srv_manager_remove_alert');
lang('srv_resevanje_foto_pre_result');
+lang('srv_vrednost_correct');
+lang('srv_editor_title');
+lang('srv_comments_new');
+lang('srv_comment_comment');
+lang('edit1338');
+lang('for');
+lang('alternative_email_delete');
+lang('srv_anketa_deleted_restore_confirm');
+lang('srv_data_deleted_restore_confirm');
+lang('more2');
+lang('less2');
+lang('srv_concl_deactivation_text_edit');
+lang('action_note_comment_added');
+lang('srv_comments_archive');
+lang('srv_comments_unarchive');
//LOKACIJA
diff --git a/admin/survey/script/library.js b/admin/survey/script/library.js
index e679d84..054395e 100644
--- a/admin/survey/script/library.js
+++ b/admin/survey/script/library.js
@@ -7,43 +7,33 @@ var srv_meta_branching = $("#srv_meta_branching").val();
// poklice se iz htmlja ob prikazu librarija (init)
function library () {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
// nardimo ankete, vprasanja draggable
- $('div#libraryInner div.folder_container, div.anketa_vprasanja span').draggable({opacity:'0.5', zIndex:'50', helper: 'clone', appendTo: 'body', distance:5});
+ //$('div#libraryInner div.folder_container, div.anketa_vprasanja span').draggable({opacity:'0.5', zIndex:'50', helper: 'clone', appendTo: 'body', distance:5});
// nardimo folderje draggable
- //if (!$.browser.msie) { // ne dela zaradi nestable draggables buga
- $('div#libraryInner ul.can_edit li.folder').draggable({revert: 'invalid', opacitiy:'0.5', zIndex:'1', handle:'.movable', distance:5});
- //}
+ $('div#libraryInner ul.can_edit li.folder.can_drag, div#libraryInner li.anketa.can_drag').draggable({
+ revert: 'invalid',
+ opacitiy: '0.5',
+ zIndex: '1',
+ handle: '.movable',
+ distance: 5,
+ handle: '.folder_box, folder_container'
+ });
// nardimo folderje droppable
- //$('div#libraryInner .folderdrop').droppable({accept: '.folder_container, ul .folder, .branch', hoverClass: 'grupahover', tolerance: 'pointer',
- $('div#libraryInner ul.can_edit .folderdrop').droppable({accept: 'ul.can_edit .folder_container, ul.can_edit .folder, .branch, .spr, .if, .block', hoverClass: 'grupahover', tolerance: 'pointer',
+ $('div#libraryInner ul.can_edit .folderdrop').droppable({
+ hoverClass: 'folderhover',
+ tolerance: 'pointer',
drop: function (e, ui) {
- if ($(ui.draggable).attr('name') == 'folder') { // premikanje folderjev v librariju
-
- $('#libraryInner').load('ajax.php?t=library&a=folder_dropped', {drop: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else if ($(ui.draggable).attr('name') == 'library') { // premikanje spremenljivk
-
- $('#libraryInner').load('ajax.php?t=library&a=spr_dropped', {spremenljivka: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else if ($(ui.draggable).attr('name') == 'library_if') { // premikanje ifov
-
- $('#libraryInner').load('ajax.php?t=library&a=if_dropped', {'if': $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab, prva: lib_prva});
-
- } else { // dodajanje v library (karkoli ze pac je - spr, if, blok)
-
- $.post('ajax.php?t=library&a=library_add', {spremenljivka: $(ui.draggable).attr('id'), folder: $(this).attr('eid'), tab: lib_tab, anketa: srv_meta_anketa_id}, function(data) {
-
- $('#libraryInner').html(data.folders);
- $('#clipboard').html(data.response).show().delay('3000').slideUp();
-
- }, 'json');
- refreshLeft();
-
+ // premikanje folderjev v librariju
+ if ($(ui.draggable).attr('name') == 'folder') {
+ $('#libraryInner').load('ajax.php?t=library&a=folder_dropped', {drop: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab});
+ }
+ // premikanje anket
+ else if ($(ui.draggable).attr('name') == 'library') {
+ $('#libraryInner').load('ajax.php?t=library&a=spr_dropped', {spremenljivka: $(ui.draggable).attr('eid'), folder: $(this).attr('eid'), tab: lib_tab});
}
}
});
@@ -62,11 +52,6 @@ function library () {
}
-function library_spremenljivka_new (spremenljivka) {
- $('html, body').animate({scrollTop: $('body').height()+$('#branching').height()});
- spremenljivka_new(0, 0, 1, spremenljivka);
-}
-
function library_if_new (copy) {
$('html, body').animate({scrollTop: $('body').height()+$('#branching').height()});
if_new(0, 0, 1, '0', copy);
@@ -102,36 +87,44 @@ function folder_rename (folder) {
}
function library_folder_newname (folder) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=folder_newname', {folder: folder, naslov: $('#naslov_'+folder).attr('value'), tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=folder_newname', {folder: folder, naslov: $('#naslov_'+folder).attr('value'), tab: lib_tab});
}
function library_new_folder (folder, uid) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=new_folder', {folder: folder, uid: uid, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=new_folder', {folder: folder, uid: uid, tab: lib_tab});
}
function library_delete_folder (folder) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=delete_folder', {folder: folder, tab: lib_tab, prva: lib_prva});
+
+ $('#libraryInner').load('ajax.php?t=library&a=delete_folder', {folder: folder, tab: lib_tab});
}
+// Prikaz vec na tri pikice
+function library_show_more(ank_id){
+
+ if($('#library_more_box_'+ank_id).hasClass('displayNone')){
+ $('.library_more_box').addClass('displayNone');
+ $('#library_more_box_'+ank_id).removeClass('displayNone');
+ }
+ else{
+ $('.library_more_box').addClass('displayNone');
+ }
+}
+
function library_del_anketa (anketa, text) {
if (confirm(text)) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=library_del_anketa', {anketa: anketa, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=library_del_anketa', {anketa: anketa, tab: lib_tab});
}
}
function library_del_myanketa (anketa, text) {
if (confirm(text)) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
- $('#libraryInner').load('ajax.php?t=library&a=library_del_myanketa', {anketa: anketa, tab: lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=library_del_myanketa', {anketa: anketa, tab: lib_tab});
}
}
@@ -143,14 +136,9 @@ function add_to_my_library () {
}
-function anketa_copy (ank_id, text) {
- var lib_prva = $("input#lib_prva").val();
- if (lib_prva == 1 ) {
- var naslov = $("#novaanketa_naslov").val();
- $.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id: ank_id, naslov: naslov});
- } else {
- $.redirect('ajax.php?t=library&a=anketa_copy', {anketa:srv_meta_anketa_id, ank_id: ank_id});
- }
+function anketa_copy (ank_id) {
+ var naslov = $("#novaanketa_naslov").val();
+ $.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id: ank_id, naslov: naslov});
}
function anketa_copy_top (ank_id, hierarhija) {
@@ -162,25 +150,21 @@ function anketa_copy_top (ank_id, hierarhija) {
}
function library_folders_plusminus (folder) {
+
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
var sortable_if = document.getElementById('folder_'+folder).style;
if (sortable_if.display != "none") {
-
- $('#folder_'+folder).slideUp();
-
- //$('#f_pm_'+folder).html('<img src="img/plus.png" class="folder_plusminus" style="width:12px; height:12px">');
-
- $('#f_pm_'+folder).load('ajax.php?t=library&a=folder_collapsed', {collapsed: 1, folder: folder, tab: lib_tab, prva:lib_prva});
-
- } else {
-
- $('#folder_'+folder).slideDown();
-
- //$('#f_pm_'+folder).html('<img src="img/minus.png" class="folder_plusminus" style="width:12px; height:12px">');
-
- $('#f_pm_'+folder).load('ajax.php?t=library&a=folder_collapsed', {collapsed: 0, folder: folder, tab:lib_tab, prva:lib_prva});
+ $('#folder_'+folder).slideUp();
+ $('#li'+folder).find('> .folder_box_holder > .folder_box').removeClass('open');
+
+ $.post('ajax.php?t=library&a=folder_collapsed', {collapsed: 1, folder: folder, tab: lib_tab});
+ }
+ else {
+ $('#folder_'+folder).slideDown();
+ $('#li'+folder).find('> .folder_box_holder > .folder_box').addClass('open');
+
+ $.post('ajax.php?t=library&a=folder_collapsed', {collapsed: 0, folder: folder, tab:lib_tab});
}
}
@@ -211,10 +195,9 @@ function library_if_remove (_if) {
// izbrise spremenljivko iz knjiznice
function library_brisi_spremenljivko (spremenljivka, text) {
var lib_tab = $("input#lib_tab").val();
- var lib_prva = $("input#lib_prva").val();
if (confirm(text)) {
- $('#libraryInner').load('ajax.php?t=library&a=brisi_spremenljivko', {spremenljivka: spremenljivka, grupa: srv_meta_grupa, anketa: srv_meta_anketa_id, branching: srv_meta_branching, tab:lib_tab, prva: lib_prva});
+ $('#libraryInner').load('ajax.php?t=library&a=brisi_spremenljivko', {spremenljivka: spremenljivka, grupa: srv_meta_grupa, anketa: srv_meta_anketa_id, branching: srv_meta_branching, tab:lib_tab});
}
}
@@ -246,11 +229,376 @@ function check_library () {
if ( $('input[name=javne_ankete]:checked').val() == '1' ) {
$('input[name=moje_ankete][value=0]').attr('checked', 'true');
- $('#moje_ankete').hide();
+ $('#moje_ankete').addClass('displayNone');
} else {
- $('#moje_ankete').show();
+ $('#moje_ankete').removeClass('displayNone');
}
}
+
+
+// Odpremo knjiznico v urejanju ankete
+function displayLibraryPopup(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('library_popup').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=libraryBranching&a=displayLibraryPopup', {anketa: srv_meta_anketa_id});
+}
+
+// Preklop med tabi
+function displayLibraryTab(tab){
+
+ if(tab == 1){
+ $('#tab_0').removeClass('active');
+ $('#tab_1').addClass('active');
+ }
+ else{
+ $('#tab_1').removeClass('active');
+ $('#tab_0').addClass('active');
+ }
+
+ $('#active_tab').val(tab);
+
+ $("#tab_content").load('ajax.php?t=libraryBranching&a=displayLibraryTabContent', {anketa: srv_meta_anketa_id, tab: tab});
+}
+
+// Odpremo folder - na desni prikazemo vprasanja
+function openLibraryFolder(folder_id){
+
+ $('.folder_item').removeClass('active');
+ $('#folder_item_'+folder_id).addClass('active').addClass('open');
+
+ // Ce poddirektoriji niso vidni jih prikazemo
+ if(!$('#folder_list_'+folder_id).is(':visible')){
+ $('#folder_list_'+folder_id).slideDown();
+ }
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=displayLibraryQuestionList', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+
+
+ // Ugasnemo vse prejšnje checkboxe
+ $(".question_item_check").removeClass('active').attr("checked", false);
+
+ // Nastavimo oznacene iteme na 0 in disablamo gumb
+ $('#selected_item_counter').html('0');
+ $("#insert_library_button").prop('disabled', true);
+}
+
+// Odpremo anketo - na desni prikazemo vprasanja
+function openLibrarySurvey(folder_id, type){
+
+ $('.folder_item').removeClass('active');
+ $('#'+type+'_survey_item_'+folder_id).addClass('active');
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=displayLibrarySurveyQuestionList', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+
+
+ // Ugasnemo vse prejšnje checkboxe
+ $(".question_item_check").removeClass('active').attr("checked", false);
+
+ // Nastavimo oznacene iteme na 0 in disablamo gumb
+ $('#selected_item_counter').html('0');
+ $("#insert_library_button").prop('disabled', true);
+}
+
+// Razpremo/skrcimo folder na levi
+function expandLibraryFolder(folder_id){
+
+ if($('#folder_list_'+folder_id).is(':visible')){
+ $('#folder_list_'+folder_id).slideUp();
+ $('#folder_item_'+folder_id).removeClass('open');
+ }
+ else{
+ $('#folder_list_'+folder_id).slideDown();
+ $('#folder_item_'+folder_id).addClass('open');
+ }
+
+ event.stopPropagation();
+}
+
+// Prikazemo opcije za urejanje folderja
+function showLibraryFolderEdit(element){
+
+ if($(element).parent().find('.folder_item_settings').hasClass('displayNone')){
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').addClass('displayNone');
+ $(element).removeClass('active');
+ }
+
+ event.stopPropagation();
+}
+
+
+// Zaprtje dodatnega popupa
+function closeAdditionalPopup(){
+ $("#lib_additional_popup").fadeOut().html();
+}
+
+// Ime novega folderja
+function displayAddFolderPopup(parent_folder_id, uid){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=addFolderPopup', {anketa: srv_meta_anketa_id, tab: tab, folder_id: parent_folder_id, uid: uid});
+}
+
+// Ime obstojecega folderja
+function displayRenameFolderPopup(folder_id, folder_name){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=renameFolderPopup', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id, folder_name: folder_name});
+}
+
+
+// Dodamo nov folder
+function addLibraryFolder(parent_folder_id, uid){
+
+ var tab = $('#active_tab').val();
+ var folder_name = $("#lib_folder_name").val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=addFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: parent_folder_id, uid: uid, folder_name: folder_name});
+}
+
+// Pobrisemo obstojeci folder
+function deleteLibraryFolder(folder_id){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=deleteFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id});
+}
+
+// Preimenujemo obstojeci folder
+function renameLibraryFolder(folder_id){
+
+ var tab = $('#active_tab').val();
+ var folder_name = $("#lib_folder_name").val();
+
+ $("#lib_folder_list").load('ajax.php?t=libraryBranching&a=renameFolder', {anketa: srv_meta_anketa_id, tab: tab, folder_id: folder_id, folder_name: folder_name});
+}
+
+
+// Klik na posamezno anketo - prikazemo/skrijemo vprasanja na desni znotraj ankete (desni tab)
+function toggleLibrarySurveyQuestions(folder_id){
+
+ if($('#survey_title_'+folder_id).hasClass('active')){
+ $('#survey_title_'+folder_id).removeClass('active');
+ $('#survey_questions_'+folder_id).hide();
+ }
+ else{
+ $('#survey_title_'+folder_id).addClass('active');
+ $('#survey_questions_'+folder_id).show();
+ }
+}
+
+// Klik na posamezen item na desni
+function selectLibraryItem(item_id){
+
+ if($('#question_item_holder_'+item_id).hasClass('active')){
+ $('#question_item_holder_'+item_id).removeClass('active');
+ $('#question_item_check_'+item_id).attr("checked", false);
+ }
+ else{
+ $('#question_item_holder_'+item_id).addClass('active');
+ $('#question_item_check_'+item_id).attr("checked", true);
+ }
+
+ // Prestejemo oznacene iteme
+ var count = $('.question_item_check:checkbox:checked').length;
+ $('#selected_item_counter').html(count);
+
+ // Nastavimo gumb dodaj kot disabled glede na to ce imamo elemente ali ne
+ if(count > 0){
+ $("#insert_library_button").prop('disabled', false);
+ }
+ else{
+ $("#insert_library_button").prop('disabled', true);
+ }
+}
+
+// Prikaz urejanja posameznega itema na desni
+function showLibraryItemEdit(element){
+
+ if($(element).parent().find('.item_settings').hasClass('displayNone')){
+ $('.item_settings').addClass('displayNone');
+ $('.dots_ver_item').removeClass('active');
+ $(element).parent().find('.item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.item_settings').addClass('displayNone');
+ $('.dots_ver_item').removeClass('active');
+ $(element).parent().find('.item_settings').addClass('displayNone');
+ }
+
+ event.stopPropagation();
+}
+
+function deleteLibraryItem(item_id, item_type){
+
+ $.post('ajax.php?t=libraryBranching&a=deleteItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+
+ event.stopPropagation();
+}
+
+// Odpremo popup za dodajanje itema v knjiznico v urejanju ankete
+function displayRenameLibraryItemPopup(item_id, type){
+
+ var tab = $('#active_tab').val();
+
+ $("#lib_additional_popup").fadeIn();
+ $("#lib_additional_popup").load('ajax.php?t=libraryBranching&a=displayRenameLibraryItemPopup', {anketa: srv_meta_anketa_id, tab: tab, item_id: item_id, type: type});
+
+ event.stopPropagation();
+}
+
+// Preimenujemo obstojeci element
+function renameLibraryItem(item_id, type){
+
+ var tab = $('#active_tab').val();
+ var title = $('#lib_element_name').val();
+ var folder_id = $('.folder_item.active').attr("folder-id");
+
+ closeAdditionalPopup();
+
+ $("#lib_question_list").load('ajax.php?t=libraryBranching&a=renameItem', {anketa: srv_meta_anketa_id, tab: tab, item_id: item_id, type: type, title: title, folder_id: folder_id});
+}
+
+// Funkcija za init drag drop vprasanj v knjiznici
+function dropLibraryItem(item_id, item_type, folder_id){
+
+ $.post('ajax.php?t=libraryBranching&a=dropItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type, folder_id: folder_id}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+}
+
+// Funkcija za init drag drop
+function initDragLibraryItem(){
+
+ $('.question_item_info').draggable({
+ containment: $('#general_popup'),
+ helper: 'clone',
+ //distance: 20,
+ //snap: theVoteBar,
+ //revert: true,
+ });
+
+ $(".droppable_folder").droppable({
+ accept: ".question_item_info",
+ tolerance: "pointer",
+ hoverClass: "drag-hover",
+ drop: function( event, ui ) {
+ var item_id = ui.draggable.attr('item-id');
+ var item_type = ui.draggable.attr('item-type');
+ var folder_id = $(this).attr("folder-id");
+
+ dropLibraryItem(item_id, item_type, folder_id);
+ }
+ });
+}
+
+// Skrijemo puscice folderjem brez subfolderjev
+function initHideLibraryArrows(){
+
+ $('ul.folder_list').each(function(){
+
+ if($(this).is(':empty')){
+
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(12);
+
+ $('#folder_item_'+id).addClass('no_arrow');
+ }
+ });
+}
+
+function insertLibraryItemsIntoSurvey(){
+
+ var items = [];
+
+ var multiple = false;
+ var different = false;
+ var prev = '';
+ var subtype = '';
+
+ $('.question_item_check:checkbox:checked').each(function(){
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(20);
+
+ var type = $(this).attr("item-type");
+ subtype = $(this).attr("item-subtype");
+
+ items.push(id + '_' + type);
+
+ // Preverimo za obvestilo, ce dodajamo vec elementov in ce so razlicni
+ if(prev != ''){
+ multiple = true;
+
+ if(prev != subtype){
+ different = true;
+ }
+ }
+
+ prev = subtype;
+ });
+
+ // Pohendlamo obvestilo, ce dodajamo vec elementov in ce so razlicni
+ var note = subtype;
+ if(different){
+ note = 'm';
+ }
+ else if(multiple){
+ note = subtype + 'm';
+ }
+ else{
+ note = subtype;
+ }
+ console.log(note)
+
+ $("#branching").load('ajax.php?t=libraryBranching&a=addIntoSurvey', {anketa: srv_meta_anketa_id, items: items}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_survey_'+note, 'success');
+ });
+}
+
+
+// Odpremo popup za dodajanje itema v knjiznico v urejanju ankete
+function displayAddIntoLibraryPopup(item_id, type){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=libraryBranching&a=displayAddIntoLibraryPopup', {anketa: srv_meta_anketa_id, item_id:item_id, type:type});
+}
+
+// Dodamo element v knjiznico
+function addIntoLibrary(item_id, type){
+
+ var title = $('#lib_item_title').val();
+ var folder_id = $('#lib_item_folder').val();
+
+ $.post('ajax.php?t=libraryBranching&a=addIntoLibrary', {anketa: srv_meta_anketa_id, item_id:item_id, type:type, title:title, folder_id:folder_id}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_lib_type'+type, 'success');
+ });
+}
diff --git a/admin/survey/script/means.js b/admin/survey/script/means.js
index c5326c5..178c0ef 100644
--- a/admin/survey/script/means.js
+++ b/admin/survey/script/means.js
@@ -68,15 +68,10 @@ function means_add_new_variable(which) {
var spr = new Array();
var grid = new Array();
- if (which == '2' ) {
- //$('#crossRightHolder #crosstab_add_new').hide();
- } else {
- //$('#crossLeftHolder #crosstab_add_new').hide();
- }
-
$('select[name=means_variable_'+which+']').each(function(index,el) {
sequence.push($(el).val());
});
+
$('select[name=means_variable_'+which+'] option:selected').each(function(index,el) {
spr.push($(el).attr("spr_id"));
grid.push($(el).attr("grd_id"));
@@ -94,9 +89,9 @@ function means_add_new_variable(which) {
function means_remove_variable(what) {
$(what).parent().remove();
- if ( $(what).parent().find('select').val() > 0 ) {
+ //if ( $(what).parent().find('select').val() > 0 ) {
change_means();
- }
+ //}
}
function changeMeansSubSetting() {
var chkMeansSeperate = $("#chkMeansSeperate").is(':checked') ? 1 : 0;
@@ -124,7 +119,7 @@ function doArchiveMeans() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveMeans() {
@@ -141,7 +136,7 @@ function submitArchiveMeans() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -157,9 +152,9 @@ function createArchiveMeansBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -167,6 +162,6 @@ function createArchiveMeansBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/missingProfiles.js b/admin/survey/script/missingProfiles.js
index 483265f..84d72e2 100644
--- a/admin/survey/script/missingProfiles.js
+++ b/admin/survey/script/missingProfiles.js
@@ -132,11 +132,11 @@ function missingProfileAction(action) {
$("#renameProfileDiv").hide();
$("#missingProfileCoverDiv").fadeOut();
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
}
}
diff --git a/admin/survey/script/missingValues.js b/admin/survey/script/missingValues.js
index 316e433..e891c92 100644
--- a/admin/survey/script/missingValues.js
+++ b/admin/survey/script/missingValues.js
@@ -53,7 +53,7 @@ function sysMissingValuesAdd()
if (filter != undefined && !(filter === '') && text != undefined && !(text === '' )) {
$("#sys_missing_values").load('ajax.php?t=missingValues&a=sysMissingValuesAdd', {filter:filter, text:text});
} else {
- alert(lang['srv_missing_value_not_empty']);
+ genericAlertPopup('srv_missing_value_not_empty');
}
}
function sysMissingValuesDelete(id)
@@ -70,7 +70,7 @@ function sysMissingValuesSave(id) {
if (filter != undefined && !(filter === '') && text != undefined && !(text === '') ) {
$("#sys_missing_values").load('ajax.php?t=missingValues&a=sysMissingValuesSave', {filter:filter, text:text, id:id});
} else {
- alert(lang['srv_missing_value_not_empty']);
+ genericAlertPopup('srv_missing_value_not_empty');
}
}
@@ -126,7 +126,7 @@ function addSurveyMissingValueConfirm() {
$('#fullscreen').fadeOut('slow');
});
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} \ No newline at end of file
diff --git a/admin/survey/script/mobile.js b/admin/survey/script/mobile.js
index 32a171c..ab43ec1 100644
--- a/admin/survey/script/mobile.js
+++ b/admin/survey/script/mobile.js
@@ -8,34 +8,100 @@ function mobile_init(){
closed: function () {
}
- })
+ })
- // dynamically bind 'closing' event
- zeynep.on('closing', function () {
+ // dynamically bind 'closing' event
+ zeynep.on('closing', function () {
- })
+ })
- // handle zeynepjs overlay click
- $('.mobile_menu_close').on('click', function () {
- zeynep.close();
- $('#fade').fadeOut();
+ // handle zeynepjs overlay click
+ $('.mobile_menu_close').on('click', function () {
- $('.mobile_menu_close').fadeOut('fast', function(){
- $('.mobile_menu_open').fadeIn('fast');
- });
- })
+ $('#fade').fadeOut();
- // open zeynepjs side menu
- $('.mobile_menu_open').on('click', function () {
- zeynep.open();
+ mobile_menu_close(zeynep);
+ })
+
+ // open zeynepjs side menu
+ $('.mobile_menu_open').on('click', function () {
+
+ if($('#fade').is(':hidden')){
$('#fade').fadeIn();
+ }
+ else{
+ mobile_settings_close(zeynep);
+ }
+
+ mobile_menu_open(zeynep);
+ })
+
+ // handle settings overlay click
+ $('.mobile_settings_close').on('click', function () {
+
+ $('#fade').fadeOut();
+
+ mobile_settings_close(zeynep);
+ })
+
+ // open settings side menu
+ $('.mobile_settings_open').on('click', function () {
+
+ if($('#fade').is(':hidden')){
+ $('#fade').fadeIn();
+ }
+ else{
+ mobile_menu_close(zeynep);
+ }
+
+ mobile_settings_open(zeynep);
+ })
+}
+
+// Odpremo mobile meni na levi
+function mobile_menu_open(zeynep){
- $('.mobile_menu_open').fadeOut('fast', function(){
- $('.mobile_menu_close').fadeIn('fast');
- });
- })
+ zeynep.open();
+
+ $('.mobile_menu_open').fadeOut('fast', function(){
+ $('.mobile_menu_close').fadeIn('fast');
+ });
+}
+
+// Zapremo mobile meni na levi
+function mobile_menu_close(zeynep){
+
+ zeynep.close();
+
+ $('.mobile_menu_close').fadeOut('fast', function(){
+ $('.mobile_menu_open').fadeIn('fast');
+ });
}
+// Odpremo settings meni na desni
+function mobile_settings_open(){
+
+ $('.mobile_settings').animate({"margin-right": '+=85vw'},200,'linear');
+
+ $('.mobile_settings_open').fadeOut('fast', function(){
+ $('.mobile_settings_close').fadeIn('fast');
+ });
+}
+
+// Zapremo settings meni na desni
+function mobile_settings_close(callback){
+
+ $('.mobile_settings').animate({"margin-right": '-85vw'},200,'linear');
+
+ $('.mobile_settings_close').fadeOut('fast', function(){
+ $('.mobile_settings_open').fadeIn('fast');
+ });
+
+ if (typeof callback == "function")
+ callback();
+}
+
+
// Popup za dodajanje vprasanja na mobile
function mobile_add_question_popup(){
$('.mobile_add_question_popup').fadeIn();
diff --git a/admin/survey/script/multiCrosstabs.js b/admin/survey/script/multiCrosstabs.js
index b4bd3cf..e85071a 100644
--- a/admin/survey/script/multiCrosstabs.js
+++ b/admin/survey/script/multiCrosstabs.js
@@ -190,6 +190,12 @@ function use_mc_table() {
location.reload();
});
}
+function switch_mc_table(value) {
+
+ $.post('ajax.php?t=multicrosstabs&a=use_mc_table', {anketa:srv_meta_anketa_id, value:value}, function(){
+ location.reload();
+ });
+}
// popravljamo ime tabele...
function mc_table_action(action){
diff --git a/admin/survey/script/notifications.js b/admin/survey/script/notifications.js
index 2494385..cdd5074 100644
--- a/admin/survey/script/notifications.js
+++ b/admin/survey/script/notifications.js
@@ -1,9 +1,14 @@
// poslje novo sporocilo
function sendNotification() {
+ if(CKEDITOR.instances['notification']){
+ CKEDITOR.instances['notification'].destroy();
+ }
+
var recipient = $( "input[name='recipient']" ).val();
var title = $( "input[name='title']" ).val();
- var notification = $( "textarea[name='notification']" ).val();
+ //var notification = $( "textarea[name='notification']" ).val();
+ var notification = $("#notification").val();
if ($( "input[name='recipient_all_slo']" ).is(':checked'))
var recipient_all_slo = 1;
@@ -20,7 +25,21 @@ function sendNotification() {
else
var force_show = 0;
- $('#notifications').load('ajax.php?t=notifications&a=sendNotification', {anketa:srv_meta_anketa_id, recipient:recipient, recipient_all_slo:recipient_all_slo, recipient_all_ang:recipient_all_ang, title:title, notification:notification, force_show:force_show});
+ $('#notifications').load('ajax.php?t=notifications&a=sendNotification', {
+ anketa:srv_meta_anketa_id,
+ recipient:recipient,
+ recipient_all_slo:recipient_all_slo,
+ recipient_all_ang:recipient_all_ang,
+ title:title,
+ notification:notification,
+ force_show:force_show,
+
+ function(){
+ if (!CKEDITOR.instances) {
+ CKEDITOR.replace['notification'];
+ }
+ }
+ });
}
// prikaze sporocilo in ga oznaci kot viewed
@@ -54,23 +73,31 @@ function closeUnreadMessages(){
$("#unread_notifications").fadeOut();
}
-function recipient_all_disable_email(){
-
- if ($( "input[name='recipient_all_slo']" ).is(':checked'))
- var recipient_all_slo = 1;
- else
- var recipient_all_slo = 0;
-
- if ($( "input[name='recipient_all_ang']" ).is(':checked'))
- var recipient_all_ang = 1;
- else
- var recipient_all_ang = 0;
-
- if(recipient_all_slo == 0 && recipient_all_ang == 0)
- $("#recipient").attr('disabled', false);
- else
- $("#recipient").attr('disabled', true);
+function recipient_toggle(type){
+
+ if (type == 'slo') {
+ if ($( "input[name='recipient_all_slo']" ).is(':checked')) {
+ $( "input[name='recipient_custom']" ).attr("checked", false);
+ $("#recipient").addClass('disabled');
+ }
+ }
+
+ if (type == 'ang') {
+ if ($( "input[name='recipient_all_ang']" ).is(':checked')) {
+ $( "input[name='recipient_custom']" ).attr("checked", false);
+ $("#recipient").addClass('disabled');
+ }
+ }
+
+ if (type == 'custom') {
+ if ($( "input[name='recipient_custom']" ).is(':checked')) {
+ $( "input[name='recipient_all_slo']" ).attr("checked", false);
+ $( "input[name='recipient_all_ang']" ).attr("checked", false);
+ $("#recipient").removeClass('disabled');
+ }
+ }
}
+
// Prikaze popup z neprebranimi sporocili
diff --git a/admin/survey/script/postProcess.js b/admin/survey/script/postProcess.js
index f8133d4..42cbdbd 100644
--- a/admin/survey/script/postProcess.js
+++ b/admin/survey/script/postProcess.js
@@ -22,7 +22,7 @@ function edit_data(event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
var td = target.prevAll('td.data_uid'); // td, ki vsebuje usr_id
@@ -110,7 +110,7 @@ function edit_data_hover (event) {
if ( ! target.is('td') ) return;
var target_parent_children = target.parent().children(); // td-ji vrstice kamor smo kliknili
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
// nad katero celico je kurosr
var cell_over = target_parent_children.index(target);
@@ -162,7 +162,7 @@ function edit_data_inline_edit () {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt( $("#tableIconColspan").val() ) || 0;
- var tableHeadChildren = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele
+ var tableHeadChildren = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele
var sprList = [];
@@ -297,19 +297,25 @@ function data_header_hoverout (event) {
function data_header_click (event) {
var target = $(event.target);
- // ce smo kliknili na notranji div z classom: .dataCell
- if ( target.is('.dataCell') ) {
- target = target.parent();
- }
-
- if ( ! target.is('th') ) return;
-
- $("#loading").show();
-
- var sort_seq = target.attr('seq');
- if ( !isNaN(sort_seq) && sort_seq!='' ) {
- var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
- vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ let spr_id = target.attr('spr_id');
+
+ //ignoriramo line number
+ if(spr_id != 'lineNo'){
+ // ce smo kliknili na notranji div z classom: .dataCell
+ if ( target.is('.dataCell') ) {
+ target = target.parent();
+ }
+
+ if ( ! target.is('th') ) return;
+
+ $("#loading").show();
+
+
+ var sort_seq = target.attr('seq');
+ if ( !isNaN(sort_seq) && sort_seq!='') {
+ var sort_type = target.is('.sort_asc') ? 'sort_dsc' : 'sort_asc'
+ vnos_redirect(sort_action_url+'&sort_seq='+sort_seq+'&sort_type='+sort_type);
+ }
}
}
@@ -322,7 +328,7 @@ function coding_click ( el, event ) {
var td_pos = el.parent().children().index(el);
- var spr_id = $('#dataTable tr:nth-child(3) th:eq('+td_pos+')').attr('spr_id');
+ var spr_id = $('#dataTable tr:nth-child(2) th:eq('+td_pos+')').attr('spr_id');
if ( ! spr_id > 0) return;
@@ -360,7 +366,7 @@ function coding_save (usr_id) {
$('#dataTable tbody td').removeClass('cellBlue');
$('#coding').hide();
- $('.coding-refresh').fadeIn();
+ $('.coding-refresh').show();
}
function coding_vrednost_new (spr_id, usr_id, naslov) {
@@ -404,6 +410,11 @@ function coding_filter (seq) {
});
}
+function toggle_coding_div () {
+
+ $('#coding').hide();
+
+}
function coding_merge (spr_id, vre_id, usr_id, merge) {
@@ -439,7 +450,7 @@ function postProcessAddMetaTitles() {
fields['itime'] = 0;
fields['lineNo'] = 0;
fields['meta'] = 0;
- $.each ( $('#dataTable tr:nth-child(3) th') ,function (i, element)
+ $.each ( $('#dataTable tr:nth-child(2) th') ,function (i, element)
{
if ($(element).attr('spr_id') == 'status')
{
@@ -576,13 +587,14 @@ function postProcessAddLurkerTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 4 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=5]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=lurker]").index();
+
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_id za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
@@ -591,31 +603,68 @@ function postProcessAddLurkerTitles(column) {
langs[0]=data.status0;
langs[1]=data.status1;
// preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tr') ,
+ $.each ( $('#dataTable tbody tr') ,
function (i, value) {
- var element = $(value).find(':nth-child('+(table_index)+')');
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
element.attr('title',new_val);
element.html(new_val);
+ element.addClass("cellGreen");
}
-
});
});
}
}
+
+function postProcessAddRelevanceTitles(column) {
+ // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
+ var tableIconColspan = parseInt($("#tableIconColspan").val());
+ // zamenjamo statuse
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=relevance]").index();
+
+ // če sploh prikazujemo statuse
+ if (table_index > 0) {
+ //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
+ table_index = 1+tableIconColspan+column;
+
+ var langs = new Array();
+ // polovimo tekste
+ $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
+ data = jQuery.parseJSON(data);
+ langs[0]=data.status0;
+ langs[1]=data.status1;
+ // preletimo skozi kolono in dodamo title
+ $.each ( $('#dataTable tbody tr') ,
+ function (i, value) {
+ var element = $(value).find('td:nth-child('+(table_index)+')');
+ if ($(element).is('td')) {
+ var status = parseInt(element.html());
+ var new_val = langs[status];
+ element.attr('title',new_val);
+ element.html(new_val);
+ element.addClass("cellGreen");
+ }
+ });
+ });
+ }
+}
+
function postProcessAddEmailTitles(column) {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt($("#tableIconColspan").val());
// zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=3]").index();
+ // poiščemo elemente z sekvenco: 4-ustreznost 3 - email, 5 - lurker
+ var table_head_children = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele (s spr_id)
+ var table_index = table_head_children.filter("th[spr_id=invitation]").index();
// če sploh prikazujemo statuse
if (table_index > 0) {
//naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+column;
+ table_index = 1+tableIconColspan+column;
var langs = new Array();
// polovimo tekste
$.post('ajax.php?a=getDataEmailTitles', {anketa: srv_meta_anketa_id}, function (data) {
@@ -627,6 +676,7 @@ function postProcessAddEmailTitles(column) {
$.each ( $('#dataTable tbody tr') ,
function (i, value) {
var element = $(value).find('td:nth-child('+(table_index)+')');
+
if ($(element).is('td')) {
var status = parseInt(element.html());
var new_val = langs[status];
@@ -637,65 +687,20 @@ function postProcessAddEmailTitles(column) {
if(status == 1)
element.addClass("invitation_cell");
}
-
- });
- });
- }
-}
-function postProcessAddRelevanceTitles() {
- // povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
- var tableIconColspan = parseInt($("#tableIconColspan").val());
- // zamenjamo statuse
- // poiščemo elemente z sekvenco: 2-ustreznost 3 - status, 5 - lurker
- var table_head_children = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele (s spr_id)
- var table_index = table_head_children.filter("th[seq=2]").index();
- // če sploh prikazujemo statuse
- if (table_index > 0) {
- //naredimo korekcijo: katera je head celica z spr_sid za celico z kurzorjem
- table_index = tableIconColspan+2;
-
- var langs = new Array();
- // polovimo tekste
- $.post('ajax.php?a=getDataLurkerTitles', {anketa: srv_meta_anketa_id}, function (data) {
- data = jQuery.parseJSON(data);
- langs[0]=data.status0;
- langs[1]=data.status1;
- // preletimo skozi kolono in dodamo title
- $.each ( $('#dataTable tbody tr') ,
- function (i, value) {
- var element = $(value).find('td:nth-child('+(table_index)+')');
- if ($(element).is('td')) {
- var status = parseInt(element.html());
- var new_val = langs[status];
- element.attr('title',new_val);
- element.html(new_val);
- element.addClass("cellGreen");
- }
-
});
});
}
}
function showSurveyAnswers(event) {
-/*
- var srv_site_url = $("#srv_site_url").val();
- var target = $(event.target);
- var uid = $(target).parent().find('.data_uid').html();
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
- //alert(href);
- //return false;
- if (uid > 0 ){
- window.open(href, '_blank');
- }
-*/
+
// polovimo user id
var srv_site_url = $("#srv_site_url").val();
var target = $(event.target);
var uid = $(target).parent().parent().find('.data_uid').html();
-// var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'&quick_view=1';
var href = srv_site_url+'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=data&m=quick_edit&usr_id='+uid+'&quick_view=1';
- if (uid > 0 ){
+
+ if (uid > 0 ){
window.location = href;
}
}
@@ -717,9 +722,9 @@ function dataTableResize (sid) {
$('#dataTable col[seq='+seq+']').width(widths[anketa][seq]);
}
- $('#dataTable tr:nth-child(3) th div.dataCell').append('<div class="tableResize"></div>');
+ $('#dataTable tr:nth-child(2) th div.dataCell').append('<div class="tableResize"></div>');
- $('#dataTable tr:nth-child(3) th .tableResize').bind('mousedown', function (e) {
+ $('#dataTable tr:nth-child(2) th .tableResize').bind('mousedown', function (e) {
startObj = $('#dataTable col[seq='+ $(this).closest('th').attr('seq') +']');
mousedown = true;
diff --git a/admin/survey/script/progressBar.js b/admin/survey/script/progressBar.js
index 0a0885f..337a087 100644
--- a/admin/survey/script/progressBar.js
+++ b/admin/survey/script/progressBar.js
@@ -34,8 +34,12 @@ var starttime = 0;
* @param getProgress - ali bomo v sessionu sporocali napredek, ali ne (ce ne, potem samo stejemo cas)
*/
function init_progressBar (getProgress) {
+
+ // Po novem nimamo vec progress bara in prikazemo samo "nalaganje"
+ $('body').addClass('waitlong');
+ $("#loading").show();
- if (typeof(getProgress) == 'undefined') getProgress = false;
+ /*if (typeof(getProgress) == 'undefined') getProgress = false;
$('#fade').fadeTo('slow', 1);
$('#fullscreen').show();
@@ -44,7 +48,6 @@ function init_progressBar (getProgress) {
'<div class="red" id="pbLabel">'+lang['srv_please_wait']+'</div>' +
'<br/><br/>' +
'<div id="pbPercent" class="floatLeft pbLabel">'+lang['srv_collectdata_progress_status']+':</div><div id="pbRowPercent" class="floatLeft"><span id="pbRowPercentLabel"></span><div>&nbsp;</div></div>' +
- '<br class="clr">' +
'</div>'
);
@@ -56,8 +59,7 @@ function init_progressBar (getProgress) {
var d = new Date();
starttime = d.getTime();
- pbInterval=window.setInterval("refresh_progressBar("+getProgress+")",250); // klicemo na 250ms
-
+ pbInterval=window.setInterval("refresh_progressBar("+getProgress+")",250); // klicemo na 250ms*/
}
/**
diff --git a/admin/survey/script/quota.js b/admin/survey/script/quota.js
index 6077385..710f12d 100644
--- a/admin/survey/script/quota.js
+++ b/admin/survey/script/quota.js
@@ -19,40 +19,44 @@ function quota_editing(condition, new_spremenljivka, vrednost) {
function quota_editing_close(condition, vrednost) {
- document.getElementById('quota').style.display = "none";
- if (condition < 0) $('#branching_' + (-condition)).delay('3000').removeClass('spr_editing', 500);
+ $('#quota').fadeOut('slow');
// kalkulacija v pogojih
if (condition >= 0) {
- $('#fade').fadeOut('slow');
+
+ // Ce imamo spodaj odprt popup za if, ga pustimo odprtega
+ if($('#div_condition_editing').is(':hidden')){
+ $('#fade').fadeOut('slow');
+ }
+
$('#div_condition_editing').load(
'ajax.php?t=quota&a=quota_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition,
vrednost: vrednost
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
+ }
+ // kalkulacija kot tip vprasanja
+ else {
- // kalkulacija kot tip vprasanja
- } else {
+ $('#branching_' + (-condition)).delay('3000').removeClass('spr_editing', 500);
// ce smo v vnosih, refreshamo stran, da se izpise nova kalkulacija..
if (__vnosi == 1) {
-
- window.location.reload();
-
- // obicajno zapiranje kalkulacije v urejanju
- } else {
+ window.location.reload();
+ }
+ // obicajno zapiranje kalkulacije v urejanju
+ else {
$('#fade').fadeOut('slow');
+
$('#branching_' + (-condition)).load(
'ajax.php?t=quota&a=quota_editing_close', {
anketa: srv_meta_anketa_id,
condition: condition
- }, function () {
- centerDiv2Page('#div_condition_editing');
- });
+ }
+ );
}
}
}
@@ -92,7 +96,6 @@ function quota_operator_edit(quota, operator) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#quota_editing_inner').scroll();
});
}
@@ -163,7 +166,6 @@ function quota_bracket_edit_new(quota, vrednost, who, what) {
noupdate: __vnosi + __analiza,
anketa: srv_meta_anketa_id
}, function () {
- centerDiv2Page('#div_condition_editing');
$('#quota_editing_inner').scroll();
});
}
diff --git a/admin/survey/script/script.js b/admin/survey/script/script.js
index c0aa65b..450aacc 100644
--- a/admin/survey/script/script.js
+++ b/admin/survey/script/script.js
@@ -24,11 +24,13 @@ var __tabele = 0; // pove ce smo v analizi v krostabulacijah(1)
// poklice se v onload.js
function load_meta_variables () {
srv_meta_anketa_id = $("#srv_meta_anketa_id").val();
+ srv_meta_anketa_hash = $("#srv_meta_anketa_hash").val();
srv_meta_podstran = $("#srv_meta_podstran").val();
srv_meta_akcija = $("#srv_meta_akcija").val();
srv_meta_grupa = $("#srv_meta_grupa").val();
srv_meta_branching = $("#srv_meta_branching").val();
srv_meta_full_screen_edit = ($("#srv_meta_full_screen_edit").val() == 1 ? true : false);
+
loaded = true;
};
@@ -38,7 +40,7 @@ function ajax_start_stop () {
$('body').ajaxStart(function() {
t=setTimeout(function() {$('body').addClass('waitlong');},1000);
$('body').addClass('wait');
- }).ajaxStop(function() {
+ }).ajaxComplete(function() {
clearTimeout(t);
$('body').removeClass('wait').removeClass('waitlong');
});
@@ -138,8 +140,11 @@ function onload_init () {
});
- $('#test_user_alert span').blink(
- {fadeIn: 100, fadeOut: 200,pauseShow:500});
+ $('#test_user_alert span').blink({
+ fadeIn: 100,
+ fadeOut: 200,
+ pauseShow:500
+ });
// Search na vrhu po pritisku na enter skoci na drupal search
$('#searchSurvey').keypress(function (e) {
@@ -376,54 +381,32 @@ function new_anketa() {
var isInfoOver = false;
var isInfoLoaded = false;
function showInfoBox(action,e) {
- if (action == 'show') {
-
- /*
- isInfoOver = true;
- // ugotovimo elementovo pozicijo
- var pos = e.offset();
- // ugotovimo dimenzije info boxa
- var surveyInfo_height = $("#surveyInfo").height();
-
- // ce infobox ne moremo prikazati navzgor, ga prikazemo navzdol
- // ugotovimo velikost strani
- var w_height = $(window).height();
- var w_width = $(document).width();
-
- if (pos.top - surveyInfo_height && (pos.top + surveyInfo_height) < w_height) {
- // risemo navzdol
- show_top = pos.top + e.height() + 5;
- }
- else { // risemo navzgor
- show_top = pos.top - surveyInfo_height - e.height() - 5;
- }*/
+
+ if (action == 'show') {
if (!isInfoLoaded) {
$('#surveyInfo_msg').load('ajax.php?a=displayInfoBox', {anketa: srv_meta_anketa_id});
isInfoLoaded = true;
}
- //$("#surveyInfo").css( { "left": (pos.left+e.width()+5)+ "px", "top": show_top + "px" } ).show().draggable();
-
- } /*else {
- isInfoOver = false;
- setTimeout(function() {hideBottomInfoBox()}, 350);
- }*/
+ }
}
function hideBottomInfoBox() {
- if (isInfoOver == false)
+
+ if (isInfoOver == false)
$('#surveyInfo').fadeOut(400);
-
}
// spremeni ime ankete
function edit_anketa_naslov (anketa) {
$('#anketa_naslov').load('ajax.php?a=edit_anketa', {anketa: anketa, naslov: $('#anketa_polnoIme').val()});
}
+
// spremeni opombo ankete
function edit_anketa_note (anketa){
$.post('ajax.php?a=edit_anketa_note', {anketa: anketa, note: $('#anketa_note').val()});
}
+
// spremeni akronim-kratko ime ankete
function edit_anketa_akronim (anketa){
$.post('ajax.php?a=edit_anketa_akronim', {anketa: anketa, akronim: $('#anketa_akronim').val()});
@@ -436,8 +419,8 @@ function anketa_active (anketa, state, folders, hierarhija) {
if (state == 0) {
// Če aktiviramo anketo, najprej vprašamo po datumih
- $.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: anketa}, function (data) {
- if (data == '1') { // vse ok, anketa nima napak
+ //$.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: anketa}, function (data) {
+ //if (data == '1') { // vse ok, anketa nima napak
$('#fade').fadeTo('slow', 1);
$('#fullscreen').html('').fadeIn('slow');
// aktiviramo anketo in prikažemo okno
@@ -447,18 +430,18 @@ function anketa_active (anketa, state, folders, hierarhija) {
// Pošljemo zahtevek za aktiviranje hierarhije
hierarhija_active(anketa);
}else {
- startTimerActivation(anketa, folders);
+ //startTimerActivation(anketa, folders);
}
});
- }
+ //}
// anketa ima napake
- else {
+ /* else {
// izpišemo obvestilo o napakah
$('#fade').fadeIn('slow');
$('#surveyTrajanje').fadeIn('slow');
$('#surveyTrajanje_msg').html(data);
- }
- });
+ } */
+ //});
}
else
@@ -748,12 +731,16 @@ function anketa_activate_save(anketa,folders) {
var voteCountLimitType = $("input[name=vote_count_limit]:checked").val();
var voteCountValue = $("#vote_count_val").val();
- $.post('ajax.php?a=anketa_save_activation', {anketa:anketa,
- durationType:durationType, durationStarts:durationStarts, durationExpire:durationExpire, voteCountLimitType:voteCountLimitType, voteCountValue:voteCountValue}, function (response) {
- refresh_anketa_activation(anketa,folders);
- });
+ $.post('ajax.php?a=anketa_activate', {anketa:anketa,folders:folders}, function (response) {
+ $.post('ajax.php?a=anketa_save_activation', {anketa:anketa,
+ durationType:durationType, durationStarts:durationStarts, durationExpire:durationExpire, voteCountLimitType:voteCountLimitType, voteCountValue:voteCountValue}, function (response) {
+ refresh_anketa_activation(anketa,folders);
+ });
+ });
} else {
- refresh_anketa_activation(anketa,folders);
+ $.post('ajax.php?a=anketa_activate', {anketa:anketa,folders:folders}, function (response) {
+ refresh_anketa_activation(anketa,folders);
+ });
}
}
@@ -930,7 +917,7 @@ function insert_grupa_before(grupa) {
function grupa_recount(prevent_recount) {
if (prevent_recount) {
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_recount_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_recount_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else {
$.redirect('ajax.php?a=grupa_recount', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa});
}
@@ -1031,17 +1018,23 @@ function brisi_spremenljivko (spremenljivka, text, confirmed) {
//refreshLeft();
$('#branching').html(data.output);
refreshRight();
+
+ // Prikazemo gumb za pobrisana vprasanja (toolbox na levi) in povecamo counter
+ $('#vprasanje_deleted_border, #vprasanje_deleted_toolbox').removeClass('displayNone');
+ var vprasanje_deleted_count = parseInt($('#vprasanje_deleted_count').html()) + 1;
+ $('#vprasanje_deleted_count').html(vprasanje_deleted_count);
}
else if (data.error == 1) {
$('#fade').fadeIn('slow');
- $('#dropped_alert').html(data.output).fadeIn('slow').animate({opacity: 1.0}, 3000, function(){
+ /*$('#dropped_alert').html(data.output).fadeIn('slow').animate({opacity: 1.0}, 3000, function(){
$('#fade').fadeOut("slow");
$('#dropped_alert').fadeOut("slow");
- });
+ });*/
+ $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '600px');
}
else if (data.error == 2) {
$('#fade').fadeIn('slow');
- $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '400px');
+ $('#dropped_alert').html(data.output).fadeIn('slow').css('width', '600px');
}
}
@@ -1516,7 +1509,33 @@ function normalmode_spremenljivka (spremenljivka) {
// prikaze editor za ne-spremenljivko (za karkoli druzga pac)
function create_editor (id, focus) {
- CKEDITOR.replace(id);
+ editor = CKEDITOR.replace(id);
+
+ // Dodamo gumb vec
+ editor.addCommand("advanced_editor_show", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').addClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('More', {
+ label: lang['more2'],
+ command: 'advanced_editor_show',
+ name: "More",
+ });
+
+ // Dodamo gumb manj
+ editor.addCommand("advanced_editor_hide", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').removeClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('Less', {
+ label: lang['less2'],
+ command: 'advanced_editor_hide',
+ name: "Less",
+ });
//namestitev editorja za tekst pri obveščanju
if(gup('a') == 'alert' && focus == false){
@@ -1623,6 +1642,23 @@ function create_editor_hotspot (id, focus) {
editor_init = true;
}
+function create_editor_notification(id) {
+
+ CKEDITOR.replace( id, {toolbar: 'Notification'}); // prikazi editor s Notification configuration
+
+ CKEDITOR.config.removePlugins = 'elementspath'; //odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
+
+ CKEDITOR.instances[id].on('focus', function () {
+ this.execCommand('selectAll');
+ });
+
+ if (id == 'notification')
+ CKEDITOR.config.resize_enabled = false;
+ CKEDITOR.config.height = 238;
+
+ editor_init = true;
+}
+
// odstrani editor za ne-spremenljivka (treba preden se odstrani html)
function remove_editor (id) {
//odstranimo CKEDITOR v kolikor je inicializiran -> če preverjanja potem javi error in ostala javascript datoteka ne deluje
@@ -1639,35 +1675,53 @@ function remove_editor (id) {
// prikaze editor za spremenljivko (definiran mora biti textarea za idjem naslov_$spremenljivka
function editor_display (spremenljivka) {
- //if (editor_init != true) {
- CKEDITOR.replace( 'naslov_'+spremenljivka );
+ editor = CKEDITOR.replace( 'naslov_'+spremenljivka );
- //v kolikor je default vrednost potem naredimo selectAll
- var def = $('#naslov_'+spremenljivka).attr("default");
- if( def == 1) {
- CKEDITOR.instances['naslov_' + spremenljivka].on('focus', function () {
- this.execCommand('selectAll');
- });
- }
- // editor_init = true;
- //}
+ // Dodamo gumb vec
+ editor.addCommand("advanced_editor_show", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').addClass('advanced');
+ }
+ });
+ editor.ui.addButton('More', {
+ label: lang['more2'],
+ command: 'advanced_editor_show',
+ name: "More",
+ });
+
+ // Dodamo gumb manj
+ editor.addCommand("advanced_editor_hide", {
+ exec: function(edt) {
+ $('#'+edt.id+'_toolbox').removeClass('advanced');
+ }
+ });
+
+ editor.ui.addButton('Less', {
+ label: lang['less2'],
+ command: 'advanced_editor_hide',
+ name: "Less",
+ });
+
+ //v kolikor je default vrednost potem naredimo selectAll
+ var def = $('#naslov_'+spremenljivka).attr("default");
+ if( def == 1) {
+ CKEDITOR.instances['naslov_' + spremenljivka].on('focus', function () {
+ this.execCommand('selectAll');
+ });
+ }
}
function editor_display_hotspot (vre_id) {
- //if (editor_init != true) {
- CKEDITOR.replace( 'hotspot_image_'+vre_id, {toolbar: 'HotSpot', width: 300, removePlugins: 'elementspath'}); //izberi config toolbar HotSpot, sirina naj bo 300px, odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
+ CKEDITOR.replace( 'hotspot_image_'+vre_id, {toolbar: 'HotSpot', width: 300, removePlugins: 'elementspath'}); //izberi config toolbar HotSpot, sirina naj bo 300px, odstrani spodnji tag, kjer po default-u so oznake html (body, p, ipd.)
- //v kolikor je default vrednost potem naredimo selectAll
- var def = $('#hotspot_image_'+vre_id).attr("default");
- //if( def == 1) {
- CKEDITOR.instances['hotspot_image_' + vre_id].on('focus', function () {
- this.execCommand('selectAll');
- });
- //}
- // editor_init = true;
- //}
+ //v kolikor je default vrednost potem naredimo selectAll
+ var def = $('#hotspot_image_'+vre_id).attr("default");
+
+ CKEDITOR.instances['hotspot_image_' + vre_id].on('focus', function () {
+ this.execCommand('selectAll');
+ });
}
// odstrani editor (treba preden se odstrani html)
@@ -1789,7 +1843,7 @@ function grupa_sortable (preventMove) {
stop: function () {
if (preventMove == true) {
$(this).sortable('cancel');
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_move_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_grupa_move_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else
$.post('ajax.php?a=vrstnired_grupa', {serialize: $('#grupe').sortable('serialize')});
}
@@ -1826,7 +1880,7 @@ function spremenljivka_sortable (preventMove) {
// {duration: 1});¸
if (preventMove == true) {
$(this).sortable('cancel');
- $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_spremenljivka_move_alert_have_branching'}, function(response) { alert(response); return false;});
+ $.post('ajax.php?a=outputLanguageNote', {anketa: srv_meta_anketa_id, note: 'srv_spremenljivka_move_alert_have_branching'}, function(response) { genericAlertPopup('alert_parameter_response',response); return false;});
} else {
var moved = ui.item.attr('id');
var topage = $("#"+moved).parent().attr('id');
@@ -1942,7 +1996,7 @@ function data_show_labels () {
// povemo koliko stolpcev z ikonicami imamo (se nastavi v html)
var tableIconColspan = parseInt( $("#tableIconColspan").val() ) || 0;
- var tableHeadChildren = $('#dataTable tr:nth-child(3)').children(); // th-ji vrstice header tabele
+ var tableHeadChildren = $('#dataTable tr:nth-child(2)').children(); // th-ji vrstice header tabele
var sprList = [];
@@ -2078,138 +2132,22 @@ function toggleStatusAlertOtherCheckbox(element) {
// alert_expire_other
if ( $('#alert_'+element).is(':checked') )
{
- $('#alert_holder_'+element+'_emails').show();
+ $('#alert_holder_'+element+'_emails').removeClass('displayNone');
} else {
- $('#alert_holder_'+element+'_emails').hide(); }
+ $('#alert_holder_'+element+'_emails').addClass('displayNone'); }
}
-function clear_analizaFilters()
-{
-$('input[id^=analiza_mv_checkbox_]').each(function()
-{ if ( $(this).is(':checked') )
- $(this).trigger('click');
-});
-}
-
-/* komentarji */
-
-// funkcija, ki pohendla komentarje ankete in vprasanj (preusmeri v forum in po potrebi (pri vprasanju) kreira novo temo, ce se ni)
-function comment_manage(type, spremenljivka) {
- $.redirect('ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: type, spremenljivka: spremenljivka});
-}
-
-var siteurl = '';
-if ( typeof srv_site_url !== 'undefined' ) { // komentarji v izpolnjevanju ankete
- siteurl = srv_site_url + '/admin/survey/';
-}
+function clear_analizaFilters(){
-// doda komentar in osvezi oblacek
-// type=0 : anketa, type=1 : vprasanje
-function add_comment (spremenljivka, type, view, vsebina) {
- $('div#survey_comment_'+spremenljivka+'_'+view).load(siteurl+'ajax.php?t=branching&a=comment_manage', {type: type, view: view, spremenljivka: spremenljivka, vsebina: vsebina, anketa: srv_meta_anketa_id, refresh: '1'},
- function () {
- if (view == 0) {
- $('#surveycomment_'+spremenljivka+'_0').qtip("hide"); // pri opciji Dodaj komentar, skrijemo oblacek po submitu
- $('#comment_add_'+spremenljivka).css('visibility', 'visible'); // pokazemo opcijo Poglej komentarje
- } else if (view == 4 || view == 5) {
- window.location.reload();
- }
+ $('input[id^=analiza_mv_checkbox_]').each(function(){
+ if ( $(this).is(':checked') )
+ $(this).trigger('click');
});
}
-// nastavi podanemu linku (a.surveycomment) oblacek za komentarje
-function load_comment (__this, show) {
- if (show == 1) { // opcije za takrat, ko je po defaultu ze na zacetku prikazan - za dodat komentar na anketo
- _when = false;
- _ready = true;
- var corners = ['leftMiddle', 'leftMiddle'];
- var opposites = ['rightMiddle', 'rightMiddle'];
- } else if (show == 2) { // opcija za takrat, ko se aktivira preko oblacka, ko se prikaze takoj
- _when = 'click';
- _ready = true;
- var corners = ['topRight', 'topRight'];
- var opposites = ['bottomLeft', 'bottomLeft'];
- } else { // default za normalne komentarje, da se odpre na klik
- _when = 'click';
- _ready = false;
- var corners = ['topLeft', 'topRight'];
- var opposites = ['bottomRight', 'bottomLeft'];
- }
-
- var width = $(document).width();
- // nastavitve za help
-
- // preverimo ali prikažemo tip na levo stran
- var position = $(__this).offset(); // position = { left: 42, top: 567 }
-
- var left = width - position.left;
-
- var i = (left >= 350) ? 0 : 1;
-
- if ($(__this).data("qtip")) {
- $(__this).qtip("destroy");
- $('div.qtip').html('');
- }
-
- // Posebej naslov ce smo v urejanju
- if($(__this).attr('view') == '1' && !show && $('#comment_qtip_title').length > 0 && $(__this).attr('subtype') == undefined){
- var naslov = $('#comment_qtip_title').val();
- }
- // komentar na vprasanje
- else if($(__this).attr('subtype') == 'q_admin_add'){
- var naslov = lang['srv_testiranje_komentar_q_title'];
- }
- // komentar na if
- else if($(__this).attr('subtype') == 'if_admin_add'){
- var naslov = lang['srv_testiranje_komentar_if_title'];
- }
- // komentarji na if
- else if($(__this).attr('subtype') == 'if_admin_all'){
- var naslov = lang['srv_testiranje_komentar_if_all_title'];
- }
- // komentar na blok
- else if($(__this).attr('subtype') == 'blok_admin_add'){
- var naslov = lang['srv_testiranje_komentar_blok_title'];
- }
- // komentarji na blok
- else if($(__this).attr('subtype') == 'blok_admin_all'){
- var naslov = lang['srv_testiranje_komentar_blok_all_title'];
- }
- // komentarji na vprasanja
- else if($(__this).attr('subtype') == 'q_admin_all'){
- var naslov = lang['srv_testiranje_komentar_q_all_title'];
- }
- // komentarji respondentov na vprasanja
- else if($(__this).attr('subtype') == 'q_resp_all'){
- var naslov = lang['srv_testiranje_komentar_q_resp_all_title'];
- }
- else{
- var naslov = lang['srv_testiranje_komentarji_anketa_title2'];
- }
-
- $(__this).qtip({
- content: {text: '<div id="survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')+'"></div>', title: {text: naslov, button: '&#x2715;'}},
- fixed: false, show: {when: _when, ready: _ready, solo: true},hide: {when: 'click'},
- style: {name: 'light', border: {width: 3, radius: 8}, width: 350, tip: {corner: corners[i]}},
- position: {corner: {tooltip: corners[i], target: opposites[i] }, adjust: {screen : true}},
- api: {
- beforeShow: function () {
- // tuki se poklice zato, ker se drugace content: {url: ....} ne refresha, ce zapres in spet odpres oblacek
- _comment = 1;
- $('div#survey_comment_'+$(__this).attr('spremenljivka')+'_'+$(__this).attr('view')).load(siteurl+'ajax.php?t=branching&a=comment_manage', {anketa: srv_meta_anketa_id, type: $(__this).attr('type'), view: $(__this).attr('view'), spremenljivka: $(__this).attr('spremenljivka'), vsebina: '', anketa: srv_meta_anketa_id, refresh: '1'});
- },
- onShow: function () {
- $('div.qtip').draggable();
- }
- }
- });
-
-}
-var _comment = 0;
/* help */
-
function load_help () { // ta funkcija je še mal slaba.
// prvi oblacek se ob vsakem ajax klicu overloadajo in se pol prikaze veckrat
// drugi oblacek ne dela v IE
@@ -2286,6 +2224,22 @@ function save_help (what, lang) {
try { $('#help_'+what).attr('qtip', '').qtip('destroy'); } catch (e) {/*alert("Napaka"+e)*/};
});
}
+
+// shrani vprasajcek iz masovnega urejanja iz nastavitev vprasajckov
+function save_help_mass(what, lang) {
+
+ var help = $('#edithelp_mass_'+what).val();
+
+ $.post('ajax.php?t=help&a=save_help&lang='+lang, {what: what, help: help}, function(){
+ try {
+ $('#help_'+what).attr('qtip', '').qtip('destroy');
+ }
+ catch (e) {
+ /*alert("Napaka"+e)*/
+ };
+ });
+}
+
function saveGlobalSetting(what)
{
var state = $("input[name="+what+"]:checked").val();
@@ -2517,34 +2471,25 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
if (advanced == 1) {
if ($("#tip_preview_sub_"+tip).length > 0) {
- var pos = $("p[tip="+tip+"]", "#toolbox_add_advanced").offset();
- var width = $("p[tip="+tip+"]", "#toolbox_add_advanced").width();
+
+ $("#tip_preview").css({"left":"520px"});
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- // prikažemo glevni div
+ // prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
$("[name=tip_preview_sub]:visible", "#tip_preview").hide();
$("#tip_preview_sub_"+tip).show();
-
- // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
- //var w_height = $(window).height();
- var height = $("#tip_preview").height();
- //if(w_height < height + pos.top){
- $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
- //}
}
// preview v toolboxu levo
} else {
if ($("#tip_preview_sub_"+tip).length > 0) {
- var pos = $("p[tip="+tip+"]:not(.adv)", "#toolbox_basic").offset();
- var width = $("p[tip="+tip+"]:not(.adv)", "#toolbox_basic").width();
- $("#tip_preview").css( { "left": (13+pos.left + width) + "px", "right":"auto", "top":(pos.top) + "px" } );
- // prikažemo glevni div
+ $("#tip_preview").css({"left":"245px"});
+
+ // prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
@@ -2573,7 +2518,6 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
$("#tip_preview").css( { "right": ($(window).width()-cnt.left) + "px", "left":"auto", "top":(10+pos.top) + "px" } );
else
$("#tip_preview").css( { "right": ($(window).width()-cnt.left) + "px", "left":"auto", "top":(10+pos.top) + "px" } );
- //$("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
// prikažemo glavni div
$("#tip_preview").show();
@@ -2601,241 +2545,194 @@ function show_tip_preview_toolbox (tip, copy, advanced, podtip) {
}
function show_tip_preview(spr, value) {
-// if ($("#tip_preview").is(':hidden'))
if ( $('select#spremenljivka_tip_'+spr).attr('data-ajax') == 'true' ) {
show_tip_preview_toolbox(0, value);
return;
}
+
+ // To zacasno izklopimo - mogoce tega raje ne uporabljamo??
//pozicioniramo div
- var pos = $("#spremenljivka_tip_"+spr).offset();
- var width = $("#spremenljivka_tip_"+spr).width();
+ /*var pos = $("#vprasanje_float_editing").offset();
var body = $('body').width();
- //$("#tip_preview").css( { "left": (10+pos.left + width) + "px", "top":(10+pos.top) + "px" } );
- $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
+
+ $("#tip_preview").css( { "left":"auto", "right": "360px", "top": "250px" } );
+
// prikažemo glevni div
$("#tip_preview").show();
// priredimo še vsebino
$("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_"+value).show();
-}
-function show_tip_preview_first(value) {
-
- if(value < 5 || value == 7 || value == 21)
- stolpec = 1;
- else if(value == 6 || value == 16 || value == 19 || value == 20)
- stolpec = 2;
- else if(value == 5 || value == 8 || value == 17 || value == 18)
- stolpec = 3;
- else if(value > 8 && value < 16)
- stolpec = 'SN';
- else
- stolpec = 4;
-
- //pozicioniramo div
- var pos = $(".questions"+stolpec).offset();
- var width = $(".questions"+stolpec).width();
- var height = $(".questions"+stolpec).height();
-
- if(stolpec == 1 || stolpec == 3)
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- else if(stolpec == 2 || stolpec == 4)
- $("#tip_preview").css( { "left": (pos.left - 200) + "px", "right":"auto", "top":(10+pos.top+height) + "px" } );
- else
- $("#tip_preview").css( { "left": (pos.left - 250) + "px", "right":"auto", "top":(10+pos.top+height) + "px" } );
-
- // prikažemo glevni div
- $("#tip_preview").show();
+ $("#tip_preview_sub_"+value).show();*/
+}
- // priredimo še vsebino
- $("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_"+value).show();
+//preview pri design, orientation in grid subtype dropdownu (ranking, radio b, multigrid)
+function show_tip_preview_subtype(spr, design, tip) {
-}
-function nova_spremenljivka_type(type) {
- $("#tip_preview").hide();
+ //ranking
+ if(tip == '17'){
+ if(design == '0')
+ val = '17';
+ else if(design == '1')
+ val = '17_1';
+ else
+ val = '17_2';
+ }
- if (srv_meta_branching == 1) {
- $('#branching').load('ajax.php?t=branching&a=spremenljivka_new', {anketa: srv_meta_anketa_id, q_type:type}, function() {
- refreshRight();
- refreshBottomIcons('gray');
- });
+ //SN generator imen
+ else if(tip == '9'){
+ if(design == '0')
+ val = '9';
+ else if(design == '1')
+ val = '9_1';
+ else if(design == '2')
+ val = '9_2';
+ else if(design == '3')
+ val = '9_3';
+ }
- } else {
- $('#vprasanja').load('ajax.php?a=nova_spremenljivka', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa, q_type:type}, function() {
- $("#grupe").load('ajax.php?a=refresh_grupe', {anketa: srv_meta_anketa_id, grupa: srv_meta_grupa});
- refreshBottomIcons('gray');
- });
+ //multigrid
+ else if(tip == '6'){
+ if(design == '0')
+ val = '6';
+ else if(design == '1')
+ val = '6_1';
+ else if(design == '2')
+ val = '6_2';
+ else if(design == '3')
+ val = '6_3';
+ else if(design == '4')
+ val = '6_4';
+ else if(design == '5')
+ val = '6_5';
+ else if(design == '6')
+ val = '6_6';
+ else if(design == '8')
+ val = '6_8';
+ else if(design == '9')
+ val = '6_9';
+ else if(design == '10')
+ val = '6_10';
}
-}
-//preview pri design, orientation in grid subtype dropdownu (ranking, radio b, multigrid)
-function show_tip_preview_subtype(spr, design, tip) {
-// if ($("#tip_preview").is(':hidden'))
- {
- //ranking
- if(tip == '17'){
- if(design == '0')
- val = '17';
- else if(design == '1')
- val = '17_1';
- else
- val = '17_2';
- }
+ //radio
+ else if(tip == '1'){
+ if(design == '0')
+ val = '1_1';
+ else if(design == '1')
+ val = '1';
+ else if(design == '2')
+ val = '1_2';
+ else if(design == '4')
+ val = '3';
+ else if (design == '5')
+ val = '1_5';
+ else if (design == '6')
+ val = '1_6';
+ else if (design == '8')
+ val = '1_8';
+ else if (design == '9')
+ val = '1_9';
+ else if (design == '10')
+ val = '1_10';
+ else if (design == '11')
+ val = '1_11';
+ }
- //SN generator imen
- else if(tip == '9'){
- if(design == '0')
- val = '9';
- else if(design == '1')
- val = '9_1';
- else if(design == '2')
- val = '9_2';
- else if(design == '3')
- val = '9_3';
- }
+ //checkbox
+ else if(tip == '2'){
+ if(design == '1')
+ val = '2';
+ else if(design == '0')
+ val = '2_1';
+ else if(design == '2')
+ val = '2_2';
+ else if (design == '6')
+ val = '1_6';
+ else if (design == '8')
+ val = '2_8';
+ else if (design == '10')
+ val = '2_10';
+ else
+ val = '2';
- //multigrid
- else if(tip == '6'){
- if(design == '0')
- val = '6';
- else if(design == '1')
- val = '6_1';
- else if(design == '2')
- val = '6_2';
- else if(design == '3')
- val = '6_3';
- else if(design == '4')
- val = '6_4';
- else if(design == '5')
- val = '6_5';
- else if(design == '6')
- val = '6_6';
- else if(design == '8')
- val = '6_8';
- else if(design == '9')
- val = '6_9';
- else if(design == '10')
- val = '6_10';
- }
+ }
- //radio
- else if(tip == '1'){
- if(design == '0')
- val = '1_1';
- else if(design == '1')
- val = '1';
- else if(design == '2')
- val = '1_2';
- else if(design == '4')
- val = '3';
- else if (design == '5')
- val = '1_5';
- else if (design == '6')
- val = '1_6';
- else if (design == '8')
- val = '1_8';
- else if (design == '9')
- val = '1_9';
- else if (design == '10')
- val = '1_10';
- else if (design == '11')
- val = '1_11';
- }
+ else if (tip == '21') {
+ if (design == '1')
+ val = '21_1';
+ else if (design == '2')
+ val = '21_2';
+ else if (design == '3')
+ val = '21_3';
+ else if (design == '4')
+ val = '21_4';
+ else if (design == '5')
+ val = '21_5';
+ else if (design == '6')
+ val = '21_6';
+ else if (design == '7')
+ val = '21_7';
+ }
- //checkbox
- else if(tip == '2'){
- if(design == '1')
- val = '2';
- else if(design == '0')
- val = '2_1';
- else if(design == '2')
- val = '2_2';
- else if (design == '6')
- val = '1_6';
- else if (design == '8')
- val = '2_8';
- else if (design == '10')
- val = '2_10';
- else
- val = '2';
+ else if (tip == '23') {
+ val = design;
+ }
- }
+ else if (tip == '5') {
+ if(design == '2')
+ val = '5_2';
+ }
- else if (tip == '21') {
- if (design == '1')
- val = '21_1';
- else if (design == '2')
- val = '21_2';
- else if (design == '3')
- val = '21_3';
- else if (design == '4')
- val = '21_4';
- else if (design == '5')
- val = '21_5';
- else if (design == '6')
- val = '21_6';
- else if (design == '7')
- val = '21_7';
- }
+ // lokacija
+ else if(tip == '26'){
+ if(design == '2')
+ val = '26_2';
+ else if(design == '1')
+ val = '26_1';
+ }
- else if (tip == '23') {
- val = design;
- }
+ // slider
+ else if (tip == '7') {
+ val = '7_2';
+ }
- else if (tip == '5') {
- if(design == '2')
- val = '5_2';
- }
- // lokacija
- else if(tip == '26'){
- if(design == '2')
- val = '26_2';
- else if(design == '1')
- val = '26_1';
- }
+ // normalno
+ if (spr >= 0) {
- // slider
- else if (tip == '7') {
- val = '7_2';
- }
+ //pozicioniramo div
+ var pos = $("#spremenljivka_podtip_"+spr).offset();
+ var width = $("#spremenljivka_podtip_"+spr).width();
+ var body = $('body').width();
+ $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
- // normalno
- if (spr >= 0) {
+ // prikažemo glavni div
+ $("#tip_preview").show();
- //pozicioniramo div
- var pos = $("#spremenljivka_podtip_"+spr).offset();
- var width = $("#spremenljivka_podtip_"+spr).width();
- var body = $('body').width();
- //$("#tip_preview").css( { "left": (pos.left) + "px", "right":"auto", "top":(100+pos.top) + "px" } );
- $("#tip_preview").css( { "left":"auto", "right": (body - pos.left + 10) + "px", "top":(pos.top) + "px" } );
+ // priredimo še vsebino
+ $("[name=tip_preview_sub]:visible").hide();
+ $("#tip_preview_sub_" + val).show();
- // pri popuupu za dodajanje advanced tipov vprasanj
- } else {
+ // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
+ var height = $("#tip_preview").height();
+ $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
+ }
+ // pri popuupu za dodajanje advanced tipov vprasanj
+ else {
- //pozicioniramo div
- var pos = $("#toolbox_add_advanced p[tip="+tip+"][podtip="+design+"]").offset();
- var width = $("#toolbox_add_advanced p[tip="+tip+"][podtip="+design+"]").width();
- $("#tip_preview").css( { "left": (10+pos.left + width) + "px", "right":"auto", "top":(10+pos.top) + "px" } );
- }
+ // pozicioniramo div
+ $("#tip_preview").css({"left":"520px"});
- // prikažemo glavni div
- $("#tip_preview").show();
- }
- // priredimo še vsebino
- $("[name=tip_preview_sub]:visible").hide();
- $("#tip_preview_sub_" + val).show();
+ // prikažemo glavni div
+ $("#tip_preview").show();
- // Na koncu zamaknemo gor za visino diva (pri nizkih ekranih)
- //var w_height = $(window).height();
- var height = $("#tip_preview").height();
- //if(w_height < height + pos.top){
- $("#tip_preview").css( { "top":(30+pos.top-height) + "px" } );
- //}
+ // priredimo še vsebino
+ $("[name=tip_preview_sub]:visible").hide();
+ $("#tip_preview_sub_" + val).show();
+ }
}
// skrijemo div za preview
@@ -2845,8 +2742,10 @@ function hide_tip_preview () {
}
function edit_email_invitations(id) {
+
$('#div_float_editing').html('');
$('#div_float_editing').fadeIn("slow");
+
if (id == 0) {
var email_subject = $("#email_subject").val();
var email_text = $("#email_text").val();
@@ -2855,11 +2754,11 @@ function edit_email_invitations(id) {
create_editor('template_text_'+id);
}
).draggable({delay:100, ghosting: true , cancel: 'input, textarea, select, .buttonwrapper'});
- } else {
+ }
+ else {
$('#div_float_editing').load('ajax.php?a=edit_email_invitations', {anketa: srv_meta_anketa_id, id: id},
function () {
CKEDITOR.replace('template_text_'+id);
-// create_editor('template_text_'+id);
}
).draggable({delay:100, ghosting: true , cancel: 'input, textarea, select, .buttonwrapper'});
}
@@ -3172,18 +3071,18 @@ function survey_chaneg_type_cancle() {
$('#fade').fadeOut('slow');
}
function preview_spremenljivka(spremenljivka, lang_id) {
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').html('').fadeIn('slow');
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').load('ajax.php?a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran}).draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').load('ajax.php?a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran})/* .draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'}) */;
}
function preview_spremenljivka_analiza(spremenljivka, lang_id) {
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').html('').fadeIn('slow');
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').load('ajax.php?t=analysis&a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran}).draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
+ $('#fullscreen').load('ajax.php?t=analysis&a=preview_spremenljivka', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, lang_id: lang_id,podstran: srv_meta_podstran})/* .draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'}) */;
}
-function preview_spremenljivka_cancle() {
+function preview_spremenljivka_cancel() {
$('#fullscreen').hide();
if ($('#vprasanje').css('display') != 'block') {
$('#fade').fadeOut('slow');
@@ -3230,9 +3129,9 @@ function IE7_select_disabled_fix () {
function change_alert_respondent(what,el) {
var id = el.attr("id");
var checked = $("#alert_"+what).is(':checked');
- $("span#label_alert_"+what).load('ajax.php?a=change_alert_respondent', {anketa: srv_meta_anketa_id, checked: checked, what:what});
+ $("#label_alert_"+what).load('ajax.php?a=change_alert_respondent', {anketa: srv_meta_anketa_id, checked: checked, what:what});
}
-function chnage_alert_instruction(el) {
+function change_alert_instruction(el) {
var checked = el.is(':checked');
if (checked) {
$("#alert_respondent_cms_instruction").show();
@@ -3243,10 +3142,10 @@ function chnage_alert_instruction(el) {
function alert_add_necessary_sysvar(what,el) {
var id = el.attr("id");
var checked = $("#alert_"+what).is(':checked');
- $("span#label_alert_"+what).load('ajax.php?a=alert_add_necessary_sysvar', {anketa: srv_meta_anketa_id, checked: checked, what:what});
+ $("div#label_alert_"+what).load('ajax.php?a=alert_add_necessary_sysvar', {anketa: srv_meta_anketa_id, checked: checked, what:what});
}
function alert_change_user_from_cms(what, el) {
- $("span#label_alert_"+what).load('ajax.php?a=alert_change_user_from_cms', {anketa: srv_meta_anketa_id});
+ $("div#label_alert_"+what).load('ajax.php?a=alert_change_user_from_cms', {anketa: srv_meta_anketa_id});
}
function alert_edit_if (type, uid) {
@@ -3297,19 +3196,9 @@ function edit_glasovanje(spremenljivka, results, what){
function glas_extra_settings(){
$('.more').toggle();
$('.less').toggle();
- $('#glas_extra_settings').toggle();
-}
-
-//reload za editiranje uvoda/zakljucka pri formi
-/*function load_formIO(spremenljivka, what){
- $("#question_holder").load('ajax.php?a=form_extra', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, what: what});
+ $('#glas_extra_settings').slideToggle();
}
-//reload za editiranje uvoda/zakljucka pri glasovanju
-function load_glasIO(spremenljivka, what){
- $("#question_holder").load('ajax.php?a=form_extra', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka, what: what});
-}*/
-
//hitre nastavitve za formo - what je spremenljivka, ki jo spreminjamo
function edit_form_settings(spremenljivka, results, what){
@@ -3426,13 +3315,57 @@ function newAnketaTemplate() {
}
if(ank_id == '' || ank_id < 1){
- alert(lang['srv_newSurvey_survey_template_error']);
+ genericAlertPopup('srv_newSurvey_survey_template_error');
}
else{
$.redirect('ajax.php?t=library&a=anketa_copy_new', {ank_id:ank_id, naslov:naslov, akronim:akronim, folder:folder});
}
}
+// preveri ali je uploadana datoteka .1ka in pokazi obvestilo
+function checkFileExtension1ka() {
+ var fileName = document.getElementById("restore").value;
+ var fileExtension = fileName.split(".").pop().toLowerCase();
+
+ if(fileName){
+ document.getElementById("file-input-label-populated").textContent = fileName.split("\\").pop();
+
+ document.getElementById("info_text_populated").style.display = "block";
+ document.getElementById("info_text_empty").style.display = "none";
+
+ document.getElementById("file-input-label-clear").style.display = "inline-block";
+ document.getElementById("file-input-label-empty").style.display = "none";
+ document.getElementById("file-input-label-populated").style.display = "inline-block";
+
+ if (fileExtension === "1ka") {
+ document.getElementById("1ka_file_approved_text").style.display = "block";
+ document.getElementById("1ka_file_not_approved_text").style.display = "none";
+ document.getElementById("noSurvey_create").disabled = false;
+ } else {
+ document.getElementById("1ka_file_approved_text").style.display = "none";
+ document.getElementById("1ka_file_not_approved_text").style.display = "block";
+ document.getElementById("noSurvey_create").disabled = true;
+ }
+ }
+ else{
+ document.getElementById("info_text_populated").style.display = "none";
+ document.getElementById("info_text_empty").style.display = "block";
+
+ document.getElementById("file-input-label-clear").style.display = "none";
+ document.getElementById("file-input-label-empty").style.display = "block";
+ document.getElementById("file-input-label-populated").style.display = "none";
+
+ document.getElementById("1ka_file_approved_text").style.display = "none";
+ document.getElementById("1ka_file_not_approved_text").style.display = "none";
+ document.getElementById("noSurvey_create").disabled = true;
+ }
+}
+
+function clearFileInput() {
+ document.getElementById("restore").value = "";
+ checkFileExtension1ka();
+}
+
// Preview vprasanj pri uvozu ankete iz besedila
function anketaFromText_preview(text) {
@@ -3661,12 +3594,19 @@ function recalc_alert_expire(days) {
// enablamo in disablamo vnos max stevila glasov (trajanje)
function voteCountStatus(status) {
+
if (status == 1 || status == 2) {
- $('#vote_count').removeAttr('disabled');
- $('.vote_limit_warning').show();
+ $('#vote_limit_warning').removeClass('displayNone');
+ $('#vote_limit').removeClass('bottom0');
} else {
- $('#vote_count').attr('disabled', true);
- $('.vote_limit_warning').hide();
+ $('#vote_limit_warning').addClass('displayNone');
+ $('#vote_limit').addClass('bottom0');
+ }
+
+ if (status == 1) {
+ $('#vote_limit_all_warning').removeClass('displayNone');
+ } else {
+ $('#vote_limit_all_warning').addClass('displayNone');
}
}
function voteCountToggle(status) {
@@ -3678,6 +3618,7 @@ function voteCountToggle(status) {
}
function survey_statistic_referal(what) {
+
if ($(what).attr('value') == '0') { // nalozimo vsebino samo prvi klik
var type = $("#type").val();
var period = $("#period").val();
@@ -3688,15 +3629,19 @@ function survey_statistic_referal(what) {
$("#survey_referals").slideDown();
$(what).attr('value','1');
});
- } else if ($(what).attr('value') == '1') { // skrijemo
+ }
+ else if ($(what).attr('value') == '1') { // skrijemo
$("#survey_referals").slideUp();
$(what).attr('value','2');
- } else { // prikazemo
+ }
+ else { // prikazemo
$("#survey_referals").slideDown();
$(what).attr('value','1');
}
}
+
function ip_list_podrobno (what) {
+
if ($(what).attr('value') == '0') { // nalozimo vsebino samo prvi klik
var type = $("#type").val();
var period = $("#period").val();
@@ -3707,20 +3652,15 @@ function ip_list_podrobno (what) {
$("#ip_list_podrobno").slideDown();
$(what).attr('value','1');
});
- } else if ($(what).attr('value') == '1') { // skrijemo
+ }
+ else if ($(what).attr('value') == '1') { // skrijemo
$("#ip_list_podrobno").slideUp();
$(what).attr('value','2');
- } else { // prikazemo
+ }
+ else { // prikazemo
$("#ip_list_podrobno").slideDown();
$(what).attr('value','1');
}
-/*
- if ($('#ip_list_podrobno').css('display') == 'none') {
- $('#ip_list_podrobno').slideDown();
- } else {
- $('#ip_list_podrobno').slideUp();
- }
- */
}
function survey_statistic_status(status) {
$('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
@@ -3749,7 +3689,7 @@ function save_user_settings() {
var icons_always_on = $("input[name=icons_always_on]:checked").val();
var full_screen_edit = $("input[name=full_screen_edit]:checked").val();
$.post('ajax.php?a=save_user_settings', {icons_always_on: icons_always_on, full_screen_edit: full_screen_edit}, function() {
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -3760,24 +3700,13 @@ function updateManual1() {
$("#radioManual1").attr("checked", "checked");
}
-function show_success_save(timeout){
-
- if (timeout == undefined)
- timeout = 2500;
-
- $(".btn_savesettings").addClass('ovalbutton_orange').removeClass('ovalbutton_orange');
- $('#success_save').load('ajax.php?a=display_success_save', {anketa: srv_meta_anketa_id}).show();
-
- setTimeout(function() {$('#success_save').animate({opacity:0})}, timeout);
-}
-
function chnage_full_screen_edit() {
//srv_meta_full_screen_edit = $("input[name=full_screen_edit]:checked").val();
srv_meta_full_screen_edit = $("input[name=full_screen_edit]").is(':checked') ? 1 : 0;
$.post('ajax.php?a=save_user_settings', {anketa: srv_meta_anketa_id, full_screen_edit: srv_meta_full_screen_edit}, function() {
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -3826,9 +3755,16 @@ function doExcelExport() {
//return false;
*/
}
-function excelExportChangeDelimit() {
- $('#replace_export_delimit_semicolon').toggle();
- $('#replace_export_delimit_comma').toggle();
+function excelExportChangeDelimit($param) {
+ if ($param == 1) {
+ $('#replace_export_delimit_semicolon').removeClass('displayNone');
+ $('#replace_export_delimit_comma').addClass('displayNone');
+ }
+ else if ($param == 2) {
+ $('#replace_export_delimit_semicolon').addClass('displayNone');
+ $('#replace_export_delimit_comma').removeClass('displayNone');
+ }
+
return false;
}
@@ -3899,6 +3835,25 @@ function check_valid_variable(variable) {
return result;
}
+function check_valid_radio_variable(variable) {
+
+ var ValidPattern = /^[0-9\-]*$/;
+ var result = '';
+
+ for (var i=0; i<variable.length; i++) {
+ var chr = variable.charAt(i);
+
+ // Radio ima lahko samo number
+ if (ValidPattern.test(chr) ){
+ result = result + chr;
+ }
+ }
+
+ result = result.substring(0, 15);
+
+ return result;
+}
+
function clearDefaultValue(el) {
if (el.defaultValue==el.value) el.value = ""
}
@@ -3910,6 +3865,22 @@ function showSearch() {
$('#searchSurvey').animate({width: 'toggle'});
}
+// search for data table
+function showDataTableSearch() {
+ if($('#data_search_value').is(":visible"))
+ $('#data_search_filter').css('background-color', '#f8f8f8');
+ else
+ $('#data_search_filter').css('background-color', 'white');
+
+ $('#data_search_value').animate({width: 'toggle'});
+}
+
+// clear search for data table
+function clearDataTableSearch() {
+ $('#data_search_value').val('');
+ data_search_filter();
+}
+
function showSearchb() {
//$('#searchSurvey').toggle("blind", { direction: 'horizontal', start: }, 500);
//$('#searchSurvey').animate({width: 'toggle'});
@@ -3929,11 +3900,11 @@ function showAdvancedSearch(){
if ($('#advancedSearch').is(":visible")) {
$('#advancedSearch').slideUp('slow');
- $('#searchSettings').find('.minus').removeClass('minus').addClass('plus');
+ $('#advanced_settings_button').removeClass('active');
}
else {
$('#advancedSearch').slideDown('slow');
- $('#searchSettings').find('.plus').removeClass('plus').addClass('minus');
+ $('#advanced_settings_button').addClass('active');
}
}
@@ -4010,6 +3981,35 @@ function dostopPassiveShowAll(show_hide) {
}
}
+function dostopNoteToggle () {
+
+ if($('#addusers_note_checkbox').is(':checked')){
+ $('#addusers_note').removeClass('displayNone');
+ }
+ else{
+ $('#addusers_note').addClass('displayNone');
+ }
+}
+
+// Ajax klic za dodajanje dostopa in posiljanje obvestila
+function dostopAddAccess () {
+
+ var addusers = $('#addusers').val();
+ var addusers_note = '';
+ if($('#addusers_note_checkbox').is(':checked')){
+ addusers_note = $('#addusers_note').val();
+ }
+
+ // Popup z rezultatom (uspesno ali neuspesno dodajanje dostopa)
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=add_survey_dostop_popup', {addusers:addusers, addusers_note:addusers_note, anketa:srv_meta_anketa_id}, function(){
+
+ // Refresh vsebine v ozadju
+ $("#globalSetingsList").load('ajax.php?a=refresh_dostop_settings', {anketa:srv_meta_anketa_id});
+ });
+}
+
function comments_admin_toggle (type) {
if ( $('#comments_admin'+type).attr('admin_on') == 'true' ) {
comments_admin_off(type);
@@ -4228,10 +4228,8 @@ function add_to_library(anketa,where) {
$.post('ajax.php?a=add_to_library', {anketa:anketa, where:where});
}
-function create_archive_survey(anketa, msg) {
+function create_archive_survey(anketa) {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
- $('#fullscreen').append('<div id="survey_archive_note">'+msg+'</div>');
$.post('index.php?anketa='+anketa+'&a=backup_create', {intro_opomba: $('#intro_opomba').val()},
function() {
window.location.reload();
@@ -4239,10 +4237,8 @@ function create_archive_survey(anketa, msg) {
return false;
}
-function create_archive_survey_data(anketa, msg) {
+function create_archive_survey_data(anketa) {
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow').draggable({delay:100, cancel: 'input, textarea, select, .buttonwrapper'});
- $('#fullscreen').append('<div id="survey_archive_note">'+msg+'</div>');
$.post('ajax.php?anketa='+anketa+'&a=backup_data&data=true', {intro_opomba: $('#intro_opomba').val()},
function() {
window.location.reload();
@@ -4315,7 +4311,7 @@ function surveyBaseSettingRadio(what,foreceReload) {
//} else if (data.action == 1) {
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
}
@@ -4327,7 +4323,7 @@ function surveyBaseSettingText(what,refresh) {
} else if ($('[name='+what+']').length) {
value = $('[name='+what+']').val();
} else {
- alert('Error while saving!');
+ genericAlertPopup('alert_save_error');
return false;
}
@@ -4340,7 +4336,7 @@ function surveyBaseSettingText(what,refresh) {
// todo show save window
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
}
@@ -4354,9 +4350,9 @@ function alert_custom(type, uid) {
}
-function exportChangeCheckbox (name) {
-
- $.post('ajax.php?a=exportChangeCheckbox', {anketa:srv_meta_anketa_id, name:name});
+function exportChangeCheckbox () {
+ var value = $("input[name=exportSetting]:checked").val();
+ $.post('ajax.php?a=exportChangeCheckbox', {anketa:srv_meta_anketa_id, value:value});
}
function exportChangeRadio (id,name) {
@@ -4364,17 +4360,43 @@ function exportChangeRadio (id,name) {
$.post('ajax.php?a=exportChangeRadio', {anketa:srv_meta_anketa_id, id:id, name:name, value:value});
}
function setExpirePermanent() {
+ // check for warnings of IF
+ $.post('ajax.php?t=branching&a=check_pogoji&izpis=short', {anketa: srv_meta_anketa_id}, function (data) {
+ // if there are warning, we dont allow change of statement
+ if (data !== '1') {
+ //reset checkox to initial state
+ $("#expirePermanent").prop('checked', !$("#expirePermanent").is(':checked'));
+ $('#fade').fadeTo('slow', 1);
+ $('#fullscreen').html('').fadeIn('slow');
+ // aktiviramo anketo in prikažemo okno
+ $("#fullscreen").load('ajax.php?a=anketa_show_activation', {anketa: srv_meta_anketa_id, folders: folders, izpis:'only_warnings'}, function() {
+ });
+ }
+ //all ok, proced with set permanent
+ else{
+ setExpirePermanentSetting();
+ }
+ });
+}
+function setExpirePermanentSetting() {
makePermanent = $("#expirePermanent").is(':checked');
$.post('ajax.php?a=setExpirePermanent', {anketa:srv_meta_anketa_id, makePermanent:makePermanent}, function (data) {
data = jQuery.parseJSON(data);
if (data.permanent == '0') {
- // pokažemo koledarcek
- $("#expire_img_manual1").show();
+ // enablamo polje
+ $("#expireManual1").removeClass("disabled");
+ $("#expire").find(".ui-datepicker-trigger").removeClass("disabled");
+
} else {
- // skrijemo koledarcek
- $("#expire_img_manual1").hide();
+ // disablamo polje
+ $("#expireManual1").addClass("disabled");
+ $("#expire").find(".ui-datepicker-trigger").addClass("disabled");
+
}
$("#expireManual1").val(data.expire);
+
+ // reload, da se na strani prika#e anketa kot aktivna (switch, link,...)
+ window.location.reload(); return;
});
}
@@ -4389,35 +4411,25 @@ function changeDoCMSUserFilterCheckbox() {
function anketa_restore(anketa) {
- if ( confirm('?') ) {
-
+ if ( confirm(lang['srv_anketa_deleted_restore_confirm']) ) {
$.post('ajax.php?a=anketa_restore', {id: anketa}, function () {
-
window.location.href = 'index.php?anketa='+anketa;
-
})
-
}
-
}
function data_restore(anketa) {
- if ( confirm('?') ) {
-
+ if ( confirm(lang['srv_data_deleted_restore_confirm']) ) {
$.post('ajax.php?a=data_restore', {id: anketa}, function () {
-
window.location.href = 'index.php?anketa='+anketa;
-
})
-
}
-
}
function deleteSurveyDataFile(note) {
if (confirm(note)) {
- $.post('ajax.php?a=deleteSurveyDataFile', {anketa:srv_meta_anketa_id}, function (result) {alert(result)});
+ $.post('ajax.php?a=deleteSurveyDataFile', {anketa:srv_meta_anketa_id}, function (result) {genericAlertPopup('alert_parameter_response',response)});
}
}
function userGlobalSettingChange(what) {
@@ -4430,7 +4442,7 @@ function userGlobalSettingChange(what) {
var state = $(what).is(':checked') ? value : '0';
$.post('ajax.php?t=globalUserSettings', {name:name, value:state}, function (data) {});
} else {
- alert("TODO:userGlobalSettingChange ("+type+")");
+ genericAlertPopup('alert_userGlobalSettingChange',type);
}
}
function changeSurveyLock(what) {
@@ -4505,8 +4517,8 @@ function testiranje_preview_settings_save () {
function showTestSurveySMTP()
{
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=showTestSurveySMTP', $('form[name="settingsanketa_'+srv_meta_anketa_id+'"]').serialize(), function() {});
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=showTestSurveySMTP', $('form[name="settingsanketa_'+srv_meta_anketa_id+'"]').serialize(), function() {});
return false;
}
@@ -4514,7 +4526,7 @@ function showTestSurveySMTP()
function showSurveyUrlLinks(podstran, m)
{
$('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
+ $('#fullscreen').html('').addClass('divPopUp').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=SurveyUrlLinks&a=showLinks',
{
anketa:srv_meta_anketa_id,
@@ -4524,7 +4536,7 @@ function showSurveyUrlLinks(podstran, m)
return false;
}
-function addSurveyUrlLink(podstran ,m)
+function addSurveyUrlLink(podstran, m)
{
$("#fullscreen").load('ajax.php?t=SurveyUrlLinks&a=addLink',
{
@@ -4556,13 +4568,28 @@ function changeParaAnalysisCbx(what, reverse) {
value = !value;
}
var what_id = $(what).attr('id');
-
+
$.post('ajax.php?t=ParaAnalysis&a=setCbx', {anketa: srv_meta_anketa_id,value:value,what:what_id}, function () {
window.location.reload();
});
return false;
}
+
+function check_para_wrap() {
+
+ var value = $("#show_with_zero").is(":checked");
+ if (value) {
+ $("#scroll1").removeClass("table-horizontal-scroll-wrapper1");
+ $("#scroll2").removeClass("table-horizontal-scroll-wrapper2");
+ }
+ else {
+ $("#scroll1").addClass("table-horizontal-scroll-wrapper1");
+ $("#scroll2").addClass("table-horizontal-scroll-wrapper2");
+ }
+
+}
+
function changeParaAnalysisSelect(what) {
var value = $(what).val();
@@ -4660,17 +4687,24 @@ function toggleAdvancedModule(what, reload){
function toggleDataCheckboxes(podstran){
+ if (podstran == 'paraAnalysisGraph'){
+ $("#anketa").addClass("drop_setting_transition");
+ $("#anketa").toggleClass("drop_setting_margin");
+ }
+
if($('#dataSettingsCheckboxes').css('display') == 'none'){
- $("#dataSettingsCheckboxes").slideDown("slow");
+ $("#dataSettingsCheckboxes").fadeIn("medium");
+ $("#toggleDataCheckboxes").addClass("active");
var showSettings = 1;
-
- $(".dropdown_blue").switchClass("dropdown_blue", "dropup_blue");
+
+ $(".fa-angle-down").switchClass("fa-angle-down", "fa-angle-up");
}
else{
- $("#dataSettingsCheckboxes").slideUp("slow");
+ $("#dataSettingsCheckboxes").fadeOut("medium");
+ $("#toggleDataCheckboxes").removeClass("active");
var showSettings = 0;
- $(".dropup_blue").switchClass("dropup_blue", "dropdown_blue");
+ $(".fa-angle-up").switchClass("fa-angle-up", "fa-angle-down");
}
if(podstran == 'data'){
@@ -4683,6 +4717,28 @@ function toggleDataCheckboxes(podstran){
}
}
+function toggle_drop_settings_margin(){
+ $("#anketa").addClass("drop_setting_margin");
+}
+
+// Preklop tabele s podatki - fullscreen / navaden pogled
+function data_fullscreen(data_fullscreen){
+
+ // Fullscreen
+ if(data_fullscreen == 1){
+ $('body').addClass('data_fullscreen');
+ $('#data_fullscreen_1').addClass('active');
+ $('#data_fullscreen_0').removeClass('active');
+ }
+ else{
+ $('body').removeClass('data_fullscreen');
+ $('#data_fullscreen_0').addClass('active');
+ $('#data_fullscreen_1').removeClass('active');
+ }
+
+ $.post('ajax.php?t=dataSettingProfile&a=changeDataFullscreen', {anketa: srv_meta_anketa_id, data_fullscreen:data_fullscreen});
+}
+
// Iskanje po tabeli s podatki
function data_search_filter(){
@@ -4789,12 +4845,9 @@ function diagnosticsParadataChooseDate(){
});
}
function changeSelectOption(){
- //console.log($("#diagnostics_date_selected").val());
- //console.log($("#diagnostics_date_selected").find(":selected").val());
$("#diagnostics_date_selected").find(":selected").prop('selected',false);
//$("#diagnostics_date_selected option").find("[value=99data]").prop('selected',true);
$("#option_99date").prop('selected',true);
- //console.log($("#diagnostics_date_selected").find(":selected").val());
diagnosticsChooseDate();
}
/** END FLOAT HEADER function for tables and div **/
@@ -4809,21 +4862,22 @@ function inline_jezik_edit(id_value){
id.siblings('.sb-edit').hide();
id.replaceWith('<div class="fixed-position"><div id="vrednost_edit">'+
+
+ '<h2><span class="faicon edit-vprasanje st-besede-popup blue"></span><span>'+lang['srv_editor_title']+'</span></h2>'+
+
+ '<div class="popup_close"><a href="#" onclick="inline_jezik_reset(\''+id_value+'\');">✕</a></div>'+
- '<br><textarea name="'+id_value+'" id="'+id_value+'">'+id.html()+'</textarea>'+
+ '<textarea name="'+id_value+'" id="'+id_value+'">'+id.html()+'</textarea>'+
// Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
- '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea><br />'+
+ '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea>'+
- // Gumb shrani
- '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_jezik_save(\''+id_value+'\');">'+
- '<span>'+lang['save']+'</span>'+
- '</a></span>'+
-
- // Gumb zapri
- '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="inline_jezik_reset(\''+id_value+'\');">'+
- '<span>'+lang['srv_zapri']+'</span>'+
- '</a></span><br><br>'+
+ // Gumb shrani / zapri
+
+ '<div class="button_holder popup">'+
+ '<button class="white-blue medium" onclick="inline_jezik_reset(\''+id_value+'\');">'+lang['srv_zapri']+'</button>'+
+ '<button class="blue medium" onclick="inline_jezik_save(\''+id_value+'\');">'+lang['save']+'</button>'+
+ '</div>'+
'</div></div>');
@@ -4951,6 +5005,125 @@ function close_API_window(){
}
+// Prikaz popupap za izvoz paketa anket
+function archive_surveys_display_export(){
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=display_export');
+}
+
+// Toggle checkboxov za seznam anket za izvoz
+function archive_surveys_export_toggle(val){
+
+ // oznacimo vse checkboxe
+ if(val == 1){
+ $(".survey_archive_checkbox").attr("checked", "true");
+ $("#switch_on").addClass("displayNone");
+ $("#switch_off").removeClass("displayNone");
+ }
+ else{
+ $('.survey_archive_checkbox').removeAttr('checked');
+ $("#switch_off").addClass("displayNone");
+ $("#switch_on").removeClass("displayNone");
+ }
+
+ archive_surveys_export_counter();
+}
+
+// Posodobimo stevilo oznacenih anket - counter
+function archive_surveys_export_counter(){
+
+ var selectedCheckboxes = $('.survey_archive_checkbox:checked');
+ var selectedCount = selectedCheckboxes.length;
+
+ $('#mass_select_counter_number').text(selectedCount);
+}
+
+// Ustvari paket anket
+function archive_surveys_export(){
+
+ var form_serialize = $("#survey_archive_form").serializeArray();
+
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=export', form_serialize);
+}
+
+// Download Izvoza paketa anket
+function archive_surveys_download_export(url) {
+
+ var link = $('<a>', {
+ href: url,
+ target: '_blank',
+ download: url.substring(url.lastIndexOf('/') + 1)
+ });
+
+ link.on('click', function() {
+ $(this).remove();
+ });
+
+ $('body').append(link);
+ link[0].click();
+
+ popupClose();
+}
+
+// Prikaz popupa za uvoz paketa anket
+function archive_surveys_display_import(){
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?t=archiveSurveys&a=display_import');
+}
+
+// Izbran paket za uvoz - preverimo ce je zip in prikazemo gumb za uvoz
+function archive_surveys_select_import(){
+
+ var fileInput = $('#archive_surveys_input')[0];
+ var fileName = fileInput.value;
+ //var fileName = $('#archive_surveys_input').val();
+ var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
+ var fileSize = fileInput.files[0].size;
+
+ var warningFileSize = 5 * 1024 * 1024;
+ var maxFileSize = 20 * 1024 * 1024;
+
+ // Napaka - paket ni zip
+ if (fileExtension !== 'zip') {
+ $('#archive_surveys_error').removeClass('displayNone');
+ $('#archive_surveys_import_button, #archive_surveys_error2, #archive_surveys_error3').addClass('displayNone');
+ }
+ // Napaka - paket je vecji od 20 mb
+ else if (fileSize > maxFileSize) {
+ $('#archive_surveys_error3').removeClass('displayNone');
+ $('#archive_surveys_import_button, #archive_surveys_error, #archive_surveys_error2').addClass('displayNone');
+ }
+ // Opozorilo - paket je vecji od 5 mb
+ else if (fileSize > warningFileSize) {
+ $('#archive_surveys_error2, #archive_surveys_import_button').removeClass('displayNone');
+ $('#archive_surveys_error, #archive_surveys_error3').addClass('displayNone');
+ }
+ else {
+ $('#archive_surveys_import_button').removeClass('displayNone');
+ $('#archive_surveys_error, #archive_surveys_error2, #archive_surveys_error2').addClass('displayNone');
+ }
+}
+
+// Izvedemo uvoz paketa anket
+function archive_surveys_import(){
+
+ var formData = new FormData($('#restore')[0]);
+
+ $.ajax({
+ url: 'ajax.php?t=archiveSurveys&a=import',
+ type: 'POST',
+ data: formData,
+ processData: false,
+ contentType: false,
+ success: function(response) {
+ $("#general_popup").html(response);
+ }
+ });
+}
+
+
// Nastavitve modula za chat
function chat_save_settings() {
@@ -4958,7 +5131,7 @@ function chat_save_settings() {
var chat_type = $('input[name=chat_type]:checked').val();
$.post('ajax.php?t=chat&a=save_settings', {anketa: srv_meta_anketa_id, code:code, chat_type:chat_type}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -4970,7 +5143,7 @@ function quiz_save_settings() {
var results_chart = $("input[name=quiz_results_chart]:checked").val();
$.post('ajax.php?t=quiz&a=save_settings', {anketa: srv_meta_anketa_id, results:results, results_chart:results_chart}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -4981,7 +5154,7 @@ function advanced_paradata_save_settings() {
var collect_post_time = $("input[name=collect_post_time]:checked").val();
$.post('ajax.php?t=advanced_paradata&a=save_settings', {anketa: srv_meta_anketa_id, collect_post_time:collect_post_time}, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
// brisanje vseh podatkov ankete pri naprednih parapodatkih
@@ -5003,8 +5176,27 @@ function panel_save_settings() {
var status_default = $('input[name=status_default]').val();
var url = $('input[name=url]').val();
- $("#globalSettingsInner").load('ajax.php?t=panel&a=save_settings', {anketa: srv_meta_anketa_id, user_id_name:user_id_name, status_name:status_name, status_default:status_default, url:url}, function(){
- show_success_save();
+ var cookie_return = $('input[name=cookie_return]:checked').val();
+
+ var continue_later = 0;
+ continue_later = $('input[name=continue_later]:checked').val();
+
+ $("#globalSettingsInner").load('ajax.php?t=panel&a=save_settings', {anketa: srv_meta_anketa_id, user_id_name:user_id_name, status_name:status_name, status_default:status_default, url:url, cookie_return:cookie_return, continue_later:continue_later}, function(){
+ actionNotePopup('success_save', 'success');
+ });
+}
+
+
+// Nastavitve modula za dostop z emailom
+function email_access_save_settings() {
+
+ var captcha = 0;
+ captcha = $('input[name=captcha]:checked').val();
+
+ var terms_text = $('textarea[name=terms_text]').val();
+
+ $("#globalSettingsInner").load('ajax.php?t=email_access&a=save_settings', {anketa:srv_meta_anketa_id, captcha:captcha, terms_text:terms_text}, function(){
+ actionNotePopup('success_save', 'success');
});
}
@@ -5102,7 +5294,6 @@ function setCheckedClass(element, type, ifId){
//Image HotSpot: brisemo obmocja iz slike
image1.mapster('set', false, loop_id); //spucaj trenutno obmocje iz slike
- //console.log(loop_id);
}
});
@@ -5139,9 +5330,6 @@ function evoli_tm_settings_add_oddelek(tm_id) {
}
-// Zakaj je to tukaj?? - ne sme biti tako, ker drugače povozi funkcijo z istim imenom v main/survey (ce se kdaj klice iz tam - recimo pri komentarjih)
-//function checkBranching(){}
-
// Popravimo crte med vprasanji ce imamo blok s horizontalnim izrisom vprasanj
function blockHorizontalLine(spr_id){
@@ -5187,11 +5375,11 @@ function save1kaRacunSettings(){
}
// Gesla nista enaka
else if(geslo1 != geslo2){
- alert(lang['cms_error_password_incorrect']);
+ genericAlertPopup('cms_error_password_incorrect');
}
// Geslo ni dovolj kompleksno
else if(!complexPassword(geslo1)){
- alert(lang['password_err_complex']);
+ genericAlertPopup('password_err_complex');
}
// Pri popravljanju gesla ga opozorimo, da bo odjavljen
else{
@@ -5241,14 +5429,17 @@ function stringContains(password, allowedChars){
*
* @param id
*/
-function izbrisiAlternativniEmail(id){
- if (confirm(lang['delete_alternative_email'])) {
+function izbrisiAlternativniEmail(id, email){
+
+ if (confirm(lang['alternative_email_delete'] + ' ' + email + '?')) {
+
$.post('ajax.php?a=editanketasettings&m=global_user_myProfile', {
izbrisiAlternativniEmail: 1,
- alternativniEmailId: id
+ alternativniEmailId: id
}).success(function(response){
window.location.reload();
});
+
}
}
@@ -5291,63 +5482,53 @@ function check_akronim() {
/* START FUNKCIJA ZA UREJANJE zakljucka po deaktivaciji - popup v urejanju zakljucka */
function vprasanje_jezik_edit_zakljucek(id_value){
- /*$('#fade').fadeTo('slow', 1);*/
+ $('#fade').fadeTo('slow', 1);
var id = $("#"+id_value);
- id.replaceWith('<div class="fixed-position"><div id="vrednost_edit">'+
-
- '<br /><textarea name="'+id_value+'" id="'+id_value+'">'+id.val()+'</textarea>'+
-
- // Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
- '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.val()+'</textarea><br />'+
+ $('#vrednost_edit').show().html(
+ '<h2><span class="faicon edit-vprasanje st-besede-popup blue"></span><span>'+lang['srv_concl_deactivation_text_edit']+'</span></h2>'+
- // Gumb shrani
- '<span class="buttonwrapper floatRight"><a class="ovalbutton ovalbutton_orange" href="#" onclick="vprasanje_jezik_save_zakljucek(\''+id_value+'\');">'+
- '<span>'+lang['save']+'</span>'+
- '</a></span>'+
-
- // Gumb zapri
- '<span class="buttonwrapper floatRight spaceRight"><a class="ovalbutton ovalbutton_gray" href="#" onclick="vprasanje_jezik_reset_zakljucek(\''+id_value+'\');">'+
- '<span>'+lang['srv_zapri']+'</span>'+
- '</a></span>'+
-
- '</div></div>');
+ '<div class="popup_close"><a href="#" onclick="inline_jezik_reset(\''+id_value+'\');">✕</a></div>'+
+
+ '<textarea name="popup_'+id_value+'" id="popup_'+id_value+'">'+id.val()+'</textarea>'+
+
+ // Hidden textarea kamor shranimo staro vrednost, da jo lahko ponastavimo
+ '<textarea name="old_val_'+id_value+'" style="visibility:hidden; display:none;">'+id.html()+'</textarea>'+
+
+ // Gumb shrani / zapri
+ '<div class="button_holder popup">'+
+ '<button class="white-blue medium" onclick="vprasanje_jezik_reset_zakljucek(\''+id_value+'\');">'+lang['srv_zapri']+'</button>'+
+ '<button class="blue medium" onclick="vprasanje_jezik_save_zakljucek(\''+id_value+'\');">'+lang['save']+'</button>'+
+ '</div>'
+ );
- create_editor(id_value);
+ create_editor('popup_'+id_value);
}
-function vprasanje_jezik_reset_zakljucek(id_value){
-
- //$('#fade').fadeOut('slow');
-
- var id = $('#'+id_value);
- var old_val = $("textarea[name=old_val_"+id_value+"]").val();
-
- var par = id.closest('.fixed-position');
-
- CKEDITOR.instances[id_value].destroy();
+function vprasanje_jezik_reset_zakljucek(){
- par.replaceWith('<textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:190px">'+old_val+'</textarea>');
-
- // postavimo se na dno strani
- $('html, body').animate({scrollTop:$(document).height()}, 100);
+ $('#fade').fadeOut('slow');
+ $('#vrednost_edit').hide().html();
}
function vprasanje_jezik_save_zakljucek(id_value){
- var id = $('#'+id_value);
- var par = id.closest('.fixed-position');
-
- CKEDITOR.instances[id_value].destroy();
+ $('#fade').fadeOut('slow');
+
+ CKEDITOR.instances['popup_'+id_value].destroy();
- par.replaceWith('<textarea name="srvlang_srv_survey_non_active" id="srvlang_srv_survey_non_active" style="width:190px">'+id.val()+'</textarea>');
-
- $('html, body').animate({scrollTop:$(document).height()}, 100, function(){
- vprasanje_save(true);
- });
+ var value = $('#popup_'+id_value).val();
+ $('#'+id_value).val(value);
+
+ $('html, body').animate({scrollTop:$(document).height()}, 100, function(){
+ vprasanje_save(true);
+ });
+
+ $('#vrednost_edit').hide().html();
}
+
function prikaziGoogle2faKodo(){
$('#2fa-display').toggle();
}
@@ -5460,13 +5641,8 @@ $(document).ready(function(){
function consultingPopupOpen(){
$('#fade').fadeTo('slow', 1);
- $('#popup_note').html('').fadeIn('slow');
- $("#popup_note").load('ajax.php?a=consulting_popup_open', {anketa: srv_meta_anketa_id});
-}
-function consultingPopupClose(){
-
- $('#popup_note').fadeOut('slow').html('');
- $('#fade').fadeOut('slow');
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=consulting_popup_open', {anketa: srv_meta_anketa_id});
}
@@ -5475,3 +5651,256 @@ function removeUploadFromData(usr_id, spr_id, code){
$("#fullscreen").load('ajax.php?t=postprocess&a=edit_data_question_upload_delete', {anketa: srv_meta_anketa_id, usr_id: usr_id, spr_id: spr_id, code: code});
}
+
+// Kopiranje URLja za anketo
+function CopyToClipboard(copyText){
+ var temp_copy = $('<input>').val(copyText).appendTo('body').select()
+ document.execCommand('copy')
+ temp_copy.remove()
+}
+
+// Popup - opozorilo na vsa vprašanja
+function popupAlertAll(alert_type){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('PopUpNarrow').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=alert_all_popup', {alert_type:alert_type, anketa:srv_meta_anketa_id});
+}
+
+
+//Generičen alert popup
+function genericAlertPopup(name, optional_parameter, class_string){
+
+ if (optional_parameter === undefined) {
+ optional_parameter = "";
+ }
+ if (class_string !== undefined) {
+ $('#general_popup').addClass(class_string);
+ }
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=genericAlertPopup', {name:name, optional_parameter:optional_parameter});
+
+}
+
+//Toggle za prikaz nastavitev in opozoril v parapodatkih
+function toggleParapodatki(){
+
+ var survey_ip = $('input[name=survey_ip]:checked').val();
+ var survey_show_ip = $('input[name=survey_show_ip ]:checked').val();
+ var show_email = $('input[name=show_email ]:checked').val();
+
+ if(survey_ip == '0') {
+ $("#save_IP_warning").removeClass('displayNone');
+ $("#save_IP").removeClass('bottom0');
+ $("#connect_IP").removeClass('displayNone');
+ }
+
+ else {
+ $("#save_IP_warning").addClass('displayNone');
+ $("#save_IP").addClass('bottom0');
+ $("#connect_IP").addClass('displayNone');
+ }
+
+ if(survey_show_ip == '1')
+ $("#connect_IP_warning").removeClass('displayNone');
+
+ else
+ $("#connect_IP_warning").addClass('displayNone');
+
+ if(show_email == '1')
+ $("#connect_identifier_warning").removeClass('displayNone');
+
+ else
+ $("#connect_identifier_warning").addClass('displayNone');
+}
+
+
+function popupClose(){
+ $('#general_popup').fadeOut('slow').html('').attr('class', 'divPopUp');
+ $('#fade').fadeOut('slow');
+}
+
+
+// Note popup spodaj levo
+function actionNotePopup(name, type){
+
+ let anketa = (typeof srv_meta_anketa_id !== 'undefined') ? srv_meta_anketa_id : '';
+
+ $('#action_note_holder').html('').load('ajax.php?a=actionNotePopup', {anketa:anketa, name:name, type:type}, function(){
+
+ setTimeout(function(){
+ actionNotePopupClose();
+ }, 10000);
+ });
+}
+
+// Zapri note popup spodaj levo
+function actionNotePopupClose(){
+
+ $('#action_note_holder .action_note_box').fadeOut(function(){
+ $('#action_note_holder').html('');
+ });
+}
+
+//Hide top_note div
+function top_note_hide(id) {
+
+ $('#'+id).addClass('displayNone');
+
+}
+
+//Objava - pregled (gumbi)
+function publishPopupOpen(name){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=publish_popup_open', {anketa: srv_meta_anketa_id, name: name});
+}
+
+//Objava - check lepi link
+function addPrettyURL(){
+ $.post('ajax.php?a=nice_url_check', {anketa: srv_meta_anketa_id, nice_url: $('#nice_url').val()},
+ function(response) {
+ console.log(response);
+ if(response==""){
+ $.redirect('ajax.php?a=nice_url', {anketa: srv_meta_anketa_id, nice_url: $('#nice_url').val()});
+ }
+ else{
+ $('#add_url_error').html(response).fadeIn('slow');
+ }
+ });
+ return false;
+}
+
+//Objava - prikaz dodajanje lepega linka
+function toggleNiceURL(type) {
+
+ if (type == 'show') {
+ $("#nice_url_button").addClass('displayNone');
+ $("#nice_url_holder").removeClass('displayNone');
+ }
+ else if (type == 'hide') {
+ $("#nice_url_button").removeClass('displayNone');
+ $("#nice_url_holder").addClass('displayNone');
+ }
+}
+
+//Objava - privzete nastavitve
+function togglePublishSettings() {
+ $("#srv_objava_info_more1, #srv_objava_info_more2").toggleClass("displayNone");
+ $("#publish_settings_more").slideToggle('medium');
+}
+
+//Aktivnost - toggle dropdown checkboxes
+function toggleAktivnostCheckboxes(type) {
+ if (type == 'units') {
+ $("#dataSettingsCheckboxes").fadeIn("medium");
+ $("#dataSettingsCheckboxes").toggleClass("displayNone");
+ $("#toggleDataCheckboxes").toggleClass("border_blue");
+ }
+ else if (type == 'date') {
+ $("#dataSettingsCheckboxes_Date").fadeIn("medium");
+ $("#dataSettingsCheckboxes_Date").toggleClass("displayNone");
+ $("#toggleDataCheckboxes_Date").toggleClass("border_blue");
+
+ }
+}
+
+function toggleAddComment (box_id) {
+
+ var toggle = '#comment_toggle_' + box_id;
+ var wrapper = '#comment_wrapper_' + box_id;
+
+ $(toggle).toggle();
+ $(wrapper).toggle();
+}
+
+function closeCommentQtip (box_id) {
+
+ var content = '#survey_comment_' + box_id;
+ $(content).closest('.qtip ').qtip("hide");
+}
+
+function toggleGrafiColorWheel () {
+ $("#chart_custom_skin_cover").css("pointer-events", "auto");
+}
+
+function toggleSurveyTopSettings() {
+ $("#top_napredne_gumb").toggleClass("border_blue");
+ $("#top_napredne_dropdown").toggleClass("displayNone");
+}
+
+//Vprašalnik - enklikarhiv gumb
+function oneClickArchive(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
+}
+
+
+
+// kliči popup
+function show_gdpr_messeage(id_sporocila, anketa){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('hello').fadeIn('slow');
+ $("#general_popup").load('ajax.php?a=show_gdpr_messeage', {id_sporocila: id_sporocila, anketa: anketa});
+
+}
+
+
+//Toggle za dodajanje uporabnika (admini in managerji)
+function toggleAddUser(value){
+ $('.add_user_option').addClass('displayNone');
+ $("#add_user_option_"+value).removeClass('displayNone');
+}
+
+
+function toggleAnketaOpomba () {
+ $("#dodaj-opombo").toggleClass('displayNone');
+}
+
+function toggleAnketaMapa () {
+ $("#dodaj-v-mapo").toggleClass('displayNone');
+ $("#anketa-toggle").toggleClass('bottom0');
+}
+
+//lahko se klice na onclick in downloada file iz url
+function download_file(url) {
+ const a = document.createElement('a')
+ a.href = url
+ a.download = url.split('/').pop()
+ document.body.appendChild(a)
+ a.click()
+ document.body.removeChild(a)
+}
+
+//header when scrolling
+$(function() {
+ $(window).on("scroll", { passive: true }, function() {
+ var header = $(".desktop_header");
+ var top_center_settings = $("#branching .top_center_settings");
+
+ var scroll = $(window).scrollTop();
+
+ if (scroll > 190) {
+ top_center_settings.addClass("top_sticky");
+ header.addClass("shrink_header");
+ }
+ else if (0 < scroll && scroll <= 190) {
+ header.addClass("shrink_header");
+ top_center_settings.removeClass("top_sticky");
+ }
+ else if(scroll > 0){
+ header.addClass("shrink_header");
+ }
+ else {
+ header.removeClass("shrink_header");
+ top_center_settings.removeClass("top_sticky");
+ }
+ });
+}); \ No newline at end of file
diff --git a/admin/survey/script/script_analiza.js b/admin/survey/script/script_analiza.js
index e166278..9cd011c 100644
--- a/admin/survey/script/script_analiza.js
+++ b/admin/survey/script/script_analiza.js
@@ -1,5 +1,7 @@
function analiza_init () {
+
var srv_site_url = $("#srv_site_url").val();
+
// dodamo klike za odpiranje divov profilov (ker so z linki ble tezave)
$("#link_filter_profile").live("click", function(event) {
if (event.button != 0) { // wasn't the left button - ignore
@@ -9,15 +11,6 @@ function analiza_init () {
return false; // "capture" the click
});
-/*
- $("#link_collect_data_setting").live("click", function(event) {
- if (event.button != 0) { // wasn't the left button - ignore
- return true;
- }
- show_collect_data_setting();
- return false; // "capture" the click
- });
-*/
$("#link_status_casi").live("click", function(event) {
if (event.button != 0) { // wasn't the left button - ignore
return true;
@@ -48,13 +41,13 @@ function analiza_init () {
});
// brisanje vnosa
- $('#dataTable td .delete_circle').live('click', function(event) {
+ $('#dataTable td .delete').live('click', function(event) {
// polovimo user id
var usr_id = $(this).parent().parent().find('.data_uid').html();
var row = $(this).parent().parent();
- var note = 'srv_ask_delete';
+ var note = 'srv_ask_delete_data';
// Preverimo ce je med njimi tudi kaksno vabilo - dodatno opozorilo
if($(this).parent().parent().find('.invitation_cell').length == 1){
@@ -70,20 +63,36 @@ function analiza_init () {
if (response == '0') {
row.hide();
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert("Napaka pri brisanju!");
+ genericAlertPopup('alert_delete_error');
}
}
});
});
+ // klik na checkbox za oznacevanje za brisanje
+ $('#dataTable td .delete_data_row').live('click', function(event) {
+
+ // Preverimo ce je kaksen checkbox oznacen - prikazemo gumb za mass delete
+ if($(this).is(':checked')){
+ $("#switch_on").hide();
+ $("#switch_off").show();
+ $("#mass_delete_button").show();
+ }
+ // Skrijemo gumb za mass delete
+ else if($('#dataTable td .delete_data_row:checked').length == 0){
+ $("#switch_on").show();
+ $("#switch_off").hide();
+ $("#mass_delete_button").hide();
+ }
+ });
// editiranje starega vnosa
$('#dataTable td .edit_square').live('click', function(event) {
// polovimo user id
var uid = $(this).parent().parent().find('.data_uid').html();
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+uid+'';
+ var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_hash+'&usr_id='+uid+'';
if (uid > 0 ){
window.open(href, '_blank');
}
@@ -211,15 +220,7 @@ function analiza_init () {
$("#span_color_residual_legend2").toggle();
});
- /*
- $(document).ready(function() {
- $('#dataTable tbody tr:odd').addClass('odd');
-
- $('#dataTable tbody tr:even').addClass('even');
-
- });
- */
// inspect za frekvence
$("td.fr_inspect").live("click", function(event) {
doInspectFromFrequency(this,event);
@@ -249,36 +250,36 @@ function analiza_init () {
$('.div_analiza_holder').live({
mouseenter: function(){
$(this).find('.div_analiza_icons').stop().animate({opacity:1}, 600);
- $(this).find('.div_analiza_scale').stop().animate({opacity:1}, 600);
+ //$(this).find('.div_analiza_scale').stop().animate({opacity:1}, 600);
},
mouseleave: function(){
$(this).find('.div_analiza_icons').stop().animate({opacity:0}, 600);
- $(this).find('.div_analiza_scale').stop().animate({opacity:0}, 600);
+ //$(this).find('.div_analiza_scale').stop().animate({opacity:0}, 600);
}
});
+
// prikazovanje gumbov za hitro skrolanje levo desno v podatkih
- $('#tableContainer').live(
- {
- mouseenter: function()
- {
- var windowWidth = $(window).width(); //retrieve current window width
- var dtWidth = $('#dataTable').outerWidth();
- if ( (dtWidth - windowWidth) > 0)
- {
- $(this).find('#dataTableScroller').stop().animate({opacity:1}, 600);
- }
- },
- mouseleave: function()
- {
- var windowWidth = $(window).width(); //retrieve current window width
- var dtWidth = $('#dataTable').outerWidth();
- if ( (dtWidth - windowWidth) > 0)
- {
- $(this).find('#dataTableScroller').stop().animate({opacity:0}, 600);
- }
- }
- });
+ // Sirina in visina okna
+ var windowWidth = $(window).width();
+ var windowHeight = $(window).height();
+
+ // Sirina in visina tabele
+ var tableWidth = $('#dataTable').width();
+ var tableHeight = $('#dataTable').height();
+
+ // Puscice za scroll prikazemo samo ce je tabela prevelika
+ if(tableWidth > windowWidth && tableHeight > 0.8*windowHeight){
+
+ $('#tableContainer').live({
+ mouseenter: function(){
+ $(this).find('#dataTableScroller').stop().animate({opacity:1}, 600);
+ },
+ mouseleave: function(){
+ $(this).find('#dataTableScroller').stop().animate({opacity:0}, 600);
+ }
+ });
+ }
};
/**
@@ -286,19 +287,21 @@ function analiza_init () {
*/
function statusCasiAction(action) {
- $("#loading").show();
+
if (action == 'change') {
pid = $("#vnosi_current_status_casi").val();
$.post('ajax.php?a=vnosi_change_status_casi', {anketa: srv_meta_anketa_id, pid:pid}, function() {
return reloadData();
});
- } else if (action == 'run') {
- $("#loading").show();
+ }
+ else if (action == 'run') {
+
pid = $("#status_casi .active").attr('value');
// polovimo statuse
var statusCnt = 0;
var srv_userstatus = "";
prefix="";
+
$("input[name^=srv_userstatus]:checked").each(function() {
srv_userstatus = srv_userstatus + prefix + $(this).attr('id');
prefix = ",";
@@ -311,12 +314,13 @@ function statusCasiAction(action) {
// osvezimo vnose
return reloadData();
});
+
// skrijemo vse dive
$("#div_status_values").hide(200);
- //$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'run_rezanje') {
- $("#loading").show();
+ }
+ else if (action == 'run_rezanje') {
+
var rezanje = $("input[name=rezanje]:checked").val();
var rezanje_meja_sp = $("select[name=rezanje_meja_sp]").val();
var rezanje_meja_zg = $("select[name=rezanje_meja_zg]").val();
@@ -333,16 +337,19 @@ function statusCasiAction(action) {
$("#div_status_values").hide(200);
//$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'cancle') {
- $('#loading').hide();
+ }
+ else if (action == 'cancle') {
+
$("#div_status_values").hide(200);
$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'newName') { // dodelimo novo ime profilu
+ }
+ else if (action == 'newName') { // dodelimo novo ime profilu
$("#statusCasiCoverDiv").show();
$("#newProfile").show();
- } else if (action == 'newSave') { // shranimo kot nov profil in pozenemo
- $("#loading").show();
+ }
+ else if (action == 'newSave') { // shranimo kot nov profil in pozenemo
+
pid = $("#status_casi .active").attr('value');
name = $("#newProfileName").val();
$("#newProfile").hide();
@@ -366,15 +373,18 @@ function statusCasiAction(action) {
$("#div_status_values").hide(200);
$('#fade').fadeOut('slow');
$("#div_status_values").html('');
- } else if (action == 'deleteAsk') { // vprašamo po potrditvi
+ }
+ else if (action == 'deleteAsk') { // vprašamo po potrditvi
$("#statusProfileCoverDiv").show();
$("#deleteProfileDiv").show();
- } else if (action == 'deleteCancle') { // prekicemo brisanje
+ }
+ else if (action == 'deleteCancle') { // prekicemo brisanje
$("#deleteProfileDiv").hide();
$("#statusProfileCoverDiv").fadeOut();
- } else if (action == 'deleteConfirm') { // izbrisemo profil
- $("#loading").show();
+ }
+ else if (action == 'deleteConfirm') { // izbrisemo profil
+
pid = $("#status_casi .active").attr('value');
$.post('ajax.php?a=vnosi_delete_status_casi', {anketa: srv_meta_anketa_id, pid:pid}, function() {
// dropdownu izberemo profil
@@ -382,6 +392,7 @@ function statusCasiAction(action) {
// osvezimo vnose
return reloadData();
});
+
$("#deleteProfileDiv").hide();
$("#statusProfileCoverDiv").fadeOut();
$("#div_status_values").hide(200);
@@ -423,7 +434,7 @@ function vnosi_show_rezanje_casi()
var left = width - (msg.width() )-42;
var top = height/2 - (msg.height() / 2);
// pozicioniramo na center strani
- $("#div_status_values").show(200).draggable({delay:100, cancel: 'input, .buttonwrapper, select'});
+ $("#div_status_values").show(200);
}
// prikaže skrit div za nastavitev manjkajočih vrednosti
@@ -478,39 +489,22 @@ function showspremenljivkaSingleVarPopup(id) {
});
}
-function showSpremenljivkaTextAnswersPopup(id,seq) {
- var size = "location=0,height=500,width=700,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
- var recipe = window.open('','RecipeWindow',size);
-
- $.post('ajax.php?t=analysis&a=showSpremenljivkaTextAnswersPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, id:id,seq:seq}, function(response) {
- recipe.document.open();
- recipe.document.write(response);
- recipe.document.close();
- recipe.focus();
- return false;
- });
+function showSpremenljivkaTextAnswersPopup(id) {
+ $('#fade').fadeTo('slow', 1);
+ $('#analysis_popup').html('').fadeIn('slow');
+ $('#analysis_popup').load('ajax.php?t=analysis&a=showSpremenljivkaTextAnswersPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, id:id});
}
-function showAnalizaSingleVarPopup(id,zaPodstran,navedbe,loop) {
- var size = "location=0,height=500,width=700,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
- var recipe = window.open('','RecipeWindow',size);
-
- $.post('ajax.php?t=analysis&a=showAnalizaSingleVarPopup&setSkipCreate=1', {anketa: srv_meta_anketa_id, podstran: zaPodstran, zaPodstran:zaPodstran, id:id,navedbe:navedbe,loop:loop}, function(response) {
- recipe.document.open();
- recipe.document.write(response);
- recipe.document.close();
- recipe.focus();
- return false;
- });
- /*
- $("#fullscreen").load('ajax.php?t=analysis&a=showAnalizaSingleVar', {anketa: srv_meta_anketa_id, podstran: zaPodstran, zaPodstran:zaPodstran, id:id}, function() {
- $('#fullscreen').show();
- $('#fade').fadeTo('slow', 1);
- }).draggable({handle: '#div_analiza_single_var_close, #div_analiza_single_var' });
- */
+function showAnalizaSingleVarPopup(id, zaPodstran, navedbe, loop, _this) {
+
+ var title = encodeURIComponent($(_this).html());
+
+ $('#fade').fadeTo('slow', 1);
+ $('#analysis_popup').html('').fadeIn('slow');
+ $('#analysis_popup').load('ajax.php?t=analysis&a=showAnalizaSingleVarPopup&setSkipCreate=1', {anketa:srv_meta_anketa_id, podstran:zaPodstran, zaPodstran:zaPodstran, id:id, navedbe:navedbe, loop:loop, title:title});
}
-function showAnalizaSingleChartPopup(id,zaPodstran) {
+function showAnalizaSingleChartPopup(id, zaPodstran) {
var size = "location=0,height=550,width=830,scrollbars=1,fullscreen=0,menubar=0,status=0,titlebar=0,toolbar=0,channelmode=0,directories=0";
var recipe = window.open('','RecipeWindow',size);
@@ -543,7 +537,7 @@ function hideAnalizaSingleVarPopup() {
}
function show_single_missing(id, what) {
- //
+
if (what == 0) {
$('tr[name=missing_detail_'+id+']').each(function() {$(this).removeClass('displayNone');});
$("#single_missing_0"+id).hide();
@@ -553,7 +547,8 @@ function show_single_missing(id, what) {
$("#single_missing_percent_"+id).hide();
$("#single_missing_title_"+id).hide();
- } else {
+ }
+ else {
$('tr[name=missing_detail_'+id+']').each(function() {$(this).addClass('displayNone');});
$("#single_missing_0"+id).show();
$("#single_missing_1"+id).hide();
@@ -561,7 +556,6 @@ function show_single_missing(id, what) {
$("#single_missing_suma_freq_"+id).hide();
$("#single_missing_percent_"+id).show();
$("#single_missing_title_"+id).show();
-
}
}
@@ -687,27 +681,6 @@ function renameFilterProfile() {
});
}
-/*function showHideRenameFilterProfile(showhide) {
- if (showhide=='true') {
- //$("#filterProfileCoverDiv").show();
- $("#renameFilterProfileDiv").show();
- }
- else {
- //$("#filterProfileCoverDiv").hide();
- $("#renameFilterProfileDiv").hide();
- }
-}
-function showHideDeleteFilterProfile(showhide) {
- if (showhide=='true') {
- //$("#filterProfileCoverDiv").show();
- $("#deleteFilterProfileDiv").show();
- }
- else {
- //$("#filterProfileCoverDiv").hide();
- $("#deleteFilterProfileDiv").hide();
- }
-}*/
-
function toggle_click_missing(what) {
var variabla = $(what).attr('id').substr(14); // odrezemo prvih 14 znakov : click_missing_
@@ -718,85 +691,85 @@ function toggle_click_missing(what) {
}
if (state == 0) {
- // odstranimo spodnjo polno črto, ostane rdeca crtkana
- $("#anl_click_missing_tr_"+variabla).removeClass('anl_bb');
- $("#anl_click_missing_tr_"+variabla).addClass('anl_dash_red_bb');
- // nič od missingov še ni vidno. prikažemo osnovne missinge in skupo sumo
- $("#click_missing_1_"+variabla).show();
- $("#click_missing_suma_"+variabla).show();
- $(what).attr('value',1);
- // skrijemo osnovni link za vklop manjkajocih (manjkajoci)
- $("#click_missing_"+variabla).hide();
- $("#single_missing_title_"+variabla).show();
- } else if (state == 1 || state == 2 || state == ""){
- // dodamo spodnjo polno črto, skrijemo rdeco crtkana
- $("#anl_click_missing_tr_"+variabla).addClass('anl_bb');
- $("#anl_click_missing_tr_"+variabla).removeClass('anl_dash_red_bb');
- // nič od missingov še ni vidno. prikažemo osnovne missinge in skupo sumo
- $("#click_missing_1_"+variabla).hide();
- $("#click_missing_suma_"+variabla).hide();
- $(what).attr('value',0);
- $("#click_missing_"+variabla).show();
- $("#single_missing_title_"+variabla).hide();
+
+ // Odpremo missinge in skupno sumo
+ $('tr[name=missing_detail_'+variabla+']').each(function() {
+ $(this).removeClass('displayNone');
+ });
+
+ $(what).attr('value', 1);
+
+ // Zamenjamo puscico
+ $(what).find('.arrow2_d').removeClass('arrow2_d').addClass('arrow2_u');
+ }
+ else if (state == 1 || state == 2 || state == ""){
+
+ // Zapremo missinge
+ $('tr[name=missing_detail_'+variabla+']').each(function() {
+ $(this).addClass('displayNone');
+ });
+
+ $(what).attr('value', 0);
+
+ // Zamenjamo puscico
+ $(what).find('.arrow2_u').removeClass('arrow2_u').addClass('arrow2_d');
}
}
-function show_single_percent(id,status) {
+function show_single_percent(id, status) {
- if (status == 0) {
- // pokazemo frekvence in skrijemo procente
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).hide();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').removeClass('anl_dash_bb');
+ // Vklop/izklop frekvenc
+ if (status == 1) {
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).addClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).removeClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).addClass("displayNone");
-
- } else if (status == 1) {
- // pokazemo oboje
- $('[name=single_sums_percent_cnt_'+id+']').addClass('anl_dash_bb');
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).show();});
-
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).removeClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).addClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).addClass("displayNone");
-
- // skrijemo še vrednosti v vrstici z procenti
- $("#span_do_hide_1"+id).hide();
- $("#span_do_hide_2"+id).hide();
- $("#span_do_hide_3"+id).hide();
- $("#span_do_hide_4"+id).hide();
- $("#span_do_hide_5"+id).hide();
-
- } else {
- $('[name=single_sums_percent_cnt_'+id+']').removeClass('anl_dash_bb');
- // pokazemo procente skrijemo frekvence
- $('[name=single_sums_percent_'+id+']').each(function() {$(this).show();});
- $('[name=single_sums_percent_cnt_'+id+']').each(function() {$(this).hide();});
-
- // popravimo css link-e
- $("#img_analysis_f_p_1_"+id+", #img_analysis_f_p_2_"+id).addClass("displayNone");
- $("#img_analysis_f_1_"+id+", #img_analysis_f_2_"+id).addClass("displayNone");
- $("#img_analysis_p_1_"+id+", #img_analysis_p_2_"+id).removeClass("displayNone");
-
- // skrijemo še vrednosti v vrstici z procenti
- $("#span_do_hide_1"+id).show();
- $("#span_do_hide_2"+id).show();
- $("#span_do_hide_3"+id).show();
- $("#span_do_hide_4"+id).show();
- $("#span_do_hide_5"+id).show();
+ // Ugasnemo - samo ce je drug vklopljen
+ if($('#freq-p_button_1_'+id).hasClass('active')){
- }
+ if($('#freq-p_button_2_'+id).hasClass('active')){
+ $('[name=single_sums_percent_cnt_'+id+']').each(function() {
+ $(this).hide().parent().parent().removeClass('freq_row');
+ });
+
+ $('#freq-p_button_1_'+id).removeClass('active');
+ }
+ }
+ // Prizgemo
+ else{
+ $('[name=single_sums_percent_cnt_'+id+']').each(function() {
+ $(this).show().parent().parent().addClass('freq_row');
+ });
+
+ $('#freq-p_button_1_'+id).addClass('active');
+ }
+ }
+ // Vklop/izklop procentov
+ else if (status == 2) {
+
+ // Ugasnemo - samo ce je drug vklopljen
+ if($('#freq-p_button_2_'+id).hasClass('active')){
+
+ if($('#freq-p_button_1_'+id).hasClass('active')){
+ $('[name=single_sums_percent_'+id+']').each(function() {
+ $(this).hide().parent().parent().removeClass('percent_row');
+ });
+
+ $('#freq-p_button_2_'+id).removeClass('active');
+ }
+ }
+ // Prizgemo
+ else{
+ $('[name=single_sums_percent_'+id+']').each(function() {
+ $(this).show().parent().parent().addClass('percent_row');
+ });
+
+ $('#freq-p_button_2_'+id).addClass('active');
+ }
+ }
}
function printAnaliza(ime)
{
if(ime == 'Crosstab')
- var divToPrint=document.getElementById('crosstab_table');
+ var divToPrint=document.getElementById('crosstab_tables');
else if(ime == 'MultiCrosstab')
var divToPrint=document.getElementById('mc_holder');
else if(ime == 'Means')
@@ -857,10 +830,11 @@ function scrollToProfile(_target) {
}
function cancleArchiveAnaliza() {
- $('#fullscreen').hide();
+ $('#fullscreen').hide().removeClass('PopUpNarrow').removeClass('divPopUp');
$('#fade').fadeOut('slow');
}
function doArchiveAnaliza() {
+ $("#fullscreen").addClass('PopUpNarrow').addClass('divPopUp');
$("#fullscreen").load('ajax.php?a=doArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran}, function() {
$('#fade').fadeTo('slow', 1);
@@ -885,7 +859,7 @@ function submitArchiveAnaliza() {
}
function closeArchiveAnaliza() {
- $('#fullscreen').hide();
+ $('#fullscreen').hide().removeClass('PopUpNarrow').removeClass('divPopUp');
$('#fade').fadeOut('slow');
}
@@ -935,7 +909,7 @@ function saveArchiveAnaliza(aid) {
});
} else {
- alert('Napaka!');
+ genericAlertPopup('error');
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -951,7 +925,7 @@ function saveArchiveAnaliza(aid) {
function toggleAnalysisArchiveAccessPassword() {
var value = $("input[name=newAnalysisArchiveAccess]:checked").val();
var pass_div = document.getElementById("newAnalysisArchiveAccessPasswordDiv");
- value == 2 ? pass_div.style.visibility='visible' : pass_div.style.visibility='hidden';
+ value == 2 ? pass_div.style.display='block' : pass_div.style.display='none';
}
function AnalysisArchiveDelete(aid) {
@@ -968,7 +942,7 @@ function doDeleteArchiveAnaliza(aid) {
$('#fade').fadeOut('slow');
});
} else {
- alert('Napaka!');
+ genericAlertPopup('error');
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
}
@@ -984,15 +958,15 @@ function createArchiveBeforeEmail() {
if (parseInt(response) > 0) {
var aid = parseInt(response);
$("#fullscreen").load('ajax.php?a=emailArchiveAnaliza', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, aid:aid}, function() {
- $('#fullscreen').show();
+ $('#fullscreen').addClass("divPopUp").show();
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
- $('#fullscreen').hide();
+ $('#fullscreen').removeClass("PopUpNarrow divPopUp").hide();
$('#fade').fadeOut('slow');
}
});
@@ -1003,173 +977,45 @@ function showHidenTextRow($sequence) {
}
-function showHidenTextTable(spid,num_records,loop_id) {
+function showHidenTextTable(spid, num_records, loop_id) {
+
+ var srv_site_url = $("#srv_site_url").val();
+
if ($("#srv_meta_podstran").length == 0 ) {
var podstran = srv_meta_podstran;
- } else {
+ }
+ else {
var podstran = $("#srv_meta_podstran").val();
}
+
if ($("#srv_meta_anketa_id").length == 0 ) {
var srv_meta_anketa_id = srv_meta_anketa_id;
- } else {
+ }
+ else {
var srv_meta_anketa_id = $("#srv_meta_anketa_id").val();
}
if (podstran == 'frequency') {
- $('#freq_'+spid+'[loop="'+loop_id+'"]').load('ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
- } else if (podstran == 'sumarnik') {
- $('#sum_'+spid+'[loop="'+loop_id+'"]').load('ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
- } else if (podstran == 'charts') {
- $('#chart_'+spid+'_loop_'+loop_id).load('ajax.php?t=charts&a=show_spid_more_table', {anketa:srv_meta_anketa_id, spid:spid, num_records:num_records, loop:loop_id});
- }
-}
-/*
-var intervalPB='';
-var hasStarted=false;
-
-function createCollectData(auto) {
- var _automatic = '&automatic=false';
- if (arguments.length > 0 ) {
- if (auto == true) {
- _automatic = '';
- }
+ $('#freq_'+spid+'[loop="'+loop_id+'"]').load(srv_site_url+'/admin/survey/ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
+ }
+ else if (podstran == 'sumarnik') {
+ $('#sum_'+spid+'[loop="'+loop_id+'"]').load(srv_site_url+'/admin/survey/ajax.php?t=analysis&a=show_spid_more_table', {anketa:srv_meta_anketa_id, podstran: podstran, spid:spid, num_records:num_records, loop_id:loop_id});
+ }
+ else if (podstran == 'charts') {
+ $('#chart_'+spid+'_loop_'+loop_id).load(srv_site_url+'/admin/survey/ajax.php?t=charts&a=show_spid_more_table', {anketa:srv_meta_anketa_id, spid:spid, num_records:num_records, loop:loop_id});
}
-
- if (hasStarted == false) {
- // skrijemo tekst z file statusom
- $('#vnosi_file_status').hide();
-
- // nalozimo div za izris poteka
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').show();
-
- $("#fullscreen").load('prepareDataCrontab.php?action=LoadProgresBar', {anketa: srv_meta_anketa_id}, function () {
- $('#pbAllPercent div').css('width','0%');
- $('#pbCurrPercent div').css('width','0%');
- $('#pbRowPercent div').css('width','0%');
-
- $('#pbAllPercent').css('visibility','visible');
- $('#pbCurrPercent').css('visibility','visible');
- $('#hpbRowPercent, #pbRowPercent').css('visibility','visible');
-
- $.ajax({
- cache: false,
- type: 'post',
- url: 'prepareDataCrontab.php?action=collectSingle'+_automatic+'&anketa='+srv_meta_anketa_id,
- beforeSend: start_display_progressBar()
- });
- });
- }
-}
-
-var pbLabels= new Array()
-pbLabels['1'] = lang['srv_collectdata_progress_status1'];
-pbLabels['2'] = lang['srv_collectdata_progress_status2'];
-pbLabels['3'] = lang['srv_collectdata_progress_status3'];
-pbLabels['8'] = lang['srv_collectdata_progress_status8'];
-pbLabels['9'] = lang['srv_collectdata_progress_status9']
-pbLabels['-1'] = lang['srv_collectdata_progress_status0']
-
-function start_display_progressBar(type) {
- if (type == undefined) type = 'true';
- if (intervalPB=="") {
- $('#start').css('visibility','hidden');
- intervalPB=window.setInterval("display_progressBar('"+type+"')",750); // interval = 400 ms
- $('#loader').css('display','inline');
- } else {
- stop_display_progressBar();
- }
}
-function stop_display_progressBar() {
- $("#loading").show();
- if (intervalPB!="") {
- $('#start').css('visibility','visible');
- window.clearInterval(intervalPB);
- intervalPB="";
+function show_navedbe(spid, status) {
-// $('#fade').fadeOut('slow');
- $('#fullscreen').hide();
- $('#fullscreen').html('');
-
- hasStarted = true;
- return reloadData();
- }
-}
-function display_progressBar(type) {
- if (type == undefined) type = 'true';
- $.ajax({
- cache: false,
- type: 'get',
- url: 'getCollectTimer.php?ajaxTimer='+type,
- success: function(response) {
- var data = jQuery.parseJSON(response);
-
- $('#actionLabel').html(pbLabels[data.id]+' ('+data.t+')');
- $('#pbAllPercent div').css('width',data.pa+'%');
- if ( data.id == '2') {
- // na koliko % smo v header datoteki
- $('#pbCurrPercent div').css('width',data.ph+'%');
- $('#pbCurrPercentLabel').html(data.ph+'%');
- // na katerem zapisu smo
- $('#pbRowPercent div').css('width',data.pr+'%');
- $('#pbRowPercentLabel').html(data.nr);
-
- }
- if ( data.id == '3') {
-// $('#hpbRowPercent, #pbRowPercent').css('visibility','visible');
- // na koliko % smo v data datoteki
- $('#pbCurrPercent div').css('width',data.pd+'%');
- $('#pbCurrPercentLabel').html(data.pd+'%');
- // na katerem zapisu smo
- $('#pbRowPercent div').css('width',data.pr+'%');
- $('#pbRowPercentLabel').html(data.nr);
- }
-
- if ( data.id == '9' || data.id == '-1' ) { // 9 = konec
- hasStarted = true;
- // konec prenosa
- $('#pbCurrPercent div').css('width','100%');
- $('#pbRowPercent div').css('width','100%');
- $('#pbCurrPercentLabel').html('100%');
- $('#pbRowPercentLabel').html('100%');
- stop_display_progressBar();
- }
- }
- });
-}
-*/
-function show_navedbe(spid,status) {
- if (status == 1) {
- // vidno je oboje
- // pokažemo pravilne linke
-// $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("#div_navedbe_1_"+spid).removeClass('displayNone');
- $("#div_navedbe_2_"+spid).addClass('displayNone');
-
- } else if (status == 2) {
- // pokažemo samo navedbe
- // pokažemo pravilne linke
-// $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("#div_navedbe_1_"+spid).addClass('displayNone');
- $("#div_navedbe_2_"+spid).removeClass('displayNone');
- /*
- } else {
-
- // pokažemo samo odgovore
-
- // pokažemo pravilne linke
- $("[name=span_show_navedbe_1_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("[name=span_show_navedbe_2_"+spid+"]").each(function() {$(this).removeClass('displayNone'); });
- $("[name=span_show_navedbe_3_"+spid+"]").each(function() {$(this).addClass('displayNone'); });
- $("#div_navedbe_1_"+spid).removeClass('displayNone');
- $("#div_navedbe_2_"+spid).addClass('displayNone');
-*/
- }
+ if (status == 1) {
+ $("#div_navedbe_1_"+spid).removeClass('displayNone');
+ $("#div_navedbe_2_"+spid).addClass('displayNone');
+ }
+ else if (status == 2) {
+ $("#div_navedbe_1_"+spid).addClass('displayNone');
+ $("#div_navedbe_2_"+spid).removeClass('displayNone');
+ }
}
// Pobrisemo vec vnosov hkrati
@@ -1177,7 +1023,7 @@ function deleteMultipleData(){
var userArray = new Array;
- var note = 'srv_ask_delete';
+ var note = 'srv_ask_delete_multiple_data';
// Napolnimo array z checkanimi userji
$('#div_vnosi_data input:checked').each(function() {
@@ -1205,7 +1051,7 @@ function deleteMultipleData(){
});
} else {
- alert(lang["srv_data_delete_not_selected"]);
+ genericAlertPopup('srv_data_delete_not_selected');
}
}
@@ -1215,11 +1061,13 @@ function selectAll(val){
$(".delete_data_row").attr("checked", "true");
$("#switch_on").hide();
$("#switch_off").show();
+ $("#mass_delete_button").show();
}
else{
$('.delete_data_row').removeAttr('checked');
$("#switch_off").hide();
$("#switch_on").show();
+ $("#mass_delete_button").hide();
}
}
@@ -1238,11 +1086,11 @@ function quickEditAction(action, usr_id){
var href = srv_site_url+'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=data&m=quick_edit';
window.location = href;
} else {
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
} else {
- alert("Napaka pri brisanju!");
+ genericAlertPopup('alert_delete_error');
}
}
});
@@ -1250,7 +1098,7 @@ function quickEditAction(action, usr_id){
// editiranje starega vnosa
if(action == 'edit'){
- var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_id+'&usr_id='+usr_id+'';
+ var href = srv_site_url+'main/survey/edit_anketa.php?anketa='+srv_meta_anketa_hash+'&usr_id='+usr_id+'';
if (usr_id > 0 ){
window.open(href, '_blank');
}
@@ -1305,7 +1153,7 @@ function quickEditAction(action, usr_id){
window.location = href;
});
} else {
- alert("Napaka pri kopiranju!");
+ genericAlertPopup('alert_copy_error');
}
}
});
@@ -1419,7 +1267,7 @@ function doArchiveChart() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveChart() {
@@ -1438,7 +1286,7 @@ function submitArchiveChart() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -1456,9 +1304,9 @@ function createArchiveChartBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -1466,7 +1314,7 @@ function createArchiveChartBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
};
@@ -1501,23 +1349,6 @@ function printCurrentAnalysis(spid) {
pri.print();
}
-/*
- * $.fn.center = function() {
- this.css({
- 'position': 'fixed',
- 'left': '50%',
- 'top': '50%'
- });
- this.css({
- 'margin-left': -this.width() / 2 + 'px',
- 'margin-top': -this.height() / 2 + 'px'
- });
-
- return this;
- }
-
-
- */
$.fn.followTo = function ( pos ) {
var $this = this,
@@ -1541,37 +1372,35 @@ $.fn.followTo = function ( pos ) {
};
+// Horizontalen scroll tabele s podatki pri kliku na puscice
+function dataTableScroll(where){
+ var scroll_width = $(window).width() / 4 * 3;
-/**
- * Copyright (c) 2007-2012 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
- * Dual licensed under MIT and GPL.
- * @author Ariel Flesler
- * @version 1.4.3.1
- */
-//(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
-
-
-/**
- * Copyright (c) 2007-2014 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
- * Licensed under MIT
- * @author Ariel Flesler
- * @version 1.4.14
- */
-//(function(k){'use strict';k(['jquery'],function($){var j=$.scrollTo=function(a,b,c){return $(window).scrollTo(a,b,c)};j.defaults={axis:'xy',duration:0,limit:!0};j.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(f,g,h){if(typeof g=='object'){h=g;g=0}if(typeof h=='function')h={onAfter:h};if(f=='max')f=9e9;h=$.extend({},j.defaults,h);g=g||h.duration;h.queue=h.queue&&h.axis.length>1;if(h.queue)g/=2;h.offset=both(h.offset);h.over=both(h.over);return this._scrollable().each(function(){if(f==null)return;var d=this,$elem=$(d),targ=f,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=win?$(targ):$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}var e=$.isFunction(h.offset)&&h.offset(d,targ)||h.offset;$.each(h.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=j.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(h.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=e[pos]||0;if(h.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*h.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(h.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&h.queue){if(old!=attr[key])animate(h.onAfterFirst);delete attr[key]}});animate(h.onAfter);function animate(a){$elem.animate(attr,g,h.easing,a&&function(){a.call(this,targ,h)})}}).end()};j.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}return j})}(typeof define==='function'&&define.amd?define:function(a,b){if(typeof module!=='undefined'&&module.exports){module.exports=b(require('jquery'))}else{b(jQuery)}}));
-
-function dataTableScroll(where)
-{
if (where == 'left'){
- //$(window).scrollTo('-=500px', 300, { axis:'x' });
-
- var leftPos = $('html').scrollLeft();
- $("html").animate({scrollLeft: leftPos - 700}, 800);
+ var leftPos = $('#tableContainer').scrollLeft();
+ $("#tableContainer").animate({scrollLeft: leftPos - scroll_width}, 600);
}
if (where == 'right'){
- //$(window).scrollTo('+=500px', 300, { axis:'x' });
-
- var leftPos = $('html').scrollLeft();
- $("html").animate({scrollLeft: leftPos + 700}, 800);
+ var leftPos = $('#tableContainer').scrollLeft();
+ $("#tableContainer").animate({scrollLeft: leftPos + scroll_width}, 600);
}
+}
+
+// Prikaz ikon (frekvence, sums...) pri kliku na 3 pikice
+function show_settings_survey_analysis(id_of_element){
+
+ if($('#options'+id_of_element).is(":visible")){
+ $('#options'+id_of_element).hide();
+ }
+ else{
+ $('.options').hide();
+ $('#options'+id_of_element).show();
+ }
+}
+
+// Zapremo popup z analizo
+function closeAnalizaPopup(){
+ $('#analysis_popup').fadeOut('slow').html('');
+ $('#fade').fadeOut('slow');
} \ No newline at end of file
diff --git a/admin/survey/script/skupine.js b/admin/survey/script/skupine.js
index 5f782cc..dae555a 100644
--- a/admin/survey/script/skupine.js
+++ b/admin/survey/script/skupine.js
@@ -5,8 +5,12 @@ function add_skupina(skupine){
var text = $('input[name=skupina]').val();
$.post('ajax.php?t=skupine&a=add_skupina', {anketa: srv_meta_anketa_id, spr_id:spr_id, text:text, skupine:skupine}, function(response){
- //window.location.reload();
- $(response).insertBefore('.add_skupina_button');
+ $('#groups_table').removeClass('displayNone');
+ $('#groups_table tr:last').after(response);
+ $('input[name=skupina]').val('').focus();
+
+ $('#passwords_table').removeClass('displayNone');
+ $('#passwords_table tr:last').after(response);
$('input[name=skupina]').val('').focus();
});
}
@@ -20,11 +24,11 @@ function add_skupina_enter(skupine, event){
}
// brisanje skupine
-function delete_skupina(skupine, vre_id, text){
+function delete_skupina(skupine, vre_id){
var spr_id = $('#skupine_spr_id').val();
- $.post('ajax.php?t=skupine&a=delete_skupina', {anketa: srv_meta_anketa_id, skupine:skupine, spr_id:spr_id, vre_id:vre_id, text:text}, function(){
+ $.post('ajax.php?t=skupine&a=delete_skupina', {anketa: srv_meta_anketa_id, skupine:skupine, spr_id:spr_id, vre_id:vre_id}, function(){
window.location.reload();
});
}
diff --git a/admin/survey/script/slideshow.js b/admin/survey/script/slideshow.js
index 00cdfe2..914cd67 100644
--- a/admin/survey/script/slideshow.js
+++ b/admin/survey/script/slideshow.js
@@ -19,7 +19,7 @@ function slideshow_reset_interval() {
} else {
// ne moremo resetriat, ker checkbox ni izbran
- alert("Error! Select checkbox");
+ genericAlertPopup('alert_checkbox_error');
}
}
@@ -37,7 +37,7 @@ function slideshow_save_settings() {
$.post('ajax.php?t=slideshow&a=save_settings',
{anketa: srv_meta_anketa_id, timer:timer, fixed_interval:fixed_interval, save_entries:save_entries, autostart:autostart, next_btn:next_btn, back_btn:back_btn, pause_btn:pause_btn},function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
} \ No newline at end of file
diff --git a/admin/survey/script/statistika.js b/admin/survey/script/statistika.js
index db3598d..1f4497c 100644
--- a/admin/survey/script/statistika.js
+++ b/admin/survey/script/statistika.js
@@ -97,7 +97,7 @@ function renameStatisticProfile() {
if (response > 0) {
$("#statistic_profile .active").html(name);
} else if (response < 0){
- alert("Error!");
+ genericAlertPopup('error');
}
});
}
@@ -145,7 +145,7 @@ function create_new_statistic_interval_filter() {
$("#div_statistic_date_select").load("ajax.php?t=dashboard&a=loadStatisticProfile", {anketa:srv_meta_anketa_id});
} else {
// prišlo je do napake;
- alert(response);
+ genericAlertPopup('alert_parameter_response',response);
}
});
}
diff --git a/admin/survey/script/statusProfiles.js b/admin/survey/script/statusProfiles.js
index 087ac4d..720e963 100644
--- a/admin/survey/script/statusProfiles.js
+++ b/admin/survey/script/statusProfiles.js
@@ -185,20 +185,55 @@ function statusProfileRefreshData(pid) {
return reloadData('status');
}
-function showColectDataSetting() {
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=statusProfile&a=showColectDataSetting', {anketa:srv_meta_anketa_id});
+// Klik na novo generiranje datoteke s podatki
+function changeColectDataStatus() {
+
+ // Preverimo, ce imamo prevec neustreznih - potem ponudimo popup za brisanje neustreznih
+ let invalid_answers_count = 0;
+ $.post('ajax.php?a=dataCountNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+ invalid_answers_count = response;
+
+ // Imamo prevec neustreznih enot - prikazemo popup za brisanje
+ if(invalid_answers_count > 1000){
+ showInvalidResponsesWarning();
+ }
+ // Na novo zgeneriramo datoteko s podatki
+ else{
+ refreshDataFile();
+ }
+ });
}
+// Prikazemo popup za brisanje neustreznih enot
+function showInvalidResponsesWarning() {
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').addClass('PopUpNarrow');
+ $('#general_popup').html('').fadeIn('slow');
+ //$("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
+ $("#general_popup").load('ajax.php?t=statusProfile&a=showInvalidResponsesWarning', {anketa:srv_meta_anketa_id});
+}
-function changeColectDataStatus() {
+// Na novo zgeneriramo datoteko s podatki
+function refreshDataFile(){
+
var collect_all_status = $('input[name="collect_all_status"]').is(':checked') ? '0' : '1';
+
$.post('ajax.php?t=statusProfile&a=saveCollectDataSetting', {anketa: srv_meta_anketa_id, collect_all_status:collect_all_status}, function(response) {
return reloadData('status');
});
}
+// Pobrišemo neustrezne enote
+function deleteInvalidAnswers() {
+
+ $.post('ajax.php?a=dataDeleteNeustrezne', {anketa: srv_meta_anketa_id}, function(response) {
+
+ // Potem na novo zgeneriramo datoteko s podatki
+ refreshDataFile();
+ });
+}
+
function changeOnlyValidRadio() {
var checked = $('input[name=statusOnlyValid]:checked').val();
@@ -206,5 +241,4 @@ function changeOnlyValidRadio() {
$.post('ajax.php?t=statusProfile&a=changeOnlyValidRadio', {anketa: srv_meta_anketa_id,meta_akcija: srv_meta_akcija, podstran: srv_meta_podstran, checked:checked}, function(response) {
return reloadData('status');
});
-
} \ No newline at end of file
diff --git a/admin/survey/script/surveyCondition.js b/admin/survey/script/surveyCondition.js
index 3670c7e..7223b66 100644
--- a/admin/survey/script/surveyCondition.js
+++ b/admin/survey/script/surveyCondition.js
@@ -19,7 +19,7 @@ function newSurveyCondition()
}
else
{
- alert('Error! (errCode:'+data.error+')');
+ genericAlertPopup('alert_error_code',data.error);
}
}
)
@@ -47,7 +47,7 @@ function deleteSurveyCondition(cid)
}
else
{
- alert('Error! (errCode:'+data.error+')');
+ genericAlertPopup('alert_error_code',data.error);
}
}
);
@@ -73,7 +73,7 @@ function renameSurveyCondition()
}
else
{
- alert(data.errorMsg+'');
+ genericAlertPopup('alert_parameter_dataerrormsg');
}
}
);
diff --git a/admin/survey/script/surveyList.js b/admin/survey/script/surveyList.js
index 5000e72..c7261ef 100644
--- a/admin/survey/script/surveyList.js
+++ b/admin/survey/script/surveyList.js
@@ -1,37 +1,116 @@
+/** Izbrise anketo
+ *
+ * @param anketa
+ * @param confirmtext
+ * @return
+ */
+ function anketa_delete_list (anketa, confirmtext) {
+ if (confirm(confirmtext)) {
+ $("#anketa_list_"+anketa).slideUp();
+ $.post('ajax.php?a=anketa_delete', {anketa: anketa, 'inList': 'true'}, function(response) {
+ if (response == '0') {
+ window.location = 'index.php';
+ }
+ });
+ }
+}
+
+/** doda/odstrani anketo v sistemsko knjiznico in refresa ikono za knjiznico ankete
+ *
+ */
+function surveyList_knjiznica (anketa) {
+ $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_glb").load('ajax.php?t=surveyList&a=surveyList_knjiznica', {anketa: anketa});
+}
+
+/** navadnega uporabnika obvesti da nima dostopa za dodajanje v sistemsko knjiznico
+ *
+ */
+function surveyList_knjiznica_noaccess (msg) {
+ genericAlertPopup('alert_parameter_msg');
+}
+
+/** doda/odstrani anketo v uporabnisko knjiznico in refresa ikono za knjiznico ankete
+*
+*/
+function surveyList_myknjiznica (anketa) {
+ $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_usr").load('ajax.php?t=surveyList&a=surveyList_myknjiznica', {anketa: anketa});
+ //$('#folders').load('ajax.php?t=folders&a=folders_myknjiznica', {anketa: anketa});
+}
+
+function surveyList_myknjiznica_new (anketa) {
+ $.post('ajax.php?t=surveyList&a=surveyList_myknjiznica_new', {anketa: anketa}, function() {
+ window.location.reload(true);
+ });
+}
+
+function surveyList_knjiznica_new (anketa) {
+ $.post('ajax.php?t=surveyList&a=surveyList_knjiznica_new', {anketa: anketa}, function() {
+ window.location.reload(true);
+ });
+}
+
+// Prikaz vec na tri pikice v tabeli anket
+function surveyList_show_more(ank_id){
+
+ if($('#survey_other_box_'+ank_id).hasClass('displayNone')){
+ $('.survey_other_box').addClass('displayNone');
+ $('#survey_other_box_'+ank_id).removeClass('displayNone');
+ }
+ else{
+ $('.survey_other_box').addClass('displayNone');
+ }
+
+}
+
+
+
+/* MOJE ANKETE - pogled z mapami */
+
+// Preklopimo med prikazom folderjev in navadnim prikazom
+function switchFolder(show){
+ if(show == 1)
+ var show_folders = 0;
+ else
+ var show_folders = 1;
+
+ $('#survey_list').load('ajax.php?a=surveyList_folders', {show_folders:show_folders}, function(){
+ $('body').toggleClass('body_mySurveys_folders');
+ $('body').toggleClass('body_mySurveys');
+ });
+}
+
// inicializiramo drag/drop anket in folderjev
-function surveyList_folder_init() {
+function mySurvey_folder_init() {
- $('#survey_list div.droppable').droppable({
- accept: '.mySurvey_draggable',
+ $('#survey_list .mySurvey_droppable').droppable({
+ accept: '#survey_list .mySurvey_draggable',
hoverClass: 'folderhover',
tolerance: 'pointer',
drop: function (e, ui) {
// Drop folderja
- if($(ui.draggable).hasClass('folder_title')){
- var drag_folder = $(ui.draggable).attr('folder_id');
- var parent = $(this).attr('folder_id');
+ if($(ui.draggable).hasClass('folder_item')){
+
+ var drag_folder_id = $(ui.draggable).attr('folder_id');
+ var parent_folder_id = $(this).attr('folder_id');
- $.post('ajax.php?t=surveyList&a=folder_dropped', {parent: parent, drag_folder: drag_folder}, function(){
- window.location.reload();
- });
+ $('#survey_list').load('ajax.php?t=surveyListFolders&a=mysurvey_folder_drop', {parent_folder_id: parent_folder_id, drag_folder_id: drag_folder_id});
}
// Drop ankete
if($(ui.draggable).hasClass('anketa_list')){
- var drag_survey = $(ui.draggable).attr('anketa_id');
- var parent = $(this).attr('folder_id');
- $.post('ajax.php?t=surveyList&a=survey_dropped', {parent: parent, drag_survey: drag_survey}, function(){
- window.location.reload();
- });
+ var drag_survey_id = $(ui.draggable).attr('anketa_id');
+ var parent_folder_id = $(this).attr('folder_id');
+
+ $('#survey_list').load('ajax.php?t=surveyListFolders&a=mysurvey_survey_drop', {parent_folder_id: parent_folder_id, drag_survey_id: drag_survey_id});
}
}
});
- $('.mySurvey_draggable').draggable({
+ $('#survey_list .mySurvey_draggable').draggable({
revert: 'invalid',
- opacitiy: '0.7',
+ opacitiy: '0.9',
helper: 'clone',
cursor: 'move',
cursorAt: { left: 20 },
@@ -41,127 +120,149 @@ function surveyList_folder_init() {
});
}
-// prikazemo/skrijemo ankete v folderju
-function toggle_folder (folder) {
-
- var open = 0;
- if($('#folder_content_'+folder).hasClass('closed')){
- open = 1;
- }
-
- $.post('ajax.php?t=surveyList&a=folder_toggle', {folder: folder, open: open}, function(){
- if(open == 1){
- $('#folder_content_'+folder).removeClass('closed');
- $('#folder_'+folder).find('.plus').removeClass('plus').addClass('minus');
- }
- else{
- $('#folder_content_'+folder).addClass('closed');
- $('#folder_'+folder).find('.minus').removeClass('minus').addClass('plus');
- }
- });
-}
+// Razpremo/skrcimo folder
+function mySurvey_folder_toggle(folder_id){
-// Pobrisemo folder
-function delete_folder (folder) {
- $.post('ajax.php?t=surveyList&a=folder_delete', {folder: folder}, function(){
- window.location.reload();
- });
+ if($('#folder_item_'+folder_id).hasClass('open'))
+ var open = 0;
+ else
+ var open = 1;
+
+ $.post('ajax.php?t=surveyListFolders&a=mysurvey_folder_toggle', {folder_id: folder_id, open: open}, function(){
+
+ if($('#folder_item_'+folder_id).hasClass('open')){
+ $('#folder_item_'+folder_id).removeClass('open');
+ $('#folder_list_'+folder_id).slideUp();
+ }
+ else{
+ $('#folder_item_'+folder_id).addClass('open');
+ $('#folder_list_'+folder_id).slideDown();
+ }
+ });
+
+ event.stopPropagation();
}
-// Ustvarimo folder
-function create_folder (parent) {
-
- $('#survey_list').load('ajax.php?t=surveyList&a=folder_create', {parent: parent}, function(){
-
- var added_folder_id = $('#new_added_folder').val();
+// Aktiviramo folder
+function mySurvey_folder_activate(folder_id){
+
+ $('#right_content').load('ajax.php?t=surveyListFolders&a=mysurvey_folder_activate', {folder_id: folder_id}, function(){
+
+ // Pobrisemo aktivni class aktivnega
+ $('.folder_item').removeClass('active');
- edit_title_folder(added_folder_id);
+ // Dodamo aktivni class novemu
+ $('#folder_item_'+folder_id).addClass('active');
});
}
-// Urejamo ime folderja
-function edit_title_folder (folder) {
-
- var text = $('#folder_title_text_'+folder).text();
+// Prikazemo opcije za urejanje folderja
+function mySurvey_folder_show_edit(element){
+
+ if($(element).parent().find('.folder_item_settings').hasClass('displayNone')){
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').removeClass('displayNone');
+ $(element).addClass('active');
+ }
+ else{
+ $('.folder_item_settings').addClass('displayNone');
+ $('.dots_ver_folder').removeClass('active');
+ $(element).parent().find('.folder_item_settings').addClass('displayNone');
+ $(element).removeClass('active');
+ }
- $('#folder_title_text_'+folder).html('<input type="text" name="folder_title_edit" folder="'+folder+'" id="folder_title_edit_'+folder+'" class="folder_title_edit" value="'+text+'" onBlur="rename_folder(\''+folder+'\'); return false;" />');
- $('#folder_title_edit_'+folder).select();
+ event.stopPropagation();
}
-// Preimenujemo folder
-function rename_folder(folder){
- var text = $('#folder_title_edit_'+folder).val();
- $.post('ajax.php?t=surveyList&a=folder_rename', {folder: folder, text: text}, function(){
- $('#folder_title_text_'+folder).html('<a href="#" onClick="edit_title_folder(\''+folder+'\'); return false;">'+text+'</a>');
- });
+// Zaprtje dodatnega popupa
+function mySurvey_folder_close_popup(){
+ $('#fade').fadeOut('slow');
+ $("#mySurvey_additional_popup").fadeOut().html();
}
-// Kopiramo folder
-function copy_folder(folder){
- $.post('ajax.php?t=surveyList&a=folder_copy', {folder: folder}, function(){
- window.location.reload();
- });
+// Ime novega folderja
+function mySurvey_folder_add_popup(parent_folder_id){
+
+ $('#fade').fadeTo('slow', 1);
+ $("#mySurvey_additional_popup").fadeIn();
+ $("#mySurvey_additional_popup").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_add_popup', {folder_id: parent_folder_id});
}
+// Dodamo nov folder
+function mySurvey_folder_add(parent_folder_id){
-// Preklopimo med prikazom folderjev in navadnim prikazom
-function switchFolder(show){
- if(show == 1)
- var show_folders = 0;
- else
- var show_folders = 1;
+ var folder_name = $("#mySurvey_folder_name").val();
- $('#survey_list').load('ajax.php?a=surveyList_folders', {show_folders:show_folders});
+ $("#left_content").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_add', {folder_id: parent_folder_id, folder_name: folder_name}, function(){
+ mySurvey_folder_close_popup();
+ });
}
+// Ime obstojecega folderja
+function mySurvey_folder_rename_popup(folder_id, folder_name){
-/** Izbrise anketo
- *
- * @param anketa
- * @param confirmtext
- * @return
- */
-function anketa_delete_list (anketa, confirmtext) {
- if (confirm(confirmtext)) {
- $("#anketa_list_"+anketa).slideUp();
- $.post('ajax.php?a=anketa_delete', {anketa: anketa, 'inList': 'true'}, function(response) {
- if (response == '0') {
- window.location = 'index.php';
- }
- });
- }
+ $('#fade').fadeTo('slow', 1);
+ $("#mySurvey_additional_popup").fadeIn();
+ $("#mySurvey_additional_popup").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_rename_popup', {folder_id: folder_id, folder_name: folder_name});
}
+// Preimenujemo obstojeci folder
+function mySurvey_folder_rename(folder_id){
-/** doda/odstrani anketo v sistemsko knjiznico in refresa ikono za knjiznico ankete
- *
- */
-function surveyList_knjiznica (anketa) {
- $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_glb").load('ajax.php?t=surveyList&a=surveyList_knjiznica', {anketa: anketa});
-}
-/** navadnega uporabnika obvesti da nima dostopa za dodajanje v sistemsko knjiznico
- *
- */
-function surveyList_knjiznica_noaccess (msg) {
- alert(msg);
+ var folder_name = $("#mySurvey_folder_name").val();
+
+ $("#left_content").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_rename', {folder_id: folder_id, folder_name: folder_name}, function(){
+ mySurvey_folder_close_popup();
+ });
}
-/** doda/odstrani anketo v uporabnisko knjiznico in refresa ikono za knjiznico ankete
-*
-*/
-function surveyList_myknjiznica (anketa) {
- $("ul#surveyList").find("li#anketa_list_"+anketa).find(".sl_lib_usr").load('ajax.php?t=surveyList&a=surveyList_myknjiznica', {anketa: anketa});
- //$('#folders').load('ajax.php?t=folders&a=folders_myknjiznica', {anketa: anketa});
+// Pobrisemo obstojeci folder
+function mySurvey_folder_delete(folder_id){
+
+ $("#survey_list").load('ajax.php?t=surveyListFolders&a=mysurvey_folder_delete', {folder_id: folder_id});
}
-function surveyList_myknjiznica_new (anketa) {
- $.post('ajax.php?t=surveyList&a=surveyList_myknjiznica_new', {anketa: anketa}, function() {
- window.location.reload();
+
+
+
+/*
+
+// prikazemo/skrijemo ankete v folderju
+function toggle_folder (folder) {
+
+ var open = 0;
+ if($('#folder_content_'+folder).hasClass('closed')){
+ open = 1;
+ }
+
+ $.post('ajax.php?t=surveyList&a=folder_toggle', {folder: folder, open: open}, function(){
+ if(open == 1){
+ $('#folder_content_'+folder).removeClass('closed');
+ //$('#folder_'+folder).find('.arrow2_u').removeClass('arrow2_u').addClass('arrow2_d');
+
+ $('#folder_'+folder).removeClass('closed').addClass('open');
+ }
+ else{
+ $('#folder_content_'+folder).addClass('closed');
+ //$('#folder_'+folder).find('.arrow2_d').removeClass('arrow2_d').addClass('arrow2_u');
+
+ $('#folder_'+folder).removeClass('open').addClass('closed');
+ }
});
}
-function surveyList_knjiznica_new (anketa) {
- $.post('ajax.php?t=surveyList&a=surveyList_knjiznica_new', {anketa: anketa}, function() {
+
+
+// Kopiramo folder
+function copy_folder(folder){
+
+ $.post('ajax.php?t=surveyList&a=folder_copy', {folder: folder}, function(){
window.location.reload();
});
}
+
+*/
+
+
+
diff --git a/admin/survey/script/telephone.js b/admin/survey/script/telephone.js
index 26d126a..f97b082 100644
--- a/admin/survey/script/telephone.js
+++ b/admin/survey/script/telephone.js
@@ -1,3 +1,34 @@
+// meta podatki
+var srv_meta_anketa_id = $("#srv_meta_anketa").val();
+
+// avtomatsko vsake 30 sekund preverimo, ce se je pojavila kaksna nova stevilka
+function preveri_nove_stevilke () {
+ $.timer(30000, function (timer) {
+
+ $('#preveri_stevilke').load('ajax.php?t=telefon&a=preveri_stevilke', {anketa: srv_meta_anketa_id});
+ timer.stop();
+ });
+}
+
+// dashboard filter na datum
+function tel_date_filter () {
+
+ // Ce imamo nastavljen datum "od"
+ var dateFrom = $('#tel_dash_dateFrom').val();
+ var dateFromText = '';
+ if(dateFrom != '')
+ dateFromText = '&date_from=' + dateFrom;
+
+ // Ce imamo nastavljen datum "do"
+ var dateTo = $('#tel_dash_dateTo').val();
+ var dateToText = '';
+ if(dateTo != '')
+ dateToText = '&date_to=' + dateTo;
+
+ var srv_site_url = $("#srv_site_url").val();
+ srv_site_url += 'admin/survey/index.php?anketa='+srv_meta_anketa_id+'&a=telephone&m=dashboard'+dateFromText+dateToText;
+ window.location.href = srv_site_url;
+}
function showPhnList(pid) {
$("#globalSettingsInner").load('ajax.php?t=telephone&m=recipients_lists', {anketa:srv_meta_anketa_id, pid:pid });
@@ -8,7 +39,7 @@ function phn_settings_save() {
form_serialize[form_serialize.length] = {name:'anketa', value:srv_meta_anketa_id}
$("#globalSettingsInner").load('ajax.php?t=telephone&m=settings_save', form_serialize, function(){
- show_success_save();
+ actionNotePopup('success_save', 'success');
});
}
@@ -45,10 +76,10 @@ function phn_add_recipients() {
$elm.next().find('a').addClass('active');
$elm.removeClass('inv_ff_left_on').addClass('inv_ff_right_on').next().next().addClass('inv_ff_left_on');
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
return true;
@@ -79,7 +110,7 @@ function phnStartSurvey(usr_id){
window.location = return_data.reloadUrl;
return false;
} else {
- alert(return_data.msg);
+ genericAlertPopup('alert_parameter_datamsg');
}
},
async: false
@@ -87,7 +118,7 @@ function phnStartSurvey(usr_id){
}
-function phnNextActionChange() {
+function phnNextActionChange(phnNextAction) {
var phnNextAction = $("input[name=phnNextAction]:checked").val();
$.post('ajax.php?t=telephone&m=setNextAction', {anketa:srv_meta_anketa_id,noNavi:'true',phnNextAction:phnNextAction});
}
@@ -177,13 +208,13 @@ function phnGetNewProfileName() {
$('#fullscreen').html('').fadeIn('slow');
$("#fullscreen").load('ajax.php?t=telephone&m=getProfileName', {anketa:srv_meta_anketa_id, recipients_list:recipients_list, fields:fields, noNavi:'true', pid:pid});
} else {
- alert(lang['srv_invitation_note1']);
+ genericAlertPopup('srv_invitation_note1',null,'PopUpNarrow');
}
} else {
- alert(lang['srv_invitation_note2']);
+ genericAlertPopup('srv_invitation_note2',null,'PopUpNarrow');
}
} else {
- alert('Invalid PID!');
+ genericAlertPopup('alert_invalidPID',null,'PopUpNarrow');
}
}
@@ -241,3 +272,20 @@ function phnUndoStatus(usr_id) {
phnGoToUser(usr_id);
});
}
+
+// Sortiranje box-ov pri dodajanju respondentov
+function initTelephoneConnectedSortable(){
+
+ // Na mobitelu ne inicializiramo sorrtiranja, ker potem gumbi niso klikabilni (na nekaterih androidih ne deluje ok)
+ if($(window).width() < 850)
+ return false;
+
+ $('ul.connectedSortable').sortable({
+ update: function(){
+ refreshFieldsList();
+ },
+ forcePlaceholderSize:'true',
+ tolerance:'pointer',
+ placeholder:'inv_field_placeholder'
+ });
+}
diff --git a/admin/survey/script/themes.js b/admin/survey/script/themes.js
index 0ec5257..d48ebc1 100644
--- a/admin/survey/script/themes.js
+++ b/admin/survey/script/themes.js
@@ -10,13 +10,13 @@ function themes_init() {
$.post("ajax.php?t=theme&a=changeProgressbar", {anketa:srv_meta_anketa_id, progressbar:progressbar}, function() {});
});
- $("a.theme_links_preview").live('click', function(event) {
+ $("div.theme_links_preview").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
window.open($(this).attr('src')+'&size=full', '_blank');
});
- $("a.theme_delete.theme").live('click', function(event) {
+ $("div.theme_delete.theme").live('click', function(event) {
event.preventDefault();
event.stopPropagation();
@@ -27,13 +27,6 @@ function themes_init() {
});
}
});
-
- /*$("#div_theme_group span.theme_links_rename").live('click', function(event) {
- var theme = $(this).attr('theme');
- $('#fade').fadeTo('slow', 1);
- $('#fullscreen').html('').fadeIn('slow');
- $("#fullscreen").load('ajax.php?t=theme&a=theme_rename', {anketa:srv_meta_anketa_id, theme:theme});
- });*/
$("#theme_rename_confirm").live('click', function(event) {
var theme_new_name = $("#theme_new_name").val();
@@ -64,20 +57,6 @@ function themes_init() {
return false;
});
- // change theme
- $("#div_theme_group img.theme").live('click', function(event) {
- event.preventDefault();
- event.stopPropagation();
- var css = $(this).attr('css');
- var gid = $(this).attr('gid');
- $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
- $("#div_theme_group_holder").html(data.group_themes);
- $('#div_theme_groups').html(data.theme_name);
- $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
- show_success_save();
- }, 'json');
- });
-
//change checkbox value
$('#izbira-checkbox-gumbov').change(function(){
var izbira = $(this).find(":selected").val();
@@ -222,6 +201,45 @@ function te_change_name (_this) {
function toggle_custom_themes () {
- $('.user_themes_button').toggleClass("plus minus");
- $('#div_theme_group.custom').toggle('medium');
+ $('.user_themes_button').toggleClass("fa-angle-up");
+ $('.div_theme_group.custom').slideToggle('medium');
+}
+
+function changeTheme (gid, css) {
+ $.post("ajax.php?t=theme&a=changeTheme", {anketa:srv_meta_anketa_id, gid:gid,css:css}, function(data) {
+ $("#div_theme_group_holder").html(data.group_themes);
+ $('#div_theme_groups').html(data.theme_name);
+ $('#div_theme_group_holder').append('<div id="success_save">'+lang['srv_success_save']+'</div>');
+ actionNotePopup('success_save', 'success');
+ }, 'json');
+}
+
+function show_settings(id_of_element){
+
+ if($('#additional_settings_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
+}
+
+
+function show_settings_mobile(id_of_element){
+
+ // var options = document.getElementsByClassName("options_mobile"+id_of_element)[0];
+ var options = document.getElementById("options_mobile"+id_of_element);
+ var additional_settings = document.getElementById("additional_settings_mobile_"+id_of_element);
+
+ additional_settings.classList.toggle("active");
+
+
+ if($('#additional_settings_mobile_'+id_of_element).hasClass('displayNone')){
+ $('.buttons-window').addClass('displayNone');
+ $('#additional_settings_mobile_'+id_of_element).removeClass('displayNone');
+ }
+ else{
+ $('.buttons-window').addClass('displayNone');
+ }
} \ No newline at end of file
diff --git a/admin/survey/script/timeProfiles.js b/admin/survey/script/timeProfiles.js
index 619f7f7..50833ad 100644
--- a/admin/survey/script/timeProfiles.js
+++ b/admin/survey/script/timeProfiles.js
@@ -117,7 +117,7 @@ function timeProfileAction(action) {
var stat_interval = $("#stat_interval").val();
if (type == 1 && stat_interval == '') {
// če je type 1 (intervalni način) in interval ni izbran, damo opozorilo
- alert(lang['srv_time_profile_error_interval']);
+ genericAlertPopup('srv_time_profile_error_interval');
return false;
} else {
$.post("ajax.php?t=timeProfile&a=saveProfile", {anketa:srv_meta_anketa_id, pid:pid, type:type, startDate:startDate,endDate:endDate,stat_interval:stat_interval}, function(response) {
@@ -125,7 +125,7 @@ function timeProfileAction(action) {
});
}
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
return false;
}
} \ No newline at end of file
diff --git a/admin/survey/script/ttest.js b/admin/survey/script/ttest.js
index 6daf350..edea283 100644
--- a/admin/survey/script/ttest.js
+++ b/admin/survey/script/ttest.js
@@ -17,6 +17,7 @@ function ttestSpremenljivkaChange() {
$('#ttestNumerusSpan').addClass('gray');
}
function ttestVariableChange() {
+
// prvi dropdown
var seq = new Array();
var spr = new Array();
@@ -24,6 +25,7 @@ function ttestVariableChange() {
$('#ttestNumerus').each(function(index,el) {
spr.push($(el).val());
});
+
// omogočimo
$('#ttestNumerus').attr('disabled',false).focus().attr('size', 1);
$('#ttestNumerusSpan').removeClass('gray');
@@ -40,11 +42,13 @@ function ttestVariableChange() {
var seq2 = $("#ttestSpremenljivka option:selected").attr('seq2');
var label2 = $("#ttestSpremenljivka option:selected").html();
+
// variable iz checkboxov
var sub_conditions = new Array();
$('#ttestVariablesSpan input:checked').each(function(index,el) {
sub_conditions.push($(el).val());
});
+
$("#ttestResults").load("ajax.php?t=ttest&a=variableChange", {anketa:srv_meta_anketa_id, sub_conditions:sub_conditions, spr:spr, seq:seq, grd:grd, spr2:spr2, seq2:seq2, grid2:grid2, label2:label2}, function() {
// preverimo da samo dva izbrana checkboxa
var cnt = $("input[name=subTtest]:checked").length;
@@ -54,9 +58,9 @@ function ttestVariableChange() {
$(this).attr("disabled", true);
$(this).parent().addClass("gray");
});
- $("#ttestVariablesSpan").removeClass('active');
-
- } else if (cnt < 2) {
+ $("#ttestVariablesSpan").removeClass('active');
+ }
+ else if (cnt < 2) {
// onemogočimo
$('#ttestNumerus').attr('disabled',true);
$('#ttestNumerusSpan').addClass('gray');
@@ -80,7 +84,7 @@ function doArchiveTTest() {
$('#fullscreen').show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
function submitArchiveTTest() {
@@ -97,7 +101,7 @@ function submitArchiveTTest() {
$("#fullscreen").show();
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}
@@ -113,9 +117,9 @@ function createArchiveTTestBeforeEmail() {
});
} else {
if (parseInt(response) == -1) {
- alert("Nothing to archive!"+response);
+ genericAlertPopup('alert_no_archive_response',response);
} else {
- alert("Error while creating archive!"+response);
+ genericAlertPopup('alert_archive_error_response',response);
}
$('#fullscreen').hide();
$('#fade').fadeOut('slow');
@@ -123,6 +127,6 @@ function createArchiveTTestBeforeEmail() {
});
} else {
- alert ('Ni podatkov za arhiv! Najprej kreirajte tabele.');
+ genericAlertPopup('alert_no_archive_tables');
}
}; \ No newline at end of file
diff --git a/admin/survey/script/uporabniki_custom.js b/admin/survey/script/uporabniki_custom.js
index 13c9d24..a5df8e8 100644
--- a/admin/survey/script/uporabniki_custom.js
+++ b/admin/survey/script/uporabniki_custom.js
@@ -1,7 +1,13 @@
//Uporabimo custom funkcijo pri uporabnikih, dokler se ne posodobi jQuery
$(document).ready(function () {
- onload_init();
+ // Search na vrhu po pritisku na enter skoci na drupal search
+ $('#searchSurvey').keypress(function (e) {
+ if (e.which == 13) {
+ executeDrupalSearch();
+ return false;
+ }
+ });
$('#xtradiv strong').on("click", function (event) {
$('#xtradivSettings').toggle();
@@ -12,7 +18,7 @@ $(document).ready(function () {
function language_change (lang) {
$.post('ajax.php?t=surveyList&a=language_change', {lang: lang}, function () {
- /*window.location.reload();*/
- window.location = window.location.href.split("?")[0];
+ window.location.reload();
+ //window.location = window.location.href.split("?")[0];
});
}
diff --git a/admin/survey/script/vprasanje.js b/admin/survey/script/vprasanje.js
index 886d689..a2f6363 100644
--- a/admin/survey/script/vprasanje.js
+++ b/admin/survey/script/vprasanje.js
@@ -11,7 +11,7 @@ function onload_init_vprasanje() {
});
}
// prikaze fullscreen urejanje vprasanja
-function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
+function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close, focus_last) {
if (locked) return;
//za ureditev custom opisnih label pri drsniku
@@ -25,10 +25,7 @@ function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
if ( ! (no_close==true) )
close_all_editing();
-
- // zapremo knjiznico
- $('#toolbox_library').hide();
-
+
// ce smo v formi zapremo hitre nastavitve desno zgoraj
$('#form_settings_obvescanje').hide();
$('#email_switch').attr("src", "img_0/plus.png");
@@ -58,7 +55,8 @@ function vprasanje_fullscreen (spremenljivka, cache, chart_edit, no_close) {
// odpremo okno za dodajanje nove kategorije
var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
- inline_nova_vrednost(last);
+
+ inline_nova_vrednost(last, focus_last);
//Preklop na tab za urejanje label grafov
if(chart_edit == 1){ vprasanje_tab(spremenljivka, 4); }
@@ -115,7 +113,7 @@ function vprasanje_pozicija (spremenljivka) {
var elHeight = $(id).height();
//$('#vprasanje_float_editing').css('top', elTop-163).show();
- $('#vprasanje_float_editing').css('margin-top', elTop-163).show();
+ $('#vprasanje_float_editing').css('margin-top', elTop-224).show();
var floatingTop = $('#vprasanje_float_editing').offset().top - 40; // ker je premaknjeno navzgor
var floatingHeight = $('#vprasanje_float_editing').height() + 40;
@@ -177,18 +175,15 @@ function vprasanje_save (silentsave, spr, callback) {
id = '#'+spremenljivka;
var form_serialize = $("form[name=vprasanje_edit]").serialize() || {spremenljivka: spremenljivka};
-
+
if (silentsave != true) {
$('#calculation').fadeOut('fast').html('');
$('#vprasanje_float_editing').hide().html('');
$(id).removeClass('spr_editing');
-
- // prikazemo knjiznico ce je odprta
- $('#toolbox_library').show();
}
-
+
$.post('ajax.php?t=vprasanje&a=vprasanje_save&silentsave='+silentsave, form_serialize, function (data) {
if (silentsave != true) {
@@ -206,6 +201,10 @@ function vprasanje_save (silentsave, spr, callback) {
else {
$(id).html(data);
+
+ // ker se z zgornjo kodo pobrise vrstica desno zgoraj (hitre nastavitve - celotni div se nadomesti z novo vsebino) jo je potrebno na novo izrisati
+ let fake_event = {target: id};
+ branching_mouseover(fake_event);
// odpremo okno za dodajanje nove kategorije
var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
@@ -250,10 +249,13 @@ function vprasanje_cancel () {
// pobrise vrednost (v srv_vrednost)
function vrednost_delete(spremenljivka, vrednost, tip, other) {
-
+
$('#vrednost_'+vrednost).remove();
// popravimo še čhekbox za missinge
+ //star nacin
$("#missing_value_"+other).attr('checked', false);
+ //nov nacin
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', false);
$.post('ajax.php?t=vprasanje&a=vrednost_delete', {spremenljivka: spremenljivka, vrednost: vrednost, other: other, anketa: srv_meta_anketa_id}, function() {
if(tip == 17) edit_ranking_moznosti();
});
@@ -481,6 +483,7 @@ function vrednost_cancel () {
function vrednost_fastadd (spremenljivka) {
$('#fade').fadeTo('slow', 1);
+ $('#vrednost_edit').addClass('PopUpNarrow');
$('#vrednost_edit').show().load('ajax.php?t=vprasanje&a=vrednost_fastadd', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id});
}
@@ -521,6 +524,26 @@ function show_timer (value) {
function show_dostop (value) {
$('#dostop').toggle();
+
+ //ce se odkljuka "skrij za respondente" (visible) nastavi dostop na 4 (vidno vsem)
+ if(!value){
+ $('#_dostop').prop('checked', false);
+ }
+}
+
+// prikaze/skrije opcije reminder (obvezno, neobvezno vprasanje)
+function show_reminders (value) {
+
+ $('#reminders').toggle();
+
+ //ce se nastasvi na 0, se more narediti uncheck za radio
+ if(value == 0){
+ $('#reminder_1').prop('checked', false);
+ $('#reminder_2').prop('checked', false);
+ }
+ else
+ $('#reminder_1').prop('checked', true);
+
}
function change_number(id1, id2) {
@@ -601,12 +624,31 @@ function change_subtype_number (spremenljivka) {
vprasanje_fullscreen(spremenljivka);
});
}
-function change_tip(spremenljivka, tip) {
+function change_tip(spremenljivka, tip, confirmed) {
- $.post('ajax.php?t=vprasanje&a=change_tip', {spremenljivka: spremenljivka, tip: tip, anketa: srv_meta_anketa_id}, function (data) {
- vprasanje_fullscreen(spremenljivka, data, false, true);
- vprasanje_save(true);
- });
+ var old_tip = $('li#branching_'+spremenljivka).attr('tip');
+
+ $.post('ajax.php?t=vprasanje&a=change_tip', {spremenljivka: spremenljivka, tip: tip, confirmed: confirmed, anketa: srv_meta_anketa_id},
+ function (data) {
+
+ try {
+ var data_json = JSON.parse(data);
+
+ if (data_json.error == 1) {
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data_json.output).fadeIn("fast").css('width', '600px');
+
+ return;
+ }
+ }
+ catch(e){}
+
+ $('li#branching_'+spremenljivka).attr('tip', tip);
+ $('li#branching_'+spremenljivka).removeClass('spr_tip_'+old_tip).addClass('spr_tip_'+tip);
+
+ vprasanje_fullscreen(spremenljivka, data, false, true);
+ vprasanje_save(true);
+ });
}
function change_demografija(spremenljivka, podtip) {
@@ -632,9 +674,9 @@ function change_limittype(limittype) {
}
}
-function num_limit(field, checked) {
+function num_limit(field, checkbox_id) {
- if(checked){
+ if($('#'+checkbox_id).is(':checked')){
document.getElementById(field).disabled = false;
}
@@ -643,6 +685,18 @@ function num_limit(field, checked) {
}
}
+function changeGridAlign(spremenljivka, enota){
+ var tip = $('#spremenljivka_tip_'+spremenljivka+' option:selected').val();
+
+ //"izberi iz seznama" ima po default postavitev na levo, ostale na sredino
+ //sprememba v seznam
+ if(tip == 6 && enota == 6)
+ $('#gridAlign').val(2); //poravnavo uredi na desno
+ //sprememba iz seznama
+ else if(tip == 6 && enota != 6)
+ $('#gridAlign').val(0); //poravnavo uredi na sredino
+}
+
function change_diferencial(spremenljivka, enota){
if(enota == 3)
$('.grid_subtitle').css('display', 'block');
@@ -741,11 +795,145 @@ function get_editor_close(id) {
// prikaze field da manager doda nek komentar obstojecemu komentarju na vprasanje
-function comment_on_comment (id) {
+function comment_on_comment (id, user, date, spr_id) {
$('#comment_on_comment_'+id).html(
- '<br /><textarea name="vsebina" id="vsebina_comment_on_comment_'+id+'" style="width:100%"></textarea><br />' +
- '<input type="submit" value="'+lang['send']+'" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;" />'
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+// prikaze field da manager doda nek komentar obstojecemu komentarju na vprasanje respondenta
+function comment_on_comment_resp (id, user, date) {
+ $('#comment_on_comment_resp_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_resp_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_resp_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment_resp\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_resp_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+}
+
+// prikaze field da manager doda nek komentar obstojecemu splosnemu komentarju
+function comment_on_comment_splosni (id, user, date) {
+ $('#comment_on_comment_splosni_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_splosni_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_splosni_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_splosni_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
+ );
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+// prikaze field da manager doda nek komentar obstojecemu splosnemu komentarju respondenta
+function comment_on_comment_splosni_resp (id, user, date) {
+ $('#comment_on_comment_splosni_resp_'+id).html(
+ '<div class="reply_to_who"><span class="faicon fa-reply link-right"></span>'+lang['for']+': '+user+' ('+date+')</div>'+
+ '<textarea name="vsebina" placeholder="'+lang['srv_comment_comment']+'" id="vsebina_comment_on_comment_splosni_resp_'+id+'"></textarea>' +
+ '<div class="button_holder bottom16">'+
+ '<button class="medium white-blue" onclick="$(\'#comment_on_comment_splosni_resp_'+id+'\').html(\'\'); return false;">'+lang['edit1338']+'</button>'+
+ '<button class="medium blue" onclick="$.post(\'ajax.php?a=comment_on_comment_splosni_resp\', {id: \''+id+'\', vsebina: $(\'#vsebina_comment_on_comment_splosni_resp_'+id+'\').val(), anketa: srv_meta_anketa_id}, function() {window.location.reload();}); return false;">'+lang['srv_comment_comment']+'</button>'+
+ '</div>'
);
+ $(".options_dropdown").addClass("displayNone");
+
+ var toggle = '#comment_toggle_' + spr_id + '_4';
+
+ $(toggle).toggle();
+}
+
+function comment_delete (id) {
+ $.post("ajax.php?a=comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function respondent_comment_delete (id) {
+ $.post("ajax.php?a=respondent_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function survey_respondent_comment_delete (id) {
+ $.post("ajax.php?a=survey_respondent_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function survey_comment_delete (id) {
+ $.post("ajax.php?a=survey_comment_delete", {id: id, anketa: srv_meta_anketa_id}, function(){
+
+ $(".options_dropdown").addClass("displayNone");
+ $("#comment_box_"+id).remove();
+ });
+}
+
+function question_comment_solve(ocena, id){
+
+ $.post("ajax.php?a=comment_ocena", {type: 'question_comment', ocena: ocena, id: id, anketa: srv_meta_anketa_id}, function () {
+
+ if(ocena == '2'){
+ $('#comment_box_'+id).addClass('archived').find('.solve').html(
+ '<p class="unarchive_comment" onclick="question_comment_solve(\'0\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_unarchive']+
+ '</p>'
+ );
+ }
+ else{
+ $('#comment_box_'+id).removeClass('archived').find('.solve').html(
+ '<p class="archive_comment" onclick="question_comment_solve(\'2\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_archive']+
+ '</p>'
+ );
+ }
+ });
+}
+
+function question_respondent_comment_solve(text2, id){
+
+ $.post("ajax.php?a=comment_ocena", {type: 'respondent_comment', text2: text2, id: id, anketa: srv_meta_anketa_id}, function () {
+
+ if(text2 == '2'){
+ $('#comment_box_'+id).addClass('archived').find('.solve').html(
+ '<p class="unarchive_comment" onclick="question_respondent_comment_solve(\'0\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_unarchive']+
+ '</p>'
+ );
+ }
+ else{
+ $('#comment_box_'+id).removeClass('archived').find('.solve').html(
+ '<p class="archive_comment" onclick="question_respondent_comment_solve(\'2\', '+id+');">'+
+ '<span class="faicon fa-check link-right"></span>'+
+ lang['srv_comments_archive']+
+ '</p>'
+ );
+ }
+ });
}
@@ -838,22 +1026,81 @@ function validation_if_remove (spremenljivka, _if) {
}
-function grid_plus_minus (type) {
+function grid_plus_minus (type, confirm='0') {
var selected = $('#grids_count').val();
- if (type == '1')
+ // Dodajamo stolpec
+ if (type == '1'){
selected = parseInt(selected) + 1;
- else if (type == '0')
- selected = parseInt(selected) - 1;
-
- if (selected >= 2 && selected <= 12)
- $('#grids_count').val( selected );
-
- vprasanje_save(true);
-
- return false;
+
+ if (selected >= 2 && selected <= 12)
+ $('#grids_count').val( selected );
+ vprasanje_save(true);
+
+ return false;
+ }
+ // Brisemo stolpec
+ else if (type == '0'){
+ selected = parseInt(selected) - 1;
+
+ // Preverimo, ce imamo podatke - potem opozorimo da se lahko izgubijo podatki
+ $.post('ajax.php?t=vprasanje&a=grid_delete_check', {anketa: srv_meta_anketa_id},
+ function(data) {
+
+ // Nimamo podatkov - normalno nadaljujemo
+ if (!data || confirm === '1'){
+ if (selected >= 2 && selected <= 12)
+ $('#grids_count').val( selected );
+
+ vprasanje_save(true);
+
+ return false;
+ }
+ else{
+ // Imamo podatke - prikazemo popup z opozorilom
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ }
+ }, 'json'
+ );
+ }
+}
+
+// Dodamo/odstranimo missing stolpec iz vprasanj tipa tabela
+function grid_add_remove_missing (checkbox, spremenljivka, confirm='0') {
+
+ // Dodajamo missing stolpec - ne rabimo nicesar preverjati
+ if ($(checkbox).is(":checked")){
+
+ // Shranimo spremembo
+ vprasanje_save(true, spremenljivka);
+ }
+ // Brisemo stolpec
+ else{
+
+ // Preverimo, ce imamo podatke - potem opozorimo da se lahko izgubijo podatki
+ $.post('ajax.php?t=vprasanje&a=grid_delete_missing_check', {anketa: srv_meta_anketa_id, spremenljivka: spremenljivka},
+ function(data) {
+
+ // Nimamo podatkov oz. smo potrdili brisanje - normalno nadaljujemo
+ if (!data || confirm === '1'){
+ // Shranimo spremembo
+ vprasanje_save(true, spremenljivka);
+ }
+ else{
+ // Imamo podatke - prikazemo popup z opozorilom
+ $('#fade').fadeIn("fast");
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ }
+
+ }, 'json'
+ );
+ }
+
+ // Zapremo meni z missingi
+ close_missing_menu(spremenljivka);
}
function grid_multiple_add (spr_id) {
@@ -925,27 +1172,30 @@ function grid_multiple_save (spr) {
}
-function show_alert_missing(){
+function show_alert_missing(sprid){
- if($('#missing_value_-97').attr("checked"))
+ if($('#missing_value_-97').attr("checked") || $('#missing_value_'+sprid+'-97').attr("checked"))
var missing_97 = 1;
else
var missing_97 = 0;
- if($('#missing_value_-98').attr("checked"))
+ if($('#missing_value_-98').attr("checked") || $('#missing_value_'+sprid+'-98').attr("checked"))
var missing_98 = 1;
else
var missing_98 = 0;
- if($('#missing_value_-99').attr("checked"))
+ if($('#missing_value_-99').attr("checked") || $('#missing_value_'+sprid+'-99').attr("checked"))
var missing_99 = 1;
else
var missing_99 = 0;
- var reminder = $('select[name=reminder]').val();
+ //samo preveri, ce je reminder vklopljen - ne preveri ali je soft ali hard (to pridobi iz radio)
+ var reminder = $('input[type=checkbox][name=reminder]').is(':checked');
+ //var reminder_type = $('input[type=radio][name=reminder]').val();
if(reminder == 1 || reminder == 2){
- if(missing_97 == 1){
+
+ /* if(missing_97 == 1){
$('#alert_show_97').prop('disabled', false);
$('#alert_show_97_text').removeClass('gray');
}
@@ -973,20 +1223,22 @@ function show_alert_missing(){
$('#alert_show_99').prop('disabled', true);
$('#alert_show_99').attr("checked", false);
$('#alert_show_99_text').addClass('gray');
- }
+ } */
}
else{
- $('#alert_show_97').prop('disabled', true);
- $('#alert_show_97').attr("checked", false);
- $('#alert_show_97_text').addClass('gray');
+ $('#alert_show_96_'+sprid).attr("checked", false);
+
+ //$('#alert_show_97').prop('disabled', true);
+ $('#alert_show_97_'+sprid).attr("checked", false);
+ //$('#alert_show_97_text').addClass('gray');
- $('#alert_show_98').prop('disabled', true);
- $('#alert_show_98').attr("checked", false);
- $('#alert_show_98_text').addClass('gray');
+ //$('#alert_show_98').prop('disabled', true);
+ $('#alert_show_98_'+sprid).attr("checked", false);
+ //$('#alert_show_98_text').addClass('gray');
- $('#alert_show_99').prop('disabled', true);
- $('#alert_show_99').attr("checked", false);
- $('#alert_show_99_text').addClass('gray');
+ //$('#alert_show_99').prop('disabled', true);
+ $('#alert_show_99_'+sprid).attr("checked", false);
+ //$('#alert_show_99_text').addClass('gray');
}
}
@@ -1625,7 +1877,7 @@ function checkCheckboxLimits(spremenljivka, value, checkbox_limit_name){
//ce je min limit vecji od max limit, je potrebno javiti opozorilo in vrednost min limita dati na 0
//if(min_value > max_value){
if(max_value!=0 && min_value > max_value){
- alert(lang['srv_checkbox_min_limit_error_msg']); //opozorilo v obliki pop-up okna
+ genericAlertPopup('srv_checkbox_min_limit_error_msg'); //opozorilo v obliki pop-up okna
$('#checkbox_min_limit_' + spremenljivka).val(0); //spremeni vrednost min limita na 0 oz. Ne
}
}
@@ -1637,4 +1889,25 @@ function toggleCheckboxMinLimitReminder(spremenljivka, checkbox_min_limit){
}else{
$('#checkboxLimitReminder_' + spremenljivka).css('display', 'none'); //skrij nastavitve za opozorilo
}
-} \ No newline at end of file
+}
+
+
+// Fieldset toggle
+function fieldsetToggle(element){
+
+ $(element).next('.fieldset_holder').slideToggle(function(){
+ //$('#vprasanje_edit').animate({scrollTop: $(this).offset().top}, 2000);
+ });
+
+ $(element).find('.faicon').toggleClass('arrow2_d').toggleClass('arrow2_u');
+
+}
+
+// Gumb dodaj kategorijo - doda okno za novo kategorijo in ga fokusira
+function add_question_category(spremenljivka){
+
+ var last = $('#branching_'+spremenljivka+' .variabla:last-child div.vrednost_inline');
+
+ inline_nova_vrednost(last, true);
+}
+
diff --git a/admin/survey/script/vprasanjeDeleted.js b/admin/survey/script/vprasanjeDeleted.js
new file mode 100644
index 0000000..ee2f644
--- /dev/null
+++ b/admin/survey/script/vprasanjeDeleted.js
@@ -0,0 +1,86 @@
+// Odpremo knjiznico v urejanju ankete
+function displayVprasanjeDeletedPopup(){
+
+ $('#fade').fadeTo('slow', 1);
+ $('#general_popup').html('').addClass('vprasanje_deleted_popup').fadeIn('slow');
+
+ $("#general_popup").load('ajax.php?t=vprasanjeDeleted&a=displayVprasanjeDeletedPopup', {anketa: srv_meta_anketa_id});
+}
+
+
+// Klik na posamezen item na desni
+function selectVprasanjeDeletedItem(item_id){
+
+ if($('#question_item_holder_'+item_id).hasClass('active')){
+ $('#question_item_holder_'+item_id).removeClass('active');
+ $('#question_item_check_'+item_id).attr("checked", false);
+ }
+ else{
+ $('#question_item_holder_'+item_id).addClass('active');
+ $('#question_item_check_'+item_id).attr("checked", true);
+ }
+
+ // Prestejemo oznacene iteme
+ var count = $('.question_item_check:checkbox:checked').length;
+ $('#selected_item_counter').html(count);
+
+ // Nastavimo gumb dodaj kot disabled glede na to ce imamo elemente ali ne
+ if(count > 0){
+ $("#insert_vprasanje_deleted_button").prop('disabled', false);
+ }
+ else{
+ $("#insert_vprasanje_deleted_button").prop('disabled', true);
+ }
+}
+
+function deleteVprasanjeDeleted(item_id, item_type){
+
+ $.post('ajax.php?t=vprasanjeDeleted&a=deleteItem', {anketa: srv_meta_anketa_id, item_id: item_id, item_type: item_type}, function(){
+ $('#question_item_holder_'+item_id).remove();
+ });
+
+ event.stopPropagation();
+}
+
+// Restavriramo pobrisano vprasanje nazaj v anketo na konec
+function insertVprasanjeDeletedItemsIntoSurvey(){
+
+ var items = [];
+
+ var prev = false;
+ var note = '1';
+
+ $('.question_item_check:checkbox:checked').each(function(){
+ var id_string = $(this).attr("id");
+ var id = id_string.substring(20);
+
+ items.push(id);
+
+ // Preverimo za obvestilo, ce dodajamo vec elementov in ce so razlicni
+ if(prev){
+ note = '1m';
+ }
+
+ prev = true;
+ });
+
+ $("#branching").load('ajax.php?t=vprasanjeDeleted&a=addIntoSurvey', {anketa: srv_meta_anketa_id, items: items}, function(){
+
+ popupClose();
+ actionNotePopup('lib_add_to_survey_'+note, 'success');
+ });
+}
+
+
+// Predogled pobrisanega vprasanjaoz. vprasanja iz knjiznice
+function previewVprasanje(spr_id){
+
+ $('#vprasanje_preview').load('ajax.php?a=preview_spremenljivka_lib', {anketa: srv_meta_anketa_id, spremenljivka: spr_id, podstran: srv_meta_podstran}).removeClass('displayNone');
+
+ event.stopPropagation();
+}
+
+// Predogled pobrisanega vprasanja
+function closePreviewVprasanje(){
+ $('#vprasanje_preview').addClass('displayNone').empty();
+}
diff --git a/admin/survey/script/vprasanjeInline.js b/admin/survey/script/vprasanjeInline.js
index 73974dd..1cef4ab 100644
--- a/admin/survey/script/vprasanjeInline.js
+++ b/admin/survey/script/vprasanjeInline.js
@@ -70,8 +70,10 @@ function onload_init_inline () {
$("div.variable_inline").live('focus', function() {
close_all_editing($(this).closest('.spremenljivka_content').attr('spr_id'));
}).live('keyup', function () {
+
var variable = $(this).html();
var tip = $(this).closest('.spremenljivka_content').attr('tip');
+
if($.trim(variable).length && tip != 1){
variable = variable.replace(/(<([^>]+)>)/ig,"");
var variable1 = check_valid_variable(variable);
@@ -79,6 +81,13 @@ function onload_init_inline () {
$(this).html(variable1);
}
}
+ else if($.trim(variable).length && tip == 1){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_radio_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
}).live('keypress', function (event) {
enterKeyPressHandler(event);
}).live('blur', function () {
@@ -100,7 +109,6 @@ function onload_init_inline () {
inline_nova_vrednost(this); // tale je ce urejamo kategorijo, da se pojavi cim kliknemo
},
keypress: function (event) {
- //console.log("keypress");
var evt = event || window.event;
var charCode = evt.which || evt.keyCode;
if (charCode == 9) return; // ce gremo s tabom naprej, da ne doda nove kategorije
@@ -113,6 +121,7 @@ function onload_init_inline () {
// ko zacnemo pisati v polje za dodajanje nove vrednosti, jo takoj kreiramo, da dobimo nov ID - naprej gre potem isto kot urejanje
// new="waiting" nam pove, da se je izvrsil post, drugace se ob tipkanju veckrat dodaja
if (div.attr('id') == 'variabla_new' && div.attr('new') != 'waiting' && ( div.find('div.vrednost_inline:first').html() != '' || div.find('div.vrednost_inline:last').html() != '' )) {
+
var spr_id = div.closest('.spremenljivka_content').attr('spr_id');
div.attr('new', 'waiting');
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_new', {
@@ -122,7 +131,9 @@ function onload_init_inline () {
div.attr('id', 'variabla_' + data);
div.attr('new', '');
div.find('div.vrednost_inline').attr('id', 'vre_id_' + data).attr('vre_id', data);
+ div.find('div.icons_holder').css('display', 'inline');
div.find('span.inline_hidden').attr('odg_id', data);
+ div.find('span.correct').attr('vre_id', data);
div.find('span.inline_if_follow').attr('onclick', 'follow_up_condition(\''+data+'\'); return false;');
div.find('span.inline_if_not').attr('onclick', 'vrednost_condition_editing(\''+data+'\'); return false;');
@@ -218,8 +229,30 @@ function onload_init_inline () {
});
// urejanje vrednosti grida
- $("div.grid_variable_inline").live('blur', function () {
- var spr_id = $(this).closest('div.spremenljivka_content').attr('spr_id');
+ $("div.grid_variable_inline").live('focus', function() {
+ close_all_editing($(this).closest('.spremenljivka_content').attr('spr_id'));
+ }).live('keyup', function () {
+
+ var variable = $(this).html();
+ var tip = $(this).closest('.spremenljivka_content').attr('tip');
+
+ if($.trim(variable).length && tip != 6){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
+ else if($.trim(variable).length && tip == 6){
+ variable = variable.replace(/(<([^>]+)>)/ig,"");
+ var variable1 = check_valid_radio_variable(variable);
+ if (variable1 != variable){
+ $(this).html(variable1);
+ }
+ }
+ }).live('keypress', function (event) {
+ enterKeyPressHandler(event);
+ }).live('blur', function () {
inline_variable_grid(spr_id, this);
});
@@ -416,11 +449,6 @@ function inline_vprasanje_float_editing_click(event) {
function inline_naslov (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
// shranimo
if (parseInt(spremenljivka) == -1) { // uvod
@@ -436,11 +464,6 @@ function inline_naslov (spremenljivka, _this) {
function inline_textfield (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
// shranimo
if (parseInt(spremenljivka) == -1) { // uvod
@@ -454,14 +477,7 @@ function inline_textfield (spremenljivka, _this) {
// shrani vsebino za hotspot vprasanje
function inline_hotspot (spremenljivka, _this) {
-
- //if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
// shranimo
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
}
@@ -471,11 +487,6 @@ function inline_info (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
$.post('ajax.php?t=vprasanjeinline&a=inline_info_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, info: $(_this).html()});
}
@@ -485,7 +496,6 @@ function inline_vrednost_variable(vre_id, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_variable_save', {vre_id: vre_id, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, variable: $(_this).html()});
-
}
// shrani variablo vprasanja
@@ -502,25 +512,15 @@ function inline_variable (spremenljivka, _this) {
function inline_vrednost (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //var vnosi = $('#spremenljivka_contentdiv3444 div.variabla').length;
- //var vnosi = $('#variable_holder div.variabla').length;
- //var vnosi = $('.edit_mode div.variabla').length;
- var vnosi = $('.edit_mode div.vrednost_inline').length;
- //console.log(spremenljivka);
- //console.log(vnosi);
+ var vnosi = $('.edit_mode div.vrednost_inline').length;
- // dodatek may: shranimo vrednost textaree in inputa pri text fieldih
- if ($(_this).attr('ETF') == 'true') {
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).val()} );
- }
- else {
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
- }
- //$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html(), sbSize: vnosi});
+ // dodatek may: shranimo vrednost textaree in inputa pri text fieldih
+ if ($(_this).attr('ETF') == 'true') {
+ $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).val()} );
+ }
+ else {
+ $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
+ }
}
// shrani ime hotspot obmocja
@@ -528,31 +528,16 @@ function inline_hotspot_vrednost (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //var vnosi = $('#spremenljivka_contentdiv3444 div.variabla').length;
- //var vnosi = $('#variable_holder div.variabla').length;
- //var vnosi = $('.edit_mode div.variabla').length;
var vnosi = $('.edit_mode div.vrednost_inline').length;
- //console.log(spremenljivka);
- //console.log(vnosi);
- $.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_vrednost_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
- //$.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_naslov_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html(), sbSize: vnosi});
+
+ $.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_vrednost_save', {spremenljivka:spremenljivka, vrednost: $(_this).attr('vre_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, naslov: $(_this).html()} );
}
// shrani grid vprasanja
function inline_grid (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
// String zaenkrat pustimo kot html
- //var string = $(_this).text();
var string = $(_this).html();
// pri dvojni tabeli popravimo se desna polja
@@ -575,12 +560,7 @@ function inline_subtitle_grid (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
- //$.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).html()});
- $.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).text(), grid_id: $(_this).attr('grid_id')});
+ $.post('ajax.php?t=vprasanjeinline&a=inline_grid_subtitle_save', {spremenljivka: spremenljivka, subtitle: $(_this).attr('grid_subtitle'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, value: $(_this).text(), grid_id: $(_this).attr('grid_id')});
}
// pobrise vrednost (v srv_vrednost)
@@ -590,7 +570,9 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
//ce je posebna vrednost, se rabi dodat callbaack in se lahko brise tudi zadnja vednost
//special vrednost je recimo marker na mapi - ni html taga z id="variabla_"+vrednost
var special_vrednost = ($("#variabla_"+vrednost).length < 1);
-
+
+ var other = $("#variabla_"+vrednost).attr('other');
+
if ( confirmed==1 || confirm(text) ) {
if (confirmed == undefined) confirmed = 1;
@@ -605,9 +587,11 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
//ce je navadna vrednost, kot rec. radio ali checkbox
if(!special_vrednost){
// popravimo se chekbox za missinge
- var other = $("#variabla_"+vrednost).attr('other');
if (other != '0') {
- $("#missing_value_"+other).attr('checked', false);
+ //star nacin
+ $("#missing_value_"+other).attr('checked', false);
+ //nov nacin
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', false);
}
// odstranimo element
@@ -622,9 +606,6 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
else{
callback();
}
-
-
-
}
else if (data.error == 1) {
$('#fade').fadeIn("fast");
@@ -633,29 +614,43 @@ function inline_vrednost_delete(spremenljivka, vrednost, confirmed/*, tip, other
else if (data.error == 2) {
$('#fade').fadeIn("fast");
- $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '400px');
+ $('#dropped_alert').html(data.output).fadeIn("fast").css('width', '600px');
+ //ce je missing
+ /* var missing = $("#missing_value_"+spremenljivka+"_"+other);
+
+ if(missing){
+ $('#brisivrednostcancel').attr('onClick', $('#brisivrednostcancel').attr('onClick')+' $(\'#missing_value_'+spremenljivka+'_'+other+'\').attr(\'checked\', true);');
+ } */
+
//ce je posebna vrednost, se rabi dodat callbaack
if(special_vrednost){
//treba je dodati callback - sori, vem da je grdo - glej funkcijo ajax_vrednost_delete v class.Vprasanje.php
document.getElementById('brisivrednostchecked').onclick =
function(){inline_vrednost_delete(spremenljivka, vrednost, 1, callback); $('#dropped_alert').html('').hide(); return false;}
-
+
+ var missing = $("#missing_value_"+spremenljivka+"_"+other);
+
$('#fade').fadeOut("fast");
}
}
}, 'json'
);
-
+ }
+ else{
+ //ce stisne cancel, nazaj vklopi check
+ $("#missing_value_"+spremenljivka+"_"+other).attr('checked', true);
}
}
// narise polje za dodajanje vrednosti
-function inline_nova_vrednost (_this) {
-
+function inline_nova_vrednost (_this, focus) {
// ce je anketa zaklenjena
if ($(_this).attr('contenteditable') != 'true') return;
+
+ // Ce smo na mobitelu tega ni
+ if ($('.mobile_header:visible').length != 0) return;
// ce imamo v edit modu vprasanja same default odgovore (to je ob novem vprasanju in ce se nic ne spreminja)
var variable_holder = $(_this).closest('.variable_holder');
@@ -664,7 +659,7 @@ function inline_nova_vrednost (_this) {
if ( $(this).find('.vrednost_inline').attr('default') != '1' ) _default = 0;
});
if (_default == 1) return;
-
+
var tip = $(_this).closest('.spremenljivka_content').attr('tip');
// Disablamo ife, ce nima ustreznega paketa
@@ -674,13 +669,12 @@ function inline_nova_vrednost (_this) {
else{
var if_class_locked = '';
}
-
+
// ce je zadnje polje in ce lahko znotraj tega parenta dodajamo vrednosti
if ( $(_this).closest('.variabla').is(':last-child') && $(_this).closest('.variabla').parent().hasClass('allow_new') ) {
-
// ce ni prazno (da pri novem ne dodamo takoj) && ce je attr new tudi ne dodamo, ker pocakamo da se zgenerira nov id
- if ($(_this).html() != '' && $(_this).attr('vre_id') != 'new') {
+ if ($(_this).html() != '' && $(_this).attr('vre_id') != 'new' && $(_this).attr('vre_id') != 'new_2') {
var spremenljivka = $(_this).closest('.spremenljivka_content').attr('spr_id'); //dobimo id spremenljivke
var orientation = $('#spremenljivka_content_'+spremenljivka).attr('spr_orientation'); //dobimo orientacijo iz dodanega parametra, ker iz prejsnje varianta ne gre, ko je urejevalno okno zaprto
@@ -688,36 +682,47 @@ function inline_nova_vrednost (_this) {
// radio, checkbox, roleta
if (tip <= 3) {
-
if(tip <= 3 && orientation != 7 && orientation != 8){
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>';
//if (tip <= 2)
if (tip <= 2 && orientation != 6)
- new_div += '<input id="foo_new" class="enka-admin-custom enka-inline" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" /><span class="enka-checkbox-radio"></span>';
-
+ new_div += '<input id="foo_new" class="enka-admin-custom enka-inline" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" /><span class="enka-checkbox-radio"></span>';
+
// Ikona za hiter upload slike (ce je vklopljena)
if($(_this).closest('.variabla').parent().find('.image_upload').length){
- new_div += '<span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>';
+ new_div += '<span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>';
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
+ (($(_this).closest('.variabla').parent().find('.correct').length) ? ' <span class="faicon correct inline" spr_id="'+spremenljivka+'" vre_id="new" title="'+lang['srv_vrednost_correct']+'"></span>' : '')+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
else{
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+lang['srv_brisivrednost']+'"></span>'+
+ (($(_this).closest('.variabla').parent().find('.correct').length) ? ' <span class="faicon correct inline" spr_id="'+spremenljivka+'" vre_id="new" title="'+lang['srv_vrednost_correct']+'"></span>' : '')+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
}
else if(tip <= 3 && orientation == 7){
@@ -727,14 +732,20 @@ function inline_nova_vrednost (_this) {
'<span class="faicon move_updown inline inline_move" title=""></span>';
new_div += '<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span class="inline_other pointer" onclick="vrednost_new(\''+spremenljivka+'\', \'1\', \'\'); $(\'#fieldset'+spremenljivka+'\').show();">'+lang['srv_novavrednost_drugo']+'</span>'+
+ ' <span id="missing_block_'+spremenljivka+'" class="inline_other inline_missings pointer"></span>'+
+
' <input id="foo_new" type="'+(tip==1?'radio':'checkbox')+'" value="" name="foo_new" />'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '</div>';
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_follow inline inline_if_follow '+if_class_locked+'" onclick="follow_up_condition(\'new\'); return false;" title="'+lang['srv_follow_up']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
}
else if(tip <= 2 && orientation == 8){ //ce imamo radio ali checkbox z drag-drop
@@ -742,21 +753,31 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">';
if($(_this).closest('.variabla').parent().find('.image_upload').length){
- new_div += '<span class="sprites image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>'+
+ new_div += '<span class="faicon image_upload pointer" onclick="vrednost_insert_image(\''+$(_this).attr('vre_id')+'\', true); return false;" title="'+lang['upload_img2']+'"></span>'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
} else{
new_div += '<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
}
}
@@ -765,12 +786,10 @@ function inline_nova_vrednost (_this) {
//drag and drop grid
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- '</div>';
+
+ '</div>';
// ranking
} else if (tip == 17) {
@@ -779,14 +798,19 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
' <select style="width:50px; margin-top:0; float:left;"> '+
' <option></option> '+
' </select> '+
'<div id="vre_id_new" class="vrednost_inline" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
'</div>';
}
@@ -795,52 +819,90 @@ function inline_nova_vrednost (_this) {
var new_div = '<div id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
+
'<div id="vre_id_new" class="vrednost_inline ranking" style="float:none" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
- '</div>';
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '</div>';
}
// vsota
} else if (tip == 18) {
- var new_div = '<div id="variabla_new" class="variabla variabla_vsota after_'+$(_this).attr('vre_id')+'" style="width:100%">'+
+ var text_width = $(_this).closest('.variabla').find('.vrednost_inline_vsota')[0].style.width;
+
+ var new_div = '<div id="variabla_new" class="variabla variabla_vsota after_'+$(_this).attr('vre_id')+'">'+
'<span class="faicon move_updown inline inline_move" title=""></span>'+
- ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
- ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
- ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
- ' <span class="faicon edit2 inline inline_edit"></span>'+
- '<div id="vre_id_new" class="vrednost_inline" style="width:111px" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
+
+ ' <div class="icons_holder">'+
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit"></span>'+
+ ' </div>'+
+
+ '<div id="vre_id_new" class="vrednost_inline vrednost_inline_vsota" style="width:'+text_width+'" contenteditable="true" tabindex="1" default="1" vre_id="new">'+lang['srv_new_vrednost']+'</div>'+
' <input type="text" name="foo_" maxlength="8" size="5">'+
'</div>';
// tabele
} else {
-
var new_div = $( '<tr id="variabla_new" class="variabla after_'+$(_this).attr('vre_id')+'">' + $(_this).closest('.variabla').html() + '</tr>' );
new_div.find('*').removeAttr('id');
- new_div.find('div').attr('id', 'vre_id_new').attr('vre_id', 'new').attr('default', '1').html(lang['srv_new_vrednost']);
+ new_div.find('div.vrednost_inline').attr('id', 'vre_id_new').attr('vre_id', 'new').attr('default', '1').html(lang['srv_new_vrednost_grid']);
+ new_div.find('div.icons_holder').css('display', 'none');
// odstani input polje drugo, ce dodajamo za poljem drugo
- new_div.find('input[type=text]').remove();
+ new_div.find('input[type=text]:disabled').remove();
new_div.find('span.inline_other').remove();
new_div.find('span.red').remove();
+
+ //child pri maxDiff je drugi, ker prvi je radio
+ let child = (tip == 6 && enota == 5) ? 'td:nth-child(2)' : 'td:first-child';
// dodamo opcijo za drugo
- new_div.find('td:first-child').append(' <span class="inline_other pointer" onclick="vrednost_new(\''+$(_this).closest('.spremenljivka_content').attr('spr_id')+'\', \'1\', \'\');"><span class="faicon add small icon-as_link" title="'+'"></span> '+lang['srv_novavrednost_drugo']+'</span>');
+ new_div.find(child).append(' <span class="inline_other pointer" '+((tip == 24) ? 'style="margin-left:0px;" ' : '')
+ +'onclick="vrednost_new(\''+$(_this).closest('.spremenljivka_content').attr('spr_id')+'\', \'1\', \'\');">'+lang['srv_novavrednost_drugo']+'</span>');
if (new_div.find('div').length > 1){
//new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').html('');
- new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').attr('default', '1').html(lang['srv_new_vrednost']);
+ new_div.find('div:last').attr('id', 'vre_id_new_2').attr('vre_id', 'new_2').attr('default', '1').html(lang['srv_new_vrednost_grid']);
}
+
+ let icons =
+ ' <span class="faicon delete small inline inline_delete" title="'+'"></span>'+
+ ' <span class="faicon odg_hidden inline inline_hidden" odg_vre="0" odg_id="new" title="'+lang['srv_hide-disable_answer-0']+'"></span>'+
+ ' <span class="faicon odg_if_not inline inline_if_not '+if_class_locked+'" onclick="vrednost_condition_editing(\'new\'); return false;" title="'+lang['srv_podif_edit']+'"></span>'+
+ ' <span class="faicon edit2 inline inline_edit" style="margin-left:0;"></span>';
+
+ new_div.find('div.icons_holder').html(icons);
}
$(_this).closest('.variabla').parent().append(new_div);
+ //executed when DOM is ready, after manipulation
+ $(function(){
+ //pripni missinge v variabla_new
+ if (tip <= 3) {
+ $.post('ajax.php?t=branching&a=get_missing_block', {spremenljivka: spremenljivka, lang_id: srv_meta_lang_id, anketa: srv_meta_anketa_id}, function (data) {
+ if(data){
+ $('[id="missing_block_'+spremenljivka+'"]').last().html(data);
+ }
+ });
+ }
+ });
+
+ // Po potrebi izvedemo focus na novi variabli
+ if(focus === true)
+ $('#branching_'+spremenljivka).find('#vre_id_new').focus();
}
- }
+ }
}
// skrije (odstrani) polje za dodajanje vrednosti
@@ -863,45 +925,15 @@ function inline_nova_vrednost_hide (spr_id, vre_id) {
}
-// Pocisti text ce je bil pastan
-function inline_clear_paste(_this){
-
- // text ki je bil pastan
- var temp = $(_this).html();
-
- // pocistimo tage - dodamo <p> ce je slucajno prazen - drugace vrne prazen string
- temp = $('<p>'+temp+'</p>').text();
-
- // shranimo nazaj
- $(_this).html(temp);
-
- pasteFromWord = false;
-}
-
-// doda novo vrednost (mv = missing value)
-/*function inline_vrednost_new (spremenljivka, other, tip, mv) {
-
- $.post('ajax.php?t=vprasanjeinline&a=inline_vrednost_new', {spremenljivka: spremenljivka, other: other, anketa: srv_meta_anketa_id, mv:mv}, function (data) {
-
- if ( $('#vprasanje_preview').is(':visible') ) {
- $('#vprasanje_preview').html(data);
- } else {
- $('#branching_'+spremenljivka+'').html(data);
- }
- $('#spremenljivka_content_'+spremenljivka+' div.variable_holder div').last().click();
- //$('#vprasanje_edit').attr({scrollTop: $('#vprasanje_edit').height()});
- //if(tip == 17) edit_ranking_moznosti();
-
- });
-
-}*/
/**
* nastavi editor na contenteditable element za naslov
*/
function inline_load_editor (_this) {
+
$(_this).css('display', 'none');
var el = $(_this).parent().find('div[contenteditable].naslov_inline');
+
if (el.attr('contenteditable') == 'true') {
var spr_id = el.attr('spr_id');
@@ -911,38 +943,28 @@ function inline_load_editor (_this) {
var def_pogoj = 'default="'+def_text+'"';
el.replaceWith('<textarea name="naslov_'+spr_id+'" id="naslov_'+spr_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor(\''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
+ '<div class="button_holder editor_button_holder"><button class="small blue" onclick="inline_save_editor(\''+spr_id+'\'); return false;">'+lang['save']+'</button></div>');
editor_display(spr_id);
}
-
}
function inline_load_editor_hotspot (_this, vre_id) {
- //console.log(_this);
+
$(_this).css('display', 'none');
- //var el = $(_this).parent().find('div[contenteditable].naslov_inline');
-
-// echo '<div id="vre_id_'.$row1['id'].'" class="vrednost_inline_hotspot " contenteditable="false" tabindex="1" vre_id="'.$row1['id'].'" '.(strpos($row1['naslov'], $lang['srv_hot_spot_image'])!==false || strpos($row1['naslov'], $lang1['srv_hot_spot_image'])!==false || $this->lang_id!=null ? ' default="1"':'').'>' . $row1['naslov'].'</div>';
-
+
var el = $(_this).parent().find('.vrednost_inline_hotspot');
- //if (el.attr('contenteditable') == 'true') {
- var spr_id = el.attr('spr_id');
- var def_text = el.attr('default');
- var def_pogoj = '';
- if(def_text == 1)
- var def_pogoj = 'default="'+def_text+'"';
-
- //el.replaceWith('<textarea name="hotspot_image_'+spr_id+'" id="hotspot_image_'+spr_id+'" style="width:99%">'+el.html()+'</textarea>'+
- //'<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor_hotspot(\''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
-
- el.replaceWith('<textarea name="hotspot_image_'+vre_id+'" id="hotspot_image_'+vre_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
- '<span class="buttonwrapper floatLeft" style="margin:5px 0"><a class="ovalbutton ovalbutton_orange" href="#" onclick="inline_save_editor_hotspot(\''+vre_id+'\', \''+spr_id+'\'); return false;">'+lang['save']+'</a></span>');
-
- editor_display_hotspot(vre_id);
- //}
- //console.log("HotSpot editor");
+ var spr_id = el.attr('spr_id');
+ var def_text = el.attr('default');
+ var def_pogoj = '';
+ if(def_text == 1)
+ var def_pogoj = 'default="'+def_text+'"';
+
+ el.replaceWith('<textarea name="hotspot_image_'+vre_id+'" id="hotspot_image_'+vre_id+'" style="width:99%" '+def_pogoj+'>'+el.html()+'</textarea>'+
+ '<div class="button_holder editor_button_holder"><button class="medium blue" onclick="inline_save_editor_hotspot(\''+vre_id+'\', \''+spr_id+'\'); return false;">'+lang['save']+'</button></div>');
+
+ editor_display_hotspot(vre_id);
}
function inline_save_editor_hotspot(vre_id, spr_id, postsave) {
@@ -953,7 +975,7 @@ function inline_save_editor_hotspot(vre_id, spr_id, postsave) {
var parent = el.parent();
el.replaceWith('<div id="vre_id_'+vre_id+'" vre_id="'+vre_id+'" class="vrednost_inline_hotspot " contenteditable="false" spr_id="'+spr_id+'" tabindex="1">'+el.val()+'</div>');
- parent.find('span.buttonwrapper').remove();
+ parent.find('div.button_holder').remove();
if ( postsave != false )
inline_hotspot(spr_id, parent.find('div.vrednost_inline_hotspot'));
@@ -972,12 +994,13 @@ function inline_save_editor(spr_id, postsave) {
var parent = el.parent();
el.replaceWith('<div class="naslov naslov_inline" contenteditable="true" spr_id="'+spr_id+'" tabindex="1">'+el.val()+'</div>');
- parent.find('span.buttonwrapper').remove();
+ parent.find('div.button_holder').remove();
if ( postsave != false )
inline_naslov(spr_id, parent.find('div.naslov_inline'));
$('#spremenljivka_content_'+spr_id+' span.display_editor').css('display', 'inline-block');
+ $('#spremenljivka_content_'+spr_id+' div.missing_dropdown_link').css('display', 'inline-block');
}
/**
@@ -1026,37 +1049,25 @@ function enterKeyPressHandler(evt) {
function inline_minmaxlabel (spremenljivka, _this, tiplabele) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
- //$.post('ajax.php?t=vprasanjeinline&a=inline_grid_naslov_save', {spremenljivka: spremenljivka, grid: $(_this).attr('grd_id'), anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, label: $(_this).html()});
$.post('ajax.php?t=vprasanjeinline&a=inline_label_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
- //vprasanje_save(true, spremenljivka);
- //vprasanje_save(true);
}
// shrani labele podrocij @ sliders
function inline_labele_podrocij(spremenljivka, _this, tiplabele){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
$.post('ajax.php?t=vprasanjeinline&a=inline_labele_podrocij_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
}
// shrani in posodobi custom opisne labele @ sliders
function inline_opisne_labele(spremenljivka, _this, tiplabele){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
$.post('ajax.php?t=vprasanjeinline&a=inline_opisne_labele_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
}
@@ -1065,12 +1076,7 @@ function inline_opisne_labele(spremenljivka, _this, tiplabele){
function inline_variabla_vsota (spremenljivka, _this) {
if ($(_this).attr('contenteditable') != 'true') return;
-
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
-
+
$.post('ajax.php?t=vprasanjeinline&a=inline_variabla_vsota_save', {spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, inline_variabla_vsota: $(_this).html()});
}
@@ -1108,9 +1114,7 @@ function inline_hotspot_delete_region(spr_id, region_index, vre_id){
});
//update variable in vrstni_red v srv_hotspot_regions
- //$.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_update_region', {spr_id: spr_id, vre_id: vre_id});
$.post('ajax.php?t=vprasanjeinline&a=inline_hotspot_update_region', {spr_id: spr_id});
-
}
//funkcija za preurejanje obstojecega obmocja
@@ -1121,13 +1125,9 @@ function inline_hotspot_edit_region(spr_id, region_index, vre_id){
// shrani nadnaslove @ uporaba traku
function trak_inline_nadnaslov(spremenljivka, _this, tiplabele, grid){
- if ($(_this).attr('contenteditable') != 'true') return;
- // Pocistimo text pri copy/paste
- if(pasteFromWord == true){
- inline_clear_paste(_this);
- }
+ if ($(_this).attr('contenteditable') != 'true') return;
+
//posljemo podatke v funkcijo za dinamicno shranjevanje
- //$.post('ajax.php?t=vprasanjeinline&a=inline_labele_podrocij_save', {anketa: srv_meta_anketa_id, grid: grid, spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
$.post('ajax.php?t=vprasanjeinline&a=inline_nadnaslov_save', {anketa: srv_meta_anketa_id, grid: grid, spremenljivka: spremenljivka, anketa: srv_meta_anketa_id, lang_id: srv_meta_lang_id, tiplabele: tiplabele, label: $(_this).html()});
-} \ No newline at end of file
+}
diff --git a/admin/survey/script/zankaProfiles.js b/admin/survey/script/zankaProfiles.js
index 43c0cc5..ff251a3 100644
--- a/admin/survey/script/zankaProfiles.js
+++ b/admin/survey/script/zankaProfiles.js
@@ -15,6 +15,7 @@ function changeViewZankaProfile(pid){
// funkcije ki skrbijo za profil zank
function zankaProfileAction(action) {
+
if (action == 'showProfiles') {
$('#fade').fadeTo('slow', 1);
// poiščemo center strani
@@ -26,19 +27,23 @@ function zankaProfileAction(action) {
var top = height / 2 - (msg.height() / 2);
}).show(200).draggable( { delay : 100, cancel : '#fs_list, input, .buttonwrapper, .select' });
- } else if (action == 'cancle') {
+ }
+ else if (action == 'cancle') {
$("#div_zanka_profiles").hide(200);
$('#fade').fadeOut('slow');
$("#div_zanka_profiles").html('');
return reloadData();
- } else if (action == 'newName') { // dodelimo novo ime profilu
+ }
+ else if (action == 'newName') { // dodelimo novo ime profilu
$("#zankaProfileCoverDiv").show();
$("#newProfileDiv").show();
- } else if (action == 'newCancle') { // preklicemo nov profil
+ }
+ else if (action == 'newCancle') { // preklicemo nov profil
$("#zankaProfileCoverDiv").hide();
$("#newProfileDiv").hide();
- } else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'newCreate') { // shranimo kot nov profil in pozenemo
var profileName = $("#newProfileName").val();
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -46,13 +51,16 @@ function zankaProfileAction(action) {
$.post('ajax.php?t=zankaProfile&a=createProfile', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, profileName:profileName, data:data, mnozenje:mnozenje }, function(newId) {
zankaProfileAction('showProfiles');
});
- } else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
+ }
+ else if (action == 'deleteAsk') { // vprašamo po potrditvi za brisanje
$("#zankaProfileCoverDiv").show();
$("#deleteProfileDiv").show();
- } else if (action == 'deleteCancle') { // preklicemo brisanje
+ }
+ else if (action == 'deleteCancle') { // preklicemo brisanje
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'deleteConfirm') { // izbrisemo profil
+ }
+ else if (action == 'deleteConfirm') { // izbrisemo profil
var pid = $("#zanka_profile .active").attr('value');
$.post('ajax.php?t=zankaProfile&a=delete_profile', { anketa : srv_meta_anketa_id, pid : pid }, function() {
$("#div_zanka_profiles").load(
@@ -64,13 +72,16 @@ function zankaProfileAction(action) {
});
$("#deleteProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameAsk') { // vprašamo za preimenovanje
+ }
+ else if (action == 'renameAsk') { // vprašamo za preimenovanje
$("#renameProfileDiv").show();
$("#zankaProfileCoverDiv").fadeIn();
- } else if (action == 'renameCancle') { // preklicemo preimenovanje
+ }
+ else if (action == 'renameCancle') { // preklicemo preimenovanje
$("#renameProfileDiv").hide();
$("#zankaProfileCoverDiv").fadeOut();
- } else if (action == 'renameConfirm') { // preimenujemo profil
+ }
+ else if (action == 'renameConfirm') { // preimenujemo profil
var pid = $("#zanka_profile .active").attr('value');
var name = $("#renameProfileName").val();
@@ -84,7 +95,8 @@ function zankaProfileAction(action) {
$("#zankaProfileCoverDiv").fadeOut();
});
});
- } else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
+ }
+ else if (action == 'run' || action == 'runSession') { // shranimo kot nov profil in pozenemo
var pid = $("#zanka_profile .active").attr('value');
var data = $.dds.serialize( 'fs_list_4' );
var mnozenje = 0;
@@ -92,24 +104,21 @@ function zankaProfileAction(action) {
// ce imamo mnozjenje pustimo max 2 variabli
if ( mnozenje * $("#fs_list_4 li").length > 2) {
- alert(lang['srv_loop_multiplication_error']);
+ genericAlertPopup('srv_loop_multiplication_error');
} else {
$.post('ajax.php?t=zankaProfile&a=run', {anketa: srv_meta_anketa_id, podstran: srv_meta_podstran, data:data, mnozenje:mnozenje, run:action, pid:pid }, function() {
-// window.location.reload();
-// return '';
return reloadData('zanka');
});
}
- } else if (action == 'change') {
+ }
+ else if (action == 'change') {
$("#loading").show();
var pid = $("#current_zanka_profile").val();
$.post('ajax.php?t=zankaProfile&a=change_profile', { anketa : srv_meta_anketa_id, pid : pid}, function() {
-// window.location.reload();
-// return '';
return reloadData();
});
} else {
- alert('Missing action:'+action)
+ genericAlertPopup('alert_missing_action',action)
};
-} \ No newline at end of file
+}
diff --git a/admin/survey/script/zoom.js b/admin/survey/script/zoom.js
index d43700d..debc254 100644
--- a/admin/survey/script/zoom.js
+++ b/admin/survey/script/zoom.js
@@ -85,7 +85,7 @@ function zoomProfileAction(action) {
//$("#zoom_cover_div").show();
$("#zoom_div div#newProfileDiv").show();
} else {
- alert('Najprej izberite variable');
+ genericAlertPopup('alert_choose_variables');
}
} else if (action == 'newCancel'){
@@ -110,10 +110,10 @@ function zoomProfileAction(action) {
// dropdownu dodamo nov prodil in ga izberemo
//$("#current_condition_profile").append( $("<option></option>").attr("value", newId).attr( "selected", true).text(name));
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
} else {
- alert(data.msg);
+ genericAlertPopup('alert_parameter_datamsg',data.msg);
}
});
//$("#zoom_cover_div").hide();
@@ -130,7 +130,7 @@ function zoomProfileAction(action) {
$("#zoom_div div#deleteProfileDiv").hide();
//$("#zoom_cover_div").fadeOut();
} else {
- alert(action);
+ genericAlertPopup('alert_parameter_action',action);
}
}
@@ -156,25 +156,14 @@ function toggleAllZoom(what) {
$.post('ajax.php?t=zoom&a=togleExtended', { anketa : srv_meta_anketa_id, what:what}, function() {
if (what == 0) {
- $("#div_zoom_condition ul").parent().show();
- $("#div_zoom_condition #zoomSpritesMinus").show();
- $("#div_zoom_condition #zoomSpritesPlus").hide();
+ $("#div_zoom_condition ul").parent().removeClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesMinus").removeClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesPlus").addClass('displayNone');
} else {
- $("#div_zoom_condition ul").parent().hide();
- $("#div_zoom_condition #zoomSpritesMinus").hide();
- $("#div_zoom_condition #zoomSpritesPlus").show();
+ $("#div_zoom_condition ul").parent().addClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesMinus").addClass('displayNone');
+ $("#div_zoom_condition #zoomSpritesPlus").removeClass('displayNone');
}
- /*
- if (what == 0) {
- $("#div_zoom_condition ul li div:nth-child(2)").show();
- $("#div_zoom_condition #zoomSpritesMinus").show();
- $("#div_zoom_condition #zoomSpritesPlus").hide();
- } else {
- $("#div_zoom_condition ul li div:nth-child(2)").hide();
- $("#div_zoom_condition #zoomSpritesMinus").hide();
- $("#div_zoom_condition #zoomSpritesPlus").show();
- }
- */
});
}
diff --git a/admin/survey/unsubscribe.php b/admin/survey/unsubscribe.php
index b92ca1f..7a70e7e 100644
--- a/admin/survey/unsubscribe.php
+++ b/admin/survey/unsubscribe.php
@@ -29,9 +29,10 @@
$anketa = $_GET['anketa'];
if ((int)$anketa > 0) {
$su = new SurveyUnsubscribe($anketa);
- $su::doUnsubscribe();
+ $su->doUnsubscribe();
- } else {
+ }
+ else {
echo $lang['user_bye_missing_id'];
exit;
}