summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-05-27 13:08:29 +0200
commit75160b12821f7f4299cce7f0b69c83c1502ae071 (patch)
tree27e25e4ccaef45f0c58b22831164050d1af1d4db /admin/survey/classes
parentprvi-commit (diff)
download1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.gz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.bz2
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.lz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.xz
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.tar.zst
1ka-75160b12821f7f4299cce7f0b69c83c1502ae071.zip
Diffstat (limited to 'admin/survey/classes')
-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
461 files changed, 41431 insertions, 19338 deletions
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()