edit.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>TODO supply a title</title>
  5. {include file="../application/manage/view/commons/headers.html" }
  6. <script >
  7. // 保存信息
  8. function save(){
  9. var data=$("#myform").serialize();
  10. $.ajax({
  11. url:"/manage/messages/save",
  12. data:data,type:"get",
  13. success:function(rs){
  14. if(rs.indexOf("insert_ok")>=0){
  15. document.location.href="edit?id="+rs.split(";")[1];
  16. }else if(rs=="success"){
  17. alert('保存成功');
  18. document.location.reload();
  19. }else{
  20. alert("保存失败!");
  21. }
  22. },error:function(e,e1,e2){
  23. alert(e2);
  24. }
  25. });
  26. }
  27. </script>
  28. </head>
  29. <body>
  30. <form id="myform" action="" method="get" >
  31. <input name="id" type="hidden" value="{if isset($messages) }{$messages.id}{/if}" />
  32. <table class="editform" width="99%" border="0" style="margin: 5px auto;" cellpadding="1" cellspacing="1" >
  33. <tr>
  34. <th width="105" height="38" align="right" >属性&nbsp;</th>
  35. <th colspan="3" >信息</th>
  36. </tr>
  37. <tr>
  38. <th height="32" align="right" >标题:</th>
  39. <td colspan="3" >
  40. <input name="title" type="text" class="easyui-textbox" size="55" value="{if isset($messages) }{$messages.title}{/if}" />
  41. </td>
  42. </tr>
  43. <tr>
  44. <th height="32" align="right" >内容:</th>
  45. <td colspan="3" >
  46. <textarea name="content" class="easyui-textbox" data-options="multiline:true" style="width: 412px;height:150px">{if isset($messages) }{$messages.content}{/if}</textarea>
  47. </td>
  48. </tr>
  49. <tr>
  50. <th height="32" align="right" >是否已读:</th>
  51. <td colspan="3" >
  52. <input name="is_read" id="status_1" type="radio" size="35" value="1" {if isset($messages) && $messages.is_read==1 }checked="check"{/if} /><label for="status_1" >未读</label>
  53. <input name="is_read" id="status_2" type="radio" size="35" value="2" {if isset($messages) && $messages.is_read==2 }checked="check"{/if} /><label for="status_2" >已读</label>
  54. </td>
  55. </tr>
  56. <tr>
  57. <th height="32" >&nbsp;</th>
  58. <td>
  59. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-save'" icon="icon-save" onclick="save()" >保存</a>
  60. <a type="button" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="window.parent.closeEditWin('reload');" >关闭</a>
  61. </td>
  62. </tr>
  63. <tr >
  64. <th height="32" >&nbsp;</th>
  65. <td colspan="3" >
  66. &nbsp;
  67. </td>
  68. </tr>
  69. </table>
  70. </form>
  71. </body>
  72. </html>