Example #1
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;
     }
 }
 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;
 }
 public function load_splasher_table($sender, $param)
 {
     //init des von bezuges
     if ($sender->ID == "From_StammdatenGroupListe") {
         $this->From_idtm_stammdaten->Text = $param->Item->lst_idtm_stammdaten->Data;
         $this->load_splasher_values();
     }
     //alternierende werte
     $Alternating = 1;
     //holen der perioden
     $Taschenrechner = new PFCalculator();
     $Taschenrechner->setStartPeriod($this->DWH_idta_perioden->Text);
     //holen der detialwerte der zielperiode
     $MyRecords = StammdatenRecord::finder()->findAll('idta_stammdaten_group = ? AND stammdaten_aktiv = 0', $this->to_idta_stammdaten_group->Text);
     //kopfzeile
     $WorkRow = new TActiveTableRow();
     $this->resulttable->Rows[] = $WorkRow;
     $WorkRow->setCssClass('thead');
     //Beschriftung
     $ii = 1;
     $cell = new TActiveTableCell();
     $cell->setID("R" . $this->sheetrow . "C" . $ii . "GA");
     $cell->Text = "<b>Name</b>";
     $WorkRow->Cells[] = $cell;
     $ii++;
     //Datum als Titel
     foreach ($Taschenrechner->Perioden as $Periode) {
         $cell = new TActiveTableCell();
         $cell->setID("R" . $this->sheetrow . "C" . $ii . "A");
         $activeLabel = new TActiveLabel();
         $activeLabel->setID("R" . $this->sheetrow . "C" . $ii . "AL");
         $activeLabel->setText($Periode[0]);
         $cell->Controls->add($activeLabel);
         $WorkRow->Cells[] = $cell;
         $ii++;
     }
     foreach ($MyRecords as $StammdatenRC) {
         $ControlListCell = array();
         //clean the children
         $WorkRow = new TActiveTableRow();
         $this->resulttable->Rows[] = $WorkRow;
         //Beschriftung
         $cell = new TActiveTableCell();
         $cell->Text = "<b>" . $StammdatenRC->stammdaten_name . "</b>";
         $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C1", "OnCallback" => "", "CommandParameter" => "", "children" => "");
         $WorkRow->Cells[] = $cell;
         //Datenfelder
         $jj = 2;
         foreach ($Taschenrechner->Perioden as $Periode) {
             $ControlListCellChildren = array();
             //clean the children
             $cell = new TActiveTableCell();
             //eingabefeld
             $inputfield = new TActiveTextBox();
             $inputfield->setCssClass("inputgrid");
             $UniqueID = 'xxx' . $Taschenrechner->getYearByMonth($Periode[0]) . 'xxx' . $Periode[0] . 'xxx' . $this->From_idtm_stammdaten->Text . 'xxx' . $StammdatenRC->idtm_stammdaten;
             $inputfield->setId($UniqueID);
             $inputfield->Text = $this->RAMRecord[$UniqueID];
             $inputfield->AutoPostback = true;
             $inputfield->OnCallback = "page.onTextChanged";
             $cell->Controls->add($inputfield);
             $ControlListCellChildren[] = array("class" => "TActiveTextBox", "id" => $UniqueID, "OnCallback" => "page.onTextChanged", "CommandParameter" => "");
             $WorkRow->Cells[] = $cell;
             $ControlListCell[] = array("class" => "TActiveTableCell", "id" => "R" . $this->sheetrow . "C" . $jj, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCellChildren);
             $jj++;
         }
         //alternieren der zeilen
         fmod($ALTERNATING, 2) == 0 ? $WorkRow->setCssClass('listalternating') : $WorkRow->setCssClass('listnonealternating');
         $this->dynamicControlList[] = array("class" => "TActiveTableRow", "id" => "R" . $this->sheetrow, "OnCallback" => "", "CommandParameter" => "", "children" => $ControlListCell);
         $ALTERNATING++;
         $this->sheetrow++;
     }
     $this->bindList_From_StammdatenGroupList();
     $param->Item->CssClass = "PSPFAZ";
     unset($Taschenrechner);
     $this->session['dynamicControlList'] = $this->dynamicControlList;
 }
Example #4
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);
     }
 }
Example #5
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;
             }
         }
     }
 }