You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

modifyRow.php 1.5 KiB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <script language="javascript">
  2. /**
  3. * switch format between json and array
  4. */
  5. function switchFormat(select) {
  6. $.ajax({
  7. "data": { "data": $("#row_data").val(), "format":select.value },
  8. "url": "index.php?action=collection.switchFormat&db=<?php h($db); ?>&collection=<?php h($collection); ?>",
  9. "type": "POST",
  10. "dataType": "json",
  11. "success": function (resp) {
  12. $("#row_data").val(resp.data);
  13. }
  14. });
  15. }
  16. </script>
  17. <h3><?php render_navigation($db,$collection,false); ?> &raquo; <?php hm("modifyrow"); ?> '<?php h_escape($row["_id"]);?>' [<a href="<?php h($_SERVER['REQUEST_URI']);?>"><?php hm("refresh"); ?></a>]</h3>
  18. <?php if (isset($message)): ?>
  19. <p class="message">
  20. <?php h($message);?>
  21. </p>
  22. <?php endif;?>
  23. <?php if (isset($error)): ?>
  24. <p class="error">
  25. <?php h($error);?>
  26. </p>
  27. <?php endif;?>
  28. <form method="post">
  29. <?php hm("format"); ?>:<br/>
  30. <select name="format" onchange="switchFormat(this)">
  31. <option value="array" <?php if($last_format=="array"): ?>selected="selected"<?php endif; ?>>Array</option>
  32. <option value="json" <?php if($last_format=="json"): ?>selected="selected"<?php endif; ?>>JSON</option>
  33. </select><br/>
  34. _id:<br/>
  35. <input type="text" readonly value="<?php h_escape($row["_id"]);?>" size="72"/>
  36. <br/>
  37. <?php hm("data"); ?>:<br/>
  38. <textarea rows="35" cols="70" name="data" id="row_data"><?php h($data); ?></textarea><br/>
  39. <input type="submit" value="<?php hm("save"); ?>"/> <input type="button" value="<?php hm("back"); ?>" onclick="window.location='<?php h(xn("uri"));?>'"/>
  40. </form>