<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Viewing / Deleting Records</TITLE>
</HEAD>
<BODY>

<?php
/***************************************************************************
 *			do_delete4a.php	                                   *
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~	                   *
 *   File Info:		  Delete All Users                                 *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include ("./header.inc");
?>
<img src=images/line.gif border=0 width=100% height=1><br><br>
<center><img src=images/computer.gif border=0><font face=verdana size=3 color=darkred> Deleting all users records</font></center><br>
<center>
<table width="500" border=1><tr align="justify" class="subtitle"><td>
  <p align="center">
  <img border="0" src="images/database.GIF" width="24" height="24"><font face=Verdana size=1><a href="./create_db.php">Create database</a>&nbsp;
  <img border="0" src="images/database.GIF" width="24" height="24"></font><a href="./delete_db.php"><font face=Verdana size=1>Delete database</font></a><font face="Verdana" size="1">&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"><a href="./create_menu.php">Create table</a>&nbsp;&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24">&nbsp;
  </font> <a href="./add_menu.php"><font face=Verdana size=1>Add Record </font></a>  
  </p>
  <p align="center">&nbsp;<font face="Verdana" size="1"><img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./view_menu.php"><font face=verdana size=1>View Records</font></a>&nbsp;
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font><a href="./del_menu.php"><font face=verdana size=1>Delete Record</font></a>
  <font face="Verdana" size="1">&nbsp;&nbsp;&nbsp;
  <img border="0" src="images/Records.GIF" width="24" height="24"></font> <a href="./upd_menu.php"><font face=verdana size=1>Update Record</font></a>&nbsp;
  <img border="0" src="images/home-to.GIF" width="24" height="24"><font face=verdana size=1>&nbsp; <a href="./index.php">Home</a></font>  </a></td></tr></table><br></center>
<?php
include("./config.php");
$table = "users";
 if ($_SERVER['REQUEST_METHOD'] == "POST") 
  {
        # escape data and set variables
        $acts = addslashes($_POST["acts"]);
}
if ($acts == "yes")
{
	$conn = @mysql_connect($server,$user,$password)
	or die("Unable to connect to SQL database...");
	$rs = @mysql_select_db($database,$conn) 
	or die("Unable to select the database...Please press 'Create Database' to create new database.");
	$sql = " DROP table $table";
	$rs = mysql_query($sql,$conn)
	or die("Could not execute SQL query!!! Possibly SQL query already been executed.");
}
?>
<br>
<center><font face=verdana size=2 color=navy><img src=images/bullets.gif border=0> Delete all orders records from USERS</font></center>
<?php 
if ($acts == "yes")
{
	echo("<br><center><img src=images/line.gif border=0 width=480 height=1><br><font face=verdana size=2>Delete of all records from USERS successful</font></center>");
### create table 4 ###
	@mysql_query("CREATE TABLE $table (username char(25),firstname char(25),lastname char(25),passwrd char(32),email char(50),hint char(50),date_added char(25))");
	echo "<center><img src =./images/private.gif><font face=verdana size=2 color = black>Successfully created users table on your SQL database.</font></cente><br>";

	############ auto create administrator account ############

	$passwrd = md5("999");
	$date_added = date("Y-m-d");
	$sqls = "INSERT INTO $table (username,firstname,lastname,passwrd,email,hint,date_added) 	values('admin','The','Administrator','$passwrd','yourname@yourdomain.com','Dial number for police','$date_added')";
	$results=mysql_query($sqls,$conn)
		or die("Unable to excute the SQL query!!! Possibly SQL command already executed");
	echo "<center><img src =./images/private.gif><font color = darkgreen face=verdana size=2>Successfully created administrator's account on your SQL database.</font><br><img src=images/line.gif border=0 width=480 height=1></center>";
}
if ($acts == "no")
{
	echo "<br><center><img src=images/line.gif border=0 width=400 height=1><br><font face=verdana size=2>No delete action was performed</font><br><img src=images/line.gif border=0 width=400 height=1></center>";
}
echo "<br><img src=images/line.gif border=0 width=100% height=1>";
include("./your-footer.inc");
?>
</BODY>
</HTML>