edituser.php 22 KB

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