<?php
/**
 * Main WPSyncSheets_For_WooCommerce namespace.
 *
 * @since 1.0.0
 * @package wpsyncsheets-woocommerce
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; }
if ( ! class_exists( 'WPSSLW_General_Settings_Pro' ) ) :

	class WPSSLW_General_Settings_Pro extends WPSSLW_Settings {

		/**
		 * Initialization
		 */
		public static function init() {
		}

        public static function wpsslw_woocommerce_admin_wpsslw_general_settings_pro_html() {
         
        ?>

        <!-- Row Background Color -->
		<div class="generalSetting-section">
			<div class="generalSetting-left">
				<input type="hidden" id="wpssw_general_settings" name="wpssw_general_settings" value="03889056a0"><input type="hidden" name="_wp_http_referer" value="/ColorUpdates/wp-admin/admin.php?page=wpsyncsheets-for-woocommerce">
				<h4>
					<span class="wpssw-tooltio-link tooltip-right">
						<?php echo esc_html( 'Row Background Color' ); ?><span class="tooltip-text">Pro</span>
					</span>
				</h4>
				<p><?php echo esc_html( 'The background color of rows is automatically determined based on their respective ID. Alternating colors are assigned to create a visually pleasing and organized appearance.' ); ?></p>
				<div class="bg-color-oddeven disabled-pro-version">
				<input type="color" id="color_code_odd" name="oddcolor" value="#d8e0fd"><label for=""> <?php echo esc_html( 'Odd Rows' ); ?></label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
				<input type="color" id="color_code_even" name="evencolor" value="#ebd6ff"><label for=""> <?php echo esc_html( 'Even Rows' ); ?></label>
				</div>
			</div>
			<div class="generalSetting-right disabled-pro-version">				
				<label for="">
					<input name="color_code" id="color_code" type="checkbox" class="" value="1"><span class="checkbox-switch"></span>
				</label>
			</div>
		</div>
		
		<!-- Row Input Format Option -->
		 <div class="generalSetting-section">
			<div class="generalSetting-left">
				<h4>
					<span class="wpssw-tooltio-link tooltip-right">
						<?php echo esc_html( 'Row Input Format Option' ); ?><span class="tooltip-text">Pro</span>
					</span>
				</h4>
				<p><?php echo esc_html( 'This option allows you to specify how the input data should be interpreted. For further information, refer to the provided Link for more details,' ); ?><a href="https://developers.google.com/sheets/api/reference/rest/v4/ValueInputOption" target="_blank"><?php echo esc_html( ' click here.' ); ?></a></p>
			</div>
			<div class="generalSetting-right disabled-pro-version">
				<select name="inputoption">
					<option value="USER_ENTERED" selected=""><?php echo esc_html( 'USER ENTERED' ); ?></option>
					<option value="RAW"><?php echo esc_html( 'RAW' ); ?></option>
				</select>					
			</div>
		</div>

		<!-- Price Format -->
		 <div class="generalSetting-section price-format-section">
			<div class="generalSetting-left">
				<h4>
					<span class="wpssw-tooltio-link tooltip-right">
						<?php echo esc_html( 'Price Format' ); ?><span class="tooltip-text">Pro</span>
					</span>
				</h4>
				<p><?php echo esc_html( 'Customize the format for displaying price values. If you choose the "Values with Symbol" option, a symbol will be appended to the price values, while the "Values" option will retain the entered values as they are.' ); ?></p>
			</div>
			<div class="generalSetting-right disabled-pro-version">
				<select name="wpssw_price_format">
					<option value="plain" selected=""><?php echo esc_html( 'Only Values' ); ?></option>
					<option value="formatted"><?php echo esc_html( 'Values with Symbol' ); ?></option>
				</select>					
			</div>
		</div>

        <!-- Graph Sheets -->
        <div class="generalSetting-section graphSheets-section">
			<div class="generalSetting-left">
				<h4>
					<span class="wpssw-tooltio-link tooltip-right">
						<?php echo esc_html( 'Graph Sheets' ); ?><span class="tooltip-text">Pro</span>
					</span>
				</h4>
				<p><?php echo esc_html( 'With the settings provided, Google Spreadsheet will automatically generate graph sheets according to your preferences. Clicking the "Regenerate" button will create a new graph with the latest data, keeping your visuals up-to-date.' ); ?></p>
				<div class="wpssw-section-6 form-table graph_spreadsheet_row">

					<?php 
					$graphs = array(
						array('label' => 'Sales Orders', 'id' => 'sales_orders_graph', 'type_name' => 'sales', 'default_radio' => 'line'),
						array('label' => 'Total Orders', 'id' => 'total_orders_graph', 'type_name' => 'total', 'default_radio' => 'column'),
						array('label' => 'Products Sold', 'id' => 'products_sold_graph', 'type_name' => 'product', 'default_radio' => 'pie'),
						array('label' => 'Total Customers', 'id' => 'total_customers_graph', 'type_name' => 'customers', 'default_radio' => 'column'),
						array('label' => 'Total Used Coupons', 'id' => 'total_used_coupons_graph', 'type_name' => 'used-coupons', 'default_radio' => 'line'),
					);

					foreach ( $graphs as $graph ) :
					?>
					<div class="graphSheets-box disabled-pro-version">
						<div class="titledesc">
							<div class="graph-header">
								<label><?php echo esc_html( $graph['label'] ); ?></label>
								<div class="forminp forminp-checkbox inside-checkbox disabled-pro-version">  
									<label for="">
										<input name="graphsheets_list[]" id="<?php echo esc_attr( $graph['id'] ); ?>" type="checkbox" class="<?php echo esc_attr( $graph['type_name'] ); ?>" value="<?php echo esc_attr( $graph['id'] ); ?>"><span class="checkbox-switch-new"></span> 							
									</label>
								</div>
							</div>
						</div>
						<div class="graph-img <?php echo esc_attr( $graph['type_name'] ); ?>-tdclass">
							<?php 
							$types = array('column','line','pie');
							foreach($types as $type) : 
							?>
							<label>
								<input type="radio" name="<?php echo esc_attr( $graph['type_name'] . '_graph_type' ); ?>" value="<?php echo esc_attr( $type ); ?>" class="graph-radio-button" <?php echo ($type === $graph['default_radio']) ? 'checked' : ''; ?> required="">
								<span class="graph_type_radio">
									<img src="<?php echo esc_url( WPSSLW_URL . 'assets/images/' . $type . '_chart.png' ); ?>">
								</span>
							</label>
							<?php endforeach; ?>
						</div>
						<div class="graph-regenerateBtn <?php echo esc_attr( $graph['type_name'] ); ?>-tdclass">  	
							<a href="javascript:void(0)" id="regenerate_<?php echo esc_attr( str_replace(' ','_',$graph['type_name']) ); ?>_graph" class="graph-regenerate wpssw-button "><?php echo esc_html( 'Regenerate' ); ?> </a>
							<img src="images/spinner.gif" id="<?php echo esc_attr( $graph['type_name'] ); ?>_chartloader" class="chartloader">			
						</div>
					</div>
					<?php endforeach; ?>

				</div>
			</div>
			<div class="generalSetting-right disabled-pro-version">				
				<label for="">
					<input name="graph_sheet" id="graph_sheet" type="checkbox" class="" value="yes"><span class="checkbox-switch"></span>
				</label>
			</div>
		</div>

        <?php
        }

    }

WPSSLW_General_Settings_Pro::init();
endif;