Skip to content

Instantly share code, notes, and snippets.

View reachkamrul's full-sized avatar
😁

Md Kamrul Islam reachkamrul

😁
View GitHub Profile
//filter by current month
var myTimeout = setTimeout(myFilterFunction, 100);
var months = ("0" + (new Date().getMonth() + 1)).slice(-2)+"/";
months = "/"+months;
function myFilterFunction() {
// jQuery('select').sumo.selectItem(months.toString());
jQuery('option[value="'+months+'"]').prop("selected", true);
jQuery('.form-control').trigger("change");
//filter by current year
var myTimeout = setTimeout(myFilterFunction, 100);
function myFilterFunction() {
var years = new Date().getFullYear();
jQuery('select')[0].sumo.selectItem(years.toString());
}
/*
* The following functions will add additional file types option to your file upload element
* In this case, You can enable MSG file format
* Just add this snippet to your theme's functions.php file or relevant place.
*/
add_filter('fluentform_file_type_options', function ($types) {
$types[] = [
'label' => __('MSG file - MSG', 'fluentform'),
'value' => 'msg',
add_filter('fluentform_payment_receipt_pre_render_payment_info', function ($html, $entry) {
$orderItem = \FluentFormPro\Payments\Orders\OrderData::getOrderItems($this->entry);
$formId = $entry->form_id;
// replace $html with your own HTML and return
return $html;
}, 10, 2);
<?php
global $current_user;
if ( is_user_logged_in() ) {
$getEmail = $current_user->user_email;
$getID = get_current_user_id();
$column_key = "email";
echo do_shortcode('[ninja_tables id="621" filter_column="' . $column_key . '" filter="' . $getID . '" ] ');
}
$form.find('.address').on('change', function(){
var address = jQuery(this).val().split(',');
$form.find('input[name="government"]').val(address[0]);
$form.find('input[name="address"]').val(address[1]);
$form.find('input[name="postal"]').val(address[2]);
})
// To hide before filter
//css
#footable_parent_NT_ID{
opacity:0;
}
// js
$table.on("after.ft.filtering", function () {
jQuery(".ninja-custom-filter").each(function(){
var m = jQuery(this).find(':input option:selected');
$urlValue = 'http://google.com/?url=';
$fieldName = 'url';
$form.find('input[name="'+$fieldName+'"]').on('change, keyup', function($fieldValue){
$fieldValue = jQuery(this).val();
$url = $urlValue+$fieldValue;
$form.on('fluentform_submission_success', function(){
window.open($url, 'name');
});
/*
* The following functions will add additional shortcode
* In this case, you can use a shortcode to show a random data among your table cell
* You can use like this [ninja_table_random_cell id="Your Table ID" column="Your Colum Key"]
* Just add this snippet to your theme's functions.php file or relevant place.
*/
add_shortcode('ninja_table_random_cell', function ($atts) {
$shortCodeDefaults = array(