예제 #1
0
 public function ajax_ssp_users_list()
 {
     $this->load_model();
     $db_options = array('table' => '`users`', 'key' => '`id`');
     $test = new cx\database\model($db_options);
     $columns = array(array('db' => "{$db_options['table']}.`id`", 'dt' => 0), array('db' => "{$db_options['table']}.`fname`", 'dt' => 1, 'textsize' => 30, 'hyper' => $this->get_url('/app/users', 'edit_user', "id="), 'id' => "{$db_options['table']}.`{$db_options['key']}`"), array('db' => "{$db_options['table']}.`lname`", 'dt' => 2, 'textsize' => 30, 'hyper' => $this->get_url('/app/users', 'edit_user', "id="), 'id' => "{$db_options['table']}.`{$db_options['key']}`"), array('db' => "{$db_options['table']}.`username`", 'dt' => 3, 'textsize' => 30, 'hyper' => $this->get_url('/app/users', 'edit_user', "id="), 'id' => "{$db_options['table']}.`{$db_options['key']}`"), array('db' => "{$db_options['table']}.`rights`", 'dt' => 4, 'fn_results' => 'format_rights', 'hyper' => $this->get_url('/app/users', 'edit_user', "id="), 'id' => "{$db_options['table']}.`{$db_options['key']}`"));
     $is_admin = $this->auth(array('user' => 'is_admin'));
     $id = $this->session->get_int(CX_LOGIN . 'id');
     $options['where'] = $is_admin === true ? " 1=1" : " id={$id}";
     $test->ssp_load($columns, $options);
 }
예제 #2
0
 public function ajax_ssp()
 {
     $this->load_model();
     $db_options = array('table' => '`test`', 'key' => '`id`');
     $test = new cx\database\model($db_options);
     $columns = array(array('db' => "{$db_options['table']}.`id`", 'dt' => 0), array('db' => "{$db_options['table']}.`data`", 'dt' => 1, 'textsize' => 30, 'hyper' => $this->get_url('/app/testing', 'echome', "id="), 'id' => "{$db_options['table']}.`{$db_options['key']}`", 'fn' => 'get_data'));
     $options['where'] = " 1=1";
     $test->ssp_load($columns, $options);
 }