【调度系统】广东民航医疗快线调度系统源代码
克樊道人
2024-12-02 61ce8cc6883e5f94e6470141df3484167caf31ed
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<?php require '/inc/odbc.php';?>
<?php require '/inc/function.php';?>
 
<?php
if(isDepartment("0604")==0){
  header("Location: /"); 
  exit;
}
 
//各种返回信息
$SystemMessageTXT="";
$SystemMessageType=empty($_REQUEST['SystemMessageType'])!=false ? "" : $_REQUEST['SystemMessageType'];
$SMT=empty($_REQUEST['SMT'])!=false ? "" : $_REQUEST['SMT'];
if ($SystemMessageType!="") {
    if ($SMT=="1") {$SystemMessageTXT="数据不足!!!";}
    elseif ($SMT=="2") {$SystemMessageTXT="修改完成!";}
    elseif ($SMT=="3") {$SystemMessageTXT="新增完成!";}
    elseif ($SMT=="4") {$SystemMessageTXT="删除完成!";}
    elseif ($SMT=="5") {$SystemMessageTXT="名称重复!";}
}
 
$page=empty($_REQUEST['page'])!=false ? 1 : $_REQUEST['page']; //当前页数
$page=empty($draw)!=false ? $page : $draw; //当前页数
$page_size = 20;    //每页显示数量
$total_page=0;            //总页数
$total_records=0;            //总记录数
 
$ID=empty($_REQUEST['ID'])!=false ? "" : addslashes($_REQUEST['ID']);
$searchTXT=empty($_REQUEST['searchTXT'])!=false ? "" : addslashes($_REQUEST['searchTXT']);
$page_URL="searchTXT=".$searchTXT."&ID=".$ID;
//echo $searchTXT;exit;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title><?php echo $LindemanAdmin?></title>
        <?php require '/inc/ccs.php';?>
    </head>
    <body onkeydown="xKeyEvent(event)">
        <?php require 'menu_header.php';?>
        <!-- content -->
        <div id="content">
            <?php require 'AdminUser_menu_left.php';?>
            <!-- content / right -->
            <div id="right">
                <!-- table -->
                <div class="box">
                    <!-- box / title -->
                    <div class="title">
                        <h5>医院科室</h5>
                        <ul class="links">
                            <?php if(isDepartment("060402")==1){?>
                            <li><a onclick="javascript:HospitalCreate.style.display='block';">新建</a></li>
                            <li><a onClick="form1_Hospital_update()">修改</a></li>
                            <li><a onClick="form1_Hospital_delete()">删除</a></li>
                            <?php } ?>
                            <div class="search">
                            <form action="?" method="post">
                                <div class="input">
                                    <input type="text" id="searchTXT" name="searchTXT" value="<?php echo $searchTXT?>" />
                                </div>
                                <div class="button">
                                    <input type="submit" name="submit" value="搜索" />
                                </div>
                            </form>
                            </div>
                        </ul>
                        <script LANGUAGE="javascript">
                        //修改诊断目录
                        function form1_Hospital_update(){
                        document.form1.action = "admin_save.php";
                        document.form1.admin_save.value = "15";
                        form1.submit();
                        }
                        //删除诊断目录
                        function form1_Hospital_delete(){
                        document.form1.action = "admin_save.php";
                        document.form1.admin_save.value = "16";
                        form1.submit();
                        }
                        //选择修改诊断目录
                        function form1_Hospital_Edit(id){
                            if (document.getElementById('Show_Hospital_vtext_'+id).style.display=="none")
                            {
                                document.getElementById('Show_Hospital_vtext_'+id).style.display='';
                                document.getElementById('Edit_Hospital_vtext_'+id).style.display='none';
                                document.getElementById('Hospital_vtext_'+id).disabled=true;
                                document.getElementById('Show_Hospital_vOrder_'+id).style.display='';
                                document.getElementById('Edit_Hospital_vOrder_'+id).style.display='none';
                                document.getElementById('Hospital_vOrder_'+id).disabled=true;
                            }
                            else
                            {
                                document.getElementById('Show_Hospital_vtext_'+id).style.display='none';
                                document.getElementById('Edit_Hospital_vtext_'+id).style.display='';
                                document.getElementById('Hospital_vtext_'+id).disabled=false;
                                document.getElementById('Show_Hospital_vOrder_'+id).style.display='none';
                                document.getElementById('Edit_Hospital_vOrder_'+id).style.display='';
                                document.getElementById('Hospital_vOrder_'+id).disabled=false;
 
                            }
 
                            
                        }
                        //新建诊断情况-关闭窗口
                        function JS_HospitalCreateClose()
                        {
                        HospitalCreate.style.display="none";
                        }
                        //新建诊断情况-保存
                        function JS_HospitalCreateSave()
                        {
                        form2.submit();
                        }
                    </script>
                    </div>
                    <?php 
                        $sql = "select top 1 vID from dictionary where vtitle='HospitalDepartment' order by vID desc";
                        $data = sqlsrv_query($conn,$sql);
                        if($data == true){
                            while($rs = sqlsrv_fetch_array($data) ) {
                                $NewvID        = $rs['vID']+1;
                            }
                        }
                        $sql = "select top 1 vOrder from dictionary where vtitle='HospitalDepartment' and vType=1 order by vOrder desc";
                        $data = sqlsrv_query($conn,$sql);
                        if($data == true){
                            while($rs = sqlsrv_fetch_array($data) ) {
                                $NewvOrder        = $rs['vOrder']+100;
                            }
                        }
                    ?>
                    <div class="dialogJ  dialogJfix dialogJshadow" id="HospitalCreate" style="width: 370px; right: 300px; top: 150px;display:none;">
                        <div class="dialogJtitle">
                            <a href="javascript:JS_HospitalCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                            <span class="dialogJtxt" id="EditPhotoTXT">新建医院科室</span>
                        </div>
                        <form id="form2" name="form2" action="admin_save.php" method="post">
                        <input name="admin_save" type="hidden" value="14">
                        
                        <input name="Hospital_vID" type="hidden" value="<?php echo $NewvID;?>">
                        <div class="dialogJcontent">
                            <div class="dialogJbody" id="dialogJbody" style="height: 220px;">
                                <div class="modify-album-name">
                                    <p class="album-tips"></p>
                                    <span>科室:</span>
                                    <input id="Hospital_vtext" name="Hospital_vtext" type="text" value="" maxlength="99/" style="width: 228px;">
                                </div>
                                <div class="modify-album-name">
                                    <p class="album-tips"></p>
                                    <span>排序:</span>
                                    <input id="Hospital_vOrder" name="Hospital_vOrder" type="text" value="<?php echo $NewvOrder;?>" maxlength="99/" style="width: 248px;">
                                </div>
                            </div>
                        </div>
                        </form>
                        <div class="dialogJanswers">
                            <input type="button" class="dialogJbtn first-child" onclick="JS_HospitalCreateSave()" value="确定"> 
                            <input type="button" class="dialogJbtn" onclick="JS_HospitalCreateClose()" value="取消">
                        </div>
                    </div>
                    <!-- end box / title -->
                    <?php
                    $i=1;
                    //SQL查询条件
                    if ($ID!="") {
                        $sqlWhere=" from dictionary where vtitle='HospitalDepartment' and vType=1 and vID=".$ICD_ID;
                    }
                    elseif ($searchTXT!=""){
                        $sqlWhere=" from dictionary where vtitle='HospitalDepartment' and vType=1 and (vtext like '%".$searchTXT."%')";
                    }else{
                        $sqlWhere=" from dictionary where vtitle='HospitalDepartment' and vType=1";
                    }
                    //组成计算总页数SQL
                    $total_sql = "select id $sqlWhere";    
                    //组成显示结果SQL
                    $Result_sql = "select id,vID,vtext,vtitle,vType,vMono,vOrder,vOrder2,row_number() over (order by vOrder,id desc) n  $sqlWhere";    
                    //附加结果SQL
                    $Additional_sql = "";
 
                    //计算总页数
                    $data = sqlsrv_query( $conn, $total_sql, array(), array( "Scrollable" => 'keyset' ));
                    if($data == true){$total_records=sqlsrv_num_rows($data);}else{$total_records=0;}//总行数
                    $total_page=ceil($total_records/$page_size);    //总页数
                    //避免page小于0或大于总页数
                    $page=$page<=0?1:$page;
                    $page=$page>$total_page?$total_page:$page;  
                    //计算开始和结束行数
                    $pageStart = ($page-1)*$page_size;
                    $pageEnd = $pageStart+$page_size;
                    $sqlPage = " where sqlData.n > $pageStart and sqlData.n <= $pageEnd " ;
                    $sql = "select * $Additional_sql from ($Result_sql) sqlData ".$sqlPage." order by sqlData.n" ;
                    $data = sqlsrv_query($conn,$sql);
                    if($data == true){
                        if (sqlsrv_rows_affected($data)==0) {
                            $SystemMessageType=2;
                            $SystemMessageTXT="数据库中相关无数据!";
                            $y=0;
                        }
                    }else{$SystemMessageType=4;$SystemMessageTXT="数据库中相关无数据!";}
                    ?>
                    <?php require '/inc/SystemMessages.php'; ?>
 
                    <div class="table">
                        <form id="form1" name="form1" action="" method="post">
                        <input name="admin_save" type="hidden" value="80">
                        <table>
                            <thead>
                                <tr>
                                    <th class="selected"><input type="checkbox" class="checkall" /></th>
                                    <th>ID</th>
                                    <th>科室</th>
                                    <th>排序</th>
                                    <th>状态</th>
                                    <th class="last">&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                    <?php
                    if($data == true){
                        while($rs = sqlsrv_fetch_array($data) ) {
                            //读取数据
                            $id        = $rs['id'];
                            $vID    = $rs['vID'];
                            $vtext    = $rs['vtext'];
                            $vOrder    = (int)$rs['vOrder'];
                            $vType    = $rs['vType'];
                            $vTypeTXT=$vType==1 ? "正常" : "停用";
                            $i++;
                            ?>
                    <tr>
                        <td class="selected"  style='white-space: nowrap;'><input type="checkbox" id="ID_<?php echo $id?>" name="ID[]" value="<?php echo $id?>" onclick="javascript:form1_Hospital_Edit('<?php echo $id?>')"/></td>
                        <td class="selected"><?php echo $vID?></td>
                        <td class="category" id="Show_Hospital_vtext_<?php echo $id?>"  style='white-space: nowrap;'><?php echo $vtext?></td>
                        <td class="category" id="Edit_Hospital_vtext_<?php echo $id?>" style="display:none;"><input id="Hospital_vtext_<?php echo $id?>" name="Hospital_vtext_<?php echo $id?>" class="small" style="width:120px;text-align: center;" value="<?php echo $vtext?>" type="text" disabled="true"></td>
                        <td class="category" id="Show_Hospital_vOrder_<?php echo $id?>"  style='white-space: nowrap;'><?php echo $vOrder?></td>
                        <td class="category" id="Edit_Hospital_vOrder_<?php echo $id?>" style="display:none;"><input id="Hospital_vOrder_<?php echo $id?>" name="Hospital_vOrder_<?php echo $id?>" class="small" style="width:120px;text-align: center;" value="<?php echo $vOrder?>" type="text" disabled="true"></td>
                        <td class="category"><?php echo $vTypeTXT?></td>
                        <td class="last">&nbsp;</td>
                      </tr>
                    <?php
                        }
                    }
                    ?>
                    
            
            <?php
            for($x=$i;$x<20;$x++) {
              echo "<tr><td class=selected>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class=last>&nbsp;</td></tr>";
            }
            ?>
                            </tbody>
                        </table>
                        
                        </form>
                        <!-- 分页 -->
                        <?php if ($total_records>=1) {?>
                        <div class="pagination pagination-left">
                            <div class="results">
                                <?php
                                $ShowingLeast = ($page-1)*$page_size+1;
                                $ShowingMax = $page_size*$page;
                                if ($ShowingMax>$total_records) {$ShowingMax=$total_records;}
                                ?>
                                <span><?php echo "显示&nbsp;$ShowingLeast-$ShowingMax&nbsp;of&nbsp;$total_records";?></span>
                            </div>
                            <?php if ($total_page>1) {?>
                            <ul class="pager">
                                <?php
                                if ($page==1) {
                                    echo "<li class=\"disabled\">&laquo; 上页</li>";
                                }else{
                                    echo "<li><a href=\"?page=".($page-1)."&".$page_URL."\">&laquo; 上页</a></li>";
                                }
                                
                                $acc4=0;
                                for($i=1;$i<=$total_page;$i++) {
                                    if ($i==$page) {echo "<li class=\"current\">$i</li>";}
                                    elseif ($i<=3 or $i>($total_page-3)  ) {echo "<li><a href=\"?page=$i&$page_URL\">$i</a></li>";}
                                    elseif ($acc4==0){echo "<li class=\"separator\">...</li>";$acc4=$i<$page ? 1 : 2;}
                                    elseif ($acc4==1 and $i>$page+3){echo "<li class=\"separator\">...</li>";$acc4=2;}
                                    elseif ($acc4==1 and $i>=$page-3){echo "<li><a href=\"?page=$i&$page_URL\">$i</a></li>";}
                                }
 
                                if ($page>=$total_page) {
                                    echo "<li class=\"disabled\">下页 &raquo;</li>";
                                }else{
                                    echo "<li><a href=\"?page=".($page+1)."&".$page_URL."\">下页 &raquo;</a></li>";
                                }
                                ?>
                            </ul>
                            <?php }?>
                        </div>
                        <?php }?>
                        <!-- end 分页 -->
                    </div>
                </div>
                <!-- end table -->
 
                
            </div>
            <!-- end content / right -->
        </div>
        <!-- end content -->
        <!--#include FILE="vicgame.asp"-->
    </body>
</html>