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

Внимание! Если размещение файла нарушает Ваши авторские права, то обязательно сообщите нам
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){
112
181. if (!in_array($value, array(".", ".."))){
182. if(is_file($dir.'/'.$value)){$i = $i + 1;}
183. if(is_dir($dir.'/'.$value)){$i += count_files($dir.'/'.$value);}
184. }
185. if ($i > 1000) {
186. $i = 'более 1000';
187. break;
188. }
189. }
190. return $i;
191. }
192. while(readdir($f_path)) {
193. if (is_dir($full_path) && readdir($f_path) != '.' && readdir($f_path) != '..') {
194. $quantity = new FilesystemIterator($full_path,
FilesystemIterator::SKIP_DOTS);
195. if (!iterator_count($quantity)) {
196. $end = "ей";
197. }
198. if (iterator_count($quantity) <= 20) {
199. if (iterator_count($quantity) == 11) {
200. $end = "ей";
201. }
202. else {
203. if (iterator_count($quantity) > 1 && iterator_count($quantity) < 21) {
204. $end = "ей";
205. }
206. else {
207. if (iterator_count($quantity) == 1) {
208. $end = "я";
209. }
210. }
211. }
212. }
213. else {
214. if (substr(iterator_count($quantity), -2) <= 20) {
215. if (substr(iterator_count($quantity), -2) == 11) {
216. $end = "ей";
217. }
218. else {
219. if (substr(iterator_count($quantity), -1) > 1 &&
substr(iterator_count($quantity), -1) < 21) {
220. $end = "ей";
221. }
222. else {
223. if (substr(iterator_count($quantity), -1) == 1) {
224. $end = "я";
225. }
226. }
113
227. }
228. }
229. else {
230. $cnt = substr(iterator_count($quantity), -1);
231. if ($cnt == 1) {
232. $end = "я";
233. }
234. else {
235. $end = "ей";
236. }
237. }
238. }
239.
240. }
241. if (round(microtime(true) - $start, 0) > 25) {
242. break;
243. }
244. }
245. $units = explode(' ', 'B KB MB GB TB PB');
246. $disk_used = foldersize($full_path);
247. echo '<h4 class="color_a"><hr><img src="images/folder1.svg" alt="Папка">
'.$full_path.'<hr>
248. <img src="images/size.svg" alt="Размер"> Размер: ' .
format_size($disk_used) . '<hr>
249. <img src="images/task.svg" alt="Заявка"> Заявок: '.count_files($full_path).'
шт.<hr>
250. <img src="images/user.svg" alt="Пользователь"> От:
'.iterator_count($quantity).' пользовател'.$end.'<hr></h4>
251. <h4 class="color_b" onclick="window.history.go(-1)" onselectstart="return
false">
252. <img src="images/back.svg" alt="Назад"> Назад
253. </h4>';
254.
255. }
256. $move = $_GET['move'];
257. if ($sort == complite && $move > 0) {
258. if (is_dir("C:\share\complite\\$move")) {
259. //echo 'CMD /Q /C XCOPY /Y /E /H /C /I C:\share\complite\\'.$move.'
C:\archive\\'.$move.' && RMDIR /Q /S C:\share\complite\\'.$move;
260. `"CMD /Q /C XCOPY /Y /E /H /C /I C:\share\complite\\$move
C:\archive\\$move && RMDIR /Q /S C:\share\complite\\$move"`;
261. echo '<script
type="text/javascript">setTimeout("window.location.href=\'arc.php?sort=complite\'",100
0)</script>';
262. }
263. else {
114
264. echo '<script
type="text/javascript">setTimeout("window.location.href=\'arc.php?sort=complite\'",500
)</script>';
265. }
266. }
267. if ($sort == inarchive && $move > 0) {
268. if (is_dir("C:\archive\\$move")) {
269. `"CMD /Q /C XCOPY /Y /E /H /C /I C:\archive\\$move
C:\share\complite\\$move && RMDIR /Q /S C:\archive\\$move"`;
270. echo '<script
type="text/javascript">setTimeout("window.location.href=\'arc.php?sort=inarchive\'",100
0)</script>';
271. }
272. else {
273. echo '<script
type="text/javascript">setTimeout("window.location.href=\'arc.php?sort=inarchive\'",500
)</script>';
274. }
275. }
276. //echo 'Время выполнения скрипта: '.round(microtime(true) - $start, 4).'
сек.';
277. echo '</tbody></table></div>';
278. if(!$directory) {
279. echo '<div class="color_a" id="controls" onselectstart="return false">
280. <div class="hidden-print" id="perpage">
281. <select onchange="sorter.size(this.value)">
282. <option value="10" selected="selected">10</option>
283. <option value="25">25</option>
284. <option value="50">50</option>
285. <option value="100">100</option>
286. <option value="250">250</option>
287. <option value="500">500</option>
288. </select>
289. <span>Записей на стр.&nbsp;</span>
290. </div>
291. <div class="hidden-print">
292. <div class="color_a" id="navigation">
293. <img src="images/first.gif" width="18" height="18" alt="First Page"
onclick="sorter.move(-1,true)" />
294. <img src="images/previous.gif" width="18" height="18" alt="First Page"
onclick="sorter.move(-1)" />
295. <img src="images/next.gif" width="18" height="18" alt="First Page"
onclick="sorter.move(1)" />
296. <img src="images/last.gif" width="18" height="18" alt="Last Page"
onclick="sorter.move(1,true)" />
297. </div>
298. <div class="color_a" id="text">Стр. <span id="currentpage"></span> из
<span id="pagelimit"></span>
115
299. </div>
300. </div>
301. </div>
302. <script type="text/javascript">
303. var sorter = new TINY.table.sorter("sorter");
304. sorter.head = "head";
305. sorter.asc = "asc";
306. sorter.desc = "desc";
307. sorter.even = "evenrow";
308. sorter.odd = "oddrow";
309. sorter.evensel = "evenselected";
310. sorter.oddsel = "oddselected";
311. sorter.paginate = true;
312. sorter.currentid = "currentpage";
313. sorter.limitid = "pagelimit";
314. sorter.init("table",1);
315. </script>';
316. echo '<div class="hidden-print">
317. <h4 class="color_b" onclick="location.href=\'main.php\'"
onselectstart="return false"><img src="images/back.svg" alt="Назад"> Назад</h4>
318. </div>';
319. }
320. ?>
321. <script type="text/javascript">
322. //листнер скроллинга страницы
323. window.onscroll = function() {
324. let table = window.document.getElementById("table").offsetTop;
325. let stick = document.querySelector(".stick");
326. let pagetop = document.querySelector(".pagetop");
327. let pagebottom = document.querySelector(".pagebottom");
328. let footer = document.querySelector(".footer").offsetTop;
329. let scrolled = window.pageYOffset;
330. let height = document.documentElement.clientHeight;
331. pagebottom.style = 'display: block';
332. if(scrolled > table) {
333. stick.style = 'display: block';
334. pagetop.style = 'display: block';
335. }
336. else {
337. stick.style = 'display: none';
338. pagetop.style = 'display: none';
339. }
340. if(footer < scrolled+height+53) {
341. pagebottom.style = 'display: none';
342. }
343. };
344. //листнер загрузки страницы
345. window.onload = function() {
116
346. let table = window.document.getElementById("table").offsetTop;
347. let footer = document.querySelector(".footer").offsetTop;
348. let height = document.documentElement.clientHeight;
349. let pagebottom = document.querySelector(".pagebottom");
350. let scrolled = window.pageYOffset;
351. if(scrolled > table) {
352. stick.style = 'display: block';
353. pagetop.style = 'display: block';
354. }
355. if(footer > height) {
356. pagebottom.style = 'display: block';
357. }
358. };
359. </script>
360. <div class="hidden-print" id="updown">
361. <img class="pagetop" onclick="window.scrollTo(0,0);" src="images/up.svg"
alt="Вверх">
362. <img class="pagebottom"
onclick="window.scrollTo(0,document.body.scrollHeight);" src="images/dwn.svg"
alt="Вниз">
363. </div>
364. </div><!-- .content -->
365. <div class="hidden-print">
366. <div class="footer" onselectstart="return false">Отдел ИТ. Тел. или 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>
367. </div>
368. </div><!-- .wrapper -->
369. </body>
370. </html>
371. <?php } ?>

Смотрите также:

"Автоматизация обработки заявок ООО "Проектно-Строительная Компания"
"Автоматизация процесса аттестации персонала для ООО "Нэт Бай Нэт Холдинг"
"Анализ интернет-активности конкурентов ( на примере конкурентов "Газпром нефть")
"Бухгалтерский учёт и аудит расчётов с подотчётними лицами в организации на примере ООО "ЛОЦ 10""
«Психологическое сопровождение персонала в организации на примере ООО «Крокус»
Cовершенствование деловой оценки персонала в организации (на примере ООО "Даймонд кейтеринг развитие")
IPO - инструмент финансирования деятельности организации. На примере ПАО «Нефтяная компания «Лукойл»
PR как средство продвижения организации (на примере ПАО "Тамбовский завод "Комсомолец им. Н.С. Артемова")
PR-коммуникации в сфере общественного питания (на примере кафе-кондитерской «Cream Cheese»)
SMM как средство повышения эффективности работы учреждений социокультурной сферы (на примере Малого театра)