<?php 
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}

global $wpdb, $table_fbbttm_setting, $fbbttm_result,$fbbttm_helperobj,$fbbttm_ajaxurl;

$table_fbbttm_setting = $wpdb->prefix . 'fbbttm_setting';

$id = '';
//phpcs:disable WordPress.DB.DirectDatabaseQuery.DirectQuery
	//phpcs:disable WordPress.DB.DirectDatabaseQuery.NoCaching
$query = $wpdb->prepare(
	//phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared  
	"SELECT * FROM $table_fbbttm_setting where fbbttm_setting_id != %d ORDER BY fbbttm_setting_id DESC LIMIT 50",$id);

$fbbttm_result = $wpdb->get_results(
	//phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared 
	$query, ARRAY_A);



?>
	
<main class="fbbttm-main fbbttm-main-listing-container fbbttm-default-box" id="all-page-main-container">
<div class="fbbttm-details-tbl-wraper foodboxbooker-settingform">
<h2 class="fbbttm-page-heading"><?php echo esc_html__( 'Settings', 'foodboxbooker' )?></h2>

<div class="fbbttm-sec-top">

	<ul id="fbbttm-tab">
		<li class="nav-item active">
          <a class="nav-link" href="#fbbttm_content1"><i class="fa fa-cog"></i> <?php echo esc_html__( 'General Setting', 'foodboxbooker' )?></a>
        </li>
		<li class="nav-item">
          <a class="nav-link" href="#fbbttm_content2"><i class="fa fa-money"></i> <?php echo esc_html__( 'Payments Setting', 'foodboxbooker' )?></a>
        </li>
		
		<li class="nav-item">
          <a class="nav-link" href="#fbbttm_content4"><i class="fa fa-envelope-o"></i> <?php echo esc_html__( 'Email Setting', 'foodboxbooker' )?></a>
        </li>
		
        <li class="nav-item">
          <a class="nav-link" href="#fbbttm_content6"><i class="fa fa-cog"></i> <?php echo esc_html__( 'Advance Setting', 'foodboxbooker' )?></a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#fbbttm_content7"><i class="fa fa-cog"></i> <?php echo esc_html__( 'Color Setting', 'foodboxbooker' )?></a>
        </li>
	</ul>
	<div class="tab-content">
	<div class="fbbttm-form-field fbbttm-tab-button"> 
	<input type="submit" name="submit" id="submitsetting" value="<?php echo esc_html__('Save','foodboxbooker');?>" class="fbbttm-button button-top-sp"/> 
</div>
<?php


$fbbttm_settingdata = array();
for($i=0;$i<count($fbbttm_result);$i++)
{

	$key = $fbbttm_result[$i]['fbbttm_setting_name'];
	$value = $fbbttm_result[$i]['fbbttm_setting_value'];
	$fbbttm_settingdata[$key] = $value;

}


//foreach($fbbttm_result as $fbbttm_resultdata){
?>



<section id="fbbttm_content1" class="fbbttm_content foodboxbooker-form" name ="genral_settings">

<div class="row">
	<h3><?php echo esc_html__('Store Address','foodboxbooker');?></h3>
	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_name"><?php echo esc_html__( 'Your Restaurant Name', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_name" id="fbbttm_restaurant_name" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_name'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_name']); else echo '';  ?>" placeholder="Ex. Food Plazza">
	</div> 

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_address"><?php echo esc_html__( 'Your Address line 1', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_address" id="fbbttm_restaurant_address" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_address'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_address']); else echo '';  ?>" placeholder="Ex. 1234 NW Bobcat Lane, St. Robert">
	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_address"><?php echo esc_html__( 'Your Address line 2', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_address2" id="fbbttm_restaurant_address2" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_address2'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_address2']); else echo '';  ?>" placeholder="Ex. 1234 NW Bobcat Lane, St. Robert">
	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_address"><?php echo esc_html__( 'City', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_city" id="fbbttm_restaurant_city" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_city'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_city']); else echo '';  ?>" placeholder="">
	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_country"><?php echo esc_html__( 'Country', 'foodboxbooker' )?></label> 

	 <?php 
	  				$counries = $fbbttm_helperobj->fbbttm_comman_single_tableinfo(FBBTTM_COUNTRIES,'id');

	  				$stateid = $country = '';
	  				
	  				if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_country']))
	  				{
	  					$country =$fbbttm_settingdata['fbbttm_restaurant_country'];
	  				}
	  				if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_state']))
	  				{
	  					$stateid =$fbbttm_settingdata['fbbttm_restaurant_state'];
	  				}

	  ?>
	
	<select name="fbbttm_restaurant_country" id="fbbttm_restaurant_country">
		<option><?php echo esc_html__('Select country','foodboxbooker');?></option>
			 	<?php foreach($counries as $countdata ){

			 		$selectdrop = ($countdata->id == $country) ? 'selected="selected"': '';

			 		?>
			 		<option value="<?php echo esc_html($countdata->id);?>" data-attr="<?php echo esc_html($countdata->shortname);?>" <?php echo esc_html($selectdrop);?>>
			 			<?php echo esc_html($countdata->name);?></option>
			 		<?php
			 	} ?>
	</select>
	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_state"><?php echo esc_html__( 'State', 'foodboxbooker' )?></label> 
	<input type="hidden" name="fbbttm-hiddencid" id="fbbttm-hiddencid" value="<?php echo esc_html($stateid);?>">
	<select name="fbbttm_restaurant_state" id="fbbttm_restaurant_state"></select>
	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_address"><?php echo esc_html__( 'Postcode / ZIP', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_zipcode" id="fbbttm_restaurant_zipcode" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_zipcode'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_zipcode']); else echo '';  ?>" placeholder="Ex. 12345">
	</div>
<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="fbbttm_restaurant_address"><?php echo esc_html__( 'Phone', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_restaurant_phone" id="fbbttm_restaurant_phone" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_restaurant_phone'])) echo esc_html($fbbttm_settingdata['fbbttm_restaurant_phone']); else echo '';  ?>" placeholder="Ex. 1234567890">
	</div>
	


	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="currency"><?php echo esc_html__( 'Currency', 'foodboxbooker' )?></label> 

	<!-- FBBTTM_CURRENCIES -->

	<?php

		$currency = $fbbttm_helperobj->fbbttm_comman_single_tableinfo(FBBTTM_CURRENCIES,'id');

		$selcurrency = '';

		if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_pay_currency']))
		{
			$selcurrency  = $fbbttm_settingdata['fbbttm_pay_currency'];
		}

	?>


	<select name="fbbttm_pay_currency" id="fbbttm_pay_currency">
		<option><?php echo esc_html__('Select currency','foodboxbooker');?></option>
			 	<?php foreach($currency as $currencydata ){

			 		$selectdrop = ($currencydata->code == $selcurrency) ? 'selected="selected"': '';

			 		?>
			 		<option value="<?php echo esc_html($currencydata->code);?>" data-attr="<?php echo esc_html($currencydata->name);?>" <?php echo esc_html($selectdrop);?>>
			 			<?php echo esc_html($currencydata->name);?></option>
			 		<?php
			 	} ?>
	</select>



	</div>

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="tax_per"><?php echo esc_html__( 'Tax on total price', 'foodboxbooker' )?></label> 
	<input type="number" name="fbbttm_tax_per" id="fbbttm_tax_per" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_tax_per'])) echo esc_html($fbbttm_settingdata['fbbttm_tax_per']); else echo '';  ?>" placeholder="Ex. 10, 20">
	<p><?php echo esc_html__('This value will be calculated on the cart and checkout pages based on the total price.','foodboxbooker');?></p>
	</div> 

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="vat_gst_tin"><?php echo esc_html__( 'VAT/GST/TIN Number', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_vat_gst_tin" id="fbbttm_vat_gst_tin" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_vat_gst_tin'])) echo esc_attr($fbbttm_settingdata['fbbttm_vat_gst_tin']); else echo '';  ?>" placeholder="22AAAAA0000A1Z5">
	</div> 

</div>


</section>
<section id="fbbttm_content2" class="fbbttm_content foodboxbooker-form" name ="payment_settings">

<div class="row">

	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12 "> 
	<label for="website"><?php echo esc_html__( 'Stripe Payment', 'foodboxbooker' )?></label> 
	<div class="fbbttm-form-field-radio">
	    

	    <?php 

		$option1Selected = $option2Selected ='';

	    //if(!empty($fbbttm_setting_name) && $fbbttm_setting_name=='fbbttm_stripe_method_status') 
	    if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_stripe_method_status']))	
	   		{
	   		
	   		   $option1Selected = ($fbbttm_settingdata['fbbttm_stripe_method_status'] === 'yes') ? 'checked' : '';
        		$option2Selected = ($fbbttm_settingdata['fbbttm_stripe_method_status'] === 'no') ? 'checked' : '';
	   		} 

		
		?>
		<input type="radio" <?php echo esc_attr($option1Selected); ?> name="fbbttm_stripe_method_status" id="fbbttm_stripe_method_status" value="yes" disabled="disabled"/>
		<label for="fbbttm_s_local"><?php echo esc_html__( 'Enable', 'foodboxbooker' )?></label>
		<input type="radio" <?php echo esc_attr($option2Selected); ?> name="fbbttm_stripe_method_status" id="fbbttm_stripe_method_status" value="no" disabled="disabled"/>
		<label for="fbbttm_s_paypal"><?php echo esc_html__( 'Disable', 'foodboxbooker' );?></label>


	</div> 
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 


	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'Stripe API Key', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_stripe_api" id="fbbttm_stripe_api" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_stripe_api'])) echo esc_attr($fbbttm_settingdata['fbbttm_stripe_api']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 

	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'Stripe Secret Key', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_stripe_scretkey" id="fbbttm_stripe_scretkey" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_stripe_scretkey'])) echo esc_attr($fbbttm_settingdata['fbbttm_stripe_scretkey']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 


<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12 "> 
	<label for="website"><?php echo esc_html__( 'Paypal Payment', 'foodboxbooker' )?></label> 
	<div class="fbbttm-form-field-radio">
	  <?php 
		  $option3Selected = $option4Selected ='';
		
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_paypal_method_status'])){
				$option3Selected = ($fbbttm_settingdata['fbbttm_paypal_method_status'] === 'yes') ? 'checked' : '';
	        	$option4Selected = ($fbbttm_settingdata['fbbttm_paypal_method_status'] === 'no') ? 'checked' : '';
			}
		?>
		<input type="radio" <?php echo esc_attr($option3Selected); ?> name="fbbttm_paypal_method_status" id="fbbttm_stripe_method_status" value="yes" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_local"><?php echo esc_html__( 'Enable', 'foodboxbooker' )?></label>
		<input type="radio" <?php echo esc_attr($option4Selected); ?> name="fbbttm_paypal_method_status" id="fbbttm_stripe_method_status" value="no" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_paypal"><?php echo esc_html__( 'Disable', 'foodboxbooker' )?></label>
	</div> 
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12 hidden"> 
	<label for="website"><?php echo esc_html__( 'Select Payment', 'foodboxbooker' )?></label> 
	<div class="fbbttm-form-field-radio">
	  <?php 
		  $option1Selected = $option2Selected = '';
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_payment_select'])){	
				$option1Selected = ($fbbttm_settingdata['fbbttm_payment_select'] === 'paylater') ? 'checked' : '';
	        	$option2Selected = ($fbbttm_settingdata['fbbttm_payment_select'] === 'paypal') ? 'checked' : '';
			}
		?>
		<input type="radio" <?php echo esc_attr($option1Selected); ?> name="fbbttm_payment_select" id="fbbttm_payment_select" value="<?php echo esc_html__( 'paylater', 'foodboxbooker' )?>" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_local"><?php echo esc_html__( 'Pay Later', 'foodboxbooker' )?></label>
		<input type="radio" <?php echo esc_attr($option2Selected); ?> name="fbbttm_payment_select" id="fbbttm_payment_select" value="<?php echo esc_html__( 'paypal', 'foodboxbooker' )?>" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_paypal"><?php echo esc_html__( 'Paypal', 'foodboxbooker' )?></label>
	</div> 
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'PaypPal Id', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_paypalid" id="fbbttm_s_paypalid" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_paypalid'])) echo esc_html($fbbttm_settingdata['fbbttm_paypalid']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'PaypPal API', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_paypalapi" id="fbbttm_s_paypalapi" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_paypalapi'])) echo esc_html($fbbttm_settingdata['fbbttm_paypalapi']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'PayPal Merchant Email', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_payment_email" id="fbbttm_s_paymentemail" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_payment_email'])) echo esc_html($fbbttm_settingdata['fbbttm_payment_email']); else echo '';  ?>">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
	<label for="firstname"><?php echo esc_html__( 'PayPal API Username', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_api_username" id="fbbttm_s_apiusername" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_api_username'])) echo esc_html($fbbttm_settingdata['fbbttm_api_username']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
	<label for="website"><?php echo esc_html__( 'PayPal Payment Mode', 'foodboxbooker' )?></label> 
	<?php
	$option3Selected = $option4Selected =''; 
	if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_payment_mode']))
	{
		$option3Selected = ($fbbttm_settingdata['fbbttm_payment_mode'] === 'sandbox') ? 'checked' : '';
        $option4Selected = ($fbbttm_settingdata['fbbttm_payment_mode'] === 'live') ? 'checked' : '';
	}
		?>
	<div class="fbbttm-form-field-radio">
		<input type="radio" <?php echo esc_attr($option3Selected); ?> checked name="fbbttm_payment_mode" id="fbbttm_payment_mode" value="sandbox" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_sandbox"><?php echo esc_html__( 'Sandbox', 'foodboxbooker' )?></label>
		<input type="radio" <?php echo esc_html($option4Selected); ?> name="fbbttm_payment_mode" id="fbbttm_payment_mode" value="live" disabled="disabled" readonly="readonly"/>
		<label for="fbbttm_s_live"><?php echo esc_html__( 'Live', 'foodboxbooker' )?></label>
	</div> 
<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>


	</div> 
	
</div>


</section>



<section id="fbbttm_content4" class="fbbttm_content foodboxbooker-form" name ="email_settings">

<div class="row">
	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12 hidden"> 
	<label for="sendername"><?php echo esc_html__( 'Sender Name', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_s_sendername" id="fbbttm_s_sendername" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_s_sendername'])) echo esc_html($fbbttm_settingdata['fbbttm_s_sendername']); else echo '';  ?>" disabled="disabled" readonly="readonly">

	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-12 col-sm-12 hidden"> 
	<label for="fbbttm_s_sendermail"><?php echo esc_html__( 'Sender email', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_s_sendermail" id="fbbttm_s_sendermail" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_s_sendermail'])) echo esc_html($fbbttm_settingdata['fbbttm_s_sendermail']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
	<label for="fbbttm_s_adminmail"><?php echo esc_html__( 'Admin email', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_s_adminmail" id="fbbttm_s_adminmail" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_s_adminmail'])) echo esc_html($fbbttm_settingdata['fbbttm_s_adminmail']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<p><?php echo esc_html__( 'You will receive a new order notification in this email.', 'foodboxbooker' )?></p>
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div> 
	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12 hidden"> 
	<label for="subject"><?php echo esc_html__( 'Email Subject', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_s_subject" id="fbbttm_s_subject" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_s_subject'])) echo esc_attr($fbbttm_settingdata['fbbttm_s_subject']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	</div>  


	<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
	<label for="subject"><?php echo esc_html__( 'Email Header Image', 'foodboxbooker' )?></label> 
	<input type="text" name="fbbttm_email_header_image" id="fbbttm_email_header_image" class="form_data" value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_email_header_image'])) echo esc_attr($fbbttm_settingdata['fbbttm_email_header_image']); else echo '';  ?>" disabled="disabled" readonly="readonly">
	<p><?php echo esc_html__( 'Paste the URL of an image you want to show in the email header. Upload images using the media uploader (Media > Add New). ', 'foodboxbooker' )?></p>
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
	</div>  
</div>

</section>




<section id="fbbttm_content6" class="fbbttm_content foodboxbooker-form" name ="advance_settings">

	<div class="row">
		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 
			<label for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Fbbttm shop', 'foodboxbooker' )?></label> 
			<?php 
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_shop_page']))	
			{
				$option_value = $fbbttm_settingdata['fbbttm_shop_page']; 
			}else {
				$option_value = get_option( 'fbbttm_fbbttm-shop_page_id' );
			}

	
				$args = array(
				    'post_type' => 'page',
				    'post_status' => 'publish',
				    'posts_per_page' => -1,
				);

				// the query
				$the_query = new WP_Query( $args ); ?>
				

			<select name="fbbttm_shop_page"  id="fbbttm_shop_page">
				<option></option>
					<?php if ( $the_query->have_posts() ) : ?>
				    <!-- the loop -->
				    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
				    	$selected = '';
				    	if($option_value == get_the_id())
				    	{
				    		$selected = 'selected';
				    	}

				    ?>
				    	<option value="<?php echo esc_html(get_the_id());?>" <?php echo esc_html($selected);?>><?php the_title(); ?></option>
				   	<?php endwhile; ?>
				   	 	<!-- end of the loop -->
				   		<?php wp_reset_postdata(); ?>
				    <?php endif; ?>
			</select>
		</div>


	</div>


	<div class="row">
		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 

			<label for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Fbbttm Cart', 'foodboxbooker' )?></label> 

			<?php 

			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_cart_page']))			
			{

				$option_value = $fbbttm_settingdata['fbbttm_cart_page']; 

			}else {

				$option_value = get_option( 'fbbttm_fbbttm-cart_page_id' );
			}

				$args = array(
				    'post_type' => 'page',
				   'post_status' => 'publish',
				    'posts_per_page' => -1,
				);

				// the query
				$the_query = new WP_Query( $args ); ?>
				

			<select name="fbbttm_cart_page"  id="fbbttm_cart_page">
				<option></option>
				<?php if ( $the_query->have_posts() ) : ?>
				    <!-- the loop -->
				    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
				    	$selected = '';
				    	if($option_value == get_the_id())
				    	{
				    		$selected = 'selected';
				    	}

				     ?>
				    	<option value="<?php echo esc_html(get_the_id());?>" <?php echo esc_html($selected);?>><?php the_title(); ?></option>
				    	 <?php endwhile; ?>
				    <!-- end of the loop -->
				    <?php wp_reset_postdata(); ?>

				    <?php endif; ?>
			</select>
		</div>


	</div>



<div class="row">
		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 

			<label for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Fbbttm Checkout', 'foodboxbooker' )?></label> 

			<?php 

			//if(!empty($fbbttm_setting_name) && $fbbttm_setting_name == 'fbbttm_checkout_page')
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_checkout_page']))		
			{

				$option_value = $fbbttm_settingdata['fbbttm_checkout_page']; 

			}else {

				$option_value = get_option( 'fbbttm_fbbttm-checkout_page_id' );
			}
				$args = array(
				    'post_type' => 'page',
				   'post_status' => 'publish',
				    'posts_per_page' => -1,
				);

				// the query
				$the_query = new WP_Query( $args ); ?>
				

			<select name="fbbttm_checkout_page"  id="fbbttm_checkout_page">
				<option></option>
				<?php if ( $the_query->have_posts() ) : ?>
				    <!-- the loop -->
				    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
				    	$selected = '';
				    	if($option_value == get_the_id())
				    	{
				    		$selected = 'selected';
				    	}

				     ?>
				    	<option value="<?php echo esc_html(get_the_id());?>" <?php echo esc_html($selected);?>><?php the_title(); ?></option>
				    	 <?php endwhile; ?>
				    <!-- end of the loop -->
				    <?php wp_reset_postdata(); ?>

				    <?php endif; ?>
			</select>
		</div>


	</div>



<div class="row">
		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 

			<label for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Fbbttm Myaccount', 'foodboxbooker' )?></label> 

			<?php 

			//if(!empty($fbbttm_setting_name) && $fbbttm_setting_name == 'fbbttm_myaccount_page')
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_myaccount_page']))			
			{

				$option_value = $fbbttm_settingdata['fbbttm_myaccount_page']; 

			}else {

				$option_value = get_option( 'fbbttm_fbbttm-myaccount_page_id' );
			}
				$args = array(
				    'post_type' => 'page',
				    'post_status' => 'publish',
				    'posts_per_page' => -1,
				);

				// the query
				$the_query = new WP_Query( $args ); ?>
				

			<select name="fbbttm_myaccount_page"  id="fbbttm_myaccount_page">
				<option></option>
				<?php if ( $the_query->have_posts() ) : ?>
				    <!-- the loop -->
				    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
				    	$selected = '';
				    	if($option_value == get_the_id())
				    	{
				    		$selected = 'selected';
				    	}

				     ?>
				    	<option value="<?php echo esc_html(get_the_id());?>" <?php echo esc_html($selected);?>><?php the_title(); ?></option>
				    	 <?php endwhile; ?>
				    <!-- end of the loop -->
				    <?php wp_reset_postdata(); ?>

				    <?php endif; ?>
			</select>
		</div>


	</div>


<div class="row">
		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12"> 

			<label for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Fbbttm Order Confirm', 'foodboxbooker' )?></label> 

			<?php 

			//if(!empty($fbbttm_setting_name) && $fbbttm_setting_name == 'fbbttm_order_received')
			if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_order_received']))
			{

				$option_value = $fbbttm_settingdata['fbbttm_order_received']; 

			}else {

				$option_value = get_option( 'fbbttm_fbbttm-order-received_page_id' );
			}
				$args = array(
				    'post_type' => 'page',
				    'post_status' => array( 'publish' )
				);

				// the query
				$the_query = new WP_Query( $args ); ?>
				

			<select name="fbbttm_order_received"  id="fbbttm_order_received">
				<option></option>
				<?php if ( $the_query->have_posts() ) : ?>
				    <!-- the loop -->
				    <?php while ( $the_query->have_posts() ) : $the_query->the_post();
				    	$selected = '';
				    	if($option_value == get_the_id())
				    	{
				    		$selected = 'selected';
				    	}

				     ?>
				    	<option value="<?php echo esc_html(get_the_id());?>" <?php echo esc_attr($selected);?>><?php the_title(); ?></option>
				    	 <?php endwhile; ?>
				    <!-- end of the loop -->
				    <?php wp_reset_postdata(); ?>

				    <?php endif; ?>
			</select>
		</div>


	</div>



</section>

<section id="fbbttm_content7" class="fbbttm_content foodboxbooker-form " name="genral_settings">
	<div class="row">
	  <h2 for="fbbttm_s_wp_phnumber"><?php echo esc_html__( 'Color option', 'foodboxbooker' )?></h2>

		<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12">

			<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12 "> 
			<label for="Color option"><?php echo esc_html__( 'Color option', 'foodboxbooker' )?></label> 
			<div class="fbbttm-form-field-radio">
			    <?php 
			    $option3Selected = $option4Selected ='';
			
				if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_color_option_status'])){
					$option3Selected = ($fbbttm_settingdata['fbbttm_color_option_status'] === 'yes') ? 'checked' : '';
		        	$option4Selected = ($fbbttm_settingdata['fbbttm_color_option_status'] === 'no') ? 'checked' : '';
				}
				?>
				<input type="radio" <?php echo esc_attr($option3Selected); ?> name="fbbttm_color_option_status" id="fbbttm_color_option_status" value="yes" readonly="readonly" disabled="disabled"/>
				<label for="fbbttm_s_local"><?php echo esc_html__( 'Enable', 'foodboxbooker' )?></label>
				<input type="radio" <?php echo esc_attr($option4Selected); ?> name="fbbttm_color_option_status" id="fbbttm_color_option_status" value="no" readonly="readonly" disabled="disabled" />
				<label for="fbbttm_s_paypal"><?php echo esc_html__( 'Disable', 'foodboxbooker' )?></label>
			</div> 
			<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
			</div> 


			<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12">

				<label for="fbbttm_button_text_color"><?php echo esc_html__( 'Button text color', 'foodboxbooker' )?></label> 

 				<input type="text" name="fbbttm_button_text_color" id="fbbttm_button_text_color" class="form_data fbbttm-color-field"  value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_button_text_color'])) echo esc_html($fbbttm_settingdata['fbbttm_button_text_color']); else echo '';  ?>"  readonly="readonly" disabled="disabled" >
	<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
			</div> 


			<div class="fbbttm-form-field col-lg-12 col-md-6 col-sm-12">

				<label for="fbbttm_button_text_color"><?php echo esc_html__( 'Button background color', 'foodboxbooker' )?></label> 

 				<input type="text" name="fbbttm_button_bg_color" id="fbbttm_button_bg_color" class="form_data fbbttm-color-field"  value="<?php if(!empty($fbbttm_settingdata) && isset($fbbttm_settingdata['fbbttm_button_bg_color'])) echo esc_attr($fbbttm_settingdata['fbbttm_button_bg_color']); else echo '';  ?>"  readonly="readonly" disabled="disabled" >
 				<div class="extensionsValid"><?php echo esc_html__( 'Paid plan subscription required', 'foodboxbooker' );?></div>
 			<?php			// Noncename needed to verify where the data originated
		wp_nonce_field( 'fbbttm_meta_box_nonce', 'fbbttm_meta_box_noncename' );
		?>
			</div> 

		</div> 

	</div>
</section>
<?php //}?>
<input type="hidden" name="hidnajaxurl" id="hidnajaxurl" value="<?php echo esc_url(FBBTTM_URL)."/main/fbbttm-setting-insert.php"; ?>">
</div>
</div>
</div>
<div id="result" class="fbbttm_success" style="display:none"></div>
</main>
