D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
gurgaon.jaipurpartyplanner.in
/
admin
/
Filename :
searchajax.php
back
Copy
<?php include("connection.php"); ?> <?php $name = $_POST['name']; $name= preg_replace("#[^0-9a-z]#i","",$name); $sql = "SELECT * FROM category WHERE categoryName LIKE '$name%'"; $query = mysqli_query($conn,$sql); $data=''; while($row = mysqli_fetch_assoc($query)) { $data= " <table> <tr> <td>".$row['id']."</td> <td>".$row['categoryName']."</td> <td><img src='".$row['image']."' width='70' height='50' ></td> <td><span class='text-muted'><i class='fa fa-clock-o'></i>".$row['createDate']."</span></td> <td><button type='button' class='waves-effect waves-light btn btn-rounded btn-success mb-5 ed-btn'><a href='cat-edit.php?eid=".$row['id']."'>Edit</a></button></td> <td><button type='button' class='waves-effect waves-light btn btn-rounded btn-danger mb-5 ed-btn'><a onclick='openDeleteModal(<?php echo ".$row['id']."; ?>)' href='javascript:void(0);' data-bs-toggle='modal' data-bs-target='#delete-item'>Delete</a></button></td> </tr> <table> "; } echo $data; ?> <?php $name2 = $_POST['name']; $name2= preg_replace("#[^0-9a-z]#i","",$name2); $sql2 = "SELECT * FROM products WHERE title LIKE '$name2%'"; $query2 = mysqli_query($conn,$sql2); $data2=''; while($row2 = mysqli_fetch_assoc($query2)) { $data2.= " <table> <tr> <td>".$row2['id']."</td> <td>".$row2['category']."</td> <td>".$row2['title']."</td> <td><img src='".$row2['image']."' width='70' height='50' ></td> <td>".$row2['sku']."</td> <td><button type='button' class='waves-effect waves-light btn btn-rounded btn-success mb-5 ed-btn'><a href='cat-edit.php?eid=".$row2['id']."'>Edit</a></button></td> <td><button type='button' class='waves-effect waves-light btn btn-rounded btn-danger mb-5 ed-btn'><a onclick='openDeleteModal(<?php echo ".$row2['id']."; ?>)' href='javascript:void(0);' data-bs-toggle='modal' data-bs-target='#delete-item'>Delete</a></button></td> </tr> <table> "; } echo $data2; ?>