Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $results = $this->_convertObjectToArrayRecursivelly($this->userModel->read(
- 'id_user, firstname, name, date_of_birth, address, zip_code, city, mobile_phone, login, email', // DON'T GET PASSWORD !
- $where, (($this->input->get('jtPageSize'))) ? $this->input->get('jtPageSize') : null, (($this->input->get('jtStartIndex'))) ? $this->input->get('jtStartIndex') : 0, null, (($this->input->get('jtSorting'))) ? $this->input->get('jtSorting') : null, null, false
- )
- );
- foreach ($results as $key => $result) {
- $result->address = deleteBR($result->address);
- }
- $count = $this->userModel->read('count(*) as "count"', $where)->count;
- if ($count > 0) {
- if ($this->input->get('options')) {
- foreach ($results as $key => $value) {
- // Create a complex description for the user.
- // Format: Nom/Type
- // Catégorie/Famille
- $options[$key]['DisplayText'] = ($this->input->get('displayType') == "select") ? $value->pseudo : '<span class="i b my-tooltip" rel="tooltip" title="<b>Id</b>: ' . $value->id_user . '. <br /><b>Pseudo</b>: ' . $value->pseudo . '. <br /><b>Email</b>: ' . $value->email . '">' . $value->pseudo . '</span>';
- $options[$key]['Value'] = $value->id_user;
- }
- $jTableResult['Result'] = "OK";
- $jTableResult['Options'] = $options;
- $jTableResult['TotalRecordCount'] = $count;
- } else {
- $jTableResult['Result'] = "OK";
- $jTableResult['Records'] = $results;
- $jTableResult['TotalRecordCount'] = $count;
- }
- } else {
- $jTableResult['Result'] = "OK";
- $jTableResult['Message'] = lang('lang_controller_research_no_result_administrator');
- $jTableResult['TotalRecordCount'] = $count;
- $jTableResult['Options'] = array();
- $jTableResult['Records'] = array();
- }
- echo json_encode($jTableResult);
Advertisement
Add Comment
Please, Sign In to add comment