Exemple #1
0
function web_invoice_currency_minor($currency_code)
{
    $currency = web_invoice_currency_array();
    if (isset($currency[$currency_code]) && isset($currency[$currency_code][1])) {
        return intval($currency[$currency_code][1]);
    }
    return 2;
}
Exemple #2
0
function web_invoice_show_settings()
{
    global $wpdb;
    if (isset($_POST['web_invoice_billing_meta'])) {
        $web_invoice_billing_meta = explode('
	', $_POST['web_invoice_billing_meta']);
        $web_invoice_billing_meta = web_invoice_fix_billing_meta_array($web_invoice_billing_meta);
        update_option('web_invoice_billing_meta', urlencode(serialize($web_invoice_billing_meta)));
    }
    if (get_option('web_invoice_billing_meta') != '') {
        $web_invoice_billing_meta = unserialize(urldecode(get_option('web_invoice_billing_meta')));
    }
    if (!$wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('meta') . "';") || !$wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('main') . "';") || !$wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('log') . "';") || !$wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('payment') . "';") || !$wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('payment_meta') . "';")) {
        $warning_message = "The plugin database tables are gone, deactivate and reactivate plugin to re-create them.";
    }
    if ($warning_message) {
        echo "<div id=\"message\" class='error' ><p>{$warning_message}</p></div>";
    }
    ?>
<h2><?php 
    _e("Web Invoice Settings", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h2>
<form method="POST">
<div id="web_invoice_settings_tab_pane" class="web_invoice_tab_pane">
	<ul>
		<li><a href="#web_invoice_settings_tab_main_pane"><span>Main</span></a></li>
		<li><a href="#web_invoice_settings_tab_business_pane"><span>Business</span></a></li>
		<li><a href="#web_invoice_settings_tab_display_pane"><span>Display</span></a></li>
		<li><a href="#web_invoice_settings_tab_currency_pane"><span>Currency</span></a></li>
		<li><a href="#web_invoice_settings_tab_payment_methods_pane"><span>Payment Methods</span></a></li>
	</ul>
<iframe
	src="https://secure.mohanjith.com/wp/web-invoice.php"
	style="float: right; width: 187px; height: 220px; z-index: 100;"></iframe>
<div id="web_invoice_settings_tab_main_pane">
<table class="form-table" id="settings_page_table" style="clear: left;">
	<tr>
		<td colspan="2">
		<h3><?php 
    _e("Main Settings:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h3>
		</td>
	</tr>
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Select the page where your invoices will be displayed. Clients must follow their secured link, simply opening the page will not show any invoices.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Page to Display Invoices", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name='web_invoice_web_invoice_page'>
			<option></option>
			<?php 
    $list_pages = $wpdb->get_results("SELECT ID, post_title, post_name, guid FROM " . $wpdb->prefix . "posts WHERE post_status = 'publish' AND post_type = 'page' ORDER BY post_title");
    $web_invoice_web_invoice_page = get_option('web_invoice_web_invoice_page');
    foreach ($list_pages as $page) {
        echo "<option  style='padding-right: 10px;'";
        if (isset($web_invoice_web_invoice_page) && $web_invoice_web_invoice_page == $page->ID) {
            echo " SELECTED ";
        }
        echo " value=\"" . $page->ID . "\">" . $page->post_title . "</option>\n";
    }
    ?>
</select></td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("If your website has an SSL certificate and you want to use it, the link to the invoice will be formatted for https.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Protocol to Use for Invoice URLs", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_protocol">
			<option></option>
			<option style="padding-right: 10px;" value="https"
			<?php 
    if (get_option('web_invoice_protocol') == 'https') {
        echo 'selected="yes"';
    }
    ?>
>https</option>
			<option style="padding-right: 10px;" value="http"
			<?php 
    if (get_option('web_invoice_protocol') == 'http') {
        echo 'selected="yes"';
    }
    ?>
>http</option>
		</select></td>
	</tr>
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("If enforced, WordPress will automatically reload the invoice page into HTTPS mode even if the user attemps to open it in non-secure mode.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Enforce HTTPS", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_force_https">
			<option></option>
			<option value="true" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_force_https') == 'true') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="false" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_force_https') == 'false') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("No", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select> <a href="http://mohanjith.com/ssl-certificates.html"
			class="web_invoice_click_me"><?php 
    _e("Do you need an SSL Certificate?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
		<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("An email will be sent automatically to client thanking them for their payment.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Send Payment Confirmation", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_send_thank_you_email">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_send_thank_you_email') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_send_thank_you_email') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Send a copy of email sent to client thanking them to you.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("CC Payment Confirmation", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>

		<td><select name="web_invoice_cc_thank_you_email">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_cc_thank_you_email') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;" value="no"
			<?php 
    if (get_option('web_invoice_cc_thank_you_email') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Redirect to new invoice page after adding user.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Redirect after adding user", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>

		<td><select name="web_invoice_redirect_after_user_add">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_redirect_after_user_add') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;" value="no"
			<?php 
    if (get_option('web_invoice_redirect_after_user_add') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>


	<tr>
		<th><?php 
    _e("User Level to Manage web-invoice", WEB_INVOICE_TRANS_DOMAIN);
    ?>
:</th>
		<td><select name="web_invoice_user_level[]" id="web_invoice_user_level" size="3" multiple="multiple" >
		<?php 
    foreach (get_editable_roles() as $role => $details) {
        $name = translate_user_role($details['name']);
        ?>
			<option value="<?php 
        print $role;
        ?>
" style="padding-right: 10px;"
			<?php 
        if (in_array($role, get_option('web_invoice_user_level', array('administrator')))) {
            echo 'selected="yes"';
        }
        ?>
><?php 
        _e($name, WEB_INVOICE_TRANS_DOMAIN);
        ?>
</option>

		<?php 
    }
    ?>
		</select>
		</td>
	</tr>
	
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Allow users not allowed to manage web-invoice to create invoices for self from templates with no access to the admin dashboard. Anonymous users are not allowed to create any invoices.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			><?php 
    _e("Allow users to create invoices for self", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>

		<td>
			<select name="web_invoice_self_generate_from_template" id="web_invoice_self_generate_from_template" >
				<option></option>
				<option style="padding-right: 10px;" value="yes"
				<?php 
    if (get_option('web_invoice_self_generate_from_template') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
				<option style="padding-right: 10px;" value="no"
				<?php 
    if (get_option('web_invoice_self_generate_from_template') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			</select>
		</td>
	</tr>
	
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Your clients will be allowed to settle an invoice in installments. Experimental feature, only some payment methods are supported.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			><?php 
    _e("Allow partial payments", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>

		<td>
			<select name="web_invoice_partial_payments" id="web_invoice_partial_payments" >
				<option></option>
				<option style="padding-right: 10px;" value="yes"
				<?php 
    if (get_option('web_invoice_partial_payments') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
				<option style="padding-right: 10px;" value="no"
				<?php 
    if (get_option('web_invoice_partial_payments') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			</select>
		</td>
	</tr>
	
	<tr>
		<th width="200"><?php 
    _e("Number of taxes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_tax_count" type="text"
			class="input_field"
			value="<?php 
    echo stripslashes(get_option('web_invoice_tax_count'));
    ?>
" size="3" />
		</td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Special proxy must be used to process credit card transactions on GoDaddy servers.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Using Godaddy Hosting", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><?php 
    echo web_invoice_draw_select('web_invoice_using_godaddy', array("yes" => __("Yes", WEB_INVOICE_TRANS_DOMAIN), "no" => __("No", WEB_INVOICE_TRANS_DOMAIN)), get_option('web_invoice_using_godaddy'));
    ?>

		</td>
	</tr>

</table>
</div>

<div id="web_invoice_settings_tab_business_pane">
<table class="form-table" id="settings_page_table" style="clear: left;">
	<tr>
		<td colspan="2">
		<h3><?php 
    _e("Business Settings:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h3>
		</td>
	</tr>
	<tr>
		<th width="200"><?php 
    _e("Business Name:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_business_name" type="text"
			class="input_field"
			value="<?php 
    echo stripslashes(get_option('web_invoice_business_name'));
    ?>
" />
		</td>
	</tr>
	<tr>
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e("This will display on the invoice page when printed for clients' records.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Business Address", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><textarea name="web_invoice_business_address"><?php 
    echo stripslashes(get_option('web_invoice_business_address'));
    ?>
</textarea>
		</td>
	</tr>

	<tr>
		<th width="200"><?php 
    _e("Business Phone", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_business_phone" type="text"
			class="input_field"
			value="<?php 
    echo stripslashes(get_option('web_invoice_business_phone'));
    ?>
" />
		</td>
	</tr>
	
	<tr>
		<th width="200"><?php 
    _e("Business Tax ID", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_business_tax_id" type="text"
			class="input_field"
			value="<?php 
    echo stripslashes(get_option('web_invoice_business_tax_id'));
    ?>
" />
		</td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Address used to send out e-mail to client with web invoice link.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Return e-mail Address", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><input name="web_invoice_email_address" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_email_address'));
    ?>
" />
		</td>
	</tr>
</table>
</div>

<div id="web_invoice_settings_tab_display_pane">
<table class="form-table" id="settings_page_table" style="clear: left;">
	<tr>
		<td colspan="2">
		<h3><?php 
    _e("Invoice Page Display Settings:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h3>
		</td>
	</tr>
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Disable this if you want to use your own stylesheet.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Use CSS", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_use_css">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_use_css') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;" value="no"
			<?php 
    if (get_option('web_invoice_use_css') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Show your business name and address on invoice.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Show Address on Invoice", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_show_business_address">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_show_business_address') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;" value="no"
			<?php 
    if (get_option('web_invoice_show_business_address') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	
	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Show billing name and address on invoice.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Show Billing Address on Invoice", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>:</th>
		<td><select name="web_invoice_show_billing_address">
			<option></option>
			<option style="padding-right: 10px;" value="yes"
			<?php 
    if (get_option('web_invoice_show_billing_address') == 'yes') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option style="padding-right: 10px;" value="no"
			<?php 
    if (get_option('web_invoice_show_billing_address') == 'no') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>

	<tr>
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e("Show quantity breakdowns in the itemized list on the front-end.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Quantities on Front End", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><select name="web_invoice_show_quantities">
			<option value="Show"
			<?php 
    if (get_option('web_invoice_show_quantities') == 'Show') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Show", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="Hide"
			<?php 
    if (get_option('web_invoice_show_quantities') == 'Hide') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Hide", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	
	<tr>
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e("Show invoice date on the front-end.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Invoice date on Front End", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><select name="web_invoice_show_invoice_date">
			<option value="Show"
			<?php 
    if (get_option('web_invoice_show_invoice_date') == 'Show') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Show", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="Hide"
			<?php 
    if (get_option('web_invoice_show_invoice_date') == 'Hide') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Hide", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
</table>
</div>


<div id="web_invoice_settings_tab_currency_pane">
<table class="form-table" id="settings_page_table" style="clear: left;">
	<tr>
		<td colspan="2">
		<h3><?php 
    _e("Currency Settings:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h3>
		</td>
	</tr>
	
	<tr>
		<th width="200"><?php 
    _e("Currencies", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td>
			<?php 
    $allowed_currencies = get_option('web_invoice_allowed_currencies', array('USD', 'EUR'));
    foreach (web_invoice_currency_array() as $value => $currency_x) {
        ?>
				<label class="web_invoice_allowed_currencies web_invoice_allowed_currencies_<?php 
        echo strtolower($value);
        ?>
">
					<input type="checkbox" value="<?php 
        echo $value;
        ?>
" <?php 
        echo in_array($value, $allowed_currencies) ? ' checked="checked"' : '';
        ?>
 name="web_invoice_allowed_currencies[]" id="allowed_currencies_<?php 
        echo strtolower($value);
        ?>
"/>
					<?php 
        echo "{$value} - {$currency_x[0]}";
        ?>
				</label><?php 
    }
    ?>
		</td>
	</tr>
	
	<tr>
		<th><?php 
    _e("Default Currency:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><?php 
    echo web_invoice_draw_select('web_invoice_default_currency_code', web_invoice_currency_allowed_array(), get_option('web_invoice_default_currency_code'));
    ?>
	</tr>
</table>
</div>

<div id="web_invoice_settings_tab_payment_methods_pane">
<table class="form-table" id="settings_page_table" style="clear: left;">
	<tr>
		<td colspan="2">
		<h3><?php 
    _e("Payment Method Settings", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h3>
		</td>
	</tr>

	<tr>
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Some payment processors may not be available unless protocol is https and enforce https is selected.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e("Payment Method:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><select id="web_invoice_payment_method"
			name="web_invoice_payment_method[]" multiple="multiple" size="4">
		<?php 
    foreach (web_invoice_get_all_payment_options() as $option_key => $option) {
        ?>
			<option value="<?php 
        print $option_key;
        ?>
" <?php 
        print $option['secure'] && (!stristr(get_option('web_invoice_protocol'), 'https') || !stristr(get_option('web_invoice_force_https'), 'true')) ? 'disabled="disabled"' : '';
        ?>
 style="padding-right: 10px;"
			<?php 
        if (stristr(get_option('web_invoice_payment_method'), $option_key)) {
            echo 'selected="yes"';
        }
        ?>
><?php 
        _e($option['text'], WEB_INVOICE_TRANS_DOMAIN);
        ?>
</option>
		<?php 
    }
    ?>
		</select></td>
	</tr>
	
	<tr class="alertpay_info">
		<th><?php 
    _e("AlertPay username:"******"web_invoice_alertpay_address" class="search-input input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_alertpay_address'));
    ?>
" />
		<a id="web_invoice_alertpay_register_link" href="http://keti.ws/36283"
			class="web_invoice_click_me"><?php 
    _e("Do you need an AlertPay account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="alertpay_info">
		<th width="200"><?php 
    _e("AlertPay Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_alertpay_button'
			name="web_invoice_alertpay_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_alertpay_button'));
    ?>
" />
			<span class="web_invoice_alertpay_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	<tr class="alertpay_info">
		<th><?php 
    _e("Enable AlertPay IPN:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_alertpay_merchant'
			name="web_invoice_alertpay_merchant">
			<option value="True"
			<?php 
    echo get_option('web_invoice_alertpay_merchant') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_alertpay_merchant') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select> <span class="web_invoice_alertpay_url web_invoice_info"><?php 
    _e("Your alert URL is", WEB_INVOICE_TRANS_DOMAIN);
    ?>
		<a
			title="<?php 
    _e("Copy this link", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			href="<?php 
    echo web_invoice_get_alertpay_api_url();
    ?>
"><?php 
    echo web_invoice_get_alertpay_api_url();
    ?>
</a>.<br />
			<?php 
    _e("Please note that AlertPay has issues with some SSL certificates. (Your milage may vary).", WEB_INVOICE_TRANS_DOMAIN);
    ?>
		</span></td>
	</tr>
	<tr class="alertpay_info alertpay_info_merchant">
		<th><?php 
    _e("AlertPay IPN security code:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_alertpay_secret'
			name="web_invoice_alertpay_secret" class="search-input input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_alertpay_secret'));
    ?>
" /></td>
	</tr>
	<tr class="alertpay_info alertpay_info_merchant">
		<th><?php 
    _e("Test / Live Mode:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_alertpay_test_mode">
			<option value="TRUE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_alertpay_test_mode') == 'TRUE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Test - Do Not Process Transactions", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="FALSE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_alertpay_test_mode') == 'FALSE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Live - Process Transactions", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="alertpay_info alertpay_info_merchant">
		<th><?php 
    _e("AlertPay IPN IP:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_alertpay_ip' name="web_invoice_alertpay_ip"
			class="search-input input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_alertpay_ip'));
    ?>
" /></td>
	</tr>
	
	<tr class="tco_info 2co_info">
		<th><?php 
    _e("2Checkout seller id:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_2co_sid'
			name="web_invoice_2co_sid" class="search-input input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_2co_sid'));
    ?>
" />
		<a id="web_invoice_2co_register_link" href="http://keti.ws/256281"
			class="web_invoice_click_me"><?php 
    _e("Do you need a 2CO account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="tco_info 2co_info">
		<th><?php 
    _e("2Checkout secret word:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_2co_secret_word'
			name="web_invoice_2co_secret_word" class="search-input input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_2co_secret_word', uniqid()));
    ?>
" />
		</td>
	</tr>
	<tr class="tco_info 2co_info">
		<th><?php 
    _e("Demo / Live Mode:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_2co_demo_mode">
			<option value="TRUE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_2co_demo_mode') == 'TRUE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Demo - Do Not Process Transactions", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="FALSE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_2co_demo_mode') == 'FALSE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e("Live - Process Transactions", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="tco_info 2co_info">
		<th width="200"><?php 
    _e("2Checkout Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_2co_button'
			name="web_invoice_2co_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_2co_button'));
    ?>
" />
			<span class="web_invoice_2co_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>

	<tr class="moneybookers_info">
		<th width="200"><?php 
    _e("Moneybookers Username:"******"web_invoice_moneybookers_address" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_moneybookers_address'));
    ?>
" />
		<a id="web_invoice_moneybookers_register_link"
			href="http://keti.ws/27481"
			class="web_invoice_click_me"><?php 
    _e("Do you need a Moneybookers account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="moneybookers_info">
		<th width="200"><?php 
    _e("Moneybookers Username for recurring payments (optional):", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_moneybookers_recurring_address'
			name="web_invoice_moneybookers_recurring_address" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_moneybookers_recurring_address'));
    ?>
" />
		</td>
	</tr>
	<tr class="moneybookers_info">
		<th width="200"><?php 
    _e("Moneybookers Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_moneybookers_button'
			name="web_invoice_moneybookers_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_moneybookers_button'));
    ?>
" />
			<span class="web_invoice_moneybookers_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	<tr class="moneybookers_info">
		<th width="200"><?php 
    _e("Enable Moneybookers payment notifications:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_moneybookers_merchant'
			name="web_invoice_moneybookers_merchant">
			<option value="True"
			<?php 
    echo get_option('web_invoice_moneybookers_merchant') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_moneybookers_merchant') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="moneybookers_info moneybookers_info_merchant">
		<th><?php 
    _e("Moneybookers payment notification secret:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_moneybookers_secret'
			name="web_invoice_moneybookers_secret"
			class="search-input input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_moneybookers_secret'));
    ?>
" /></td>
	</tr>
	<tr class="moneybookers_info moneybookers_info_merchant">
		<th><?php 
    _e("Moneybookers payment notification IP:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_moneybookers_ip'
			name="web_invoice_moneybookers_ip" class="search-input input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_moneybookers_ip'));
    ?>
" /></td>
	</tr>

	<tr class="google_checkout_info">
		<th width="200"><?php 
    _e("Google Checkout Merchant Id:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_google_checkout_merchant_id'
			name="web_invoice_google_checkout_merchant_id" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_google_checkout_merchant_id'));
    ?>
" />
		<a id="web_invoice_google_checkout_register_link" href="http://keti.ws/60282"
			class="web_invoice_click_me"><?php 
    _e("Do you need a Google Checkout account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="google_checkout_info">
		<th><?php 
    _e('Sandbox / Live Mode:', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_google_checkout_env">
			<option value="sandbox" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_google_checkout_env') == 'sandbox') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Sandbox - Do Not Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="live" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_google_checkout_env') == 'live') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Live - Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="google_checkout_info">
		<th width="200"><?php 
    _e("Google Checkout Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_google_checkout_button'
			name="web_invoice_google_checkout_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_google_checkout_button'));
    ?>
" />
			<span class="web_invoice_googlecheckout_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	<tr class="google_checkout_info">
		<th width="200"><?php 
    _e("Enable Google Checkout Level 2 integration:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_google_checkout_level2'
			name="web_invoice_google_checkout_level2">
			<option value="True"
			<?php 
    echo get_option('web_invoice_google_checkout_level2') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_google_checkout_level2') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select>
		<span class="web_invoice_google_checkout_url web_invoice_info"><?php 
    _e("HTML API callback URL is", WEB_INVOICE_TRANS_DOMAIN);
    ?>
		<a
			title="<?php 
    _e("Copy this link", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			href="<?php 
    echo web_invoice_get_google_checkout_api_url();
    ?>
"><?php 
    echo web_invoice_get_google_checkout_api_url();
    ?>
</a></span>
			</td>
	</tr>
	<tr class="google_checkout_info google_checkout_info_merchant">
		<th><?php 
    _e("Google Checkout merchant key:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_google_checkout_merchant_key'
			name="web_invoice_google_checkout_merchant_key"
			class="search-input input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_google_checkout_merchant_key'));
    ?>
" /></td>
	</tr>
	<tr class="google_checkout_info google_checkout_info_merchant">
		<th><?php 
    _e("Google Checkout tax country/state:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_google_checkout_tax_state' 
			name="web_invoice_google_checkout_tax_state" class="search-input input_field" >
				<option value="" ></option>
				<?php 
    print "<option value='UK'";
    if ("UK" == get_option('web_invoice_google_checkout_tax_state')) {
        print " selected";
    }
    print ">United Kingdom</option>";
    ?>
				<optgroup label="United States">
				<?php 
    foreach (web_invoice_state_array() as $_state_code => $_state_name) {
        print "<option value='{$_state_code}'";
        if ($_state_code == get_option('web_invoice_google_checkout_tax_state')) {
            print " selected";
        }
        print ">{$_state_name}</option>";
    }
    ?>
				</optgroup>
			</select></td>
	</tr>
	
	<tr class="paypal_info">
		<th width="200"><?php 
    _e("PayPal Username:"******"web_invoice_paypal_address" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_paypal_address'));
    ?>
" />
			<a id="web_invoice_paypal_register_link" href="http://keti.ws/87281"
				class="web_invoice_click_me"><?php 
    _e("Do you need a PayPal account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="paypal_info">
		<th width="200"><?php 
    _e("Just PayPal button (No form):", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_paypal_only_button'
			name="web_invoice_paypal_only_button">
			<option value="True"
			<?php 
    echo get_option('web_invoice_paypal_only_button') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_paypal_only_button') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="paypal_info">
		<th width="200"><?php 
    _e("PayPal Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_paypal_button'
			name="web_invoice_paypal_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_paypal_button'));
    ?>
" />
			<span class="web_invoice_paypal_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	<tr class="paypal_info">
		<th width="200"><?php 
    _e("PayPal Subscribe Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_paypal_subscribe_button'
			name="web_invoice_paypal_subscribe_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_paypal_subscribe_button'));
    ?>
" />
			<span class="web_invoice_paypal_subscribe_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		</td>
	</tr>
	<tr class="paypal_info">
		<th width="200"><?php 
    _e("PayPal Sandbox:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_paypal_sandbox'
			name="web_invoice_paypal_sandbox">
			<option value="True"
			<?php 
    echo get_option('web_invoice_paypal_sandbox') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_paypal_sandbox') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="payflow_info">
		<th width="200"><?php 
    _e("PayPal Payflow Username:"******"web_invoice_payflow_login" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_payflow_login'));
    ?>
" />
			<a id="web_invoice_payflow_register_link" href="http://keti.ws/87281"
				class="web_invoice_click_me"><?php 
    _e("Do you need a PayPal account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="payflow_info">
		<th width="200"><?php 
    _e("PayPal Payflow Partner name:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_payflow_partner'
			name="web_invoice_payflow_partner" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_payflow_partner'));
    ?>
" />
		</td>
	</tr>
	<tr class="payflow_info">
		<th width="200"><?php 
    _e("Just PayPal Payflow button (No form):", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_payflow_only_button'
			name="web_invoice_payflow_only_button">
			<option value="True"
			<?php 
    echo get_option('web_invoice_payflow_only_button') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_payflow_only_button') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="payflow_info payflow_shipping">
		<th width="200"><?php 
    _e("Display shipping details form:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_payflow_shipping_details'
			name="web_invoice_payflow_shipping_details">
			<option value="True"
			<?php 
    echo get_option('web_invoice_payflow_shipping_details') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_payflow_shipping_details') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="payflow_info">
		<th width="200"><?php 
    _e("PayPal Payflow Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_payflow_button'
			name="web_invoice_payflow_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_payflow_button'));
    ?>
" />
			<span class="web_invoice_payflow_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	<tr class="payflow_info">
		<th width="200"><?php 
    _e("Enable PayPal Payflow silent post integration:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_payflow_silent_post'
			name="web_invoice_payflow_silent_post">
			<option value="True"
			<?php 
    echo get_option('web_invoice_payflow_silent_post') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_payflow_silent_post') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select>
		<span class="web_invoice_payflow_silent_post_url web_invoice_info"><?php 
    _e("Silent post URL is", WEB_INVOICE_TRANS_DOMAIN);
    ?>
		<a
			title="<?php 
    _e("Copy this link", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			href="<?php 
    echo web_invoice_get_payflow_silent_post_url();
    ?>
"><?php 
    echo web_invoice_get_payflow_silent_post_url();
    ?>
</a></span>
			</td>
	</tr>
	
	<tr class="pfp_info">
		<th width="200"><?php 
    _e("PayPal Payflow Pro Partner name:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_pfp_partner'
			name="web_invoice_pfp_partner" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_partner'));
    ?>
" />
			<a id="web_invoice_pfp_register_link" href="http://keti.ws/87281"
				class="web_invoice_click_me"><?php 
    _e("Do you need a PayPal account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="pfp_info">
		<th><?php 
    _e('Sandbox / Live Mode:', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_pfp_env">
			<option value="sandbox" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_pfp_env') == 'sandbox') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Sandbox - Do Not Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="live" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_pfp_env') == 'live') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Live - Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="pfp_info">
		<th width="200"><?php 
    _e("PayPal Payflow Pro authentication mode:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id='web_invoice_pfp_authentication'
			name="web_invoice_pfp_authentication">
			<option value="3token"
			<?php 
    echo get_option('web_invoice_pfp_authentication') == '3token' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("3TOKEN", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="unipay"
			<?php 
    echo get_option('web_invoice_pfp_authentication') == 'unipay' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("UNIPAY", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="wpppe"
			<?php 
    echo get_option('web_invoice_pfp_authentication') == 'wpppe' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("Website Payments Pro", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="pfp_info 3token">
		<th width="200"><?php 
    _e("PayPal Payflow Pro Username:"******"web_invoice_pfp_username" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_username'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info 3token">
		<th width="200"><?php 
    _e("PayPal Payflow Pro Password:"******"web_invoice_pfp_password" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_password'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info 3token">
		<th width="200"><?php 
    _e("PayPal Payflow Pro Signature:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_pfp_signature'
			name="web_invoice_pfp_signature" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_signature'));
    ?>
" />
		</td>
	</tr>
	<!-- Website Payments Pro -->
	<tr class="pfp_info wpppe">
		<th width="200"><?php 
    _e("Website Payments Pro Vendor:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_pfp_wpppe_vendor'
			name="web_invoice_pfp_wpppe_vendor" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_wpppe_vendor'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info wpppe">
		<th width="200"><?php 
    _e("Website Payments Pro Username:"******"web_invoice_pfp_wpppe_username" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_wpppe_username'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info wpppe">
		<th width="200"><?php 
    _e("Website Payments Pro Password:"******"web_invoice_pfp_wpppe_password" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_wpppe_password'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info unipay">
		<th width="200"><?php 
    _e("PayPal Payflow Pro Third party e-mail address:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_pfp_3rdparty_email'
			name="web_invoice_pfp_3rdparty_email" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_pfp_3rdparty_email'));
    ?>
" />
		</td>
	</tr>
	<tr class="pfp_info">
		<th width="200"><?php 
    _e("Display shipping details form:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id="web_invoice_pfp_shipping_details"
			name="web_invoice_pfp_shipping_details">
			<option value="True"
			<?php 
    echo get_option('web_invoice_pfp_shipping_details') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_pfp_shipping_details') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	
	<tr class="sagepay_info">
		<th width="200"><?php 
    _e("Sage Pay vendor login name:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_sagepay_vendor_name'
			name="web_invoice_sagepay_vendor_name" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_sagepay_vendor_name'));
    ?>
" />
		<a id="web_invoice_sagepay_register_link" href="http://keti.ws/85282"
			class="web_invoice_click_me"><?php 
    _e("Do you need a Sage Pay account?", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		</td>
	</tr>
	<tr class="sagepay_info">
		<th><a class="web_invoice_tooltip"
			title="<?php 
    _e("Sage Pay encryption password is different from your Sage Pay vendor password", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			><?php 
    _e("Sage Pay encryption password:"******"web_invoice_sagepay_vendor_key"
			class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_sagepay_vendor_key'));
    ?>
" /></td>
	</tr>
	<tr class="sagepay_info">
		<th><?php 
    _e('Sandbox / Live Mode:', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_sagepay_env">
			<option value="simulator" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_sagepay_env') == 'simulator') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Simulator - Do Not Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="test" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_sagepay_env') == 'test') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Sandbox - Do Not Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="live" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_sagepay_env') == 'live') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Live - Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="sagepay_info">
		<th width="200"><?php 
    _e("Display shipping details form:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select id="web_invoice_sagepay_shipping_details"
			name="web_invoice_sagepay_shipping_details">
			<option value="True"
			<?php 
    echo get_option('web_invoice_sagepay_shipping_details') == 'True' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("yes", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="False"
			<?php 
    echo get_option('web_invoice_sagepay_shipping_details') == 'False' ? 'selected="selected"' : '';
    ?>
><?php 
    _e("no", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<tr class="sagepay_info">
		<th width="200"><?php 
    _e("Sage Pay Button URL:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input id='web_invoice_sagepay_button'
			name="web_invoice_sagepay_button" class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_sagepay_button'));
    ?>
" />
			<span class="web_invoice_sagepay_button_info web_invoice_info"><?php 
    _e("Leave blank for default", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>	
		</td>
	</tr>
	
	<tr class="other_info">
		<th width="200"><?php 
    _e("Other/Bank details:", WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><textarea id='web_invoice_other_details'
			name="web_invoice_other_details"><?php 
    echo get_option('web_invoice_other_details');
    ?>
</textarea></td>
	</tr>

	<tr>
		<th colspan="2"><?php 
    web_invoice_cc_setup(false);
    ?>
</th>
	</tr>
	
	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e('Your credit card processor will provide you with a gateway username.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Gateway Username', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_gateway_username"
			class="input_field noautocomplete" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_username'));
    ?>
" />
		</td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e("You will be able to generate this in your credit card processor's control panel.", WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Gateway Transaction Key', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_gateway_tran_key"
			class="input_field noautocomplete" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_tran_key'));
    ?>
" />
		</td>
	</tr>


	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e('This is the URL provided to you by your credit card processing company.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Gateway URL', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_gateway_url" id="web_invoice_gateway_url"
			class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_url'));
    ?>
" />
		<br />
		<span class="web_invoice_click_me"
			onclick="jQuery('#web_invoice_gateway_url').val('https://gateway.merchantplus.com/cgi-bin/PAWebClient.cgi');"><?php 
    _e('MerchantPlus', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		| <span class="web_invoice_click_me"
			onclick="jQuery('#web_invoice_gateway_url').val('https://secure.authorize.net/gateway/transact.dll');"><?php 
    _e('Authorize.Net', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		| <span class="web_invoice_click_me"
			onclick="jQuery('#web_invoice_gateway_url').val('https://test.authorize.net/gateway/transact.dll');"><?php 
    _e('Authorize.Net Developer', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		</td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e('Recurring billing gateway URL is most likely different from the Gateway URL, and will almost always be with Authorize.net. Be advised - test credit card numbers will be declined even when in test mode.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Recurring Billing Gateway URL', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_recurring_gateway_url"
			id="web_invoice_recurring_gateway_url" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_recurring_gateway_url'));
    ?>
" />
		<br />
		<span class="web_invoice_click_me"
			onclick="jQuery('#web_invoice_recurring_gateway_url').val('https://api.authorize.net/xml/v1/request.api');"><?php 
    _e('Authorize.net ARB', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		| <span class="web_invoice_click_me"
			onclick="jQuery('#web_invoice_recurring_gateway_url').val('https://apitest.authorize.net/xml/v1/request.api');"><?php 
    _e('Authorize.Net ARB Testing', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</span>
		</td>
	</tr>

	<tr class="gateway_info">
		<th><?php 
    _e('Test / Live Mode:', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_gateway_test_mode">
			<option value="TRUE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_test_mode') == 'TRUE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Test - Do Not Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="FALSE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_test_mode') == 'FALSE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('Live - Process Transactions', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>

	<tr class="gateway_info">
		<td colspan="2">
		<h2><?php 
    _e('Advanced Gateway Settings', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h2>
		</td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e('Get this from your credit card processor. If the transactions are not going through, this character is most likely wrong.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Delimiter Character', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_gateway_delim_char" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_delim_char'));
    ?>
" />
		</td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><a class="web_invoice_tooltip"
			title="<?php 
    _e('Authorize.net default is blank. Otherwise, get this from your credit card processor. If the transactions are going through, but getting strange responses, this character is most likely wrong.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"><?php 
    _e('Encapsulation Character', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a></th>
		<td><input name="web_invoice_gateway_encap_char" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_encap_char'));
    ?>
" />
		</td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><?php 
    _e('Merchant Email', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_gateway_merchant_email"
			class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_merchant_email'));
    ?>
" />
		</td>
	</tr>

	<tr class="gateway_info">
		<th><?php 
    _e('Email Customer (on success):', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_gateway_email_customer">
			<option value="TRUE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_email_customer') == 'TRUE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('True', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="FALSE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_email_customer') == 'FALSE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('False', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>

	<tr class="gateway_info">
		<th width="200"><?php 
    _e('Customer Receipt Email Header', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_gateway_header_email_receipt"
			class="input_field" type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_header_email_receipt'));
    ?>
" />
		</td>
	</tr>


	<tr class="gateway_info">
		<th width="200"><?php 
    _e('Security: MD5 Hash', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><input name="web_invoice_gateway_MD5Hash" class="input_field"
			type="text"
			value="<?php 
    echo stripslashes(get_option('web_invoice_gateway_MD5Hash'));
    ?>
" />
		</td>
	</tr>

	<tr class="gateway_info">
		<th><?php 
    _e('Delim Data:', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</th>
		<td><select name="web_invoice_gateway_delim_data">
			<option value="TRUE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_delim_data') == 'TRUE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('True', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
			<option value="FALSE" style="padding-right: 10px;"
			<?php 
    if (get_option('web_invoice_gateway_delim_data') == 'FALSE') {
        echo 'selected="yes"';
    }
    ?>
><?php 
    _e('False', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</option>
		</select></td>
	</tr>
	<?php 
    do_action('web_invoice_display_settings');
    ?>
</table>
</div>
</div>
<table class="form-table">
	<tr>
		<td><input type="submit"
			value="<?php 
    _e('Update', WEB_INVOICE_TRANS_DOMAIN);
    ?>
"
			class="button" /></td>
	</tr>
</table>

<table class="form-table">
	<tr>
		<td>
		<h2><?php 
    _e('Web Invoice Database Tables', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</h2>
		<p>Check to see if the database tables are installed properly. If not,
		try deactivating and reactivating the plugin, if that doesn't work, <a
			href="http://mohanjith.com/contact.html">contact us</a>.</p>
			<?php 
    echo __("Main Table - ", WEB_INVOICE_TRANS_DOMAIN);
    if ($wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('main') . "';")) {
        echo __("Good", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        echo __("Not Found", WEB_INVOICE_TRANS_DOMAIN);
    }
    echo "<br />" . __("Meta Table - ", WEB_INVOICE_TRANS_DOMAIN);
    if ($wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('meta') . "';")) {
        echo __("Good", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        echo __("Not Found", WEB_INVOICE_TRANS_DOMAIN);
    }
    echo "<br />" . __("Log Table - ", WEB_INVOICE_TRANS_DOMAIN);
    if ($wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('log') . "';")) {
        echo __("Good", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        echo __("Not Found", WEB_INVOICE_TRANS_DOMAIN);
    }
    echo "<br />" . __("Payment Table - ", WEB_INVOICE_TRANS_DOMAIN);
    if ($wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('payment') . "';")) {
        echo __("Good", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        echo __("Not Found", WEB_INVOICE_TRANS_DOMAIN);
    }
    echo "<br />" . __("Payment Meta Table - ", WEB_INVOICE_TRANS_DOMAIN);
    if ($wpdb->query("SHOW TABLES LIKE '" . Web_Invoice::tablename('payment_meta') . "';")) {
        echo __("Good", WEB_INVOICE_TRANS_DOMAIN);
    } else {
        echo __("Not Found", WEB_INVOICE_TRANS_DOMAIN);
    }
    ?>
</td>
	</tr>
	<tr>
		<td colspan="2"><a id="delete_all_web_invoice_databases"
			href="admin.php?page=new_web_invoice&web_invoice_action=complete_removal"><?php 
    _e('Remove All Web Invoice Databases', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</a>
		- <?php 
    _e('Only do this if you want to completely remove the plugin.  All invoices and logs will be gone... forever.', WEB_INVOICE_TRANS_DOMAIN);
    ?>
</td>
	</tr>
</table>
</form>
			<?php 
}