<?php
include("protect.php");
include("dbconnect.php");
extract($_POST);
$uname=$_SESSION['uname'];
if($_REQUEST['act']=="del")
{
$daccount=$_REQUEST['daccount'];
mysql_query("delete from register where account='$daccount'");
mysql_query("delete from event where account='$daccount'");
header("location:view_cus.php");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php include("title.php"); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>

        <form id="form1" name="form1" method="post" action="">
		<div class="sd"><!--<a href="index.php">Home</a>-->
    <?php include("link_admin.php"); ?>
  </div>
          <h2 align="center">Customer Information </h2>
          <table width="570" border="1" align="center" cellpadding="5" cellspacing="0">
            <tr>
              <th width="59" scope="col">Sno</th>
              <th width="128" scope="col">Account No. </th>
              <th width="141" scope="col">Name</th>
              <th width="94" scope="col">Mobile No. </th>
              <th width="94" scope="col">Date</th>
            </tr>
			<?php
			$i=0;
			$qs=mysql_query("select * from register");
			while($rs=mysql_fetch_array($qs))
			{
			$i++;
			?>
            <tr>
              <td><?php echo $i; ?></td>
              <td><?php echo $rs['account']; ?></td>
              <td><?php echo $rs['name']; ?></td>
              <td><?php echo $rs['contact']; ?></td>
              <td><?php echo $rs['rdate']; ?></td>
            </tr>
			<?php
			}
			?>
          </table>
		  
          <p align="center"><a href="add_cus.php">Add New </a></p>
          <p>&nbsp;</p>
		  <p align="center" class="sd"><?php include("title.php"); ?></p>
        </form>
       
</body>
</html>