<?php
include('header.php');
if (isset($_GET['id']) && $_GET['id'] != NULL) {
    $id = base64_decode($_GET['id']);
    mysqli_set_charset($conn,"utf8");
    $res = mysqli_query($conn, "SELECT * FROM `dmanual` WHERE id='$id'");
    $data = mysqli_fetch_assoc($res);
}


if (isset($_POST['ahkweb'])  && $_POST['ahkweb'] == "ahkwebsolutions") {
    $name = mysqli_real_escape_string($conn,$_POST['name']);
    $dob = mysqli_real_escape_string($conn,$_POST['dob']);
    $aadhar = mysqli_real_escape_string($conn, $_POST['aadhar']);
    $regno = mysqli_real_escape_string($conn, $_POST['regno']);
    $hus_name = mysqli_real_escape_string($conn, $_POST['hus_name']);
    $hus_aadhar = mysqli_real_escape_string($conn, $_POST['hus_aadhar']);
    $father_name = mysqli_real_escape_string($conn, $_POST['father_name']);
    $father_aadhar = mysqli_real_escape_string($conn, $_POST['father_aadhar']);
    $mother_name = mysqli_real_escape_string($conn, $_POST['mother_name']);
    $mother_aadhar = mysqli_real_escape_string($conn, $_POST['mother_aadhar']);
    $permanent_address = mysqli_real_escape_string($conn, $_POST['permanent_address']);
    $death_address = mysqli_real_escape_string($conn, $_POST['death_address']);
 

    $username = $_SESSION['phone'];
    mysqli_set_charset($conn,"utf8");
    $ires = mysqli_query($conn,"UPDATE `dmanual` SET `name`='$name',`dob`='$dob',`aadharno`='$aadhar',`regno`='$regno',`mname`='$mother_name',`maadhar`='$mother_aadhar',`fname`='$father_name',`faadhar`='$father_aadhar',`birthaddress`='$death_address',`permanentaddress`='$permanent_address',`hwname`='$hus_name',`hwaadhar`='$hus_aadhar' WHERE username='$username' AND id='$id'");

    if($ires){
        ?>
        <script>
            $(function(){
                Swal.fire(
                    'Success',
                    'Data Updated Successfully',
                    'success'
                )
            });
        </script>
        <?php
    }else{
        ?>
        <script>
            $(function(){
                Swal.fire(
                    'Opps',
                    'Internal Server Error Please try Agin Later',
                    'error'
                )
            });
        </script>
        <?php
    }
}
?>

    
    

<style>
/* ===================== PAGE BACKGROUND ===================== */
body{
    background:linear-gradient(135deg,#0f2027,#203a43,#2c5364);
    font-family:"Poppins",sans-serif;
    min-height:100vh;
}

/* ===================== PAYMENT CARD ===================== */
.payment-form{
    max-width:1400px;
    margin:40px auto;
    background:linear-gradient(135deg,#ffffff,#f4f7ff);
    padding:25px 30px;
    border-radius:18px;
    box-shadow:0 20px 50px rgba(0,0,0,.35);
    position:relative;
}

/* TOP BORDER GLOW */
.payment-form::before{
    content:'';
    position:absolute;
    top:0;
    left:0;
    right:0;
    height:6px;
    background:linear-gradient(135deg,#11998e,#38ef7d);
    border-radius:18px 18px 0 0;
}

/* ===================== HEADING ===================== */
.payment-form h1{
    text-align:center;
    font-weight:800;
    color:#1e3c72;
    margin-bottom:25px;
    letter-spacing:1px;
}

/* ===================== LABEL ===================== */
.payment-form label{
    font-weight:600;
    color:#2c3e50;
    margin-bottom:6px;
}

/* ===================== INPUTS (ALL TYPES) ===================== */
.payment-form input[type="text"],
.payment-form input[type="password"],
.payment-form input[type="email"],
.payment-form input[type="number"],
.payment-form select,
.payment-form textarea{
    width:100%;
    padding:14px 16px;
    margin-bottom:15px;
    border-radius:30px;
    border:1px solid #d0d7ff;
    font-size:15px;
    transition:all .3s ease;
    box-shadow:inset 0 2px 6px rgba(0,0,0,.08);
    background:#fff;
}

/* PLACEHOLDER */
.payment-form input::placeholder,
.payment-form textarea::placeholder{
    color:#999;
    font-weight:500;
}

/* ===================== FOCUS EFFECT ===================== */
.payment-form input[type="text"]:focus,
.payment-form input[type="password"]:focus,
.payment-form input[type="email"]:focus,
.payment-form input[type="number"]:focus,
.payment-form select:focus,
.payment-form textarea:focus{
    outline:none;
    border-color:#396afc;
    box-shadow:0 0 0 3px rgba(57,106,252,.25);
}

/* ===================== BUTTON ===================== */
.payment-form button,
.payment-form input[type="submit"]{
    width:100%;
    padding:14px;
    margin-top:10px;
    border-radius:30px;
    font-weight:700;
    font-size:16px;
    border:none;
    cursor:pointer;
    background:linear-gradient(135deg,#11998e,#38ef7d);
    color:#fff;
    box-shadow:0 6px 18px rgba(0,0,0,.35);
    transition:all .25s ease;
}

/* BUTTON HOVER */
.payment-form button:hover,
.payment-form input[type="submit"]:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 28px rgba(0,0,0,.45);
}

/* ===================== CARD BODY / FOOTER ===================== */
.payment-form .card-body{
    padding:0;
}

.payment-form .card-footer{
    background:none;
    border:none;
    padding-top:10px;
}

/* ===================== INFO & ALERT ===================== */
.bg-info{
    background:linear-gradient(135deg,#396afc,#2948ff)!important;
    color:#fff;
    font-weight:700;
    padding:10px;
    border-radius:10px 0 0 10px;
}

.bg-danger{
    background:linear-gradient(135deg,#ff416c,#ff4b2b)!important;
    color:#fff;
    padding:10px;
    border-radius:0 10px 10px 0;
}

/* ===================== MARQUEE ===================== */
.marquee{
    font-weight:600;
    letter-spacing:.5px;
}

/* ===================== TEXT ===================== */
.payment-form p{
    color:#2c3e50;
    font-size:14px;
}

/* ===================== QR POPUP ===================== */
.qr-popup{
    display:none;
    position:fixed;
    top:80px;
    left:50%;
    transform:translateX(-50%);
    width:320px;
    background:#ffffff;
    padding:20px;
    border-radius:18px;
    text-align:center;
    border:4px solid #38ef7d;
    box-shadow:0 15px 40px rgba(0,0,0,.45);
    z-index:9999;
}

.qr-popup img{
    max-width:220px;
    margin:15px auto;
}

.qr-popup button{
    background:linear-gradient(135deg,#ff416c,#ff4b2b);
    border-radius:25px;
}

/* ===================== MOBILE ===================== */
@media(max-width:768px){
    .payment-form{
        margin:20px;
        padding:20px;
    }
}
</style>
		 <div class="payment-form">

                        <!-- form start -->
                        <form method="post" action="" autocomplete="off" enctype="multipart/form-data">
                            <input type="hidden" name="_token" value="1TDde6CMH369W5RCLWCgTOjV8fR50kKPMlAfDgjN"> <input type="hidden" name="_method" value="PUT">
                            <input type="hidden" name="ahkweb" value="ahkwebsolutions">
                            <div class="card-body row">

                                       <div class="form-group col-md-6">
							   <label for="aadhar">नाम / Name</label>
								<input type="text" class="form-control" id="name" name="name" placeholder="Name" value="<?php echo $data['name'] ?>">
								
							</div>
                            <div class="form-group col-md-6">
                                    <label for="aadhar">मृत्यु तिथि / Date of Death</label>
                                    <input type="text" class="form-control" id="dob" name="dob" placeholder="dob" value="<?php echo $data['dob'] ?>">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="aadhar">आधार नंबर / Aadhar Number</label>
                                    <input type="text" class="form-control" id="aadhar" name="aadhar" placeholder="AADHAR NUMBER" value="<?php echo $data['aadharno'] ?>">
                                </div>

                                <div class="form-group col-md-12">
                                    <label for="date_of_death">मृत्यु का स्थान / Place of Death <span class="text-danger">*</span></label>
                                    <input type="text" class="form-control" id="date_of_death" name="date_of_death" placeholder="PLACE OF BIRTH" value="<?php echo $data['placeofbirth'] ?>" required="">
                                </div>

                                <div class="form-group col-md-6">
                                    <label>पति / पत्नी का नाम / NAME OF HUSBAND / WIFE</label>
                                    <input type="text" required class="form-control" name="hus_name" placeholder="FNAME OF HUSBAND / WIFE" value="<?php echo $data['hwname'] ?>">
                                </div>
                                <div class="form-group col-md-6">
                                    <label for="exampleInputPassword1">पति / पत्नी का आधार संख्या / HUSBAND / WIFE AADHAAR NO</label>
                                    <input type="text" maxlength="12" class="form-control" name="hus_aadhar" placeholder="HUSBAND / WIFE AADHAAR NO" value="<?php echo $data['hwaadhar'] ?>">
                                </div>


                                <div class="form-group col-md-6">
                                    <label for="father_name">पिता का नाम / Father Name <span class="text-danger">*</span></label>
                                    <input type="text" class="form-control" id="father_name" name="father_name" placeholder="FATHER NAME" value="<?php echo $data['fname'] ?>" required="">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="father_aadhar">पिता का आधार / Father Aadhar</label>
                                    <input type="text" class="form-control" id="father_aadhar" name="father_aadhar" placeholder="FATHER AADHAR" value="<?php echo $data['faadhar'] ?>">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="mother_name">माता का नाम / Mother Name <span class="text-danger">*</span></label>
                                    <input type="text" class="form-control" id="mother_name" name="mother_name" placeholder="MOTHER NAME" value="<?php echo $data['mname'] ?>" required="">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="mother_aadhar">माता का आधार / Mother Aadhar</label>
                                    <input type="text" class="form-control" id="mother_aadhar" name="mother_aadhar" placeholder="MOTHER AADHAR" value="<?php echo $data['maadhar'] ?>">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="permanent_address">स्थायी पता / Permanent Address <span class="text-danger">*</span></label>
                                    <input type="text" class="form-control" id="permanent_address" name="permanent_address" placeholder="PERMANENT ADDRESS" value="<?php echo $data['permanentaddress'] ?>" required="">
                                </div>

                                <div class="form-group col-md-6">
                                    <label for="death_address">मृत्यु के समय पता / Address at time of death <span class="text-danger">*</span></label>
                                    <input type="text" class="form-control" id="death_address" name="death_address" placeholder="ADDRESS OF BIRTH" value="<?php echo $data['birthaddress'] ?>" required="">
                                </div>
                                   <div class="form-group col-md-12">
								<label for="regno">पंजीकरण संख्या / REGISTRATION NUMBER<span class="text-danger">*</span></label>
								<input type="text" class="form-control" id="regno" name="regno" placeholder="REGISTRATION" value="<?php echo $data['regno'] ?>" required="">
							</div>
                          
                       
                            </div>
                            <!-- /.card-body -->

                            <div class="card-footer text-right pt-3 pb-3 mt-2">
                                <button type="submit" class="btn btn-primary btn-lg">Update</button>
                            </div>
                        </form>
                    </div>
                    <!-- /.card -->
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->


</div>

</div>
<!-- ./wrapper -->

<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>

<!-- Select2 -->
<script src="plugins/select2/js/select2.full.min.js"></script>

<!-- SweetAlert -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/limonte-sweetalert2/8.11.8/sweetalert2.all.min.js"></script>

<!-- DataTables  & Plugins -->
<script src="plugins/datatables/jquery.dataTables.min.js"></script>
<script src="plugins/datatables-bs4/js/dataTables.bootstrap4.min.js"></script>
<script src="plugins/datatables-responsive/js/dataTables.responsive.min.js"></script>
<script src="plugins/datatables-responsive/js/responsive.bootstrap4.min.js"></script>
<script src="plugins/datatables-buttons/js/dataTables.buttons.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.bootstrap4.min.js"></script>

<script src="plugins/datatables-buttons/js/buttons.html5.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.print.min.js"></script>
<script src="plugins/datatables-buttons/js/buttons.colVis.min.js"></script>

<!-- ChartJS -->
<script src="plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="plugins/sparklines/sparkline.js"></script>
<!-- JQVMap -->
<script src="plugins/jqvmap/jquery.vmap.min.js"></script>
<script src="plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
<!-- jQuery Knob Chart -->
<script src="plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="dist/js/pages/dashboard.js"></script>

<script src="https://code.jquery.com/ui/1.13.0/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.3/jquery.validate.min.js" integrity="sha512-37T7leoNS06R80c8Ulq7cdCDU5MNQBwlYoy1TX/WUsLFC2eYNqtKlV0QjH7r8JpG/S0GUMZwebnVFLPd6SU5yg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-toast-plugin/1.3.2/jquery.toast.min.js" integrity="sha512-zlWWyZq71UMApAjih4WkaRpikgY9Bz1oXIW5G0fED4vk14JjGlQ1UmkGM392jEULP8jbNMiwLWdM8Z87Hu88Fw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

<script>
    function alertMessage(type, message) {
        if (type == 'error') {
            type = 'danger';
        }

        return "<div class='alert alert-" + type + " alert-dismissible'> <a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a> " + message + " </div>";
    }
</script>


</body>

</html>