/
var
/
www
/
html
/
stengineers
/
admin
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once 'dbconnection.php'; error_reporting(0); $imenu_active = "active"; include 'header.php'; ?> <!-- Begin Page Content --> <div class="container-fluid"> <!-- Page Heading --> <h1 class="h3 mb-2 text-gray-800">Home SEO List</h1> <p> <?php $s = "select * from index_seo"; $res = mysqli_query($con, $s); $num = mysqli_num_rows($res); // If there are no records, show the "Add SEO" button if ($num == 0) { echo '<a href="indexseo-add.php" class="btn btn-success btn-icon-split"> <span class="icon text-white-50"> <i class="fas fa-check"></i> </span> <span class="text">Add SEO</span> </a>'; } ?> </p> <!-- 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>Page Title</th> <th>Meta Descritpion</th> <th>Meta Tags</th> <th>Action</th> </tr> </thead> <tbody id="table_id"> <?php $sql = "select * from index_seo"; $selected = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($selected)) { $id = $row['id']; $pagetitle = $row['pagetitle']; $metadescription = $row['metadescription']; $metatags = $row['metatags']; echo "<tr> <td>$pagetitle</td> <td>$metadescription</td> <td>$metatags</td> <td style='white-space: nowrap;'> <a href='indexseo-edit.php?id=$id' class='btn btn-info btn-circle btn-sm'> <i class='fas fa-edit'></i> </a> <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; if (confirm('Are you sure you want to delete?')) { $.ajax({ url: 'api/seo-admin.php', type: 'POST', data: { id: id, action: "deleteseo", referer: "ezioaws" }, success: function(response) { var data = JSON.parse(response); console.log(data); if (data.status == 'success') { alert("Deleted Successfully") window.location.href = "home-seo.php"; } else { alert("Failed, Please try again later") } } }); } } </script> <?php include 'footer.php'?>