Repository navigation
Expand file tree
/
Copy pathwebBack_caseStatus.php
More file actions
163 lines (129 loc) · 4.44 KB
/
Copy pathwebBack_caseStatus.php
File metadata and controls
163 lines (129 loc) · 4.44 KB
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
<?php
ob_start();
session_start();
?>
<!DOCTYPE html>
<html lang="UTF-8">
<head>
<meta charset="UTF-8">
<title>後台::案件狀態</title>
<link rel="stylesheet" href="css/webBack_caseStatus.css">
<link rel="stylesheet" type="text/css" href="css/web_back_frame.css">
<!-- 不准動的部分,以下三行 -->
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
<script src="js/jquery.min.js"></script>
<script src="js/web_back_frame/web_back_frame.js"></script>
<!-- 自己的css擺這裡 -->
</head>
<body>
<?php require_once('web_back_frame_top.php') ?>
<nav>
<div class="nav_item">
<h2>案件狀態</h2>
</div>
<div class="nav_item">
<span>狀態:</span>
<select>
<option value="">不限</option>
<option value="">不限</option>
<option value="">不限</option>
</select>
</div>
<div class="nav_item">
<span>類別:</span>
<select>
<option value="">不限</option>
<option value="">不限</option>
<option value="">不限</option>
</select>
</div>
<div class="nav_item">
<div class="search">
<input type="text" name="" placeholder="搜尋">
<button><img src="src/image/web_back_frame/seaech.png"></button>
<button><img src="src/image/web_back_frame/erase.png"></button>
</div>
</div>
<div class="clearfix"></div>
</nav>
<div class="myForm">
<?php
try{
require_once("php/connectGrowing_hope.php");
$sql = "select * from event order by event_status desc";
$events = $pdo ->query($sql);
?>
<table cellspacing="1">
<tr>
<!-- <th></th> -->
<th>案件編號</th> <!-- event_no -->
<th>案件名稱</th> <!-- event_title -->
<th>申請金額</th> <!-- event_need -->
<th>核準金額</th> <!-- event_allow -->
<th>案件歷程</th> <!-- event_period -->
<th>成立時間</th> <!-- event_allowdate -->
<th>目前狀態</th> <!-- event_status -->
<th>狀態修改</th>
<th></th>
</tr>
<?php while ( $eventsRow = $events->fetchObject()) { ?>
<!-- <from action="webBack_caseStatus_update.php" method="get"> -->
<tr class="tdRow">
<td class="event_no"><?php echo $eventsRow -> event_no; ?></td>
<td><?php echo $eventsRow -> event_title; ?></td>
<td><?php echo $eventsRow -> event_need; ?></td>
<td><?php echo $eventsRow -> event_allow; ?></td>
<td><?php echo $eventsRow -> event_period; ?>個月</td>
<td><?php echo $eventsRow -> event_allowdate; ?></td>
<td class="status"><select name="status">
<?php $status = $eventsRow -> event_status; ?>
<option value="P" <?php if ($status == "P") echo "selected"; ?>>審核通過</option>
<option value="R" <?php if ($status == "R") echo "selected"; ?>>案件退回</option>
<option value="DI" <?php if ($status == "DI") echo "selected"; ?>>募資中</option>
<option value="DE" <?php if ($status == "DE") echo "selected"; ?>>募資結束</option>
<option value="CI" <?php if ($status == "CI") echo "selected"; ?>>案件進行中</option>
<option value="CN" <?php if ($status == "CN") echo "selected"; ?>>結案</option>
</select>
</td>
<td><input type="button" value="確定" class="btn yes"></td>
<td><input type="button" value="編輯內容" class="btn edit" onclick="self.location.href='webBack_caseCheckUp.php?event_no=<?php echo $eventsRow -> event_no; ?>'"></td>
<!-- <?php //if($status <>"P" echo "disabled";) ?> -->
</tr>
<!-- </from> -->
<?php
}
echo "</table>
</div>";
}catch (PDOException $e) {
echo "錯誤行號 : ", $e->getLine(), "<br>";
echo "錯誤訊息 : ", $e->getMessage(), "<br>";
}
?>
<?php require_once('web_back_frame_bottom.php') ?>
<script>
$(function(){
$(".yes").click(function(){
var xhr = new XMLHttpRequest();
xhr.onreadystatechange=function(){
if (xhr.readyState == 4) {
if (xhr.status == 200) {
$(this).parent().innerHTML= xhr.responseText;
location.reload();
}else{
alert(xhr.status);
}
}
}
var event_no = $(this).parent().parent().children('.event_no').text();
var status = $(this).parent().parent().children('.status').children().val();
var url = "webBack_caseStatus_update.php?event_no=" + event_no +"&status=" + status+"&old_status=<?php echo $status; ?>";
alert(url);
xhr.open("Get", url , true);
xhr.send(null);
});
// $(".edit").click(function(){
// });
})
</script>
</body>
</html>