Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error pagination listings
#1
Exclamation 
First I apologize for my English translator supported by google.

When making lists, linked to a user account, it shows me only items that account, but the total number of items and in Page, displays the total of items from all accounts. Therefore, if I go back pages are empty.

An example:

Element 1 - 20 de 984 Elements 

898 and there really are not shown, but there empty and full pages of wrong elements.

page without elements:
[Image: captura-error-paginacion-1.PNG]

true last page elements, page 45:

[Image: captura-error-paginacion-2.PNG]


I hope I made myself clear. Thank you for your help.
Reply
#2
(07-01-2016, 08:19 AM)eaimoi Wrote: First I apologize for my English translator supported by google.

When making lists, linked to a user account, it shows me only items that account, but the total number of items and in Page, displays the total of items from all accounts. Therefore, if I go back pages are empty.

An example:

Element 1 - 20 de 984 Elements 

898 and there really are not shown, but there empty and full pages of wrong elements.

page without elements:
[Image: captura-error-paginacion-1.PNG]

true last page elements, page 45:

[Image: captura-error-paginacion-2.PNG]


I hope I made myself clear. Thank you for your help.

hello aimoi,
sorry for late response,  are you use the manual query on the module? and on the query it self, are you use a keyword group by? if you are using manual query can you share your query here ?

thanks
Reply
#3
(07-02-2016, 11:36 PM)seegithub Wrote:
(07-01-2016, 08:19 AM)eaimoi Wrote: First I apologize for my English translator supported by google.

When making lists, linked to a user account, it shows me only items that account, but the total number of items and in Page, displays the total of items from all accounts. Therefore, if I go back pages are empty.

An example:

Element 1 - 20 de 984 Elements 

898 and there really are not shown, but there empty and full pages of wrong elements.

page without elements:
[Image: captura-error-paginacion-1.PNG]

true last page elements, page 45:

[Image: captura-error-paginacion-2.PNG]


I hope I made myself clear. Thank you for your help.

hello aimoi,
sorry for late response,  are you use the manual query on the module? and on the query it self, are you use a keyword group by? if you are using manual query can you share your query here ?

thanks

I have not changed anything in the query, the only thing I've changed something is Mycontroller.php , save and edit in sections.
I hit the code block is in Mycontroller.php on view:



Code:
 /**
    * show view informasi data detail pada suatu record
    * @param int $id(record)
    */
   public function view($id = 0) {
       $this->load->model('table_model', 'table');
       
       $currentClass       = $this->_currentClass;
       $arrayRawQuery      = $this->cfggenerator->loadQueryFields($currentClass);
       if (is_object($arrayRawQuery) && !empty($arrayRawQuery->select)) {
           $tblName        = $this->{$currentClass}->getTblName();
           $tblPk          = $this->{$currentClass}->getPrimaryKey();
           $condition      = "{$tblName}.{$tblPk} = '{$id}'";
           $dataResult     = $this->{$currentClass}->searchByRaw($arrayRawQuery, $condition);
           $data['obj']    = isset($dataResult[0]) ? $dataResult[0] : null;
       } else {
           $data['obj']    = $this->{$currentClass}->find($id);
       }
       
       $data['settings']   = getSession(SESSION_NAME.'_settingsInfo');
       $data['formFields'] = $this->cfggenerator->loadStructureFields($currentClass, ROOTKEY_FORM);
       $data['gridFields'] = $this->cfggenerator->loadStructureFields($currentClass, ROOTKEY_GRID);
       $data['viewFields'] = $this->cfggenerator->loadGridViewFields($currentClass);
       
       $this->load->view("{$this->baseViewDir}/{$this->viewPage}", $data);
   }


Yes I added a field in the account table linked to another table , I show catches:

[Image: camposaccount.PNG]

[Image: claveacount.PNG]
Thanks for your help
Reply
#4
hi eaimoi,


Do you mean, you just want to display the data based on references from the field accountAgencia? Is it true ? If so then you just simply do a bit of configuration on the tuning module, because the module account is the basic module of the application, then you need to do a bit of additional lines of code, but I want to assure once again, what do I mean the same as you are looking for?
Reply
#5
(07-05-2016, 12:57 PM)seegithub Wrote: hi eaimoi,


Do you mean, you just want to display the data based on references from the field accountAgencia? Is it true ? If so then you just simply do a bit of configuration on the tuning module, because the module account is the basic module of the application, then you need to do a bit of additional lines of code, but I want to assure once again, what do I mean the same as you are looking for?


Yes, it's that. What happens is that he thought he was checking this box that functionality :


Enable data binding Owner userid


idusuario                                                                                


* Allowing cancellation of data?


Thanks for your help.
Reply
#6
(07-05-2016, 01:41 PM)eaimoi Wrote:
(07-05-2016, 12:57 PM)seegithub Wrote: hi eaimoi,


Do you mean, you just want to display the data based on references from the field accountAgencia? Is it true ? If so then you just simply do a bit of configuration on the tuning module, because the module account is the basic module of the application, then you need to do a bit of additional lines of code, but I want to assure once again, what do I mean the same as you are looking for?


Yes, it's that. What happens is that he thought he was checking this box that functionality :


Enable data binding Owner userid


idusuario                                                                                


* Allowing cancellation of data?


Thanks for your help.

ok, because the users module is a basic module of this application, then you have to add a bit of code, here I will adjust to fieldname that you created, namely accountAgencia:
1. First of all open file: application/controllers/builtin/master/Users.php, then find the function save(), and then find the section.
PHP Code:
$s['entryBy'      $this->_userInfo->userId


add the following line below:
PHP Code:
$s['accountAgencia'      $this->_userInfo->userId;
$s['entryBy'      $this->_userInfo->userId

2. then find again the function update(), and then find the section:
PHP Code:
$u['status'       $this->input->post('slcStatus'); 


add the following line below:
PHP Code:
$u['accountAgencia'      $this->_userInfo->userId;
$u['entryBy'      $this->_userInfo->userId

3. then go to the user module settings: menu Management> Generator Module,  find the module namely users and then click edit.

4. then click Module Config tab.
5. put a checklist on the setting "Turn on Owner Data Binding", then on the dropdown select fieldname accountAgencia, save the settings and try again the data input.


hopefully this helps, if you still have trouble, please contact me
Reply
#7
(07-05-2016, 02:19 PM)seegithub Wrote:
(07-05-2016, 01:41 PM)eaimoi Wrote:
(07-05-2016, 12:57 PM)seegithub Wrote: hi eaimoi,


Do you mean, you just want to display the data based on references from the field accountAgencia? Is it true ? If so then you just simply do a bit of configuration on the tuning module, because the module account is the basic module of the application, then you need to do a bit of additional lines of code, but I want to assure once again, what do I mean the same as you are looking for?


Yes, it's that. What happens is that he thought he was checking this box that functionality :


Enable data binding Owner userid


idusuario                                                                                


* Allowing cancellation of data?


Thanks for your help.

ok, because the users module is a basic module of this application, then you have to add a bit of code, here I will adjust to fieldname that you created, namely accountAgencia:
1. First of all open file: application/controllers/builtin/master/Users.php, then find the function save(), and then find the section.
PHP Code:
$s['entryBy'      $this->_userInfo->userId


add the following line below:
PHP Code:
$s['accountAgencia'      $this->_userInfo->userId;
$s['entryBy'      $this->_userInfo->userId

2. then find again the function update(), and then find the section:
PHP Code:
$u['status'       $this->input->post('slcStatus'); 


add the following line below:
PHP Code:
$u['accountAgencia'      $this->_userInfo->userId;
$u['entryBy'      $this->_userInfo->userId

3. then go to the user module settings: menu Management> Generator Module,  find the module namely users and then click edit.
[Image: image1.png]
4. then click Module Config tab.
5. put a checklist on the setting "Turn on Owner Data Binding", then on the dropdown select fieldname accountAgencia, save the settings and try again the data input.
[Image: image2.png]

hopefully this helps, if you still have trouble, please contact me

My users.php file in the save() section is this:

PHP Code:
/**
     * menyimpan user baru kedatabase
     */
 
   public function save() {
 
       //pastikan method yg dikirim adalah post
 
       if (!$this->http->isPost()) { 
 
           $this->permission->blockDirectAccess();
 
       }
 
       
        
//makesure check permission
 
       if (!$this->permission->checkActionPermission($this->_havedAction"C")) {
 
           $this->permission->blockActionAccess();
 
       }
 
       
        $gmAccount  
= (object) $this->_infoSuperUser();
 
       $settings   hlGetSettingInfo('generals');
 
       $pwdExpired = isset($settings->pwdExpired) ? $settings->pwdExpired 0;
 
       
        $meConcat           
'';
 
       $mfConcat           '';
 
       $userExpDate        $this->input->post('txtExpiredDate');
 
       $password           $this->input->post('txtPassword');
 
       $salt               substr(md5($this->___settings->generals->salt), 022);
 
       
        $s
['userName'     $this->input->post('txtUsername');
 
       $s['alias'        $this->input->post('txtAlias');
 
       
        $s
['password'     $this->password->hash($password$salt);
 
       $s['email'        $this->input->post('txtEmail');
 
       $s['groupId'      $this->input->post('slcGroup');
 
       $s['status'       $this->input->post('slcStatus');
 
       $s['pwdExpiredDate']= $pwdExpired date('Y-m-d H:i:s'strtotime("+{$pwdExpired} days")) : NULL;
 
       if (!empty($userExpDate)) {
 
           $s['userExpiredDate'] = date('Y-m-d H:i:s'strtotime($userExpDate));
 
       }
 
       
        
//$s['expiredDate']   = date('Y-m-d H:i:s');
 
       $extraMenus         $this->input->post('me');
 
       $forbiddenMenus     $this->input->post('mf');
 
       $arrExtraMenu       = array();
 
       
        if 
(is_array($extraMenus) && !empty($extraMenus)) {
 
           foreach ($extraMenus as $mid) {
 
               $meChild $this->input->post('me'.$mid);
 
               $arrExtraMenu[$mid] = $meChild;
 
           }
 
       }

 
       if (!empty($s['userName'])) {
 
           //block if some user trying to create superuser account name
 
           if (strtolower($s['userName'] === strtolower($gmAccount->userName))) {
 
               $isExist true;
 
           } else {
 
               $condition  = array("userName = '".$s['userName']."' OR email = '".$s['email']."'" => null);
 
               $isExist $this->users->isExist($condition);
 
           }
 
           
            if 
(!$isExist) {
 
               $res $this->users->save($strue);
 
               if ($res) {
 
                   $this->___saveExtraMenu($arrExtraMenu$res);
 
                   $this->___saveBlockMenu($forbiddenMenus$res);
 
                   $this->___addDefaultMenu($s['groupId']);
 
               }
 
               
                hlJsonResponse
(
 
                   'success'
 
                   Translator::__('Success'), 
 
                   Translator::__('New account has been created.')
 
               );
 
               
            
} else {
 
               hlJsonResponse(
 
                   'warning'
 
                   Translator::__('Warning'), 
 
                   Translator::__('Username or email already registered!')
 
               );
 
           }
 
       } else {
 
           hlJsonResponse(
 
               'danger'
 
               Translator::__('Error'), 
 
               Translator::__('Forbidden direct access!')
 
           );
 
       }
 
   

Where should I add the code?

 Thanks for your help.


EDIT: 
I would comment: Data are bound to accountAgencia field, as shown in Listing only those of the agency. However, it shows empty pages to the total of items of all agencies. Therefore, what is wrong is the total of items on the pagination.
Reply
#8
What solved, moment , With A patch My_Controller.php in section _count (). I added a default condition if the total of the tables that affects me the problem is requested. Through a switch-case on those tables.
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)