How to Create Page navigation Tables in Frontaccounting
- Article
- Comment (4)
How to Create Page navigation Tables in Frontaccounting. Frontaccounting itself, we need to create page navigated tables. Here we are going to use existing functions and create page navigational tables, Let’s start with coding.
function display_rows(){ $sql = kv_hrm_uploads_list(); $cols = array( _("Employee Id") => array('fun'=>'employee_id', 'ord'=>''), _("Employee Id") => array('name'=>'employee_id'), _("Employee Name") => array('name'=>'employee_name'), _("CV Title") => array('name'=>'title'), array('insert'=>true, 'fun'=>'edit_link'), array('insert'=>true, 'fun'=>'view_link'), array('insert'=>true, 'fun'=>'download_link'), array('insert'=>true, 'fun'=>'delete_link') ); $table =& new_db_pager('kv_cv_table', $sql, $cols); $table->width = "60%"; display_db_pager($table); }
The above function is my example code for your understanding, Actually, i am working with HRM module, there i coded myself for the Attachment of employee resume. Come to the topic, The above function will fetch the returned result to the pager function. The list will be collected from kv_hrm_uploads_list().
You need to include the following class to support db pager view .
include_once($path_to_root . "/includes/db_pager.inc");
Now, we need to write the kv_hrm_uploads_list function to query the lists from the database.
//----------------------------------------------------------------------------- function kv_hrm_uploads_list(){ return "SELECT empl_id, empl_name, cv_title FROM ".TB_PREF."kv_empl_cv"; }
That’s it, your page view table is ready, once it reaches more than 11 entries, you will start using the table navigation. Here is a sample screenshot for your reference.
hello sir i tried this code but its not working for me
This should work when you include the db_pager file from includes directory
thanks, I have already included the db_pager file.
Issue was in sql it is not working properly without where condition so i used where 1
So you found the solution for the problem. It won’t work without right query.