【调度系统】广东民航医疗快线调度系统源代码
克樊道人
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
<?php require '/inc/odbc.php';?>
<?php require '/inc/function.php';?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php 
$searchTXT=empty($_REQUEST['searchTXT'])!=false ? "" : addslashes($_REQUEST['searchTXT']);
$orderby=empty($_REQUEST['orderby'])!=false ? "" : addslashes($_REQUEST['orderby']);
 
$OrdDateType=empty($_REQUEST['OrdDateType'])!=false ? "0" : addslashes($_REQUEST['OrdDateType']);
$OrdDateStart=empty($_REQUEST['OrdDateStart'])!=false ? "" : addslashes($_REQUEST['OrdDateStart']);
$OrdDateEnd=empty($_REQUEST['OrdDateEnd'])!=false ? "" : addslashes($_REQUEST['OrdDateEnd']);
$UnitNameID=empty($_REQUEST['UnitNameID'])!=false ? "" : addslashes($_REQUEST['UnitNameID']);
 
if(isDepartment("070101")==0){
  header("Location: /"); 
  exit;
}
 
//默认显示字段
$Report_Name    = "员工里程统计2 (PS:本表只统计 \"医务中心\",\"车管中心\"所属员工)";
if ($OrdDateType=="0" and $OrdDateStart=="" and $OrdDateEnd=="") {
    $OrdDateType=4;
    $OrdDateTop=" top 20 ";
}
else {
    $OrdDateTop="";
}
$OrdDateTypeName="";
if ($OrdDateType=="0") {
    if ($OrdDateStart=="" and $OrdDateEnd=="") {
        $OrdDateStart=date("Y-m-d");
        $OrdDateEnd=date("Y-m-d");
    }
    elseif ($OrdDateStart!="" and $OrdDateEnd=="") {
        $OrdDateEnd=$OrdDateStart;
    }
    elseif ($OrdDateStart=="" and $OrdDateEnd!="") {
        $OrdDateStart=$OrdDateEnd;
    }
    If ($OrdDateStart>$OrdDateEnd) {
        $OrdDateStart1=$OrdDateStart;
        $OrdDateStart=$OrdDateEnd;
        $OrdDateEnd=$OrdDateStart1;
    }
    If ($OrdDateStart==$OrdDateEnd) {
        $OrdDateTypeName=$OrdDateStart;
        $OrdDateTypeName1=$OrdDateTypeName;
    }
    Else {
        $OrdDateTypeName=$OrdDateStart." 至 ".$OrdDateEnd;
        $OrdDateTypeName1="时间段 ".$OrdDateTypeName;
    }
    $SqlOrdDateType=" between '".$OrdDateStart."' and '".$OrdDateEnd." 23:59:59'";
}
Else {
    $sql = "select top 1 vID,vtext,vOrder2 from dictionary where vType>=1 and vtitle='OrdDateType' and vID=".$OrdDateType ;
    $data = sqlsrv_query($conn,$sql);
    if($data == true){
        if (sqlsrv_rows_affected($data)!=0) {
            while($rs = sqlsrv_fetch_array( $data, SQLSRV_FETCH_ASSOC) ) {
                $OrdDateTypeName    = $rs['vtext'];
                $OrdDateTypeName1    = $OrdDateTypeName;
                $SqlOrdDateType    = $rs['vOrder2'];
            }
        } else {
            $OrdDateType="4";
            $OrdDateTypeName="本月";
            $OrdDateTypeName1=$OrdDateTypeName;
            $SqlOrdDateType="between DATEADD(mm,DATEDIFF(mm,0,getdate()),0) and dateadd(ms,-3,DATEADD(mm,DATEDIFF(m,0,getdate())+1,0))";
 
        }
    }
    
}
 
//各种返回信息
$SystemMessageTXT="";
$SystemMessageType=empty($_REQUEST['SystemMessageType'])!=false ? "" : $_REQUEST['SystemMessageType'];
$SMT=empty($_REQUEST['SMT'])!=false ? "" : $_REQUEST['SMT'];
if ($SystemMessageType!="") {
    if ($SMT=="1") {
        $SystemMessageTXT="请选择日期";
    }
}
 
//时间段列表
$OrdDateTypes=array();
$sql = "select vID,vtext from dictionary where vType>=1 and vtitle='OrdDateType' order by vOrder" ;
$data = sqlsrv_query($conn,$sql);
if($data == true){
    $i=0;
    while($rs = sqlsrv_fetch_array( $data, SQLSRV_FETCH_ASSOC) ) {
        $OrdDateTypes[$i]=array($rs['vID'],$rs['vtext']);
        $i++;
    }
}
 
//公司列表
$UnitNameName="全部";
$UnitNames=array();
$UnitNames[0]=array(0,"全部");
$sql = "select vID,vtext,vType from dictionary where vType>=0 and vtitle='UnitName' order by vType desc,vOrder" ;
$data = sqlsrv_query($conn,$sql);
if($data == true){
    $i=1;
    while($rs = sqlsrv_fetch_array( $data, SQLSRV_FETCH_ASSOC) ) {
        $UnitName=$rs['vtext'];
        if ($rs['vType']==0) {$UnitName    = $UnitName."(停用)";}
        $UnitNames[$i]=array($rs['vID'],$UnitName);
        if (strval($UnitNames[$i][0])==$UnitNameID){$UnitNameName = $UnitNames[$i][1];}
        $i++;
    }
}
 
$page_URL_noDate="searchTXT=".$searchTXT."&orderby=".$orderby."&UnitNameID=".$UnitNameID;
$page_URL="OrdDateType=".$OrdDateType."&OrdDateStart=".$OrdDateStart."&OrdDateEnd=".$OrdDateEnd."&".$page_URL_noDate;
?>
 
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title><?php echo $LindemanAdmin?></title>
        <?php require '/inc/ccs.php';?>
        <!-- DataTables -->
        <link rel="stylesheet" type="text/css" href="/js/media/css/jquery.dataTables.css">
        <script type="text/javascript" charset="utf8" src="/js/media/js/jquery.js"></script>
        <script type="text/javascript" charset="utf8" src="/js/media/js/jquery.dataTables.js"></script>
        <style type="text/css">
        #content div.box table td {
            border-right: 1px solid #cdcdcd;
            text-align: center;
        }
        </style>
    </head>
    <body onkeydown="xKeyEvent(event)">
    
        <?php require 'menu_header.php';?>
        <!-- content -->
        <div id="content">
            <?php require 'Report_menu_left.php';?>
            <!-- content / right -->
            <div id="right">
                <!-- table -->
                <div class="box">
                    <!-- box / title -->
                    <?php if (empty($OrdDateType)!=false) {$OrdDateType="0";}?>
                    <div class="title">
                        
                        
                        <h5><span id="right_Menu" style="display: none;">[<a onclick="JavaScript:JS_left_Menu2('1');" style="color: #ffffff;">显示菜单</a>]&nbsp;</span><?php if($searchTXT!=""){echo $Report_Name." ".$searchTXT;} else {echo $OrdDateTypeName1." ".$Report_Name;} ?></h5>
                        <ul class="links">
                            <li><a href="Report_MileageMan2_Excel.php?<?php echo $page_URL?>">导出Excel</a></li>
                            <?php if (isDepartment("070109")==1) {?>
                            <li>
                                <?php
                                //下拉菜单设定
                                $DownMenuName="公司";        //菜单名称
                                $DownMenuNameID="UnitNameID";    //菜单ID
                                $DownMenuArray=$UnitNames;    //菜单数组
                                $DownMenuOldName=$UnitNameName;    //默认值名称
                                $DownMenuOldID=$UnitNameID    //默认值ID
                                ?>
                                <div class="search">
                                <div name="DownMenu_container" id="<?php echo $DownMenuNameID?>_container" class="select-container" style="overflow: hidden;cursor:pointer" onclick="JS_DownMenu('<?php echo $DownMenuNameID?>')">
                                    <span class="select-content" style="width: 46px;"><?php echo $DownMenuName.":".$DownMenuOldName?></span><span class="arrow" id="<?php echo $DownMenuNameID?>_arrow" name="DownMenu_arrow"></span>
                                </div>
                                <div name="DownMenu_list" id="<?php echo $DownMenuNameID?>_list" class="select-list scroll-pane" style="overflow: hidden; position: absolute; background-color: white; width: 105px; display: none;background-position: initial initial; background-repeat: initial initial;margin-left: 69px;">
                                    <div class="jspContainer" style="width: 105px;">
                                        <div style="padding: 0px; top: 0px; width: 105px;">
                                        <?php for($i=0;$i<count($DownMenuArray);$i++) {?>
                                          <span title="<?php echo $DownMenuArray[$i][1]?>" name="DownMenu_<?php echo $DownMenuNameID?>" onmouseover="JS_DownMenuMouseover('<?php echo $DownMenuNameID?>',<?php echo $i?>)" onclick="JS_DownMenuJump('<?php echo "?".$page_URL?>','<?php echo $DownMenuOldID?>','<?php echo $DownMenuNameID?>','<?php echo $DownMenuArray[$i][0]?>')" class="list-option<?php if ($DownMenuArray[$i][0]==$DownMenuOldID){echo " option";}?>"><?php echo $DownMenuArray[$i][1]?></span>
                                        <?php }?>
                                        </div>
                                    </div>
                                </div>
                                </div>
                            </li>
                            <?php }?>
                            <li>
                                <div class="search">
                                <div id="Date_container" class="select-container" style="overflow: hidden;cursor:pointer" onclick="JS_OrdDateType()">
                                    <span class="select-content" style="width: 46px;">期间:<?php echo $OrdDateTypeName?></span><span class="arrow" id="Date_arrow"></span>
                                </div>
                                <div id="Date_list" class="select-list scroll-pane" style="overflow: hidden; position: absolute; background-color: white; width: 65px; display: none;background-position: initial initial; background-repeat: initial initial;margin-left: 35px;">
                                    <div class="jspContainer" style="width: 63px; ">
                                        <div style="padding: 0px; top: 0px; width: 63px;">
                                        <?php for($i=0;$i<count($OrdDateTypes);$i++) {?>
                                          <span title="<?php echo $OrdDateTypes[$i][1]?>" onmouseover="JS_OrdDateTypeMouseover('OrdDateType_<?php echo $OrdDateTypes[$i][0]?>')" onclick="JS_OrdDateTypeJump('<?php echo $OrdDateTypes[$i][0]?>')" id="OrdDateType_<?php echo $OrdDateTypes[$i][0]?>" class="list-option<?php if ($OrdDateTypes[$i][0]==$OrdDateType){echo " option";}?>"><?php echo $OrdDateTypes[$i][1]?></span>
                                        <?php }?>
                                        <span title="自定义" onmouseover="JS_OrdDateTypeMouseover('OrdDateType_0')" onclick="JS_OrdDateTypeCreateOpen()" id="OrdDateType_0" name="OrdDateType" class="list-option">自定义</span>
                                        </div>
                                    </div>
                                </div>
                                </div>
                            </li>
                            <div class="search">
                            <form action="?1=1<?php echo $page_URL;?>" method="post">
                                <div class="input">
                                    <input type="text" id="search" name="searchTXT" value="<?php echo $searchTXT;?>" />
                                </div>
                                <div class="button">
                                    <input type="submit" name="submit" value="搜索员工" />
                                </div>
                            </form>
                            </div>
                        </ul>
                    </div>
                    <div class="dialogJ  dialogJfix dialogJshadow" id="OrdDateTypeCreate" style="width: 440px;right: 80px; top: 150px;height:80px ;display:none;z-index: 100;">
                        <div class="dialogJtitle">
                            <a href="javascript:JS_OrdDateTypeCreateClose();" class="dialogJclose" title="关闭本窗口">&nbsp;</a>
                            <span class="dialogJtxt" id="EditPhotoTXT">请选择时间段</span>
                        </div>
                        <div class="dialogJcontent" style="margin-left: 5px;margin-right:5px;">
                            <div class="input" style="float:left;margin-top: 10px;margin-left: 5px;" id="two-inputs">
                                期间:
                                <input type="text" id="OrdDateStart" name="OrdDateStart" class="date" style="width:138px;" value="<?php echo $OrdDateStart?>">
                                至
                                <input type="text" id="OrdDateEnd" name="OrdDateEnd" class="date" style="width:138px;" value="<?php echo $OrdDateEnd?>">
                                <input type="button" class="dialogJbtn first-child" onclick="JS_OrdDateJump()" value="查询">
                            </div>
                        </div>
                    </div>
                    <!--时间选择js  liang------------->
                    <link rel="stylesheet" href="css/daterangepicker.css">
                    <script src="js/moment.min.js"></script>
                    <script src="js/jquery.daterangepicker.js"></script>
                    <script>
                            $(function()
                        {
                            $('#two-inputs').dateRangePicker(
                            {
                                separator : ' to ',
                                getValue: function()
                                {
                                    if ($('#OrdDateStart').val() && $('#OrdDateEnd').val() )
                                        return $('#OrdDateStart').val() + ' to ' + $('#OrdDateEnd').val();
                                    else
                                        return '';
                                },
                                setValue: function(s,s1,s2)
                                {
                                    $('#OrdDateStart').val(s1);
                                    $('#OrdDateEnd').val(s2);
                                }
 
                            });
                        });
                    </script>
                <!--时间选择js  liang------------->
                    <script type="text/javascript">
                        //时间表列显示下拉菜单
                        function JS_OrdDateType(){
                          if (Date_container.className!="select-container select-container-show-list"){
                            Date_container.className="select-container select-container-show-list";
                            Date_arrow.className="arrow arrow-up";
                            Date_list.style.display="block";
                            OrdClass_container.className="select-container";
                            OrdClass_arrow.className="arrow";
                            OrdClass_list.style.display="none";
                            OrdDateTypeCreate.style.display="none";
                          }
                          else {
                            Date_container.className="select-container";
                            Date_arrow.className="arrow";
                            Date_list.style.display="none";
                          }
                        }
                        //时间表列指针移动到下拉菜单
                        function JS_OrdDateTypeMouseover(id){
                          var d=document.getElementById(id);
                          <?php for($i=0;$i<count($OrdDateTypes);$i++) {?>
                          document.getElementById("OrdDateType_<?php echo $OrdDateTypes[$i][0]?>").className="list-option";
                          <?php }?>
                          document.getElementById("OrdDateType_0").className="list-option";
                          d.className="list-option option";
                        }
                        //自定义时间-打开窗口
                        function JS_OrdDateTypeCreateOpen()
                        {
                            JS_OrdDateType();
                            OrdDateTypeCreate.style.display="block";
                        }
                        //自定义时间-关闭窗口
                        function JS_OrdDateTypeCreateClose()
                        {
                            JS_OrdDateType();
                            OrdDateTypeCreate.style.display="none";
                        }
                        //自定义时间-确定时间
                        function JS_OrdDateTypeCreateSave()
                        {
                        document.getElementById('ServiceOrdTraStreet').value=document.getElementById('Duration').value;
                        document.getElementById('ServiceOrdTraEnd').value=document.getElementById('ServiceOrdTraEnd').value;
                        document.getElementById('ServiceOrdTraStreetCoo').value=results.sw.point.lng + ','+ results.sw.point.lat; //起点坐标
                        document.getElementById('ServiceOrdTraEndCoo').value=results.Lu.point.lng + ','+ results.Lu.point.lat; //起点坐标
                        }
                        //时间类表列转跳
                        function JS_OrdDateJump(id){
                            var OrdDateStart=document.getElementById("OrdDateStart").value;
                            var OrdDateEnd=document.getElementById("OrdDateEnd").value;
                            //var searchTXT=document.getElementById("searchTXT").value;
                            window.location.href='Report_MileageMan2.php?<?php echo $page_URL_noDate?>&OrdDateType=0&OrdDateStart='+OrdDateStart+'&OrdDateEnd='+OrdDateEnd;
                        }
                        //自定义时间转跳
                        function JS_OrdDateTypeJump(id){
                            //var searchTXT=document.getElementById("searchTXT").value;
                            window.location.href='Report_MileageMan2.php?<?php echo $page_URL_noDate?>&OrdDateType='+id;
                        }
 
                        //时间表列转跳
                        function JS_OrdClassTypeJump(id){
                            //var searchTXT=document.getElementById("searchTXT").value;
                            window.location.href='Report_MileageMan2.php?<?php echo $page_URL_noDate?>&OrdClassList='+id;
                        }
                        
                    </script>
                    <!-- end box / title -->
            <?php //数据读取
            $is_CSV=0;
            ?>
            <?php require 'Report_MileageMan2_Data.php';?>
            
                    <?php require '/inc/SystemMessages.php';?>
                    <div class="table" style="overflow:auto">
                    <!--第二步:添加如下 HTML 代码 填充表头信息(复杂表头)-->
                        <table id="example" class="display">
                            <thead>
                                <tr>
                                    <?php
                                    for($x=0;$x<$FormArrayX1;$x++) {
                                      $HeaderArray=explode("|",$FormArray[0][$x]);
                                      echo "<th ".$HeaderArray[1].">".$HeaderArray[0]."</th>";
                                    }
                                    ?>
                                </tr>
                                <tr>
                                    <?php
                                    for($x=0;$x<$FormArrayX2;$x++) {
                                      echo "<th>".$FormArray[1][$x]."</th>";
                                    }
                                    ?>
                                </tr>
                            </thead>
                        </table>
 
                        <!--第三步:初始化Datatables-->
                        <script>
                        //$(document).ready( function () {
                        //    $('#table_id_example').DataTable();
                        //} );
 
                            var data = [
                                <?php
                                for($y=2;$y<count($FormArray);$y++) {
                                    if ($y==count($FormArray)-1){
                                      $FormArrayHtml="";
                                    }else{
                                      $FormArrayHtml=",";
                                    }
                                    echo "[";
                                    for($x=0;$x<count($FormArray[$y]);$x++) {
                                        if ($x==count($FormArray[$y])-1){
                                          $classHtml="";
                                        }else{
                                          $classHtml=",";
                                        }
                                        echo "\"".$FormArray[$y][$x]."\"".$classHtml;
                                    }
                                    echo "]".$FormArrayHtml;
                                }
                                ?>
                            ];
                         
                            //然后 DataTables 这样初始化:
                            $('#example').DataTable( {
                                data: data,            //原数据
                                //"ordering": false,    //排序显示开关
                                //"info":     false,    //数量显示开关
                                //"paging":   false,    //分页显示开关
                                //"searching": false,        //查找功能开关
                                //"search": {"search": "Fred"},    //默认查找内容
                                "lengthMenu": [[25, 50, 100,-1], [25, 50, 100,"所有"]],    //分页显示数量
                                "language": {
                                    "lengthMenu": "每页_MENU_ 条记录",
                                    "zeroRecords": "没有找到记录",
                                    "info": "显示 _START_ - _END_ , 共 _TOTAL_ 条",
                                    "infoEmpty": "无记录",
                                    "search": "搜索:",
                                    "infoFiltered": "(从 _MAX_ 条记录过滤)",
                                    "paginate": {
                                        "previous": "上一页",
                                        "next": "下一页"
                                    }
                                }
                            } );
                        </script>
                    </div>
                </div>
                <!-- end table -->
 
 
                
            </div>
            <!-- end content / right -->
        </div>
        <!-- end content -->
        <?php require 'vicgame.php';?>
        <IFRAME id="HiddenFrame" name="HiddenFrame" WIDTH=0 HEIGHT=0 MARGINWIDTH=0 MARGINHEIGHT=0 HSPACE=0 VSPACE=0 FRAMEBORDER=0 SCROLLING=no BORDERCOLOR=#ffffff></IFRAME>
    </body>
</html>