-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_stu.php
221 lines (209 loc) · 10.6 KB
/
add_stu.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?php
header("Content-type:text/html;charset=utf-8");
include "add_user_fun.php";
//$query="select COLUMN_COMMENT, COLUMN_NAME from information_schema.columns where table_schema='choose_lesson_system' and table_name='user_stu'";
//$cn_query=mysql_query($query);
//$result_1=mysql_fetch_row($query);
//echo($result_1[0]);
//print_r($result);
function lwreplace($lwchar){
return(str_replace(' ','',$lwchar));
}
if(trim($_POST['user_name'])!=NULL){
//echo($_POST['user_name']);
//echo("<script>alert('锟斤拷锟斤拷晒锟絪s');</script>");
//******************************锟斤拷锟斤拷锟斤拷一些锟斤拷锟斤拷没锟叫革拷锟斤拷锟睫革拷权锟斤拷*****锟斤拷锟斤拷说学院
$stu_id=lwreplace(trim($_POST['stu_id']));
//$stu_pass=trim($_POST['stu_pass']);
$stu_pass=$stu_id;
$user_name=trim($_POST['user_name']);
$en_name=trim($_POST['en_name']);
$stu_sex=trim($_POST['stu_sex']);
$stu_sch=trim($_POST['stu_sch']);
$stu_maj=trim($_POST['stu_maj']);
$stu_gra=trim($_POST['stu_gra']);
$stu_clas=trim($_POST['stu_clas']);
$stu_clas=$stu_gra.$stu_clas;
$stu_bir=trim($_POST['stu_bir']);
$passport_id=trim($_POST['passport_id']);
$stu_nation=trim($_POST['stu_nation']);
$stu_address1=trim($_POST['stu_address1']);
$stu_address2=trim($_POST['stu_address2']);
$contact_way=trim($_POST['contact_way']);
$fri_contact_way=trim($_POST['fri_contact_way']);
$entrydate=trim($_POST['entrydate']);
$gradate=trim($_POST['gradate']);
$nature=trim($_POST['nature']);
$comment=trim($_POST['comment']);
if(is_exist($stu_id)!=0){
exit('学锟斤拷锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷');
}
$jud=add_stu_user($stu_id,$stu_pass,$user_name,$en_name,$stu_sex,$stu_sch,$stu_maj,$stu_gra,$stu_clas,$stu_bir,$passport_id,$stu_nation,$stu_address1,$stu_address2,$contact_way,$fri_contact_way,$entrydate,$gradate,$nature,$comment);
if($jud){
echo('<script>alert("锟斤拷锟接成癸拷");window.location.href="add_stu.php"</script>');
//echo('<script>alert("'.$stu_clas.'")</script>');
}
else{echo('<script>alert("锟斤拷锟斤拷失锟斤拷");</script>');}
//$sql="update `user_stu` set ch_name='$user_name', en_name='$en_name', stu_sex='$stu_sex', stu_maj='$stu_maj', stu_gra='$stu_gra', stu_clas='$stu_clas', stu_bir='$stu_bir', passport_id='$passport_id', stu_nation='$stu_nation', stu_address1='$stu_address1', stu_address2='$stu_address2', contact_way='$contact_way', fri_contact_way='$fri_contact_way' where stu_id='201063502140'";
}
?>
<!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 id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>锟矫伙拷锟斤拷锟斤拷</title>
<!--lw-->
<link href="../style/green/skin.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../My97DatePicker/WdatePicker.js" type="text/javascript"></script>
</head>
<body>
<form id="Form1" action="" method="post" onsubmit="return test(this)">
<div id="tbMain">
<div class="divTbg">
<div class="divTbgL"></div>
<div class="divTbgInfo">
<div class="divTbgTitle">锟斤拷锟斤拷学锟斤拷</div>
</div>
</div>
<div class="divTbgF"></div>
<div class="divTNavBG" id="topURL">
<ul id="topURLul">
<li class="divURLed" id="div1">
<div><img src="../style/green/images/mini_icons_046.gif" width="10" height="10" /> 锟斤拷锟斤拷锟斤拷息</div>
</li>
</ul>
</div>
<div id="mypanel">
<div class="divInfo" id="ddiv1">
<div class="divInfoTop">
<div class="listLeft">
<ul>
<li>
<div><img src="../style/green/images/basic.gif"/></div>
</li>
<li>锟斤拷锟斤拷锟斤拷息</li>
</ul>
</div>
</div>
<div class="divInfoContext">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" class="SkyTDLine">
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 学锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="stu_id"/><span class="red_note"> *</span></td>
<td></td>
<td></td>
<!--
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="password" name="stu_pass" /><span class="red_note"> *</span></td>
-->
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="user_name"/><span class="red_note"> *</span></td>
<td align="center" class="SkyTDTopLine" width="100"> 英锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="en_name"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟皆憋拷 </td>
<td class="SkyTDLine" >
<input type="radio" name="stu_sex" value="锟斤拷"/> 锟斤拷
<input type="radio" name="stu_sex" value="女"/> 女</td>
<td align="center" class="SkyTDTopLine" width="100"> 学院 </td>
<td class="SkyTDLine" ><select name='stu_sch'>
<?php sel_option('学院');?>
</select><span class="red_note"> *</span></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 专业 </td>
<td class="SkyTDLine" ><select name='stu_maj'>
<?php sel_option('专业');?>
</select><span class="red_note"> *</span></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟疥级 </td>
<td class="SkyTDLine" ><select name='stu_gra'>
<option value="">--锟斤拷选锟斤拷--</option>
<?php sel_option('锟疥级');?>
</select><span class="red_note"> *</span></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟洁级 </td>
<td class="SkyTDLine" ><select name='stu_clas'>
<option value="">--锟斤拷选锟斤拷--</option>
<?php sel_option('锟洁级');?>
</select><span class="red_note"> *</span></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="stu_bir" onclick="WdatePicker({skin:'whyGreen',readOnly:true,dateFmt:'yyyy-MM-dd'});"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="passport_id"/></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="stu_nation"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷住址 </td>
<td class="SkyTDLine" ><input type="text" name="stu_address1"/></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷台住址 </td>
<td class="SkyTDLine" ><input type="text" name="stu_address2"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷系锟斤拷式 </td>
<td class="SkyTDLine" ><input type="text" name="contact_way"/></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷锟斤拷系锟斤拷式 </td>
<td class="SkyTDLine" ><input type="text" name="fri_contact_way"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷学锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="entrydate" onclick="WdatePicker({skin:'whyGreen',readOnly:true,dateFmt:'yyyy-MM-dd'});"/><span class="red_note"> *</span></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷业锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="gradate" onclick="WdatePicker({skin:'whyGreen',readOnly:true,dateFmt:'yyyy-MM-dd'});"/></td>
</tr>
<tr class='MeNewTDLine'>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷锟斤拷 </td>
<td class="SkyTDLine" ><input type="text" name="nature"/><span class="red_note"> *</span></td>
<td align="center" class="SkyTDTopLine" width="100"> 锟斤拷注 </td>
<td class="SkyTDLine" ><input type="text" name="comment"/></td>
</tr>
</table>
</div>
</div>
</div>
<div class="divSave">
<input type="submit" class="SkyButtonFocus" value="锟斤拷锟斤拷" />
<input type="button" class="SkyButtonFocus" value="取锟斤拷" />
</div>
</div>
</form>
</body>
<script type="text/javascript">
function test(form){
if(form.stu_id.value==""){
alert("锟斤拷锟斤拷写学锟脚o拷");
return(false);
}
if(!(form.stu_sex[0].checked||form.stu_sex[1].checked)){
alert("锟斤拷选锟斤拷锟皆憋拷!");
return(false);
}
if(form.stu_gra.value==""){
alert("锟斤拷选锟斤拷锟疥级锟斤拷");
return(false);
}
if(form.stu_clas.value==""){
alert("锟斤拷选锟斤拷嗉讹拷锟?);
return(false);
}
if(form.user_name.value==""){
alert("锟斤拷锟斤拷写锟斤拷锟斤拷锟斤拷");
return(false);
}
if(form.entrydate.value==""){
alert("锟斤拷锟斤拷写锟斤拷学锟斤拷锟节o拷");
return(false);
}
if(form.nature.value==""){
alert("锟斤拷锟斤拷写锟斤拷锟绞o拷");
return(false);
}
}
</script>
</html>