D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
urbane.createerp.com
/
Filename :
ajax.php
back
Copy
<?php //Including Database configuration file. include "config.php"; //Getting value of "search" variable from "script.js". if (isset($_POST['search'])) { //Search box value assigning to $Name variable. $Name = $_POST['search']; //Search query. $Query = "SELECT DISTINCT item_name FROM inventory_manager WHERE item_name LIKE '%$Name%'"; //Query execution $ExecQuery = MySQLi_query($conn, $Query); //Creating unordered list to display result. if ($ExecQuery->num_rows > 0) { ?> <ul style="position: absolute;background: #ffff;z-index: 1111;box-shadow: 0 0 10px rgba(0,0,0,0.3);margin-top: 3px;padding: 10px 20px;width: 91%;font-size: 15px;border-radius: 4px;list-style: none;font-weight: 700; text-transform: capitalize !important;"> <?php //Fetching result from database. while ($Result = MySQLi_fetch_array($ExecQuery)) { ?> <li style=" cursor: pointer;" onclick='fill("<?php echo $Result['item_name']; ?>")'> <a> <?php echo $Result['item_name']; ?> </li></a> <?php }}else{ echo " <ul style='position: absolute;background: #ffff;z-index: 1111;box-shadow: 0 0 10px rgba(0,0,0,0.3);margin-top: 3px;padding: 10px 20px;width: 91%;font-size: 15px;border-radius: 4px;list-style: none;font-weight: 700; text-transform: capitalize !important;'> <li> <p style='color:black;font-weight:bold;'>No Data Found</p></li> </ul>"; } } ?> </ul>