<?php
include "headerLink.php";
$property_id = $_GET["property_id"];
 ?>
<!DOCTYPE html>
<html lang="en">


<body class="animsition">
    <div class="page-wrapper">
        <!-- HEADER MOBILE-->
        <?php include "menuSideBar_mobile.php" ;?>
        <!-- END HEADER MOBILE-->
		
        <!-- MENU SIDEBAR-->
        <?php include "menuSideBar.php" ;?>
        <!-- END MENU SIDEBAR-->

        <!-- PAGE CONTAINER-->
        <div class="page-container">
            <!-- HEADER DESKTOP-->
			<?php include "headerPage.php"?>
            <!-- END HEADER DESKTOP-->
			
			<!-- MAIN CONTENT-->
            <div class="main-content"  >
                <div class="section__content section__content--p30" >
                    <div class="container-fluid" >
                        <!-- menu show on page after selected - start -->
                        <?php include "selectedMenuSubMenu.php"?>
						<!-- menu show on page after selected - end -->
						<div class="row" >
							<!--<img src="images/icon/website under contruction.jpg" alt="PAYPRO-V3" />-->
							<?php 
							if($_SESSION["projectLocation"] == ""){
								?>
								<button type="button" class="btn btn-warning">
									<i class="fa fa-map-marker"></i>&nbsp; Please select location </button>
								<?php
							}
							else if($_SESSION["projectLocation"] != ""){
							?>
                            <div class="col-lg-12">
								<div class="col-lg-12">
									<div class="card">
										<div class="card-header">
											<strong>Properties - Additional Info </strong> Form
											<span>
												<form action="properties_viewPropertyRecord.php?menu=<?php echo  $_SESSION["menu"]?>&submenu=<?php echo $_SESSION["submenu"]?>" method="post">
													<input type="hidden" name="projectLocation" value="<?php echo $_SESSION["projectLocation"]?>">
													<input type="hidden" name="property_id" value="<?php echo $property_id?>">
													<button class="btn btn-warning btn-sm" >Skip</button>
												</form>
											</span>
										</div>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">Fire Insurances</h3>
											</div>
											<hr>
											<form action="properties_addtionalinfo_save.php" method="post" novalidate="novalidate" enctype="multipart/form-data" >
												<input type="hidden" name="projectLocation" value="<?php echo $_SESSION["projectLocation"]?>">
												<input type="hidden" name="menu" value="<?php echo $_SESSION["menu"]?>">
												<input type="hidden" name="submenu" value="<?php echo $_SESSION["submenu"]?>">
												<input type="hidden" name="property_id" value="<?php echo $property_id?>">
												<div class="row">
													<div class="col-6">
														<div class="form-group">
															<label class="control-label mb-1">Policy Year</label>
															<input  name="policy_year" type="text" class="form-control" value="<?php echo $_SESSION['policy_year']?>" >
														</div>
													</div>
													<div class="col-6">
														<label  class="control-label mb-1">Policy No:</label>
														<div class="input-group">
															<input  name="policy_no" type="text" class="form-control" value="<?php echo $_SESSION['policy_no']?>" >
														</div>
													</div>
												</div>
												<div class="row">
													<div class="col-6">
														<div class="form-group">
															<label  class="control-label mb-1">Start</label>
															<input  name="policy_start" type="date" class="form-control" value="<?php echo $_SESSION['policy_start_cover']?>" >
														</div>
													</div>
													<div class="col-6">
														<label  class="control-label mb-1">End</label>
														<div class="input-group">
															<input  name="policy_end" type="date" class="form-control" value="<?php echo $_SESSION['policy_end_cover']?>" >
														</div>
													</div>
												</div>
												<div class="row">
													<div class="col-6">
														<div class="form-group">
															<label  class="control-label mb-1">Total Cover (RM):</label>
															<input  name="policy_total_cover" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['policy_start_cover']?>" >
														</div>
													</div>
													<div class="col-6">
														<label  class="control-label mb-1">Type Of Use:</label>
														<div class="input-group">
															<input  name="policy_type_of_used" type="text" class="form-control" value="<?php echo $_SESSION['policy_end_cover']?>" >
														</div>
													</div>
												</div>
												<div class="row">
													<div class="col-6">
														<div class="form-group">
															<label  class="control-label mb-1">Upload File</label>
															<input  name="policy_file_attachment" type="file" class="form-control-file"  >
														</div>
													</div>
												</div>
											
										</div>
										<hr>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">CUKAI PINTU</h3>
											</div>
											<hr>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label class="control-label mb-1">Year:</label>
														<input  name="cukaipintu_year" type="text" class="form-control" value="<?php echo $_SESSION['cukaipintu_year']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Account No.:</label>
													<div class="input-group">
														<input  name="cukaipintu_account_no" type="text" class="form-control" value="<?php echo $_SESSION['cukaipintu_account_no']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Amount Charges (RM):</label>
														<input  name="cukaipintu_charges" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['policy_start_cover']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Due Date:</label>
													<div class="input-group">
														<input  name="cukaipintu_duedate" type="date" class="form-control" value="<?php echo $_SESSION['cukaipintu_duedate']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Upload File</label>
														<input  name="cukaipintu_file_attachment" type="file" class="form-control-file"  >
													</div>
												</div>
											</div>
										</div>
										<hr>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">CUKAI TANAH / PETAK</h3>
											</div>
											<hr>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label class="control-label mb-1">Year:</label>
														<input  name="cukaitanahpetak_year" type="text" class="form-control" value="<?php echo $_SESSION['cukaitanahpetak_year']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Account No.:</label>
													<div class="input-group">
														<input  name="cukaitanahpetak_account_no" type="text" class="form-control" value="<?php echo $_SESSION['cukaitanahpetak_account_no']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Amount Charges (RM):</label>
														<input  name="cukaitanahpetak_charges" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['cukaitanahpetak_charges']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Due Date:</label>
													<div class="input-group">
														<input  name="cukaitanahpetak_duedate" type="date" class="form-control" value="<?php echo $_SESSION['cukaitanahpetak_duedate']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Upload File</label>
														<input  name="cukaitanahpetak_file_attachment" type="file" class="form-control-file"  >
													</div>
												</div>
											</div>
										</div>
										<hr>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">MAINTENANCE FEE & SINKING FUND</h3>
											</div>
											<hr>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label class="control-label mb-1">Maintenance Fee Charges (RM):</label>
														<input  name="MF_charges" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['MF_charges']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Sinking Fund Charges (RM):</label>
													<div class="input-group">
														<input  name="SF_charges" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['SF_charges']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Due Date:</label>
														<input  name="MFSF_duedate" type="date"  class="form-control" value="<?php echo $_SESSION['MFSF_duedate']?>" >
													</div>
												</div>
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Upload File</label>
														<input  name="MFSF_file_attachment" type="file" class="form-control-file"  >
													</div>
												</div>
											</div>
										</div>
										<hr/>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">INDAH WATER KONSORTIUM (IWK)</h3>
											</div>
											<hr>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label class="control-label mb-1">Account No.:</label>
														<input  name="iwk_account_no" type="text" step="0.01" class="form-control" value="<?php echo $_SESSION['iwk_account_no']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Amount Charges (RM):</label>
													<div class="input-group">
														<input  name="iwk_charges" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['iwk_charges']?>" >
													</div>
												</div>
											</div>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Due Date:</label>
														<input  name="MFSF_duedate" type="date"  class="form-control" value="<?php echo $_SESSION['MFSF_duedate']?>" >
													</div>
												</div>
												<div class="col-6">
													<div class="form-group">
														<label  class="control-label mb-1">Upload File</label>
														<input  name="MFSF_file_attachment" type="file" class="form-control-file"  >
													</div>
												</div>
											</div>
										</div>
										<hr>
										<div class="card-body">
											<div class="card-title">
												<h3 class="text-center title-2">MARKET VALUE</h3>
											</div>
											<hr>
											<div class="row">
												<div class="col-6">
													<div class="form-group">
														<label class="control-label mb-1">Year</label>
														<input  name="mv_year" type="text"  class="form-control" value="<?php echo $_SESSION['mv_year']?>" >
													</div>
												</div>
												<div class="col-6">
													<label  class="control-label mb-1">Value (RM):</label>
													<div class="input-group">
														<input  name="mv_RM" type="number" step="0.01" class="form-control" value="<?php echo $_SESSION['mv_RM']?>" >
													</div>
												</div>
											</div>
										</div>
										<div class="card-footer">
											<button type="submit" class="btn btn-primary btn-sm" name="submit">
												<i class="fa fa-dot-circle-o"></i> Submit
											</button>
											<button type="reset" class="btn btn-danger btn-sm">
												<i class="fa fa-ban"></i> Reset
											</button>
										</div>
										</form>
									</div>
								</div>
							
							<?php } ?>
                        </div>
                        
                        
                        
                    </div>
					<?PHP include "footer.php";?>
                </div>
            </div>
            <!-- END MAIN CONTENT-->
            <!-- END PAGE CONTAINER-->
        </div>
		
    </div>
    <?PHP include "footerLink.php";?>
</body>

</html>

<script type="text/javascript">

function addNewLinkAcc(){
	//alert();
	var divWrap = document.createElement('div');
	var div1 = document.createElement('div');
	var div2 = document.createElement('div');
	var div3 = document.createElement('div');
    divWrap.className = 'row form-group';
    div1.className = 'col col-md-3';
    div2.className = 'col-12 col-md-6';
    div3.className = 'col col-md-3';
	divWrap.id = 'divRow';
	div3.id = 'deleteButton';
	
	var div1_html = "<label for='text-input' class='form-control-label'>&nbsp;</label>";
	var div2_html = "<input type='text' name='child_unit_no[]'  id='child_unit_no' size='25' required='Please type childs unit no.' class='form-control' placeholder='Please type childs unit no. '>";
	var div3_html = "<span class='help-block'><a href='#' id='del' onclick='deleteRow(this)'><i class='fas fa-minus-square' ></a></i></span>";
	
	div1.innerHTML = div1_html;
	div2.innerHTML = div2_html;
	div3.innerHTML = div3_html;
	
	divWrap.append(div1,div2,div3);
	document.getElementById("input_unitNo").appendChild(divWrap);	
	
}
function deleteRow(row){ 
	
	var x = document.querySelectorAll("#deleteButton");
	
	var remove = function(){
		this.parentNode.remove();
	};

	var button = document.querySelectorAll('#del');
	for (var i = 0, len = x.length; i < len; i++) {
		x[i].addEventListener('click', remove, false);
	}


}


document.getElementById("skipParentsUnit").onclick = function() {myFunction()};

function myFunction() {
	if(document.getElementById("propertiesParentsUnit_input").disabled === true){
		document.getElementById("propertiesParentsUnit_input").removeAttribute("disabled");
		document.getElementById("propertiesParentsUnit_input").setAttribute("required","required");
	}
	else{
		document.getElementById("propertiesParentsUnit_input").setAttribute("disabled","disabled");
		document.getElementById("propertiesParentsUnit_input").removeAttribute("required");
		
	}
		
}


function leaseholdClick(){
  document.getElementById('leaseholdClick').style.display ='block';
}
function freeholdClick(){
  document.getElementById('leaseholdClick').style.display ='none';
}
function tambahCatatanClick(){
  document.getElementById('tambahCatatanClick').style.display ='block';
}
</script>
<!-- end document-->
