<html><head><title>128 Concepts Stock Inventory</title></head>
<body>
<?php
/***************************************************************************
 *			create_db1.php	                                   *
 *                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~	                   *
 *   File Info:		  Create a database                                *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include("./config.php");
include("./header.inc");
?>
<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
 if ($_SERVER['REQUEST_METHOD'] == "POST") 
  {
        # escape data and set variables
        $acts = addslashes($_POST["acts"]);
}

if ($acts == "yes")
{
$db = "mydata";
$conn = @mysql_connect($server,$user,$password) 
   or die("Sorry - could not connect to MySQL");
$rs1 = @mysql_create_db($db)
	or die("Sorry - could not create database...possibly already created previously!");
$rs2 = @mysql_list_dbs($conn)
	or die("Sorry - unable to get list of databases...");
for($row=0;$row<mysql_num_rows($rs2);$row++)
{
  $list.= mysql_tablename($rs2,$row). " | ";
}
}
if ($acts == "no")
{
$db = "mydata";
$conn = @mysql_connect($server,$user,$password) 
   or die("Sorry - could not connect to MySQL");
$rs2 = @mysql_list_dbs($conn)
	or die("Sorry - unable to get list of databases...");
for($row=0;$row<mysql_num_rows($rs2);$row++)
{
  $list.= mysql_tablename($rs2,$row). " | ";
}
}
?>
<center><img src=images/computer.gif border=0><font face=verdana size=3 color=darkred>Creating a new database 'mydata'</font></center>

<br><center><img src=images/line.gif border=0 width=400 height=1><br><br><font face=verdana size=2 color=navy>Current databases found:-</font> 

<?php 

echo($list);

if ($acts == "yes")
{
 echo("<br><font face=verdana size=2 color=red>Create operation was successful...</font>");
}
else
{
echo("<br><font face=verdana size=2>No create operation was performed...</font>");
}
echo "<br><br><img src=images/line.gif border=0 width=400 height=1></center>";
?>
<?php include("./your-footer.inc"); ?>
</body>
</html>