<?php include_once $BL->props->get_page("templates/alp_admin/html/header.php"); ?>
<div id="content">
    <div id="display_list">
        <form name='form1' id='form1' method='POST' action='<?php echo $PHP_SELF; ?>'>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list_table">
        <tr> 
            <td colspan="2" class="tdheading">
            <b>&nbsp;<?php echo $BL->props->lang['Create_Invoice_for']." ".$BL->getCustomerFieldValue("name",isset($Invoice[0]['id'])?$Invoice[0]['id']:$Order[0]['id']); ?></b>
            </td>
        </tr>
        <tr> 
            <td colspan="2" class="text_grey">
            <img src="elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>spacer.gif" alt="" width="100%" height="1" />
            </td>
        </tr>
        <?php if($cmd=="editinvoice" && isset($Extra_Fields) && count($Extra_Fields)){ ?>
        <tr> 
            <td colspan="2" class="text_grey">                      
            <table width='100%' border='0' cellspacing='0' cellpadding='0'>
            <?php foreach($Extra_Fields as $Extra_Field){ ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label"><?php echo $BL->props->lang[$Extra_Field[0]]; ?></div>
                <div id="form1_field"><?php echo $Extra_Field_Values[$Extra_Field[1]]; ?></div>
                </td>
            </tr>
            <?php } ?>
            </table>
            </td>
        </tr> 
        <tr> 
            <td colspan="2" class="text_grey">
            <img src="elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>spacer.gif" alt="" width="100%" height="1" />
            </td>
        </tr>
        <?php } ?>
        <tr>
            <td class="text_grey" colspan="2">
            <table width='100%' border='0' cellspacing='0' cellpadding='0'>
            <tr> 
                <td width="1%" class='text_grey'>
	            <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Description']; ?>
                </div>
                <div id="form1_field">
                <?php if($cmd=="editinvoice") { echo $BL->getFriendlyDesc($Invoice[0]['desc'],$Invoice[0]['order_id']); }else { echo $BL->getFriendlyDesc($Order[0]['sub_id']."-".$Order[0]['product_id']."-".$Order[0]['domain_name']."-".date('Y-m-d'),$Order[0]['sub_id']); } ?>
                <input name='desc' id='desc' type='hidden' value="<?php if($cmd=="editinvoice") echo $Invoice[0]['desc']; else echo $Order[0]['sub_id']."-".$Order[0]['product_id']."-".$Order[0]['domain_name']."-".date('Y-m-d'); ?>" />                    
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Due_Date']; ?>
                </div>
                <div id="form1_field">
                <?php $date=$BL->utils->getDateArray(isset($Invoice[0]['due_date'])?$Invoice[0]['due_date']:date('Y-m-d')); ?>
                <?php echo $BL->utils->datePicker($date['mday'], $date['mon'], $date['year'], "search"); ?>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" valign="top" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey' valign="top">
                <div id="form1_label">
                <?php echo $BL->props->lang['detail']; ?>
                </div>
                <div id="form1_field">
                <textarea name="pay_text" rows="10" cols="65"><?php if($cmd=="editinvoice"){echo $Invoice[0]['pay_text'];} ?></textarea>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php if($cmd=="editinvoice"){ ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Domain']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='inv_tld_fee' type='text' class='search' id='inv_tld_fee' size='20' value='<?php echo $Invoice[0]['tld_fee']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['setup_fee']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='inv_setup_fee' type='text' class='search' id='inv_setup_fee' size='20' value='<?php echo $Invoice[0]['setup_fee']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['cycle_amount']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='inv_cycle_fee' type='text' class='search' id='inv_cycle_fee' size='20' value='<?php echo $Invoice[0]['cycle_fee']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php foreach($Addons as $Addon_Name=>$Addon_Fee){ ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $Addon_Name; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <?php echo $BL->props->lang['setup_fee']; ?>&nbsp;<input name='addon_setups[<?php echo $Addon_Name; ?>]' type='text' class='search' id='addon_setups[<?php echo $Addon_Name; ?>]' size='8' value='<?php echo $Addon_Fee['SETUP']; ?>' />
                <?php echo $BL->props->lang['Recurring']; ?>&nbsp;<input name='addon_cycles[<?php echo $Addon_Name; ?>]' type='text' class='search' id='addon_cycles[<?php echo $Addon_Name; ?>]' size='8' value='<?php echo $Addon_Fee['CYCLE']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php } ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <b><?php echo $BL->props->lang['special_disount']; ?></b>
                </div>
                <div id="form1_field">
                &nbsp;
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>&nbsp;</div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['tld_discount']; ?> (%)
                </div>
                <div id="form1_field">
                <input name='inv_tld_disc' type='text' class='search' id='inv_tld_disc' size='20' value='<?php echo $Invoice[0]['inv_tld_disc']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>&nbsp;</div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['plan_discount']; ?> (%)
                </div>
                <div id="form1_field">
                <input name='inv_plan_disc' type='text' class='search' id='inv_plan_disc' size='20' value='<?php echo $Invoice[0]['inv_plan_disc']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>&nbsp;</div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['addon_discount']; ?> (%)
                </div>
                <div id="form1_field">
                <input name='inv_addon_disc' type='text' class='search' id='inv_addon_disc' size='20' value='<?php echo $Invoice[0]['inv_addon_disc']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php } ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Credit_Debit']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='debit_credit_amount' type='text' class='search' id='debit_credit_amount' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['debit_credit_amount'];}else echo "0.00"; ?>' />
                	  <select name="debit_credit" size="1" class='search'>
                	  <option></option>
                	    <option value="credit" <?php if($cmd=="editinvoice" && $Invoice[0]['debit_credit'] == "credit")echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['credit']; ?></option>
                	    <option value="debit" <?php if($cmd=="editinvoice" && $Invoice[0]['debit_credit'] == "debit")echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['debit']; ?></option>
                	  </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Credit_Debit']." ".$BL->props->lang['reason']; ?>
                </div>
                <div id="form1_field">
                <input name='debit_credit_reason' type='text' class='search' id='debit_credit_reason' size='20' value='<?php if($cmd=="editinvoice")echo $Invoice[0]['debit_credit_reason']; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php if(($cmd=="editinvoice" && $Invoice[0]['prorate_amount']>0) || ($cmd!="editinvoice" && $BL->conf['en_prorate'])){ ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['prorate_desc']; ?>
                </div>
                <div id="form1_field">                      
                <input name='prorate_desc' type='text' class='search' id='prorate_desc' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['prorate_desc'];} ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['prorate_amount']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='prorate_amount' type='text' class='search' id='prorate_amount' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['prorate_amount'];}else echo "0.00"; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php } ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['discount']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">                      
                <input name='other_amount' type='text' class='search' id='other_amount' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['other_amount'];}else echo "0.00"; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Net_Amount']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='net_amount' type='text' class='search' id='net_amount' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['net_amount'];}else echo "0.00"; ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php if($cmd=="editinvoice"){?>
            <?php foreach($Taxes as $Tax) { ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' /></div></td>
                <td class='text_grey'>
                <div id="form1_label">
                <input name='tax2[]' type='text' value='<?php echo $Tax[2]; ?>' class='search' id='tax2'>
                </div>
                <div id="form1_field">
                <select name='tax3[]' id='tax3' class='search'>
                <option value='+' <?php if($Tax[3]=="+")echo "selected=\"selected\""; ?>>+</option>
                <option value='-' <?php if($Tax[3]=="-")echo "selected=\"selected\""; ?>>-</option>
                </select>
                %<input name='tax0[]' type='text' value='<?php echo number_format($Tax[0],2); ?>' class='search' id='tax0' size='5' />
                =
                <?php echo $BL->conf['symbol']; ?>
                <input name='tax1[]' type='text' value='<?php echo $BL->toCurrency($Tax[1]); ?>' class='search' id='tax1' size='10' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php } ?>
            <?php } ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' /></div></td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['total_tax']." (".$BL->conf['symbol'].")"; ?> 
                </div>
                <div id="form1_field">
                <input name='tax_amount' type='text' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['tax_amount'];}else echo "0"; ?>' class='search' id='tax_amount' size='20' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Gross_Amount']; ?> (<?php echo $BL->conf['symbol']; ?>)
                </div>
                <div id="form1_field">
                <input name='gross_amount' type='text' class='search' id='gross_amount' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['gross_amount'];} ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <?php 
            if(isset($Invoice[0]['pay_curr_factor']) && $Invoice[0]['pay_curr_factor']!=1 && $Invoice[0]['pay_curr_factor']!=0){
                $curr_conf                    = array();
                $curr_conf['symbol_prefixed'] = $Invoice[0]['pay_curr_symbol_prefixed'];
                $curr_conf['symbol']          = $Invoice[0]['pay_curr_symbol'];
                $curr_conf['decimals']        = $Invoice[0]['pay_curr_decimal_number'];
                $curr_conf['str1']            = $Invoice[0]['pay_curr_decimal_str'];
                $curr_conf['str2']            = $Invoice[0]['pay_curr_thousand_str']; 
            ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['currency']; ?>
                </div>
                <div id="form1_field">
                <input name='pay_curr_name' type='text' class='search' id='pay_curr_name' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['pay_curr_name'];} ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['symbol']; ?>
                </div>
                <div id="form1_field">
                <input name='pay_curr_symbol' type='text' class='search' id='pay_curr_symbol' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['pay_curr_symbol'];} ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['currency_rate']; ?>
                </div>
                <div id="form1_field">
                <input name='pay_curr_factor' type='text' class='search' id='pay_curr_factor' size='20' value='<?php if($cmd=="editinvoice"){echo $Invoice[0]['pay_curr_factor'];} ?>' />
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['curr_symbol_position']; ?>
                </div>
                <div id="form1_field"> 
                    <select name='pay_curr_symbol_prefixed' id='pay_curr_symbol_prefixed' class="search">
                    <option value="1" <?php  if($cmd=="editinvoice" && $Invoice[0]['pay_curr_symbol_prefixed']==1)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['Prefixed']; ?></option>
                    <option value="0" <?php  if($cmd=="editinvoice" && $Invoice[0]['pay_curr_symbol_prefixed']==0)echo "selected=\"selected\""; ?>><?php echo $BL->props->lang['Suffixed']; ?></option>
                    </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['decimal_number']; ?>
                </div>
                <div id="form1_field"> 
                  <select name="pay_curr_decimal_number" id="pay_curr_decimal_number" size="1">
                  <?php for($i=0;$i<=6;$i++){ ?>
                    <option value="<?php echo $i; ?>" <?php if($cmd=="editinvoice" && $i==$Invoice[0]['pay_curr_decimal_number'])echo "selected=\"selected\""; ?>><?php echo $i; ?></option>
                  <?php } ?>
                  </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['decimal_str']; ?>
                </div>
                <div id="form1_field">
                  <select name="pay_curr_decimal_str" id="pay_curr_decimal_str" size="1">
                    <option value="," <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']==',')echo "selected=\"selected\""; ?>>,</option>
                    <option value="." <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']=='.')echo "selected=\"selected\""; ?>>.</option>
                    <option value="'" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']=='\'')echo "selected=\"selected\""; ?>>'</option>
                    <option value="’" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']=='’')echo "selected=\"selected\""; ?>>’</option>
                    <option value=" " <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']==' ')echo "selected=\"selected\""; ?>>[<?php echo $BL->props->lang['blank']; ?>]</option>
                    <option value="" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_decimal_str']=='')echo "selected=\"selected\""; ?>>[<?php echo $BL->props->lang['none']; ?>]</option>
                  </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['thousand_str']; ?>
                </div>
                <div id="form1_field"> 
                  <select name="pay_curr_thousand_str" id="pay_curr_thousand_str" size="1">
                    <option value="," <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']==',')echo "selected=\"selected\""; ?>>,</option>
                    <option value="." <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']=='.')echo "selected=\"selected\""; ?>>.</option>
                    <option value="'" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']=='\'')echo "selected=\"selected\""; ?>>'</option>
                    <option value="’" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']=='’')echo "selected=\"selected\""; ?>>’</option>
                    <option value=" " <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']==' ')echo "selected=\"selected\""; ?>>[<?php echo $BL->props->lang['blank']; ?>]</option>
                    <option value="" <?php if($cmd=="editinvoice" && $Invoice[0]['pay_curr_thousand_str']=='')echo "selected=\"selected\""; ?>>[<?php echo $BL->props->lang['none']; ?>]</option>
                  </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Total_amount_in'].$Invoice[0]['pay_curr_name']."(".$Invoice[0]['pay_curr_symbol'].")"; ?>
                </div>
                <div id="form1_field">
                <b><?php echo $BL->toCurrency($Invoice[0]['pay_curr_factor']*$Invoice[0]['gross_amount'],$curr_conf,1); ?></b>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>                  
            <?php } ?>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                <?php echo $BL->props->lang['Payment_processor']; ?>
                </div>
                <div id="form1_field">
                <select name='payment_method' class='search' id='payment_method'>
                <?php foreach ($BL->pg as $key => $value) {
                        if ($BL->pp_active[$value] == "Yes") {
                            if ($cmd == "editinvoice" && $Invoice[0]['payment_method'] == $value) {
                ?>
                <option value='<?php echo $value; ?>' selected="selected"><?php echo $BL->pg_name[$value]; ?></option>
                <?php }else{ ?>
                <option value='<?php echo $value; ?>'><?php echo $BL->pg_name[$value]; ?></option>
                <?php  } } } ?>
                </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_icon_dot.gif' width='32' height='18' />
                </div>
                </td>
                <td class='text_grey'>
                <div id="form1_label"><?php echo $BL->props->lang['Status']; ?></div>
                <div id="form1_field">
                <select name='status' class='search'>
                <?php foreach ($BL->props->invoice_status as $k => $v) {
                	if ($cmd == "editinvoice" && $Invoice[0]['status'] == $v)
                    {
                		echo "<option value=\"".$v."\" selected=\"selected\">".$BL->props->lang[$v]."</option>";
                    }
                	else
                    {
                		echo "<option value=\"".$v."\">".$BL->props->lang[$v]."</option>";
                    }
                }
                ?>
                </select>
                </div>
                </td>
            </tr>
            <tr> 
                <td colspan='2' class='text_grey'>
                <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen-long.jpg' width='100%' height='1' />
                </td>
            </tr>
            <tr> 
                <td width="1%" class='text_grey'>
                <div align='center'>&nbsp;</div>
                </td>
                <td class='text_grey'>
                <div id="form1_label">
                &nbsp;
                </div>
                <div id="form1_field">
                <?php if ($cmd == "editinvoice") { ?>
                <input type='hidden' name='invoice_no' value='<?php echo $REQUEST['invoice_no']; ?>' />
                <?php }else{ ?>
                <input type='hidden' name='sub_id' value='<?php echo $REQUEST['sub_id']; ?>' />
                <?php } ?>
                <input type='hidden' name='cmd' value='<?php echo $cmd; ?>' />
                <input name='submit' type='submit' class='search1' value='<?php if($cmd=="editinvoice")echo $BL->props->lang['Update'];else echo $BL->props->lang['add']; ?>' />
                </div>
                </td>
            </tr>
            </table>
            </td>
        </tr>
        </table>
        </form>
	</div>
</div>
<!--end content -->
<div id="navBar">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td class='text_grey'>
            <a href='info.php?cmd=PRINT&invoice_no=<?php echo $REQUEST['invoice_no']; ?>' target='_blank'><b><?php echo $BL->props->lang['Print']; ?></b></a>
        </td>
    </tr>
    <tr> 
        <td class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen.jpg' width='100%' height='2' />
        </td>
    </tr>
    <tr>
        <td class='text_grey'>
            <a href='info.php?cmd=PDF&invoice_no=<?php echo $REQUEST['invoice_no']; ?>' target='_blank'><b><?php echo $BL->props->lang['Download_PDF']; ?></b></a>
        </td>
    </tr>
    <tr> 
        <td class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen.jpg' width='100%' height='2' />
        </td>
    </tr>
    <tr>
        <td class='text_grey'>
            <a href='<?php echo $PHP_SELF; ?>?cmd=editinvoice&action=sendinvoice&invoice_no=<?php echo $REQUEST['invoice_no']; ?>'><b><?php echo $BL->props->lang['Send_Invoice']; ?></b></a>
        </td>
    </tr>
    <tr> 
        <td class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen.jpg' width='100%' height='2' />
        </td>
    </tr>
    <tr>
        <td class='text_grey'>
            <a href='<?php echo $PHP_SELF; ?>?cmd=editinvoice&action=sendpaymentnotice&invoice_no=<?php echo $REQUEST['invoice_no']; ?>'><b><?php echo $BL->props->lang['Send_Payment_Reciept']; ?></b></a>
        </td>
    </tr>
    <tr> 
        <td class='text_grey'>
            <img src='elements<?php echo PATH_SEP; ?>default<?php echo PATH_SEP; ?>templates<?php echo PATH_SEP; ?>alp_admin<?php echo PATH_SEP; ?>images<?php echo PATH_SEP; ?>menu_line_lightgreen.jpg' width='100%' height='2' />
        </td>
    </tr>
</table>
<?php include_once $BL->props->get_page("templates/alp_admin/html/_sidepanel.php"); ?>
</div>
<!--end navbar -->
<?php include_once $BL->props->get_page("templates/alp_admin/html/footer.php"); ?>