📄 install.php
字号:
<html><head><title>化妆品公司数据管理系统 -- 安装程序</title>
</head>
<body bgcolor=#ffffff>
<font face="Arial">
:: 开始安装 ::<br>
<hr>
系统信息:<br>
<?
$host="localhost";
$user="root";
$pass="123";
$db="aneng";
$projectdb="projectx";
echo"数据库主机名: $host<br>数据库用户名: $user<br>用户密码: (保密)<br>要创建的数据库: $projectdb<br><hr>";
$link_id=mysql_connect($host,$user,$pass);
if ($link_id)
{
?>
安装进度:<br>MySQL 数据库连接成功<br>
<?
$str_sql="INSERT INTO user VALUES('$host','project','', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y');";
$result=mysql_db_query($db,$str_sql,$link_id);
if ($result)
{echo"用户创建成功<br>";}
else{echo"用户创建失败<br>";}
$str_sql="create database $projectdb";
$result=mysql_db_query($db,$str_sql,$link_id);
if ($result)
{echo"数据库 $projectdb 创建成功<br>";}
else{echo"数据库 $projectdb 创建失败<br>";}
//1
$str_sql="create table ARRANGERRC (
shid int(8) not null,
pid int(8) not null,
pprice decimal(8,2) not null,
inamount int(10) not null,
outamount int(10) not null,
primary key (shid,pid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"调度纪录表 ARRANGERRC 创建成功<br>";}
else{echo"调度纪录表 ARRANGERRC 创建失败<br>";}
//2
$str_sql="create table ARRANGERTB (
shid int(8) not null,
outst int(8) not null,
inst int(8) not null,
checkdate date not null,
outdate date not null,
indate date not null,
checkp varchar(10) not null,
outp varchar(10) not null,
inp varchar(10) not null,
amount decimal(12,2) not null,
memo text,
primary key(shid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"调度情况表 ARRANGERTB 创建成功<br>";}
else{echo"调度情况表 ARRANGERTB 创建失败<br>";}
//3
$str_sql="create table SALETB (
said int(8) not null,
sast int(8) not null,
sadate date not null,
mtp varchar(10) not null,
memo text,
primary key(said,sast));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"销售情况表 SALETB 创建成功<br>";}
else{echo"销售情况表 SALETB 创建失败<br>";}
//4
$str_sql="create table SALERC (
said int(8) not null,
pid int(8) not null,
samount int(10) not null,
money decimal(12,2) not null,
primary key(said,pid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"销售纪录表 SALERC 创建成功<br>";}
else{echo"销售纪录表 SALERC 创建失败<br>";}
//5
$str_sql="create table STORAGETB (
stid int(8) not null,
pid int(8) not null,
amount int(10) not null,
memo text,
primary key(stid,pid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"库存情况表 STORAGETB 创建成功<br>";}
else{echo"库存情况表 STORAGETB 创建失败<br>";}
//6
$str_sql="create table PRODUCTTB (
pid int(8) not null,
mark varchar(20) not null,
class varchar(10) not null,
pname varchar(20) not null,
pprice decimal(10,2) not null,
sprice decimal(10,2) not null,
color varchar(10) not null,
life int(4) not null,
unit varchar(4) not null,
memo text,
primary key(pid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"产品信息表 PRODUCTTB 创建成功<br>";}
else{echo"产品信息表 PRODUCTTB 创建失败<br>";}
//7
$str_sql="create table STOREHOUSETB (
stid int(8) not null,
stname varchar(20) not null,
email varchar(20) not null,
isactive int(1) not null default '1',
primary key(stid));";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"仓库信息表 STOREHOUSETB 创建成功<br>";}
else{echo"仓库信息表 STOREHOUSETB 创建失败<br>";}
//8
$str_sql="create table USERTB (
stid int(8) not null,
pass varchar(20) not null,
cdate datetime not null,
logtimes int(10) not null,
ldate datetime not null,
primary key(stid),
foreign key(stid) references STOREHOUSETB
on delete cascade
on update cascade);";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{
echo"用户信息表 USERTB 创建成功<br>";
//9
$str_sql="insert into STOREHOUSETB values (
'-1',
'DATABASE总公司',
'lonelyp@etang.com',
'1');";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{
echo"DATABASE化妆品总公司纪录创建成功<br>";
//10
$t=date('Y-m-d H:i:s');
$str_sql="insert into USERTB values (
'-1',
'password',
'$t',
'0',
'$t');";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result)
{echo"超级用户 admin (密码: password) 创建成功<br>";}
else{echo"超级用户创建失败<br>";}
}
else{echo"DATABASE化妆品总公司纪录创建失败<br>";}
}
else{echo"用户信息表 USERTB 创建失败<br>";}
$str_sql="insert into STOREHOUSETB values (
'-2',
'外部购进',
'----',
'1');";
$result=mysql_db_query($projectdb,$str_sql,$link_id);
if ($result) echo "外部创建成功<br>";
else echo"外部创建失败<br>";
}
else
{
echo "MySQL 数据库连接失败,请检查主机名和用户/密码是否正确";
exit();
}
@mysql_close($link_id);
?>
</font><font face="Arial" size=-1><div align=center><br><a href=javascript:close()>::关闭窗口::</a>
<hr>
© 2001,<a href=mailto:lonelyp@etang.com?subject=projectx>Lonely Passenger</a><br>All rights reserved!</div></font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -