How to use Default Datepicker for your Custom module in Frontaccounting
X

Congrats, You are Subscribed to Receive Updates.

How to use Default Datepicker for your Custom module in Frontaccounting


How to use Default Datepicker for your Custom module in Frontaccounting. This is one of a simple tutorial to help you to use the default date picker for your custom module development and extension creation.

hrm

Let’s start with some basic aspect. Frontaccounting itself, it doesnot allow other popular JS and PHP fraemworks for operations.But they coded for some functions. So just inherit to use our own requirment. When you start creating a module, you need to write the following things

<?php
$page_security = 'HR_EMPL_INFO';   // For the purpose of Access permission 
$path_to_root="../..";        // path to the root of your frontaccounting installation.
include($path_to_root . "/includes/session.inc");    // Manage User sessions with this class.

include($path_to_root . "/includes/ui.inc");   // Includes all the visual components of Frontaccoutning.

page(_("Employee Informations"));    //Title of your page

start_page();

end_page();

?>

The above code helps you to create a blank page with frontaccounting visuals. But in default it wont help you to use datepicker with the ui inclusion. So its separate JS. so just use the following code snippet to get datepicker.

$js = "";
if ($use_popup_windows)
	$js .= get_js_open_window(900, 500);
if ($use_date_picker)
	$js .= get_js_date_picker();

Add the above lines before setting the page title.

Also which requires to include a js file to render the datepicker. So use the following line of code to get the datepicker.

include_once($path_to_root . "/includes/date_functions.inc");

That’s it now the datepicker is ready to work .Test the function using the following code.

start_table();
date_row(_("Joining") . ":", 'join_date');

end_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, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

3 comments

  1. commenter

    Hi, Can i ask, how can i add minimum date on frontaccounting datepicker. Ex Date today would be the starting date less than today’s date cant be selected.
    Thanks!

  2. commenter

    Hi, Do you know how to add minimum date on fa default datepicker, Kindly help please, thanks

Comment Below

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

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts