add.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. {// 引入标签库 }
  2. <tagLib name="html" />
  3. <include file="Public:header" />
  4. <div class="main">
  5. <div class="main_title">{%ADD} <a href="{:u("IndexImage/index")}" class="back_list">{%BACK_LIST}</a></div>
  6. <div class="blank5"></div>
  7. <form name="edit" action="__APP__" method="post" enctype="multipart/form-data">
  8. <table class="form" cellpadding=0 cellspacing=0>
  9. <tr>
  10. <td colspan=2 class="topTd"></td>
  11. </tr>
  12. <tr>
  13. <td class="item_title">标题:</td>
  14. <td class="item_input"><input type="text" class="textbox require" name="title" /></td>
  15. </tr>
  16. <tr>
  17. <td class="item_title">图片:</td>
  18. <td class="item_input"><html:imgUpload name = 'image' id='image' />
  19. <span class="tip_span" id="tip_span">&nbsp;[启动广告图标规格为:750px*1334px][其他图片规格为:828px*240px]</span>
  20. </td>
  21. </tr>
  22. <tr>
  23. <td class="item_title">显示位置:</td>
  24. <td class="item_input">
  25. <select name="show_position" id="position">
  26. <foreach name="position" item="position_item" key="k">
  27. <option value="{$k}">{$position_item}</option>
  28. </foreach>
  29. </select>
  30. </td>
  31. </tr>
  32. <tr id="select_type">
  33. <td class="item_title">类型:</td>
  34. <td class="item_input">
  35. <select name="type" id="type">
  36. <foreach name="type_list" item="type_item" key="k">
  37. <option value="{$k}">{$type_item}</option>
  38. </foreach>
  39. </select>
  40. </td>
  41. </tr>
  42. <tr id="url">
  43. <td class="item_title">链接:</td>
  44. <td class="item_input"><input type="text" class="textbox" name="url" /></td>
  45. </tr>
  46. <tr id="family_id" style="display: none">
  47. <td class="item_title">家族:</td>
  48. <td class="item_input">
  49. <select name="show_id">
  50. <foreach name="family" item="f_item" key="k">
  51. <option value="{$f_item.id}">{$f_item.name}</option>
  52. </foreach>
  53. </select>
  54. </td>
  55. </tr>
  56. <tr id="edu_show_id" style="display: none">
  57. <td class="item_title" id="edu_show_id_title" >房间id:</td>
  58. <td class="item_input">
  59. <input type="text" class="textbox" name="show_id" value="" />
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="item_title">{%SORT}:</td>
  64. <td class="item_input"><input type="text" class="textbox" name="sort" value="{$new_sort}" /></td>
  65. </tr>
  66. <tr>
  67. <td class="item_title"></td>
  68. <td class="item_input">
  69. <!--隐藏元素-->
  70. <input type="hidden" name="{:conf("VAR_MODULE")}" value="IndexImage" />
  71. <input type="hidden" name="{:conf("VAR_ACTION")}" value="insert" />
  72. <!--隐藏元素-->
  73. <input type="submit" class="button" value="{%ADD}" />
  74. <input type="reset" class="button" value="{%RESET}" />
  75. </td>
  76. </tr>
  77. <tr>
  78. <td colspan=2 class="bottomTd"></td>
  79. </tr>
  80. </table>
  81. <script>
  82. $(function(){
  83. var type = $('#type option:selected').val();
  84. var position = $('#position option:selected').val();
  85. if(type==1){
  86. $('#family_id').show();
  87. }else{
  88. $('#family_id').hide();
  89. }
  90. if(type==0){
  91. $("#url").show();
  92. }else{
  93. $("#url").hide();
  94. }
  95. if(position == 3){
  96. $("#select_type").hide();
  97. $("#type").val(0);
  98. $("#url").show();
  99. }else{
  100. $("#select_type").show();
  101. }
  102. $("#type").change(function(){
  103. type = $(this).val();
  104. if(type==1){
  105. $('#family_id').show();
  106. }else{
  107. $('#family_id').hide();
  108. }
  109. if(type!=0){
  110. $("#url").hide();
  111. $("input[name='url']").val('');
  112. }else{
  113. $("#url").show();
  114. }
  115. if(type>=6 && type<=9){
  116. $('#edu_show_id').show();
  117. $('#edu_show_id input').attr('name','show_id');
  118. if( type==8)
  119. $('#edu_show_id_title').html("房间号:");
  120. else if( type==6)
  121. $('#edu_show_id_title').html("机构id:");
  122. else if( type==9)
  123. $('#edu_show_id_title').html("课程id:");
  124. else
  125. $('#edu_show_id_title').html("会员id:");
  126. }else{
  127. $('#edu_show_id').hide();
  128. $('#edu_show_id input').removeAttr('name');
  129. }
  130. });
  131. $("#position").change(function(){
  132. position = $(this).val();
  133. if(position == 3){
  134. $("#select_type").hide();
  135. $("#type").val(0);
  136. $("#url").show();
  137. }
  138. else{
  139. type = $('#type option:selected').val();
  140. if(type==0){
  141. $("#url").show();
  142. }else{
  143. $("#url").hide();
  144. $("input[name='url']").val('');
  145. }
  146. $("#select_type").show();
  147. }
  148. });
  149. });
  150. </script>
  151. </form>
  152. </div>
  153. <include file="Public:footer" />