<?php
	include("netcash_payment_func.php");
	$hddnNpId = $_SESSION['caller']['args'][1];
	if ($_SESSION['user']['access_level'] < SABLE_ACCESS_MANAGER)
	{
		SableGeneralFunctions::divertFromPage();
	}
	$row = $sableDB->getRow("select * from netcash_payment where np_id = ".$hddnNpId);
?>
<script src="<?php SableGeneralFunctions::printModuleJS('netcash_payment'); ?>"></script>

<!--// Netcash Payment -->
<form id="frmNetcashPayment" name="frmNetcashPayment" autocomplete="on">
	<input type="hidden" value="<?php echo(SableSystem::sableEncode($hddnNpId)); ?>" id="hddnNpId" name="hddnNpId" />
	<div class="forms">
		<div class="container forms-grids">
			<div class="row forms-grid">
				<div class="col-md-12">
					<h3 class="title"><i class="fa fa-edit" aria-hidden="true"></i>&nbsp;Modify Netcash Payment</h3>
					<p></p>
				</div>
			</div>
			<!--// selNpUser -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selNpUser" type="select" id="selNpUser" onfocus="showHint('selNpUser');" onblur="hideHint('selNpUser'); validate_selNpUser()" onkeypress="handleEnter(this, event)" placeholder="User">
<?php echo(SableDBFunctions::getOptions("user", "user_code", "user_surname", $row['np_user'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selNpUser">User</div>
				</div>
			</div>
			<p></p>
			<!-- selNpUser //-->
			<p></p>
			<!--// edtNpDate -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtNpDate" type="date" id="edtNpDate" onfocus="showHint('edtNpDate'); validate_edtNpDate();" onblur="hideHint('edtNpDate');" placeholder="Date" onkeypress="handleEnter(this, event);" value="<?php echo($row['np_date']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtNpDate">Date</div>
				</div>
			</div>
			<p></p>
			<!-- edtNpDate //-->
			<p></p>
			<!--// edtNpDescription -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtNpDescription" type="text" id="edtNpDescription" onfocus="showHint('edtNpDescription'); validate_edtNpDescription();" onblur="hideHint('edtNpDescription');" placeholder="Description" onkeypress="handleEnter(this, event);" value="<?php echo($row['np_description']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtNpDescription">Description</div>
				</div>
			</div>
			<p></p>
			<!-- edtNpDescription //-->
			<p></p>
			<!--// edtNpAmount -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<input name="edtNpAmount" type="number" id="edtNpAmount" class="mod"  onfocus="showHint('edtNpAmount'); validate_edtNpAmount();" onblur="hideHint('edtNpAmount');" placeholder="Amount" onkeypress="handleEnter(this, event);" value="<?php echo($row['np_amount']); ?>" >
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_edtNpAmount">Amount</div>
				</div>
			</div>
			<p></p>
			<!-- edtNpAmount //-->
			<p></p>
			<!--// selNpPaymentType -->
			<div class="row forms-grid">
				<div class="col-md-4 forms-grid">
					<div class="dropdown">
						<select name="selNpPaymentType" type="select" id="selNpPaymentType" onfocus="showHint('selNpPaymentType');" onblur="hideHint('selNpPaymentType'); validate_selNpPaymentType()" onkeypress="handleEnter(this, event)" placeholder="Payment Type">
<?php echo(SableDBFunctions::getOptions("netcash_pay_type", "pay_type_id", "pay_type_name", $row['np_payment_type'])); ?>
						</select>
					</div>
				</div>
				<div class="col-md-8">
					<div class="fieldHint" id="hint_selNpPaymentType">Payment Type</div>
				</div>
			</div>
			<p></p>
			<!-- selNpPaymentType //-->
			<p></p>
		<!--// buttons -->
			<div class="row forms-grid">
				<div class="col-md-2">
					<input type="button" id="btnCancel" value="Cancel"
					class="submit" onclick="window.location = '<?php SableSystem::printCallPageLink('/netcash_payment/'); ?>'"/>
				</div>
				<div class="col-md-2 forms-grid">
					<input id="btnOk" type="button" onclick="modifyNetcashPayment();" value="Update Netcash Payment" class="submit"/>
				</div>
			</div>
		<!-- buttons //-->
		</div>
	</div>
</form>
<!-- Netcash Payment //-->
