@@ -37,6 +37,9 @@ public function __construct( Template $temp, Login $login ) {
3737 private function displayContent (array $ data ) : void {
3838 $ this ->temp ->setContent ('COMBIDATA ' , json_encode ($ data ['combi ' ]));
3939 $ this ->temp ->setContent ('PLAINDATA ' , json_encode (array_slice ($ data ['plain ' ], 0 , self ::MAX_PLAIN_ELEMENTS )));
40+ if (count ($ data ['combi ' ]) > self ::MAX_PLAIN_ELEMENTS ){
41+ $ this ->temp ->setContent ('LESSDATADISABLE ' , '' );
42+ }
4043 $ this ->temp ->setContent ('TABLEA ' , $ this ->arrayToTable ($ data ['table ' ]));
4144 if (isset ($ data ['today ' ])){
4245 $ this ->temp ->setContent ('TABLEB ' , $ this ->arrayToTable ($ data ['today ' ]) );
@@ -45,26 +48,27 @@ private function displayContent(array $data) : void {
4548 }
4649
4750 private function arrayToTable (array $ data ) : string {
48- $ table = "<table class= \"accounttable \"> " ;
51+ $ table = "<table class= \"table table-striped table-responsive-sm \"> " ;
4952 $ head = false ;
5053 $ lastCat = '' ;
5154 foreach ($ data as $ row ){
5255 if (!$ head ){
53- $ table .= "<tr> " ;
56+ $ table .= "<tr><thead class= \" thead-dark \" > " ;
5457 foreach ($ row as $ col => $ val ){
55- $ table .= "<th> " . $ col ."</th> " ;
58+ $ table .= "<th scope= \" col \" > " . $ col ."</th> " ;
5659 }
57- $ table .= "</tr> " ;
60+ $ table .= "</thead></ tr> " ;
5861 $ head = true ;
5962 }
60- $ table .= "<tr> " ;
63+ $ table .= "<tr class= " . ( $ row [ ' Category ' ] !== $ lastCat ? "\" table-active \"" : "" ) . " > " ;
6164 foreach ($ row as $ key => $ val ){
6265 if ($ key === 'Category ' ){
6366 if ( $ val === $ lastCat ){
6467 $ table .= "<td></td> " ;
6568 }
6669 else {
67- $ table .= "<td> " . $ val ."</td> " ;
70+ $ table .= "<th scope= \"row \"> " . $ val ."</th> " ;
71+
6872 }
6973 $ lastCat = $ val ;
7074 }
0 commit comments