<?php
	$kitchen_ord = $pref['pos_restaurant_mode'] == 1 ? "<div class='payment_arrow_btn' id='print_kitchen_order'><img src='".$path_to_root."/modules/pos/css/printer_white.svg' width='25' title='"._('Print Kitchen Order')."'/> ".pos_print_link(@$_SESSION['table'], _("&Kitchen Order"), true, ST_KITCHENORDER, false, 'printlink', 'prtopt')."</div>" : '';
	$bill_print = $pref['pos_restaurant_mode'] == 1 ? "<div class='payment_arrow_btn' id='pos_bill_print_btn'><img src='".$path_to_root."/modules/pos/css/printer_white.svg' width='25' title='"._('Print Bill')."'/> ".pos_print_link(@$_SESSION['table'], _("&Bill"), true, ST_POSBILL, false, 'printlink', 'prtopt')."</div>" : '';
	$remain_amt_restaurant = $pref['pos_restaurant_mode'] == 1 ? "<center><h2 id='remain_amount'></h2></center>" : '';
	$remain_amt = $pref['pos_restaurant_mode'] != 1 ? "<h2 id='remain_amount'></h2>" : '';
?>

<div id='payment_panel'>

	<div id="arrow_wrapper">
		<div class="payment_arrow_btn" id="back_to_bill"><?php echo '<< '._('Back');?></div>
		<?php echo $kitchen_ord; echo $bill_print; echo $remain_amt; ?>
		<div class="payment_arrow_btn" id="processPayment" name="processPayment"><?php echo _('Process Payment'); ?></div>
		<button type="submit" class="hidden_btn" name="update" id="update"></button>
		<button type="submit" class="hidden_btn" name="process_payment" id="process_payment"></button>
	</div>

	<?php echo $remain_amt_restaurant; ?>

	<div id="payment_content">
		
		<div class="pos_payment_body" id="pos_payment_left">
			<div id="payment_items_wrapper">
				<table id="payment_items_table">
					<tr>
						<th><?php echo _('To Account'); ?></th>
						<th><?php echo _('Amount'); ?></th>
						<th><?php echo _('Total'); ?></th>
					</tr>
				</table>
			</div>
			<div id="pos_cash_refund">
				<table>
					<tr>
						<th align="center" width="50%"><?php echo _('Cash Tendered'); ?></th>
						<th align="center" width="50%"><?php echo _('Refund'); ?></th>
					</tr>
					<tr>
						<th align="center" id="pos_tendered">0</th>
						<th align="center" id="pos_refund">0</th>
					</tr>
				</table>
			</div>
		</div>
		<div class="pos_payment_body" id="pos_payment_right">
			<table id="payment_add_bank">
				<tr>
					<td>
						<div id='pos_bank_selector'>
						<?php
						if(get_company_pref('pos_restaurant_mode') == 1) {

							$curr_pos = $_SESSION['wa_current_user']->pos;

							$myrow1 = get_sales_point($curr_pos);
							$cash_account = $myrow1['pos_account'];
							$cash_acc_name = get_bank_account($cash_account)['bank_account_name'];

							$myrow2 = get_pos_credit_account($curr_pos);
							$bank_account = $myrow2['account'];
							$bank_acc_name = get_bank_account($bank_account)['bank_account_name'];

							echo "<div class='pos_payment_type_btn selected_method' btn='pt_cash' account='".$cash_account."' acc_name='".$cash_acc_name."'>"._('Cash Payment')."</div>";
							echo "<div class='pos_payment_type_btn' btn='pt_bank' account='".$bank_account."' acc_name='".$bank_acc_name."'>"._('Bank Payment')."</div>";
						}
						else
							echo bank_accounts_list('bank_name');
						?>
						</div>
					</td>
				</tr>
				<tr>
					<td><div id="payment_amount_cell"></div></td>
				</tr>
				<tr>
					<td>
						<div id="total_disc_wrapper">
							<center>
								<?php echo _('Discount:'); ?>
								<input type="text" name="pmt_dsc" id="pmt_dsc">
								<input type="radio" name="dsc_type" value="%" checked><?php echo _('%'); ?>&nbsp
								<input type="radio" name="dsc_type" value="amt"><?php echo _('amount'); ?>&nbsp
							</center>
						</div>
					</td>
				</tr>
			</table>
			<table id="payment_keyboard">
				<tr>
					<td class="pos_cal_btn" btn="import" id="import_remains" rowspan="3">&#8681;</td>
					<td class="pos_cal_btn" colspan="2" btn="p_amt">AMT</td>
					<td class="pos_cal_btn" colspan="2" btn="p_dsc">DISC</td>
				</tr>
				<tr>
					<td class="pos_cal_btn">1</td>
					<td class="pos_cal_btn">2</td>
					<td class="pos_cal_btn">3</td>
					<td class="pos_cal_btn" btn="add10">+10</td>
				</tr>
				<tr>
					<td class="pos_cal_btn">4</td>
					<td class="pos_cal_btn">5</td>
					<td class="pos_cal_btn">6</td>
					<td class="pos_cal_btn" btn="add20">+20</td>
				</tr>
				<tr>
					<td class="pos_cal_btn" id="add_payment_item" rowspan="2"><?php echo '&#8617;'."<br/>"._('Enter'); ?></td>
					<td class="pos_cal_btn">7</td>
					<td class="pos_cal_btn">8</td>
					<td class="pos_cal_btn">9</td>
					<td class="pos_cal_btn" btn="add50">+50</td>
				</tr>
				<tr>
					<td class="pos_cal_btn" btn="c">C</td>
					<td class="pos_cal_btn">0</td>
					<td class="pos_cal_btn">.</td>
					<td class="pos_cal_btn" btn="del">&larr;</td>
				</tr>
			</table>
		</div>
	</div>

</div>