国内流行的内容管理系统(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.

260 lines
10KB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="<?php echo $cfg_soft_lang; ?>">
  5. <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
  6. <title>增加广告</title>
  7. <link rel="stylesheet" href="../static/web/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="../static/web/font/css/font-awesome.min.css">
  9. <link rel="stylesheet" href="../static/web/css/admin.css">
  10. <link rel="stylesheet" href="../static/web/css/daterangepicker.css">
  11. <script src="../static/web/js/jquery.min.js"></script>
  12. <script src="../static/web/js/moment.min.js"></script>
  13. <script src="../static/web/js/daterangepicker.js"></script>
  14. <script>
  15. function checkSubmit() {
  16. if (document.form1.tagname.value == "") {
  17. alert("广告标识不能为空");
  18. document.form1.tagname.focus();
  19. return false;
  20. }
  21. }
  22. $(document).ready(function () {
  23. $('.datepicker').daterangepicker({
  24. "singleDatePicker": true,
  25. "autoApply": true,
  26. "showDropdowns": true,
  27. "linkedCalendars": false,
  28. "timePicker": true,
  29. "timePicker24Hour": true,
  30. //"timePickerSeconds": true,
  31. "showCustomRangeLabel": false,
  32. ranges: {
  33. '今日': [moment(), moment()],
  34. '昨日': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  35. '本月': [moment().startOf('month'), moment().startOf('month')],
  36. '上月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').startOf('month')]
  37. },
  38. "locale": {
  39. format: 'YYYY-MM-DD HH:mm',
  40. applyLabel: '确定',
  41. cancelLabel: '取消',
  42. daysOfWeek: ['日', '一', '二', '三', '四', '五', '六'],
  43. monthNames: ['一月', '二月', '三月', '四月', '五月', '六月',
  44. '七月', '八月', '九月', '十月', '十一月', '十二月'],
  45. firstDay: 1
  46. }
  47. }, function (start) {
  48. $(this).val(start.format("YYYY-MM-DD HH:mm"));
  49. });
  50. })
  51. </script>
  52. <style>
  53. .typetab {
  54. text-align: left;
  55. }
  56. .typetab ul {
  57. list-style: none;
  58. }
  59. .typetab ul li {
  60. float: left;
  61. margin: 5px 5px 0px;
  62. width: 64px;
  63. height: 26px;
  64. line-height: 26px;
  65. background: url(../static/web/img/adtype_link.gif) no-repeat scroll 0px 0px;
  66. text-align: center;
  67. cursor: pointer;
  68. }
  69. .typetab ul .act {
  70. background: url(../static/web/img/adtype_act.gif) no-repeat scroll 0px 0px;
  71. }
  72. .i_table {
  73. border: 1px solid #eee;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <form action="ad_add.php" method="post" name="form1" onSubmit="return checkSubmit()">
  79. <table width="98%" cellpadding="3" cellspacing="1" align="center" class="table maintable mt-3 mb-3">
  80. <tr>
  81. <td height="26" background="../static/web/img/tbg.gif" style="padding-left:10px"><a href="ad_main.php">广告管理</a> &gt; 增加广告位置</td>
  82. </tr>
  83. <tr>
  84. <td>
  85. <table width="100%" cellspacing="4" cellpadding="4" class="table table-borderless">
  86. <input name="normbody[style]" type="hidden" value="code" id="adstyle">
  87. <input type="hidden" name="_csrf_token" value="<?php echo $GLOBALS['csrf_token']; ?>">
  88. <input type='hidden' name='dopost' value='save'>
  89. <tr>
  90. <td height="26" colspan="3">广告代码的调用方法:{dede:myad name='广告位标识'/} </td>
  91. </tr>
  92. <tr>
  93. <td height="26">广告位标识:</td>
  94. <td colspan="2"><input name="tagname" type="text" id="tagname" class="iptxt" style="width:260px">(使用英文或数字表示的简洁标识)</td>
  95. </tr>
  96. <tr>
  97. <td height="26">广告分类:</td>
  98. <td colspan="2">
  99. <select name='clsid' id="clsid" style='width:160px'>
  100. <option value='0'>默认分类</option>
  101. <?php echo $option; ?>
  102. </select>
  103. </td>
  104. </tr>
  105. <tr>
  106. <td height="26">广告投放范围:</td>
  107. <td colspan="2"><?php
  108. $tl = new TypeLink(0);
  109. $typeOptions = $tl->GetOptionArray(0,0,0);
  110. echo "<select name='typeid' style='width:160px'>";
  111. echo "<option value='0' selected>投放在没有同名标识的所有栏目</option>";
  112. echo $typeOptions;
  113. echo "</select>";
  114. ?>
  115. <br>
  116. (如果在所选栏目找不到指定标识的广告内容,系统会自动搜索父栏目)</td>
  117. </tr>
  118. <tr>
  119. <td height="26">广告位名称:</td>
  120. <td colspan="2"><input name="adname" type="text" id="adname" class="iptxt" style="width:260px"></td>
  121. </tr>
  122. <tr>
  123. <td height="26">时间限制:</td>
  124. <td colspan="2">
  125. <input name="timeset" type="radio" class="np" value="0" checked='1' id="notimelimit">
  126. <label for="notimelimit">永不过期</label>
  127. <input type="radio" name="timeset" class="np" value="1" id="timelimit">
  128. <label for="timelimit">在设内时间内有效</label>
  129. </td>
  130. </tr>
  131. <tr>
  132. <td height="26">投放时间:</td>
  133. <td colspan="2">从
  134. <input name="starttime" type="text" id="starttime" value="<?php echo $startDay?>" class='iptxt datepicker' style="width:160px">
  135. <input name="endtime" type="text" id="endtime" value="<?php echo $endDay?>" class='iptxt datepicker' style="width:160px">
  136. </td>
  137. </tr>
  138. <tr>
  139. <td height="80">广告内容:</td>
  140. <td width="70%">
  141. <div class="typetab">
  142. <ul id="changeTab">
  143. <li id="t_code" class="act">代码</li>
  144. <li id="t_txt">文字</li>
  145. <li id="t_img">图片</li>
  146. <li id="t_flash">Flash</li>
  147. </ul>
  148. <div style="clear:both"></div>
  149. </div>
  150. <div id='advert'></div>
  151. </td>
  152. <td width="10%"></td>
  153. </tr>
  154. <tr>
  155. <td height="80">过期显示内容:</td>
  156. <td><textarea name="expbody" rows="10" id="expbody" style="width:80%;height:100px"></textarea></td>
  157. <td></td>
  158. </tr>
  159. <tr>
  160. <td colspan="3" align="center" class="py-3"><button type="submit" class="btn btn-success btn-sm">保存</button></td>
  161. </tr>
  162. </table>
  163. </td>
  164. </tr>
  165. </table>
  166. </form>
  167. <div style="display:none" id="formtxt">
  168. <div class="content" id="code" style="display:none">
  169. <table width="80%" cellpadding="3" cellspacing="1" class="i_table">
  170. <tr class="b">
  171. <td width="260">广告代码:<br>
  172. 请填写广告代码,支持html代码</td>
  173. <td><textarea name="normbody[htmlcode]" style="width:380px;height:100px"></textarea></td>
  174. </tr>
  175. </table>
  176. </div>
  177. <div class="content" id="txt" style="display:none">
  178. <table width="80%" cellpadding=3 cellspacing=1 class='i_table'>
  179. <tr>
  180. <td class="b" width="260">文字内容 *</td>
  181. <td class="b"><input type="text" name="normbody[title]" value="" class="iptxt" style="width:360px"></td>
  182. </tr>
  183. <tr>
  184. <td class="b">文字链接 *</td>
  185. <td class="b"><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  186. </tr>
  187. <tr>
  188. <td class="b">文字颜色</td>
  189. <td class="b"><input type="text" name="normbody[color]" value="" class="iptxt" style="width:360px"></td>
  190. </tr>
  191. <tr>
  192. <td class="b">文字大小</td>
  193. <td class="b"><input type="text" name="normbody[size]" value="" class="iptxt" style="width:360px"></td>
  194. </tr>
  195. </table>
  196. </div>
  197. <div class="content" id="img" style="display:none">
  198. <table width="80%" cellpadding=3 cellspacing=1 class='i_table'>
  199. <tr>
  200. <td class="b" width="260">图片地址 *</td>
  201. <td class="b"><input type="text" name="normbody[url]" value="" class="iptxt" style="width:360px"></td>
  202. </tr>
  203. <tr>
  204. <td class="b">图片链接 *</td>
  205. <td class="b"><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  206. </tr>
  207. <tr>
  208. <td class="b">图片宽度</td>
  209. <td class="b"><input type="text" name="normbody[width]" value="" class="iptxt" style="width:360px"></td>
  210. </tr>
  211. <tr>
  212. <td class="b">图片高度</td>
  213. <td class="b"><input type="text" name="normbody[height]" value="" class="iptxt" style="width:360px"></td>
  214. </tr>
  215. <tr>
  216. <td class="b">图片描述</td>
  217. <td class="b"><input type="text" name="normbody[descrip]" value="" class="iptxt" style="width:360px"></td>
  218. </tr>
  219. </table>
  220. </div>
  221. <div class="content" id="flash" style="display:none">
  222. <table width="80%" cellpadding=3 cellspacing=1 class='i_table'>
  223. <tr>
  224. <td class="b" width="260">flash链接</td>
  225. <td class="b"><input type="text" name="normbody[link]" value="" class="iptxt" style="width:360px"></td>
  226. </tr>
  227. <tr>
  228. <td class="b">flash宽度</td>
  229. <td class="b"><input type="text" name="normbody[width]" value="" class="iptxt" style="width:360px"></td>
  230. </tr>
  231. <tr>
  232. <td class="b">flash高度</td>
  233. <td class="b"><input type="text" name="normbody[height]" value="" class="iptxt" style="width:360px"></td>
  234. </tr>
  235. </table>
  236. </div>
  237. </div>
  238. <script>
  239. (function ($) {
  240. function showcode(idName) {
  241. $("#advert").html("").html($("#formtxt>#" + idName).html());
  242. $("#adstyle").val(idName);
  243. }
  244. showcode('code');
  245. $("#changeTab>li").click(function () {
  246. var tabLi = $(this);
  247. var thistab = tabLi[0].id;
  248. $(".content").each(function () {
  249. if ("t_" + $(this)[0].id == thistab) {
  250. $("#changeTab>li").removeClass("act");
  251. $("#t_" + $(this)[0].id).addClass("act");
  252. showcode($(this)[0].id);
  253. }
  254. })
  255. })
  256. })(jQuery);
  257. </script>
  258. </body>
  259. </html>