Example #1
0
 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)]);
 }
Example #2
0
 protected function _prepareDomainsTable()
 {
     $table = new Table();
     $table->addClass('table', 'table-striped', 'tablesorter');
     $row = new TableRow();
     $row->setContent([TableHeading::create('Domain'), TableHeading::create('Price'), TableHeading::create('Source'), TableHeading::create('Month'), TableHeading::create('Year'), TableHeading::create('Status')]);
     $thead = new TableHead();
     $thead->setContent($row);
     $tbody = new TableBody();
     foreach ($this->_domains as $item) {
         $month = $item->month;
         $domain = strtolower(trim($item->domain, ''));
         if (is_numeric($item->month)) {
             $dateObj = \DateTime::createFromFormat('!m', (int) ltrim($item->month, 0));
             $month = $dateObj->format('F');
         }
         $whois = Span::create('Check')->addClass('btn', 'btn-success', 'btn-xs');
         $whois->setAttribute('data-sendretrieve', '/domains/whois/' . $domain);
         $domainLink = new Link('http://www.' . $domain, $domain);
         $row = TableRow::create();
         $row->appendContent([TableCell::create($domainLink), TableCell::create(Encoding::toUTF8($item->price)), TableCell::create($this->_filterSource($item->source)), TableCell::create($month), TableCell::create($item->year), TableCell::create($whois)]);
         $tbody->appendContent($row);
     }
     $table->prependContent($thead);
     $table->appendContent($tbody);
     return Div::create([GoogleAdsense::leaderboard(), $table]);
 }