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;
 }
예제 #2
0
 public function createTable()
 {
     for ($ii = 1; $ii <= 10; $ii++) {
         $MyRow = new TActiveTableRow();
         $ControlListCell = array();
         //clean the children
         if ($ii % 3 == 0) {
             $rowId = "R" . $ii . "G";
         } else {
             $rowId = "R" . $ii;
         }
         $MyRow->setID($rowId);
         $this->MyTable->Rows[] = $MyRow;
         for ($jj = 1; $jj <= 10; $jj++) {
             $cell = new TActiveTableCell();
             $ControlListCellChildren = array();
             //clean the children
             if ($jj % 3 == 0) {
                 $cellID = "R" . $ii . "C" . $jj . "G";
             } else {
                 $cellID = "R" . $ii . "C" . $jj;
             }
             $cell->setID($cellID);
             //my imagebutton for test
             if ($jj == 1) {
                 if ($ii % 3 == 0) {
                     $imagebutton = new TActiveImageButton();
                     $imagebutton->setID($cellID . "IB");
                     $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif");
                     $imagebutton->setText("collapse");
                     $imagebutton->onCallback = "page.hideRowGroup";
                     $imagebutton->setCommandParameter($ii);
                     $cell->Controls->add($imagebutton);
                     $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideRowGroup", "CommandParameter" => $ii);
                 } else {
                     $cell->Text = $jj * $ii;
                 }
             } else {
                 if ($ii == 1) {
                     if ($jj % 3 == 0) {
                         $imagebutton = new TActiveImageButton();
                         $imagebutton->setID($cellID . "IB");
                         $imagebutton->setImageUrl("/rliq/themes/basic/gfx/group-collapse.gif");
                         $imagebutton->setText("collapse");
                         $imagebutton->onCallback = "page.hideColumnGroup";
                         $imagebutton->setCommandParameter($jj);
                         $cell->Controls->add($imagebutton);
                         $ControlListCellChildren[] = array("class" => "TActiveImageButton", "id" => $cellID . "IB", "OnCallback" => "page.hideColumnGroup", "CommandParameter" => $jj);
                     } else {
                         $cell->Text = $jj * $ii;
                     }
                 } else {
                     $cell->Text = $jj * $ii;
                 }
             }
             //this must appear at the end
             $MyRow->Cells[] = $cell;
             $ControlListCell[] = array("class" => "TActiveTableCell", "id" => $cellID, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
         }
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => $rowId, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
     }
 }