message.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <?php
  2. // by 请勿倒卖,已申请软著,否则追究法律责任
  3. namespace app\index;
  4. class message extends BaseUser
  5. {
  6. function index()
  7. {
  8. if (is_numeric($this->action)) {
  9. return $this->detail($this->action);
  10. }
  11. $ext = SafeRequest("ext", "get");
  12. $keyword = SafeRequest("keyword", "get");
  13. $map = array();
  14. $map[] = array('type', '=', '2');
  15. $total = db('article')->where($map)->count();
  16. $num = 10;
  17. $cpage = isset($_GET['page']) ? $_GET['page'] : 1;
  18. $pagenum = ceil($total / $num);
  19. $offset = ($cpage - 1) * $num;
  20. $result = db('article')->where($map)->order('id desc')->limit($offset, $num)->select();
  21. $start = $offset + 1;
  22. $end = $cpage == $pagenum ? $total : $cpage * $num;
  23. $next = $cpage == $pagenum ? 0 : $cpage + 1;
  24. $prev = $cpage == 1 ? 0 : $cpage - 1;
  25. $rules = explode('|', '50M|100M|300M|600M|1G|1.5G|1.5G以上');
  26. $prices = json_decode(IN_POINTSRULE, true);
  27. $price_str = '收费标准:<br>0-';
  28. foreach ($rules as $k => $v) {
  29. if ($k > 5) {
  30. $price_str .= '<br>';
  31. }
  32. $price_str .= $v . '(' . $prices[$k] . '个)';
  33. if ($k < 5) {
  34. $price_str .= '<br>' . $rules[$k] . '-';
  35. }
  36. }
  37. $price_str .= "<br>CDN云存储" . IN_CDNPOINTS . "倍计费";
  38. ?> <!DOCTYPE html>
  39. <html lang="">
  40. <head>
  41. <meta charset="utf-8">
  42. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/>
  43. <meta name="keywords" content="<?php echo IN_KEYWORDS;?>"/>
  44. <meta name="description" content="<?php echo IN_DESCRIPTION;?>"/>
  45. <title>消息中心 - <?php echo IN_NAME;?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  46. <?php
  47. $this->static_();
  48. ?> <link rel="stylesheet" href="/static/pack/font-awesome-4.7.0/css/font-awesome.css"/>
  49. <script src="/static/index/js/bootstrap-paginator.js"></script>
  50. <style>
  51. .tl {
  52. text-align: left !important;
  53. }
  54. </style>
  55. </head>
  56. <body>
  57. <?php
  58. $this->header();
  59. ?> <div class="release-app-wrap">
  60. <div class="container">
  61. <div class="release-app2">
  62. <div class="crumbs">
  63. <a href="/index/message">消息中心</a>
  64. </div>
  65. <div class="row clearfix">
  66. <div class="col-sm-10" style="width: 100%;">
  67. <div class="aside-right">
  68. <div class="table-list-wrap">
  69. <div class="table-list">
  70. <div class="app-table-wrap">
  71. <div class="table-wrap">
  72. <?php
  73. if ($total) {
  74. ?> <div class="table-responsive">
  75. <table class="table app-table">
  76. <tr>
  77. <th></th>
  78. <th class="tl" style="padding-left: 10px;">
  79. 标题
  80. </th>
  81. <th>
  82. 时间
  83. </th>
  84. </tr>
  85. <?php
  86. foreach ($result as $key => $value) {
  87. ?><tr><td></td>
  88. <td class="tl"><a href="/index/message/<?php echo $value['id'];?>"><?php echo $value['name'];?></a></td>
  89. <td><?php echo date('Y-m-d H:i:s', $value['create_time'] ?: time());?></td>
  90. </tr><?php
  91. }
  92. ?> </table>
  93. </div>
  94. <?php
  95. } else {
  96. ?><div class="no-app text-center">
  97. <div class="mt60 small">
  98. <img src="/static/index/image/icon-19.png">
  99. </div>
  100. <div class="color-333 mt20">
  101. 暂无内容
  102. </div>
  103. </div><?php
  104. }
  105. ?> </div>
  106. <?php
  107. if ($pagenum != 1) {
  108. ?> <?php
  109. if ($total !== 0) {
  110. ?> <div style="text-align: center"><ul id="pager" class="pagination"><li><a>共<b><?php echo $total;?></b>个应用</b> <?php echo $cpage;?>/<?php echo $pagenum;?></a></li><?php
  111. if ($cpage == 1) {
  112. ?><li class='active'><a>首页</a></li><?php
  113. } else {
  114. ?><li><a href='?page=1&ext=<?php echo $ext;?>&keyword=<?php echo $keyword;?>'>首页</a></li><?php
  115. }
  116. if ($prev) {
  117. ?><li><a href='?page=<?php echo $prev;?>&ext=<?php echo $ext;?>&keyword=<?php echo $keyword;?>'>上一页</a></li><?php
  118. } else {
  119. }
  120. if ($next) {
  121. ?><li><a href='?page=<?php echo $next;?>&ext=<?php echo $ext;?>&keyword=<?php echo $keyword;?>'>下一页</a></li><?php
  122. } else {
  123. }
  124. if ($cpage == $pagenum) {
  125. ?><li class='active'><a>尾页</a></li><?php
  126. } else {
  127. ?><li><a href='?page=<?php echo $pagenum;?>&ext=<?php echo $ext;?>&keyword=<?php echo $keyword;?>'>尾页</a></li><?php
  128. }
  129. ?></ul></div> <?php
  130. }
  131. ?> <?php
  132. }
  133. ?> </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. <?php
  143. $this->inc_merge();
  144. ?> <script src="/static/pack/layer/layer.js"></script>
  145. <script>
  146. $('.icon-search').click(function () {
  147. var keyword = $('#keyword').val();
  148. if (keyword) {
  149. window.location.href = "/index/apps/apps?ext=<?php echo $ext;?>&keyword=" + $('#keyword').val();
  150. }
  151. });
  152. $(".app_device li").on('click', function () {
  153. ext = $(this).data('system');
  154. window.location.href = "/index/apps/apps?keyword=<?php echo $keyword;?>&ext=" + ext;
  155. });
  156. $('#keyword').bind('keyup', function (event) {
  157. if (event.keyCode == "13") {
  158. //回车执行查询
  159. $('.icon-search').click();
  160. }
  161. });
  162. $(".delete-app").click(function () {
  163. var appId = $(this).attr("app_id");
  164. alert('此操作会使应用失效,你确定要删除该app吗?', function () {
  165. $.post('/index/webview_log/del', {id: appId}, function (data) {
  166. if (data.code == 200) {
  167. window.location.reload();
  168. } else {
  169. alert('删除失败');
  170. }
  171. }, 'json')
  172. }, function () {
  173. }, 'center', '确定', '取消');
  174. });
  175. <?php
  176. if (IN_VERIFY == 1 && $this->user['in_verify'] != 1) {
  177. ?> Modal.templateModal({
  178. imgName: "modal-bg-2.jpg",
  179. title1: '提示',
  180. title2: '账户尚未实名,请尽快操作实名认证',
  181. p: '建议您:<br>尽快登录<?php echo IN_NAME;?>网站,点击右上角未实名认证,进行认证。<br>未实名认证,不能上传应用。',
  182. align: 'left', // 居左 left, 居中 center, 居右 right
  183. btnText: '知道了',
  184. btnClass: "modal-btn1"
  185. });
  186. <?php
  187. }
  188. ?> </script>
  189. <?php
  190. $this->footer();
  191. ?> </body>
  192. </html>
  193. <?php
  194. }
  195. function detail($id = 0)
  196. {
  197. $id = SafeRequest("id", "get") ?: $id;
  198. $data = db('article')->where('id', $id)->find();
  199. ?> <!DOCTYPE html>
  200. <html lang="">
  201. <head>
  202. <meta charset="utf-8">
  203. <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"/>
  204. <meta name="keywords" content="<?php echo IN_KEYWORDS;?>"/>
  205. <meta name="description" content="<?php echo IN_DESCRIPTION;?>"/>
  206. <title><?php echo $data['name'];?> - <?php echo IN_NAME;?> - 免费应用内测托管平台|iOS应用Beta测试分发|Android应用内测分发</title>
  207. <?php
  208. $this->static_();
  209. ?> <link rel="stylesheet" href="/static/pack/font-awesome-4.7.0/css/font-awesome.css"/>
  210. <script src="/static/index/js/bootstrap-paginator.js"></script>
  211. <style>
  212. .tl {
  213. text-align: left !important;
  214. }
  215. .article {
  216. padding: 20px;
  217. }
  218. .article > div {
  219. border: 1px solid #e5e5e5;
  220. }
  221. .title {
  222. padding: 10px 25px;
  223. border-bottom: 1px solid #eee8d5;
  224. }
  225. .title > span {
  226. font-size: 16px
  227. }
  228. .title > time {
  229. font-size: 12px;
  230. color: #999
  231. }
  232. .content {
  233. padding: 30px;
  234. }
  235. </style>
  236. </head>
  237. <body>
  238. <?php
  239. $this->header();
  240. ?> <div class="release-app-wrap">
  241. <div class="container">
  242. <div class="release-app2">
  243. <div class="crumbs">
  244. <a href="/index/message">消息中心</a><span>/</span><?php echo $data['name'];?> </div>
  245. <div class="article row clearfix" style="background: #fff;">
  246. <div>
  247. <h3 class="title">
  248. <a href="javascript:;" onclick="history.go(-1)"><i class="iconfont icon-000"></i></a>
  249. <span><?php echo $data['name'];?></span>
  250. <time><?php echo date('Y-m-d H:i:s', $data['create_time'] ?: time());?></time>
  251. </h3>
  252. <div class="content">
  253. <?php echo $data['content'];?> </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. <?php
  260. $this->footer();
  261. ?> </body>
  262. </html>
  263. <?php
  264. }
  265. }