<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}
/**
 * @var string $tab
 * @var array  $options
 */
?>
<form method="post">
	<input type="hidden" name="action" value="wdp">
	<input type="hidden" name="tab" value="<?php echo $tab; ?>" />

	<table class="form-table">
		<tbody>
		
		<tr valign="top">
			<th scope="row" class="titledesc"><?php _e('Show Bulk Table inside Category page', 'advanced-dynamic-pricing-for-woocommerce') ?></th>
			<td class="forminp forminp-checkbox">
				<fieldset>
					<legend class="screen-reader-text"><span><?php _e('Show Bulk Table inside Category page', 'advanced-dynamic-pricing-for-woocommerce') ?></span></legend>
					<label for="show_category_bulk_table">
						<input <?php checked( $options['show_category_bulk_table'] ); ?>
							name="show_category_bulk_table" id="show_category_bulk_table" type="checkbox">
					</label>
				</fieldset>
			</td>
		</tr>
		<tr valign="top">
			<th scope="row" class="titledesc"><?php _e( 'Category Bulk Table position', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
			<td class="forminp forminp-checkbox">
				<fieldset>
					<legend class="screen-reader-text">
						<span><?php _e( 'Category Bulk Table position', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
					<label for="category_bulk_table_action">
					    <select name = "category_bulk_table_action">
							<option value="woocommerce_before_shop_loop" <?php selected($options['category_bulk_table_action'], "woocommerce_before_shop_loop", true) ?> >At top of the page</option>
							<option value="woocommerce_after_shop_loop"  <?php selected($options['category_bulk_table_action'], "woocommerce_after_shop_loop", true) ?>>At bottom of the page</option>
						</select>
					</label>
					<div>
						<?php _e( 'Or you can use shortcode [adp_category_bulk_rules_table] in category template.', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
					</div>
				</fieldset>
		</td>
		
		<tr valign="top">
			<th scope="row" class="titledesc"><?php _e('Show Bulk Table inside Product page', 'advanced-dynamic-pricing-for-woocommerce') ?></th>
			<td class="forminp forminp-checkbox">
				<fieldset>
					<legend class="screen-reader-text"><span><?php _e('Show Bulk Table inside Product page', 'advanced-dynamic-pricing-for-woocommerce') ?></span></legend>
					<label for="show_matched_bulk_table">
						<input <?php checked( $options['show_matched_bulk_table'] ); ?>
							name="show_matched_bulk_table" id="show_matched_bulk_table" type="checkbox">
					</label>
				</fieldset>
			</td>
		</tr>
		<tr valign="top">
			<th scope="row" class="titledesc"><?php _e( 'Product Bulk Table position', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
			<td class="forminp forminp-checkbox">
				<fieldset>
					<legend class="screen-reader-text">
						<span><?php _e( 'Product Bulk Table position', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
					<label for="product_bulk_table_action">
					    <select name = "product_bulk_table_action">
							<option value="woocommerce_after_single_product_summary" <?php selected($options['product_bulk_table_action'], "woocommerce_after_single_product_summary", true) ?> >Below product summary</option>
							<option value="woocommerce_before_single_product_summary" <?php selected($options['product_bulk_table_action'], "woocommerce_before_single_product_summary", true) ?> >Above product summary</option>
							<option value="woocommerce_after_single_product" <?php selected($options['product_bulk_table_action'], "woocommerce_after_single_product", true) ?> >Below product</option>
							<option value="woocommerce_before_single_product" <?php selected($options['product_bulk_table_action'], "woocommerce_before_single_product", true) ?> >Above product</option>
							<option value="woocommerce_after_add_to_cart_form" <?php selected($options['product_bulk_table_action'], "woocommerce_after_add_to_cart_form", true) ?> >Below add to cart</option>
							<option value="woocommerce_before_add_to_cart_form" <?php selected($options['product_bulk_table_action'], "woocommerce_before_add_to_cart_form", true) ?> >Above add to cart</option>
						</select>
					</label>
					<div>
						<?php _e( 'Or you can use shortcode [adp_product_bulk_rules_table] in product template.', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
					</div>
				</fieldset>
			</td>
		</tr>
		

		<tr valign="top">
			<th scope="row" class="titledesc"><?php _e('Show Striked Prices in the Cart', 'advanced-dynamic-pricing-for-woocommerce') ?></th>
			<td class="forminp forminp-checkbox">
				<fieldset>
					<legend class="screen-reader-text"><span><?php _e('Show Striked Prices in the Cart', 'advanced-dynamic-pricing-for-woocommerce') ?></span></legend>
					<label for="show_striked_prices">
						<input <?php checked( $options['show_striked_prices'] ); ?>
								name="show_striked_prices" id="show_striked_prices" type="checkbox">
					</label>
				</fieldset>
			</td>
		</tr>

        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e('Show On Sale badge if product price was modified', 'advanced-dynamic-pricing-for-woocommerce') ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text"><span><?php _e('Show On Sale badge if product price was modified', 'advanced-dynamic-pricing-for-woocommerce') ?></span></legend>
                    <label for="show_onsale_badge">
                        <input <?php checked( $options['show_onsale_badge'] ); ?>
                                name="show_onsale_badge" id="show_onsale_badge" type="checkbox">
                    </label>
                </fieldset>
            </td>
        </tr>

		<tr valign="top">
			<th scope="row" class="titledesc">
				<label for="discount_for_onsale"><?php _e('Apply Discount for "Onsale" products', 'advanced-dynamic-pricing-for-woocommerce') ?></label>
			</th>
			<td class="forminp">
				<select name="discount_for_onsale">
					<option <?php selected( $options['discount_for_onsale'], 'sale_price' ); ?> value="sale_price"><?php _e('Use Sale Price', 'advanced-dynamic-pricing-for-woocommerce') ?></option>
					<option <?php selected( $options['discount_for_onsale'], 'discount_regular' ); ?> value="discount_regular"><?php _e('Discount Regular Price', 'advanced-dynamic-pricing-for-woocommerce')?></option>
					<option <?php selected( $options['discount_for_onsale'], 'discount_sale' ); ?> value="discount_sale"><?php _e('Discount Sale Price', 'advanced-dynamic-pricing-for-woocommerce')?></option>
				</select>
			</td>
		</tr>

        <tr valign="top">
            <th scope="row" class="titledesc">
				<?php _e( 'Combine Miltiple Fixed Discounts', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Combine Miltiple Fixed Discounts', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span>
                    </legend>
                    <label for="combine_discounts">
                        <input <?php checked( $options['combine_discounts'] ) ?>
                                name="combine_discounts" id="combine_discounts" type="checkbox">
                    </label>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e( 'Default Discount Name', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Default Discount Name', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
                    <label for="default_discount_name">
                        <input value="<?php echo $options['default_discount_name'] ?>"
                               name="default_discount_name" id="default_discount_name" type="text">

                    </label>
                    <div>
						<?php _e( 'Fixed discounts with the same name are grouped in the cart.', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                    </div>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e( 'Combine Miltiple Fees', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Combine Miltiple Fees', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
                    <label for="combine_fees">
                        <input <?php checked( $options['combine_fees'] ) ?>
                                name="combine_fees" id="combine_fees" type="checkbox">
                    </label>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e( 'Default Fee Name', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Default Fee Name', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
                    <label for="default_fee_name">
                        <input value="<?php echo $options['default_fee_name'] ?>"
                               name="default_fee_name" id="default_fee_name" type="text">

                    </label>
                    <div>
						<?php _e( 'Fees with the same name are grouped in the cart.', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                    </div>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc">
				<?php _e( 'Cents', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <div>
                        <label for="is_override_cents">
                            <input <?php checked( $options['is_override_cents'] ) ?> name="is_override_cents" id="is_override_cents" type="checkbox">
		                    <?php _e( 'Override the cents on the calculated price.', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                        </label>
                    </div>
                    <div>
                        <label for="prices_ends_with">
		                    <?php _e( 'If selected, prices will end with: ', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
		                    <?php echo ( '0' . wc_get_price_decimal_separator() ) ?>
                            <input value="<?php echo $options['prices_ends_with'] ?>" name="prices_ends_with" id="prices_ends_with" placeholder="99" type="text" maxlength="2" size=3>
                        </label>
                    </div>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc">
				<?php _e( 'Show amount saved in', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <div>
                        <label for="is_show_amount_saved_in_mini_cart">
                            <input <?php checked( $options['is_show_amount_saved_in_mini_cart'] ) ?> name="is_show_amount_saved_in_mini_cart" id="is_show_amount_saved_in_mini_cart" type="checkbox">
							<?php _e( 'Mini cart', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                        </label>
                    </div>
                    <div>
                        <label for="is_show_amount_saved_in_cart">
                            <input <?php checked( $options['is_show_amount_saved_in_cart'] ) ?> name="is_show_amount_saved_in_cart" id="is_show_amount_saved_in_cart" type="checkbox">
		                    <?php _e( 'Cart', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                        </label>
                    </div>
                    <div>
                        <label for="is_show_amount_saved_in_checkout_cart">
                            <input <?php checked( $options['is_show_amount_saved_in_checkout_cart'] ) ?> name="is_show_amount_saved_in_checkout_cart" id="is_show_amount_saved_in_checkout_cart" type="checkbox">
			                <?php _e( 'Checkout cart', 'advanced-dynamic-pricing-for-woocommerce' ) ?>
                        </label>
                    </div>
                </fieldset>
            </td>
        </tr>



        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e( 'Remove all data on uninstall', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Remove all data on uninstall', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
                    <label for="uninstall_remove_data">
                        <input <?php checked( $options['uninstall_remove_data'] ) ?>
                                name="uninstall_remove_data" id="uninstall_remove_data" type="checkbox">
                    </label>
                </fieldset>
            </td>
        </tr>

        <tr valign="top">
            <th scope="row" class="titledesc"><?php _e( 'Apply  pricing rules to backend orders', 'advanced-dynamic-pricing-for-woocommerce' ) ?></th>
            <td class="forminp forminp-checkbox">
                <fieldset>
                    <legend class="screen-reader-text">
                        <span><?php _e( 'Apply  pricing rules to backend orders', 'advanced-dynamic-pricing-for-woocommerce' ) ?></span></legend>
                    <label for="load_in_backend">
                        <input <?php checked( $options['load_in_backend'] ) ?>
                                name="load_in_backend" id="load_in_backend" type="checkbox">
                    </label>
                </fieldset>
            </td>
        </tr>
        
		</tbody>
	</table>

	<p>
		<button type="submit" class="button button-primary" name="save-options"><?php _e('Save Changes', 'advanced-dynamic-pricing-for-woocommerce') ?></button>
	</p>
</form>