This repository was archived by the owner on Dec 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
1003 lines (826 loc) · 48.1 KB
/
index.php
File metadata and controls
1003 lines (826 loc) · 48.1 KB
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
<div class="container" id="host-dashboard">
<?php if(isset($response)) { ?>
<div class="row">
<div class="col-md-12">
<?php printResponse($response); ?>
</div>
</div>
<?php } ?>
<!-- Profiles -->
<?php if(hasRole( $user, 'Administrator' )) { ?>
<section class="row profiles">
<div class="col-md-12">
<h5>Admin Console</h5>
</div>
<div class="col-md-6">
<div class="btn-group btn-group-justified">
<div class="btn-group" role="group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Groups
<span class="fa fa-chevron-down"></span>
</button>
<ul class="dropdown-menu">
<?php foreach($grouplist as $g) { ?>
<li class="group-list clearfix">
<div class="pull-left">
<?php if(!empty($g->path)) { ?>
<img src="/uploads/thumbnail_<?php echo $g->path; ?>" width="60" height="60" alt="<?php echo $g->name; ?> Image" class="profile-pic" />
<?php } else { ?>
<img src="/uploads/mid_1474993329ef38d3a4b9478841cc2346f8e131842fdcfd073b307.jpg" width="40" height="40" alt="<?php echo $group->name; ?> Image" class="profile-pic clearfix"/>
<?php } ?>
</div>
<div class="pull-left">
<a href="/host/index/<?php echo $g->id; ?>" ><?php echo $g->name; ?></a>
</div>
</li>
<?php } ?>
</ul>
</div>
<a class="btn btn-default" href="/group/create"><?php _t("Add Group");?></a>
</div>
</div>
<div class="col-md-6">
<div class="btn-group btn-group-justified">
<a class="btn btn-default" href="/user/all"><?php _t("Users");?></a>
<a class="btn btn-default" href="/user/create"><?php _t("Add User");?></a>
</div>
</div>
</section>
<?php } ?>
<?php if (hasRole($user, 'Host') && count($userGroups) > 0) { ?>
<section class="row profiles">
<div class="col-md-12">
<p><?php _t("You are a host of multiple groups. You can switch to a different group by clicking the button(s) below.");?></p>
<?php
foreach($userGroups as $g) {
if($group->idgroups != $g->idgroups){
?>
<a class="btn btn-primary" href="/host/index/<?php echo $g->idgroups; ?>"><img class="img-responsive pull-left" width="20" height="20" alt="<?php echo $g->name; ?>" src="/uploads/thumbnail_<?php echo $g->path; ?>"> Switch to "<?php echo $g->name; ?>"</a>
<?php
}
}
?>
</div>
</section>
<?php } ?>
<section class="row profiles" id="group-profile">
<div class="col-md-3">
<div class="media">
<h3 class="media-heading"><?php echo $group->name; ?></h3>
<div class="media-left">
<?php if(empty($group->path)){ ?>
<img src="/uploads/mid_1474993329ef38d3a4b9478841cc2346f8e131842fdcfd073b307.jpg" width="60" height="60" alt="<?php echo $group->name; ?> Image" class="profile-pic" />
<?php } else { ?>
<img src="/uploads/thumbnail_<?php echo $group->path; ?>" width="60" height="60" alt="<?php echo $group->name; ?> Image" class="profile-pic" />
<?php } ?>
</div>
<div class="media-body">
<span><?php echo $group->location . (!empty($group->area) ? ', ' . $group->area : ''); ?></span><br />
<a href="/group/edit/<?php echo $group->idgroups; ?>" class="small"><i class="fa fa-edit"></i> <?php _t("Edit Group...");?></a>
</div>
</div>
</div>
<div class="col-md-9">
<div class="row" id="group-main-stats">
<div class="col">
<h5><?php _t("participants");?></h5>
<span class="largetext"><?php echo $pax; ?></span>
</div>
<div class="col">
<h5><?php _t("hours volunteered");?></h5>
<span class="largetext"><?php echo $hours; ?></span>
</div>
<div class="col">
<h5><?php _t("parties thrown");?></h5>
<span class="largetext"><?php echo count($allparties); ?></span>
</div>
<div class="col">
<h5><?php _t("waste prevented");?></h5>
<span class="largetext">
<?php echo $weights[0]->total_weights; ?> kg
</span>
</div>
<div class="col">
<h5><?php _t("CO<sub>2</sub> emission prevented");?></h5>
<span class="largetext"><?php echo $weights[0]->total_footprints; ?> kg</span>
</div>
</div>
</div>
<div class="col-md-12 text-right">
<a class="btn btn-default" href="/search"><i class="fa fa-filter"></i> <?php _t("Filter Parties");?></a>
<button class="btn btn-default" type="button" data-toggle="modal" data-target="#esw"><i class="fa fa-share"></i> <?php _t("Share your stats");?></button>
</div>
</section>
<!-- Tabs -->
<!-- Nav tabs -->
<ul class="nav nav-pills nav-justified" role="tablist">
<li role="presentation" class="active"><a href="#parties-tab" aria-controls="Parties" role="tab" data-toggle="pill"><?php _t("Parties");?></a></li>
<li role="presentation"><a href="#impact-tab" aria-controls="Impact" role="tab" data-toggle="pill"><?php _t("Impact");?></a></li>
<li role="presentation"><a href="#details-tab" aria-controls="Details" role="tab" data-toggle="pill"><?php _t("Details");?></a></li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="parties-tab">
<section class="row parties">
<header>
<div class="col-md-12" id="upcomingparties">
<h2>
<span class="title-text"><?php _t("Upcoming Restart Parties");?> <a href="/party/create" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php _t("New Party");?></a></span>
</h2>
</div>
</header>
<?php
if(empty($upcomingparties)){
?>
<div class="col-md-12"><p class="text-center"><?php _t("No Upcoming Parties.");?> <a href="/party/create"><?php _t("Add a party.");?></a></p></div>
<?php
} else { ?>
<?php foreach($upcomingparties as $party){ ?>
<div class="col-md-6">
<div class="media">
<div class="media-left">
<img class="media-object" alt="The Restart Project: Logo" src="/assets/images/logo_mini.png">
</div>
<div class="media-body">
<div class="body">
<time datetime="<?php echo dbDate($party->event_date); ?>"><?php echo strftime('%a, %d %b %Y %H:%M', $party->event_timestamp); ?></time>
<span clasS="location"><?php echo (!empty($party->venue) ? $party->venue : $party->location); ?></span>
</div>
<div class="links">
<a href="/party/edit/<?php echo $party->idevents; ?>" class="btn btn-default btn-sm btn-block"><i class="fa fa-edit"></i> edit</a>
<a href="/party/delete/<?php echo $party->idevents; ?>" class="btn btn-danger btn-sm btn-block delete-control"><i class="fa fa-trash"></i> delete</a>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="col-md-3 col-md-offset-9">
</div>
<?php } ?>
</section>
<!-- Latest Parties -->
<section class="row parties">
<header>
<div class="col-md-12" id="allparties">
<h2>
<span class="title-text">All <span class="grey"><?php echo $group->name; ?></span> Parties</span>
</h2>
</div>
</header>
<div class="col-md-12" id="party-list-header">
<div class="header-col header-col-2" id="header-link-box">
<a href="http://www.therestartproject.org/party"><?php _t("view all upcoming events");?></a>
</div>
<div class="header-col">
<img src="/assets/icons/icon_pax.png" alt="Participants" class="header-icon">
<span class="icon-label"><?php _t("Participants");?></span>
</div>
<div class="header-col">
<img src="/assets/icons/icon_volunters.png" alt="Restarters" class="header-icon">
<span class="icon-label"><?php _t("Restarters");?></span>
</div>
<div class="header-col">
<img src="/assets/icons/icon_emissions.png" alt="CO2 Emissions Prevented" class="header-icon">
<span class="icon-label">CO<sub>2</sub> <?php _t("Emissions prevented");?></span>
</div>
<div class="header-col">
<img src="/assets/icons/icon_fixed.png" alt="Fixed" class="header-icon">
<span class="icon-label"><?php _t("Fixed");?></span>
</div>
<div class="header-col">
<img src="/assets/icons/icon_repairable.png" alt="Repairable" class="header-icon">
<span class="icon-label"><?php _t("Repairable");?></span>
</div>
<div class="header-col">
<img src="/assets/icons/icon_dead.png" alt="Dead" class="header-icon">
<span class="icon-label"><?php _t("Dead");?></span>
</div>
</div>
<div class="col-md-12 well" id="party-list">
<?php
$nodata = 0;
$currentYear = date('Y', time());
foreach($allparties as $party){
$partyYear = date('Y', $party->event_timestamp);
if( $partyYear < $currentYear){
?>
<div class="year-break">
<?php echo $partyYear; ?>
</div>
<?php
$currentYear = $partyYear;
}
?>
<?php if($party->device_count < 1){ $nodata++; ?>
<a class="no-data-wrap party" href="/party/manage/<?php echo $party->idevents; ?>" <?php echo ($nodata == 1 ? 'id="attention"' : ''); ?>>
<div class="header-col header-col-2">
<div class="date">
<span class="month"><?php echo strftime('%b', $party->event_timestamp); ?></span>
<span class="day"> <?php echo strftime('%d', $party->event_timestamp); ?></span>
<span class="year"> <?php echo strftime('%Y', $party->event_timestamp); ?></span>
</div>
<div class="short-body">
<span class="location"><?php echo (!empty($party->venue) ? $party->venue : $party->location); ?></span>
<time datetime="<?php echo dbDate($party->event_date); ?>"><?php echo substr($party->start, 0, -3); ?></time>
</div>
</div>
<div class="header-col header-col-3">
<button class="btn btn-primary btn-lg add-info-btn">
<i class="fa fa-cloud-upload"></i> <?php _t("Add Information");?>
</button>
</div>
<div class="header-col">
<span class="largetext greyed">?</span>
</div>
<div class="header-col">
<span class="largetext greyed">?</span>
</div>
<div class="header-col">
<span class="largetext greyed">?</span>
</div>
</a>
<?php } else { ?>
<a class="party" href="/party/manage/<?php echo $party->idevents; ?>">
<div class="header-col header-col-2">
<div class="date">
<span class="month"><?php echo date('M', $party->event_timestamp); ?></span>
<span class="day"> <?php echo date('d', $party->event_timestamp); ?></span>
<span class="year"> <?php echo date('Y', $party->event_timestamp); ?></span>
</div>
<div class="short-body">
<span class="location"><?php echo (!empty($party->venue) ? $party->venue : $party->location); ?></span>
<time datetime="<?php echo dbDate($party->event_date); ?>"><?php echo substr($party->start, 0, -3); ?></time>
</div>
</div>
<div class="header-col">
<span class="largetext">
<?php echo $party->pax; ?>
</span>
</div>
<div class="header-col">
<span class="largetext">
<?php echo $party->volunteers; ?>
</span>
</div>
<div class="header-col">
<span class="largetext">
<?php echo $party->co2; ?> kg
</span>
</div>
<div class="header-col">
<span class="largetext fixed">
<?php echo $party->fixed_devices; ?>
</span>
</div>
<div class="header-col">
<span class="largetext repairable">
<?php echo $party->repairable_devices; ?>
</span>
</div>
<div class="header-col">
<span class="largetext dead">
<?php echo $party->dead_devices; ?>
</span>
</div>
</a>
<?php } ?>
<?php } ?>
</div>
</section>
</div>
<div role="tabpanel" class="tab-pane" id="impact-tab">
<section class="row" id="impact-header">
<div class="col-sm-12 text-center">
<?php if(!empty($group->path)) { ?>
<img src="/uploads/mid_<?php echo $group->path; ?>" class="img-circle impact-avatar" width="120" />
<?php } else { ?>
<img src="/uploads/mid_1474993329ef38d3a4b9478841cc2346f8e131842fdcfd073b307.jpg" class="img-circle impact-avatar" width="120"/>
<?php } ?>
<h2><?php echo $group->name; ?></h2>
<p class="big">
<span class="big blue"><?php echo $pax; ?> <?php _t("participants");?></span> <?php _t("aided by");?> <span class="big blue"><?php echo $hours; ?> <?php _t("hours of volunteered time");?></span> <?php _t("worked on");?> <span class="big blue"><?php echo ($group_device_count_status[0]->counter + $group_device_count_status[1]->counter + $group_device_count_status[2]->counter) ?> devices.</span>
</p>
</div>
</section>
<section class="row" id="impact-devices">
<div class="col-md-6 col-md-offset-3 text-center">
<div class="impact-devices-1">
<img src="/assets/icons/impact_device_1.jpg" class="" width="200">
<span class="title"><?php echo (int)$group_device_count_status[0]->counter;?></span>
<span class="legend"><?php _t("were fixed");?></span>
</div>
<div class="impact-devices-2">
<img src="/assets/icons/impact_device_2.jpg" class="" width="200">
<span class="title"><?php echo (int)$group_device_count_status[1]->counter;?></span>
<span class="legend"><?php _t("were still repairable");?></span>
</div>
<div class="impact-devices-3">
<img src="/assets/icons/impact_device_3.jpg" class="" width="200">
<span class="title"><?php echo (int)$group_device_count_status[2]->counter;?></span>
<span class="legend"><?php _t("were dead");?></span>
</div>
</div>
<div class="col-md-12">
<h2><span class="title-text"><?php _t("Most Repaired Devices");?></span></h2>
<div class="row">
<div class="col-md-4"><div class="topper text-center"><?php echo $top[0]->name . ' [' . $top[0]->counter . ']'; ?></div></div>
<div class="col-md-4"><div class="topper text-center"><?php echo $top[1]->name . ' [' . $top[1]->counter . ']'; ?></div></div>
<div class="col-md-4"><div class="topper text-center"><?php echo $top[2]->name . ' [' . $top[2]->counter . ']'; ?></div></div>
</div>
</div>
</section>
<section class="row" id="impact-dataviz">
<div class="col-md-12 text-center texter">
<?php
$sum = 0;
foreach($waste_year_data as $y){
$sum += $y->waste;
}
?>
<span class="datalabel"> <?php _t("Total waste prevented:"); ?> </span><span class="blue"> <?php echo $weights[0]->total_weights; ?> kg </span>
</div>
<div class="col-md-12 text-center texter">
<?php
$sum = 0;
foreach($year_data as $y){
$sum += $y->co2;
}
//$di_co2 = number_format(round($sum), 0, '.', ',');
?>
<span class="datalabel"><?php _t("Total CO<sub>2</sub> emission prevented:");?>" </span><span class="blue"><?php echo $weights[0]->total_footprints; ?> kg</span>
</div>
<div class="col-md-12">
<?php
/** find size of needed SVGs **/
if($sum > 6000) {
$consume_class = 'car';
$consume_image = 'Counters_C2_Driving.svg';
$consume_label = 'Equal to driving';
$consume_eql_to = (1 / 0.12) * $weights[0]->total_footprints;
$consume_eql_to = number_format(round($consume_eql_to), 0, '.', ',') . '<small>km</small>';
$manufacture_eql_to = round($weights[0]->total_footprints / 6000);
$manufacture_img = 'Icons_04_Assembly_Line.svg';
$manufacture_label = 'or like the manufacture of <span class="dark">' . $manufacture_eql_to . '</span> cars';
$manufacture_legend = ' 6000kg of CO<sub>2</sub>';
}
else {
$consume_class = 'tv';
$consume_image = 'Counters_C1_TV.svg';
$consume_label = 'Like watching TV for';
$consume_eql_to = ((1 / 0.024) * $weights[0]->total_footprints ) / 24;
$consume_eql_to = number_format(round($consume_eql_to), 0, '.', ',') . '<small>days</small>';
$manufacture_eql_to = round($weights[0]->total_footprints / 100);
$manufacture_img = 'Icons_03_Sofa.svg';
$manufacture_label = 'or like the manufacture of <span class="dark">' . $manufacture_eql_to . '</span> sofas';
$manufacture_legend = ' 100kg of CO<sub>2</sub>';
}
?>
<div class="di_consume <?php echo $consume_class; ?>">
<img src="/assets/icons/<?php echo $consume_image; ?>" class="img-responsive">
<div class="text">
<div class="blue"><?php _t( $consume_label); ?></div>
<div class="consume"><?php echo $consume_eql_to; ?></div>
</div>
</div>
<div class="di_manufacture">
<div class="col-md-12 text-center"><div class="lightblue"><?php _t( $manufacture_label); ?></div></div>
<?php for($i = 1; $i<= $manufacture_eql_to; $i++){ ?>
<div class="col-md-3 text-center">
<img src="/assets/icons/<?php echo $manufacture_img; ?>" class="img-responsive">
</div>
<?php } ?>
<div class="col-md-12 text-center">
<div class="legend">1 <img src="/assets/icons/<?php echo $manufacture_img; ?>"> = <?php echo $manufacture_legend; ?> <?php _t("(approximately)");?></div>
</div>
</div>
<div class="col-md-12 text-right">
<button class="btn btn-default" type="button" data-toggle="modal" data-target="#esw"><i class="fa fa-share"></i> <?php _t("Share your stats");?></button>
</div>
</div>
</section>
</div>
<div role="tabpanel" class="tab-pane" id="details-tab">
<!-- Group Achievements -->
<!--<section class="row">
<div class="col-md-12">
<h2>
<span class="title-text">Group Achievements</span>
</h2>
</div>
</section>-->
<!-- CO2 stats -->
<section class="row parties">
<div class="col-md-12">
<h2><span class="title-text"><?php _t("Impact");?></span></h2>
</div>
<div class="col-md-6">
<h5 class="text-center"><?php _t("e-Waste Prevented to date");?></h5>
<span class="largetext">
<?php echo $weights[0]->total_weights; ?> kg
</span>
<span class="subtext text-center"><?php _t("Total:");?>" <?php echo number_format(round($wasteTotal), 0, '.', ','); ?> kg</span>
<hr />
<h5 class="text-center"><?php _t("e-Waste prevented this year");?></h5>
<?php
foreach($waste_year_data as $y){
if($y->year == date('Y', time())) {
?>
<span class="largetext">
<?php echo number_format(round($y->waste), 0, '.', ','); ?> kg
</span>
<span class="subtext text-center">Total: <?php echo number_format(round($wasteThisYear), 0, '.', ','); ?> kg</span>
<?php
}
}
?>
</div>
<div class="col-md-6">
<h5 class="text-center">CO<sub>2</sub> <?php _t("emission prevented to date");?></h5>
<?php
$sum = 0;
foreach($year_data as $y){
$sum += $y->co2;
}
?>
<span class="largetext">
<?php echo number_format(round($sum), 0, '.', ','); ?> kg of CO<sub>2</sub>
</span>
<span class="subtext text-center">Total: <?php echo number_format(round($co2Total), 0, '.', ','); ?> kg of CO<sub>2</sub></span>
<hr />
<h5 class="text-center">CO<sub>2</sub> <?php _t("emission prevented this year");?></h5>
<?php
foreach($year_data as $y){
if($y->year == date('Y', time())) {
?>
<span class="largetext">
<?php echo number_format(round($y->co2), 0, '.', ','); ?> <?php _t("kg of CO");?><sub>2</sub>
</span>
<span class="subtext text-center"><?php _t("Total:");?>" <?php echo number_format(round($co2ThisYear), 0, '.', ','); ?> <?php _t("kg of CO");?><sub>2</sub></span>
<?php
}
}
?>
</div>
</section>
<section class="row">
<!-- Device count -->
<div class="col-md-12">
<h2><span class="title-text"><?php _t("Devices Restarted");?></span></h2>
<div class="row">
<div class="col-md-4 count">
<div class="col">
<img src="/assets/icons/fixed_circle.jpg">
</div>
<div class="col">
<span class="status_title"><?php _t("Fixed");?></span>
<span class="largetext fixed">
<?php echo (int)$group_device_count_status[0]->counter; ?>
</span>
<span class="subtext textblue">total: <?php echo $device_count_status[0]->counter; ?></span>
</div>
</div>
<div class="col-md-4 count">
<div class="col repairable">
<img src="/assets/icons/repairable_circle.jpg">
</div>
<div class="col">
<span class="status_title"><?php _t("Repairable");?></span>
<span class="largetext repairable">
<?php echo (int)$group_device_count_status[1]->counter; ?>
</span>
<span class="subtext textblue">total: <?php echo $device_count_status[1]->counter; ?></span>
</div>
</div>
<div class="col-md-4 count">
<div class="col dead">
<img src="/assets/icons/dead_circle.jpg">
</div>
<div class="col">
<span class="status_title">Dead</span>
<span class="largetext dead">
<?php echo (int)$group_device_count_status[2]->counter; ?>
</span>
<span class="subtext textblue"><?php _t("total:");?>" <?php echo $device_count_status[2]->counter; ?></span>
</div>
</div>
</div>
</div>
</section>
<!-- category details -->
<section class="row">
<div class="col-md-12">
<h2><span class="title-text"><?php _t("Category Details");?></span></h2>
</div>
<div class="row">
<div class="col-md-2"> </div>
<div class="col-md-4 category-table">
<div class="col3">
<img src="/assets/icons/icon_fixed.png" title="fixed items" alt="Fixed Items icon">
<span class="subtext"><?php _t("fixed");?></span>
</div>
<div class="col3 no-brd">
<img src="/assets/icons/icon_repairable.png" title="repairable items" alt="repairable Items icon">
<span class="subtext"><?php _t("repairable");?></span>
</div>
<div class="col3">
<img src="/assets/icons/icon_dead.png" title="dead items" alt="dead Items icon">
<span class="subtext"><?php _t("dead");?></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-center">
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-01.png">
<!-- <i class="cluster big cluster-1"></i> -->
</div>
<div class="col-md-4">
<div class="col3">
<span class="largetext fixed"><?php echo (int)$clusters['all'][1][0]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext repairable"><?php echo (int)$clusters['all'][1][1]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext dead"><?php echo (int)$clusters['all'][1][2]->counter; ?></span>
</div>
</div>
<div class="col-md-6">
<div class="category-detail">
<table cellspacing="0">
<thead>
<tr>
<th colspan="3">
<?php _t("Computers and Home Office");?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="table-label"><?php _t("Most seen:");?>"</td>
<td class="table-data"><?php echo $mostleast[1]['most_seen'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[1]['most_seen'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Most repaired:");?>"</td>
<td class="table-data"><?php echo $mostleast[1]['most_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[1]['most_repaired'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Least repaired:");?>"</td>
<td class="table-data"><?php echo $mostleast[1]['least_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[1]['least_repaired'][0]->counter; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-center">
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-02.png">
<!-- <i class="cluster big cluster-2"></i> -->
</div>
<div class="col-md-4">
<div class="col3">
<span class="largetext fixed"><?php echo (int)$clusters['all'][2][0]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext repairable"><?php echo (int)$clusters['all'][2][1]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext dead"><?php echo (int)$clusters['all'][2][2]->counter; ?></span>
</div>
</div>
<div class="col-md-6">
<div class="category-detail">
<table cellspacing="0">
<thead>
<tr>
<th colspan="3">
<?php _t("Electronic Gadgets");?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="table-label"><?php _t("Most seen:");?>"</td>
<td class="table-data"><?php echo $mostleast[2]['most_seen'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[2]['most_seen'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Most repaired:");?></td>
<td class="table-data"><?php echo $mostleast[2]['most_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[2]['most_repaired'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Least repaired:");?></td>
<td class="table-data"><?php echo $mostleast[2]['least_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[2]['least_repaired'][0]->counter; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-center">
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-03.png">
<!-- <i class="cluster big cluster-3"></i> -->
</div>
<div class="col-md-4">
<div class="col3">
<span class="largetext fixed"><?php echo (int)$clusters['all'][3][0]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext repairable"><?php echo (int)$clusters['all'][3][1]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext dead"><?php echo (int)$clusters['all'][3][2]->counter; ?></span>
</div>
</div>
<div class="col-md-6">
<div class="category-detail">
<table cellspacing="0">
<thead>
<tr>
<th colspan="3">
<?php _t("Home Entertainment");?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="table-label"><?php _t("Most seen:");?>"</td>
<td class="table-data"><?php echo $mostleast[3]['most_seen'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[3]['most_seen'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Most repaired:");?>"</td>
<td class="table-data"><?php echo $mostleast[3]['most_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[3]['most_repaired'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Least repaired:");?></td>
<td class="table-data"><?php echo $mostleast[3]['least_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[3]['least_repaired'][0]->counter; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2 text-center">
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-04.png">
<!-- <i class="cluster big cluster-4"></i> -->
</div>
<div class="col-md-4">
<div class="col3">
<span class="largetext fixed"><?php echo (int)$clusters['all'][4][0]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext repairable"><?php echo (int)$clusters['all'][4][1]->counter; ?></span>
</div>
<div class="col3">
<span class="largetext dead"><?php echo (int)$clusters['all'][4][2]->counter; ?></span>
</div>
</div>
<div class="col-md-6">
<div class="category-detail">
<table cellspacing="0">
<table cellspacing="0">
<thead>
<tr>
<th colspan="3">
<?php _t("Kitchen and Household Items");?>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="table-label"><?php _t("Most seen:");?></td>
<td class="table-data"><?php echo $mostleast[4]['most_seen'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[4]['most_seen'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Most repaired:");?></td>
<td class="table-data"><?php echo $mostleast[4]['most_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[4]['most_repaired'][0]->counter; ?></td>
</tr>
<tr>
<td class="table-label"><?php _t("Least repaired:");?></td>
<td class="table-data"><?php echo $mostleast[4]['least_repaired'][0]->name; ?></td>
<td class="table-count"><?php echo $mostleast[4]['least_repaired'][0]->counter; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</section>
<!--categories-->
<section class="row">
<div class="col-md-12">
<h2><span class="title-text"><?php _t("Devices Restarted per Category");?></span></h2>
</div>
<?php
//dbga($clusters);
$c = 1;
foreach($clusters as $key => $cluster){ ?>
<div class="col-md-10 <?php echo($c == 1 ? 'show' : 'hide'); ?> bargroup" id="<?php echo $key; ?>">
<div class="row">
<div class="col-md-2">
<!-- <span class="cluster big cluster-1"></span> -->
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-01.png">
</div>
<div class="col-md-4">
<div class="barpiece fixed" style="width :<?php echo barChartValue($cluster[1][0]->counter, $cluster[1]['total']); ?>%"> </div><div class="barpiece-label fixed"><?php echo barChartValue($cluster[1][0]->counter, $cluster[1]['total']) + 15; ?>%</div>
<div class="barpiece repairable" style="width :<?php echo barChartValue($cluster[1][1]->counter, $cluster[1]['total']); ?>%"> </div><div class="barpiece-label repairable"><?php echo barChartValue($cluster[1][1]->counter, $cluster[1]['total']) + 15; ?>%</div>
<div class="barpiece end-of-life" style="width :<?php echo barChartValue($cluster[1][2]->counter, $cluster[1]['total']); ?>%"> </div><div class="barpiece-label dead"><?php echo barChartValue($cluster[1][2]->counter, $cluster[1]['total']) + 15; ?>%</div>
</div>
<div class="col-md-2">
<!-- <span class="cluster big cluster-2"></span> -->
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-02.png">
</div>
<div class="col-md-4">
<div class="barpiece fixed" style="width: <?php echo barChartValue($cluster[2][0]->counter, $cluster[2]['total']); ?>%"> </div><div class="barpiece-label fixed"><?php echo barChartValue($cluster[2][0]->counter, $cluster[2]['total']) + 15; ?>%</div>
<div class="barpiece repairable" style="width: <?php echo barChartValue($cluster[2][1]->counter, $cluster[2]['total']); ?>%"> </div><div class="barpiece-label repairable"><?php echo barChartValue($cluster[2][1]->counter, $cluster[2]['total']) + 15; ?>%</div>
<div class="barpiece end-of-life" style="width: <?php echo barChartValue($cluster[2][2]->counter, $cluster[2]['total']); ?>%"> </div><div class="barpiece-label dead"><?php echo barChartValue($cluster[2][2]->counter, $cluster[2]['total']) + 15; ?>%</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<!-- <span class="cluster big cluster-3"></span> -->
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-03.png">
</div>
<div class="col-md-4">
<div class="barpiece fixed" style="width :<?php echo barChartValue($cluster[3][0]->counter, $cluster[3]['total']); ?>%"> </div><div class="barpiece-label fixed"><?php echo barChartValue($cluster[3][0]->counter, $cluster[3]['total']) + 15; ?>%</div>
<div class="barpiece repairable" style="width :<?php echo barChartValue($cluster[3][1]->counter, $cluster[3]['total']); ?>%"> </div><div class="barpiece-label repairable"><?php echo barChartValue($cluster[3][1]->counter, $cluster[3]['total']) + 15; ?>%</div>
<div class="barpiece end-of-life" style="width :<?php echo barChartValue($cluster[3][2]->counter, $cluster[3]['total']); ?>%"> </div><div class="barpiece-label dead"><?php echo barChartValue($cluster[3][2]->counter, $cluster[3]['total']) + 15; ?>%</div>
</div>
<div class="col-md-2">
<!-- <span class="cluster big cluster-4"></span> -->
<img class="cluster big img-responsive" src="/assets/icons/Category_Icons-04.png">
</div>
<div class="col-md-4">
<div class="barpiece fixed" style="width : <?php echo barChartValue($cluster[4][0]->counter, $cluster[4]['total']); ?>%"> </div><div class="barpiece-label fixed"><?php echo barChartValue($cluster[4][0]->counter, $cluster[4]['total']) + 15; ?>%</div>
<div class="barpiece repairable" style="width :<?php echo barChartValue($cluster[4][1]->counter, $cluster[4]['total']); ?>%"> </div><div class="barpiece-label repairable"><?php echo barChartValue($cluster[4][1]->counter, $cluster[4]['total']) + 15; ?>%</div>
<div class="barpiece end-of-life" style="width :<?php echo barChartValue($cluster[4][2]->counter, $cluster[4]['total']); ?>%"> </div><div class="barpiece-label dead"><?php echo barChartValue($cluster[4][2]->counter, $cluster[4]['total']) + 15; ?>%</div>
</div>
</div>
</div>
<?php
$c++;
}
?>
<div class="col-md-2">
<div class=" barpiece-tabs">
<ul>
<?php
$c = 1;
foreach($clusters as $key => $cluster){
?>
<li><button class="btn btn-primary btn-sm <?php echo($c == 1 ? 'active' : ''); ?> switch-view" data-family=".bargroup" data-target="#<?php echo $key; ?>"><?php echo strtoupper($key); ?></button></li>
<?php
$c++;
}
?>
</ul>
</div>
</div>
</section>
</div>
</div>
<!-- EOF Tabs -->
<br />
<br />
<br />
<br />
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="esw">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title"><?php _t("Share your group's stats");?></h4>
</div>
<div class="modal-body">
<p><?php _t("Copy and paste the code snippets below into a page on your website to share your group's achievements!");?></p>
<div><strong><?php _t("Headline stats");?></strong></div>
<p><?php _t("This widget shows the headline stats for your group — the number of participants at your parties; the hours volunteered; the number of parties thrown; the amount of waste prevented and the amount of CO<sub>2</sub> emissions prevented.");?>
</p>
<code style="padding:0">
<pre><iframe src="https://community.therestartproject.org/group/stats/<?php echo $group->idgroups; ?>" frameborder="0" width="100%" height="115"></iframe></pre>
</code>
<div><strong>CO<sub>2</sub> <?php _t("equivalence visualisation");?></strong></div>
<p><?php _t("This widget displays an infographic of an easy-to-understand equivalent of the CO<sub>2</sub> emissions that your group has diverted, such as equivalent number of cars manufactured.");?></p>
<code style="padding:0">
<pre><iframe src="https://community.therestartproject.org/outbound/info/group/<?php echo $group->idgroups; ?>" frameborder="0" width="700" height="850"></iframe></pre>
</code>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>