D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
home
/
markniuj
/
bazmeasar.com
/
admin
/
Filename :
search.php
back
Copy
<?php include "../config.php"; ?> <?php // Check if a search query is submitted if (isset($_GET['query'])) { $search_query = $_GET['query']; // Query to search for audio records by English title $query = "SELECT * FROM audio_files WHERE english_title LIKE '%$search_query%'"; $result = $conn->query($query); // Store matching audio records in an array if ($result && $result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $audio_records[] = $row; } } } // Close the database connection $conn->close(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Search Audio Records by English Title</title> <link rel="stylesheet" href="css.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> </head> <body> <header> <div class="logo"><img src="logo.png"></div> </header> <div class="mainbody"> <div class="bodyarea"> <h6>site/audio/search.php</h6> <h1>Search Audio Records by English Title</h1> <!-- Search form --> <form method="get" action="search.php"> <input type="text" name="query" placeholder="Type bayan title" value="<?php echo $search_query; ?>"> <input type="submit" value="Search"> </form> <!-- Display search results in a table --> <?php if (!empty($search_query)) { if (count($audio_records) > 0) { echo "<h2>Search Results:</h2>"; echo "<table border='1'>"; echo "<tr><th>English Title</th><th>Audio Filename</th></tr>"; foreach ($audio_records as $record) { $audio_id = $record["id"]; $audio_filename = $record["audio_filename"]; $english_title = $record["english_title"]; echo "<tr>"; echo "<td><a href='details.php?id=$audio_id'>$english_title</a></td>"; echo "<td><a href='details.php?id=$audio_id'>$audio_filename</a></td>"; echo "<td><a href='edit_audio.php?id=$audio_id' title='Edit'><i class='fa fa-pencil'></i></a></td>"; echo "<td><a href='delete_audio.php?id=$audio_id' title='Delete'><i class='fa fa-trash'></i></a></td>"; echo "</tr>"; } echo "</table>"; } else { echo "No results found for your search."; } } ?> </div> </div> </div> <footer> <a href="https://webograph.pk/">Site BY Webograph.pk</a> </footer> </body> </html>