Дипломная работа: Автоматизация приема и обработки заявок отделом техподдержки Богородском филиале АО "НПО "Прибор"

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
107
154. }
155. ?>
156. <h4 class="color_b" onclick="location.href='main.php'"><img
src="images/back.svg" alt="Назад"> Назад</h4>
157. </div><!-- .content -->
158. <div class="footer">Отдел ИТ. Тел. или sip: <a
href="sip:2288@94.253.8.238">22-88</a>, <a href="sip:2289@94.253.8.238">22-
89</a>, <a href="sip:2480@94.253.8.238">24-80</a>. БФ АО "НПО "Прибор" <?php
echo date("Y") ?>г.</div>
159. </div><!-- .wrapper -->
160. </body>
161. </html>
162. <?php } ?>
108
Приложение 4 arc.php
1. <?php
2. session_start();
3. header("Content-Type: text/html; charset=Windows-1251");
4. $id = $_SESSION['id'];
5. date_default_timezone_set("Asia/Baghdad");
6. // Проверяем логин юзера по id
7. $content = file('C:\pref\users.list');
8. $usr = explode('>', $content[$id]);
9. $user = $usr[1];
10. if(!$_SESSION['hash']){ header("location:cookie.php");}
11. require "C:\pref\id$id.php";
12. $hash=hash_file('md5', "C:\pref\id$id.php");
13. if ($admin) {
14. $rank = 'admin';
15. }
16. else {
17. $rank = 'user';
18. }
19. if(!isset($_SESSION['hash']) || $_SESSION['hash']!=$hash ||
$_SESSION['id']!=$id || !$admin){ header("location:401.4.php");}
20. else{ ?>
21. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22. <html xmlns="http://www.w3.org/1999/xhtml">
23. <head>
24. <meta charset="Windows-1251">
25. <noscript>
26. <meta http-equiv="Refresh" content="0; js.php" />
27. </noscript>
28. <meta http-equiv="X-UA-Compatible" content="IE=edge">
29. <meta name="viewport" content="width=device-width, initial-scale=1">
30. <link rel="icon" href="favicon.ico" type="image/x-icon" />
31. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
32. <title>Просмотр логов</title>
33. <link href="css/bootstrap.min.css" rel="stylesheet">
34. <!--[if !IE]><!--><link href="css/style.css" rel="stylesheet"><!--<![endif]-->
35. <!--[if IE]><link href="css/style-ie.css" rel="stylesheet"><![endif]-->
36. <link rel="stylesheet" href="./css/table.style.css">
37. <!--[if lt IE 9]>
38. <script src="js/html5shiv.js"></script>
39. <script src="js/respond.min.js"></script>
40. <![endif]-->
41. <script type="text/javascript" src="js/jquery.min.js"></script>
42. <script type="text/javascript" src="js/bootstrap.min.js"></script>
43. <script type="text/javascript" src="js/onclick.js"></script>
44. <script type="text/javascript" src="js/modernizr-1.6.min.js"></script>
109
45. <script type="text/javascript" src="js/table.js"></script>
46. </head>
47. <body onselectstart="return false">
48. <div class="wrapper">
49. <div class="content">
50. <div class="hidden-print">
51. <p class="header" onselectstart="return false">
52. <img class="im" src="images/owl.svg" alt="ОТДЕЛ ИТ"> ОТДЕЛ ИТ</p>
53. </div>
54. <div class="hidden-print">
55. <h4 class="color_b">
56. <?php echo '<img src="images/'.$rank.'.svg" alt="Пользователь"> '.$user; ?>
57. <span style="position:absolute; right:0px" onclick="return logout()">Выход
<img src="images/logout.svg" alt="Выход"></span>
58. </h4>
59. </div>
60. <?php
61. $piece=explode("&", $_SERVER['REQUEST_URI']);
62. $sort = $_GET['sort'];
63. $directory = $_GET['directory'];
64. if(!$directory) {
65. echo '<div><h4 class="color_a" onselectstart="return false"><img
src="images/task.svg" alt="задача"> Заявки: <b>';
66. $sort_array = array(
67. "complite",
68. "inarchive",
69. );
70. $sorter_array = array(
71. "Архивировать",
72. "Разархивировать",
73. );
74. echo '<select name="sel" onchange="MM_select(\'parent\',this,1)">
75. <option value="'.$piece[0].'&'.$piece[1].'" disabled>Выбор</option>';
76. $i=0;
77. foreach ($sorter_array as $key) {
78. echo '<option value="arc.php?sort='.$sort_array[$i].'"';
79. if ($sort == $sort_array[$i]) {
80. echo ' selected ';
81. }
82. echo '>'.$sorter_array[$i].'</option>';
83. $i = $i+1;
84. }
85. echo '</select></b></h4></div>';
86. }
87. $table = '<div class="stick">
88. <div class="hidden-print">
89. <table width="100%" border="0" class="sortable">
90. <thead>
110
91. <tr>
92. <th onclick="$(\'#thnum\').click()" width="45px"><h4>Тип</h4></th>
93. <th onclick="$(\'#thdate\').click()" width="55px"><h4>Имя</h4></th>
94. <th onclick="$(\'#thtime\').click()" width="80px"><h4>Статус</h4></th>
95. <th onclick="$(\'#thtype\').click()"><h4>Действие</h4></th>
96. </tr>
97. </thead>
98. </table>
99. </div>
100. </div>
101. <div id="tbl">
102. <table border="0" id="table" class="sortable">
103. <thead class="trh">
104. <tr>
105. <th id="thnum" width="45px"><h4>Тип</h4></th>
106. <th id="thdate" width="55px"><h4>Имя</h4></th>
107. <th id="thtime" width="80px"><h4>Статус</h4></th>
108. <th id="thtype"><h4>Действие</h4></th>
109. </tr>
110. </thead>
111. <tbody>';
112. function func_loadtable($table, $sort, $full_path) {
113. echo $table;
114. $dir = opendir($full_path);
115. while($folder = readdir($dir)) {
116. if (is_dir($full_path) && $folder != '.' && $folder != '..') {
117. echo '<tr><td><img src="images/folder.svg"
alt="111"></td><td>'.$folder.'</td><td><a
href="arc.php?sort='.$sort.'&directory='.$folder.'">Подробнее</a></td><td>';
118. if ($_GET['sort'] == inarchive) {
119. echo '<a href="arc.php?sort='.$sort.'&move='.$folder.'" onclick="return
confirm(\'Вы действительно хотите разархивировать папку '.$folder.'
?\')">Разархивировать</a></td></tr>';
120. }
121. else {
122. if ($folder > (date("Ym") - 1)) {
123. echo '<b>Недоступно</b><br>Заявки текушего месяца</td></tr>';
124. }
125. else {
126. echo '<a href="arc.php?sort='.$sort.'&move='.$folder.'" onclick="return
confirm(\'Вы действительно хотите архивировать папку '.$folder.'
?\')">Архивироватьa></td></tr>';
127. }
128. }
129. }
130. }
131. }
132. if($sort == inarchive) {
111
133. $full_path = trim('C:\archive\\'.$_GET['directory']);
134. if(!$_GET['directory']) {
135. func_loadtable($table, 'inarchive', $full_path);
136. }
137. }
138. if($sort == complite) {
139. $full_path = trim('C:\share\complite\\'.$_GET['directory']);
140. if(!$_GET['directory']) {
141. func_loadtable($table, 'complite', $full_path);
142. }
143. }
144. if($_GET['directory'] > 0) {
145. function foldersize($path) {
146. $total_size = 0;
147. $files = scandir($path);
148. $cleanPath = rtrim($path, '/'). '/';
149. foreach($files as $t) {
150. if ($t<>"." && $t<>"..") {
151. $currentFile = $cleanPath . $t;
152. if (is_dir($currentFile)) {
153. $size = foldersize($currentFile);
154. $total_size += $size;
155. }
156. else {
157. $size = filesize($currentFile);
158. $total_size += $size;
159. }
160. }
161. }
162.
163. return $total_size;
164. }
165. function format_size($size) {
166. global $units;
167. $mod = 1024;
168. for ($i = 0; $size > $mod; $i++) {
169. $size /= $mod;
170. }
171. $endIndex = strpos($size, ".")+3;
172. return substr( $size, 0, $endIndex).' '.$units[$i];
173. }
174. $start = microtime(true);
175.
176. $f_path = opendir($full_path);
177. function count_files($dir){
178. $files = scandir($dir);
179. $i = 0;
180. foreach ($files as $key => $value){
Источник: https://baza.diplomsite.ru/previewfile/1972