-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.php
64 lines (55 loc) · 1.51 KB
/
list.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
<html><head><meta http-equiv="content-Type" content="test/html; charset=utf-8">
<title>清單</title>
<script>
function func1(ID) {
window.open("apply.php?theID="+ID,"right_frame","toolbar=no,location=yes, directories=no,status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=400, height=620");
}
function mouse_in(x){
x.style.color="#FFFFFF";
x.style.backgroundColor="E60000";
}
function mouse_out(x){
x.style.color="#000000";
x.style.backgroundColor="FFFFFF";
}
</script>
</head>
<body>
<?php
//連接MsSql資料庫
$serverIP="10.100.74.0";
$connectinfor = array("UID" => "sa", "PWD" => "ebm_sa", "Database" => "iDO_apply_doc");
$ContSVR = sqlsrv_connect($serverIP,$connectinfor);
IF ($ContSVR === FALSE) {
die (print_r(sqlsrv_errors(),TRUE));
}
//SQL語法放入變數
$sql_1="select * from apply_doc order by U_ID,dept,account,P_name";
//執行SQL語法
$stmt=sqlsrv_query($ContSVR,$sql_1);
if ($stmt === false) {
die (print_r(sqlsrv_errors(),true));
}
echo "<table border=\"1\">
<tr>
<th>Row_ID</th>
<th>姓名</th>
<th>帳號</th>
<th>eMail</th>
</tr>";
while ($row=sqlsrv_fetch_array($stmt)) {
$theID=$row['U_ID'];
echo "<tr onclick=\"func1('$theID')\"
onmouseover=\"mouse_in(this)\"
onmouseout=\"mouse_out(this)\"
style=\"cursor:pointer\">
<td>".$row['U_ID']."</td>
<td>".$row['P_name']."</td>
<td>".$row['account']."</td>
<td>".$row['e_mail']."</td>
</tr>";
}
echo "</table>";
?>
</body>
</html>