📄 addobject.php
字号:
<?
require_once("../include/admin_or_user.php");
require_once('../include/connection1.php');
require_once('../include/sqlfuns.php');
require_once('../include/check.inc');
?>
<?
if(isset($_POST['s1']))
{
$insertsql = sprintf("INSERT INTO dept_3 (name,mount ,prise, other_prise,total_prise,descript) VALUES(%s, %s, %s,%s, %s, %s)",
GetSQLValueString($_POST['name'], "text"),
GetSQLValueString($_POST['mount'], "double"),
GetSQLValueString($_POST['prise'], "double"),
GetSQLValueString($_POST['other_prise'], "double"),
GetSQLValueString($_POST['total_prise'], "double"),
GetSQLValueString($_POST['descript'], "text"));
$result=odbc_exec($conn,$insertsql);
echo "<script>
alert('操作成功');
</script>";
}
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="../css/hotel.css" rel="stylesheet" type="text/css" />
</head>
<script>
function countprise()
{
total=0;
total=parseFloat(document.form1.mount.value*document.form1.prise.value)+parseFloat(document.form1.other_prise.value);
if(total)
document.form1.total_prise.value=String(total);
}
</script>
<body>
<table width="100%" border="1">
<tr>
<td><? include("collectdept_top.php"); ?></td>
</tr>
<? if(!isset($_GET['modefiy'])) { ?>
<tr>
<td>
<form method="post" enctype="application/x-www-form-urlencoded" name="form1" id="form1" onsubmit="return (empty(name)&&empty(mount)&&empty(prise)&&numbercheck(prise)&&numbercheck(mount))">
<table width="100%" border="0">
<tr>
<td width="10%">登记采购</td>
<td width="90%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> 名称</td>
<td><label>
<input name="name" type="text" id="name" size="20" maxlength="20" />
*</label></td>
</tr>
<tr>
<td> 数量</td>
<td><label>
<input name="mount" type="text" id="mount" onkeyup="countprise()" onchange="countprise()" size="6" maxlength="6"/>
*</label></td>
</tr>
<tr>
<td> 单价</td>
<td><label><span class="redclore">¥</span>
<input name="prise" type="text" id="prise" size="6" maxlength="6" onkeyup="countprise()" onchange="countprise()" />
*</label></td>
</tr>
<tr>
<td> 说明</td>
<td><label>
<textarea name="descript" cols="30" rows="6" id="descript"></textarea>
</label></td>
</tr>
<tr>
<td> 其它费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="other_prise" type="text" id="other_prise" size="6" maxlength="6" onkeyup="countprise()" onchange="countprise()"/>
</label></td>
</tr>
<tr>
<td> 总费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="total_prise" type="text" id="total_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input name="s1" type="submit" id="s1" value="提交" />
<input name="s3" type="reset" id="s3" value="重置" />
</label></td>
</tr>
</table>
</form>
</td>
</tr>
<? } if(isset($_GET['modefiy'])) { ?>
<tr>
<td>
<form method="post" enctype="application/x-www-form-urlencoded" name="form2" id="form2" >
<table width="100%" border="0">
<tr>
<td width="10%">修改记录</td>
<td width="90%"> </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> 名称</td>
<td><label>
<input name="name" type="text" id="name" size="20" maxlength="20" />
</label></td>
</tr>
<tr>
<td> 数量</td>
<td><label>
<input name="mount" type="text" id="mount" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 单价</td>
<td><label><span class="redclore">¥</span>
<input name="prise" type="text" id="prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 说明</td>
<td><label>
<textarea name="descript" cols="30" rows="6" id="descript"></textarea>
</label></td>
</tr>
<tr>
<td> 其它费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="other_prise" type="text" id="other_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> 总费用</td>
<td><label>
<span class="redclore">¥</span>
<input name="total_prise" type="text" id="total_prise" size="6" maxlength="6" />
</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input name="s2" type="submit" id="s2" value="修改" />
<input type="reset" name="Submit2" value="重置" />
</label></td>
</tr>
</table>
</form>
</td>
</tr>
<? }?>
</table>
<p \>
<script src="../copyright.inc">
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -