/home3/vehiclea/public_html/keerthiinsurance/mandal_edit.php
<?php
include 'sidelinks.php';
include 'header.php';
require_once "db.php";
if(!empty($_GET['edit']))
{
$select = "SELECT * from mandal where id = '".$_GET['edit']."'";
$query = mysqli_query($conn,$select);
$row= mysqli_fetch_array($query);
}
if(!empty($_POST['submit']))
{
$update = "UPDATE mandal set state='".$_POST['state']."', district = '".$_POST['district']."', mandal = '".$_POST['mandal']."',update_date = '".date('Y-m-d H:i:s')."' where id = '".$_POST['edit_data']."'";
$query1 = mysqli_query($conn,$update);
if(!empty($query1))
{
redirect("mandal.php?upd=1");
}
}
?>
<style type="text/css">
.whiteBg{
background: #EEEAEA;
}
</style>
<div class="container-fluid pt-4 px-4">
<div class="row g-6">
<div class="col-lg-12">
<div class="whiteBg rounded h-100 p-4">
<h6 class="mb-4">District Edit List</h6>
<form method="post">
<div class="row">
<div class="col-md-4">
<label class="form-label">State List</label>
<?php
$select_state = "SELECT * from state";
$stateqry = mysqli_query($conn,$select_state);
?>
<select id="state" name="state" class="form-control" required>
<option value="">Please Select State</option>
<?php
while($staterow = mysqli_fetch_array($stateqry)){
?>
<option value="<?= $staterow['state']?>" <?php if($staterow['state'] == $row['state']){ echo 'selected';}?>><?= $staterow['state']?></option>
<?php
}
?>
</select>
</div>
<div class="col-md-4">
<label class="form-label">District List</label>
<?php
$select_district = "SELECT * from district";
$districtqry = mysqli_query($conn,$select_district);
?>
<select id="district" name="district" class="form-control" required>
<option value="">Please Select district</option>
<?php
while($districtrow = mysqli_fetch_array($districtqry)){
?>
<option value="<?= $districtrow['district']?>" <?php if($districtrow['district'] == $row['district']){ echo 'selected';}?>><?= $districtrow['district']?></option>
<?php
}
?>
</select>
</div>
<div class="col-md-4">
<label class="form-label">Mandal List</label>
<input type="text" value="<?php echo $row['mandal']?>" name="mandal" id="mandal" class="form-control" placeholder="Enter Mandal">
</div>
<div class="mt-4">
<input type="hidden" name="edit_data" value="<?php echo $row['id']?>">
<input type="submit" class="btn btn-primary" value="Edit" name="submit">
</div>
</form>
</div>
</div>
</div>
<?php
include "footer.php";
?>
@LwBee Strong Bypass
Upload File
Create New File