<div class="container no-padding">
	<div class="row">
		<div class="col-xs-12">&nbsp;</div>
		<div class="col-xs-12"><h2>Payment Details</h2></div>
		<div class="col-xs-12">
			<table>
				<tr>
					<td colspan='3'><h3>Client Details</h3></td>
				</tr>
				<tr>
					<td><label>Client:&nbsp;</label></td>
					<td colspan='2'><span><?php echo($row['client_full_name']); ?></span></td>
				</tr>
				<tr>
					<td><label>Address:&nbsp;</label></td>
					<td colspan='2'><span><?php printClientAddress($row['address_id']) ?></span></td>
				</tr>
				<!--
				<tr>
					<td><label>Cell No:&nbsp;</label></td>
					<td colspan='2'>
						<span>
							<a href="tel:<?php echo(SableGeneralFunctions::removeSpaces($row['client_phone'])); ?>">
								<?php echo($row['client_phone']); ?>
							</a>
						</span>
					</td>
				</tr>
				-->
				<tr>
					<td colspan='3'>&nbsp;</td>
				</tr>					
				<tr>
					<td colspan='3'><h3>Payment Details</h3></td>
				</tr>
				
				<?php
				if ($row['bs_completed']) {
				?>
				<tr>
					<td><label>Service Total:&nbsp;</label></td>
					<td colspan='2'>
						<span><?php printTotalDue($bsid, $row['client_id']) ?></span>
					</td>
				</tr>
				<tr>
					<td><label>Current Balance:&nbsp;</label></td>
					<td colspan='2'>
						<span><?php printCurrentBalance($row['client_id']) ?></span>
					</td>
				</tr>				
				<?php
				} else {
				?>
				<tr>
					<td><label>Current Balance:&nbsp;</label></td>
					<td colspan='2'>
						<span><?php printCurrentBalance($row['client_id']) ?></span>
					</td>
				</tr>				
				<tr>
					<td><label>Amount Due:&nbsp;</label></td>
					<td colspan='2'>
						<span><?php printTotalDue($bsid, $row['client_id']) ?></span>
					</td>
				</tr>
				<tr>
					<td><label>Payment Method:&nbsp;</label></td>
					<td colspan='2'>
						<div class="forms-grid">
							<div class="dropdown">
								<?php
									$params							= [];
									$params['table_name']			= 'payment_method';
									$params['value_field_name']		= 'pm_id';
									$params['caption_field_name']	= 'pm_name';
									$params['selected_value']		= 0;
									$params['select_title']			= 'Select Method';
									$params['where_clause']			= '';
								?> 								
								<select name="selPMId" type="select" id="selPMId" onfocus="showHint('selPMId');" onChange="showHideAmount()"
										onblur="hideHint('selPMId');" onkeypress="handleEnter(this, event)" placeholder="Payment Method">
									<?php SableDBFunctions::printOptionsAdv($params); ?>
								</select>
							</div>
							<div class="fieldHint hintUnder" id="hint_selPMId">Confirmation required.</div>
						</div>
					</td>
				</tr>
				<tr id="trCashAmount" style="display:none;">
					<td><label>Cash Amount:&nbsp;</label></td>
					<td colspan='2'>
						<div class="forms-grid">
							<input name="edtCashAmount" type="number" step="0.01" id="edtCashAmount" onfocus="showHint('edtCashAmount');" 
									onblur="hideHint('edtCashAmount');" onkeypress="handleEnter(this, event)" placeholder="<?php printTotalDue($bsid, $row['client_id']) ?>">
							<div class="fieldHint hintUnder" id="hint_edtCashAmount">Enter cash amount received.</div>
						</div>
					</td>
				</tr>				
				<tr>
					<td colspan='3'>&nbsp;</td>
				</tr>
				<tr>
					<td><label>Confirm:&nbsp;</label></td>
					<td colspan='2'>
						<div>
						These services were conducted &amp; completed on <?php echo($serviceDate->format('Y-m-d')); ?><br>
						</div>						
						<div class="forms-grid">
							<div class="switch">
								<input name="cbConfirm" type="checkbox" id="cbConfirm" 
									   class="form-toggle form-toggle-yes-no" onfocus="showHint('cbConfirm');" onblur="hideHint('cbConfirm'); validate_cbConfirm()"  
									   placeholder="Confirmation required." onkeypress="handleEnter(this, event)"/>
								<label for="cbConfirm" data-on="Yes" data-off="No"></label>
							</div>
							<div class="fieldHint hintUnder" id="hint_cbConfirm">Confirmation required.</div>
						</div>
					</td>
				</tr>
				<tr>
					<td colspan='3'>&nbsp;</td>
				</tr>
				<tr>
					<td width="35%" class="forms-grid">
						<input type="button" id="btnCancel" value="Cancel" class="submit" onclick="window.location.reload();"/>
					</td>
					<td width="35%" class="forms-grid">
						<input id="btnOk" type="button" onclick="addServiceTransaction(<?php echo($bsid); ?>);" 
							   value="Add Payment" class="submit"/>
					</td>
					<td width="30%">&nbsp;</td>
					</td>
				</tr>
				<?php
				}
				?>
			</table>
		</div>
	</div>
</div>
	