1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
|
<?php
/**
*
* Created on 17.12.2019
*
* @author: Peter Hrvatin
*
* Class za prikaz tabele s podatki
*
*/
#KONSTANTE
// spremenljivke, ki se podajajo preko GETa
define('VAR_REC_ON_PAGE', 'rec_on_page');
define('VAR_SPR_LIMIT', 'spr_limit');
define('VAR_CUR_REC_PAGE', 'cur_rec_page');
define('VAR_SPR_PAGE', 'spr_page');
define('VAR_ORDER', 'order');
define('VAR_EDIT', 'edit');
define('VAR_PRINT', 'print');
define('VAR_MONITORING', 'monitoring');
define('VAR_CODING', 'coding');
define('VAR_DATA', 'view_data');
define('VAR_META', 'view_meta');
define('VAR_CIRCLES', 'view_circles');
define('VAR_METAFULL', 'view_fullmeta');
define('VAR_SHOW_SYSTEM', 'view_system');
define('VAR_SORT_SEQ', 'sort_seq');
define('VAR_SORT_TYPE', 'sort_type');
define('VAR_PDF_TYPE', 'type');
define('VAR_RELEVANCE', 'view_relevance');
define('VAR_SHOW_DATE', 'view_date', false);
define('VAR_SHOW_NO', 'view_no', false);
define('VAR_EMAIL', 'email');
define('SRV_LIST_GROUP_PAGINATE', 4); # po kolko strani grupira pri paginaciji
global $site_path;
class SurveyDataDisplay{
static private $sid = null; # id ankete
static private $folder = ''; # pot do folderja
static private $headFileName = null; # pot do header fajla
static private $dataFileName = null; # pot do data fajla
static private $dataFileStatus = null; # status data datoteke
static private $dataFileUpdated = null; # kdaj je bilo updejtano
static private $SDF = null; # class za osnovne funkcije data fajla
static private $inited = false; # ali smo razred inicializirali
static private $subAction = M_COLLECT_DATA_VIEW; # ali smo v urejanju ali pregledu
static private $survey = null; # podatki ankete
static private $db_table = ''; # ali se uporablja aktivna tabela
static private $file_handler = null; # ali se uporablja aktivna tabela
static private $_REC_ORDER = array('recnum'=>'ASC'); // vrstni red zapisov - rekordov
static private $_REC_LIMIT = ' NR==1,NR==50'; # string za limiz tapisov
static private $_RECORD_COUNT = 0; # koliko zapisov dobimo po filtriranju
static private $_TOTAL_PAGES = 0; # koliko strani dobimo po filtriranju
static private $_ALL_QUESTION_COUNT = null; # koliko je vseh vprasanj
static private $_ALL_VARIABLES_COUNT = null; # koliko je vseh variables
static private $SSNDF = null; # Class za SN_data fajle
static private $is_social_network = false; # ali je anketa tipa SN (social network)
static private $_HEADERS = array();
static private $_HAS_TEST_DATA = false; # ali anketa vsebuje testne podatke
static private $do_sort = false; # ali sploh sortiramo podatke
static private $sort_seq = null; # po katerem stolpcu sortiramo
static private $sort_type = null; # na kak način sortiramo sort_asc = / sort_dsc =
static private $doCMSUserFilter = false; # ali filtriramo samo svoje ankete
static private $usr_id = null; #id respondenta za ki ga trenutno prikazujemo
static private $showItime = false; #ali prikazujemo insert time
static private $showLineNumber = false; #ali vrivamo line number
static private $lineoffset = 0; #po koliko celicah vrivamo line number
static private $displayEditIcons = array(
'dataIcons_quick_view' => true,
'dataIcons_edit' => false,
'dataIcons_write'=>false); #ali prikazujemo ikone za urejanje
static private $displayEditIconsSettings = false; # ali prikazujemo okno s checkboxi za nastavitve tabele s podatki
static private $printPreview = false; # ali prikazujemo podatke kot print preview;
static private $canDisplayRelevance = true; # ali prikazujemo ustreznost - relevance;
static private $quickEdit_recnum = array(); # array z prejsnjim in naslednjim recnumom (za vpogled - puscici naprej,nazaj)
# LIMITI
static public $_VARS = array(
VAR_DATA => 1, # ali prikazujemo podatke
VAR_REC_ON_PAGE => 50,
VAR_CUR_REC_PAGE => 1,
VAR_META => 0, # ali prikazujemo meta (status)
VAR_METAFULL => 0, # ali prikazujemo full meta
VAR_SPR_LIMIT => 10,
VAR_SPR_PAGE => 1,
VAR_EDIT => 0, # ali imamo možnost urejanja (brisanje popravljanje)
VAR_PRINT => 0, # ali imamo možnost izpisa v PDF, RTF
VAR_MONITORING => 0, # ali smo v zavihku monitoring
VAR_CODING => 0, # ali smo v zavihku kodiranje
VAR_SHOW_SYSTEM => 0, # ali prikazujemo sistemske variable (telefon, email)
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_EMAIL => 1, # ali prikazujemo email status
VAR_CIRCLES => 0, # ali prikazujemo kroge antonučija
VAR_SHOW_DATE => 0, # ali prikazujemo kroge antonučija
VAR_SHOW_NO => 0, # ali prikazujemo kroge antonučija
);
static public $_CURRENT_STATUS_FILTER = '';
static public $_VARIABLE_FILTER = ''; # sed string array z prikazanimi variablami z upoštevanjem filtrov
static private $_SVP_PV = array(); # array z prikazanimi variablami z upoštevanjem filtrov
static public $_PROFILE_ID_STATUS = null;
static public $_PROFILE_ID_VARIABLE = null;
static public $_PROFILE_ID_CONDITION = null;
function __construct($anketa) {
self::Init($anketa);
}
/** Inicializacija
*
* @param $sid
*/
static public function Init($sid) {
# nastavimo privzeto pot do folderjev
global $site_path, $global_user_id, $lang;
self::$folder = $site_path . EXPORT_FOLDER.'/';
# nastavimo id ankete
self::$sid = $sid;
Common::deletePreviewData($sid);
SurveySession::sessionStart(self::$sid);
# nastavimo limite
self::setVars();
# podakcija
self::$subAction = isset($_GET['m']) && $_GET['m'] != '' ? $_GET['m'] : M_COLLECT_DATA_VIEW;
# informacije ankete
SurveyInfo::getInstance()->SurveyInit($sid);
self::$survey = SurveyInfo::getInstance()->getSurveyRow();
# aktivne tabele
if (SurveyInfo::getInstance()->getSurveyColumn('db_table') == 1)
self::$db_table = '_active';
# ali je anketa tipa SN - social network
self::$is_social_network = (SurveyInfo::getInstance()->checkSurveyModule('social_network')) ? true : false;
# Ce imamo vklopljeno povezovanje z identifikatorji, potem prikaz identifikatorjev izklopimo
if(self::$survey['show_email'] == '1'){
self::$_VARS[VAR_SHOW_SYSTEM] = false;
}
# 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) {
self::$showItime = true;
}
else {
self::$showItime = false;
}
# 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) {
self::$showLineNumber = true;
}
else {
self::$showLineNumber = false;
}
self::$_CURRENT_STATUS_FILTER = STATUS_FIELD.'~/6|5/';
if (self::$subAction == M_COLLECT_DATA_MONITORING)
$monitoring = true;
else
$monitoring = false;
SurveyStatusProfiles :: Init(self::$sid);
SurveyVariablesProfiles :: Init($sid, $global_user_id, true, $monitoring);
SurveyConditionProfiles :: Init($sid, $global_user_id);
SurveyTimeProfiles :: Init($sid, $global_user_id);
SurveyUserSetting :: getInstance()->Init($sid, $global_user_id);
SurveyDataSettingProfiles :: Init($sid);
SurveySetting::getInstance()->Init($sid);
$sdsp_displayEditIcons = SurveyDataSettingProfiles :: getSetting('dataShowIcons');
if ($sdsp_displayEditIcons != null && is_array($sdsp_displayEditIcons)) {
self::$displayEditIcons = $sdsp_displayEditIcons;
}
if(isset($_SESSION['sid_'.self::$sid]['dataIcons_settings']))
self::$displayEditIconsSettings = ($_SESSION['sid_'.self::$sid]['dataIcons_settings']);
# ali filtriramo cms usejreve datotekoe
session_start();
self::$doCMSUserFilter = $_SESSION['sid_'.$sid]['doCMSUserFilter'];
session_commit();
// Inicializiramo class za datoteke
self::$SDF = SurveyDataFile::get_instance();
self::$SDF->init($sid);
// 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::$headFileName = self::$SDF->getHeaderFileName();
self::$dataFileName = self::$SDF->getDataFileName();
self::$dataFileStatus = self::$SDF->getStatus();
self::$dataFileUpdated = self::$SDF->getFileUpdated();
// Ce ni datoteke izpisemo samo text
if ( self::$dataFileStatus == FILE_STATUS_NO_DATA || self::$dataFileStatus == FILE_STATUS_SRV_DELETED) {
Common::noDataAlert();
return false;
}
// Ce smo v identifikatorjih potem ne omogočamo urejanja
if (self::$_VARS[VAR_SHOW_SYSTEM] == true) {
foreach (self::$displayEditIcons AS $key => $value) {
self::$displayEditIcons[$key] = false;
}
}
# nastavimo ali smo v urejanju. Po novem gledamo url - zaenkrat imamo pregled urejanje in izvoz skupaj
if(self::$subAction == M_COLLECT_DATA_VIEW){
self::$_VARS[VAR_PRINT] = true;
}
if (self::$subAction == M_COLLECT_DATA_EDIT && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
self::$_VARS[VAR_EDIT] = true;
}
// gorazd, ti si nekaj spremenil tole EDIT variablo - tuki se zdej v vsakem primeru nastavi edit
if (self::$displayEditIcons['dataIcons_edit'] == true && self::$_VARS[VAR_SHOW_SYSTEM] == false) {
self::$_VARS[VAR_EDIT] = true;
} else {
self::$_VARS[VAR_EDIT] = false;
}
if ( self::$displayEditIcons['dataIcons_multiple'] ) {
self::$_VARS['spr_limit'] = 'all';
}
if (self::$subAction == M_COLLECT_DATA_MONITORING) {
self::$_VARS[VAR_MONITORING] = true;
self::$_VARS[VAR_PRINT] = true;
}
if (self::$subAction == 'coding') {
self::$_VARS[VAR_CODING] = true;
}
self::$_VARS[VAR_META] = self::$_VARS[VAR_METAFULL];
# Če so izbrani VSI vnosi, naj bo označena USTREZNOST,
# če pa so označeni le USTREZNI, je spoloh ni treba tega stolpca, saj so itak vsi ustrezni in je odveč.
$ssp_pid = SurveyStatusProfiles::getCurentProfileId();
if ($ssp_pid == 2) {
self::$canDisplayRelevance = false;
}
# preštejemo vsa vabila, če so vsi na ne, potem ne prikažemo vabil
if (IS_WINDOWS) {
$awk_cnt_str = 'awk -F"'.STR_DLMT.'" "'.EMAIL_FIELD.'~/1/'.' {cnt++} END {print cnt}" '.self::$dataFileName;
} else {
$awk_cnt_str = 'awk -F"'.STR_DLMT.'" \''.EMAIL_FIELD.'~/1/'.' {cnt++} END {print cnt}\' \''.self::$dataFileName.'\'';
}
$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) ) {
self::$_VARS[VAR_EMAIL] = 0;
}
# nastavimo način sortiranja
self::setUpSort();
# plovimo privzete id-je uporabniškega filtra
self::setUserFilters();
# nastavimo uporabniške filtere
self::setUpFilter();
# nastavimo SN class
if (self :: $is_social_network) {
self::$SSNDF = new SurveySNDataFile(self::$sid);
self::$SSNDF->setVars(self::$_VARS);
self::$SSNDF->setParameter('canDisplayRelevance',self::$canDisplayRelevance);
self::$SSNDF->setParameter('showItime',self::$showItime);
self::$SSNDF->setParameter('showLineNumber',self::$showLineNumber);
}
# nastavimo trenuten id respondenta (ce ga imamo)
if(isset($_GET['usr_id'])) {
self::$usr_id = $_GET['usr_id'];
}
}
public function ajax() {
switch ($_GET['a']) {
case 'displayDataPrintPreview' :
self :: displayDataPrintPreview();
break;
case 'setSnDisplayFullTableCheckbox' :
self :: setSnDisplayFullTableCheckbox();
break;
case 'set_data_search_filter' :
self :: setDataSearchFilter();
break;
default:
echo 'Error! (class: SurveyAnalysis->ajax() - missing action)';
break;
}
}
/** vrne število vseh vprašanj
*
*/
public static function getQuestionCount() {
if (self::$_ALL_QUESTION_COUNT == null) {
self::$_ALL_VARIABLES_COUNT = 0;
self::$_ALL_QUESTION_COUNT = 0;
if (self::$headFileName != null && self::$headFileName != '') {
foreach (unserialize(file_get_contents(self::$headFileName)) AS $_spremenljivka) {
if (isset($_spremenljivka['tip']) && $_spremenljivka['tip'] != 'm' && $_spremenljivka['tip'] != 'sm') {
self::$_ALL_VARIABLES_COUNT += $_spremenljivka['cnt_all'];
self::$_ALL_QUESTION_COUNT++;
}
}
}
}
return self::$_ALL_QUESTION_COUNT;
}
/** vrne število vseh variabel
*
*/
public function getVariablesCount() {
if (self::$_ALL_VARIABLES_COUNT == null) {
self::$_ALL_VARIABLES_COUNT = 0;
self::$_ALL_QUESTION_COUNT = 0;
if (self::$headFileName != null && self::$headFileName != '') {
foreach (unserialize(file_get_contents(self::$headFileName)) AS $_spremenljivka) {
if (isset($_spremenljivka['tip']) && $_spremenljivka['tip'] != 'm' && $_spremenljivka['tip'] != 'sm') {
self::$_ALL_VARIABLES_COUNT += $_spremenljivka['cnt_all'];
self::$_ALL_QUESTION_COUNT++;
}
}
}
}
return self::$_ALL_VARIABLES_COUNT;
}
/**
* @desc nastavi default vrednosti spremenljivk in prebere kar je blo GETano
*/
static function setVars () {
// preberemo kar je GETano
$data_view_settings = SurveySession::get('data_view_settings');
foreach (self::$_VARS AS $var => $val) {
if (isset($data_view_settings[$var]))
{
$_val = $data_view_settings[$var];
if (is_string($_val) && $_val == 'true')
{
$_val = (int)true;
}
else if (is_string($_val) && $_val == 'false')
{
$_val = (int)false;
}
else if (is_numeric($_val))
{
if( (float)$_val != (int)$_val )
{
$_val = (float)$_val;
}
else
{
$_val = (int)$_val;
}
}
self::$_VARS[$var] = $_val;
}
else if (isset($_REQUEST[$var]))
{
self::$_VARS[$var] = $_REQUEST[$var];
}
}
}
/**
* @desc vrne vse spremenljivki v obliki, ki se poslje preko GETa
* v parametrih se poda spremenljivko, ki se bo nastavla (se prav ni taka, kot je zdej v self::$_VARS)
*/
static function getVars ($new_var=null, $new_val=null) {
$str = '';
foreach (self::$_VARS AS $var => $val) {
if ($var == $new_var) {
$str .= '&'.$var.'='.$new_val;
} else {
$str .= '&'.$var.'='.$val;
}
}
return $str;
}
/**
* @desc vrne vse spremenljivki v obliki, ki se poslje preko GETa brez sorta, ker dodamo naknadno z javascriptom
* v parametrih se poda spremenljivko, ki se bo nastavla (se prav ni taka, kot je zdej v self::$_VARS)
*/
static function getVarsNoSort ($new_var=null, $new_val=null) {
$str = '';
foreach (self::$_VARS AS $var => $val) {
if ($var != VAR_SORT_SEQ && $var != VAR_SORT_TYPE) {
if ($var == $new_var) {
$str .= '&'.$var.'='.$new_val;
} else {
$str .= '&'.$var.'='.$val;
}
}
}
return $str;
}
static private function setUpSort() {
# če smo postali sort nastavitve preko geta
if (isset($_GET['sort_seq']) && (int)$_GET['sort_seq'] > 0 )
{
# sortiramo
self::$do_sort = true;
# nastavimo po kateri sekvenci / stolpcu sortiramo
self::$sort_seq = (int)$_GET['sort_seq'];
if (isset($_GET['sort_type']) && $_GET['sort_type'] === 'sort_dsc' )
{
self::$sort_type = 'sort_dsc';
}
else
{
self::$sort_type = 'sort_asc';
}
}
else
{
# ne sortiramo
self::$do_sort = false;
}
}
static private function setUserFilters()
{
#SurveyStatusProfiles :: setCurentProfileId();
self::$_PROFILE_ID_STATUS = SurveyStatusProfiles :: getDefaultProfile();
# Nastavimo filtre variabel
$dvp = SurveyUserSetting :: getInstance()->getSettings('default_variable_profile');
$_currentVariableProfile = SurveyVariablesProfiles :: checkDefaultProfile($dvp);
if ($dvp != $_currentVariableProfile) {
SurveyUserSetting :: getInstance()->saveSettings('default_variable_profile', $_currentVariableProfile);
}
self::$_PROFILE_ID_VARIABLE = $_currentVariableProfile;
}
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();
}
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;
}
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;
}
}
}
#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(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_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'];
}
# 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 = ',';
}
}
}
}
$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....
*
*/
public static function displayFilters() {
global $site_url, $site_path, $lang, $global_user_id;
#debug
echo '<script>window.onload = function() { __vnosi = 1; }</script>';
if (self::$dataFileStatus == FILE_STATUS_NO_DATA) {
return false;
}
# č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'].' ';
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 ' ';
/*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 ' ';
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 ' ';*/
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 ' ';
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 ' ';
/*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 ' ';
echo '<input type="checkbox" id="dataIcons_write" disabled="disabled" /><label for="dataIcons_write" class="gray">'.$lang['srv_dataIcons_write'].'</label>';
echo ' ';*/
echo '<input type="checkbox" id="dataIcons_labels" disabled="disabled" /><label for="dataIcons_labels" class="gray">'.$lang['srv_dataIcons_labels'].'</label>';
if ( self::showMultiple() ) {
echo ' ';
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>';
# ali imamo testne podatke
if (self::$_HAS_TEST_DATA) {
# izrišemo bar za testne podatke
$SSH = new SurveyStaticHtml(self::$sid);
$SSH -> displayTestDataBar();
}
}
else {
print_r("Anketa je bila izbrisana! Prikaz podatkov ni mogoč!");
}
}
public static function displayPaginacija($position='_top') {
global $lang, $site_url;
if ((int)self::$_RECORD_COUNT == 0) {
return false;
}
# ŠTEVILO VNOSOV NA STRAN
echo '<div id="div_paginacija_vnosov">';
echo '<label>'.$lang['srv_show_inserts'].'</label>';
if (self::$_VARS[VAR_REC_ON_PAGE] > self::$_RECORD_COUNT) {
self::$_VARS[VAR_REC_ON_PAGE] = 'all';
}
//$_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'].'">';
foreach ($_tmp_limit AS $limit) {
if ($limit < self::$_RECORD_COUNT) {
$_select_records .= '<option '.(self::$_VARS[VAR_REC_ON_PAGE] == $limit ? ' selected="selected"' : '').' value="'.$limit.'">';
$_select_records .= $limit;
$_select_records .= '</option>';
}
}
// 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 .= '</option>';
}
$_select_records .= '</select>';
echo $_select_records;
# KATERA STRAN
if (self::$_VARS[VAR_REC_ON_PAGE] != 'all' && self::$_TOTAL_PAGES > 1) {
echo '<label>';
echo $lang['page'];
echo '</label>';
// puscica levo
if (self::$_VARS[VAR_CUR_REC_PAGE] > 1){
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'].'">';
for ($i=1; $i<=self::$_TOTAL_PAGES; $i++) {
$_records_page .= '<option'.(self::$_VARS[VAR_CUR_REC_PAGE]==$i ? ' selected="selected"' : '' )
. ' value="'.$i.'" >';
$_records_page .= $i;
$_records_page .= '</option>';
}
$_records_page .= '</select>';
echo $_records_page;
// puscica desno
if (self::$_VARS[VAR_CUR_REC_PAGE] < self::$_TOTAL_PAGES){
echo '<a title="'.$lang['next_page'].'" href="#" onclick="setDataView(\''.VAR_CUR_REC_PAGE.'\',\''.(self::$_VARS[VAR_CUR_REC_PAGE]+1).'\');"><span class="faicon arrow2_r"></span></a>';
}
}
echo '</div>';
# ŠTEVILO SPREMENLJIVK NA STRAN
echo '<div id="div_paginacija_vprasanj">';
echo '<label>'.$lang['srv_show_questions'].'</label>';
self::getQuestionCount();
if (self::$_VARS[VAR_SPR_LIMIT] > self::$_ALL_QUESTION_COUNT) {
self::$_VARS[VAR_SPR_LIMIT] = 'all';
}
//$_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'].'">';
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.'">';
$_spr_on_page .= $label;
$_spr_on_page .= '</option>';
}
}
// 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 .= '</option>';
}
$_spr_on_page .= '</select>';
echo $_spr_on_page;
# KATERA STRAN
// prestejemo stevilo vprasanj
$questions = count(self::$_SVP_PV);
if (self::$_VARS[VAR_SPR_LIMIT] != 'all') {
$spr_pages = bcdiv($questions, self::$_VARS[VAR_SPR_LIMIT]);
if (bcmod($questions, self::$_VARS[VAR_SPR_LIMIT]) > 0)
$spr_pages += 1;
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'].'">';
echo '<label>';
echo $lang['page'];
echo '</label>';
// puscica levo
if (self::$_VARS[VAR_SPR_PAGE] > 1){
echo '<a title="'.$lang['previous_page'].'" href="#" onclick="setDataView(\''.VAR_SPR_PAGE.'\',\''.(self::$_VARS[VAR_SPR_PAGE]-1).'\');"><span class="faicon arrow2_l"></span></a>';
}
for ($i=1; $i<=$spr_pages; $i++) {
$_spr_page .= '<option'.(self::$_VARS[VAR_SPR_PAGE]==$i ? ' selected="selected"' : '' )
.' value="'.$i.'"'
.'>';
$_spr_page .= $i;
$_spr_page .= '</option>';
}
$_spr_page .= '</select>';
echo $_spr_page;
// puscica desno
if (self::$_VARS[VAR_SPR_PAGE] < $spr_pages){
echo '<a title="'.$lang['next_page'].'" href="#" onclick="setDataView(\''.VAR_SPR_PAGE.'\',\''.(self::$_VARS[VAR_SPR_PAGE]+1).'\');"><span class="faicon arrow2_r"></span></a>';
}
}
}
echo '</div>';
}
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) {
echo '<li>';
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>';
}
else {
echo '<label for="var_relevance" class="gray"><input type="checkbox" disabled="disabled" />'.$lang['srv_displaydata_relevance'].'</label>';
}
echo '</li>';
}
// email prikazujemo skupaj z ustreznost
if ((int)self::$survey['email'] == 1 && (int)self::$survey['user_base'] == 1) {
echo '<li>';
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>';
}
else {
echo '<label for="var_email" class="gray"><input type="checkbox" disabled="disabled" id="var_email" />'.$lang['srv_displaydata_invitation'].'</label>';
}
echo '</li>';
}
// 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>';
// 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>';
// č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>';
}
// 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>';
}
// 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>';
}
// 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>';
}
// Search po tabeli s podatki
public static function displayDataSearch(){
global $lang;
$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>';
}
// Shranimo iskanje v session
private function setDataSearchFilter(){
session_start();
$search = (isset($_POST['value']) && $_POST['value'] != '') ? trim($_POST['value']) : '';
if($search != ''){
$_SESSION['sid_'.self::$sid]['data_search_filter'] = $search;
}
else{
$_SESSION['sid_'.self::$sid]['data_search_filter'] = '';
}
session_commit();
// Na koncu se popravimo paginacijo na prvo stran
SurveySession::sessionStart(self::$sid);
SurveySession::append('data_view_settings','cur_rec_page',1);
return;
}
// Prikazemo editiranje na dnu (brisanje vecih hkrati...)
public static function displayBottomEdit(){
global $lang;
if ((int)self::$_RECORD_COUNT > 0){
echo '<div id="bottom_edit" class="floatLeft'.( self::$displayEditIcons['dataIcons_quick_view'] == true ? '' : ' shifted').'">';
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 ' <a href="#" onClick="deleteMultipleData();"><span class="faicon delete_circle icon-orange" title="'.$lang['srv_delete_data_multirow'].'"/></span> '.$lang['srv_delete_selected'].'</a>';
echo '<p>'.$lang['srv_delete_infotext'].' '.Help::display('srv_delete_infotext').'</p>';
echo '</div>';
}
}
/** Naredi output podatkov v HTML tabelo
*
*/
public static function displayVnosiHTML() {
global $lang;
global $site_path;
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();
// Checkboxa za urejanje in izpise podatkov ter razpiranje dodatnih nastavitev
echo '<div class="dataSettingsBasic">';
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 ' ';
// 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>';
echo '</div>';
}
echo '<br class="clr" />';
echo '<div id="displayFilterNotes">';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
SurveyTimeProfiles :: printIsDefaultProfile();
# če nismo v identifikatorjih
if (self::$_VARS[VAR_SHOW_SYSTEM] == false) {
# če imamo filter ifov ga izpišemo
SurveyConditionProfiles:: getConditionString();
# če imamo filter ifov za inspect ga izpišemo
$SI = new SurveyInspect(self::$sid);
$SI->getConditionString();
# če imamo filter spremenljivk ga izpišemo
SurveyVariablesProfiles:: getProfileString();
}
else{
echo '<p>'.$lang['srv_data_settings_identifier_notice'].'</p>';
}
# če imamo rekodiranje
$SR = new SurveyRecoding(self::$sid);
$SR -> getProfileString();
echo '</div>';
$folder = $site_path . EXPORT_FOLDER.'/';
echo '<div id="div_vnosi_data">';
if ((self::$dataFileStatus == 1 || self::$dataFileStatus == 0) && self::$dataFileName !== null) {
# filtri morajo prikazovat vsaj eno spremenljivko ali meta podatek
if (count(self::$_SVP_PV) > 0) {
# če imamo kaj podatkov za prikaz
if ((int)self::$_RECORD_COUNT > 0){
if (self :: $is_social_network == false) {
if ( self::showMultiple() && self::$displayEditIcons['dataIcons_multiple'] )
self::DisplayDataMultipleTable();
else
self::DisplayDataTable();
}
else {
# imamo SN omrežje
if (self::$_VARS[VAR_CIRCLES] == 0) {
self::DisplaySnLinks();
self::DisplayDataTable();
}
}
}
# ni vrstic za prikaz
else{
echo $lang['srv_data_no_data_filtred'];
}
}
else {
echo '<br /><div style="margin: 0 0 40px 0;">Ni podatkov za prikaz. Preverite filtre (Podatki, Para podatki, Polni para podatki)</div>';
}
}
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">';
#izrišemo legendo statusov
self::displayStatusLegend();
self::displayMetaStatusLegend();
self::displayTestLegend();
// na vrhu in na dnu izrisemo paginacijo
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>';
}
// osvetlimo stolpec s spremenljivko
if (isset($_GET['highlight_spr'])) {
?><script>
highlight_spremenljivka(<?=(int)$_GET['highlight_spr']?>);
</script><?php
}
// osvetlimo vrstice s spremembami
if (isset($_GET['highlight_usr'])) {
$high = explode('-', $_GET['highlight_usr']);
?><script>
highlight_user([<?=implode(',',$high)?>]);
</script><?php
}
// prikazujemo labele podatkov
if ( self::$displayEditIcons['dataIcons_labels'] ) {
?><script>
data_show_labels();
</script><?php
}
}
public static function DisplayDataTable() {
global $lang, $site_path;
if ( self::$dataFileStatus == FILE_STATUS_OLD) {
echo "Posodobljeno: ".date("d.m.Y, H:i:s", strtotime(self::$dataFileUpdated));
}
$folder = $site_path . EXPORT_FOLDER.'/';
// paginacija 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'];
}
#preberemo HEADERS iz datoteke
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
// vrinemo userid na začetku ki ga potem skrivamo.
$_svp_pv['uid'] = 'uid';
//self::$_SVP_PV = array_merge($_svp_pv, self::$_SVP_PV);
#izpišemo tabelo
echo '<div style="padding-top:0px; height:5px;" class="clr"> </div>';
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 ' ';
echo '<span class="faicon arrow_large2_r icon-as_link pointer" onclick="dataTableScroll(\'right\');return false;"></span>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
if (self::$printPreview == true) {
self::$displayEditIcons['dataIcons_edit'] = false;
self::$displayEditIcons['dataIcons_write'] = false;
$display1kaIcon = false;
}
# koliko stolpcev je colspan
$stolpci = ((int)self::$displayEditIcons['dataIcons_edit']*4)
+ ((int)self::$displayEditIcons['dataIcons_write']*2)
+ (int)$display1kaIcon;
// Evoli ikona (ce je vklopljen modul)
if((SurveyInfo::getInstance()->checkSurveyModule('evoli') || SurveyInfo::getInstance()->checkSurveyModule('evoli_employmeter')) && self::$displayEditIcons['dataIcons_write'] == '1')
$stolpci += 3;
// MFDPS ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('mfdps') && self::$displayEditIcons['dataIcons_write'] == '1')
$stolpci += 1;
// BORZA ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('borza') && self::$displayEditIcons['dataIcons_write'] == '1')
$stolpci += 1;
echo '<input type="hidden" id="tableIconColspan" value="'.($stolpci).'">';
# 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 '<thead class="fixedHeader">';
echo '<tr>';
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$spr_cont = 0;
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>';
}
// 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>';
}
$spr_cont++;
}
}
echo '</tr><tr>';
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$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 '<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($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>';
}
else{
echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
echo '<div class="headerCell">'.$grid['naslov'].'</div>';
echo '</th>';
}
}
}
$spr_cont++;
}
}
echo '</tr><tr>';
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$spr_cont = 0;
$system_columns = array();
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 '<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) {
foreach ($grid['variables'] AS $vid => $variable ){
echo '<th title="'.$variable['naslov'].($variable['other'] ? ' (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':'')
// .' inline_edit='.($spremenljivka['inline_edit']?$spremenljivka['inline_edit']:'0')
.($variable['sequence'] == self::$sort_seq && self::$sort_seq != null ? ' class="hover '.self::$sort_type.'"': '')
.'>';
if ($variable['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>';
}
// 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) {
echo ' (text)';
}
/*// urejanje kalkulacije -- izracunane vrednosti v podatkih
if ($spremenljivka['tip'] == 22) {
echo ' <a href="" onclick="calculation_editing(\'-'.substr($spid, 0, strpos($spid, '_')).'\'); return false;">('.$lang['edit3'].')</a>';
}*/
echo '</div>';
echo '</th>';
}
}
}
}
$spr_cont++;
}
}
echo'</tr>';
echo '</thead>';
# PREBEREMO PODATKE
$_command = '';
# najprej po potrebi presortiramo
# na vindowsih ne delamo sorta (zaenkrat)
if (self::$do_sort == true) {
$sortString = '-k '.self::$sort_seq;
#ker tekstovnih ne sortira vredu sem odstranil parameter -n
# iz navodil: sorting keys can be interpreted numerically (-n option) instead of alphabetically (which is the default).
# če bodo težave bo potrebno parameter -n dodajat po potrebi
# $sort_numeric =>
$sort_numeric = '';
//$sort_numeric = '-n ';
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (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') {
#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') {
$sort_numeric = '-n ';
}
}
}
}
}
}
}
if (IS_WINDOWS) {
#Cygwin Sort Command On Windows
# popravi pot do svojega sort-a
$_path_to_CygwinSort = PATH_TO_CYGWIN_FOLDER;
# $_command = $_path_to_CygwinSort.' -t"'.STR_DLMT.'"'.(self::$sort_type == 'sort_dsc' ? '-r' : '').' +'.(int)(self::$sort_seq-1).' '.self::$dataFileName.'';
$_command = $_path_to_CygwinSort.' -t"'.STR_DLMT.'" '.(self::$sort_type == 'sort_asc' ? '' : '-r ').$sort_numeric.$sortString.' '.self::$dataFileName;
} else {
# smo na linuxu
$_command = 'sort -t \\'.STR_DLMT.' '.(self::$sort_type == 'sort_asc' ? '' : '-r ' ).$sort_numeric.$sortString.' '.self::$dataFileName;
}
}
// 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)
{
$_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
{
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
} 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)
{
$_command .= ' | awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' ';
}
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\'';
}
}
// 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);
$_command .= ' | cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER;
}
if (self::$_REC_LIMIT != '') {
#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';
}
// 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);
$_command .= ' | sed \'s*'.STR_DLMT.'*</td><td>*g\' >> '
.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
if (IS_WINDOWS) {
# ker so na WINsih težave z sortom, ga damo v bat fajl in izvedemo :D
$file_handler = fopen($folder.'cmd_'.self::$sid.'_to_run.bat',"w");
fwrite($file_handler,$_command);
fclose($file_handler);
$out_command = shell_exec($folder.'cmd_'.self::$sid.'_to_run.bat');
unlink($folder.'cmd_'.self::$sid.'_to_run.bat');
} 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'){
$up = 0;
$low = 1;
}
else{
$up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
$low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
}
$cntLines=$low ;
$f = fopen ($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT, 'r');
while ($line = fgets ($f)) {
echo '<tr>';
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>';
}
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>';
}
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>';
// Evoli ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('evoli')) {
echo '<td class="data_edit"><span class="sprites evoli_16 evoli icon-as_link" title="Evoli"></span></td>';
echo '<td class="data_edit"><span class="sprites evoli2_16 evoli2 icon-as_link" title="Evoli - Danish"></span></td>';
echo '<td class="data_edit"><span class="sprites evoli3_16 evoli3 icon-as_link" title="Evoli - Slovensko"></span></td>';
}
if(SurveyInfo::getInstance()->checkSurveyModule('evoli_employmeter')) {
echo '<td class="data_edit"><span class="sprites evoli_16 evoliEM icon-as_link" title="Evoli EM"></span></td>';
echo '<td class="data_edit"><span class="sprites evoli2_16 evoliEM2 icon-as_link" title="Evoli EM - Danish"></span></td>';
echo '<td class="data_edit"><span class="sprites evoli3_16 evoliEM3 icon-as_link" title="Evoli EM - Slovensko"></span></td>';
}
// MFDPS ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('mfdps')) {
echo '<td class="data_edit"><span class="sprites mfdps_16 mfdps" title="MFDPS"></span></td>';
}
// BORZA ikona (ce je vklopljen modul)
if(SurveyInfo::getInstance()->checkSurveyModule('borza')) {
echo '<td class="data_edit"><span class="sprites borza_16 borza pointer" title="BORZA"></span></td>';
}
}
}
// URLje v besedilu spremenimo v __hiperlinke__
$line = stripslashes(self::url_to_link($line));
# po potrebi vrinemo zaporedno številko
if (self::$showLineNumber) {
$pos = self::getLineNumberCellOffset($line);
$line = substr_replace($line, '</td><td>'.$cntLines, $pos, 0);
}
echo '<td class="data_uid">'.$line.'</td>';
echo '</tr>';
$cntLines++;
}
} 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();
*/
// 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";
}
?>
</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) {
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() {
global $lang, $site_path;
if ( self::$dataFileStatus == FILE_STATUS_OLD) {
echo "Posodobljeno: ".date("d.m.Y, H:i:s", strtotime(self::$dataFileUpdated));
}
$folder = $site_path . EXPORT_FOLDER.'/';
// paginacija spremenljivk
$_spr_on_pages_stop = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'];
$_spr_on_pages_start = self::$_VARS['spr_page'] * self::$_VARS['spr_limit'] - self::$_VARS['spr_limit'];
$sql = sisplet_query("SELECT s.id, s.tip FROM srv_spremenljivka s, srv_grupa g WHERE s.tip='24' AND s.gru_id=g.id AND g.ank_id='".self::$sid."'");
if ( mysqli_num_rows($sql) != 1 ) return;
$row = mysqli_fetch_assoc($sql);
$parent = $row['id'];
$childs = array();
$sql1 = sisplet_query("SELECT spr_id FROM srv_grid_multiple WHERE parent='$parent' AND ank_id='".self::$sid."'");
while ( $row1 = mysqli_fetch_assoc($sql1) ) {
if ( isset( self::$_SVP_PV[$row1['spr_id'].'_0'] ) )
$childs[] = $row1['spr_id'];
}
#preberemo HEADERS iz datoteke
self::$_HEADERS = unserialize(file_get_contents(self::$headFileName));
$multiple = array();
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];
if ( in_array($spr_id, $childs) ) {
$spremenljivka['seq'] = explode('_', $spremenljivka['sequences']);
$spremenljivka['spr_id'] = $spid;
$multiple[] = $spremenljivka;
}
}
}
$sequences = array(); $subseq = array(); $cols = array();
for ($spr=0; $spr<count($multiple); $spr++) {
$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;"><</span>';
echo ' ';
echo '<span class="pointer halfCircleRight" onclick="dataTableScroll(\'right\');return false;">></span>';
echo '</div>';
$display1kaIcon = self::$displayEditIcons['dataIcons_quick_view'] ;
if (self::$printPreview == true) {
self::$displayEditIcons['dataIcons_edit'] = false;
self::$displayEditIcons['dataIcons_write'] = false;
$display1kaIcon = false;
}
# koliko stolpcev je colspan
$stolpci = ((int)self::$displayEditIcons['dataIcons_edit']*4)
+ ((int)self::$displayEditIcons['dataIcons_write']*2)
+ (int)$display1kaIcon ;
echo '<input type="hidden" id="tableIconColspan" value="'.($stolpci).'">';
# 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) {
//for ($i=0; $i<$stolpci; $i++)
// echo '<col class="data_edit">';
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) {
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
if ( in_array($spr_id, $childs) )
$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) {
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 '>';
}
}
if (!$repeat) break;
}
}
$spr_cont++;
}
}
echo '</colgroup>';
echo '<thead class="fixedHeader">';
echo '<tr>';
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid])) {
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
if ( in_array($spr_id, $childs) ) {
$colspan = $cols[ array_search($spr_id, $childs) ];
} else {
$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'].'">';
echo '<div class="headerCell">'.$spremenljivka['naslov'].'</div>';
echo '</th>';
}
$spr_cont++;
}
}
echo '</tr><tr>';
# colspan za ikonce
if ($stolpci > 0) {
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </td>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && (count($spremenljivka['grids']) > 0 )) {
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
if ( in_array($spr_id, $childs) )
$repeat = false;
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) {
echo '<th colspan="'.$grid['cnt_vars'].'" title="'.$grid['naslov'].'">';
echo '<div class="headerCell">'.$grid['naslov'].'</div>';
echo '</th>';
if (!$repeat) break;
}
}
$spr_cont++;
}
}
echo '</tr><tr>';
# colspan za ikonce
if ($stolpci > 0) {
//for ($i=0; $i<$stolpci; $i++)
// echo '<th class="data_edit"> </th>';
echo '<th class="data_edit"'.($stolpci > 1 ? (' colspan="'.$stolpci.'"') : '').'> </th>';
}
# dodamo skrit stolpec uid
echo '<th class="data_uid"> </th>';
$spr_cont = 0;
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (isset(self::$_SVP_PV[$spid]) && count($spremenljivka['grids']) > 0) {
$spr_id = explode('_', $spid);
$spr_id = $spr_id[0];
if ( in_array($spr_id, $childs) )
$repeat = false;
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'] ? ' (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':'')
// .' inline_edit='.($spremenljivka['inline_edit']?$spremenljivka['inline_edit']:'0')
.($variable['sequence'] == self::$sort_seq && self::$sort_seq != null ? ' class="hover '.self::$sort_type.'"': '')
.'>';
echo '<div class="dataCell">'.$variable['naslov'];
if ($variable['other'] == 1) {
echo ' (text)';
}
/*// urejanje kalkulacije -- izracunane vrednosti v podatkih
if ($spremenljivka['tip'] == 22) {
echo ' <a href="" onclick="calculation_editing(\'-'.substr($spid, 0, strpos($spid, '_')).'\'); return false;">('.$lang['edit3'].')</a>';
}*/
if ($variable['sequence'] == self::$sort_seq && self::$sort_seq != null) {
$img_src = self::$sort_type == 'sort_dsc' ? 'sort_descending' : 'sort_ascending' ;
echo '<span class="floatRight faicon '.$img_src.'" title=""></span>';
}
echo '</div>';
echo '</th>';
}
}
if (!$repeat) break;
}
}
$spr_cont++;
}
}
echo'</tr>';
echo '</thead>';
$_command = '';
#preberemo podatke
# najprej po potrebi presortiramo
# na vindowsih ne delamo sorta (zaenkrat) // zdej ga že? :)
if (self::$do_sort == true) {
#
$sortString = '-k '.self::$sort_seq;
#ker tekstovnih ne sortira vredu sem odstranil parameter -n
# iz navodil: sorting keys can be interpreted numerically (-n option) instead of alphabetically (which is the default).
# če bodo težave bo potrebno parameter -n dodajat po potrebi
# $sort_numeric =>
$sort_numeric = ''; #$sort_numeric = '-n '
# za datumska polja je potrebno malo potelovadit
foreach (self::$_HEADERS AS $spid => $spremenljivka) {
if (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']) {
if ($variable['spss'] == 'DATETIMEw' || $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';
}
}
}
}
}
}
}
if (IS_WINDOWS) {
#Cygwin Sort Command On Windows
# popravi pot do svojega sort-a
$_path_to_CygwinSort = PATH_TO_CYGWIN_FOLDER;
# $_command = $_path_to_CygwinSort.' -t"'.STR_DLMT.'"'.(self::$sort_type == 'sort_dsc' ? '-r' : '').' +'.(int)(self::$sort_seq-1).' '.self::$dataFileName.'';
$_command = $_path_to_CygwinSort.' -t"'.STR_DLMT.'" '.(self::$sort_type == 'sort_asc' ? '' : '-r ').$sort_numeric.$sortString.' '.self::$dataFileName;
} else {
# smo na linuxu
$_command = 'sort -t \\'.STR_DLMT.' '.(self::$sort_type == 'sort_asc' ? '' : '-r ' ).$sort_numeric.$sortString.' '.self::$dataFileName;
}
}
// 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) {
$_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 {
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\x7C\"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }" '.self::$dataFileName;
}
} 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) {
$_command .= ' | awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' ';
} else {
$_command = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS="\x7C"} '.self::$_CURRENT_STATUS_FILTER.' { print $0 }\' '.self::$dataFileName;
}
}
// 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);
$_command .= ' | cut -d \'|\' -f 1,'.self::$_VARIABLE_FILTER;
}
if (self::$_REC_LIMIT != '') {
#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';
}
// 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);
$_command .= ' | sed \'s*'.STR_DLMT.'*</td><td>*g\' >> '
.$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
}
if (IS_WINDOWS) {
# ker so na WINsih težave z sortom, ga damo v bat fajl in izvedemo :D
$file_handler = fopen($folder.'cmd_'.self::$sid.'_to_run.bat',"w");
fwrite($file_handler,$_command);
fclose($file_handler);
$out_command = shell_exec($folder.'cmd_'.self::$sid.'_to_run.bat');
unlink($folder.'cmd_'.self::$sid.'_to_run.bat');
} 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'){
$up = 0;
$low = 1;
}
else{
$up = self::$_VARS[VAR_REC_ON_PAGE] * self::$_VARS[VAR_CUR_REC_PAGE];
$low = $up - self::$_VARS[VAR_REC_ON_PAGE]+1;
}
$cntLines=$low ;
$f = fopen ($folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT, 'r');
$data = array();
while ($line= fgets ($f)) {
$data[] = explode('</td><td>', $line);
}
$dataoffset = 1;
$vrstni_red = array();
foreach (self::$_HEADERS AS $key => $val) {
if ($key != '_settings') {
$spr = explode('_', $key);
$spr = $spr[0];
$vrstni_red[$key] = $dataoffset;
if ( in_array($key, self::$_SVP_PV) ) { // TODO: tukaj je nekaj pocasno..
if (is_numeric($spr)) {
$dataoffset += $val['cnt_all'];
} else {
$dataoffset++;
}
}
}
}
$newdata = array();
for ($dataline=0; $dataline<count($data); $dataline++) {
$origline = $data[$dataline]; //for ($j=0; $j<count($origline); $j++) $origline[$j] = (1+$j).'_'.$origline[$j];
$newlines = array();
for ($i=0; $i < $subseq[0]; $i++) { // $subseq mora imeti vse vrednosti enake, cene ne bo slo, zato mamo lahko kar 0
$newlines[$i] = $origline;
$add = false; // preverjamo da niso same -3 ALI -1 (Ajda pravi da vcasih ni prikazovalo vrstic s samo -1)
if ($i==0) $add = true; // prvo vrstico pustimo v vsakem primeru
for ($spr=count($multiple)-1; $spr>=0; $spr--) {
for ($j=0; $j<$cols[$spr]; $j++) {
if ( ! in_array(trim($newlines[$i][ $vrstni_red[$multiple[$spr]['spr_id']] + ($cols[$spr]*($i)) + $j ]), array('-1', '-3', '-4')) ) {
$add = true;
break;
}
}
}
if ( $add ) { // preverjamo da niso same -3
// pri vseh, razen prvi vrstici odstranimo podvojene vrednosti
if ($i > 0) {
$leave = array();
for ($spr=count($multiple)-1; $spr>=0; $spr--) {
for ($j=0; $j<$cols[$spr]; $j++) {
$leave[] = $vrstni_red[$multiple[$spr]['spr_id']] + ($cols[$spr]*($i)) + $j;
}
}
for ($j=0; $j<count($newlines[$i]); $j++) {
if ( ! in_array($j, $leave) )
$newlines[$i][$j] = '';
}
}
for ($spr=count($multiple)-1; $spr>=0; $spr--) { // zacnemo od zadaj da si ne pokvarjamo indexov
// zbrisemo na koncu (najprej na koncu, da si ne pokvarjamo indexov)
array_splice($newlines[$i], $vrstni_red[$multiple[$spr]['spr_id']] + ($cols[$spr]*($i+1)), $subseq[0]*$cols[$spr] - $cols[$spr]*($i+1) );
// zbrisemo na zacetku
array_splice($newlines[$i], $vrstni_red[$multiple[$spr]['spr_id']], $cols[$spr]*($i));
}
# dodamo UID. Mitja, tole sem jaz dodal,
# da se na začetek vsake vrstice doda UID, kateri je potreben za postprocess JS funkcije
# za urejanje, ker Ajda joka da v kombinirani tabeli ne deluje urejanje za podvojene vrstice
# Gorazd
$newlines[$i][0] = $origline[0];
// dodamo v nov array
$newdata[] = $newlines[$i];
}
}
}
unset($data);
$data = &$newdata;
foreach ($data AS $line) {
$line = implode('</td><td>', $line);
echo '<tr>';
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>';
}
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>';
}
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>';
}
}
// URLje v besedilu spremenimo v __hiperlinke__
$line = stripslashes(self::url_to_link($line));
# po potrebi vrinemo zaporedno številko
if (self::$showLineNumber && self::$_VARS[VAR_DATA]) {
$pos = self::getLineNumberCellOffset($line);
$line = substr_replace($line, '</td><td>'.$cntLines, $pos, 0);
}
echo '<td class="data_uid">'.$line.'</td>';
echo '</tr>';
$cntLines++;
}
} 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();
*/
// 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 ($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) {
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) {
if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443)
return preg_replace('!(https://[a-z0-9_./?=&-]+)!i', '<a href="$1" target="_blank">$1</a> ', $text." ");
else
return preg_replace('!(http://[a-z0-9_./?=&-]+)!i', '<a href="$1" target="_blank">$1</a> ', $text." ");
}
/** Prikaze reseno anketo za posameznega uporabnika v hitrem nacinu
*
*/
public static function displayQuickEdit(){
global $lang;
global $site_path;
if (self::$dataFileStatus == FILE_STATUS_NO_DATA
|| self::$dataFileStatus == FILE_STATUS_NO_FILE
|| self::$dataFileStatus == FILE_STATUS_SRV_DELETED){
return false;
}
include_once('../../main/survey/app/global_function.php');
new \App\Controllers\SurveyController(true);
save('usr_id', self::$usr_id);
if (isset($_GET['quick_view']) && $_GET['quick_view'] == 0 ) {
$quick_view = false;
} else {
$quick_view = true;
}
$rowa = SurveyInfo::getInstance()->getSurveyRow();
if ($quick_view) {
# če smo v quick_view disejblamo vse elemente forem
echo "<script>"."\n";
//echo "$(document).ready(function(){ $('#edit_survey_data input:[type=radio], #edit_survey_data input:[type=checkbox], #edit_survey_data input:[type=text], #edit_survey_data select, #edit_survey_data textarea').attr('disabled',true); })"."\n";
echo "$(document).ready(function(){ $('#edit_survey_data input:[type=radio], #edit_survey_data input:[type=checkbox], #edit_survey_data input:[type=text], #edit_survey_data select, #edit_survey_data textarea, #edit_survey_data input:[type=button] , ').attr('disabled',true); })"."\n";
echo "$(document).ready(function(){ $('#quick_view').attr('disabled',false); })"."\n";
echo "$(document).ready(function(){ $('.ranking').draggable({disabled:true}); })"."\n"; //disable-anje draggable
echo "$(document).ready(function(){ $('.dropzone, .sortzone').sortable({disabled:true}); })"."\n"; //disable-anje sortable
//echo "$(document).ready(function(){ $('canvas').attr('disabled'); })"."\n"; //disable-anje canvas
echo "$(document).ready(function(){ $('.sig').attr('disabled', true); })"."\n"; //disable-anje canvas
echo "</script>";
}
else{
# če urejamo dodamo prazno js funkcijo submitForm da ne mece errorja (submit izvedemo rocno)
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>';
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";
}
if (isset($_GET['anketa']))
{
save('anketa', $_GET['anketa']);
if ($quick_view == false) {
//JS potreben za branching
\App\Controllers\JsController::getInstance()->generateBranchingJS();
echo '<script>function checkBranchingDate(){checkBranching();}</script>';
// shranimo popravke v bazo
if(isset($_GET['post']) && $_GET['post'] == '1'){
\App\Models\SaveSurvey::getInstance()->posted();
}
}
$first_loop = 0;
// prikažemo spremenljivke - vse grupe
do
{
// nastavimo naslednjo grupo / loop
if(get('loop_AW') == 0 && get('loop_id') == null){
save('grupa', \App\Controllers\FindController::getInstance()->findNextGrupa());
} elseif (get('loop_id') != null) {
save('loop_id', \App\Controllers\FindController::getInstance()->findNextLoopId());
if (get('loop_id') == null)
save('grupa', \App\Controllers\FindController::getInstance()->findNextGrupa());
}
echo '<div id="container">'."\n";
// zgeneriramo sistemske spremenljivke
\App\Controllers\HeaderController::getInstance()->displaySistemske();;
$offset = 0;
$zaporedna = 1;
if (SurveyInfo::getInstance()->getSurveyCountType() > 0)
{
// Preštejemo koliko vprašanj je bilo do sedaj
$sqlg = sisplet_query("SELECT vrstni_red FROM srv_grupa WHERE id='".get('grupa')."'");
$rowg = mysqli_fetch_assoc($sqlg);
$vrstni_red = $rowg['vrstni_red'];
$sqlCountPast = sisplet_query("SELECT count(*) as cnt FROM srv_spremenljivka s, srv_grupa g WHERE g.ank_id='".get('anketa')."' AND s.gru_id=g.id AND g.vrstni_red < '$vrstni_red' ORDER BY g.vrstni_red ASC, s.vrstni_red ASC");
$rowCount = mysqli_fetch_assoc($sqlCountPast);
$offset = $rowCount['cnt'];
}
// poiscemo vprasanja / spremenljivke
$sql = sisplet_query("SELECT id FROM srv_spremenljivka WHERE gru_id='".get('grupa')."' AND visible='1' ORDER BY vrstni_red ASC");
while ($row = mysqli_fetch_array($sql)) {
//ce gre za glasovanje in smo eno vprasanje ze prikazali, ostalih ne prikazemo
if( (SurveyInfo::getInstance()->getSurveyType() != 0) || ($zaporedna == 1)){
// preverimo, ce je na tej strani LOOP
if (get('loop_id') ==null) {
// nastavimo pravi id trenutnega loopa
$if_id = \App\Controllers\FindController::find_parent_loop($row['id']);
if ($if_id > 0) {
// Ce je prva spremenljivka v loopih izpisemo warning za urejanje
$first_loop = ($first_loop == 0) ? 1 : 2;
if($first_loop == 1)
echo '<div class="loop_warning">'.$lang['srv_loop_warning'].'<a href="#" title="'.$lang['srv_edit_data_row'].'" onClick="quickEditAction(\'edit\', \''.self::$usr_id.'\');">'.$lang['srv_loop_warning2'].'</a>.</div>';
save('loop_id', \App\Controllers\FindController::getInstance()->findNextLoopId($if_id));
}
}
// filtriramo spremenljivke glede na profil
$dvp = SurveyUserSetting :: getInstance()->getSettings('default_variable_profile');
$_currentVariableProfile = SurveyVariablesProfiles :: checkDefaultProfile($dvp);
# V VPOGLEDU NE FILTRIRAMO SPREMENLJIVK (v.v.: 27.11.2011)
#$tmp_svp_pv = SurveyVariablesProfiles :: getProfileVariables($_currentVariableProfile);
# č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 (!is_countable($tmp_svp_pv) || 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] = substr($vid, 0, strpos($vid, '_'));
}
}
}
else{
foreach ( $tmp_svp_pv as $vid => $variable) {
$tmp_svp_pv[$vid] = substr($vid, 0, strpos($vid, '_'));
}
}
# V VPOGLEDU NE FILTRIRAMO SPREMENLJIVK (v.v.: 27.11.2011)
//if(in_array($row['id'],$tmp_svp_pv))
\App\Controllers\Vprasanja\VprasanjaController::getInstance()->displaySpremenljivka($row['id'], $offset, $zaporedna);
}
$zaporedna++;
}
if ($quick_view == false) {
\App\Controllers\JsController::getInstance()->generateSubmitJS();
}
echo '</div>'."\n";
}
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{
echo '</form>'."\n";
}
echo '</div>'; # inner
echo '<div id="quick_edit_title">';
self::displayVnosIcons();
echo '</div>';
echo '<br /><br /><br /><br />';
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();
$sas = new SurveyAdminSettings();
$sas->checkFirstDataChange($inserted=true);
}
}
public static function displayQuickEditFilters(){
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;
}
self::displayQuickEditPagination();
echo '<div id="div_analiza_filtri_right" class="floatRight vpogled">';
echo '<ul>';
# div za filtre statusov
SurveyStatusProfiles::DisplayLink(false);
# div za profile variabel
SurveyVariablesProfiles::DisplayLink(false, false);
# filter za pogoje - ifi
SurveyConditionProfiles::DisplayLink(false);
# filter za čase
SurveyTimeProfiles::DisplayLink(false,false);
echo '</ul>';
echo '</div>';
# če ne uporabljamo privzetega časovnega profila izpišemo opozorilo
$doNewLine = SurveyTimeProfiles :: printIsDefaultProfile(false);
if ($doNewLine) {
echo '<br/>';
}
# če imamo filter ifov ga izpišemo
$doNewLine = SurveyConditionProfiles:: getConditionString($doNewLine ) || $doNewLine;
# če imamo filter ifov za inspect ga izpišemo
$SI = new SurveyInspect(self::$sid);
$SI->getConditionString();
# če imamo filter spremenljivk ga izpišemo
# ker v vpogledu ne filtriramo spremenljivk, ne izpisujemo obvestila
#$doNewLine = SurveyVariablesProfiles:: getProfileString($doNewLine ) || $doNewLine;
if ($doNewLine) {
echo '<br/>';
}
echo '<div id="quick_edit_title">';
self::displayVnosIcons();
echo '</div>';
}
public static function displayQuickEditPagination() {
global $site_url, $lang;
#Userje polovimo iz datoteke s pomočjo filtrov z AWK-jem
$_command = '';
#preberemo podatke
$tmp_file = self::$folder.'tmp_export_'.self::$sid.'_data'.TMP_EXT;
$file_handler = fopen($tmp_file,"w");
fwrite($file_handler,"<?php\n");
fclose($file_handler);
# polovimo vrstice z statusom 5,6 in jih damo v začasno datoteko
if (IS_WINDOWS) {
$_command = 'gawk -F"'.STR_DLMT.'" "BEGIN {OFS=\"\"} '.self::$_CURRENT_STATUS_FILTER.' {print \"$uids[]=\",'.USER_ID_FIELD.',\";$uid_rec[\",'.USER_ID_FIELD.',\"]=\",'.MOD_REC_FIELD.',\";\" }" '.self::$dataFileName.' >> '.$tmp_file;
} else {
$_command = 'awk -F"'.STR_DLMT.'" \'BEGIN {OFS=""} '.self::$_CURRENT_STATUS_FILTER.' { print "$uids[]=",'.USER_ID_FIELD.',";$uid_rec[",'.USER_ID_FIELD.',"]=",'.MOD_REC_FIELD.',";"}\' '.self::$dataFileName.' >> '.$tmp_file;
}
if (IS_WINDOWS) {
$out_command = shell_exec($_command);
} else {
$out_command = shell_exec($_command);
}
include($tmp_file);
if (file_exists($tmp_file)) {
unlink($tmp_file);
}
# če imamo zapise
$all = count($uids);
# current nastavimo na zadnji element
if ( $all > 0) {
// Če trenutni user ni nastavljen ga nastavimo. Upoštevamo tudi filtre, zato preberemo prvega iz filtriranega seznama
if(self::$usr_id == 0){
self::$usr_id = reset($uids);
}
if (isset($_GET['quick_view']) && $_GET['quick_view'] == 0 ) {
$baseUrl = $site_url.'admin/survey/index.php?anketa='.self::$sid.'&a=data&m=quick_edit&quick_view='.$_GET['quick_view'].'&usr_id=';
} else {
$baseUrl = $site_url.'admin/survey/index.php?anketa='.self::$sid.'&a=data&m=quick_edit&usr_id=';
}
if (self::$usr_id > 0 && isset(self::$usr_id,$uids)) {
$current = array_search(self::$usr_id,$uids);
} else {
$current = count($uids)-1;
}
echo '<div id="pagination" class="floatLeft">';
# 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];
if( ($current - 1) >= 0) {
echo('<div><a href="'.$baseUrl.$prev_page.'"><span class="faicon pagination_left icon-blue"></span></a></div>');
} else {
# brez href povezave
echo('<div class="disabledPage"><span class="faicon pagination_left icon-blue_soft"></span></div>');
$controls['hasPrev'] = false;
}
# povezave za vmesne strani
$middle = $all / 2;
$skipped = false;
for($a = 0; $a < $all; $a++) {
if ($all < ((SRV_LIST_GROUP_PAGINATE+1) * 2) || $a <= SRV_LIST_GROUP_PAGINATE || $a > ($all-SRV_LIST_GROUP_PAGINATE)
|| ( abs($a-$current) < SRV_LIST_GROUP_PAGINATE)) {
if ($skipped == true) {
echo '<div class="spacePage">. . .</div>';
$skipped = false;
}
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>');
}
} else {
$skipped = true;
}
}
# povezava na naslednjo stran
$next_page = ($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 {
# brez href povezave
echo('<div class="disabledPage"><span class="faicon pagination_right icon-blue_soft"></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>';
// 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 {
// dobimo trenutnega userja - ce ni nastavljen v get-u
if(self::$usr_id == 0){
$sqlu = sisplet_query("SELECT id FROM srv_user WHERE ank_id='".self::$sid."' ORDER BY recnum DESC LIMIT 1");
$rowu = mysqli_fetch_array($sqlu);
self::$usr_id = $rowu['id'];
}
}
}
public static function displayQuickEditMeta(){
global $lang;
global $site_path;
global $admin_type;
$rowa = SurveyInfo::getInstance()->getSurveyRow();
// dobimo trenutnega userja
if(self::$usr_id > 0){
$sqlu = sisplet_query("SELECT * FROM srv_user WHERE ank_id='".self::$sid."' AND id='".self::$usr_id."' ");
$rowu = mysqli_fetch_array($sqlu);
}
else{
$sqlu = sisplet_query("SELECT * FROM srv_user WHERE ank_id='".self::$sid."' ORDER BY recnum DESC ");
$rowu = mysqli_fetch_array($sqlu);
}
self::$usr_id = $rowu['id'];
echo '<div class="title">'.$lang['srv_metapodatki'].'</div>';
echo '<table>';
echo '<tr><td class="left">'.$lang['srv_info_type'].':</td>';
echo '<td class="right">'.$lang['srv_vrsta_survey_type_'.SurveyInfo::getSurveyType()].'</td></tr>';
// IP
$ip = SurveySetting::getInstance()->getSurveyMiscSetting('survey_ip');
$ip_show = SurveySetting::getInstance()->getSurveyMiscSetting('survey_show_ip');
if($ip==0 && $ip_show==1 && ($admin_type == 0 || $admin_type == 1)){
echo '<tr><td class="left">'.$lang['ip'].':</td>';
echo '<td class="right">'.($rowu['ip'] ? $rowu['ip'] : ' ').'</td></tr>';
}
// recnum
echo '<tr><td class="left">'.$lang['srv_recnum'].':</td>';
echo '<td class="right">'.($rowu['recnum'] ? $rowu['recnum'] : ' ').'</td></tr>';
// Pri volitvah nimamo parapodatkov
if (!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// browser
echo '<tr><td class="left">'.$lang['browser'].':</td>';
echo '<td class="right">'.($rowu['useragent'] ? $rowu['useragent'] : ' ').'</td></tr>';
// javascript
echo '<tr><td class="left">'.$lang['javascript'].':</td>';
echo '<td class="right">'.(($rowu['javascript'] == 1) ? $lang['yes'] : $lang['no1']).'</td></tr>';
// jezik
// Dobimo vse jezike za katere obstaja jezikovna datoteka
include_once($site_path.'lang/jeziki.php');
$jeziki = $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>';
}
// status
echo '<tr><td class="left">'.$lang['status'].':</td>';
echo '<td class="right">'.($rowu['last_status'] ? $rowu['last_status'] : ' ').'</td></tr>';
// lurker
echo '<tr><td class="left">'.$lang['srv_data_lurker'].':</td>';
echo '<td class="right">'.(($rowu['lurker'] == 1) ? $lang['yes'] : $lang['no1']).'</td></tr>';
// Pri volitvah nimamo parapodatkov
if (!SurveyInfo::getInstance()->checkSurveyModule('voting')){
// referer
echo '<tr><td class="left">'.$lang['referer'].':</td>';
echo '<td class="right">'.($rowu['referer'] ? $rowu['referer'] : ' ').'</td></tr>';
// email - samo forma
if($rowa['survey_type'] == 1){
echo '<tr><td class="left">'.$lang['email'].':</td>';
echo '<td class="right">'.($rowu['email'] ? $rowu['email'] : ' ').'</td></tr>';
}
// spreminjal
$datetime = strtotime($rowu['time_insert']);
$text = date("d.m.Y, H:i:s", $datetime);
echo '<tr><td class="left">'.$lang['timeinsert'].':</td>';
echo '<td class="right">'.$text.'</td></tr>';
$datetime = strtotime($rowu['time_edit']);
$text = date("d.m.Y, H:i:s", $datetime);
echo '<tr><td class="left">'.$lang['timeedit'].':</td>';
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");
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 '<td class="right">'.$text.'</td></tr>';
}
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>';
}
}
# preberemo vklopljene module
//potrebuje se za modul MAZA, da aplikacija izpolni te hidden inpute
//rabi pa se to za povezavo respondenta med tebelama maza_app_users in srv_user
if(SurveyInfo::checkSurveyModule('maza')){
$maza_query = "SELECT mau.identifier, mau.deviceInfo, mau.tracking_log FROM maza_app_users as mau
JOIN maza_srv_users AS msu ON mau.id = msu.maza_user_id
JOIN srv_user AS su ON msu.srv_user_id = su.id
WHERE su.id = '".self::$usr_id."';";
$sql = sisplet_query($maza_query, 'array');
//it is already there
if(count($sql) > 0){
//NextPin link
echo '<tr><td class="left">'.$lang['srv_maza_nextpin_link'].':</td>';
echo '<td class="right"><a href="http://traffic.ijs.si/NextPin/?user=1KAPanel_'.$sql[0]['identifier'].'">'
. 'http://traffic.ijs.si/NextPin/?user=1KAPanel_'.$sql[0]['identifier'].'</a></td></tr>';
//Device info
echo '<tr><td class="left">'.$lang['srv_maza_device_info'].':</td>';
echo '<td class="right">'.$sql[0]['deviceInfo'].'</td></tr>';
//Tracking logs
echo '<tr><td class="left">'.$lang['srv_maza_user_app_logs'].':</td>';
echo '<td class="right">'.$sql[0]['tracking_log'].'</td></tr>';
}
}
echo '</table>';
echo '<div id="survey-connect-disp" style="display:none"></div>';
}
/* funkcija vrne AWK string za pogoj ali iščemo zapise trenutnega userja
* vklopljeno more bit prepoznava userja iz cms
*
*/
static function createCMSUserFilter() {
#poiščemo sekvenco meta podatka: usr_from_cms
$found=false;
$sequence = null;
if (count(self::$_HEADERS['meta']['grids']) > 0 && $found==false) {
foreach (self::$_HEADERS['meta']['grids'] AS $gid => $grids) {
if (count($grids['variables']) > 0 && $found==false) {
foreach ($grids['variables'] AS $vids => $variables) {
if ($variables['variable'] == 'usr_from_cms') {
$sequence = $variables['sequence'];
$found=true;
}
}
}
}
}
if ($found == true && (int)$sequence > 0) {
# polovimo email
global $global_user_id;
$sqlu = sisplet_query("SELECT email FROM users WHERE id = '".$global_user_id."'");
list($email) = mysqli_fetch_row($sqlu);
if ($email != null &&trim($email) != '') {
# nardimo awk string da primerjamo email
if (IS_WINDOWS) {
# za windows
$awkString = '($'.$sequence.'=='."\\\"".$email."\\\"".')';
} else {
# za linux
$awkString = '($'.$sequence.'=='.'"'.$email.'"'.')';
}
return $awkString;
}
}
return null;
}
static function displayOnlyCMS() {
global $lang;
# prikažemo samo če imamo ankete uporabnika iz cms
echo '<label>';
echo '<input type="checkbox" id="doCMSUserFilterCheckbox"'.(self::$doCMSUserFilter==true?' checked="checked"':'').' onchange="changeDoCMSUserFilterCheckbox();" autocomplete="off">';
echo $lang['srv_data_onlyMySurvey'];
echo Help::display('srv_data_onlyMySurvey');
echo '</label>';
}
static function displayPublicData($properties = array()) {
global $lang;
global $site_url;
header('Cache-Control: no-cache');
header('Pragma: no-cache');
$anketa = self::$sid;
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="'.$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 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 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 . '" />';
echo '<div id="analiza_data">';
//Izvoz v PDF / RTF / XLS
$_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
array( 'b'=>'export',
'a'=>'list_pdf',
'anketa'=>$anketa)));
$_url2 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
array( 'b'=>'export',
'a'=>'list_rtf',
'anketa'=>$anketa)));
$_url3 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
array( 'b'=>'export',
'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> ';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
echo '<a href="'.$_url3.'" target="_blank"><span class="faicon xls icon-as_link"></span></a>';
if (isset($properties['profile_id_status']))
{
self::$_PROFILE_ID_STATUS = $properties['profile_id_status'];
SurveyStatusProfiles :: setCurentProfileId(self::$_PROFILE_ID_STATUS);
}
if (isset($properties['profile_id_variable']))
{
self::$_PROFILE_ID_VARIABLE = $properties['profile_id_variable'];
SurveyVariablesProfiles::setCurrentProfileId(self::$_PROFILE_ID_VARIABLE);
}
if (isset($properties['profile_id_condition']))
{
self::$_PROFILE_ID_CONDITION = $properties['profile_id_condition'];
SurveyConditionProfiles::setCurrentProfileId(self::$_PROFILE_ID_CONDITION);
}
self::$printPreview = true;
self::$_VARS[VAR_DATA] = 1;
self::$_VARS[VAR_EDIT] = 0;
self::$_VARS[VAR_PRINT] = 0;
self::$_VARS[VAR_MONITORING] = 0;
if (isset(self::$_SVP_PV['invitation'])) {
unset(self::$_SVP_PV['invitation']);
}
# ponastavimo nastavitve- filter
self::setUpFilter();
self::DisplayDataTable();
// JS ki vedno doda labele
?><script>
data_show_labels();
</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> ';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
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>';
}
function displayDataPrintPreview() {
global $lang;
global $site_url;
header('Cache-Control: no-cache');
header('Pragma: no-cache');
$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="'.$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 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 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 '<div id="analiza_data">';
//Izvoz v PDF / RTF / XLS
$_url1 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
array( 'b'=>'export',
'a'=>'list_pdf',
'anketa'=>$anketa)));
$_url2 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
array( 'b'=>'export',
'a'=>'list_rtf',
'anketa'=>$anketa)));
$_url3 = $site_url.'admin/survey/izvoz.php?dc='.base64_encode(
serialize(
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> ';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf 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;
self::$_VARS[VAR_SPR_LIMIT] = 5;
self::$_VARS[VAR_META] = 0;
self::$_VARS[VAR_EMAIL] = 0;
self::$_VARS[VAR_RELEVANCE] = 0;
self::$_VARS[VAR_EDIT] = 0;
self::$_VARS[VAR_PRINT] = 0;
self::$_VARS[VAR_MONITORING] = 0;
if (isset(self::$_SVP_PV['invitation'])) {
unset(self::$_SVP_PV['invitation']);
}
# 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> ';
echo '<a href="'.$_url2.'" target="_blank"><span class="faicon rtf icon-as_link"></span></a> ';
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>';
}
static function displayVnosIcons() {
global $lang;
global $global_user_id;
$userAccess = UserAccess::getInstance($global_user_id);
// gumbi na levi (delete, edit, izvozi...)
echo '<div id="left_options">';
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>';
// 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
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 '<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 '<input type="hidden" id="quick_view" value="1">';
}
echo '</div>';
}
static function displayStatusLegend (){
if (self::$dataFileStatus >= 0) {
#status - če smo v meta ali imamo profil vse enote
if ( (self::$_VARS[VAR_META] && self::$_VARS[VAR_METAFULL])
|| ( SurveyStatusProfiles::getCurentProfileId() == 1 )) {
SurveyAnalysisHelper::getInstance()->displayStatusLegend();
}
}
}
static function displayTestLegend (){
if (self::$dataFileStatus >= 0) {
#testni vnosi - samo ce imamo testne
if (self::$_HAS_TEST_DATA) {
SurveyAnalysisHelper::getInstance()->displayTestLegend();
}
}
}
static function displayMetaStatusLegend (){
if (self::$dataFileStatus >= 0) {
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();
$_SESSION['sid_'.self::$sid]['snCreateFullTable'] = (int)$_POST['fullTable'] == 1;
session_commit();
}
static function getLineNumberCellOffset($line) {
$offset = 0;
// 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++) {
$offset = strpos($line,'</td><td>',$offset+1);
}
}
return $offset;
}
static function showMultiple () {
$sql = sisplet_query("SELECT * FROM srv_grid_multiple WHERE ank_id = ".self::$sid." GROUP BY parent");
if ( mysqli_num_rows($sql) == 1 )
return true;
return false;
}
}
?>
|