How to Create Page navigation Tables in Frontaccounting |
X

Congrats, You are Subscribed to Receive Updates.

How to Create Page navigation Tables in Frontaccounting


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.

fa-page_view-table

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, PHP and Data Analyst. Database Management Advance Level

4 comments

  1. commenter

    hello sir i tried this code but its not working for me

Reply to Varadharaj V Cancel reply

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar