private function edParticipantbindList() { $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_activity = :suchtext"; $criteria->Parameters[':suchtext'] = $this->idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $this->ParticipantListe->VirtualItemCount = count(ActivityParticipantsView::finder()->findAll($criteria)); $criteria->setLimit($this->ParticipantListe->PageSize); $criteria->setOffset($this->ParticipantListe->PageSize * $this->ParticipantListe->CurrentPageIndex); $this->ParticipantListe->DataKeyField = 'idtm_organisation'; $this->ParticipantListe->DataSource = ActivityParticipantsView::finder()->findAll($criteria); $this->ParticipantListe->dataBind(); }
private function ProtokollHeader($idtm_protokoll) { $Protokoll = ProtokollRecord::finder()->findBy_idtm_protokoll($idtm_protokoll); $this->pdf->SetXY(25, 60); $this->pdf->SetDrawColor(43, 51, 43); $this->pdf->SetFont('Helvetica', '', 10); $this->pdf->Cell(185, 5, strtoupper('Protokollnotiz zum Termin am ' . date('j.n.Y', strtotime($Protokoll->prt_cdate))), 0, 0, 'B', 0); $this->pdf->Ln(); $this->pdf->SetX(25); $this->pdf->SetDrawColor(43, 51, 43); $this->pdf->SetFont('Helvetica', '', 10); $this->pdf->Cell(185, 5, strtoupper('Projekt: ' . utf8_decode($Protokoll->idtm_termin)), 0, 0, 'B', 0); $this->pdf->Ln(); //$this->pdf->SetX(28); $this->pdf->SetXY(25, 105); $this->pdf->SetDrawColor(43, 51, 43); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Thema ', 'B'); $this->pdf->Cell(100, 5, utf8_decode($Protokoll->prt_name), 'B', 1); $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Moderator ', 'B'); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(100, 5, utf8_decode(OrganisationRecord::finder()->findByidtm_organisation($Protokoll->idtm_organisation)->org_name), 'B', 1); $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Typ ', 'B'); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(100, 5, utf8_decode(ProtokollTypeRecord::finder()->findByPK($Protokoll->idta_protokoll_type)->prt_type_name), 'B', 1); $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Ort ', 'B'); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(100, 5, utf8_decode($Protokoll->prt_location), 'B', 1); $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Datum ', 'B'); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(100, 5, utf8_decode($Protokoll->prt_cdate), 'B', 1); $this->pdf->Ln(); $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, 'Eingeladen ', 'B', 0); $this->pdf->SetFont('Arial', '', 10); $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_activity = :suchtext"; $criteria->Parameters[':suchtext'] = $Protokoll->idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $AnwesendPP = ActivityParticipantsView::finder()->findAll($criteria); $i = 0; foreach ($AnwesendPP as $InvitedP) { if ($i > 0) { $this->pdf->SetX(25); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(50, 5, ' ', 'B'); } $this->pdf->Cell(50, 5, utf8_decode(OrganisationRecord::finder()->findByPK($InvitedP->idtm_organisation)->org_vorname) . ' ' . utf8_decode($InvitedP->org_name), 'B', 0); $this->pdf->Cell(50, 5, $InvitedP->act_part_anwesend == 1 ? 'anwesend' : '', 'B', 1); $i++; } $this->pdf->Ln(); }
private function ProtokollHeader($idtm_protokoll) { $Protokoll = ProtokollRecord::finder()->findBy_idtm_protokoll($idtm_protokoll); $this->pdf->SetY(48); //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Helvetica', 'B', 12); $this->pdf->Cell(185, 6, 'Thema - ' . utf8_decode($Protokoll->prt_name), 1, 0, 'B', 1); $this->pdf->Ln(7); //$this->pdf->SetX(28); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'Moderator: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode(OrganisationRecord::finder()->findByidtm_organisation($Protokoll->idtm_organisation)->org_name), 0); $this->pdf->Ln(); //$this->pdf->SetX(28); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'Typ: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode(ProtokollTypeRecord::finder()->findByPK($Protokoll->idta_protokoll_type)->prt_type_name), 0); $this->pdf->Ln(); //$this->pdf->SetX(28); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'Ort: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($Protokoll->prt_location), 0); $this->pdf->Ln(); //$this->pdf->SetX(28); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'Datum: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($Protokoll->prt_cdate), 0); $this->pdf->Ln(7); //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Arial', 'B', 12); $this->pdf->Cell(185, 6, 'Eingeladen ', 1, 0, 'B', 1); $this->pdf->Ln(7); $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_termin = :suchtext"; $criteria->Parameters[':suchtext'] = $Protokoll->idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $InvitedPP = TerminOrganisationView::finder()->findAll($criteria); foreach ($InvitedPP as $InvitedP) { $this->pdf->SetX(20); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'T: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($InvitedP->org_name), 0); $this->pdf->Ln(); } //$this->pdf->SetX(20); $this->pdf->SetFillColor(234, 242, 220); $this->pdf->SetDrawColor(234, 242, 220); $this->pdf->SetFont('Arial', 'B', 12); $this->pdf->Cell(185, 6, 'Anwesend ', 1, 0, 'B', 1); $this->pdf->Ln(7); $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_activity = :suchtext"; $criteria->Parameters[':suchtext'] = $Protokoll->idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $AnwesendPP = ActivityParticipantsView::finder()->findAll($criteria); foreach ($AnwesendPP as $InvitedP) { $this->pdf->SetX(20); $this->pdf->SetFont('Arial', '', 10); $this->pdf->Cell(30, 5, 'T: ', 0); $this->pdf->SetFont('Arial', 'B', 10); $this->pdf->Cell(60, 5, utf8_decode($InvitedP->org_name), 0); $this->pdf->Cell(60, 5, utf8_decode($InvitedP->act_part_notiz), 0); $this->pdf->Cell(10, 5, $InvitedP->act_part_anwesend == 1 ? 'Ja' : 'Nein', 0); $this->pdf->Ln(); } }
public function onPreInit($param) { parent::onPreInit($param); $completeCounter = 1; $this->idtm_termin = $_GET['idtm_termin']; $this->idtm_protokoll = $_GET['idtm_protokoll']; $idtm_termin = $this->idtm_termin; $idtm_protokoll = $this->idtm_protokoll; $this->workbook = new PHPExcel(); $sheet = $this->workbook->getActiveSheet(); $sheet->setTitle('Protokoll'); $sheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT); $sheet->getPageSetup()->setPaperSize(PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4); $sheet->getRowDimension('1')->setRowHeight(40); $sheet->getColumnDimension('A')->setWidth(5); $sheet->getColumnDimension('B')->setWidth(30); $sheet->getColumnDimension('C')->setWidth(20); $sheet->getColumnDimension('D')->setWidth(5); $sheet->getColumnDimension('E')->setWidth(20); $sheet->getColumnDimension('F')->setWidth(20); $this->workbook->getActiveSheet()->getStyle('A1')->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $this->workbook->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setRGB('898989'); $this->workbook->getActiveSheet()->getStyle('A1')->getFont()->setSize(16); $this->workbook->getActiveSheet()->getStyle('A1')->getFont()->getColor()->setRGB('FFFFFF'); $sheet->mergeCells('A1:B1'); $sheet->setCellValue('A1', "Protokoll"); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('A1'), 'A' . $completeCounter . ':H' . $completeCounter); $counter = 5; $completeCounter = $counter; $this->workbook->getActiveSheet()->getStyle('B5')->applyFromArray(array('font' => array('bold' => true, 'size' => 12, 'color' => array('argb' => 'FFFFFFFF')), 'alignment' => array('horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_LEFT), 'borders' => array('top' => array('style' => PHPExcel_Style_Border::BORDER_THIN)), 'fill' => array('type' => PHPExcel_Style_Fill::FILL_SOLID, 'startcolor' => array('argb' => 'FFA0A0A0')))); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B5'), 'B' . $counter . ':C' . $counter); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B5'), 'E' . $counter . ':G' . $counter); //der header fuer den Bereich $sheet->setCellValue('B' . $counter, "Name"); $sheet->setCellValue('C' . $counter, "Projektrolle"); $sheet->setCellValue('E' . $counter, "Name"); $sheet->setCellValue('F' . $counter, "Kommentar"); $sheet->setCellValue('G' . $counter, "AV"); $counter++; $criteria = new TActiveRecordCriteria(); $criteria->Condition = "idtm_termin = :suchtext"; $criteria->Parameters[':suchtext'] = $idtm_termin; $criteria->OrdersBy["idtm_organisation"] = 'asc'; $Records = TerminOrganisationView::finder()->findAll($criteria); foreach ($Records as $Record) { $sheet->setCellValue('B' . $counter, htmlentities($Record->org_name)); $sheet->setCellValue('C' . $counter, htmlentities($Record->user_role_name)); $counter++; } $counter2 = $completeCounter; $counter2++; $criteria2 = new TActiveRecordCriteria(); $criteria2->Condition = "idtm_activity = :suchtext"; $criteria2->Parameters[':suchtext'] = $idtm_termin; $Records2 = ActivityParticipantsView::finder()->findAll($criteria2); foreach ($Records2 as $Record) { $sheet->setCellValue('E' . $counter2, htmlentities($Record->org_name)); $sheet->setCellValue('F' . $counter2, htmlentities($Record->act_part_notiz)); $sheet->setCellValue('G' . $counter2, htmlentities($Record->act_part_anwesend)); $counter2++; } $counter >= $counter2 ? $completeCounter = $counter : ($completeCounter = $counter2); $completeCounter++; $counter3 = $completeCounter; $counter3++; $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getAlignment()->setWrapText(true); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getAlignment()->setShrinkToFit(true); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getFont()->setSize(12); $this->workbook->getActiveSheet()->getStyle('B' . $completeCounter)->getFont()->getColor()->setRGB('232323'); $SQL = "SELECT a.* FROM `vv_protokoll_detail_aufgabe` a INNER JOIN ta_protokoll_detail_group b ON a.idta_protokoll_detail_group = b.idta_protokoll_detail_group"; $SQL .= " WHERE idtm_protokoll = " . $idtm_protokoll; $Records3 = ProtokollDetailAufgabeView::finder()->findAllBySQL($SQL); foreach ($Records3 as $Record) { $sheet->setCellValue('B' . $counter3, htmlentities($Record->idta_protokoll_detail_group)); $sheet->mergeCells('C' . $counter3 . ':D' . $counter3); $sheet->setCellValue('C' . $counter3, htmlentities($Record->prtdet_cdate)); $sheet->setCellValue('E' . $counter3, htmlentities($Record->prtdet_topic)); $this->workbook->getActiveSheet()->getStyle('B' . $counter3)->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID); $this->workbook->getActiveSheet()->getStyle('B' . $counter3)->getFill()->getStartColor()->setRGB('A9AB78'); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B' . $counter3), 'B' . $counter3 . ':G' . $counter3); $counter3++; $sheet->mergeCells('B' . $counter3 . ':G' . $counter3); $sheet->setCellValue('B' . $counter3, utf8_decode(strip_tags($Record->prtdet_descr))); $this->workbook->getActiveSheet()->duplicateStyle($this->workbook->getActiveSheet()->getStyle('B' . $completeCounter), 'B' . $counter3 . ':G' . $counter3); $counter3++; } $this->generate('Excel2007', 'risklogiq2009'); }