<?php

	
	$searchBy=$_POST["searchBy"];
	$keyword=$_POST["keywords"];
	
	$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);	
	
	?>
<html>
<head>
<title>
Admin search view
</title>
</head>
<body style="background:lightyellow url(bgimage.jpg) repeat fixed center center;>

<table align="center" width=70% border=0>
<tr>
<td><img src="logo2_1200x150.jpg"></td>
</tr>
</table>
<hr width=70% align=center/>
<h2 align=center><i>Searching result</i></h2>
<?php
	echo "<h3 align=center> You are login as admin</h3><h4 align=center><a href=index.php>Logout</a> | <u><a href=http://www.wauhaha.com/karaoke/adminaccount.php>Back Menu</u></a></h4>";
?>
<?php


$query=mysql_query("select * from regmember where $searchBy  like '%$keyword%'  ");
			if(mysql_num_rows($query)==0){
				echo "<center>No results<br><a href=http://www.wauhaha.com/karaoke/adminview.php>Back to my menu</a></center>";die();
			}
			else{
			echo "<table border=1 align=center style ='font-family:Arial, Helvetica, sans-serif;font-size:1em' color='blue' bordercolorlight='tan' cellspacing=0 cellpadding=4>
 <tr bgcolor=lightblue><th>UserID</th>
							<th>regUser Name</th><th>Email</th><th>Phone</th><th>Handphone</th><th>Note</th><th>Delete</th><th>Edit</th></tr>";
			
			
		while($row = mysql_fetch_array($query)){
			$reguserid=$row['regUserID'];
  echo"<tr>";
	
  echo "<td>".$row['Username']."</td>";
  echo "<td>".$row['Name']."</td>";
  echo "<td>".$row['Email']."</td>";
  echo "<td>".$row['Phone']."</td>";
  echo "<td>".$row['Hphone']."</td>";
  echo "<td><a href=http://www.wauhaha.com/karaoke/delete.php?userid=$Username />delete</a></td>";
  echo "<td><a href=http://www.wauhaha.com/karaoke/edited.php?userid=$Username />Edit</a></td>";
  
  echo "</tr>";
 
  }
  }
  echo "</table>";
	
		
?>
</body>
</html>