/
var
/
www
/
html
/
stengineers
/
admin
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once('dbconnection.php'); error_reporting(0); include 'header.php'; ?> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h1 class="h3 mb-2 text-gray-800">Contact Request List</h1> <!-- DataTales Example --> <div class="card shadow mb-4"> <div class="card-header py-3"> <!-- <h6 class="m-0 font-weight-bold text-primary">DataTables Example</h6> --> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0"> <thead> <tr> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Budget</th> <th>Comments</th> <th>Action</th> </tr> </thead> <tfoot> <tr> <th>Name</th> <th>Email</th> <th>Phone</th> <th>Budget</th> <th>Comments</th> <th>Action</th> </tr> </tfoot> <tbody id="table_id"> <?php $s = "select * from contact"; $res = mysqli_query($con, $s); $num = mysqli_num_rows($res); if ($num == 0) { echo '<tr> <td colspan="6">No Datas Found</td> </tr>'; } else { $carr = array(); $sql = "select * from contact"; $selected = mysqli_query($con, $sql); while($row = mysqli_fetch_array($selected)) { $id = $row['id']; $name = $row['name']; $email = $row['email']; $phone = $row['phone']; $budget = $row['budget']; $comments = $row['comments']; echo "<tr> <td>$name</td> <td>$email</td> <td>$phone</td> <td>$budget</td> <td>$comments</td> <td style='white-space: nowrap;'> <a class='btn btn-danger btn-circle btn-sm' onclick='deleteData($id)'> <i class='fas fa-trash'></i> </a> </td> </tr>"; } } ?> </tbody> </table> </div> </div> </div> </div> <!-- /.container-fluid --> <script type="text/javascript"> function refreshData(){ $("#table_id").load(window.location + " #table_id"); } function deleteData(id){ var id = id; var getData; $.ajax({ url: 'api/contact.php', type: 'POST', data:{id:id,action:"contactdelete", referer:"ezioaws"}, success: function (response) { var responseObject = JSON.parse(response); // console.log(responseObject.name,"response"); console.log(response,"response"); window.location.href="contact.php"; // refreshData(); } }); } </script> <?php include 'footer.php'?>