Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 110

Přidáno uživatelem Jiří Sviták před asi 16 roky(ů)

vypis vsech transakci

Zobrazit rozdíly:

freenetis/trunk/kohana/application/controllers/money_transfers.php
<?php
class Money_Transfers_Controller extends Controller {
function index()
{
url::redirect(url_lang::base().'money_transfers/show_all');
}
function show_all($limit_results = 500, $order_by = 'id', $order_by_direction = 'ASC')
{
if (!$this->gacl_class->acl_check('freenetis', 'view_all', 'all', $_SESSION['username'])) Controller::error(1);
// get new selector
if (is_numeric($this->input->get('record_per_page'))) $limit_results = (int) $this->input->get('record_per_page');
// parameters control
$allowed_order_type = array('id');
if (!in_array(strtolower($order_by),$allowed_order_type)) $order_by = 'id';
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc') $order_by_direction = 'asc';
$data['title'] = url_lang::lang('texts.List of all transactions');
$data['heading'] = url_lang::lang('texts.List of all transactions');
$model_money_transfer = new Money_transfer_Model();
$alltransfers = $model_money_transfer->get_all_money_transfers();
$total_money_transfers = $model_money_transfer->count_all_money_transfers();
$grid = new Grid(url_lang::base().'users', url_lang::lang('texts.List of all transactions'), array(
'separator' => '',
//'use_paginator' => false,
//'use_selector' => false,
'current' => $limit_results, //current selected 'records_per_page' value
'selector_increace' => 200, // increace
'selector_min' => 200, // minimum where selector start
'selector_max_multiplier' => 10,
'base_url' => Config::item('locale.lang').'/money_transfers' ,
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
'total_items' => $total_money_transfers, // use db count query here of course
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
'style' => 'classic',
'order_by' => $order_by,
'order_by_direction' => $order_by_direction,
'limit_results' => $limit_results
));
$grid->order_field('id')->label('ID')->class('center');
$grid->order_field('bank_info_id')->label('Bank info id');
$grid->order_field('origin_id')->label('Origin id');
$grid->order_field('destination_id')->label('Destination id');
$grid->order_field('previous_transfer_id')->label('Previous transfer id');
$grid->order_field('timestamp')->label('Timestamp');
$grid->order_field('text')->label('Text');
$grid->order_field('amount')->label('Amount');
$grid->datasource( $alltransfers );
$this->template->content = $grid;
$view = new View('template');
$view->header = new View('base/header');
$view->content = $this->template->content;
$view->footer = new View('base/footer');
$view->header->menu = Controller::render_menu();
$view->header->title = url_lang::lang('texts.Money transfers');
//$view->content->heading = "Úprava uživatele ".$data['row']['name']." ".$data['row']['surname'];
//$view->content->form = $form->html();
$view->render(TRUE);
}
}
?>

Také k dispozici: Unified diff