Пример #1
0
 /**
  * Execute a command and return a response. Does not render
  * @param IRequest $Request
  * @return IResponse the execution response
  */
 function execute(IRequest $Request)
 {
     $Table = new WalletTable();
     $page = 0;
     $total = null;
     $row_count = 5;
     if (isset($Request[self::PARAM_PAGE])) {
         $page = $Request[self::PARAM_PAGE];
     }
     $offset = $page * $row_count;
     $Pagination = new HTMLPagination($row_count, $page, $total);
     $SearchQuery = $Table->select()->limit("{$row_count} OFFSET {$offset}");
     $SearchTable = new HTMLPDOQueryTable($SearchQuery);
     $SearchTable->validateRequest($Request);
     $Form = new HTMLForm(self::FORM_METHOD, $Request->getPath(), self::FORM_NAME, new HTMLMetaTag(HTMLMetaTag::META_TITLE, self::TITLE), new HTMLElement('fieldset', new HTMLElement('legend', 'legend-submit', self::TITLE), $SearchTable, $Pagination, "<br/><br/>", new HTMLButton('submit', 'Search', 'submit')));
     return $Form;
 }
Пример #2
0
 /**
  * @param ISessionRequest $Request
  * @return WalletEntry[]
  */
 static function loadSessionWallets(ISessionRequest $Request)
 {
     $Table = new WalletTable();
     return $Table->select()->limit(50);
 }