subscribe_list.tpl.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header','admin');
  4. ?>
  5. <div class="pad_10">
  6. <div class="table-list">
  7. <form name="searchform" id="searchform" action="" method="get" >
  8. <input type="hidden" value="video" name="m">
  9. <input type="hidden" value="video" name="c">
  10. <input type="hidden" <?php if (($type == 1)) { ?>value="subscribe_list"<?php } else { ?>value="subscribe_uservideo"<?php } ?> id="sub_function" name="a">
  11. <input type="hidden" value="<?php echo $_GET['menuid']?>" name="menuid">
  12. <div class="explain-col search-form">
  13. <?php echo form::radio(array('1'=>L('channel_subscribe'), '2'=>L('user_subscribe')), $type, 'name="type"', '', 'choose')?>&nbsp;&nbsp;
  14. <label id="selected_instruction"><?php if ($type == 2) { echo L('input_userid'); } else { echo L('choose_channel'); }?></label>
  15. <?php if ($type == 2) { echo form::select($ku6_channels, $sub['channelid'], 'name="sub[channelid]" id="channelid" style="display:none"', L('please_choose_channel')); } else {echo form::select($ku6_channels, $sub['channelid'], 'name="sub[channelid]" id="channelid"', L('please_choose_channel'));}?>
  16. <input type="text" id="userid" name="sub[userid]" <?php if($type == 1) { ?> style="display:none;" <?php }?>>
  17. <label id="return_result" style="display:none; color:red"></label>
  18. <?php echo L('subscribe_storage_section');?><?php echo $category_list;?>
  19. <?php echo L('subscribe_postions');?><span id="posid"></span>
  20. <input type="submit" value=" <?php echo L('add');?> " class="button" id="add_sub" name="dosubmit">
  21. </div>
  22. </form>
  23. <table width="100%" cellspacing="0">
  24. <thead>
  25. <tr>
  26. <th width="6%">ID</th>
  27. <th id="change_instruction"><?php if ($type == 1) { echo L('channel'); } else { echo L('instruction_usersub'); }?></th>
  28. <th width="26%"><?php echo L('storage_cat');?></th>
  29. <th width="26%"><?php echo L('storage_pos');?></th>
  30. <th width="10%"><?php echo L('operations_manage')?></th>
  31. </tr>
  32. </thead>
  33. <tbody id="channel_sub_list" <?php if($type == 2) { ?> style="display:none;" <?php }?>>
  34. <?php
  35. if(is_array($subscribes)){
  36. foreach($subscribes as $info){
  37. ?>
  38. <tr>
  39. <td align="center"><?php echo $info['sid']?></td>
  40. <td align="center"><?php echo $info['channelid'];?> </td>
  41. <td align="center"><?php echo $CATEGORYS[$info['catid']]['catname'];?></td>
  42. <td align="center"><?php echo $position[$info['posid']]['name']?> </a>
  43. <td align="center">
  44. <a href="javascript:confirmurl('index.php?m=video&c=video&a=sub_del&id=<?php echo $info['sid']?>&meunid=<?php echo $_GET['menuid']?>&type=1', '是否删除?')"><?php echo L('delete');?></a></td>
  45. </tr>
  46. <?php
  47. }
  48. }
  49. ?>
  50. </tbody>
  51. <tbody id="user_sub_list" <?php if($type == 1) { ?> style="display:none;" <?php }?>>
  52. <?php
  53. if(is_array($usersubscribes)){
  54. foreach($usersubscribes as $val){
  55. ?>
  56. <tr>
  57. <td align="center"><?php echo $val['sid']?></td>
  58. <td align="center"><?php echo $val['sub_userid'];?> </td>
  59. <td align="center"><?php echo $CATEGORYS[$val['catid']]['catname'];?></td>
  60. <td align="center"><?php echo $position[$val['posid']]['name']?> </a>
  61. <td align="center">
  62. <a href="javascript:confirmurl('index.php?m=video&c=video&a=user_sub_del&id=<?php echo $val['sid']?>&meunid=<?php echo $_GET['menuid']?>&type=2', '是否删除?')"><?php echo L('delete');?></a></td>
  63. </tr>
  64. <?php
  65. }
  66. }
  67. ?>
  68. </tbody>
  69. </table>
  70. <div class="btn text-r">
  71. </div>
  72. <div id="pages"> <?php echo $pages?></div>
  73. </div>
  74. </div>
  75. </form>
  76. </body>
  77. </html>
  78. <script type="text/javascript">
  79. <!--
  80. $(document).ready(function(e) {
  81. $("#userid").blur( function() {
  82. var userid = $("#userid").val();
  83. if (userid == '') {
  84. alert('<?php echo L('please_input_userid')?>');
  85. return false;
  86. }
  87. var hash = '<?php echo $_GET['pc_hash']?>';
  88. $('#return_result').show();
  89. $('#return_result').html('<img src="<?php echo IMG_PATH.'msg_img/loading.gif';?>">');
  90. $.get("index.php", {m:'video', c:'video', a:'ajax_getuseridvideo', userid:userid , tm:Math.random(), pc_hash:hash}, function (data) {
  91. if (data == 1) {
  92. $('#return_result').css('color', '');
  93. $('#return_result').addClass("onCorrect");
  94. $('#return_result').html('<?php echo L('input_right')?>');
  95. $('#add_sub').removeAttr('disabled');
  96. } else if (data == 2) {
  97. $('#return_result').css('color', 'red');
  98. $('#return_result').removeClass("onCorrect");
  99. $('#return_result').html('<?php echo L('user_already_sub')?>');
  100. $('#add_sub').attr('disabled', 'true');
  101. } else if (data == 3) {
  102. $('#return_result').css('color', 'red');
  103. $('#return_result').removeClass("onCorrect");
  104. $('#return_result').html('<?php echo L('user_sub_nomore_than3')?>');
  105. $('#add_sub').attr('disabled', 'true');
  106. } else {
  107. $('#return_result').css('color', 'red');
  108. $('#return_result').removeClass("onCorrect");
  109. $('#return_result').html('<?php echo L('user_no_video')?>');
  110. $('#add_sub').attr('disabled', 'true');
  111. }
  112. } );
  113. });
  114. $('#choose_1').click(function(){
  115. $('#change_instruction').html('<?php echo L('channel');?>');
  116. $('#user_sub_list').hide();
  117. $('#channel_sub_list').show();
  118. $('#userid').val('');
  119. $('#sub_function').val('subscribe_list');
  120. $('#selected_instruction').html('<?php echo L('choose_channel');?>');
  121. $('#userid').hide();
  122. $('#channelid').show();
  123. });
  124. $('#choose_2').click(function(){
  125. $('#change_instruction').html('<?php echo L('instruction_usersub');?>');
  126. $('#channel_sub_list').hide();
  127. $('#user_sub_list').show();
  128. $('#sub_function').val('subscribe_uservideo');
  129. $('#selected_instruction').html('<?php echo L('input_userid');?>');
  130. $('#channelid').hide();
  131. $('#userid').show();
  132. });
  133. });
  134. function select_pos(obj) {
  135. var catid = obj.value;
  136. if (catid == 0) {
  137. return false;
  138. }
  139. var hash = '<?php echo $_GET['pc_hash']?>';
  140. $('#posid').html('<img src="<?php echo IMG_PATH.'msg_img/loading.gif';?>">');
  141. $.get("index.php", {m:'video', c:'video', a:'public_get_pos', catid:catid, tm:Math.random(), pc_hash:hash}, function (data) {
  142. if (data) {
  143. $('#posid').html(data);
  144. } else {
  145. alert('<?php echo L('check_choose_cat')?>');
  146. }
  147. } );
  148. }
  149. $('#searchform').submit(function (){
  150. if ($('#channelid').val()=='' && $('#userid').val()=='') {
  151. alert('<?php echo L('check_choose_cha_');?>');
  152. return false;
  153. }
  154. if ($('#catid').val()=='') {
  155. alert('<?php echo L('check_choose_cat_');?>');
  156. return false;
  157. }
  158. return true;
  159. });
  160. //-->
  161. </script>