Example #1
0
    /** @var BaseObject[] $objs */
    $objs = Finder::create('medOffer')->setWhere($where)->find();
    if (empty($objs)) {
        $od->addContent('Keine Datensätze gefunden');
    } else {
        $table = new base_html_model_Table();
        $table->setCssClass('offerTable');

        $headRow = new base_html_model_table_Row();
        $headRow->setRowType(base_html_model_table_Row::ROWTAG_HEAD);
        /** @var Fieldinfo[] $fis */
        $fis = [];
        foreach ($obj->getFieldsForOfferPage() as $field) {
            $fi = $obj->getFieldinfo($field);
            $cell = new base_html_model_table_Cell();
            $cell->setCssId($fi->getFieldName());
            $cell->setContent($fi->getFieldLabel());
            $headRow->addCell($cell);
            $fis[] = $fi;
        }

        $cell = new base_html_model_table_Cell();
        $cell->setCssClass('orderAmount');
        $cell->setContent('Bestellmenge');
        $headRow->addCell($cell);
        $table->addHeadRow($headRow);

        foreach ($objs as $obj) {
            $obj['name'] .= ' ' . $obj->getField('amount') . ' ' . $obj->getField('unit') . ' ' . $obj->getField('dosage');
            $row = new base_html_model_table_Row();
            $row->setId($obj['LK']);