editcustom.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
  3. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . $language . ".php");
  4. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/idfilter.php");
  5. $msg_error = "";
  6. if (isset($_POST["edituser"])) {
  7. $new[Login] = substr(trim($_POST["login"]), 0, 20);
  8. if (isset($_POST["pass"]) and (strlen(trim($_POST["pass"])) > 0)) {
  9. $new[Pwd] = md5($_POST["pass"]);
  10. }
  11. $new[readonly] = $_POST["f_ro"] * 1;
  12. update_record($db_link, "Customers", "id='$id'", $new);
  13. unset($_POST["pass"]);
  14. header("Location: " . $_SERVER["REQUEST_URI"]);
  15. }
  16. unset($_POST);
  17. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
  18. $customer=get_record($db_link,'Customers',"id=".$id);
  19. ?>
  20. <div id="cont">
  21. <form name="def" action="editcustom.php?id=<? echo $id; ?>" method="post">
  22. <input type="hidden" name="id" value=<? echo $id; ?>>
  23. <table class="data">
  24. <tr>
  25. <td>Login</td>
  26. <td>Password</td>
  27. <td>RO</td>
  28. </tr>
  29. <tr>
  30. <td><input type="text" name="login" value="<?php print $customer['Login']; ?>" size=20></td>
  31. <td><input type="text" name="pass" value="" size=20></td>
  32. <td><?php print_qa_select('f_ro',$customer['readonly']); ?></td>
  33. </tr>
  34. <td colspan=2><input type="submit" name="edituser" value="Save"></td>
  35. </table>
  36. </form>
  37. <?
  38. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
  39. ?>