Uname:Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64

Base Dir : /var/www/html

User : gavin


403WebShell
403Webshell
Server IP : 68.183.124.220  /  Your IP : 216.73.217.137
Web Server : Apache/2.4.18 (Ubuntu)
System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User : gavin ( 1000)
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/wp-content/plugins/ninja-forms/deprecated/includes/fields/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/ninja-forms/deprecated/includes/fields/tax.php
<?php if ( ! defined( 'ABSPATH' ) ) exit;
/*
 * Function to register a new field for payment tax
 *
 * @since 2.2.28
 * @returns void
 */

function ninja_forms_register_field_tax(){
	$args = array(
		'name' => __( 'Tax', 'ninja-forms' ),
		'sidebar' => '',
		'display_function' => 'ninja_forms_field_tax_display',
		'group' => 'standard_fields',
		'edit_conditional' => true,
		'edit_req' => false,
		'edit_options' => array(
			array(
				'type' => 'text',
				'name' => 'default_value',
				'label' => __( 'Tax Percentage', 'ninja-forms' ),
				'class' => 'widefat',
				'desc' => __( 'Should be entered as a percentage. e.g. 8.25%, 4%', 'ninja-forms' ),
			),
			array(
				'type' => 'hidden',
				'name' => 'payment_field_group',
				'default' => 1,
			),
			array(
				'type' => 'hidden',
				'name' => 'payment_tax',
				'default' => 1,
			),
		),
		'save_function' => 'ninja_forms_field_tax_save',
	);

	ninja_forms_register_field( '_tax', $args );
}

add_action( 'init', 'ninja_forms_register_field_tax' );

/*
 * Function to display our tax field on the front-end.
 *
 * @since 2.2.30
 * @returns void
 */

function ninja_forms_field_tax_display( $field_id, $data, $form_id = '' ) {
	if(isset($data['default_value'])){
		$default_value = $data['default_value'];
	}else{
		$default_value = '';
	}

	$field_class = ninja_forms_get_field_class( $field_id, $form_id );
	?>
	<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>"  type="hidden"  value="<?php echo $default_value;?>">
	<input id="ninja_forms_field_<?php echo $field_id;?>" name="ninja_forms_field_<?php echo $field_id;?>" type="text" class="<?php echo $field_class;?>" value="<?php echo $default_value;?>" rel="<?php echo $field_id;?>" disabled/>
	<?php
}

/*
 *
 * Function that runs when our field is saved to make sure that a % is in the tax rate box.
 *
 * @since 2.2.30
 * @returns void
 */

function ninja_forms_field_tax_save( $form_id, $data ) {
	foreach ( $data as $field_id => $val ) {
		$field = ninja_forms_get_field_by_id( $field_id );
		if ( $field['type'] == '_tax' ) {
			if ( isset ( $val['default_value'] ) ) {
				if ( strpos( $val['default_value'], '%' ) === false ) {
					$data[$field_id]['default_value'] .= '%';
				}
			}
		}
	}
	return $data;
}

Youez - 2016 - github.com/yon3zu
LinuXploit