1
0

editcustom.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. exit;
  16. }
  17. unset($_POST);
  18. require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
  19. $customer=get_record($db_link,'Customers',"id=".$id);
  20. ?>
  21. <div id="cont">
  22. <form name="def" action="editcustom.php?id=<?php echo $id; ?>" method="post">
  23. <input type="hidden" name="id" value=<?php echo $id; ?>>
  24. <table class="data">
  25. <tr>
  26. <td>Login</td>
  27. <td>Password</td>
  28. <td>RO</td>
  29. </tr>
  30. <tr>
  31. <td><input type="text" name="login" value="<?php print $customer['Login']; ?>" size=20></td>
  32. <td><input type="text" name="pass" value="" size=20></td>
  33. <td><?php print_qa_select('f_ro',$customer['readonly']); ?></td>
  34. </tr>
  35. <td colspan=2><input type="submit" name="edituser" value="Save"></td>
  36. </table>
  37. </form>
  38. <?php require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php"); ?>