prop_item.html 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. {// 引入标签库 }
  2. <tagLib name="html" />
  3. <include file="Public:header" />
  4. <php>
  5. function prop_name($id){
  6. $prop=M("Prop")->where("id =".intval($id))->getField("name");
  7. return $prop;
  8. }
  9. function is_show($show_user){
  10. return $show_user?"是":"否";
  11. }
  12. function is_type($type){
  13. if($type==1){
  14. return "屏幕上部";
  15. }
  16. if($type==2){
  17. return "屏幕中间";
  18. }
  19. if($type==3){
  20. return "屏幕底部";
  21. }
  22. }
  23. </php>
  24. <script>
  25. function add_item(id){
  26. location.href = ROOT+'?m='+MODULE_NAME+'&a=add_prop_item&id='+id;
  27. }
  28. function edit_item(id){
  29. location.href = ROOT+'?m='+MODULE_NAME+'&a=edit_prop_item&id='+id;
  30. }
  31. function del_prop_item(id){
  32. if(!id)
  33. {
  34. idBox = $(".key:checked");
  35. if(idBox.length == 0)
  36. {
  37. alert("请选择需要删除的项目");
  38. return;
  39. }
  40. idArray = new Array();
  41. $.each( idBox, function(i, n){
  42. idArray.push($(n).val());
  43. });
  44. id = idArray.join(",");
  45. }
  46. if(confirm("确定要删除选中的项目吗?"))
  47. $.ajax({
  48. url: ROOT+"?"+VAR_MODULE+"="+MODULE_NAME+"&"+VAR_ACTION+"=del_prop_item&id="+id,
  49. data: "ajax=1",
  50. dataType: "json",
  51. success: function(obj){
  52. $("#info").html(obj.info);
  53. if(obj.status==1)
  54. location.href=location.href;
  55. }
  56. });
  57. }
  58. </script>
  59. <div class="main">
  60. <div class="main_title">动画列表</div>
  61. <div class="blank5"></div>
  62. <div class="button_row">
  63. <input type="button" class="button" value="{%ADD}" onclick="add_item({$prop_info.id});" />
  64. <input type="button" class="button" value="{%DEL}" onclick="del_prop_item();" />
  65. </div>
  66. <div class="blank5"></div>
  67. <html:list
  68. id="dataTable"
  69. style="dataTable"
  70. name="prop_animated"
  71. checkbox="true"
  72. action="true"
  73. datasource="list"
  74. show="id:{%ID}
  75. ,prop_id|prop_name:所属礼物
  76. ,url:gif动画地址
  77. ,play_count:播放次数
  78. ,delay_time:延时播放时间(毫秒)
  79. ,duration:播放时长(毫秒)
  80. ,show_user|is_show:显示用户名
  81. ,type|is_type:使用路径
  82. ,sort|get_sort=$prop_animated['id']:{%SORT}"
  83. actionlist="edit_item:编辑,del_prop_item:删除" />
  84. <div class="blank5"></div>
  85. <div class="page">{$page}</div>
  86. </div>
  87. <include file="Public:footer" />
  88. <!---->