<?php
include "../db.php";

$search=$_GET['search'];

$result=$conn->query("
SELECT * FROM menus
WHERE menu_name LIKE '%$search%'
ORDER BY id DESC
");

?>

<table class="radio-table">

<tr>
<th>ID</th>
<th>Radio</th>
<th>Name</th>
<th>Stream</th>
<th>Status</th>
<th>Save</th>
<th>Actions</th>
</tr>

<?php while($row=$result->fetch_assoc()){ ?>

<tr>

<form method="post" action="update_status.php">

<td><?php echo $row['id']; ?></td>

<td>
<img src="../<?php echo $row['menu_image']; ?>" class="thumb">
</td>

<td><?php echo $row['menu_name']; ?></td>

<td><?php echo $row['stream_type']; ?></td>

<td>

<input type="hidden" name="id" value="<?php echo $row['id']; ?>">

<label class="switch">

<input type="checkbox"
name="status"
value="1"
<?php if($row['status']==1) echo "checked"; ?>>

<span class="slider"></span>

</label>

</td>

<td>
<button class="btn small">Save</button>
</td>

<td>

<a class="btn"
href="edit_menu.php?id=<?php echo $row['id']; ?>">
Edit
</a>

<a class="btn danger"
href="delete_menu.php?id=<?php echo $row['id']; ?>"
onclick="return confirm('Delete this radio?')">
Delete
</a>

</td>

</form>

</tr>

<?php } ?>

</table>