private function draw_cells_dimension($PFCALCULATOR, $name = "Summe", $ORDER = 0, $DetailRow = "0")
 {
     if ($DetailRow == 0) {
         //$TESTDETAIL = StammdatenGroupRecord::finder()->findByidta_stammdaten_group((StammdatenRecord::finder()->findByidtm_stammdaten($PFCALCULATOR->dimension)->idta_stammdaten_group))->stammdaten_group_original;
         //$DetailChecker = $TESTDETAIL==1?1:0;
         $DetailChecker = 0;
     } else {
         $DetailChecker = 1;
     }
     $PFCALCULATOR->executeDimensionSQL($name, $DetailChecker, $this->InputBericht);
     $ROWS = $PFCALCULATOR->getValues();
     $ROWSPLAIN = $PFCALCULATOR->getPlainValues();
     $ALTERNATING = $this->sheetrow;
     $ROWCOUNTER = 0;
     //here comes the part for the iniputfield
     if ($this->InputBericht == 1) {
         $inp_idta_feldfunktion = $PFCALCULATOR->FeldFunktion;
         $inp_idta_variante = $this->Variante;
     }
     $temparray = array();
     //hier speicher ich die werte fuer das zwischenergebnis
     $WorkRowID = "";
     //empty an init var
     foreach ($ROWS as $row) {
         $jj = 1;
         $ROWCOUNTER++;
         $DDRowCounter = 1;
         //hier bauen wir die einzelnen Zeilen
         $ControlListCell = array();
         //clean the children
         $WorkRow = new TActiveTableRow();
         if ($this->InputBericht == 1) {
             $walkerCheck = count($ROWS) > 2 ? count($ROWS) - 1 : count($ROWS);
         } else {
             $walkerCheck = count($ROWS);
         }
         if ($ROWCOUNTER < $walkerCheck or $DetailChecker == 0 and $this->InputBericht == 0 or $this->InputBericht == 1) {
             $WorkRowID = "R" . $this->sheetrow;
             //new for grouping
             $this->resulttable->Rows[] = $WorkRow;
             $ColumnCounter = 0;
             foreach ($row as $value) {
                 $ControlListCellChildren = array();
                 //clean the children
                 $cell = new TActiveTableCell();
                 $cell->setID("R" . $this->sheetrow . "C" . $jj);
                 $jj++;
                 $cell->EnableViewState = true;
                 if ($this->InputBericht == 0 or $DDRowCounter == 1) {
                     if ($this->InputBericht == 1) {
                         $tmpText = preg_split("/xxx/", $value);
                         $cell->Text = $tmpText[1];
                         $inp_idtm_struktur = $tmpText[2];
                         $inp_idta_struktur_type = StrukturRecord::finder()->findByidtm_struktur($inp_idtm_struktur)->idta_struktur_type;
                     } else {
                         $cell->Text = $value;
                     }
                 } else {
                     $inp_per_month = $this->Perioden[$ColumnCounter - 1];
                     $inp_per_year = $PFCALCULATOR->getYearByMonth($inp_per_month);
                     $inputfield = new TActiveTextBox();
                     $UniqueID = 'xxx' . $inp_per_year . 'xxx' . $inp_per_month . 'xxx' . $inp_idta_struktur_type . 'xxx' . $inp_idta_feldfunktion . 'xxx' . $inp_idtm_struktur . 'xxx' . $inp_idta_variante . 'xxx';
                     if (!$this->page->isPostBack && !$this->page->isCallback && $this->InputBericht == 1) {
                         $inputfield->setText($value);
                         $MyUserFelderRecord = new UserFelderRecord();
                         $MyUserFelderRecord->user_id = $this->User->getUserId($this->User->Name);
                         $MyUserFelderRecord->tuf_feldname = $UniqueID;
                         $MyUserFelderRecord->save();
                     }
                     //$local_jahr."xxx".$local_jahr."xxx".$local_type."xxx".$local_ff."xxx".$local_id;
                     $inputfield->setId($UniqueID);
                     $inputfield->setCssClass("inputgrid");
                     //$this->page->registerObject($UniqueID,$inputfield);
                     $cell->Controls->add($inputfield);
                     $ControlListCellChildren[] = array("class" => "TActiveTextBox", "id" => $UniqueID, "OnCallback" => "", "CommandParameter" => "");
                 }
                 $WorkRow->Cells[] = $cell;
                 $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
                 $DDRowCounter++;
                 $ColumnCounter++;
             }
             fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
             $ALTERNATING++;
         } else {
             $WorkRowID = "R" . $this->sheetrow . "G";
             //new for grouping
             $this->resulttable->Rows[] = $WorkRow;
             $jj = 1;
             if ($this->InputBericht == 0) {
                 $ControlListCellChildren = array();
                 foreach ($row as $value) {
                     $cell = new TActiveTableCell();
                     $cell->setID("R" . $this->sheetrow . "C" . $jj);
                     $jj++;
                     $cell->EnableViewState = true;
                     $cell->Text = $value;
                     $cell->setCssClass('calculatedsumme');
                     $WorkRow->Cells[] = $cell;
                     $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
                 }
             }
         }
         $WorkRow->setID($WorkRowID);
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => $WorkRowID, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
         $this->sheetrow++;
         //increment rowcounter
     }
     $ALTERNATING = 0;
     $labelcounter = 0;
     foreach ($ROWSPLAIN as $rowplain) {
         $ALTERNATING++;
         if ($ALTERNATING == count($ROWSPLAIN)) {
             foreach ($rowplain as $valueplain) {
                 $labelcounter == 0 ? $labelcounter++ : array_push($temparray, $valueplain * 1);
             }
         }
     }
     $this->zwischenergebnisse[$name] = $temparray;
 }
Exemplo n.º 2
0
 public function drawTimer($mydate)
 {
     $MyRow = new TActiveTableRow();
     //hinzufuegen der Row
     $this->PTimeBalkenTable->rows[] = $MyRow;
     $month = date("n", strtotime($mydate));
     for ($ii = 1; $ii < 13; $ii++) {
         $cell = new TActiveTableCell();
         if ($ii == $month) {
             $cell->setCssClass('activeleaf');
         } else {
             $cell->setCssClass('leaf');
         }
         $cell->Text = $ii;
         $MyRow->Cells[] = $cell;
     }
 }
Exemplo n.º 3
0
 private function DrawPSP($data)
 {
     foreach ($data as $row) {
         $act_row = new TActiveTableRow();
         $this->resulttable->Rows[] = $act_row;
         $range1 = $row->ttact_faz;
         $range2 = $row->ttact_sez - $row->ttact_faz;
         $ttemp = $row->ttact_sez == 0 ? 1 : $row->ttact_sez;
         $range3 = $this->MaxElement - $ttemp;
         if ($range1 == 0) {
             $cell = new TActiveTableCell();
             if (!$range2 == 0) {
                 $cell->setColumnSpan($range2);
             }
             $cell->setCssClass('PSPContainer');
             $cell->Text = $this->DrawPSPElement($row);
             $act_row->Cells[] = $cell;
             $dcell = new TActiveTableCell();
             if ($range3 > 0) {
                 $dcell->setColumnSpan($range3);
             }
             $dcell->Text = '';
             $dcell->setCssClass('PSPContainer');
             $act_row->Cells[] = $dcell;
         } else {
             $cell = new TActiveTableCell();
             if ($range1 < $this->MaxElement) {
                 $cell->setColumnSpan($range1);
             } else {
                 $cell->setColumnSpan($range1 - 1);
             }
             $cell->Text = '';
             $cell->setCssClass('PSPContainer');
             $act_row->Cells[] = $cell;
             $zcell = new TActiveTableCell();
             if (!$range2 == 0) {
                 $zcell->setColumnSpan($range2);
             }
             $zcell->Text = $this->DrawPSPElement($row);
             $zcell->setCssClass('PSPContainer');
             $act_row->Cells[] = $zcell;
             if ($range3 > 0) {
                 $dcell = new TActiveTableCell();
                 $dcell->setColumnSpan($range3);
                 $dcell->Text = '';
                 $dcell->setCssClass('PSPContainer');
                 $act_row->Cells[] = $dcell;
             }
         }
     }
 }