xyh 4 years ago
parent bb8461f54f
commit d120da0424

@ -0,0 +1,10 @@
eclipse.preferences.version=1
encoding/<project>=GBK
encoding/fun.php=UTF-8
encoding/login.php=UTF-8
encoding/login1.php=UTF-8
encoding/main.php=GBK
encoding/scoreManage.php=UTF-8
encoding/showpicture.php=UTF-8
encoding/studentAction.php=UTF-8
encoding/studentManage.php=UTF-8

@ -0,0 +1,2 @@
eclipse.preferences.version=1
line.separator=\r\n

@ -0,0 +1,2 @@
eclipse.preferences.version=1
include_path=0;/xscj

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="php.core.component"/>
<fixed facet="php.component"/>
<installed facet="php.core.component" version="1"/>
<installed facet="php.component" version="7.4"/>
</faceted-project>

@ -0,0 +1,10 @@
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_conn = "localhost";
$database_conn = "dxscj";
$username_conn = "root";
$password_conn = "root";
$conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error(mysql_error(),E_USER_ERROR);
?>

@ -0,0 +1,59 @@
<!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=utf-8" />
<!-- TemplateBeginEditable name="doctitle" -->
<title>主页</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
</head>
<style type="text/css">
.a0{
width:80%;
margin-left:auto;
margin-right:auto;
}
.a1{
background-image:url(../images/top.png);
background-size:cover;
background-repeat:no-repeat;
width:80%;
height:160px;
margin:auto;
border:1px #69C solid;
}
.a2
{
background-image:url(../images/bottom1.png);
background-size:cover;
background-repeat:no-repeat;
width:80%;
height:40px;
margin:auto;
border:1px #69C solid;
}
.a3{
margin:auto;
width:80%;
height:10%;
}
.a4{
font-size:10px;}
iframe{
width:100%;
height:600px;
overflow:scroll;
}
</style>
<body style=" background-repeat:no-repeat ;background-size:100% 100%; background-attachment:fixed;">
<header class="a1"></header>
<div class="a0"><iframe src="../main.php"></iframe></div>
<header class="a2"></header>
</div>
<div>
<p align="center" class="a4">设计者信息<br />系别:软件工程 班级19级软件工程3班 姓名:张憶文 联系方式:18922350192/18144626352</h4>
</div>
</body>
</html>

@ -0,0 +1,10 @@
<!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>
</head>
<body>
</body>
</html>

@ -0,0 +1,52 @@
<?php require_once('Connections/conn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($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;
}
}
mysql_select_db($database_conn, $conn);
$query_Recordset1 = "SELECT * FROM cj";
$Recordset1 = mysql_query($query_Recordset1, $conn) 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>ÎÞ±êÌâÎĵµ</title>
</head>
<body>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

@ -0,0 +1,109 @@
<?php // <ERRORS><ERROR><DESCRIPTION>Your testing server do not has support for PHP pages</DESCRIPTION></ERROR>\n</ERRORS>
$debug_to_file = false;
function log_messages($error_message){
global $f, $debug_to_file;
if ($debug_to_file === true){
if (!is_resource($f)){
@ini_set('display_errors', 1);
@error_reporting(E_ALL);
$f = @fopen('log.txt', 'a');
}
if (is_resource($f)){
return @fwrite($f, $error_message."\n");
}
}
return false;
}
function create_error($error_msg = '', $line = -1){
if ($error_msg != ''){
return '<ERRORS><ERROR><DESCRIPTION>'.$error_msg.'</DESCRIPTION></ERROR></ERRORS>\n';
}else{
return '<ERRORS><ERROR><DESCRIPTION> Unidentified Connection Error at Line '.$line.'</DESCRIPTION></ERROR></ERRORS>\n';
}
}
log_messages("\n--------------------------------");
// what parameters were sent ?!
foreach($_POST as $key=>$value) {
if (strtoupper($key) != 'PASSWORD'){
log_messages('$_POST["'.$key.'"] = \''.$value."';");
}
}
// We need these information only once when the test button is hit
if (isset($_POST['opCode']) && $_POST['opCode'] == 'IsOpen' ){
// What PHP version
log_messages("\nPHP-Version: ".phpversion());
// What OS System is running on
log_messages('PHP-OS: '.PHP_OS);
// How PHP is installed (CGI, ISAPI, FastCGI)
// !!!! Major difference exists on these servers for $_ENV, $_SERVER
log_messages('PHP-SAPI-NAME: '.php_sapi_name());
// MySQL, mbstring modules are installed ?!
log_messages('PHP-Extensions: '.var_export(get_loaded_extensions(),true));
}
if(extension_loaded('mbstring'))
{
$acceptCharsetHeader = 'Accept-Charset: ' . mb_internal_encoding();
header( $acceptCharsetHeader );
$head = '<html><head><meta http-equiv=\'Content-Type\' content=\'text/html; charset=' . mb_http_output() . '\'></head>';
echo $head;
}else{
echo '<html><head></head>';
}
// Build connection object
if (isset($_POST['Type']) && $_POST['Type'] == 'MYSQL')
{
require("./mysql.php");
$oConn = new MySqlConnection(@$_POST['ConnectionString'], @$_POST['Timeout'], @$_POST['Host'], @$_POST['Database'], @$_POST['UserName'], @$_POST['Password']);
if (!isset($oConn) || $oConn == false){
log_messages("\n".'MySQL Connection Object initialisation failed'."\n\n".@$error);
}else{
log_messages("\n".'MySQL Connection Object Created'."\n\n");
}
}else{
$error=create_error('The files from the _mmServerScripts folder are for the server model PHP-MySQL. You try to connect to a database using a different server model '.@$_POST['Type'].".\n\nPlease remove this folder outside the Dreamweaver environment on both local and testing machines and try again.",__LINE__);
log_messages("\nError Sent:\n\n\t".@$error."\n\n\n");
echo $error.'</HTML>';
return;
}
// Process opCode
if (isset($oConn) && $oConn)
{
$oConn->Open();
if ($_POST['opCode'] == 'IsOpen'){
$answer = $oConn->TestOpen();
}elseif (is_resource($oConn->connectionId) && $oConn->isOpen){
switch ($_POST['opCode']){
case 'GetTables': $answer = $oConn->GetTables(@$_POST['Database']); break;
case 'GetColsOfTable': $answer = $oConn->GetColumnsOfTable(@$_POST['TableName']); break;
case 'ExecuteSQL': $answer = $oConn->ExecuteSQL(@$_POST['SQL'], @$_POST['MaxRows']); break;
case 'GetODBCDSNs': $answer = $oConn->GetDatabaseList(); break;
case 'SupportsProcedure': $answer = $oConn->SupportsProcedure(); break;
case 'GetProviderTypes': $answer = $oConn->GetProviderTypes(); break;
case 'GetViews': $answer = $oConn->GetViews(); break;
case 'GetProcedures': $answer = $oConn->GetProcedures(); break;
case 'GetParametersOfProcedure': $answer = $oConn->GetParametersOfProcedure(@$_POST['ProcName']); break;
case 'ReturnsResultset': $answer = $oConn->ReturnsResultSet($_POST['RRProcName']); break;
case 'ExecuteSP': $answer = $oConn->ExecuteSP(@$_POST['ExecProcName'], 0, @$_POST['ExecProcParameters']); break;
case 'GetKeysOfTable': $answer = $oConn->GetPrimaryKeysOfTable(@$_POST['TableName']); break;
default: $answer = create_error('The \''.$_POST['opCode'].'\' command is not supported.'); break;
}
}
$oConn->Close();
}else{
$answer = create_error('The Connection Module was not initialized properly for an unknown reason.');
}
log_messages("\nAnswer From Database:\n\n\t".@$answer."\n\n\n");
echo $answer;
echo '</html>';
?>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="MMHTTPDB.php" server="C:/Users/17659/Desktop/chapter6/" local="132691610476252863" remote="132691610470000000" Dst="0" />
<file name="mysql.php" server="C:/Users/17659/Desktop/chapter6/" local="132691610476266357" remote="132691610470000000" Dst="0" />
<file name="MMHTTPDB.php" server="D:/phpStudy/PHPTutorial/WWW/chapter6/" local="132691610476252863" remote="132691610470000000" Dst="0" />
<file name="mysql.php" server="D:/phpStudy/PHPTutorial/WWW/chapter6/" local="132691610476266357" remote="132691610470000000" Dst="0" />
</dwsync>

@ -0,0 +1,438 @@
<?php
// If this file is not included from the MMHTTPDB possible hacking problem.
if (!function_exists('create_error')){
die();
}
define('MYSQL_NOT_EXISTS', create_error("Your PHP server doesn't have the MySQL module loaded or you can't use the mysql_(p)connect functions."));
define('CONN_NOT_OPEN_GET_TABLES', create_error('The Connection could not be opened when trying to retrieve the tables.'));
define('CONN_NOT_OPEN_GET_DB_LIST', create_error('The Connection could not be opened when trying to retrieve the database list.'));
if (!function_exists('mysql_connect') || !function_exists('mysql_pconnect') || !extension_loaded('mysql')){
echo MYSQL_NOT_EXISTS;
die();
}
// Now let's handle the crashes or any other PHP errors that we can catch
function KT_ErrorHandler($errno, $errstr, $errfile, $errline) {
global $f, $already_sent;
$errortype = array (
1 => "Error",
2 => "Warning",
4 => "Parsing Error",
8 => "Notice",
16 => "Core Error",
32 => "Core Warning",
64 => "Compile Error",
128 => "Compile Warning",
256 => "User Error",
512 => "User Warning",
1024=> "User Notice",
2048=> "E_ALL",
2049=> "PHP5 E_STRICT"
);
$str = sprintf("[%s]\n%s:\t%s\nFile:\t\t'%s'\nLine:\t\t%s\n\n", date('d-m-Y H:i:s'),(isset($errortype[@$errno])?$errortype[@$errno]:('Unknown '.$errno)),@$errstr,@$errfile,@$errline);
if (error_reporting() != 0) {
@fwrite($f, $str);
if (@$errno == 2 && isset($already_sent) && !$already_sent==true){
$error = '<ERRORS>'."\n";
$error .= '<ERROR><DESCRIPTION>An Warning Type error appeared. The error is logged into the log file.</DESCRIPTION></ERROR>'."\n";
$error .= '</ERRORS>'."\n";
$already_sent = true;
echo $error;
}
}
}
if ($debug_to_file){
$old_error_handler = set_error_handler("KT_ErrorHandler");
}
class MySqlConnection
{
/*
// The 'var' keyword is deprecated in PHP5 ... we will define these variables at runtime.
var $isOpen;
var $hostname;
var $database;
var $username;
var $password;
var $timeout;
var $connectionId;
var $error;
*/
function MySqlConnection($ConnectionString, $Timeout, $Host, $DB, $UID, $Pwd)
{
$this->isOpen = false;
$this->timeout = $Timeout;
$this->error = '';
if( $Host ) {
$this->hostname = $Host;
}
elseif( preg_match("/host=([^;]+);/", $ConnectionString, $ret) ) {
$this->hostname = $ret[1];
}
if( $DB ) {
$this->database = $DB;
}
elseif( preg_match("/db=([^;]+);/", $ConnectionString, $ret) ) {
$this->database = $ret[1];
}
if( $UID ) {
$this->username = $UID;
}
elseif( preg_match("/uid=([^;]+);/", $ConnectionString, $ret) ) {
$this->username = $ret[1];
}
if( $Pwd ) {
$this->password = $Pwd;
}
elseif( preg_match("/pwd=([^;]+);/", $ConnectionString, $ret) ) {
$this->password = $ret[1];
}
}
function Open()
{
$this->connectionId = mysql_connect($this->hostname, $this->username, $this->password);
if (isset($this->connectionId) && $this->connectionId && is_resource($this->connectionId))
{
$this->isOpen = ($this->database == "") ? true : mysql_select_db($this->database, $this->connectionId);
}
else
{
$this->isOpen = false;
}
}
function TestOpen()
{
return ($this->isOpen) ? '<TEST status=true></TEST>' : $this->HandleException();
}
function Close()
{
if (is_resource($this->connectionId) && $this->isOpen)
{
if (mysql_close($this->connectionId))
{
$this->isOpen = false;
unset($this->connectionId);
}
}
}
function GetTables($table_name = '')
{
$xmlOutput = "";
if ($this->isOpen && isset($this->connectionId) && is_resource($this->connectionId)){
// 1. mysql_list_tables and mysql_tablename are deprecated in PHP5
// 2. For backward compatibility GetTables don't have any parameters
if ($table_name === ''){
$table_name = @$_POST['Database'];
}
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
$sql = ' SHOW TABLES FROM ' . $this->ensureTicks($table_name) ;
$results = mysql_query($sql, $this->connectionId) or $this->HandleException();
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= '<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>'; // column 0 (zero-based)
$xmlOutput .= '<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>'; // column 1
$xmlOutput .= '<FIELD><NAME>TABLE_NAME</NAME></FIELD>'; // column 2
$xmlOutput .= "</FIELDS><ROWS>";
if (is_resource($results) && mysql_num_rows($results) > 0){
while ($row = mysql_fetch_array($results)){
$xmlOutput .= '<ROW><VALUE/><VALUE/><VALUE>' . $row[0]. '</VALUE></ROW>';
}
}
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetViews()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetProcedures()
{
// not supported
return "<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>";
}
function GetColumnsOfTable($TableName)
{
$xmlOutput = "";
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
$query = "DESCRIBE ".$this->ensureTicks($TableName);
$result = mysql_query($query) or $this->HandleException();
if ($result)
{
$xmlOutput = "<RESULTSET><FIELDS>";
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= "<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>"; // column 0 (zero-based)
$xmlOutput .= "<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>"; // column 1
$xmlOutput .= "<FIELD><NAME>TABLE_NAME</NAME></FIELD>"; // column 2
$xmlOutput .= "<FIELD><NAME>COLUMN_NAME</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>DATA_TYPE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>IS_NULLABLE</NAME></FIELD>";
$xmlOutput .= "<FIELD><NAME>COLUMN_SIZE</NAME></FIELD>";
$xmlOutput .= "</FIELDS><ROWS>";
// The fields returned from DESCRIBE are: Field, Type, Null, Key, Default, Extra
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$xmlOutput .= "<ROW><VALUE/><VALUE/><VALUE/>";
// Separate type from size. Format is: type(size)
if (preg_match("/(.*)\((.*)\)/", $row["Type"], $ret))
{
$type = $ret[1];
$size = $ret[2];
}
else
{
$type = $row["Type"];
$size = "";
}
// MySQL sets nullable to "YES" or "", so we need to set "NO"
$null = $row["Null"];
if ($null == "")
$null = "NO";
$xmlOutput .= "<VALUE>" . $row["Field"] . "</VALUE>";
$xmlOutput .= "<VALUE>" . $type . "</VALUE>";
$xmlOutput .= "<VALUE>" . $null . "</VALUE>";
$xmlOutput .= "<VALUE>" . $size . "</VALUE></ROW>";
}
mysql_free_result($result);
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetParametersOfProcedure($ProcedureName, $SchemaName, $CatalogName)
{
// not supported on MySQL
return '<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>';
}
function ExecuteSQL($aStatement, $MaxRows)
{
if ( get_magic_quotes_gpc() )
{
$aStatement = stripslashes( $aStatement ) ;
}
$xmlOutput = "";
$result = mysql_query($aStatement) or $this->HandleException();
if (isset($result) && is_resource($result))
{
$xmlOutput = "<RESULTSET><FIELDS>";
$fieldCount = mysql_num_fields($result);
for ($i=0; $i < $fieldCount; $i++)
{
$meta = mysql_fetch_field($result);
if ($meta)
{
$xmlOutput .= '<FIELD';
$xmlOutput .= ' type="' . $meta->type;
$xmlOutput .= '" max_length="' . $meta->max_length;
$xmlOutput .= '" table="' . $meta->table;
$xmlOutput .= '" not_null="' . $meta->not_null;
$xmlOutput .= '" numeric="' . $meta->numeric;
$xmlOutput .= '" unsigned="' . $meta->unsigned;
$xmlOutput .= '" zerofill="' . $meta->zerofill;
$xmlOutput .= '" primary_key="' . $meta->primary_key;
$xmlOutput .= '" multiple_key="'. $meta->multiple_key;
$xmlOutput .= '" unique_key="' . $meta->unique_key;
$xmlOutput .= '"><NAME>' . $meta->name;
$xmlOutput .= '</NAME></FIELD>';
}
}
$xmlOutput .= "</FIELDS><ROWS>";
$row = mysql_fetch_assoc($result);
for ($i=0; $row && ($i < $MaxRows); $i++)
{
$xmlOutput .= "<ROW>";
foreach ($row as $key => $value)
{
$xmlOutput .= "<VALUE>";
$xmlOutput .= htmlspecialchars($value);
$xmlOutput .= "</VALUE>";
}
$xmlOutput .= "</ROW>";
$row = mysql_fetch_assoc($result);
}
mysql_free_result($result);
$xmlOutput .= "</ROWS></RESULTSET>";
}
return $xmlOutput;
}
function GetProviderTypes()
{
return '<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>';
}
function ExecuteSP($aProcStatement, $TimeOut, $Parameters)
{
return '<RESULTSET><FIELDS></FIELDS><ROWS></ROWS></RESULTSET>';
}
function ReturnsResultSet($ProcedureName)
{
return '<RETURNSRESULTSET status=false></RETURNSRESULTSET>';
}
function SupportsProcedure()
{
return '<SUPPORTSPROCEDURE status=false></SUPPORTSPROCEDURE>';
}
/*
* HandleException added by InterAKT for ease in database translation answer
*/
function HandleException()
{
global $debug_to_file, $f;
$this->error = create_error(' MySQL Error#: '. ((int)mysql_errno()) . "\n\n".mysql_error());
log_messages($this->error);
die($this->error.'</HTML>');
}
function ensureTicks($inputSQL)
{
$outSQL = $inputSQL;
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
//only add ticks if not already there
$oLength = strlen($outSQL);
$bHasTick = false;
if (($oLength > 0) && (($outSQL[0] == "`") && ($outSQL[$oLength-1] == "`")))
{
$bHasTick = true;
}
if ($bHasTick == false)
{
$outSQL = "`".$outSQL."`";
}
return $outSQL;
}
function GetDatabaseList()
{
$xmlOutput = '<RESULTSET><FIELDS><FIELD><NAME>NAME</NAME></FIELD></FIELDS><ROWS>';
if (isset($this->connectionId) && is_resource($this->connectionId)){
$dbList = mysql_list_dbs($this->connectionId);
while ($row = mysql_fetch_object($dbList))
{
$xmlOutput .= '<ROW><VALUE>' . $row->Database . '</VALUE></ROW>';
}
}else{
$this->error = CONN_NOT_OPEN_GET_DB_LIST;
return $this->error;
}
$xmlOutput .= '</ROWS></RESULTSET>';
return $xmlOutput;
}
function GetPrimaryKeysOfTable($TableName)
{
$xmlOutput = '';
//added backtick for handling reserved words and special characters
//http://dev.mysql.com/doc/refman/5.0/en/legal-names.html
$query = "DESCRIBE ".$this->ensureTicks($TableName);
$result = mysql_query($query) or $this->HandleException();
if ($result)
{
$xmlOutput = '<RESULTSET><FIELDS>';
// Columns are referenced by index, so Schema and
// Catalog must be specified even though they are not supported
$xmlOutput .= '<FIELD><NAME>TABLE_CATALOG</NAME></FIELD>'; // column 0 (zero-based)
$xmlOutput .= '<FIELD><NAME>TABLE_SCHEMA</NAME></FIELD>'; // column 1
$xmlOutput .= '<FIELD><NAME>TABLE_NAME</NAME></FIELD>'; // column 2
$xmlOutput .= '<FIELD><NAME>COLUMN_NAME</NAME></FIELD>';
$xmlOutput .= '<FIELD><NAME>DATA_TYPE</NAME></FIELD>';
$xmlOutput .= '<FIELD><NAME>IS_NULLABLE</NAME></FIELD>';
$xmlOutput .= '<FIELD><NAME>COLUMN_SIZE</NAME></FIELD>';
$xmlOutput .= '</FIELDS><ROWS>';
// The fields returned from DESCRIBE are: Field, Type, Null, Key, Default, Extra
while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if (strtoupper($row['Key']) == 'PRI'){
$xmlOutput .= '<ROW><VALUE/><VALUE/><VALUE/>';
// Separate type from size. Format is: type(size)
if (preg_match("/(.*)\((.*)\)/", $row['Type'], $ret))
{
$type = $ret[1];
$size = $ret[2];
}
else
{
$type = $row['Type'];
$size = '';
}
// MySQL sets nullable to "YES" or "", so we need to set "NO"
$null = $row['Null'];
if ($null == '')
$null = 'NO';
$xmlOutput .= '<VALUE>' . $row['Field'] . '</VALUE>';
$xmlOutput .= '<VALUE>' . $type . '</VALUE>';
$xmlOutput .= '<VALUE>' . $null . '</VALUE>';
$xmlOutput .= '<VALUE>' . $size . '</VALUE></ROW>';
}
}
mysql_free_result($result);
$xmlOutput .= '</ROWS></RESULTSET>';
}
return $xmlOutput;
}
} // class MySqlConnection
?>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<info>
<infoitem key="UD_Recordset1" value="name:XM;datatype:string,name:KCM;datatype:string,name:CJ;datatype:int" />
</info>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="studentAction.php" server="D:/phpstudy_pro/WWW/chapter2" local="132367905033137966" remote="132367905030000000" Dst="0" />
<file name="fun.php" server="D:/phpstudy_pro/WWW/chapter2" local="132367921964486878" remote="132367921960000000" Dst="0" />
<file name="studentManage.php" server="D:/phpstudy_pro/WWW/chapter2" local="132366169360892870" remote="132366169360000000" Dst="0" />
<file name="login1.php" server="D:/phpstudy_pro/WWW/chapter2" local="132367913621051203" remote="132367913620000000" Dst="0" />
</dwsync>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<info>
<infoitem key="UD_Recordset1" value="name:XM;datatype:string,name:KCM;datatype:string,name:CJ;datatype:int" />
<infoitem key="UD_Recordset2" value="name:KCM;datatype:string,name:CJ;datatype:int" />
</info>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<info>
<infoitem key="UD_Recordset1" value="name:XM;datatype:string,name:KCM;datatype:string,name:CJ;datatype:int" />
<infoitem key="UD_Recordset2" value="name:KCM;datatype:string,name:CJ;datatype:int" />
</info>

@ -0,0 +1,18 @@
<?php
header('Content-Type: text/html; charset=gb2312');
?>
<html>
<head>
<title>内容网页</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body {
background-image: url(images/%E8%83%8C%E6%99%AF.gif);
background-repeat: no-repeat;
}
</style>
</head>
<body bgcolor="D9DFAA" topMargin="0" leftMargin="0" bottomMargin="0" rightMargin="0">
<img src="images/背景.gif" width="1953" height="656">
</body>
</html>

@ -0,0 +1,41 @@
<?php
header('Content-Type: text/html; charset=gb2312');
?>
<?php
?>
<html>
<head>
</head>
<body style="background: white">
<span> Hello, Course! </span>
<form action="course.php">
<label>ÐÕÃû:</label><input type="text" value="" placeholder="ÐÕÃû">
<label>ÐÕÃû:</label><input type="text" value="">
</form>
<table border="0" style="border:1px solid #000000;" border="1" cellspacing="0">
<tr >
<td style="border:1px solid #000000;">Month</td>
<td style="border:1px solid #000000;">Savings</td>
</tr>
<tr>
<td style="border:1px solid #000000;">January</td>
<td style="border:1px solid #000000;">$100</td>
</tr>
</table>
</body>
</html>

File diff suppressed because one or more lines are too long

@ -0,0 +1,11 @@
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<?php
try {
$db = new PDO("mysql:host=localhost;dbname=dxscj", "root", "root");
}catch(PDOException $e) {
echo "连接错误".$e->getMessage();
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 840 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 960 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -0,0 +1,44 @@
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<html>
<head>
<title>学生管理系统</title>
<style>
.d1{
font-family: "Adobe 楷体 Std R";
text-align: center;
font-size: 52px;
color: #600;
text-shadow: 2px 2px 2px #F00;
//background-image:url(images/9999.jpg)
background-repeat:no-repeat;
}
</style>
</head>
<body topMargin="0" leftMargin="0" bottomMargin="0" rightMargin="0">
<table width="1025" border="0" align="center" cellpadding="0" cellspacing="0" style="width: 1024px;">
<tr>
<td width="1025"><img src="images/top.jpg" width="1700" height="200"><div class="d1">学生成绩管理系统 </div></td>
</tr>
<tr>
<td><iframe src="main_frame.html" width="1700" height="616"></iframe></td>
</tr>
<tr><td><img src="images/底部.png" width="1700" height="118">
</td></tr>
</table>
</body>
</html>
<script type="text/javascript">
console.info("console");
</script>

@ -0,0 +1,293 @@
<!doctype html>
<html><head>
<meta charset="utf-8">
<title>login</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
#wrap {
height: 719px;
width: 100;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
position: relative;
}
#head {
height: 120px;
width: 100;
background-color: #000;
text-align: center;
position: relative;
}
#foot {
width: 100;
height: 120px;
background-color: #333;
position: relative;
text-align: center;
line-height: 3vh;
}
#wrap .logGet {
height: 408px;
width: 368px;
position: absolute;
background-color: #FFFFFF;
top: 195px;
right: 179px;
}
.logC a button {
width: 100%;
height: 45px;
background-color: #ee7700;
border: none;
color: white;
font-size: 18px;
}
.logC input {
width: 100%;
height: 45px;
background-color: #669966;
border: none;
color: white;
font-size: 18px;
}
.logGet .logD.logDtip .p1 {
display: compact;
font-size: 28px;
margin-top: 30px;
width: 86%;
color:#000
}
#wrap .logGet .logD.logDtip {
width: 86%;
border-bottom: 1px solid #ee7700;
margin-bottom: 60px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
}
.logGet .lgD img {
position: absolute;
top: 12px;
left: 8px;
}
.logGet .lgD input {
width: 100%;
height: 42px;
text-indent: 2.5rem;
}
#wrap .logGet .lgD {
width: 86%;
position: relative;
margin-bottom: 30px;
margin-top: 30px;
margin-right: auto;
margin-left: auto;
}
#wrap .logGet .logC {
width: 86%;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
.title {
font-family: "Adobe 楷体 Std R";
color: #FFFFFF;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); /* 使用css3的transform来实现 */
font-size: 52px;
height: 40px;
width: 30%;
}
.copyright {
font-family: "宋体";
color: #FFFFFF;
position: absolute;
top: 93px;
left: 306px;
transform: translate(-50%, -50%); /* 使用css3的transform来实现 */
height: 263px;
width: 730px;
text-align: center;
}
#foot .copyright .img {
width: 100%;
height: 24px;
position: relative;
}
.copyright .img .icon {
display: inline-block;
width: 24px;
height: 24px;
margin-left: 22px;
vertical-align: middle;
background-image: url(%E7%94%B5%E5%AD%90%E9%82%AE%E4%BB%B6.png);
background-repeat: no-repeat;
vertical-align: middle;
margin-right: 5px;
}
.copyright .img .icon1 {
display: inline-block;
width: 24px;
height: 24px;
margin-left: 22px;
vertical-align: middle;
background-image: url(%E5%9C%B0%E5%9D%80.png);
background-repeat: no-repeat;
vertical-align: middle;
margin-right: 5px;
}
.copyright .img .icon2 {
display: inline-block;
width: 24px;
height: 24px;
margin-left: 22px;
vertical-align: middle;
background-image: url(%E8%81%94%E7%B3%BB%E6%96%B9%E5%BC%8F.png);
background-repeat: no-repeat;
vertical-align: middle;
margin-right: 5px;
}
#foot .copyright p {
height: 24px;
width: 100%;
}
body,td,th {
font-family: "Adobe 楷体 Std R";
font-size: 24px;
color: #FFF;
}
body {
background-color: #FFF;
background-image:
background-repeat: no-repeat;
background-image: url(images/timg.gif);
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body>
<?php
include "fun.php";
//include "studentManage.php";
$username = @$_POST['username']; //用户名
$password = @$_POST['password']; //密码
echo $username;
//echo $password;
$success_tips = "<script type='javascript'>alert(0)</script>";
if(!empty($username))
{
$s_sql = "select * from user where username ='$username' and password='$password'"; //查找姓名、已修课程数信息
$s_result = $db->query( $s_sql);
if($s_result && $s_result->rowCount() != 0)
{
echo "<script>url=\"index.php\";window.location.href=url;</script>";
}
else
{
echo "<script language=\"JavaScript\">alert(\"用户名,密码错误\");</script>";
}
}
?>
<div class="header" id="head">
<div class="title">学生成绩管理系统</div>
</div>
<form name="login" action="login1.php" method="post">
<div class="wrap" id="wrap">
<div class="logGet">
<div class="logD logDtip">
<p class="p1">登录</p>
</div>
<div class="lgD">
<img src="images/7897.jpg" width="20" height="20" alt=""/>
<input name="username" type="text"
placeholder="输入用户名" />
</div>
<div class="lgD">
<img src="images/5473167.jpg" width="20" height="20" alt=""/>
<input name="password" type="password"
placeholder="输入用户密码" />
</div>
<div class="logC" >
<input type="submit" value="登 录"><br>
</div>
</div>
</div>
</form>
<div class="footer" id="foot">
<tr>
<th>&nbsp;&nbsp;&nbsp;</th>
<th>姓名:肖演淮</th>
<th> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</th>
<th>学院:计算机科学与工程学院</th><th> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</th>
<th>系别/班级:19级软件工程2班</th><th> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</th>
<br>
<th><p>qq邮箱:450443740@qq.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;电话:18029568415</p></th>
</tr>
<tr>
<th></th>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<p><a href="mailto:450443740@qq.com">联系我们</a></p>
</font>
</div>
</div>
</div>
</body>
</html>

@ -0,0 +1,31 @@
<?php
header('Content-Type: text/html; charset=gb2312');
?>
<html>
<head>
<title>学生管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
body {
background-image: url(images/%E8%83%8C%E6%99%AF.gif);
background-repeat: no-repeat;
background-size: cover;
}
</style>
</head>
<body bgcolor="D9DFAA">
<tr>
<td height="158" align="center"><input type="button" value="学生管理" onclick=parent.frmmain.location="studentManage.php" style="width: 200px; height: 80px; font-size: 40px; background-color:#309;"></td>
</tr>
<tr>
<td height="278" align="center"><input type="button" value="成绩管理" onclick=parent.frmmain.location="scoreManage.php" style="width: 200px; height: 80px; font-size: 40px; background-color:#06C"></td>
</tr>
</table>
</body>
</html>

@ -0,0 +1,14 @@
<?php
header('Content-Type: text/html; charset=gb2312');
?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=GB2312"/>
<title>学生成绩管理系统</title>
</head>
<frameset rows="*" cols="1,210,*">
<frame src="UntitledFrame-1.html">
<frame frameborder=0 src="main.php" name="frmleft" scrolling="no" noresize>
<frame frameborder=0 src="body.html" name="frmmain" scrolling="no" noresize>
</frameset><noframes></noframes>
</html>

@ -0,0 +1,153 @@
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<html>
<head>
<title>成绩管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-image: url(images/%E8%83%8C%E6%99%AF.gif);
background-repeat: no-repeat;
background-size: cover;
color: #FFF;
font-size: larger;
}
.zt {
font-size: 36px;
font-weight: bold;
}
</style>
</head>
<body>
<form method="post">
<p>&nbsp;</p>
<table>
<tr>
<td align="left" class="zt"><table>
<tr></tr>
<tr>
<td align="left" class="zt"><table width="494" height="189">
<tr>
<td width="365" class="zt"> 课程名:
<script type="text/javascript">
function setCookie(name, value) {
var exp = new Date();
exp.setTime(exp.getTime() + 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
}
function getCookie(name) {
var regExp = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
var arr = document.cookie.match(regExp);
if(arr == null) {
return null;
}
return unescape(arr[2]);
}
</script>
<select name="kcm" id="select_1"
onclick="setCookie('select_1',this.selectedIndex)">
<?php
echo "<option>请选择</option>";
require "fun.php";
$kcm_sql = "select distinct KCM from KC"; //查找所有的课程名
$kcm_result = $db->query($kcm_sql);
while(list($KCM) = $kcm_result->fetch(PDO::FETCH_NUM)) { //输出课程名到下拉框中
$KC = iconv('UTF-8', 'UTF-8', $KCM);
echo "<option value=$KC>$KC</option>";
}
?>
</select>
<script type="text/javascript">
var selectedIndex = getCookie("select_1");
if(selectedIndex != null) {
document.getElementById("select_1").selectedIndex = selectedIndex;
}
</script></td>
<td width="100"><input name="btn" type="submit" value="查询"></td>
</tr>
<tr>
<td class="zt"> 姓名:
<input type="text" name="xm" size="5">
&nbsp;
成绩:
<input type="text" name="cj" size="2"></td>
<td><input name="btn" type="submit" value="录入">
<input name="btn" type="submit" value="删除"></td>
</tr>
<tr>
<td align="left" class="zt"><table border=1 width="285">
<tr bgcolor=#CCCCC0>
<td align="center">姓名</td>
<td align="center">成绩</td>
</tr>
<?php
include "fun.php";
if(@$_POST["btn"] == '查询') {
$CourseName = $_POST['kcm'];
$cj_sql = "select XM, CJ from CJ where KCM ='$CourseName'";
$cj_result = $db->query(iconv('UTF-8', 'UTF-8', $cj_sql));
if ($cj_result->rowCount() == 0)
echo "<script>alert('该门课程无学生选!');location.href='scoreManage.php';</script>";
else {
while (list ($XM, $CJ) = $cj_result->fetch(PDO::FETCH_NUM))
{
$Name = iconv('UTF-8', 'UTF-8', $XM);
echo "<tr><td align=center>$Name&nbsp;</td><td align=center>$CJ</td></tr>";
}
}
}
?>
</table></td>
<td></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form>
</body>
</html>
<?php
@$CourseName = $_POST['kcm'];
@$StudentName = $_POST['xm'];
@$Score = $_POST['cj'];
$cj_sql = "select * from CJ where KCM ='$CourseName' and XM ='$StudentName'";
$result = $db->query(iconv('UTF-8', 'UTF-8', $cj_sql));
if(@$_POST["btn"] == '录入')
{if($result->rowCount() != 0)
echo "<script>alert('该记录已经存在!');location.href='scoreManage.php';</script>";
else
{
$insert_sql = "insert into CJ(XM, KCM, CJ) values('$StudentName', '$CourseName', '$Score')";
$insert_result = $db->query(iconv('UTF-8', 'UTF-8', $insert_sql));
if($insert_result->rowCount() != 0)
echo "<script>alert('添加成功!');location.href='scoreManage.php';</script>";
else
echo "<script>alert('添加失败,请确保有此学生!');location.href='scoreManage.php';</script>";
}
}
if(@$_POST["btn"] == '删除') {
if($result->rowCount() != 0) {
$delete_sql = "delete from CJ where XM ='$StudentName' and KCM ='$CourseName'";
$del_affected = $db->exec(iconv('UTF-8', 'UTF-8', $delete_sql));
if($del_affected)
echo "<script>alert('删除成功!');location.href='scoreManage.php';</script>";
else
echo "<script>alert('删除失败,请检查操作权限!');location.href='scoreManage.php';</script>";
}else
echo "<script>alert('该记录不存在!');location.href='scoreManage.php';</script>";
}
?>

@ -0,0 +1,17 @@
<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<?php
header('Content-type: image/jpg'); //输出HTTP头信息
require "fun.php";
//以GET方法从studentManage.php页面img控件的src属性中获取学生姓名值
$StuXm = $_GET['studentname'];
$sql = "select ZP from XS where XM ='$StuXm'"; //根据姓名查找照片
$result = $db->query(iconv('UTF-8', 'UTF-8', $sql));
//$result = mysql_query($sql);
list($ZP) = $result->fetch(PDO::FETCH_NUM);
//$row = mysql_fetch_array($result);
$image = base64_decode($ZP); //使用base64_decode()函数解码
//$image = base64_decode($row['ZP']); //使用base64_decode()函数解码
echo $image; //输出照片
?>

@ -0,0 +1,91 @@
<?php
header('Content-Type: text/html; charset=UTF-8');
?>
<?php
include "fun.php";
include "studentManage.php";
$StudentName = @$_POST['xm']; //姓名
$Sex = @$_POST['xb']; //性别
$Birthday = @$_POST['cssj']; //生日
$tmp_file = @$_FILES["photo"]["tmp_name"]; //文件被上传后在服务端储存的临时文件
$handle = @fopen($tmp_file,'rb'); //打开文件
$Picture = @base64_encode(fread($handle, filesize($tmp_file))); //读取上传的照片变量并编码
$s_sql = "select XM, KCS from XS where XM ='$StudentName'"; //查找姓名、已修课程数信息
$s_result = $db->query(iconv('UTF-8', 'UTF-8', $s_sql));
/**以下为各学生管理操作按钮的代码*/
//录入功能
if(@$_POST["btn"] == '录入') { //单击"录入"按钮
if($s_result->rowCount() != 0) //要录入的学生姓名已经存在时提示
echo "<script>alert('该学生已经存在!');location.href='studentManage.php';</script>";
else {
if(!$tmp_file) { //没有上传照片的情况
$insert_sql = "insert into XS values('$StudentName', $Sex, '$Birthday', 0, NULL, NULL)";
}else {
$insert_sql = "insert into XS values('$StudentName', $Sex, '$Birthday', 0, NULL, '$Picture')";
}
$insert_result = $db->query(iconv('UTF-8', 'UTF-8', $insert_sql));
if($insert_result->rowCount() != 0) {
$_SESSION['StuName'] = $StudentName;
echo "<script>alert('添加成功!');location.href='studentManage.php';</script>";
}else
echo "<script>alert('添加失败,请检查输入信息!');location.href='studentManage.php';</script>";
}
}
//删除功能
if(@$_POST["btn"] == '删除') { //单击"删除"按钮
if($s_result->rowCount() == 0) //要删除的学生姓名不存在时提示
echo "<script>alert('该学生不存在!');location.href='studentManage.php';</script>";
else { //处理姓名存在的情况
list($XM, $KCS) = $s_result->fetch(PDO::FETCH_NUM);
if($KCS != 0) //学生有修课记录时提示
echo "<script>alert('该生有修课记录,不能删!');location.href='studentManage.php';</script>";
else { //删除操作
$del_sql = "delete from XS where XM ='$StudentName'";
$del_affected = $db->exec(iconv('UTF-8', 'UTF-8', $del_sql));
if($del_affected) {
$_SESSION['StuName'] = 0;
echo "<script>alert('删除成功!');location.href='studentManage.php';</script>";
}
}
}
}
//更新功能
if(@$_POST["btn"] == '更新'){ //单击"更新"按钮
$_SESSION['StuName'] = $StudentName; //将用户输入的姓名用SESSION保存
if(!$tmp_file) //若没有上传文件则不更新照片列
$update_sql = "update XS set XB =$Sex, CSSJ ='$Birthday' where XM ='$StudentName'";
else
$update_sql = "update XS set XB =$Sex, CSSJ ='$Birthday', ZP='$Picture' where XM ='$StudentName'";
$update_affected = $db->exec(iconv('UTF-8', 'UTF-8', $update_sql));
if($update_affected)
echo "<script>alert('更新成功!');location.href='studentManage.php';</script>";
else
echo "<script>alert('更新失败,请检查输入信息!');location.href='studentManage.php';</script>";
}
//查询功能
if(@$_POST["btn"] == '查询') { //单击"查询"按钮
$_SESSION['StuName'] = $StudentName; //将姓名传给其他页面
$sql = "select XM, XB, CSSJ, KCS from XS where XM ='$StudentName'"; //查找姓名对应的学生信息
$result = $db->query(iconv('UTF-8', 'UTF-8', $sql));
if($result->rowCount() == 0) //判断该学生是否存在
echo "<script>alert('该学生不存在!');location.href='studentManage.php';</script>";
else {
list($XM, $XB, $CSSJ, $KCS) = $result->fetch(PDO::FETCH_NUM);
$_SESSION['XM'] = iconv('UTF-8', 'UTF-8', $XM);
$_SESSION['XB'] = $XB;
$_SESSION['CSSJ'] = $CSSJ;
$_SESSION['KCS'] = $KCS;
echo "<script>location.href='studentManage.php';</script>";
}
}
?>

@ -0,0 +1,119 @@
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<?php
session_start();
?>
<html>
<head>
<title>学生管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
body {
background-image: url(images/%E8%83%8C%E6%99%AF.gif);
background-size: cover;
background-repeat: no-repeat;
font-family: "Adobe 楷体 Std R";
color: #FFF;
font-size: 40px;
}
</style>
</head>
<body >
<?php
@$XM = $_SESSION['XM'];
@$XB = $_SESSION['XB'];
@$CSSJ = $_SESSION['CSSJ'];
@$KCS = $_SESSION['KCS'];
@$StuName = $_SESSION['StuName'];
?>
<form method="post" action="studentAction.php" enctype="multipart/form-data">
<table>
<tr>
<td><table>
<tr>
<td>姓名:</td>
<td><input type="text" name="xm" value="<?php echo @$XM;?>"/></td>
</tr>
<tr>
<td>性别:</td>
<?php
if(@$XB == 1) {
?>
<td>
<input type="radio" name="xb" value="1" checked="checked">
<input type="radio" name="xb" value="0">
</td>
<?php
}else {
?>
<td>
<input type="radio" name="xb" value="1">
<input type="radio" name="xb" value="0" checked="checked">
</td>
<?php
}
?>
</tr>
<tr>
<td>出生年月:</td>
<td><input type="text" name="cssj" value="<?php echo @$CSSJ;?>"/></td>
</tr>
<tr>
<td>照片:</td><td><input name="photo" type="file"></td>
</tr>
<tr>
<td></td>
<td>
<?php
echo "<img src='showpicture.php?studentname=$StuName&time=".time()."' width=200 height=300 />";
?>
</td>
</tr>
<tr>
<td></td>
<td>
<input name="btn" type="submit" value="录入">
<input name="btn" type="submit" value="删除">
<input name="btn" type="submit" value="更新">
<input name="btn" type="submit" value="查询">
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>已修课程<input type="text" name="kcs" size="6" value="
<?php echo @$KCS;?>" disabled/></td>
</tr>
<tr>
<td align="left">
<?php
include "fun.php";
$cj_sql = "call CJ_PROC('$StuName')";
$result = $db->query(iconv('UTF-8', 'UTF-8', $cj_sql));
$xmcj_sql = "select * from XMCJ_VIEW";
$cj_rs = $db->query($xmcj_sql);
echo "<table border=1>";
echo "<tr bgcolor=#CC0066>";
echo "<td>课程名</td><td align=center>成绩</td></tr>";
while(list($KCM, $CJ) = $cj_rs->fetch(PDO::FETCH_NUM)) {
$KC = iconv('UTF-8', 'UTF-8', $KCM);
echo "<tr><td>$KC&nbsp;</td><td align=center>$CJ</td></tr>";
}
echo "</table>";
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Loading…
Cancel
Save