
  <!-- Begin Body -->

<div class="container-fluid" style="padding-top:100px; height:200px">
	<div class="row"><br/><br/></div>
	<div class="row">
      		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
              	   
						  <table id="postdated_checks_received_table" class="cell-border order-column compact hover"  style="width:100%;">
								<thead>
									<tr> 
										<th style="text-align:center;">&nbsp;</th>
										<th style="text-align:center;"><small>#</small></th>
										<th style="text-align:center;"><small>Date</small></th>
										<th style="text-align:center;"><small>Bank / Branch</small></th>
										<th style="text-align:center;"><small>CK #</small></th>
										<th style="text-align:center;"><small>Amount</small></th>
										<th style="text-align:center;"><small>Payment Mode</small></th> <!--3JAN23 sample -->
										<th style="text-align:center;"><small>Transcode</small></th> <!--3JAN23 sample -->
										<th style="text-align:center;"><small>Remarks</small></th>
										<th style="text-align:center;"><small>OR #</small></th>
										<th style="text-align:center;"><small>CK Processed / Validation Date</small></th> <!--9JUL25-->
										<th style="text-align:center;"><small>Status</small></th>
										<th style="text-align:center;"><small>Returned Check Reason</small></th>  <!--9JUL25-->
										<th style="text-align:center;"><small>Interest / Penalty</small></th> 
									</tr>
								</thead>
								<!--<tfoot>
									<tr> 
										<th style="text-align:center;">&nbsp;</th>
										<th style="text-align:center;"><small>#</small></th>
										<th style="text-align:center;"><small>Date</small></th>
										<th style="text-align:center;"><small>Bank / Branch</small></th>
										<th style="text-align:center;"><small>CK #</small></th>
										<th style="text-align:center;"><small>Amount</small></th>
										<th style="text-align:center;"><small>Payment Mode</small></th>  
										<th style="text-align:center;"><small>Transcode</small></th>  
										<th style="text-align:center;"><small>Remarks</small></th>
										<th style="text-align:center;"><small>OR #</small></th>
										<th style="text-align:center;"><small>CK Process Date</small></th>
										<th style="text-align:center;"><small>Status</small></th>
										<th style="text-align:center;"><small>Returned Check Reasons</small></th> 
										<th style="text-align:center;"><small>Interest / Penalty</small></th> 
									</tr>
								</tfoot>--> <!--23AUG24 removed footer caption from the table -->
						</table> 
      		</div>
  	</div>
</div>
<input type="hidden" value="<?=$mainrid?>" id="main_rid">



<div class="modal fade postdated_cheque_modal" tabindex="-1" role="dialog" aria-labelledby="postdatedModal" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">Postdated Checks Received for Equity</h4></div>
		<div class="modal-body">
		
<form role="form" id="postdated_checks_received_form" class="form-horizontal"  method="POST" autocomplete="on">
	<div class="container-fluid">
		<div class="row"><br/></div>
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_mode"><small>Payment Mode</small></label>
						<div class="col-md-8">
								<div class="radio">
								  <label><input type="radio" name="pdc_mode" class="pdc_mode" id="pdc_mode_cash" value="cash">Cash</label>
								  <label><input type="radio" name="pdc_mode" class="pdc_mode" id="pdc_mode_cheque" value="cheque">Cheque</label>
								  <label><input type="radio" name="pdc_mode" class="pdc_mode" id="pdc_mode_online" value="online">Online</label> <!-- 3JAN23 -->
								  <label><input type="radio" name="pdc_mode" class="pdc_mode" id="pdc_mode_counter" value="over_the_counter_deposit">Over the counter deposit</label> <!-- 22JUN25 -->
								</div> 
						</div>
					</div>
				</fieldset>
			</div>
			 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 hidecheckno">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-5 control-label text-left" for="pdc_no_cheque"><small># of Cheques</small></label>
						<div class="col-md-4"><input type="text" id="pdc_no_cheque" name="pdc_no_cheque" placeholder="# of Cheques" value="" class="form-control text-left"></div>
					</div>
				</fieldset>
			</div>
		</div>

		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_transcode_select"><small>Transcode</small></label> <!--3JAN23 sample-->
						<div class="col-md-8">
								 <select required id="pdc_transcode_select" name="pdc_transcode_select" class="form-control">
										<option value=""></option>
										<option value="Downpayment">Downpayment</option>
										<option value="Equity">Equity</option>
										<!--<option value="Re-Deposit">Re-Deposit</option>-->
										<!--<option value="Replacement Check">Replacement Check</option>-->
										<!--<option value="Partial Payment">Partial Payment</option>-->
										<!--<option value="Penalty & Interest">Penalty & Interest</option>-->
 								<!-- 14JUN25 START -->
										<option value="Loan Difference">Loan Difference</option> 
										<option value="Transfer Fee">Transfer Fee</option> 
										<option value="Re-docs Charge">Re-docs Charge</option> 
										<option value="Re-filing Fee">Re-filing Fee</option> 
								<!-- 14JUN25 END -->		
										<option value="Others">Others</option> 
									</select>
						</div>
					</div>
				</fieldset>
			</div>
			 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12"> 
			</div>
		</div>
		
		<div class="row"> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_date"><small>Date</small></label>
						<div class="col-md-8"><input type="text" id="pdc_date" style="cursor:pointer" name="pdc_date" readonly placeholder="MM/DD/YYYY" value="" class="form-control text-left whitebg datepicker"></div>
					</div>
				</fieldset>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-5 control-label text-right" for="pdc_bank"><small>Bank / Branch</small></label>
						<div class="col-md-7 input_container"><input type="text" id="pdc_bank" name="pdc_bank" placeholder="Bank / Branch" value="" class="form-control text-left auto_bank" onkeyup="autocomplet()">
						<ul id="bank_list_id"></ul>
						</div>
						  
					</div> 
				</fieldset>
			</div>
		</div>
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_ck"><small>CK #</small></label>
						<div class="col-md-8"><input type="text" id="pdc_ck" name="pdc_ck" placeholder="CK #" value="" class="form-control text-left"></div>
					</div>
				</fieldset>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-5 control-label text-right" for="pdc_amount"><small>Amount</small></label>
						<div class="col-md-7 input_container"><input type="text" id="pdc_amount" name="pdc_amount" placeholder="0.00" value="" class="form-control text-right" onblur = "javascript:this.value=Comma(this.value);" onkeypress="return isNumberKey(event)" onkeyup="autocomplet_amount3()">
						<ul class="amount_list_id"></ul>
						</div>
					</div> 
				</fieldset>
			</div>
		</div>
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-2 control-label text-left" for="pdc_remarks"><small>Remarks</small></label>
						<div class="col-md-10"><input type="text" id="pdc_remarks" name="pdc_remarks" placeholder="Remarks" value="" class="form-control text-left"></div>
					</div>
				</fieldset>
			</div> 
		</div>
	</div>
	<input type="hidden" id="pdc_action" name="pdc_action" value="create">
	<input type="hidden" id="pdc_id" name="pdc_id" value="">
</form>
		</div>
		<div class="modal-footer text-center center">
			<button id="pdc_save" type="button" class="btn btn-success" onclick="save_pdc();">Save</button>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button id="pdc_cancel" type="button" class="btn btn-default" >Cancel</button> 
		</div>
    </div>
  </div>
</div>


   
<!-----CHANGE CHECK STATUS------->
<div class="modal fade postdated_cheque_status_modal" tabindex="-1" role="dialog" aria-labelledby="postdatedStatusModal" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">Postdated Checks Received for Equity &nbsp;&nbsp;&nbsp;<small>Status</small></h4></div>
		<div class="modal-body">
<form role="form" id="postdated_checks_received_status_form" class="form-horizontal">
	<div class="container-fluid">
		<div class="row"><br/></div>
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_status_date"><small>Date</small></label>
						<div class="col-md-7"><input type="text" id="pdc_status_date" style="cursor:pointer" name="pdc_status_date" readonly placeholder="MM/DD/YYYY" value="" class="form-control text-left datepicker"></div>
					</div>
				</fieldset>
			</div> 
	 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_or_num"><small>OR Num</small></label>
						<div class="col-md-8">
							<input type="text" id="pdc_or_num" name="pdc_or_num" class="form-control">
						</div>
					</div>
				</fieldset>
			</div> 
		</div>
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_status_select"><small>Status</small></label>
						<div class="col-md-9">
							<select id="pdc_status_select" name="pdc_status_select" class="form-control">
								<option value=""></option>
								<option value="Cleared">Cleared</option>
								<option value="Past due Cleared">Past due Cleared</option>  <!--14JUN25 -->
								<option value="Hold">Hold</option>
								<!--<option value="No Check">No Check</option>
								<option value="Replacement">Check for Replacement</option>
								<option value="Due Date">Due Date</option>
								<option value="No Payment">No Payment</option>-->
								<option value="Returned">Returned due to DAIF</option>
								<option value="Closed">Returned due to Account Closed</option>
								<option value="Returned by Bank">Returned by Bank</option>
								<option value="Returned to Buyer">Returned to Buyer</option> 
							</select>
						</div>
					</div>
				</fieldset>
			</div> 
		</div>
		<div class="row show_return">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_status_remarks"><small>Remarks</small></label>
						<div class="col-md-7">
							<select id="pdc_status_remarks" name="pdc_status_remarks" class="form-control select2">
								<option value="">-</option>
								<option value="Insufficient Funds">Insufficient Funds</option>
								<option value="Closed Account">Closed Account</option> 
							</select>
						</div>
					</div>
				</fieldset>
			</div> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-4 control-label text-left" for="pdc_replace_option"><small>Option</small></label>
						<div class="col-md-8">
							<select id="pdc_replace_option" name="pdc_replace_option" class="form-control select2">
								<option value="">-</option>
								<option value="cash">Cash</option>
								<option value="cheque">Cheque</option> 
							</select>
						</div>
					</div>
				</fieldset>
			</div>
		</div>
		<!-------------CASH / CHEQUE OPTIONS---------------------->
		
		<div class="row replace_cash"><hr/></div> 
		<div class="row replace_cash"> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_date_replace_cash"><small>Date</small></label>
						<div class="col-md-7"><input type="text" id="pdc_date_replace_cash" style="cursor:pointer" name="pdc_date_replace_cash" readonly placeholder="MM/DD/YYYY" value="" class="form-control text-left datepicker"></div>
					</div>
				</fieldset>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-right" for="pdc_amount_replace_cash"><small>Amount</small></label>
						<div class="col-md-8 input_container"><input type="text" id="pdc_amount_replace_cash" name="pdc_amount_replace_cash" placeholder="0.00" value="" class="form-control text-right" onblur = "javascript:this.value=Comma(this.value);" onkeypress="return isNumberKey(event)" onkeyup="autocomplet_amount()">
						<ul class="amount_list_id"></ul> </div>
					</div> 
				</fieldset>
			</div>
		</div>
		
		<div class="row replace_cheque"><hr/></div> 
		<div class="row replace_cheque"> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_date_replace_cheque"><small>Date</small></label>
						<div class="col-md-7"><input type="text" id="pdc_date_replace_cheque" style="cursor:pointer" name="pdc_date_replace_cheque" readonly placeholder="MM/DD/YYYY" value="" class="form-control text-left datepicker"></div>
					</div>
				</fieldset>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-right" for="pdc_bank_replace_cheque"><small>Bank / Branch</small></label>
						<div class="col-md-8 input_container"><input type="text" id="pdc_bank_replace_cheque" name="pdc_bank_replace_cheque" placeholder="Bank / Branch" value="" class="form-control text-left auto_bank" onkeyup="autocomplet2()">
						<ul id="bank_list_id2"></ul>
						</div>
					</div> 
				</fieldset>
			</div>
		</div>
		<div class="row replace_cheque">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-3 control-label text-left" for="pdc_ck_replace_cheque"><small>CK #</small></label>
						<div class="col-md-7"><input type="text" id="pdc_ck_replace_cheque" name="pdc_ck_replace_cheque" placeholder="CK #" value="" class="form-control text-left"></div>
					</div>
				</fieldset>
			</div>
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset> 
					<div class="form-group">
						<label class="col-md-4 control-label text-right" for="pdc_amount_replace_cheque"><small>Amount</small></label>
						<div class="col-md-8 input_container"><input type="text" id="pdc_amount_replace_cheque" name="pdc_amount_replace_cheque" placeholder="0.00" value="" class="form-control text-right" onblur = "javascript:this.value=Comma(this.value);" onkeypress="return isNumberKey(event)" onkeyup="autocomplet_amount2()">
						<ul class="amount_list_id"></ul> </div>
					</div> 
				</fieldset>
			</div>
		</div> 
		
		<!----------------------------------->
		
		
	</div>
	<input type="hidden" id="pdc_status_action" name="pdc_status_action" value="edit">
	<input type="hidden" id="pdc_id" name="pdc_id" value="">
</form>
		</div>
		<div class="modal-footer text-center center">
			<button id="pdc_status_save" type="button" class="btn btn-success" onclick="save_pdc_status();">Save</button>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button id="pdc_status_cancel" type="button" class="btn btn-default" >Cancel</button> 
		</div>
    </div>
  </div>
</div>


<!-----MODAL popup----------->
<div id="pop_pdc_status_modal" class="modal fade" role="dialog">
  <div class="modal-dialog modal-sm"> 
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>
        <h4 class="modal-title"><span id="pdc_pop_title"></span>&nbsp;&nbsp;<small>Status</small></h4>
      </div>
      <div class="modal-body"> 
			<fieldset> 
				<div class="form-group">
					<label class="col-md-3 control-label text-right" for="pop_pdc_status_date"><small>Date</small></label>
					<div class="col-md-9"><input  type="text" id="pop_pdc_status_date" placeholder="MM/DD/YYYY" value="" class="form-control text-right datepicker" readonly name="pop_pdc_status_date"></div> 
				</div>
			</fieldset>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-success" id="pdc_status_date_save">Save</button>
      </div>
    </div>

  </div>
</div>







<!-----SHOW LIST OF RETURN CHECKS------->
<div class="modal fade return_cheque_status_modal" tabindex="-1" role="dialog" aria-labelledby="returnChequeStatusModal" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
		<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">Postdated Checks Received for Equity &nbsp;&nbsp;&nbsp;<small>Returned - Closed Account Status</small></h4></div>
		<div class="modal-body">
<form role="form" id="return_checks_received_status_form" class="form-horizontal">
	<div class="container-fluid">
		<div class="row"><br/></div>
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left"><small>Borrower</small></label>
						<div class="col-md-9">
							<div id="return_pdc_borrower"></div>
						</div>
					</div>
				</fieldset>
			</div> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left"><small>Bank</small></label>
						<div class="col-md-9">
							<div id="return_pdc_bank"></div>
						</div>
					</div>
				</fieldset>
			</div> 
		</div>
		
		<div class="row">
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left"><small>Block</small></label>
						<div class="col-md-9">
							<div id="return_pdc_block"></div>
						</div>
					</div>
				</fieldset>
			</div> 
			<div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
				<fieldset>
					<div class="form-group">
						<label class="col-md-3 control-label text-left"><small>Lot</small></label>
						<div class="col-md-9">
							<div id="return_pdc_lot"></div>
						</div>
					</div>
				</fieldset>
			</div> 
		</div>
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<fieldset>
					<div class="form-group"> 
						<div class="col-md-12">
							<div id="return_pdc_list"></div>
						</div>
					</div>
				</fieldset>
			</div> 
		</div>
	</div>
	<input type="hidden" id="pdc_return_status_action" name="pdc_return_status_action" value="edit">
	<input type="hidden" id="pdc_return_id" name="pdc_return_id" value=""> 
	<input type="hidden" id="pdc_return_rid" name="pdc_return_rid" value="">
	<input type="hidden" id="pdc_return_bank" name="pdc_return_bank" value="">
	<input type="hidden" id="pdc_return_ckno" name="pdc_return_ckno" value="">
	<input type="hidden" id="pdc_return_counter" name="pdc_return_counter" value="">
</form>
		</div>
		<div class="modal-footer text-center center">
			<button id="pdc_return_status_save" type="button" class="btn btn-success" onclick="save_pdc_return_status();">Save</button>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<button id="pdc_return_status_cancel" type="button" class="btn btn-default" >Cancel</button> 
		</div>
    </div>
  </div>
</div>




<script>
 

function updateReturnRemarks(remarks,pid){
	var newValue = remarks.value;

	 // Send to server via AJAX
        $.ajax({
          url: './ajax/update_postdated_returned_remarks.php',
          method: 'POST',
          data: {
            mainid: pid, 
            value: newValue
          },
          success: function (response) {
            alert('Saved successfully');
          },
          error: function () {
            alert('Failed to save'); 
          }
        });
}
</script>