ad_message_edit.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <include file="./Application/Admin/View/head.html" />
  5. <link rel="stylesheet" type="text/css" href="/Public/lib/bootstrap-Switch/bootstrapSwitch.css" />
  6. <link rel="stylesheet" type="text/css" href="/Public/plugins/uploadify/uploadify.css">
  7. <link rel="stylesheet" type="text/css" href="/Public/plugins/css/tinyselect.css">
  8. <style type="text/css">
  9. form .row input{width:250px;}
  10. * {
  11. margin: 0;
  12. padding: 0;
  13. }
  14. .citys{
  15. margin-bottom: 10px;
  16. }
  17. .citys p{
  18. line-height: 28px;
  19. }
  20. .warning{
  21. color: #c00;
  22. }
  23. table a{
  24. margin-right: 8px;
  25. color: #369;
  26. }
  27. .imgUpload {
  28. width: 60px;
  29. height: 25px;
  30. line-height: 25px;
  31. text-align: center;
  32. border-radius: 2px;
  33. background: #CC290E;
  34. color: #FFF;
  35. font-size: 12px;
  36. border: none;
  37. cursor: pointer;
  38. outline: none;
  39. }
  40. .c_img{
  41. width:240px;height:auto;
  42. }
  43. </style>
  44. </head>
  45. <body>
  46. <article class="page-container">
  47. <form action="" method="post" class="form form-horizontal" id="edit">
  48. <div class="row cl">
  49. <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>广告名称:</label>
  50. <div class="formControls col-xs-10 col-sm-10">
  51. <input type="text" class="input-text" placeholder="请输入广告名称" id="name" name="name" value="{$data['name']}" />
  52. </div>
  53. </div>
  54. <div class="row cl">
  55. <label class="form-label col-xs-2 col-sm-2"><span class="c-red">*</span>链接:</label>
  56. <div class="formControls col-xs-10 col-sm-10">
  57. <input type="text" class="input-text" placeholder="请输入链接" id="url" name="url" value="{$data['url']}" />
  58. </div>
  59. </div>
  60. <div class="row cl">
  61. <label class="form-label col-xs-2 col-sm-2">头条id:</label>
  62. <div class="formControls col-xs-10 col-sm-10">
  63. <input type="text" class="input-text" placeholder="请输入头条id" id="tt_code" name="tt_code" value="{$data['tt_code']}" />
  64. </div>
  65. </div>
  66. <div class="row cl">
  67. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
  68. <input type="hidden" class="input-text" value="{$data.id}" placeholder="" id="id" name="id" />
  69. <button type="submit" class="btn btn-success radius" id="save" name="save"><i class="icon-ok"></i> 确定</button>
  70. </div>
  71. </div>
  72. </form>
  73. </article>
  74. <!--_footer 作为公共模版分离出去-->
  75. <include file="./Application/Admin/View/foot.html" />
  76. <!--/_footer /作为公共模版分离出去-->
  77. <script>
  78. $().ready(function() {
  79. $("#edit").validate({
  80. rules: {
  81. name: {required: true},
  82. url: {required: true}
  83. },
  84. success: "valid",
  85. submitHandler: function() {
  86. $("#save").attr('disabled', true);
  87. var data = {
  88. id: $('#id').val(),
  89. name: $('#name').val(),
  90. img: $('#img').val(),
  91. url: $('#url').val(),
  92. tt_code: $('#tt_code').val()
  93. };
  94. $.ajax({
  95. type: "post",
  96. url: "{:U(CONTROLLER_NAME . '/' . ACTION_NAME)}",
  97. data: {data:data},
  98. success: function(data) {
  99. if (data.status == '1') {
  100. //加载层-风格3
  101. parent.layer.load(2);
  102. parent.layer.msg(data.info, {icon: 1});
  103. parent.location.reload();
  104. var index = parent.layer.getFrameIndex(window.name);
  105. parent.layer.close(index);
  106. } else if(data.status == '0') {
  107. parent.layer.msg(data.info, {icon: 2});
  108. }
  109. $("#save").removeAttr('disabled');
  110. }
  111. });
  112. }
  113. });
  114. });
  115. </script>
  116. </body>
  117. </html>