1
0

edituser.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <?php
  2. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/auth.php");
  3. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/languages/" . HTML_LANG . ".php");
  4. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/idfilter.php");
  5. $default_sort = 'ip_int';
  6. require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/sortfilter.php");
  7. $msg_error = "";
  8. $sSQL = "SELECT * FROM user_list WHERE id=?";
  9. $user_info = get_record_sql($db_link, $sSQL, [ $id ]);
  10. if (empty($user_info)) {
  11. header("Location: /admin/");
  12. }
  13. if (isset($_POST["edituser"])) {
  14. unset($new);
  15. $new["ou_id"] = $_POST["f_ou"] * 1;
  16. $new["filter_group_id"] = $_POST["f_filter"] * 1;
  17. $new["queue_id"] = $_POST["f_queue"] * 1;
  18. $user_name = trim($_POST["f_login"]);
  19. if (!empty($user_name)) { $new["login"] = $user_name; }
  20. $new["fio"] = trim($_POST["f_fio"]);
  21. if (get_const('default_user_ou_id') == $new["ou_id"] or get_const('default_hotspot_ou_id') == $new["ou_id"]) {
  22. $new["enabled"] = 0;
  23. $new["blocked"] = 0;
  24. $new["day_quota"] = 0;
  25. $new["month_quota"] = 0;
  26. $new["permanent"] = 0;
  27. } else {
  28. $new["enabled"] = get_int($_POST["f_enabled"]);
  29. $new["blocked"] = get_int($_POST["f_blocked"]);
  30. $new["day_quota"] = get_int(trim($_POST["f_perday"]));
  31. $new["month_quota"] = get_int(trim($_POST["f_permonth"]));
  32. $new["permanent"] = $_POST["f_permanent"] * 1;
  33. }
  34. $changes = get_diff_rec($db_link, "user_list", "id=?", $new, 0, [ $id ]);
  35. if (!empty($changes)) {
  36. LOG_WARNING($db_link, "Changed user id: $id login: " . $new["login"] . ". \r\nApply: $changes");
  37. }
  38. update_record($db_link, "user_list", "id=?", $new, [ $id ]);
  39. if (!$new["enabled"]) {
  40. update_record($db_link, 'user_auth', 'user_id = ?', [ 'enabled' => 0,'changed' => 1 ], [ $id ]);
  41. }
  42. if (!empty($new["fio"])) {
  43. update_records($db_link,'user_auth',"user_id=? AND deleted=0 AND (description IS NULL or description='' or description=?)", [ 'description'=> $new["fio"] ], [ $id, $user_info["fio"] ]);
  44. }
  45. // Обновление ou_id в user_auth
  46. update_records($db_link, 'user_auth', 'user_id = ? AND deleted=0', [ 'ou_id' => $new["ou_id"] ], [ $id ]);
  47. // Обновление device_name в devices
  48. update_record($db_link, 'devices', 'user_id = ?', [ 'device_name' => $new["login"] ], [ $id ]);
  49. header("Location: " . $_SERVER["REQUEST_URI"]);
  50. exit;
  51. }
  52. if (isset($_POST["addMacRule"])) {
  53. unset($new);
  54. $first_auth = get_records_sql($db_link, "SELECT mac FROM user_auth WHERE user_id=? AND deleted=0 AND LENGTH(mac)>0 ORDER BY id", [ $id ]);
  55. foreach ($first_auth as $row) {
  56. if (!empty($row['mac'])) { add_auth_rule($db_link, $row['mac'], 2, $id); }
  57. }
  58. header("Location: " . $_SERVER["REQUEST_URI"]);
  59. exit;
  60. }
  61. if (isset($_POST["delMacRule"])) {
  62. run_sql($db_link, "DELETE FROM auth_rules WHERE user_id=? AND type=2", [ $id ]);
  63. LOG_INFO($db_link, "All autorules removed for id: $id login: " . $user_info["login"] . " by mac");
  64. header("Location: " . $_SERVER["REQUEST_URI"]);
  65. exit;
  66. }
  67. if (isset($_POST["addIPRule"])) {
  68. unset($new);
  69. $first_auth = get_records_sql($db_link, "SELECT ip FROM user_auth WHERE user_id = ? AND deleted = 0 AND ip IS NOT NULL ORDER BY id", [$id]);
  70. foreach ($first_auth as $row) {
  71. if (!empty($row['ip'])) { add_auth_rule($db_link, $row['ip'], 1, $id); }
  72. }
  73. header("Location: " . $_SERVER["REQUEST_URI"]);
  74. exit;
  75. }
  76. if (isset($_POST["delIPRule"])) {
  77. run_sql($db_link, "DELETE FROM auth_rules WHERE user_id=? AND type=1", [ $id ]);
  78. LOG_INFO($db_link, "Removed all auto rules for id: $id login: " . $user_info["login"] . " by ip");
  79. header("Location: " . $_SERVER["REQUEST_URI"]);
  80. exit;
  81. }
  82. if (isset($_POST["showDevice"])) {
  83. $device = get_record_sql($db_link, "SELECT * FROM devices WHERE user_id=?", [$id]);
  84. $auth = get_record_sql($db_link, "SELECT * FROM user_auth WHERE user_id=?", [$id]);
  85. if (empty($device) and !empty($auth)) {
  86. $new['user_id'] = $id;
  87. $new['device_name'] = $user_info['login'];
  88. $new['device_type'] = 5;
  89. $new['ip'] = $auth['ip'];
  90. $new['ip_int'] = $auth['ip_int'];
  91. $new['community'] = get_const('snmp_default_community');
  92. $new['snmp_version'] = get_const('snmp_default_version');
  93. $new['login'] = get_option($db_link, 28);
  94. $new['password'] = get_option($db_link, 29);
  95. //default ssh
  96. $new['protocol'] = 0;
  97. $new['control_port'] = get_option($db_link, 30);
  98. $new_id = insert_record($db_link, "devices", $new);
  99. unset($_POST);
  100. if (!empty($new_id)) {
  101. LOG_INFO($db_link, "Created device with id: $new_id for auth_id: $id");
  102. header("Location: /admin/devices/editdevice.php?id={$new_id}");
  103. exit;
  104. } else {
  105. header("Location: " . $_SERVER["REQUEST_URI"]);
  106. exit;
  107. }
  108. }
  109. header("Location: /admin/devices/editdevice.php?id=" . $device['id']);
  110. exit;
  111. }
  112. if (isset($_POST["addauth"])) {
  113. $fip = normalizeIpAddress(substr(trim($_POST["newip"]), 0, 18));
  114. $fdescription = NULL;
  115. $fmac = trim($_POST["newmac"]);
  116. if (!empty($fmac)) {
  117. if (!checkValidMac($fmac)) {
  118. $fdescription = $fmac;
  119. $fmac=NULL;
  120. } else {
  121. $fmac = mac_dotted($fmac);
  122. }
  123. }
  124. if (!empty($fip)) {
  125. $ip_aton = ip2long($fip);
  126. $f_dhcp = 1;
  127. //search mac
  128. if (!empty($fmac) and !empty($fip)) {
  129. $mac_exists = find_mac_in_subnet($db_link, $fip, $fmac);
  130. if (!empty($mac_exists) and $mac_exists['count'] >= 1 and !in_array($id, $mac_exists['users_id'])) {
  131. $dup_sql = "SELECT * FROM user_list WHERE id=?";
  132. $dup_info = get_record_sql($db_link, $dup_sql, [ $mac_exists['users_id']['0'] ]);
  133. $msg_error = "Mac already exists at another user in this subnet! Skip creating $fip [$fmac].<br>Old user id: " . $dup_info['id'] . " login: " . $dup_info['login'];
  134. $_SESSION[$page_url]['msg'] = $msg_error;
  135. LOG_ERROR($db_link, $msg_error);
  136. header("Location: " . $_SERVER["REQUEST_URI"]);
  137. exit;
  138. }
  139. //disable dhcp for secondary ip
  140. if (empty($mac_exists)) {
  141. $f_dhcp = 1;
  142. } else {
  143. if (in_array($id, $mac_exists['users_id'])) {
  144. $f_dhcp = 0;
  145. }
  146. }
  147. }
  148. //search ip
  149. $dup_ip_record = get_record_sql($db_link, "SELECT * FROM user_auth WHERE ip_int=? AND user_id<>? AND deleted=0", [ $ip_aton, $id ]);
  150. if (!empty($dup_ip_record)) {
  151. $dup_info = get_record_sql($db_link, "SELECT * FROM user_list WHERE id=?", [ $dup_ip_record['user_id'] ]);
  152. $msg_error = "$fip already exists. Skip creating $fip [$fmac].<br>Old user id: " . $dup_info['id'] . " login: " . $dup_info['login'];
  153. $_SESSION[$page_url]['msg'] = $msg_error;
  154. LOG_ERROR($db_link, $msg_error);
  155. header("Location: " . $_SERVER["REQUEST_URI"]);
  156. exit;
  157. }
  158. $fid = new_auth($db_link, $fip, $fmac, $id);
  159. if (!empty($fid)) {
  160. $new['dhcp'] = $f_dhcp;
  161. $new['created_by'] = 'manual';
  162. if (!empty($fdescription)) { $new['description'] = $fdescription; }
  163. update_record($db_link, "user_auth", "id=?", $new, [ $fid ]);
  164. LOG_WARNING($db_link, "Add ip for login: " . $user_info["login"] . ": ip => $fip, mac => $fmac", $fid);
  165. header("Location: /admin/users/editauth.php?id=" . $fid);
  166. exit;
  167. }
  168. header("Location: " . $_SERVER["REQUEST_URI"]);
  169. exit;
  170. } else {
  171. $msg_error = "IP-address fromat eror!";
  172. $_SESSION[$page_url]['msg'] = $msg_error;
  173. }
  174. header("Location: " . $_SERVER["REQUEST_URI"]);
  175. exit;
  176. }
  177. if (isset($_POST["removeauth"])) {
  178. $auth_id = $_POST["f_auth_id"];
  179. foreach ($auth_id as $key => $val) {
  180. if ($val) { delete_user_auth($db_link, $val); }
  181. }
  182. header("Location: " . $_SERVER["REQUEST_URI"]);
  183. exit;
  184. }
  185. if (isset($_POST["new_user"])) {
  186. $auth_id = $_POST["f_auth_id"];
  187. $save_traf = get_option($db_link, 23) * 1;
  188. foreach ($auth_id as $key => $val) {
  189. if ($val) {
  190. $auth_info = get_record_sql($db_link, "SELECT * FROM user_auth WHERE id=?", [ $val ]);
  191. $ou_id = $user_info["ou_id"];
  192. $login = NULL;
  193. if (!empty($auth_info["dns_name"])) {
  194. $login = $auth_info["dns_name"];
  195. }
  196. if (empty($login) and !empty($auth_info["description"])) {
  197. $login = transliterate($auth_info["description"]);
  198. }
  199. if (empty($login) and !empty($auth_info["dhcp_hostname"])) {
  200. $login = $auth_info["dhcp_hostname"];
  201. }
  202. if (empty($login) and !empty($auth_info["mac"])) {
  203. $login = $auth_info["mac"];
  204. }
  205. if (empty($login)) {
  206. $login = $auth_info["ip"];
  207. }
  208. $new_user = get_record_sql($db_link, "SELECT * FROM user_list WHERE LOWER(login) = LOWER(?) AND deleted = 0", [$login]);
  209. if (!empty($new_user)) {
  210. // move auth
  211. $auth["user_id"] = $new_user["id"];
  212. $auth["ou_id"] = $new_user["ou_id"];
  213. $auth["save_traf"] = $save_traf;
  214. $auth = apply_auth_rule($db_link, $auth, $l_id);
  215. update_record($db_link, "user_auth", "id=?", $auth, [ $val ]);
  216. LOG_WARNING($db_link, "ip from id: $val moved to another user user_id: " . $new_user["id"], $val);
  217. } else {
  218. $new["login"] = $login;
  219. $new["ou_id"] = $ou_id;
  220. if (!empty($auth_info["description"])) { $new["fio"] = $auth_info["description"]; }
  221. if (!isset($new["fio"]) and !empty($auth_info["dns_name"])) { $new["fio"] = $auth_info["dns_name"]; }
  222. if (!isset($new["fio"]) and !empty($auth_info["dhcp_hostname"])) { $new["fio"] = $auth_info["dhcp_hostname"]; }
  223. $new["enabled"] = $auth_info["enabled"];
  224. $l_id = insert_record($db_link, "user_list", $new);
  225. $auth["user_id"] = $l_id;
  226. $auth["save_traf"] = $save_traf;
  227. update_record($db_link, "user_auth", "id=?", $auth, [ $val ]);
  228. LOG_WARNING($db_link, "Create user from ip: login => $login. ip-record auth_id: $val moved to this user.", $val);
  229. }
  230. }
  231. }
  232. header("Location: " . $_SERVER["REQUEST_URI"]);
  233. exit;
  234. }
  235. unset($_POST);
  236. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/header.php");
  237. ?>
  238. <div id="cont">
  239. <?php
  240. if (!empty($_SESSION[$page_url]['msg'])) {
  241. print '<div id="msg">' . $_SESSION[$page_url]['msg'] . '</div>';
  242. unset($_SESSION[$page_url]['msg']);
  243. }
  244. ?>
  245. <form name="def" action="edituser.php?id=<?php echo $id; ?>" method="post">
  246. <input type="hidden" name="id" value=<?php echo $id; ?>>
  247. <table class="data">
  248. <tr>
  249. <td colspan=2><?php print WEB_cell_login; ?></td>
  250. <td colspan=2><?php print WEB_cell_fio; ?></td>
  251. <td colspan=2><?php print WEB_cell_ou; ?></td>
  252. <td ><?php print WEB_user_permanent; ?></td>
  253. </tr>
  254. <tr>
  255. <td colspan=2><input type="text" name="f_login" value="<?php print $user_info["login"]; ?>" size=25></td>
  256. <td colspan=2><input type="text" name="f_fio" value="<?php print $user_info["fio"]; ?>" size=25></td>
  257. <td colspan=2><?php print_ou_set($db_link, 'f_ou', $user_info["ou_id"]); ?></td>
  258. <td><?php print_qa_select('f_permanent', $user_info["permanent"]); ?></td>
  259. </tr>
  260. <tr>
  261. <td colspan=2><?php print WEB_cell_perday; ?></td>
  262. <td colspan=2><?php print WEB_cell_permonth; ?></td>
  263. <td><?php print WEB_cell_blocked; ?></td>
  264. <td></td>
  265. <td><?php print WEB_cell_enabled; ?></td>
  266. </tr>
  267. <tr>
  268. <td colspan=2><input type="text" name="f_perday" value="<?php echo $user_info["day_quota"]; ?>" size=5></td>
  269. <td colspan=2><input type="text" name="f_permonth" value="<?php echo $user_info["month_quota"]; ?>" size=5></td>
  270. <td><?php print_qa_select('f_blocked', $user_info["blocked"]); ?></td>
  271. <td></td>
  272. <td><?php print_qa_select('f_enabled', $user_info["enabled"]); ?></td>
  273. </tr>
  274. <tr>
  275. <td class=data colspan=7><?php echo WEB_user_rules_for_autoassign; ?>:</td>
  276. </tr>
  277. <tr>
  278. <td colspan=2><?php print WEB_cell_filter; ?></td>
  279. <td colspan=2><?php print WEB_cell_shaper; ?></td>
  280. <td colspan=3></td>
  281. </tr>
  282. <tr>
  283. <td colspan=2><?php print_filter_group_select($db_link, 'f_filter', $user_info["filter_group_id"]); ?></td>
  284. <td colspan=2><?php print_queue_select($db_link, 'f_queue', $user_info["queue_id"]); ?></td>
  285. <td colspan=3></td>
  286. </tr>
  287. <tr>
  288. <?php
  289. print "<td>";
  290. print_url(WEB_user_rule_list, "/admin/users/edit_rules.php?id=$id");
  291. print "</td>";
  292. $rule_count = get_count_records($db_link, "auth_rules", "user_id=?", [ $id ]);
  293. print "<td > Count: " . $rule_count . "</td>";
  294. $first_auth = get_record_sql($db_link, "SELECT id FROM user_auth WHERE user_id=? AND deleted=0 ORDER BY id", [ $id ]);
  295. if (!empty($first_auth)) {
  296. //mac
  297. $mac_rule_count = get_count_records($db_link, "auth_rules", "user_id=? AND type=2", [ $id ]);
  298. if (!empty($mac_rule_count)) {
  299. print "<td><input type=\"submit\" name=\"delMacRule\" value=" . WEB_btn_mac_del . " ></td>";
  300. } else {
  301. print "<td><input type=\"submit\" name=\"addMacRule\" value=" . WEB_btn_mac_add . " ></td>";
  302. }
  303. //ip
  304. $ip_rule_count = get_count_records($db_link, "auth_rules", "user_id=? AND type=1", [ $id ]);
  305. if (!empty($ip_rule_count)) {
  306. print "<td><input type=\"submit\" name=\"delIPRule\" value=" . WEB_btn_ip_del . " ></td>";
  307. } else {
  308. print "<td><input type=\"submit\" name=\"addIPRule\" value=" . WEB_btn_ip_add . " ></td>";
  309. }
  310. } else {
  311. print "<td colspan=2></td>";
  312. }
  313. ?>
  314. <td colspan=3 align=right><?php print WEB_cell_created . ":&nbsp";
  315. print $user_info["ts"]; ?></td>
  316. </tr>
  317. <tr>
  318. <?php print "<td colspan=2>";
  319. print_url(WEB_report_by_day, "/admin/reports/userday.php?id=$id"); ?></td>
  320. <td></td>
  321. <td><input type="submit" name="showDevice" value=<?php print WEB_btn_device; ?>></td>
  322. <td colspan=2></td>
  323. <td align=right><input type="submit" name="edituser" value=<?php print WEB_btn_save; ?>></td>
  324. </tr>
  325. </table>
  326. <?php
  327. if ($msg_error) {
  328. print "<div id='msg'><b>$msg_error</b></div><br>\n";
  329. }
  330. $sort_table = 'user_auth';
  331. $sort_url = "<a href=edituser.php?id=" . $id;
  332. ?>
  333. <br><b><?php echo WEB_user_ip_list; ?></b><br>
  334. <table class="data">
  335. <tr>
  336. <td class="data"><?php echo WEB_user_add_ip; ?>:&nbsp<input type=text name=newip value=""></td>
  337. <td class="data"><?php echo WEB_user_add_mac; ?>:&nbsp<input type=text name=newmac value=""></td>
  338. <td class="data"><input type="submit" name="addauth" value="<?php echo WEB_btn_add; ?>"></td>
  339. <td class="data" align=right><input type="submit" name="new_user" value="<?php echo WEB_btn_transfom; ?>"></td>
  340. </tr>
  341. </table>
  342. <table class="data" width=120%>
  343. <tr align=center>
  344. <td class="data"><input type="checkbox" onClick="checkAll(this.checked);"></td>
  345. <td class="data"><?php print $sort_url . "&sort=ip_int&order=$new_order>" . WEB_cell_ip . "</a>"; ?></td>
  346. <td class="data"><?php print $sort_url . "&sort=mac&order=$new_order>" . WEB_cell_mac . "</a>"; ?></td>
  347. <td class="data"><?php print WEB_cell_description; ?></td>
  348. <td class="data"><?php print $sort_url . "&sort=dns_name&order=$new_order>" . WEB_cell_dns_name . "</a>"; ?></td>
  349. <td class="data"><?php print WEB_cell_enabled; ?></td>
  350. <td class="data"><?php print WEB_cell_dhcp; ?></td>
  351. <td class="data"><?php print WEB_cell_filter; ?></td>
  352. <td class="data"><?php print WEB_cell_shaper; ?></td>
  353. <td class="data"><?php print WEB_cell_perday . "/<br>" . WEB_cell_permonth . ", Mb"; ?></td>
  354. <td class="data"><?php print WEB_cell_temporary; ?></td>
  355. <td class="data"><?php print "<input type=\"submit\" onclick=\"return confirm('" . WEB_msg_apply_selected . "?')\" name=\"removeauth\" value=" . WEB_btn_remove . ">"; ?></td>
  356. </tr>
  357. <?php
  358. $flist = get_records($db_link, 'user_auth', "user_id=? and deleted=0 ORDER BY $sort_table.$sort_field $order", [ $id ]);
  359. if (!empty($flist)) {
  360. foreach ($flist as $row) {
  361. $dhcp_str = '';
  362. if ($row["dhcp_time"] !== '0000-00-00 00:00:00') {
  363. if (!empty($row["dhcp_action"])) { $dhcp_str = FormatDateStr('Y.m.d H:m', $row["dhcp_time"]) . " (" . $row["dhcp_action"] . ")"; }
  364. }
  365. if ($row["last_found"] == '0000-00-00 00:00:00') {
  366. $row["last_found"] = '';
  367. }
  368. if ($row["mac_found"] == '0000-00-00 00:00:00') {
  369. $row["mac_found"] = '';
  370. }
  371. if ($row["arp_found"] == '0000-00-00 00:00:00') {
  372. $row["arp_found"] = '';
  373. }
  374. print "<tr align=center>";
  375. print "<td class=\"data\" style='padding:0'><input type=checkbox name=f_auth_id[] value=" . $row["id"] . " ></td>";
  376. print "<td class=\"data\" align=left><a href=editauth.php?id=" . $row["id"] . ">" . $row["ip"] . "</a>";
  377. if (!empty($row["arp_found"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["arp_found"])."</p>"; }
  378. print "</td>";
  379. print "<td class=\"data\" >" . expand_mac($db_link, $row["mac"]);
  380. if (!empty($row["mac_found"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["mac_found"])."</p>"; }
  381. print "</td>";
  382. if (isset($row["dhcp_hostname"]) and strlen($row["dhcp_hostname"]) > 0) {
  383. print "<td class=\"data\" >" . $row["description"] . " [" . $row["dhcp_hostname"] . "]</td>";
  384. } else {
  385. print "<td class=\"data\" >" . $row["description"] . "</td>";
  386. }
  387. $f_dns_type = 'A';
  388. if ($row["dns_ptr_only"]) { $f_dns_type = 'ptr'; }
  389. $f_dns_row = '';
  390. if (!empty($row["dns_name"])) { $f_dns_row = $row["dns_name"]."<hr>".$f_dns_type; }
  391. print "<td class=\"data\" >" . $f_dns_row . "</td>";
  392. $ip_status = 1;
  393. if ($row["blocked"] or !$row["enabled"]) {
  394. $ip_status = 0;
  395. }
  396. print_td_qa($ip_status);
  397. $cl = "data_green";
  398. if (!$row["dhcp"]) { $cl = "data_red"; }
  399. print "<td class=\"$cl\" >" . get_qa($row["dhcp"]);
  400. if (!empty($row["dhcp_acl"]) or !empty($row["dhcp_option_set"])) {
  401. print "<p class='ts'>";
  402. if (!empty($row["dhcp_acl"])) { print $row["dhcp_acl"]; }
  403. if (!empty($row["dhcp_acl"]) and !empty($row["dhcp_option_set"])) { print "&nbsp/&nbsp"; }
  404. if (!empty($row["dhcp_option_set"])) { print $row["dhcp_option_set"]; }
  405. print "</p>";
  406. }
  407. if (!empty($dhcp_str)) { print "<p class='ts'>".$dhcp_str. "</p>"; }
  408. print "</td>";
  409. print "<td class=\"data\" >" . get_group($db_link, $row["filter_group_id"]) . "</td>";
  410. print "<td class=\"data\" >" . get_queue($db_link, $row["queue_id"]) . "</td>";
  411. print "<td class=\"data\" >" . $row["day_quota"] . "/" . $row["month_quota"] . "</td>";
  412. if ($row['dynamic']) { $cl = "data_red"; } else { $cl = "data_green"; }
  413. print "<td class=\"$cl\" >". get_qa($row['dynamic']);
  414. if ($row['dynamic'] and !empty($row["end_life"])) { print "<p class='ts'>".FormatDateStr('Y.m.d H:i', $row["end_life"])."</p>"; } else { print "&nbsp"; }
  415. print "</td>";
  416. print "<td class=\"data\" >";
  417. if (!empty($row["created_by"])) { print $row["created_by"]; } else { print "&nbsp"; }
  418. print "</td>";
  419. print "</tr>";
  420. }
  421. }
  422. ?>
  423. </table>
  424. </form>
  425. <?php
  426. require_once($_SERVER["DOCUMENT_ROOT"] . "/inc/footer.php");
  427. ?>