154 lines
5.8 KiB
PHP
154 lines
5.8 KiB
PHP
|
<?php require_once('Connections/jc.php'); ?>
|
|||
|
<?php
|
|||
|
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
|
|||
|
{
|
|||
|
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
|
|||
|
|
|||
|
switch ($theType) {
|
|||
|
case "text":
|
|||
|
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
|
|||
|
break;
|
|||
|
case "long":
|
|||
|
case "int":
|
|||
|
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
|
|||
|
break;
|
|||
|
case "double":
|
|||
|
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
|
|||
|
break;
|
|||
|
case "date":
|
|||
|
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
|
|||
|
break;
|
|||
|
case "defined":
|
|||
|
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
|
|||
|
break;
|
|||
|
}
|
|||
|
return $theValue;
|
|||
|
}
|
|||
|
|
|||
|
$editFormAction = $_SERVER['PHP_SELF'];
|
|||
|
if (isset($_SERVER['QUERY_STRING'])) {
|
|||
|
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
|
|||
|
}
|
|||
|
|
|||
|
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
|
|||
|
$insertSQL = sprintf("INSERT INTO xushen (xuehao, xingming, banji, xi, user_name, password) VALUES (%s, %s, %s, %s, %s, %s)",
|
|||
|
GetSQLValueString($_POST['xuehao'], "text"),
|
|||
|
GetSQLValueString($_POST['xingming'], "text"),
|
|||
|
GetSQLValueString($_POST['banji'], "text"),
|
|||
|
GetSQLValueString($_POST['xi'], "text"),
|
|||
|
GetSQLValueString($_POST['user_name'], "text"),
|
|||
|
GetSQLValueString($_POST['password'], "text"));
|
|||
|
|
|||
|
mysql_select_db($database_jc, $jc);
|
|||
|
$Result1 = mysql_query($insertSQL, $jc) or die(mysql_error());
|
|||
|
|
|||
|
$insertGoTo = "cg2.htm";
|
|||
|
if (isset($_SERVER['QUERY_STRING'])) {
|
|||
|
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
|
|||
|
$insertGoTo .= $_SERVER['QUERY_STRING'];
|
|||
|
}
|
|||
|
header(sprintf("Location: %s", $insertGoTo));
|
|||
|
}
|
|||
|
|
|||
|
mysql_select_db($database_jc, $jc);
|
|||
|
$query_Recordset1 = "SELECT * FROM xushen";
|
|||
|
$Recordset1 = mysql_query($query_Recordset1, $jc) or die(mysql_error());
|
|||
|
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
|
|||
|
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
|
|||
|
?><!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><EFBFBD>ޱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD></title>
|
|||
|
<style type="text/css">
|
|||
|
<!--
|
|||
|
.txt {font-size: 12px;
|
|||
|
color: #000000;
|
|||
|
}
|
|||
|
-->
|
|||
|
</style>
|
|||
|
</head>
|
|||
|
|
|||
|
<body topmargin="0" bottommargin="0" marginwidth="0" marginheight="0">
|
|||
|
<?php include("head.php");?>
|
|||
|
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="txt">
|
|||
|
<tr>
|
|||
|
<td align="center"><form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
|
|||
|
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="txt">
|
|||
|
<tr>
|
|||
|
<td height="20" colspan="2" align="center"><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѧ<EFBFBD><EFBFBD></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td width="102" align="right">ѧ <EFBFBD><EFBFBD>:</td>
|
|||
|
<td width="198"><input name="xuehao" type="text" id="xuehao" /></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td align="right"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>:</td>
|
|||
|
<td><input name="xingming" type="text" id="xingming" /></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td align="right"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>:</td>
|
|||
|
<td><input name="banji" type="text" id="banji" /></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td align="right">ϵ:</td>
|
|||
|
<td><input name="xi" type="text" id="xi" /></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td align="right"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>:</td>
|
|||
|
<td><input name="user_name" type="text" id="user_name" /></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td align="right"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>:</td>
|
|||
|
<td><input name="password" type="password" id="password" /></td>
|
|||
|
</tr>
|
|||
|
</table>
|
|||
|
<label>
|
|||
|
<input type="submit" name="Submit" value="<EFBFBD>ύ" />
|
|||
|
</label>
|
|||
|
<label></label>
|
|||
|
<table width="760" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" class="txt">
|
|||
|
<tr>
|
|||
|
<td colspan="6" align="center" valign="bottom">ѧ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></td>
|
|||
|
</tr>
|
|||
|
<tr>
|
|||
|
<td width="12%" align="center" valign="bottom">ѧ <EFBFBD><EFBFBD></td>
|
|||
|
<td width="12%" align="center" valign="bottom"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD></td>
|
|||
|
<td width="12%" align="center" valign="bottom"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD></td>
|
|||
|
<td width="12%" align="center" valign="bottom"><EFBFBD><EFBFBD> <EFBFBD><EFBFBD></td>
|
|||
|
<td width="12%" align="center" valign="bottom"><EFBFBD><EFBFBD></td>
|
|||
|
<td width="12%" align="center" valign="bottom">ɾ<EFBFBD><EFBFBD></td>
|
|||
|
</tr>
|
|||
|
<%
|
|||
|
While ((Repeat1__numRows <> 0) AND (NOT Recordset2.EOF))
|
|||
|
%>
|
|||
|
<?php do { ?>
|
|||
|
<tr>
|
|||
|
<td align="center" valign="bottom"><?php echo $row_Recordset1['xuehao']; ?></td>
|
|||
|
<td align="center" valign="bottom"><?php echo $row_Recordset1['xingming']; ?></td>
|
|||
|
<td align="center" valign="bottom"><?php echo $row_Recordset1['user_name']; ?></td>
|
|||
|
<td align="center"><?php echo $row_Recordset1['password']; ?></td>
|
|||
|
<td align="center" valign="bottom"><a href="xgai.php?xuehao=<?php echo $row_Recordset1['xuehao']; ?>"><EFBFBD><EFBFBD></a></td>
|
|||
|
<td align="center" valign="bottom"><a href="xdel.php?xuehao=<?php echo $row_Recordset1['xuehao']; ?>">ɾ<EFBFBD><EFBFBD></a></td>
|
|||
|
</tr>
|
|||
|
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
|
|||
|
<%
|
|||
|
Repeat1__index=Repeat1__index+1
|
|||
|
Repeat1__numRows=Repeat1__numRows-1
|
|||
|
Recordset2.MoveNext()
|
|||
|
Wend
|
|||
|
%>
|
|||
|
</table>
|
|||
|
<p> </p>
|
|||
|
|
|||
|
<input type="hidden" name="MM_insert" value="form1">
|
|||
|
</form>
|
|||
|
</td>
|
|||
|
</tr>
|
|||
|
</table>
|
|||
|
<?php include("foot.php");?>
|
|||
|
</body>
|
|||
|
</html>
|
|||
|
<?php
|
|||
|
mysql_free_result($Recordset1);
|
|||
|
?>
|