001.
<?php session_start();
002.
include
(
"nusoap/nusoap.php"
);
003.
include
(
"connect_db.php"
);
004.
?>
007.
<head>
008.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
009.
010.
<title>ระบบล็อกอิน</title>
011.
<style type=
"text/css"
>
012.
<!--
013.
body,td,th {
014.
font-family: Angsana New;
015.
font-size: 24px;
016.
font-weight: bold;
017.
font-family: sr FahTHAI;
018.
font-family: sr FahTHAI;
019.
}
020.
a {
021.
font-family: Angsana New;
022.
font-size: 24px;
023.
font-weight: bold;
024.
font-family: sr FahTHAI;
025.
}
026.
h1 {
027.
font-size: 24px;
028.
}
029.
body {
030.
background-image: url();
031.
background-color: #FFF;
032.
}
033.
h1,h2,h3,h4,h5,h6 {
034.
font-weight: bold;
035.
font-family: Angsana New;
036.
}
037.
.style3 {
038.
font-size: 18;
039.
font-family:
"Angsana New"
;
040.
}
041.
.style11 {font-size: 24px; font-family:
"Angsana New"
; }
042.
.style12 {font-size: 20px}
043.
-->
044.
</style>
045.
</head>
046.
047.
<body>
048.
<table width=
"1018"
border=
"0"
align=
"center"
>
049.
<tr>
050.
<th height=
"81"
colspan=
"2"
scope=
"col"
><img src=
"image/EV1.jpg"
width=
"1024"
height=
"300"
/></th>
051.
</tr>
052.
<tr>
053.
<td colspan=
"2"
align=
"center"
bgcolor=
"#FF99FF"
><table width=
"1024"
border=
"0"
>
054.
<tr>
055.
<th height=
"50"
align=
""
valign=
"bottom"
bgcolor=
"#FFCCFF"
scope=
"row"
><form action=
"?action=check_login"
method=
"post"
name=
"login_frm"
id=
"login_frm"
onsubmit=
"return login_check()"
>
056.
<table width=
"610"
height=
"188"
border=
"0"
align=
"center"
cellpadding=
"0"
cellspacing=
"0"
id=
"Table_01"
>
057.
<tr>
058.
<td height=
"60"
colspan=
"4"
align=
"center"
valign=
"bottom"
>
059.
<font color=
"#EE0000"
size=
"+3"
></font>
060.
<span
class
=
"style11"
><font color=
"#EE0000"
>กรุณาป้อนรหัสประจำตัวและรหัสผ่าน</font></span></td>
061.
</tr>
062.
<tr>
063.
<td width=
"175"
rowspan=
"3"
align=
"right"
valign=
"top"
> </td>
064.
<td height=
"80"
colspan=
"3"
valign=
"top"
>
065.
<label
for
=
"user_name"
></label>
066.
<label
for
=
"pass_word"
></label>
067.
<table width=
"300"
height=
"50"
border=
"0"
align=
"left"
cellpadding=
"0"
cellspacing=
"0"
>
068.
<tr>
069.
<td width=
"80"
align=
"right"
valign=
"middle"
><span
class
=
"style11"
><span
class
=
"style12"
>ชื่อผู้ใช้ </span>:</span></td>
070.
<td height=
"30"
align=
"left"
valign=
"middle"
>
071.
<input name=
"user_name"
type=
"text"
id=
"user_name"
size=
"15"
value=
""
onclick=
"clickclear(this, 'ชื่อผู้ใช้...')"
onblur=
"clickrecall(this,'ชื่อผู้ใช้...')"
/>
072.
<font color=
"#FF0000"
>*</font></td>
073.
</tr>
074.
<tr>
075.
<td height=
"38"
align=
"right"
valign=
"middle"
><span
class
=
"style11"
><span
class
=
"style12"
>รหัสผ่า</span>น :</span> </td>
076.
<td width=
"171"
height=
"30"
align=
"left"
valign=
"middle"
>
077.
<input name=
"pass_word"
type=
"password"
id=
"pass_word"
size=
"16"
value=
""
onclick=
"clickclear(this, '.........')"
onblur=
"clickrecall(this,'.........')"
/>
078.
<font color=
"#FF0000"
>*</font> </td>
079.
</tr>
080.
</table></td>
081.
</tr>
082.
<tr>
083.
<td width=
"276"
height=
"42"
align=
"center"
valign=
"top"
><input type=
"submit"
name=
"button"
id=
"button"
value=
" เข้าสู่ระบบ "
/>
084.
<input type=
"reset"
name=
"button2"
id=
"button2"
value=
" ยกเลิก "
/></td>
085.
<td width=
"5"
align=
"center"
> </td>
086.
<td width=
"154"
rowspan=
"2"
> </td>
087.
</tr>
088.
<tr>
089.
<td height=
"24"
colspan=
"2"
> </td>
090.
</tr>
091.
</table>
092.
</form>
093.
<!--
End
ImageReady Slices -->
094.
<?php
095.
096.
if
(
$_GET
[
"action"
]==
"check_login"
)
097.
{
099.
$result
=
$client
->call(
'getuser'
,
array
(
'username'
=>
$user
,
'password'
=>
$pass
));
100.
$user
= trim(
$_POST
[
'user_name'
]);
101.
$pass
= trim(
$_POST
[
'pass_word'
]);
102.
$SQL
=
"SELECT * FROM OFFICER where \"OFFICERCODE\"='$result'"
;
103.
$stmt
=oci_parse(
$objConnect
,
$SQL
);
104.
oci_execute(
$stmt
,OCI_DEFAULT);
105.
$row
= oci_fetch_array(
$stmt
,OCI_BOTH);
106.
$type_id
=
$row
[
"OFFICERTYPE"
];
107.
$card_id
=
$row
[
"OFFICERCODE"
];
108.
109.
if
(
$result
)
110.
{
111.
112.
$b
=
explode
(
","
,
$result
);
113.
$_SESSION
[
"officer_code"
]=
$b
[0];
114.
$_SESSION
[
"name"
]=
$b
[1];
115.
$_SESSION
[
"faculty"
]=
$b
[6];
116.
session_write_close();
117.
echo
"<meta http-equiv='refresh' content='0;URL=index.php?name=$user'>"
;
118.
119.
}
if
((
$result
==
$OFFICERCODE
)&&(
$OFFICERTYPE
==
'WEBMIS'
)){
120.
$b
=
explode
(
","
,
$result
);
121.
$_SESSION
[
"officer_code1"
]=
$b
[0];
122.
$_SESSION
[
"name1"
]=
$b
[1];
123.
$_SESSION
[
"faculty1"
]=
$b
[6];
124.
$_SESSION
[
"fac_work"
]=
$b
[7];
125.
session_write_close();
126.
echo
"<meta http-equiv='refresh' content='0;URL=index_officer.php?name=$user'>"
;
127.
}
else
if
((
$result
==
$OFFICERCODE
)&&(
$OFFICERTYPE
==
'WEBREGISTRA'
)){
128.
$b
=
explode
(
","
,
$result
);
129.
$_SESSION
[
"officer_code2"
]=
$b
[0];
130.
$_SESSION
[
"name2"
]=
$b
[1];
131.
$_SESSION
[
"faculty2"
]=
$b
[6];
132.
$_SESSION
[
"fac_work"
]=
$b
[7];
133.
session_write_close();
134.
echo
"<meta http-equiv='refresh' content='0;URL=index_officer1.php?name=$user'>"
;
135.
136.
}
else
{
138.
$result
=
$client
->call(
'auth'
,
array
(
'username'
=>
$user
,
'password'
=>
$pass
));
139.
140.
if
(
$result
<>
"กรุณาตรวจสอบชื่อผู้ใช้และรหัสผ่าน"
)
141.
{
142.
$b
=
explode
(
","
,
$result
);
143.
$_SESSION
[
"student_code"
]=
$b
[0];
144.
$_SESSION
[
"cars_id"
]=
$b
[1];
145.
$_SESSION
[
"prefix"
]=
$b
[2];
146.
$_SESSION
[
"std_name"
]=
$b
[3];
147.
$_SESSION
[
"std_surname"
]=
$b
[4];
148.
$_SESSION
[
"program"
]=
$b
[5];
149.
$_SESSION
[
"faculty"
]=
$b
[6];
150.
session_write_close();
151.
152.
153.
echo
"<meta http-equiv='refresh' content='0;URL=index_std.php?student_code="
.
$_SESSION
[
"student_code"
].
"' on>"
;
154.
155.
}
else
156.
{
157.
echo
"<script>alert(' username password ไม่ถูกต้องตรวจสอบอีกครั้ง'); window.location = 'page_login.php';</script>"
;
158.
159.
160.
echo
"<meta http-equiv='refresh' content='0;URL=page_login.php'>"
;
161.
echo
"<meta http-equiv='refresh' content='0;'>"
;
162.
echo
"<script language='JavaScript'>"
;
163.
echo
"alert('ชื่อและรหัสผ่านไม่ถูกต้อง');"
;
164.
echo
"</script >"
;
165.
}
166.
}
167.
}
168.
169.
?></th>
170.
</tr>
171.
</table></td>
172.
</tr>
173.
<tr>
174.
<td colspan=
"2"
align=
"center"
bgcolor=
"#FF99FF"
><span
class
=
"style3"
><font size=
"+1"
>กองบริการการศึกษา มหาวิทยาลัยราชภัฏยะลา 073-227-151 ต่อ 1002</font></span></td>
175.
</tr>
176.
</table>
177.
</body>
178.
</html>