{error}

<!-- BEGIN DYNAMIC BLOCK: noClients -->
<br>
&nbsp;&nbsp;&nbsp;
<img src="../images/sub_dot.gif">
<font class=body7green>[l]Client database is empty[/l]</font>
<!-- END DYNAMIC BLOCK: noClients -->

<!-- BEGIN DYNAMIC BLOCK: addClient -->
<br>
&nbsp;&nbsp;&nbsp;
<img src="../images/sub_dot.gif">
[l]To add a client please click[/l]
<a onclick='addClient()' href='javascript:void();'>[l]here[/l]</a>
<!-- END DYNAMIC BLOCK: addClient -->

<!-- BEGIN DYNAMIC BLOCK: profile -->
<script language="javascript" type="text/javascript" src="{RELATIVE_PATH}javascript/modules/clients.js?version={VERSION}" ></script>
<script language="javascript" type="text/javascript"><!--hide it---
    function CheckForCCDisplay(selObj){
        var inarray = 0;

        // possible plugins that require cc information
        validpluginsforcc = new Array({pluginsList});
        {availableCCArray}

        //for loop to take a look and see if the selected plugin accepts cc information
        for (x = 0; x < {arraycount}; x++){
            if (selObj == validpluginsforcc[x]) {
                inarray = 1;
            }
        }
    
        visabit     = 0;
        mcbit       = 0;
        amexbit     = 0;
        discoverbit = 0;
        
        laserbit    = 0;
        dinersbit   = 0;
        switchbit   = 0;
    
        //if inarray is 1 then we need to show credit card information
        if (inarray == 1) {
            if (pluginsforcc[selObj][{cCREDITVISA}] == 1) {
                visabit = 1;
                document.getElementById('visa_logo').style.display = "";
            } else {
                document.getElementById('visa_logo').style.display = "none";
            }
            
            if (pluginsforcc[selObj][{cCREDITMC}] == 1) {
                mcbit = 1;
                document.getElementById('mastercard_logo').style.display = "";
            } else {
                document.getElementById('mastercard_logo').style.display = "none";
            }
            
            if (pluginsforcc[selObj][{cCREDITAMEX}] == 1) {
                amexbit = 1;
                document.getElementById('americanexpress_logo').style.display = "";
            } else {
                document.getElementById('americanexpress_logo').style.display = "none";
            }
            
            if (pluginsforcc[selObj][{cCREDITDISC}] == 1) {
                discoverbit = 1;
                document.getElementById('discover_logo').style.display = "";
            } else {
                document.getElementById('discover_logo').style.display = "none";
            }
            
            
            if (pluginsforcc[selObj][{cCREDITLASER}] == 1) {
                laserbit = 1;
                document.getElementById('lasercard_logo').style.display = "";
            } else {
                document.getElementById('lasercard_logo').style.display = "none";
            }
            
            if (pluginsforcc[selObj][{cCREDITDINERS}] == 1) {
                dinersbit = 1;
                document.getElementById('dinersclub_logo').style.display = "";
            } else {
                document.getElementById('dinersclub_logo').style.display = "none";
            }
            
            if (pluginsforcc[selObj][{cCREDITSWITCH}] == 1) {
                switchbit = 1;
                document.getElementById('switch_logo').style.display = "";
            } else {
                document.getElementById('switch_logo').style.display = "none";
            }
            
            //   document.forms['customerdata'].elements['c_ccnumber'].value = 'Invalid Credit Card Number'; 

            <!-- BEGIN DYNAMIC BLOCK: forceCCRequirement -->
            if (document.forms['customerdata'].elements['r_ccnumber'] != null) {
                document.forms['customerdata'].elements['r_ccnumber'].value = lang('Credit Card Required');
            }
            <!-- END DYNAMIC BLOCK: forceCCRequirement -->

            document.getElementById('creditcardinfo').style.display = "";
            document.getElementById('nocreditcardinfo').style.display = "none";
        } else {
            if (document.forms['customerdata'].elements['c_ccnumber'] != null) {
                document.forms['customerdata'].elements['c_ccnumber'].value = '';
            }
            
            if (document.forms['customerdata'].elements['r_ccnumber'] != null) {
                document.forms['customerdata'].elements['r_ccnumber'].value = '';
            }
            
            document.getElementById('creditcardinfo').style.display = "none";
            document.getElementById('nocreditcardinfo').style.display = "";
        }
        document.forms['customerdata'].elements['validcc'].value = "" + visabit + mcbit + amexbit + discoverbit + laserbit + dinersbit + switchbit + "";
        
    }


    function OpenShowCCWindow(){
        if (document.forms['customerdata'].elements['viewpassphrase'].value==""){
            alert(lang('You will need to enter your passphrase before viewing the entire credit card number.'));
            return;
        }
    
        var mywin = window.open('','cewindow','scrollbars=no,menubar=no,location=no,width=200,height=10,resizable=no');
        var passphrase = encodeURIComponent(document.forms['customerdata'].elements['viewpassphrase'].value);
        mywin.location.href = "index.php?fuse={fuse}&pp=" + passphrase + "&view=ViewCCNumber";
        mywin.focus();
    }
    
    function replaceString(oldS,newS,fullS) {
      for (var i=0; i<fullS.length; i++) {
         if (fullS.substring(i,i+oldS.length) == oldS) {
            fullS = fullS.substring(0,i)+newS+fullS.substring(i+oldS.length,fullS.length);
         }
      }
      return fullS;
    }
    
    function fixaddress(myfield) {
      myfield.value =  replaceString(" ","",myfield.value);
      myfield.value = myfield.value.toLowerCase();
    }
    
    function checkCreditBalance(form){
        if (form.balance.value !=""){
            if (isNaN(form.balance.value) || form.balance.value < 0){
                alert(lang("Your credit balance has a wrong format or is not valid"));
                return (false);
            }
        }
        return (true);
    }
    
    function showHideRecurring(value) {
        usingRecurring = document.getElementById('use_recurring');
        if (value == 'paypal') {
            usingRecurring.style.display = 'block';
        } else {
            usingRecurring.style.display = 'none';
        }
    }
    
    function showHideVaultPaymentInformation(value) {
        if (value == 'quantumvault') {
            document.getElementById('vaultpaymentinformation').style.display = 'block';
            document.getElementById('vaultpaymentiframe').src = "index.php?fuse=admin&view=ViewPluginUrl&plugintoshow=quantumvault";
        } else {
            document.getElementById('vaultpaymentinformation').style.display = 'none';
            document.getElementById('vaultpaymentiframe').src = '';
        }
    }
    
    if (document.images) {
        pic1= new Image(167,14);
        pic1.src="{RELATIVE_PATH}images/loading.gif";
    }
//-->
</script>


<form method=post name=customerdata action="index.php?fuse=clients&action=UpdateCustomer&CustomerTab=BillingInformation">
    <!-- BEGIN DYNAMIC BLOCK: updateCustomerForm -->
    <input type=hidden name=id value="{customerId}">
    <input type=hidden name=userid value="{customerId}">
    <!-- END DYNAMIC BLOCK: updateCustomerForm -->

    <div class="inside">
        <ul class="tabs">
            <!-- BEGIN DYNAMIC BLOCK: customerTabs -->
            <li{TABCLASS}><a href="index.php?fuse=clients&view=ShowCustomerData&CustomerTab={CUSTOMERTAB}">{CUSTOMERTABNAME}</a></li>
            <!-- END DYNAMIC BLOCK: customerTabs -->
        </ul>

        <div class="tab">
            <div id="errMessages" valign=top>
                <font class="redtext"><b>{MESSAGES}&nbsp;</b></font>
            </div>
            <br>
            <h5>{billingHeader}</h5>
            <dl class="form">
                <!-- BEGIN DYNAMIC BLOCK: billing -->
                    <!-- BEGIN DYNAMIC BLOCK: billingAdminOnly -->

                <!--  ADDED FOR: ACCOUNT_CREDIT - Credit Balance  -->
                        <!-- BEGIN DYNAMIC BLOCK: billingEditCredit -->
                <dt><label>[l]Credit Balance[/l]</label></dt>
                <dd>
                    <input class=body type=text name=balance size=15 autocomplete="off" value={balance}>
                </dd>
                        <!-- END DYNAMIC BLOCK: billingEditCredit -->

                        <!-- BEGIN DYNAMIC BLOCK: billingSeeCredit -->
                <dt><label>[l]Credit Balance[/l]</label></dt>
                <dd>
                    {balance}
                </dd>
                        <!-- END DYNAMIC BLOCK: billingSeeCredit -->
                <!--  ADDED FOR: ACCOUNT_CREDIT - Credit Balance  -->

                <dt><label>[l]Taxable[/l]</label></dt>
                <dd>
                    <select name=taxable>
                        <option value=1 {taxableYesSelected} >[l]Yes[/l]</option>
                        <option value=0 {taxableNoSelected} >[l]No[/l]</option>
                    </select>
                </dd>

                <dt><label>[l]Currency[/l]</label></dt>
                <dd>
                    {currencyDropdown}&nbsp;&nbsp;{currencySymbol}
                </dd>

                <dt><label>[l]Payment Type[/l]</label></dt>
                <dd>
                    <select name=paymenttype class=body onChange="CheckForCCDisplay(this.options[this.selectedIndex].value); showHideRecurring(this.options[this.selectedIndex].value); showHideVaultPaymentInformation(this.options[this.selectedIndex].value);">
                        <!-- BEGIN DYNAMIC BLOCK: paymentTypeOption -->
                        <option value="{paymentTypeOptionValue}" {paymentTypeOptionSelected} >{paymentTypeOptionLabel}</option>
                        <!-- END DYNAMIC BLOCK: paymentTypeOption -->
                    </select>&nbsp;&nbsp;{paymentTypeHelp}
                </dd>

                <div id="use_recurring" style="display:{displayRecurring}">
                    <dt><label>[l]Use Recurring Subscription[/l]</label></dt>
                    <dd>
                        <input type="radio" name="recurring_paypal" value="0" {recurringPaypalNo} />[l]No[/l]&nbsp;&nbsp;
                        <input type="radio" name="recurring_paypal" value="1" {recurringPaypalYes} />[l]Yes[/l]&nbsp;&nbsp;
                        {paypalRecurringHelp}
                    </dd>
                </div>
                    <!-- END DYNAMIC BLOCK: billingAdminOnly -->

                <div id=nocreditcardinfo style="display:{noDisplayCC}" >
                    <table width=400 style="padding-left:30px">
                        <tr>
                            <td align=center>
                                <div class="notice">
                                    <div class="inside">
                                        <p>
                                            <font class="redtext">[l]We do not store credit card information<br>for your selected payment type[/l]</font><br><br>
                                        </p>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>

                <div id=creditcardinfo style="display:{displayCC}">
                    <dt><label>[l]Credit Card Number[/l]</label></dt>

                    <!-- BEGIN DYNAMIC BLOCK: CCSection -->
                    <dd>
                        <!-- BEGIN DYNAMIC BLOCK: isPassphrased -->
                            <!-- BEGIN DYNAMIC BLOCK: ccIsThere -->
                                <!-- BEGIN DYNAMIC BLOCK: canEditCC -->
                        xxxxxxxxxxxxx {lastFour}&nbsp;&nbsp;&nbsp;

                                    <!-- BEGIN DYNAMIC BLOCK: canPassphrase -->
                        <font color=red>{passphraseHelp}</font>
                        <div id="passphrasediv" style="display:none">
                            <table>
                                <tr>
                                    <td>
                                        <input type=password name='viewpassphrase'>&nbsp;&nbsp;
                                    </td>
                                    <td>
                                        <input class=button_s type=button name=viewentirecc value='[l]view[/l]' onClick='OpenShowCCWindow();'>
                                    </td>
                                </tr>
                            </table>
                        </div>
                                    <!-- END DYNAMIC BLOCK: canPassphrase -->

                                    <!-- BEGIN DYNAMIC BLOCK: deleteCC -->
                        <div>
                            <input type=checkbox name='deletecc' />&nbsp;&nbsp;[l]Delete Credit Card[/l]
                        </div>
                                    <!-- END DYNAMIC BLOCK: deleteCC -->
                                <!-- END DYNAMIC BLOCK: canEditCC -->

                        {cantEditCC}
                            <!-- END DYNAMIC BLOCK: ccIsThere -->

                            <!-- BEGIN DYNAMIC BLOCK: ccIsNotThere -->
                        <input type=text name=ccnumber size=30>
                        <input type=hidden name=c_ccnumber value="{requiredMsg}" />
                        <input type=hidden name=r_ccnumber value="{ccRequiredMsg}" />
                            <!-- END DYNAMIC BLOCK: ccIsNotThere -->
                        <!-- END DYNAMIC BLOCK: isPassphrased -->

                        <!-- BEGIN DYNAMIC BLOCK: isNotPassphrased -->
                            <!-- BEGIN DYNAMIC BLOCK: thereIsCC -->
                                <!-- BEGIN DYNAMIC BLOCK: CCEditable -->
                                    <!-- BEGIN DYNAMIC BLOCK: passphraseable -->
                        {someHelp}
                        <div id="passphrasediv" style="display:none">
                            <input type=password name=passphrase>
                        </div>
                                    <!-- END DYNAMIC BLOCK: passphraseable -->

                                    <!-- BEGIN DYNAMIC BLOCK: awaitingValidation -->
                        <font color=red>[l]Awaiting Validation[/l]</font>
                                    <!-- END DYNAMIC BLOCK: awaitingValidation -->

                                    <!-- BEGIN DYNAMIC BLOCK: deleteCC2 -->
                        <div>
                            <input type=checkbox name='deletecc' />&nbsp;&nbsp;[l]Delete Credit Card[/l]
                        </div>
                                    <!-- END DYNAMIC BLOCK: deleteCC2 -->
                                <!-- END DYNAMIC BLOCK: CCEditable -->

                                <!-- BEGIN DYNAMIC BLOCK: awaitingValidation2 -->
                        <font color=red>[l]Awaiting Validation[/l]</font>
                                <!-- END DYNAMIC BLOCK: awaitingValidation2 -->
                            <!-- END DYNAMIC BLOCK: thereIsCC -->
                      
                            <!-- BEGIN DYNAMIC BLOCK: thereIsNoCC -->
                        <input type=text name=ccnumber size=30>
                        <input type=hidden name=c_ccnumber value="{requiredMsg}" />
                        <input type=hidden name=r_ccnumber value="{ccRequiredMsg}" />
                            <!-- END DYNAMIC BLOCK: thereIsNoCC -->
                        <!-- END DYNAMIC BLOCK: isNotPassphrased -->
                    </dd>

                        <!-- BEGIN DYNAMIC BLOCK: changeCC -->
                    <dt><label>[l]New Credit Card Number[/l]</label></dt>
                    <dd>
                        <input type=text name=newccnumber size=30>
                        <input type=hidden name=c_newccnumber value="{requiredMsg}" />
                        <input type=hidden name=r_newccnumber value="">&nbsp;&nbsp;{helpCCChange}
                    </dd>
                        <!-- END DYNAMIC BLOCK: changeCC -->
                    <!-- END DYNAMIC BLOCK: CCSection -->

                    <!-- BEGIN DYNAMIC BLOCK: emptyCCSection -->
                    <dd>
                        <input type=text name=ccnumber size=30 value={ccnumber}>
                        <input type=hidden name=c_ccnumber value="{requiredMsg}" />
                        <input type=hidden name=r_ccnumber value="{ccRequiredMsg}">
                    </dd>
                    <!-- END DYNAMIC BLOCK: emptyCCSection -->

                    <dt><label>[l]Expiration Month[/l]</label></dt>
                    <dd>
                        <select type=text name=ccmonth>
                    <!-- BEGIN DYNAMIC BLOCK: monthOptions -->
                            <option value="{monthOptionsValue}" {monthOptionsSelected} >{monthOptionsLabel}</option>
                    <!-- END DYNAMIC BLOCK: monthOptions -->
                        </select>
                    </dd>

                    <dt><label>[l]Expiration Year[/l]</label></dt>
                    <dd>
                        <select type=text name=ccyear>
                    <!-- BEGIN DYNAMIC BLOCK: yearOptions -->
                            <option value="{yearOptionsValue}" {yearOptionsSelected} >{yearOptionsLabel}</option>
                    <!-- END DYNAMIC BLOCK: yearOptions -->
                        </select>
                    </dd>

                    <dt><label>[l]Accepting[/l]</label></dt>
                    <dd>
                        <img src="../images/visa_logo.gif" style="display:{visaStyle}" id=visa_logo>
                        <img src="../images/mastercard_logo.gif" style="display:{mastercardStyle}" id=mastercard_logo>
                        <img src="../images/americanexpress_logo.gif" style="display:{americanexpressStyle}" id=americanexpress_logo>
                        <img src="../images/discover_logo.gif" style="display:{discoverStyle}" id=discover_logo>
                        
                        <img src="../images/lasercard_logo.gif" style="display:{lasercardStyle}" id=lasercard_logo>
                        <img src="../images/dinersclub_logo.gif" style="display:{dinersclubStyle}" id=dinersclub_logo>
                        <img src="../images/switch_logo.gif" style="display:{switchStyle}" id=switch_logo>
                        <input type=hidden name=validcc value='{visabit}{mcbit}{amexbit}{discbit}{laserbit}{dinersbit}{switchbit}' />
                    </dd>
                </div>

                <div id=vaultpaymentinformation style="display:{displayEditVaultPaymentInformation}">
                    <iframe
                        id=vaultpaymentiframe
                        src ="{vaultPaymentIframeSrc}"
                        width="100%"
                        height="300"
                        scrolling="auto"
                        frameborder="0"
                    > 
                        <p>
                            Your browser does not support iframes.
                        </p> 
                    </iframe>
                </div>
                <!-- END DYNAMIC BLOCK: billing -->
            </dl>

            <!-- BEGIN DYNAMIC BLOCK: passwordButtons2 -->
            <p class="buttons">
                <input type=submit class=button value='[l]update[/l]' onclick='if (checkCreditBalance(form)) {check(form,form.elements.length);} return false;' class=body>
            </p>
            <!-- END DYNAMIC BLOCK: passwordButtons2 -->
            <input type=hidden name=removeArray value='{queryString1}'>
        </div>
        <br class="clearboth" />
    </div>
</form>
<!-- END DYNAMIC BLOCK: profile -->
