/
home
/
u718748226
/
domains
/
saraswatihousingco.com
/
public_html
/
admin
/
Upload File
HOME
<?php session_start(); require("config.php"); if(!isset($_SESSION['auser'])) { header("location:index.php"); } ///code $error=""; $msg=""; if(isset($_POST['insert'])) { $name=$_POST['name']; $address=$_POST['address']; $email=$_POST['email']; $phone=$_POST['phone']; $date=$_POST['date']; $project_no=$_POST['project_no']; $flat_no=$_POST['flat_no']; $flat_value=$_POST['flat_value']; $remarks=$_POST['remarks']; if(!empty($name)){ $sql="insert into advanced (name,address,email,phone,date,project_no,flat_no,flat_value,remarks) values('$name','$address','$email','$phone','$date','$project_no','$flat_no','$flat_value','$remarks')"; $result=mysqli_query($con,$sql); if($result) { $msg="<p class='alert alert-success'>Advance Inserted Successfully</p>"; } else { $error="<p class='alert alert-warning'>* Advance Not Inserted</p>"; } } else{ $error = "<p class='alert alert-warning'>* Fill all the Fields</p>"; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0"> <title>SRHousing - Advance Paid List Tables</title> <!-- Favicon --> <link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.png"> <!-- Bootstrap CSS --> <link rel="stylesheet" href="assets/css/bootstrap.min.css"> <!-- Fontawesome CSS --> <link rel="stylesheet" href="assets/css/font-awesome.min.css"> <!-- Feathericon CSS --> <link rel="stylesheet" href="assets/css/feathericon.min.css"> <!-- Datatables CSS --> <link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap4.min.css"> <link rel="stylesheet" href="assets/plugins/datatables/responsive.bootstrap4.min.css"> <link rel="stylesheet" href="assets/plugins/datatables/select.bootstrap4.min.css"> <link rel="stylesheet" href="assets/plugins/datatables/buttons.bootstrap4.min.css"> <!-- Main CSS --> <link rel="stylesheet" href="assets/css/style.css"> <!--[if lt IE 9]> <script src="assets/js/html5shiv.min.js"></script> <script src="assets/js/respond.min.js"></script> <![endif]--> </head> <body> <!-- Main Wrapper --> <!-- Header --> <?php include("header.php");?> <!-- /Sidebar --> <!-- Page Wrapper --> <div class="page-wrapper"> <div class="content container-fluid"> <!-- Page Header --> <div class="page-header"> <div class="row"> <div class="col"> <h3 class="page-title">Advance Paid</h3> <ul class="breadcrumb"> <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li> <li class="breadcrumb-item active">Advance Paid</li> </ul> </div> </div> </div> <!-- /Page Header --> <!-- Advance Paid add section --> <!----End Advance Paid add section ---> <!----view Advance Paid ---> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-header"> <h4 class="card-title">Advance Paid List for Customer</h4> </div> <div class="card-body"> <table id="basic-datatable" class="table table-bordered table-hover"> <thead> <tr> <th>#</th> <th>Advance Paid Name</th> <th>Address</th> <th>Email</th> <th>Phone</th> <th>Date</th> <th>Project No.</th> <th>Flat No.</th> <th>Amount(Rs.)</th> <th>Remarks</th> <th>Actions</th> </tr> </thead> <tbody> <?php $query=mysqli_query($con,"select * from advanced"); $cnt=1; while($row=mysqli_fetch_row($query)) { $query2=mysqli_query($con,"select * from project_master where projid = '" . $row['6'] . "'"); while($row2=mysqli_fetch_row($query2)) { $project_name = $row2['1'] ."--". $row2['3']; } ?> <tr> <td><?php echo $cnt; ?></td> <td><?php echo $row['1']; ?></td> <td><?php echo $row['2']; ?></td> <td><?php echo $row['3']; ?></td> <td><?php echo $row['4']; ?></td> <td><?php echo $formattedDate = date("d-m-Y", strtotime($row['5'])); ?></td> <td><?php echo $project_name; ?></td> <td><?php echo $row['7']; ?></td> <td><?php echo $row['8']; ?></td> <td><?php echo $row['9']; ?></td> <td><a href="advancedpayment.php?id=<?php echo $row['0']; ?>"><img src="payment.jpg" alt="Paymentt" width="30" height="30"></a> <a href="advancedpayview.php?id=<?php echo $row['0']; ?>"><img src="view.jpg" alt="View" width="30" height="30"></a></td> </tr> <?php $cnt=$cnt+1; } ?> </tbody> </table> </div> </div> </div> </div> <!-- view state --> </div> </div> <!-- /Main Wrapper --> <!--- <label class="col-lg-3 col-form-label">State Name</label> <div class="col-lg-9"> <select class="form-control"> <option>Select</option> <option>Option 1</option> <option>Option 2</option> <option>Option 3</option> <option>Option 4</option> <option>Option 5</option> </select> </div> ----> <!-- jQuery --> <script src="assets/js/jquery-3.2.1.min.js"></script> <!-- Bootstrap Core JS --> <script src="assets/js/popper.min.js"></script> <script src="assets/js/bootstrap.min.js"></script> <!-- Slimscroll JS --> <script src="assets/plugins/slimscroll/jquery.slimscroll.min.js"></script> <!-- Datatables JS --> <!-- Datatables JS --> <script src="assets/plugins/datatables/jquery.dataTables.min.js"></script> <script src="assets/plugins/datatables/dataTables.bootstrap4.min.js"></script> <script src="assets/plugins/datatables/dataTables.responsive.min.js"></script> <script src="assets/plugins/datatables/responsive.bootstrap4.min.js"></script> <script src="assets/plugins/datatables/dataTables.select.min.js"></script> <script src="assets/plugins/datatables/dataTables.buttons.min.js"></script> <script src="assets/plugins/datatables/buttons.bootstrap4.min.js"></script> <script src="assets/plugins/datatables/buttons.html5.min.js"></script> <script src="assets/plugins/datatables/buttons.flash.min.js"></script> <script src="assets/plugins/datatables/buttons.print.min.js"></script> <!-- Custom JS --> <script src="assets/js/script.js"></script> <script> // Attach a change event listener to the select element $("#project_no").change(function() { var selectedValue = $(this).val(); // Get the selected value // Use jQuery AJAX to send the data to the server $.ajax({ url: 'submit_data.php', // The server-side script URL type: 'POST', // Use the POST method data: { optionValue: selectedValue, }, // Data to send success: function(response) { // This function runs on a successful AJAX request $("#flat_no").val(response); console.log("Success:", response); }, error: function(error) { // This function runs if the AJAX request fails $("#flat_no").val("Nil"); console.log("Error:", error); } }); }); </script> </body> </html>