|
楼主 |
发表于 2005-4-26 21:47:14
|
显示全部楼层
客户基本数据的录入界面
代单选项的录入界面[PHP]<?php
Session_Start();
Session_Register('curr_page');
include_once('./dblink/mylink.php');?>
<!--我的第一个数据输入模块-->
<html>
<title>客户基本数据录入</title>
<body>
<h2>请输入数据</h2>
<hr align="left" size="3" width="100%" noshade>
<form action="<?php echo $PHPSELF ?>" method="post" enctype="multipart/form-data">
<table border=1 borderwidth=2>
<tr>
<th width="100" bgcolor="#ffff00">项目</th>
<th width="300" bgcolor="#ffff00">内容</th>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">客户名称</td>
<td bgcolor="#00ffff"><input size="40" type="text" name="khmc"></td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">客户类别</td>
<td><input type="radio" name="khlx" value="dfzj" />东风主机
<input type="radio" name="khlx" value="shzj" />社会主机
<input type="radio" name="khlx" value="tyjx" />特约经销商
<input type="radio" name="khlx" value="qtkh" />其他客户
</td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">注册地址</td>
<td><input size="40" type="text" name="zcdz">
</td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">法人代表</td>
<td><input size="40" type="text" name="fzdb"></td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">注册资金</td>
<td><input size="40" type="text" name="zczj"></td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">注册方式</td>
<td><input size="40" type="text" name="zcfs"></td>
</tr>
<tr>
<td width="100" bgcolor="#00ff00">备注</td>
<td><input size="40" type="text" name="bz"></td>
</tr>
</table>
<hr align="left" size="3" width="100%" noshade>
<input type="submit" name="提交">
<hr align="left" size="3" width="100%" noshade>
<?PHP
//print_r($_POST[khlx]);
if (!empty($_POST["khlx"])and!empty($_POST["khmc"])){;
$rs = $db->Execute('select * from khjbzlz');
$rs1=$db->Execute("select max(客户代码) from khjbzlz where substring(客户代码 from '$_POST[khlx]')='$_POST[khlx]'");
$fd=$rs1->fields;
$khdmss=substr($fd[max],4)+1.00;
if ($khdmss<10){;
$khdm=$_POST[khlx].'00'.$khdmss;
}elseif ($khdmss<100){;
$khdm=$_POST[khlx].'0'.$khdmss;
}else{;
$khdm=$_POST[khlx].$khdmss;
};
$record = array(); # Initialize an array to hold the record data to insert
# Set the values for the fields in the record
# Note that field names are case-insensitive
$record["客户名称"] =$_POST["khmc"] ;
$record["客户代码"] = $khdm;
$record["注册地址"] = $_POST["zcdz"];
$record["法人代表"] = $_POST["fzdb"];
$record["注册资金"] = $_POST["zczj"]+0.00;
$record["注册方式"] = $_POST["zcfs"];
$record["备注"] =$_POST["bz"];
# Pass the empty recordset and the array containing the data to insert
# into the GetInsertSQL function. The function will process the data and return
# a fully formatted insert sql statement.
$insertSQL = $db->GetInsertSQL($rs, $record);
$db->Execute($insertSQL); # Insert the record into the database;
echo "共$Affected_Rows()条记录被增加!";
if ($db->Execute($insertSQL) === false) {
print '输入错误: '.$db->ErrorMsg().'<BR>';
}
$db->close();
};
?>
</form>
</body>
</html>
[/PHP] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|