Preview: add_contact.php
Size: 31.19 KB
/home/urbanman/hindustansecurity.in/admin/add_contact.php
<?php
error_reporting(0);
include("common.php");
include("config.php");
$id = $_GET[id];
$r7 = sprintf("SELECT * from contact_book WHERE id = '$id'");
$res_y = $conn->query($r7);
$row=mysqli_fetch_assoc($res_y);
?>
<style>
.btn5{
padding:2px;
background-color:#125924;
color:#fff;
border-radius:2px;
padding-left:10px;padding-right:10px;
border:2px solid #125924;
box-shadow:0 4px 10px 0 rgba(0,0,0,0.3);
width:160px;
}
</style>
<style>
.btn6{
padding:2px;
background-color:#4a3937;
color:#fff;
border-radius:2px;
padding-left:10px;padding-right:10px;
border:2px solid #4a3937;
box-shadow:0 4px 10px 0 rgba(0,0,0,0.3);
width:120px;
}
</style>
<!-- START: Template CSS-->
<link rel="stylesheet" href="dist/vendors/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="dist/vendors/jquery-ui/jquery-ui.min.css">
<link rel="stylesheet" href="dist/vendors/jquery-ui/jquery-ui.theme.min.css">
<link rel="stylesheet" href="dist/vendors/simple-line-icons/css/simple-line-icons.css">
<link rel="stylesheet" href="dist/vendors/flags-icon/css/flag-icon.min.css">
<link rel="stylesheet" href="dist/vendors/flag-select/css/flags.css">
<!-- END Template CSS-->
<!-- START: Page CSS-->
<link rel="stylesheet" href="dist/vendors/quill/quill.snow.css" />
<!-- END: Page CSS-->
<!-- START: Custom CSS-->
<link rel="stylesheet" href="dist/css/main.css">
<!-- END: Custom CSS-->
<!-- START: Main Content-->
<main>
<div class="container-fluid">
<!-- START: Breadcrumbs-->
<div class="row ">
<div class="col-12 align-self-center">
<div class="sub-header mt-3 py-3 px-3 align-self-center d-sm-flex w-100 rounded">
<?php if($_GET[id]==""){?>
<div class="w-sm-100 mr-auto"><h5 class="mb-0"> Contact Book </h5></div>
<a href="add_contact.php?flag=add">
<span style="float:right"><button class="btn5"> Add New Contact </button></span>
</a>
<?php } else {?>
<div class="w-sm-100 mr-auto"><h5 class="mb-0">Update Contact Book</h5></div>
<?php } ?>
<?php
if($_GET[flag]=="del") {?>
<center><div style="font-size:16px;" id="myData" >
<span class="label label-success">
<font color="red">Record deleted successfully!</font></span></font></div></center> <br/>
<?php }
if($_GET[flag]=="dn") {?>
<center><div style="font-size:16px;" id="myData" >
<span class="label label-success">
<font color="green">Record added successfully!</font></span></font></div></center> <br/>
<?php }
if($_GET[flag]=="up") {?>
<center><div style="font-size:16px;" id="myData" >
<span class="label label-success">
<font color="blue">Record updated successfully!</font></span></font></div></center> <br/>
<?php }
?>
</div>
</div>
</div>
<!-- END: Breadcrumbs-->
<!-- START: Card Data-->
<?php if($_GET[flag]=='add'){?>
<div class="row">
<div class="col-12 col-sm-12 mt-2">
<div class="card">
<div class="card-body">
<form class="form-row" action="submit-contact-book.php" method="post" enctype="multipart/form-data" autocomplete="off">
<div class="form-group col-md-12">
<td style="width:3%"> <b>Personal Information </b> </td>
<td> </td>
</div>
<div class="form-group col-md-2">
<td> Group Name <span style="float:right"><a href="add_group.php" target="_blank"><b>+ Add New </b></a></span> </td>
<td> <select class="form-control" name="group_name" id="group_name">
<option value="">- Select -</option>
<?php
$sql1=sprintf("select * from group_typ ORDER BY id");
$rowptdata = $conn->query($sql1);
while($data = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $data[group_name];?>"><?php echo stripslashes($data[group_name]);?></option>
<?php }?>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Person Name <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[first_name];?>" placeholder="Enter" required name="first_name"></td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Middle Name </td>
<td> <input type="text" class="form-control" value="<?php echo $row[middle_name];?>" placeholder="Enter" name="middle_name"></td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Last Name <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[last_name];?>" placeholder="Enter" required name="last_name"></td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Gender </td>
<td>
<select class="form-control" name="gender" id="gender" >
<option value="">- Select -</option>
<option value="Male"<?php if ($row[gender]=="Male") echo 'selected="selected"';?>> Male</option>
<option value="Female"<?php if ($row[gender]=="Female") echo 'selected="selected"';?>> Female</option>
</select>
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Mobile Number 01<font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[phone1];?>" placeholder="Phone 01" required name="phone1">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Mobile Number 02 </td>
<td> <input type="text" class="form-control" value="<?php echo $row[phone2];?>" placeholder="Phone 02" name="phone2">
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Email Id 01 </td>
<td> <input type="email" class="form-control" value="<?php echo $row[email];?>" placeholder="Enter" name="email">
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Email Id 02 </td>
<td> <input type="email" class="form-control" value="<?php echo $row[email2];?>" placeholder="Enter" name="email2">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Website URL </td>
<td> <input type="text" class="form-control" value="<?php echo $row[website];?>" placeholder="Enter" name="website">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Set Birth Date </td>
<td> <input type="date" class="form-control" value="<?php echo $row[bday];?>" placeholder="Enter" name="bday">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Set Anniversary Date </td>
<td> <input type="date" class="form-control" value="<?php echo $row[anidate];?>" placeholder="Enter" name="anidate">
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> Person Photo </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="photo_copy">
<?php if($_GET[id]!=""){?>
<img src="<?php echo $uploadpath.$row['photo_copy']; ?>" class="img-fluid" style="border-radius:50%" width="60px" >
<?php } ?>
</td>
</div>
<div class="form-group col-md-12">
<td style="width:3%"> <b>Permanent Address </b> </td>
<td> </td>
</div>
<div class="form-group col-md-4">
<td style="width:3%"> Address/Location </td>
<td> <input type="text" class="form-control" value="<?php echo $row[address];?>" placeholder="Enter" id="permanentAddress" name="address">
</td>
</div>
<!--<div class="form-group col-md-2">
<td> Select Country Type <font color="red">*</font> </td>
<td> <select class="form-control" name="country_typ" id="country_typ" onchange="one_id('ajax_country.php','cat_change_n3','country_typ','change_cat');" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from country_typ ORDER BY country_typname");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['country_typ']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[country_typname]);?></option>
<?php }?>
</select>
</td>
</div>
<div class="form-group col-md-2">
<td> Select Country <font color="red">*</font> </td>
<td>
<span id="cat_change_n3" > <select class="form-control" name="country" id="country" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from country ORDER BY country_name");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['country']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[country_name]);?></option>
<?php }?>
</select> </span>
</td>
</div> -->
<div class="form-group col-md-2">
<td style="width:3%"> State Name <font color="red">*</font> </td>
<td><select class="form-control" name="state" id="state" onchange="one_id('ajax.php','cat_change_n','state','change_cat');" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from state ORDER BY state");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['state_id']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[state]);?></option>
<?php }?>
</select> </td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> District Name <font color="red">*</font> </td>
<span id="cat_change_n" >
<td>
<select class="form-control" name="district" id="district" >
<!--<option value="<?php echo $row[district_id];?><?php if($rowdata['id']==$row['district_id']){echo 'selected="selected"';}?>"><?php echo $rowname[district_name];?></option>-->
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql7=sprintf("select * from district ORDER BY district_name");
$rowptdata = $conn->query($sql7);
while($metadis = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadis[id];?>" <?php if($metadis['id']==$row['district_id']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadis[district_name]);?></option>
<?php }?>
</select>
</td>
</span>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> City/Village <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[city];?>" placeholder="Enter" required id="city" name="city">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Pincode <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[pincode];?>" placeholder="Enter" required id="pincode" name="pincode">
</td>
</div>
<div class="form-group col-md-12">
<td style="width:3%"><b>Local Address</b></td>
<td>
<input type="checkbox" id="sameAsPermanent" name="same"> Same as Permanent Address
</td>
</div>
<div class="form-group col-md-4">
<td style="width:3%"> Address/Location </td>
<td> <input type="text" class="form-control" value="<?php echo $row[laddress];?>" placeholder="Enter" id="localAddress" name="laddress">
</td>
</div>
<!-- <div class="form-group col-md-2">
<td> Select Country Type <font color="red">*</font> </td>
<td> <select class="form-control" name="lcountry_typ" id="lcountry_typ" onchange="one_id('ajax_country.php','cat_change_n3','country_typ','change_cat');" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from country_typ ORDER BY country_typname");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['country_typ']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[country_typname]);?></option>
<?php }?>
</select>
</td>
</div>
<div class="form-group col-md-2">
<td> Select Country <font color="red">*</font> </td>
<td>
<span id="cat_change_n3" > <select class="form-control" name="lcountry" id="lcountry" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from country ORDER BY country_name");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['country']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[country_name]);?></option>
<?php }?>
</select> </span>
</td>
</div> -->
<div class="form-group col-md-2">
<td style="width:3%"> State Name <font color="red">*</font> </td>
<td><select class="form-control" name="lstate" id="lstate" onchange="one_id('ajax.php','cat_change_n','state','change_cat');" >
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql1=sprintf("select * from state ORDER BY state");
$rowptdata = $conn->query($sql1);
while($metadatatyp = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadatatyp[id];?>" <?php if($metadatatyp['id']==$row['state_id']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadatatyp[state]);?></option>
<?php }?>
</select> </td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> District Name <font color="red">*</font> </td>
<span id="cat_change_n" >
<td>
<select class="form-control" name="ldistrict" id="ldistrict" >
<!--<option value="<?php echo $row[district_id];?><?php if($rowdata['id']==$row['district_id']){echo 'selected="selected"';}?>"><?php echo $rowname[district_name];?></option>-->
<option value="" style="background-color:#A9E2F3">- Select -</option>
<?php
$sql7=sprintf("select * from district ORDER BY district_name");
$rowptdata = $conn->query($sql7);
while($metadis = mysqli_fetch_assoc($rowptdata)){ ?>
<option value="<?php echo $metadis[id];?>" <?php if($metadis['id']==$row['district_id']){echo 'selected="selected"';}?>>
<?php echo stripslashes($metadis[district_name]);?></option>
<?php }?>
</select>
</td>
</span>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> City/Village <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[lcity];?>" placeholder="Enter" required id="lcity" name="lcity">
</td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Pincode <font color="red">*</font> </td>
<td> <input type="text" class="form-control" value="<?php echo $row[lpincode];?>" placeholder="Enter" required id="lpincode" name="lpincode">
</td>
</div>
<div class="form-group col-md-12">
<td style="width:3%"> <b>Upload Document</b> </td>
<td> </td>
</div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value="aadharcard"<?php if ($row[doclist]=="aadharcard") echo 'selected="selected"';?>> Aadhar card</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> <font color="blue">Aadhar card</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="adharfile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value="T.C."<?php if ($row[doclist]=="T.C.") echo 'selected="selected"';?>> T.C.</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> <font color="blue">T.C.</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="tcfile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value="Marksheet"<?php if ($row[doclist]=="Marksheet") echo 'selected="selected"';?>> Marksheet</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"><font color="blue"> Marksheet </font>- Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="marksheetfile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control" >
<option value="Visiting Card"> Visiting Card</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> <font color="blue">Visiting card</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="vcardfile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value="Broucher"<?php if ($row[doclist]=="Broucher") echo 'selected="selected"';?>> Broucher</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"><font color="blue"> Broucher</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="brafile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value="Driving License"<?php if ($row[doclist]=="Driving License") echo 'selected="selected"';?>> Driving License</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> <font color="blue">Driving License</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="drifile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-2">
<td style="width:3%"> Document Name </td>
<td>
<select class="form-control">
<option value=""> Other Document</option>
</select>
</td>
</div>
<div class="form-group col-md-3">
<td style="width:3%"> <font color="blue">Other Document</font> - Upload Document </td>
<td> <input type="file" class="form-control" placeholder="Enter" name="otherfile"></td>
</div>
<div class="form-group col-md-6"></div>
<div class="form-group col-md-12">
<td style="width:3%"> Add Note </td>
<td> <input type="text" class="form-control" value="<?php echo $row[note];?>" placeholder="Enter" id="note" name="note">
</td>
</div>
<div class="form-group col-md-12">
<button type="submit" class="btn5" > Submit </button>
<?php $id = $row[id]; if($id==""){?>
<input type="hidden" value="add" name="mode" >
<?php }else{?>
<input type="hidden" value="<?php echo $id;?>" name="id" >
<?php }?>
</div>
</form>
</div>
</div>
</div>
</div>
<?php } ?>
<!-- END: Card DATA-->
<!-- START: Card Data-->
<div class="row">
<div class="col-12 mt-3">
<div class="card">
<div class="card-header justify-content-between align-items-center">
<h4 class="card-title">Contact List
</h4>
<span style="float:left">
<a href="welcome.php"><button class="btn6">Back to page</button> </a></span>
<span>
<input
type="text"
id="search"
placeholder="Search by name, phone, or email..."
oninput="fetchResults()"
style="margin-bottom: 10px; width: 100%; padding: 10px; border: 1px solid #ccc;"
/>
</span>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="example" class="display table dataTable table-striped table-bordered" >
<thead>
<tr>
<th>Sr</th>
<th>Person</th>
<th>Person Name</th>
<th> Action</th>
<th> </th>
</tr>
</thead>
<tbody id="result-body">
<?php
error_reporting(0);
include("config.php");
$query="select * from contact_book order by id desc";
$result = $conn->query($query);
while($data=mysqli_fetch_assoc($result)){
$count ++;
?>
<tr>
<td><?php echo $count;?></td>
<td>
<?php if($data['photo_copy']==''){?>
<img src="img/vouchersimg_1.png" class="img-fluid" style="border-radius:50%;width:50px;height:50px;" >
<?php } else {?>
<img src="<?php echo "../admin/".$uploadpath.$data['photo_copy']; ?>" class="img-fluid" style="border-radius:50%;width:50px;height:50px;" >
<?php } ?>
</td>
<td><?php echo ucfirst($data[gender_typ]);?>
<?php echo ucfirst($data[first_name]);?> <?php echo ucfirst($data[middle_name]);?> <?php echo ucfirst($data[last_name]);?>
<br> <?php echo $data[phone1];?> <?php if($data[phone2]!=''){ ?> / <?php echo $data[phone2];?> <?php } ?></td>
<td>
<a href="add_contact.php?id=<?php echo $data[id];?>&flag=add"><i class="fa fa-edit"></i></a>
<a class="btn3" title="delete" href="submit-contact-book.php?flag=del&id=<?php echo $data[id];?>"onclick="if(confirm('Do You Want To Delete This ?')){return true;}else{return false;}">
<i class="fa fa-trash icon-white"></i>
</a>
</td>
<td>
<a href="viewinfo.php?id=<?php echo $data[id];?>&flag=view"> <button class="btn5"> View Info </button> </a>
</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script>
function fetchResults() {
const searchValue = document.getElementById("search").value.trim();
if (searchValue === "") {
// Optionally reload original data when search is cleared
return;
}
const xhr = new XMLHttpRequest();
xhr.open("POST", "search_contact.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.onload = function () {
if (xhr.status === 200) {
const resultBody = document.getElementById("result-body");
if (xhr.responseText.trim() === "") {
resultBody.innerHTML = "<tr><td colspan='8'>No results found</td></tr>";
} else {
resultBody.innerHTML = xhr.responseText;
}
} else {
console.error("Error fetching data");
}
};
xhr.onerror = function () {
console.error("Request failed");
};
xhr.send("query=" + encodeURIComponent(searchValue));
}
</script>
</div>
</main>
<!-- END: Content-->
<script src="js/ajax.js"></script>
<!-- START: Template JS-->
<script src="dist/vendors/jquery/jquery-3.3.1.min.js"></script>
<script src="dist/vendors/jquery-ui/jquery-ui.min.js"></script>
<script src="dist/vendors/moment/moment.js"></script>
<script src="dist/vendors/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="dist/vendors/slimscroll/jquery.slimscroll.min.js"></script>
<script src="dist/vendors/flag-select/js/jquery.flagstrap.min.js"></script>
<!-- END: Template JS-->
<!-- START: APP JS-->
<script src="dist/js/app.js"></script>
<!-- END: APP JS-->
<!-- START: Page Vendor JS-->
<script src="dist/vendors/datatable/js/jquery.dataTables.min.js"></script>
<script src="dist/vendors/datatable/js/dataTables.bootstrap4.min.js"></script>
<script src="dist/vendors/datatable/jszip/jszip.min.js"></script>
<script src="dist/vendors/datatable/pdfmake/pdfmake.min.js"></script>
<script src="dist/vendors/datatable/pdfmake/vfs_fonts.js"></script>
<script src="dist/vendors/datatable/buttons/js/dataTables.buttons.min.js"></script>
<script src="dist/vendors/datatable/buttons/js/buttons.bootstrap4.min.js"></script>
<script src="dist/vendors/datatable/buttons/js/buttons.colVis.min.js"></script>
<script src="dist/vendors/datatable/buttons/js/buttons.flash.min.js"></script>
<script src="dist/vendors/datatable/buttons/js/buttons.html5.min.js"></script>
<script src="dist/vendors/datatable/buttons/js/buttons.print.min.js"></script>
<!-- END: Page Vendor JS-->
<!-- START: Page Script JS-->
<script src="dist/js/datatable.script.js"></script>
<!-- END: Page Script JS-->
<script>
document.getElementById("sameAsPermanent").addEventListener("change", function () {
const isChecked = this.checked;
// Get Permanent Address fields
const permanentAddress = document.getElementById("permanentAddress").value;
const permanentState = document.getElementById("state").value;
const permanentDistrict = document.getElementById("district").value;
const permanentCity = document.getElementById("city").value;
const permanentPincode = document.getElementById("pincode").value;
// Set values for Local Address fields
document.getElementById("localAddress").value = isChecked ? permanentAddress : '';
document.getElementById("lstate").value = isChecked ? permanentState : '';
document.getElementById("ldistrict").value = isChecked ? permanentDistrict : '';
document.getElementById("lcity").value = isChecked ? permanentCity : '';
document.getElementById("lpincode").value = isChecked ? permanentPincode : '';
// Add similar lines for other fields like state, district, taluka, etc.
});
</script>
</body>
</html>
Directory Contents
Dirs: 5 × Files: 42