国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
3.7KB

  1. <?php
  2. /**
  3. * 自由列表管理
  4. *
  5. * @version $Id: freelist_main.php 1 8:48 2010年7月13日Z tianya $
  6. * @package DedeBIZ.Administrator
  7. * @copyright Copyright (c) 2020, DedeBIZ.COM
  8. * @license https://www.dedebiz.com/license
  9. * @link https://www.dedebiz.com
  10. */
  11. require_once(dirname(__FILE__)."/config.php");
  12. CheckPurview('c_FreeList');
  13. require_once DEDEINC.'/channelunit.func.php';
  14. setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/");
  15. if(empty($pagesize)) $pagesize = 18;
  16. if(empty($pageno)) $pageno = 1;
  17. if(empty($dopost)) $dopost = '';
  18. if(empty($orderby)) $orderby = 'aid';
  19. if(empty($keyword))
  20. {
  21. $keyword = '';
  22. $addget = '';
  23. $addsql = '';
  24. } else
  25. {
  26. $addget = '&keyword='.urlencode($keyword);
  27. $addsql = " where title like '%$keyword%' ";
  28. }
  29. //重载列表
  30. if($dopost=='getlist')
  31. {
  32. AjaxHead();
  33. GetTagList($dsql,$pageno,$pagesize,$orderby);
  34. exit();
  35. }
  36. //删除字段
  37. else if($dopost=='del')
  38. {
  39. $aid = preg_replace("#[^0-9]#", "", $aid);
  40. $dsql->ExecuteNoneQuery("DELETE FROM `#@__freelist` WHERE aid='$aid'; ");
  41. AjaxHead();
  42. GetTagList($dsql,$pageno,$pagesize,$orderby);
  43. exit();
  44. }
  45. //第一次进入这个页面
  46. if($dopost=='')
  47. {
  48. $row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__freelist` $addsql ");
  49. $totalRow = $row['dd'];
  50. include(DEDEADMIN."/templets/freelist_main.htm");
  51. }
  52. /**
  53. * 获得特定的Tag列表
  54. *
  55. * @param object $dsql
  56. * @param int $pageno
  57. * @param int $pagesize
  58. * @param string $orderby
  59. */
  60. function GetTagList($dsql,$pageno,$pagesize,$orderby='aid')
  61. {
  62. global $cfg_phpurl,$addsql;
  63. $start = ($pageno-1) * $pagesize;
  64. $printhead ="<table width='98%' border='0' cellpadding='1' cellspacing='1' align='center' class='table maintable table-bordered' style='background:#cfcfcf;margin-bottom:5px;'>
  65. <tr align='center' bgcolor='#FBFCE2'>
  66. <td width='5%' class='tbsname'><a href='#' onclick=\"ReloadPage('aid')\"><u>ID</u></a></td>
  67. <td width='20%' class='tbsname'>列表名称</td>
  68. <td width='20%' class='tbsname'>模板文件</td>
  69. <td width='5%' class='tbsname'><a href='#' onclick=\"ReloadPage('click')\"><u>点击</u></a></td>
  70. <td width='15%' class='tbsname'>创建时间</td>
  71. <td class='tbsname'>管理</td>
  72. </tr>\r\n";
  73. echo $printhead;
  74. $dsql->SetQuery("Select aid,title,templet,click,edtime,namerule,listdir,defaultpage,nodefault From #@__freelist $addsql order by $orderby desc limit $start,$pagesize ");
  75. $dsql->Execute();
  76. while($row = $dsql->GetArray())
  77. {
  78. $listurl = GetFreeListUrl($row['aid'],$row['namerule'],$row['listdir'],$row['defaultpage'],$row['nodefault']);
  79. $line = "
  80. <tr align='center' bgcolor='#FFFFFF' onMouseMove=\"javascript:this.bgColor='#FCFDEE';\" onMouseOut=\"javascript:this.bgColor='#FFFFFF';\">
  81. <td>{$row['aid']}</td>
  82. <td> <a href='$listurl' target='_blank'>{$row['title']}</a> </td>
  83. <td> {$row['templet']} </td>
  84. <td> {$row['click']} </td>
  85. <td>".MyDate("y-m-d",$row['edtime'])."</td>
  86. <td> <a href='#' onclick='EditNote({$row['aid']})' class='btn btn-secondary btn-sm'> <i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> 更改</a>
  87. <a href='#' onclick='CreateNote({$row['aid']})' class='btn btn-secondary btn-sm'> <i class=\"fa fa-refresh\" aria-hidden=\"true\"></i> 更新</a>
  88. <a href='#' onclick='DelNote({$row['aid']})' class='btn btn-secondary btn-sm'> <i class=\"fa fa-trash\" aria-hidden=\"true\"></i> 删除</a>
  89. </td>
  90. </tr>";
  91. echo $line;
  92. }
  93. echo "</table>\r\n";
  94. }