���ѧۧݧ�ӧ�� �ާ֧ߧ֧էا֧� - ���֧էѧܧ�ڧ��ӧѧ�� - /home/rickpfrv/tie.cx/app/controllers/Pixels.php
���ѧ٧ѧ�
<?php namespace Altum\Controllers; use Altum\Middlewares\Authentication; class Pixels extends Controller { public function index() { Authentication::guard(); /* Create Modal */ $view = new \Altum\Views\View('pixels/pixel_create_modal', (array) $this); \Altum\Event::add_content($view->run(), 'modals'); /* Update Modal */ $view = new \Altum\Views\View('pixels/pixel_update_modal', (array) $this); \Altum\Event::add_content($view->run(), 'modals'); /* Delete Modal */ $view = new \Altum\Views\View('pixels/pixel_delete_modal', (array) $this); \Altum\Event::add_content($view->run(), 'modals'); /* Prepare the filtering system */ $filters = (new \Altum\Filters(['type'], ['name'], ['name', 'datetime'])); /* Prepare the paginator */ $total_rows = database()->query("SELECT COUNT(*) AS `total` FROM `pixels` WHERE `user_id` = {$this->user->user_id} {$filters->get_sql_where()}")->fetch_object()->total ?? 0; $paginator = (new \Altum\Paginator($total_rows, $filters->get_results_per_page(), $_GET['page'] ?? 1, url('pixels?' . $filters->get_get() . '&page=%d'))); /* Get the pixels list for the user */ $pixels = []; $pixels_result = database()->query("SELECT * FROM `pixels` WHERE `user_id` = {$this->user->user_id} {$filters->get_sql_where()} {$filters->get_sql_order_by()} {$paginator->get_sql_limit()}"); while($row = $pixels_result->fetch_object()) $pixels[] = $row; /* Prepare the pagination view */ $pagination = (new \Altum\Views\View('partials/pagination', (array) $this))->run(['paginator' => $paginator]); /* Prepare the View */ $data = [ 'pixels' => $pixels, 'pixels_total' => $total_rows, 'pagination' => $pagination, 'filters' => $filters, ]; $view = new \Altum\Views\View('pixels/index', (array) $this); $this->add_view_content('content', $view->run($data)); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | ���֧ߧ֧�ѧ�ڧ� ����ѧߧڧ��: 0.2 |
proxy
|
phpinfo
|
���ѧ����ۧܧ�