public function pageContent() { $table = (new Table())->addClass('table', 'table-striped', 'tablesorter'); $thead = new TableHead(); $tbody = new TableBody(); $noTitle = []; $thead->setContent([new TableHeading('Qty'), new TableHeading('Title')]); $table->setContent($thead); foreach ($this->_dvds as $key => $item) { if ($key === 0 && $this->_canAdd) { $tr = new TableRow(); $tr->appendContent([new TableCell(1), new TableCell($this->_editable('title', 'title', ''))]); $tbody->prependContent($tr); } if (!$item->title) { $noTitleRow = new TableRow(); $noTitleRow->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', 'no title', $item->barcode))]); $this->_count--; $noTitle[] = $noTitleRow; } else { $tr = new TableRow(); $tr->appendContent([new TableCell($item->count), new TableCell($this->_editable('title', $item->title, $item->barcode))]); $tbody->appendContent($tr); $this->_count++; } } //$tbody->appendContent($noTitle); return Div::create([HeadingTwo::create(['Dvd Library ', Span::create('count ' . $this->_count)->setAttribute('style', 'font-size: 16px; color: #ccc;')]), $table->appendContent($tbody)]); }
protected function _renderTitle() { return HeadingTwo::create($this->getTitle())->addClass('heading-text', Ui::FLOAT_LEFT, Ui::MARGIN_NONE); }
public function pageContent() { $arrayBuilder1 = ["1" => "34re", "2" => "df", "3" => "rvdf", "4" => "rvdf", "5" => "4terdf", "6" => "tfgvb"]; $arrayBuilder2 = ["brooke" => "bryan", "tom" => "kay", "rich" => "gooding", "steve" => "barrow", "james" => "eagle", "chris" => "sparshott"]; return Div::create([HeadingTwo::create('Array Builder'), $this->_arrayBuilder($arrayBuilder1), $this->_arrayBuilder($arrayBuilder2)]); }
protected function _salesByChars() { $output = Div::create(HeadingTwo::create('Sales by Domain Character Length')); $data = []; foreach ($this->_domains as $item) { $domain = str_replace(['.co.uk', '.org.uk'], '', $item->domain); $data[strlen($domain)][] = $domain; } $domains = [['Char Length', 'Count']]; foreach ($data as $length => $domain) { $domains[$length] = ["{$length}", count($domain)]; } ksort($domains); $chart = ChartPanel::i($domains); $chart->setChartType($chart::CHART_TYPE_COLUMN); $output->appendContent($chart); return $output->addClass('col-md-12'); }